@absolutejs/voice 0.0.22-beta.507 → 0.0.22-beta.509
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/dist/angular/index.d.ts +2 -0
- package/dist/angular/index.js +374 -272
- package/dist/angular/voice-live-agent-console.service.d.ts +16 -0
- package/dist/dtmfCollector.d.ts +37 -0
- package/dist/holdAudio.d.ts +23 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +563 -0
- package/dist/postCallSurvey.d.ts +41 -0
- package/dist/promptInjectionGuard.d.ts +30 -0
- package/dist/react/VoiceLiveAgentConsole.d.ts +11 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +285 -29
- package/dist/svelte/createVoiceLiveAgentConsole.d.ts +23 -0
- package/dist/svelte/index.d.ts +2 -0
- package/dist/svelte/index.js +291 -180
- package/dist/vue/VoiceLiveAgentConsole.d.ts +50 -0
- package/dist/vue/index.d.ts +1 -0
- package/dist/vue/index.js +250 -32
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type LiveAgentConsole } from "../client/liveAgentConsole";
|
|
2
|
+
export type VoiceLiveAgentConsoleProps = {
|
|
3
|
+
className?: string;
|
|
4
|
+
console?: LiveAgentConsole;
|
|
5
|
+
onTakeover?: (reason?: string) => void;
|
|
6
|
+
sessionId?: string;
|
|
7
|
+
takeoverButtonLabel?: string;
|
|
8
|
+
takeoverReason?: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const VoiceLiveAgentConsole: ({ className, console: consoleProp, onTakeover, sessionId, takeoverButtonLabel, takeoverReason, title, }: VoiceLiveAgentConsoleProps) => import("react/jsx-runtime").JSX.Element;
|
package/dist/react/index.d.ts
CHANGED
|
@@ -41,6 +41,8 @@ export { VoiceCallPlayer } from "./VoiceCallPlayer";
|
|
|
41
41
|
export type { VoiceCallPlayerProps } from "./VoiceCallPlayer";
|
|
42
42
|
export { VoiceCostDashboard } from "./VoiceCostDashboard";
|
|
43
43
|
export type { VoiceCostDashboardProps } from "./VoiceCostDashboard";
|
|
44
|
+
export { VoiceLiveAgentConsole } from "./VoiceLiveAgentConsole";
|
|
45
|
+
export type { VoiceLiveAgentConsoleProps } from "./VoiceLiveAgentConsole";
|
|
44
46
|
export { VoiceLiveCallViewer } from "./VoiceLiveCallViewer";
|
|
45
47
|
export type { VoiceLiveCallViewerProps } from "./VoiceLiveCallViewer";
|
|
46
48
|
export { VoiceReplayTimeline } from "./VoiceReplayTimeline";
|
package/dist/react/index.js
CHANGED
|
@@ -13339,7 +13339,7 @@ var VoiceCostDashboard = ({
|
|
|
13339
13339
|
]
|
|
13340
13340
|
}, undefined, true, undefined, this);
|
|
13341
13341
|
};
|
|
13342
|
-
// src/react/
|
|
13342
|
+
// src/react/VoiceLiveAgentConsole.tsx
|
|
13343
13343
|
import { useEffect as useEffect27, useMemo as useMemo3, useState as useState2 } from "react";
|
|
13344
13344
|
|
|
13345
13345
|
// src/client/liveCallViewer.ts
|
|
@@ -13450,8 +13450,263 @@ var createLiveCallViewer = (options) => {
|
|
|
13450
13450
|
};
|
|
13451
13451
|
};
|
|
13452
13452
|
|
|
13453
|
-
// src/
|
|
13453
|
+
// src/client/liveAgentConsole.ts
|
|
13454
|
+
var createLiveAgentConsole = (options) => {
|
|
13455
|
+
const viewer = createLiveCallViewer(options);
|
|
13456
|
+
const recentLimit = Math.max(1, options.recentLimit ?? 12);
|
|
13457
|
+
let caller;
|
|
13458
|
+
let hasTakeover = false;
|
|
13459
|
+
let takeoverAt;
|
|
13460
|
+
let takeoverReason;
|
|
13461
|
+
const subscribers = new Set;
|
|
13462
|
+
const buildState = () => {
|
|
13463
|
+
const view = viewer.getState();
|
|
13464
|
+
return {
|
|
13465
|
+
caller,
|
|
13466
|
+
hasTakeover,
|
|
13467
|
+
recentTimeline: view.events.slice(-recentLimit),
|
|
13468
|
+
takeoverAt,
|
|
13469
|
+
takeoverReason,
|
|
13470
|
+
view
|
|
13471
|
+
};
|
|
13472
|
+
};
|
|
13473
|
+
const notify = () => {
|
|
13474
|
+
for (const subscriber of subscribers)
|
|
13475
|
+
subscriber();
|
|
13476
|
+
};
|
|
13477
|
+
const unsubscribeViewer = viewer.subscribe(() => {
|
|
13478
|
+
notify();
|
|
13479
|
+
});
|
|
13480
|
+
if (options.resolveCaller) {
|
|
13481
|
+
Promise.resolve(options.resolveCaller()).then((snapshot) => {
|
|
13482
|
+
caller = snapshot;
|
|
13483
|
+
notify();
|
|
13484
|
+
});
|
|
13485
|
+
}
|
|
13486
|
+
return {
|
|
13487
|
+
getState: buildState,
|
|
13488
|
+
noteAgentAudio: (at) => viewer.noteAgentAudio(at),
|
|
13489
|
+
notePartial: (text, at) => viewer.notePartial(text, at),
|
|
13490
|
+
noteTranscript: (text, at) => viewer.noteTranscript(text, at),
|
|
13491
|
+
releaseTakeover: () => {
|
|
13492
|
+
if (!hasTakeover)
|
|
13493
|
+
return;
|
|
13494
|
+
hasTakeover = false;
|
|
13495
|
+
takeoverAt = undefined;
|
|
13496
|
+
takeoverReason = undefined;
|
|
13497
|
+
viewer.applyControl({ reason: "released", type: "takeover.release" });
|
|
13498
|
+
notify();
|
|
13499
|
+
},
|
|
13500
|
+
setCaller: (snapshot) => {
|
|
13501
|
+
caller = snapshot;
|
|
13502
|
+
notify();
|
|
13503
|
+
},
|
|
13504
|
+
subscribe: (listener) => {
|
|
13505
|
+
subscribers.add(listener);
|
|
13506
|
+
return () => {
|
|
13507
|
+
subscribers.delete(listener);
|
|
13508
|
+
if (subscribers.size === 0)
|
|
13509
|
+
unsubscribeViewer();
|
|
13510
|
+
};
|
|
13511
|
+
},
|
|
13512
|
+
takeover: (reason) => {
|
|
13513
|
+
if (hasTakeover)
|
|
13514
|
+
return;
|
|
13515
|
+
hasTakeover = true;
|
|
13516
|
+
takeoverAt = Date.now();
|
|
13517
|
+
takeoverReason = reason;
|
|
13518
|
+
viewer.applyControl({ reason, type: "takeover.engaged" });
|
|
13519
|
+
notify();
|
|
13520
|
+
},
|
|
13521
|
+
viewer
|
|
13522
|
+
};
|
|
13523
|
+
};
|
|
13524
|
+
|
|
13525
|
+
// src/react/VoiceLiveAgentConsole.tsx
|
|
13454
13526
|
import { jsxDEV as jsxDEV25 } from "react/jsx-dev-runtime";
|
|
13527
|
+
var VoiceLiveAgentConsole = ({
|
|
13528
|
+
className,
|
|
13529
|
+
console: consoleProp,
|
|
13530
|
+
onTakeover,
|
|
13531
|
+
sessionId,
|
|
13532
|
+
takeoverButtonLabel = "Take over",
|
|
13533
|
+
takeoverReason,
|
|
13534
|
+
title = "Live agent console"
|
|
13535
|
+
}) => {
|
|
13536
|
+
const console = useMemo3(() => consoleProp ?? createLiveAgentConsole({ sessionId: sessionId ?? "live" }), [consoleProp, sessionId]);
|
|
13537
|
+
const [state, setState] = useState2(() => console.getState());
|
|
13538
|
+
useEffect27(() => {
|
|
13539
|
+
const unsubscribe = console.subscribe(() => {
|
|
13540
|
+
setState(console.getState());
|
|
13541
|
+
});
|
|
13542
|
+
return () => {
|
|
13543
|
+
unsubscribe();
|
|
13544
|
+
};
|
|
13545
|
+
}, [console]);
|
|
13546
|
+
const handleTakeover = () => {
|
|
13547
|
+
console.takeover(takeoverReason);
|
|
13548
|
+
onTakeover?.(takeoverReason);
|
|
13549
|
+
};
|
|
13550
|
+
const handleRelease = () => {
|
|
13551
|
+
console.releaseTakeover();
|
|
13552
|
+
};
|
|
13553
|
+
return /* @__PURE__ */ jsxDEV25("section", {
|
|
13554
|
+
"aria-label": "voice-live-agent-console",
|
|
13555
|
+
className: className ?? "absolute-voice-live-agent-console",
|
|
13556
|
+
"data-takeover": state.hasTakeover ? "true" : "false",
|
|
13557
|
+
style: {
|
|
13558
|
+
background: "#0f172a",
|
|
13559
|
+
borderRadius: 16,
|
|
13560
|
+
color: "#f8fafc",
|
|
13561
|
+
fontFamily: 'ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
|
|
13562
|
+
padding: 20
|
|
13563
|
+
},
|
|
13564
|
+
children: [
|
|
13565
|
+
/* @__PURE__ */ jsxDEV25("header", {
|
|
13566
|
+
style: {
|
|
13567
|
+
alignItems: "center",
|
|
13568
|
+
display: "flex",
|
|
13569
|
+
gap: 12,
|
|
13570
|
+
marginBottom: 12
|
|
13571
|
+
},
|
|
13572
|
+
children: [
|
|
13573
|
+
/* @__PURE__ */ jsxDEV25("strong", {
|
|
13574
|
+
style: { fontSize: 16 },
|
|
13575
|
+
children: title
|
|
13576
|
+
}, undefined, false, undefined, this),
|
|
13577
|
+
/* @__PURE__ */ jsxDEV25("span", {
|
|
13578
|
+
style: {
|
|
13579
|
+
background: state.hasTakeover ? "rgba(239,68,68,0.18)" : "rgba(59,130,246,0.18)",
|
|
13580
|
+
borderRadius: 999,
|
|
13581
|
+
fontSize: 11,
|
|
13582
|
+
padding: "3px 10px",
|
|
13583
|
+
textTransform: "uppercase"
|
|
13584
|
+
},
|
|
13585
|
+
children: state.hasTakeover ? "Human" : "Agent"
|
|
13586
|
+
}, undefined, false, undefined, this),
|
|
13587
|
+
/* @__PURE__ */ jsxDEV25("span", {
|
|
13588
|
+
style: { fontSize: 13, marginLeft: "auto", opacity: 0.7 },
|
|
13589
|
+
children: state.view.sessionId
|
|
13590
|
+
}, undefined, false, undefined, this)
|
|
13591
|
+
]
|
|
13592
|
+
}, undefined, true, undefined, this),
|
|
13593
|
+
state.caller ? /* @__PURE__ */ jsxDEV25("div", {
|
|
13594
|
+
style: {
|
|
13595
|
+
background: "rgba(255,255,255,0.06)",
|
|
13596
|
+
borderRadius: 12,
|
|
13597
|
+
fontSize: 13,
|
|
13598
|
+
margin: "0 0 12px",
|
|
13599
|
+
padding: 12
|
|
13600
|
+
},
|
|
13601
|
+
children: [
|
|
13602
|
+
/* @__PURE__ */ jsxDEV25("div", {
|
|
13603
|
+
style: { fontSize: 11, opacity: 0.7, textTransform: "uppercase" },
|
|
13604
|
+
children: "Caller"
|
|
13605
|
+
}, undefined, false, undefined, this),
|
|
13606
|
+
/* @__PURE__ */ jsxDEV25("div", {
|
|
13607
|
+
style: { marginTop: 4 },
|
|
13608
|
+
children: state.caller.summary
|
|
13609
|
+
}, undefined, false, undefined, this),
|
|
13610
|
+
Object.keys(state.caller.facts ?? {}).length > 0 ? /* @__PURE__ */ jsxDEV25("dl", {
|
|
13611
|
+
style: {
|
|
13612
|
+
display: "grid",
|
|
13613
|
+
fontSize: 12,
|
|
13614
|
+
gap: 4,
|
|
13615
|
+
gridTemplateColumns: "auto 1fr",
|
|
13616
|
+
margin: "8px 0 0"
|
|
13617
|
+
},
|
|
13618
|
+
children: Object.entries(state.caller.facts).map(([key, value]) => /* @__PURE__ */ jsxDEV25("div", {
|
|
13619
|
+
style: { display: "contents" },
|
|
13620
|
+
children: [
|
|
13621
|
+
/* @__PURE__ */ jsxDEV25("dt", {
|
|
13622
|
+
style: { opacity: 0.7 },
|
|
13623
|
+
children: key
|
|
13624
|
+
}, undefined, false, undefined, this),
|
|
13625
|
+
/* @__PURE__ */ jsxDEV25("dd", {
|
|
13626
|
+
style: { margin: 0 },
|
|
13627
|
+
children: value
|
|
13628
|
+
}, undefined, false, undefined, this)
|
|
13629
|
+
]
|
|
13630
|
+
}, key, true, undefined, this))
|
|
13631
|
+
}, undefined, false, undefined, this) : null,
|
|
13632
|
+
state.caller.openActions.length > 0 ? /* @__PURE__ */ jsxDEV25("ul", {
|
|
13633
|
+
style: {
|
|
13634
|
+
fontSize: 12,
|
|
13635
|
+
margin: "8px 0 0",
|
|
13636
|
+
paddingLeft: 16
|
|
13637
|
+
},
|
|
13638
|
+
children: state.caller.openActions.map((action) => /* @__PURE__ */ jsxDEV25("li", {
|
|
13639
|
+
children: action
|
|
13640
|
+
}, action, false, undefined, this))
|
|
13641
|
+
}, undefined, false, undefined, this) : null
|
|
13642
|
+
]
|
|
13643
|
+
}, undefined, true, undefined, this) : null,
|
|
13644
|
+
/* @__PURE__ */ jsxDEV25("div", {
|
|
13645
|
+
style: { display: "flex", gap: 10, marginBottom: 12 },
|
|
13646
|
+
children: state.hasTakeover ? /* @__PURE__ */ jsxDEV25("button", {
|
|
13647
|
+
onClick: handleRelease,
|
|
13648
|
+
style: {
|
|
13649
|
+
background: "rgba(255,255,255,0.08)",
|
|
13650
|
+
border: "1px solid rgba(255,255,255,0.18)",
|
|
13651
|
+
borderRadius: 12,
|
|
13652
|
+
color: "#f8fafc",
|
|
13653
|
+
cursor: "pointer",
|
|
13654
|
+
fontSize: 13,
|
|
13655
|
+
padding: "8px 14px"
|
|
13656
|
+
},
|
|
13657
|
+
type: "button",
|
|
13658
|
+
children: "Release back to agent"
|
|
13659
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV25("button", {
|
|
13660
|
+
onClick: handleTakeover,
|
|
13661
|
+
style: {
|
|
13662
|
+
background: "#ef4444",
|
|
13663
|
+
border: "none",
|
|
13664
|
+
borderRadius: 12,
|
|
13665
|
+
color: "#f8fafc",
|
|
13666
|
+
cursor: "pointer",
|
|
13667
|
+
fontSize: 13,
|
|
13668
|
+
padding: "8px 14px"
|
|
13669
|
+
},
|
|
13670
|
+
type: "button",
|
|
13671
|
+
children: takeoverButtonLabel
|
|
13672
|
+
}, undefined, false, undefined, this)
|
|
13673
|
+
}, undefined, false, undefined, this),
|
|
13674
|
+
/* @__PURE__ */ jsxDEV25("ol", {
|
|
13675
|
+
style: {
|
|
13676
|
+
display: "flex",
|
|
13677
|
+
flexDirection: "column",
|
|
13678
|
+
gap: 6,
|
|
13679
|
+
listStyle: "none",
|
|
13680
|
+
margin: 0,
|
|
13681
|
+
maxHeight: 260,
|
|
13682
|
+
overflowY: "auto",
|
|
13683
|
+
padding: 0
|
|
13684
|
+
},
|
|
13685
|
+
children: state.recentTimeline.map((event, index) => /* @__PURE__ */ jsxDEV25("li", {
|
|
13686
|
+
style: {
|
|
13687
|
+
alignItems: "center",
|
|
13688
|
+
display: "flex",
|
|
13689
|
+
fontSize: 13,
|
|
13690
|
+
gap: 12,
|
|
13691
|
+
paddingLeft: 8
|
|
13692
|
+
},
|
|
13693
|
+
children: [
|
|
13694
|
+
/* @__PURE__ */ jsxDEV25("strong", {
|
|
13695
|
+
children: event.title
|
|
13696
|
+
}, undefined, false, undefined, this),
|
|
13697
|
+
event.detail ? /* @__PURE__ */ jsxDEV25("span", {
|
|
13698
|
+
style: { opacity: 0.85 },
|
|
13699
|
+
children: event.detail
|
|
13700
|
+
}, undefined, false, undefined, this) : null
|
|
13701
|
+
]
|
|
13702
|
+
}, `${event.at}-${index}`, true, undefined, this))
|
|
13703
|
+
}, undefined, false, undefined, this)
|
|
13704
|
+
]
|
|
13705
|
+
}, undefined, true, undefined, this);
|
|
13706
|
+
};
|
|
13707
|
+
// src/react/VoiceLiveCallViewer.tsx
|
|
13708
|
+
import { useEffect as useEffect28, useMemo as useMemo4, useState as useState3 } from "react";
|
|
13709
|
+
import { jsxDEV as jsxDEV26 } from "react/jsx-dev-runtime";
|
|
13455
13710
|
var CATEGORY_COLOR = {
|
|
13456
13711
|
agent_audio: "#3b82f6",
|
|
13457
13712
|
agent_text: "#3b82f6",
|
|
@@ -13471,9 +13726,9 @@ var VoiceLiveCallViewer = ({
|
|
|
13471
13726
|
title,
|
|
13472
13727
|
viewer: viewerProp
|
|
13473
13728
|
}) => {
|
|
13474
|
-
const viewer =
|
|
13475
|
-
const [state, setState] =
|
|
13476
|
-
|
|
13729
|
+
const viewer = useMemo4(() => viewerProp ?? createLiveCallViewer({ sessionId: sessionId ?? "live" }), [viewerProp, sessionId]);
|
|
13730
|
+
const [state, setState] = useState3(() => viewer.getState());
|
|
13731
|
+
useEffect28(() => {
|
|
13477
13732
|
const unsubscribe = viewer.subscribe(() => {
|
|
13478
13733
|
setState(viewer.getState());
|
|
13479
13734
|
});
|
|
@@ -13481,7 +13736,7 @@ var VoiceLiveCallViewer = ({
|
|
|
13481
13736
|
unsubscribe();
|
|
13482
13737
|
};
|
|
13483
13738
|
}, [viewer]);
|
|
13484
|
-
return /* @__PURE__ */
|
|
13739
|
+
return /* @__PURE__ */ jsxDEV26("section", {
|
|
13485
13740
|
"aria-label": "voice-live-call-viewer",
|
|
13486
13741
|
className: className ?? "absolute-voice-live-call-viewer",
|
|
13487
13742
|
"data-agent-state": state.agentState,
|
|
@@ -13493,7 +13748,7 @@ var VoiceLiveCallViewer = ({
|
|
|
13493
13748
|
padding: 20
|
|
13494
13749
|
},
|
|
13495
13750
|
children: [
|
|
13496
|
-
/* @__PURE__ */
|
|
13751
|
+
/* @__PURE__ */ jsxDEV26("header", {
|
|
13497
13752
|
style: {
|
|
13498
13753
|
alignItems: "center",
|
|
13499
13754
|
display: "flex",
|
|
@@ -13501,11 +13756,11 @@ var VoiceLiveCallViewer = ({
|
|
|
13501
13756
|
marginBottom: 12
|
|
13502
13757
|
},
|
|
13503
13758
|
children: [
|
|
13504
|
-
/* @__PURE__ */
|
|
13759
|
+
/* @__PURE__ */ jsxDEV26("strong", {
|
|
13505
13760
|
style: { fontSize: 16 },
|
|
13506
13761
|
children: title ?? "Live call"
|
|
13507
13762
|
}, undefined, false, undefined, this),
|
|
13508
|
-
/* @__PURE__ */
|
|
13763
|
+
/* @__PURE__ */ jsxDEV26("span", {
|
|
13509
13764
|
style: {
|
|
13510
13765
|
background: "rgba(59,130,246,0.18)",
|
|
13511
13766
|
borderRadius: 999,
|
|
@@ -13515,7 +13770,7 @@ var VoiceLiveCallViewer = ({
|
|
|
13515
13770
|
},
|
|
13516
13771
|
children: state.agentState
|
|
13517
13772
|
}, undefined, false, undefined, this),
|
|
13518
|
-
/* @__PURE__ */
|
|
13773
|
+
/* @__PURE__ */ jsxDEV26("span", {
|
|
13519
13774
|
style: { fontSize: 13, marginLeft: "auto", opacity: 0.7 },
|
|
13520
13775
|
children: [
|
|
13521
13776
|
state.sessionId,
|
|
@@ -13525,7 +13780,7 @@ var VoiceLiveCallViewer = ({
|
|
|
13525
13780
|
}, undefined, true, undefined, this)
|
|
13526
13781
|
]
|
|
13527
13782
|
}, undefined, true, undefined, this),
|
|
13528
|
-
state.partialTranscript ? /* @__PURE__ */
|
|
13783
|
+
state.partialTranscript ? /* @__PURE__ */ jsxDEV26("p", {
|
|
13529
13784
|
style: {
|
|
13530
13785
|
background: "rgba(16,185,129,0.12)",
|
|
13531
13786
|
borderRadius: 12,
|
|
@@ -13540,7 +13795,7 @@ var VoiceLiveCallViewer = ({
|
|
|
13540
13795
|
"\u201D"
|
|
13541
13796
|
]
|
|
13542
13797
|
}, undefined, true, undefined, this) : null,
|
|
13543
|
-
/* @__PURE__ */
|
|
13798
|
+
/* @__PURE__ */ jsxDEV26("ol", {
|
|
13544
13799
|
style: {
|
|
13545
13800
|
display: "flex",
|
|
13546
13801
|
flexDirection: "column",
|
|
@@ -13551,7 +13806,7 @@ var VoiceLiveCallViewer = ({
|
|
|
13551
13806
|
overflowY: "auto",
|
|
13552
13807
|
padding: 0
|
|
13553
13808
|
},
|
|
13554
|
-
children: state.events.map((event, index) => /* @__PURE__ */
|
|
13809
|
+
children: state.events.map((event, index) => /* @__PURE__ */ jsxDEV26("li", {
|
|
13555
13810
|
style: {
|
|
13556
13811
|
alignItems: "center",
|
|
13557
13812
|
borderLeft: `3px solid ${CATEGORY_COLOR[event.kind] ?? "#94a3b8"}`,
|
|
@@ -13561,7 +13816,7 @@ var VoiceLiveCallViewer = ({
|
|
|
13561
13816
|
paddingLeft: 12
|
|
13562
13817
|
},
|
|
13563
13818
|
children: [
|
|
13564
|
-
/* @__PURE__ */
|
|
13819
|
+
/* @__PURE__ */ jsxDEV26("span", {
|
|
13565
13820
|
style: {
|
|
13566
13821
|
color: "#cbd5e1",
|
|
13567
13822
|
fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
@@ -13570,11 +13825,11 @@ var VoiceLiveCallViewer = ({
|
|
|
13570
13825
|
},
|
|
13571
13826
|
children: formatRelative(event.at - (state.events[0]?.at ?? event.at))
|
|
13572
13827
|
}, undefined, false, undefined, this),
|
|
13573
|
-
/* @__PURE__ */
|
|
13828
|
+
/* @__PURE__ */ jsxDEV26("strong", {
|
|
13574
13829
|
style: { fontSize: 13 },
|
|
13575
13830
|
children: event.title
|
|
13576
13831
|
}, undefined, false, undefined, this),
|
|
13577
|
-
event.detail ? /* @__PURE__ */
|
|
13832
|
+
event.detail ? /* @__PURE__ */ jsxDEV26("span", {
|
|
13578
13833
|
style: { opacity: 0.85 },
|
|
13579
13834
|
children: event.detail
|
|
13580
13835
|
}, undefined, false, undefined, this) : null
|
|
@@ -13636,7 +13891,7 @@ var buildReplayTimelineReport = (input) => {
|
|
|
13636
13891
|
};
|
|
13637
13892
|
|
|
13638
13893
|
// src/react/VoiceReplayTimeline.tsx
|
|
13639
|
-
import { jsxDEV as
|
|
13894
|
+
import { jsxDEV as jsxDEV27 } from "react/jsx-dev-runtime";
|
|
13640
13895
|
var CATEGORY_COLOR2 = {
|
|
13641
13896
|
agent: "#3b82f6",
|
|
13642
13897
|
lifecycle: "#94a3b8",
|
|
@@ -13655,7 +13910,7 @@ var VoiceReplayTimeline = ({
|
|
|
13655
13910
|
title
|
|
13656
13911
|
}) => {
|
|
13657
13912
|
const report = buildReplayTimelineReport({ artifact });
|
|
13658
|
-
return /* @__PURE__ */
|
|
13913
|
+
return /* @__PURE__ */ jsxDEV27("section", {
|
|
13659
13914
|
"aria-label": "voice-replay-timeline",
|
|
13660
13915
|
className: className ?? "absolute-voice-replay-timeline",
|
|
13661
13916
|
style: {
|
|
@@ -13666,7 +13921,7 @@ var VoiceReplayTimeline = ({
|
|
|
13666
13921
|
padding: 20
|
|
13667
13922
|
},
|
|
13668
13923
|
children: [
|
|
13669
|
-
/* @__PURE__ */
|
|
13924
|
+
/* @__PURE__ */ jsxDEV27("header", {
|
|
13670
13925
|
style: {
|
|
13671
13926
|
alignItems: "baseline",
|
|
13672
13927
|
display: "flex",
|
|
@@ -13674,11 +13929,11 @@ var VoiceReplayTimeline = ({
|
|
|
13674
13929
|
marginBottom: 12
|
|
13675
13930
|
},
|
|
13676
13931
|
children: [
|
|
13677
|
-
/* @__PURE__ */
|
|
13932
|
+
/* @__PURE__ */ jsxDEV27("strong", {
|
|
13678
13933
|
style: { fontSize: 16 },
|
|
13679
13934
|
children: title ?? report.metadata.title ?? "Replay"
|
|
13680
13935
|
}, undefined, false, undefined, this),
|
|
13681
|
-
/* @__PURE__ */
|
|
13936
|
+
/* @__PURE__ */ jsxDEV27("span", {
|
|
13682
13937
|
style: { fontSize: 13, opacity: 0.7 },
|
|
13683
13938
|
children: [
|
|
13684
13939
|
report.events.length,
|
|
@@ -13694,10 +13949,10 @@ var VoiceReplayTimeline = ({
|
|
|
13694
13949
|
}, undefined, true, undefined, this)
|
|
13695
13950
|
]
|
|
13696
13951
|
}, undefined, true, undefined, this),
|
|
13697
|
-
report.events.length === 0 ? /* @__PURE__ */
|
|
13952
|
+
report.events.length === 0 ? /* @__PURE__ */ jsxDEV27("p", {
|
|
13698
13953
|
style: { fontSize: 13, opacity: 0.7 },
|
|
13699
13954
|
children: "No timeline events."
|
|
13700
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
13955
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV27("ol", {
|
|
13701
13956
|
style: {
|
|
13702
13957
|
display: "flex",
|
|
13703
13958
|
flexDirection: "column",
|
|
@@ -13706,7 +13961,7 @@ var VoiceReplayTimeline = ({
|
|
|
13706
13961
|
margin: 0,
|
|
13707
13962
|
padding: 0
|
|
13708
13963
|
},
|
|
13709
|
-
children: report.events.map((event, index) => /* @__PURE__ */
|
|
13964
|
+
children: report.events.map((event, index) => /* @__PURE__ */ jsxDEV27("li", {
|
|
13710
13965
|
style: {
|
|
13711
13966
|
alignItems: "center",
|
|
13712
13967
|
borderLeft: `3px solid ${CATEGORY_COLOR2[event.category]}`,
|
|
@@ -13716,7 +13971,7 @@ var VoiceReplayTimeline = ({
|
|
|
13716
13971
|
paddingLeft: 12
|
|
13717
13972
|
},
|
|
13718
13973
|
children: [
|
|
13719
|
-
/* @__PURE__ */
|
|
13974
|
+
/* @__PURE__ */ jsxDEV27("span", {
|
|
13720
13975
|
style: {
|
|
13721
13976
|
color: "#cbd5e1",
|
|
13722
13977
|
fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
@@ -13725,11 +13980,11 @@ var VoiceReplayTimeline = ({
|
|
|
13725
13980
|
},
|
|
13726
13981
|
children: formatRelative2(event.at - report.startedAt)
|
|
13727
13982
|
}, undefined, false, undefined, this),
|
|
13728
|
-
/* @__PURE__ */
|
|
13983
|
+
/* @__PURE__ */ jsxDEV27("strong", {
|
|
13729
13984
|
style: { fontSize: 13 },
|
|
13730
13985
|
children: event.label
|
|
13731
13986
|
}, undefined, false, undefined, this),
|
|
13732
|
-
event.detail ? /* @__PURE__ */
|
|
13987
|
+
event.detail ? /* @__PURE__ */ jsxDEV27("span", {
|
|
13733
13988
|
style: { opacity: 0.85 },
|
|
13734
13989
|
children: event.detail
|
|
13735
13990
|
}, undefined, false, undefined, this) : null
|
|
@@ -13740,7 +13995,7 @@ var VoiceReplayTimeline = ({
|
|
|
13740
13995
|
}, undefined, true, undefined, this);
|
|
13741
13996
|
};
|
|
13742
13997
|
// src/react/useVoiceWorkflowStatus.tsx
|
|
13743
|
-
import { useEffect as
|
|
13998
|
+
import { useEffect as useEffect29, useRef as useRef28, useSyncExternalStore as useSyncExternalStore26 } from "react";
|
|
13744
13999
|
|
|
13745
14000
|
// src/client/workflowStatus.ts
|
|
13746
14001
|
var fetchVoiceWorkflowStatus = async (path = "/evals/scenarios/json", options = {}) => {
|
|
@@ -13828,7 +14083,7 @@ var useVoiceWorkflowStatus = (path = "/evals/scenarios/json", options = {}) => {
|
|
|
13828
14083
|
storeRef.current = createVoiceWorkflowStatusStore(path, options);
|
|
13829
14084
|
}
|
|
13830
14085
|
const store = storeRef.current;
|
|
13831
|
-
|
|
14086
|
+
useEffect29(() => {
|
|
13832
14087
|
store.refresh().catch(() => {});
|
|
13833
14088
|
return () => store.close();
|
|
13834
14089
|
}, [store]);
|
|
@@ -13885,6 +14140,7 @@ export {
|
|
|
13885
14140
|
VoiceOpsStatus,
|
|
13886
14141
|
VoiceOpsActionCenter,
|
|
13887
14142
|
VoiceLiveCallViewer,
|
|
14143
|
+
VoiceLiveAgentConsole,
|
|
13888
14144
|
VoiceDeliveryRuntime,
|
|
13889
14145
|
VoiceCostDashboard,
|
|
13890
14146
|
VoiceCallPlayer,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type CreateLiveAgentConsoleOptions, type LiveAgentConsoleState } from "../client/liveAgentConsole";
|
|
2
|
+
export type CreateVoiceLiveAgentConsoleSvelteOptions = CreateLiveAgentConsoleOptions & {
|
|
3
|
+
takeoverButtonLabel?: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const renderVoiceLiveAgentConsoleHTML: (state: LiveAgentConsoleState, options?: {
|
|
7
|
+
takeoverButtonLabel?: string;
|
|
8
|
+
title?: string;
|
|
9
|
+
}) => string;
|
|
10
|
+
export declare const createVoiceLiveAgentConsole: (options: CreateVoiceLiveAgentConsoleSvelteOptions) => {
|
|
11
|
+
getHTML: () => string;
|
|
12
|
+
takeoverButtonLabel: string;
|
|
13
|
+
title: string;
|
|
14
|
+
getState: () => LiveAgentConsoleState;
|
|
15
|
+
noteAgentAudio: (at?: number) => void;
|
|
16
|
+
notePartial: (text: string, at?: number) => void;
|
|
17
|
+
noteTranscript: (text: string, at?: number) => void;
|
|
18
|
+
releaseTakeover: () => void;
|
|
19
|
+
setCaller: (caller: import("..").VoiceCallerMemorySnapshot | undefined) => void;
|
|
20
|
+
subscribe: (listener: () => void) => () => void;
|
|
21
|
+
takeover: (reason?: string) => void;
|
|
22
|
+
viewer: import("..").LiveCallViewer;
|
|
23
|
+
};
|
package/dist/svelte/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export { createVoiceWidget } from "./createVoiceWidget";
|
|
|
5
5
|
export type { CreateVoiceWidgetOptions, VoiceWidgetLabels, VoiceWidgetTheme, VoiceWidgetViewModel, } from "./createVoiceWidget";
|
|
6
6
|
export { createVoiceCostDashboard, renderVoiceCostDashboardHTML, } from "./createVoiceCostDashboard";
|
|
7
7
|
export type { CreateVoiceCostDashboardOptions } from "./createVoiceCostDashboard";
|
|
8
|
+
export { createVoiceLiveAgentConsole, renderVoiceLiveAgentConsoleHTML, } from "./createVoiceLiveAgentConsole";
|
|
9
|
+
export type { CreateVoiceLiveAgentConsoleSvelteOptions } from "./createVoiceLiveAgentConsole";
|
|
8
10
|
export { createVoiceLiveCallViewer, renderVoiceLiveCallViewerHTML, } from "./createVoiceLiveCallViewer";
|
|
9
11
|
export type { CreateVoiceLiveCallViewerSvelteOptions } from "./createVoiceLiveCallViewer";
|
|
10
12
|
export { createVoiceReplayTimeline, renderVoiceReplayTimelineHTML, } from "./createVoiceReplayTimeline";
|