sliccy 6.78.1 → 6.78.3

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 (169) hide show
  1. package/dist/node-server/cloud-status.d.ts +9 -0
  2. package/dist/node-server/cloud-status.js +9 -1
  3. package/dist/ui/.vite/manifest.json +215 -227
  4. package/dist/ui/assets/{account-store-DFPhEmuH.js → account-store-Bwe7JMH-.js} +1 -1
  5. package/dist/ui/assets/{account-store-CqA9SSU8.js → account-store-Ch65aCFb.js} +1 -1
  6. package/dist/ui/assets/{adobe-DxnLH0tB.js → adobe-Bz9Td5du.js} +1 -1
  7. package/dist/ui/assets/{adobe-C9LIkjuB.js → adobe-DsgfMMl7.js} +1 -1
  8. package/dist/ui/assets/anthropic-messages-BX4DpK10.js +39 -0
  9. package/dist/ui/assets/anthropic-messages-C-orWG7m.js +39 -0
  10. package/dist/ui/assets/{apply-layout-Ba_t-LU-.js → apply-layout-CFIXh5fS.js} +1 -1
  11. package/dist/ui/assets/{apps-yLGS328q.js → apps-Cs8oR4Lg.js} +1 -1
  12. package/dist/ui/assets/azure-openai-Cm4-SPmb.js +18 -0
  13. package/dist/ui/assets/azure-openai-V4ydKR70.js +18 -0
  14. package/dist/ui/assets/{azure-openai-responses-eJTO6o5G.js → azure-openai-responses-C2LleG-4.js} +1 -1
  15. package/dist/ui/assets/{azure-openai-responses-qqQXNCHy.js → azure-openai-responses-Df9YPxyp.js} +1 -1
  16. package/dist/ui/assets/bedrock-camp-B0KF_4RS.js +1 -0
  17. package/dist/ui/assets/bedrock-camp-qpZqnqLa.js +2 -0
  18. package/dist/ui/assets/{browser-BAL8RehA.js → browser-2rCVqcqy.js} +1 -1
  19. package/dist/ui/assets/{cerebras-CO_bCsX2.js → cerebras-C51m3zHq.js} +1 -1
  20. package/dist/ui/assets/{cerebras-Bjmz0nDq.js → cerebras-Cr72hzB7.js} +1 -1
  21. package/dist/ui/assets/{connect-surface-CKT9YR66.js → connect-surface-BgLFvMBr.js} +1 -1
  22. package/dist/ui/assets/constrained-sampling-BNmnoM-i.js +1 -0
  23. package/dist/ui/assets/constrained-sampling-Zzx2ko9x.js +1 -0
  24. package/dist/ui/assets/dist-DTAqvnM4.js +18 -0
  25. package/dist/ui/assets/{ensure-speech-assets-DDGWBTuw.js → ensure-speech-assets-DvFwJX-M.js} +1 -1
  26. package/dist/ui/assets/es-BDNIRkLU.js +51 -0
  27. package/dist/ui/assets/esptool-operations-BmdosN6N.js +13 -0
  28. package/dist/ui/assets/{esptool-operations-CDJhOTdU.js → esptool-operations-CbgLIJzi.js} +4 -4
  29. package/dist/ui/assets/{fs-BGYdXvQe.js → fs-CHduR_z-.js} +2 -2
  30. package/dist/ui/assets/{fs-BgcV7gMH.js → fs-CrXC-O2d.js} +1 -1
  31. package/dist/ui/assets/{github-CWDyelVA.js → github-BGfSga5-.js} +1 -1
  32. package/dist/ui/assets/{github-DigiqZkc.js → github-BIU4tpUD.js} +2 -2
  33. package/dist/ui/assets/{github-copilot-D3QxDFpn.js → github-copilot-D9Lwnwqf.js} +1 -1
  34. package/dist/ui/assets/{github-copilot-BUvhiBqo.js → github-copilot-DVH5IrYn.js} +1 -1
  35. package/dist/ui/assets/{github-install-J_iRe0Qn.js → github-install-BdNHZlYI.js} +1 -1
  36. package/dist/ui/assets/{github-zip-DA7KS0q8.js → github-zip-CpmjWt7A.js} +1 -1
  37. package/dist/ui/assets/google-generative-ai-C9uw7Zks.js +1 -0
  38. package/dist/ui/assets/google-generative-ai-DHBc1oKV.js +1 -0
  39. package/dist/ui/assets/google-shared-BMJ_JErv.js +11 -0
  40. package/dist/ui/assets/google-shared-YqcyR4cm.js +371 -0
  41. package/dist/ui/assets/google-vertex-BaT3InWy.js +1 -0
  42. package/dist/ui/assets/google-vertex-DX8CfGr6.js +1 -0
  43. package/dist/ui/assets/icons-ZLR7gmJ4.js +1 -0
  44. package/dist/ui/assets/{installer-CyaKvN2m.js → installer-DW4F27JY.js} +1 -1
  45. package/dist/ui/assets/{js-realm-worker-BnUM21eR.js → js-realm-worker-MY0pjZ9h.js} +4 -4
  46. package/dist/ui/assets/{kernel-worker-yw857ueT.js → kernel-worker-BKxUtfmY.js} +300 -300
  47. package/dist/ui/assets/{legacy-api-aliases-C2CCsk4u.js → legacy-api-aliases-CsTVszvY.js} +1 -1
  48. package/dist/ui/assets/{legacy-api-aliases-qI5FdR49.js → legacy-api-aliases-nSD9C16V.js} +1 -1
  49. package/dist/ui/assets/{local-llm-BGW1wtLE.js → local-llm-D1NRQkzz.js} +1 -1
  50. package/dist/ui/assets/{local-llm-COK65VbN.js → local-llm-HqLsF79p.js} +1 -1
  51. package/dist/ui/assets/{main-E8Y9fUEO.js → main-BAZcY8aY.js} +3 -3
  52. package/dist/ui/assets/mistral-conversations-BXo-tb0V.js +4 -0
  53. package/dist/ui/assets/mistral-conversations-Ck257tvp.js +4 -0
  54. package/dist/ui/assets/{mount-D8qNPn6f.js → mount-DG1bfETF.js} +2 -2
  55. package/dist/ui/assets/{mount-BRFa6t-4.js → mount-M6zAHrfJ.js} +1 -1
  56. package/dist/ui/assets/{mount-recovery-CHVRcxtq.js → mount-recovery-_TjykwtG.js} +1 -1
  57. package/dist/ui/assets/{new-session-BGczu0FG.js → new-session--SSmR5Ga.js} +2 -2
  58. package/dist/ui/assets/{oauth-bootstrap-4fK_96El.js → oauth-bootstrap-BsYaFcYA.js} +2 -2
  59. package/dist/ui/assets/openai-CjBvzZcB.js +17 -0
  60. package/dist/ui/assets/openai-ZcrxEOGB.js +17 -0
  61. package/dist/ui/assets/{openai-codex-C8wVJf5e.js → openai-codex-C5laLxy5.js} +1 -1
  62. package/dist/ui/assets/{openai-codex-B81Bro8k.js → openai-codex-ChaoxQtS.js} +1 -1
  63. package/dist/ui/assets/openai-codex-responses-BQzefg3i.js +7 -0
  64. package/dist/ui/assets/openai-codex-responses-JtcU5b3J.js +7 -0
  65. package/dist/ui/assets/openai-completions-D-HjYi8x.js +5 -0
  66. package/dist/ui/assets/openai-completions-QMfwfjiE.js +5 -0
  67. package/dist/ui/assets/openai-responses-BVHnEPuG.js +1 -0
  68. package/dist/ui/assets/openai-responses-Ca0oWhbv.js +1 -0
  69. package/dist/ui/assets/openai-responses-shared-DhnqxYC9.js +10 -0
  70. package/dist/ui/assets/openai-responses-shared-DxcsuzHF.js +10 -0
  71. package/dist/ui/assets/{openrouter-DNcyWZsw.js → openrouter-5bo3AK5r.js} +1 -1
  72. package/dist/ui/assets/{openrouter-BReb0eBy.js → openrouter-BglEF0gx.js} +1 -1
  73. package/dist/ui/assets/{openrouter-images-CeBDTy7a.js → openrouter-images-C93KT7V_.js} +1 -1
  74. package/dist/ui/assets/{openrouter-images-JzygwjVz.js → openrouter-images-CiM-JPBO.js} +1 -1
  75. package/dist/ui/assets/{openrouter-models-BVfLgK5R.js → openrouter-models-BhgPe74G.js} +1 -1
  76. package/dist/ui/assets/{openrouter-models-Ds9BfRxR.js → openrouter-models-DYeJmDu6.js} +1 -1
  77. package/dist/ui/assets/{openrouter-oauth-CdzR0HLG.js → openrouter-oauth-B_qwkZyM.js} +1 -1
  78. package/dist/ui/assets/{openrouter-oauth-DtQkXo85.js → openrouter-oauth-lWgqXvCt.js} +1 -1
  79. package/dist/ui/assets/openrouter.models-DEX-YTLI.js +1 -0
  80. package/dist/ui/assets/openrouter.models-gbjkpjE_.js +1 -0
  81. package/dist/ui/assets/{panel-rpc-handlers-B6g2obdo.js → panel-rpc-handlers-DOaYtEJ2.js} +2 -2
  82. package/dist/ui/assets/{panelize-shell-BZuH5tPw.js → panelize-shell-BiuM5F3-.js} +1 -1
  83. package/dist/ui/assets/pdfjs-BspLIDsM.js +100 -0
  84. package/dist/ui/assets/pi-user-agent-6Rm79QmC.js +1 -0
  85. package/dist/ui/assets/pi-user-agent-BlGZrXbX.js +1 -0
  86. package/dist/ui/assets/{provider-BnYcq1I8.js → provider-D5-Ws4A3.js} +1 -1
  87. package/dist/ui/assets/{provider-O2Fsi2E6.js → provider-DGKy0rlK.js} +2 -2
  88. package/dist/ui/assets/{provider-settings-CHVLgGD4.js → provider-settings-BkIna1v7.js} +1 -1
  89. package/dist/ui/assets/{provider-settings-B4ty6gIx.js → provider-settings-DrEGQ7ef.js} +1 -1
  90. package/dist/ui/assets/provider-store-access-BK4wRKW6.js +1 -0
  91. package/dist/ui/assets/{provider-store-access-DO8lATOK.js → provider-store-access-Dr5cJrix.js} +2 -2
  92. package/dist/ui/assets/{providers-UBBok802.js → providers-B9Tcuh9N.js} +1 -1
  93. package/dist/ui/assets/{providers-DTdEhTSN.js → providers-DiWgfJHV.js} +2 -2
  94. package/dist/ui/assets/{quick-llm-CmyRUCMf.js → quick-llm-CSEzJrdv.js} +1 -1
  95. package/dist/ui/assets/{recovery-screen-_f8iC-Fq.js → recovery-screen-BAeZAnd3.js} +1 -1
  96. package/dist/ui/assets/{redirect-uri-CMVLNgtY.js → redirect-uri-BmNItvHl.js} +1 -1
  97. package/dist/ui/assets/{session-freezer-CvPl-bDp.js → session-freezer-BU7ggIXE.js} +3 -3
  98. package/dist/ui/assets/{setup-feature-flags-remote-CHIJc86J.js → setup-feature-flags-remote-B7CMO8xS.js} +1 -1
  99. package/dist/ui/assets/{setup-standalone-prelude-DUERSTfj.js → setup-standalone-prelude-Dg0BO-ug.js} +1 -1
  100. package/dist/ui/assets/{setup-sudo-D2RYRZR7.js → setup-sudo-w0slorYi.js} +2 -2
  101. package/dist/ui/assets/{skills-BFj_C0zu.js → skills-Qu2Xx97d.js} +1 -1
  102. package/dist/ui/assets/slicc-version-BJsqUhbP.js +1 -0
  103. package/dist/ui/assets/{sprinkle-manager-BMj0BniN.js → sprinkle-manager-2UUakPAV.js} +1 -1
  104. package/dist/ui/assets/src-Cj-AoUM3.js +2 -0
  105. package/dist/ui/assets/{src-jZxFomYR.js → src-DDn9o2XK.js} +1 -1
  106. package/dist/ui/assets/{store-PIfsltkW.js → store-BY8jHah-.js} +1 -1
  107. package/dist/ui/assets/{store-B_azjzWK.js → store-DLe-z7qR.js} +1 -1
  108. package/dist/ui/assets/{sudo-B_q1NKKG.js → sudo-B-8VnvDn.js} +1 -1
  109. package/dist/ui/assets/{sync-dialog-BXZHMjrc.js → sync-dialog-ACgl0n-p.js} +1 -1
  110. package/dist/ui/assets/{telemetry-DeLkquP_.js → telemetry-BVzuNdvW.js} +1 -1
  111. package/dist/ui/assets/{telemetry-BugxTkxX.js → telemetry-BwapcULJ.js} +1 -1
  112. package/dist/ui/assets/{upgrade-detection-DPiDPtcB.js → upgrade-detection-Bsw9PDXL.js} +1 -1
  113. package/dist/ui/assets/{wc-attach-C4L2GyF0.js → wc-attach-BsqldTbU.js} +2 -2
  114. package/dist/ui/assets/{wc-extension-BO9vRQwT.js → wc-extension-DYDuh0JO.js} +2 -2
  115. package/dist/ui/assets/{wc-follower-CZfJ2TtN.js → wc-follower-ww51bVZi.js} +3 -3
  116. package/dist/ui/assets/{wc-live-Bs4FhY5U.js → wc-live-B-tu9Zmf.js} +5 -5
  117. package/dist/ui/assets/{wc-nav-CxJPwpP-.js → wc-nav-DTKff66m.js} +2 -2
  118. package/dist/ui/assets/{wc-onboarding-Da7hSB-p.js → wc-onboarding-W9IFk-VE.js} +2 -2
  119. package/dist/ui/assets/{wc-placeholder-Dxzwmbbc.js → wc-placeholder-BHMU_r6O.js} +2 -2
  120. package/dist/ui/assets/{wc-settings-LBH0HADM.js → wc-settings-DXjEjm0D.js} +2 -2
  121. package/dist/ui/assets/wc-shell-Csh9APE_.js +119 -0
  122. package/dist/ui/assets/{wc-sprinkles-kW8sZ7l_.js → wc-sprinkles-DzajqLC2.js} +2 -2
  123. package/dist/ui/assets/{wc-tray-Z8PDTCsn.js → wc-tray-DNQ32Rxm.js} +2 -2
  124. package/dist/ui/assets/{xai-grok-Bj6T-qsO.js → xai-grok-Bjjeqaxc.js} +1 -1
  125. package/dist/ui/assets/{xai-grok-CNmzJXMK.js → xai-grok-D9twjPSS.js} +1 -1
  126. package/dist/ui/index.html +9 -9
  127. package/dist/ui/lucide-icons.js +1788 -1707
  128. package/dist/ui/packages/webapp/index.html +9 -9
  129. package/package.json +10 -10
  130. package/dist/ui/assets/anthropic-messages-DzEs7DmW.js +0 -39
  131. package/dist/ui/assets/anthropic-messages-EYoOyCX6.js +0 -39
  132. package/dist/ui/assets/azure-openai-BjzhxW0m.js +0 -18
  133. package/dist/ui/assets/azure-openai-Cv0yG7CG.js +0 -18
  134. package/dist/ui/assets/bedrock-camp-BfNg24Ce.js +0 -1
  135. package/dist/ui/assets/bedrock-camp-C8bCNVSq.js +0 -2
  136. package/dist/ui/assets/completionchunk-CVTjxyMe.js +0 -65
  137. package/dist/ui/assets/completionchunk-CksvMkXE.js +0 -65
  138. package/dist/ui/assets/constrained-sampling-DafcjXU6.js +0 -1
  139. package/dist/ui/assets/dist-CZvQ4trc.js +0 -15
  140. package/dist/ui/assets/es-D8T2ybXa.js +0 -53
  141. package/dist/ui/assets/esptool-operations-3FBbK-fD.js +0 -13
  142. package/dist/ui/assets/google-generative-ai-C9Is_VVN.js +0 -1
  143. package/dist/ui/assets/google-generative-ai-u7R_TH9o.js +0 -1
  144. package/dist/ui/assets/google-shared-BPNUreTT.js +0 -371
  145. package/dist/ui/assets/google-shared-Cde0njMr.js +0 -11
  146. package/dist/ui/assets/google-vertex-DzrD0kHC.js +0 -1
  147. package/dist/ui/assets/google-vertex-bmq-ZPFH.js +0 -1
  148. package/dist/ui/assets/icons-DtQGhvkp.js +0 -1
  149. package/dist/ui/assets/mistral-conversations-BKWQGrhA.js +0 -8
  150. package/dist/ui/assets/mistral-conversations-CunWHeDt.js +0 -7
  151. package/dist/ui/assets/openai-DQxsE__c.js +0 -16
  152. package/dist/ui/assets/openai-DehfWK3N.js +0 -16
  153. package/dist/ui/assets/openai-codex-responses-8wXA5Dto.js +0 -7
  154. package/dist/ui/assets/openai-codex-responses-CeLTmOkk.js +0 -7
  155. package/dist/ui/assets/openai-completions-CfjF1o-N.js +0 -5
  156. package/dist/ui/assets/openai-completions-q2lvopuz.js +0 -5
  157. package/dist/ui/assets/openai-responses-B7rl8DAX.js +0 -1
  158. package/dist/ui/assets/openai-responses-Cpj4YO2E.js +0 -1
  159. package/dist/ui/assets/openai-responses-shared-B_T0yMQn.js +0 -10
  160. package/dist/ui/assets/openai-responses-shared-iNFeCdoC.js +0 -10
  161. package/dist/ui/assets/openrouter.models-CrhNqqEN.js +0 -1
  162. package/dist/ui/assets/openrouter.models-DkPWoMvu.js +0 -1
  163. package/dist/ui/assets/otel-BVv11zKU.js +0 -3
  164. package/dist/ui/assets/otel-BZA5WuO2.js +0 -3
  165. package/dist/ui/assets/pdfjs-CRuE4vGw.js +0 -54
  166. package/dist/ui/assets/provider-store-access-DojveU92.js +0 -1
  167. package/dist/ui/assets/slicc-version-C2rv26Z3.js +0 -1
  168. package/dist/ui/assets/src-C9oNvq2b.js +0 -2
  169. package/dist/ui/assets/wc-shell-DXji2EMu.js +0 -117
