@voqalize/avatar 0.2.2 → 0.4.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/LICENSE +21 -661
- package/LICENSE-CC-BY-4.0 +396 -0
- package/README.md +191 -662
- package/assets/README.md +48 -0
- package/assets/tanya.glb +0 -0
- package/assets/tara.glb +0 -0
- package/assets/tushar.glb +0 -0
- package/client/Avatar.tsx +57 -0
- package/client/AvatarClient.ts +818 -0
- package/client/arjun.ts +26 -0
- package/client/createAvatar.ts +177 -0
- package/client/createCanvasAvatar.ts +72 -0
- package/client/index.ts +44 -0
- package/client/internal.ts +108 -0
- package/client/interviewer-female.ts +4 -0
- package/client/interviewer-male.ts +4 -0
- package/client/ishita.ts +26 -0
- package/client/kabir.ts +26 -0
- package/client/meera.ts +26 -0
- package/client/naina.ts +26 -0
- package/client/playout.ts +95 -0
- package/client/professional-female-a.ts +4 -0
- package/client/professional-female-b.ts +4 -0
- package/client/professional-male-a.ts +4 -0
- package/client/professional-male-b.ts +4 -0
- package/client/react.ts +13 -0
- package/client/supports.ts +28 -0
- package/client/three/assets.ts +24 -0
- package/client/three/budgets.ts +27 -0
- package/client/three/holds.ts +64 -0
- package/client/three/internal.ts +54 -0
- package/client/three/motion-limits.json +116 -0
- package/client/three/sequences.ts +281 -0
- package/client/three/tanya.ts +69 -0
- package/client/three/tara-rig.ts +1562 -0
- package/client/three/tara.ts +76 -0
- package/client/three/tushar.ts +65 -0
- package/client/types.ts +235 -0
- package/client/useAvatar.ts +74 -0
- package/client/vikram.ts +26 -0
- package/dist/Avatar.d.ts +44 -0
- package/dist/Avatar.d.ts.map +1 -0
- package/{client/dist → dist}/Avatar.js +2 -2
- package/dist/Avatar.js.map +1 -0
- package/dist/AvatarClient.d.ts +274 -0
- package/dist/AvatarClient.d.ts.map +1 -0
- package/dist/AvatarClient.js +712 -0
- package/dist/AvatarClient.js.map +1 -0
- package/dist/arjun.d.ts +7 -0
- package/dist/arjun.d.ts.map +1 -0
- package/dist/arjun.js +20 -0
- package/dist/arjun.js.map +1 -0
- package/dist/createAvatar.d.ts +135 -0
- package/dist/createAvatar.d.ts.map +1 -0
- package/dist/createAvatar.js +75 -0
- package/dist/createAvatar.js.map +1 -0
- package/dist/createCanvasAvatar.d.ts +22 -0
- package/dist/createCanvasAvatar.d.ts.map +1 -0
- package/dist/createCanvasAvatar.js +47 -0
- package/dist/createCanvasAvatar.js.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -0
- package/dist/internal.d.ts +34 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +41 -0
- package/dist/internal.js.map +1 -0
- package/dist/interviewer-female.d.ts +4 -0
- package/dist/interviewer-female.d.ts.map +1 -0
- package/dist/interviewer-female.js +3 -0
- package/dist/interviewer-female.js.map +1 -0
- package/dist/interviewer-male.d.ts +4 -0
- package/dist/interviewer-male.d.ts.map +1 -0
- package/dist/interviewer-male.js +3 -0
- package/dist/interviewer-male.js.map +1 -0
- package/dist/ishita.d.ts +7 -0
- package/dist/ishita.d.ts.map +1 -0
- package/dist/ishita.js +20 -0
- package/dist/ishita.js.map +1 -0
- package/dist/kabir.d.ts +7 -0
- package/dist/kabir.d.ts.map +1 -0
- package/dist/kabir.js +20 -0
- package/dist/kabir.js.map +1 -0
- package/dist/meera.d.ts +7 -0
- package/dist/meera.d.ts.map +1 -0
- package/dist/meera.js +20 -0
- package/dist/meera.js.map +1 -0
- package/dist/naina.d.ts +7 -0
- package/dist/naina.d.ts.map +1 -0
- package/dist/naina.js +20 -0
- package/dist/naina.js.map +1 -0
- package/dist/playout.d.ts +42 -0
- package/dist/playout.d.ts.map +1 -0
- package/dist/playout.js +85 -0
- package/dist/playout.js.map +1 -0
- package/dist/professional-female-a.d.ts +4 -0
- package/dist/professional-female-a.d.ts.map +1 -0
- package/dist/professional-female-a.js +3 -0
- package/dist/professional-female-a.js.map +1 -0
- package/dist/professional-female-b.d.ts +4 -0
- package/dist/professional-female-b.d.ts.map +1 -0
- package/dist/professional-female-b.js +3 -0
- package/dist/professional-female-b.js.map +1 -0
- package/dist/professional-male-a.d.ts +4 -0
- package/dist/professional-male-a.d.ts.map +1 -0
- package/dist/professional-male-a.js +3 -0
- package/dist/professional-male-a.js.map +1 -0
- package/dist/professional-male-b.d.ts +4 -0
- package/dist/professional-male-b.d.ts.map +1 -0
- package/dist/professional-male-b.js +3 -0
- package/dist/professional-male-b.js.map +1 -0
- package/dist/react.d.ts +13 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +13 -0
- package/dist/react.js.map +1 -0
- package/dist/supports.d.ts +20 -0
- package/dist/supports.d.ts.map +1 -0
- package/dist/supports.js +26 -0
- package/dist/supports.js.map +1 -0
- package/dist/three/assets.d.ts +24 -0
- package/dist/three/assets.d.ts.map +1 -0
- package/dist/three/assets.js +22 -0
- package/dist/three/assets.js.map +1 -0
- package/dist/three/budgets.d.ts +17 -0
- package/dist/three/budgets.d.ts.map +1 -0
- package/dist/three/budgets.js +21 -0
- package/dist/three/budgets.js.map +1 -0
- package/dist/three/holds.d.ts +33 -0
- package/dist/three/holds.d.ts.map +1 -0
- package/dist/three/holds.js +56 -0
- package/dist/three/holds.js.map +1 -0
- package/dist/three/internal.d.ts +52 -0
- package/dist/three/internal.d.ts.map +1 -0
- package/dist/three/internal.js +49 -0
- package/dist/three/internal.js.map +1 -0
- package/dist/three/motion-limits.json +116 -0
- package/dist/three/sequences.d.ts +71 -0
- package/dist/three/sequences.d.ts.map +1 -0
- package/dist/three/sequences.js +262 -0
- package/dist/three/sequences.js.map +1 -0
- package/dist/three/tanya.d.ts +35 -0
- package/dist/three/tanya.d.ts.map +1 -0
- package/dist/three/tanya.js +51 -0
- package/dist/three/tanya.js.map +1 -0
- package/dist/three/tara-rig.d.ts +403 -0
- package/dist/three/tara-rig.d.ts.map +1 -0
- package/dist/three/tara-rig.js +1500 -0
- package/dist/three/tara-rig.js.map +1 -0
- package/dist/three/tara.d.ts +35 -0
- package/dist/three/tara.d.ts.map +1 -0
- package/dist/three/tara.js +58 -0
- package/dist/three/tara.js.map +1 -0
- package/dist/three/tushar.d.ts +31 -0
- package/dist/three/tushar.d.ts.map +1 -0
- package/dist/three/tushar.js +47 -0
- package/dist/three/tushar.js.map +1 -0
- package/dist/types.d.ts +149 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +140 -0
- package/dist/types.js.map +1 -0
- package/dist/useAvatar.d.ts +39 -0
- package/dist/useAvatar.d.ts.map +1 -0
- package/dist/useAvatar.js +35 -0
- package/dist/useAvatar.js.map +1 -0
- package/dist/vikram.d.ts +7 -0
- package/dist/vikram.d.ts.map +1 -0
- package/dist/vikram.js +20 -0
- package/dist/vikram.js.map +1 -0
- package/package.json +110 -25
- package/src/avatar.d.ts +218 -120
- package/src/avatar.js +950 -213
- package/src/behavior.d.ts +42 -0
- package/src/behavior.js +114 -0
- package/src/camera.js +29 -0
- package/src/canvas/author/parts/eye.mjs +722 -0
- package/src/canvas/author/parts/hand.mjs +1156 -0
- package/src/canvas/author/parts/mouth.mjs +741 -0
- package/src/canvas/author/parts/nose.mjs +100 -0
- package/src/canvas/author/parts/skin-detail.mjs +67 -0
- package/src/canvas/author/path.mjs +283 -0
- package/src/canvas/author/rig.mjs +405 -0
- package/src/canvas/avatars/round/face.d.mts +3 -0
- package/src/canvas/avatars/round/face.mjs +1307 -0
- package/src/canvas/create-rig.d.ts +15 -0
- package/src/canvas/create-rig.js +100 -0
- package/src/canvas/data/img/professional-female-a-hair-back.webp +0 -0
- package/src/canvas/data/img/professional-female-a-hair-front.webp +0 -0
- package/src/canvas/data/img/professional-female-a-top-body.webp +0 -0
- package/src/canvas/data/img/professional-female-b-hair-back.webp +0 -0
- package/src/canvas/data/img/professional-female-b-hair-front.webp +0 -0
- package/src/canvas/data/img/professional-female-b-top-body.webp +0 -0
- package/src/canvas/data/img/professional-male-a-hair-back.webp +0 -0
- package/src/canvas/data/img/professional-male-a-hair-front.webp +0 -0
- package/src/canvas/data/img/professional-male-a-top-body.webp +0 -0
- package/src/canvas/data/img/professional-male-b-hair-back.webp +0 -0
- package/src/canvas/data/img/professional-male-b-hair-front.webp +0 -0
- package/src/canvas/data/img/professional-male-b-top-body.webp +0 -0
- package/src/canvas/data/img/round-m3-hair-back.webp +0 -0
- package/src/canvas/data/img/round-m3-hair-front.webp +0 -0
- package/src/canvas/data/img/round-m3-top-body.webp +0 -0
- package/src/canvas/data/img/round-w1-hair-back.webp +0 -0
- package/src/canvas/data/img/round-w1-hair-front.webp +0 -0
- package/src/canvas/data/img/round-w1-top-body.webp +0 -0
- package/src/canvas/data/interviewer-female.rig.json +1 -0
- package/src/canvas/data/interviewer-male.rig.json +1 -0
- package/src/canvas/data/professional-female-a.rig.json +1 -0
- package/src/canvas/data/professional-female-b.rig.json +1 -0
- package/src/canvas/data/professional-male-a.rig.json +1 -0
- package/src/canvas/data/professional-male-b.rig.json +1 -0
- package/src/canvas/src/live.js +508 -0
- package/src/canvas/src/render2d.js +218 -0
- package/src/canvas/src/rig.js +297 -0
- package/src/canvas/src/vocab.js +96 -0
- package/src/clips.js +18 -7
- package/src/conformance.js +119 -0
- package/src/emotions.js +8 -5
- package/src/face-core.js +27 -1
- package/src/face-myna.d.ts +7 -0
- package/src/face-myna.js +192 -131
- package/src/face-peep-control-plane.js +167 -0
- package/src/face-peep.d.ts +7 -0
- package/src/face-peep.js +274 -116
- package/src/face-wren.d.ts +7 -0
- package/src/face-wren.js +17 -19
- package/src/faces.d.ts +12 -0
- package/src/faces.js +53 -0
- package/src/gaze.js +434 -58
- package/src/hand.js +120 -91
- package/src/head.js +134 -0
- package/src/idle.js +227 -119
- package/src/interjections.js +200 -31
- package/src/params.js +8 -4
- package/src/perform.js +7 -9
- package/src/prosody.js +647 -0
- package/src/rig.d.ts +24 -0
- package/src/rig.js +32 -0
- package/src/speech-timing.js +23 -0
- package/src/visemes.js +110 -24
- package/client/dist/Avatar.d.ts +0 -27
- package/client/dist/Avatar.d.ts.map +0 -1
- package/client/dist/Avatar.js.map +0 -1
- package/client/dist/AvatarClient.d.ts +0 -139
- package/client/dist/AvatarClient.d.ts.map +0 -1
- package/client/dist/AvatarClient.js +0 -223
- package/client/dist/AvatarClient.js.map +0 -1
- package/client/dist/index.d.ts +0 -22
- package/client/dist/index.d.ts.map +0 -1
- package/client/dist/index.js +0 -22
- package/client/dist/index.js.map +0 -1
- package/client/dist/types.d.ts +0 -86
- package/client/dist/types.d.ts.map +0 -1
- package/client/dist/types.js +0 -31
- package/client/dist/types.js.map +0 -1
- package/client/dist/useAvatar.d.ts +0 -42
- package/client/dist/useAvatar.d.ts.map +0 -1
- package/client/dist/useAvatar.js +0 -51
- package/client/dist/useAvatar.js.map +0 -1
- package/client/src/Avatar.tsx +0 -33
- package/client/src/AvatarClient.ts +0 -270
- package/client/src/index.ts +0 -22
- package/client/src/types.ts +0 -104
- package/client/src/useAvatar.ts +0 -85
- package/docs/contract-avatar.md +0 -371
- package/docs/contract-protocol.md +0 -461
package/dist/kabir.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Relaxed professional male avatar, authored to read at call-tile size. */
|
|
2
|
+
import type { CanvasAvatarOptions } from './createCanvasAvatar.js';
|
|
3
|
+
import type { AvatarInstance } from './createAvatar.js';
|
|
4
|
+
export type { CanvasAvatarOptions };
|
|
5
|
+
export { supports } from './supports.js';
|
|
6
|
+
export declare function createAvatar(options: CanvasAvatarOptions): AvatarInstance;
|
|
7
|
+
//# sourceMappingURL=kabir.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kabir.d.ts","sourceRoot":"","sources":["../client/kabir.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAG5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAUxD,YAAY,EAAE,mBAAmB,EAAE,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,cAAc,CAOzE"}
|
package/dist/kabir.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Relaxed professional male avatar, authored to read at call-tile size. */
|
|
2
|
+
import { createCanvasAvatar } from './createCanvasAvatar.js';
|
|
3
|
+
const RIG_URL = new URL('../src/canvas/data/professional-male-b.rig.json', import.meta.url);
|
|
4
|
+
const IMAGES = {
|
|
5
|
+
'professional-male-b-top-body.webp': new URL('../src/canvas/data/img/professional-male-b-top-body.webp', import.meta.url),
|
|
6
|
+
'professional-male-b-hair-back.webp': new URL('../src/canvas/data/img/professional-male-b-hair-back.webp', import.meta.url),
|
|
7
|
+
'professional-male-b-hair-front.webp': new URL('../src/canvas/data/img/professional-male-b-hair-front.webp', import.meta.url),
|
|
8
|
+
};
|
|
9
|
+
const FACE = () => import('../src/canvas/avatars/round/face.mjs');
|
|
10
|
+
// Same mixer, same clip library, so the same declaration (`supports.ts`).
|
|
11
|
+
export { supports } from './supports.js';
|
|
12
|
+
export function createAvatar(options) {
|
|
13
|
+
return createCanvasAvatar(options, {
|
|
14
|
+
rigUrl: RIG_URL,
|
|
15
|
+
images: IMAGES,
|
|
16
|
+
face: FACE,
|
|
17
|
+
label: 'Kabir — relaxed professional male avatar',
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=kabir.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kabir.js","sourceRoot":"","sources":["../client/kabir.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAE5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAI7D,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,iDAAiD,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC5F,MAAM,MAAM,GAAG;IACb,mCAAmC,EAAE,IAAI,GAAG,CAAC,0DAA0D,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;IACzH,oCAAoC,EAAE,IAAI,GAAG,CAAC,2DAA2D,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;IAC3H,qCAAqC,EAAE,IAAI,GAAG,CAAC,4DAA4D,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;CACrH,CAAC;AACX,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,sCAAsC,CAAC,CAAC;AAGlE,0EAA0E;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,UAAU,YAAY,CAAC,OAA4B;IACvD,OAAO,kBAAkB,CAAC,OAAO,EAAE;QACjC,MAAM,EAAE,OAAO;QACf,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,0CAA0C;KAClD,CAAC,CAAC;AACL,CAAC"}
|
package/dist/meera.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Professional Indian female interviewer, authored to read at call-tile size. */
|
|
2
|
+
import type { CanvasAvatarOptions } from './createCanvasAvatar.js';
|
|
3
|
+
import type { AvatarInstance } from './createAvatar.js';
|
|
4
|
+
export type { CanvasAvatarOptions };
|
|
5
|
+
export { supports } from './supports.js';
|
|
6
|
+
export declare function createAvatar(options: CanvasAvatarOptions): AvatarInstance;
|
|
7
|
+
//# sourceMappingURL=meera.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meera.d.ts","sourceRoot":"","sources":["../client/meera.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAGlF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAUxD,YAAY,EAAE,mBAAmB,EAAE,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,cAAc,CAOzE"}
|
package/dist/meera.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Professional Indian female interviewer, authored to read at call-tile size. */
|
|
2
|
+
import { createCanvasAvatar } from './createCanvasAvatar.js';
|
|
3
|
+
const RIG_URL = new URL('../src/canvas/data/interviewer-female.rig.json', import.meta.url);
|
|
4
|
+
const IMAGES = {
|
|
5
|
+
'round-w1-hair-back.webp': new URL('../src/canvas/data/img/round-w1-hair-back.webp', import.meta.url),
|
|
6
|
+
'round-w1-top-body.webp': new URL('../src/canvas/data/img/round-w1-top-body.webp', import.meta.url),
|
|
7
|
+
'round-w1-hair-front.webp': new URL('../src/canvas/data/img/round-w1-hair-front.webp', import.meta.url),
|
|
8
|
+
};
|
|
9
|
+
const FACE = () => import('../src/canvas/avatars/round/face.mjs');
|
|
10
|
+
// Same mixer, same clip library, so the same declaration (`supports.ts`).
|
|
11
|
+
export { supports } from './supports.js';
|
|
12
|
+
export function createAvatar(options) {
|
|
13
|
+
return createCanvasAvatar(options, {
|
|
14
|
+
rigUrl: RIG_URL,
|
|
15
|
+
images: IMAGES,
|
|
16
|
+
face: FACE,
|
|
17
|
+
label: 'Meera — professional female interviewer avatar',
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=meera.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meera.js","sourceRoot":"","sources":["../client/meera.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAElF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAI7D,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,gDAAgD,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3F,MAAM,MAAM,GAAG;IACb,yBAAyB,EAAE,IAAI,GAAG,CAAC,gDAAgD,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;IACrG,wBAAwB,EAAE,IAAI,GAAG,CAAC,+CAA+C,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;IACnG,0BAA0B,EAAE,IAAI,GAAG,CAAC,iDAAiD,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;CAC/F,CAAC;AACX,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,sCAAsC,CAAC,CAAC;AAGlE,0EAA0E;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,UAAU,YAAY,CAAC,OAA4B;IACvD,OAAO,kBAAkB,CAAC,OAAO,EAAE;QACjC,MAAM,EAAE,OAAO;QACf,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,gDAAgD;KACxD,CAAC,CAAC;AACL,CAAC"}
|
package/dist/naina.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Relaxed professional female avatar, authored to read at call-tile size. */
|
|
2
|
+
import type { CanvasAvatarOptions } from './createCanvasAvatar.js';
|
|
3
|
+
import type { AvatarInstance } from './createAvatar.js';
|
|
4
|
+
export type { CanvasAvatarOptions };
|
|
5
|
+
export { supports } from './supports.js';
|
|
6
|
+
export declare function createAvatar(options: CanvasAvatarOptions): AvatarInstance;
|
|
7
|
+
//# sourceMappingURL=naina.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"naina.d.ts","sourceRoot":"","sources":["../client/naina.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAG9E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAUxD,YAAY,EAAE,mBAAmB,EAAE,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,cAAc,CAOzE"}
|
package/dist/naina.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Relaxed professional female avatar, authored to read at call-tile size. */
|
|
2
|
+
import { createCanvasAvatar } from './createCanvasAvatar.js';
|
|
3
|
+
const RIG_URL = new URL('../src/canvas/data/professional-female-b.rig.json', import.meta.url);
|
|
4
|
+
const IMAGES = {
|
|
5
|
+
'professional-female-b-top-body.webp': new URL('../src/canvas/data/img/professional-female-b-top-body.webp', import.meta.url),
|
|
6
|
+
'professional-female-b-hair-back.webp': new URL('../src/canvas/data/img/professional-female-b-hair-back.webp', import.meta.url),
|
|
7
|
+
'professional-female-b-hair-front.webp': new URL('../src/canvas/data/img/professional-female-b-hair-front.webp', import.meta.url),
|
|
8
|
+
};
|
|
9
|
+
const FACE = () => import('../src/canvas/avatars/round/face.mjs');
|
|
10
|
+
// Same mixer, same clip library, so the same declaration (`supports.ts`).
|
|
11
|
+
export { supports } from './supports.js';
|
|
12
|
+
export function createAvatar(options) {
|
|
13
|
+
return createCanvasAvatar(options, {
|
|
14
|
+
rigUrl: RIG_URL,
|
|
15
|
+
images: IMAGES,
|
|
16
|
+
face: FACE,
|
|
17
|
+
label: 'Naina — relaxed professional female avatar',
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=naina.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"naina.js","sourceRoot":"","sources":["../client/naina.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAE9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAI7D,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,mDAAmD,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC9F,MAAM,MAAM,GAAG;IACb,qCAAqC,EAAE,IAAI,GAAG,CAAC,4DAA4D,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;IAC7H,sCAAsC,EAAE,IAAI,GAAG,CAAC,6DAA6D,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;IAC/H,uCAAuC,EAAE,IAAI,GAAG,CAAC,8DAA8D,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;CACzH,CAAC;AACX,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,sCAAsC,CAAC,CAAC;AAGlE,0EAA0E;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,UAAU,YAAY,CAAC,OAA4B;IACvD,OAAO,kBAAkB,CAAC,OAAO,EAAE;QACjC,MAAM,EAAE,OAAO;QACf,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,4CAA4C;KACpD,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* When the bot's audio actually begins, heard on the track the browser plays.
|
|
3
|
+
*
|
|
4
|
+
* `BotStartedSpeaking` and the audio reach the browser by different roads —
|
|
5
|
+
* the event on the data channel, the sound over RTP and through a jitter
|
|
6
|
+
* buffer — so the event is a statement about *which* audio is starting and
|
|
7
|
+
* not about when anyone hears it. Measured on two stacks, the event arrived
|
|
8
|
+
* 57 ms after the first sample on one and 160 ms before it on the other: the
|
|
9
|
+
* mouth lagged the voice on the first and ran ahead of it on the second, and
|
|
10
|
+
* no constant corrects both. So the turn clock is anchored to the sound.
|
|
11
|
+
*
|
|
12
|
+
* What makes "the sound began" observable is that between turns the decoded
|
|
13
|
+
* track is exact digital zero — Opus decodes silence to silence — so onset is
|
|
14
|
+
* the first sample off zero, not a speech detector's guess at a threshold. That
|
|
15
|
+
* matters: cue `t: 0` is the first sample the TTS produced, lead-in included,
|
|
16
|
+
* and a detector keyed to *speech* would anchor 20-50 ms into the lead-in.
|
|
17
|
+
*
|
|
18
|
+
* What this probe hears is the sound entering the page's audio graph, not
|
|
19
|
+
* leaving the speaker. For a wired speaker the difference is about what the
|
|
20
|
+
* compositor and display add to the picture, and the two cancel. A Bluetooth
|
|
21
|
+
* headset adds 150-250 ms that nothing on the picture side matches, so the
|
|
22
|
+
* probe also reports the device latency the browser admits to, and the
|
|
23
|
+
* client delays the mouth by the excess (`AvatarClient.ts`).
|
|
24
|
+
*/
|
|
25
|
+
export interface PlayoutProbe {
|
|
26
|
+
/**
|
|
27
|
+
* Where the bot's current sound began, on the caller's `now()` clock.
|
|
28
|
+
* `null`: the track is silent right now. `undefined`: this probe cannot say —
|
|
29
|
+
* the track has been sounding for longer than it can look back, or the
|
|
30
|
+
* audio graph is not running.
|
|
31
|
+
*/
|
|
32
|
+
onset(): number | null | undefined;
|
|
33
|
+
/** The output device's latency as this context reports it, in ms; 0 when it
|
|
34
|
+
* will not say. The probe shares the device the call's audio plays on. */
|
|
35
|
+
outputLatencyMs?(): number;
|
|
36
|
+
/** Ask a suspended graph to run. A browser that needs a gesture for it
|
|
37
|
+
* ignores the request outside one, so this is safe to call at any time. */
|
|
38
|
+
resume?(): void;
|
|
39
|
+
dispose(): void;
|
|
40
|
+
}
|
|
41
|
+
export declare function createPlayoutProbe(track: MediaStreamTrack, now: () => number): PlayoutProbe | null;
|
|
42
|
+
//# sourceMappingURL=playout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playout.d.ts","sourceRoot":"","sources":["../client/playout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,KAAK,IAAI,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACnC;8EAC0E;IAC1E,eAAe,CAAC,IAAI,MAAM,CAAC;IAC3B;+EAC2E;IAC3E,MAAM,CAAC,IAAI,IAAI,CAAC;IAChB,OAAO,IAAI,IAAI,CAAC;CACjB;AASD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,MAAM,GAAG,YAAY,GAAG,IAAI,CA6ClG"}
|
package/dist/playout.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* When the bot's audio actually begins, heard on the track the browser plays.
|
|
3
|
+
*
|
|
4
|
+
* `BotStartedSpeaking` and the audio reach the browser by different roads —
|
|
5
|
+
* the event on the data channel, the sound over RTP and through a jitter
|
|
6
|
+
* buffer — so the event is a statement about *which* audio is starting and
|
|
7
|
+
* not about when anyone hears it. Measured on two stacks, the event arrived
|
|
8
|
+
* 57 ms after the first sample on one and 160 ms before it on the other: the
|
|
9
|
+
* mouth lagged the voice on the first and ran ahead of it on the second, and
|
|
10
|
+
* no constant corrects both. So the turn clock is anchored to the sound.
|
|
11
|
+
*
|
|
12
|
+
* What makes "the sound began" observable is that between turns the decoded
|
|
13
|
+
* track is exact digital zero — Opus decodes silence to silence — so onset is
|
|
14
|
+
* the first sample off zero, not a speech detector's guess at a threshold. That
|
|
15
|
+
* matters: cue `t: 0` is the first sample the TTS produced, lead-in included,
|
|
16
|
+
* and a detector keyed to *speech* would anchor 20-50 ms into the lead-in.
|
|
17
|
+
*
|
|
18
|
+
* What this probe hears is the sound entering the page's audio graph, not
|
|
19
|
+
* leaving the speaker. For a wired speaker the difference is about what the
|
|
20
|
+
* compositor and display add to the picture, and the two cancel. A Bluetooth
|
|
21
|
+
* headset adds 150-250 ms that nothing on the picture side matches, so the
|
|
22
|
+
* probe also reports the device latency the browser admits to, and the
|
|
23
|
+
* client delays the mouth by the excess (`AvatarClient.ts`).
|
|
24
|
+
*/
|
|
25
|
+
/** 8192 samples is 170 ms at 48 kHz: past the 57 ms the sound has been seen to
|
|
26
|
+
* lead the event by, with room for a slower network. */
|
|
27
|
+
const WINDOW = 8192;
|
|
28
|
+
/** -80 dBFS. The gaps between turns are exact zero; this only keeps a
|
|
29
|
+
* denormal from reading as speech. */
|
|
30
|
+
const FLOOR = 1e-4;
|
|
31
|
+
export function createPlayoutProbe(track, now) {
|
|
32
|
+
const Ctx = globalThis.AudioContext;
|
|
33
|
+
if (!Ctx)
|
|
34
|
+
return null;
|
|
35
|
+
let ctx;
|
|
36
|
+
let source;
|
|
37
|
+
let analyser;
|
|
38
|
+
try {
|
|
39
|
+
ctx = new Ctx();
|
|
40
|
+
source = ctx.createMediaStreamSource(new MediaStream([track]));
|
|
41
|
+
analyser = ctx.createAnalyser();
|
|
42
|
+
analyser.fftSize = WINDOW;
|
|
43
|
+
source.connect(analyser);
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
// A context made after the user's connect click is allowed to run; one that
|
|
49
|
+
// is not simply answers `undefined`, and the event anchors the turn.
|
|
50
|
+
ctx.resume().catch(() => { });
|
|
51
|
+
const buf = new Float32Array(WINDOW);
|
|
52
|
+
return {
|
|
53
|
+
onset() {
|
|
54
|
+
if (ctx.state !== "running")
|
|
55
|
+
return undefined;
|
|
56
|
+
analyser.getFloatTimeDomainData(buf);
|
|
57
|
+
const t = now();
|
|
58
|
+
let first = -1;
|
|
59
|
+
for (let i = 0; i < buf.length; i++) {
|
|
60
|
+
if (Math.abs(buf[i]) > FLOOR) {
|
|
61
|
+
first = i;
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (first < 0)
|
|
66
|
+
return null;
|
|
67
|
+
if (first === 0)
|
|
68
|
+
return undefined;
|
|
69
|
+
return t - ((buf.length - first) / ctx.sampleRate) * 1000;
|
|
70
|
+
},
|
|
71
|
+
outputLatencyMs() {
|
|
72
|
+
const s = ctx.outputLatency;
|
|
73
|
+
return typeof s === "number" && Number.isFinite(s) ? s * 1000 : 0;
|
|
74
|
+
},
|
|
75
|
+
resume() {
|
|
76
|
+
if (ctx.state === "suspended")
|
|
77
|
+
ctx.resume().catch(() => { });
|
|
78
|
+
},
|
|
79
|
+
dispose() {
|
|
80
|
+
source.disconnect();
|
|
81
|
+
ctx.close().catch(() => { });
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=playout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playout.js","sourceRoot":"","sources":["../client/playout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAmBH;wDACwD;AACxD,MAAM,MAAM,GAAG,IAAI,CAAC;AACpB;sCACsC;AACtC,MAAM,KAAK,GAAG,IAAI,CAAC;AAEnB,MAAM,UAAU,kBAAkB,CAAC,KAAuB,EAAE,GAAiB;IAC3E,MAAM,GAAG,GAAG,UAAU,CAAC,YAAY,CAAC;IACpC,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IACtB,IAAI,GAAiB,CAAC;IACtB,IAAI,MAAkC,CAAC;IACvC,IAAI,QAAsB,CAAC;IAC3B,IAAI,CAAC;QACH,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;QAChB,MAAM,GAAG,GAAG,CAAC,uBAAuB,CAAC,IAAI,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC/D,QAAQ,GAAG,GAAG,CAAC,cAAc,EAAE,CAAC;QAChC,QAAQ,CAAC,OAAO,GAAG,MAAM,CAAC;QAC1B,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IACD,4EAA4E;IAC5E,qEAAqE;IACrE,GAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAC7B,MAAM,GAAG,GAAG,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC;IAErC,OAAO;QACL,KAAK;YACH,IAAI,GAAG,CAAC,KAAK,KAAK,SAAS;gBAAE,OAAO,SAAS,CAAC;YAC9C,QAAQ,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC;YACrC,MAAM,CAAC,GAAG,GAAG,EAAE,CAAC;YAChB,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC;YACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACpC,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAE,CAAC,GAAG,KAAK,EAAE,CAAC;oBAAC,KAAK,GAAG,CAAC,CAAC;oBAAC,MAAM;gBAAC,CAAC;YACtD,CAAC;YACD,IAAI,KAAK,GAAG,CAAC;gBAAE,OAAO,IAAI,CAAC;YAC3B,IAAI,KAAK,KAAK,CAAC;gBAAE,OAAO,SAAS,CAAC;YAClC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;QAC5D,CAAC;QACD,eAAe;YACb,MAAM,CAAC,GAAG,GAAG,CAAC,aAAa,CAAC;YAC5B,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACpE,CAAC;QACD,MAAM;YACJ,IAAI,GAAG,CAAC,KAAK,KAAK,WAAW;gBAAE,GAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QAC9D,CAAC;QACD,OAAO;YACL,MAAM,CAAC,UAAU,EAAE,CAAC;YACpB,GAAG,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QAC9B,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"professional-female-a.d.ts","sourceRoot":"","sources":["../client/professional-female-a.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAE1F,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"professional-female-a.js","sourceRoot":"","sources":["../client/professional-female-a.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAE1F,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"professional-female-b.d.ts","sourceRoot":"","sources":["../client/professional-female-b.ts"],"names":[],"mappings":"AAAA,yFAAyF;AAEzF,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"professional-female-b.js","sourceRoot":"","sources":["../client/professional-female-b.ts"],"names":[],"mappings":"AAAA,yFAAyF;AAEzF,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"professional-male-a.d.ts","sourceRoot":"","sources":["../client/professional-male-a.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAE1F,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"professional-male-a.js","sourceRoot":"","sources":["../client/professional-male-a.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAE1F,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"professional-male-b.d.ts","sourceRoot":"","sources":["../client/professional-male-b.ts"],"names":[],"mappings":"AAAA,yFAAyF;AAEzF,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"professional-male-b.js","sourceRoot":"","sources":["../client/professional-male-b.ts"],"names":[],"mappings":"AAAA,yFAAyF;AAEzF,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@voqalize/avatar/react` — the avatar as one component.
|
|
3
|
+
*
|
|
4
|
+
* import { Avatar } from "@voqalize/avatar/react";
|
|
5
|
+
*
|
|
6
|
+
* <Avatar client={session.client} className="avatar-tile" />
|
|
7
|
+
*
|
|
8
|
+
* Separate from the main entry so that `createAvatar` costs nothing to a
|
|
9
|
+
* caller who is not on React — React is an optional peer, and a barrel that
|
|
10
|
+
* re-exported this would make it a hard one.
|
|
11
|
+
*/
|
|
12
|
+
export { Avatar, type AvatarProps } from "./Avatar.js";
|
|
13
|
+
//# sourceMappingURL=react.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../client/react.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/react.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@voqalize/avatar/react` — the avatar as one component.
|
|
3
|
+
*
|
|
4
|
+
* import { Avatar } from "@voqalize/avatar/react";
|
|
5
|
+
*
|
|
6
|
+
* <Avatar client={session.client} className="avatar-tile" />
|
|
7
|
+
*
|
|
8
|
+
* Separate from the main entry so that `createAvatar` costs nothing to a
|
|
9
|
+
* caller who is not on React — React is an optional peer, and a barrel that
|
|
10
|
+
* re-exported this would make it a hard one.
|
|
11
|
+
*/
|
|
12
|
+
export { Avatar } from "./Avatar.js";
|
|
13
|
+
//# sourceMappingURL=react.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.js","sourceRoot":"","sources":["../client/react.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,EAAoB,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `supports` for every avatar this package ships — the SVG faces and the six
|
|
3
|
+
* canvas identities alike.
|
|
4
|
+
*
|
|
5
|
+
* It is one constant and one file because they are one renderer: the canvas
|
|
6
|
+
* avatars mount the same mixer with the same clip library, so a second list
|
|
7
|
+
* would be the same list with a second chance to be wrong. It is not in
|
|
8
|
+
* `createAvatar.ts`, where the type is documented, because a value is imported
|
|
9
|
+
* for real — reading it from there would pull `peep`'s drawing into a canvas
|
|
10
|
+
* avatar's bundle.
|
|
11
|
+
*
|
|
12
|
+
* The two required ids first, then this renderer's own catalogue. `ACTION_IDS`
|
|
13
|
+
* already carries `RESPONSE_INTERRUPTED` as this renderer's shape for it, so
|
|
14
|
+
* the join dedupes rather than concatenating, and `ACKNOWLEDGE` is the one name
|
|
15
|
+
* here with no clip behind it because `action()` resolves it on the floor
|
|
16
|
+
* (docs/internal-mixer.md § Actions).
|
|
17
|
+
*/
|
|
18
|
+
import type { AvatarSupport } from "./createAvatar.js";
|
|
19
|
+
export declare const supports: AvatarSupport;
|
|
20
|
+
//# sourceMappingURL=supports.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supports.d.ts","sourceRoot":"","sources":["../client/supports.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGvD,eAAO,MAAM,QAAQ,EAAE,aAKrB,CAAC"}
|
package/dist/supports.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `supports` for every avatar this package ships — the SVG faces and the six
|
|
3
|
+
* canvas identities alike.
|
|
4
|
+
*
|
|
5
|
+
* It is one constant and one file because they are one renderer: the canvas
|
|
6
|
+
* avatars mount the same mixer with the same clip library, so a second list
|
|
7
|
+
* would be the same list with a second chance to be wrong. It is not in
|
|
8
|
+
* `createAvatar.ts`, where the type is documented, because a value is imported
|
|
9
|
+
* for real — reading it from there would pull `peep`'s drawing into a canvas
|
|
10
|
+
* avatar's bundle.
|
|
11
|
+
*
|
|
12
|
+
* The two required ids first, then this renderer's own catalogue. `ACTION_IDS`
|
|
13
|
+
* already carries `RESPONSE_INTERRUPTED` as this renderer's shape for it, so
|
|
14
|
+
* the join dedupes rather than concatenating, and `ACKNOWLEDGE` is the one name
|
|
15
|
+
* here with no clip behind it because `action()` resolves it on the floor
|
|
16
|
+
* (docs/internal-mixer.md § Actions).
|
|
17
|
+
*/
|
|
18
|
+
import { ACTION_IDS } from "../src/avatar.js";
|
|
19
|
+
import { CORE_ACTION_IDS } from "./types.js";
|
|
20
|
+
export const supports = Object.freeze({
|
|
21
|
+
actions: Object.freeze([
|
|
22
|
+
...CORE_ACTION_IDS,
|
|
23
|
+
...ACTION_IDS.filter((id) => !CORE_ACTION_IDS.includes(id)),
|
|
24
|
+
]),
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=supports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supports.js","sourceRoot":"","sources":["../client/supports.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,CAAC,MAAM,QAAQ,GAAkB,MAAM,CAAC,MAAM,CAAC;IACnD,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;QACrB,GAAG,eAAe;QAClB,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAE,eAAqC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;KACnF,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the three compiled characters are, resolved against this module's own
|
|
3
|
+
* location.
|
|
4
|
+
*
|
|
5
|
+
* `new URL(…, import.meta.url)` and not a bundler's asset import: these files
|
|
6
|
+
* are fetched at runtime by a consumer's app, and the spelling has to survive
|
|
7
|
+
* Vite, webpack, Rollup, esbuild, a plain `tsc` output and a browser loading
|
|
8
|
+
* the module directly. The query-suffix form this used to carry is Vite syntax —
|
|
9
|
+
* every other toolchain, including the compiler that now builds this directory,
|
|
10
|
+
* passes it through verbatim and produces an import of a file that is not there.
|
|
11
|
+
*
|
|
12
|
+
* The depth is the same from the source tree and from the compiled one
|
|
13
|
+
* (`client/three/` and `dist/three/` are siblings), so one literal is correct in
|
|
14
|
+
* both — and literal is load-bearing, because a bundler can only follow this
|
|
15
|
+
* pattern when it can read the path without running anything.
|
|
16
|
+
*/
|
|
17
|
+
export declare const ASSETS: Readonly<{
|
|
18
|
+
tara: string;
|
|
19
|
+
tushar: string;
|
|
20
|
+
tanya: string;
|
|
21
|
+
}>;
|
|
22
|
+
/** Every compiled character, in build order. */
|
|
23
|
+
export type CharacterName = keyof typeof ASSETS;
|
|
24
|
+
//# sourceMappingURL=assets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../client/three/assets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,MAAM;;;;EAIjB,CAAC;AAEH,gDAAgD;AAChD,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,MAAM,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the three compiled characters are, resolved against this module's own
|
|
3
|
+
* location.
|
|
4
|
+
*
|
|
5
|
+
* `new URL(…, import.meta.url)` and not a bundler's asset import: these files
|
|
6
|
+
* are fetched at runtime by a consumer's app, and the spelling has to survive
|
|
7
|
+
* Vite, webpack, Rollup, esbuild, a plain `tsc` output and a browser loading
|
|
8
|
+
* the module directly. The query-suffix form this used to carry is Vite syntax —
|
|
9
|
+
* every other toolchain, including the compiler that now builds this directory,
|
|
10
|
+
* passes it through verbatim and produces an import of a file that is not there.
|
|
11
|
+
*
|
|
12
|
+
* The depth is the same from the source tree and from the compiled one
|
|
13
|
+
* (`client/three/` and `dist/three/` are siblings), so one literal is correct in
|
|
14
|
+
* both — and literal is load-bearing, because a bundler can only follow this
|
|
15
|
+
* pattern when it can read the path without running anything.
|
|
16
|
+
*/
|
|
17
|
+
export const ASSETS = Object.freeze({
|
|
18
|
+
tara: new URL("../../assets/tara.glb", import.meta.url).href,
|
|
19
|
+
tushar: new URL("../../assets/tushar.glb", import.meta.url).href,
|
|
20
|
+
tanya: new URL("../../assets/tanya.glb", import.meta.url).href,
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=assets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.js","sourceRoot":"","sources":["../../client/three/assets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAClC,IAAI,EAAE,IAAI,GAAG,CAAC,uBAAuB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI;IAC5D,MAAM,EAAE,IAAI,GAAG,CAAC,yBAAyB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI;IAChE,KAAK,EAAE,IAAI,GAAG,CAAC,wBAAwB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI;CAC/D,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Measurable limits for one 3-D avatar at its shipping surface. */
|
|
2
|
+
export declare const SHIPPING_SURFACE: Readonly<{
|
|
3
|
+
cssWidth: 400;
|
|
4
|
+
cssHeight: 300;
|
|
5
|
+
maxDevicePixelRatio: 2;
|
|
6
|
+
}>;
|
|
7
|
+
/** Keep the physical drawing buffer inside the shipping ceiling at any mount size. */
|
|
8
|
+
export declare function pixelRatioFor(width: number, height: number, devicePixelRatio: number): number;
|
|
9
|
+
/** Crossing one of these is a failed asset/runtime review, not a suggestion. */
|
|
10
|
+
export declare const HARD_BUDGET: Readonly<{
|
|
11
|
+
assetBytes: number;
|
|
12
|
+
triangles: 60000;
|
|
13
|
+
drawCalls: 30;
|
|
14
|
+
bones: 40;
|
|
15
|
+
morphTargets: 40;
|
|
16
|
+
}>;
|
|
17
|
+
//# sourceMappingURL=budgets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"budgets.d.ts","sourceRoot":"","sources":["../../client/three/budgets.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,eAAO,MAAM,gBAAgB;;;;EAI3B,CAAC;AAEH,sFAAsF;AACtF,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAS7F;AAED,gFAAgF;AAChF,eAAO,MAAM,WAAW;;;;;;EAMtB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Measurable limits for one 3-D avatar at its shipping surface. */
|
|
2
|
+
export const SHIPPING_SURFACE = Object.freeze({
|
|
3
|
+
cssWidth: 400,
|
|
4
|
+
cssHeight: 300,
|
|
5
|
+
maxDevicePixelRatio: 2,
|
|
6
|
+
});
|
|
7
|
+
/** Keep the physical drawing buffer inside the shipping ceiling at any mount size. */
|
|
8
|
+
export function pixelRatioFor(width, height, devicePixelRatio) {
|
|
9
|
+
const maxWidth = SHIPPING_SURFACE.cssWidth * SHIPPING_SURFACE.maxDevicePixelRatio;
|
|
10
|
+
const maxHeight = SHIPPING_SURFACE.cssHeight * SHIPPING_SURFACE.maxDevicePixelRatio;
|
|
11
|
+
return Math.max(0.1, Math.min(SHIPPING_SURFACE.maxDevicePixelRatio, devicePixelRatio, maxWidth / Math.max(1, width), maxHeight / Math.max(1, height)));
|
|
12
|
+
}
|
|
13
|
+
/** Crossing one of these is a failed asset/runtime review, not a suggestion. */
|
|
14
|
+
export const HARD_BUDGET = Object.freeze({
|
|
15
|
+
assetBytes: 6 * 1024 * 1024,
|
|
16
|
+
triangles: 60_000,
|
|
17
|
+
drawCalls: 30,
|
|
18
|
+
bones: 40,
|
|
19
|
+
morphTargets: 40,
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=budgets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"budgets.js","sourceRoot":"","sources":["../../client/three/budgets.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC5C,QAAQ,EAAE,GAAG;IACb,SAAS,EAAE,GAAG;IACd,mBAAmB,EAAE,CAAC;CACvB,CAAC,CAAC;AAEH,sFAAsF;AACtF,MAAM,UAAU,aAAa,CAAC,KAAa,EAAE,MAAc,EAAE,gBAAwB;IACnF,MAAM,QAAQ,GAAG,gBAAgB,CAAC,QAAQ,GAAG,gBAAgB,CAAC,mBAAmB,CAAC;IAClF,MAAM,SAAS,GAAG,gBAAgB,CAAC,SAAS,GAAG,gBAAgB,CAAC,mBAAmB,CAAC;IACpF,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAC3B,gBAAgB,CAAC,mBAAmB,EACpC,gBAAgB,EAChB,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,EAC7B,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAChC,CAAC,CAAC;AACL,CAAC;AAED,gFAAgF;AAChF,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC;IACvC,UAAU,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI;IAC3B,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,EAAE;IACb,KAAK,EAAE,EAAE;IACT,YAAY,EAAE,EAAE;CACjB,CAAC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How far each character may hold its head off centre, as the mixer wants it:
|
|
3
|
+
* pose units per axis, ready to hand to `createSvgAvatar` as `headHold`.
|
|
4
|
+
*
|
|
5
|
+
* The angles themselves are in `motion-limits.json` and are only
|
|
6
|
+
* there. They were read off the three faces by the person who owns how they
|
|
7
|
+
* look, one axis at a time, at the surface a call actually shows — which is
|
|
8
|
+
* the only way this kind of number can be got, and the reason nothing here
|
|
9
|
+
* recomputes, adjusts or second-guesses one. This file is the unit change and
|
|
10
|
+
* nothing else.
|
|
11
|
+
*
|
|
12
|
+
* An axis the file marks for re-measurement is not enforced: it was read off an
|
|
13
|
+
* asset that has since been fixed, and holding the driver to a defect that no
|
|
14
|
+
* longer exists is worse than the defect. It falls back to the tightest angle
|
|
15
|
+
* still live on that axis across the other characters instead of falling out of
|
|
16
|
+
* the budget altogether, which is what it used to do. That is not a way of
|
|
17
|
+
* believing the stale number by the back door — it is the same budget the
|
|
18
|
+
* faces nobody has any doubt about are already held to. Dropping the axis made
|
|
19
|
+
* the one face nobody can currently vouch for the only one driven with no
|
|
20
|
+
* budget at all, and speech asks for about nine degrees of yaw before a budget
|
|
21
|
+
* trims it.
|
|
22
|
+
*/
|
|
23
|
+
import LIMITS from "./motion-limits.json";
|
|
24
|
+
declare const AXIS: {
|
|
25
|
+
readonly headYaw: "yaw";
|
|
26
|
+
readonly headPitch: "pitch";
|
|
27
|
+
readonly headRoll: "roll";
|
|
28
|
+
};
|
|
29
|
+
export type HeadHold = Partial<Record<keyof typeof AXIS, number>>;
|
|
30
|
+
/** `name` as the limits file spells it: tara, tushar, tanya. */
|
|
31
|
+
export declare function headHold(name: keyof typeof LIMITS.characters): HeadHold;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=holds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"holds.d.ts","sourceRoot":"","sources":["../../client/three/holds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,MAAM,MAAM,sBAAsB,CAAuB;AAUhE,QAAA,MAAM,IAAI;;;;CAAoE,CAAC;AAE/E,MAAM,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,OAAO,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;AAmBlE,gEAAgE;AAChE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,OAAO,MAAM,CAAC,UAAU,GAAG,QAAQ,CAQvE"}
|