@saar-ai/web-widget 0.8.0 → 0.10.0

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 (54) hide show
  1. package/dist/chunks/{chat-e1afSRBr.js → chat-CU9VPqVO.js} +260 -37
  2. package/dist/chunks/{host-widget-Ce-l1xu1.js → host-widget-BtiYIMwb.js} +5638 -350
  3. package/dist/chunks/{schemas-D-uDc-9q.js → schemas-YN3wGSGZ.js} +7 -4
  4. package/dist/chunks/{telemetry-CBblNC6C.js → telemetry-B1xBTk1s.js} +16 -1
  5. package/dist/dock/dock-drag.d.ts +5 -5
  6. package/dist/dock/dock-drag.d.ts.map +1 -1
  7. package/dist/dock/dock-float.d.ts +116 -0
  8. package/dist/dock/dock-float.d.ts.map +1 -0
  9. package/dist/dock/dock-motion.d.ts +61 -6
  10. package/dist/dock/dock-motion.d.ts.map +1 -1
  11. package/dist/dock/dock-pill.d.ts +18 -1
  12. package/dist/dock/dock-pill.d.ts.map +1 -1
  13. package/dist/dock/dock-row.d.ts +128 -10
  14. package/dist/dock/dock-row.d.ts.map +1 -1
  15. package/dist/dock/dock-sheet.d.ts.map +1 -1
  16. package/dist/dock/dock-state.d.ts +129 -9
  17. package/dist/dock/dock-state.d.ts.map +1 -1
  18. package/dist/dock/dock.d.ts +137 -25
  19. package/dist/dock/dock.d.ts.map +1 -1
  20. package/dist/dock/geometry.d.ts +129 -3
  21. package/dist/dock/geometry.d.ts.map +1 -1
  22. package/dist/generated/widget-css.d.ts.map +1 -1
  23. package/dist/host-routes.d.ts +187 -0
  24. package/dist/host-routes.d.ts.map +1 -0
  25. package/dist/host-widget.d.ts +78 -2
  26. package/dist/host-widget.d.ts.map +1 -1
  27. package/dist/index.d.ts +1 -1
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +4 -3889
  30. package/dist/messages.d.ts +88 -1
  31. package/dist/messages.d.ts.map +1 -1
  32. package/dist/mount.d.ts +10 -1
  33. package/dist/mount.d.ts.map +1 -1
  34. package/dist/next/index.js +1 -1
  35. package/dist/rope-knot.d.ts +67 -0
  36. package/dist/rope-knot.d.ts.map +1 -1
  37. package/dist/theme/derive.d.ts +1 -1
  38. package/dist/theme/derive.d.ts.map +1 -1
  39. package/dist/use-chat-session.d.ts +87 -33
  40. package/dist/use-chat-session.d.ts.map +1 -1
  41. package/dist/use-voice-session.d.ts +13 -8
  42. package/dist/use-voice-session.d.ts.map +1 -1
  43. package/dist/voice-widget.d.ts +22 -1
  44. package/dist/voice-widget.d.ts.map +1 -1
  45. package/dist/widget-cards.d.ts +21 -1
  46. package/dist/widget-cards.d.ts.map +1 -1
  47. package/dist/widget-cart-summary.d.ts +10 -1
  48. package/dist/widget-cart-summary.d.ts.map +1 -1
  49. package/dist/widget.css +1 -1
  50. package/package.json +7 -3
  51. package/src/styles/concierge.css +528 -65
  52. package/src/styles/dock-surface.css +284 -0
  53. package/src/styles/tokens.css +22 -6
  54. package/src/styles/widget-entry.css +3 -0
