sliccy 3.2.3 → 3.4.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 (87) hide show
  1. package/dist/ui/assets/{adobe-QN2CGEuK.js → adobe-Sj_hyVv3.js} +1 -1
  2. package/dist/ui/assets/{adobe-C6L-KqM8.js → adobe-rb_aKl_M.js} +2 -2
  3. package/dist/ui/assets/{agent-bridge-C3yTqUsW.js → agent-bridge-CRl9nflm.js} +1 -1
  4. package/dist/ui/assets/{agent-message-to-chat-DA9jQnkg.js → agent-message-to-chat-Dyd_CsuF.js} +1 -1
  5. package/dist/ui/assets/{anthropic-Iifm_Ljc.js → anthropic-BwCIhFCi.js} +4 -4
  6. package/dist/ui/assets/{anthropic-vLH5Wqs1.js → anthropic-DGQsJ6GL.js} +2 -2
  7. package/dist/ui/assets/apps-DmHyKbsC.js +27 -0
  8. package/dist/ui/assets/{azure-openai-Dul8yrdC.js → azure-openai-CsZ6EkiQ.js} +1 -1
  9. package/dist/ui/assets/azure-openai-CzJ7kgB0.js +1 -0
  10. package/dist/ui/assets/{azure-openai-responses-v6_djoy0.js → azure-openai-responses-Cx-TgqVy.js} +1 -1
  11. package/dist/ui/assets/{azure-openai-responses-Bv_GxAPf.js → azure-openai-responses-DlvDSi37.js} +1 -1
  12. package/dist/ui/assets/{bsh-watchdog-S8D_8Nfa.js → bsh-watchdog-BBqqb0G2.js} +1 -1
  13. package/dist/ui/assets/{cdp-Dov9DJkT.js → cdp-BQuqB1VW.js} +4 -4
  14. package/dist/ui/assets/cost-command-CGymv06m.js +1 -0
  15. package/dist/ui/assets/{es-BCrJzVim.js → es-8WlRIcnc.js} +5 -5
  16. package/dist/ui/assets/{follower-sprinkle-bridge-B3x8kxZm.js → follower-sprinkle-bridge-CR4urQ4J.js} +1 -1
  17. package/dist/ui/assets/{github-CGR7VRwT.js → github-C0u1Cweu.js} +1 -1
  18. package/dist/ui/assets/github-CP0b-qF6.js +2 -0
  19. package/dist/ui/assets/global-db-B97_fwjD.js +1 -0
  20. package/dist/ui/assets/{google-CajcZ91f.js → google-B6BnBJ98.js} +1 -1
  21. package/dist/ui/assets/google-D3gWIXEs.js +1 -0
  22. package/dist/ui/assets/{google-shared-D_dLvQOv.js → google-shared-BNqQ5w7Y.js} +3 -3
  23. package/dist/ui/assets/{google-shared-CZf2rVDo.js → google-shared-BY9ygMMp.js} +1 -1
  24. package/dist/ui/assets/{google-vertex-DjRs7IYH.js → google-vertex-AEmDhMsk.js} +1 -1
  25. package/dist/ui/assets/{google-vertex-ROGH_e7C.js → google-vertex-By4ImXSU.js} +1 -1
  26. package/dist/ui/assets/index-CIq7hD7V.js +1574 -0
  27. package/dist/ui/assets/{index-BeHZmqLr.css → index-CvlDeETm.css} +1 -1
  28. package/dist/ui/assets/{intercepted-oauth-BRuy2Kfs.js → intercepted-oauth-kgoLPBUR.js} +1 -1
  29. package/dist/ui/assets/{kernel-worker-DD8Usyxx.js → kernel-worker--9XR6TA5.js} +1043 -961
  30. package/dist/ui/assets/lick-ws-bridge-BsSRskZG.js +1 -0
  31. package/dist/ui/assets/{local-llm-EzEzei9O.js → local-llm-BrH-c1zQ.js} +2 -2
  32. package/dist/ui/assets/{magick-wasm-27-2_Eho.js → magick-wasm-DIXnoDPT.js} +1 -1
  33. package/dist/ui/assets/{mistral-D8AzlZW_.js → mistral-DYMtqzx-.js} +2 -2
  34. package/dist/ui/assets/{mistral-DLpWJDUH.js → mistral-gLgXy0EG.js} +2 -2
  35. package/dist/ui/assets/{nuke-command-DDKQSsN7.js → nuke-command-BnJKevvl.js} +1 -1
  36. package/dist/ui/assets/oauth-BV_uFTzp.js +1 -0
  37. package/dist/ui/assets/oauth-bootstrap-Cc7G6WlD.js +2 -0
  38. package/dist/ui/assets/{oauth-service-CHW2vtTw.js → oauth-service-BVXQmGtd.js} +1 -1
  39. package/dist/ui/assets/{oauth-service-oUFpJ_KO.js → oauth-service-UbuSiXNl.js} +1 -1
  40. package/dist/ui/assets/{offscreen-client-D1PbNub7.js → offscreen-client-CvKAEsA3.js} +1 -1
  41. package/dist/ui/assets/{onboarding-orchestrator-B82tihZv.js → onboarding-orchestrator-BVD2nVhL.js} +1 -1
  42. package/dist/ui/assets/{openai-codex-responses-DKXkHpcT.js → openai-codex-responses-ayymz0JM.js} +3 -3
  43. package/dist/ui/assets/{openai-codex-responses-C3po1AZV.js → openai-codex-responses-oiePUhNT.js} +4 -4
  44. package/dist/ui/assets/{openai-completions-B8rB17k5.js → openai-completions-Cj4QAb7m.js} +2 -2
  45. package/dist/ui/assets/{openai-responses-D0Pv1V2J.js → openai-responses-DwPaORDm.js} +1 -1
  46. package/dist/ui/assets/{openai-responses-C0p9Yysz.js → openai-responses-K7Y7tl7V.js} +1 -1
  47. package/dist/ui/assets/{openai-responses-shared-tMsFRUiy.js → openai-responses-shared-BFFJ9U3s.js} +5 -5
  48. package/dist/ui/assets/{openai-responses-shared-BHD4dY5m.js → openai-responses-shared-DO90_lVh.js} +4 -4
  49. package/dist/ui/assets/panel-rpc-handlers-BR9pV2oA.js +1 -0
  50. package/dist/ui/assets/provider-ClQjSE5O.js +2 -0
  51. package/dist/ui/assets/provider-DptBThba.js +1 -0
  52. package/dist/ui/assets/provider-store-access-5Gl48qWH.js +1 -0
  53. package/dist/ui/assets/provider-store-access-zE-XqO5j.js +1 -0
  54. package/dist/ui/assets/proxied-fetch-Ce2Yxudj.js +1 -0
  55. package/dist/ui/assets/{pyodide-DgAqpC8i.js → pyodide-CQR70Y-9.js} +2 -2
  56. package/dist/ui/assets/{remote-terminal-view-J9J7pk1H.js → remote-terminal-view-BsaD8S0g.js} +3 -3
  57. package/dist/ui/assets/{secret-env--0BcYjEq.js → secret-env-D0ZmDp8q.js} +1 -1
  58. package/dist/ui/assets/{slicc-editor-BzGs3P5h.js → slicc-editor-BA1c_c2O.js} +1 -1
  59. package/dist/ui/assets/{spawn-KTT1KFUY.js → spawn-ANsPpvkr.js} +1 -1
  60. package/dist/ui/assets/{sql-wasm-BgLnn2vi.js → sql-wasm-DWB5Lp-L.js} +2 -2
  61. package/dist/ui/assets/store-DOiFsVuu.js +1 -0
  62. package/dist/ui/assets/{tray-leave-runtime-B-6PC-Ne.js → tray-leave-runtime-C68HaJGb.js} +1 -1
  63. package/dist/ui/assets/upgrade-detection-wN6GvHJh.js +1 -0
  64. package/dist/ui/assets/{xai-grok-Bs1PPsw-.js → xai-grok-CAymFCGg.js} +1 -1
  65. package/dist/ui/assets/{xai-grok-D-OPqtYg.js → xai-grok-f5k6FhbM.js} +1 -1
  66. package/dist/ui/assets/{xai-grok-sanitize-CiOn_xsO.js → xai-grok-sanitize-h_8XMTD9.js} +1 -1
  67. package/dist/ui/index.html +2 -2
  68. package/dist/ui/packages/webapp/index.html +2 -2
  69. package/package.json +1 -1
  70. package/dist/ui/assets/azure-openai-E3Wl5zJa.js +0 -1
  71. package/dist/ui/assets/cost-command-yt4lKOdD.js +0 -1
  72. package/dist/ui/assets/github-BwW6n9oL.js +0 -2
  73. package/dist/ui/assets/google-C-gvkOTh.js +0 -1
  74. package/dist/ui/assets/index-C4gHNw6L.js +0 -1574
  75. package/dist/ui/assets/lick-ws-bridge-ZB_XB9cZ.js +0 -1
  76. package/dist/ui/assets/oauth-bootstrap-BEREFAjD.js +0 -1
  77. package/dist/ui/assets/panel-rpc-handlers-zcYFQzD1.js +0 -1
  78. package/dist/ui/assets/upgrade-detection-CKnfP1Ro.js +0 -1
  79. /package/dist/ui/assets/{active-transport-DeSPCdTV.js → active-transport-Dm6CWYVE.js} +0 -0
  80. /package/dist/ui/assets/{azure-ai-foundry-k_w7vD5C.js → azure-ai-foundry-BHLfY_0t.js} +0 -0
  81. /package/dist/ui/assets/{chat-fixture-BNN19l1e.js → chat-fixture-DOzffHLr.js} +0 -0
  82. /package/dist/ui/assets/{git-config-DFJqG7AS.js → git-config-CGMfR0WK.js} +0 -0
  83. /package/dist/ui/assets/{page-storage-sync-BxtXNbwY.js → page-storage-sync-CqMAh8jG.js} +0 -0
  84. /package/dist/ui/assets/{rum-wVO4iYd-.js → rum-DCU8sePD.js} +0 -0
  85. /package/dist/ui/assets/{sprinkle-bridge-channel-no1Jz9ii.js → sprinkle-bridge-channel-DJC5SGWr.js} +0 -0
  86. /package/dist/ui/assets/{xai-grok-errors-CGcnoVae.js → xai-grok-errors-Bzn3oNvW.js} +0 -0
  87. /package/dist/ui/assets/{xai-grok-models-0q2zveAT.js → xai-grok-models-DMYWtapT.js} +0 -0
