@saar-ai/web-widget 0.4.1 → 0.5.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.
@@ -0,0 +1,106 @@
1
+ /**
2
+ * Arrival-order stamping for the merged transcript `ConciergeWidget` renders.
3
+ *
4
+ * The typed session, the spoken transcript and the voice tool events are three
5
+ * lists with no shared clock (`use-chat-session` stamps nothing; the voice
6
+ * worker's `atMs` is ITS clock, optional on the wire, and absent from typed
7
+ * turns entirely). What the widget CAN observe is arrival: it re-renders every
8
+ * time any of the three lists changes, so "which render did this row first
9
+ * appear in" is a total order over everything on screen — exactly the order a
10
+ * shopper watched the conversation happen in.
11
+ *
12
+ * `TurnOrderClock` hands every row a monotonic stamp on first sight and
13
+ * remembers it for the rest of the widget's life, so the merged transcript can
14
+ * simply sort by stamp. The three sources mutate differently, so each gets its
15
+ * own concrete rules — no generic aligner whose predicates a reader must
16
+ * re-derive per source:
17
+ *
18
+ * - **Typed turns** (`stampTyped`) — keyed by `id`, with one wrinkle: an id
19
+ * is rewritten IN PLACE once per turn (`send` swaps the optimistic caller
20
+ * id for the server's; `onDone` does the same for the streamed agent
21
+ * bubble, and may REMOVE a poll-backfilled duplicate of the same server id
22
+ * in the same update). A rewritten row must keep its stamp or it would
23
+ * leapfrog a spoken line that arrived while it was streaming. The list can
24
+ * also SHRINK: a failed `send` rolls its two optimistic rows back, and a
25
+ * recovery re-boot replaces the whole list — neither may donate a dead
26
+ * row's stamp to an unrelated newcomer.
27
+ * - **Spoken lines** (`stampSpoken`) — no stable key at all: a provisional
28
+ * line is REVISED IN PLACE as a brand-new object (`coalesceTranscript`),
29
+ * the list is capped (`slice(-MAX_TRANSCRIPT_LINES)` shifts everything
30
+ * left), and `start()` resets it to `[]` for a new call.
31
+ * - **Voice tool events** (`stampEvent`) — append-only distinct objects, a
32
+ * `WeakMap` by identity.
33
+ */
34
+ /** The fields of a typed turn the clock needs — a structural subset of `ChatTurn`. */
35
+ export interface TypedTurnLike {
36
+ readonly id: string;
37
+ readonly speaker: 'caller' | 'agent' | 'event';
38
+ }
39
+ /** The fields of a spoken transcript line the clock needs — a structural subset of `TranscriptPayload`. */
40
+ export interface SpokenLineLike {
41
+ readonly speaker: 'caller' | 'agent';
42
+ readonly final: boolean;
43
+ }
44
+ /**
45
+ * The widget's arrival clock. One instance per mounted widget (`useRef`), fed
46
+ * the CURRENT source lists on every render; every call is idempotent for
47
+ * unchanged input, so React StrictMode's double-invoked render (and any memo
48
+ * re-run) hands back identical stamps.
49
+ */
50
+ export declare class TurnOrderClock {
51
+ private counter;
52
+ private typedPrev;
53
+ private typedStamps;
54
+ private spokenPrev;
55
+ private spokenStamps;
56
+ private readonly eventStamps;
57
+ private fresh;
58
+ /**
59
+ * Stamps for the typed session's turns, parallel to `turns`.
60
+ *
61
+ * Per row, in order of precedence:
62
+ *
63
+ * 1. **Positional rewrite** — the row at this INDEX last render had a
64
+ * different id that no longer exists anywhere in the list, and the same
65
+ * speaker: that is `send`/`onDone`'s in-place id swap, so the stamp
66
+ * carries over. Checked BEFORE the id lookup because of the one race
67
+ * where both would match: the poll can backfill the streaming turn's
68
+ * server row before `onDone` renames the streamed bubble to that same
69
+ * id and drops the duplicate — the id lookup alone would hand the
70
+ * bubble the DUPLICATE's later stamp and orphan every row between.
71
+ * 2. **Id match** — the row was here last render; same stamp.
72
+ * 3. **Fresh** — a genuinely new row, which sorts after everything already
73
+ * on screen. This is where a row lands when a failed `send`'s rollback
74
+ * and a new append batch into one render: the newcomer stands at a
75
+ * removed OPTIMISTIC row's index, but the speaker gate in rule 1 (and
76
+ * the dead id in rule 2) keep it from inheriting the dead row's past.
77
+ */
78
+ stampTyped(turns: readonly TypedTurnLike[]): readonly number[];
79
+ /**
80
+ * Stamps for the voice transcript, parallel to `lines` — the FULL list as
81
+ * `useVoiceSession` publishes it, before any render-side filtering, so the
82
+ * caller can filter lines and stamps together.
83
+ *
84
+ * Rows are matched by object IDENTITY, scanning forward only — which is
85
+ * what lets the cap trim (the whole list shifted left one) keep every
86
+ * surviving stamp. An unmatched row standing where an unmatched PROVISIONAL
87
+ * line of the same speaker stood is `coalesceTranscript`'s in-place
88
+ * revision and inherits that line's stamp; anything else is new and stamps
89
+ * fresh, after everything already seen.
90
+ *
91
+ * Inheritance is disabled outright on a render where the list SHRANK:
92
+ * appends and revisions never shrink it and the cap trim keeps the length
93
+ * constant, so a shorter list means rows were dropped (`start()`'s reset to
94
+ * `[]` for a new call, or any future producer change) — and a dropped
95
+ * line's stamp must never be donated to a newcomer that merely stands where
96
+ * it stood. Surviving identical rows still keep their stamps; everything
97
+ * else restamps fresh, i.e. the new call's lines sort after everything
98
+ * already said. (`start()`'s clear commits as its own render before any
99
+ * frame from the new room can arrive, so in practice the reset is observed
100
+ * as `[]` and this guard is belt and braces.)
101
+ */
102
+ stampSpoken(lines: readonly SpokenLineLike[]): readonly number[];
103
+ /** Stamp for one voice tool event — append-only distinct objects, so plain first-sight identity. */
104
+ stampEvent(event: object): number;
105
+ }
106
+ //# sourceMappingURL=turn-order.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"turn-order.d.ts","sourceRoot":"","sources":["../src/turn-order.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,sFAAsF;AACtF,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;CAChD;AAED,2GAA2G;AAC3G,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC;IACrC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED;;;;;GAKG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,SAAS,CAAgC;IACjD,OAAO,CAAC,WAAW,CAAyB;IAC5C,OAAO,CAAC,UAAU,CAAiC;IACnD,OAAO,CAAC,YAAY,CAAyB;IAC7C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAiC;IAE7D,OAAO,CAAC,KAAK;IAKb;;;;;;;;;;;;;;;;;;;OAmBG;IACH,UAAU,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,GAAG,SAAS,MAAM,EAAE,CAqB7D;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,WAAW,CAAC,KAAK,EAAE,SAAS,cAAc,EAAE,GAAG,SAAS,MAAM,EAAE,CAkC/D;IAED,oGAAoG;IACpG,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMhC;CACF"}
@@ -1,5 +1,5 @@
1
1
  import type { VisitorEventCollector } from '@saar-ai/widget-bridge';
