sliccy 5.31.3 → 5.31.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui/assets/{account-store-SL9GSzVk.js → account-store-Bk7BU4R2.js} +2 -2
- package/dist/ui/assets/account-store-CWYCPgAg.js +103 -0
- package/dist/ui/assets/adobe-b9KONAKs.js +2 -0
- package/dist/ui/assets/{adobe-oauth-state-X5E5a44s.js → adobe-oauth-state-mA3vu6Bf.js} +1 -1
- package/dist/ui/assets/adobe-xFuU2zCa.js +1 -0
- package/dist/ui/assets/{agent-message-to-chat-C1C-ZYPB.js → agent-message-to-chat-D7tDL1mh.js} +1 -1
- package/dist/ui/assets/anthropic-messages-DP3-Xd3J.js +39 -0
- package/dist/ui/assets/{anthropic-LjoeX6v-.js → anthropic-messages-DSmP2_-Q.js} +6 -6
- package/dist/ui/assets/{apps-BQ_qFSmZ.js → apps-DjoNkGOL.js} +1 -1
- package/dist/ui/assets/azure-openai-DbeGNEJJ.js +1 -0
- package/dist/ui/assets/{azure-openai-g-MISqMy.js → azure-openai-r8cj7flx.js} +1 -1
- package/dist/ui/assets/azure-openai-responses-CEEm6_Xn.js +1 -0
- package/dist/ui/assets/azure-openai-responses-YO8iO-Ch.js +1 -0
- package/dist/ui/assets/bedrock-camp-DVKDCEuf.js +1 -0
- package/dist/ui/assets/bedrock-camp-DbZ6Mjym.js +1 -0
- package/dist/ui/assets/cerebras-DHXm2Opl.js +1 -0
- package/dist/ui/assets/cerebras-DSz7FIO_.js +1 -0
- package/dist/ui/assets/compat-DADQxxLV.js +2 -0
- package/dist/ui/assets/completionchunk-B2eUYPOo.js +40 -0
- package/dist/ui/assets/completionchunk-BsT4qCtf.js +40 -0
- package/dist/ui/assets/{connect-surface-C37aNu3W.js → connect-surface-Ce0cz8Sc.js} +1 -1
- package/dist/ui/assets/{context-compaction-DvlXtgVG.js → context-compaction-DaxQExZG.js} +1 -1
- package/dist/ui/assets/dip-7kvHeBSg.js +1 -0
- package/dist/ui/assets/{dist-Z_lsorao.js → dist-Bp_iacBp.js} +1 -1
- package/dist/ui/assets/{dist-Crm-xEtc.js → dist-ClXA2s8_.js} +1 -1
- package/dist/ui/assets/{ensure-speech-assets-C16fjyEc.js → ensure-speech-assets-CBkFedDM.js} +1 -1
- package/dist/ui/assets/esp8266-BuqxV-Rf.js +1 -0
- package/dist/ui/assets/{esptool-operations-DS77K1xA.js → esptool-operations-Dyb_KlG3.js} +2 -2
- package/dist/ui/assets/{fs-CJe7ORQQ.js → fs-CtR0lVGQ.js} +1 -1
- package/dist/ui/assets/{fs-4jha6tKU.js → fs-Cza4C_VI.js} +2 -2
- package/dist/ui/assets/{github-bHdfOCia.js → github-CyuBASDb.js} +2 -2
- package/dist/ui/assets/{github-B7MJQ6o8.js → github-D6l0k87E.js} +1 -1
- package/dist/ui/assets/github-copilot-BxtkvNkA.js +2 -0
- package/dist/ui/assets/github-copilot-CgxdBB7O.js +1 -0
- package/dist/ui/assets/github-copilot-headers-DRgtIyTm.js +1 -0
- package/dist/ui/assets/google-generative-ai-Cz3VHJVe.js +1 -0
- package/dist/ui/assets/google-generative-ai-DRLjqQHr.js +1 -0
- package/dist/ui/assets/{google-shared-CwjAeP6N.js → google-shared-0Fg2dFO2.js} +1 -1
- package/dist/ui/assets/{google-shared-CFmFmYdk.js → google-shared-mehyRjje.js} +1 -1
- package/dist/ui/assets/google-vertex-C8F4Q-3-.js +1 -0
- package/dist/ui/assets/google-vertex-DI_ybVGc.js +1 -0
- package/dist/ui/assets/headers-CbDaTl3c.js +1 -0
- package/dist/ui/assets/{hear-DVfG4tMB.js → hear-DPr4m8os.js} +1 -1
- package/dist/ui/assets/{kernel-worker-DU_V0U3r.js → kernel-worker-DZdJjW09.js} +1193 -1193
- package/dist/ui/assets/{kokoro-engine-BCF6RB67.js → kokoro-engine-DtX15dky.js} +1 -1
- package/dist/ui/assets/{lick-ws-bridge-CWz8ua2f.js → lick-ws-bridge-DW_om-XF.js} +1 -1
- package/dist/ui/assets/{lick-ws-bridge-Bw7A25PO.js → lick-ws-bridge-F1bk9Ndr.js} +1 -1
- package/dist/ui/assets/{local-llm-CUYHWkoy.js → local-llm-BUh467MT.js} +2 -2
- package/dist/ui/assets/main-DVF1KaMV.js +24 -0
- package/dist/ui/assets/mistral-conversations-BD1LHG49.js +8 -0
- package/dist/ui/assets/mistral-conversations-CoropYyn.js +7 -0
- package/dist/ui/assets/models-ByRUWfA-.js +1 -0
- package/dist/ui/assets/{mount-COvarpEy.js → mount-BJAgT6cd.js} +2 -2
- package/dist/ui/assets/{mount-DhKiCtt7.js → mount-CAEbJLup.js} +1 -1
- package/dist/ui/assets/{new-session-COz75sHo.js → new-session-DuIKoj8h.js} +2 -2
- package/dist/ui/assets/{oauth-bootstrap-BRe2dg9j.js → oauth-bootstrap-C1t3F5l9.js} +2 -2
- package/dist/ui/assets/{openai-codex-Bg862N5_.js → openai-codex-7a3yMxhL.js} +1 -1
- package/dist/ui/assets/openai-codex-BNJ1y0s8.js +1 -0
- package/dist/ui/assets/openai-codex-responses-DUWTsNB0.js +7 -0
- package/dist/ui/assets/openai-codex-responses-DcE8b3Us.js +7 -0
- package/dist/ui/assets/openai-completions-2m5htnw8.js +5 -0
- package/dist/ui/assets/openai-completions-CPxuOo6h.js +5 -0
- package/dist/ui/assets/openai-responses-BIaF8Olv.js +1 -0
- package/dist/ui/assets/openai-responses-D3YJWUR5.js +1 -0
- package/dist/ui/assets/openai-responses-shared-1KvKQf-4.js +12 -0
- package/dist/ui/assets/openai-responses-shared-CEQMR7Nx.js +12 -0
- package/dist/ui/assets/openrouter-images-CHaqAs_0.js +1 -0
- package/dist/ui/assets/openrouter-images-CIagBWVL.js +1 -0
- package/dist/ui/assets/otel-BvlmHUjk.js +3 -0
- package/dist/ui/assets/otel-CCT7TRJr.js +3 -0
- package/dist/ui/assets/{page-follower-tray-CKjmGVTI.js → page-follower-tray-wxp2UQxg.js} +1 -1
- package/dist/ui/assets/{panel-rpc-handlers-DV_SVK7O.js → panel-rpc-handlers-CfN2Vxm8.js} +2 -2
- package/dist/ui/assets/{provider-C1MeNgf6.js → provider-CDfndD9E.js} +2 -2
- package/dist/ui/assets/{provider-CH9Vg0CP.js → provider-CYVtAuph.js} +1 -1
- package/dist/ui/assets/provider-env-D37PhSJu.js +1 -0
- package/dist/ui/assets/provider-env-DwY8YuMk.js +1 -0
- package/dist/ui/assets/provider-store-access-BCxDzrP_.js +1 -0
- package/dist/ui/assets/provider-store-access-C0J_PJos.js +1 -0
- package/dist/ui/assets/providers-BrRzKc33.js +2 -0
- package/dist/ui/assets/{providers-DTc9cavg.js → providers-CzILNNm-.js} +1 -1
- package/dist/ui/assets/quick-llm-C3DL1kkz.js +1 -0
- package/dist/ui/assets/session-freezer-BAlnZq3r.js +1 -0
- package/dist/ui/assets/{speak-qQJqxyY_.js → speak-BvV9R1Ep.js} +1 -1
- package/dist/ui/assets/{sprinkle-manager-DqB-1sMP.js → sprinkle-manager-WFdDIrH2.js} +1 -1
- package/dist/ui/assets/{sprinkle-renderer-Bc0oWiBK.js → sprinkle-renderer-Bd0WVTH3.js} +1 -1
- package/dist/ui/assets/{store-CQZC3J0e.js → store-DYEVj3Mn.js} +1 -1
- package/dist/ui/assets/{sudo-DDua5CDS.js → sudo-Dov5vvU-.js} +1 -1
- package/dist/ui/assets/transform-messages-CQuDksPz.js +1 -0
- package/dist/ui/assets/transform-messages-D7OsqBmU.js +1 -0
- package/dist/ui/assets/{transformers-env-Bd5uUAET.js → transformers-env-DtlYTSDz.js} +1 -1
- package/dist/ui/assets/{tray-leader-tUG5SYx1.js → tray-leader-DYLxucjO.js} +1 -1
- package/dist/ui/assets/{tray-leave-runtime-DFSM2v0u.js → tray-leave-runtime-bo512Gb_.js} +1 -1
- package/dist/ui/assets/{upgrade-detection-SjHrqVRd.js → upgrade-detection-ssTKZKw3.js} +1 -1
- package/dist/ui/assets/{voice-reply-Cfv2GJPY.js → voice-reply-C7IdeZWx.js} +1 -1
- package/dist/ui/assets/{wc-attach-BLShAwZU.js → wc-attach-DqUMF3SN.js} +2 -2
- package/dist/ui/assets/wc-extension-C4v5cPUY.js +2 -0
- package/dist/ui/assets/{wc-follower-DcPEJsCg.js → wc-follower-Crqux2kQ.js} +3 -3
- package/dist/ui/assets/wc-live-DQFQdors.js +258 -0
- package/dist/ui/assets/{wc-nav-BipzeLE6.js → wc-nav-CaLNkUtj.js} +2 -2
- package/dist/ui/assets/{wc-onboarding-CcG_XrLd.js → wc-onboarding-Dl79TUXT.js} +2 -2
- package/dist/ui/assets/{wc-placeholder-BYxtEGbt.js → wc-placeholder-CbKpW6j0.js} +3 -3
- package/dist/ui/assets/{wc-settings-CdRw8sxH.js → wc-settings-BCItZ-R5.js} +2 -2
- package/dist/ui/assets/{wc-shell-CrTQtlJQ.js → wc-shell-BPSFQuzD.js} +4 -4
- package/dist/ui/assets/{wc-sprinkles-CiD8jtkB.js → wc-sprinkles-DFSkoMFZ.js} +2 -2
- package/dist/ui/assets/{wc-tray-CSrI5SrA.js → wc-tray-CB5grpTa.js} +2 -2
- package/dist/ui/assets/{whisper-engine-6ZaZ9EaS.js → whisper-engine-CDLEuuEq.js} +1 -1
- package/dist/ui/assets/xai-grok-BHUG3fUE.js +1 -0
- package/dist/ui/assets/{xai-grok-Bjh8Mg84.js → xai-grok-CwvM0E_f.js} +1 -1
- package/dist/ui/index.html +9 -9
- package/dist/ui/packages/webapp/index.html +9 -9
- package/package.json +2 -2
- package/dist/ui/assets/account-store-BSEcudvg.js +0 -99
- package/dist/ui/assets/adobe-DbSSf4Ld.js +0 -1
- package/dist/ui/assets/adobe-SNd1IfRO.js +0 -2
- package/dist/ui/assets/anthropic-BOEkIcb-.js +0 -39
- package/dist/ui/assets/azure-openai-C4FPpKAs.js +0 -1
- package/dist/ui/assets/azure-openai-responses-CbJrQGi8.js +0 -1
- package/dist/ui/assets/azure-openai-responses-DPSrcT4o.js +0 -1
- package/dist/ui/assets/bedrock-camp-DjKgax8m.js +0 -1
- package/dist/ui/assets/bedrock-camp-DlP7CPgV.js +0 -5
- package/dist/ui/assets/cerebras-D2PjlO7P.js +0 -1
- package/dist/ui/assets/cerebras-zumaaXYF.js +0 -1
- package/dist/ui/assets/diagnostics-DRDFDs4d.js +0 -1
- package/dist/ui/assets/diagnostics-mI-AnKx_.js +0 -1
- package/dist/ui/assets/dip-CZO83CmG.js +0 -1
- package/dist/ui/assets/dist-D69OmKNn.js +0 -4
- package/dist/ui/assets/esp8266-f57A77mF.js +0 -1
- package/dist/ui/assets/event-stream-BJI_nGaK.js +0 -1
- package/dist/ui/assets/github-copilot-B3U5ZsUu.js +0 -1
- package/dist/ui/assets/github-copilot-Brb8tPWW.js +0 -2
- package/dist/ui/assets/github-copilot-headers-DZtWWv8W.js +0 -1
- package/dist/ui/assets/google-C3U0TK_l.js +0 -1
- package/dist/ui/assets/google-DPvIPcfE.js +0 -1
- package/dist/ui/assets/google-vertex-BbeV3aSP.js +0 -1
- package/dist/ui/assets/google-vertex-CEGsokz8.js +0 -1
- package/dist/ui/assets/headers-DO1UzNKu.js +0 -1
- package/dist/ui/assets/main-LqqRM1F-.js +0 -24
- package/dist/ui/assets/mistral-CLF3Mo4W.js +0 -46
- package/dist/ui/assets/mistral-DkJAVbOW.js +0 -46
- package/dist/ui/assets/openai-codex-BYbsJPYQ.js +0 -1
- package/dist/ui/assets/openai-codex-responses-B2oZ1hgB.js +0 -7
- package/dist/ui/assets/openai-codex-responses-Dumyd9t2.js +0 -7
- package/dist/ui/assets/openai-completions-B2n4Op2S.js +0 -5
- package/dist/ui/assets/openai-completions-aHU8w14d.js +0 -5
- package/dist/ui/assets/openai-responses-4ryIAXQS.js +0 -1
- package/dist/ui/assets/openai-responses-BurVahs3.js +0 -1
- package/dist/ui/assets/openai-responses-shared-BebU8o_f.js +0 -12
- package/dist/ui/assets/openai-responses-shared-D9O9OCYB.js +0 -12
- package/dist/ui/assets/openrouter-B1ruTb6k.js +0 -1
- package/dist/ui/assets/openrouter-XmffhsNH.js +0 -1
- package/dist/ui/assets/provider-store-access-DEnkpFQB.js +0 -1
- package/dist/ui/assets/provider-store-access-hYm5ykP5.js +0 -1
- package/dist/ui/assets/providers-BYABmiE-.js +0 -2
- package/dist/ui/assets/quick-llm-CpQ7FC1y.js +0 -1
- package/dist/ui/assets/session-freezer-ClZHZ4rq.js +0 -1
- package/dist/ui/assets/transform-messages-BjP6vDPY.js +0 -1
- package/dist/ui/assets/transform-messages-DiIjWKhh.js +0 -1
- package/dist/ui/assets/wc-extension-9BJC8pnc.js +0 -2
- package/dist/ui/assets/wc-live-CpCIXFgr.js +0 -258
- package/dist/ui/assets/xai-grok-BClQ5lXS.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,d as t,o as n,r}from"./transform-messages-CQuDksPz.js";import{t as i}from"./provider-env-DwY8YuMk.js";import{n as a}from"./headers-CbDaTl3c.js";import{t as o}from"./sanitize-unicode-DmIE6hZJ.js";import{a as s,c,i as l,l as u,n as d,o as f,r as p,s as m,t as h}from"./google-shared-0Fg2dFO2.js";const g={THINKING_LEVEL_UNSPECIFIED:u.THINKING_LEVEL_UNSPECIFIED,MINIMAL:u.MINIMAL,LOW:u.LOW,MEDIUM:u.MEDIUM,HIGH:u.HIGH};let _=0;const v=(n,r,i)=>{let a=new t;return(async()=>{let t={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=E(i),s=o?x(n,o,i?.headers):b(n,O(i),k(i),i?.headers,i?.env),c=A(n,r,i),u=await i?.onPayload?.(c,n);u!==void 0&&(c=u);let d=await s.models.generateContentStream(c);a.push({type:`start`,partial:t});let m=null,h=t.content,g=()=>h.length-1;for await(let r of d){t.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 n=p(e);(!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:t}):a.push({type:`thinking_end`,contentIndex:g(),content:m.thinking,partial:t})),n?(m={type:`thinking`,thinking:``,thinkingSignature:void 0},t.content.push(m),a.push({type:`thinking_start`,contentIndex:g(),partial:t})):(m={type:`text`,text:``},t.content.push(m),a.push({type:`text_start`,contentIndex:g(),partial:t}))),m.type===`thinking`?(m.thinking+=e.text,m.thinkingSignature=f(m.thinkingSignature,e.thoughtSignature),a.push({type:`thinking_delta`,contentIndex:g(),delta:e.text,partial:t})):(m.text+=e.text,m.textSignature=f(m.textSignature,e.thoughtSignature),a.push({type:`text_delta`,contentIndex:g(),delta:e.text,partial:t}))}if(e.functionCall){m&&=(m.type===`text`?a.push({type:`text_end`,contentIndex:g(),content:m.text,partial:t}):a.push({type:`thinking_end`,contentIndex:g(),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()}_${++_}`:n,name:e.functionCall.name||``,arguments:e.functionCall.args??{},...e.thoughtSignature&&{thoughtSignature:e.thoughtSignature}};t.content.push(r),a.push({type:`toolcall_start`,contentIndex:g(),partial:t}),a.push({type:`toolcall_delta`,contentIndex:g(),delta:JSON.stringify(r.arguments),partial:t}),a.push({type:`toolcall_end`,contentIndex:g(),toolCall:r,partial:t})}}i?.finishReason&&(t.stopReason=l(i.finishReason),t.content.some(e=>e.type===`toolCall`)&&(t.stopReason=`toolUse`)),r.usageMetadata&&(t.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(n,t.usage))}if(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:g(),content:m.text,partial:t}):a.push({type:`thinking_end`,contentIndex:g(),content:m.thinking,partial:t})),i?.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=i?.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},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 j(c)||M(c)?v(e,t,{...a,thinking:{enabled:!0,level:P(s,c)}}):v(e,t,{...a,thinking:{enabled:!0,budgetTokens:F(c,s,i.thinkingBudgets)}})};function b(e,t,n,r,i){let a=T(i);return new m({vertexai:!0,project:t,location:n,apiVersion:`v1`,...a?{googleAuthOptions:a}:{},httpOptions:S(e,r)})}function x(e,t,n){return new m({vertexai:!0,apiKey:t,apiVersion:`v1`,httpOptions:S(e,n)})}function S(e,t){let n={},r=C(e.baseUrl);r&&(n.baseUrl=r,n.baseUrlResourceScope=c.COLLECTION,w(r)&&(n.apiVersion=``));let i=a({...e.headers,...t});return i&&(n.headers=i),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=i(`GOOGLE_APPLICATION_CREDENTIALS`,e);return t?{keyFilename:t}:void 0}function E(e){let t=e?.apiKey?.trim();if(!(!t||t===`gcp-vertex-credentials`||D(t)))return t}function D(e){return/^<[^>]+>$/.test(e)}function O(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 k(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 A(e,t,n={}){let r=h(e,t),i={};n.temperature!==void 0&&(i.temperature=n.temperature),n.maxTokens!==void 0&&(i.maxOutputTokens=n.maxTokens);let a={...Object.keys(i).length>0&&i,...t.systemPrompt&&{systemInstruction:o(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:d(t.tools)}};if(t.tools&&t.tools.length>0&&n.toolChoice?a.toolConfig={functionCallingConfig:{mode:s(n.toolChoice)}}:a.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],a.thinkingConfig=e}else e.reasoning&&n.thinking&&!n.thinking.enabled&&(a.thinkingConfig=N(e));if(n.signal){if(n.signal.aborted)throw Error(`Request aborted`);a.abortSignal=n.signal}return{model:e.id,contents:r,config:a}}function j(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function M(e){let t=e.id.toLowerCase();return/gemini-3(?:\.\d+)?-flash/.test(t)||t===`gemini-flash-latest`||t===`gemini-flash-lite-latest`}function N(e){let t=e;return j(t)?{thinkingLevel:u.LOW}:M(t)?{thinkingLevel:u.MINIMAL}:{thinkingBudget:0}}function P(e,t){if(j(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 F(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 stream,y as streamSimple};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t,t as n}from"./models-ByRUWfA-.js";import{t as r}from"./provider-env-D37PhSJu.js";import{r as i}from"./transform-messages-D7OsqBmU.js";import{n as a}from"./headers-CbDaTl3c.js";import{t as o}from"./sanitize-unicode-DmIE6hZJ.js";import{a as s,c,i as l,l as u,n as d,o as f,r as p,s as m,t as h}from"./google-shared-mehyRjje.js";var g=`v1`,_=`gcp-vertex-credentials`,v={THINKING_LEVEL_UNSPECIFIED:u.THINKING_LEVEL_UNSPECIFIED,MINIMAL:u.MINIMAL,LOW:u.LOW,MEDIUM:u.MEDIUM,HIGH:u.HIGH},y=0,b=(e,r,i)=>{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=O(i),s=o?C(e,o,i?.headers):S(e,A(i),j(i),i?.headers,i?.env),c=M(e,r,i),u=await i?.onPayload?.(c,e);u!==void 0&&(c=u);let d=await s.models.generateContentStream(c);a.push({type:`start`,partial:t});let m=null,h=t.content,g=()=>h.length-1;for await(let r of d){t.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 n=p(e);(!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:t}):a.push({type:`thinking_end`,contentIndex:g(),content:m.thinking,partial:t})),n?(m={type:`thinking`,thinking:``,thinkingSignature:void 0},t.content.push(m),a.push({type:`thinking_start`,contentIndex:g(),partial:t})):(m={type:`text`,text:``},t.content.push(m),a.push({type:`text_start`,contentIndex:g(),partial:t}))),m.type===`thinking`?(m.thinking+=e.text,m.thinkingSignature=f(m.thinkingSignature,e.thoughtSignature),a.push({type:`thinking_delta`,contentIndex:g(),delta:e.text,partial:t})):(m.text+=e.text,m.textSignature=f(m.textSignature,e.thoughtSignature),a.push({type:`text_delta`,contentIndex:g(),delta:e.text,partial:t}))}if(e.functionCall){m&&=(m.type===`text`?a.push({type:`text_end`,contentIndex:g(),content:m.text,partial:t}):a.push({type:`thinking_end`,contentIndex:g(),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()}_${++y}`:n,name:e.functionCall.name||``,arguments:e.functionCall.args??{},...e.thoughtSignature&&{thoughtSignature:e.thoughtSignature}};t.content.push(r),a.push({type:`toolcall_start`,contentIndex:g(),partial:t}),a.push({type:`toolcall_delta`,contentIndex:g(),delta:JSON.stringify(r.arguments),partial:t}),a.push({type:`toolcall_end`,contentIndex:g(),toolCall:r,partial:t})}}i?.finishReason&&(t.stopReason=l(i.finishReason),t.content.some(e=>e.type===`toolCall`)&&(t.stopReason=`toolUse`)),r.usageMetadata&&(t.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}},n(e,t.usage))}if(m&&(m.type===`text`?a.push({type:`text_end`,contentIndex:g(),content:m.text,partial:t}):a.push({type:`thinking_end`,contentIndex:g(),content:m.thinking,partial:t})),i?.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=i?.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},x=(t,n,r)=>{let a=i(t,r,void 0);if(!r?.reasoning)return b(t,n,{...a,thinking:{enabled:!1}});let o=e(t,r.reasoning),s=o===`off`?`high`:o,c=t;return N(c)||P(c)?b(t,n,{...a,thinking:{enabled:!0,level:I(s,c)}}):b(t,n,{...a,thinking:{enabled:!0,budgetTokens:L(c,s,r.thinkingBudgets)}})};function S(e,t,n,r,i){let a=D(i);return new m({vertexai:!0,project:t,location:n,apiVersion:g,...a?{googleAuthOptions:a}:{},httpOptions:w(e,r)})}function C(e,t,n){return new m({vertexai:!0,apiKey:t,apiVersion:g,httpOptions:w(e,n)})}function w(e,t){let n={},r=T(e.baseUrl);r&&(n.baseUrl=r,n.baseUrlResourceScope=c.COLLECTION,E(r)&&(n.apiVersion=``));let i=a({...e.headers,...t});return i&&(n.headers=i),Object.keys(n).length>0?n:void 0}function T(e){let t=e.trim();if(!(!t||t.includes(`{location}`)))return t}function E(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 D(e){let t=r(`GOOGLE_APPLICATION_CREDENTIALS`,e);return t?{keyFilename:t}:void 0}function O(e){let t=e?.apiKey?.trim();if(!(!t||t===_||k(t)))return t}function k(e){return/^<[^>]+>$/.test(e)}function A(e){let t=e?.project||r(`GOOGLE_CLOUD_PROJECT`,e?.env)||r(`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 j(e){let t=e?.location||r(`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 M(e,t,n={}){let r=h(e,t),i={};n.temperature!==void 0&&(i.temperature=n.temperature),n.maxTokens!==void 0&&(i.maxOutputTokens=n.maxTokens);let a={...Object.keys(i).length>0&&i,...t.systemPrompt&&{systemInstruction:o(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:d(t.tools)}};if(t.tools&&t.tools.length>0&&n.toolChoice?a.toolConfig={functionCallingConfig:{mode:s(n.toolChoice)}}:a.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=v[n.thinking.level],a.thinkingConfig=e}else e.reasoning&&n.thinking&&!n.thinking.enabled&&(a.thinkingConfig=F(e));if(n.signal){if(n.signal.aborted)throw Error(`Request aborted`);a.abortSignal=n.signal}return{model:e.id,contents:r,config:a}}function N(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function P(e){let t=e.id.toLowerCase();return/gemini-3(?:\.\d+)?-flash/.test(t)||t===`gemini-flash-latest`||t===`gemini-flash-lite-latest`}function F(e){let t=e;return N(t)?{thinkingLevel:u.LOW}:P(t)?{thinkingLevel:u.MINIMAL}:{thinkingBudget:0}}function I(e,t){if(N(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 L(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{b as stream,x as streamSimple};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){let t={};for(let[n,r]of e.entries())t[n]=r;return t}function t(e){if(!e)return;let t={};for(let[n,r]of Object.entries(e))r!==null&&(t[n]=r);return Object.keys(t).length>0?t:void 0}export{t as n,e as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./logger-LESFN7Hj.js";import{t}from"./wc-permissions-registry-C7PhTX3c.js";import{i as n,n as r,r as i}from"./whisper-engine-
|
|
1
|
+
import{t as e}from"./logger-LESFN7Hj.js";import{t}from"./wc-permissions-registry-C7PhTX3c.js";import{i as n,n as r,r as i}from"./whisper-engine-CDLEuuEq.js";const a=16e3;async function o(e){if(typeof AudioContext>`u`||typeof OfflineAudioContext>`u`)throw Error(`audio decoding requires a window/page realm (AudioContext unavailable)`);let t=new AudioContext,n;try{n=await t.decodeAudioData(e.slice(0))}finally{await t.close().catch(()=>{})}let r=Math.max(1,Math.ceil(n.duration*a)),i=new OfflineAudioContext(1,r,a),o=i.createBufferSource();return o.buffer=n,o.connect(i.destination),o.start(),(await i.startRendering()).getChannelData(0).slice(0)}e(`speech:whisper-session`);function s(e){return e?.split(`-`)[0]?.toLowerCase()||void 0}const c=e(`speech:hear`);let l={};function u(){return l.getPermissionSurface?l.getPermissionSurface():t()||null}function d(){if(typeof window>`u`)return null;let e=window;return e.SpeechRecognition??e.webkitSpeechRecognition??null}var f=class extends Error{code;constructor(e){super(p(e)),this.name=`SpeechRecognitionError`,this.code=e}};function p(e){switch(e){case`network`:case`service-not-allowed`:return"builtin speech recognition is unsupported in this browser (no Web Speech cloud backend) — use `hear --engine enhanced`";case`not-allowed`:return`microphone permission denied for builtin speech recognition`;case`audio-capture`:return`no microphone available for builtin speech recognition`;case`no-speech`:return`no speech detected`;case`aborted`:return`speech recognition aborted`;default:return`speech recognition error: ${e}`}}function m(e){return e instanceof f&&(e.code===`network`||e.code===`service-not-allowed`)}function h(e,t){let n=d();return n?new Promise((r,i)=>{let a=Date.now(),o=()=>Date.now()-a,s=new n;s.continuous=!1,s.interimResults=!1,e&&(s.lang=e),c.debug(`builtinOnce: recognizer constructed`,{lang:e??`(browser default)`,timeoutMs:t});let l=``,u=!1,d=setTimeout(()=>{c.debug(`builtinOnce: timeout reached — stopping recognizer`,{elapsedMs:o()});try{s.stop()}catch{}},t);s.onstart=()=>c.debug(`builtinOnce: onstart (recognition service active)`,{elapsedMs:o()}),s.onaudiostart=()=>c.debug(`builtinOnce: onaudiostart (capturing audio)`,{elapsedMs:o()}),s.onspeechstart=()=>c.debug(`builtinOnce: onspeechstart (speech detected)`,{elapsedMs:o()}),s.onspeechend=()=>c.debug(`builtinOnce: onspeechend (speech ended)`,{elapsedMs:o()}),s.onnomatch=()=>c.debug(`builtinOnce: onnomatch (no recognizable speech)`,{elapsedMs:o()}),s.onresult=e=>{let t=[];for(let n=0;n<e.results.length;n++)t.push(e.results[n][0]?.transcript??``);l=t.join(` `).trim(),c.debug(`builtinOnce: onresult`,{elapsedMs:o(),resultCount:e.results.length,transcriptLength:l.length})},s.onerror=e=>{if(e.error===`no-speech`||e.error===`aborted`){c.debug(`builtinOnce: onerror (non-fatal — ends with empty transcript)`,{elapsedMs:o(),code:e.error});return}u=!0,clearTimeout(d),c.error(`builtinOnce: onerror (fatal)`,{elapsedMs:o(),code:e.error}),i(new f(e.error))},s.onend=()=>{clearTimeout(d),u?c.debug(`builtinOnce: onend after fatal error (already rejected)`,{elapsedMs:o()}):(c.debug(`builtinOnce: onend — resolving`,{elapsedMs:o(),transcriptLength:l.length,empty:l.length===0}),r(l))},c.debug(`builtinOnce: calling recognizer.start()`,{elapsedMs:o()}),s.start()}):Promise.reject(Error(`speech recognition unavailable in this environment`))}async function g(e){let t={audio:e?{deviceId:{exact:e}}:!0},n=u();if(n){c.debug(`acquireMicrophoneStream: requesting microphone via permission surface`,{hasDeviceId:!!e});let r=await n.prompt({kinds:[`microphone`],description:`The hear command needs your microphone to transcribe speech.`,requestOptions:{microphone:{constraints:t}},skipIfGranted:!0});if(r.status!==`granted`){c.error(`acquireMicrophoneStream: microphone permission not granted`,{status:r.status,reason:r.reason});let e=r.message?`: ${r.message}`:``;throw Error(`microphone permission ${r.reason??r.status}${e}`)}let i=r.grants.find(e=>e.kind===`microphone`);if(!i)throw c.error(`acquireMicrophoneStream: permission granted without a microphone stream`),Error(`microphone permission granted without a stream`);return c.debug(`acquireMicrophoneStream: microphone stream acquired via surface`),i.stream}if(!navigator.mediaDevices?.getUserMedia)throw c.error(`acquireMicrophoneStream: getUserMedia unavailable in this realm`),Error(`microphone capture unavailable in this realm`);c.debug(`acquireMicrophoneStream: no permission surface; calling getUserMedia directly`);try{let e=await navigator.mediaDevices.getUserMedia(t);return c.debug(`acquireMicrophoneStream: getUserMedia succeeded (direct)`),e}catch(e){throw c.error(`acquireMicrophoneStream: getUserMedia failed (direct)`,e),e}}async function _(e){let t=await g(e),n=new MediaRecorder(t),r=[];n.ondataavailable=e=>{e.data.size>0&&r.push(e.data)},n.start(500);let i=()=>{for(let e of t.getTracks())e.stop()};return{stop:()=>new Promise(e=>{n.onstop=()=>{i(),e(r.length?new Blob(r,{type:n.mimeType||`audio/webm`}):null)};try{n.stop()}catch{i(),e(null)}}),cancel:()=>{try{n.stop()}catch{}i()}}}async function v(e){if(!u())return c.debug(`primeBuiltinPermission: no permission surface; recognizer drives its own prompt`),null;c.debug(`primeBuiltinPermission: priming microphone grant via permission surface`,{hasDeviceId:!!e});let t=await g(e);return c.debug(`primeBuiltinPermission: microphone primed; holding stream open for recognizer`),t}function y(e){if(e){for(let t of e.getTracks())t.stop();c.debug(`primeBuiltinPermission: released primed microphone stream`)}}async function b(e,t){let n=await _(e.deviceId),i=``;try{i=await h(e.lang,t)}catch(e){c.warn(`builtin endpointing failed; transcribing captured audio anyway`,e)}let a=await n.stop();if(!a)return{transcript:i,engine:`builtin`};try{let t=await r(),n=await o(await a.arrayBuffer()),i=await t.transcribe(n,{language:s(e.lang)});if(i)return{transcript:i,engine:`enhanced`}}catch(e){c.warn(`whisper transcription failed; falling back to builtin text`,e)}return{transcript:i,engine:`builtin`}}async function x(e={}){let t=e.timeoutMs??3e4,r=e.engine??`auto`,i=n()===`ready`;if(r===`enhanced`&&!i)throw c.error(`hearCapture: enhanced engine requested but whisper is not ready`),Error("enhanced engine not ready — run `hear --warmup` (check progress with `hear --status`)");let a=r!==`builtin`&&i;if(c.debug(`hearCapture: engine dispatch`,{requested:r,enhancedReady:i,resolved:a?`enhanced`:`builtin`}),a)return b(e,t);let o=await v(e.deviceId);try{let n=await h(e.lang,t);return c.debug(`hearCapture: builtin recognition produced a transcript`),{transcript:n,engine:`builtin`}}catch(n){if(!m(n))throw c.error(`hearCapture: builtin recognition failed`,n),n;if(i)return c.debug(`hearCapture: builtin unsupported in this browser; falling back to enhanced whisper`),y(o),o=null,b(e,t);throw c.error(`hearCapture: builtin unsupported and whisper not ready`,{code:n.code}),n}finally{y(o)}}async function S(e,t){let n=await r(),i=await o(e);return{transcript:await n.transcribe(i,{language:s(t)}),engine:`enhanced`}}function C(){let e=i();return{state:n(),...e?{loaded:e.loaded,total:e.total,etaSeconds:e.etaSeconds}:{}}}function w(){return r().catch(()=>{}),C()}export{x as hearCapture,C as hearStatus,S as hearTranscribe,w as hearWarmup};
|