{"_id":"@ajentify/voice","_rev":"5-9cca163a1387b4888a8c3988b6b20784","name":"@ajentify/voice","dist-tags":{"latest":"0.4.0"},"versions":{"0.1.0":{"name":"@ajentify/voice","version":"0.1.0","license":"MIT","_id":"@ajentify/voice@0.1.0","maintainers":[{"name":"ajentify","email":"purpledevilai@gmail.com"}],"dist":{"shasum":"231de29217a5d87ad51aea89fc27dbe6325e36c2","tarball":"https://registry.npmjs.org/@ajentify/voice/-/voice-0.1.0.tgz","fileCount":5,"integrity":"sha512-z085eYUeOvd6BYgb6+DJKJm5pH/jrY3x6xwwjf3kE8M0Qd+sZGWE9QzweURL9idh887OSt5gDxAQ801bL8QVnA==","signatures":[{"sig":"MEUCIQChhYEHsV4uq6Np7bp1luQ4UwBYPbFdZ23sBRb+jvptDQIgLQwNztPbnKDQ193P4a1HU9qUdTB0eajhQmLbF5yM1tg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":125296},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"5d123fcf5a7793c41da1b8d148eea7c03096758b","scripts":{"dev":"tsup --watch","lint":"eslint src --ext .ts,.tsx","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"ajentify","email":"purpledevilai@gmail.com"},"_npmVersion":"10.9.0","description":"Thin React + WebRTC transport for talking to an Ajentify agent over a voice room.","directories":{},"sideEffects":false,"_nodeVersion":"23.3.0","dependencies":{"zustand":"^5.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","react":"^18.3.1","react-dom":"^18.3.1","typescript":"^5.6.3","@types/node":"^22.9.0","@types/react":"^18.3.12","@types/react-dom":"^18.3.1"},"peerDependencies":{"react":">=18","react-dom":">=18"},"_npmOperationalInternal":{"tmp":"tmp/voice_0.1.0_1782580026306_0.8189926752734134","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@ajentify/voice","version":"0.2.0","license":"MIT","_id":"@ajentify/voice@0.2.0","maintainers":[{"name":"ajentify","email":"purpledevilai@gmail.com"}],"dist":{"shasum":"246369078faf5b22818d7f387931ad2255fa3898","tarball":"https://registry.npmjs.org/@ajentify/voice/-/voice-0.2.0.tgz","fileCount":5,"integrity":"sha512-bKNzl2Dk5IDkOW/kEiz1Q4yW3F1c3pZzSHP6k7UmMTaowu/Z82W2kZYyb7Ck6/emebTWgCRq4C1rnwJLN1gRdA==","signatures":[{"sig":"MEYCIQDysZpX4aCWCJD892M1pYKOuDhTDWAm/8myHFrSFECGxgIhAMhB831JEpi7pbbceU1l7uaqYjJS3/ttUX+cOjplwsw3","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":157318},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"5d123fcf5a7793c41da1b8d148eea7c03096758b","scripts":{"dev":"tsup --watch","lint":"eslint src --ext .ts,.tsx","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"ajentify","email":"purpledevilai@gmail.com"},"_npmVersion":"10.9.0","description":"Thin React + WebRTC transport for talking to an Ajentify agent over a voice room.","directories":{},"sideEffects":false,"_nodeVersion":"23.3.0","dependencies":{"zustand":"^5.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","react":"^18.3.1","react-dom":"^18.3.1","typescript":"^5.6.3","@types/node":"^22.9.0","@types/react":"^18.3.12","@types/react-dom":"^18.3.1"},"peerDependencies":{"react":">=18","react-dom":">=18"},"_npmOperationalInternal":{"tmp":"tmp/voice_0.2.0_1784356592743_0.28779735690088715","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@ajentify/voice","version":"0.2.1","license":"MIT","_id":"@ajentify/voice@0.2.1","maintainers":[{"name":"ajentify","email":"purpledevilai@gmail.com"}],"dist":{"shasum":"1a618fc07fb529a533bc75c73937ca790c094545","tarball":"https://registry.npmjs.org/@ajentify/voice/-/voice-0.2.1.tgz","fileCount":5,"integrity":"sha512-3AEjCtjX887y+8tkpUjX4TjAGKm5EabCn/seOVvuuDlcPQN5OL7aLHr4Ol1DOnRHqqISX9+I2860rwhsDmkL3w==","signatures":[{"sig":"MEUCIQCXNlGGiUoiIGrmpDReARe3PAO39cizh9Hh+i8y5dx09gIgd68IUlVEGu78shKKUyJhBUPPKrI4dYdjqZfqBR+7ihw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":157402},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"5d123fcf5a7793c41da1b8d148eea7c03096758b","scripts":{"dev":"tsup --watch","lint":"eslint src --ext .ts,.tsx","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"ajentify","email":"purpledevilai@gmail.com"},"_npmVersion":"10.9.0","description":"Thin React + WebRTC transport for talking to an Ajentify agent over a voice room.","directories":{},"sideEffects":false,"_nodeVersion":"23.3.0","dependencies":{"zustand":"^5.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","react":"^18.3.1","react-dom":"^18.3.1","typescript":"^5.6.3","@types/node":"^22.9.0","@types/react":"^18.3.12","@types/react-dom":"^18.3.1"},"peerDependencies":{"react":">=18","react-dom":">=18"},"_npmOperationalInternal":{"tmp":"tmp/voice_0.2.1_1784360252555_0.2020648207090534","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@ajentify/voice","version":"0.3.0","license":"MIT","_id":"@ajentify/voice@0.3.0","maintainers":[{"name":"ajentify","email":"purpledevilai@gmail.com"}],"dist":{"shasum":"3cb3de9d09a0dc34820763d70a53e6fc6b191522","tarball":"https://registry.npmjs.org/@ajentify/voice/-/voice-0.3.0.tgz","fileCount":5,"integrity":"sha512-baIxm7NTEY5VVwqhKNTQ480AWJrI3jONmC4V/n/ZVjcxW8pww5UBM5jUdNX7XWmpEX/lYnzXKoOu0IoEbirWjA==","signatures":[{"sig":"MEQCIFjoNNLvgcB6mKbQGRGd6qpjFtP85TH8F4+vsJht/E13AiB0mcP5ci0RgE1u3SoMAUfLvvzqdISB6RDs/43+iBu+hA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":162734},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"1a63059725fbde0bc475ecaf5c33a201379a709f","scripts":{"dev":"tsup --watch","lint":"eslint src --ext .ts,.tsx","build":"tsup","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"ajentify","email":"purpledevilai@gmail.com"},"_npmVersion":"10.9.0","description":"Thin React + WebRTC transport for talking to an Ajentify agent over a voice room.","directories":{},"sideEffects":false,"_nodeVersion":"23.3.0","dependencies":{"zustand":"^5.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","react":"^18.3.1","react-dom":"^18.3.1","typescript":"^5.6.3","@types/node":"^22.9.0","@types/react":"^18.3.12","@types/react-dom":"^18.3.1"},"peerDependencies":{"react":">=18","react-dom":">=18"},"_npmOperationalInternal":{"tmp":"tmp/voice_0.3.0_1786848108562_0.7970367426252141","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@ajentify/voice","version":"0.4.0","description":"Thin React + WebRTC transport for talking to an Ajentify agent over a voice room.","license":"MIT","type":"module","sideEffects":false,"main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"build":"tsup","dev":"tsup --watch","typecheck":"tsc --noEmit","lint":"eslint src --ext .ts,.tsx","prepublishOnly":"npm run build"},"peerDependencies":{"react":">=18","react-dom":">=18"},"dependencies":{"zustand":"^5.0.1"},"devDependencies":{"@types/node":"^22.9.0","@types/react":"^18.3.12","@types/react-dom":"^18.3.1","react":"^18.3.1","react-dom":"^18.3.1","tsup":"^8.3.5","typescript":"^5.6.3"},"publishConfig":{"access":"public"},"_id":"@ajentify/voice@0.4.0","gitHead":"1a63059725fbde0bc475ecaf5c33a201379a709f","_nodeVersion":"23.3.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-ZtV+sgI6o8KmxTkSw+3g6S9CBrSYX/b/uj04wkU8/KD7KbVfRFXq8ADfxPetSxmStrAJoiADa11B85u8dOCPzw==","shasum":"6b2af62ab678c4ac2e30870737ffa76351ef7d00","tarball":"https://registry.npmjs.org/@ajentify/voice/-/voice-0.4.0.tgz","fileCount":5,"unpackedSize":164103,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDtG0w/MZvjut30J6VBwT2UpI/2ykWb8OZBg3BqKyfGlAiBQ6e9zLscU0dmwaQ+zLKuEGbVzmM0aAZJReqfJBUZuYQ=="}]},"_npmUser":{"name":"ajentify","email":"purpledevilai@gmail.com"},"directories":{},"maintainers":[{"name":"ajentify","email":"purpledevilai@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/voice_0.4.0_1787447341573_0.0441771095112764"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-27T17:07:06.125Z","modified":"2026-08-23T01:09:01.853Z","0.1.0":"2026-06-27T17:07:06.433Z","0.2.0":"2026-07-18T06:36:32.891Z","0.2.1":"2026-07-18T07:37:32.691Z","0.3.0":"2026-08-16T02:41:48.706Z","0.4.0":"2026-08-23T01:09:01.714Z"},"license":"MIT","description":"Thin React + WebRTC transport for talking to an Ajentify agent over a voice room.","maintainers":[{"name":"ajentify","email":"purpledevilai@gmail.com"}],"readme":"# @ajentify/voice\n\nThin React + WebRTC transport for talking to an Ajentify agent over a voice room.\n\n`@ajentify/voice` owns the signaling WebSocket, the WebRTC peer connection, the microphone media stream, and the JSON-RPC data channel between the browser and the agent. It deliberately does **not** store derived chat state (AI sentences, transcribed user speech, etc.). Consumers subscribe to raw data-channel events and shape their own UI/state.\n\n## Install\n\n```bash\npnpm add @ajentify/voice\n```\n\n`react` and `react-dom` are peer dependencies.\n\n## Usage\n\n```tsx\nimport { AjentifyVoiceProvider, useAgentRoom, useMediaDevices, useAgentRoomEvent } from '@ajentify/voice';\n\nfunction App() {\n  return (\n    <AjentifyVoiceProvider config={{}}>\n      <Call />\n    </AjentifyVoiceProvider>\n  );\n}\n\nfunction Call() {\n  const initialize = useAgentRoom((s) => s.initialize);\n  const disconnect = useAgentRoom((s) => s.disconnect);\n  const toggleMute = useAgentRoom((s) => s.toggleMute);\n  const isConnected = useAgentRoom((s) => s.isConnected);\n  const audioDevices = useMediaDevices((s) => s.audioDevices);\n\n  // Subscribe to whatever data-channel events you care about.\n  useAgentRoomEvent('ai_sentence', ({ sentence }) => {\n    console.log('agent says:', sentence);\n  });\n\n  return (\n    <>\n      <button onClick={() => initialize('my-context-id', 'my-access-token')}>Start</button>\n      <button onClick={() => disconnect()}>Stop</button>\n      <button onClick={() => toggleMute()}>Mute</button>\n      <select>{audioDevices.map((d) => <option key={d.deviceId}>{d.label}</option>)}</select>\n      <p>{isConnected ? 'connected' : 'not connected'}</p>\n    </>\n  );\n}\n```\n\n## Provider config\n\n```ts\ninterface AjentifyVoiceConfig {\n  signalingServerUrl?: string; // default: wss://room-signaling-server.prod.rooms.ajentify.com\n  agentServerUrl?: string;     // default: https://agent.ajentify.com\n}\n```\n\nURLs only — no callbacks. The provider builds the stores once on mount and tears them down on unmount.\n\n## Public API\n\n- `AjentifyVoiceProvider`, `AjentifyVoiceContext`\n- `useAjentifyVoiceStores()`, `useAjentifyVoiceConfig()`\n- `useAgentRoom(selector)`, `useAgentRoomStore()`\n- `useMediaDevices(selector)`, `useMediaDevicesStore()`\n- `useAgentRoomEvent(eventName, handler)` — convenience wrapper around `agentRoom.on(...)`\n- `monitorMicStream`, `monitorInboundMediaStream` — Web Audio helpers for level animation\n- `AgentDataChannelEvents`, `AgentDataChannelEventName` — typed event payload map\n\n## Client-side tools\n\n`on_client_side_tool_calls` is a fire-and-forget notification from the agent server. Subscribe, run your tool handlers, and emit the response back as a separate call:\n\n```ts\nuseAgentRoomEvent('on_client_side_tool_calls', async ({ tool_calls }) => {\n  const tool_responses = await Promise.all(\n    tool_calls.map(async (c) => ({ tool_call_id: c.tool_call_id, response: await myTools[c.tool_name](c.tool_input) })),\n  );\n  agentRoom.send('client_side_tool_responses', { tool_responses });\n});\n```\n","readmeFilename":"README.md"}