2
- import type { WidgetChatReport } from '@saar-ai/widget-protocol/chat';
2
+ import type { WidgetChatCart, WidgetChatReport } from '@saar-ai/widget-protocol/chat';
3
3
  import { type ConciergePosition } from './position.js';
4
4
  /**
5
5
  * Text chat transport for the end-user widget: boots a session, sends typed
@@ -153,6 +153,22 @@ export interface ChatCards {
153
153
  readonly curationId?: string;
154
154
  readonly items: readonly ChatCardItem[];
155
155
  }
156
+ /**
157
+ * The concierge asking the WIDGET to put one item in the shopper's cart —
158
+ * `add_to_cart` (the concierge tool) as it arrives on the typed leg, an
159
+ * `add-to-cart` SSE frame.
160
+ *
161
+ * An ENVELOPE around the card rather than the bare card, so the identity a
162
+ * consumer dedupes on belongs to the REQUEST and not to a product: two adds of
163
+ * the same item are two requests, and the widget must perform both.
164
+ *
165
+ * There is deliberately no quantity, here or on the wire — the widget's add
166
+ * path adds exactly one unit, so a second unit is a second event (see
167
+ * `@saar-ai/widget-protocol`'s `WidgetChatAddToCartEventSchema`).
168
+ */
169
+ export interface ChatCartAdd {
170
+ readonly item: ChatCardItem;
171
+ }
156
172
  /**
157
173
  * A real Shopify checkout handoff the `checkout_handoff` concierge tool
158
174
  * produced — `url` is a server-built permalink (see `apps/api/src/catalog/
@@ -318,6 +334,20 @@ export interface UseChatSessionResult {
318
334
  readonly cards: readonly ChatCards[];
319
335
  /** Every `checkout` event received this session, oldest first — see `checkout_handoff` (the concierge tool). */
