sliccy 3.0.3 → 3.2.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.
Files changed (192) hide show
  1. package/README.md +1 -1
  2. package/dist/ui/assets/__vite-browser-external-B0Aozsa-.js +1 -0
  3. package/dist/ui/assets/adobe-CQkUqrZB.js +1 -0
  4. package/dist/ui/assets/adobe-TpBzqWxv.js +2 -0
  5. package/dist/ui/assets/agent-bridge-CUrfnLhB.js +1 -0
  6. package/dist/ui/assets/{agent-message-to-chat-BCltq66T.js → agent-message-to-chat-7ySe6LOC.js} +1 -1
  7. package/dist/ui/assets/{anthropic-CW4Fql_O.js → anthropic-BazfeP88.js} +2 -2
  8. package/dist/ui/assets/anthropic-DrIv-Sj8.js +39 -0
  9. package/dist/ui/assets/azure-openai-D57g94Od.js +1 -0
  10. package/dist/ui/assets/azure-openai-responses-DGiPDuLb.js +1 -0
  11. package/dist/ui/assets/azure-openai-responses-DaFIsbip.js +1 -0
  12. package/dist/ui/assets/azure-openai-syGxMed8.js +1 -0
  13. package/dist/ui/assets/{bsh-watchdog-0KPLx0BS.js → bsh-watchdog-Cy1Phycv.js} +1 -1
  14. package/dist/ui/assets/{cdp-CDF6RoDF.js → cdp-C7-GqDX7.js} +4 -4
  15. package/dist/ui/assets/cost-command-D4966sTV.js +1 -0
  16. package/dist/ui/assets/{dist-N8xNrrAa.js → dist-BTGs16AV.js} +1 -1
  17. package/dist/ui/assets/{dist-C867mOPm.js → dist-BcBxL8nL.js} +1 -1
  18. package/dist/ui/assets/{dist-VRuvLOER.js → dist-Bgcuvc8h.js} +1 -1
  19. package/dist/ui/assets/{dist-Dv2Nk_Uq.js → dist-EkY3RL7q.js} +1 -1
  20. package/dist/ui/assets/{dist-BT9E_vUE.js → dist-cK1g1pHF.js} +1 -1
  21. package/dist/ui/assets/{es-CbCfYSmQ.js → es-BBFipyo7.js} +5 -5
  22. package/dist/ui/assets/follower-sprinkle-bridge-Bvk6d5Lt.js +1 -0
  23. package/dist/ui/assets/github-C7iB6IW8.js +1 -0
  24. package/dist/ui/assets/github-D9o07OM2.js +2 -0
  25. package/dist/ui/assets/google-BViJaPNs.js +1 -0
  26. package/dist/ui/assets/google-BqPFk_Hy.js +1 -0
  27. package/dist/ui/assets/{google-shared-D_qkojxq.js → google-shared-BSWPDQyC.js} +3 -3
  28. package/dist/ui/assets/google-shared-DB5TYWXI.js +11 -0
  29. package/dist/ui/assets/google-vertex-BxSo3Ndm.js +1 -0
  30. package/dist/ui/assets/google-vertex-CezozIAv.js +1 -0
  31. package/dist/ui/assets/index-A_yObWaU.js +1574 -0
  32. package/dist/ui/assets/index-BeHZmqLr.css +1 -0
  33. package/dist/ui/assets/intercepted-oauth-D-GrdXf5.js +1 -0
  34. package/dist/ui/assets/kernel-worker-Du6Tb6XA.js +7651 -0
  35. package/dist/ui/assets/{local-llm-BOxOEv5D.js → local-llm-KIzd2XHf.js} +2 -2
  36. package/dist/ui/assets/magick-wasm-DfEA4h23.js +1 -0
  37. package/dist/ui/assets/{mistral-BGhArSbR.js → mistral-B9W99mq4.js} +2 -2
  38. package/dist/ui/assets/{mistral-BjvHW1zm.js → mistral-DdhVmVmD.js} +2 -2
  39. package/dist/ui/assets/{nuke-command-D5unBYdb.js → nuke-command-Njj8xVqm.js} +1 -1
  40. package/dist/ui/assets/oauth-bootstrap-BIoZ-1iT.js +1 -0
  41. package/dist/ui/assets/oauth-service-DEV-lUfQ.js +1 -0
  42. package/dist/ui/assets/oauth-service-DvOjqu8g.js +1 -0
  43. package/dist/ui/assets/offscreen-client-BQT-86bJ.js +1 -0
  44. package/dist/ui/assets/onboarding-orchestrator-DG6gLseB.js +1 -0
  45. package/dist/ui/assets/openai-codex-responses-BEGQfxLc.js +7 -0
  46. package/dist/ui/assets/openai-codex-responses-DB3Vu7ed.js +7 -0
  47. package/dist/ui/assets/openai-completions-CGQBWCgH.js +5 -0
  48. package/dist/ui/assets/openai-responses-CtvH1M3o.js +1 -0
  49. package/dist/ui/assets/openai-responses-DN7LxPQE.js +1 -0
  50. package/dist/ui/assets/{openai-responses-shared-iv5WheAz.js → openai-responses-shared-CSGV3fZY.js} +3 -3
  51. package/dist/ui/assets/{openai-responses-shared-iYgA7Khl.js → openai-responses-shared-Dgs-mRZN.js} +4 -4
  52. package/dist/ui/assets/panel-rpc-handlers-CvD_7V3n.js +1 -0
  53. package/dist/ui/assets/{py-realm-worker-vbqFsiux.js → py-realm-worker-zrXeREDr.js} +1 -1
  54. package/dist/ui/assets/pyodide-Bv1KSh-_.js +3 -0
  55. package/dist/ui/assets/pyodide-DP-fllM-.js +3 -0
  56. package/dist/ui/assets/remote-terminal-view-DbubM0iY.js +6 -0
  57. package/dist/ui/assets/secret-env-YKWt497t.js +1 -0
  58. package/dist/ui/assets/slicc-editor-DYDRVURI.js +12 -0
  59. package/dist/ui/assets/{spawn-DfNLdcnW.js → spawn-9oH05Sa3.js} +1 -1
  60. package/dist/ui/assets/{sql-wasm-DZVUCGLK.js → sql-wasm-CpKN22NN.js} +2 -2
  61. package/dist/ui/assets/upgrade-detection-oR3blKyL.js +1 -0
  62. package/dist/ui/assets/xai-grok-CNhK84Kt.js +1 -0
  63. package/dist/ui/assets/xai-grok-qxlQfVDb.js +1 -0
  64. package/dist/ui/assets/{xai-grok-sanitize-DTcvIA0E.js → xai-grok-sanitize-BeI8rdV5.js} +1 -1
  65. package/dist/ui/assets/{xai-grok-sanitize-DsBfxZb8.js → xai-grok-sanitize-CiOn_xsO.js} +1 -1
  66. package/dist/ui/electron-overlay-entry.js +7 -7
  67. package/dist/ui/index.html +2 -21
  68. package/dist/ui/packages/webapp/index.html +2 -21
  69. package/package.json +3 -3
  70. package/dist/ui/assets/__vite-browser-external-CTFk2Lkt.js +0 -1
  71. package/dist/ui/assets/__vite-browser-external-CdaqDer8.js +0 -1
  72. package/dist/ui/assets/adobe-B80c3min.js +0 -2
  73. package/dist/ui/assets/adobe-CAH_NOLf.js +0 -1
  74. package/dist/ui/assets/agent-bridge-gA34hm1Z.js +0 -1
  75. package/dist/ui/assets/anthropic-4ASJTRhO.js +0 -39
  76. package/dist/ui/assets/azure-openai-B1aRebkL.js +0 -1
  77. package/dist/ui/assets/azure-openai-responses-C_KSa6jj.js +0 -1
  78. package/dist/ui/assets/azure-openai-responses-Ci2gkluO.js +0 -1
  79. package/dist/ui/assets/azure-openai-uOck_Bf9.js +0 -1
  80. package/dist/ui/assets/backend-local-BTd37iLF.js +0 -9
  81. package/dist/ui/assets/backend-local-CfhYopTE.js +0 -9
  82. package/dist/ui/assets/bedrock-camp-Bds6qFqf.js +0 -4
  83. package/dist/ui/assets/bedrock-camp-uPFt7YMZ.js +0 -5
  84. package/dist/ui/assets/chunk-Cn1BcAw8.js +0 -1
  85. package/dist/ui/assets/chunk-jRWAZmH_.js +0 -1
  86. package/dist/ui/assets/cost-command-Bc9LjZfl.js +0 -1
  87. package/dist/ui/assets/db-DPvmo9md.js +0 -1
  88. package/dist/ui/assets/diagnostics-Bab61WyO.js +0 -1
  89. package/dist/ui/assets/diagnostics-C5z6rwkV.js +0 -1
  90. package/dist/ui/assets/env-api-keys-BoL4zxcb.js +0 -1
  91. package/dist/ui/assets/env-api-keys-DEKGEdJy.js +0 -1
  92. package/dist/ui/assets/follower-sprinkle-bridge-D98CB4QW.js +0 -1
  93. package/dist/ui/assets/fs-Cf-IdW2x.js +0 -3
  94. package/dist/ui/assets/fs-bDRkGfEW.js +0 -4
  95. package/dist/ui/assets/git-config-CxvDN7N3.js +0 -7
  96. package/dist/ui/assets/github-CH73eM0a.js +0 -1
  97. package/dist/ui/assets/github-CXycVfPa.js +0 -2
  98. package/dist/ui/assets/github-copilot-headers-DPO4cOSI.js +0 -1
  99. package/dist/ui/assets/google-CBK_Mvyz.js +0 -1
  100. package/dist/ui/assets/google-gejI0Xd8.js +0 -1
  101. package/dist/ui/assets/google-shared-BB2MKu9Q.js +0 -11
  102. package/dist/ui/assets/google-vertex-tM5T-lH5.js +0 -1
  103. package/dist/ui/assets/google-vertex-wc4xtIz9.js +0 -1
  104. package/dist/ui/assets/headers-CGhBAvcc.js +0 -1
  105. package/dist/ui/assets/index-Bk_LVMna.js +0 -1422
  106. package/dist/ui/assets/index-eWuuouO-.css +0 -1
  107. package/dist/ui/assets/intercepted-oauth-CnYe4Pun.js +0 -1
  108. package/dist/ui/assets/json-parse-CKelIhmU.js +0 -3
  109. package/dist/ui/assets/json-parse-Cu2r6BfV.js +0 -3
  110. package/dist/ui/assets/kernel-worker-DgOE7S84.js +0 -7546
  111. package/dist/ui/assets/local-llm-xpXqSazD.js +0 -2
  112. package/dist/ui/assets/logger-B-No_qN_.js +0 -1
  113. package/dist/ui/assets/logger-BHrAkMIS.js +0 -1
  114. package/dist/ui/assets/magick-wasm-BMFWa7e1.js +0 -1
  115. package/dist/ui/assets/magick-wasm-D4Na_fL8.js +0 -1
  116. package/dist/ui/assets/mime-types-4JXpZe6p.js +0 -1
  117. package/dist/ui/assets/mime-types-DL940yDZ.js +0 -1
  118. package/dist/ui/assets/mount-B-d5niFK.js +0 -2
  119. package/dist/ui/assets/mount-BF7L2l0E.js +0 -1
  120. package/dist/ui/assets/mount-id-Ccy4_G8i.js +0 -1
  121. package/dist/ui/assets/mount-picker-popup-ys6_YNH0.js +0 -1
  122. package/dist/ui/assets/mount-table-store-BDnU4NqG.js +0 -1
  123. package/dist/ui/assets/oauth-bootstrap-Dwo48sgL.js +0 -1
  124. package/dist/ui/assets/oauth-service--O2P_cH3.js +0 -1
  125. package/dist/ui/assets/oauth-service-BXo87SGy.js +0 -1
  126. package/dist/ui/assets/offscreen-client-CogsU9xP.js +0 -1
  127. package/dist/ui/assets/onboarding-orchestrator-DkKjSNro.js +0 -1
  128. package/dist/ui/assets/openai-CQMTwQw3.js +0 -16
  129. package/dist/ui/assets/openai-codex-responses-BH7I3fcD.js +0 -7
  130. package/dist/ui/assets/openai-codex-responses-Box9MCzN.js +0 -7
  131. package/dist/ui/assets/openai-completions-BnShqSeR.js +0 -5
  132. package/dist/ui/assets/openai-completions-DmV2esrh.js +0 -5
  133. package/dist/ui/assets/openai-responses-Cp1E557G.js +0 -1
  134. package/dist/ui/assets/openai-responses-DOCxF9QM.js +0 -1
  135. package/dist/ui/assets/panel-rpc-DMFq2vU_.js +0 -1
  136. package/dist/ui/assets/panel-rpc-handlers-CKHTPsah.js +0 -1
  137. package/dist/ui/assets/panel-rpc-uLhnFoXD.js +0 -1
  138. package/dist/ui/assets/path-utils-C99GOg2c.js +0 -1
  139. package/dist/ui/assets/path-utils-CgbXfwyO.js +0 -1
  140. package/dist/ui/assets/preload-helper-ca-nBW7U.js +0 -1
  141. package/dist/ui/assets/provider-settings-BntkzQDt.js +0 -63
  142. package/dist/ui/assets/provider-settings-w0pFif0W.js +0 -28
  143. package/dist/ui/assets/providers-CTrcq-XG.js +0 -1
  144. package/dist/ui/assets/pyodide-DOGWuEal.js +0 -3
  145. package/dist/ui/assets/pyodide-DhfjhWo1.js +0 -3
  146. package/dist/ui/assets/remote-cache-Cd8CL8Mo.js +0 -1
  147. package/dist/ui/assets/remote-terminal-view-BD1tHNzj.js +0 -6
  148. package/dist/ui/assets/sanitize-unicode-DFrWoF2t.js +0 -1
  149. package/dist/ui/assets/secret-env-LcaaxgBy.js +0 -1
  150. package/dist/ui/assets/shared-AafAvJaI.js +0 -1
  151. package/dist/ui/assets/simple-options-CVJdKrCb.js +0 -1
  152. package/dist/ui/assets/simple-options-D8vGmEnp.js +0 -1
  153. package/dist/ui/assets/slicc-editor-CFqadznu.js +0 -12
  154. package/dist/ui/assets/sprinkle-renderer-sJJO5bqF.js +0 -112
  155. package/dist/ui/assets/telemetry-D728iVf5.js +0 -1
  156. package/dist/ui/assets/tool-ui-D9h6SJkp.js +0 -1
  157. package/dist/ui/assets/tool-ui-DaAXBPJY.js +0 -1
  158. package/dist/ui/assets/tray-follower-status-hrOEFANe.js +0 -1
  159. package/dist/ui/assets/upgrade-detection-B25rC3uA.js +0 -1
  160. package/dist/ui/assets/xai-grok-DTAnFIoT.js +0 -1
  161. package/dist/ui/assets/xai-grok-ZZg_1Erw.js +0 -1
  162. /package/dist/ui/assets/{active-transport-DjJ32qlA.js → active-transport-CfU1UxY6.js} +0 -0
  163. /package/dist/ui/assets/{active-transport-lYMG0Gv5.js → active-transport-DeSPCdTV.js} +0 -0
  164. /package/dist/ui/assets/{addon-fit-CBYO9uVb.js → addon-fit-BDUxDgg1.js} +0 -0
  165. /package/dist/ui/assets/{addon-fit-CTgRqR5i.js → addon-fit-Dkm5m5XK.js} +0 -0
  166. /package/dist/ui/assets/{azure-ai-foundry-DtrzZiwo.js → azure-ai-foundry-1pnZpxAJ.js} +0 -0
  167. /package/dist/ui/assets/{azure-ai-foundry--QIByvkN.js → azure-ai-foundry-k_w7vD5C.js} +0 -0
  168. /package/dist/ui/assets/{chat-fixture-t_1Cmb9j.js → chat-fixture-BNN19l1e.js} +0 -0
  169. /package/dist/ui/assets/{dist-B-Md2rjs.js → dist-BNe7ZIzA.js} +0 -0
  170. /package/dist/ui/assets/{dist-BXMOjFxx.js → dist-BYoCEWmq.js} +0 -0
  171. /package/dist/ui/assets/{dist-CZgcx_4U.js → dist-BrjVVq8c.js} +0 -0
  172. /package/dist/ui/assets/{git-config-DIdLP3yo.js → git-config-DFJqG7AS.js} +0 -0
  173. /package/dist/ui/assets/{github-copilot-headers-BKQV7zrp.js → github-copilot-headers-CTUP_cqn.js} +0 -0
  174. /package/dist/ui/assets/{hash-K0cSe8jy.js → hash-B9Dtr1VK.js} +0 -0
  175. /package/dist/ui/assets/{hash-ekRFATsu.js → hash-C3GX0Zuo.js} +0 -0
  176. /package/dist/ui/assets/{headers-C4jF_HTA.js → headers-AeYLn7L4.js} +0 -0
  177. /package/dist/ui/assets/{lick-manager-proxy-D4WRd8z3.js → lick-manager-proxy-DfectiMI.js} +0 -0
  178. /package/dist/ui/assets/{openai-DxnCgV1v.js → openai-Bf1npfRy.js} +0 -0
  179. /package/dist/ui/assets/{page-storage-sync-M2qhyuvc.js → page-storage-sync-BxtXNbwY.js} +0 -0
  180. /package/dist/ui/assets/{pdfjs-Cesr9Csk.js → pdfjs-DDDkZHZ4.js} +0 -0
  181. /package/dist/ui/assets/{rum-C0g6MAOC.js → rum-wVO4iYd-.js} +0 -0
  182. /package/dist/ui/assets/{sanitize-unicode-BA6bNBBh.js → sanitize-unicode-h0KEBmEw.js} +0 -0
  183. /package/dist/ui/assets/{sprinkle-bridge-channel-B_tegUwc.js → sprinkle-bridge-channel-BBxRgvga.js} +0 -0
  184. /package/dist/ui/assets/{sprinkle-bridge-channel-C2blpBXT.js → sprinkle-bridge-channel-no1Jz9ii.js} +0 -0
  185. /package/dist/ui/assets/{sprinkle-proxy-CgcbIA81.js → sprinkle-proxy-rF3NSOGq.js} +0 -0
  186. /package/dist/ui/assets/{src-lJxZtwWF.js → src-BQRb5emh.js} +0 -0
  187. /package/dist/ui/assets/{xai-grok-errors-DGVLpB4k.js → xai-grok-errors-CGcnoVae.js} +0 -0
  188. /package/dist/ui/assets/{xai-grok-errors-B7OqxH_0.js → xai-grok-errors-WbFsMZum.js} +0 -0
  189. /package/dist/ui/assets/{xai-grok-models-DGbQVjGO.js → xai-grok-models-0q2zveAT.js} +0 -0
  190. /package/dist/ui/assets/{xai-grok-models-0CbvNCeN.js → xai-grok-models-cvcIXmNM.js} +0 -0
  191. /package/dist/ui/assets/{xterm-CguO-Jtb.js → xterm-D8ldLLKi.js} +0 -0
  192. /package/dist/ui/assets/{xterm-BcRgm-P0.js → xterm-DhusGoAm.js} +0 -0
