@voicethere/agent 0.7.8 → 0.7.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voicethere/agent",
3
- "version": "0.7.8",
3
+ "version": "0.7.10",
4
4
  "description": "VoiceThere customer agent SDK — IPC types and runtime helpers for sandboxed child bundles",
5
5
  "type": "module",
6
6
  "exports": {
@@ -95,9 +95,9 @@
95
95
  "@node-webrtc-rust/sdk": ">=0.9.0"
96
96
  },
97
97
  "devDependencies": {
98
- "@node-webrtc-rust/helpers": "0.9.0",
99
- "@node-webrtc-rust/sdk": "0.9.0",
100
- "@node-webrtc-rust/signaling": "0.9.0",
98
+ "@node-webrtc-rust/helpers": "0.9.5",
99
+ "@node-webrtc-rust/sdk": "0.9.5",
100
+ "@node-webrtc-rust/signaling": "0.9.5",
101
101
  "@types/node": "22.20.1",
102
102
  "http-server": "14.1.1",
103
103
  "ioredis": "5.11.1",
@@ -17,7 +17,7 @@ import {
17
17
 
18
18
  | Kind | Dashboard create | Prebuilt seed bundle | Typical consumer |
19
19
  | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ | ----------------------- |
20
- | **product** | Yes (`echo`, `echo-dc`, `voice-starter`, `game-sync`, `voice-showcase`, `recording-consent`, `positional-tts`, `webhooks`, `webhooks-redis`) | Yes — `dist/templates/<id>/agent.js` | Platform project create |
20
+ | **product** | Yes (`echo`, `echo-dc`, `voice-starter`, `game-sync`, `voice-showcase`, `recording-consent`, `positional-tts`, `spatial-showcase`, `webhooks`, `webhooks-redis`) | Yes — `dist/templates/<id>/agent.js` | Platform project create |
21
21
  | **e2e** | No | No — build from sources at test time | `voicethere/e2e` smokes |
22
22
 
23
23
  Product templates always set `seedOnCreate: true`. CI fails if a product template is missing its prebuilt bundle after `npm run build`.
@@ -79,6 +79,22 @@ Voice+Data demo — enables positional mixing and orbits each listener’s TTS s
79
79
 
80
80
  Sources: `positional-tts/agent.ts` (defineAgent wiring), `positional-tts/orbit.ts` (pure circle helper for tests).
81
81
 
82
+ ### `spatial-showcase/` (`spatial-showcase`)
83
+
84
+ Spatial audio showcase for `/showcase` — one agent template with three demos selected by `{ type: "join", demo }` on the control DataChannel:
85
+
86
+ | Demo | Behavior |
87
+ | ---- | -------- |
88
+ | `orbit` | TTS speaker orbits the listener (`setTtsPose`); `{ type: "orbit", action: "set" \| "say" }`; agent emits `{ type: "orbit_pose" }` |
89
+ | `soundboard` | Positional clip pads — browser sends `clipId` only (never URLs); agent resolves against an allowlisted `assetOrigin` |
90
+ | `proximity` | Shared mix room (`createMixGroup` + `setClientPose`); `{ type: "move" }`, `{ type: "mute_peer" }`; `{ type: "room_state" }` broadcast |
91
+
92
+ **Protocol:** inbound `join`, `orbit`, `pad`, `pad_stop`, `pad_status`, `move`, `mute_peer`, `leave`, `ping` — outbound `showcase_ack`, `orbit_pose`, `pad_progress`, `room_state`, `room_full`, `error`.
93
+
94
+ **Limits:** `MAX_ROOM_PEERS = 8`, `MAX_ACTIVE_PLAYS = 4` per session. Clip ids: `chime`, `bell`, `laser`, `impact`, `footsteps`, `rain-loop`, `cafe-loop`, `jingle`.
95
+
96
+ Sources: `spatial-showcase/agent.ts`, `protocol.ts`, `sounds.ts`, `room.ts`, `orbit.ts`.
97
+
82
98
  ### `webhooks.ts` (`webhooks`)
83
99
 
84
100
  Inbound HTTP webhook sample — verifies `x-agent-webhook-signature` HMAC on the **raw body** with `AGENT_WEBHOOK_SIGNING_SECRET`, then `JSON.parse` and fans out to connected sessions via DataChannel + `speak`.
@@ -6,17 +6,20 @@
6
6
  * - `{ type: "crash_exit" }` → process.exit(1)
7
7
  * - `{ type: "ping", id }` → `{ type: "pong", id }`
8
8
  * - `onUserSpeechFinal` text starting with "crash" → throw
9
- * - other finals → speak(`echo. ${text}`)
9
+ * - other finals → speak(`Okay. ${text}`)
10
10
  * - onSessionStart → speak("ready") after 1s (voice ready waiter)
11
11
  */
12
12
  import { defineAgent, sendToClient, speak } from "@voicethere/agent";
13
13
 
14
- /** TTS echo prefix with a sentence boundary so Piper does not glue words. */
14
+ /**
15
+ * TTS reply prefix with a sentence boundary so Piper does not glue words.
16
+ * Use a word local streaming STT reliably emits a token for (`Okay.`); `echo.`
17
+ * measured ~5% no-token Piper renders. Never glue `echo:` onto the payload.
18
+ */
15
19
  export function formatEchoSpeak(text: string): string {
16
20
  const trimmed = text.trim();
17
21
  if (!trimmed) return "";
18
- // Never glue `echo:` onto the next word; Piper skips "echo colon" on `echo:One`.
19
- return `echo. ${trimmed}`;
22
+ return `Okay. ${trimmed}`;
20
23
  }
21
24
 
22
25
  export const CRASH_AGENT_MESSAGE =
@@ -5,11 +5,15 @@
5
5
  */
6
6
  import { defineAgent, parseChatText, speak } from "@voicethere/agent";
7
7
 
8
- /** TTS echo prefix with a sentence boundary so Piper does not glue words. */
8
+ /**
9
+ * TTS reply prefix with a sentence boundary so Piper does not glue words.
10
+ * Use a word local streaming STT (Kroko Zipformer) reliably emits a token for;
11
+ * `echo.` measured ~5% no-token Piper renders (audio intact). `Okay.` does not.
12
+ */
9
13
  export function formatEchoSpeak(text: string): string {
10
14
  const trimmed = text.trim();
11
15
  if (!trimmed) return "";
12
- return `echo. ${trimmed}`;
16
+ return `Okay. ${trimmed}`;
13
17
  }
14
18
 
15
19
  defineAgent({