320
336
  readonly checkoutHandoffs: readonly ChatCheckoutHandoff[];
337
+ /**
338
+ * Every `add-to-cart` event received this session, oldest first — the
339
+ * concierge asking the WIDGET to put an item in the shopper's cart because
340
+ * the shopper asked for it in words (`add_to_cart`, the concierge tool).
341
+ *
342
+ * This hook only COLLECTS them; it never adds anything itself, because the
343
+ * cart lives behind a `HostBridge` this hook has no handle on.
344
+ * `ConciergeWidget` (`host-widget.tsx`) is the consumer, and it must consume
345
+ * these **by object identity** — see its effect's doc comment, and
346
+ * `AGENTS.md` → "Consuming an agent-requested add". Each entry is a distinct
347
+ * object, one per SSE frame, which is what makes "have I already added THIS
348
+ * one" exact across re-renders.
349
+ */
350
+ readonly cartAdds: readonly ChatCartAdd[];
321
351
  readonly status: ChatStatus;
322
352
  readonly error?: string;
323
353
  /** `true` once `POST /widget/session` has resolved (success or failure). */
@@ -330,6 +360,14 @@ export interface UseChatSessionResult {
330
360
  * "syncing" indicator.
331
361
  */
332
362
  readonly connection: ChatConnectionState;
363
+ /**
364
+ * A HUMAN operator is composing a reply right now — driven by the desk
365
+ * socket's `desk:typing` pings, expiring `DESK_TYPING_INDICATOR_TTL_MS` (`@saar-ai/widget-protocol/desk-typing`) after
366
+ * the last one and cleared the moment their message actually arrives.
367
+ * Always `false` without a connected socket: the poll transport has no
368
+ * typing signal, and a stale "someone is typing" is worse than none.
369
+ */
370
+ readonly deskTyping: boolean;
333
371
  /**
334
372
  * Which channels the tenant's published widget config enables —
335
373
  * `StartWidgetSessionResult.modalities` (`apps/api/src/widget/
@@ -401,6 +439,73 @@ export interface UseChatSessionResult {
401
439
  * cross-verifying it server-side is deliberately out of scope.
402
440
  */
403
441
  readonly sendReport: (report: WidgetChatReport) => Promise<boolean>;
442
+ /**
443
+ * Tell this hook what the shopper's basket currently is, so that every
444
+ * later turn carries it to the concierge as context.
445
+ *
446
+ * ## Why a setter and not an option
447
+ *
448
+ * The basket is assembled by `ConciergeWidget`, which is the SAME component
449
+ * that calls this hook — so it cannot be passed in as an option (the cart
450
+ * does not exist yet when the hook is constructed). A setter called from an
451
+ * effect closes that loop without a second source of truth: the widget goes
452
+ * on owning "what is in the basket" (`bridge.readCart()` merged with its own
453
+ * adds, by the ownership table in this package's `AGENTS.md`), and this hook
454
+ * only carries whatever it was last told.
455
+ *
456
+ * ## Why it is stored in a ref, not state
457
+ *
458
+ * Nothing renders from it. Holding it in state would re-render the whole
459
+ * transcript on every cart read, including the ones that change nothing.
460
+ *
461
+ * ## What is actually sent, and when
462
+ *
463
+ * The value is attached to the NEXT `POST /widget/chat` — a message or a
464
+ * report, both — and to no other request. That makes the cart the model
465
+ * reads the cart the widget held at the moment the shopper pressed send:
466
+ * atomic with the question, with no stored snapshot to go stale and nothing
467
+ * to expire. `null` clears it, which is how a widget says "I no longer know
468
+ * of a cart" rather than repeating a basket it can no longer see.
469
+ *
470
+ * ## Trust
471
+ *
472
+ * CLIENT-ASSERTED, exactly like {@link sendReport}'s report and no more:
473
+ * nothing verifies it, and the server does not persist it — see
474
+ * `WidgetChatCartSchema` (`@saar-ai/widget-protocol`) and
475
+ * `WidgetChatInput.cart` (`apps/api`) for the full posture.
476
+ */
477
+ readonly setCart: (cart: WidgetChatCart | null) => void;
478
+ /**
479
+ * `POST /widget/cart` — push the basket so a live VOICE CALL can answer a
480
+ * question about it.
481
+ *
482
+ * ## Why {@link setCart} is not enough
483
+ *
484
+ * `setCart` attaches the basket to the next chat REQUEST, which is exactly
485
+ * right for a typed turn and reaches a call not at all: a caller asks out
486
+ * loud, the turn is assembled by the agent tier, and nothing on that path
487
+ * has been near this browser. So while a call is live the basket has to be
488
+ * pushed rather than carried, and the agent tier reads the pushed snapshot
489
+ * on every turn.
490
+ *
491
+ * ## Called when the basket CHANGES, not on a timer
492
+ *
493
+ * A poll would be a request per interval whether or not anything moved, and
494
+ * would still be stale in between. `ConciergeWidget` already recomputes the
495
+ * basket whenever it changes — a card add, a bridge re-read, an add the
496
+ * CONCIERGE itself asked for — so the change is the signal, and the same
497
+ * `chatCart` value that feeds `setCart` feeds this.
498
+ *
499
+ * ## Trust and cost
500
+ *
501
+ * CLIENT-ASSERTED, exactly like {@link setCart}, and nothing is persisted:
502
+ * the server writes a bounded blob with a TTL for the turn tier to read.
503
+ * Resolves `false` (never throws) with no session or on any failure — a
504
+ * push that did not land leaves the previously pushed basket standing and
505
+ * costs the call a grounded answer, which is not worth telling the shopper
506
+ * about.
507
+ */
508
+ readonly pushCart: (cart: WidgetChatCart) => Promise<boolean>;
404
509
  /**
405
510
  * `POST /widget/event` with the session's chatToken. Resolves `false` (never
406
511
  * throws) with no session or on a network/HTTP failure — browsing telemetry
@@ -408,6 +513,28 @@ export interface UseChatSessionResult {
408
513
  * storefront error the visitor sees.
409
514
  */
410
515
  readonly sendEvent: (events: readonly WidgetEventInput[]) => Promise<boolean>;
516
+ /**
517
+ * "The shopper is typing" — `POST /widget/typing` with the session's
518
+ * chatToken, relayed to whichever operator is watching this conversation.
519
+ * The mirror of {@link deskTyping}, pointed the other way.
520
+ *
521
+ * Call it on EVERY keystroke: it is leading-edge throttled internally to one
522
+ * request per `SHOPPER_TYPING_PING_INTERVAL_MS`
523
+ * (`@saar-ai/widget-protocol/desk-typing`), so a paragraph costs a handful
524
+ * of requests, not one per character. No timers are armed, so there is
525
+ * nothing to clean up and no trailing request after the shopper stops.
526
+ *
527
+ * Fire-and-forget and synchronous by design — it returns `void`, not a
528
+ * promise, precisely so no caller can be tempted to await a keystroke, and
529
+ * every failure (no session yet, offline, a 4xx) is swallowed. A hint that
530
+ * did not land costs an operator an animation; surfacing it would cost the
531
+ * shopper an error toast over one.
532
+ *
533
+ * The draft itself never leaves the browser: there is no body and no
534
+ * parameter to put one in — see `apps/api/src/widget/widget-chat.controller.ts`'s
535
+ * `typing()` for the server half of that promise.
536
+ */
537
+ readonly notifyTyping: () => void;
411
538
  /**
412
539
  * The add-to-cart-time attribution token the SERVER established
413
540
  * (`CheckoutHandoffService.recordCartAdd`), surfaced here the moment a
@@ -1 +1 @@
1
- {"version":3,"file":"use-chat-session.d.ts","sourceRoot":"","sources":["../src/use-chat-session.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAQpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,EAAuB,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAG5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwGG;AAEH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,WAAW,GAAG,WAAW,GAAG,OAAO,CAAC;AAEtE;;;;;;;;;GASG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,YAAY,GAAG,WAAW,GAAG,cAAc,CAAC;AAEvF,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,qKAAqK;IACrK,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;;;;;;;;;;;;OAgBG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,6FAA6F;IAC7F,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ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
146
146
  itemCount: import("zod").ZodNumber;
147
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
148
+ type: import("zod").ZodLiteral<"add-to-cart">;
149
+ item: import("zod").ZodObject<{
150
+ productId: import("zod").ZodString;
151
+ variantId: import("zod").ZodOptional<import("zod").ZodString>;
152
+ platformVariantId: import("zod").ZodOptional<import("zod").ZodString>;
153
+ title: import("zod").ZodString;
154
+ imageUrl: import("zod").ZodOptional<import("zod").ZodURL>;
155
+ handle: import("zod").ZodOptional<import("zod").ZodString>;
156
+ priceMinor: import("zod").ZodNumber;
157
+ currency: import("zod").ZodString;
158
+ available: import("zod").ZodBoolean;
159
+ reason: import("zod").ZodOptional<import("zod").ZodString>;
160
+ }, import("zod/v4/core").$strip>;
147
161
  }, import("zod/v4/core").$strip>], "type">;
148
162
  }>;
149
163
  export type VoiceProtocol = Awaited<ReturnType<typeof loadVoiceProtocol>>;
@@ -179,6 +193,22 @@ export interface UseVoiceSessionOptions {
179
193
  */
180
194
  loadProtocol?: () => Promise<VoiceProtocol>;
181
195
  }