@@ -0,0 +1 @@
1
+ import{N as e,P as t,_ as n,j as r,o as i}from"./kernel-worker-Du6Tb6XA.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-BSWPDQyC.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 r;return(async()=>{let r={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:r});let m=null,g=r.content,_=()=>g.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:g.length-1,content:m.text,partial:r}):a.push({type:`thinking_end`,contentIndex:_(),content:m.thinking,partial:r})),t?(m={type:`thinking`,thinking:``,thinkingSignature:void 0},r.content.push(m),a.push({type:`thinking_start`,contentIndex:_(),partial:r})):(m={type:`text`,text:``},r.content.push(m),a.push({type:`text_start`,contentIndex:_(),partial:r}))),m.type===`thinking`?(m.thinking+=e.text,m.thinkingSignature=u(m.thinkingSignature,e.thoughtSignature),a.push({type:`thinking_delta`,contentIndex:_(),delta:e.text,partial:r})):(m.text+=e.text,m.textSignature=u(m.textSignature,e.thoughtSignature),a.push({type:`text_delta`,contentIndex:_(),delta:e.text,partial:r}))}if(e.functionCall){m&&=(m.type===`text`?a.push({type:`text_end`,contentIndex:_(),content:m.text,partial:r}):a.push({type:`thinking_end`,contentIndex:_(),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()}_${++h}`:t,name:e.functionCall.name||``,arguments:e.functionCall.args??{},...e.thoughtSignature&&{thoughtSignature:e.thoughtSignature}};r.content.push(n),a.push({type:`toolcall_start`,contentIndex:_(),partial:r}),a.push({type:`toolcall_delta`,contentIndex:_(),delta:JSON.stringify(n.arguments),partial:r}),a.push({type:`toolcall_end`,contentIndex:_(),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}},e(t,r.usage))}if(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:_(),content:m.text,partial:r}):a.push({type:`thinking_end`,contentIndex:_(),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},_=(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};
@@ -0,0 +1 @@
1
+ import{F as e,L as t,R as n,_ as r}from"./index-A_yObWaU.js";import{t as i}from"./sanitize-unicode-h0KEBmEw.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-DB5TYWXI.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 e;return(async()=>{let e={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:e});let m=null,h=e.content,g=()=>h.length-1;for await(let r of p){e.responseId||=r.responseId;let i=r.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`)),r.usageMetadata&&(e.usage={input:(r.usageMetadata.promptTokenCount||0)-(r.usageMetadata.cachedContentTokenCount||0),output:(r.usageMetadata.candidatesTokenCount||0)+(r.usageMetadata.thoughtsTokenCount||0),cacheRead:r.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,totalTokens:r.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},t(n,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,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};