@@ -0,0 +1 @@
1
+ import{i as e}from"./diagnostics-DN_idNHx.js";import{c as t,i as n,s as r}from"./transform-messages-N_eMsP2M.js";import{t as i}from"./provider-env-CTOcDKrQ.js";import{n as a}from"./headers-CbDaTl3c.js";import{t as o}from"./sanitize-unicode-DmIE6hZJ.js";import{n as s,t as c}from"./error-body-pkrba6pf.js";import{a as l,c as u,d,i as f,l as p,n as m,o as h,r as g,s as _,t as v,u as y}from"./google-shared-BMJ_JErv.js";var b=`v1`,x=`gcp-vertex-credentials`,S={THINKING_LEVEL_UNSPECIFIED:d.THINKING_LEVEL_UNSPECIFIED,MINIMAL:d.MINIMAL,LOW:d.LOW,MEDIUM:d.MEDIUM,HIGH:d.HIGH},C=0,w=(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:`pending`,timestamp:Date.now()};try{if(i?.fetch&&i.fetch!==globalThis.fetch)throw Error(`Custom fetch is not supported by the Google Vertex adapter`);let o=M(i),s=o?D(t,o,i?.headers):E(t,P(i),F(i),i?.headers,i?.env),c=I(t,n,i),l=await i?.onPayload?.(c,t);l!==void 0&&(c=l);let u=await _(()=>s.models.generateContentStream(c),i);a.push({type:`start`,partial:e});let d=null,p=e.content,m=()=>p.length-1;for await(let n of u){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=g(t);(!d||n&&d.type!==`thinking`||!n&&d.type!==`text`)&&(d&&(d.type===`text`?a.push({type:`text_end`,contentIndex:p.length-1,content:d.text,partial:e}):a.push({type:`thinking_end`,contentIndex:m(),content:d.thinking,partial:e})),n?(d={type:`thinking`,thinking:``,thinkingSignature:void 0},e.content.push(d),a.push({type:`thinking_start`,contentIndex:m(),partial:e})):(d={type:`text`,text:``},e.content.push(d),a.push({type:`text_start`,contentIndex:m(),partial:e}))),d.type===`thinking`?(d.thinking+=t.text,d.thinkingSignature=h(d.thinkingSignature,t.thoughtSignature),a.push({type:`thinking_delta`,contentIndex:m(),delta:t.text,partial:e})):(d.text+=t.text,d.textSignature=h(d.textSignature,t.thoughtSignature),a.push({type:`text_delta`,contentIndex:m(),delta:t.text,partial:e}))}if(t.functionCall){d&&=(d.type===`text`?a.push({type:`text_end`,contentIndex:m(),content:d.text,partial:e}):a.push({type:`thinking_end`,contentIndex:m(),content:d.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()}_${++C}`:n,name:t.functionCall.name||``,arguments:t.functionCall.args??{},...t.thoughtSignature&&{thoughtSignature:t.thoughtSignature}};e.content.push(r),a.push({type:`toolcall_start`,contentIndex:m(),partial:e}),a.push({type:`toolcall_delta`,contentIndex:m(),delta:JSON.stringify(r.arguments),partial:e}),a.push({type:`toolcall_end`,contentIndex:m(),toolCall:r,partial:e})}}i?.finishReason&&(e.rawStopReason=i.finishReason,e.stopReason=f(i.finishReason),e.content.some(e=>e.type===`toolCall`)&&e.stopReason===`stop`&&(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,reasoning:n.usageMetadata.thoughtsTokenCount||0,totalTokens:n.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},r(t,e.usage))}if(d&&(d.type===`text`?a.push({type:`text_end`,contentIndex:m(),content:d.text,partial:e}):a.push({type:`thinking_end`,contentIndex:m(),content:d.thinking,partial:e})),i?.signal?.aborted)throw Error(`Request was aborted`);if(e.stopReason===`pending`)throw Error(`Google Vertex stream ended without a finish reason`);if(e.stopReason===`aborted`||e.stopReason===`error`){let t=e.rawStopReason?`Provider stopped with: ${e.rawStopReason}`:`An unknown error occurred`;throw Error(t)}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=c(s(t)),a.push({type:`error`,reason:e.stopReason,error:e}),a.end()}})(),a},T=(e,r,i)=>{let a=n(e,r,i,void 0);if(!i?.reasoning)return w(e,r,{...a,thinking:{enabled:!1}});let o=t(e,i.reasoning),s=o===`off`?`high`:o,c=e;return L(c)||R(c)?w(e,r,{...a,thinking:{enabled:!0,level:B(s,c)}}):w(e,r,{...a,thinking:{enabled:!0,budgetTokens:V(c,s,i.thinkingBudgets)}})};function E(e,t,n,r,i){let a=j(i);return new p({vertexai:!0,project:t,location:n,apiVersion:b,...a?{googleAuthOptions:a}:{},httpOptions:O(e,r)})}function D(e,t,n){return new p({vertexai:!0,apiKey:t,apiVersion:b,httpOptions:O(e,n)})}function O(e,t){let n={},r=k(e.baseUrl);r&&(n.baseUrl=r,n.baseUrlResourceScope=y.COLLECTION,A(r)&&(n.apiVersion=``));let i=a({...e.headers,...t});return i&&(n.headers=i),Object.keys(n).length>0?n:void 0}function k(e){let t=e.trim();if(!(!t||t.includes(`{location}`)))return t}function A(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 j(e){let t=i(`GOOGLE_APPLICATION_CREDENTIALS`,e);return t?{keyFilename:t}:void 0}function M(e){let t=e?.apiKey?.trim();if(!(!t||t===x||N(t)))return t}function N(e){return/^<[^>]+>$/.test(e)}function P(e){let t=e?.project||i(`GOOGLE_CLOUD_PROJECT`,e?.env)||i(`GCLOUD_PROJECT`,e?.env);if(!t)throw Error(`Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.`);return t}function F(e){let t=e?.location||i(`GOOGLE_CLOUD_LOCATION`,e?.env);if(!t)throw Error(`Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.`);return t}function I(e,t,n={}){let r=v(e,t),i={};n.temperature!==void 0&&(i.temperature=n.temperature),n.maxTokens!==void 0&&(i.maxOutputTokens=n.maxTokens);let a=u(e.id),s=t.tools?.length?l(t.tools,n.toolChoice,a):void 0,c={...Object.keys(i).length>0&&i,...t.systemPrompt&&{systemInstruction:o(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:m(t.tools,!1,a)},...s!==void 0&&{toolConfig:{functionCallingConfig:{mode:s}}}};if(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=S[n.thinking.level],c.thinkingConfig=e}else e.reasoning&&n.thinking&&!n.thinking.enabled&&(c.thinkingConfig=z(e));if(n.signal){if(n.signal.aborted)throw Error(`Request aborted`);c.abortSignal=n.signal}return{model:e.id,contents:r,config:c}}function L(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function R(e){let t=e.id.toLowerCase();return/gemini-3(?:\.\d+)?-flash/.test(t)||t===`gemini-flash-latest`||t===`gemini-flash-lite-latest`}function z(e){let t=e;return L(t)?{thinkingLevel:d.LOW}:R(t)?{thinkingLevel:d.MINIMAL}:{thinkingBudget:0}}function B(e,t){if(L(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 V(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{w as stream,T as streamSimple};
@@ -0,0 +1 @@
1
+ import{i as e}from"./diagnostics-DN_idNHx.js";import{c as t,i as n,s as r}from"./transform-messages-DEFauvrq.js";import{t as i}from"./provider-env-CILujRmO.js";import{n as a}from"./headers-CbDaTl3c.js";import{t as o}from"./sanitize-unicode-DmIE6hZJ.js";import{n as s,t as c}from"./error-body-pkrba6pf.js";import{a as l,c as u,d,i as f,l as p,n as m,o as h,r as g,s as _,t as v,u as y}from"./google-shared-YqcyR4cm.js";const b={THINKING_LEVEL_UNSPECIFIED:d.THINKING_LEVEL_UNSPECIFIED,MINIMAL:d.MINIMAL,LOW:d.LOW,MEDIUM:d.MEDIUM,HIGH:d.HIGH};let x=0;const S=(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:`pending`,timestamp:Date.now()};try{if(i?.fetch&&i.fetch!==globalThis.fetch)throw Error(`Custom fetch is not supported by the Google Vertex adapter`);let o=A(i),s=o?T(t,o,i?.headers):w(t,M(i),N(i),i?.headers,i?.env),c=P(t,n,i),l=await i?.onPayload?.(c,t);l!==void 0&&(c=l);let u=await _(()=>s.models.generateContentStream(c),i);a.push({type:`start`,partial:e});let d=null,p=e.content,m=()=>p.length-1;for await(let n of u){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=g(t);(!d||n&&d.type!==`thinking`||!n&&d.type!==`text`)&&(d&&(d.type===`text`?a.push({type:`text_end`,contentIndex:p.length-1,content:d.text,partial:e}):a.push({type:`thinking_end`,contentIndex:m(),content:d.thinking,partial:e})),n?(d={type:`thinking`,thinking:``,thinkingSignature:void 0},e.content.push(d),a.push({type:`thinking_start`,contentIndex:m(),partial:e})):(d={type:`text`,text:``},e.content.push(d),a.push({type:`text_start`,contentIndex:m(),partial:e}))),d.type===`thinking`?(d.thinking+=t.text,d.thinkingSignature=h(d.thinkingSignature,t.thoughtSignature),a.push({type:`thinking_delta`,contentIndex:m(),delta:t.text,partial:e})):(d.text+=t.text,d.textSignature=h(d.textSignature,t.thoughtSignature),a.push({type:`text_delta`,contentIndex:m(),delta:t.text,partial:e}))}if(t.functionCall){d&&=(d.type===`text`?a.push({type:`text_end`,contentIndex:m(),content:d.text,partial:e}):a.push({type:`thinking_end`,contentIndex:m(),content:d.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()}_${++x}`:n,name:t.functionCall.name||``,arguments:t.functionCall.args??{},...t.thoughtSignature&&{thoughtSignature:t.thoughtSignature}};e.content.push(r),a.push({type:`toolcall_start`,contentIndex:m(),partial:e}),a.push({type:`toolcall_delta`,contentIndex:m(),delta:JSON.stringify(r.arguments),partial:e}),a.push({type:`toolcall_end`,contentIndex:m(),toolCall:r,partial:e})}}i?.finishReason&&(e.rawStopReason=i.finishReason,e.stopReason=f(i.finishReason),e.content.some(e=>e.type===`toolCall`)&&e.stopReason===`stop`&&(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,reasoning:n.usageMetadata.thoughtsTokenCount||0,totalTokens:n.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},r(t,e.usage))}if(d&&(d.type===`text`?a.push({type:`text_end`,contentIndex:m(),content:d.text,partial:e}):a.push({type:`thinking_end`,contentIndex:m(),content:d.thinking,partial:e})),i?.signal?.aborted)throw Error(`Request was aborted`);if(e.stopReason===`pending`)throw Error(`Google Vertex stream ended without a finish reason`);if(e.stopReason===`aborted`||e.stopReason===`error`){let t=e.rawStopReason?`Provider stopped with: ${e.rawStopReason}`:`An unknown error occurred`;throw Error(t)}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=c(s(t)),a.push({type:`error`,reason:e.stopReason,error:e}),a.end()}})(),a},C=(e,r,i)=>{let a=n(e,r,i,void 0);if(!i?.reasoning)return S(e,r,{...a,thinking:{enabled:!1}});let o=t(e,i.reasoning),s=o===`off`?`high`:o,c=e;return F(c)||I(c)?S(e,r,{...a,thinking:{enabled:!0,level:R(s,c)}}):S(e,r,{...a,thinking:{enabled:!0,budgetTokens:z(c,s,i.thinkingBudgets)}})};function w(e,t,n,r,i){let a=k(i);return new p({vertexai:!0,project:t,location:n,apiVersion:`v1`,...a?{googleAuthOptions:a}:{},httpOptions:E(e,r)})}function T(e,t,n){return new p({vertexai:!0,apiKey:t,apiVersion:`v1`,httpOptions:E(e,n)})}function E(e,t){let n={},r=D(e.baseUrl);r&&(n.baseUrl=r,n.baseUrlResourceScope=y.COLLECTION,O(r)&&(n.apiVersion=``));let i=a({...e.headers,...t});return i&&(n.headers=i),Object.keys(n).length>0?n:void 0}function D(e){let t=e.trim();if(!(!t||t.includes(`{location}`)))return t}function O(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 k(e){let t=i(`GOOGLE_APPLICATION_CREDENTIALS`,e);return t?{keyFilename:t}:void 0}function A(e){let t=e?.apiKey?.trim();if(!(!t||t===`gcp-vertex-credentials`||j(t)))return t}function j(e){return/^<[^>]+>$/.test(e)}function M(e){let t=e?.project||i(`GOOGLE_CLOUD_PROJECT`,e?.env)||i(`GCLOUD_PROJECT`,e?.env);if(!t)throw Error(`Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.`);return t}function N(e){let t=e?.location||i(`GOOGLE_CLOUD_LOCATION`,e?.env);if(!t)throw Error(`Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.`);return t}function P(e,t,n={}){let r=v(e,t),i={};n.temperature!==void 0&&(i.temperature=n.temperature),n.maxTokens!==void 0&&(i.maxOutputTokens=n.maxTokens);let a=u(e.id),s=t.tools?.length?l(t.tools,n.toolChoice,a):void 0,c={...Object.keys(i).length>0&&i,...t.systemPrompt&&{systemInstruction:o(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:m(t.tools,!1,a)},...s!==void 0&&{toolConfig:{functionCallingConfig:{mode:s}}}};if(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=b[n.thinking.level],c.thinkingConfig=e}else e.reasoning&&n.thinking&&!n.thinking.enabled&&(c.thinkingConfig=L(e));if(n.signal){if(n.signal.aborted)throw Error(`Request aborted`);c.abortSignal=n.signal}return{model:e.id,contents:r,config:c}}function F(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function I(e){let t=e.id.toLowerCase();return/gemini-3(?:\.\d+)?-flash/.test(t)||t===`gemini-flash-latest`||t===`gemini-flash-lite-latest`}function L(e){let t=e;return F(t)?{thinkingLevel:d.LOW}:I(t)?{thinkingLevel:d.MINIMAL}:{thinkingBudget:0}}function R(e,t){if(F(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 z(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{S as stream,C as streamSimple};