196
+ /**
197
+ * One tool event, plus the turn it belongs to.
198
+ *
199
+ * `turnId` rides the telemetry ENVELOPE beside `event`, never inside it: the
200
+ * event's schema belongs to `@saar-ai/widget-protocol/chat` and knows nothing
201
+ * about turns, while the turn is a fact about the conversation. Lifting it
202
+ * here is what lets the mounter draw a curation UNDER the line that introduced
203
+ * it instead of merging it in by arrival time — see `host-widget.tsx`.
204
+ *
205
+ * Optional, and stays optional. An agent that predates the stamp, or a
206
+ * curation raised outside any turn, sends the frame without one; the mounter
207
+ * falls back to arrival order rather than dropping the cards.
208
+ */
209
+ export type VoiceWidgetEvent = WidgetToolEvent & {
210
+ readonly turnId?: string;
211
+ };
182
212
  export interface VoiceSession {
183
213
  /**
184
214
  * What the concierge's TOOLS put on screen this call, oldest first.
@@ -188,7 +218,7 @@ export interface VoiceSession {
188
218
  * beside the transcript — the same split as everything else here: this hook
189
219
  * owns the call, the mounter owns the screen.
190
220
  */
191
- readonly widgetEvents: readonly WidgetToolEvent[];
221
+ readonly widgetEvents: readonly VoiceWidgetEvent[];
192
222
  /** What the avatar should render. */
193
223
  readonly state: BotState;
194
224
  readonly phase: VoicePhase;
@@ -1 +1 @@
1
- {"version":3,"file":"use-voice-session.d.ts","sourceRoot":"","sources":["../src/use-voice-session.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EACV,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EACnB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,EAAqC,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC3F,OAAO,EAGL,KAAK,UAAU,EAEhB,MAAM,0BAA0B,CAAC;AAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AAEH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,MAAM,IAAI,gBAAgB,CAAC;IAC3B,MAAM,IAAI,gBAAgB,EAAE,CAAC;CAC9B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eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,YAAY,CAkZlF"}
@@ -29,7 +29,16 @@ export interface WidgetTurn {
29
29
  readonly locale: string;
30
30
  /** `false` while the recognizer may still revise it. */
31
31
  readonly final?: boolean;
32
- /** Product cards the agent attached to this turn — text mode only. */
32
+ /**
33
+ * Product cards the agent attached to this turn, drawn directly under its
34
+ * bubble.
35
+ *
36
+ * Both legs reach here now. The typed leg attaches its `cards` SSE event
37
+ * onto the live agent turn (`use-chat-session.ts`); the spoken leg's
38
+ * curations arrive as their own `widget.event` frames and are folded onto
39
+ * the matching transcript line by `turnId` (`host-widget.tsx`'s merge memo,
40
+ * which also explains what happens to one that finds no line).
41
+ */
33
42
  readonly cards?: ChatCards;
34
43
  /** Files carried on this turn, either direction — text mode only. */
35
44
  readonly attachments?: readonly ChatAttachment[];
@@ -75,6 +84,33 @@ export interface VoiceWidgetProps {
75
84
  readonly mode?: WidgetMode;
76
85
  /** Shows the "a human will pick this up" banner once the conversation escalates. */
77
86
  readonly escalated?: boolean;
87
+ /**
88
+ * A HUMAN operator is composing a reply right now (the desk socket's
89
+ * `desk:typing` pings — see `UseChatSessionResult.deskTyping`). Draws the
90
+ * same typing-dots bubble a still-streaming agent turn gets, pinned after
91
+ * the last turn, so the shopper waiting on a human sees the person is
92
+ * there. Distinct from the model's own dots, which ride on an OPEN agent
93
+ * turn — a human composing has no turn to ride on until they press send.
94
+ */
95
+ readonly humanTyping?: boolean;
96
+ /**
97
+ * The shopper is typing — called on every keystroke that leaves a NON-EMPTY
98
+ * draft. The mirror of {@link humanTyping}, pointed the other way: it is
99
+ * what puts "…is typing" beside this conversation in the operator console.
100
+ *
101
+ * Called raw, once per keystroke, with no throttling here on purpose. The
102
+ * cadence is a wire contract shared with the server
103
+ * (`SHOPPER_TYPING_PING_INTERVAL_MS`) and is enforced where the request is
104
+ * actually made (`useChatSession.notifyTyping`); a second throttle in this
105
+ * component would be a second thing to retune and a second way for the two
106
+ * to disagree.
107
+ *
108
+ * Deliberately NOT called when a keystroke empties the field: backspacing to
109
+ * blank is a shopper abandoning the message, and it is the one keystroke
110
+ * where "they are typing" is actively misleading. Omitted entirely ⇒ nothing
111
+ * is ever reported, same "additive per caller" posture as `onAddToCart`.
112
+ */
113
+ readonly onTyping?: () => void;
78
114
  /** Forwarded to every product card's "Add to cart" button, text mode only. */
79
115
  readonly onAddToCart?: (item: ChatCardItem) => void;
80
116
  /**
@@ -165,24 +201,48 @@ export interface VoiceWidgetProps {
165
201
  */
166
202
  export declare function readsAsCheckoutIntent(text: string): boolean;
167
203
  /**
168
- * Does this thread, as it stands, want to check out?
204
+ * Does this line ask to SEE the basket — "show me my cart", "what's my
205
+ * total"?
206
+ *
207
+ * A separate read from {@link readsAsCheckoutIntent} because it is a
208
+ * different question with the same answer: the basket itself. Asking what is
209
+ * in the cart, or what it comes to, is answered by lines, prices and a
210
+ * running total — not by prose. Without this the concierge answered "show me
211
+ * my cart" as an ordinary question and TYPED the basket back as a bullet list
212
+ * with no prices at all, then refused the total, because the server's
213
+ * guardrails (rightly) forbid it from stating a price no tool grounded.
214
+ * Observed on the KH storefront.
215
+ *
216
+ * Wider than the checkout list on purpose: a false positive here shows a
217
+ * basket the shopper is already looking at the contents of, which costs
218
+ * nothing. Bare "how much" is deliberately absent — "how much is delivery?"
219
+ * is a question about a policy, not about the basket.
220
+ */
221
+ export declare function readsAsCartViewIntent(text: string): boolean;
222
+ /**
223
+ * Does this thread, as it stands, want the basket on screen?
169
224
  *
170
225
  * The shopper's MOST RECENT line, not "any line ever": once they carry on
171
226
  * shopping past the summary the basket should get out of the way again, and a
172
227
  * sticky flag would leave it wedged at the bottom of every later answer.
173
228
  *
229
+ * TWO intents, ONE answer. Asking to pay ({@link readsAsCheckoutIntent}) and
230
+ * asking to see the cart ({@link readsAsCartViewIntent}) are different
231
+ * questions that are both answered by rendering the basket, so they share a
232
+ * single read rather than two flags that could disagree about the same line.
233
+ *
174
234
  * There is exactly ONE of these because two consumers ask the same question
175
235
  * of the same transcript and must never disagree about the answer:
176
236
  * `VoiceWidget` below draws the basket from it, and `ConciergeWidget`
177
237
  * (`host-widget.tsx`) re-reads the HOST's cart from it, so the basket the
178
- * shopper is about to check out with is the one that exists now. Two copies
179
- * of the same `reverse().find()` is how those two quietly drift apart.
238
+ * shopper is looking at is the one that exists now. Two copies of the same
239
+ * `reverse().find()` is how those two quietly drift apart.
180
240
  *
181
241
  * Takes only what it reads, so a caller with its own merged turn shape (which
182
242
  * `ConciergeWidget` has — typed turns plus spoken lines plus rendered cards)
183
243
  * can pass it without conversion.
184
244
  */
185
- export declare function checkoutIntentFromTurns(turns: readonly Pick<WidgetTurn, 'speaker' | 'text'>[]): boolean;
245
+ export declare function basketIntentFromTurns(turns: readonly Pick<WidgetTurn, 'speaker' | 'text'>[]): boolean;
186
246
  /**
187
247
  * The end-user agent widget: a launcher bubble that expands into a conversation
188
248
  * with both a microphone and a text box.
@@ -211,5 +271,5 @@ export declare function checkoutIntentFromTurns(turns: readonly Pick<WidgetTurn,
211
271
  * `dir`, resolved from that line's locale rather than inherited from the page —
212
272
  * inheriting is what renders Arabic punctuation on the wrong end of a sentence.
213
273
  */
214
- export declare function VoiceWidget({ state, turns, onToggleMic, onEndCall, callPhase, onSendText, micOpen, open, onOpenChange, status, mode, escalated, onAddToCart, curationHref, productHref, onAttachFile, launcherLabel, position, onPositionChange, cart, messages, navigate, locale, skinStyle, avatar, attribution, }: VoiceWidgetProps): import("react").JSX.Element;
274
+ export declare function VoiceWidget({ state, turns, onToggleMic, onEndCall, callPhase, onSendText, micOpen, open, onOpenChange, status, mode, escalated, humanTyping, onTyping, onAddToCart, curationHref, productHref, onAttachFile, launcherLabel, position, onPositionChange, cart, messages, navigate, locale, skinStyle, avatar, attribution, }: VoiceWidgetProps): import("react").JSX.Element;
215
275
  //# sourceMappingURL=voice-widget.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"voice-widget.d.ts","sourceRoot":"","sources":["../src/voice-widget.tsx"],"names":[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