@mgamadeus/ddd-agents 0.14.6 → 0.14.8
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 +10 -1
- package/dist/chat.js +1 -1
- package/dist/chunks/{contract-CIXLnSqL.js → contract-IQHESBXq.js} +12 -3
- package/dist/chunks/contract-IQHESBXq.js.map +1 -0
- package/dist/contract.js +1 -1
- package/dist/files/i18n-keys.json +66 -0
- package/dist/types/entries/voice.d.ts +1 -1
- 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/types/voice/call/agent-voice-call-store.d.ts +1 -1
- package/dist/voice-admin.js +20 -2
- package/dist/voice-admin.js.map +1 -1
- package/dist/voice.js +6 -0
- package/dist/voice.js.map +1 -1
- package/package.json +1 -1
- package/public-api.json +2 -0
- package/dist/chunks/contract-CIXLnSqL.js.map +0 -1
package/README.md
CHANGED
|
@@ -372,6 +372,8 @@ Pass one stable component (what changes comes through a context of the host), or
|
|
|
372
372
|
- **While the turn runs** (`phase="live"`): the group stands open, steps arrive one line each, `RunStatusLine` shows
|
|
373
373
|
the clock and Stop, the task plan stands above (its items when the trace names them). A host that also shows an
|
|
374
374
|
activity ticker keeps one source of live step rows: the trace in `normal` and `verbose`, the ticker in `summary`.
|
|
375
|
+
A spoken sentence a voice call left without an answer (an owner row with a `PHONE_CALL_ENDED` marker above it) is
|
|
376
|
+
no turn in flight: no working line, no live trace, no Stop — only the server's run status shows a turn then.
|
|
375
377
|
- **Reads.** All traces of a conversation share one `ConversationTraceLoader` (`getConversationTraceLoader`): the
|
|
376
378
|
turns on screen are read in windows, a live turn is followed with `afterMessageIndex`, a new message reads again.
|
|
377
379
|
A failed read renders nothing; the chat is never broken by its trace. `useConversationTraces` gives a pane beside
|
|
@@ -482,6 +484,12 @@ not.
|
|
|
482
484
|
- `zIndex` of the incoming call sets its stacking order over the page; without it the custom property
|
|
483
485
|
`--agents-voice-incoming-call-z-index` does.
|
|
484
486
|
|
|
487
|
+
- An ended call's title on the band follows the server's end reason: `%agentName% ended the voice chat`
|
|
488
|
+
(`ENDED_BY_AGENT`), `Voice chat limit reached` (`LIMIT_REACHED`), `Connection to %agentName% lost`
|
|
489
|
+
(`PROVIDER_CONNECTION_LOST`), `%agentName% stopped answering` (`PROVIDER_STALLED`), else `Voice chat ended`
|
|
490
|
+
(`useAgentVoiceCall().endReason` carries the stored value; `./voice` exports
|
|
491
|
+
`AGENT_VOICE_CALL_END_REASON_ENDED_BY_AGENT`, `AGENT_VOICE_CALL_END_REASON_LIMIT_REACHED`,
|
|
492
|
+
`AGENT_VOICE_CALL_END_REASON_PROVIDER_CONNECTION_LOST` and `AGENT_VOICE_CALL_END_REASON_PROVIDER_STALLED`).
|
|
485
493
|
- The band also shows the agent's ring while a chat is in sight (`isPresented`); the incoming call then keeps its own
|
|
486
494
|
card away. A surface that covers the chats reports it with `useAgentVoiceRingCover(true)`.
|
|
487
495
|
- The server-side end of a call is read after the change signal of the call's conversation
|
|
@@ -527,7 +535,8 @@ export const agentVoiceAdminApi = createAgentVoiceAdminApi({ baseApi: adminApi,
|
|
|
527
535
|
`createStaticAgentVoiceAdminApi` answers fixed payloads for reviews and tests.
|
|
528
536
|
- `AgentVoiceCallsScreen`: one row per call (when it began, the account, who started it, the state with the end
|
|
529
537
|
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
|
|
538
|
+
the call was created, the booked seconds and the end reason (every end reason, also `PROVIDER_CONNECTION_LOST`
|
|
539
|
+
"Connection lost" and `PROVIDER_STALLED` "Provider stalled"); pages of `pageSize` calls (default 50). Props: `api`,
|
|
531
540
|
`title?`, `description?`, `headerActions?`, `onOpenCall?(callId)`, `accountId?`, `conversationId?`,
|
|
532
541
|
`buildConversationHref?(conversationId)`, `linkComponent?`, `pageSize?`.
|
|
533
542
|
- `AgentVoiceCallDetailScreen`: the same values in full, the call's times, its provider, and the link that opens the
|
package/dist/chat.js
CHANGED
|
@@ -13,7 +13,7 @@ import { r as resolveDeepLinkableWidget, i as isWidgetClickSignalSource, a as Ca
|
|
|
13
13
|
import { b as ConversationErrorType, a as ConversationMessageInputComposerWidgets, C as ConversationWidgetProvider, c as createAgentsChatStore } from "./chunks/ConversationMessageInputComposerWidgets-TchR1lPj.js";
|
|
14
14
|
import { A, E, I, r, d } from "./chunks/ConversationMessageInputComposerWidgets-TchR1lPj.js";
|
|
15
15
|
import { c as buildMessageTextWithComposerWidgets, e as WidgetWindowRootContext, f as findBalancedJsonObjectEnd, d as buildWidgetRenderReportSignal, W as WIDGET_RENDER_REPORT_SIGNAL_SOURCE, g as createWidgetRenderReportCollector, h as WidgetRenderReportCollectorContext } from "./chunks/ConversationMarkdown-DlvwT3Qk.js";
|
|
16
|
-
import { S as SIGNAL_SOURCES_THAT_OWE_NO_WORK, P as PHONE_CALL_LIFECYCLE_SIGNAL_SOURCES, l as lastWireMessageIsUnansweredUserMessage, b as buildChangedMessagesRequest, d as deriveAgentActivity } from "./chunks/contract-
|
|
16
|
+
import { S as SIGNAL_SOURCES_THAT_OWE_NO_WORK, P as PHONE_CALL_LIFECYCLE_SIGNAL_SOURCES, l as lastWireMessageIsUnansweredUserMessage, b as buildChangedMessagesRequest, d as deriveAgentActivity } from "./chunks/contract-IQHESBXq.js";
|
|
17
17
|
import { t as textKey } from "./chunks/text-key-DnoZ4lAk.js";
|
|
18
18
|
import { r as readTraceMoment, s as styles$m, u as useTraceFormat, a as useTraceNow, b as agentStyles, T as TraceStateIcon, f as formatTraceClock, c as readTraceStateLabel, d as styles$n, F as FileChangesSummary, e as readTraceFileChangeLetter, g as readTraceFileChangeWord, h as TracePath, i as TraceMountChip, j as TraceLink, k as FileEditBlock, E as EntityChip, l as selectVisibleTraceSteps, m as TraceStepRow, n as TaskPlanRow$1, o as readTaskPlanCountsOfStep, p as buildTaskPlanItems, q as describeStepCount, M as MIN_SHOWN_TURN_DURATION_MS, t as TurnMetaLine, v as ToolStepGroup, w as readTaskPlanCounts, x as describeTaskPlanProgress, y as isTraceBackgroundJobLabel, z as readTraceSubAgentState, A as describeTraceBackgroundJob, B as readTraceStepState } from "./chunks/content-from-unified-diff-lgH6CejC.js";
|
|
19
19
|
import { C, D, L, S, G, H, I as I2, J, K, N, O, P, Q, R, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar } from "./chunks/content-from-unified-diff-lgH6CejC.js";
|
|
@@ -38,6 +38,14 @@ const isResolved = (status) => status != null && RESOLVED_STATUSES.includes(stat
|
|
|
38
38
|
const TERMINAL_RUN_STATES = ["COMPLETED", "FAILED", "CANCELLED"];
|
|
39
39
|
const UNRESOLVED_RUN_STATUSES = ["QUEUED", "RUNNING"];
|
|
40
40
|
const isRowThatOwesNoWork = (message) => message.messageType === "ERROR" || message.messageType === "CHECKPOINT" || message.messageType === "SIGNAL" && SIGNAL_SOURCES_THAT_OWE_NO_WORK.includes(message.signalSource ?? "");
|
|
41
|
+
const PHONE_CALL_ENDED_SIGNAL_SOURCE = "PHONE_CALL_ENDED";
|
|
42
|
+
const isOwnerRowLeftBehindByEndedCall = (ownerRow, sortedMessages) => {
|
|
43
|
+
const ownerRowIndex = ownerRow.indexInConversation;
|
|
44
|
+
if (ownerRowIndex == null || ownerRow.messageType === "SIGNAL") return false;
|
|
45
|
+
return sortedMessages.some(
|
|
46
|
+
(message) => message.messageType === "SIGNAL" && message.signalSource === PHONE_CALL_ENDED_SIGNAL_SOURCE && message.indexInConversation != null && message.indexInConversation > ownerRowIndex
|
|
47
|
+
);
|
|
48
|
+
};
|
|
41
49
|
const isEffectivelyResolved = (message) => {
|
|
42
50
|
if (message == null) return false;
|
|
43
51
|
if (isResolved(message.toolCall?.status)) return true;
|
|
@@ -73,11 +81,12 @@ const deriveAgentActivity = (messages, runStatus) => {
|
|
|
73
81
|
if (runStatus === "failed") {
|
|
74
82
|
return { active: false, label: "" };
|
|
75
83
|
}
|
|
76
|
-
const
|
|
84
|
+
const allSorted = [...messages ?? []].sort(
|
|
77
85
|
(a, b) => (a.indexInConversation ?? Number.POSITIVE_INFINITY) - (b.indexInConversation ?? Number.POSITIVE_INFINITY)
|
|
78
86
|
);
|
|
87
|
+
const sorted = allSorted.filter((message) => !isRowThatOwesNoWork(message));
|
|
79
88
|
const lastMessage = sorted[sorted.length - 1];
|
|
80
|
-
if (lastMessage?.role === "USER") {
|
|
89
|
+
if (lastMessage?.role === "USER" && !isOwnerRowLeftBehindByEndedCall(lastMessage, allSorted)) {
|
|
81
90
|
return { active: true, label: "" };
|
|
82
91
|
}
|
|
83
92
|
const unresolvedDelegateCount = sorted.reduce((count, message) => count + countOutstandingChildren(message), 0);
|
|
@@ -129,4 +138,4 @@ export {
|
|
|
129
138
|
deriveAgentActivity as d,
|
|
130
139
|
lastWireMessageIsUnansweredUserMessage as l
|
|
131
140
|
};
|
|
132
|
-
//# sourceMappingURL=contract-
|
|
141
|
+
//# sourceMappingURL=contract-IQHESBXq.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-IQHESBXq.js","sources":["../../src/chat/last-wire-message-is-unanswered-user-message.ts","../../src/chat/controller/derive-agent-activity.ts","../../src/chat/controller/changed-messages-request.ts"],"sourcesContent":["import type { ChatMessage } from \"./chat-message\";\n\n/** The phone call's started / ended markers — the call marker chip, structural context, never owed work. */\nexport const PHONE_CALL_LIFECYCLE_SIGNAL_SOURCES: readonly string[] = [\"PHONE_CALL_STARTED\", \"PHONE_CALL_ENDED\"];\n/** The loop dropped a repeat of an already delivered text — bookkeeping behind the agent's answer, never owed work. */\nconst REPEATED_TEXT_SUPPRESSED_SIGNAL_SOURCE = \"REPEATED_TEXT_SUPPRESSED\";\n/** The platform wrote a widget on its own (e.g. a follow-up question under the final text) — a notice, never owed work. */\nconst PLATFORM_WIDGET_EMITTED_SIGNAL_SOURCE = \"PLATFORM_WIDGET_EMITTED\";\n/** The frontend's render report of a message's widgets — context for the next turn, never owed work. */\nconst FRONTEND_WIDGET_RENDER_REPORT_SIGNAL_SOURCE = \"FRONTEND_WIDGET_RENDER_REPORT\";\n/**\n * The SIGNAL rows that owe no work — the backend's `owesWork() === false` on a SIGNAL row, pinned by\n * `signal-source-parity.json` (`_signal-source-parity.spec.ts`).\n */\nexport const SIGNAL_SOURCES_THAT_OWE_NO_WORK: readonly string[] = [\n ...PHONE_CALL_LIFECYCLE_SIGNAL_SOURCES,\n REPEATED_TEXT_SUPPRESSED_SIGNAL_SOURCE,\n PLATFORM_WIDGET_EMITTED_SIGNAL_SOURCE,\n FRONTEND_WIDGET_RENDER_REPORT_SIGNAL_SOURCE,\n];\n\n/**\n * Whether the newest WIRE message is the customer's own, still unanswered — the backend's `hasUnansweredInboundMessage`\n * seen from the frontend, walked the same way: ERROR / CHECKPOINT rows are bookkeeping (never rendered, never an\n * answer); a TOOL_MESSAGE (a tool's own widget to the customer, stored role ASSISTANT) is NOT the agent's answer — a\n * customer question followed only by a tool's status widget stays owed; the phone-call lifecycle chips are structural\n * context, never owed work, and so is the platform's notice that it wrote a widget on its own; any other trailing SIGNAL (a widget click, a memory-conflict clarify) IS owed work, exactly\n * like a user message. Only then does a failed run have something to RETRY — the persisted\n * message is re-driven server-side instead of asking the customer to send it again. A walk that diverges from the\n * backend's shows the error card without the button while the backend would accept the retry — keep the two in step.\n *\n * The slice keeps `messages` ordered by `indexInConversation`; the sort here is belt-and-suspenders for a caller that\n * hands in an unordered page, not a fix for an upstream ordering defect.\n */\nexport const lastWireMessageIsUnansweredUserMessage = (messages: ChatMessage[] | null): boolean => {\n if (!messages?.length) {\n return false;\n }\n const sorted = [...messages].sort((a, b) => (a.indexInConversation ?? 0) - (b.indexInConversation ?? 0));\n for (let position = sorted.length - 1; position >= 0; position--) {\n const message = sorted[position];\n if (\n message.messageType === \"ERROR\" ||\n message.messageType === \"CHECKPOINT\" ||\n message.messageType === \"TOOL_MESSAGE\"\n ) {\n continue;\n }\n if (message.messageType === \"SIGNAL\") {\n if (SIGNAL_SOURCES_THAT_OWE_NO_WORK.includes(message.signalSource ?? \"\")) {\n continue;\n }\n return true;\n }\n return message.authorType === \"USER\";\n }\n return false;\n};\n","import type { ConversationMessageStatus } from \"../../contract/conversation\";\nimport type { ChatMessage } from \"../chat-message\";\nimport { textKey } from \"../../provider/text-key\";\nimport { SIGNAL_SOURCES_THAT_OWE_NO_WORK } from \"../last-wire-message-is-unanswered-user-message\";\n\n/** Mirrors App\\Domain\\AI\\Entities\\Conversations\\Agent\\Tools\\DelegateTool::NAME. */\nconst DELEGATE_TOOL_NAME = \"delegate\";\n\n/** Terminal tool-call statuses — mirrors ToolCall::isResolved (COMPLETED / FAILED / CANCELLED). */\nconst RESOLVED_STATUSES: string[] = [\"COMPLETED\", \"FAILED\", \"CANCELLED\"] satisfies ConversationMessageStatus[];\nconst isResolved = (status?: string | null): boolean => status != null && RESOLVED_STATUSES.includes(status);\n\n/** Terminal child run-states — mirrors AIConversationRunState::TERMINAL (COMPLETED / FAILED / CANCELLED). */\nconst TERMINAL_RUN_STATES: string[] = [\"COMPLETED\", \"FAILED\", \"CANCELLED\"];\n\n/** A sub-agent run still waiting to start or actively working (mirrors DelegationSubAgentRun::STATUS_*). */\nconst UNRESOLVED_RUN_STATUSES: string[] = [\"QUEUED\", \"RUNNING\"];\n\n/**\n * A tool call is EFFECTIVELY resolved when its stored status says so — or, for a `delegate` call, when every\n * expanded child already reached a terminal run state: the children are the truth of a fan-out, the stored\n * status is a mirror that a write race can leave stale (a delegate call left RUNNING kept the whole customer\n * chat \"thinking\" for the rest of a setup). An empty or missing expansion proves nothing and falls back to the status.\n */\n/**\n * Rows that never start or continue a turn: the bookkeeping rows (ERROR, CHECKPOINT) and the SIGNAL rows that owe no\n * work (the frontend's widget render report, the platform's own widget notice, phone call markers, a suppressed\n * repeat). They are stored with role USER and may land after the agent's answer; read as the tail they would keep the\n * \"Working on it…\" line under a finished answer forever.\n */\nconst isRowThatOwesNoWork = (message: ChatMessage): boolean =>\n message.messageType === \"ERROR\" ||\n message.messageType === \"CHECKPOINT\" ||\n (message.messageType === \"SIGNAL\" && SIGNAL_SOURCES_THAT_OWE_NO_WORK.includes(message.signalSource ?? \"\"));\n\n/** The marker the voice session writes when a phone call ends — mirrors PhoneConversationSignalSource::PHONE_CALL_ENDED. */\nconst PHONE_CALL_ENDED_SIGNAL_SOURCE = \"PHONE_CALL_ENDED\";\n\n/**\n * Whether a phone call ended after this owner row: a call-ended marker stands above it. The caller's spoken sentences\n * are stored as owner rows; the voice model answers them in the call or hands them on by a delegation, and nothing\n * answers one by text after the call — a sentence still without an answer at the hang-up is a record of the call, not a\n * turn the agent owes (the backend's `isNewestOwnerTextLeftBehindByEndedCall`). Such a row is not \"just sent\" either:\n * whether a turn runs is then the run status's word alone. An optimistic row (no index yet) is never left behind.\n */\nconst isOwnerRowLeftBehindByEndedCall = (ownerRow: ChatMessage, sortedMessages: ChatMessage[]): boolean => {\n const ownerRowIndex = ownerRow.indexInConversation;\n // Only the owner's text: a click or another owed signal waits for its turn as before.\n if (ownerRowIndex == null || ownerRow.messageType === \"SIGNAL\") return false;\n return sortedMessages.some(\n (message) =>\n message.messageType === \"SIGNAL\" &&\n message.signalSource === PHONE_CALL_ENDED_SIGNAL_SOURCE &&\n message.indexInConversation != null &&\n message.indexInConversation > ownerRowIndex,\n );\n};\n\nconst isEffectivelyResolved = (message: ChatMessage | undefined): boolean => {\n if (message == null) return false;\n if (isResolved(message.toolCall?.status)) return true;\n if (message.toolCall?.name !== DELEGATE_TOOL_NAME) return false;\n const children = message.delegatedConversations ?? [];\n if (children.length === 0) return false;\n // A partial expansion (page cap) proves nothing: the call declared N tasks, N children must be visible.\n const declaredTasks = (message.toolCall?.arguments as { tasks?: unknown[] } | undefined)?.tasks;\n if (Array.isArray(declaredTasks) && declaredTasks.length > children.length) return false;\n return children.every((child) => TERMINAL_RUN_STATES.includes(child.runState ?? \"\"));\n};\n\n/** How many sub-agents spawned by this message are still working. */\nexport const countOutstandingChildren = (message: ChatMessage): number => {\n const children = message.delegatedConversations ?? [];\n if (children.length > 0) {\n return children.filter((child) => !TERMINAL_RUN_STATES.includes(child.runState ?? \"\")).length;\n }\n if (message.toolCall?.name !== DELEGATE_TOOL_NAME) {\n return 0;\n }\n // A NEW row (one `delegate` call = one sub-agent) carries its own run record instead of\n // `delegatedConversations`; no child expanded, so the record's CURRENT run is the truth of whether it is done.\n const subAgent = message.subAgent;\n if (subAgent != null) {\n const currentRun = (subAgent.runs ?? []).find((run) => run.runNumber === subAgent.currentRunNumber);\n return currentRun != null && UNRESOLVED_RUN_STATUSES.includes(currentRun.status ?? \"\") ? 1 : 0;\n }\n if (isResolved(message.toolCall?.status)) {\n return 0;\n }\n const declaredTasks = (message.toolCall?.arguments as { tasks?: unknown[] } | undefined)?.tasks;\n return Array.isArray(declaredTasks) && declaredTasks.length > 0 ? declaredTasks.length : 1;\n};\n\n/** A tool call whose result is still to come — its progress lives in `toolCall.status`, never in the row's status. */\nexport const hasUnresolvedToolCall = (message: ChatMessage): boolean =>\n message.toolCall != null && !isEffectivelyResolved(message);\n\n/** Whether this message's delegation can still change: a child is still working, or the call is not resolved yet. */\nexport const hasDelegationInFlight = (message: ChatMessage): boolean =>\n countOutstandingChildren(message) > 0 ||\n (message.toolCall?.name === DELEGATE_TOOL_NAME && !isEffectivelyResolved(message));\n\nexport type AgentActivity = {\n /** Whether a turn is in flight — drives the indicator's visibility (ConversationView aiThinking). */\n active: boolean;\n /**\n * Translation source string for \"what the agent is doing right now\" (empty when nothing to show). Rendered through\n * the chat's `Text`, so this is the translatable key with %placeholders% — NOT pre-interpolated. The dynamic values\n * arrive via {@link AgentActivity.replacements} and plural form via {@link AgentActivity.context}.\n */\n label: string;\n /** Dynamic values substituted into the %placeholders% of {@link AgentActivity.label} by <Text>. */\n replacements?: Record<string, string | number>;\n /** Plural selector for <Text> when the label is count-dependent. */\n context?: \"one\" | \"other\";\n /** A non-delegate tool is running → show the ASCII wrench spinner instead of a text label. */\n toolRunning?: boolean;\n};\n\n/**\n * Derive \"what the agent is doing right now\" for the agent activity indicator PURELY from the\n * live conversation data: the message tree (refreshed on each realtime-signal tick / on open) plus the signal's\n * coarse runStatus (\"running\" | \"idle\" | \"failed\" | null). No network. Mirrors the backend truth —\n * AIConversation.runState (IDLE/RUNNING/AWAITING_DELEGATES/…) and per-message status/messageType/toolCall — but reads\n * it off the messages the FE already holds, so the indicator is correct even before the first signal emission.\n */\nexport const deriveAgentActivity = (\n messages: ChatMessage[] | null,\n runStatus: string | null,\n): AgentActivity => {\n if (runStatus === \"failed\") {\n // Failure surfaces via ConversationView's error state, not the activity line.\n return { active: false, label: \"\" };\n }\n\n // An optimistic (just-sent, not yet server-assigned) row carries no index — it belongs at the TAIL, the newest\n // thing in the conversation, never at the front, where `?? 0` would park it ahead of every real message.\n const allSorted = [...(messages ?? [])].sort(\n (a, b) => (a.indexInConversation ?? Number.POSITIVE_INFINITY) - (b.indexInConversation ?? Number.POSITIVE_INFINITY),\n );\n const sorted = allSorted.filter((message) => !isRowThatOwesNoWork(message));\n const lastMessage = sorted[sorted.length - 1];\n\n // The owner just sent — the optimistic bubble, or a saved row still awaiting the first response — starts the face\n // thinking immediately, before the server's \"running\" ping arrives (which can lag the send by about a second);\n // checked before the `idle` short-circuit below, whose `runStatus` can still report the PREVIOUS turn's rest state.\n // A rejected POST resets `aiThinking` itself (conversations-message-post.case.ts), so no separate reset is needed.\n // A sentence a phone call left behind is neither: no turn is owed for it (no Stop button, no \"working\" line).\n if (lastMessage?.role === \"USER\" && !isOwnerRowLeftBehindByEndedCall(lastMessage, allSorted)) {\n return { active: true, label: \"\" };\n }\n\n // Sub-agents still working → the orchestrator is parked on its children (backend runState AWAITING_DELEGATES).\n // Counted per CHILD, not per delegate message: a fan-out (`delegate` with N tasks, or a tool result carrying\n // `delegationTasks`, e.g. a LARGE website edit's page packets) is ONE message with N children. The expanded\n // `delegatedConversations` carry each child's runState; without the expand, a `delegate` call still awaiting its\n // verdict counts its declared tasks, else one.\n const unresolvedDelegateCount = sorted.reduce((count, message) => count + countOutstandingChildren(message), 0);\n\n // The turn is at rest and nothing is outstanding → idle, no indicator.\n if (runStatus === \"idle\" && unresolvedDelegateCount === 0) {\n return { active: false, label: \"\" };\n }\n\n if (unresolvedDelegateCount > 0) {\n return {\n active: true,\n label: textKey(\"Waiting for %count% delegations...\"),\n replacements: { count: unresolvedDelegateCount },\n context: unresolvedDelegateCount === 1 ? \"one\" : \"other\",\n };\n }\n\n // A tool-call that hasn't resolved yet → that tool is running now (a delegate call whose children all finished\n // is resolved in effect, whatever its stored status says).\n if (lastMessage?.messageType === \"TOOL_CALL\" && !isEffectivelyResolved(lastMessage)) {\n return {\n active: true,\n label: textKey(\"Running: %tool%...\"),\n replacements: { tool: lastMessage.toolCall?.name ?? \"Tool\" },\n toolRunning: true,\n };\n }\n\n // The model is producing a turn (signal running) — a trailing owner row was already caught above, unless a call\n // left it behind: then only the running signal shows a turn.\n if (runStatus === \"running\") {\n return { active: true, label: \"\" };\n }\n\n return { active: false, label: \"\" };\n};\n","import type { ChangedMessagesRequest, ConversationMessageStatus } from \"../../contract/conversation\";\nimport type { ChatMessage } from \"../chat-message\";\nimport { hasDelegationInFlight, hasUnresolvedToolCall } from \"./derive-agent-activity\";\n\n/** Row statuses that are not final yet (today only a waiting signal row carries one, PENDING until a turn reads it). */\nconst CHANGING_STATUSES: string[] = [\"PENDING\", \"RUNNING\", \"CANCEL_REQUESTED\"] satisfies ConversationMessageStatus[];\n\nconst canStillChange = (message: ChatMessage): boolean =>\n CHANGING_STATUSES.includes(message.status ?? \"\") || hasUnresolvedToolCall(message) || hasDelegationInFlight(message);\n\n/**\n * What a live update reads, given the loaded messages: every row written since the newest loaded one, plus every\n * message from the lowest one that can still change. \"Written since\" goes by id, not index: ids grow with every write,\n * while an index can be taken below the newest loaded one (a call row persisted after the row its execution emitted)\n * or reused (a re-drive after an admin delete-from). The index start never lies below the newest page (a newest-first\n * page of `pageSize` cannot return older rows anyway), so a row a dead worker left pending cannot pin it. Nothing\n * loaded yet → null: the caller reads the newest page as on open. How the request reaches the wire (the filter string)\n * is the binding's matter (`AgentsConversationClient.getChangedMessages`).\n */\nexport const buildChangedMessagesRequest = (\n messages: ChatMessage[] | null,\n pageSize: number,\n): ChangedMessagesRequest | null => {\n const loaded = (messages ?? []).filter((message) => message.indexInConversation != null);\n if (loaded.length === 0) {\n return null;\n }\n const indexes = (list: ChatMessage[]) => list.map((message) => message.indexInConversation as number);\n const highestIndex = Math.max(...indexes(loaded));\n const changing = loaded.filter(canStillChange);\n const fromIndex = Math.max(\n changing.length > 0 ? Math.min(...indexes(changing)) : highestIndex + 1,\n highestIndex - pageSize + 1,\n );\n const highestKnownId = Math.max(...loaded.map((message) => message.id ?? 0));\n return { highestKnownId, fromIndex, pageSize };\n};\n"],"names":[],"mappings":";;;;AAGO,MAAM,sCAAyD,CAAC,sBAAsB,kBAAkB;AAE/G,MAAM,yCAAyC;AAE/C,MAAM,wCAAwC;AAE9C,MAAM,8CAA8C;AAK7C,MAAM,kCAAqD;AAAA,EAChE,GAAG;AAAA,EACH;AAAA,EACA;AAAA,EACA;AACF;AAeO,MAAM,yCAAyC,CAAC,aAA4C;AACjG,MAAI,CAAC,UAAU,QAAQ;AACrB,WAAO;AAAA,EACT;AACA,QAAM,SAAS,CAAC,GAAG,QAAQ,EAAE,KAAK,CAAC,GAAG,OAAO,EAAE,uBAAuB,MAAM,EAAE,uBAAuB,EAAE;AACvG,WAAS,WAAW,OAAO,SAAS,GAAG,YAAY,GAAG,YAAY;AAChE,UAAM,UAAU,OAAO,QAAQ;AAC/B,QACE,QAAQ,gBAAgB,WACxB,QAAQ,gBAAgB,gBACxB,Q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AAwB,KAAK,IAAI,CAAC,YAAY,QAAQ,mBAA6B;AACpG,QAAM,eAAe,KAAK,IAAI,GAAG,QAAQ,MAAM,CAAC;AAChD,QAAM,WAAW,OAAO,OAAO,cAAc;AAC7C,QAAM,YAAY,KAAK;AAAA,IACrB,SAAS,SAAS,IAAI,KAAK,IAAI,GAAG,QAAQ,QAAQ,CAAC,IAAI,eAAe;AAAA,IACtE,eAAe,WAAW;AAAA,EAAA;AAE5B,QAAM,iBAAiB,KAAK,IAAI,GAAG,OAAO,IAAI,CAAC,YAAY,QAAQ,MAAM,CAAC,CAAC;AAC3E,SAAO,EAAE,gBAAgB,WAAW,SAAA;AACtC;"}
|
package/dist/contract.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { b, a, A, C, i, r } from "./chunks/conversation-B7-evdj_.js";
|
|
3
3
|
import { C as C2 } from "./chunks/conversation-trace-fVeh6Lg6.js";
|
|
4
|
-
import { b as b2 } from "./chunks/contract-
|
|
4
|
+
import { b as b2 } from "./chunks/contract-IQHESBXq.js";
|
|
5
5
|
export {
|
|
6
6
|
b as AGENTS_CLIENT_CONTEXT_LIMITS,
|
|
7
7
|
a as AGENTS_CLIENT_ERROR_CODE_REQUEST_ABORTED,
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
export type { AgentVoiceAdminCall, AgentVoiceAdminCallDerivedValues, AgentVoiceAdminCallDirection, AgentVoiceAdminCallEndReason, AgentVoiceAdminCallIdArg, AgentVoiceAdminCallResponse, AgentVoiceAdminCallsArg, AgentVoiceAdminCallsResponse, AgentVoiceAdminCallState, AgentVoiceAdminChangeHistory, AgentVoiceAdminCurrency, AgentVoiceAdminElements, AgentVoiceAdminMoneyAmount, } from "../voice/admin/agent-voice-admin-types";
|
|
2
2
|
export { AGENT_VOICE_ERROR_CODE_INVALID_OPEN_ANSWER, type AgentVoiceApi, AgentVoiceApiError, type AgentVoiceBaseApi, type AgentVoiceFetchOptions, type AgentVoiceOpenPathBuilder, type AgentVoiceRequest, buildAgentVoiceRequests, createAgentVoiceApi, type CreateAgentVoiceApiOptions, createAgentVoiceFetchBaseApi, type CreateAgentVoiceFetchBaseApiOptions, readAgentVoiceErrorCode, } from "../voice/agent-voice-api";
|
|
3
|
-
export { AGENT_VOICE_CALL_END_REASON_ENDED_BY_AGENT, AGENT_VOICE_CALL_END_REASON_LIMIT_REACHED, type AgentVoiceCallLine, type AgentVoiceCallPhase, type AgentVoiceCallSnapshot, type AgentVoiceCallSpeaker, bindAgentVoiceApi, checkAgentVoiceCallEndedOnServer, dismissAgentVoiceCallOutcome, endAgentVoiceCallFromServer, hangUpAgentVoiceCall, IDLE_AGENT_VOICE_CALL, isAgentVoiceCallActive, isAgentVoiceCallShownInAgentSpace, readAgentVoiceCallSnapshot, startAgentVoiceCall, type StartAgentVoiceCallParams, toggleAgentVoiceCallMute, useAgentVoiceCallSnapshot, useAgentVoiceCallValue, useIsAgentVoiceCallActive, } from "../voice/call/agent-voice-call-store";
|
|
3
|
+
export { AGENT_VOICE_CALL_END_REASON_ENDED_BY_AGENT, AGENT_VOICE_CALL_END_REASON_LIMIT_REACHED, AGENT_VOICE_CALL_END_REASON_PROVIDER_CONNECTION_LOST, AGENT_VOICE_CALL_END_REASON_PROVIDER_STALLED, type AgentVoiceCallLine, type AgentVoiceCallPhase, type AgentVoiceCallSnapshot, type AgentVoiceCallSpeaker, bindAgentVoiceApi, checkAgentVoiceCallEndedOnServer, dismissAgentVoiceCallOutcome, endAgentVoiceCallFromServer, hangUpAgentVoiceCall, IDLE_AGENT_VOICE_CALL, isAgentVoiceCallActive, isAgentVoiceCallShownInAgentSpace, readAgentVoiceCallSnapshot, startAgentVoiceCall, type StartAgentVoiceCallParams, toggleAgentVoiceCallMute, useAgentVoiceCallSnapshot, useAgentVoiceCallValue, useIsAgentVoiceCallActive, } from "../voice/call/agent-voice-call-store";
|
|
4
4
|
export { type AgentVoiceCall, useAgentVoiceCall } from "../voice/call/use-agent-voice-call";
|
|
5
5
|
export { type AgentVoiceCallTurn, turnOfAgentVoiceCall } from "../voice/call/agent-voice-call-turn";
|
|
6
6
|
export { formatAgentVoiceCallDuration } from "../voice/call/format-agent-voice-call-duration";
|
|
@@ -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";
|
|
@@ -46,7 +46,7 @@ export interface AgentVoiceCallSnapshot {
|
|
|
46
46
|
*/
|
|
47
47
|
readonly endReason?: string;
|
|
48
48
|
}
|
|
49
|
-
export { AGENT_VOICE_CALL_END_REASON_ENDED_BY_AGENT, AGENT_VOICE_CALL_END_REASON_LIMIT_REACHED, } from "./agent-voice-call-end-reasons";
|
|
49
|
+
export { AGENT_VOICE_CALL_END_REASON_ENDED_BY_AGENT, AGENT_VOICE_CALL_END_REASON_LIMIT_REACHED, AGENT_VOICE_CALL_END_REASON_PROVIDER_CONNECTION_LOST, AGENT_VOICE_CALL_END_REASON_PROVIDER_STALLED, } from "./agent-voice-call-end-reasons";
|
|
50
50
|
/** No voice chat: also what a chat shows of a voice chat that runs in another agent space. */
|
|
51
51
|
export declare const IDLE_AGENT_VOICE_CALL: AgentVoiceCallSnapshot;
|
|
52
52
|
/**
|
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
|
{
|