@fungi.computer/grove 0.6.2 → 0.7.1

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 (38) hide show
  1. package/README.md +1 -1
  2. package/dist/assets/animation-Ca8A_H2p.js +1 -0
  3. package/dist/assets/{anthropic-messages-CDm0hoBV.js → anthropic-messages-7sgt1UHG.js} +3 -3
  4. package/dist/assets/{azure-openai-responses-BjoRAOlM.js → azure-openai-responses-ifioVRLI.js} +1 -1
  5. package/dist/assets/burger-Bew_dWQ5.js +1 -0
  6. package/dist/assets/cat-CyeMJpek.js +1 -0
  7. package/dist/assets/{extension-hook-CmoMuW6C.js → client-BgsArGc4.js} +130 -130
  8. package/dist/assets/compat-C_BaSpng.js +2 -0
  9. package/dist/assets/extension-hook-BmxyPufU.js +1 -0
  10. package/dist/assets/extensions-D4sT3fnw.js +1 -0
  11. package/dist/assets/{google-generative-ai-xdelq2ko.js → google-generative-ai-DTrjA_Kq.js} +1 -1
  12. package/dist/assets/{google-shared-P7z8Pe9d.js → google-shared-CC7Fhi9a.js} +1 -1
  13. package/dist/assets/{google-vertex-8hsu6Eaf.js → google-vertex-g2QdhHGh.js} +1 -1
  14. package/dist/assets/index-eTK6Oges.js +109 -0
  15. package/dist/assets/{mistral-conversations-JKMpJrPb.js → mistral-conversations-PsOnrdNU.js} +1 -1
  16. package/dist/assets/{mushroom-ur0TNKww.js → mushroom-Bws8KRYq.js} +1 -1
  17. package/dist/assets/{node.browser-GHKlzSn3.js → node.browser-BXQd5-t8.js} +1 -1
  18. package/dist/assets/{openai-codex-responses-CidQ12Xa.js → openai-codex-responses-iLzgcq4d.js} +1 -1
  19. package/dist/assets/openai-codex.models-B_MCwO6E.js +1 -0
  20. package/dist/assets/{openai-completions-D9RzypE9.js → openai-completions-BKmKKKO6.js} +1 -1
  21. package/dist/assets/{openai-responses-BXeaL2BV.js → openai-responses-CPrT1qyt.js} +1 -1
  22. package/dist/assets/{openai-responses-shared-Da1jFqQB.js → openai-responses-shared-D1m_goPG.js} +1 -1
  23. package/dist/assets/parakeet-MIo5GJJ1.js +36 -0
  24. package/dist/assets/parakeet-conversation-BAsHp-EG.js +4 -0
  25. package/dist/assets/renderer-gIZ0s6fA.js +1 -0
  26. package/dist/assets/{runtime-core-DKpk6tKT.js → runtime-core-tDPMDDqR.js} +2 -2
  27. package/dist/assets/sigil-DQZqONrR.js +31 -0
  28. package/dist/assets/{transform-messages-YmXk5TtR.js → transform-messages-B1nXfhYd.js} +1 -1
  29. package/dist/assets/website-conversation-CwS3UatH.js +1 -0
  30. package/dist/index.html +4 -2
  31. package/package.json +6 -6
  32. package/dist/assets/burger-DGewjCsv.js +0 -1
  33. package/dist/assets/cat-CRMM8U8H.js +0 -1
  34. package/dist/assets/compat-tatm8WJ0.js +0 -2
  35. package/dist/assets/extensions-CrmxvtfG.js +0 -1
  36. package/dist/assets/index-CCJvRnqn.js +0 -174
  37. package/dist/assets/parakeet-conversation-DYlN7oL9.js +0 -4
  38. package/dist/assets/renderer-BKCye2Ev.js +0 -1