@@ -1 +1 @@
1
- import{I as e,R as t,_ as n,z as r}from"./index-C4gHNw6L.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-CZf2rVDo.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=n(e,i,void 0);if(!i?.reasoning)return v(e,t,{...a,thinking:{enabled:!1}});let o=r(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};
1
+ import{H as e,V as t,y as n,z as r}from"./index-CIq7hD7V.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-BY9ygMMp.js";var m=`v1`,h=`gcp-vertex-credentials`,g={THINKING_LEVEL_UNSPECIFIED:c.THINKING_LEVEL_UNSPECIFIED,MINIMAL:c.MINIMAL,LOW:c.LOW,MEDIUM:c.MEDIUM,HIGH:c.HIGH},_=0,v=(e,n,i)=>{let a=new r;return(async()=>{let r={role:`assistant`,content:[],api:`google-vertex`,provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`stop`,timestamp:Date.now()};try{let o=T(i),c=o?x(e,o,i?.headers):b(e,D(i),O(i),i?.headers),l=k(e,n,i),f=await i?.onPayload?.(l,e);f!==void 0&&(l=f);let p=await c.models.generateContentStream(l);a.push({type:`start`,partial:r});let m=null,h=r.content,g=()=>h.length-1;for await(let n of p){r.responseId||=n.responseId;let i=n.candidates?.[0];if(i?.content?.parts)for(let e of i.content.parts){if(e.text!==void 0){let t=d(e);(!m||t&&m.type!==`thinking`||!t&&m.type!==`text`)&&(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:h.length-1,content:m.text,partial:r}):a.push({type:`thinking_end`,contentIndex:g(),content:m.thinking,partial:r})),t?(m={type:`thinking`,thinking:``,thinkingSignature:void 0},r.content.push(m),a.push({type:`thinking_start`,contentIndex:g(),partial:r})):(m={type:`text`,text:``},r.content.push(m),a.push({type:`text_start`,contentIndex:g(),partial:r}))),m.type===`thinking`?(m.thinking+=e.text,m.thinkingSignature=u(m.thinkingSignature,e.thoughtSignature),a.push({type:`thinking_delta`,contentIndex:g(),delta:e.text,partial:r})):(m.text+=e.text,m.textSignature=u(m.textSignature,e.thoughtSignature),a.push({type:`text_delta`,contentIndex:g(),delta:e.text,partial:r}))}if(e.functionCall){m&&=(m.type===`text`?a.push({type:`text_end`,contentIndex:g(),content:m.text,partial:r}):a.push({type:`thinking_end`,contentIndex:g(),content:m.thinking,partial:r}),null);let t=e.functionCall.id,n={type:`toolCall`,id:!t||r.content.some(e=>e.type===`toolCall`&&e.id===t)?`${e.functionCall.name}_${Date.now()}_${++_}`:t,name:e.functionCall.name||``,arguments:e.functionCall.args??{},...e.thoughtSignature&&{thoughtSignature:e.thoughtSignature}};r.content.push(n),a.push({type:`toolcall_start`,contentIndex:g(),partial:r}),a.push({type:`toolcall_delta`,contentIndex:g(),delta:JSON.stringify(n.arguments),partial:r}),a.push({type:`toolcall_end`,contentIndex:g(),toolCall:n,partial:r})}}i?.finishReason&&(r.stopReason=s(i.finishReason),r.content.some(e=>e.type===`toolCall`)&&(r.stopReason=`toolUse`)),n.usageMetadata&&(r.usage={input:(n.usageMetadata.promptTokenCount||0)-(n.usageMetadata.cachedContentTokenCount||0),output:(n.usageMetadata.candidatesTokenCount||0)+(n.usageMetadata.thoughtsTokenCount||0),cacheRead:n.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,totalTokens:n.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},t(e,r.usage))}if(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:g(),content:m.text,partial:r}):a.push({type:`thinking_end`,contentIndex:g(),content:m.thinking,partial:r})),i?.signal?.aborted)throw Error(`Request was aborted`);if(r.stopReason===`aborted`||r.stopReason===`error`)throw Error(`An unknown error occurred`);a.push({type:`done`,reason:r.stopReason,message:r}),a.end()}catch(e){for(let e of r.content)`index`in e&&delete e.index;r.stopReason=i?.signal?.aborted?`aborted`:`error`,r.errorMessage=e instanceof Error?e.message:JSON.stringify(e),a.push({type:`error`,reason:r.stopReason,error:r}),a.end()}})(),a},y=(t,r,i)=>{let a=n(t,i,void 0);if(!i?.reasoning)return v(t,r,{...a,thinking:{enabled:!1}});let o=e(t,i.reasoning),s=o===`off`?`high`:o,c=t;return A(c)||j(c)?v(t,r,{...a,thinking:{enabled:!0,level:N(s,c)}}):v(t,r,{...a,thinking:{enabled:!0,budgetTokens:P(c,s,i.thinkingBudgets)}})};function b(e,t,n,r){return new f({vertexai:!0,project:t,location:n,apiVersion:m,httpOptions:S(e,r)})}function x(e,t,n){return new f({vertexai:!0,apiKey:t,apiVersion:m,httpOptions:S(e,n)})}function S(e,t){let n={},r=C(e.baseUrl);return r&&(n.baseUrl=r,n.baseUrlResourceScope=o.COLLECTION,w(r)&&(n.apiVersion=``)),(e.headers||t)&&(n.headers={...e.headers,...t}),Object.keys(n).length>0?n:void 0}function C(e){let t=e.trim();if(!(!t||t.includes(`{location}`)))return t}function w(e){try{return new URL(e).pathname.split(`/`).some(e=>/^v\d+(?:beta\d*)?$/.test(e))}catch{return/(?:^|\/)v\d+(?:beta\d*)?(?:\/|$)/.test(e)}}function T(e){let t=e?.apiKey?.trim()||{}.GOOGLE_CLOUD_API_KEY?.trim();if(!(!t||t===h||E(t)))return t}function E(e){return/^<[^>]+>$/.test(e)}function D(e){let t=e?.project||{}.GOOGLE_CLOUD_PROJECT||{}.GCLOUD_PROJECT;if(!t)throw Error(`Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.`);return t}function O(e){let t=e?.location||{}.GOOGLE_CLOUD_LOCATION;if(!t)throw Error(`Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.`);return t}function k(e,t,n={}){let r=p(e,t),o={};n.temperature!==void 0&&(o.temperature=n.temperature),n.maxTokens!==void 0&&(o.maxOutputTokens=n.maxTokens);let s={...Object.keys(o).length>0&&o,...t.systemPrompt&&{systemInstruction:i(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:l(t.tools)}};if(t.tools&&t.tools.length>0&&n.toolChoice?s.toolConfig={functionCallingConfig:{mode:a(n.toolChoice)}}:s.toolConfig=void 0,n.thinking?.enabled&&e.reasoning){let e={includeThoughts:!0};n.thinking.level===void 0?n.thinking.budgetTokens!==void 0&&(e.thinkingBudget=n.thinking.budgetTokens):e.thinkingLevel=g[n.thinking.level],s.thinkingConfig=e}else e.reasoning&&n.thinking&&!n.thinking.enabled&&(s.thinkingConfig=M(e));if(n.signal){if(n.signal.aborted)throw Error(`Request aborted`);s.abortSignal=n.signal}return{model:e.id,contents:r,config:s}}function A(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function j(e){return/gemini-3(?:\.\d+)?-flash/.test(e.id.toLowerCase())}function M(e){let t=e;return A(t)?{thinkingLevel:c.LOW}:j(t)?{thinkingLevel:c.MINIMAL}:{thinkingBudget:0}}function N(e,t){if(A(t))switch(e){case`minimal`:case`low`:return`LOW`;case`medium`:case`high`:return`HIGH`}switch(e){case`minimal`:return`MINIMAL`;case`low`:return`LOW`;case`medium`:return`MEDIUM`;case`high`:return`HIGH`}}function P(e,t,n){return n?.[t]===void 0?e.id.includes(`2.5-pro`)?{minimal:128,low:2048,medium:8192,high:32768}[t]:e.id.includes(`2.5-flash`)?{minimal:128,low:2048,medium:8192,high:24576}[t]:-1:n[t]}export{v as streamGoogleVertex,y as streamSimpleGoogleVertex};
@@ -1 +1 @@
1
- import{I as e,L as t,P as n,b as r,o as i}from"./kernel-worker-DD8Usyxx.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_dLvQOv.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,r,i)=>{let a=new n;return(async()=>{let n={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,r,i),f=await i?.onPayload?.(l,t);f!==void 0&&(l=f);let p=await c.models.generateContentStream(l);a.push({type:`start`,partial:n});let m=null,g=n.content,_=()=>g.length-1;for await(let r of p){n.responseId||=r.responseId;let i=r.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:n}):a.push({type:`thinking_end`,contentIndex:_(),content:m.thinking,partial:n})),t?(m={type:`thinking`,thinking:``,thinkingSignature:void 0},n.content.push(m),a.push({type:`thinking_start`,contentIndex:_(),partial:n})):(m={type:`text`,text:``},n.content.push(m),a.push({type:`text_start`,contentIndex:_(),partial:n}))),m.type===`thinking`?(m.thinking+=e.text,m.thinkingSignature=u(m.thinkingSignature,e.thoughtSignature),a.push({type:`thinking_delta`,contentIndex:_(),delta:e.text,partial:n})):(m.text+=e.text,m.textSignature=u(m.textSignature,e.thoughtSignature),a.push({type:`text_delta`,contentIndex:_(),delta:e.text,partial:n}))}if(e.functionCall){m&&=(m.type===`text`?a.push({type:`text_end`,contentIndex:_(),content:m.text,partial:n}):a.push({type:`thinking_end`,contentIndex:_(),content:m.thinking,partial:n}),null);let t=e.functionCall.id,r={type:`toolCall`,id:!t||n.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}};n.content.push(r),a.push({type:`toolcall_start`,contentIndex:_(),partial:n}),a.push({type:`toolcall_delta`,contentIndex:_(),delta:JSON.stringify(r.arguments),partial:n}),a.push({type:`toolcall_end`,contentIndex:_(),toolCall:r,partial:n})}}i?.finishReason&&(n.stopReason=s(i.finishReason),n.content.some(e=>e.type===`toolCall`)&&(n.stopReason=`toolUse`)),r.usageMetadata&&(n.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}},e(t,n.usage))}if(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:_(),content:m.text,partial:n}):a.push({type:`thinking_end`,contentIndex:_(),content:m.thinking,partial:n})),i?.signal?.aborted)throw Error(`Request was aborted`);if(n.stopReason===`aborted`||n.stopReason===`error`)throw Error(`An unknown error occurred`);a.push({type:`done`,reason:n.stopReason,message:n}),a.end()}catch(e){for(let e of n.content)`index`in e&&delete e.index;n.stopReason=i?.signal?.aborted?`aborted`:`error`,n.errorMessage=e instanceof Error?e.message:JSON.stringify(e),a.push({type:`error`,reason:n.stopReason,error:n}),a.end()}})(),a},_=(e,n,i)=>{let a=r(e,i,void 0);if(!i?.reasoning)return g(e,n,{...a,thinking:{enabled:!1}});let o=t(e,i.reasoning),s=o===`off`?`high`:o,c=e;return O(c)||k(c)?g(e,n,{...a,thinking:{enabled:!0,level:j(s,c)}}):g(e,n,{...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
+ import{B as e,L as t,b as n,o as r,z as i}from"./kernel-worker--9XR6TA5.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-BNqQ5w7Y.js";const m={THINKING_LEVEL_UNSPECIFIED:c.THINKING_LEVEL_UNSPECIFIED,MINIMAL:c.MINIMAL,LOW:c.LOW,MEDIUM:c.MEDIUM,HIGH:c.HIGH};let h=0;const g=(e,n,r)=>{let a=new t;return(async()=>{let t={role:`assistant`,content:[],api:`google-vertex`,provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`stop`,timestamp:Date.now()};try{let o=C(r),c=o?y(e,o,r?.headers):v(e,T(r),E(r),r?.headers),l=D(e,n,r),f=await r?.onPayload?.(l,e);f!==void 0&&(l=f);let p=await c.models.generateContentStream(l);a.push({type:`start`,partial:t});let m=null,g=t.content,_=()=>g.length-1;for await(let n of p){t.responseId||=n.responseId;let r=n.candidates?.[0];if(r?.content?.parts)for(let e of r.content.parts){if(e.text!==void 0){let n=d(e);(!m||n&&m.type!==`thinking`||!n&&m.type!==`text`)&&(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:g.length-1,content:m.text,partial:t}):a.push({type:`thinking_end`,contentIndex:_(),content:m.thinking,partial:t})),n?(m={type:`thinking`,thinking:``,thinkingSignature:void 0},t.content.push(m),a.push({type:`thinking_start`,contentIndex:_(),partial:t})):(m={type:`text`,text:``},t.content.push(m),a.push({type:`text_start`,contentIndex:_(),partial:t}))),m.type===`thinking`?(m.thinking+=e.text,m.thinkingSignature=u(m.thinkingSignature,e.thoughtSignature),a.push({type:`thinking_delta`,contentIndex:_(),delta:e.text,partial:t})):(m.text+=e.text,m.textSignature=u(m.textSignature,e.thoughtSignature),a.push({type:`text_delta`,contentIndex:_(),delta:e.text,partial:t}))}if(e.functionCall){m&&=(m.type===`text`?a.push({type:`text_end`,contentIndex:_(),content:m.text,partial:t}):a.push({type:`thinking_end`,contentIndex:_(),content:m.thinking,partial:t}),null);let n=e.functionCall.id,r={type:`toolCall`,id:!n||t.content.some(e=>e.type===`toolCall`&&e.id===n)?`${e.functionCall.name}_${Date.now()}_${++h}`:n,name:e.functionCall.name||``,arguments:e.functionCall.args??{},...e.thoughtSignature&&{thoughtSignature:e.thoughtSignature}};t.content.push(r),a.push({type:`toolcall_start`,contentIndex:_(),partial:t}),a.push({type:`toolcall_delta`,contentIndex:_(),delta:JSON.stringify(r.arguments),partial:t}),a.push({type:`toolcall_end`,contentIndex:_(),toolCall:r,partial:t})}}r?.finishReason&&(t.stopReason=s(r.finishReason),t.content.some(e=>e.type===`toolCall`)&&(t.stopReason=`toolUse`)),n.usageMetadata&&(t.usage={input:(n.usageMetadata.promptTokenCount||0)-(n.usageMetadata.cachedContentTokenCount||0),output:(n.usageMetadata.candidatesTokenCount||0)+(n.usageMetadata.thoughtsTokenCount||0),cacheRead:n.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,totalTokens:n.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},i(e,t.usage))}if(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:_(),content:m.text,partial:t}):a.push({type:`thinking_end`,contentIndex:_(),content:m.thinking,partial:t})),r?.signal?.aborted)throw Error(`Request was aborted`);if(t.stopReason===`aborted`||t.stopReason===`error`)throw Error(`An unknown error occurred`);a.push({type:`done`,reason:t.stopReason,message:t}),a.end()}catch(e){for(let e of t.content)`index`in e&&delete e.index;t.stopReason=r?.signal?.aborted?`aborted`:`error`,t.errorMessage=e instanceof Error?e.message:JSON.stringify(e),a.push({type:`error`,reason:t.stopReason,error:t}),a.end()}})(),a},_=(t,r,i)=>{let a=n(t,i,void 0);if(!i?.reasoning)return g(t,r,{...a,thinking:{enabled:!1}});let o=e(t,i.reasoning),s=o===`off`?`high`:o,c=t;return O(c)||k(c)?g(t,r,{...a,thinking:{enabled:!0,level:j(s,c)}}):g(t,r,{...a,thinking:{enabled:!0,budgetTokens:M(c,s,i.thinkingBudgets)}})};function v(e,t,n,r){return new f({vertexai:!0,project:t,location:n,apiVersion:`v1`,httpOptions:b(e,r)})}function y(e,t,n){return new f({vertexai:!0,apiKey:t,apiVersion:`v1`,httpOptions:b(e,n)})}function b(e,t){let n={},r=x(e.baseUrl);return r&&(n.baseUrl=r,n.baseUrlResourceScope=o.COLLECTION,S(r)&&(n.apiVersion=``)),(e.headers||t)&&(n.headers={...e.headers,...t}),Object.keys(n).length>0?n:void 0}function x(e){let t=e.trim();if(!(!t||t.includes(`{location}`)))return t}function S(e){try{return new URL(e).pathname.split(`/`).some(e=>/^v\d+(?:beta\d*)?$/.test(e))}catch{return/(?:^|\/)v\d+(?:beta\d*)?(?:\/|$)/.test(e)}}function C(e){let t=e?.apiKey?.trim()||{}.GOOGLE_CLOUD_API_KEY?.trim();if(!(!t||t===`gcp-vertex-credentials`||w(t)))return t}function w(e){return/^<[^>]+>$/.test(e)}function T(e){let t=e?.project||{}.GOOGLE_CLOUD_PROJECT||{}.GCLOUD_PROJECT;if(!t)throw Error(`Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.`);return t}function E(e){let t=e?.location||{}.GOOGLE_CLOUD_LOCATION;if(!t)throw Error(`Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.`);return t}function D(e,t,n={}){let i=p(e,t),o={};n.temperature!==void 0&&(o.temperature=n.temperature),n.maxTokens!==void 0&&(o.maxOutputTokens=n.maxTokens);let s={...Object.keys(o).length>0&&o,...t.systemPrompt&&{systemInstruction:r(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:l(t.tools)}};if(t.tools&&t.tools.length>0&&n.toolChoice?s.toolConfig={functionCallingConfig:{mode:a(n.toolChoice)}}:s.toolConfig=void 0,n.thinking?.enabled&&e.reasoning){let e={includeThoughts:!0};n.thinking.level===void 0?n.thinking.budgetTokens!==void 0&&(e.thinkingBudget=n.thinking.budgetTokens):e.thinkingLevel=m[n.thinking.level],s.thinkingConfig=e}else e.reasoning&&n.thinking&&!n.thinking.enabled&&(s.thinkingConfig=A(e));if(n.signal){if(n.signal.aborted)throw Error(`Request aborted`);s.abortSignal=n.signal}return{model:e.id,contents:i,config:s}}function O(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function k(e){return/gemini-3(?:\.\d+)?-flash/.test(e.id.toLowerCase())}function A(e){let t=e;return O(t)?{thinkingLevel:c.LOW}:k(t)?{thinkingLevel:c.MINIMAL}:{thinkingBudget:0}}function j(e,t){if(O(t))switch(e){case`minimal`:case`low`:return`LOW`;case`medium`:case`high`:return`HIGH`}switch(e){case`minimal`:return`MINIMAL`;case`low`:return`LOW`;case`medium`:return`MEDIUM`;case`high`:return`HIGH`}}function M(e,t,n){return n?.[t]===void 0?e.id.includes(`2.5-pro`)?{minimal:128,low:2048,medium:8192,high:32768}[t]:e.id.includes(`2.5-flash`)?{minimal:128,low:2048,medium:8192,high:24576}[t]:-1:n[t]}export{g as streamGoogleVertex,_ as streamSimpleGoogleVertex};