@tellyouai/plugin 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.
@@ -0,0 +1,156 @@
1
+ export type Mode = "call" | "text" | "help" | "chats" | "start";
2
+ export type DisplayMode = "inline" | "widget" | "widget-maximized" | "overlay" | "overlay-maximized" | "bar" | "bar-maximized";
3
+ export type ConsentMode = "auto" | "required" | "disabled";
4
+ export type ConsentConfig = {
5
+ mode?: ConsentMode;
6
+ chatTtlDays?: number;
7
+ };
8
+ export type ConsentSource = "none" | "custom" | "tcf" | "onetrust" | "cookiebot" | "didomi";
9
+ export type ConsentState = {
10
+ status: "unknown" | "granted" | "denied";
11
+ functional: boolean;
12
+ analytics: boolean;
13
+ source: ConsentSource;
14
+ };
15
+ export type ClientTool = {
16
+ description: string;
17
+ parameters: {
18
+ name: string;
19
+ type: string;
20
+ description: string;
21
+ }[];
22
+ execute: (params: Record<string, any>) => Promise<any> | void;
23
+ };
24
+ export type McpServer = {
25
+ headers?: Record<string, string>;
26
+ config?: Record<string, any>;
27
+ };
28
+ export type ConfigStyles = {
29
+ spacingXL?: string;
30
+ spacingLG?: string;
31
+ spacingMD?: string;
32
+ spacingSM?: string;
33
+ spacingXS?: string;
34
+ spacingXXS?: string;
35
+ borderRadius?: string;
36
+ borderRadiusLg?: string;
37
+ openerDimensions?: string;
38
+ marginRight?: string;
39
+ marginBottom?: string;
40
+ themeColors?: string[];
41
+ hoverColor?: string;
42
+ borderColor?: string;
43
+ color?: string;
44
+ colorFaded?: string;
45
+ backgroundColor?: string;
46
+ backgroundColor30?: string;
47
+ backgroundColor70?: string;
48
+ foregroundColor?: string;
49
+ foregroundColor70?: string;
50
+ redColor?: string;
51
+ colorBright?: string;
52
+ colorDark?: string;
53
+ colorGreen?: string;
54
+ transitionSpeed?: string;
55
+ colorDarkMode?: string;
56
+ borderColorDarkMode?: string;
57
+ backgroundColorDarkMode?: string;
58
+ backgroundColor30DarkMode?: string;
59
+ backgroundColor70DarkMode?: string;
60
+ foregroundColorDarkMode?: string;
61
+ foregroundColor70DarkMode?: string;
62
+ shadow: string;
63
+ shadowOuter: string;
64
+ fontWeightNormal?: string | number;
65
+ fontWeightBold?: string | number;
66
+ };
67
+ export type InstanceOptions = {
68
+ theme?: "light" | "dark" | "auto";
69
+ background?: "wave" | "aurora" | "stripes" | "fade" | "solid" | "none";
70
+ backgroundIntensity?: number;
71
+ borderRadius?: number;
72
+ shadow?: number;
73
+ avatarId?: string;
74
+ mediaUrl?: string;
75
+ mediaUrls?: ({
76
+ url?: string | null;
77
+ enabled?: boolean;
78
+ } | null)[];
79
+ name?: string;
80
+ withEmoji?: boolean;
81
+ withFiles?: boolean;
82
+ withMessageAvatars?: boolean;
83
+ withDisplaySize?: boolean;
84
+ withLocale?: boolean;
85
+ withQuickActions?: "visible" | "inside" | "visible-desktop";
86
+ withVoice?: boolean;
87
+ greeting?: Record<string, string>;
88
+ quickActions?: {
89
+ context?: {
90
+ knowledgeId?: string;
91
+ };
92
+ strings: Record<string, string>;
93
+ }[];
94
+ quickActionsSpeed?: "slow" | "normal" | "fast";
95
+ styles?: ConfigStyles;
96
+ };
97
+ export type InstanceConfig = {
98
+ target?: string;
99
+ displayMode?: DisplayMode;
100
+ isOpen?: boolean;
101
+ options?: InstanceOptions;
102
+ isMaximized?: boolean;
103
+ withSources?: boolean;
104
+ chat?: {
105
+ textChatId?: string;
106
+ };
107
+ user?: {
108
+ entityId?: string;
109
+ name: string;
110
+ email?: string;
111
+ phone?: string;
112
+ address?: {
113
+ address1?: string;
114
+ address2?: string;
115
+ city?: string;
116
+ company?: string;
117
+ province?: string;
118
+ provinceCode?: string;
119
+ zip?: string;
120
+ country?: string;
121
+ countryCode?: string;
122
+ };
123
+ tags?: string[];
124
+ totalSpent?: number;
125
+ currency?: string;
126
+ };
127
+ context?: {
128
+ pageName: string;
129
+ [key: string]: any;
130
+ };
131
+ clientTools?: Record<string, ClientTool>;
132
+ servers?: Record<string, McpServer>;
133
+ autoTools?: boolean | "readonly";
134
+ accessToken?: string;
135
+ thingId?: string;
136
+ entityId?: string;
137
+ widgetId?: string;
138
+ languages?: string[];
139
+ consent?: ConsentConfig;
140
+ };
141
+ export type ToggleOptions = {
142
+ open: boolean;
143
+ target?: string;
144
+ userMessage?: string;
145
+ assistantMessage?: string;
146
+ };
147
+ export type PluginController = {
148
+ load: () => void;
149
+ toggle: (options: ToggleOptions) => void;
150
+ goTo: (mode: Mode, target?: string) => void;
151
+ setConsent: (consent: Pick<ConsentState, "functional" | "analytics">) => void;
152
+ update: (patch: Partial<InstanceConfig>, options?: {
153
+ target?: string;
154
+ }) => void;
155
+ };
156
+ export type PluginConfiguration = Partial<InstanceConfig> | Partial<InstanceConfig>[];
package/package.json ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "@tellyouai/plugin",
3
+ "version": "0.1.0",
4
+ "description": "Framework-agnostic browser SDK for the Tellyou AI plugin",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/Imhere-Inc/tellyou-plugin.git"
8
+ },
9
+ "homepage": "https://tellyou.ai",
10
+ "type": "module",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/package/index.d.ts",
14
+ "import": "./dist/package/index.js"
15
+ }
16
+ },
17
+ "types": "./dist/package/index.d.ts",
18
+ "files": [
19
+ "dist/package",
20
+ "README.md"
21
+ ],
22
+ "sideEffects": false,
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "scripts": {
27
+ "dev": "vite",
28
+ "build": "eslint . --quiet && tsc -b && vite build",
29
+ "build:package": "vite build --config vite.npm.config.ts",
30
+ "prepack": "npm run build && npm run build:package",
31
+ "pack:check": "npm pack --dry-run",
32
+ "test:package": "node scripts/package-smoke.mjs",
33
+ "lint": "eslint .",
34
+ "preview": "vite preview"
35
+ },
36
+ "devDependencies": {
37
+ "@mcp-ui/client": "^7.1.1",
38
+ "@modelcontextprotocol/ext-apps": "^1.7.4",
39
+ "@modelcontextprotocol/sdk": "^1.29.0",
40
+ "@supabase/supabase-js": "^2.50.2",
41
+ "@eslint/js": "^10.0.1",
42
+ "@types/node": "^26.4.1",
43
+ "@types/react": "^19.0.8",
44
+ "@types/react-dom": "^19.0.3",
45
+ "@vitejs/plugin-basic-ssl": "^2.0.0",
46
+ "@vitejs/plugin-react": "^6.0.1",
47
+ "emojilib": "^4.0.2",
48
+ "eslint": "^10.10.0",
49
+ "eslint-plugin-react-hooks": "^7.1.0",
50
+ "eslint-plugin-react-refresh": "^0.5.2",
51
+ "globals": "^17.1.0",
52
+ "heic2any": "^0.0.4",
53
+ "localforage": "^1.10.0",
54
+ "motion": "^13.2.0",
55
+ "react": "^19.0.0",
56
+ "react-dom": "^19.0.0",
57
+ "react-intl": "^10.1.1",
58
+ "swr": "^2.3.3",
59
+ "typescript": "^6.0.3",
60
+ "typescript-eslint": "^8.22.0",
61
+ "use-debounce": "^10.0.6",
62
+ "uuidv7": "^1.0.2",
63
+ "vite": "^8.0.0",
64
+ "vite-plugin-dts": "^5.1.0"
65
+ }
66
+ }