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.
Files changed (53) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +62 -0
  3. package/dist/obi-sdk.standalone.iife.js +62 -2646
  4. package/package.json +13 -31
  5. package/dist/core/config-logger.d.ts +0 -30
  6. package/dist/core/constants.d.ts +0 -1
  7. package/dist/core/index.d.ts +0 -3
  8. package/dist/core/init.d.ts +0 -1
  9. package/dist/core/types.d.ts +0 -46
  10. package/dist/empty-loader.d.ts +0 -5
  11. package/dist/index.d.ts +0 -2
  12. package/dist/loader.d.ts +0 -33
  13. package/dist/modular/chunks/index-a481947c.js +0 -6
  14. package/dist/modular/chunks/index-a481947c.js.map +0 -1
  15. package/dist/modular/chunks/obi-widget-eab5da7a.js +0 -22450
  16. package/dist/modular/chunks/obi-widget-eab5da7a.js.map +0 -1
  17. package/dist/modular/chunks/types-f38a47f6.js +0 -22431
  18. package/dist/modular/chunks/types-f38a47f6.js.map +0 -1
  19. package/dist/modular/core.js +0 -4086
  20. package/dist/modular/core.js.map +0 -1
  21. package/dist/modular/index.js +0 -361
  22. package/dist/modular/index.js.map +0 -1
  23. package/dist/modular/ui.js +0 -110
  24. package/dist/modular/ui.js.map +0 -1
  25. package/dist/obi-sdk.standalone.iife.js.map +0 -1
  26. package/dist/react.d.ts +0 -6
  27. package/dist/react.es.js +0 -32910
  28. package/dist/react.es.js.map +0 -1
  29. package/dist/react.umd.js +0 -2843
  30. package/dist/react.umd.js.map +0 -1
  31. package/dist/sentry.d.ts +0 -39
  32. package/dist/test/setup.d.ts +0 -1
  33. package/dist/ui/components/audio-equalizer.d.ts +0 -21
  34. package/dist/ui/components/courses/course-modal.d.ts +0 -20
  35. package/dist/ui/components/courses/courses.d.ts +0 -31
  36. package/dist/ui/components/courses/index.d.ts +0 -1
  37. package/dist/ui/components/dot-loader.d.ts +0 -20
  38. package/dist/ui/components/icons.d.ts +0 -6
  39. package/dist/ui/components/index.d.ts +0 -10
  40. package/dist/ui/components/nav-icon.d.ts +0 -10
  41. package/dist/ui/components/navigation-bar.d.ts +0 -19
  42. package/dist/ui/components/obi-widget/index.d.ts +0 -1
  43. package/dist/ui/components/obi-widget/obi-widget.d.ts +0 -104
  44. package/dist/ui/components/obi-widget/obi-widget.test.d.ts +0 -1
  45. package/dist/ui/components/obi-widget/user-update.test.d.ts +0 -1
  46. package/dist/ui/components/searching-loader.d.ts +0 -5
  47. package/dist/ui/components/status-widget.d.ts +0 -8
  48. package/dist/ui/index.d.ts +0 -1
  49. package/dist/utils/index.d.ts +0 -2
  50. package/dist/utils/storage.d.ts +0 -45
  51. package/dist/utils/url-matcher.d.ts +0 -16
  52. package/dist/utils/url-matcher.test.d.ts +0 -1
  53. package/index.d.ts +0 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "obi-sdk",
3
- "version": "0.17.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/obi-session": "0.3.8",
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
- "build": "pnpm build:old && pnpm build:react && pnpm build:modular && pnpm build:standalone",
94
- "build:old": "vite build",
95
- "build:standalone": "vite build --config vite.standalone.config.js",
96
- "build:modular": "vite build --config vite.modular.config.js",
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
- }
@@ -1 +0,0 @@
1
- export declare const API_BASE_URL: string;
@@ -1,3 +0,0 @@
1
- export * from "./types";
2
- export * from "./constants";
3
- export { SDKState } from "@obi/obi-session";
@@ -1 +0,0 @@
1
- export declare const initializeObiWidget: () => Promise<void>;
@@ -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
- }
@@ -1,5 +0,0 @@
1
- /**
2
- * @deprecated The loader functionality has been moved to a separate package.
3
- * Please install and use the 'obi-loader' package instead.
4
- */
5
- export declare const initObi: () => never;
package/dist/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export { ObiWidget } from "./ui/components/obi-widget";
2
- import "./core/init";
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,6 +0,0 @@
1
- import { O } from "./obi-widget-eab5da7a.js";
2
- import "./types-f38a47f6.js";
3
- export {
4
- O as ObiWidget
5
- };
6
- //# sourceMappingURL=index-a481947c.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-a481947c.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}