@oyehello/chat 0.4.0 → 0.5.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 +2 -1
- package/dist/index.cjs +494 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.global.js +494 -26
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +494 -26
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -64,6 +64,8 @@ interface WidgetConfig {
|
|
|
64
64
|
logoUrl: string | null;
|
|
65
65
|
accentColor: string | null;
|
|
66
66
|
} | null;
|
|
67
|
+
offline?: boolean;
|
|
68
|
+
offlineMessage?: string;
|
|
67
69
|
}
|
|
68
70
|
interface OpenSessionResponse {
|
|
69
71
|
sessionId: string;
|
|
@@ -73,6 +75,7 @@ interface OpenSessionResponse {
|
|
|
73
75
|
id: string;
|
|
74
76
|
name: string;
|
|
75
77
|
};
|
|
78
|
+
protocol?: number;
|
|
76
79
|
}
|
|
77
80
|
interface ChatClientOptions {
|
|
78
81
|
apiKey: string;
|
|
@@ -137,12 +140,15 @@ interface ChatClient {
|
|
|
137
140
|
start(): Promise<void>;
|
|
138
141
|
sendMessage(text: string, files?: File[]): Promise<void>;
|
|
139
142
|
end(): Promise<void>;
|
|
143
|
+
detach(): void;
|
|
144
|
+
reset(): void;
|
|
140
145
|
getMessages(): ChatMessage[];
|
|
141
146
|
getState(): ChatClientState;
|
|
142
147
|
on(listener: (e: ChatClientEvent) => void): () => void;
|
|
143
148
|
registerTools(handlers: Record<string, ChatToolHandler>): void;
|
|
144
149
|
getAttachmentUrl(storageRef: string): Promise<string>;
|
|
145
150
|
getWidgetConfig(): Promise<WidgetConfig>;
|
|
151
|
+
recordPageView(path: string): void;
|
|
146
152
|
}
|
|
147
153
|
declare function createChatClient(options: ChatClientOptions): ChatClient;
|
|
148
154
|
|
|
@@ -175,13 +181,21 @@ declare class OyehelloChatElement extends HTMLElement {
|
|
|
175
181
|
private renderedBotFinal;
|
|
176
182
|
private timers;
|
|
177
183
|
private serverSuggestions;
|
|
184
|
+
private streamId;
|
|
185
|
+
private streamEl;
|
|
186
|
+
private audioCtx;
|
|
178
187
|
private teaserText;
|
|
179
188
|
private teaserShownOnce;
|
|
189
|
+
private offline;
|
|
190
|
+
private offlineMessage;
|
|
191
|
+
private configLoaded;
|
|
180
192
|
private idleTimer;
|
|
181
193
|
private idleReset;
|
|
194
|
+
private uninstallSpaHooks;
|
|
182
195
|
private oc;
|
|
183
196
|
private bodyEl;
|
|
184
197
|
private textareaEl;
|
|
198
|
+
private composerEl;
|
|
185
199
|
private fileEl;
|
|
186
200
|
private titleEl;
|
|
187
201
|
private statusEl;
|
|
@@ -216,6 +230,9 @@ declare class OyehelloChatElement extends HTMLElement {
|
|
|
216
230
|
private doSend;
|
|
217
231
|
private sendChip;
|
|
218
232
|
private bindChips;
|
|
233
|
+
private startFresh;
|
|
234
|
+
private maybeChime;
|
|
235
|
+
private playChime;
|
|
219
236
|
private toggleEmoji;
|
|
220
237
|
private closeEmoji;
|
|
221
238
|
private renderEmoji;
|
package/dist/index.d.ts
CHANGED
|
@@ -64,6 +64,8 @@ interface WidgetConfig {
|
|
|
64
64
|
logoUrl: string | null;
|
|
65
65
|
accentColor: string | null;
|
|
66
66
|
} | null;
|
|
67
|
+
offline?: boolean;
|
|
68
|
+
offlineMessage?: string;
|
|
67
69
|
}
|
|
68
70
|
interface OpenSessionResponse {
|
|
69
71
|
sessionId: string;
|
|
@@ -73,6 +75,7 @@ interface OpenSessionResponse {
|
|
|
73
75
|
id: string;
|
|
74
76
|
name: string;
|
|
75
77
|
};
|
|
78
|
+
protocol?: number;
|
|
76
79
|
}
|
|
77
80
|
interface ChatClientOptions {
|
|
78
81
|
apiKey: string;
|
|
@@ -137,12 +140,15 @@ interface ChatClient {
|
|
|
137
140
|
start(): Promise<void>;
|
|
138
141
|
sendMessage(text: string, files?: File[]): Promise<void>;
|
|
139
142
|
end(): Promise<void>;
|
|
143
|
+
detach(): void;
|
|
144
|
+
reset(): void;
|
|
140
145
|
getMessages(): ChatMessage[];
|
|
141
146
|
getState(): ChatClientState;
|
|
142
147
|
on(listener: (e: ChatClientEvent) => void): () => void;
|
|
143
148
|
registerTools(handlers: Record<string, ChatToolHandler>): void;
|
|
144
149
|
getAttachmentUrl(storageRef: string): Promise<string>;
|
|
145
150
|
getWidgetConfig(): Promise<WidgetConfig>;
|
|
151
|
+
recordPageView(path: string): void;
|
|
146
152
|
}
|
|
147
153
|
declare function createChatClient(options: ChatClientOptions): ChatClient;
|
|
148
154
|
|
|
@@ -175,13 +181,21 @@ declare class OyehelloChatElement extends HTMLElement {
|
|
|
175
181
|
private renderedBotFinal;
|
|
176
182
|
private timers;
|
|
177
183
|
private serverSuggestions;
|
|
184
|
+
private streamId;
|
|
185
|
+
private streamEl;
|
|
186
|
+
private audioCtx;
|
|
178
187
|
private teaserText;
|
|
179
188
|
private teaserShownOnce;
|
|
189
|
+
private offline;
|
|
190
|
+
private offlineMessage;
|
|
191
|
+
private configLoaded;
|
|
180
192
|
private idleTimer;
|
|
181
193
|
private idleReset;
|
|
194
|
+
private uninstallSpaHooks;
|
|
182
195
|
private oc;
|
|
183
196
|
private bodyEl;
|
|
184
197
|
private textareaEl;
|
|
198
|
+
private composerEl;
|
|
185
199
|
private fileEl;
|
|
186
200
|
private titleEl;
|
|
187
201
|
private statusEl;
|
|
@@ -216,6 +230,9 @@ declare class OyehelloChatElement extends HTMLElement {
|
|
|
216
230
|
private doSend;
|
|
217
231
|
private sendChip;
|
|
218
232
|
private bindChips;
|
|
233
|
+
private startFresh;
|
|
234
|
+
private maybeChime;
|
|
235
|
+
private playChime;
|
|
219
236
|
private toggleEmoji;
|
|
220
237
|
private closeEmoji;
|
|
221
238
|
private renderEmoji;
|