@burdenoff/website-sdk 2026.829.8 → 2026.921.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 +112 -1
- package/dist/components/contact.js +4 -1
- package/dist/components/contact.js.map +1 -1
- package/dist/components/contact.mjs +4 -1
- package/dist/components/contact.mjs.map +1 -1
- package/dist/components/explore.d.mts +14 -1
- package/dist/components/explore.d.ts +14 -1
- package/dist/components/explore.js +217 -43
- package/dist/components/explore.js.map +1 -1
- package/dist/components/explore.mjs +217 -45
- package/dist/components/explore.mjs.map +1 -1
- package/dist/components/newsletter.js +4 -1
- package/dist/components/newsletter.js.map +1 -1
- package/dist/components/newsletter.mjs +4 -1
- package/dist/components/newsletter.mjs.map +1 -1
- package/dist/components/partners.js +23 -13
- package/dist/components/partners.js.map +1 -1
- package/dist/components/partners.mjs +23 -13
- package/dist/components/partners.mjs.map +1 -1
- package/dist/components/pricing.js +4 -1
- package/dist/components/pricing.js.map +1 -1
- package/dist/components/pricing.mjs +4 -1
- package/dist/components/pricing.mjs.map +1 -1
- package/dist/components/unsubscribe.js +4 -1
- package/dist/components/unsubscribe.js.map +1 -1
- package/dist/components/unsubscribe.mjs +4 -1
- package/dist/components/unsubscribe.mjs.map +1 -1
- package/dist/components/waitlist.js +4 -1
- package/dist/components/waitlist.js.map +1 -1
- package/dist/components/waitlist.mjs +4 -1
- package/dist/components/waitlist.mjs.map +1 -1
- package/dist/content/index.js +23 -13
- package/dist/content/index.js.map +1 -1
- package/dist/content/index.mjs +23 -13
- package/dist/content/index.mjs.map +1 -1
- package/dist/{use-explore-chat-BzXCz2UM.d.mts → explore-types-CLw19R76.d.mts} +1 -131
- package/dist/{use-explore-chat-BzXCz2UM.d.ts → explore-types-CLw19R76.d.ts} +1 -131
- package/dist/hooks/index.d.mts +2 -1
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/index.js +23 -7
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +23 -7
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.d.mts +143 -3
- package/dist/index.d.ts +143 -3
- package/dist/index.js +1552 -207
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1548 -210
- package/dist/index.mjs.map +1 -1
- package/dist/seo/index.js +4 -1
- package/dist/seo/index.js.map +1 -1
- package/dist/seo/index.mjs +4 -1
- package/dist/seo/index.mjs.map +1 -1
- package/dist/store/index.js +23 -13
- package/dist/store/index.js.map +1 -1
- package/dist/store/index.mjs +23 -13
- package/dist/store/index.mjs.map +1 -1
- package/dist/use-explore-chat-CvW-kyIm.d.mts +145 -0
- package/dist/use-explore-chat-DdGBimiz.d.ts +145 -0
- package/package.json +1 -1
|
@@ -184,134 +184,4 @@ interface SendExploreMessageMutationData {
|
|
|
184
184
|
sendExploreMessage: SendExploreMessageResult;
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
|
|
188
|
-
interface ExploreAttachmentPayload {
|
|
189
|
-
name: string;
|
|
190
|
-
mimeType: string;
|
|
191
|
-
size: number;
|
|
192
|
-
textContent: string | null;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Where the conversation is right now.
|
|
197
|
-
*
|
|
198
|
-
* - `loading` — catalog request in flight (the fallback catalog is already
|
|
199
|
-
* rendered, so this is a refinement, not a blank screen).
|
|
200
|
-
* - `ready` — idle; the composer accepts input.
|
|
201
|
-
* - `sending` — `sendExploreMessage` in flight.
|
|
202
|
-
* - `streaming` — polling the assistant turn; `activity` is live.
|
|
203
|
-
* - `error` — the last turn failed; `retry()` is meaningful and the
|
|
204
|
-
* composer stays usable.
|
|
205
|
-
* - `limited` — rate limited; the composer is disabled.
|
|
206
|
-
* - `disabled` — `exploreCatalog.enabled === false`.
|
|
207
|
-
*/
|
|
208
|
-
type ExploreChatPhase = "loading" | "ready" | "sending" | "streaming" | "error" | "limited" | "disabled";
|
|
209
|
-
/** Coarse bucket the UI switches its banner copy and affordances on. */
|
|
210
|
-
type ExploreChatErrorKind = "rate-limit" | "captcha" | "timeout" | "network" | "disabled" | "validation" | "unknown";
|
|
211
|
-
interface ExploreChatError {
|
|
212
|
-
/** UI bucket. */
|
|
213
|
-
kind: ExploreChatErrorKind;
|
|
214
|
-
/** Raw `extensions.code` (or a client-side code such as `TIMEOUT`). */
|
|
215
|
-
code: string;
|
|
216
|
-
/** Human-readable, safe to render. */
|
|
217
|
-
message: string;
|
|
218
|
-
/** Whether re-sending the same message could plausibly succeed. */
|
|
219
|
-
retryable: boolean;
|
|
220
|
-
}
|
|
221
|
-
interface UseExploreChatOptions {
|
|
222
|
-
/** Slug of the product site this page is on — a soft hint to the harness. */
|
|
223
|
-
productSlug?: string;
|
|
224
|
-
/** Full URL of the page, forwarded as `pageUrl`. */
|
|
225
|
-
pageUrl?: string;
|
|
226
|
-
/** BCP-47 locale, forwarded as `locale`. */
|
|
227
|
-
locale?: string;
|
|
228
|
-
/** Poll cadence in ms. Default 1500 (CONTRACT.md §1). */
|
|
229
|
-
pollIntervalMs?: number;
|
|
230
|
-
/** Give up on a turn after this long. Default 90000 (the edge poll timeout). */
|
|
231
|
-
pollTimeoutMs?: number;
|
|
232
|
-
/**
|
|
233
|
-
* Prompts to offer when `exploreCatalog` supplies none. Resolution order is
|
|
234
|
-
* catalog → this option → {@link DEFAULT_EXPLORE_EXAMPLE_PROMPTS}, so a site
|
|
235
|
-
* can ship product-specific prompts without waiting on the backend and still
|
|
236
|
-
* be overridden centrally once the catalog carries them.
|
|
237
|
-
*/
|
|
238
|
-
examplePrompts?: string[];
|
|
239
|
-
/** localStorage key for the ACTIVE conversation. Default `boff.explore.v1`. */
|
|
240
|
-
storageKey?: string;
|
|
241
|
-
/** Persist the conversation across reloads within the tab. Default true. */
|
|
242
|
-
persist?: boolean;
|
|
243
|
-
/** Called with the message text each time a send is accepted locally. */
|
|
244
|
-
onSend?: (message: string) => void;
|
|
245
|
-
}
|
|
246
|
-
interface UseExploreChatResult {
|
|
247
|
-
phase: ExploreChatPhase;
|
|
248
|
-
/** Never null — starts as the static fallback, upgraded by the server. */
|
|
249
|
-
catalog: ExploreCatalog;
|
|
250
|
-
messages: ExploreMessage[];
|
|
251
|
-
/** Latest progress line of the in-flight turn, or null when idle. */
|
|
252
|
-
activity: string | null;
|
|
253
|
-
/** Messages left today for this visitor, when the server reports it. */
|
|
254
|
-
remainingToday: number | null;
|
|
255
|
-
error: ExploreChatError | null;
|
|
256
|
-
/** Product the visitor pinned the conversation to, or null for "all". */
|
|
257
|
-
focusProduct: string | null;
|
|
258
|
-
setFocusProduct: (slug: string | null) => void;
|
|
259
|
-
send: (message: string, attachments?: readonly ExploreAttachmentPayload[]) => Promise<void>;
|
|
260
|
-
/** Stop polling and keep whatever text has streamed so far. */
|
|
261
|
-
stop: () => void;
|
|
262
|
-
/** Re-send the last message after a failed turn. */
|
|
263
|
-
retry: () => void;
|
|
264
|
-
/** Clear the conversation and the persisted session. */
|
|
265
|
-
reset: () => void;
|
|
266
|
-
/** Past conversations held in THIS browser, newest first. */
|
|
267
|
-
history: ArchivedExploreConversation[];
|
|
268
|
-
/** Reopen a past conversation and continue it. */
|
|
269
|
-
openConversation: (token: string) => void;
|
|
270
|
-
/** Forget one past conversation (local only). */
|
|
271
|
-
deleteConversation: (token: string) => void;
|
|
272
|
-
/** Forget every past conversation held in this browser. */
|
|
273
|
-
clearHistory: () => void;
|
|
274
|
-
/**
|
|
275
|
-
* Record that the visitor followed a link this answer offered. Fire-and-forget — never
|
|
276
|
-
* awaited, never throws, and must never delay the navigation it is reporting on.
|
|
277
|
-
*/
|
|
278
|
-
recordClick: (messageId: string, kind: "CTA" | "REFERENCE", url: string) => void;
|
|
279
|
-
/**
|
|
280
|
-
* Mint a read-only link to this conversation, or null when there is nothing to share yet.
|
|
281
|
-
* The secret returned is not the conversation token and cannot continue the thread.
|
|
282
|
-
*/
|
|
283
|
-
createShareLink: () => Promise<string | null>;
|
|
284
|
-
/**
|
|
285
|
-
* True when the transcript on screen came from a shared link rather than this visitor's own
|
|
286
|
-
* conversation. A shared view is read-only: the share secret cannot continue the thread.
|
|
287
|
-
*/
|
|
288
|
-
isSharedView: boolean;
|
|
289
|
-
canSend: boolean;
|
|
290
|
-
}
|
|
291
|
-
/** Fallback limits, mirroring the server defaults in CONTRACT.md §3. */
|
|
292
|
-
declare const FALLBACK_EXPLORE_LIMITS: ExploreLimits;
|
|
293
|
-
/**
|
|
294
|
-
* Prompts shown when neither the catalog nor the consumer supplies any.
|
|
295
|
-
* Deliberately product-agnostic — this SDK renders on 38 different sites.
|
|
296
|
-
*/
|
|
297
|
-
declare const DEFAULT_EXPLORE_EXAMPLE_PROMPTS: string[];
|
|
298
|
-
/**
|
|
299
|
-
* Map a `extensions.code` (or a client-side transport code) onto the bucket the
|
|
300
|
-
* UI renders. Unknown codes are treated as retryable — a transient backend
|
|
301
|
-
* condition we have not enumerated is far more likely than a permanent one.
|
|
302
|
-
*/
|
|
303
|
-
declare function classifyExploreError(code: string | null | undefined, serverMessage?: string | null): ExploreChatError;
|
|
304
|
-
/** One past conversation, as shown in the history list and restored on click. */
|
|
305
|
-
interface ArchivedExploreConversation {
|
|
306
|
-
token: string;
|
|
307
|
-
/** First thing the visitor asked — the human-readable label for the thread. */
|
|
308
|
-
title: string;
|
|
309
|
-
/** ISO timestamp of the last message in the thread. */
|
|
310
|
-
updatedAt: string;
|
|
311
|
-
messageCount: number;
|
|
312
|
-
focusProduct: string | null;
|
|
313
|
-
messages: ExploreMessage[];
|
|
314
|
-
}
|
|
315
|
-
declare function useExploreChat(options?: UseExploreChatOptions): UseExploreChatResult;
|
|
316
|
-
|
|
317
|
-
export { DEFAULT_EXPLORE_EXAMPLE_PROMPTS as D, type ExploreChatError as E, FALLBACK_EXPLORE_LIMITS as F, SEND_EXPLORE_MESSAGE_MUTATION as S, type UseExploreChatOptions as U, type ExploreChatErrorKind as a, type ExploreChatPhase as b, type UseExploreChatResult as c, classifyExploreError as d, EXPLORE_CATALOG_QUERY as e, EXPLORE_MESSAGE_QUERY as f, type ExploreCatalog as g, type ExploreCatalogQueryData as h, type ExploreConversation as i, type ExploreCtaKind as j, type ExploreCtaLink as k, type ExploreErrorCode as l, type ExploreLimits as m, type ExploreMessage as n, type ExploreMessageQueryData as o, type ExploreMessageRole as p, type ExploreMessageStatus as q, type ExploreProduct as r, type ExploreReference as s, type SendExploreMessageInput as t, useExploreChat as u, type SendExploreMessageMutationData as v, type SendExploreMessageResult as w };
|
|
187
|
+
export { type ExploreProduct as E, SEND_EXPLORE_MESSAGE_MUTATION as S, type ExploreLimits as a, type ExploreCatalog as b, type ExploreMessage as c, EXPLORE_CATALOG_QUERY as d, EXPLORE_MESSAGE_QUERY as e, type ExploreCatalogQueryData as f, type ExploreConversation as g, type ExploreCtaKind as h, type ExploreCtaLink as i, type ExploreErrorCode as j, type ExploreMessageQueryData as k, type ExploreMessageRole as l, type ExploreMessageStatus as m, type ExploreReference as n, type SendExploreMessageInput as o, type SendExploreMessageMutationData as p, type SendExploreMessageResult as q };
|
|
@@ -184,134 +184,4 @@ interface SendExploreMessageMutationData {
|
|
|
184
184
|
sendExploreMessage: SendExploreMessageResult;
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
|
|
188
|
-
interface ExploreAttachmentPayload {
|
|
189
|
-
name: string;
|
|
190
|
-
mimeType: string;
|
|
191
|
-
size: number;
|
|
192
|
-
textContent: string | null;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Where the conversation is right now.
|
|
197
|
-
*
|
|
198
|
-
* - `loading` — catalog request in flight (the fallback catalog is already
|
|
199
|
-
* rendered, so this is a refinement, not a blank screen).
|
|
200
|
-
* - `ready` — idle; the composer accepts input.
|
|
201
|
-
* - `sending` — `sendExploreMessage` in flight.
|
|
202
|
-
* - `streaming` — polling the assistant turn; `activity` is live.
|
|
203
|
-
* - `error` — the last turn failed; `retry()` is meaningful and the
|
|
204
|
-
* composer stays usable.
|
|
205
|
-
* - `limited` — rate limited; the composer is disabled.
|
|
206
|
-
* - `disabled` — `exploreCatalog.enabled === false`.
|
|
207
|
-
*/
|
|
208
|
-
type ExploreChatPhase = "loading" | "ready" | "sending" | "streaming" | "error" | "limited" | "disabled";
|
|
209
|
-
/** Coarse bucket the UI switches its banner copy and affordances on. */
|
|
210
|
-
type ExploreChatErrorKind = "rate-limit" | "captcha" | "timeout" | "network" | "disabled" | "validation" | "unknown";
|
|
211
|
-
interface ExploreChatError {
|
|
212
|
-
/** UI bucket. */
|
|
213
|
-
kind: ExploreChatErrorKind;
|
|
214
|
-
/** Raw `extensions.code` (or a client-side code such as `TIMEOUT`). */
|
|
215
|
-
code: string;
|
|
216
|
-
/** Human-readable, safe to render. */
|
|
217
|
-
message: string;
|
|
218
|
-
/** Whether re-sending the same message could plausibly succeed. */
|
|
219
|
-
retryable: boolean;
|
|
220
|
-
}
|
|
221
|
-
interface UseExploreChatOptions {
|
|
222
|
-
/** Slug of the product site this page is on — a soft hint to the harness. */
|
|
223
|
-
productSlug?: string;
|
|
224
|
-
/** Full URL of the page, forwarded as `pageUrl`. */
|
|
225
|
-
pageUrl?: string;
|
|
226
|
-
/** BCP-47 locale, forwarded as `locale`. */
|
|
227
|
-
locale?: string;
|
|
228
|
-
/** Poll cadence in ms. Default 1500 (CONTRACT.md §1). */
|
|
229
|
-
pollIntervalMs?: number;
|
|
230
|
-
/** Give up on a turn after this long. Default 90000 (the edge poll timeout). */
|
|
231
|
-
pollTimeoutMs?: number;
|
|
232
|
-
/**
|
|
233
|
-
* Prompts to offer when `exploreCatalog` supplies none. Resolution order is
|
|
234
|
-
* catalog → this option → {@link DEFAULT_EXPLORE_EXAMPLE_PROMPTS}, so a site
|
|
235
|
-
* can ship product-specific prompts without waiting on the backend and still
|
|
236
|
-
* be overridden centrally once the catalog carries them.
|
|
237
|
-
*/
|
|
238
|
-
examplePrompts?: string[];
|
|
239
|
-
/** localStorage key for the ACTIVE conversation. Default `boff.explore.v1`. */
|
|
240
|
-
storageKey?: string;
|
|
241
|
-
/** Persist the conversation across reloads within the tab. Default true. */
|
|
242
|
-
persist?: boolean;
|
|
243
|
-
/** Called with the message text each time a send is accepted locally. */
|
|
244
|
-
onSend?: (message: string) => void;
|
|
245
|
-
}
|
|
246
|
-
interface UseExploreChatResult {
|
|
247
|
-
phase: ExploreChatPhase;
|
|
248
|
-
/** Never null — starts as the static fallback, upgraded by the server. */
|
|
249
|
-
catalog: ExploreCatalog;
|
|
250
|
-
messages: ExploreMessage[];
|
|
251
|
-
/** Latest progress line of the in-flight turn, or null when idle. */
|
|
252
|
-
activity: string | null;
|
|
253
|
-
/** Messages left today for this visitor, when the server reports it. */
|
|
254
|
-
remainingToday: number | null;
|
|
255
|
-
error: ExploreChatError | null;
|
|
256
|
-
/** Product the visitor pinned the conversation to, or null for "all". */
|
|
257
|
-
focusProduct: string | null;
|
|
258
|
-
setFocusProduct: (slug: string | null) => void;
|
|
259
|
-
send: (message: string, attachments?: readonly ExploreAttachmentPayload[]) => Promise<void>;
|
|
260
|
-
/** Stop polling and keep whatever text has streamed so far. */
|
|
261
|
-
stop: () => void;
|
|
262
|
-
/** Re-send the last message after a failed turn. */
|
|
263
|
-
retry: () => void;
|
|
264
|
-
/** Clear the conversation and the persisted session. */
|
|
265
|
-
reset: () => void;
|
|
266
|
-
/** Past conversations held in THIS browser, newest first. */
|
|
267
|
-
history: ArchivedExploreConversation[];
|
|
268
|
-
/** Reopen a past conversation and continue it. */
|
|
269
|
-
openConversation: (token: string) => void;
|
|
270
|
-
/** Forget one past conversation (local only). */
|
|
271
|
-
deleteConversation: (token: string) => void;
|
|
272
|
-
/** Forget every past conversation held in this browser. */
|
|
273
|
-
clearHistory: () => void;
|
|
274
|
-
/**
|
|
275
|
-
* Record that the visitor followed a link this answer offered. Fire-and-forget — never
|
|
276
|
-
* awaited, never throws, and must never delay the navigation it is reporting on.
|
|
277
|
-
*/
|
|
278
|
-
recordClick: (messageId: string, kind: "CTA" | "REFERENCE", url: string) => void;
|
|
279
|
-
/**
|
|
280
|
-
* Mint a read-only link to this conversation, or null when there is nothing to share yet.
|
|
281
|
-
* The secret returned is not the conversation token and cannot continue the thread.
|
|
282
|
-
*/
|
|
283
|
-
createShareLink: () => Promise<string | null>;
|
|
284
|
-
/**
|
|
285
|
-
* True when the transcript on screen came from a shared link rather than this visitor's own
|
|
286
|
-
* conversation. A shared view is read-only: the share secret cannot continue the thread.
|
|
287
|
-
*/
|
|
288
|
-
isSharedView: boolean;
|
|
289
|
-
canSend: boolean;
|
|
290
|
-
}
|
|
291
|
-
/** Fallback limits, mirroring the server defaults in CONTRACT.md §3. */
|
|
292
|
-
declare const FALLBACK_EXPLORE_LIMITS: ExploreLimits;
|
|
293
|
-
/**
|
|
294
|
-
* Prompts shown when neither the catalog nor the consumer supplies any.
|
|
295
|
-
* Deliberately product-agnostic — this SDK renders on 38 different sites.
|
|
296
|
-
*/
|
|
297
|
-
declare const DEFAULT_EXPLORE_EXAMPLE_PROMPTS: string[];
|
|
298
|
-
/**
|
|
299
|
-
* Map a `extensions.code` (or a client-side transport code) onto the bucket the
|
|
300
|
-
* UI renders. Unknown codes are treated as retryable — a transient backend
|
|
301
|
-
* condition we have not enumerated is far more likely than a permanent one.
|
|
302
|
-
*/
|
|
303
|
-
declare function classifyExploreError(code: string | null | undefined, serverMessage?: string | null): ExploreChatError;
|
|
304
|
-
/** One past conversation, as shown in the history list and restored on click. */
|
|
305
|
-
interface ArchivedExploreConversation {
|
|
306
|
-
token: string;
|
|
307
|
-
/** First thing the visitor asked — the human-readable label for the thread. */
|
|
308
|
-
title: string;
|
|
309
|
-
/** ISO timestamp of the last message in the thread. */
|
|
310
|
-
updatedAt: string;
|
|
311
|
-
messageCount: number;
|
|
312
|
-
focusProduct: string | null;
|
|
313
|
-
messages: ExploreMessage[];
|
|
314
|
-
}
|
|
315
|
-
declare function useExploreChat(options?: UseExploreChatOptions): UseExploreChatResult;
|
|
316
|
-
|
|
317
|
-
export { DEFAULT_EXPLORE_EXAMPLE_PROMPTS as D, type ExploreChatError as E, FALLBACK_EXPLORE_LIMITS as F, SEND_EXPLORE_MESSAGE_MUTATION as S, type UseExploreChatOptions as U, type ExploreChatErrorKind as a, type ExploreChatPhase as b, type UseExploreChatResult as c, classifyExploreError as d, EXPLORE_CATALOG_QUERY as e, EXPLORE_MESSAGE_QUERY as f, type ExploreCatalog as g, type ExploreCatalogQueryData as h, type ExploreConversation as i, type ExploreCtaKind as j, type ExploreCtaLink as k, type ExploreErrorCode as l, type ExploreLimits as m, type ExploreMessage as n, type ExploreMessageQueryData as o, type ExploreMessageRole as p, type ExploreMessageStatus as q, type ExploreProduct as r, type ExploreReference as s, type SendExploreMessageInput as t, useExploreChat as u, type SendExploreMessageMutationData as v, type SendExploreMessageResult as w };
|
|
187
|
+
export { type ExploreProduct as E, SEND_EXPLORE_MESSAGE_MUTATION as S, type ExploreLimits as a, type ExploreCatalog as b, type ExploreMessage as c, EXPLORE_CATALOG_QUERY as d, EXPLORE_MESSAGE_QUERY as e, type ExploreCatalogQueryData as f, type ExploreConversation as g, type ExploreCtaKind as h, type ExploreCtaLink as i, type ExploreErrorCode as j, type ExploreMessageQueryData as k, type ExploreMessageRole as l, type ExploreMessageStatus as m, type ExploreReference as n, type SendExploreMessageInput as o, type SendExploreMessageMutationData as p, type SendExploreMessageResult as q };
|
package/dist/hooks/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { D as DEFAULT_EXPLORE_EXAMPLE_PROMPTS, E as ExploreChatError, a as ExploreChatErrorKind, b as ExploreChatPhase, F as FALLBACK_EXPLORE_LIMITS, U as UseExploreChatOptions, c as UseExploreChatResult, d as classifyExploreError, u as useExploreChat } from '../use-explore-chat-
|
|
1
|
+
export { D as DEFAULT_EXPLORE_EXAMPLE_PROMPTS, E as ExploreChatError, a as ExploreChatErrorKind, b as ExploreChatPhase, F as FALLBACK_EXPLORE_LIMITS, U as UseExploreChatOptions, c as UseExploreChatResult, d as classifyExploreError, u as useExploreChat } from '../use-explore-chat-CvW-kyIm.mjs';
|
|
2
|
+
import '../explore-types-CLw19R76.mjs';
|
|
2
3
|
|
|
3
4
|
interface UseSpeechInputOptions {
|
|
4
5
|
/** Receives settled text as it is recognised. Append it to the draft. */
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { D as DEFAULT_EXPLORE_EXAMPLE_PROMPTS, E as ExploreChatError, a as ExploreChatErrorKind, b as ExploreChatPhase, F as FALLBACK_EXPLORE_LIMITS, U as UseExploreChatOptions, c as UseExploreChatResult, d as classifyExploreError, u as useExploreChat } from '../use-explore-chat-
|
|
1
|
+
export { D as DEFAULT_EXPLORE_EXAMPLE_PROMPTS, E as ExploreChatError, a as ExploreChatErrorKind, b as ExploreChatPhase, F as FALLBACK_EXPLORE_LIMITS, U as UseExploreChatOptions, c as UseExploreChatResult, d as classifyExploreError, u as useExploreChat } from '../use-explore-chat-DdGBimiz.js';
|
|
2
|
+
import '../explore-types-CLw19R76.js';
|
|
2
3
|
|
|
3
4
|
interface UseSpeechInputOptions {
|
|
4
5
|
/** Receives settled text as it is recognised. Append it to the draft. */
|
package/dist/hooks/index.js
CHANGED
|
@@ -368,10 +368,13 @@ var ECOSYSTEM_PRODUCTS = [
|
|
|
368
368
|
name: "VibeControls",
|
|
369
369
|
websiteUrl: "https://vibecontrols.com"
|
|
370
370
|
},
|
|
371
|
+
// FluidGrids ships on www.fluidgrids.ai — fluidgrids.com only redirects there. The explore
|
|
372
|
+
// catalog and the site's own sitemap use this origin, and so must the fallback catalog
|
|
373
|
+
// built from this list, or /explore rejects FluidGrids concept images until it loads.
|
|
371
374
|
{
|
|
372
375
|
slug: "fluidgrids",
|
|
373
376
|
name: "FluidGrids",
|
|
374
|
-
websiteUrl: "https://fluidgrids.
|
|
377
|
+
websiteUrl: "https://www.fluidgrids.ai"
|
|
375
378
|
},
|
|
376
379
|
// Botlit ships on botlit.ai — botlit.com does not resolve.
|
|
377
380
|
{ slug: "botlit", name: "Botlit", websiteUrl: "https://www.botlit.ai" },
|
|
@@ -622,7 +625,7 @@ var DEFAULT_EXPLORE_EXAMPLE_PROMPTS = [
|
|
|
622
625
|
];
|
|
623
626
|
var FALLBACK_WELCOME_TITLE = "Ask anything about our products";
|
|
624
627
|
var FALLBACK_WELCOME_BODY = "Get straight answers drawn from our product documentation and public pages \u2014 with links back to the exact page each answer came from.";
|
|
625
|
-
function buildFallbackCatalog(examplePrompts) {
|
|
628
|
+
function buildFallbackCatalog(examplePrompts, welcome) {
|
|
626
629
|
return {
|
|
627
630
|
enabled: true,
|
|
628
631
|
products: ECOSYSTEM_PRODUCTS.map((p) => ({
|
|
@@ -632,8 +635,8 @@ function buildFallbackCatalog(examplePrompts) {
|
|
|
632
635
|
website: p.websiteUrl
|
|
633
636
|
})),
|
|
634
637
|
examplePrompts: examplePrompts?.length ? examplePrompts : DEFAULT_EXPLORE_EXAMPLE_PROMPTS,
|
|
635
|
-
welcomeTitle: FALLBACK_WELCOME_TITLE,
|
|
636
|
-
welcomeBody: FALLBACK_WELCOME_BODY,
|
|
638
|
+
welcomeTitle: welcome?.title ?? FALLBACK_WELCOME_TITLE,
|
|
639
|
+
welcomeBody: welcome?.body ?? FALLBACK_WELCOME_BODY,
|
|
637
640
|
limits: FALLBACK_EXPLORE_LIMITS,
|
|
638
641
|
captchaRequired: false,
|
|
639
642
|
recaptchaSiteKey: null
|
|
@@ -693,7 +696,15 @@ function classifyExploreError(code, serverMessage) {
|
|
|
693
696
|
retryable: true
|
|
694
697
|
};
|
|
695
698
|
}
|
|
696
|
-
if (c === "
|
|
699
|
+
if (c === "TOOL_BUDGET") {
|
|
700
|
+
return {
|
|
701
|
+
kind: "scope",
|
|
702
|
+
code: c,
|
|
703
|
+
message: "That question spans more of our products than I can look through in one go. Try asking about two or three specific products.",
|
|
704
|
+
retryable: false
|
|
705
|
+
};
|
|
706
|
+
}
|
|
707
|
+
if (c === "TIMEOUT") {
|
|
697
708
|
return {
|
|
698
709
|
kind: "timeout",
|
|
699
710
|
code: c,
|
|
@@ -825,6 +836,7 @@ function useExploreChat(options = {}) {
|
|
|
825
836
|
pageUrl,
|
|
826
837
|
locale,
|
|
827
838
|
examplePrompts,
|
|
839
|
+
fallbackWelcome,
|
|
828
840
|
pollIntervalMs = DEFAULT_POLL_INTERVAL_MS,
|
|
829
841
|
pollTimeoutMs = DEFAULT_POLL_TIMEOUT_MS,
|
|
830
842
|
storageKey = DEFAULT_STORAGE_KEY,
|
|
@@ -833,9 +845,13 @@ function useExploreChat(options = {}) {
|
|
|
833
845
|
} = options;
|
|
834
846
|
const client = useWebSDK();
|
|
835
847
|
const promptKey = JSON.stringify(examplePrompts ?? []);
|
|
848
|
+
const welcomeKey = JSON.stringify(fallbackWelcome ?? null);
|
|
836
849
|
const fallbackCatalog = react.useMemo(
|
|
837
|
-
() => buildFallbackCatalog(
|
|
838
|
-
|
|
850
|
+
() => buildFallbackCatalog(
|
|
851
|
+
JSON.parse(promptKey),
|
|
852
|
+
JSON.parse(welcomeKey) ?? void 0
|
|
853
|
+
),
|
|
854
|
+
[promptKey, welcomeKey]
|
|
839
855
|
);
|
|
840
856
|
const [catalog, setCatalog] = react.useState(fallbackCatalog);
|
|
841
857
|
const [messages, setMessages] = react.useState([]);
|