bstp-agent-widget 0.2.4 → 0.2.6

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/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "bstp-agent-widget",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "private": false,
5
5
  "type": "module",
6
+ "main": "./dist/agent-widget.js",
6
7
  "module": "./dist/agent-widget.js",
7
8
  "types": "./src/lib/index.d.ts",
8
9
  "exports": {
@@ -26,16 +27,17 @@
26
27
  "dist/typescript-*.js",
27
28
  "dist/typescript-*.js.map"
28
29
  ],
30
+ "sideEffects": [
31
+ "*.css"
32
+ ],
29
33
  "scripts": {
30
34
  "dev": "vite",
31
35
  "preview": "vite preview",
32
36
  "build": "bun prepare:build && bun lint && bun intl:build && vite build",
33
37
  "build:lib": "rm -rf dist && bunx vite build -c vite.lib.config.ts",
34
38
  "prepublishOnly": "bun run build:lib",
35
- "pack:check": "npm pack --dry-run",
36
- "publish:public": "npm publish --access public",
37
- "publish:token": "npm publish --access public",
38
- "release:check": "bun run build:lib && bun run pack:check",
39
+ "release:patch:clean": "npm version patch && bun run build:lib && npm publish --access public",
40
+ "release:patch:dirty": "npm version patch --no-git-tag-version && bun run build:lib && npm publish --access public",
39
41
  "prepare:build": "bun script:build-metadata",
40
42
  "build:sourcemap": "cross-env SOURCEMAP=true bun run build",
41
43
  "build:visualizer": "cross-env ANALYZE=true bun run build",
@@ -1,13 +1,47 @@
1
- import type {
2
- AgentChatAssistantConfig,
3
- AgentChatConfig,
4
- AgentChatConfigGetter,
5
- AgentChatConfigValue,
6
- AgentChatGenAiInit,
7
- } from '../types/models/agent-chat-config';
8
- import type { AgentChatRuntime, AgentChatRuntimeGetter, AgentChatRuntimeValue } from '../types/models/agent-chat-runtime';
9
1
  import type { ReactElement } from 'react';
10
2
 
3
+ export type AgentChatAssistantConfig = {
4
+ assistantKey: string;
5
+ assistantId: number;
6
+ label: string;
7
+ initialMessage?: string;
8
+ };
9
+
10
+ export type AgentChatGenAiInit = {
11
+ email: string;
12
+ clientSecret: string;
13
+ };
14
+
15
+ export type AgentChatConfigValue = {
16
+ baseUrl: string;
17
+ assistantId: number;
18
+ assistants?: AgentChatAssistantConfig[];
19
+ genaiInit?: AgentChatGenAiInit;
20
+ };
21
+
22
+ export type AgentChatConfigGetter = {
23
+ getBaseUrl: () => string | null;
24
+ getAssistantId: () => number | null;
25
+ getAssistants?: () => AgentChatAssistantConfig[];
26
+ getGenaiInit?: () => AgentChatGenAiInit | null;
27
+ };
28
+
29
+ export type AgentChatConfig = AgentChatConfigValue | AgentChatConfigGetter;
30
+
31
+ export type AgentChatRuntimeValue = {
32
+ customerId: string;
33
+ customerToken: string;
34
+ language?: string;
35
+ };
36
+
37
+ export type AgentChatRuntimeGetter = {
38
+ getCustomerId: () => string | null;
39
+ getCustomerToken: () => string | null | Promise<string | null>;
40
+ getLanguage?: () => string | null;
41
+ };
42
+
43
+ export type AgentChatRuntime = AgentChatRuntimeValue | AgentChatRuntimeGetter;
44
+
11
45
  export type AgentChatWidgetProps = {
12
46
  config: AgentChatConfig;
13
47
  runtime: AgentChatRuntime;
@@ -24,14 +58,3 @@ export declare function mountAgentChatWidgetFromEnvironment(
24
58
  container: Element,
25
59
  options: MountFromEnvironmentOptions,
26
60
  ): Promise<() => void>;
27
-
28
- export type {
29
- AgentChatConfig,
30
- AgentChatConfigGetter,
31
- AgentChatConfigValue,
32
- AgentChatAssistantConfig,
33
- AgentChatGenAiInit,
34
- AgentChatRuntime,
35
- AgentChatRuntimeGetter,
36
- AgentChatRuntimeValue,
37
- };