@@ -0,0 +1 @@
1
+ import{N as e,pt as t,rr as n,yt as r}from"./Effect-CtszBD7f.js";import{ai as i,ca as a,fa as o,gi as s,go as c,hi as l,ia as u}from"./client-BgsArGc4.js";var d=i.pipe(s(a(1)),s(u(128)),s(o(/^[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$/u))),f=i.pipe(s(a(1)),s(u(64)),s(o(/^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/u))),p=d.pipe(l(`ExtensionId`)),m=i.pipe(s(o(/^sha256:[0-9a-f]{64}$/u)),l(`ExtensionRevision`)),h=i.pipe(s(o(/^sha256:[0-9a-f]{64}$/u)),l(`ExtensionFingerprint`)),g=class extends c(`ExtensionHookError`){};function _(n){return t(()=>{let t=n();return e(t)?t:r({try:()=>Promise.resolve(t),catch:e=>new g({cause:e})})})}var v=class extends Error{constructor(){super(`Extension transaction handler must return synchronously`),this.name=`AsyncExtensionTransactionError`}};function y(t,r){let i=t(r);if(i instanceof Promise||e(i)&&!n(i))throw new v;return i}export{h as a,f as c,p as i,_ as n,d as o,y as r,m as s,v as t};
@@ -0,0 +1 @@
1
+ import{An as e}from"./Effect-CtszBD7f.js";import{$n as t,Ni as n,Qn as r,Ti as i,ai as a,er as o,go as s,ji as c,xi as l,zn as u}from"./client-BgsArGc4.js";import{c as d,i as f}from"./extension-hook-BmxyPufU.js";Object.freeze({module:r,operation:t,gate:o}),l(u),i(c(u));var p=class extends e()(`@fungi.computer/shiitake/ExtensionRead`){},m=class extends e()(`@fungi.computer/shiitake/ExtensionTx`){},h=class extends s(`ExtensionStateError`){},g=class extends s(`AdmissionError`){},_=class extends s(`ExtensionCommandError`){},v=class extends s(`ExtensionStop`){};s(`ExtensionActivationError`),i(f),i(d),n(a);export{v as a,h as i,_ as n,m as o,p as r,g as t};
@@ -1 +1 @@
1
- import{a as e,m as t,n,s as r}from"./preload-helper-DY31Aviq.js";import{a as i}from"./diagnostics-CxvqSC4Q.js";import{n as a,t as o}from"./models-BM_0GHMS.js";import{n as s}from"./headers-FK4rgixo.js";import{h as c,i as l}from"./transform-messages-YmXk5TtR.js";import{t as u}from"./sanitize-unicode-DmIE6hZJ.js";import{n as d,t as f}from"./error-body-pkrba6pf.js";import{a as p,c as m,d as h,f as g,i as _,l as v,m as y,n as b,o as x,p as S,r as C,s as w,t as T,u as E}from"./google-shared-P7z8Pe9d.js";var D=0,O=(e,t,r)=>{let a=new i,s=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),c=j(e,s,r),l=await r?.onPayload?.(c,e);l!==void 0&&(c=l);let u=await v(()=>i.models.generateContentStream(c),r);a.push({type:`start`,partial:t});let d=null,f=t.content,h=()=>f.length-1;for await(let n of u){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=_(e);(!d||n&&d.type!==`thinking`||!n&&d.type!==`text`)&&(d&&(d.type===`text`?a.push({type:`text_end`,contentIndex:f.length-1,content:d.text,partial:t}):a.push({type:`thinking_end`,contentIndex:h(),content:d.thinking,partial:t})),n?(d={type:`thinking`,thinking:``,thinkingSignature:void 0},t.content.push(d),a.push({type:`thinking_start`,contentIndex:h(),partial:t})):(d={type:`text`,text:``},t.content.push(d),a.push({type:`text_start`,contentIndex:h(),partial:t}))),d.type===`thinking`?(d.thinking+=e.text,d.thinkingSignature=m(d.thinkingSignature,e.thoughtSignature),a.push({type:`thinking_delta`,contentIndex:h(),delta:e.text,partial:t})):(d.text+=e.text,d.textSignature=m(d.textSignature,e.thoughtSignature),a.push({type:`text_delta`,contentIndex:h(),delta:e.text,partial:t}))}if(e.functionCall){d&&=(d.type===`text`?a.push({type:`text_end`,contentIndex:h(),content:d.text,partial:t}):a.push({type:`thinking_end`,contentIndex:h(),content:d.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),a.push({type:`toolcall_start`,contentIndex:h(),partial:t}),a.push({type:`toolcall_delta`,contentIndex:h(),delta:JSON.stringify(r.arguments),partial:t}),a.push({type:`toolcall_end`,contentIndex:h(),toolCall:r,partial:t})}}i?.finishReason&&(t.rawStopReason=i.finishReason,t.stopReason=p(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}},o(e,t.usage))}if(d&&(d.type===`text`?a.push({type:`text_end`,contentIndex:h(),content:d.text,partial:t}):a.push({type:`thinking_end`,contentIndex:h(),content:d.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)}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=f(d(e)),a.push({type:`error`,reason:t.stopReason,error:t}),a.end()}})(),a},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 o=a(e,n.reasoning);if(o===`off`)return O(e,t,{...i,thinking:{enabled:!1}});let s=w(e,o);return S(e)?O(e,t,{...i,thinking:{enabled:!0,level:g(s)}}):O(e,t,{...i,thinking:{enabled:!0,budgetTokens:M(e,s,n.thinkingBudgets)}})};function A(e,t,n){let r={};e.baseUrl&&(r.baseUrl=e.baseUrl,r.apiVersion=``);let i=s({"User-Agent":c(),...e.headers,...n});return i&&(r.headers=i),new y({apiKey:t,httpOptions:Object.keys(r).length>0?r:void 0})}function j(n,i,a={}){let o=T(n,i),s=r(i.messages),c=e(i.messages),l={};a.temperature!==void 0&&(l.temperature=a.temperature),a.maxTokens!==void 0&&(l.maxOutputTokens=a.maxTokens);let d=E(n.id),f=c.length>0?x(c,a.toolChoice,d):void 0,p=s?t(s):``,m={...Object.keys(l).length>0&&l,...p&&{systemInstruction:u(p)},...c.length>0&&{tools:b(c,!1,d)},...f!==void 0&&{toolConfig:{functionCallingConfig:{mode:f}}}};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=h(a.thinking.level),m.thinkingConfig=e}else n.reasoning&&a.thinking&&!a.thinking.enabled&&(m.thinkingConfig=C(n));if(a.signal){if(a.signal.aborted)throw Error(`Request aborted`);m.abortSignal=a.signal}return{model:n.id,contents:o,config:m}}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};
1
+ import{a as e,m as t,n,s as r}from"./preload-helper-DY31Aviq.js";import{a as i}from"./diagnostics-CxvqSC4Q.js";import{n as a,t as o}from"./models-BM_0GHMS.js";import{n as s}from"./headers-FK4rgixo.js";import{h as c,i as l}from"./transform-messages-B1nXfhYd.js";import{t as u}from"./sanitize-unicode-DmIE6hZJ.js";import{n as d,t as f}from"./error-body-pkrba6pf.js";import{a as p,c as m,d as h,f as g,i as _,l as v,m as y,n as b,o as x,p as S,r as C,s as w,t as T,u as E}from"./google-shared-CC7Fhi9a.js";var D=0,O=(e,t,r)=>{let a=new i,s=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),c=j(e,s,r),l=await r?.onPayload?.(c,e);l!==void 0&&(c=l);let u=await v(()=>i.models.generateContentStream(c),r);a.push({type:`start`,partial:t});let d=null,f=t.content,h=()=>f.length-1;for await(let n of u){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=_(e);(!d||n&&d.type!==`thinking`||!n&&d.type!==`text`)&&(d&&(d.type===`text`?a.push({type:`text_end`,contentIndex:f.length-1,content:d.text,partial:t}):a.push({type:`thinking_end`,contentIndex:h(),content:d.thinking,partial:t})),n?(d={type:`thinking`,thinking:``,thinkingSignature:void 0},t.content.push(d),a.push({type:`thinking_start`,contentIndex:h(),partial:t})):(d={type:`text`,text:``},t.content.push(d),a.push({type:`text_start`,contentIndex:h(),partial:t}))),d.type===`thinking`?(d.thinking+=e.text,d.thinkingSignature=m(d.thinkingSignature,e.thoughtSignature),a.push({type:`thinking_delta`,contentIndex:h(),delta:e.text,partial:t})):(d.text+=e.text,d.textSignature=m(d.textSignature,e.thoughtSignature),a.push({type:`text_delta`,contentIndex:h(),delta:e.text,partial:t}))}if(e.functionCall){d&&=(d.type===`text`?a.push({type:`text_end`,contentIndex:h(),content:d.text,partial:t}):a.push({type:`thinking_end`,contentIndex:h(),content:d.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),a.push({type:`toolcall_start`,contentIndex:h(),partial:t}),a.push({type:`toolcall_delta`,contentIndex:h(),delta:JSON.stringify(r.arguments),partial:t}),a.push({type:`toolcall_end`,contentIndex:h(),toolCall:r,partial:t})}}i?.finishReason&&(t.rawStopReason=i.finishReason,t.stopReason=p(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}},o(e,t.usage))}if(d&&(d.type===`text`?a.push({type:`text_end`,contentIndex:h(),content:d.text,partial:t}):a.push({type:`thinking_end`,contentIndex:h(),content:d.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)}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=f(d(e)),a.push({type:`error`,reason:t.stopReason,error:t}),a.end()}})(),a},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 o=a(e,n.reasoning);if(o===`off`)return O(e,t,{...i,thinking:{enabled:!1}});let s=w(e,o);return S(e)?O(e,t,{...i,thinking:{enabled:!0,level:g(s)}}):O(e,t,{...i,thinking:{enabled:!0,budgetTokens:M(e,s,n.thinkingBudgets)}})};function A(e,t,n){let r={};e.baseUrl&&(r.baseUrl=e.baseUrl,r.apiVersion=``);let i=s({"User-Agent":c(),...e.headers,...n});return i&&(r.headers=i),new y({apiKey:t,httpOptions:Object.keys(r).length>0?r:void 0})}function j(n,i,a={}){let o=T(n,i),s=r(i.messages),c=e(i.messages),l={};a.temperature!==void 0&&(l.temperature=a.temperature),a.maxTokens!==void 0&&(l.maxOutputTokens=a.maxTokens);let d=E(n.id),f=c.length>0?x(c,a.toolChoice,d):void 0,p=s?t(s):``,m={...Object.keys(l).length>0&&l,...p&&{systemInstruction:u(p)},...c.length>0&&{tools:b(c,!1,d)},...f!==void 0&&{toolConfig:{functionCallingConfig:{mode:f}}}};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=h(a.thinking.level),m.thinkingConfig=e}else n.reasoning&&a.thinking&&!a.thinking.enabled&&(m.thinkingConfig=C(n));if(a.signal){if(a.signal.aborted)throw Error(`Request aborted`);m.abortSignal=a.signal}return{model:n.id,contents:o,config:m}}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};