With this, your mind can join a room where members speak to each other, and act when someone clearly addresses it. It is not a public phone agent and it should not act on every sentence it overhears. The room’s guide makes that distinction explicit: ordinary discussion is context, not authorization.
Audio travels two ways
apps/room/public/app.js joins browsers by WebRTC using ephemeral room events for presence and signalling. Each browser also cuts its own microphone into utterances and uploads a bounded WAV to POST /utterance. apps/room/app.ts transcribes it and appends a durable room/utterance-transcribed event to /rooms/main, attributed to the platform-authenticated member. A client-provided speaker name is not accepted as identity.
case "room":
return this.auth.require(request) || room.fetch(request, this);
// Durable transcript facts differ from ephemeral WebRTC signalling.
const utteranceType = "room/utterance-transcribed";
The server bounds upload size, while the browser caps each utterance at thirty seconds and drops common speech-model noise phrases. A mention of the mind’s name can wake the room agent; a short follow-on window lets one request span two utterances. A small debounce gathers words before the model starts. worker.ts forwards addressed room events to the fixed room agent and mirrors its plain-text answers back as room/agent-said, where the page shows them. room.md is the standing behavior guide. Transcripts can also enter the member-only search pipeline; they are not blog content.
The difficult part is permission to act
The microphone belongs to the signed-in member, but a transcription can still be wrong. The agent must require a clear request, tolerate transcription errors, and remain silent during people thinking aloud. Member authentication protects the room; speech instructions do not turn third-party words into trusted orders. Keep presence and signalling ephemeral while making intentional transcript facts durable. Repeated delivery of an utterance or answer must not duplicate the agent request.
Dependencies and tests
A similar room needs an iterate mind, the existing agent runtime and model funding, browser microphone permission, WebRTC connectivity and an OpenAI API account for gpt-4o-transcribe. Keep the transcription key in the vault, restricted to the provider’s API; no key belongs in browser JavaScript. It can incur transcription and agent usage charges. No phone number or new telephony account is needed just to run the browser room. This implementation uses a small peer mesh and public STUN servers, without TURN, so restrictive networks may prevent members from hearing each other. Report that failure rather than claiming a connected call. Wire the host and event handlers together, not only the HTML. Test two members, permission refusal, silent audio, oversized uploads, split utterances, reconnects and repeated events. Keep transcripts and speaker identities private. Agents explains the durable conversation side; the blog publishes only the reusable design, never what people actually said.
Keep similarly named rooms separate
This recipe describes only apps/room/ on the room host: one room, a durable transcript and text answers from its agent. The meet and meet2 hosts currently use a different app, apps/meet2/, while boiler-room keeps an earlier implementation and its sessions. Do not copy their screen-sharing, canvas or per-session behavior into this room’s description. To add spoken agent replies here, consume the explicit answer event with a separate speech layer; the existing page displays text, not synthesized speech.