@chatpanel/events 0.453.1 → 0.454.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/chap-face.js +1 -0
- package/package.json +3 -1
package/chap-face.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const k="#2046f5",w=Object.freeze(["idle","listening","thinking","speaking","muted"]),b=[38,59],m=4.2,l=.15;function _({state:t="idle",t:n=0,level:e=0,still:h=!1}={}){const o=w.includes(t)?t:"idle",c=((n+1.3)%m+m)%m,f=h?1:c<l?Math.max(.08,Math.abs(c-l/2)/(l/2)):1,u=o==="listening"?Math.min(Math.max(Number(e)||0,0),1):0,x=h?0:o==="thinking"?3*Math.sin(n*1.9):o==="listening"?3*u:0,y=o==="thinking"&&!h?-4:0,a=24*((o==="muted"?.45:1)*f*(1+.12*u)),M=b.map(s=>({x:s+x,y:50+(24-a)/2+y,w:12,h:a,r:Math.min(6,a/2)}));let $=null;if(o==="speaking"){const s=n*2*Math.PI,d=h?.5:(.55+.45*Math.sin(s*7.3))*(.6+.4*Math.sin(s*2.9+1.1)),r=3+9*Math.min(Math.max(d,0),1);$={x:46.5+x,y:84-r/2,w:16,h:r,r:Math.min(16,r)/2}}return{eyes:M,mouth:$}}const i=t=>Math.round(t*10)/10,g=(t,n)=>`<rect x="${i(t.x)}" y="${i(t.y)}" width="${i(t.w)}" height="${i(t.h)}" rx="${i(t.r)}" fill="${n}"/>`;function P(t,{plate:n=k,body:e="#fff",label:h="Chap"}={}){const o=[...t.eyes.map(c=>g(c,n)),t.mouth?g(t.mouth,n):""];return`<svg viewBox="0 0 128 128" role="img" aria-label="${h}"><rect width="128" height="128" rx="28" fill="${n}"/><rect x="22" y="28" width="84" height="72" rx="32" fill="${e}"/>${o.join("")}</svg>`}function S(t){const n=t.eyes[0].h/24,e=n>.66?"▮":n>.3?"▬":"‿",h=t.eyes[0].x-38,o=h>1.5?` ${e} ${e}`:h<-1.5?`${e} ${e} `:`${e} ${e} `,c=t.mouth?t.mouth.h>8?"O":t.mouth.h>5?"o":"-":" ";return`(${o}${c})`}export{k as CHAP_COBALT,w as CHAP_STATES,P as chapFaceSvg,S as chapFaceText,_ as chapPose};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatpanel/events",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.454.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",
|
|
@@ -129,6 +129,7 @@
|
|
|
129
129
|
"./meeting-analyzers.js": "./meeting-analyzers.js",
|
|
130
130
|
"./meeting-insights.js": "./meeting-insights.js",
|
|
131
131
|
"./meeting-followup.js": "./meeting-followup.js",
|
|
132
|
+
"./chap-face.js": "./chap-face.js",
|
|
132
133
|
"./meeting-insight-prompts.js": "./meeting-insight-prompts.js",
|
|
133
134
|
"./meeting-shape.js": "./meeting-shape.js",
|
|
134
135
|
"./meeting-speakers.js": "./meeting-speakers.js",
|
|
@@ -491,6 +492,7 @@
|
|
|
491
492
|
"meeting-analyzers.js",
|
|
492
493
|
"meeting-insights.js",
|
|
493
494
|
"meeting-followup.js",
|
|
495
|
+
"chap-face.js",
|
|
494
496
|
"meeting-insight-prompts.js",
|
|
495
497
|
"meeting-shape.js",
|
|
496
498
|
"meeting-speakers.js",
|