obi-sdk 0.17.0 → 0.18.1
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/README.md +1 -1
- package/dist/index.js +62 -0
- package/dist/obi-sdk.standalone.iife.js +62 -2646
- package/package.json +13 -31
- package/dist/core/config-logger.d.ts +0 -30
- package/dist/core/constants.d.ts +0 -1
- package/dist/core/index.d.ts +0 -3
- package/dist/core/init.d.ts +0 -1
- package/dist/core/types.d.ts +0 -46
- package/dist/empty-loader.d.ts +0 -5
- package/dist/index.d.ts +0 -2
- package/dist/loader.d.ts +0 -33
- package/dist/modular/chunks/index-a481947c.js +0 -6
- package/dist/modular/chunks/index-a481947c.js.map +0 -1
- package/dist/modular/chunks/obi-widget-eab5da7a.js +0 -22450
- package/dist/modular/chunks/obi-widget-eab5da7a.js.map +0 -1
- package/dist/modular/chunks/types-f38a47f6.js +0 -22431
- package/dist/modular/chunks/types-f38a47f6.js.map +0 -1
- package/dist/modular/core.js +0 -4086
- package/dist/modular/core.js.map +0 -1
- package/dist/modular/index.js +0 -361
- package/dist/modular/index.js.map +0 -1
- package/dist/modular/ui.js +0 -110
- package/dist/modular/ui.js.map +0 -1
- package/dist/obi-sdk.standalone.iife.js.map +0 -1
- package/dist/react.d.ts +0 -6
- package/dist/react.es.js +0 -32910
- package/dist/react.es.js.map +0 -1
- package/dist/react.umd.js +0 -2843
- package/dist/react.umd.js.map +0 -1
- package/dist/sentry.d.ts +0 -39
- package/dist/test/setup.d.ts +0 -1
- package/dist/ui/components/audio-equalizer.d.ts +0 -21
- package/dist/ui/components/courses/course-modal.d.ts +0 -20
- package/dist/ui/components/courses/courses.d.ts +0 -31
- package/dist/ui/components/courses/index.d.ts +0 -1
- package/dist/ui/components/dot-loader.d.ts +0 -20
- package/dist/ui/components/icons.d.ts +0 -6
- package/dist/ui/components/index.d.ts +0 -10
- package/dist/ui/components/nav-icon.d.ts +0 -10
- package/dist/ui/components/navigation-bar.d.ts +0 -19
- package/dist/ui/components/obi-widget/index.d.ts +0 -1
- package/dist/ui/components/obi-widget/obi-widget.d.ts +0 -104
- package/dist/ui/components/obi-widget/obi-widget.test.d.ts +0 -1
- package/dist/ui/components/obi-widget/user-update.test.d.ts +0 -1
- package/dist/ui/components/searching-loader.d.ts +0 -5
- package/dist/ui/components/status-widget.d.ts +0 -8
- package/dist/ui/index.d.ts +0 -1
- package/dist/utils/index.d.ts +0 -2
- package/dist/utils/storage.d.ts +0 -45
- package/dist/utils/url-matcher.d.ts +0 -16
- package/dist/utils/url-matcher.test.d.ts +0 -1
- package/index.d.ts +0 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "obi-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.1",
|
|
4
4
|
"description": "JavaScript SDK for Obi",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/obi-sdk.umd.js",
|
|
@@ -8,18 +8,13 @@
|
|
|
8
8
|
"types": "index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
-
"types": "./index.d.ts",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
12
|
"import": "./dist/obi-sdk.es.js",
|
|
13
13
|
"require": "./dist/obi-sdk.umd.js"
|
|
14
|
-
},
|
|
15
|
-
"./react": {
|
|
16
|
-
"types": "./dist/react.d.ts",
|
|
17
|
-
"import": "./dist/react.es.js"
|
|
18
14
|
}
|
|
19
15
|
},
|
|
20
16
|
"files": [
|
|
21
|
-
"dist"
|
|
22
|
-
"index.d.ts"
|
|
17
|
+
"dist"
|
|
23
18
|
],
|
|
24
19
|
"keywords": [
|
|
25
20
|
"obi",
|
|
@@ -39,30 +34,20 @@
|
|
|
39
34
|
"@sentry/browser": "^9.23.0",
|
|
40
35
|
"@sentry/vite-plugin": "^3.5.0",
|
|
41
36
|
"@types/jsdom": "^21.1.7",
|
|
37
|
+
"eventemitter3": "^5.0.1",
|
|
42
38
|
"html2canvas-pro": "^1.5.11",
|
|
43
39
|
"lit": "^3.0.0",
|
|
40
|
+
"preact": ">=10.0.0",
|
|
44
41
|
"ts-pattern": "^5.7.0",
|
|
45
42
|
"zod": "^3.22.0",
|
|
46
43
|
"@obi/obi-client": "0.7.0",
|
|
47
|
-
"@obi/
|
|
48
|
-
"@obi/obi-components": "0.1.0"
|
|
49
|
-
"@obi/utils": "0.2.0"
|
|
50
|
-
},
|
|
51
|
-
"peerDependencies": {
|
|
52
|
-
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
53
|
-
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
|
54
|
-
},
|
|
55
|
-
"peerDependenciesMeta": {
|
|
56
|
-
"react": {
|
|
57
|
-
"optional": true
|
|
58
|
-
},
|
|
59
|
-
"react-dom": {
|
|
60
|
-
"optional": true
|
|
61
|
-
}
|
|
44
|
+
"@obi/utils": "0.2.0",
|
|
45
|
+
"@obi/obi-components": "0.1.0"
|
|
62
46
|
},
|
|
63
47
|
"devDependencies": {
|
|
64
48
|
"@chromatic-com/storybook": "^4.0.0-0",
|
|
65
49
|
"@eslint/js": "^8.56.0",
|
|
50
|
+
"@preact/preset-vite": "^2.10.1",
|
|
66
51
|
"@storybook/addon-docs": "^9.0.0",
|
|
67
52
|
"@storybook/web-components-vite": "^9.0.0",
|
|
68
53
|
"@types/node": "^22.15.18",
|
|
@@ -70,7 +55,6 @@
|
|
|
70
55
|
"@types/react-dom": "^18.0.0",
|
|
71
56
|
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
72
57
|
"@typescript-eslint/parser": "^6.0.0",
|
|
73
|
-
"@vitejs/plugin-react": "^4.0.3",
|
|
74
58
|
"@vitest/coverage-v8": "^2.1.8",
|
|
75
59
|
"@vitest/ui": "^2.1.8",
|
|
76
60
|
"eslint": "^8.45.0",
|
|
@@ -89,13 +73,11 @@
|
|
|
89
73
|
"vitest": "^2.1.8"
|
|
90
74
|
},
|
|
91
75
|
"scripts": {
|
|
92
|
-
"dev": "vite",
|
|
93
|
-
"
|
|
94
|
-
"build
|
|
95
|
-
"build:
|
|
96
|
-
"build:
|
|
97
|
-
"build:react": "vite build --config vite.react.config.ts",
|
|
98
|
-
"build:publish": "pnpm build && pnpm build:react && pnpm build:modular && pnpm build:standalone",
|
|
76
|
+
"dev": "vite --mode development",
|
|
77
|
+
"dev:staging": "VITE_API_BASE_URL=https://staging.coragents.ai vite --mode staging",
|
|
78
|
+
"build": "vite build --mode production",
|
|
79
|
+
"build:staging": "VITE_API_BASE_URL=https://staging.coragents.ai vite build --mode staging",
|
|
80
|
+
"build:publish": "pnpm build --mode production",
|
|
99
81
|
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
100
82
|
"format": "prettier --write \"src/**/*.{ts,tsx}\"",
|
|
101
83
|
"preview": "vite preview",
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ObiAssistantConfig } from "../types/sdk";
|
|
2
|
-
export interface ConfigLogEntry {
|
|
3
|
-
timestamp: number;
|
|
4
|
-
source: 'initial' | 'update';
|
|
5
|
-
previousConfig: ObiAssistantConfig | null;
|
|
6
|
-
newConfig: ObiAssistantConfig;
|
|
7
|
-
diff: ConfigDiff;
|
|
8
|
-
}
|
|
9
|
-
export interface ConfigDiff {
|
|
10
|
-
added: Record<string, any>;
|
|
11
|
-
modified: Record<string, {
|
|
12
|
-
from: any;
|
|
13
|
-
to: any;
|
|
14
|
-
}>;
|
|
15
|
-
removed: Record<string, any>;
|
|
16
|
-
}
|
|
17
|
-
export declare class ConfigLogger {
|
|
18
|
-
private history;
|
|
19
|
-
private currentConfig;
|
|
20
|
-
logInitialConfig(config: ObiAssistantConfig): void;
|
|
21
|
-
logConfigUpdate(newConfig: ObiAssistantConfig): void;
|
|
22
|
-
getHistory(): ConfigLogEntry[];
|
|
23
|
-
getLatest(): ObiAssistantConfig | null;
|
|
24
|
-
getDiff(index: number): ConfigDiff | null;
|
|
25
|
-
clear(): void;
|
|
26
|
-
getFormattedHistory(): string;
|
|
27
|
-
private deepClone;
|
|
28
|
-
private calculateDiff;
|
|
29
|
-
private isEqual;
|
|
30
|
-
}
|
package/dist/core/constants.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const API_BASE_URL: string;
|
package/dist/core/index.d.ts
DELETED
package/dist/core/init.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const initializeObiWidget: () => Promise<void>;
|
package/dist/core/types.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const ObiSDKConfigSchema: z.ZodObject<{
|
|
3
|
-
apiKey: z.ZodOptional<z.ZodString>;
|
|
4
|
-
enableVoice: z.ZodDefault<z.ZodBoolean>;
|
|
5
|
-
enableScreenCapture: z.ZodDefault<z.ZodBoolean>;
|
|
6
|
-
debug: z.ZodDefault<z.ZodBoolean>;
|
|
7
|
-
user: z.ZodOptional<z.ZodObject<{
|
|
8
|
-
id: z.ZodString;
|
|
9
|
-
email: z.ZodOptional<z.ZodString>;
|
|
10
|
-
metadata: z.ZodOptional<z.ZodAny>;
|
|
11
|
-
}, "strip", z.ZodTypeAny, {
|
|
12
|
-
id: string;
|
|
13
|
-
email?: string | undefined;
|
|
14
|
-
metadata?: any;
|
|
15
|
-
}, {
|
|
16
|
-
id: string;
|
|
17
|
-
email?: string | undefined;
|
|
18
|
-
metadata?: any;
|
|
19
|
-
}>>;
|
|
20
|
-
}, "strip", z.ZodTypeAny, {
|
|
21
|
-
debug: boolean;
|
|
22
|
-
enableVoice: boolean;
|
|
23
|
-
enableScreenCapture: boolean;
|
|
24
|
-
apiKey?: string | undefined;
|
|
25
|
-
user?: {
|
|
26
|
-
id: string;
|
|
27
|
-
email?: string | undefined;
|
|
28
|
-
metadata?: any;
|
|
29
|
-
} | undefined;
|
|
30
|
-
}, {
|
|
31
|
-
apiKey?: string | undefined;
|
|
32
|
-
debug?: boolean | undefined;
|
|
33
|
-
enableVoice?: boolean | undefined;
|
|
34
|
-
enableScreenCapture?: boolean | undefined;
|
|
35
|
-
user?: {
|
|
36
|
-
id: string;
|
|
37
|
-
email?: string | undefined;
|
|
38
|
-
metadata?: any;
|
|
39
|
-
} | undefined;
|
|
40
|
-
}>;
|
|
41
|
-
export type ObiSDKConfig = z.infer<typeof ObiSDKConfigSchema>;
|
|
42
|
-
export interface ObiError {
|
|
43
|
-
code: string;
|
|
44
|
-
message: string;
|
|
45
|
-
details?: unknown;
|
|
46
|
-
}
|
package/dist/empty-loader.d.ts
DELETED
package/dist/index.d.ts
DELETED
package/dist/loader.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Obi Widget Loader Script
|
|
3
|
-
*
|
|
4
|
-
* This script dynamically loads the Obi Widget web component on any webpage
|
|
5
|
-
* with a simple script tag inclusion.
|
|
6
|
-
*/
|
|
7
|
-
interface ObiWidgetConfig {
|
|
8
|
-
apiKey: string;
|
|
9
|
-
position?: "bottom-right" | "bottom-left" | "bottom-center" | "top-right" | "top-left" | "top-center" | "middle-left" | "middle-right";
|
|
10
|
-
user?: {
|
|
11
|
-
id: string;
|
|
12
|
-
email?: string;
|
|
13
|
-
metadata?: Record<string, any>;
|
|
14
|
-
} | null;
|
|
15
|
-
isActive?: boolean;
|
|
16
|
-
linkOnlyAccess?: boolean;
|
|
17
|
-
showMenu?: boolean;
|
|
18
|
-
primaryColor?: string;
|
|
19
|
-
urlBlacklist?: string[];
|
|
20
|
-
}
|
|
21
|
-
declare class ObiWidgetLoader {
|
|
22
|
-
private config;
|
|
23
|
-
private widget;
|
|
24
|
-
constructor(config?: Partial<ObiWidgetConfig>);
|
|
25
|
-
private init;
|
|
26
|
-
private loadScript;
|
|
27
|
-
private fetchLatestVersion;
|
|
28
|
-
private createWidget;
|
|
29
|
-
private initializeWidget;
|
|
30
|
-
initialize(): void;
|
|
31
|
-
getWidget(): HTMLElement | null;
|
|
32
|
-
}
|
|
33
|
-
export { ObiWidgetLoader };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-a481947c.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|