@bevyra/avatar 1.0.6 → 1.0.7

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/README.md CHANGED
@@ -19,7 +19,7 @@ const client = new AvatarClient({ apiKey: process.env.BEVYRA_API_KEY });
19
19
  client.activate();
20
20
  client.download('noora');
21
21
  const { url, token } = await client.start();
22
- const session = await client.connect('noora');
22
+ const session = await client.connect('noora'); // Off-white background by default.
23
23
  const clauseId = session.sendAudio(pcm16At16kHz);
24
24
  for await (const event of session.events()) {
25
25
  // clause.audio precedes binary PCM; clause.frame precedes binary JPEG.
@@ -36,4 +36,4 @@ for await (const event of session.events()) {
36
36
  session.close(); client.close();
37
37
  ```
38
38
 
39
- Other local processes can use `url` and `token` to connect to the loopback WebSocket. Keep the token private. `npx bevyra-avatar serve` prints them as JSON. Send complete speech units with natural pauses; `session.interrupt` cancels the current generation. See the [Python package protocol](../avatar-python/README.md).
39
+ Speech and idle JPEGs are composited over off-white `#F5F3EE` by default. Pass `{ background: '#FFFFFF' }` to `client.connect` to use a different solid color. Other local processes can use `url` and `token` to connect to the loopback WebSocket. Keep the token private. `npx bevyra-avatar serve` prints them as JSON. Send complete speech units with natural pauses; `session.interrupt` cancels the current generation. See the [Python package protocol](../avatar-python/README.md).
package/index.d.ts CHANGED
@@ -7,7 +7,7 @@ export declare class AvatarClient {
7
7
  assign(slot: number, avatar: string, replace?: boolean): Record<string, unknown>;
8
8
  download(avatar: string): { avatar: string; path: string };
9
9
  start(options?: { port?: number }): Promise<{ url: string; token: string }>;
10
- connect(avatar: string): Promise<AvatarSession>;
10
+ connect(avatar: string, options?: { background?: string }): Promise<AvatarSession>;
11
11
  close(): void;
12
12
  }
13
13
  export declare class AvatarSession {
package/index.js CHANGED
@@ -6,7 +6,7 @@ import path from "node:path";
6
6
  import readline from "node:readline";
7
7
  import WebSocket from "ws";
8
8
 
9
- const VERSION = "1.0.6";
9
+ const VERSION = "1.0.7";
10
10
 
11
11
  function python() {
12
12
  if (process.env.BEVYRA_PYTHON) return { executable: process.env.BEVYRA_PYTHON, prefix: [] };
@@ -63,12 +63,12 @@ export class AvatarClient {
63
63
  this.server = { ...ready, child };
64
64
  return { url: ready.url, token: ready.token };
65
65
  }
66
- connect(avatar) {
66
+ connect(avatar, { background } = {}) {
67
67
  if (!this.server) throw new Error("Start the local renderer first");
68
68
  return new Promise((resolve, reject) => {
69
69
  const url = new URL("/v1/stream", this.server.url); url.protocol = "ws:";
70
70
  const socket = new WebSocket(url, { headers: { Authorization: `Bearer ${this.server.token}` } });
71
- socket.once("open", () => { socket.send(JSON.stringify({ type: "session.setup", avatar })); resolve(new AvatarSession(socket)); });
71
+ socket.once("open", () => { socket.send(JSON.stringify({ type: "session.setup", avatar, ...(background ? { background } : {}) })); resolve(new AvatarSession(socket)); });
72
72
  socket.once("error", reject);
73
73
  });
74
74
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bevyra/avatar",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "API-authorized local BeVyra avatar service for Node.js",
5
5
  "homepage": "https://bevyra.ai/docs",
6
6
  "bugs": {"url": "https://bevyra.ai/docs"},