@gymmymac/bob-widget 3.2.14 → 3.2.17
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/CHANGELOG.md +31 -0
- package/dist/components/Bob.d.ts +8 -0
- package/dist/hooks/useBobChat.d.ts +9 -1
- package/dist/index.js +28 -28
- package/dist/index.mjs +7764 -3933
- package/dist/types/partner.d.ts +8 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,37 @@ All notable changes to the `@gymmymac/bob-widget` package will be documented in
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [v3.2.17] - 2026-03-21
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **`identifiedVehicle` now persisted in session** — Previously, navigating away and returning restored messages and conversation state but lost the identified vehicle. This caused `vehicleContext` to be `null` in subsequent requests, breaking `add_to_cart` and other vehicle-dependent tools. The vehicle is now saved/restored alongside all other session data.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## [v3.2.16] - 2026-03-21
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- **Session persistence via `sessionStorage`** — Bob's conversation (messages, vehicle candidates, conversation state) is now saved to `sessionStorage` and restored on mount if less than 4 hours old. Navigating away and returning preserves the full chat context. Cleared on explicit conversation reset.
|
|
21
|
+
- **`initialVehicle` prop on `BobStandalone`** — Hosts can pass a pre-identified vehicle to skip the REGO lookup flow. Session takes priority: if a valid session exists, `initialVehicle` is ignored.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## [v3.2.15] - 2026-03-11
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- **Server-side add-to-cart now emits `cart_updated` SSE event** — When Bob's AI adds items to the cart via the `add_to_cart` tool, the edge function now correctly populates `_cartItemsToEmit` with full `CartItem`-shaped payloads (`product_id`, `product_name`, `quantity`, `unit_price`, `vehicle_id`, `sku`, `brand`), so the `cart_updated` SSE event fires to the widget.
|
|
30
|
+
- **Widget fires `onAddToCart` for server-initiated cart adds** — `useBobChat` now calls `onAddToCart` for each item in a `cart_updated` event, ensuring the host site handles AI-initiated cart adds identically to manual UI clicks.
|
|
31
|
+
- **`cart_updated` payload shape aligned to `CartItem` interface** — Previously sent `{ productName, quantity }`, now sends full `CartItem` fields matching the host contract.
|
|
32
|
+
|
|
33
|
+
### Added
|
|
34
|
+
|
|
35
|
+
- **`add_vehicle_to_garage` tool** — Bob can now save a confirmed vehicle to the customer's garage via the Partner API. Guardrailed: requires confirmed REGO lookup and customer email. Bob proactively offers to save new vehicles.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
8
39
|
## [v3.2.14] - 2026-03-09
|
|
9
40
|
|
|
10
41
|
### Fixed
|
package/dist/components/Bob.d.ts
CHANGED
|
@@ -21,6 +21,14 @@ interface BobProps {
|
|
|
21
21
|
* @default false
|
|
22
22
|
*/
|
|
23
23
|
embedded?: boolean;
|
|
24
|
+
/** Optional pre-identified vehicle — Bob skips REGO lookup */
|
|
25
|
+
initialVehicle?: {
|
|
26
|
+
vehicle_id: string | number;
|
|
27
|
+
make: string;
|
|
28
|
+
model: string;
|
|
29
|
+
year: number;
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
};
|
|
24
32
|
}
|
|
25
33
|
export declare const Bob: React.FC<BobProps>;
|
|
26
34
|
export {};
|
|
@@ -24,8 +24,16 @@ interface UseBobChatProps {
|
|
|
24
24
|
onVariantSelectionRequired?: (variants: VariantCard[], make: string, model: string) => void;
|
|
25
25
|
/** Ref containing current shelf category names for post-stream scroll matching */
|
|
26
26
|
shelfCategoriesRef?: React.RefObject<Set<string>>;
|
|
27
|
+
/** Optional pre-identified vehicle — skips REGO lookup when no session exists */
|
|
28
|
+
initialVehicle?: {
|
|
29
|
+
vehicle_id: string | number;
|
|
30
|
+
make: string;
|
|
31
|
+
model: string;
|
|
32
|
+
year: number;
|
|
33
|
+
[key: string]: unknown;
|
|
34
|
+
};
|
|
27
35
|
}
|
|
28
|
-
export declare const useBobChat: ({ setAnimationState, manualMode, talkingState, thinkingState, completeState, idleState, listenState, onStreamStart, onStreamComplete, onShowingProduct, onResearchStart, onReadyToSpeak, onHighlightPart, onHighlightProduct, onNoPartsFound, onAutoFetchComplete, onVariantSelectionRequired, shelfCategoriesRef }: UseBobChatProps) => {
|
|
36
|
+
export declare const useBobChat: ({ setAnimationState, manualMode, talkingState, thinkingState, completeState, idleState, listenState, onStreamStart, onStreamComplete, onShowingProduct, onResearchStart, onReadyToSpeak, onHighlightPart, onHighlightProduct, onNoPartsFound, onAutoFetchComplete, onVariantSelectionRequired, shelfCategoriesRef, initialVehicle }: UseBobChatProps) => {
|
|
29
37
|
messages: Message[];
|
|
30
38
|
input: string;
|
|
31
39
|
setInput: import('react').Dispatch<import('react').SetStateAction<string>>;
|