@gengage/assistant-fe 0.6.0 → 0.6.2

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 (41) hide show
  1. package/README.md +6 -22
  2. package/dist/agentic/adaptor/fetch-bridge.d.ts +3 -2
  3. package/dist/agentic/index.d.ts +1 -0
  4. package/dist/agentic/index.js +358 -306
  5. package/dist/agentic/similarity.d.ts +77 -0
  6. package/dist/agentic/types.d.ts +2 -0
  7. package/dist/agentic/util/be-url.d.ts +1 -1
  8. package/dist/agentic/worker/be-client.d.ts +2 -1
  9. package/dist/agentic/worker.d.ts +1 -0
  10. package/dist/agentic/worker.js +65 -57
  11. package/dist/agentic.iife.js +5 -5
  12. package/dist/{api-paths-DJFF9RuZ.js → api-paths-B1sFG4Tn.js} +1 -1
  13. package/dist/chat/runtime.d.ts +1 -0
  14. package/dist/chat-runtime.js +1 -1
  15. package/dist/chat.iife.js +2 -2
  16. package/dist/chat.js +1 -1
  17. package/dist/common/overlay.d.ts +1 -1
  18. package/dist/common/transport.d.ts +7 -0
  19. package/dist/{common-BydCGBNn.js → common-BML75wCP.js} +1 -1
  20. package/dist/common.js +5 -5
  21. package/dist/{connection-warning-Pbvk3J8k.js → connection-warning-Qy4APv0U.js} +1 -1
  22. package/dist/{fastIntent-CkYN2UOl.js → fastIntent-CXqUDc50.js} +1 -1
  23. package/dist/index.js +10 -10
  24. package/dist/native.iife.js +2 -2
  25. package/dist/qna/types.d.ts +1 -1
  26. package/dist/qna-runtime.js +1 -1
  27. package/dist/qna.iife.js +1 -1
  28. package/dist/qna.js +1 -1
  29. package/dist/{runtime-OpNoB3cu.js → runtime-C5FjeLrv.js} +116 -113
  30. package/dist/{runtime-iCLkUjI3.js → runtime-DmZ325aj.js} +3 -3
  31. package/dist/{runtime-DbZO1qG5.js → runtime-U8DOh3fb.js} +3 -3
  32. package/dist/{simbut-FyXolmZY.js → simbut-BJpWnq1J.js} +1 -1
  33. package/dist/simbut.iife.js +1 -1
  34. package/dist/simbut.js +1 -1
  35. package/dist/{beauty-consulting-turn-BmPXbkQg.js → similarity-DcfZ0CKT.js} +515 -295
  36. package/dist/{simrel-CbLe5OAr.js → simrel-B7RQY06h.js} +1 -1
  37. package/dist/simrel-runtime.js +1 -1
  38. package/dist/simrel.iife.js +1 -1
  39. package/dist/simrel.js +2 -2
  40. package/dist/{widget-base-COP8QwU3.js → widget-base-d-dDGkr7.js} +1 -1
  41. package/package.json +2 -34
package/README.md CHANGED
@@ -97,7 +97,7 @@ The chat widget includes a built-in history entry point in the header. Past chat
97
97
 
98
98
  ## Customization
99
99
 
100
- **Theme tokens** — no fork required:
100
+ **Theme tokens** — configure visual defaults at the SDK boundary:
101
101
  ```ts
102
102
  chat.init({
103
103
  theme: { primaryColor: '#f27a1a', headerBg: '#1a1a2e' },
@@ -128,9 +128,9 @@ await initOverlayWidgets({
128
128
 
129
129
  **SimBut customization** — use theme tokens, `i18n.findSimilarLabel`, and `onFindSimilar` for the PDP image-overlay pill.
130
130
 
131
- **Full fork** — replace `src/chat/components/` entirely; keep `catalog.ts` + `index.ts`.
131
+ **Reusable component changes** — update SDK components and keep `catalog.ts`, public exports, tests, and catalog previews in sync.
132
132
 
133
- See [docs/customization.md](docs/customization.md) for the fork and merchant-customization playbook.
133
+ See [docs/customization.md](docs/customization.md) for the supported SDK customization surface.
134
134
 
135
135
  ---
136
136
 
@@ -138,30 +138,16 @@ See [docs/customization.md](docs/customization.md) for the fork and merchant-cus
138
138
 
139
139
  ```bash
140
140
  npm install
141
- npm run dev -- koctascomtr --sku=1000465056 # Local dev server with HMR
142
- npm run koctascomtr # Merchant shortcut with the seeded demo SKU
143
- npm run trendyolcom # Another merchant shortcut using its default PDP SKU
144
141
  npm run typecheck # TypeScript strict check
145
142
  npm run test # Unit tests
