supafone-labs 0.3.1 → 0.4.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/README.md +73 -1
- package/dist/cjs/index.d.ts +529 -4
- package/dist/cjs/index.js +660 -6
- package/dist/index.d.ts +529 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +659 -6
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
- package/src/index.ts +1120 -8
package/README.md
CHANGED
|
@@ -59,6 +59,21 @@ The default path is fully Supafone-managed. Developers do **not** need a Twilio
|
|
|
59
59
|
account, Ultravox account, or voice-provider account to buy a number and launch
|
|
60
60
|
an agent.
|
|
61
61
|
|
|
62
|
+
Supafone Labs has two main features:
|
|
63
|
+
|
|
64
|
+
- **Agent Factory**: create the complete hosted agent with managed provider
|
|
65
|
+
defaults and one Supafone API key.
|
|
66
|
+
- **Self-healing watcher**: enable `labs.enabled` to attach the Supafone Labs
|
|
67
|
+
second mind to a hosted or BYOK agent.
|
|
68
|
+
|
|
69
|
+
BYOK is advanced and split into three independent lanes:
|
|
70
|
+
|
|
71
|
+
| Lane | Examples |
|
|
72
|
+
| --- | --- |
|
|
73
|
+
| Agent/provider stack | Ultravox, Retell, Vapi, Bland, LiveKit, Pipecat, GPT Realtime, Grok |
|
|
74
|
+
| Telephony | Twilio, Telnyx, Plivo, SignalWire, SIP/custom trunks |
|
|
75
|
+
| TTS | Cartesia, ElevenLabs, Inworld, Deepgram, custom TTS |
|
|
76
|
+
|
|
62
77
|
```ts
|
|
63
78
|
import { Supafone } from "supafone-labs";
|
|
64
79
|
|
|
@@ -88,6 +103,21 @@ const inbound = await supafone.labs.agents.createInboundWithNumber({
|
|
|
88
103
|
enabled: true,
|
|
89
104
|
model: "gemma",
|
|
90
105
|
},
|
|
106
|
+
recording: {
|
|
107
|
+
enabled: true,
|
|
108
|
+
recordAudio: true,
|
|
109
|
+
consentRequired: true,
|
|
110
|
+
announcement: "This call may be recorded for quality and training.",
|
|
111
|
+
retentionDays: 30,
|
|
112
|
+
redactPii: true,
|
|
113
|
+
},
|
|
114
|
+
transcription: {
|
|
115
|
+
enabled: true,
|
|
116
|
+
provider: "supafone_managed",
|
|
117
|
+
language: "multi",
|
|
118
|
+
diarization: true,
|
|
119
|
+
timestamps: true,
|
|
120
|
+
},
|
|
91
121
|
tools: {
|
|
92
122
|
callRouting: true,
|
|
93
123
|
scheduling: true,
|
|
@@ -128,8 +158,16 @@ const outbound = await supafone.labs.agents.createOutboundWithNumber({
|
|
|
128
158
|
console.log(outbound.number?.assignment);
|
|
129
159
|
```
|
|
130
160
|
|
|
161
|
+
Call artifacts are available from the same hosted-agent namespace:
|
|
162
|
+
|
|
163
|
+
```ts
|
|
164
|
+
await supafone.labs.calls.list({ agentKey: "medivoice-intake" });
|
|
165
|
+
await supafone.labs.recordings.list({ agentKey: "medivoice-intake" });
|
|
166
|
+
await supafone.labs.transcripts.list({ agentKey: "medivoice-intake" });
|
|
167
|
+
```
|
|
168
|
+
|
|
131
169
|
If you already own telephony, keep Supafone's agent framework and configure
|
|
132
|
-
BYOK as the advanced path:
|
|
170
|
+
that BYOK lane as the advanced path:
|
|
133
171
|
|
|
134
172
|
```ts
|
|
135
173
|
await supafone.labs.telephony.configure({
|
|
@@ -143,6 +181,40 @@ await supafone.labs.telephony.configure({
|
|
|
143
181
|
});
|
|
144
182
|
```
|
|
145
183
|
|
|
184
|
+
Or configure all three BYOK lanes in one agent payload:
|
|
185
|
+
|
|
186
|
+
```ts
|
|
187
|
+
await supafone.labs.agents.createOutbound({
|
|
188
|
+
agentKey: "speed-to-lead-byok",
|
|
189
|
+
name: "Speed to lead BYOK",
|
|
190
|
+
byok: {
|
|
191
|
+
agentProvider: {
|
|
192
|
+
provider: "ultravox",
|
|
193
|
+
apiKey: process.env.ULTRAVOX_API_KEY!,
|
|
194
|
+
},
|
|
195
|
+
telephony: {
|
|
196
|
+
mode: "byok",
|
|
197
|
+
provider: "telnyx",
|
|
198
|
+
credentials: {
|
|
199
|
+
apiKey: process.env.TELNYX_API_KEY!,
|
|
200
|
+
connectionId: process.env.TELNYX_CONNECTION_ID!,
|
|
201
|
+
fromNumber: "+14155550123",
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
tts: {
|
|
205
|
+
provider: "cartesia",
|
|
206
|
+
apiKey: process.env.CARTESIA_API_KEY!,
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
labs: {
|
|
210
|
+
enabled: true,
|
|
211
|
+
mode: "byok",
|
|
212
|
+
managedInfrastructure: false,
|
|
213
|
+
tts: { provider: "cartesia" },
|
|
214
|
+
},
|
|
215
|
+
});
|
|
216
|
+
```
|
|
217
|
+
|
|
146
218
|
## Verify the hosted-agent path
|
|
147
219
|
|
|
148
220
|
Use the production smoke example before handing a key to a customer or testing a
|