@skippr/live-agent-sdk 0.1.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/LICENSE +7 -0
- package/README.md +95 -0
- package/dist/esm/lib-exports.js +710 -0
- package/dist/skippr-sdk.css +2 -0
- package/dist/skippr-sdk.js +275 -0
- package/dist/types/components/ChatHeader.d.ts +5 -0
- package/dist/types/components/ChatMessage.d.ts +6 -0
- package/dist/types/components/LiveAgent.d.ts +9 -0
- package/dist/types/components/MeetingControls.d.ts +5 -0
- package/dist/types/components/MessageList.d.ts +7 -0
- package/dist/types/components/QuickActions.d.ts +7 -0
- package/dist/types/components/SessionAgenda.d.ts +8 -0
- package/dist/types/components/Sidebar.d.ts +1 -0
- package/dist/types/components/SidebarTrigger.d.ts +1 -0
- package/dist/types/components/TypingIndicator.d.ts +1 -0
- package/dist/types/components/ui/button.d.ts +9 -0
- package/dist/types/context/LiveAgentContext.d.ts +19 -0
- package/dist/types/hooks/useAgentState.d.ts +1 -0
- package/dist/types/hooks/useLiveAgent.d.ts +2 -0
- package/dist/types/hooks/usePhaseUpdates.d.ts +8 -0
- package/dist/types/hooks/useQuestionUpdates.d.ts +11 -0
- package/dist/types/hooks/useSession.d.ts +17 -0
- package/dist/types/hooks/useTranscriptMessages.d.ts +6 -0
- package/dist/types/lib/constants.d.ts +1 -0
- package/dist/types/lib/format.d.ts +1 -0
- package/dist/types/lib/utils.d.ts +2 -0
- package/dist/types/lib-exports.d.ts +2 -0
- package/dist/types/types.d.ts +5 -0
- package/package.json +66 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
interface LiveAgentProps {
|
|
3
|
+
organizationId: string;
|
|
4
|
+
agentId: string;
|
|
5
|
+
defaultOpen?: boolean;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare function LiveAgent({ organizationId, agentId, defaultOpen, children, }: LiveAgentProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PhaseStatus } from '../hooks/usePhaseUpdates';
|
|
2
|
+
import type { QuestionStatus } from '../hooks/useQuestionUpdates';
|
|
3
|
+
interface SessionAgendaProps {
|
|
4
|
+
phases: PhaseStatus[];
|
|
5
|
+
questions?: QuestionStatus[];
|
|
6
|
+
}
|
|
7
|
+
export declare function SessionAgenda({ phases, questions }: SessionAgendaProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Sidebar(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function SidebarTrigger(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function TypingIndicator(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes } from 'react';
|
|
2
|
+
type ButtonVariant = 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost';
|
|
3
|
+
type ButtonSize = 'default' | 'xs' | 'sm' | 'lg' | 'icon' | 'icon-xs' | 'icon-sm' | 'icon-lg';
|
|
4
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
|
+
variant?: ButtonVariant;
|
|
6
|
+
size?: ButtonSize;
|
|
7
|
+
}
|
|
8
|
+
declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
export { Button, type ButtonProps };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface LiveAgentPublicValue {
|
|
2
|
+
isConnected: boolean;
|
|
3
|
+
isStarting: boolean;
|
|
4
|
+
error: string;
|
|
5
|
+
startSession: () => Promise<void>;
|
|
6
|
+
disconnect: () => Promise<void>;
|
|
7
|
+
isPanelOpen: boolean;
|
|
8
|
+
openPanel: () => void;
|
|
9
|
+
closePanel: () => void;
|
|
10
|
+
togglePanel: () => void;
|
|
11
|
+
}
|
|
12
|
+
export interface LiveAgentContextValue extends LiveAgentPublicValue {
|
|
13
|
+
connection: {
|
|
14
|
+
livekitUrl: string;
|
|
15
|
+
token: string;
|
|
16
|
+
} | null;
|
|
17
|
+
shouldConnect: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare const LiveAgentContext: import("react").Context<LiveAgentContextValue | null>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useAgentState<T>(attributeKey: string, parse: (json: string) => T | null, initial: T): T;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface QuestionStatus {
|
|
2
|
+
id: string;
|
|
3
|
+
text: string;
|
|
4
|
+
phaseName: string;
|
|
5
|
+
required: boolean;
|
|
6
|
+
status: 'unanswered' | 'answered';
|
|
7
|
+
answer: string | null;
|
|
8
|
+
}
|
|
9
|
+
export declare function useQuestionUpdates(): {
|
|
10
|
+
questions: QuestionStatus[];
|
|
11
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface LiveKitConnection {
|
|
2
|
+
livekitUrl: string;
|
|
3
|
+
token: string;
|
|
4
|
+
}
|
|
5
|
+
interface UseSessionParams {
|
|
6
|
+
organizationId: string;
|
|
7
|
+
agentId: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function useSession({ organizationId, agentId }: UseSessionParams): {
|
|
10
|
+
connection: LiveKitConnection | null;
|
|
11
|
+
shouldConnect: boolean;
|
|
12
|
+
isStarting: boolean;
|
|
13
|
+
error: string;
|
|
14
|
+
startSession: () => Promise<void>;
|
|
15
|
+
disconnect: () => Promise<void>;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SIDEBAR_WIDTH = 600;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatTime(seconds: number): string;
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@skippr/live-agent-sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "dist/esm/lib-exports.js",
|
|
6
|
+
"module": "dist/esm/lib-exports.js",
|
|
7
|
+
"types": "dist/types/lib-exports.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/types/lib-exports.d.ts",
|
|
11
|
+
"import": "./dist/esm/lib-exports.js"
|
|
12
|
+
},
|
|
13
|
+
"./styles": "./dist/skippr-sdk.css",
|
|
14
|
+
"./widget": "./dist/skippr-sdk.js"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist/**/*",
|
|
18
|
+
"README.md",
|
|
19
|
+
"LICENSE"
|
|
20
|
+
],
|
|
21
|
+
"sideEffects": [
|
|
22
|
+
"*.css"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "bun run scripts/build-sdk.ts",
|
|
26
|
+
"typecheck": "tsc --noEmit",
|
|
27
|
+
"check": "biome check .",
|
|
28
|
+
"check:fix": "biome check --write .",
|
|
29
|
+
"test": "bun test",
|
|
30
|
+
"ci": "bun run check && bun run typecheck && bun run test && bun run build",
|
|
31
|
+
"release": "release-it"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"clsx": "2.1.1",
|
|
35
|
+
"tailwind-merge": "3.4.0"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"react": "^18 || ^19",
|
|
39
|
+
"react-dom": "^18 || ^19",
|
|
40
|
+
"livekit-client": "^2.0.0",
|
|
41
|
+
"@livekit/components-react": "^2.0.0",
|
|
42
|
+
"lucide-react": ">=0.300.0 <1.0.0"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@biomejs/biome": "^2.3.13",
|
|
46
|
+
"@happy-dom/global-registrator": "20.3.7",
|
|
47
|
+
"@livekit/components-react": "2.9.19",
|
|
48
|
+
"@release-it/conventional-changelog": "^10.0.0",
|
|
49
|
+
"@tailwindcss/cli": "4.1.18",
|
|
50
|
+
"@testing-library/react": "16.3.2",
|
|
51
|
+
"@types/bun": "^1.3.8",
|
|
52
|
+
"@types/react": "19.2.9",
|
|
53
|
+
"@types/react-dom": "19.2.3",
|
|
54
|
+
"bun-plugin-tailwind": "0.1.2",
|
|
55
|
+
"livekit-client": "2.17.1",
|
|
56
|
+
"lucide-react": "0.563.0",
|
|
57
|
+
"react": "19.2.3",
|
|
58
|
+
"react-dom": "19.2.3",
|
|
59
|
+
"release-it": "^19.0.0",
|
|
60
|
+
"tailwindcss": "4.1.18",
|
|
61
|
+
"typescript": "5.9.3"
|
|
62
|
+
},
|
|
63
|
+
"publishConfig": {
|
|
64
|
+
"access": "public"
|
|
65
|
+
}
|
|
66
|
+
}
|