146
143
  npm run test:chat-history # Targeted history + restore regression suite
147
144
  npm run build # Build to dist/
148
- npm run catalog # Visual component catalog at :3002
145
+ npm run catalog # Visual component catalog at :3002, with fixed generic styling presets
149
146
  npm run docs:build # Build contributor docs with VitePress
150
147
  ```
151
148
 
152
- **Using a local backend:**
153
-
154
- ```bash
155
- npm run dev -- koctascomtr --sku=1000465056 --backend-url=http://localhost:7860
156
- ```
157
-
158
- The local demos use the shared `defaultDevBackend` value from `demos/shared/default-dev-backend.ts`. For account-specific testing, set `MIDDLEWARE_URL` to the backend service location provided for your Gengage account:
159
-
160
- ```bash
161
- MIDDLEWARE_URL=http://localhost:7860 npm run dev -- koctascomtr --sku=1000465056
162
- ```
163
-
164
- Merchant demo pages under `demos/` now seed a default PDP SKU for direct launch flows, and the affected PDP shells hydrate their breadcrumb, summary content, and gallery imagery from middleware `productDetails` when the backend is available.
149
+ This repo builds the SDK package only. Hosted account demos and exact client PDP/PLP clones live in
150
+ `gengage-assistant-injector` and are deployed from that repository to `configs.gengage.ai`.
165
151
 
166
152
  ---
167
153
 
@@ -180,7 +166,6 @@ Merchant demo pages under `demos/` now seed a default PDP SKU for direct launch
180
166
  | [Security](docs/security-production.md) | Production CSP, postMessage origins, sanitization |
181
167
  | [Analytics](docs/analytics-contract.md) | GTM/GA dataLayer event mapping |
182
168
  | [Mobile SDK](docs/native-mobile-sdk.md) | Android/iOS/React Native integration |
183
- | [New Account](docs/new-account-guide.md) | Adding a new merchant demo |
184
169
  | [AGENTS](AGENTS.md) | Coding-agent architecture and code-path index |
185
170
  | [Contributing](CONTRIBUTING.md) | Shared SDK contribution workflow |
186
171
 
@@ -196,7 +181,6 @@ src/
196
181
  simrel/ # Similar products widget (GengageSimRel class + components)
197
182
  simbut/ # PDP image overlay pill widget (GengageSimBut class)
198
183
  native/ # Native WebView bridge exports
199
- demos/ # Merchant-branded demo pages and framework integration examples
200
184
  catalog/ # Visual component catalog (mock data, no backend)
201
185
  docs/ # Architecture, wire protocol, customization, analytics
202
186
  tests/ # Vitest unit tests + Playwright E2E
@@ -1,11 +1,12 @@
1
- import type { InjectorAdapter } from '../../common/transport.js';
1
+ import type { InjectorAdapter, InjectorBridgeEndpoint, InjectorEndpointHandler } from '../../common/transport.js';
2
2
  interface InstallFetchBridgeArgs {
3
3
  accountId: string;
4
4
  streamTransport: InjectorAdapter;
5
+ endpoints?: Partial<Record<InjectorBridgeEndpoint, InjectorEndpointHandler>>;
5
6
  }
6
7
  interface InstallFetchBridgeResult {
7
8
  middlewareUrl: string;
8
9
  stop: () => void;
9
10
  }
10
- export declare function installFetchTransportBridge({ accountId, streamTransport, }: InstallFetchBridgeArgs): InstallFetchBridgeResult;
11
+ export declare function installFetchTransportBridge({ accountId, streamTransport, endpoints, }: InstallFetchBridgeArgs): InstallFetchBridgeResult;
11
12
  export {};
@@ -9,6 +9,7 @@ export { actionButtonsUiSpec, comparisonUiSpec, productDetailsUiSpec, productsUi
9
9
  export { beautyConsultingTurnFlow } from './flow/beauty-consulting-turn.js';
10
10
  export { createFlow } from './flow/create-flow.js';
11
11
  export { resolveFlow } from './flow/dispatch.js';
12
+ export { buildPhotoSimilarityProfile, buildProductSimilarityProfile, buildSimilarityQueries, normalizeSimilarityText, rankSimilarProducts, scoreSimilarityCandidate, tokenizeSimilarityText, type PhotoSimilaritySignals, type ProductSimilarityProfile, type SimilarityProductLike, type SimilarityRankedProduct, type SimilarityRankingOptions, type SimilarityScore, type SimilarityWeights, } from './similarity.js';
12
13
  export { setAssistantHostVisible } from './util/assistant-host.js';
13
14
  export { resolveBeUrl } from './util/be-url.js';
14
15
  export { createBrowserMemory, stableKey } from './util/browser-memory.js';