@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
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { a as ExploreLimits, b as ExploreCatalog, c as ExploreMessage } from './explore-types-CLw19R76.mjs';
|
|
2
|
+
|
|
3
|
+
/** What travels on the wire — mirrors `ExploreAttachmentInput`. */
|
|
4
|
+
interface ExploreAttachmentPayload {
|
|
5
|
+
name: string;
|
|
6
|
+
mimeType: string;
|
|
7
|
+
size: number;
|
|
8
|
+
textContent: string | null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Where the conversation is right now.
|
|
13
|
+
*
|
|
14
|
+
* - `loading` — catalog request in flight (the fallback catalog is already
|
|
15
|
+
* rendered, so this is a refinement, not a blank screen).
|
|
16
|
+
* - `ready` — idle; the composer accepts input.
|
|
17
|
+
* - `sending` — `sendExploreMessage` in flight.
|
|
18
|
+
* - `streaming` — polling the assistant turn; `activity` is live.
|
|
19
|
+
* - `error` — the last turn failed; `retry()` is meaningful and the
|
|
20
|
+
* composer stays usable.
|
|
21
|
+
* - `limited` — rate limited; the composer is disabled.
|
|
22
|
+
* - `disabled` — `exploreCatalog.enabled === false`.
|
|
23
|
+
*/
|
|
24
|
+
type ExploreChatPhase = "loading" | "ready" | "sending" | "streaming" | "error" | "limited" | "disabled";
|
|
25
|
+
/** Coarse bucket the UI switches its banner copy and affordances on. */
|
|
26
|
+
type ExploreChatErrorKind = "rate-limit" | "captcha" | "timeout" | "scope" | "network" | "disabled" | "validation" | "unknown";
|
|
27
|
+
interface ExploreChatError {
|
|
28
|
+
/** UI bucket. */
|
|
29
|
+
kind: ExploreChatErrorKind;
|
|
30
|
+
/** Raw `extensions.code` (or a client-side code such as `TIMEOUT`). */
|
|
31
|
+
code: string;
|
|
32
|
+
/** Human-readable, safe to render. */
|
|
33
|
+
message: string;
|
|
34
|
+
/** Whether re-sending the same message could plausibly succeed. */
|
|
35
|
+
retryable: boolean;
|
|
36
|
+
}
|
|
37
|
+
interface UseExploreChatOptions {
|
|
38
|
+
/** Slug of the product site this page is on — a soft hint to the harness. */
|
|
39
|
+
productSlug?: string;
|
|
40
|
+
/** Full URL of the page, forwarded as `pageUrl`. */
|
|
41
|
+
pageUrl?: string;
|
|
42
|
+
/** BCP-47 locale, forwarded as `locale`. */
|
|
43
|
+
locale?: string;
|
|
44
|
+
/** Poll cadence in ms. Default 1500 (CONTRACT.md §1). */
|
|
45
|
+
pollIntervalMs?: number;
|
|
46
|
+
/** Give up on a turn after this long. Default 90000 (the edge poll timeout). */
|
|
47
|
+
pollTimeoutMs?: number;
|
|
48
|
+
/**
|
|
49
|
+
* Prompts to offer when `exploreCatalog` supplies none. Resolution order is
|
|
50
|
+
* catalog → this option → {@link DEFAULT_EXPLORE_EXAMPLE_PROMPTS}, so a site
|
|
51
|
+
* can ship product-specific prompts without waiting on the backend and still
|
|
52
|
+
* be overridden centrally once the catalog carries them.
|
|
53
|
+
*/
|
|
54
|
+
examplePrompts?: string[];
|
|
55
|
+
/**
|
|
56
|
+
* Welcome copy for the fallback catalog, used only when `exploreCatalog` cannot be reached.
|
|
57
|
+
*
|
|
58
|
+
* The hook's own built-in fallback is English. `ExplorePage` passes the strings for the
|
|
59
|
+
* visitor's locale, so a catalog outage degrades to a translated page rather than an
|
|
60
|
+
* English one — the whole point of shipping six locales is that the failure paths speak
|
|
61
|
+
* them too.
|
|
62
|
+
*/
|
|
63
|
+
fallbackWelcome?: {
|
|
64
|
+
title: string;
|
|
65
|
+
body: string;
|
|
66
|
+
};
|
|
67
|
+
/** localStorage key for the ACTIVE conversation. Default `boff.explore.v1`. */
|
|
68
|
+
storageKey?: string;
|
|
69
|
+
/** Persist the conversation across reloads within the tab. Default true. */
|
|
70
|
+
persist?: boolean;
|
|
71
|
+
/** Called with the message text each time a send is accepted locally. */
|
|
72
|
+
onSend?: (message: string) => void;
|
|
73
|
+
}
|
|
74
|
+
interface UseExploreChatResult {
|
|
75
|
+
phase: ExploreChatPhase;
|
|
76
|
+
/** Never null — starts as the static fallback, upgraded by the server. */
|
|
77
|
+
catalog: ExploreCatalog;
|
|
78
|
+
messages: ExploreMessage[];
|
|
79
|
+
/** Latest progress line of the in-flight turn, or null when idle. */
|
|
80
|
+
activity: string | null;
|
|
81
|
+
/** Messages left today for this visitor, when the server reports it. */
|
|
82
|
+
remainingToday: number | null;
|
|
83
|
+
error: ExploreChatError | null;
|
|
84
|
+
/** Product the visitor pinned the conversation to, or null for "all". */
|
|
85
|
+
focusProduct: string | null;
|
|
86
|
+
setFocusProduct: (slug: string | null) => void;
|
|
87
|
+
send: (message: string, attachments?: readonly ExploreAttachmentPayload[]) => Promise<void>;
|
|
88
|
+
/** Stop polling and keep whatever text has streamed so far. */
|
|
89
|
+
stop: () => void;
|
|
90
|
+
/** Re-send the last message after a failed turn. */
|
|
91
|
+
retry: () => void;
|
|
92
|
+
/** Clear the conversation and the persisted session. */
|
|
93
|
+
reset: () => void;
|
|
94
|
+
/** Past conversations held in THIS browser, newest first. */
|
|
95
|
+
history: ArchivedExploreConversation[];
|
|
96
|
+
/** Reopen a past conversation and continue it. */
|
|
97
|
+
openConversation: (token: string) => void;
|
|
98
|
+
/** Forget one past conversation (local only). */
|
|
99
|
+
deleteConversation: (token: string) => void;
|
|
100
|
+
/** Forget every past conversation held in this browser. */
|
|
101
|
+
clearHistory: () => void;
|
|
102
|
+
/**
|
|
103
|
+
* Record that the visitor followed a link this answer offered. Fire-and-forget — never
|
|
104
|
+
* awaited, never throws, and must never delay the navigation it is reporting on.
|
|
105
|
+
*/
|
|
106
|
+
recordClick: (messageId: string, kind: "CTA" | "REFERENCE", url: string) => void;
|
|
107
|
+
/**
|
|
108
|
+
* Mint a read-only link to this conversation, or null when there is nothing to share yet.
|
|
109
|
+
* The secret returned is not the conversation token and cannot continue the thread.
|
|
110
|
+
*/
|
|
111
|
+
createShareLink: () => Promise<string | null>;
|
|
112
|
+
/**
|
|
113
|
+
* True when the transcript on screen came from a shared link rather than this visitor's own
|
|
114
|
+
* conversation. A shared view is read-only: the share secret cannot continue the thread.
|
|
115
|
+
*/
|
|
116
|
+
isSharedView: boolean;
|
|
117
|
+
canSend: boolean;
|
|
118
|
+
}
|
|
119
|
+
/** Fallback limits, mirroring the server defaults in CONTRACT.md §3. */
|
|
120
|
+
declare const FALLBACK_EXPLORE_LIMITS: ExploreLimits;
|
|
121
|
+
/**
|
|
122
|
+
* Prompts shown when neither the catalog nor the consumer supplies any.
|
|
123
|
+
* Deliberately product-agnostic — this SDK renders on 38 different sites.
|
|
124
|
+
*/
|
|
125
|
+
declare const DEFAULT_EXPLORE_EXAMPLE_PROMPTS: string[];
|
|
126
|
+
/**
|
|
127
|
+
* Map a `extensions.code` (or a client-side transport code) onto the bucket the
|
|
128
|
+
* UI renders. Unknown codes are treated as retryable — a transient backend
|
|
129
|
+
* condition we have not enumerated is far more likely than a permanent one.
|
|
130
|
+
*/
|
|
131
|
+
declare function classifyExploreError(code: string | null | undefined, serverMessage?: string | null): ExploreChatError;
|
|
132
|
+
/** One past conversation, as shown in the history list and restored on click. */
|
|
133
|
+
interface ArchivedExploreConversation {
|
|
134
|
+
token: string;
|
|
135
|
+
/** First thing the visitor asked — the human-readable label for the thread. */
|
|
136
|
+
title: string;
|
|
137
|
+
/** ISO timestamp of the last message in the thread. */
|
|
138
|
+
updatedAt: string;
|
|
139
|
+
messageCount: number;
|
|
140
|
+
focusProduct: string | null;
|
|
141
|
+
messages: ExploreMessage[];
|
|
142
|
+
}
|
|
143
|
+
declare function useExploreChat(options?: UseExploreChatOptions): UseExploreChatResult;
|
|
144
|
+
|
|
145
|
+
export { DEFAULT_EXPLORE_EXAMPLE_PROMPTS as D, type ExploreChatError as E, FALLBACK_EXPLORE_LIMITS as F, type UseExploreChatOptions as U, type ExploreChatErrorKind as a, type ExploreChatPhase as b, type UseExploreChatResult as c, classifyExploreError as d, useExploreChat as u };
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { a as ExploreLimits, b as ExploreCatalog, c as ExploreMessage } from './explore-types-CLw19R76.js';
|
|
2
|
+
|
|
3
|
+
/** What travels on the wire — mirrors `ExploreAttachmentInput`. */
|
|
4
|
+
interface ExploreAttachmentPayload {
|
|
5
|
+
name: string;
|
|
6
|
+
mimeType: string;
|
|
7
|
+
size: number;
|
|
8
|
+
textContent: string | null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Where the conversation is right now.
|
|
13
|
+
*
|
|
14
|
+
* - `loading` — catalog request in flight (the fallback catalog is already
|
|
15
|
+
* rendered, so this is a refinement, not a blank screen).
|
|
16
|
+
* - `ready` — idle; the composer accepts input.
|
|
17
|
+
* - `sending` — `sendExploreMessage` in flight.
|
|
18
|
+
* - `streaming` — polling the assistant turn; `activity` is live.
|
|
19
|
+
* - `error` — the last turn failed; `retry()` is meaningful and the
|
|
20
|
+
* composer stays usable.
|
|
21
|
+
* - `limited` — rate limited; the composer is disabled.
|
|
22
|
+
* - `disabled` — `exploreCatalog.enabled === false`.
|
|
23
|
+
*/
|
|
24
|
+
type ExploreChatPhase = "loading" | "ready" | "sending" | "streaming" | "error" | "limited" | "disabled";
|
|
25
|
+
/** Coarse bucket the UI switches its banner copy and affordances on. */
|
|
26
|
+
type ExploreChatErrorKind = "rate-limit" | "captcha" | "timeout" | "scope" | "network" | "disabled" | "validation" | "unknown";
|
|
27
|
+
interface ExploreChatError {
|
|
28
|
+
/** UI bucket. */
|
|
29
|
+
kind: ExploreChatErrorKind;
|
|
30
|
+
/** Raw `extensions.code` (or a client-side code such as `TIMEOUT`). */
|
|
31
|
+
code: string;
|
|
32
|
+
/** Human-readable, safe to render. */
|
|
33
|
+
message: string;
|
|
34
|
+
/** Whether re-sending the same message could plausibly succeed. */
|
|
35
|
+
retryable: boolean;
|
|
36
|
+
}
|
|
37
|
+
interface UseExploreChatOptions {
|
|
38
|
+
/** Slug of the product site this page is on — a soft hint to the harness. */
|
|
39
|
+
productSlug?: string;
|
|
40
|
+
/** Full URL of the page, forwarded as `pageUrl`. */
|
|
41
|
+
pageUrl?: string;
|
|
42
|
+
/** BCP-47 locale, forwarded as `locale`. */
|
|
43
|
+
locale?: string;
|
|
44
|
+
/** Poll cadence in ms. Default 1500 (CONTRACT.md §1). */
|
|
45
|
+
pollIntervalMs?: number;
|
|
46
|
+
/** Give up on a turn after this long. Default 90000 (the edge poll timeout). */
|
|
47
|
+
pollTimeoutMs?: number;
|
|
48
|
+
/**
|
|
49
|
+
* Prompts to offer when `exploreCatalog` supplies none. Resolution order is
|
|
50
|
+
* catalog → this option → {@link DEFAULT_EXPLORE_EXAMPLE_PROMPTS}, so a site
|
|
51
|
+
* can ship product-specific prompts without waiting on the backend and still
|
|
52
|
+
* be overridden centrally once the catalog carries them.
|
|
53
|
+
*/
|
|
54
|
+
examplePrompts?: string[];
|
|
55
|
+
/**
|
|
56
|
+
* Welcome copy for the fallback catalog, used only when `exploreCatalog` cannot be reached.
|
|
57
|
+
*
|
|
58
|
+
* The hook's own built-in fallback is English. `ExplorePage` passes the strings for the
|
|
59
|
+
* visitor's locale, so a catalog outage degrades to a translated page rather than an
|
|
60
|
+
* English one — the whole point of shipping six locales is that the failure paths speak
|
|
61
|
+
* them too.
|
|
62
|
+
*/
|
|
63
|
+
fallbackWelcome?: {
|
|
64
|
+
title: string;
|
|
65
|
+
body: string;
|
|
66
|
+
};
|
|
67
|
+
/** localStorage key for the ACTIVE conversation. Default `boff.explore.v1`. */
|
|
68
|
+
storageKey?: string;
|
|
69
|
+
/** Persist the conversation across reloads within the tab. Default true. */
|
|
70
|
+
persist?: boolean;
|
|
71
|
+
/** Called with the message text each time a send is accepted locally. */
|
|
72
|
+
onSend?: (message: string) => void;
|
|
73
|
+
}
|
|
74
|
+
interface UseExploreChatResult {
|
|
75
|
+
phase: ExploreChatPhase;
|
|
76
|
+
/** Never null — starts as the static fallback, upgraded by the server. */
|
|
77
|
+
catalog: ExploreCatalog;
|
|
78
|
+
messages: ExploreMessage[];
|
|
79
|
+
/** Latest progress line of the in-flight turn, or null when idle. */
|
|
80
|
+
activity: string | null;
|
|
81
|
+
/** Messages left today for this visitor, when the server reports it. */
|
|
82
|
+
remainingToday: number | null;
|
|
83
|
+
error: ExploreChatError | null;
|
|
84
|
+
/** Product the visitor pinned the conversation to, or null for "all". */
|
|
85
|
+
focusProduct: string | null;
|
|
86
|
+
setFocusProduct: (slug: string | null) => void;
|
|
87
|
+
send: (message: string, attachments?: readonly ExploreAttachmentPayload[]) => Promise<void>;
|
|
88
|
+
/** Stop polling and keep whatever text has streamed so far. */
|
|
89
|
+
stop: () => void;
|
|
90
|
+
/** Re-send the last message after a failed turn. */
|
|
91
|
+
retry: () => void;
|
|
92
|
+
/** Clear the conversation and the persisted session. */
|
|
93
|
+
reset: () => void;
|
|
94
|
+
/** Past conversations held in THIS browser, newest first. */
|
|
95
|
+
history: ArchivedExploreConversation[];
|
|
96
|
+
/** Reopen a past conversation and continue it. */
|
|
97
|
+
openConversation: (token: string) => void;
|
|
98
|
+
/** Forget one past conversation (local only). */
|
|
99
|
+
deleteConversation: (token: string) => void;
|
|
100
|
+
/** Forget every past conversation held in this browser. */
|
|
101
|
+
clearHistory: () => void;
|
|
102
|
+
/**
|
|
103
|
+
* Record that the visitor followed a link this answer offered. Fire-and-forget — never
|
|
104
|
+
* awaited, never throws, and must never delay the navigation it is reporting on.
|
|
105
|
+
*/
|
|
106
|
+
recordClick: (messageId: string, kind: "CTA" | "REFERENCE", url: string) => void;
|
|
107
|
+
/**
|
|
108
|
+
* Mint a read-only link to this conversation, or null when there is nothing to share yet.
|
|
109
|
+
* The secret returned is not the conversation token and cannot continue the thread.
|
|
110
|
+
*/
|
|
111
|
+
createShareLink: () => Promise<string | null>;
|
|
112
|
+
/**
|
|
113
|
+
* True when the transcript on screen came from a shared link rather than this visitor's own
|
|
114
|
+
* conversation. A shared view is read-only: the share secret cannot continue the thread.
|
|
115
|
+
*/
|
|
116
|
+
isSharedView: boolean;
|
|
117
|
+
canSend: boolean;
|
|
118
|
+
}
|
|
119
|
+
/** Fallback limits, mirroring the server defaults in CONTRACT.md §3. */
|
|
120
|
+
declare const FALLBACK_EXPLORE_LIMITS: ExploreLimits;
|
|
121
|
+
/**
|
|
122
|
+
* Prompts shown when neither the catalog nor the consumer supplies any.
|
|
123
|
+
* Deliberately product-agnostic — this SDK renders on 38 different sites.
|
|
124
|
+
*/
|
|
125
|
+
declare const DEFAULT_EXPLORE_EXAMPLE_PROMPTS: string[];
|
|
126
|
+
/**
|
|
127
|
+
* Map a `extensions.code` (or a client-side transport code) onto the bucket the
|
|
128
|
+
* UI renders. Unknown codes are treated as retryable — a transient backend
|
|
129
|
+
* condition we have not enumerated is far more likely than a permanent one.
|
|
130
|
+
*/
|
|
131
|
+
declare function classifyExploreError(code: string | null | undefined, serverMessage?: string | null): ExploreChatError;
|
|
132
|
+
/** One past conversation, as shown in the history list and restored on click. */
|
|
133
|
+
interface ArchivedExploreConversation {
|
|
134
|
+
token: string;
|
|
135
|
+
/** First thing the visitor asked — the human-readable label for the thread. */
|
|
136
|
+
title: string;
|
|
137
|
+
/** ISO timestamp of the last message in the thread. */
|
|
138
|
+
updatedAt: string;
|
|
139
|
+
messageCount: number;
|
|
140
|
+
focusProduct: string | null;
|
|
141
|
+
messages: ExploreMessage[];
|
|
142
|
+
}
|
|
143
|
+
declare function useExploreChat(options?: UseExploreChatOptions): UseExploreChatResult;
|
|
144
|
+
|
|
145
|
+
export { DEFAULT_EXPLORE_EXAMPLE_PROMPTS as D, type ExploreChatError as E, FALLBACK_EXPLORE_LIMITS as F, type UseExploreChatOptions as U, type ExploreChatErrorKind as a, type ExploreChatPhase as b, type UseExploreChatResult as c, classifyExploreError as d, useExploreChat as u };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/website-sdk",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.921.1",
|
|
4
4
|
"description": "Shared SDK for Burdenoff product websites - reusable React components, utilities, and configurations",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|