supafone-labs 0.3.1 → 0.3.2

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 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
@@ -74,11 +74,39 @@ export interface UsageToday {
74
74
  cap: number;
75
75
  }>;
76
76
  }
77
+ export interface LabsLogEntry {
78
+ id: number;
79
+ at: string;
80
+ endpoint: string;
81
+ seconds_billed: number;
82
+ duration_ms: number;
83
+ detail: string;
84
+ meta: Record<string, unknown>;
85
+ }
86
+ export interface StreamLogsOptions {
87
+ limit?: number;
88
+ afterId?: number;
89
+ pollMs?: number;
90
+ snapshot?: boolean;
91
+ signal?: AbortSignal;
92
+ }
77
93
  export type LabsAgentType = "phone" | "web" | "campaign";
78
94
  export type LabsAgentStyle = "inbound" | "outbound";
79
95
  export type LabsRuntimeMode = "multi_stage" | "single_stage";
80
96
  export type LabsTelephonyMode = "supafone_managed" | "byok";
81
- export type LabsTelephonyProvider = "supafone" | "twilio" | "telnyx" | "plivo" | "sip" | string;
97
+ export type LabsTelephonyProvider = "supafone" | "twilio" | "telnyx" | "plivo" | "signalwire" | "sip" | "custom_sip" | "custom" | string;
98
+ export type LabsNumberStrategy = "default_pool" | "dedicated" | "premium" | "byok" | string;
99
+ export interface LabsCallStage {
100
+ key?: string;
101
+ id?: string;
102
+ name: string;
103
+ goal?: string;
104
+ instructions?: string;
105
+ exitCriteria?: string[];
106
+ exit_criteria?: string[];
107
+ tools?: string[];
108
+ metadata?: Record<string, unknown>;
109
+ }
82
110
  export interface LabsVoiceSelection {
83
111
  provider?: string;
84
112
  voiceId?: string;
@@ -86,9 +114,51 @@ export interface LabsVoiceSelection {
86
114
  model?: string;
87
115
  }
88
116
  export interface LabsProviderKeys {
117
+ /** Agent runtime/platform providers. */
89
118
  ultravox?: string;
90
119
  ultravoxApiKey?: string;
91
120
  ultravox_api_key?: string;
121
+ retell?: string;
122
+ retellApiKey?: string;
123
+ retell_api_key?: string;
124
+ vapi?: string;
125
+ vapiApiKey?: string;
126
+ vapi_api_key?: string;
127
+ bland?: string;
128
+ blandApiKey?: string;
129
+ bland_api_key?: string;
130
+ livekit?: string;
131
+ livekitApiKey?: string;
132
+ livekit_api_key?: string;
133
+ livekitApiSecret?: string;
134
+ livekit_api_secret?: string;
135
+ pipecat?: string;
136
+ pipecatApiKey?: string;
137
+ pipecat_api_key?: string;
138
+ /** Telephony/carrier providers. */
139
+ twilio?: string;
140
+ twilioAccountSid?: string;
141
+ twilio_account_sid?: string;
142
+ twilioAuthToken?: string;
143
+ twilio_auth_token?: string;
144
+ twilioApiKeySid?: string;
145
+ twilio_api_key_sid?: string;
146
+ twilioApiKeySecret?: string;
147
+ twilio_api_key_secret?: string;
148
+ telnyx?: string;
149
+ telnyxApiKey?: string;
150
+ telnyx_api_key?: string;
151
+ plivo?: string;
152
+ plivoAuthId?: string;
153
+ plivo_auth_id?: string;
154
+ plivoAuthToken?: string;
155
+ plivo_auth_token?: string;
156
+ signalwire?: string;
157
+ signalwireApiToken?: string;
158
+ signalwire_api_token?: string;
159
+ signalwireProjectId?: string;
160
+ signalwire_project_id?: string;
161
+ /** TTS providers. */
92
162
  elevenlabs?: string;
93
163
  elevenlabsApiKey?: string;
94
164
  elevenlabs_api_key?: string;
@@ -101,6 +171,62 @@ export interface LabsProviderKeys {
101
171
  deepgram?: string;
102
172
  deepgramApiKey?: string;
103
173
  deepgram_api_key?: string;
174
+ /** Brain/STT providers used by Labs watcher or customer BYOK stacks. */
175
+ anthropic?: string;
176
+ anthropicApiKey?: string;
177
+ anthropic_api_key?: string;
178
+ openai?: string;
179
+ openaiApiKey?: string;
180
+ openai_api_key?: string;
181
+ xai?: string;
182
+ xaiApiKey?: string;
183
+ xai_api_key?: string;
184
+ [extra: string]: unknown;
185
+ }
186
+ export interface LabsCustomSipConfig {
187
+ sipTrunkUri?: string;
188
+ sip_trunk_uri?: string;
189
+ trunkUri?: string;
190
+ trunk_uri?: string;
191
+ sipHost?: string;
192
+ sip_host?: string;
193
+ fromNumber?: string;
194
+ from_number?: string;
195
+ username?: string;
196
+ password?: string;
197
+ transport?: string;
198
+ headers?: Record<string, string>;
199
+ codecs?: string[];
200
+ dtmfMode?: string;
201
+ dtmf_mode?: string;
202
+ metadata?: Record<string, unknown>;
203
+ [extra: string]: unknown;
204
+ }
205
+ export interface LabsProviderByokConfig {
206
+ provider?: string;
207
+ apiKey?: string;
208
+ api_key?: string;
209
+ credentials?: Record<string, unknown>;
210
+ settings?: Record<string, unknown>;
211
+ model?: string;
212
+ voiceId?: string;
213
+ voice_id?: string;
214
+ [extra: string]: unknown;
215
+ }
216
+ export interface LabsByokConfig {
217
+ providerKeys?: LabsProviderKeys;
218
+ provider_keys?: LabsProviderKeys;
219
+ agentProvider?: LabsProviderByokConfig;
220
+ agent_provider?: LabsProviderByokConfig;
221
+ runtime?: LabsProviderByokConfig;
222
+ telephony?: LabsTelephonyConfig;
223
+ tts?: LabsProviderByokConfig;
224
+ stt?: LabsProviderByokConfig;
225
+ llm?: LabsProviderByokConfig;
226
+ customSip?: LabsCustomSipConfig;
227
+ custom_sip?: LabsCustomSipConfig;
228
+ sip?: LabsCustomSipConfig;
229
+ [extra: string]: unknown;
104
230
  }
105
231
  export interface LabsTelephonyCredentials {
106
232
  accountSid?: string;
@@ -115,6 +241,20 @@ export interface LabsTelephonyCredentials {
115
241
  auth_id?: string;
116
242
  connectionId?: string;
117
243
  connection_id?: string;
244
+ telnyxConnectionId?: string;
245
+ telnyx_connection_id?: string;
246
+ signalwireSpaceUrl?: string;
247
+ signalwire_space_url?: string;
248
+ projectId?: string;
249
+ project_id?: string;
250
+ applicationId?: string;
251
+ application_id?: string;
252
+ trunkId?: string;
253
+ trunk_id?: string;
254
+ endpointId?: string;
255
+ endpoint_id?: string;
256
+ token?: string;
257
+ secret?: string;
118
258
  fromNumber?: string;
119
259
  from_number?: string;
120
260
  sipTrunkUri?: string;
@@ -125,6 +265,9 @@ export interface LabsTelephonyCredentials {
125
265
  password?: string;
126
266
  webhookSecret?: string;
127
267
  webhook_secret?: string;
268
+ customSip?: LabsCustomSipConfig;
269
+ custom_sip?: LabsCustomSipConfig;
270
+ [extra: string]: unknown;
128
271
  }
129
272
  export interface LabsTelephonyConfig {
130
273
  agencyId?: string;
@@ -132,9 +275,22 @@ export interface LabsTelephonyConfig {
132
275
  /** Default is Supafone-managed; developers do not need Twilio for this path. */
133
276
  mode?: LabsTelephonyMode;
134
277
  provider?: LabsTelephonyProvider;
278
+ /** default_pool reuses idle Supafone numbers; dedicated/premium reserve a number-month. */
279
+ numberStrategy?: LabsNumberStrategy;
280
+ number_strategy?: LabsNumberStrategy;
281
+ numberPool?: string;
282
+ number_pool?: string;
283
+ numberId?: string;
284
+ number_id?: string;
285
+ premium?: boolean;
135
286
  label?: string;
136
287
  credentials?: LabsTelephonyCredentials;
288
+ providerSettings?: Record<string, unknown>;
289
+ provider_settings?: Record<string, unknown>;
290
+ customSip?: LabsCustomSipConfig;
291
+ custom_sip?: LabsCustomSipConfig;
137
292
  metadata?: Record<string, unknown>;
293
+ [extra: string]: unknown;
138
294
  }
139
295
  export interface LabsToolsConfig {
140
296
  callRouting?: boolean;
@@ -154,11 +310,58 @@ export interface LabsToolsConfig {
154
310
  customTools?: Array<Record<string, unknown>>;
155
311
  custom_tools?: Array<Record<string, unknown>>;
156
312
  }
313
+ export interface LabsRecordingConfig {
314
+ enabled?: boolean;
315
+ recordAudio?: boolean;
316
+ record_audio?: boolean;
317
+ consentRequired?: boolean;
318
+ consent_required?: boolean;
319
+ announcement?: string;
320
+ retentionDays?: number;
321
+ retention_days?: number;
322
+ storage?: "supafone_managed" | "byok" | string;
323
+ redactPii?: boolean;
324
+ redact_pii?: boolean;
325
+ metadata?: Record<string, unknown>;
326
+ }
327
+ export interface LabsTranscriptionConfig {
328
+ enabled?: boolean;
329
+ provider?: string;
330
+ model?: string;
331
+ language?: string;
332
+ redactPii?: boolean;
333
+ redact_pii?: boolean;
334
+ diarization?: boolean;
335
+ timestamps?: boolean;
336
+ metadata?: Record<string, unknown>;
337
+ }
338
+ export interface LabsArtifactsConfig {
339
+ recordings?: boolean;
340
+ transcripts?: boolean;
341
+ summaries?: boolean;
342
+ qaReports?: boolean;
343
+ qa_reports?: boolean;
344
+ logs?: boolean;
345
+ webhooks?: boolean;
346
+ retentionDays?: number;
347
+ retention_days?: number;
348
+ metadata?: Record<string, unknown>;
349
+ }
157
350
  export interface LabsWatcherConfig {
158
351
  enabled?: boolean;
159
352
  voiceWatcher?: boolean;
160
353
  voice_watcher?: boolean;
354
+ apiKey?: string;
355
+ api_key?: string;
161
356
  model?: string;
357
+ mode?: "supafone_managed" | "byok" | string;
358
+ managedInfrastructure?: boolean;
359
+ managed_infrastructure?: boolean;
360
+ stt?: Record<string, unknown>;
361
+ llm?: Record<string, unknown>;
362
+ tts?: Record<string, unknown>;
363
+ providerKeys?: Record<string, unknown>;
364
+ provider_keys?: Record<string, unknown>;
162
365
  label?: string;
163
366
  }
164
367
  export interface LabsUltravoxRuntime {
@@ -203,6 +406,10 @@ export interface LabsUltravoxRuntime {
203
406
  retention_policy?: string;
204
407
  callTemplate?: Record<string, unknown>;
205
408
  call_template?: Record<string, unknown>;
409
+ customSip?: LabsCustomSipConfig;
410
+ custom_sip?: LabsCustomSipConfig;
411
+ sip?: LabsCustomSipConfig;
412
+ [extra: string]: unknown;
206
413
  }
207
414
  export interface CreateLabsAgentRequest {
208
415
  agencyId?: string;
@@ -225,11 +432,22 @@ export interface CreateLabsAgentRequest {
225
432
  website_url?: string;
226
433
  phoneNumber?: string;
227
434
  phone_number?: string;
435
+ numberStrategy?: LabsNumberStrategy;
436
+ number_strategy?: LabsNumberStrategy;
437
+ numberPool?: string;
438
+ number_pool?: string;
439
+ premium?: boolean;
228
440
  direction?: string;
229
441
  presetKey?: string;
230
442
  preset_key?: string;
231
443
  runtimeMode?: LabsRuntimeMode;
232
444
  runtime_mode?: LabsRuntimeMode;
445
+ /** Default true. When true, the SDK creates sensible call stages from prompt metadata. */
446
+ callStages?: boolean | LabsCallStage[];
447
+ call_stages?: boolean | LabsCallStage[];
448
+ stages?: LabsCallStage[];
449
+ autoCallStages?: boolean;
450
+ auto_call_stages?: boolean;
233
451
  goal?: string;
234
452
  greeting?: string;
235
453
  systemPrompt?: string;
@@ -238,8 +456,15 @@ export interface CreateLabsAgentRequest {
238
456
  voice?: LabsVoiceSelection;
239
457
  providerKeys?: LabsProviderKeys;
240
458
  provider_keys?: LabsProviderKeys;
241
- byok?: LabsProviderKeys;
459
+ byok?: LabsProviderKeys | LabsByokConfig;
242
460
  telephony?: LabsTelephonyConfig;
461
+ customSip?: LabsCustomSipConfig;
462
+ custom_sip?: LabsCustomSipConfig;
463
+ sip?: LabsCustomSipConfig;
464
+ recording?: LabsRecordingConfig;
465
+ transcription?: LabsTranscriptionConfig;
466
+ artifacts?: LabsArtifactsConfig;
467
+ compliance?: Record<string, unknown>;
243
468
  tools?: LabsToolsConfig;
244
469
  labs?: LabsWatcherConfig;
245
470
  ultravox?: LabsUltravoxRuntime;
@@ -256,6 +481,19 @@ export interface ListLabsAgentsOptions {
256
481
  }
257
482
  export interface GetLabsAgentOptions extends ListLabsAgentsOptions {
258
483
  }
484
+ export interface DeleteLabsAgentOptions {
485
+ agencyId?: string;
486
+ agency_id?: string;
487
+ releaseNumbers?: boolean;
488
+ release_numbers?: boolean;
489
+ }
490
+ export interface DeleteLabsAgentResponse {
491
+ success?: boolean;
492
+ deleted?: boolean;
493
+ agent_key?: string;
494
+ released_numbers?: unknown[];
495
+ [extra: string]: unknown;
496
+ }
259
497
  export interface LabsCapabilitiesResponse {
260
498
  product: string;
261
499
  api_namespace: string;
@@ -283,9 +521,50 @@ export interface LabsVoiceListResponse {
283
521
  provider_accounts?: Record<string, unknown>;
284
522
  errors?: Record<string, string>;
285
523
  }
524
+ export interface LabsCallListOptions {
525
+ agencyId?: string;
526
+ agentKey?: string;
527
+ agent_key?: string;
528
+ limit?: number;
529
+ }
530
+ export interface LabsCallArtifact {
531
+ id?: string;
532
+ call_id?: string;
533
+ agent_key?: string;
534
+ status?: string;
535
+ started_at?: string;
536
+ duration_seconds?: number;
537
+ recording_url?: string;
538
+ transcript_url?: string;
539
+ [extra: string]: unknown;
540
+ }
541
+ export interface LabsCallListResponse {
542
+ calls: LabsCallArtifact[];
543
+ [extra: string]: unknown;
544
+ }
545
+ export interface LabsRecordingListOptions extends LabsCallListOptions {
546
+ callId?: string;
547
+ call_id?: string;
548
+ }
549
+ export interface LabsRecordingListResponse {
550
+ recordings: Array<Record<string, unknown>>;
551
+ [extra: string]: unknown;
552
+ }
553
+ export interface LabsTranscriptListOptions extends LabsCallListOptions {
554
+ callId?: string;
555
+ call_id?: string;
556
+ }
557
+ export interface LabsTranscriptListResponse {
558
+ transcripts: Array<Record<string, unknown>>;
559
+ [extra: string]: unknown;
560
+ }
286
561
  export interface LabsPhoneNumberSearchOptions {
287
562
  agencyId?: string;
288
563
  agency_id?: string;
564
+ numberPool?: string;
565
+ number_pool?: string;
566
+ numberStrategy?: LabsNumberStrategy;
567
+ number_strategy?: LabsNumberStrategy;
289
568
  countryCode?: string;
290
569
  country_code?: string;
291
570
  areaCode?: string;
@@ -354,6 +633,11 @@ export interface LabsPhoneNumberProvisionRequest {
354
633
  agent_name?: string;
355
634
  presetKey?: string;
356
635
  preset_key?: string;
636
+ numberStrategy?: LabsNumberStrategy;
637
+ number_strategy?: LabsNumberStrategy;
638
+ numberPool?: string;
639
+ number_pool?: string;
640
+ premium?: boolean;
357
641
  style?: LabsAgentStyle;
358
642
  agentStyle?: LabsAgentStyle;
359
643
  agent_style?: LabsAgentStyle;
@@ -363,6 +647,14 @@ export interface LabsPhoneNumberProvisionRequest {
363
647
  }
364
648
  export interface LabsPhoneNumberAssignRequest extends Omit<LabsPhoneNumberProvisionRequest, "phoneNumber" | "phone_number" | "departmentId" | "department_id"> {
365
649
  }
650
+ export interface LabsPhoneNumberReleaseRequest {
651
+ agencyId?: string;
652
+ agency_id?: string;
653
+ reason?: string;
654
+ returnToPool?: boolean;
655
+ return_to_pool?: boolean;
656
+ metadata?: Record<string, unknown>;
657
+ }
366
658
  export interface LabsPhoneNumberProvisionResponse {
367
659
  success: boolean;
368
660
  number: LabsPhoneNumberRecord;
@@ -375,6 +667,13 @@ export interface LabsPhoneNumberAssignResponse {
375
667
  number: LabsPhoneNumberRecord;
376
668
  assignment?: Record<string, unknown>;
377
669
  }
670
+ export interface LabsPhoneNumberReleaseResponse {
671
+ success: boolean;
672
+ number?: LabsPhoneNumberRecord;
673
+ released?: boolean;
674
+ returned_to_pool?: boolean;
675
+ [extra: string]: unknown;
676
+ }
378
677
  export interface LabsPhoneNumberBuyAndAssignRequest extends LabsPhoneNumberProvisionRequest {
379
678
  search?: LabsPhoneNumberSearchOptions;
380
679
  }
@@ -537,6 +836,8 @@ export declare class SupafoneLabs {
537
836
  whisper(transcript: string, opts?: WhisperOptions): Promise<string>;
538
837
  /** Hosted TTS — returns raw audio bytes (WAV/PCM per voice). */
539
838
  tts(text: string, voice?: string): Promise<Uint8Array>;
839
+ /** Convenience alias for voice preview UI/buttons. */
840
+ previewVoice(voice?: string, text?: string): Promise<Uint8Array>;
540
841
  /** Hosted STT for a finished audio clip — returns transcript + language tags. */
541
842
  stt(audio: Uint8Array | ArrayBuffer, opts?: {
542
843
  language?: string;
@@ -554,8 +855,10 @@ export declare class SupafoneLabs {
554
855
  usage(): Promise<UsageToday>;
555
856
  /** The auditable whisper/billing log. */
556
857
  logs(limit?: number): Promise<{
557
- logs: unknown[];
858
+ logs: LabsLogEntry[];
558
859
  }>;
860
+ /** Live audit-log stream. Works in Node 18+ and browsers via fetch streaming. */
861
+ streamLogs(opts?: StreamLogsOptions): AsyncGenerator<LabsLogEntry>;
559
862
  /** The structured whisper feed (what the console shows). */
560
863
  nudges(limit?: number): Promise<{
561
864
  nudges: unknown[];
@@ -572,6 +875,10 @@ export declare class SupafoneLabs {
572
875
  models(): Promise<string[]>;
573
876
  /** Available TTS voice ids. */
574
877
  voices(): Promise<string[]>;
878
+ /** Full hosted voice catalog with provider live/configured flags. */
879
+ voiceCatalog(): Promise<{
880
+ voices: Array<Record<string, unknown>>;
881
+ }>;
575
882
  }
576
883
  export interface LiveTranscribeOptions {
577
884
  language?: string;
@@ -606,6 +913,9 @@ declare class LabsNamespace {
606
913
  readonly voices: LabsVoicesNamespace;
607
914
  readonly phoneNumbers: LabsPhoneNumbersNamespace;
608
915
  readonly telephony: LabsTelephonyNamespace;
916
+ readonly calls: LabsCallsNamespace;
917
+ readonly recordings: LabsRecordingsNamespace;
918
+ readonly transcripts: LabsTranscriptsNamespace;
609
919
  constructor(sm: SupafoneLabs);
610
920
  /** Discover the Supafone convenience layer over Ultravox. */
611
921
  capabilities(): Promise<LabsCapabilitiesResponse>;
@@ -633,6 +943,8 @@ declare class LabsAgentsNamespace {
633
943
  list(opts?: ListLabsAgentsOptions): Promise<ListLabsAgentsResponse>;
634
944
  /** Fetch one durable agent by key. */
635
945
  get(agentKey: string, opts?: GetLabsAgentOptions): Promise<GetLabsAgentResponse>;
946
+ /** Delete an agent. Optionally ask the backend to release assigned numbers. */
947
+ delete(agentKey: string, opts?: DeleteLabsAgentOptions): Promise<DeleteLabsAgentResponse>;
636
948
  }
637
949
  declare class LabsPresetsNamespace {
638
950
  private sm;
@@ -652,6 +964,34 @@ declare class LabsVoicesNamespace {
652
964
  /** Supafone-managed Ultravox, Cartesia, Inworld, and ElevenLabs-compatible voices. */
653
965
  list(opts?: LabsVoiceListOptions): Promise<LabsVoiceListResponse>;
654
966
  }
967
+ declare class LabsCallsNamespace {
968
+ private sm;
969
+ constructor(sm: SupafoneLabs);
970
+ list(opts?: LabsCallListOptions): Promise<LabsCallListResponse>;
971
+ get(callId: string, opts?: {
972
+ agencyId?: string;
973
+ }): Promise<Record<string, unknown>>;
974
+ }
975
+ declare class LabsRecordingsNamespace {
976
+ private sm;
977
+ constructor(sm: SupafoneLabs);
978
+ list(opts?: LabsRecordingListOptions): Promise<LabsRecordingListResponse>;
979
+ get(recordingId: string, opts?: {
980
+ agencyId?: string;
981
+ }): Promise<Record<string, unknown>>;
982
+ delete(recordingId: string, opts?: {
983
+ agencyId?: string;
984
+ reason?: string;
985
+ }): Promise<Record<string, unknown>>;
986
+ }
987
+ declare class LabsTranscriptsNamespace {
988
+ private sm;
989
+ constructor(sm: SupafoneLabs);
990
+ list(opts?: LabsTranscriptListOptions): Promise<LabsTranscriptListResponse>;
991
+ get(transcriptId: string, opts?: {
992
+ agencyId?: string;
993
+ }): Promise<Record<string, unknown>>;
994
+ }
655
995
  declare class LabsPhoneNumbersNamespace {
656
996
  private sm;
657
997
  constructor(sm: SupafoneLabs);
@@ -663,6 +1003,14 @@ declare class LabsPhoneNumbersNamespace {
663
1003
  buy(input: LabsPhoneNumberProvisionRequest): Promise<LabsPhoneNumberProvisionResponse>;
664
1004
  /** Attach an existing Supafone number to an inbound or outbound agent. */
665
1005
  assign(numberId: string, input?: LabsPhoneNumberAssignRequest): Promise<LabsPhoneNumberAssignResponse>;
1006
+ /** Unassign a number from an agent but keep it reserved on the account. */
1007
+ unassign(numberId: string, input?: LabsPhoneNumberReleaseRequest): Promise<LabsPhoneNumberReleaseResponse>;
1008
+ /** Give a number back to the shared pool or release the reservation. */
1009
+ release(numberId: string, input?: LabsPhoneNumberReleaseRequest): Promise<LabsPhoneNumberReleaseResponse>;
1010
+ /** Alias for release(numberId, { returnToPool: true }). */
1011
+ returnToPool(numberId: string, input?: LabsPhoneNumberReleaseRequest): Promise<LabsPhoneNumberReleaseResponse>;
1012
+ /** Delete/release a number reservation. Backend policy decides whether this is allowed. */
1013
+ delete(numberId: string, input?: LabsPhoneNumberReleaseRequest): Promise<LabsPhoneNumberReleaseResponse>;
666
1014
  /**
667
1015
  * Search if needed, buy the first matching Supafone-managed number, and assign
668
1016
  * it to the supplied agent. This is the zero-Twilio-account happy path.
@@ -727,10 +1075,20 @@ declare class OptimizerNamespace {
727
1075
  version: number;
728
1076
  text: string;
729
1077
  }>;
1078
+ /** SSR grade distribution: five nominal levels folded into a real score distribution. */
1079
+ distribution(agent?: string, limit?: number): Promise<{
1080
+ agent: string;
1081
+ calls: number;
1082
+ counts: Record<string, number>;
1083
+ mean_score: number;
1084
+ buckets: number[];
1085
+ bucket_edges: number[];
1086
+ }>;
730
1087
  /** List the post-call reports behind the optimizer. */
731
1088
  reports(agent?: string, limit?: number): Promise<{
732
1089
  reports: unknown[];
733
1090
  }>;
734
1091
  }
1092
+ export declare function generateCallStages(input: CreateLabsAgentRequest): LabsCallStage[];
735
1093
  export { SupafoneLabs as Supafone };
736
1094
  export default SupafoneLabs;