@fungi.computer/grove 0.15.0 → 0.16.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.
- package/dist/assets/{anthropic-messages-Y5WJvyqH.js → anthropic-messages-BoQicMvu.js} +3 -3
- package/dist/assets/{azure-openai-responses-sv5z2oJl.js → azure-openai-responses-FDabgA7u.js} +1 -1
- package/dist/assets/base-face-BYExcFAP.js +1 -0
- package/dist/assets/burger-B7R4zMC1.js +1 -0
- package/dist/assets/cat-IVcMI3Kr.js +1 -0
- package/dist/assets/{classifier-shared-B2W4uvue.js → classifier-shared-Deocnyea.js} +1 -1
- package/dist/assets/{cloudflare-workers-ai-system-one-C77Rn0un.js → cloudflare-workers-ai-system-one-CGH_pK-e.js} +1 -1
- package/dist/assets/{compat-Bg_8DMIR.js → compat-CfHbT1sC.js} +2 -2
- package/dist/assets/conversation-toast-BrxLLwNS.js +32 -0
- package/dist/assets/document-BiiUDQ73.js +1 -0
- package/dist/assets/document-EWUYmKg3.js +1 -0
- package/dist/assets/{extension-hook-CPEDb_dZ.js → extension-hook-Cmt9U0vD.js} +129 -129
- package/dist/assets/{google-generative-ai-BNzk1CE7.js → google-generative-ai-Ceyomei_.js} +1 -1
- package/dist/assets/{google-shared-DKoN-WAL.js → google-shared-Ck6ywoif.js} +1 -1
- package/dist/assets/{google-vertex-Dagxw3QH.js → google-vertex-BnLh-cet.js} +1 -1
- package/dist/assets/index-Du7GFgpE.js +117 -0
- package/dist/assets/{mistral-conversations-BYjaBa0G.js → mistral-conversations-DpJGrx0P.js} +1 -1
- package/dist/assets/{mushroom-a_sE2Lmz.js → mushroom-CjQXC8r7.js} +1 -1
- package/dist/assets/{node.browser-BYMf8Fo1.js → node.browser-CrrUeMCV.js} +1 -1
- package/dist/assets/{openai-codex-responses-C4lIM44a.js → openai-codex-responses-BMXymyOJ.js} +1 -1
- package/dist/assets/{openai-completions-DxCYryWd.js → openai-completions-FGvQd2Wf.js} +1 -1
- package/dist/assets/{openai-decisions-BpFgAsHO.js → openai-decisions-D2COFIXF.js} +1 -1
- package/dist/assets/{openai-responses-shared-DsXiYlmB.js → openai-responses-shared-DpDj6Ky1.js} +1 -1
- package/dist/assets/{openai-responses-CDv4Cp1s.js → openai-responses-ySTmwOIj.js} +1 -1
- package/dist/assets/{openrouter-images-B1WUs1MY.js → openrouter-images-BU5Yii-E.js} +1 -1
- package/dist/assets/parakeet-CXq4unKH.js +36 -0
- package/dist/assets/parakeet-conversation-UnWYlJ1w.js +4 -0
- package/dist/assets/{pi-messages-eptjcUpt.js → pi-messages-RlRIpxdV.js} +1 -1
- package/dist/assets/renderer-DOUDAFcS.js +1 -0
- package/dist/assets/{runtime-core-6IZ-I96h.js → runtime-core-Nu5SPlul.js} +2 -2
- package/dist/assets/{system-one-shared-CPwLZJuH.js → system-one-shared-BncCsH1N.js} +1 -1
- package/dist/assets/{transform-messages-CAKq9CLB.js → transform-messages-DXxBwHSL.js} +1 -1
- package/dist/assets/{typesafe-system-one-FckVj8yv.js → typesafe-system-one-aoUo0GON.js} +1 -1
- package/dist/assets/{website-conversation-sSS2HMor.js → website-conversation-CtgsyFag.js} +1 -1
- package/dist/index.html +6 -6
- package/package.json +9 -9
- package/dist/assets/animation-Ca8A_H2p.js +0 -1
- package/dist/assets/base-face-Biu4f93I.js +0 -1
- package/dist/assets/burger-C1wxdFxE.js +0 -1
- package/dist/assets/cat-CefyF5eq.js +0 -1
- package/dist/assets/conversation-toast-BgNrfhg0.js +0 -31
- package/dist/assets/document-CEriO-BY.js +0 -1
- package/dist/assets/index-CBzvcFvx.js +0 -117
- package/dist/assets/parakeet-Bf0VgpqA.js +0 -36
- package/dist/assets/parakeet-conversation-DghYwq8X.js +0 -4
- package/dist/assets/renderer-BvWy-oBw.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./text-_WthCHzw.js";import{a as t,n,s as r}from"./preload-helper-CfILh1TC.js";import{a as i}from"./diagnostics-CxvqSC4Q.js";import{n as a,t as o}from"./error-body-C7MTmn8e.js";import{n as s}from"./headers-FK4rgixo.js";import{t as c}from"./sanitize-unicode-DmIE6hZJ.js";import{i as l}from"./transform-messages-
|
|
1
|
+
import{n as e}from"./text-_WthCHzw.js";import{a as t,n,s as r}from"./preload-helper-CfILh1TC.js";import{a as i}from"./diagnostics-CxvqSC4Q.js";import{n as a,t as o}from"./error-body-C7MTmn8e.js";import{n as s}from"./headers-FK4rgixo.js";import{t as c}from"./sanitize-unicode-DmIE6hZJ.js";import{i as l}from"./transform-messages-DXxBwHSL.js";import{a as u,c as d,d as f,f as p,i as m,l as h,m as g,n as _,o as v,p as y,r as b,s as x,t as S,u as C}from"./google-shared-Ck6ywoif.js";import{calculateCost as w,clampThinkingLevel as T,getIdentityHeaders as E}from"./compat-CfHbT1sC.js";var D=0,O=(e,t,r)=>{let s=new i,c=n(t);return(async()=>{let t={role:`assistant`,content:[],api:`google-generative-ai`,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:`pending`,timestamp:Date.now()};try{if(r?.fetch&&r.fetch!==globalThis.fetch)throw Error(`Custom fetch is not supported by the Google Generative AI adapter`);let n=r?.apiKey;if(!n)throw Error(`No API key for provider: ${e.provider}`);let i=A(e,n,r?.headers,r?.identity),a=j(e,c,r),o=await r?.onPayload?.(a,e);o!==void 0&&(a=o);let l=await h(()=>i.models.generateContentStream(a),r);s.push({type:`start`,partial:t});let f=null,p=t.content,g=()=>p.length-1;for await(let n of l){await r?.onProviderStreamEvent?.(n,e),t.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 n=m(e);(!f||n&&f.type!==`thinking`||!n&&f.type!==`text`)&&(f&&(f.type===`text`?s.push({type:`text_end`,contentIndex:p.length-1,content:f.text,partial:t}):s.push({type:`thinking_end`,contentIndex:g(),content:f.thinking,partial:t})),n?(f={type:`thinking`,thinking:``,thinkingSignature:void 0},t.content.push(f),s.push({type:`thinking_start`,contentIndex:g(),partial:t})):(f={type:`text`,text:``},t.content.push(f),s.push({type:`text_start`,contentIndex:g(),partial:t}))),f.type===`thinking`?(f.thinking+=e.text,f.thinkingSignature=d(f.thinkingSignature,e.thoughtSignature),s.push({type:`thinking_delta`,contentIndex:g(),delta:e.text,partial:t})):(f.text+=e.text,f.textSignature=d(f.textSignature,e.thoughtSignature),s.push({type:`text_delta`,contentIndex:g(),delta:e.text,partial:t}))}if(e.functionCall){f&&=(f.type===`text`?s.push({type:`text_end`,contentIndex:g(),content:f.text,partial:t}):s.push({type:`thinking_end`,contentIndex:g(),content:f.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()}_${++D}`:n,name:e.functionCall.name||``,arguments:e.functionCall.args??{},...e.thoughtSignature&&{thoughtSignature:e.thoughtSignature}};t.content.push(r),s.push({type:`toolcall_start`,contentIndex:g(),partial:t}),s.push({type:`toolcall_delta`,contentIndex:g(),delta:JSON.stringify(r.arguments),partial:t}),s.push({type:`toolcall_end`,contentIndex:g(),toolCall:r,partial:t})}}i?.finishReason&&(t.rawStopReason=i.finishReason,t.stopReason=u(i.finishReason),t.content.some(e=>e.type===`toolCall`)&&t.stopReason===`stop`&&(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,reasoning:n.usageMetadata.thoughtsTokenCount||0,totalTokens:n.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},w(e,t.usage))}if(f&&(f.type===`text`?s.push({type:`text_end`,contentIndex:g(),content:f.text,partial:t}):s.push({type:`thinking_end`,contentIndex:g(),content:f.thinking,partial:t})),r?.signal?.aborted)throw Error(`Request was aborted`);if(t.stopReason===`pending`)throw Error(`Google stream ended without a finish reason`);if(t.stopReason===`aborted`||t.stopReason===`error`){let e=t.rawStopReason?`Provider stopped with: ${t.rawStopReason}`:`An unknown error occurred`;throw Error(e)}s.push({type:`done`,reason:t.stopReason,message:t}),s.end()}catch(e){t.stopReason=r?.signal?.aborted?`aborted`:`error`,t.errorMessage=o(a(e)),s.push({type:`error`,reason:t.stopReason,error:t}),s.end()}})(),s},k=(e,t,n)=>{let r=n?.apiKey;if(!r)throw Error(`No API key for provider: ${e.provider}`);let i={...l(e,t,n,r),toolChoice:n?.toolChoice};if(!n?.reasoning)return O(e,t,{...i,thinking:{enabled:!1}});let a=T(e,n.reasoning);if(a===`off`)return O(e,t,{...i,thinking:{enabled:!1}});let o=x(e,a);return y(e)?O(e,t,{...i,thinking:{enabled:!0,level:p(o)}}):O(e,t,{...i,thinking:{enabled:!0,budgetTokens:M(e,o,n.thinkingBudgets)}})};function A(e,t,n,r){let i={};e.baseUrl&&(i.baseUrl=e.baseUrl,i.apiVersion=``);let a=s(E(e,r),e.headers,n);return a&&(i.headers=a),new g({apiKey:t,httpOptions:Object.keys(i).length>0?i:void 0})}function j(n,i,a={}){let o=S(n,i),s=r(i.messages),l=t(i.messages),u={};a.temperature!==void 0&&(u.temperature=a.temperature),a.maxTokens!==void 0&&(u.maxOutputTokens=a.maxTokens);let d=C(n.id),p=l.length>0?v(l,a.toolChoice,d):void 0,m=s?e(s):``,h={...Object.keys(u).length>0&&u,...m&&{systemInstruction:c(m)},...l.length>0&&{tools:_(l,!1,d)},...p!==void 0&&{toolConfig:{functionCallingConfig:{mode:p}}}};if(a.thinking?.enabled&&n.reasoning){let e={includeThoughts:!0};a.thinking.level===void 0?a.thinking.budgetTokens!==void 0&&(e.thinkingBudget=a.thinking.budgetTokens):e.thinkingLevel=f(a.thinking.level),h.thinkingConfig=e}else n.reasoning&&a.thinking&&!a.thinking.enabled&&(h.thinkingConfig=b(n));if(a.signal){if(a.signal.aborted)throw Error(`Request aborted`);h.abortSignal=a.signal}return{model:n.id,contents:o,config:h}}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-lite`)?{minimal:512,low:2048,medium:8192,high:24576}[t]:e.id.includes(`2.5-flash`)?{minimal:128,low:2048,medium:8192,high:24576}[t]:-1:n[t]}export{O as stream,k as streamSimple};
|