supafone-labs 0.5.2 → 0.5.3
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 +6 -7
- package/dist/cjs/index.d.ts +36 -25
- package/dist/cjs/index.js +20 -18
- package/dist/index.d.ts +36 -25
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -18
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +57 -42
package/README.md
CHANGED
|
@@ -104,13 +104,13 @@ Supafone Labs has two main features:
|
|
|
104
104
|
|
|
105
105
|
- **Agent Factory**: create the complete hosted agent with managed provider
|
|
106
106
|
defaults and one Supafone API key.
|
|
107
|
-
- **
|
|
108
|
-
|
|
107
|
+
- **Supafone Supervisor**: attach live guidance, call scoring, and QA to a
|
|
108
|
+
hosted or BYOK agent.
|
|
109
109
|
|
|
110
110
|
The daily developer workflow is documented in
|
|
111
111
|
[Developer Workflows](../gitbook/developer-workflows.md): one normalized live
|
|
112
112
|
voice catalog, fixed BCP-47 language selection, automatic voice compatibility
|
|
113
|
-
filtering, structured
|
|
113
|
+
filtering, structured Supervisor directives, and the same configuration model
|
|
114
114
|
across TypeScript and Python. Fixed language selection does not enable
|
|
115
115
|
mid-call language or voice switching.
|
|
116
116
|
|
|
@@ -166,10 +166,9 @@ import { Supafone } from "supafone-labs";
|
|
|
166
166
|
const supafone = new Supafone({
|
|
167
167
|
apiKey: process.env.SUPAFONE_LABS_API_KEY || process.env.SUPAFONE_API_KEY!,
|
|
168
168
|
supafoneApiKey: process.env.SUPAFONE_API_KEY!,
|
|
169
|
-
//
|
|
170
|
-
//
|
|
171
|
-
|
|
172
|
-
voiceWatcher: true,
|
|
169
|
+
// Supafone Supervisor is on by default for live guidance, QA, and scoring.
|
|
170
|
+
// Set false only when you intentionally need an unsupervised agent.
|
|
171
|
+
supervisor: true,
|
|
173
172
|
// Defaults to https://api.supafone.ai. Override for staging/local tests.
|
|
174
173
|
// supafoneApiBaseUrl: "http://localhost:8000",
|
|
175
174
|
});
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* A dependency-free TypeScript client for creating hosted Supafone agents
|
|
5
5
|
* through the Supafone API, including managed phone numbers, voices, stages,
|
|
6
|
-
* tools, recordings, transcripts, widgets, and Supafone
|
|
6
|
+
* tools, recordings, transcripts, widgets, and Supafone Supervisor. It also
|
|
7
7
|
* includes the Labs cloud sidecar oracle, hosted TTS/STT, live multilingual
|
|
8
8
|
* transcription, telemetry, agent builder, and objective-driven optimizer.
|
|
9
9
|
*
|
|
@@ -53,15 +53,13 @@ export interface SupafoneLabsOptions {
|
|
|
53
53
|
* fall back to the plain zero-billed report.
|
|
54
54
|
*/
|
|
55
55
|
postCallAnalysis?: boolean;
|
|
56
|
-
/**
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
* agent with no watcher. `voice_watcher` (snake) and the deprecated `labs`
|
|
60
|
-
* are accepted aliases, resolved voiceWatcher > voice_watcher > labs > true.
|
|
61
|
-
*/
|
|
56
|
+
/** Enable Supafone Supervisor live guidance, QA, and scoring (default true). */
|
|
57
|
+
supervisor?: boolean;
|
|
58
|
+
/** @deprecated Use supervisor. */
|
|
62
59
|
voiceWatcher?: boolean;
|
|
60
|
+
/** @deprecated Use supervisor. */
|
|
63
61
|
voice_watcher?: boolean;
|
|
64
|
-
/** @deprecated
|
|
62
|
+
/** @deprecated Use supervisor. */
|
|
65
63
|
labs?: boolean;
|
|
66
64
|
}
|
|
67
65
|
export interface ChatMessage {
|
|
@@ -87,7 +85,9 @@ export interface WhisperOptions {
|
|
|
87
85
|
maxTokens?: number;
|
|
88
86
|
temperature?: number;
|
|
89
87
|
}
|
|
90
|
-
export type
|
|
88
|
+
export type SupervisorDirectiveKind = "empathy" | "tactical" | "guardrail" | "mixed";
|
|
89
|
+
/** @deprecated Use SupervisorDirectiveKind. */
|
|
90
|
+
export type SecondMindDirectiveKind = SupervisorDirectiveKind;
|
|
91
91
|
export interface DirectiveTextControl {
|
|
92
92
|
enabled?: boolean;
|
|
93
93
|
instructions?: string;
|
|
@@ -102,7 +102,7 @@ export interface DirectiveListControl {
|
|
|
102
102
|
itemMaxChars?: number;
|
|
103
103
|
item_max_chars?: number;
|
|
104
104
|
}
|
|
105
|
-
/** Serializable controls for each field generated by
|
|
105
|
+
/** Serializable controls for each field generated by Supafone Supervisor. */
|
|
106
106
|
export interface DirectiveContract {
|
|
107
107
|
empathyDirective?: DirectiveTextControl;
|
|
108
108
|
empathy_directive?: DirectiveTextControl;
|
|
@@ -115,27 +115,29 @@ export interface DirectiveContract {
|
|
|
115
115
|
language_mode?: "caller" | "model" | "fixed";
|
|
116
116
|
fixedLanguage?: string;
|
|
117
117
|
fixed_language?: string;
|
|
118
|
-
allowedKinds?:
|
|
119
|
-
allowed_kinds?:
|
|
118
|
+
allowedKinds?: SupervisorDirectiveKind[];
|
|
119
|
+
allowed_kinds?: SupervisorDirectiveKind[];
|
|
120
120
|
confidenceThreshold?: number;
|
|
121
121
|
confidence_threshold?: number;
|
|
122
122
|
operatorGuardrails?: string[];
|
|
123
123
|
operator_guardrails?: string[];
|
|
124
124
|
}
|
|
125
|
-
export interface
|
|
125
|
+
export interface SupervisorDirective {
|
|
126
126
|
empathy_directive: string;
|
|
127
127
|
tactical_directive: string;
|
|
128
128
|
surface_facts: string[];
|
|
129
129
|
guardrails: string[];
|
|
130
130
|
language: string;
|
|
131
131
|
confidence: number;
|
|
132
|
-
kind:
|
|
132
|
+
kind: SupervisorDirectiveKind;
|
|
133
133
|
}
|
|
134
|
+
/** @deprecated Use SupervisorDirective. */
|
|
135
|
+
export type SecondMindDirective = SupervisorDirective;
|
|
134
136
|
export interface StructuredWhisperOptions extends WhisperOptions {
|
|
135
137
|
directiveContract?: DirectiveContract;
|
|
136
138
|
directive_contract?: DirectiveContract;
|
|
137
139
|
/** Local final say: revise or suppress the generated directive before use. */
|
|
138
|
-
transform?: (directive:
|
|
140
|
+
transform?: (directive: SupervisorDirective) => SupervisorDirective | null | Promise<SupervisorDirective | null>;
|
|
139
141
|
}
|
|
140
142
|
export interface Balance {
|
|
141
143
|
plan: string;
|
|
@@ -579,9 +581,12 @@ export interface LabsArtifactsConfig {
|
|
|
579
581
|
retention_days?: number;
|
|
580
582
|
metadata?: Record<string, unknown>;
|
|
581
583
|
}
|
|
582
|
-
export interface
|
|
584
|
+
export interface LabsSupervisorConfig {
|
|
583
585
|
enabled?: boolean;
|
|
586
|
+
supervisor?: boolean;
|
|
587
|
+
/** @deprecated Use supervisor. */
|
|
584
588
|
voiceWatcher?: boolean;
|
|
589
|
+
/** @deprecated Use supervisor. */
|
|
585
590
|
voice_watcher?: boolean;
|
|
586
591
|
apiKey?: string;
|
|
587
592
|
api_key?: string;
|
|
@@ -596,6 +601,8 @@ export interface LabsWatcherConfig {
|
|
|
596
601
|
provider_keys?: Record<string, unknown>;
|
|
597
602
|
label?: string;
|
|
598
603
|
}
|
|
604
|
+
/** @deprecated Use LabsSupervisorConfig. */
|
|
605
|
+
export type LabsWatcherConfig = LabsSupervisorConfig;
|
|
599
606
|
export interface LabsUltravoxRuntime {
|
|
600
607
|
model?: string;
|
|
601
608
|
temperature?: number;
|
|
@@ -810,9 +817,12 @@ export interface CreateLabsAgentRequest {
|
|
|
810
817
|
artifacts?: LabsArtifactsConfig;
|
|
811
818
|
compliance?: Record<string, unknown>;
|
|
812
819
|
tools?: LabsToolsConfig;
|
|
813
|
-
labs?:
|
|
820
|
+
labs?: LabsSupervisorConfig;
|
|
814
821
|
ultravox?: LabsUltravoxRuntime;
|
|
822
|
+
supervisor?: boolean;
|
|
823
|
+
/** @deprecated Use supervisor. */
|
|
815
824
|
voiceWatcher?: boolean;
|
|
825
|
+
/** @deprecated Use supervisor. */
|
|
816
826
|
voice_watcher?: boolean;
|
|
817
827
|
voiceWatcherModel?: string;
|
|
818
828
|
voice_watcher_model?: string;
|
|
@@ -1518,7 +1528,9 @@ export declare class SupafoneLabs {
|
|
|
1518
1528
|
private readonly supafoneApiKey;
|
|
1519
1529
|
private readonly timeoutMs;
|
|
1520
1530
|
private readonly postCallAnalysis;
|
|
1521
|
-
/** Client default for
|
|
1531
|
+
/** Client default for Supafone Supervisor (live guidance + QA + scoring). */
|
|
1532
|
+
readonly supervisor: boolean;
|
|
1533
|
+
/** @deprecated Use supervisor. */
|
|
1522
1534
|
readonly voiceWatcher: boolean;
|
|
1523
1535
|
private sessionToken?;
|
|
1524
1536
|
private accountToken?;
|
|
@@ -1623,13 +1635,13 @@ export declare class SupafoneLabs {
|
|
|
1623
1635
|
*/
|
|
1624
1636
|
whisper(transcript: string, opts?: WhisperOptions): Promise<string>;
|
|
1625
1637
|
/**
|
|
1626
|
-
* Structured
|
|
1638
|
+
* Structured Supafone Supervisor guidance with developer-controlled field policy.
|
|
1627
1639
|
* Returns null when JSON is invalid, evidence misses the confidence gate,
|
|
1628
1640
|
* the generated kind is disallowed, or the local transform suppresses it.
|
|
1629
1641
|
*/
|
|
1630
|
-
whisperStructured(transcript: string, opts?: StructuredWhisperOptions): Promise<
|
|
1642
|
+
whisperStructured(transcript: string, opts?: StructuredWhisperOptions): Promise<SupervisorDirective | null>;
|
|
1631
1643
|
/** Alias that reads naturally in applications building their own watcher loop. */
|
|
1632
|
-
directive(transcript: string, opts?: StructuredWhisperOptions): Promise<
|
|
1644
|
+
directive(transcript: string, opts?: StructuredWhisperOptions): Promise<SupervisorDirective | null>;
|
|
1633
1645
|
/** Hosted TTS — returns raw audio bytes (WAV/PCM per voice). */
|
|
1634
1646
|
tts(text: string, voice?: string): Promise<Uint8Array>;
|
|
1635
1647
|
/** Convenience alias for voice preview UI/buttons. */
|
|
@@ -2052,10 +2064,9 @@ declare class LabsAgentsNamespace {
|
|
|
2052
2064
|
generateCallStages(input: CreateLabsAgentRequest & {
|
|
2053
2065
|
description?: string;
|
|
2054
2066
|
}): Promise<LabsCallPlan>;
|
|
2055
|
-
/** Default the agent onto the client's
|
|
2056
|
-
*
|
|
2057
|
-
|
|
2058
|
-
private withVoiceWatcher;
|
|
2067
|
+
/** Default the agent onto the client's Supafone Supervisor setting unless the
|
|
2068
|
+
* caller set it explicitly. Legacy wire fields remain unchanged. */
|
|
2069
|
+
private withSupervisor;
|
|
2059
2070
|
/** Create an inbound receptionist/intake agent. No Twilio account is required. */
|
|
2060
2071
|
createInbound(input: CreateLabsAgentRequest): Promise<CreateLabsAgentResponse>;
|
|
2061
2072
|
/** Create an outbound sales/speed-to-lead/campaign agent. No Twilio account is required. */
|
package/dist/cjs/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* A dependency-free TypeScript client for creating hosted Supafone agents
|
|
6
6
|
* through the Supafone API, including managed phone numbers, voices, stages,
|
|
7
|
-
* tools, recordings, transcripts, widgets, and Supafone
|
|
7
|
+
* tools, recordings, transcripts, widgets, and Supafone Supervisor. It also
|
|
8
8
|
* includes the Labs cloud sidecar oracle, hosted TTS/STT, live multilingual
|
|
9
9
|
* transcription, telemetry, agent builder, and objective-driven optimizer.
|
|
10
10
|
*
|
|
@@ -159,11 +159,11 @@ class SupafoneLabsError extends Error {
|
|
|
159
159
|
exports.SupafoneLabsError = SupafoneLabsError;
|
|
160
160
|
const DEFAULT_BASE = "https://api.labs.supafone.ai";
|
|
161
161
|
const DEFAULT_SUPAFONE_API_BASE = "https://api.supafone.ai";
|
|
162
|
-
const COACH_SYSTEM = "You are the coaching core of a
|
|
162
|
+
const COACH_SYSTEM = "You are the coaching core of a supervisor for a live voice agent. Read the " +
|
|
163
163
|
"conversation and return ONE short, silent directive the agent reads but never " +
|
|
164
164
|
"speaks aloud — a correction or nudge, phrased imperatively. If nothing needs " +
|
|
165
165
|
"correcting, return an empty string.";
|
|
166
|
-
const STRUCTURED_COACH_SYSTEM = "You are the coaching core of a
|
|
166
|
+
const STRUCTURED_COACH_SYSTEM = "You are the coaching core of a supervisor for a live voice agent. Read the " +
|
|
167
167
|
"conversation and return ONLY one JSON object with exactly these keys: " +
|
|
168
168
|
"empathy_directive (string), tactical_directive (string), surface_facts (string[]), " +
|
|
169
169
|
"guardrails (string[]), language (short code), confidence (0-1), and kind " +
|
|
@@ -273,7 +273,9 @@ class SupafoneLabs {
|
|
|
273
273
|
supafoneApiKey;
|
|
274
274
|
timeoutMs;
|
|
275
275
|
postCallAnalysis;
|
|
276
|
-
/** Client default for
|
|
276
|
+
/** Client default for Supafone Supervisor (live guidance + QA + scoring). */
|
|
277
|
+
supervisor;
|
|
278
|
+
/** @deprecated Use supervisor. */
|
|
277
279
|
voiceWatcher;
|
|
278
280
|
sessionToken;
|
|
279
281
|
accountToken;
|
|
@@ -298,8 +300,9 @@ class SupafoneLabs {
|
|
|
298
300
|
this.appUrl = (opts.appUrl ?? "https://app.supafone.ai").replace(/\/$/, "");
|
|
299
301
|
this.timeoutMs = opts.timeoutMs ?? 30_000;
|
|
300
302
|
this.postCallAnalysis = opts.postCallAnalysis ?? false;
|
|
301
|
-
// Precedence:
|
|
302
|
-
this.
|
|
303
|
+
// Precedence: supervisor > legacy aliases > true.
|
|
304
|
+
this.supervisor = opts.supervisor ?? opts.voiceWatcher ?? opts.voice_watcher ?? opts.labs ?? true;
|
|
305
|
+
this.voiceWatcher = this.supervisor;
|
|
303
306
|
this.sessionToken = opts.sessionToken;
|
|
304
307
|
this.accountToken = opts.accountToken;
|
|
305
308
|
this.accountEmail = opts.accountEmail;
|
|
@@ -628,7 +631,7 @@ class SupafoneLabs {
|
|
|
628
631
|
return out.text.trim();
|
|
629
632
|
}
|
|
630
633
|
/**
|
|
631
|
-
* Structured
|
|
634
|
+
* Structured Supafone Supervisor guidance with developer-controlled field policy.
|
|
632
635
|
* Returns null when JSON is invalid, evidence misses the confidence gate,
|
|
633
636
|
* the generated kind is disallowed, or the local transform suppresses it.
|
|
634
637
|
*/
|
|
@@ -1174,7 +1177,7 @@ class LabsAgentsNamespace {
|
|
|
1174
1177
|
}
|
|
1175
1178
|
/** Spawn a durable hosted Supafone agent backed by Ultravox and Supafone-managed providers. */
|
|
1176
1179
|
create(input) {
|
|
1177
|
-
return this.sm.requestSupafoneApi("POST", "/api/v1/labs/agents", labsAgentPayload(this.
|
|
1180
|
+
return this.sm.requestSupafoneApi("POST", "/api/v1/labs/agents", labsAgentPayload(this.withSupervisor(input)));
|
|
1178
1181
|
}
|
|
1179
1182
|
/** Preview the exact validated call-plan contract the Supafone runtime executes. */
|
|
1180
1183
|
plan(input) {
|
|
@@ -1183,17 +1186,16 @@ class LabsAgentsNamespace {
|
|
|
1183
1186
|
generateCallStages(input) {
|
|
1184
1187
|
return this.plan(input);
|
|
1185
1188
|
}
|
|
1186
|
-
/** Default the agent onto the client's
|
|
1187
|
-
*
|
|
1188
|
-
|
|
1189
|
-
withVoiceWatcher(input) {
|
|
1189
|
+
/** Default the agent onto the client's Supafone Supervisor setting unless the
|
|
1190
|
+
* caller set it explicitly. Legacy wire fields remain unchanged. */
|
|
1191
|
+
withSupervisor(input) {
|
|
1190
1192
|
const out = { ...input };
|
|
1191
|
-
if (out.voice_watcher === undefined && out.voiceWatcher === undefined) {
|
|
1192
|
-
out.
|
|
1193
|
+
if (out.supervisor === undefined && out.voice_watcher === undefined && out.voiceWatcher === undefined) {
|
|
1194
|
+
out.supervisor = this.sm.supervisor;
|
|
1193
1195
|
}
|
|
1194
1196
|
const labs = out.labs;
|
|
1195
|
-
if (labs && labs.voice_watcher === undefined && labs.voiceWatcher === undefined) {
|
|
1196
|
-
out.labs = { ...labs,
|
|
1197
|
+
if (labs && labs.supervisor === undefined && labs.voice_watcher === undefined && labs.voiceWatcher === undefined) {
|
|
1198
|
+
out.labs = { ...labs, supervisor: this.sm.supervisor };
|
|
1197
1199
|
}
|
|
1198
1200
|
return out;
|
|
1199
1201
|
}
|
|
@@ -2014,7 +2016,7 @@ function labsAgentPayload(input) {
|
|
|
2014
2016
|
tools: input.tools ? toolsPayload(input.tools) : undefined,
|
|
2015
2017
|
labs: input.labs ? labsPayload(input.labs) : undefined,
|
|
2016
2018
|
ultravox: input.ultravox ? ultravoxPayload(input.ultravox) : undefined,
|
|
2017
|
-
voice_watcher: input.voice_watcher ?? input.voiceWatcher,
|
|
2019
|
+
voice_watcher: input.supervisor ?? input.voice_watcher ?? input.voiceWatcher,
|
|
2018
2020
|
voice_watcher_model: input.voice_watcher_model ?? input.voiceWatcherModel,
|
|
2019
2021
|
metadata: labsAgentMetadataPayload(input),
|
|
2020
2022
|
});
|
|
@@ -2415,7 +2417,7 @@ function artifactsPayload(input) {
|
|
|
2415
2417
|
function labsPayload(input) {
|
|
2416
2418
|
return compact({
|
|
2417
2419
|
enabled: input.enabled,
|
|
2418
|
-
voice_watcher: input.voice_watcher ?? input.voiceWatcher,
|
|
2420
|
+
voice_watcher: input.supervisor ?? input.voice_watcher ?? input.voiceWatcher,
|
|
2419
2421
|
api_key: input.api_key ?? input.apiKey,
|
|
2420
2422
|
model: input.model,
|
|
2421
2423
|
mode: input.mode,
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* A dependency-free TypeScript client for creating hosted Supafone agents
|
|
5
5
|
* through the Supafone API, including managed phone numbers, voices, stages,
|
|
6
|
-
* tools, recordings, transcripts, widgets, and Supafone
|
|
6
|
+
* tools, recordings, transcripts, widgets, and Supafone Supervisor. It also
|
|
7
7
|
* includes the Labs cloud sidecar oracle, hosted TTS/STT, live multilingual
|
|
8
8
|
* transcription, telemetry, agent builder, and objective-driven optimizer.
|
|
9
9
|
*
|
|
@@ -53,15 +53,13 @@ export interface SupafoneLabsOptions {
|
|
|
53
53
|
* fall back to the plain zero-billed report.
|
|
54
54
|
*/
|
|
55
55
|
postCallAnalysis?: boolean;
|
|
56
|
-
/**
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
* agent with no watcher. `voice_watcher` (snake) and the deprecated `labs`
|
|
60
|
-
* are accepted aliases, resolved voiceWatcher > voice_watcher > labs > true.
|
|
61
|
-
*/
|
|
56
|
+
/** Enable Supafone Supervisor live guidance, QA, and scoring (default true). */
|
|
57
|
+
supervisor?: boolean;
|
|
58
|
+
/** @deprecated Use supervisor. */
|
|
62
59
|
voiceWatcher?: boolean;
|
|
60
|
+
/** @deprecated Use supervisor. */
|
|
63
61
|
voice_watcher?: boolean;
|
|
64
|
-
/** @deprecated
|
|
62
|
+
/** @deprecated Use supervisor. */
|
|
65
63
|
labs?: boolean;
|
|
66
64
|
}
|
|
67
65
|
export interface ChatMessage {
|
|
@@ -87,7 +85,9 @@ export interface WhisperOptions {
|
|
|
87
85
|
maxTokens?: number;
|
|
88
86
|
temperature?: number;
|
|
89
87
|
}
|
|
90
|
-
export type
|
|
88
|
+
export type SupervisorDirectiveKind = "empathy" | "tactical" | "guardrail" | "mixed";
|
|
89
|
+
/** @deprecated Use SupervisorDirectiveKind. */
|
|
90
|
+
export type SecondMindDirectiveKind = SupervisorDirectiveKind;
|
|
91
91
|
export interface DirectiveTextControl {
|
|
92
92
|
enabled?: boolean;
|
|
93
93
|
instructions?: string;
|
|
@@ -102,7 +102,7 @@ export interface DirectiveListControl {
|
|
|
102
102
|
itemMaxChars?: number;
|
|
103
103
|
item_max_chars?: number;
|
|
104
104
|
}
|
|
105
|
-
/** Serializable controls for each field generated by
|
|
105
|
+
/** Serializable controls for each field generated by Supafone Supervisor. */
|
|
106
106
|
export interface DirectiveContract {
|
|
107
107
|
empathyDirective?: DirectiveTextControl;
|
|
108
108
|
empathy_directive?: DirectiveTextControl;
|
|
@@ -115,27 +115,29 @@ export interface DirectiveContract {
|
|
|
115
115
|
language_mode?: "caller" | "model" | "fixed";
|
|
116
116
|
fixedLanguage?: string;
|
|
117
117
|
fixed_language?: string;
|
|
118
|
-
allowedKinds?:
|
|
119
|
-
allowed_kinds?:
|
|
118
|
+
allowedKinds?: SupervisorDirectiveKind[];
|
|
119
|
+
allowed_kinds?: SupervisorDirectiveKind[];
|
|
120
120
|
confidenceThreshold?: number;
|
|
121
121
|
confidence_threshold?: number;
|
|
122
122
|
operatorGuardrails?: string[];
|
|
123
123
|
operator_guardrails?: string[];
|
|
124
124
|
}
|
|
125
|
-
export interface
|
|
125
|
+
export interface SupervisorDirective {
|
|
126
126
|
empathy_directive: string;
|
|
127
127
|
tactical_directive: string;
|
|
128
128
|
surface_facts: string[];
|
|
129
129
|
guardrails: string[];
|
|
130
130
|
language: string;
|
|
131
131
|
confidence: number;
|
|
132
|
-
kind:
|
|
132
|
+
kind: SupervisorDirectiveKind;
|
|
133
133
|
}
|
|
134
|
+
/** @deprecated Use SupervisorDirective. */
|
|
135
|
+
export type SecondMindDirective = SupervisorDirective;
|
|
134
136
|
export interface StructuredWhisperOptions extends WhisperOptions {
|
|
135
137
|
directiveContract?: DirectiveContract;
|
|
136
138
|
directive_contract?: DirectiveContract;
|
|
137
139
|
/** Local final say: revise or suppress the generated directive before use. */
|
|
138
|
-
transform?: (directive:
|
|
140
|
+
transform?: (directive: SupervisorDirective) => SupervisorDirective | null | Promise<SupervisorDirective | null>;
|
|
139
141
|
}
|
|
140
142
|
export interface Balance {
|
|
141
143
|
plan: string;
|
|
@@ -579,9 +581,12 @@ export interface LabsArtifactsConfig {
|
|
|
579
581
|
retention_days?: number;
|
|
580
582
|
metadata?: Record<string, unknown>;
|
|
581
583
|
}
|
|
582
|
-
export interface
|
|
584
|
+
export interface LabsSupervisorConfig {
|
|
583
585
|
enabled?: boolean;
|
|
586
|
+
supervisor?: boolean;
|
|
587
|
+
/** @deprecated Use supervisor. */
|
|
584
588
|
voiceWatcher?: boolean;
|
|
589
|
+
/** @deprecated Use supervisor. */
|
|
585
590
|
voice_watcher?: boolean;
|
|
586
591
|
apiKey?: string;
|
|
587
592
|
api_key?: string;
|
|
@@ -596,6 +601,8 @@ export interface LabsWatcherConfig {
|
|
|
596
601
|
provider_keys?: Record<string, unknown>;
|
|
597
602
|
label?: string;
|
|
598
603
|
}
|
|
604
|
+
/** @deprecated Use LabsSupervisorConfig. */
|
|
605
|
+
export type LabsWatcherConfig = LabsSupervisorConfig;
|
|
599
606
|
export interface LabsUltravoxRuntime {
|
|
600
607
|
model?: string;
|
|
601
608
|
temperature?: number;
|
|
@@ -810,9 +817,12 @@ export interface CreateLabsAgentRequest {
|
|
|
810
817
|
artifacts?: LabsArtifactsConfig;
|
|
811
818
|
compliance?: Record<string, unknown>;
|
|
812
819
|
tools?: LabsToolsConfig;
|
|
813
|
-
labs?:
|
|
820
|
+
labs?: LabsSupervisorConfig;
|
|
814
821
|
ultravox?: LabsUltravoxRuntime;
|
|
822
|
+
supervisor?: boolean;
|
|
823
|
+
/** @deprecated Use supervisor. */
|
|
815
824
|
voiceWatcher?: boolean;
|
|
825
|
+
/** @deprecated Use supervisor. */
|
|
816
826
|
voice_watcher?: boolean;
|
|
817
827
|
voiceWatcherModel?: string;
|
|
818
828
|
voice_watcher_model?: string;
|
|
@@ -1518,7 +1528,9 @@ export declare class SupafoneLabs {
|
|
|
1518
1528
|
private readonly supafoneApiKey;
|
|
1519
1529
|
private readonly timeoutMs;
|
|
1520
1530
|
private readonly postCallAnalysis;
|
|
1521
|
-
/** Client default for
|
|
1531
|
+
/** Client default for Supafone Supervisor (live guidance + QA + scoring). */
|
|
1532
|
+
readonly supervisor: boolean;
|
|
1533
|
+
/** @deprecated Use supervisor. */
|
|
1522
1534
|
readonly voiceWatcher: boolean;
|
|
1523
1535
|
private sessionToken?;
|
|
1524
1536
|
private accountToken?;
|
|
@@ -1623,13 +1635,13 @@ export declare class SupafoneLabs {
|
|
|
1623
1635
|
*/
|
|
1624
1636
|
whisper(transcript: string, opts?: WhisperOptions): Promise<string>;
|
|
1625
1637
|
/**
|
|
1626
|
-
* Structured
|
|
1638
|
+
* Structured Supafone Supervisor guidance with developer-controlled field policy.
|
|
1627
1639
|
* Returns null when JSON is invalid, evidence misses the confidence gate,
|
|
1628
1640
|
* the generated kind is disallowed, or the local transform suppresses it.
|
|
1629
1641
|
*/
|
|
1630
|
-
whisperStructured(transcript: string, opts?: StructuredWhisperOptions): Promise<
|
|
1642
|
+
whisperStructured(transcript: string, opts?: StructuredWhisperOptions): Promise<SupervisorDirective | null>;
|
|
1631
1643
|
/** Alias that reads naturally in applications building their own watcher loop. */
|
|
1632
|
-
directive(transcript: string, opts?: StructuredWhisperOptions): Promise<
|
|
1644
|
+
directive(transcript: string, opts?: StructuredWhisperOptions): Promise<SupervisorDirective | null>;
|
|
1633
1645
|
/** Hosted TTS — returns raw audio bytes (WAV/PCM per voice). */
|
|
1634
1646
|
tts(text: string, voice?: string): Promise<Uint8Array>;
|
|
1635
1647
|
/** Convenience alias for voice preview UI/buttons. */
|
|
@@ -2052,10 +2064,9 @@ declare class LabsAgentsNamespace {
|
|
|
2052
2064
|
generateCallStages(input: CreateLabsAgentRequest & {
|
|
2053
2065
|
description?: string;
|
|
2054
2066
|
}): Promise<LabsCallPlan>;
|
|
2055
|
-
/** Default the agent onto the client's
|
|
2056
|
-
*
|
|
2057
|
-
|
|
2058
|
-
private withVoiceWatcher;
|
|
2067
|
+
/** Default the agent onto the client's Supafone Supervisor setting unless the
|
|
2068
|
+
* caller set it explicitly. Legacy wire fields remain unchanged. */
|
|
2069
|
+
private withSupervisor;
|
|
2059
2070
|
/** Create an inbound receptionist/intake agent. No Twilio account is required. */
|
|
2060
2071
|
createInbound(input: CreateLabsAgentRequest): Promise<CreateLabsAgentResponse>;
|
|
2061
2072
|
/** Create an outbound sales/speed-to-lead/campaign agent. No Twilio account is required. */
|