@clawvoice/voice-assistant 1.0.0
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/.env.example +125 -0
- package/CHANGELOG.md +112 -0
- package/LICENSE +21 -0
- package/README.md +215 -0
- package/dist/cli.d.ts +10 -0
- package/dist/cli.js +272 -0
- package/dist/config.d.ts +42 -0
- package/dist/config.js +182 -0
- package/dist/diagnostics/health.d.ts +14 -0
- package/dist/diagnostics/health.js +182 -0
- package/dist/hooks.d.ts +16 -0
- package/dist/hooks.js +113 -0
- package/dist/inbound/classifier.d.ts +5 -0
- package/dist/inbound/classifier.js +72 -0
- package/dist/inbound/types.d.ts +30 -0
- package/dist/inbound/types.js +2 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +52 -0
- package/dist/routes.d.ts +6 -0
- package/dist/routes.js +89 -0
- package/dist/services/memory-extraction.d.ts +42 -0
- package/dist/services/memory-extraction.js +117 -0
- package/dist/services/post-call.d.ts +56 -0
- package/dist/services/post-call.js +112 -0
- package/dist/services/relay.d.ts +9 -0
- package/dist/services/relay.js +19 -0
- package/dist/services/voice-call.d.ts +61 -0
- package/dist/services/voice-call.js +189 -0
- package/dist/telephony/telnyx.d.ts +12 -0
- package/dist/telephony/telnyx.js +60 -0
- package/dist/telephony/twilio.d.ts +12 -0
- package/dist/telephony/twilio.js +63 -0
- package/dist/telephony/types.d.ts +15 -0
- package/dist/telephony/types.js +2 -0
- package/dist/telephony/util.d.ts +2 -0
- package/dist/telephony/util.js +25 -0
- package/dist/tools.d.ts +5 -0
- package/dist/tools.js +167 -0
- package/dist/voice/bridge.d.ts +47 -0
- package/dist/voice/bridge.js +411 -0
- package/dist/voice/types.d.ts +168 -0
- package/dist/voice/types.js +42 -0
- package/dist/webhooks/verify.d.ts +30 -0
- package/dist/webhooks/verify.js +95 -0
- package/docs/FEATURES.md +36 -0
- package/docs/OPENCLAW_PLUGIN_GUIDE.md +1202 -0
- package/docs/SETUP.md +303 -0
- package/openclaw.plugin.json +137 -0
- package/package.json +37 -0
- package/skills/voice-assistant/SKILL.md +15 -0
package/.env.example
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# ClawVoice - Environment Variables
|
|
2
|
+
# Copy this file to .env and fill in your values.
|
|
3
|
+
# Only configure the providers you plan to use.
|
|
4
|
+
|
|
5
|
+
# ============================================================
|
|
6
|
+
# TELEPHONY PROVIDER
|
|
7
|
+
# Primary: Twilio (default, widely supported)
|
|
8
|
+
# Alternative: Telnyx (lower cost option)
|
|
9
|
+
# ============================================================
|
|
10
|
+
|
|
11
|
+
# Which telephony provider to use: "twilio" or "telnyx"
|
|
12
|
+
CLAWVOICE_TELEPHONY_PROVIDER="twilio"
|
|
13
|
+
|
|
14
|
+
# --- Twilio (default) ---
|
|
15
|
+
TWILIO_ACCOUNT_SID=""
|
|
16
|
+
TWILIO_AUTH_TOKEN=""
|
|
17
|
+
TWILIO_PHONE_NUMBER=""
|
|
18
|
+
|
|
19
|
+
# --- Telnyx (alternative) ---
|
|
20
|
+
TELNYX_API_KEY=""
|
|
21
|
+
TELNYX_CONNECTION_ID=""
|
|
22
|
+
TELNYX_PHONE_NUMBER=""
|
|
23
|
+
|
|
24
|
+
# Telnyx webhook signing public key (Ed25519, for verifying inbound webhooks)
|
|
25
|
+
TELNYX_WEBHOOK_SECRET=""
|
|
26
|
+
|
|
27
|
+
# ============================================================
|
|
28
|
+
# VOICE PROVIDER
|
|
29
|
+
# Option A: Deepgram Voice Agent (single WebSocket, lower latency)
|
|
30
|
+
# Option B: ElevenLabs Conversational AI (premium voices)
|
|
31
|
+
# ============================================================
|
|
32
|
+
|
|
33
|
+
# Which voice provider to use: "deepgram-agent" or "elevenlabs-conversational"
|
|
34
|
+
CLAWVOICE_VOICE_PROVIDER="deepgram-agent"
|
|
35
|
+
|
|
36
|
+
# --- Deepgram (required for Option A) ---
|
|
37
|
+
DEEPGRAM_API_KEY=""
|
|
38
|
+
|
|
39
|
+
# Default Deepgram voice (aura-asteria-en, aura-luna-en, aura-orion-en, aura-arcas-en)
|
|
40
|
+
CLAWVOICE_DEEPGRAM_VOICE="aura-asteria-en"
|
|
41
|
+
|
|
42
|
+
# --- ElevenLabs (optional, for premium TTS via Deepgram or Option B) ---
|
|
43
|
+
ELEVENLABS_API_KEY=""
|
|
44
|
+
|
|
45
|
+
# ElevenLabs Agent ID (for Option B: EL Conversational AI)
|
|
46
|
+
ELEVENLABS_AGENT_ID=""
|
|
47
|
+
|
|
48
|
+
# ElevenLabs voice ID (for Option A: EL TTS via Deepgram)
|
|
49
|
+
ELEVENLABS_VOICE_ID=""
|
|
50
|
+
|
|
51
|
+
# ============================================================
|
|
52
|
+
# AGENT BEHAVIOR
|
|
53
|
+
# ============================================================
|
|
54
|
+
|
|
55
|
+
# System prompt for the voice agent (instructions, persona, role)
|
|
56
|
+
CLAWVOICE_VOICE_SYSTEM_PROMPT=""
|
|
57
|
+
|
|
58
|
+
# Enable inbound call answering (true/false)
|
|
59
|
+
CLAWVOICE_INBOUND_ENABLED="true"
|
|
60
|
+
|
|
61
|
+
# Enable disclosure statement at call start (true/false)
|
|
62
|
+
CLAWVOICE_DISCLOSURE_ENABLED="true"
|
|
63
|
+
|
|
64
|
+
# Custom disclosure statement
|
|
65
|
+
CLAWVOICE_DISCLOSURE_STATEMENT="Hello, this call is from an AI assistant calling on behalf of a user."
|
|
66
|
+
|
|
67
|
+
# ============================================================
|
|
68
|
+
# POST-CALL ANALYSIS
|
|
69
|
+
# ============================================================
|
|
70
|
+
|
|
71
|
+
# OpenAI API key (optional, for dedicated post-call analysis)
|
|
72
|
+
# If not set, uses OpenClaw's default model provider
|
|
73
|
+
OPENAI_API_KEY=""
|
|
74
|
+
|
|
75
|
+
# Analysis model (default: gpt-4o-mini for cost efficiency)
|
|
76
|
+
CLAWVOICE_ANALYSIS_MODEL="gpt-4o-mini"
|
|
77
|
+
|
|
78
|
+
# ============================================================
|
|
79
|
+
# VOICE MEMORY
|
|
80
|
+
# ============================================================
|
|
81
|
+
|
|
82
|
+
# Can the voice agent read main MEMORY.md? ("read" or "none")
|
|
83
|
+
CLAWVOICE_MAIN_MEMORY_ACCESS="read"
|
|
84
|
+
|
|
85
|
+
# Auto-extract memories from call transcripts? (true/false)
|
|
86
|
+
CLAWVOICE_AUTO_EXTRACT_MEMORIES="true"
|
|
87
|
+
|
|
88
|
+
# ============================================================
|
|
89
|
+
# SECURITY
|
|
90
|
+
# ============================================================
|
|
91
|
+
|
|
92
|
+
# Restrict voice agent tool access (recommended: true)
|
|
93
|
+
CLAWVOICE_RESTRICT_TOOLS="true"
|
|
94
|
+
|
|
95
|
+
# Denied tools for voice sessions (comma-separated)
|
|
96
|
+
# Default: exec,browser,web_fetch,gateway,cron,sessions_spawn
|
|
97
|
+
CLAWVOICE_DENIED_TOOLS="exec,browser,web_fetch,gateway,cron,sessions_spawn"
|
|
98
|
+
|
|
99
|
+
# ============================================================
|
|
100
|
+
# CALL BEHAVIOR
|
|
101
|
+
# ============================================================
|
|
102
|
+
|
|
103
|
+
# Maximum daily outbound calls (0 = unlimited)
|
|
104
|
+
CLAWVOICE_DAILY_CALL_LIMIT="50"
|
|
105
|
+
|
|
106
|
+
# Enable answering machine detection for outbound calls (true/false)
|
|
107
|
+
CLAWVOICE_AMD_ENABLED="true"
|
|
108
|
+
|
|
109
|
+
# Maximum call duration in seconds (default: 1800 = 30 minutes)
|
|
110
|
+
CLAWVOICE_MAX_CALL_DURATION="1800"
|
|
111
|
+
|
|
112
|
+
# Enable call recording (true/false)
|
|
113
|
+
CLAWVOICE_RECORD_CALLS="false"
|
|
114
|
+
|
|
115
|
+
# Webhook URL for call events (optional, for external integrations)
|
|
116
|
+
CLAWVOICE_WEBHOOK_URL=""
|
|
117
|
+
|
|
118
|
+
# ============================================================
|
|
119
|
+
# NOTIFICATIONS (optional)
|
|
120
|
+
# ============================================================
|
|
121
|
+
|
|
122
|
+
# Send post-call notifications to these channels (true/false)
|
|
123
|
+
CLAWVOICE_NOTIFY_TELEGRAM="false"
|
|
124
|
+
CLAWVOICE_NOTIFY_DISCORD="false"
|
|
125
|
+
CLAWVOICE_NOTIFY_SLACK="false"
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Non-blocking config diagnostics warnings at plugin init — missing credentials and misconfigured settings are now surfaced immediately via `api.log.warn()` rather than failing silently at first call time.
|
|
12
|
+
- Runtime credential failure tests for both Twilio and Telnyx call-start path.
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
- OpenClaw guide manifest example now uses the correct stable plugin id (`voice-assistant`) and correct default provider (`twilio`).
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## [1.0.1] - 2026-03-16
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
- `package.json` now includes `openclaw.extensions` field required by the OpenClaw plugin installer.
|
|
23
|
+
- Named `activate` and `register` exports in plugin entry point for OpenClaw loader compatibility.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
- Plugin manifest `id` changed from `clawvoice/voice-assistant` to `voice-assistant` (shorter stable form used by OpenClaw runtime).
|
|
27
|
+
- Init-time config validation no longer hard-fails on missing provider credentials — the plugin can be installed and enabled before credentials are configured.
|
|
28
|
+
- Config schema `required` list cleared so OpenClaw's plugin host does not block enable when credentials are absent.
|
|
29
|
+
- Private ignore rules (internal tooling paths) moved from tracked `.gitignore` to local-only `.git/info/exclude`.
|
|
30
|
+
|
|
31
|
+
### Fixed
|
|
32
|
+
- History scrubbed to remove all internal development artifacts (BMAD planning files, reference code, `.beads` state, `.claude` commands) from all historical commits and tags.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## [1.0.0] - 2026-03-14
|
|
37
|
+
|
|
38
|
+
Initial production release. Implements all five epics and 17 user stories from the PRD.
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
|
|
42
|
+
**Core Plugin (Epic 1)**
|
|
43
|
+
- OpenClaw plugin scaffold with manifest, TypeScript build, and SDK integration.
|
|
44
|
+
- Three-tier config resolution (env → plugin config → defaults) with contextual validation.
|
|
45
|
+
- Interactive setup wizard (`clawvoice setup`) for provider credentials and preferences.
|
|
46
|
+
- Configurable disclosure statement spoken at call start (`disclosureEnabled`, `disclosureStatement`).
|
|
47
|
+
- Configurable max call duration with automatic termination (`maxCallDuration`).
|
|
48
|
+
- Enable/disable inbound call answering (`inboundEnabled`).
|
|
49
|
+
- Custom voice system prompt for agent persona and task framing (`voiceSystemPrompt`).
|
|
50
|
+
|
|
51
|
+
**Voice Bridge (Epic 2)**
|
|
52
|
+
- Audio codec negotiation with actionable diagnostics (μ-law 8 kHz, bidirectional).
|
|
53
|
+
- Deepgram Voice Agent settings builder with configurable TTS voice and system prompt composition.
|
|
54
|
+
- Real-time 160 → 3200-byte audio buffering for Twilio media stream compatibility.
|
|
55
|
+
- 5-second keepalive heartbeat over active voice WebSocket.
|
|
56
|
+
- Greeting grace period preventing false barge-in on agent greeting.
|
|
57
|
+
- Barge-in via Twilio `clear` command when `UserStartedSpeaking` event fires outside grace period.
|
|
58
|
+
- Function call dispatch for `end_call` and custom agent-invoked tools.
|
|
59
|
+
- Per-call transcript tracking (user and agent turns with timestamps).
|
|
60
|
+
- Heartbeat-based disconnection detection with 2-second timeout (NFR10).
|
|
61
|
+
- `DisconnectionRecord` with reason, detail, duration, and transcript length.
|
|
62
|
+
- Call summaries with `CallOutcome` (completed / partial / failed), failure list, and `RetryContext`.
|
|
63
|
+
|
|
64
|
+
**Safety and Isolation (Epic 3)**
|
|
65
|
+
- Voice-memory write isolation: all writes during a voice session are redirected to `voice-memory/` namespace.
|
|
66
|
+
- Configurable main-memory read access (`mainMemoryAccess`: `read` or `none`).
|
|
67
|
+
- Built-in always-denied tools for voice sessions (`exec`, `browser`, `web_fetch`).
|
|
68
|
+
- User-configurable additional denied tools list (`restrictTools`, `deniedTools`).
|
|
69
|
+
- Prompt injection detection with 8 pattern guards applied before response generation.
|
|
70
|
+
- Telnyx webhook signature verification using Ed25519 public-key cryptography.
|
|
71
|
+
- Twilio webhook signature verification using HMAC-SHA1.
|
|
72
|
+
- Post-call transcript and call record persistence to `voice-memory/calls/{callId}`.
|
|
73
|
+
- Configurable post-call notifications to Telegram, Discord, or Slack channels (`notifyTelegram`, `notifyDiscord`, `notifySlack`).
|
|
74
|
+
|
|
75
|
+
**CLI (Epic 4)**
|
|
76
|
+
- `clawvoice call <number>` — initiate outbound call with optional `--greeting` and `--purpose` flags.
|
|
77
|
+
- `clawvoice history` — list recent calls with outcome, duration, and status.
|
|
78
|
+
- `clawvoice history <callId>` — full call detail with transcript summary and retry context.
|
|
79
|
+
- `clawvoice status` — run health diagnostics with ✓/⚠/✗ per check and remediation guidance.
|
|
80
|
+
- `clawvoice test` — connectivity test showing pass/fail with remediation, secrets never exposed.
|
|
81
|
+
- `clawvoice promote` — list pending memory candidates and promote approved entries to main memory.
|
|
82
|
+
|
|
83
|
+
**Advanced Features (Epic 5)**
|
|
84
|
+
- Inbound call handling with AMD (Answering Machine Detection) classification.
|
|
85
|
+
- Per-decision routing: human → bridge, machine → voicemail, fax → reject.
|
|
86
|
+
- Telnyx and Twilio AMD callback routes.
|
|
87
|
+
- Pattern-based memory extraction from call transcripts (health, schedule, preference, relationship, interest categories).
|
|
88
|
+
- Pending/approved/rejected/promoted memory candidate workflow with `MemoryExtractionService`.
|
|
89
|
+
- Health diagnostics covering 8 checks: telephony credentials, voice credentials, webhook URL, disclosure, call duration, inbound status, mode, provider.
|
|
90
|
+
|
|
91
|
+
**Real telephony integration**
|
|
92
|
+
- Twilio adapter makes real calls via REST API (`https://api.twilio.com/2010-04-01/Accounts/{sid}/Calls.json`).
|
|
93
|
+
- Telnyx adapter makes real calls via REST API (`https://api.telnyx.com/v2/calls`).
|
|
94
|
+
- Both adapters throw immediately if credentials are missing (no silent simulation).
|
|
95
|
+
- Daily outbound call rate limit with per-day counter and reset (`dailyCallLimit`, default 50).
|
|
96
|
+
|
|
97
|
+
### Security
|
|
98
|
+
- Real cryptographic webhook verification (no stub validation).
|
|
99
|
+
- Built-in prompt injection guards in all voice sessions.
|
|
100
|
+
- Memory namespace isolation prevents voice session data from polluting main agent memory.
|
|
101
|
+
- Credentials never logged or exposed in diagnostic output.
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## [0.1.0] - 2026-03-13
|
|
106
|
+
|
|
107
|
+
- Initial repository structure, documentation, and feature overview.
|
|
108
|
+
|
|
109
|
+
[Unreleased]: https://github.com/ClawVoice/clawvoice/compare/v1.0.0...HEAD
|
|
110
|
+
[1.0.1]: https://github.com/ClawVoice/clawvoice/compare/v1.0.0...02536b5
|
|
111
|
+
[1.0.0]: https://github.com/ClawVoice/clawvoice/compare/a6c9ceb...d58a040
|
|
112
|
+
[0.1.0]: https://github.com/ClawVoice/clawvoice/releases/tag/a6c9ceb
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ClawVoice
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# ClawVoice
|
|
2
|
+
|
|
3
|
+
Voice calling plugin for OpenClaw. Give your AI agent a phone number.
|
|
4
|
+
|
|
5
|
+
## What It Does
|
|
6
|
+
|
|
7
|
+
ClawVoice connects your OpenClaw agent to the phone network. Your agent can receive and make phone calls, with real-time voice conversation powered by Deepgram Voice Agent or ElevenLabs Conversational AI.
|
|
8
|
+
|
|
9
|
+
**Key features:**
|
|
10
|
+
- **Two voice pipelines**: Deepgram Voice Agent (single WebSocket, lowest latency) or ElevenLabs Conversational AI (premium voice quality)
|
|
11
|
+
- **Voice memory isolation**: Phone calls write to a sandboxed `voice-memory/` namespace. Voice callers cannot corrupt your agent's main memory. Memory promotion to `MEMORY.md` requires explicit review.
|
|
12
|
+
- **Post-call analysis**: After every call, get a transcript, call summary with outcome/failures/retry context, and action items written to voice memory.
|
|
13
|
+
- **Inbound + outbound**: Your agent can take calls and initiate them.
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
### 1. Install
|
|
18
|
+
|
|
19
|
+
Bring your own API keys. You control everything.
|
|
20
|
+
<br>
|
|
21
|
+
|
|
22
|
+
Configure your providers in `.env` or via `openclaw config set`:
|
|
23
|
+
- **Telephony**: Telnyx (recommended) or Twilio
|
|
24
|
+
- **Voice**: Deepgram Voice Agent or ElevenLabs Conversational AI
|
|
25
|
+
- **Analysis**: OpenAI (optional, falls back to OpenClaw's configured model)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
openclaw plugins install @clawvoice/voice-assistant
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 2. Get API Keys
|
|
33
|
+
|
|
34
|
+
**Telephony** (pick one):
|
|
35
|
+
- [Telnyx](https://telnyx.com) - Create account, get API key, buy a phone number, set up a Call Control app
|
|
36
|
+
- [Twilio](https://twilio.com) - Create account, get SID + auth token, buy a phone number
|
|
37
|
+
|
|
38
|
+
**Voice** (pick one):
|
|
39
|
+
- [Deepgram](https://deepgram.com) - Create account, get API key (needed for both voice provider options)
|
|
40
|
+
- [ElevenLabs](https://elevenlabs.io) - Create account, get API key, create a Conversational AI agent (for Option B only)
|
|
41
|
+
|
|
42
|
+
### 3. Configure
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# Telephony
|
|
46
|
+
openclaw config set clawvoice.telephonyProvider telnyx
|
|
47
|
+
openclaw config set clawvoice.telnyxApiKey YOUR_KEY
|
|
48
|
+
openclaw config set clawvoice.telnyxConnectionId YOUR_CONNECTION_ID
|
|
49
|
+
openclaw config set clawvoice.telnyxPhoneNumber +15551234567
|
|
50
|
+
|
|
51
|
+
# Voice (Deepgram Voice Agent)
|
|
52
|
+
openclaw config set clawvoice.voiceProvider deepgram-agent
|
|
53
|
+
openclaw config set clawvoice.deepgramApiKey YOUR_KEY
|
|
54
|
+
|
|
55
|
+
# Or set via .env file — see .env.example
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 4. Start
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
openclaw start
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Your agent now answers calls to the configured phone number.
|
|
65
|
+
|
|
66
|
+
### 5. Make a test call
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
openclaw clawvoice call +15559876543
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Or ask your agent: *"Call +15559876543"*
|
|
73
|
+
|
|
74
|
+
## Voice Providers
|
|
75
|
+
|
|
76
|
+
### Deepgram Voice Agent (Recommended)
|
|
77
|
+
|
|
78
|
+
Single WebSocket handles STT + LLM + TTS. Lowest latency (~200ms round-trip).
|
|
79
|
+
|
|
80
|
+
- Uses Deepgram's Agent API
|
|
81
|
+
- TTS: Deepgram Aura voices (included) or ElevenLabs (BYOK, routed through Deepgram)
|
|
82
|
+
- Barge-in support (caller can interrupt)
|
|
83
|
+
- LLM routing happens inside Deepgram's infrastructure
|
|
84
|
+
|
|
85
|
+
### ElevenLabs Conversational AI
|
|
86
|
+
|
|
87
|
+
ElevenLabs handles the entire voice pipeline. Premium voice quality.
|
|
88
|
+
|
|
89
|
+
- Create an ElevenLabs Conversational AI agent in their dashboard
|
|
90
|
+
- Point it at your OpenClaw gateway's `/v1/chat/completions` endpoint
|
|
91
|
+
- ElevenLabs handles STT, turn-taking, and TTS
|
|
92
|
+
- OpenClaw provides the brain (tools, memory, personality)
|
|
93
|
+
|
|
94
|
+
## Voice Memory Isolation
|
|
95
|
+
|
|
96
|
+
Phone calls are inherently riskier than text — callers can attempt social engineering or prompt injection via voice. ClawVoice sandboxes all voice interactions:
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
~/.openclaw/workspace/
|
|
100
|
+
MEMORY.md # Main memory (text channels)
|
|
101
|
+
memory/ # Main daily logs
|
|
102
|
+
voice-memory/ # Voice-only sandbox
|
|
103
|
+
VOICE-MEMORY.md # Curated voice long-term memory
|
|
104
|
+
2026-03-11.md # Voice daily log
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Access rules:**
|
|
108
|
+
- Voice agent can READ main `MEMORY.md` (configurable)
|
|
109
|
+
- Voice agent can ONLY WRITE to `voice-memory/`
|
|
110
|
+
- Text channels don't see `voice-memory/` by default
|
|
111
|
+
- Memory promotion requires explicit review
|
|
112
|
+
|
|
113
|
+
### Promote voice memories
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
openclaw clawvoice promote
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Reviews pending voice memories and lets you approve/reject promotion to main `MEMORY.md`.
|
|
120
|
+
|
|
121
|
+
## CLI Commands
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
openclaw clawvoice setup # Interactive setup wizard
|
|
125
|
+
openclaw clawvoice call <number> # Initiate outbound call
|
|
126
|
+
openclaw clawvoice status # Show active calls and config
|
|
127
|
+
openclaw clawvoice promote # Review and promote voice memories
|
|
128
|
+
openclaw clawvoice history # Show recent call history
|
|
129
|
+
openclaw clawvoice test # Test voice pipeline connectivity
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Agent Tools
|
|
133
|
+
|
|
134
|
+
The plugin registers these tools for your OpenClaw agent:
|
|
135
|
+
|
|
136
|
+
| Tool | Description |
|
|
137
|
+
|------|-------------|
|
|
138
|
+
| `voice_assistant.call` | Initiate an outbound phone call |
|
|
139
|
+
| `voice_assistant.hangup` | End an active call |
|
|
140
|
+
| `voice_assistant.status` | Get status of active/recent calls |
|
|
141
|
+
| `voice_assistant.promote_memory` | Promote a voice memory to main memory |
|
|
142
|
+
|
|
143
|
+
## Architecture
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
Phone ──PSTN──> Telnyx ──WebSocket──> ClawVoice Plugin ──> OpenClaw Agent
|
|
147
|
+
│
|
|
148
|
+
┌──────┴──────┐
|
|
149
|
+
Deepgram ElevenLabs
|
|
150
|
+
Voice Agent Conversational AI
|
|
151
|
+
(STT+LLM+TTS) (STT+TTS, OpenClaw=LLM)
|
|
152
|
+
│
|
|
153
|
+
voice-memory/
|
|
154
|
+
(sandboxed writes)
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Configuration Reference
|
|
158
|
+
|
|
159
|
+
See [`.env.example`](.env.example) for all environment variables.
|
|
160
|
+
|
|
161
|
+
Key settings in `openclaw.plugin.json` `configSchema`:
|
|
162
|
+
|
|
163
|
+
| Setting | Type | Default | Description |
|
|
164
|
+
|---------|------|---------|-------------|
|
|
165
|
+
| `telephonyProvider` | `"telnyx" \| "twilio"` | `"telnyx"` | PSTN provider |
|
|
166
|
+
| `voiceProvider` | `"deepgram-agent" \| "elevenlabs-conversational"` | `"deepgram-agent"` | Voice pipeline |
|
|
167
|
+
| `voiceSystemPrompt` | `string` | `""` | Instructions for how the agent behaves on calls |
|
|
168
|
+
| `inboundEnabled` | `boolean` | `true` | Accept inbound calls (disable to only allow outbound) |
|
|
169
|
+
| `mainMemoryAccess` | `"read" \| "none"` | `"read"` | Can voice agent read main MEMORY.md? |
|
|
170
|
+
| `autoExtractMemories` | `boolean` | `true` | Extract memories from transcripts after calls |
|
|
171
|
+
| `restrictTools` | `boolean` | `true` | Restrict tool access for voice sessions |
|
|
172
|
+
| `amdEnabled` | `boolean` | `true` | Answering machine detection for outbound calls |
|
|
173
|
+
| `maxCallDuration` | `number` | `1800` | Maximum call length in seconds |
|
|
174
|
+
| `recordCalls` | `boolean` | `false` | Save call recordings |
|
|
175
|
+
|
|
176
|
+
## Customizing the Agent's Voice Persona
|
|
177
|
+
|
|
178
|
+
Set `voiceSystemPrompt` to control how your agent behaves on phone calls:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
openclaw config set clawvoice.voiceSystemPrompt "You are a friendly customer support agent for Acme Corp. Be concise, helpful, and professional. Always confirm the caller's name before proceeding."
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
This prompt is injected into the voice agent's system instructions alongside OpenClaw's base personality. If left empty, the agent uses OpenClaw's default system prompt.
|
|
185
|
+
|
|
186
|
+
## Documentation
|
|
187
|
+
|
|
188
|
+
- [`docs/SETUP.md`](docs/SETUP.md) - Full setup guide with step-by-step instructions and configuration reference
|
|
189
|
+
- [`docs/FEATURES.md`](docs/FEATURES.md) - Complete feature list
|
|
190
|
+
|
|
191
|
+
- [`docs/OPENCLAW_PLUGIN_GUIDE.md`](docs/OPENCLAW_PLUGIN_GUIDE.md) - Technical guide for building the OpenClaw plugin
|
|
192
|
+
|
|
193
|
+
## Development
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
# Install dependencies
|
|
197
|
+
npm install
|
|
198
|
+
|
|
199
|
+
# Build
|
|
200
|
+
npm run build
|
|
201
|
+
|
|
202
|
+
# Run tests
|
|
203
|
+
npm test
|
|
204
|
+
|
|
205
|
+
# Development mode (watch + rebuild)
|
|
206
|
+
npm run dev
|
|
207
|
+
|
|
208
|
+
# Link for local OpenClaw testing
|
|
209
|
+
npm link
|
|
210
|
+
openclaw plugins install --link @clawvoice/voice-assistant
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## License
|
|
214
|
+
|
|
215
|
+
MIT
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PluginAPI } from "@openclaw/plugin-sdk";
|
|
2
|
+
import { ClawVoiceConfig } from "./config";
|
|
3
|
+
import { MemoryExtractionService } from "./services/memory-extraction";
|
|
4
|
+
import { VoiceCallService } from "./services/voice-call";
|
|
5
|
+
export interface SetupPrompter {
|
|
6
|
+
ask(question: string): Promise<string>;
|
|
7
|
+
close(): void;
|
|
8
|
+
}
|
|
9
|
+
export declare function runSetupWizard(api: PluginAPI, args: string[], prompter?: SetupPrompter): Promise<void>;
|
|
10
|
+
export declare function registerCLI(api: PluginAPI, config: ClawVoiceConfig, callService: VoiceCallService, memoryService?: MemoryExtractionService): void;
|