@@ -1 +1 @@
1
- {"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../src/dock/geometry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,mDAAmD;AACnD,eAAO,MAAM,KAAK,KAAK,CAAC;AACxB,yDAAyD;AACzD,eAAO,MAAM,MAAM,KAAK,CAAC;AACzB,8CAA8C;AAC9C,eAAO,MAAM,IAAI,KAAK,CAAC;AACvB,4CAA4C;AAC5C,eAAO,MAAM,SAAS,KAAK,CAAC;AAC5B,2EAA2E;AAC3E,eAAO,MAAM,OAAO,KAAK,CAAC;AAC1B,iEAAiE;AACjE,eAAO,MAAM,UAAU,KAAK,CAAC;AAC7B,iEAAiE;AACjE,eAAO,MAAM,aAAa,KAAK,CAAC;AAChC,yEAAyE;AACzE,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,iEAAiE;AACjE,eAAO,MAAM,YAAY,KAAK,CAAC;AAC/B,mCAAmC;AACnC,eAA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AC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,GAAG,eAAe,CAYxF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,SAAS,EACd,SAAS,EAAE,OAAO,EAClB,YAAY,EAAE,YAAY,GACzB;IAAE,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAStD"}
@@ -1 +1 @@
1
- {"version":3,"file":"widget-css.d.ts","sourceRoot":"","sources":["../../src/generated/widget-css.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,EAAE,MAAkt9D,CAAC"}
1
+ {"version":3,"file":"widget-css.d.ts","sourceRoot":"","sources":["../../src/generated/widget-css.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,EAAE,MAAq5pE,CAAC"}
@@ -0,0 +1,187 @@
1
+ /**
2
+ * HOST ROUTES — the merchant's own URL scheme, and the two things the widget
3
+ * does with it.
4
+ *
5
+ * ## The defect
6
+ *
7
+ * `navigate` (`apps/api/src/catalog/tools/navigate.tool.ts`) resolves every
8
+ * destination against the catalogue and spells the result the way a SHOPIFY
9
+ * storefront spells it: `/products/<handle>`, `/collections/<handle>`,
10
+ * `/search?q=`, `/cart`. That is right for the only production bridge and
11
+ * wrong for any host with a scheme of its own. The console's own demo store is
12
+ * the worked example: "take me to the rugs collection" produced
13
+ * `/collections/carpets`, the widget applied it on the console's origin, no
14
+ * such route exists there, and the console's auth gate turned the navigation
15
+ * into `/login?next=/`. Every collection navigation ejected the shopper.
16
+ *
17
+ * ## Two halves, and both are needed
18
+ *
19
+ * 1. **Rewrite** — {@link resolveHostRoutePath} turns the canonical path the
20
+ * server resolved into the path THIS host serves, using the templates the
21
+ * embed declared (`data-collection-url-template` and friends). A host that
22
+ * declared nothing is untouched, which is what keeps every Shopify
23
+ * storefront byte-identical.
24
+ * 2. **Declare** — {@link hostRouteTargets} turns the same templates into the
25
+ * capability list the widget sends on session boot, so the server can
26
+ * REFUSE a target this host cannot serve instead of emitting a path that
27
+ * ends in a 404. Without this half the concierge still says "taking you to
28
+ * the cushions" and then nothing happens; without the first half the
29
+ * declaration would be a promise the widget could not keep.
30
+ *
31
+ * The two are derived from ONE object for exactly that reason — a host that
32
+ * declares `collection` and cannot build a collection path, or builds one it
33
+ * never declared, is the bug this module's shape makes unrepresentable.
34
+ *
35
+ * ## Root-relative only, for NAVIGATION
36
+ *
37
+ * `buildProductHref` (`./cdn/core.ts`) accepts an absolute `https://` template
38
+ * because a product CARD may legitimately link to another origin. A navigation
39
+ * may not: `@saar-ai/widget-protocol`'s `SameOriginPathSchema` makes every
40
+ * server-resolved destination structurally same-origin, and a host template
41
+ * that re-opened that door would undo it at the last step. So
42
+ * {@link hostRouteResolvers} builds navigation hrefs with
43
+ * `allowAbsoluteHttps: false`, and a host whose product template is absolute
44
+ * simply does not declare `product` — its cards still link out, and the
45
+ * concierge declines to drive.
46
+ */
47
+ /**
48
+ * Backslash, every ASCII C0 control (0x00–0x1F — which includes tab, LF and
49
+ * CR), and space (0x20), as one ascending range plus the backslash.
50
+ *
51
+ * Both bypasses this closes are properties of the WHATWG URL parser rather
52
+ * than of any check below it, which is why they are rejected on the raw
53
+ * template before any prefix test runs:
54
+ *
55
+ * - **backslash** — the spec treats `\` exactly like `/` when scanning a
56
+ * special scheme's authority, so `/\evil.com/{handle}` starts with `/`,
57
+ * fails a `startsWith('//')` test, and parses identically to
58
+ * `//evil.com/{handle}`.
59
+ * - **tab/newline/CR** — the same spec STRIPS every ASCII tab and newline
60
+ * before parsing at all, so `/<TAB>/evil.com/{handle}` also starts with
61
+ * `/`, contains no backslash, and becomes protocol-relative once the
62
+ * browser is done with it. A raw space goes for the same class of reason.
63
+ *
64
+ * `eslint-disable-next-line no-control-regex` — the control range is the
65
+ * entire point of this pattern, not an accidental literal.
66
+ */
67
+ export declare const UNSAFE_TEMPLATE_CHARS: RegExp;
68
+ /**
69
+ * Turn a merchant-declared URL template into a one-argument href builder, or
70
+ * `undefined` when the template is not safe to use. Never throws — a malformed
71
+ * or hostile template degrades to "this host declares no such route" rather
72
+ * than reaching a `location.assign` unvalidated.
73
+ *
74
+ * Four rules, all required:
75
+ *
76
+ * - **carries the literal placeholder.** A template with nothing to
77
+ * substitute is not a per-entity template at all (probably a typo'd
78
+ * attribute), and building hrefs that all point at the same URL is worse
79
+ * than building none.
80
+ * - **contains none of {@link UNSAFE_TEMPLATE_CHARS}**, ahead of the prefix
81
+ * check so a hostile template never reaches it.
82
+ * - **starts with `/` and is not protocol-relative** — or, when
83
+ * `allowAbsoluteHttps`, with `https://`. This is the one thing standing
84
+ * between a merchant-configured attribute and a URL a shopper's browser
85
+ * will follow: `javascript:` executes script, `data:` can spoof a page, and
86
+ * a bare `//evil.com/{handle}` silently sends the shopper to another
87
+ * origin.
88
+ * - **the substituted value is `encodeURIComponent`-ed**, so a handle or a
89
+ * search query containing `/`, `?`, `#` or `&` cannot smuggle extra path
90
+ * segments or query parameters into the built href.
91
+ *
92
+ * @param template the merchant's template, verbatim from the embed attribute
93
+ * @param placeholder the literal token to substitute (`{handle}`, `{query}`)
94
+ * @param allowAbsoluteHttps whether an `https://…` template is acceptable —
95
+ * true for a card link, false for a navigation (see the module doc comment)
96
+ */
97
+ export declare function buildTemplateHref(template: string, placeholder: string, allowAbsoluteHttps: boolean): ((value: string) => string) | undefined;
98
+ /**
99
+ * The scheme half of {@link buildTemplateHref}'s rules, on its own — for the
100
+ * one declared route that substitutes nothing (the cart page). Exported so
101
+ * "is this merchant-supplied path safe to send a browser to" has exactly one
102
+ * spelling, rather than a second, subtly different copy for the placeholder-
103
+ * less case.
104
+ *
105
+ * @param template the merchant-supplied template or path
106
+ * @param allowAbsoluteHttps whether an `https://…` value is acceptable
107
+ */
108
+ export declare function isSafeHrefTemplate(template: string, allowAbsoluteHttps: boolean): boolean;
109
+ /**
110
+ * The merchant's declared URL scheme, as builders. Every member optional: a
111
+ * host declares what it has, and an absent member is a target the concierge
112
+ * will be told it cannot reach.
113
+ */
114
+ export interface HostRouteResolvers {
115
+ /** `/shop/p/{handle}` → a builder taking a product handle. */
116
+ readonly product?: (handle: string) => string;
117
+ /** `/shop/c/{handle}` → a builder taking a collection handle. */
118
+ readonly collection?: (handle: string) => string;
119
+ /** `/shop/search?query={query}` → a builder taking the shopper's own text. */
120
+ readonly search?: (query: string) => string;
121
+ /** The host's cart PAGE, as a root-relative path. A cart drawer is not a page and must not be declared. */
122
+ readonly cart?: string;
123
+ }
124
+ /** The embed's raw declaration — every field exactly as it came off the `<script>` tag, unvalidated. */
125
+ export interface HostRouteTemplates {
126
+ readonly product?: string | null;
127
+ readonly collection?: string | null;
128
+ readonly search?: string | null;
129
+ readonly cart?: string | null;
130
+ }
131
+ /**
132
+ * Build the resolvers from the raw embed attributes, or `undefined` when this
133
+ * host is not declaring a scheme at all.
134
+ *
135
+ * **What counts as declaring is deliberately narrow**: any of `collection`,
136
+ * `search` or `cart`. `product` alone does NOT, because
137
+ * `data-product-url-template` predates this feature by many releases and means
138
+ * "link my cards" — a merchant who set only that one has said nothing about
139
+ * navigation, and reading it as a narrowing would silently stop their
140
+ * concierge from navigating anywhere. The demo store sets a collection
141
+ * template, so it declares; a Shopify storefront sets none of the three, so it
142
+ * does not, and nothing about it changes.
143
+ *
144
+ * @param templates the raw attribute values
145
+ */
146
+ export declare function hostRouteResolvers(templates: HostRouteTemplates): HostRouteResolvers | undefined;
147
+ /** The navigation targets, in the vocabulary `@saar-ai/widget-protocol`'s `HostRoutes` uses. Spelt as literals, so `ui`/`core` never pull the zod-backed protocol module in for a string. */
148
+ export type HostRouteTarget = 'product' | 'collection' | 'search' | 'cart' | 'url';
149
+ /**
150
+ * What to declare to the server on session boot, or `undefined` when this host
151
+ * declares nothing (⇒ the field is omitted, and the server keeps its Shopify
152
+ * assumption).
153
+ *
154
+ * `'url'` is never declared. That target exists so a model can name a
155
+ * storefront path directly, and a host with a scheme of its own has no closed
156
+ * route list the server could check such a path against — so on a declaring
157
+ * host it is refused outright rather than allowed to become the one hole every
158
+ * other narrowing here would leave.
159
+ *
160
+ * @param routes the resolvers, from {@link hostRouteResolvers}
161
+ */
162
+ export declare function hostRouteTargets(routes: HostRouteResolvers | undefined): readonly HostRouteTarget[] | undefined;
163
+ /**
164
+ * Rewrite a server-resolved destination into the path THIS host serves.
165
+ *
166
+ * Three answers, and the difference between the last two is the whole point:
167
+ *
168
+ * - the path itself — this host declared nothing, so the server's Shopify
169
+ * spelling is the right one and nothing is rewritten;
170
+ * - a rewritten path — the host declared this target and the destination
171
+ * matched its shape;
172
+ * - `null` — this host cannot serve the destination, so NOTHING should
173
+ * happen. The caller reports a failed navigate rather than assigning a URL
174
+ * the host will 404 (or, on the console, bounce to a login page).
175
+ *
176
+ * `null` for a declared target whose path does not match the expected shape is
177
+ * deliberate rather than a fallthrough to the raw path: a `product` target
178
+ * carrying something that is not `/products/<handle>` is a destination this
179
+ * function does not understand, and passing an un-rewritten Shopify path to a
180
+ * host that just told us it has no Shopify routes is precisely the defect.
181
+ *
182
+ * @param url the server-resolved, root-relative destination
183
+ * @param target which kind of destination the server said it was
184
+ * @param routes this host's declared scheme, or `undefined`
185
+ */
186
+ export declare function resolveHostRoutePath(url: string, target: HostRouteTarget | undefined, routes: HostRouteResolvers | undefined): string | null;
187
+ //# sourceMappingURL=host-routes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-routes.d.ts","sourceRoot":"","sources":["../src/host-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,eAAO,MAAM,qBAAqB,QAAk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KAAK,CAAC;AAEnF;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,kBAAkB,GAAG,SAAS,GACrC,SAAS,eAAe,EAAE,GAAG,SAAS,CAQxC;AAsCD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,eAAe,GAAG,SAAS,EACnC,MAAM,EAAE,kBAAkB,GAAG,SAAS,GACrC,MAAM,GAAG,IAAI,CAsCf"}
@@ -1,6 +1,7 @@
1
1
  import type { CartSnapshot, HostBridge, SiteProfile } from '@saar-ai/widget-bridge';
2
2
  import type { VisitorEventCollector } from '@saar-ai/widget-bridge';
3
3
  import type { WidgetChatCart } from '@saar-ai/widget-protocol/chat';
4
+ import { type HostRouteResolvers } from './host-routes.js';
4
5
  import { type ChatCardItem, type ChatCheckoutHandoff } from './use-chat-session.js';
5
6
  import { type VoiceSession } from './use-voice-session.js';
6
7
  import type { WidgetCartLine } from './widget-cart-summary.js';
@@ -10,6 +11,35 @@ import type { DockCopyView, DockLayoutView } from './dock/dock.js';
10
11
  import type { WidgetColorConfig, WidgetTypeConfig } from './theme/derive.js';
11
12
  import { type WidgetMessages } from './messages.js';
12
13
  import type { WidgetAvatar } from './avatar.js';
14
+ /** What a "Choose options" press does, given the state at the moment of the press. */
15
+ export type ChooseOptionsAction = 'send' | 'hold' | 'product-page' | 'ignore';
16
+ /**
17
+ * SAA-175 — the decision behind a "Choose options" press, as a pure function
18
+ * so every branch is testable. Two of them (`streaming`, `inFlight`) cannot be
19
+ * reached through a click, because the button's `aria-disabled` reads the same
20
+ * state; they exist for the moment state changes between render and handler.
21
+ *
22
+ * In order:
23
+ *
24
+ * 1. **Already in flight** → `ignore`. A double press.
25
+ * 2. **No session** → `product-page`. Nobody to ask.
26
+ * 3. **A live call** → `hold`. A typed turn mid-call is answered out loud over
27
+ * the caller, and a page change mid-call takes the audio with it; the
28
+ * report waits for the call to end.
29
+ * 4. **Escalated** → `product-page`. A person holds the conversation and the
30
+ * concierge does not answer, so a report would leave the shopper with
31
+ * nothing and the operator with a label and no product link.
32
+ * 5. **A reply streaming** → `ignore`. The session would refuse the send, and
33
+ * "not now" is not a failure.
34
+ * 6. Otherwise → `send`.
35
+ */
36
+ export declare function chooseOptionsAction(state: {
37
+ readonly hasSession: boolean;
38
+ readonly escalated: boolean;
39
+ readonly inCall: boolean;
40
+ readonly streaming: boolean;
41
+ readonly inFlight: boolean;
42
+ }): ChooseOptionsAction;
13
43
  /**
14
44
  * Resolves the widget's "add to cart" handler from the bridge's OWN degraded
15
45
  * path — docs/WIDGET_EMBED_PLAN.md §3, rule 1 ("every optional method is
@@ -77,6 +107,13 @@ onAdded?: (item: ChatCardItem) => void): ((item: ChatCardItem) => Promise<void>)
77
107
  */
78
108
  export interface AddedCartLine extends WidgetCartLine {
79
109
  readonly variantId?: string;
110
+ /**
111
+ * The storefront platform's variant id, when known. Never used for
112
+ * checkout (see above) — it rides to the server on the chat cart so the
113
+ * server can join the line to its catalogue for a price-drift log
114
+ * (SAA-174). A host line may carry either id; a card add carries both.
115
+ */
116
+ readonly platformVariantId?: string;
80
117
  }
81
118
  /**
82
119
  * Folds one successful add into the widget's own basket, merging a repeat add
@@ -114,6 +151,14 @@ export declare function cartLinesFromSnapshot(snapshot: CartSnapshot | null, cur
114
151
  * discipline). The two are pinned together by a test.
115
152
  */
116
153
  export declare const MAX_REPORTED_CART_LINES = 50;
154
+ /**
155
+ * The shapes `WidgetChatCartLineSchema` enforces on a line's ids —
156
+ * `CART_LINE_VARIANT_ID_PATTERN` / `CART_LINE_PLATFORM_VARIANT_ID_PATTERN`
157
+ * (`@saar-ai/widget-protocol`), duplicated for the same no-zod-in-the-bundle
158
+ * reason as {@link MAX_REPORTED_CART_LINES} and pinned to them by a test.
159
+ */
160
+ export declare const CART_LINE_VARIANT_ID_SHAPE: RegExp;
161
+ export declare const CART_LINE_PLATFORM_VARIANT_ID_SHAPE: RegExp;
117
162
  /**
118
163
  * Build the cart snapshot the widget sends with every chat turn, from the
119
164
  * basket it is already rendering.
@@ -161,10 +206,17 @@ export declare const MAX_REPORTED_CART_LINES = 50;
161
206
  * and may be stated plainly.
162
207
  */
163
208
  export declare function toChatCart(input: {
164
- readonly lines: readonly WidgetCartLine[];
209
+ readonly lines: readonly AddedCartLine[];
165
210
  readonly currency: string;
166
211
  readonly hostReported: boolean;
167
212
  readonly hostSubtotalMinor?: number | undefined;
213
+ /**
214
+ * Send line variant ids (SAA-174) — ONLY when the api advertised
215
+ * `capabilities.cartLineIds`. An older api's strict line schema 400s them,
216
+ * and the widget CDN and the api deploy separately, so the default is the
217
+ * shape every api accepts: no ids.
218
+ */
219
+ readonly includeLineIds?: boolean;
168
220
  }): WidgetChatCart | null;
169
221
  /**
170
222
  * Where "Checkout" sends the shopper, and the order the two answers are
@@ -301,6 +353,22 @@ export interface ConciergeWidgetProps {
301
353
  readonly locale?: string;
302
354
  /** Builds a product card's PDP href from its handle — also feeds the `addToCart` degraded path, see `resolveAddToCartHandler`. */
303
355
  readonly productHref?: (handle: string) => string;
356
+ /**
357
+ * This host's OWN navigation scheme — see `./host-routes.ts` for the defect
358
+ * it exists for (a demo storefront whose every collection navigation bounced
359
+ * the shopper to a login page).
360
+ *
361
+ * Two things follow from it, and both have to, which is why it is one prop
362
+ * rather than two: the concierge's destinations are REWRITTEN into this
363
+ * host's paths before the bridge is asked to navigate, and the same set is
364
+ * DECLARED to the api on session boot so a target this host cannot serve is
365
+ * refused before an event is ever produced.
366
+ *
367
+ * Absent — the default, and every host that predates this — means "spell
368
+ * destinations the way a Shopify storefront spells them", which is exactly
369
+ * what the widget did before.
370
+ */
371
+ readonly hostRoutes?: HostRouteResolvers;
304
372
  /** Builds a truncated curation's "See all N" href. */
305
373
  readonly curationHref?: (curationId: string) => string;
306
374
  /**
@@ -330,6 +398,14 @@ export interface ConciergeWidgetProps {
330
398
  readonly bottomOffset?: 'auto' | number;
331
399
  /** §9.1 `cards.showPrice`. */
332
400
  readonly showPrice?: boolean;
401
+ /**
402
+ * The API advertised `capabilities.cartLineIds` on `GET /widget/config`
403
+ * (SAA-174). Only then does the cart sent with each turn carry line variant
404
+ * ids — an api from before that change 400s them. Absent ⇒ no ids, which
405
+ * every api accepts. The CDN core passes it; an npm host passes it only if
406
+ * it knows its api has it.
407
+ */
408
+ readonly cartLineIds?: boolean;
333
409
  /** §9.1 `cards.imageAspect` — the fixed box every card thumbnail is drawn in. */
334
410
  readonly cardImageAspect?: 'square' | 'portrait' | 'landscape';
335
411
  /**
@@ -447,5 +523,5 @@ export interface ConciergeWidgetProps {
447
523
  * about offering voice here costs a byte until a caller actually presses
448
524
  * the microphone.
449
525
  */
450
- export declare function ConciergeWidget({ embedKey, apiBase, socketUrl, socketPath, bridge, siteProfile, collector, messages, locale, productHref, curationHref, brandPrimary, brandSecondary, brandAccent, avatar, attribution, color, type, identity, layout, copy, bottomOffset, showPrice, cardImageAspect, voiceAvailable, direction, proactive, initialDraft, initialSelection, initialFocus, initialMinimised, insets, hold, audio, onReady, }: ConciergeWidgetProps): import("react").JSX.Element;
526
+ export declare function ConciergeWidget({ embedKey, apiBase, socketUrl, socketPath, bridge, siteProfile, collector, messages, locale, productHref, hostRoutes, curationHref, brandPrimary, brandSecondary, brandAccent, avatar, attribution, color, type, identity, layout, copy, bottomOffset, showPrice, cardImageAspect, voiceAvailable, direction, proactive, initialDraft, initialSelection, initialFocus, initialMinimised, insets, hold, audio, onReady, cartLineIds, }: ConciergeWidgetProps): import("react").JSX.Element;
451
527
  //# sourceMappingURL=host-widget.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"host-widget.d.ts","sourceRoot":"","sources":["../src/host-widget.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,YAAY,EACZ,UAAU,EAEV,WAAW,EAEZ,MAAM,wBAAwB,CAAC;AAYhC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAIpE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AChB,YAAY,EACZ,gBAAgB,EAChB,MAAM,EACN,IAAI,EACJ,KAAK,EACL,OAAO,EACP,WAAW,GACZ,EAAE,oBAAoB,+BAskEtB"}
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ export * from './avatar.js';
4
4
  export * from './morphing-loader.js';
5
5
  export { cn } from './cn.js';
6
6
  export { Dock } from './dock/dock.js';
7
- export type { DockProps, DockVoiceProps, DockLayoutView, DockCopyView, WidgetAttribution, } from './dock/dock.js';
7
+ export type { DockProps, DockVoiceProps, DockLayoutView, DockCopyView, DockTurn, WidgetAttribution, } from './dock/dock.js';
8
8
  export type { DockIdentityView, DockAvatarKind, DockMicSource } from './dock/dock-row.js';
9
9
  export type { DockSheetSnap } from './dock/dock-sheet.js';
10
10
  export * from './dock/dock-state.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAc7B,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,YAAY,EACV,SAAS,EACT,cAAc,EACd,cAAc,EACd,YAAY,EACZ,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC1F,YAAY,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,cAAc,sBAAsB,CAAC;AAGrC,cAAc,eAAe,CAAC;AAG9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,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