@superpanel-sdk/runtime 0.5.0 → 0.7.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 +3 -3
- package/dist/builder/codegen/emit.d.ts +5 -10
- package/dist/builder/codegen/emit.js +100 -106
- package/dist/builder/codegen/generate.d.ts +3 -5
- package/dist/builder/codegen/generate.js +13 -32
- package/dist/builder/company-imports.d.ts +5 -0
- package/dist/builder/company-imports.js +9 -1
- package/dist/builder/compile/compile-sequence.d.ts +13 -11
- package/dist/builder/compile/compile-sequence.js +135 -83
- package/dist/builder/compile/function-code.d.ts +15 -9
- package/dist/builder/compile/function-code.js +59 -29
- package/dist/builder/compile/registry.d.ts +4 -4
- package/dist/builder/compile/registry.js +14 -12
- package/dist/builder/errors.d.ts +9 -0
- package/dist/builder/errors.js +17 -0
- package/dist/builder/function-params.d.ts +10 -0
- package/dist/builder/function-params.js +203 -0
- package/dist/builder/load.d.ts +17 -17
- package/dist/builder/load.js +27 -25
- package/dist/builder/paths.d.ts +6 -1
- package/dist/builder/paths.js +16 -2
- package/dist/builder/schedules.d.ts +9 -7
- package/dist/builder/schedules.js +20 -21
- package/dist/builder/typecheck.d.ts +1 -1
- package/dist/builder/typecheck.js +3 -6
- package/dist/builder/types.d.ts +41 -5
- package/dist/builder/types.js +19 -0
- package/dist/cli/calls/index.d.ts +177 -0
- package/dist/cli/calls/index.js +96 -0
- package/dist/cli/debug/index.d.ts +31 -0
- package/dist/cli/debug/index.js +119 -0
- package/dist/cli/exec/index.d.ts +39 -0
- package/dist/cli/exec/index.js +138 -0
- package/dist/cli/exec/session.d.ts +48 -0
- package/dist/cli/exec/session.js +82 -0
- package/dist/cli/exec/trace.d.ts +18 -0
- package/dist/cli/exec/trace.js +52 -0
- package/dist/cli/index.js +84 -1
- package/dist/cli/logs/index.d.ts +47 -0
- package/dist/cli/logs/index.js +113 -0
- package/dist/cli/mobile/index.d.ts +12 -0
- package/dist/cli/mobile/index.js +405 -0
- package/dist/cli/serve/index.d.ts +40 -4
- package/dist/cli/serve/index.js +167 -28
- package/dist/cli/turns/index.d.ts +105 -0
- package/dist/cli/turns/index.js +128 -0
- package/dist/cli/turns/run.d.ts +13 -0
- package/dist/cli/turns/run.js +57 -0
- package/dist/cli/turns/shadow.d.ts +112 -0
- package/dist/cli/turns/shadow.js +54 -0
- package/dist/cli/type-gen/index.js +0 -1
- package/dist/compute-host/compute-host.d.ts +5 -6
- package/dist/compute-host/compute-host.js +4 -13
- package/dist/compute-host/source-compute-host.d.ts +5 -7
- package/dist/compute-host/source-compute-host.js +12 -33
- package/dist/core/case-orchestrator/contact-hours.d.ts +26 -6
- package/dist/core/case-orchestrator/contact-hours.js +27 -8
- package/dist/core/case-orchestrator/index.d.ts +1 -4
- package/dist/core/case-orchestrator/index.js +1 -4
- package/dist/core/case-orchestrator/render.d.ts +1 -1
- package/dist/core/case-orchestrator/render.js +15 -10
- package/dist/core/case-orchestrator/types.d.ts +83 -128
- package/dist/core/case-orchestrator/types.js +0 -4
- package/dist/core/context/email-message.d.ts +40 -1
- package/dist/core/context/email-message.js +27 -0
- package/dist/core/context/email.d.ts +13 -1
- package/dist/core/context/email.js +2 -3
- package/dist/core/context/exchanges.d.ts +25 -0
- package/dist/core/context/exchanges.js +25 -7
- package/dist/core/context/instances.d.ts +31 -2
- package/dist/core/context/instances.js +18 -4
- package/dist/core/context/platform-registry.d.ts +35 -0
- package/dist/core/context/sms.d.ts +30 -0
- package/dist/core/context/sms.js +20 -0
- package/dist/core/context/types.d.ts +29 -1
- package/dist/core/conversation/index.d.ts +58 -4
- package/dist/core/conversation/index.js +123 -4
- package/dist/core/functions/errors.d.ts +74 -0
- package/dist/core/functions/errors.js +26 -0
- package/dist/core/functions/events.d.ts +23 -78
- package/dist/core/functions/events.js +8 -17
- package/dist/core/functions/schedules.d.ts +9 -10
- package/dist/core/functions/schedules.js +2 -2
- package/dist/core/functions/types.d.ts +17 -72
- package/dist/core/functions/types.js +1 -9
- package/dist/core/page/define.d.ts +230 -160
- package/dist/core/page/define.js +145 -104
- package/dist/core/page/envelope.d.ts +55 -0
- package/dist/core/page/envelope.js +4 -0
- package/dist/core/page/fns.d.ts +448 -0
- package/dist/core/page/fns.js +539 -0
- package/dist/core/page/memory-reader.d.ts +27 -0
- package/dist/core/page/memory-reader.js +299 -0
- package/dist/core/page/page-host.d.ts +20 -0
- package/dist/core/page/page-host.js +57 -0
- package/dist/core/page/records-query.d.ts +234 -0
- package/dist/core/page/records-query.js +780 -0
- package/dist/core/page/render.d.ts +67 -25
- package/dist/core/page/render.js +492 -272
- package/dist/core/page/sandbox.d.ts +85 -0
- package/dist/core/page/sandbox.js +357 -0
- package/dist/core/page/time-format.d.ts +27 -0
- package/dist/core/page/time-format.js +84 -0
- package/dist/core/page/typed.d.ts +165 -159
- package/dist/core/page/workspace.d.ts +25 -1
- package/dist/core/page/workspace.js +48 -13
- package/dist/core/party/schema.d.ts +74 -3
- package/dist/core/party/schema.js +39 -6
- package/dist/core/party/types.d.ts +8 -13
- package/dist/core/sequence/define.d.ts +1 -2
- package/dist/core/slot/company-metadata.d.ts +11 -22
- package/dist/core/slot/company-metadata.js +12 -39
- package/dist/core/slot/compile-schema.js +6 -6
- package/dist/core/slot/field.d.ts +1 -2
- package/dist/core/slot/field.js +0 -2
- package/dist/core/slot/index.d.ts +3 -3
- package/dist/core/slot/index.js +3 -3
- package/dist/core/slot/naming.d.ts +1 -1
- package/dist/core/slot/naming.js +1 -1
- package/dist/core/slot/platform-fields.d.ts +4 -4
- package/dist/core/slot/platform-fields.js +5 -5
- package/dist/core/slot/schema-compat.d.ts +8 -7
- package/dist/core/slot/schema-compat.js +22 -31
- package/dist/core/slot/schema.d.ts +3 -59
- package/dist/core/slot/schema.js +0 -15
- package/dist/core/slot/types.d.ts +4 -10
- package/dist/core/slot/value.d.ts +2 -0
- package/dist/core/slot/value.js +6 -2
- package/dist/dev-overlay/protocol.d.ts +38 -5
- package/dist/fn-context/build-context.js +10 -4
- package/dist/fn-context/fake/index.d.ts +2 -0
- package/dist/fn-context/fake/index.js +5 -3
- package/dist/fn-context/fn-params.d.ts +2 -5
- package/dist/fn-context/fn-params.js +6 -9
- package/dist/fn-context/index.d.ts +1 -1
- package/dist/fn-context/make-ctx.js +5 -4
- package/dist/fn-context/rpc/case-orchestrator-tools.d.ts +11 -3
- package/dist/fn-context/rpc/case-orchestrator-tools.js +0 -1
- package/dist/fn-context/rpc/errors.d.ts +13 -0
- package/dist/fn-context/rpc/errors.js +22 -0
- package/dist/fn-context/rpc/index.d.ts +1 -1
- package/dist/fn-context/rpc/index.js +1 -1
- package/dist/fn-context/rpc/integration/index.d.ts +11 -1
- package/dist/fn-context/rpc/log.d.ts +11 -1
- package/dist/fn-context/rpc/platform.d.ts +11 -1
- package/dist/fn-context/rpc/records.d.ts +13 -6
- package/dist/fn-context/rpc/records.js +2 -4
- package/dist/fn-context/rpc/trpc-client.d.ts +42 -0
- package/dist/fn-context/rpc/trpc-client.js +151 -22
- package/dist/fn-context/rpc/trpc-init.d.ts +19 -1
- package/dist/fn-context/rpc/trpc-init.js +10 -4
- package/dist/fn-context/rpc/trpc-router-factory.d.ts +66 -8
- package/dist/fn-context/run-scope.js +1 -1
- package/dist/fn-context/types.d.ts +20 -6
- package/dist/index.d.ts +11 -12
- package/dist/index.js +5 -8
- package/dist/logger.d.ts +4 -0
- package/dist/logger.js +8 -0
- package/dist/platform.d.ts +32 -33
- package/dist/platform.js +23 -22
- package/dist/testing-compile-child.d.ts +2 -0
- package/dist/testing-compile-child.js +20 -0
- package/dist/testing.d.ts +368 -0
- package/dist/testing.js +439 -0
- package/dist/voice-service/actions.d.ts +12 -35
- package/dist/voice-service/index.d.ts +2 -0
- package/dist/voice-service/index.js +2 -0
- package/dist/voice-service/protocol.d.ts +604 -0
- package/dist/voice-service/protocol.js +67 -0
- package/dist/voice-service/types.d.ts +16 -6
- package/dist/worker.d.ts +2 -1
- package/dist/worker.js +2 -1
- package/package.json +20 -16
- package/dist/core/case-orchestrator/follow-ups.d.ts +0 -31
- package/dist/core/case-orchestrator/follow-ups.js +0 -103
- package/dist/core/case-orchestrator/tools.d.ts +0 -29
- package/dist/core/case-orchestrator/tools.js +0 -31
- package/dist/core/case-orchestrator/validate.d.ts +0 -11
- package/dist/core/case-orchestrator/validate.js +0 -63
- package/dist/core/functions/define/bind.d.ts +0 -25
- package/dist/core/functions/define/bind.js +0 -14
- package/dist/core/functions/define/case.d.ts +0 -9
- package/dist/core/functions/define/case.js +0 -13
- package/dist/core/functions/define/events.d.ts +0 -20
- package/dist/core/functions/define/events.js +0 -21
- package/dist/core/functions/define/no-case.d.ts +0 -4
- package/dist/core/functions/define/no-case.js +0 -9
- package/dist/core/functions/func-ref.d.ts +0 -25
- package/dist/core/functions/func-ref.js +0 -20
|
@@ -0,0 +1,604 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Voice service ⇄ Backend call protocol — the shared type file.
|
|
3
|
+
*
|
|
4
|
+
* Self-contained on purpose: no imports. The Backend copies this file as is
|
|
5
|
+
* (jupiter-backend-and-worker: packages/runtime/src/voice-service/protocol.ts); change it here first and
|
|
6
|
+
* copy it over, never edit the copy. Design: jupiter-voice-service docs/voice-service-event-protocol.md.
|
|
7
|
+
*
|
|
8
|
+
* Compatibility rules (there is one protocol version, no negotiation):
|
|
9
|
+
* - A receiver ignores any `type` it does not know.
|
|
10
|
+
* - Fields are only ever added, and every added field is optional.
|
|
11
|
+
*/
|
|
12
|
+
export interface Envelope<T extends string = string, D = unknown> {
|
|
13
|
+
/**
|
|
14
|
+
* The sender's counter, from 1, one per reliable message, each direction on its own. `0` marks a
|
|
15
|
+
* control message outside the reliable stream (`ack`, `session.resume`, `session.resumed`, `drain`):
|
|
16
|
+
* never acked, never resent.
|
|
17
|
+
*/
|
|
18
|
+
seq: number;
|
|
19
|
+
/** The highest contiguous `seq` received from the other side; may ride on any message. */
|
|
20
|
+
ack?: number;
|
|
21
|
+
type: T;
|
|
22
|
+
/** Sender's clock, ms since epoch. */
|
|
23
|
+
ts: number;
|
|
24
|
+
data: D;
|
|
25
|
+
}
|
|
26
|
+
/** Control messages: `seq: 0`. */
|
|
27
|
+
export type ControlType = 'ack' | 'session.resume' | 'session.resumed' | 'drain';
|
|
28
|
+
/** Close code a Backend uses to refuse the socket (bad signature, unknown call). Not retried. */
|
|
29
|
+
export declare const CLOSE_UNAUTHORIZED = 4401;
|
|
30
|
+
/**
|
|
31
|
+
* `elevenlabs` and `elevenlabs-http` are the platform's older names (its voice profiles): taken as
|
|
32
|
+
* `elevenlabs-ttd`, the voice service's one ElevenLabs client. Send the canonical names; see `canonicalTtsProvider`.
|
|
33
|
+
*/
|
|
34
|
+
export type TtsProvider = 'cartesia' | 'elevenlabs-ttd' | 'inworld' | 'fish' | 'elevenlabs' | 'elevenlabs-http';
|
|
35
|
+
export type CanonicalTtsProvider = 'cartesia' | 'elevenlabs-ttd' | 'inworld' | 'fish';
|
|
36
|
+
/** The provider as the voice service runs it; null for one it does not have. */
|
|
37
|
+
export declare function canonicalTtsProvider(provider: string | undefined | null): CanonicalTtsProvider | null;
|
|
38
|
+
/** A TTS voice (part two). Keys never travel: the voice service reads them from its environment. */
|
|
39
|
+
export interface Voice {
|
|
40
|
+
provider: TtsProvider;
|
|
41
|
+
voiceId: string;
|
|
42
|
+
model?: string;
|
|
43
|
+
language?: string;
|
|
44
|
+
speed?: number;
|
|
45
|
+
/** Passed through to the provider's config as is (emotion, stability, pronunciation dictionary…). */
|
|
46
|
+
options?: Record<string, unknown>;
|
|
47
|
+
/** Said with this voice when this one fails. May nest. */
|
|
48
|
+
fallback?: Voice;
|
|
49
|
+
}
|
|
50
|
+
export type CallDirection = 'inbound' | 'outbound';
|
|
51
|
+
export interface CallContext {
|
|
52
|
+
callSid: string;
|
|
53
|
+
fromNumber: string;
|
|
54
|
+
toNumber: string;
|
|
55
|
+
forwardedFrom?: string;
|
|
56
|
+
direction: CallDirection;
|
|
57
|
+
/** Our number on this call. */
|
|
58
|
+
serviceNumber: string;
|
|
59
|
+
appId: string;
|
|
60
|
+
startTs: string | Date;
|
|
61
|
+
source?: 'pstn' | 'sip';
|
|
62
|
+
sip?: {
|
|
63
|
+
fromUri?: string;
|
|
64
|
+
toUri?: string;
|
|
65
|
+
domain?: string;
|
|
66
|
+
domainSid?: string;
|
|
67
|
+
callId?: string;
|
|
68
|
+
sourceIp?: string;
|
|
69
|
+
headers: Record<string, string>;
|
|
70
|
+
};
|
|
71
|
+
callToken?: string;
|
|
72
|
+
unavailableServices?: string[];
|
|
73
|
+
}
|
|
74
|
+
export type DtmfDigit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '*' | '#';
|
|
75
|
+
export type FallbackAction = 'end-call' | 'restore-normal-call-state';
|
|
76
|
+
/** One entry of the transcript the voice service keeps (§1.17); the Backend builds LLM context from it. */
|
|
77
|
+
export interface ChatItem {
|
|
78
|
+
role: 'assistant' | 'user' | 'system';
|
|
79
|
+
type: 'chat' | 'transfer' | 'end-call' | 'silence-signal' | 'field-collect';
|
|
80
|
+
content: string;
|
|
81
|
+
timestamp: number;
|
|
82
|
+
/** When it was audible, ms since the call's conversation started. */
|
|
83
|
+
startMs?: number;
|
|
84
|
+
endMs?: number;
|
|
85
|
+
params?: {
|
|
86
|
+
/** Said over the AI without interrupting it. */
|
|
87
|
+
bargeIn?: boolean;
|
|
88
|
+
/** Said inside a `realtime_chat` sub-flow. */
|
|
89
|
+
source?: 'realtime';
|
|
90
|
+
/** Structured form of a `[category] …` note. */
|
|
91
|
+
category?: 'amd' | 'far-end' | 'transfer' | 'field-collect' | 'silence' | 'system';
|
|
92
|
+
[key: string]: unknown;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
export interface InterruptionSettings {
|
|
96
|
+
enabled: boolean;
|
|
97
|
+
/** Words the caller must say before the AI stops. */
|
|
98
|
+
minWords: number;
|
|
99
|
+
/** The first ms of each sentence's audio cannot be interrupted. */
|
|
100
|
+
protectMs: number;
|
|
101
|
+
/** Said as an overlay right after an interruption; empty for none (the default: it lands on the caller's words). */
|
|
102
|
+
backchannels: string[];
|
|
103
|
+
/**
|
|
104
|
+
* A collision, not an interruption: the caller's first words come while the AI's speech is not heard yet,
|
|
105
|
+
* or has been heard for at most this long (the caller began first, or both at about the same moment). The AI stops at that first word, without
|
|
106
|
+
* `minWords`. 0 turns it off. Default 1500.
|
|
107
|
+
*/
|
|
108
|
+
collisionMs?: number;
|
|
109
|
+
}
|
|
110
|
+
export interface SttSettings {
|
|
111
|
+
/**
|
|
112
|
+
* The call's language (BCP-47): what the caller is spoken to in. The STT does not reconnect for it; it only
|
|
113
|
+
* changes who ends turns, from the next turn on (48 §7.1). `session.updated` follows.
|
|
114
|
+
*/
|
|
115
|
+
language?: string;
|
|
116
|
+
/** Names and terms to listen for, given to every engine (it reconnects for them). */
|
|
117
|
+
keyterms?: string[];
|
|
118
|
+
/** Report `user.partial`. Default false. */
|
|
119
|
+
partials?: boolean;
|
|
120
|
+
/** Stop listening until set back to false. */
|
|
121
|
+
paused?: boolean;
|
|
122
|
+
}
|
|
123
|
+
export interface FarEndHintSettings {
|
|
124
|
+
enabled: boolean;
|
|
125
|
+
/** Regex sources (case-insensitive) that send a greeting to the voicemail check (65 §3.1); omitted, the defaults. */
|
|
126
|
+
voicemail?: string[];
|
|
127
|
+
}
|
|
128
|
+
export interface QuietSettings {
|
|
129
|
+
/** Notify after this long quiet; 0 pauses notifications. Default 9000. */
|
|
130
|
+
notifyAfterMs: number;
|
|
131
|
+
/** Hang up after this many notifications in a row with the caller never speaking. Default 15. */
|
|
132
|
+
hangupAfterTimes: number;
|
|
133
|
+
/** Hang up when the caller has not spoken for this long, whatever the AI said. Default 180000. */
|
|
134
|
+
hangupAfterNoUserMs: number;
|
|
135
|
+
/**
|
|
136
|
+
* Once: a `call.quiet { checkBack: true }` after this long quiet (counted from the update, and again from
|
|
137
|
+
* the end of any AI speech), whatever `notifyAfterMs` is. Dropped when the caller speaks or after it is
|
|
138
|
+
* sent; the usual notices go on as before and it does not count in `times`. 0 drops one set.
|
|
139
|
+
*/
|
|
140
|
+
checkBackMs?: number;
|
|
141
|
+
}
|
|
142
|
+
export interface ThinkingSettings {
|
|
143
|
+
/** How long a caller who finished speaking waits for a reply (or a stalled stream for more). Default 30000. */
|
|
144
|
+
maxWaitMs: number;
|
|
145
|
+
/** `say`: the fallback text, then listen again. `hangup`: the fallback text, then hang up. */
|
|
146
|
+
onTimeout: 'say' | 'hangup' | 'none';
|
|
147
|
+
}
|
|
148
|
+
export interface FallbackSettings {
|
|
149
|
+
/** Said when the Backend cannot be heard from. */
|
|
150
|
+
text: string;
|
|
151
|
+
voice?: Voice;
|
|
152
|
+
/** No Backend socket this long after the call is answered: say `text`, hang up. */
|
|
153
|
+
connectTimeoutMs: number;
|
|
154
|
+
/** Nothing said this long after `call.answered`: say `text`, hang up. */
|
|
155
|
+
firstSpeechTimeoutMs: number;
|
|
156
|
+
/** Played while the Backend socket is down (raw μ-law 8 kHz: asset name or https URL). */
|
|
157
|
+
waitSound: string;
|
|
158
|
+
waitSoundVolume: number;
|
|
159
|
+
}
|
|
160
|
+
export interface QueueSettings {
|
|
161
|
+
/** Items waiting behind the running one. Default 5; more are dropped with an `error`. */
|
|
162
|
+
maxItems: number;
|
|
163
|
+
}
|
|
164
|
+
/** `session.update` and the initial `session`: only the fields given change. */
|
|
165
|
+
export interface SessionSettings {
|
|
166
|
+
/** The default voice from now on. */
|
|
167
|
+
voice?: Voice;
|
|
168
|
+
/** Voices to connect ahead of use. */
|
|
169
|
+
voices?: Voice[];
|
|
170
|
+
interruption?: Partial<InterruptionSettings>;
|
|
171
|
+
stt?: SttSettings;
|
|
172
|
+
farEndHint?: Partial<FarEndHintSettings>;
|
|
173
|
+
quiet?: Partial<QuietSettings>;
|
|
174
|
+
thinking?: Partial<ThinkingSettings>;
|
|
175
|
+
fallback?: Partial<FallbackSettings>;
|
|
176
|
+
queue?: Partial<QueueSettings>;
|
|
177
|
+
/**
|
|
178
|
+
* Provider settings, deep-merged over the call's (the same shape as `CallSetup.cfg`): TTS and the like.
|
|
179
|
+
* How the call is heard is the voice service's own (48 §10.3): a `cfg.stt` is not taken.
|
|
180
|
+
*/
|
|
181
|
+
cfg?: Record<string, unknown>;
|
|
182
|
+
}
|
|
183
|
+
export type CallRoute = {
|
|
184
|
+
type: 'assistant';
|
|
185
|
+
ringSeconds?: number;
|
|
186
|
+
} | {
|
|
187
|
+
type: 'dial';
|
|
188
|
+
toNumber: string;
|
|
189
|
+
ringSeconds?: number;
|
|
190
|
+
}
|
|
191
|
+
/** Not taken. Inbound: `say` (if any) is read to the caller first, by Twilio's own voice. */
|
|
192
|
+
| {
|
|
193
|
+
type: 'reject';
|
|
194
|
+
reason?: string;
|
|
195
|
+
say?: string;
|
|
196
|
+
};
|
|
197
|
+
export interface PreloadItem {
|
|
198
|
+
text: string;
|
|
199
|
+
voice?: Voice;
|
|
200
|
+
}
|
|
201
|
+
export interface CallSetup {
|
|
202
|
+
route: CallRoute;
|
|
203
|
+
session?: SessionSettings;
|
|
204
|
+
/** Synthesized into the TTS cache while the call rings: the first `speak` with this text starts at once. */
|
|
205
|
+
preload?: PreloadItem[];
|
|
206
|
+
/** Started as soon as the call is answered (usually the background). */
|
|
207
|
+
sounds?: SoundPlayCommand[];
|
|
208
|
+
/** The number this call is taken as, when it is not the one it came in on (SIP). */
|
|
209
|
+
serviceNumber?: string;
|
|
210
|
+
/** Voice service provider settings for this call, deep-merged over its defaults. */
|
|
211
|
+
cfg?: Record<string, unknown>;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* How a queued command enters the play queue (§1.6):
|
|
215
|
+
* - `queue` (default): after everything queued.
|
|
216
|
+
* - `next`: right after the running item.
|
|
217
|
+
* - `replace`: stop the running item, clear the queue (epoch + 1), then this.
|
|
218
|
+
* - `overlay`: `speak` only — played at once over whatever plays, outside the queue.
|
|
219
|
+
*/
|
|
220
|
+
export type QueueMode = 'queue' | 'next' | 'replace' | 'overlay';
|
|
221
|
+
export interface QueuedCommand {
|
|
222
|
+
mode?: QueueMode;
|
|
223
|
+
/** The epoch the Backend last saw; older than the current one → dropped (`cause: dropped`). */
|
|
224
|
+
epoch?: number;
|
|
225
|
+
}
|
|
226
|
+
export interface SpeakCommand extends QueuedCommand {
|
|
227
|
+
text: string;
|
|
228
|
+
voice?: Voice;
|
|
229
|
+
/** Default true. */
|
|
230
|
+
interruptible?: boolean;
|
|
231
|
+
/**
|
|
232
|
+
* One more way to cut this line off, besides the session's rules (which still apply): the caller's words
|
|
233
|
+
* begun while it is heard, once the STT's final has them, this many of them not counting fillers ("uh",
|
|
234
|
+
* "mm"). The voicemail message takes 1: a "Hello?" over it is a person who picked up (65 §3.3); the tail of
|
|
235
|
+
* the greeting, a partial taken back, or an "mm" of line noise is not. Only for an interruptible line, only
|
|
236
|
+
* while interruptions are on; it changes no other line.
|
|
237
|
+
*/
|
|
238
|
+
interruptMinWords?: number;
|
|
239
|
+
/** Dropped when its turn comes while the caller is speaking. */
|
|
240
|
+
onlyIfQuiet?: boolean;
|
|
241
|
+
/** Default true: a whole sentence goes through the TTS cache. */
|
|
242
|
+
cache?: boolean;
|
|
243
|
+
}
|
|
244
|
+
export type SpeakStartCommand = Omit<SpeakCommand, 'text' | 'cache'>;
|
|
245
|
+
/** Belongs to the latest `speak.start` not yet ended; dropped once that one is over. */
|
|
246
|
+
export interface SpeakDeltaCommand {
|
|
247
|
+
text: string;
|
|
248
|
+
epoch?: number;
|
|
249
|
+
}
|
|
250
|
+
export interface SpeakEndCommand {
|
|
251
|
+
epoch?: number;
|
|
252
|
+
}
|
|
253
|
+
export interface PlayCommand extends QueuedCommand {
|
|
254
|
+
/** Raw μ-law 8 kHz: asset name or https URL. */
|
|
255
|
+
url: string;
|
|
256
|
+
interruptible?: boolean;
|
|
257
|
+
onlyIfQuiet?: boolean;
|
|
258
|
+
}
|
|
259
|
+
export type TransferType = 'cold' | 'warm' | 'async-warm';
|
|
260
|
+
export interface TransferCommand extends QueuedCommand {
|
|
261
|
+
toNumber: string;
|
|
262
|
+
transferType?: TransferType;
|
|
263
|
+
/** Said to the caller before transferring (empty: nothing). */
|
|
264
|
+
say?: string;
|
|
265
|
+
/** Said to the caller when the transfer fails (empty: nothing). */
|
|
266
|
+
unsuccessfulSay?: string;
|
|
267
|
+
/** Read to the person taking the call: cold, as it connects; warm, once they confirm. */
|
|
268
|
+
briefing?: string;
|
|
269
|
+
/**
|
|
270
|
+
* Warm and background (76 §2.9): who it is and what about, looped to the person taking the call before
|
|
271
|
+
* they confirm; the voice service adds how to confirm. Without it: "You have a call from {companyName}".
|
|
272
|
+
* English for now.
|
|
273
|
+
*/
|
|
274
|
+
whisper?: string;
|
|
275
|
+
/** Warm and background: the company's display name, for the loop line without a whisper. */
|
|
276
|
+
companyName?: string;
|
|
277
|
+
/** SIP/custom parameters for the outbound leg (JSON text). */
|
|
278
|
+
arguments?: string;
|
|
279
|
+
voice?: Voice;
|
|
280
|
+
warmTransferConfirmMode?: Array<'keypad' | 'llm'>;
|
|
281
|
+
warmTransferConfirmKeypad?: DtmfDigit;
|
|
282
|
+
warmTransferConfig?: {
|
|
283
|
+
confirmTimeoutMs?: number;
|
|
284
|
+
pauseAfterSayMs?: number;
|
|
285
|
+
/** Looped to the person taking the call until they confirm. */
|
|
286
|
+
loopSayText?: string;
|
|
287
|
+
fallbackAction?: FallbackAction;
|
|
288
|
+
/** Decides, from what the person said, whether they take the call ("CONFIRMED"). */
|
|
289
|
+
confirmLlmPrompt?: string;
|
|
290
|
+
/** Said to the person taking the call when the customer hung up meanwhile, in their language. */
|
|
291
|
+
customerGoneSay?: string;
|
|
292
|
+
inboundCallTransferCallerId?: 'customer' | 'assistant';
|
|
293
|
+
warmTransferWaitingMusicURL?: string;
|
|
294
|
+
warmTransferWaitingMusicVolume?: number;
|
|
295
|
+
};
|
|
296
|
+
asyncWarmTransferBridge?: {
|
|
297
|
+
targetSayTemplate?: string;
|
|
298
|
+
customerSayTemplate?: string;
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
export interface FieldCollectConfig {
|
|
302
|
+
confirmTimeoutMs: number;
|
|
303
|
+
pauseAfterSayMs: number;
|
|
304
|
+
loopSayText: string;
|
|
305
|
+
fallbackAction: FallbackAction;
|
|
306
|
+
enterModeSayText: string | null;
|
|
307
|
+
succeedSayText: string | null;
|
|
308
|
+
unsuccessSayText: string | null;
|
|
309
|
+
validateDigits: DtmfDigit[];
|
|
310
|
+
digitsValueMap: Record<string, string>;
|
|
311
|
+
}
|
|
312
|
+
export interface FieldCollectCommand extends QueuedCommand {
|
|
313
|
+
fieldName: string;
|
|
314
|
+
userdata?: string;
|
|
315
|
+
config: FieldCollectConfig;
|
|
316
|
+
voice?: Voice;
|
|
317
|
+
}
|
|
318
|
+
export interface RealtimeChatCommand extends QueuedCommand {
|
|
319
|
+
instructions: string;
|
|
320
|
+
/** gpt-live built-in voice name, or `{ id }` for a custom one. */
|
|
321
|
+
voice?: string | {
|
|
322
|
+
id: string;
|
|
323
|
+
};
|
|
324
|
+
historyContext?: 'none' | 'last-n' | 'full';
|
|
325
|
+
historyContextLastN?: number;
|
|
326
|
+
exit?: {
|
|
327
|
+
onTool?: string[];
|
|
328
|
+
onSilenceMs?: number;
|
|
329
|
+
};
|
|
330
|
+
/** Any subset of the voice service's gpt-live settings. */
|
|
331
|
+
configOverride?: Record<string, unknown>;
|
|
332
|
+
}
|
|
333
|
+
export interface SendDigitsCommand extends QueuedCommand {
|
|
334
|
+
/** `0-9 * #`; `w` waits half a second. */
|
|
335
|
+
digits: string;
|
|
336
|
+
}
|
|
337
|
+
export interface HangupCommand extends QueuedCommand {
|
|
338
|
+
reason: string;
|
|
339
|
+
}
|
|
340
|
+
export interface WaitCommand extends QueuedCommand {
|
|
341
|
+
ms: number;
|
|
342
|
+
}
|
|
343
|
+
export interface StopCommand {
|
|
344
|
+
/** Also clear the queue (epoch + 1). */
|
|
345
|
+
clearQueue?: boolean;
|
|
346
|
+
}
|
|
347
|
+
export interface CancelCommand {
|
|
348
|
+
/** The `seq` of the command to take back. */
|
|
349
|
+
ref: number;
|
|
350
|
+
}
|
|
351
|
+
export interface SoundPlayCommand {
|
|
352
|
+
/** Your name for it; playing the same id again replaces it. */
|
|
353
|
+
soundId: string;
|
|
354
|
+
/** Raw μ-law 8 kHz: asset name or https URL. */
|
|
355
|
+
src: string;
|
|
356
|
+
loop?: boolean;
|
|
357
|
+
/** 0–1. */
|
|
358
|
+
volume?: number;
|
|
359
|
+
/** Stopped as soon as anyone speaks: the AI's next sentence, or the caller. */
|
|
360
|
+
stopOnSpeech?: boolean;
|
|
361
|
+
}
|
|
362
|
+
export interface SoundStopCommand {
|
|
363
|
+
soundId: string;
|
|
364
|
+
}
|
|
365
|
+
export type DownstreamCommands = {
|
|
366
|
+
speak: SpeakCommand;
|
|
367
|
+
'speak.start': SpeakStartCommand;
|
|
368
|
+
'speak.delta': SpeakDeltaCommand;
|
|
369
|
+
'speak.end': SpeakEndCommand;
|
|
370
|
+
play: PlayCommand;
|
|
371
|
+
transfer: TransferCommand;
|
|
372
|
+
field_collect: FieldCollectCommand;
|
|
373
|
+
realtime_chat: RealtimeChatCommand;
|
|
374
|
+
send_digits: SendDigitsCommand;
|
|
375
|
+
hangup: HangupCommand;
|
|
376
|
+
wait: WaitCommand;
|
|
377
|
+
stop: StopCommand;
|
|
378
|
+
cancel: CancelCommand;
|
|
379
|
+
'sound.play': SoundPlayCommand;
|
|
380
|
+
'sound.stop': SoundStopCommand;
|
|
381
|
+
'session.update': SessionSettings;
|
|
382
|
+
};
|
|
383
|
+
export type DownstreamType = keyof DownstreamCommands;
|
|
384
|
+
export type DownstreamMessage = {
|
|
385
|
+
[T in DownstreamType]: Envelope<T, DownstreamCommands[T]>;
|
|
386
|
+
}[DownstreamType];
|
|
387
|
+
/** Commands that go through the play queue and are checked against the epoch. */
|
|
388
|
+
export declare const QUEUED_COMMANDS: readonly ['speak', 'speak.start', 'play', 'transfer', 'field_collect', 'realtime_chat', 'send_digits', 'hangup', 'wait'];
|
|
389
|
+
export type QueuedCommandType = (typeof QUEUED_COMMANDS)[number];
|
|
390
|
+
export type SpeechCause = 'user' | 'replaced' | 'stopped' | 'dropped' | 'timeout' | 'error';
|
|
391
|
+
export interface VoiceReport {
|
|
392
|
+
provider: TtsProvider;
|
|
393
|
+
voiceId: string;
|
|
394
|
+
model?: string;
|
|
395
|
+
/** The requested voice failed and this one said it. */
|
|
396
|
+
fallback?: boolean;
|
|
397
|
+
}
|
|
398
|
+
export type ActionKind = 'transfer' | 'field_collect' | 'realtime_chat' | 'send_digits' | 'hangup';
|
|
399
|
+
export type TransferResult = 'start-transfer' | 'transfer-failed' | 'transfer-completed' | 'async-warm-transfer-bridging';
|
|
400
|
+
export interface TransferOutcome {
|
|
401
|
+
transferType: TransferType;
|
|
402
|
+
result: TransferResult;
|
|
403
|
+
fallbackAction: FallbackAction;
|
|
404
|
+
/** Why it failed, when it did. */
|
|
405
|
+
reason?: string;
|
|
406
|
+
}
|
|
407
|
+
export interface FieldCollectOutcome {
|
|
408
|
+
fieldName: string;
|
|
409
|
+
succeed: boolean;
|
|
410
|
+
/** Keys pressed. */
|
|
411
|
+
result: DtmfDigit[];
|
|
412
|
+
/** Keys mapped through `digitsValueMap`. */
|
|
413
|
+
value: string;
|
|
414
|
+
userdata?: string;
|
|
415
|
+
}
|
|
416
|
+
export interface SpokenAt {
|
|
417
|
+
start: number;
|
|
418
|
+
end: number;
|
|
419
|
+
}
|
|
420
|
+
/** How the engines came to a turn's text (backend design 48 §7.3). */
|
|
421
|
+
export interface SttFusion {
|
|
422
|
+
/** agree: every engine heard the same; primary: only the turn source heard it; voted: word by word; rescue: the turn source heard nothing. */
|
|
423
|
+
method: 'agree' | 'primary' | 'voted' | 'rescue';
|
|
424
|
+
/** The engine that ended the turn (its id). */
|
|
425
|
+
turnsBy?: string;
|
|
426
|
+
/** The turn's language as worked out (the call's): for looking into a turn, not for deciding anything. */
|
|
427
|
+
language?: string;
|
|
428
|
+
/** What each engine heard (as configured: always, on disagreement, never). */
|
|
429
|
+
engines?: Array<{
|
|
430
|
+
engine: string;
|
|
431
|
+
provider: string;
|
|
432
|
+
text: string;
|
|
433
|
+
state: 'final' | 'interim' | 'none' | 'down';
|
|
434
|
+
/** How much its words counted in the turn's language. */
|
|
435
|
+
weight?: number;
|
|
436
|
+
}>;
|
|
437
|
+
/**
|
|
438
|
+
* The words the voting engines did not agree on (backend design 63 §6): `[start, end)` in the turn's
|
|
439
|
+
* `text`, which reads `text` there, and what the other engines heard instead. Fillers ("uh") are no
|
|
440
|
+
* disagreement; a number is marked whole. Absent when they agreed.
|
|
441
|
+
*/
|
|
442
|
+
unclear?: Array<{
|
|
443
|
+
start: number;
|
|
444
|
+
end: number;
|
|
445
|
+
text: string;
|
|
446
|
+
alsoHeard: string[];
|
|
447
|
+
}>;
|
|
448
|
+
/** They disagreed over much of the turn (more than two stretches, or half the words): what each heard, whole. */
|
|
449
|
+
unclearTurn?: string[];
|
|
450
|
+
}
|
|
451
|
+
export type UpstreamEvents = {
|
|
452
|
+
/** seq 1 on the first socket. */
|
|
453
|
+
'session.start': {
|
|
454
|
+
callSid: string;
|
|
455
|
+
call: CallContext;
|
|
456
|
+
voiceServiceUrl: string;
|
|
457
|
+
};
|
|
458
|
+
/** Control (seq 0): first message on a later socket. The Backend answers `session.resumed { lastAck }`. */
|
|
459
|
+
'session.resume': {
|
|
460
|
+
callSid: string;
|
|
461
|
+
lastAck: number;
|
|
462
|
+
call?: CallContext;
|
|
463
|
+
voiceServiceUrl?: string;
|
|
464
|
+
};
|
|
465
|
+
/** Media flowing, STT and the default voice ready. */
|
|
466
|
+
'call.answered': {
|
|
467
|
+
direction: CallDirection;
|
|
468
|
+
answeredAt: number;
|
|
469
|
+
};
|
|
470
|
+
'call.ended': {
|
|
471
|
+
reason: string;
|
|
472
|
+
};
|
|
473
|
+
'user.started': {
|
|
474
|
+
utteranceId: string;
|
|
475
|
+
overlappedRef?: number;
|
|
476
|
+
};
|
|
477
|
+
'user.partial': {
|
|
478
|
+
utteranceId: string;
|
|
479
|
+
text: string;
|
|
480
|
+
};
|
|
481
|
+
'user.finished': {
|
|
482
|
+
utteranceId: string;
|
|
483
|
+
text: string;
|
|
484
|
+
spokenAt?: SpokenAt;
|
|
485
|
+
/** The `seq` of the speech playing as the caller started. */
|
|
486
|
+
overlappedRef?: number;
|
|
487
|
+
/** What of that speech had been said by then. */
|
|
488
|
+
saidTextAtStart?: string;
|
|
489
|
+
/** It interrupted the AI (the queue was cleared). */
|
|
490
|
+
interrupted: boolean;
|
|
491
|
+
/** Every word is a backchannel ("Okay.", "Mm-hm.", "Got it."): said to show the caller listens, not to take the turn. */
|
|
492
|
+
backchannel?: boolean;
|
|
493
|
+
source?: 'realtime';
|
|
494
|
+
/** How the engines came to its text (48 §7.3). */
|
|
495
|
+
fusion?: SttFusion;
|
|
496
|
+
};
|
|
497
|
+
/** A finished turn's text changed: an engine's late words came after `user.finished` (48 §7.3). */
|
|
498
|
+
'user.revised': {
|
|
499
|
+
utteranceId: string;
|
|
500
|
+
text: string;
|
|
501
|
+
previousText: string;
|
|
502
|
+
fusion?: SttFusion;
|
|
503
|
+
};
|
|
504
|
+
'speech.started': {
|
|
505
|
+
ref: number;
|
|
506
|
+
voice?: VoiceReport;
|
|
507
|
+
ttfbMs: number;
|
|
508
|
+
};
|
|
509
|
+
'speech.finished': {
|
|
510
|
+
ref?: number;
|
|
511
|
+
saidText: string;
|
|
512
|
+
spokenAt?: SpokenAt;
|
|
513
|
+
source?: 'realtime';
|
|
514
|
+
};
|
|
515
|
+
'speech.interrupted': {
|
|
516
|
+
ref: number;
|
|
517
|
+
saidText: string;
|
|
518
|
+
cause: SpeechCause;
|
|
519
|
+
};
|
|
520
|
+
chatItem: {
|
|
521
|
+
item: ChatItem;
|
|
522
|
+
};
|
|
523
|
+
/** A `session.update` that needed a reconnect (STT) took effect. */
|
|
524
|
+
'session.updated': SessionSettings;
|
|
525
|
+
'action.started': {
|
|
526
|
+
ref: number;
|
|
527
|
+
type: ActionKind;
|
|
528
|
+
};
|
|
529
|
+
'action.finished': {
|
|
530
|
+
ref: number;
|
|
531
|
+
type: ActionKind;
|
|
532
|
+
/** `restore`: the call goes on with the AI. `cancelled`: stopped by `cancel` / `replace` / an interruption. */
|
|
533
|
+
result: 'success' | 'failed' | 'restore' | 'cancelled';
|
|
534
|
+
transfer?: TransferOutcome;
|
|
535
|
+
fieldCollect?: FieldCollectOutcome;
|
|
536
|
+
reason?: string;
|
|
537
|
+
};
|
|
538
|
+
/** A background (async-warm) transfer, after its action finished. */
|
|
539
|
+
'transfer.status': {
|
|
540
|
+
ref: number;
|
|
541
|
+
transfer: TransferOutcome;
|
|
542
|
+
};
|
|
543
|
+
'transfer.target_answered': {
|
|
544
|
+
ref: number;
|
|
545
|
+
};
|
|
546
|
+
'transfer.target_confirmed': {
|
|
547
|
+
ref: number;
|
|
548
|
+
};
|
|
549
|
+
'transfer.target_failed': {
|
|
550
|
+
ref: number;
|
|
551
|
+
reason?: string;
|
|
552
|
+
};
|
|
553
|
+
/** A key the caller pressed outside `field_collect`. */
|
|
554
|
+
dtmf: {
|
|
555
|
+
digit: string;
|
|
556
|
+
};
|
|
557
|
+
/** Twilio AMD as it came. `answeredBy`: human | machine_start | machine_end_beep | machine_end_silence | machine_end_other | fax | unknown. */
|
|
558
|
+
amd: {
|
|
559
|
+
answeredBy: string;
|
|
560
|
+
machineDetectionDuration?: number;
|
|
561
|
+
};
|
|
562
|
+
'far_end.hint': {
|
|
563
|
+
kind: 'voicemail' | 'human';
|
|
564
|
+
said: string;
|
|
565
|
+
};
|
|
566
|
+
/** Quiet for `notifyAfterMs` (again). `times` counts in a row, reset only by the caller speaking. */
|
|
567
|
+
/** `checkBack`: the one-shot notice `quiet.checkBackMs` asked for, not a usual one. */
|
|
568
|
+
'call.quiet': {
|
|
569
|
+
quietMs: number;
|
|
570
|
+
times: number;
|
|
571
|
+
checkBack?: boolean;
|
|
572
|
+
};
|
|
573
|
+
'instance.draining': {
|
|
574
|
+
deadlineMs: number;
|
|
575
|
+
};
|
|
576
|
+
error: {
|
|
577
|
+
code: string;
|
|
578
|
+
message: string;
|
|
579
|
+
ref?: number;
|
|
580
|
+
};
|
|
581
|
+
};
|
|
582
|
+
export type UpstreamType = keyof UpstreamEvents;
|
|
583
|
+
/** Every upstream event carries the epoch current when it was sent. */
|
|
584
|
+
export type UpstreamData<T extends UpstreamType> = UpstreamEvents[T] & {
|
|
585
|
+
epoch?: number;
|
|
586
|
+
};
|
|
587
|
+
export type UpstreamMessage = {
|
|
588
|
+
[T in UpstreamType]: Envelope<T, UpstreamData<T>>;
|
|
589
|
+
}[UpstreamType];
|
|
590
|
+
/**
|
|
591
|
+
* HTTP `onCallEvents`: upstream messages the Backend never acked on the socket, sent once the socket is
|
|
592
|
+
* gone. Deduplicate by (`callSid`, `seq`).
|
|
593
|
+
*/
|
|
594
|
+
export interface CallEventsBatch {
|
|
595
|
+
callSid: string;
|
|
596
|
+
events: UpstreamMessage[];
|
|
597
|
+
}
|
|
598
|
+
export declare const DEFAULT_INTERRUPTION: InterruptionSettings;
|
|
599
|
+
export declare const DEFAULT_QUIET: QuietSettings;
|
|
600
|
+
/** Only for a Backend that says nothing at all: the fallback line, then the end. A Backend sets its own. */
|
|
601
|
+
export declare const DEFAULT_THINKING: ThinkingSettings;
|
|
602
|
+
export declare const DEFAULT_FALLBACK: FallbackSettings;
|
|
603
|
+
export declare const DEFAULT_QUEUE: QueueSettings;
|
|
604
|
+
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Voice service ⇄ Backend call protocol — the shared type file.
|
|
3
|
+
*
|
|
4
|
+
* Self-contained on purpose: no imports. The Backend copies this file as is
|
|
5
|
+
* (jupiter-backend-and-worker: packages/runtime/src/voice-service/protocol.ts); change it here first and
|
|
6
|
+
* copy it over, never edit the copy. Design: jupiter-voice-service docs/voice-service-event-protocol.md.
|
|
7
|
+
*
|
|
8
|
+
* Compatibility rules (there is one protocol version, no negotiation):
|
|
9
|
+
* - A receiver ignores any `type` it does not know.
|
|
10
|
+
* - Fields are only ever added, and every added field is optional.
|
|
11
|
+
*/
|
|
12
|
+
/** Close code a Backend uses to refuse the socket (bad signature, unknown call). Not retried. */
|
|
13
|
+
export const CLOSE_UNAUTHORIZED = 4401;
|
|
14
|
+
/** The provider as the voice service runs it; null for one it does not have. */
|
|
15
|
+
export function canonicalTtsProvider(provider) {
|
|
16
|
+
switch (provider) {
|
|
17
|
+
case 'cartesia':
|
|
18
|
+
case 'inworld':
|
|
19
|
+
case 'fish':
|
|
20
|
+
case 'elevenlabs-ttd':
|
|
21
|
+
return provider;
|
|
22
|
+
case 'elevenlabs':
|
|
23
|
+
case 'elevenlabs-http':
|
|
24
|
+
return 'elevenlabs-ttd';
|
|
25
|
+
default:
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/** Commands that go through the play queue and are checked against the epoch. */
|
|
30
|
+
export const QUEUED_COMMANDS = [
|
|
31
|
+
'speak',
|
|
32
|
+
'speak.start',
|
|
33
|
+
'play',
|
|
34
|
+
'transfer',
|
|
35
|
+
'field_collect',
|
|
36
|
+
'realtime_chat',
|
|
37
|
+
'send_digits',
|
|
38
|
+
'hangup',
|
|
39
|
+
'wait',
|
|
40
|
+
];
|
|
41
|
+
// ═══ Defaults ══════════════════════════════════════════════════════════════════
|
|
42
|
+
export const DEFAULT_INTERRUPTION = {
|
|
43
|
+
enabled: true,
|
|
44
|
+
minWords: 2,
|
|
45
|
+
protectMs: 0,
|
|
46
|
+
backchannels: [],
|
|
47
|
+
collisionMs: 1500,
|
|
48
|
+
};
|
|
49
|
+
export const DEFAULT_QUIET = {
|
|
50
|
+
notifyAfterMs: 9_000,
|
|
51
|
+
hangupAfterTimes: 15,
|
|
52
|
+
hangupAfterNoUserMs: 180_000,
|
|
53
|
+
};
|
|
54
|
+
/** Only for a Backend that says nothing at all: the fallback line, then the end. A Backend sets its own. */
|
|
55
|
+
export const DEFAULT_THINKING = {
|
|
56
|
+
maxWaitMs: 30_000,
|
|
57
|
+
onTimeout: 'hangup',
|
|
58
|
+
};
|
|
59
|
+
export const DEFAULT_FALLBACK = {
|
|
60
|
+
text: 'Sorry, we are having technical difficulties. Please call back later. Goodbye.',
|
|
61
|
+
connectTimeoutMs: 8_000,
|
|
62
|
+
firstSpeechTimeoutMs: 10_000,
|
|
63
|
+
waitSound: 'music/jazz-01.ulaw',
|
|
64
|
+
waitSoundVolume: 0.3,
|
|
65
|
+
};
|
|
66
|
+
export const DEFAULT_QUEUE = { maxItems: 5 };
|
|
67
|
+
//# sourceMappingURL=protocol.js.map
|