Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

add xspace-agent/xspace-agent/examples/transcription-logger/index.ts

overstepping957f2b5982d1
diff --git a/xspace-agent/xspace-agent/examples/transcription-logger/index.ts b/xspace-agent/xspace-agent/examples/transcription-logger/index.ts
new file mode 100644
index 000000000..2da2b917d
--- /dev/null
+++ b/xspace-agent/xspace-agent/examples/transcription-logger/index.ts
@@ -0,0 +1,52 @@
+// SPDX-License-Identifier: Apache-2.0
+// Copyright 2026 nirholas (https://github.com/nirholas/xspace-agent) [§84]
+
+import { XSpaceAgent } from 'xspace-agent'
+import { appendFileSync } from 'fs'
+
+const OUTPUT_FILE = process.env.OUTPUT_FILE || 'transcript.txt'
+
+const agent = new XSpaceAgent({
+ auth: { token: process.env.X_AUTH_TOKEN! },
+ ai: {
+ provider: 'openai',
+ apiKey: process.env.OPENAI_API_KEY!,
+ systemPrompt: ''
+ },
+ behavior: { autoRespond: false }
+})
+
+const spaceUrl = process.argv[2]
+if (!spaceUrl) {
+ console.error('Usage: npm start <space-url>')
+ process.exit(1)
+}
+
+await agent.join(spaceUrl)
+console.log(`Joined Space. Logging transcript to ${OUTPUT_FILE}...\n`)
+
+agent.on('transcription', ({ speaker, text, timestamp }) => {
+ const line = `[${timestamp.toISOString()}] ${speaker}: ${text}\n`
+ process.stdout.write(line)
+ appendFileSync(OUTPUT_FILE, line)
+})
+
+agent.on('speakerJoined', ({ name }) => {
+ const line = `[${new Date().toISOString()}] --- ${name} joined ---\n`
+ process.stdout.write(line)
+ appendFileSync(OUTPUT_FILE, line)
+})
+
+agent.on('speakerLeft', ({ name }) => {
+ const line = `[${new Date().toISOString()}] --- ${name} left ---\n`
+ process.stdout.write(line)
+ appendFileSync(OUTPUT_FILE, line)
+})
+
+process.on('SIGINT', async () => {
+ await agent.destroy()
+ console.log(`\nTranscript saved to ${OUTPUT_FILE}`)
+ process.exit(0)
+})
+
+