@ada-cx/messaging-bridge 1.12.0 → 1.13.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.
|
@@ -109,13 +109,35 @@ export declare const STATE: {
|
|
|
109
109
|
readonly SAML_LOCKED: "saml.locked";
|
|
110
110
|
readonly SAML_URL: "saml.url";
|
|
111
111
|
readonly SAML_LOGIN_BUTTON: "saml.loginButton";
|
|
112
|
+
/** @deprecated No-op alias retained for one release. Use the voice.callState contract. */
|
|
112
113
|
readonly VOICE_AUDIO_LEVEL: "voice.audioLevel";
|
|
114
|
+
/** @deprecated No-op alias retained for one release. Use the voice.callState contract. */
|
|
113
115
|
readonly VOICE_CURRENT_TRANSCRIPT: "voice.currentTranscript";
|
|
116
|
+
/** @deprecated No-op alias retained for one release. Use the voice.callState contract. */
|
|
114
117
|
readonly VOICE_ENABLED: "voice.enabled";
|
|
115
|
-
|
|
118
|
+
/** @deprecated No-op alias retained for one release. Use the voice.callState contract. */
|
|
116
119
|
readonly VOICE_IS_FINAL: "voice.isFinal";
|
|
120
|
+
/** @deprecated No-op alias retained for one release. Use the voice.callState contract. */
|
|
117
121
|
readonly VOICE_IS_RECORDING: "voice.isRecording";
|
|
122
|
+
/** @deprecated No-op alias retained for one release. Use the voice.callState contract. */
|
|
118
123
|
readonly VOICE_MODE: "voice.mode";
|
|
124
|
+
/** @deprecated No-op alias retained for one release. Use the voice.callState contract. */
|
|
119
125
|
readonly VOICE_TTS_ENABLED: "voice.ttsEnabled";
|
|
126
|
+
readonly VOICE_AVAILABILITY: "voice.availability";
|
|
127
|
+
readonly VOICE_UNAVAILABLE_REASON: "voice.unavailableReason";
|
|
128
|
+
readonly VOICE_CONSENT_REQUIRED: "voice.consentRequired";
|
|
129
|
+
readonly VOICE_CALL_STATE: "voice.callState";
|
|
130
|
+
readonly VOICE_TURN: "voice.turn";
|
|
131
|
+
readonly VOICE_TURN_ID: "voice.turnId";
|
|
132
|
+
readonly VOICE_PENDING_REPLY_TURN_ID: "voice.pendingReplyTurnId";
|
|
133
|
+
readonly VOICE_SPOKEN_CHARS: "voice.spokenChars";
|
|
134
|
+
readonly VOICE_MUTED: "voice.muted";
|
|
135
|
+
readonly VOICE_INPUT_LEVEL: "voice.inputLevel";
|
|
136
|
+
readonly VOICE_CALL_STARTED_AT: "voice.callStartedAt";
|
|
137
|
+
readonly VOICE_AGENT_CAPTION: "voice.agentCaption";
|
|
138
|
+
readonly VOICE_USER_CAPTION: "voice.userCaption";
|
|
139
|
+
readonly VOICE_REJECTED_CAPTIONS: "voice.rejectedCaptions";
|
|
140
|
+
readonly VOICE_ERROR: "voice.error";
|
|
141
|
+
readonly VOICE_ENDED_REASON: "voice.endedReason";
|
|
120
142
|
};
|
|
121
143
|
export type StateKey = (typeof STATE)[keyof typeof STATE];
|
|
@@ -6,6 +6,32 @@ import type { CsatFeedbackOption, CsatSurveySettings, CustomAppFrameStyles, File
|
|
|
6
6
|
* These types are the source of truth for the `@ada-cx/messaging-bridge`
|
|
7
7
|
* package and must stay in sync with the AsyncAPI spec at asyncapi.yml.
|
|
8
8
|
*/
|
|
9
|
+
export type VoiceAvailability = "unavailable" | "available";
|
|
10
|
+
export type VoiceUnavailableReason = "not_enabled" | "delegation_missing" | "host_unsupported" | "mic_policy_blocked" | "unsupported" | "language_unsupported";
|
|
11
|
+
export type VoiceCallState = "idle" | "requesting_permission" | "connecting" | "in_call" | "reconnecting" | "ended" | "error";
|
|
12
|
+
export type VoiceTurn = "quiet" | "agent_speaking" | "user_speaking";
|
|
13
|
+
export type VoiceErrorCode = "permission_denied" | "mic_policy_blocked" | "session_refused" | "connect_failed" | "disconnected" | "audio_blocked" | "unsupported" | "capture_failed" | (string & {});
|
|
14
|
+
export type VoiceEndedReason = "client_end" | "idle_timeout" | "max_duration" | "grace_expired" | "handoff" | "voice_box_draining" | "resume_unavailable" | "error" | "voice_disabled" | "conversation_reset" | (string & {});
|
|
15
|
+
export interface VoiceSpokenChars {
|
|
16
|
+
turnId: number;
|
|
17
|
+
chars: number;
|
|
18
|
+
playedMs: number;
|
|
19
|
+
scheduledMs: number;
|
|
20
|
+
finalReceived: boolean;
|
|
21
|
+
revision: number;
|
|
22
|
+
}
|
|
23
|
+
export interface VoiceCaption {
|
|
24
|
+
accepted?: boolean;
|
|
25
|
+
turnId?: number;
|
|
26
|
+
utteranceId?: string;
|
|
27
|
+
text: string;
|
|
28
|
+
final: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface VoiceError {
|
|
31
|
+
code: VoiceErrorCode;
|
|
32
|
+
message: string;
|
|
33
|
+
refusalCode?: string;
|
|
34
|
+
}
|
|
9
35
|
export interface FallbackUiLink {
|
|
10
36
|
label: string;
|
|
11
37
|
url: string;
|
|
@@ -84,6 +110,7 @@ export interface LiveChatStateData {
|
|
|
84
110
|
timeoutAfterMs: string;
|
|
85
111
|
}
|
|
86
112
|
interface BaseMessage {
|
|
113
|
+
turnId?: number;
|
|
87
114
|
id: string;
|
|
88
115
|
sender: "user" | "bot" | "agent";
|
|
89
116
|
timestamp: number;
|
|
@@ -348,7 +375,7 @@ export type SdkPlatform = "IOS" | "ANDROID" | "REACTNATIVE" | null;
|
|
|
348
375
|
* - `error.*` — fatal error surface.
|
|
349
376
|
* - `chatter.*` — end-user preferences: language, notifications, translations.
|
|
350
377
|
* - `ui.*` — transient UI signals (typing indicators, dialogs, toasts).
|
|
351
|
-
* - `voice.*` —
|
|
378
|
+
* - `voice.*` — Voice call state.
|
|
352
379
|
* - `csat.*` / `endChat.*` — survey settings, eligibility, and End Chat gates.
|
|
353
380
|
* - `security.*` — Turnstile challenge state.
|
|
354
381
|
* - `featureFlags` — allowlisted LaunchDarkly values exposed to the app.
|
|
@@ -671,14 +698,36 @@ export interface AppDisplayState {
|
|
|
671
698
|
"ui.botTyping.visible": boolean;
|
|
672
699
|
"ui.showRetryDialog"?: boolean;
|
|
673
700
|
"ui.retryDialog.pending"?: boolean;
|
|
701
|
+
/** @deprecated No-op alias retained for one release. Use the voice.callState contract. */
|
|
702
|
+
"voice.audioLevel"?: number;
|
|
703
|
+
/** @deprecated No-op alias retained for one release. Use the voice.callState contract. */
|
|
704
|
+
"voice.currentTranscript"?: string;
|
|
705
|
+
/** @deprecated No-op alias retained for one release. Use the voice.callState contract. */
|
|
674
706
|
"voice.enabled"?: boolean;
|
|
707
|
+
/** @deprecated No-op alias retained for one release. Use the voice.callState contract. */
|
|
708
|
+
"voice.isFinal"?: boolean;
|
|
709
|
+
/** @deprecated No-op alias retained for one release. Use the voice.callState contract. */
|
|
675
710
|
"voice.isRecording"?: boolean;
|
|
711
|
+
/** @deprecated No-op alias retained for one release. Use the voice.callState contract. */
|
|
676
712
|
"voice.mode"?: "toggle" | "push-to-talk";
|
|
677
|
-
|
|
678
|
-
"voice.isFinal"?: boolean;
|
|
679
|
-
"voice.audioLevel"?: number;
|
|
680
|
-
"voice.error"?: string | null;
|
|
713
|
+
/** @deprecated No-op alias retained for one release. Use the voice.callState contract. */
|
|
681
714
|
"voice.ttsEnabled"?: boolean;
|
|
715
|
+
"voice.consentRequired"?: boolean;
|
|
716
|
+
"voice.availability"?: VoiceAvailability;
|
|
717
|
+
"voice.unavailableReason"?: VoiceUnavailableReason;
|
|
718
|
+
"voice.callState"?: VoiceCallState;
|
|
719
|
+
"voice.turn"?: VoiceTurn;
|
|
720
|
+
"voice.turnId"?: number | null;
|
|
721
|
+
"voice.pendingReplyTurnId"?: number | null;
|
|
722
|
+
"voice.spokenChars"?: VoiceSpokenChars | null;
|
|
723
|
+
"voice.muted"?: boolean;
|
|
724
|
+
"voice.inputLevel"?: number;
|
|
725
|
+
"voice.callStartedAt"?: number | null;
|
|
726
|
+
"voice.agentCaption"?: VoiceCaption | null;
|
|
727
|
+
"voice.userCaption"?: VoiceCaption | null;
|
|
728
|
+
"voice.rejectedCaptions"?: Record<string, VoiceCaption>;
|
|
729
|
+
"voice.error"?: string | VoiceError | null;
|
|
730
|
+
"voice.endedReason"?: VoiceEndedReason | null;
|
|
682
731
|
"csat.autoTrigger"?: boolean;
|
|
683
732
|
"csat.autoTriggerConversationId"?: string | null;
|
|
684
733
|
"csat.showAfterEndChat"?: boolean;
|
|
@@ -746,7 +795,7 @@ export interface AppDisplayState {
|
|
|
746
795
|
* typing edges, visitor info.
|
|
747
796
|
* - `zendesk.*` / `zendeskMessaging.*` — Zendesk handoff SDK control.
|
|
748
797
|
* - `file.*` — handoff file-upload start/cancel/retry/error-dismiss.
|
|
749
|
-
* - `voice.*` —
|
|
798
|
+
* - `voice.*` — Voice call controls.
|
|
750
799
|
* - `ui.*` — widget chrome interactions (close, minimize, dialogs, toasts,
|
|
751
800
|
* viewport, composer-changed edge).
|
|
752
801
|
* - `settings.*` / `appearance.*` — end-user preference changes.
|
|
@@ -888,17 +937,35 @@ export interface AppEvents {
|
|
|
888
937
|
file: File;
|
|
889
938
|
uploadId?: string;
|
|
890
939
|
};
|
|
940
|
+
/** @deprecated No-op alias retained for one release. Use voice.call.* events. */
|
|
891
941
|
"voice.recording.start": undefined;
|
|
942
|
+
/** @deprecated No-op alias retained for one release. Use voice.call.* events. */
|
|
892
943
|
"voice.recording.stop": undefined;
|
|
944
|
+
/** @deprecated No-op alias retained for one release. Use voice.call.* events. */
|
|
893
945
|
"voice.mode.set": {
|
|
894
946
|
mode: "toggle" | "push-to-talk";
|
|
895
947
|
};
|
|
948
|
+
/** @deprecated No-op alias retained for one release. Use voice.call.* events. */
|
|
896
949
|
"voice.transcript.apply": {
|
|
897
950
|
transcript: string;
|
|
898
951
|
};
|
|
952
|
+
/** @deprecated No-op alias retained for one release. Use voice.call.* events. */
|
|
899
953
|
"voice.tts.toggle": {
|
|
900
954
|
enabled: boolean;
|
|
901
955
|
};
|
|
956
|
+
"voice.consent.accept": undefined;
|
|
957
|
+
"voice.consent.decline": undefined;
|
|
958
|
+
"voice.call.start": undefined;
|
|
959
|
+
"voice.call.end": undefined;
|
|
960
|
+
"voice.call.mute": {
|
|
961
|
+
muted: boolean;
|
|
962
|
+
};
|
|
963
|
+
"voice.call.audio.start": undefined;
|
|
964
|
+
"voice.call.interrupt": undefined;
|
|
965
|
+
"voice.text.rendered": {
|
|
966
|
+
turnId: number;
|
|
967
|
+
length: number;
|
|
968
|
+
};
|
|
902
969
|
"ui.closeButton.click": undefined;
|
|
903
970
|
"ui.minimizeButton.click": undefined;
|
|
904
971
|
"ui.drawer.dismiss": undefined;
|
|
@@ -27,17 +27,11 @@ export declare const IMAGE_ATTACHMENT_MAX_BYTES: number;
|
|
|
27
27
|
/**
|
|
28
28
|
* How many images one send may carry.
|
|
29
29
|
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* a group into one describe budget. A fourth image would be hosted, rendered
|
|
36
|
-
* *and* described — in its own reasoner turn.
|
|
37
|
-
*
|
|
38
|
-
* So the cap is a product decision about that cost, not a ceiling api imposes:
|
|
39
|
-
* each extra image buys another bot turn and another describe call. Match it to
|
|
40
|
-
* `MAX_DESCRIBED_IMAGE_ATTACHMENTS` by coincidence of value only.
|
|
30
|
+
* api answers one send in one reasoner turn and describes at most
|
|
31
|
+
* `MAX_DESCRIBED_IMAGE_ATTACHMENTS` of its images there. It holds at most
|
|
32
|
+
* `MAX_HELD_ROWS` rows besides the final row, so a fourth image would start
|
|
33
|
+
* a turn of its own. Keep this value equal to `MAX_DESCRIBED_IMAGE_ATTACHMENTS`
|
|
34
|
+
* (3) and to `MAX_HELD_ROWS` plus the final row (2 + 1).
|
|
41
35
|
*/
|
|
42
36
|
export declare const IMAGE_ATTACHMENT_MAX_COUNT = 3;
|
|
43
37
|
/** The image types api's attachments route accepts; HEIC/HEIF are transcoded to JPEG there. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ada-cx/messaging-bridge",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "Types, test mocks, and a thin CDN loader for building a custom app UI on Ada Messaging's bridge contract. The bridge runtime always loads from Ada's CDN.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "ISC",
|