@skippr/live-agent-sdk 0.37.0 → 0.38.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 +77 -38
- package/dist/skippr-sdk.js +78 -78
- package/dist/types/lib/session.d.ts +2 -0
- package/package.json +1 -1
package/dist/esm/lib-exports.js
CHANGED
|
@@ -549,7 +549,7 @@ function getResumableSessionId(currentSession, mode) {
|
|
|
549
549
|
const { id, status } = currentSession;
|
|
550
550
|
if (status === "paused" || status === "active")
|
|
551
551
|
return id;
|
|
552
|
-
if (status === "expired"
|
|
552
|
+
if (mode === "always_on" && (status === "expired" || status === "completed"))
|
|
553
553
|
return id;
|
|
554
554
|
return;
|
|
555
555
|
}
|
|
@@ -562,6 +562,20 @@ function getResumableSession(module) {
|
|
|
562
562
|
const id = getResumableSessionId(module.currentSession, module.mode);
|
|
563
563
|
return id ? { id, agentId: module.id } : null;
|
|
564
564
|
}
|
|
565
|
+
function getModuleSessionState(currentSession, mode) {
|
|
566
|
+
if (!currentSession)
|
|
567
|
+
return null;
|
|
568
|
+
if (canResumeSession(currentSession, mode))
|
|
569
|
+
return "resume";
|
|
570
|
+
if (mode === "standard") {
|
|
571
|
+
const { status } = currentSession;
|
|
572
|
+
if (status === "completed")
|
|
573
|
+
return "completed";
|
|
574
|
+
if (status === "expired")
|
|
575
|
+
return "expired";
|
|
576
|
+
}
|
|
577
|
+
return null;
|
|
578
|
+
}
|
|
565
579
|
|
|
566
580
|
// src/components/AutoStartMedia.tsx
|
|
567
581
|
import { useConnectionState, useLocalParticipant } from "@livekit/components-react/hooks";
|
|
@@ -1585,8 +1599,14 @@ var ChevronDown = createLucideIcon("chevron-down", __iconNode7);
|
|
|
1585
1599
|
// ../../node_modules/.bun/lucide-react@1.8.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/circle.js
|
|
1586
1600
|
var __iconNode8 = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]];
|
|
1587
1601
|
var Circle = createLucideIcon("circle", __iconNode8);
|
|
1588
|
-
// ../../node_modules/.bun/lucide-react@1.8.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/
|
|
1602
|
+
// ../../node_modules/.bun/lucide-react@1.8.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/clock.js
|
|
1589
1603
|
var __iconNode9 = [
|
|
1604
|
+
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
1605
|
+
["path", { d: "M12 6v6l4 2", key: "mmk7yg" }]
|
|
1606
|
+
];
|
|
1607
|
+
var Clock = createLucideIcon("clock", __iconNode9);
|
|
1608
|
+
// ../../node_modules/.bun/lucide-react@1.8.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/graduation-cap.js
|
|
1609
|
+
var __iconNode10 = [
|
|
1590
1610
|
[
|
|
1591
1611
|
"path",
|
|
1592
1612
|
{
|
|
@@ -1597,9 +1617,9 @@ var __iconNode9 = [
|
|
|
1597
1617
|
["path", { d: "M22 10v6", key: "1lu8f3" }],
|
|
1598
1618
|
["path", { d: "M6 12.5V16a6 3 0 0 0 12 0v-3.5", key: "1r8lef" }]
|
|
1599
1619
|
];
|
|
1600
|
-
var GraduationCap = createLucideIcon("graduation-cap",
|
|
1620
|
+
var GraduationCap = createLucideIcon("graduation-cap", __iconNode10);
|
|
1601
1621
|
// ../../node_modules/.bun/lucide-react@1.8.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/headset.js
|
|
1602
|
-
var
|
|
1622
|
+
var __iconNode11 = [
|
|
1603
1623
|
[
|
|
1604
1624
|
"path",
|
|
1605
1625
|
{
|
|
@@ -1609,15 +1629,15 @@ var __iconNode10 = [
|
|
|
1609
1629
|
],
|
|
1610
1630
|
["path", { d: "M21 16v2a4 4 0 0 1-4 4h-5", key: "1x7m43" }]
|
|
1611
1631
|
];
|
|
1612
|
-
var Headset = createLucideIcon("headset",
|
|
1632
|
+
var Headset = createLucideIcon("headset", __iconNode11);
|
|
1613
1633
|
// ../../node_modules/.bun/lucide-react@1.8.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/mail.js
|
|
1614
|
-
var
|
|
1634
|
+
var __iconNode12 = [
|
|
1615
1635
|
["path", { d: "m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7", key: "132q7q" }],
|
|
1616
1636
|
["rect", { x: "2", y: "4", width: "20", height: "16", rx: "2", key: "izxlao" }]
|
|
1617
1637
|
];
|
|
1618
|
-
var Mail = createLucideIcon("mail",
|
|
1638
|
+
var Mail = createLucideIcon("mail", __iconNode12);
|
|
1619
1639
|
// ../../node_modules/.bun/lucide-react@1.8.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/message-circle.js
|
|
1620
|
-
var
|
|
1640
|
+
var __iconNode13 = [
|
|
1621
1641
|
[
|
|
1622
1642
|
"path",
|
|
1623
1643
|
{
|
|
@@ -1626,9 +1646,9 @@ var __iconNode12 = [
|
|
|
1626
1646
|
}
|
|
1627
1647
|
]
|
|
1628
1648
|
];
|
|
1629
|
-
var MessageCircle = createLucideIcon("message-circle",
|
|
1649
|
+
var MessageCircle = createLucideIcon("message-circle", __iconNode13);
|
|
1630
1650
|
// ../../node_modules/.bun/lucide-react@1.8.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/message-square.js
|
|
1631
|
-
var
|
|
1651
|
+
var __iconNode14 = [
|
|
1632
1652
|
[
|
|
1633
1653
|
"path",
|
|
1634
1654
|
{
|
|
@@ -1637,9 +1657,9 @@ var __iconNode13 = [
|
|
|
1637
1657
|
}
|
|
1638
1658
|
]
|
|
1639
1659
|
];
|
|
1640
|
-
var MessageSquare = createLucideIcon("message-square",
|
|
1660
|
+
var MessageSquare = createLucideIcon("message-square", __iconNode14);
|
|
1641
1661
|
// ../../node_modules/.bun/lucide-react@1.8.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/mic-off.js
|
|
1642
|
-
var
|
|
1662
|
+
var __iconNode15 = [
|
|
1643
1663
|
["path", { d: "M12 19v3", key: "npa21l" }],
|
|
1644
1664
|
["path", { d: "M15 9.34V5a3 3 0 0 0-5.68-1.33", key: "1gzdoj" }],
|
|
1645
1665
|
["path", { d: "M16.95 16.95A7 7 0 0 1 5 12v-2", key: "cqa7eg" }],
|
|
@@ -1647,40 +1667,40 @@ var __iconNode14 = [
|
|
|
1647
1667
|
["path", { d: "m2 2 20 20", key: "1ooewy" }],
|
|
1648
1668
|
["path", { d: "M9 9v3a3 3 0 0 0 5.12 2.12", key: "r2i35w" }]
|
|
1649
1669
|
];
|
|
1650
|
-
var MicOff = createLucideIcon("mic-off",
|
|
1670
|
+
var MicOff = createLucideIcon("mic-off", __iconNode15);
|
|
1651
1671
|
// ../../node_modules/.bun/lucide-react@1.8.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/mic.js
|
|
1652
|
-
var
|
|
1672
|
+
var __iconNode16 = [
|
|
1653
1673
|
["path", { d: "M12 19v3", key: "npa21l" }],
|
|
1654
1674
|
["path", { d: "M19 10v2a7 7 0 0 1-14 0v-2", key: "1vc78b" }],
|
|
1655
1675
|
["rect", { x: "9", y: "2", width: "6", height: "13", rx: "3", key: "s6n7sd" }]
|
|
1656
1676
|
];
|
|
1657
|
-
var Mic = createLucideIcon("mic",
|
|
1677
|
+
var Mic = createLucideIcon("mic", __iconNode16);
|
|
1658
1678
|
// ../../node_modules/.bun/lucide-react@1.8.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/minimize-2.js
|
|
1659
|
-
var
|
|
1679
|
+
var __iconNode17 = [
|
|
1660
1680
|
["path", { d: "m14 10 7-7", key: "oa77jy" }],
|
|
1661
1681
|
["path", { d: "M20 10h-6V4", key: "mjg0md" }],
|
|
1662
1682
|
["path", { d: "m3 21 7-7", key: "tjx5ai" }],
|
|
1663
1683
|
["path", { d: "M4 14h6v6", key: "rmj7iw" }]
|
|
1664
1684
|
];
|
|
1665
|
-
var Minimize2 = createLucideIcon("minimize-2",
|
|
1685
|
+
var Minimize2 = createLucideIcon("minimize-2", __iconNode17);
|
|
1666
1686
|
// ../../node_modules/.bun/lucide-react@1.8.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/monitor-off.js
|
|
1667
|
-
var
|
|
1687
|
+
var __iconNode18 = [
|
|
1668
1688
|
["path", { d: "M12 17v4", key: "1riwvh" }],
|
|
1669
1689
|
["path", { d: "M17 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 1.184-1.826", key: "cv7jms" }],
|
|
1670
1690
|
["path", { d: "m2 2 20 20", key: "1ooewy" }],
|
|
1671
1691
|
["path", { d: "M8 21h8", key: "1ev6f3" }],
|
|
1672
1692
|
["path", { d: "M8.656 3H20a2 2 0 0 1 2 2v10a2 2 0 0 1-.293 1.042", key: "z8ni2w" }]
|
|
1673
1693
|
];
|
|
1674
|
-
var MonitorOff = createLucideIcon("monitor-off",
|
|
1694
|
+
var MonitorOff = createLucideIcon("monitor-off", __iconNode18);
|
|
1675
1695
|
// ../../node_modules/.bun/lucide-react@1.8.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/monitor.js
|
|
1676
|
-
var
|
|
1696
|
+
var __iconNode19 = [
|
|
1677
1697
|
["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
|
|
1678
1698
|
["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
|
|
1679
1699
|
["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
|
|
1680
1700
|
];
|
|
1681
|
-
var Monitor = createLucideIcon("monitor",
|
|
1701
|
+
var Monitor = createLucideIcon("monitor", __iconNode19);
|
|
1682
1702
|
// ../../node_modules/.bun/lucide-react@1.8.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/mouse-pointer-2.js
|
|
1683
|
-
var
|
|
1703
|
+
var __iconNode20 = [
|
|
1684
1704
|
[
|
|
1685
1705
|
"path",
|
|
1686
1706
|
{
|
|
@@ -1689,15 +1709,15 @@ var __iconNode19 = [
|
|
|
1689
1709
|
}
|
|
1690
1710
|
]
|
|
1691
1711
|
];
|
|
1692
|
-
var MousePointer2 = createLucideIcon("mouse-pointer-2",
|
|
1712
|
+
var MousePointer2 = createLucideIcon("mouse-pointer-2", __iconNode20);
|
|
1693
1713
|
// ../../node_modules/.bun/lucide-react@1.8.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/pause.js
|
|
1694
|
-
var
|
|
1714
|
+
var __iconNode21 = [
|
|
1695
1715
|
["rect", { x: "14", y: "3", width: "5", height: "18", rx: "1", key: "kaeet6" }],
|
|
1696
1716
|
["rect", { x: "5", y: "3", width: "5", height: "18", rx: "1", key: "1wsw3u" }]
|
|
1697
1717
|
];
|
|
1698
|
-
var Pause = createLucideIcon("pause",
|
|
1718
|
+
var Pause = createLucideIcon("pause", __iconNode21);
|
|
1699
1719
|
// ../../node_modules/.bun/lucide-react@1.8.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/phone-off.js
|
|
1700
|
-
var
|
|
1720
|
+
var __iconNode22 = [
|
|
1701
1721
|
[
|
|
1702
1722
|
"path",
|
|
1703
1723
|
{
|
|
@@ -1714,9 +1734,9 @@ var __iconNode21 = [
|
|
|
1714
1734
|
}
|
|
1715
1735
|
]
|
|
1716
1736
|
];
|
|
1717
|
-
var PhoneOff = createLucideIcon("phone-off",
|
|
1737
|
+
var PhoneOff = createLucideIcon("phone-off", __iconNode22);
|
|
1718
1738
|
// ../../node_modules/.bun/lucide-react@1.8.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/play.js
|
|
1719
|
-
var
|
|
1739
|
+
var __iconNode23 = [
|
|
1720
1740
|
[
|
|
1721
1741
|
"path",
|
|
1722
1742
|
{
|
|
@@ -1725,9 +1745,9 @@ var __iconNode22 = [
|
|
|
1725
1745
|
}
|
|
1726
1746
|
]
|
|
1727
1747
|
];
|
|
1728
|
-
var Play = createLucideIcon("play",
|
|
1748
|
+
var Play = createLucideIcon("play", __iconNode23);
|
|
1729
1749
|
// ../../node_modules/.bun/lucide-react@1.8.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/rocket.js
|
|
1730
|
-
var
|
|
1750
|
+
var __iconNode24 = [
|
|
1731
1751
|
["path", { d: "M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5", key: "qeys4" }],
|
|
1732
1752
|
[
|
|
1733
1753
|
"path",
|
|
@@ -1745,9 +1765,9 @@ var __iconNode23 = [
|
|
|
1745
1765
|
],
|
|
1746
1766
|
["path", { d: "M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05", key: "92ym6u" }]
|
|
1747
1767
|
];
|
|
1748
|
-
var Rocket = createLucideIcon("rocket",
|
|
1768
|
+
var Rocket = createLucideIcon("rocket", __iconNode24);
|
|
1749
1769
|
// ../../node_modules/.bun/lucide-react@1.8.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/send.js
|
|
1750
|
-
var
|
|
1770
|
+
var __iconNode25 = [
|
|
1751
1771
|
[
|
|
1752
1772
|
"path",
|
|
1753
1773
|
{
|
|
@@ -1757,15 +1777,15 @@ var __iconNode24 = [
|
|
|
1757
1777
|
],
|
|
1758
1778
|
["path", { d: "m21.854 2.147-10.94 10.939", key: "12cjpa" }]
|
|
1759
1779
|
];
|
|
1760
|
-
var Send = createLucideIcon("send",
|
|
1780
|
+
var Send = createLucideIcon("send", __iconNode25);
|
|
1761
1781
|
// ../../node_modules/.bun/lucide-react@1.8.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/user-plus.js
|
|
1762
|
-
var
|
|
1782
|
+
var __iconNode26 = [
|
|
1763
1783
|
["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
|
|
1764
1784
|
["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
|
|
1765
1785
|
["line", { x1: "19", x2: "19", y1: "8", y2: "14", key: "1bvyxn" }],
|
|
1766
1786
|
["line", { x1: "22", x2: "16", y1: "11", y2: "11", key: "1shjgl" }]
|
|
1767
1787
|
];
|
|
1768
|
-
var UserPlus = createLucideIcon("user-plus",
|
|
1788
|
+
var UserPlus = createLucideIcon("user-plus", __iconNode26);
|
|
1769
1789
|
// src/components/HighlightOverlay.tsx
|
|
1770
1790
|
import { useCallback as useCallback4, useEffect as useEffect6, useRef as useRef4, useState as useState4 } from "react";
|
|
1771
1791
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -3430,14 +3450,15 @@ function ModuleSelector() {
|
|
|
3430
3450
|
const isFeatured = index2 === 0;
|
|
3431
3451
|
const isWide = index2 === availableModules.length - 1 && availableModules.length % 2 === 1;
|
|
3432
3452
|
const Icon2 = getAgentIcon(module.type);
|
|
3433
|
-
const
|
|
3453
|
+
const sessionState = getModuleSessionState(module.currentSession, module.mode);
|
|
3454
|
+
const isTerminal = sessionState === "completed" || sessionState === "expired";
|
|
3434
3455
|
const base = "skippr:group skippr:flex skippr:cursor-pointer skippr:gap-3 skippr:rounded-xl skippr:text-left skippr:transition-colors skippr:disabled:cursor-not-allowed skippr:disabled:opacity-50";
|
|
3435
3456
|
const layout = isWide ? "skippr:items-center skippr:p-3.5 skippr:pb-5" : "skippr:flex-col skippr:items-start skippr:p-3.5";
|
|
3436
3457
|
const variant = isFeatured ? "skippr:bg-primary skippr:text-primary-foreground skippr:hover:bg-primary/90" : "skippr:bg-background skippr:ring-1 skippr:ring-foreground/10 skippr:hover:bg-muted/50";
|
|
3437
3458
|
const span = isWide ? "skippr:col-span-2" : "";
|
|
3438
3459
|
return /* @__PURE__ */ jsxs13("button", {
|
|
3439
3460
|
type: "button",
|
|
3440
|
-
disabled: isBusy,
|
|
3461
|
+
disabled: isBusy || isTerminal,
|
|
3441
3462
|
onClick: () => selectModule(module.id),
|
|
3442
3463
|
className: `${base} ${layout} ${variant} ${span}`,
|
|
3443
3464
|
children: [
|
|
@@ -3457,7 +3478,7 @@ function ModuleSelector() {
|
|
|
3457
3478
|
className: "skippr:line-clamp-1 skippr:text-sm skippr:font-semibold",
|
|
3458
3479
|
children: module.name
|
|
3459
3480
|
}),
|
|
3460
|
-
|
|
3481
|
+
sessionState === "resume" && /* @__PURE__ */ jsxs13("span", {
|
|
3461
3482
|
className: `skippr:inline-flex skippr:shrink-0 skippr:items-center skippr:gap-0.5 skippr:rounded-full skippr:px-1.5 skippr:py-0.5 skippr:text-[9px] skippr:font-medium skippr:uppercase skippr:tracking-wide ${isFeatured ? "skippr:bg-primary-foreground/20 skippr:text-primary-foreground" : "skippr:bg-bubble/15 skippr:text-bubble"}`,
|
|
3462
3483
|
children: [
|
|
3463
3484
|
/* @__PURE__ */ jsx14(Play, {
|
|
@@ -3465,6 +3486,24 @@ function ModuleSelector() {
|
|
|
3465
3486
|
}),
|
|
3466
3487
|
"Resume"
|
|
3467
3488
|
]
|
|
3489
|
+
}),
|
|
3490
|
+
sessionState === "completed" && /* @__PURE__ */ jsxs13("span", {
|
|
3491
|
+
className: "skippr:inline-flex skippr:shrink-0 skippr:items-center skippr:gap-0.5 skippr:rounded-full skippr:bg-muted skippr:px-1.5 skippr:py-0.5 skippr:text-[9px] skippr:font-medium skippr:uppercase skippr:tracking-wide skippr:text-muted-foreground",
|
|
3492
|
+
children: [
|
|
3493
|
+
/* @__PURE__ */ jsx14(CircleCheck, {
|
|
3494
|
+
className: "skippr:size-2.5"
|
|
3495
|
+
}),
|
|
3496
|
+
"Completed"
|
|
3497
|
+
]
|
|
3498
|
+
}),
|
|
3499
|
+
sessionState === "expired" && /* @__PURE__ */ jsxs13("span", {
|
|
3500
|
+
className: "skippr:inline-flex skippr:shrink-0 skippr:items-center skippr:gap-0.5 skippr:rounded-full skippr:bg-muted skippr:px-1.5 skippr:py-0.5 skippr:text-[9px] skippr:font-medium skippr:uppercase skippr:tracking-wide skippr:text-muted-foreground",
|
|
3501
|
+
children: [
|
|
3502
|
+
/* @__PURE__ */ jsx14(Clock, {
|
|
3503
|
+
className: "skippr:size-2.5"
|
|
3504
|
+
}),
|
|
3505
|
+
"Expired"
|
|
3506
|
+
]
|
|
3468
3507
|
})
|
|
3469
3508
|
]
|
|
3470
3509
|
}),
|