@skippr/live-agent-sdk 0.72.0 → 0.73.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/dist/esm/lib-exports.js
CHANGED
|
@@ -50,6 +50,28 @@ function useAgentCursor() {
|
|
|
50
50
|
|
|
51
51
|
// src/context/LiveAgentContext.tsx
|
|
52
52
|
import { createContext } from "react";
|
|
53
|
+
|
|
54
|
+
// src/lib/constants.ts
|
|
55
|
+
var SIDEBAR_WIDTH = 280;
|
|
56
|
+
var CAPTURE_MODE = {
|
|
57
|
+
Screenshare: "screenshare",
|
|
58
|
+
Auto: "auto"
|
|
59
|
+
};
|
|
60
|
+
var DEFAULT_CAPTURE_MODE = CAPTURE_MODE.Auto;
|
|
61
|
+
var WIDGET_ROOT_ID = "skippr-sdk-root";
|
|
62
|
+
var REF_ATTR = "data-skippr-ref";
|
|
63
|
+
var PRIVATE_ATTR = "data-skippr-private";
|
|
64
|
+
var DOM_SNAPSHOT_TOPIC = "skippr.dom-snapshot";
|
|
65
|
+
var DOM_EVENTS_TOPIC = "skippr.dom-events";
|
|
66
|
+
var HIGHLIGHT_TOPIC = "skippr.highlight";
|
|
67
|
+
var PAGE_ACTIONS_TOPIC = "skippr.page-actions";
|
|
68
|
+
var TEXT_MODE_TOPIC = "skippr.text-mode";
|
|
69
|
+
var ACTION_CONTROL_TOPIC = "skippr.action-control";
|
|
70
|
+
var SESSION_HOLD_TOPIC = "skippr.session-hold";
|
|
71
|
+
var PLAN_ATTR = "skippr.action-plan";
|
|
72
|
+
var NAME_MAX_CHARS = 80;
|
|
73
|
+
|
|
74
|
+
// src/context/LiveAgentContext.tsx
|
|
53
75
|
var LiveAgentContext = createContext(null);
|
|
54
76
|
|
|
55
77
|
// src/hooks/useAdoptionGoals.ts
|
|
@@ -415,21 +437,6 @@ function useLiveAgent() {
|
|
|
415
437
|
// src/hooks/usePlanUpdates.ts
|
|
416
438
|
import { useCallback as useCallback4 } from "react";
|
|
417
439
|
|
|
418
|
-
// src/lib/constants.ts
|
|
419
|
-
var SIDEBAR_WIDTH = 280;
|
|
420
|
-
var WIDGET_ROOT_ID = "skippr-sdk-root";
|
|
421
|
-
var REF_ATTR = "data-skippr-ref";
|
|
422
|
-
var PRIVATE_ATTR = "data-skippr-private";
|
|
423
|
-
var DOM_SNAPSHOT_TOPIC = "skippr.dom-snapshot";
|
|
424
|
-
var DOM_EVENTS_TOPIC = "skippr.dom-events";
|
|
425
|
-
var HIGHLIGHT_TOPIC = "skippr.highlight";
|
|
426
|
-
var PAGE_ACTIONS_TOPIC = "skippr.page-actions";
|
|
427
|
-
var TEXT_MODE_TOPIC = "skippr.text-mode";
|
|
428
|
-
var ACTION_CONTROL_TOPIC = "skippr.action-control";
|
|
429
|
-
var SESSION_HOLD_TOPIC = "skippr.session-hold";
|
|
430
|
-
var PLAN_ATTR = "skippr.action-plan";
|
|
431
|
-
var NAME_MAX_CHARS = 80;
|
|
432
|
-
|
|
433
440
|
// src/hooks/useAgentState.ts
|
|
434
441
|
import { useRemoteParticipants } from "@livekit/components-react/hooks";
|
|
435
442
|
import { useEffect as useEffect5, useState as useState5 } from "react";
|
|
@@ -536,7 +543,7 @@ async function exchangeForBearerToken(appKey, userToken) {
|
|
|
536
543
|
return { token, expiresAt: new Date(expiresAt).getTime() };
|
|
537
544
|
}
|
|
538
545
|
function useSession({
|
|
539
|
-
captureMode =
|
|
546
|
+
captureMode = DEFAULT_CAPTURE_MODE,
|
|
540
547
|
authToken,
|
|
541
548
|
appKey,
|
|
542
549
|
getUserToken,
|
|
@@ -689,7 +696,7 @@ function useSession({
|
|
|
689
696
|
setErrorCode(null);
|
|
690
697
|
onStart?.();
|
|
691
698
|
let screenStream = null;
|
|
692
|
-
if (captureMode ===
|
|
699
|
+
if (captureMode === CAPTURE_MODE.Screenshare) {
|
|
693
700
|
screenStream = await requestScreenShare();
|
|
694
701
|
}
|
|
695
702
|
const enabledControls = {};
|
|
@@ -3933,8 +3940,8 @@ function SessionControlBar() {
|
|
|
3933
3940
|
}, [isHeld, minimizePanel]);
|
|
3934
3941
|
const isReady = state === "listening" || state === "thinking" || state === "speaking";
|
|
3935
3942
|
const { barRefs, isTalking } = useMicLevel(isReady && !isMuted && !textMode && !isHeld);
|
|
3936
|
-
const showScreenShareToggle = captureMode ===
|
|
3937
|
-
const showActionControl = captureMode ===
|
|
3943
|
+
const showScreenShareToggle = captureMode === CAPTURE_MODE.Screenshare;
|
|
3944
|
+
const showActionControl = captureMode === CAPTURE_MODE.Auto && actionsActive;
|
|
3938
3945
|
const screenShareExtra = showScreenShareToggle ? SCREEN_SHARE_EXTRA_WIDTH : 0;
|
|
3939
3946
|
const actionControlExtra = showActionControl ? ACTION_CONTROL_EXTRA_WIDTH : 0;
|
|
3940
3947
|
let barWidth = STANDBY_BAR_WIDTH;
|
|
@@ -5617,10 +5624,10 @@ function LiveAgent(props) {
|
|
|
5617
5624
|
animateAgentCursor = false,
|
|
5618
5625
|
children
|
|
5619
5626
|
} = props;
|
|
5620
|
-
const captureMode = props.captureMode ??
|
|
5627
|
+
const captureMode = props.captureMode ?? DEFAULT_CAPTURE_MODE;
|
|
5621
5628
|
let hostAgentControls;
|
|
5622
5629
|
if ("agentControls" in props && props.agentControls) {
|
|
5623
|
-
if (captureMode ===
|
|
5630
|
+
if (captureMode === CAPTURE_MODE.Auto) {
|
|
5624
5631
|
hostAgentControls = props.agentControls;
|
|
5625
5632
|
} else {
|
|
5626
5633
|
console.warn('[Skippr] agentControls requires captureMode: "auto"');
|
|
@@ -5962,16 +5969,16 @@ function LiveAgent(props) {
|
|
|
5962
5969
|
onDisconnected: handleRoomDisconnected,
|
|
5963
5970
|
children: [
|
|
5964
5971
|
connection && !textMode && /* @__PURE__ */ jsx22(RoomAudioRenderer, {}),
|
|
5965
|
-
connection && captureMode ===
|
|
5972
|
+
connection && captureMode === CAPTURE_MODE.Screenshare && /* @__PURE__ */ jsx22(AutoStartMedia, {
|
|
5966
5973
|
pendingScreenStream
|
|
5967
5974
|
}),
|
|
5968
|
-
connection && captureMode ===
|
|
5975
|
+
connection && captureMode === CAPTURE_MODE.Auto && /* @__PURE__ */ jsx22(DomCapture, {}),
|
|
5969
5976
|
/* @__PURE__ */ jsxs19(ShadowHost, {
|
|
5970
5977
|
children: [
|
|
5971
|
-
connection && captureMode ===
|
|
5972
|
-
connection && captureMode ===
|
|
5973
|
-
connection && captureMode ===
|
|
5974
|
-
connection && captureMode ===
|
|
5978
|
+
connection && captureMode === CAPTURE_MODE.Auto && agentControls?.highlight && /* @__PURE__ */ jsx22(HighlightOverlay, {}),
|
|
5979
|
+
connection && captureMode === CAPTURE_MODE.Auto && agentControls?.actions && /* @__PURE__ */ jsx22(PageActionHandler, {}),
|
|
5980
|
+
connection && captureMode === CAPTURE_MODE.Auto && agentControls?.actions && /* @__PURE__ */ jsx22(PlanPanelOpener, {}),
|
|
5981
|
+
connection && captureMode === CAPTURE_MODE.Auto && (agentControls?.highlight || agentControls?.actions) && /* @__PURE__ */ jsx22(AgentCursorMount, {
|
|
5975
5982
|
animated: shouldAnimateCursor
|
|
5976
5983
|
}),
|
|
5977
5984
|
/* @__PURE__ */ jsxs19("div", {
|