@chatpanel/events 0.454.0 → 0.455.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 (2) hide show
  1. package/package.json +3 -1
  2. package/speech-remote.js +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chatpanel/events",
3
- "version": "0.454.0",
3
+ "version": "0.455.0",
4
4
  "description": "The canonical ChatPanel event-log and capability contracts — typed durable facts, clock-free deterministic linearization, schema upcasting, and the invariants the replay harness asserts. Pure, dependency-free ESM shared by the ChatPanel extension, gateway and bridge.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -130,6 +130,7 @@
130
130
  "./meeting-insights.js": "./meeting-insights.js",
131
131
  "./meeting-followup.js": "./meeting-followup.js",
132
132
  "./chap-face.js": "./chap-face.js",
133
+ "./speech-remote.js": "./speech-remote.js",
133
134
  "./meeting-insight-prompts.js": "./meeting-insight-prompts.js",
134
135
  "./meeting-shape.js": "./meeting-shape.js",
135
136
  "./meeting-speakers.js": "./meeting-speakers.js",
@@ -493,6 +494,7 @@
493
494
  "meeting-insights.js",
494
495
  "meeting-followup.js",
495
496
  "chap-face.js",
497
+ "speech-remote.js",
496
498
  "meeting-insight-prompts.js",
497
499
  "meeting-shape.js",
498
500
  "meeting-speakers.js",
@@ -0,0 +1 @@
1
+ import{isVoiceId as s,vendorOf as d}from"./endpoint-jobs.js";const m="eleven_flash_v2_5",a=24e3,c=2500;function h(n){const o=String(n||"");let e=/^el:([^/]{1,80})\/([A-Za-z0-9_-]{1,64})$/.exec(o);return e?{kind:"elevenlabs",endpoint:e[1],voice:e[2]}:(e=/^link:([^/]{1,120})(?:\/(.{1,64}))?$/.exec(o),e?{kind:"link",computer:e[1],voice:e[2]||null}:{kind:"local",id:o})}function u({kind:n,endpoint:o,voice:e,computer:i}={}){return n==="elevenlabs"&&o&&s(e)?`el:${o}/${e}`:n==="link"&&i?`link:${i}${e?`/${e}`:""}`:""}const p=Object.freeze({elevenlabs:"What Chap says aloud is sent to ElevenLabs to be voiced, with your API key.",link:"What Chap says aloud is voiced by your computer, over the Link."});function y({ep:n,voice:o,text:e,model:i=null}={}){const t=String(e||"").trim().slice(0,c);if(!t||!n?.apiKey||!s(o))return null;const r=String(n.baseUrl||"https://api.elevenlabs.io/v1").replace(/\/+$/,""),l=i||(typeof n.model=="string"&&/^eleven_/.test(n.model)&&!/scribe|sts/.test(n.model)?n.model:m);return{url:`${r}/text-to-speech/${o}/stream?output_format=pcm_${a}`,method:"POST",headers:{"xi-api-key":n.apiKey,"content-type":"application/json",accept:"audio/pcm"},body:JSON.stringify({text:t,model_id:l}),audio:{encoding:"pcm16le",rate:a,channels:1}}}function b({voice:n=null,text:o}={}){const e=String(o||"").trim().slice(0,c);return e?{method:"POST",path:"/v1/audio/speech",headers:{"content-type":"application/json"},body:JSON.stringify({input:e,response_format:"wav",...n?{voice:n}:{}}),audio:{encoding:"wav"}}:null}function k({endpoints:n=[],voices:o={},computers:e=[]}={}){const i=[];for(const t of n){if(!t?.id||d(t)!=="elevenlabs")continue;const r=Array.isArray(o[t.id])?o[t.id]:[];i.push({kind:"elevenlabs",title:t.name||"ElevenLabs",endpoint:t.id,note:p.elevenlabs,options:r.map(l=>({value:u({kind:"elevenlabs",endpoint:t.id,voice:l.id}),label:l.name,...l.note?{note:l.note}:{}}))})}for(const t of e)t?.key&&i.push({kind:"link",title:t.name||"Your computer",note:p.link,options:[{value:u({kind:"link",computer:t.key}),label:`${t.name||"Your computer"}'s voice`}]});return i}export{a as ELEVENLABS_PCM_RATE,m as ELEVENLABS_SPEECH_MODEL,p as SPEECH_EGRESS_NOTE,y as elevenLabsSpeechRequest,b as linkSpeechRequest,h as parseSpeechVoice,k as remoteSpeechChoices,u as speechVoiceValue};