@mgamadeus/ddd-agents 0.14.5 → 0.14.7
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 +8 -1
- package/dist/files/i18n-keys.json +66 -0
- package/dist/types/voice/AgentVoiceCallBand/agent-voice-call-outcome-title-text-key.d.ts +4 -1
- package/dist/types/voice/admin/agent-voice-admin-format.d.ts +1 -1
- package/dist/types/voice/admin/agent-voice-admin-types.d.ts +1 -1
- package/dist/types/voice/call/agent-voice-call-end-reasons.d.ts +4 -0
- package/dist/voice-admin.js +20 -2
- package/dist/voice-admin.js.map +1 -1
- package/dist/voice.js +4 -0
- package/dist/voice.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -482,6 +482,12 @@ not.
|
|
|
482
482
|
- `zIndex` of the incoming call sets its stacking order over the page; without it the custom property
|
|
483
483
|
`--agents-voice-incoming-call-z-index` does.
|
|
484
484
|
|
|
485
|
+
- An ended call's title on the band follows the server's end reason: `%agentName% ended the voice chat`
|
|
486
|
+
(`ENDED_BY_AGENT`), `Voice chat limit reached` (`LIMIT_REACHED`), `Connection to %agentName% lost`
|
|
487
|
+
(`PROVIDER_CONNECTION_LOST`), `%agentName% stopped answering` (`PROVIDER_STALLED`), else `Voice chat ended`
|
|
488
|
+
(`useAgentVoiceCall().endReason` carries the stored value; `./voice` exports
|
|
489
|
+
`AGENT_VOICE_CALL_END_REASON_ENDED_BY_AGENT` and `AGENT_VOICE_CALL_END_REASON_LIMIT_REACHED`, an application compares
|
|
490
|
+
the two provider values as strings).
|
|
485
491
|
- The band also shows the agent's ring while a chat is in sight (`isPresented`); the incoming call then keeps its own
|
|
486
492
|
card away. A surface that covers the chats reports it with `useAgentVoiceRingCover(true)`.
|
|
487
493
|
- The server-side end of a call is read after the change signal of the call's conversation
|
|
@@ -527,7 +533,8 @@ export const agentVoiceAdminApi = createAgentVoiceAdminApi({ baseApi: adminApi,
|
|
|
527
533
|
`createStaticAgentVoiceAdminApi` answers fixed payloads for reviews and tests.
|
|
528
534
|
- `AgentVoiceCallsScreen`: one row per call (when it began, the account, who started it, the state with the end
|
|
529
535
|
reason, the duration, the booked seconds, their costs, the task, the conversation); filters for the account, the day
|
|
530
|
-
the call was created, the booked seconds and the end reason
|
|
536
|
+
the call was created, the booked seconds and the end reason (every end reason, also `PROVIDER_CONNECTION_LOST`
|
|
537
|
+
"Connection lost" and `PROVIDER_STALLED` "Provider stalled"); pages of `pageSize` calls (default 50). Props: `api`,
|
|
531
538
|
`title?`, `description?`, `headerActions?`, `onOpenCall?(callId)`, `accountId?`, `conversationId?`,
|
|
532
539
|
`buildConversationHref?(conversationId)`, `linkComponent?`, `pageSize?`.
|
|
533
540
|
- `AgentVoiceCallDetailScreen`: the same values in full, the call's times, its provider, and the link that opens the
|
|
@@ -242,6 +242,17 @@
|
|
|
242
242
|
"src/admin/connections/ConnectDialogs.tsx"
|
|
243
243
|
]
|
|
244
244
|
},
|
|
245
|
+
{
|
|
246
|
+
"key": "%agentName% stopped answering",
|
|
247
|
+
"defaultText": "%agentName% stopped answering",
|
|
248
|
+
"placeholders": [
|
|
249
|
+
"agentName"
|
|
250
|
+
],
|
|
251
|
+
"contexts": [],
|
|
252
|
+
"usedIn": [
|
|
253
|
+
"src/voice/AgentVoiceCallBand/agent-voice-call-outcome-title-text-key.ts"
|
|
254
|
+
]
|
|
255
|
+
},
|
|
245
256
|
{
|
|
246
257
|
"key": "%agentName% stopped asking to talk.",
|
|
247
258
|
"defaultText": "%agentName% stopped asking to talk.",
|
|
@@ -3750,6 +3761,17 @@
|
|
|
3750
3761
|
"src/admin/connections/AgentConnectionsPanel.tsx"
|
|
3751
3762
|
]
|
|
3752
3763
|
},
|
|
3764
|
+
{
|
|
3765
|
+
"key": "Connection lost",
|
|
3766
|
+
"defaultText": "Connection lost",
|
|
3767
|
+
"placeholders": [],
|
|
3768
|
+
"contexts": [
|
|
3769
|
+
"agent-voice-call-end-reason"
|
|
3770
|
+
],
|
|
3771
|
+
"usedIn": [
|
|
3772
|
+
"src/voice/admin/agent-voice-admin-format.ts"
|
|
3773
|
+
]
|
|
3774
|
+
},
|
|
3753
3775
|
{
|
|
3754
3776
|
"key": "Connection saved",
|
|
3755
3777
|
"defaultText": "Connection saved",
|
|
@@ -3759,6 +3781,17 @@
|
|
|
3759
3781
|
"src/admin/connections/AgentConnectionLevelsDrawer.tsx"
|
|
3760
3782
|
]
|
|
3761
3783
|
},
|
|
3784
|
+
{
|
|
3785
|
+
"key": "Connection to %agentName% lost",
|
|
3786
|
+
"defaultText": "Connection to %agentName% lost",
|
|
3787
|
+
"placeholders": [
|
|
3788
|
+
"agentName"
|
|
3789
|
+
],
|
|
3790
|
+
"contexts": [],
|
|
3791
|
+
"usedIn": [
|
|
3792
|
+
"src/voice/AgentVoiceCallBand/agent-voice-call-outcome-title-text-key.ts"
|
|
3793
|
+
]
|
|
3794
|
+
},
|
|
3762
3795
|
{
|
|
3763
3796
|
"key": "Connections",
|
|
3764
3797
|
"defaultText": "Connections",
|
|
@@ -10107,6 +10140,17 @@
|
|
|
10107
10140
|
"src/voice/admin/AgentVoiceCallDetailScreen/AgentVoiceCallDetailScreen.tsx"
|
|
10108
10141
|
]
|
|
10109
10142
|
},
|
|
10143
|
+
{
|
|
10144
|
+
"key": "Provider stalled",
|
|
10145
|
+
"defaultText": "Provider stalled",
|
|
10146
|
+
"placeholders": [],
|
|
10147
|
+
"contexts": [
|
|
10148
|
+
"agent-voice-call-end-reason"
|
|
10149
|
+
],
|
|
10150
|
+
"usedIn": [
|
|
10151
|
+
"src/voice/admin/agent-voice-admin-format.ts"
|
|
10152
|
+
]
|
|
10153
|
+
},
|
|
10110
10154
|
{
|
|
10111
10155
|
"key": "Provider time",
|
|
10112
10156
|
"defaultText": "Provider time",
|
|
@@ -13774,6 +13818,17 @@
|
|
|
13774
13818
|
"src/voice/call/agent-voice-call-store.ts"
|
|
13775
13819
|
]
|
|
13776
13820
|
},
|
|
13821
|
+
{
|
|
13822
|
+
"key": "The connection to the voice provider broke while the call ran; nobody hung up",
|
|
13823
|
+
"defaultText": "The connection to the voice provider broke while the call ran; nobody hung up",
|
|
13824
|
+
"placeholders": [],
|
|
13825
|
+
"contexts": [
|
|
13826
|
+
"agent-voice-call-end-reason"
|
|
13827
|
+
],
|
|
13828
|
+
"usedIn": [
|
|
13829
|
+
"src/voice/admin/agent-voice-admin-format.ts"
|
|
13830
|
+
]
|
|
13831
|
+
},
|
|
13777
13832
|
{
|
|
13778
13833
|
"key": "The connections could not be loaded",
|
|
13779
13834
|
"defaultText": "The connections could not be loaded",
|
|
@@ -15205,6 +15260,17 @@
|
|
|
15205
15260
|
"src/voice/admin/AgentVoiceCallsScreen/AgentVoiceCallsScreen.tsx"
|
|
15206
15261
|
]
|
|
15207
15262
|
},
|
|
15263
|
+
{
|
|
15264
|
+
"key": "The voice model gave the caller no answer, also after a reminder",
|
|
15265
|
+
"defaultText": "The voice model gave the caller no answer, also after a reminder",
|
|
15266
|
+
"placeholders": [],
|
|
15267
|
+
"contexts": [
|
|
15268
|
+
"agent-voice-call-end-reason"
|
|
15269
|
+
],
|
|
15270
|
+
"usedIn": [
|
|
15271
|
+
"src/voice/admin/agent-voice-admin-format.ts"
|
|
15272
|
+
]
|
|
15273
|
+
},
|
|
15208
15274
|
{
|
|
15209
15275
|
"key": "The voice of %agentName% is not reachable right now. Please try again in a minute.",
|
|
15210
15276
|
"defaultText": "The voice of %agentName% is not reachable right now. Please try again in a minute.",
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { AgentVoiceCallSnapshot } from "../call/agent-voice-call-store";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* An ended voice chat that was connected: who or what ended it (the call's end reason, when the server ended it). A lost
|
|
4
|
+
* connection to the voice provider and a voice model that stopped answering are said as such, never as an ended chat.
|
|
5
|
+
*/
|
|
3
6
|
export declare const endedAgentVoiceCallTitleTextKey: (call: Pick<AgentVoiceCallSnapshot, "endReason">) => string;
|
|
4
7
|
/**
|
|
5
8
|
* The band's title after a voice chat (`phase` `ended` or `failed`): a failed one says so; an ended one that was
|
|
@@ -4,7 +4,7 @@ export declare const AGENT_VOICE_CALL_STATE: Readonly<Record<AgentVoiceAdminCall
|
|
|
4
4
|
/** `AgentVoiceCall.endReason`: the reasons the call writes itself. A diagnostic value shows as it came. */
|
|
5
5
|
export declare const AGENT_VOICE_CALL_END_REASON: Readonly<Record<AgentVoiceAdminCallEndReason, import("@mgamadeus/ddd-admin-ui/logic").StatusDefinition>>;
|
|
6
6
|
/** The end reasons a list can be filtered by, in the order the filter offers them. */
|
|
7
|
-
export declare const AGENT_VOICE_CALL_END_REASONS: readonly ["COMPLETED", "ENDED_BY_AGENT", "LIMIT_REACHED", "FAILED", "NOT_ANSWERED", "DECLINED", "EXPIRED", "CANCELED"];
|
|
7
|
+
export declare const AGENT_VOICE_CALL_END_REASONS: readonly ["COMPLETED", "ENDED_BY_AGENT", "LIMIT_REACHED", "FAILED", "NOT_ANSWERED", "DECLINED", "EXPIRED", "CANCELED", "PROVIDER_CONNECTION_LOST", "PROVIDER_STALLED"];
|
|
8
8
|
/** `AgentVoiceCall.direction`: who started the call. */
|
|
9
9
|
export declare const AGENT_VOICE_CALL_DIRECTION: Readonly<Record<AgentVoiceAdminCallDirection, import("@mgamadeus/ddd-admin-ui/logic").StatusDefinition>>;
|
|
10
10
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** `AgentVoiceCall.direction`: `INBOUND` the owner called the agent, `OUTBOUND` the agent rang the owner. */
|
|
2
2
|
export type AgentVoiceAdminCallDirection = "INBOUND" | "OUTBOUND";
|
|
3
3
|
/** The end reasons the call writes itself; the teardown paths write diagnostic values of their own beside them. */
|
|
4
|
-
export type AgentVoiceAdminCallEndReason = "COMPLETED" | "LIMIT_REACHED" | "FAILED" | "NOT_ANSWERED" | "DECLINED" | "EXPIRED" | "CANCELED" | "ENDED_BY_AGENT";
|
|
4
|
+
export type AgentVoiceAdminCallEndReason = "COMPLETED" | "LIMIT_REACHED" | "FAILED" | "NOT_ANSWERED" | "DECLINED" | "EXPIRED" | "CANCELED" | "ENDED_BY_AGENT" | "PROVIDER_CONNECTION_LOST" | "PROVIDER_STALLED";
|
|
5
5
|
/**
|
|
6
6
|
* Where a call stands: it rings, it was answered and runs, or it is over. The server's reading at the time it answers:
|
|
7
7
|
* a call a dead session worker left open, or a ring past its deadline, reads `ENDED` although it has no `endedAt`. A
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
/** The call's end reasons the band words differently (`AgentVoiceCall::END_REASON_*`). */
|
|
2
2
|
export declare const AGENT_VOICE_CALL_END_REASON_ENDED_BY_AGENT = "ENDED_BY_AGENT";
|
|
3
3
|
export declare const AGENT_VOICE_CALL_END_REASON_LIMIT_REACHED = "LIMIT_REACHED";
|
|
4
|
+
/** The connection to the voice provider broke while the call ran; nobody hung up. */
|
|
5
|
+
export declare const AGENT_VOICE_CALL_END_REASON_PROVIDER_CONNECTION_LOST = "PROVIDER_CONNECTION_LOST";
|
|
6
|
+
/** The voice model gave the caller no answer, also after a reminder. */
|
|
7
|
+
export declare const AGENT_VOICE_CALL_END_REASON_PROVIDER_STALLED = "PROVIDER_STALLED";
|
package/dist/voice-admin.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { trimApiPrefix, toQueryString, injectEndpointsOnce, staticQueryHook } from "@mgamadeus/ddd-admin-ui/logic/pure";
|
|
3
3
|
import { combineFilters, buildFieldFilter } from "@mgamadeus/ddd-web/query";
|
|
4
4
|
import { normalizeDddError } from "@mgamadeus/ddd-web/contract";
|
|
5
|
-
import { Bot, UserRound, Undo2, TimerOff, Ban, BellOff, CircleX, Gauge, CircleCheck, CircleStop, AudioLines, BellRing, RefreshCw, ChevronLeft, ChevronRight, MessagesSquare, LoaderCircle, Square, Play } from "lucide-react";
|
|
5
|
+
import { Bot, UserRound, Undo2, Hourglass, WifiOff, TimerOff, Ban, BellOff, CircleX, Gauge, CircleCheck, CircleStop, AudioLines, BellRing, RefreshCw, ChevronLeft, ChevronRight, MessagesSquare, LoaderCircle, Square, Play } from "lucide-react";
|
|
6
6
|
import { m, formatUiNumber, useTranslate } from "@mgamadeus/ddd-admin-ui/i18n";
|
|
7
7
|
import { defineStatusMap, useDebouncedValue } from "@mgamadeus/ddd-admin-ui/logic";
|
|
8
8
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
@@ -124,6 +124,22 @@ const AGENT_VOICE_CALL_END_REASON = defineStatusMap(
|
|
|
124
124
|
icon: TimerOff,
|
|
125
125
|
description: m("Nobody answered before the ringing stopped", { context: "agent-voice-call-end-reason" })
|
|
126
126
|
},
|
|
127
|
+
PROVIDER_CONNECTION_LOST: {
|
|
128
|
+
label: m("Connection lost", { context: "agent-voice-call-end-reason" }),
|
|
129
|
+
tone: "danger",
|
|
130
|
+
icon: WifiOff,
|
|
131
|
+
description: m("The connection to the voice provider broke while the call ran; nobody hung up", {
|
|
132
|
+
context: "agent-voice-call-end-reason"
|
|
133
|
+
})
|
|
134
|
+
},
|
|
135
|
+
PROVIDER_STALLED: {
|
|
136
|
+
label: m("Provider stalled", { context: "agent-voice-call-end-reason" }),
|
|
137
|
+
tone: "danger",
|
|
138
|
+
icon: Hourglass,
|
|
139
|
+
description: m("The voice model gave the caller no answer, also after a reminder", {
|
|
140
|
+
context: "agent-voice-call-end-reason"
|
|
141
|
+
})
|
|
142
|
+
},
|
|
127
143
|
CANCELED: {
|
|
128
144
|
label: m("Canceled", { context: "agent-voice-call-end-reason" }),
|
|
129
145
|
tone: "neutral",
|
|
@@ -143,7 +159,9 @@ const AGENT_VOICE_CALL_END_REASONS = [
|
|
|
143
159
|
"NOT_ANSWERED",
|
|
144
160
|
"DECLINED",
|
|
145
161
|
"EXPIRED",
|
|
146
|
-
"CANCELED"
|
|
162
|
+
"CANCELED",
|
|
163
|
+
"PROVIDER_CONNECTION_LOST",
|
|
164
|
+
"PROVIDER_STALLED"
|
|
147
165
|
];
|
|
148
166
|
const AGENT_VOICE_CALL_DIRECTION = defineStatusMap(
|
|
149
167
|
{
|