admesh-ui-sdk 1.0.20 → 1.0.22

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 (36) hide show
  1. package/dist/components/AdMeshFollowup.d.ts +34 -0
  2. package/dist/components/AdMeshFollowup.d.ts.map +1 -0
  3. package/dist/components/AdMeshRecommendations.d.ts +54 -44
  4. package/dist/components/AdMeshRecommendations.d.ts.map +1 -1
  5. package/dist/components/WeaveAdFormatContainer.d.ts +8 -0
  6. package/dist/components/WeaveAdFormatContainer.d.ts.map +1 -1
  7. package/dist/components/WeaveFallbackRecommendations.d.ts +11 -1
  8. package/dist/components/WeaveFallbackRecommendations.d.ts.map +1 -1
  9. package/dist/context/AdMeshContext.d.ts +9 -0
  10. package/dist/context/AdMeshContext.d.ts.map +1 -1
  11. package/dist/context/AdMeshProvider.d.ts +14 -0
  12. package/dist/context/AdMeshProvider.d.ts.map +1 -1
  13. package/dist/hooks/useAdMesh.d.ts +14 -0
  14. package/dist/hooks/useAdMesh.d.ts.map +1 -1
  15. package/dist/index.d.ts +2 -0
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +6 -6
  18. package/dist/index.js.map +1 -1
  19. package/dist/index.mjs +1813 -1264
  20. package/dist/index.mjs.map +1 -1
  21. package/dist/sdk/AdMeshRenderer.d.ts +6 -0
  22. package/dist/sdk/AdMeshRenderer.d.ts.map +1 -1
  23. package/dist/sdk/AdMeshSDK.d.ts +50 -11
  24. package/dist/sdk/AdMeshSDK.d.ts.map +1 -1
  25. package/dist/sdk/AdMeshSessionManager.d.ts +16 -5
  26. package/dist/sdk/AdMeshSessionManager.d.ts.map +1 -1
  27. package/dist/sdk/AdMeshTracker.d.ts +18 -0
  28. package/dist/sdk/AdMeshTracker.d.ts.map +1 -1
  29. package/dist/types/analytics.d.ts +4 -4
  30. package/dist/types/analytics.d.ts.map +1 -1
  31. package/dist/types/index.d.ts +129 -13
  32. package/dist/types/index.d.ts.map +1 -1
  33. package/dist/utils/streamingEvents.d.ts.map +1 -1
  34. package/dist/utils/viewabilityTracker.d.ts +6 -1
  35. package/dist/utils/viewabilityTracker.d.ts.map +1 -1
  36. package/package.json +1 -1
@@ -0,0 +1,34 @@
1
+ import { default as React } from 'react';
2
+ import { AdMeshRecommendation, AdMeshTheme } from '../types/index';
3
+ import { AdMeshSDK } from '../sdk/AdMeshSDK';
4
+ export interface AdMeshFollowupProps {
5
+ recommendation: AdMeshRecommendation;
6
+ theme?: AdMeshTheme;
7
+ sdk: AdMeshSDK;
8
+ sessionId: string;
9
+ onExecuteQuery?: (query: string) => void | Promise<void>;
10
+ }
11
+ /**
12
+ * AdMeshFollowup - Sponsored Follow-up Component
13
+ *
14
+ * Displays sponsored follow-up suggestions as optional fields on any recommendation.
15
+ * Follow-ups use the same recommendation_id as the primary ad and are rendered separately
16
+ * in a followups_container_id. This component handles all exposure and engagement tracking
17
+ * internally - platforms only need to provide an onExecuteQuery hook for query execution.
18
+ *
19
+ * @example
20
+ * ```tsx
21
+ * <AdMeshFollowup
22
+ * recommendation={recommendation}
23
+ * sdk={sdk}
24
+ * sessionId={sessionId}
25
+ * theme={theme}
26
+ * onExecuteQuery={(query) => {
27
+ * // Platform's query execution logic
28
+ * executeQuery(query);
29
+ * }}
30
+ * />
31
+ * ```
32
+ */
33
+ export declare const AdMeshFollowup: React.FC<AdMeshFollowupProps>;
34
+ //# sourceMappingURL=AdMeshFollowup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AdMeshFollowup.d.ts","sourceRoot":"","sources":["../../src/components/AdMeshFollowup.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG7C,MAAM,WAAW,mBAAmB;IAClC,cAAc,EAAE,oBAAoB,CAAC;IACrC,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,GAAG,EAAE,SAAS,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1D;AAoBD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAyFxD,CAAC"}
@@ -1,21 +1,4 @@
1
1
  export interface AdMeshRecommendationsProps {
2
- /**
3
- * Recommendation format (optional override)
4
- *
5
- * - 'product': Display as product cards
6
- * - 'tail': Display as tail format (default)
7
- * - 'bridge': Display as bridge format for followup sponsored recommendations
8
- *
9
- * If not provided, format is auto-detected from brand agent's `preferred_format`.
10
- * This prop can be used to override the auto-detection.
11
- *
12
- * Note: For Weave Ad Format (where AdMesh links are embedded in LLM response),
13
- * use WeaveAdFormatContainer component instead.
14
- *
15
- * Note: allowed_formats are configured during platform onboarding and fetched automatically
16
- * from the platform's configuration. No need to specify them in code.
17
- */
18
- format?: 'product' | 'tail' | 'bridge';
19
2
  /** Optional callback when recommendations are shown */
20
3
  onRecommendationsShown?: (messageId: string) => void;
21
4
  /** Optional callback on error */
@@ -37,19 +20,60 @@ export interface AdMeshRecommendationsProps {
37
20
  * The backend requires a valid query parameter.
38
21
  */
39
22
  query?: string;
40
- /**
41
- * Latency budget in milliseconds.
42
- *
43
- * How long the platform will wait for an ad response.
44
- * If not provided, the backend will use a default value.
45
- */
46
- latencyBudgetMs?: number;
47
23
  /**
48
24
  * Callback to paste content to input field (for bridge format CTA button).
49
25
  * When provided, the bridge format will show a CTA button that pastes
50
26
  * the bridge_content into the input field when clicked.
51
27
  */
52
28
  onPasteToInput?: (content: string) => void;
29
+ /**
30
+ * Optional container ID for follow-up suggestions.
31
+ * When provided and the recommendation includes a followup_query,
32
+ * the SDK will automatically render the follow-up in this container.
33
+ */
34
+ followups_container_id?: string;
35
+ /**
36
+ * Callback to execute query when follow-up is selected (required for follow-up functionality).
37
+ * When a user clicks on a follow-up suggestion, this callback is invoked with the followup_query.
38
+ * This allows the platform to continue the conversation with the sponsored follow-up query.
39
+ */
40
+ onExecuteQuery?: (query: string) => void | Promise<void>;
41
+ /**
42
+ * Callback when a sponsored followup is detected.
43
+ * This allows third-party applications to integrate the sponsored followup query into their own
44
+ * followup suggestions UI (e.g., adding to a suggestions list, related questions section, etc.).
45
+ *
46
+ * When a user clicks the followup suggestion, the application should:
47
+ * 1. Fire engagement tracking by calling the followupEngagementUrl
48
+ * 2. Execute the followupQuery (e.g., submit it as a new user query)
49
+ *
50
+ * @param followupQuery - The sponsored followup query text to display to the user
51
+ * @param followupEngagementUrl - The engagement tracking URL to call when user clicks the followup
52
+ * @param recommendationId - The recommendation ID for tracking and correlation
53
+ *
54
+ * @example
55
+ * ```tsx
56
+ * <AdMeshRecommendations
57
+ * onFollowupDetected={(query, engagementUrl, recId) => {
58
+ * // Add to your suggestions list
59
+ * setSuggestions(prev => [...prev, {
60
+ * text: query,
61
+ * sponsored: true,
62
+ * engagementUrl,
63
+ * recommendationId: recId
64
+ * }]);
65
+ * }}
66
+ * />
67
+ * ```
68
+ */
69
+ onFollowupDetected?: (followupQuery: string, followupEngagementUrl: string, recommendationId: string) => void;
70
+ /**
71
+ * Signal indicating if the followup container is ready in the DOM.
72
+ *
73
+ * Useful for scenarios where the container is rendered conditionally or after a delay (e.g. streaming).
74
+ * If provided, the component will wait until this is true before attempting to attach the portal.
75
+ */
76
+ isContainerReady?: boolean;
53
77
  }
54
78
  /**
55
79
  * AdMeshRecommendations - Citation/Product Format Recommendation Display
@@ -67,12 +91,12 @@ export interface AdMeshRecommendationsProps {
67
91
  * // Per-message recommendations with messageId
68
92
  * <AdMeshProvider apiKey={apiKey} sessionId={sessionId}>
69
93
  * {messages.map((msg) => (
70
- * <div key={msg.messageId}>
94
+ * <div key={msg.messageId}>
71
95
  * {msg.content}
72
96
  * {msg.role === 'assistant' && (
73
- * <AdMeshRecommendations
74
- * messageId={msg.messageId}
75
- * format="tail"
97
+ * <AdMeshRecommendations
98
+ * messageId={msg.messageId}
99
+ * query={msg.userQuery}
76
100
  * />
77
101
  * )}
78
102
  * </div>
@@ -82,30 +106,16 @@ export interface AdMeshRecommendationsProps {
82
106
  *
83
107
  * @example
84
108
  * ```tsx
85
- * // Product card format recommendations
109
+ * // Format is auto-detected from brand agent's preferred_format
86
110
  * <AdMeshProvider apiKey={apiKey} sessionId={sessionId}>
87
111
  * <Chat messages={messages} />
88
112
  * <AdMeshRecommendations
89
113
  * messageId={lastMessageId}
90
114
  * query="best CRM for small business"
91
- * format="product"
92
- * />
93
- * </AdMeshProvider>
94
- * ```
95
- *
96
- * @example
97
- * ```tsx
98
- * // Bridge format for followup sponsored recommendations (Vibe Coding Platforms, AI IDEs, AI search)
99
- * <AdMeshProvider apiKey={apiKey} sessionId={sessionId}>
100
- * <Chat messages={messages} />
101
- * <AdMeshRecommendations
102
- * messageId={lastMessageId}
103
- * query="how to set up a CRM system"
104
- * format="bridge"
105
115
  * />
106
116
  * </AdMeshProvider>
107
117
  * ```
108
118
  */
109
- export declare const AdMeshRecommendations: ({ format, onRecommendationsShown, onError, messageId, query, latencyBudgetMs, onPasteToInput, }: AdMeshRecommendationsProps) => import("react/jsx-runtime").JSX.Element | null;
119
+ export declare const AdMeshRecommendations: ({ onRecommendationsShown, onError, messageId, query, onPasteToInput, followups_container_id: _followups_container_id, onExecuteQuery: _onExecuteQuery, onFollowupDetected, isContainerReady, }: AdMeshRecommendationsProps) => import("react/jsx-runtime").JSX.Element | null;
110
120
  export default AdMeshRecommendations;
111
121
  //# sourceMappingURL=AdMeshRecommendations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AdMeshRecommendations.d.ts","sourceRoot":"","sources":["../../src/components/AdMeshRecommendations.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,0BAA0B;IACzC;;;;;;;;;;;;;;;OAeG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KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IAEH,kBAAkB,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,KAAK,IAAI,CAAC;IAE9G;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,eAAO,MAAM,qBAAqB,GAAI,gMAWnC,0BAA0B,mDA6X5B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -22,6 +22,14 @@ export interface WeaveAdFormatContainerProps {
22
22
  onWeaveAttempt?: (messageId: string) => void;
23
23
  /** Optional callback when weave injection outcome is determined */
24
24
  onWeaveOutcome?: (messageId: string, success: boolean, reason?: string) => void;
25
+ /** Optional container ID for follow-up suggestions */
26
+ followups_container_id?: string;
27
+ /** Callback to execute query when follow-up is selected (required for follow-up functionality) */
28
+ onExecuteQuery?: (query: string) => void | Promise<void>;
29
+ /** Optional callback when a sponsored followup is detected */
30
+ onFollowupDetected?: (followupQuery: string, followupEngagementUrl: string, recommendationId: string) => void;
31
+ /** Signal indicating if the followup container is ready in the DOM */
32
+ isContainerReady?: boolean;
25
33
  }
26
34
  /**
27
35
  * WeaveAdFormatContainer - Automatic Weave Ad Format handling component
@@ -1 +1 @@
1
- {"version":3,"file":"WeaveAdFormatContainer.d.ts","sourceRoot":"","sources":["../../src/components/WeaveAdFormatContainer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmD,MAAM,OAAO,CAAC;AA4MxE,MAAM,WAAW,2BAA2B;IAC1C,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAElB,0DAA0D;IAC1D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B,6DAA6D;IAC7D,cAAc,CAAC,EAAE,SAAS,G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BAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAE/B,iCAAiC;IACjC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAEjC,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,mFAAmF;IACnF,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,qEAAqE;IACrE,gBAAgB,CAAC,EAAE,CAAC,cAAc,EAAE,OAAO,KAAK,IAAI,CAAC;IAErD,0DAA0D;IAC1D,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAE7C,mEAAmE;IACnE,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAEhF,sDAAsD;IACtD,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC,kGAAkG;IAClG,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzD,8DAA8D;IAC9D,kBAAkB,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,KAAK,IAAI,CAAC;IAE9G,sEAAsE;IACtE,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CA+WxE,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -31,6 +31,12 @@ export interface WeaveFallbackRecommendationsProps {
31
31
  * When false or undefined, component will not render
32
32
  */
33
33
  fallback?: boolean;
34
+ /**
35
+ * Previously fetched recommendations from WeaveAdFormatContainer.
36
+ * If provided and not empty, these will be rendered directly without making a new API call.
37
+ * Only makes a new API call if this is empty/null/undefined.
38
+ */
39
+ previousRecommendations?: any[];
34
40
  }
35
41
  /**
36
42
  * WeaveFallbackRecommendations - Weave Format Fallback Component
@@ -41,9 +47,12 @@ export interface WeaveFallbackRecommendationsProps {
41
47
  * This component will:
42
48
  * - Accept messageId, query, and fallback state as props
43
49
  * - Only render when fallback prop is true
44
- * - Call SDK's showRecommendations() to fetch fresh recommendations
50
+ * - If previousRecommendations are provided and not empty: renders them directly (no API call)
51
+ * - If previousRecommendations are empty/null: calls SDK's showRecommendations() to fetch recommendations
45
52
  * - Display recommendations in the specified format (tail or product)
46
53
  *
54
+ * IMPORTANT: Pass previousRecommendations from WeaveAdFormatContainer to avoid duplicate API calls.
55
+ *
47
56
  * @example
48
57
  * ```tsx
49
58
  * const [fallback, setFallback] = useState(false);
@@ -61,6 +70,7 @@ export interface WeaveFallbackRecommendationsProps {
61
70
  * query={userQuery}
62
71
  * format="tail"
63
72
  * fallback={fallback}
73
+ * previousRecommendations={recommendations} // Pass from WeaveAdFormatContainer
64
74
  * />
65
75
  * </AdMeshProvider>
66
76
  * ```
@@ -1 +1 @@
1
- {"version":3,"file":"WeaveFallbackRecommendations.d.ts","sourceRoot":"","sources":["../../src/components/WeaveFallbackRecommendations.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAI3D,MAAM,WAAW,iCAAiC;IAChD;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAE5B,iCAAiC;IACjC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAEjC;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,4BAA4B,EAAE,KAAK,CAAC,EAAE,CAAC,iCAAiC,CA6FpF,CAAC;AAEF,eAAe,4BAA4B,CAAC"}
1
+ {"version":3,"file":"WeaveFallbackRecommendations.d.ts","sourceRoot":"","sources":["../../src/components/WeaveFallbackRecommendations.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAI3D,MAAM,WAAW,iCAAiC;IAChD;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAE5B,iCAAiC;IACjC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAEjC;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,GAAG,EAAE,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,4BAA4B,EAAE,KAAK,CAAC,EAAE,CAAC,iCAAiC,CAuOpF,CAAC;AAEF,eAAe,4BAA4B,CAAC"}
@@ -9,6 +9,15 @@ export interface AdMeshContextValue {
9
9
  apiKey: string;
10
10
  sessionId: string;
11
11
  theme?: AdMeshTheme;
12
+ language?: string;
13
+ geo_country?: string;
14
+ userId?: string;
15
+ model?: string;
16
+ messages?: Array<{
17
+ role: string;
18
+ content: string;
19
+ id?: string;
20
+ }>;
12
21
  processedMessageIds: Set<string>;
13
22
  markMessageAsProcessed: (messageId: string) => void;
14
23
  isMessageProcessed: (messageId: string) => boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"AdMeshContext.d.ts","sourceRoot":"","sources":["../../src/context/AdMeshContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC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C;IAGjE,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAGjC,sBAAsB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,kBAAkB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;CACpD;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,+CAEzB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,kBAAkB,CAWrD"}
@@ -9,6 +9,20 @@ export interface AdMeshProviderProps {
9
9
  theme?: AdMeshTheme;
10
10
  /** Optional API base URL (defaults to production) */
11
11
  apiBaseUrl?: string;
12
+ /** Optional user language in BCP 47 format (e.g., "en-US") */
13
+ language?: string;
14
+ /** Optional user country code in ISO 3166-1 alpha-2 format (e.g., "US") */
15
+ geo_country?: string;
16
+ /** Optional anonymous hashed user ID */
17
+ userId?: string;
18
+ /** Optional AI model identifier (e.g., "gpt-4o") - used for producer.software_version in UCP PlatformRequest */
19
+ model?: string;
20
+ /** Optional conversation history - used for extensions.aip.messages in UCP PlatformRequest */
21
+ messages?: Array<{
22
+ role: string;
23
+ content: string;
24
+ id?: string;
25
+ }>;
12
26
  /** Child components */
13
27
  children: React.ReactNode;
14
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AdMeshProvider.d.ts","sourceRoot":"","sources":["../../src/context/AdMeshProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAI3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,mBAAmB;IAClC,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;IAEf,4BAA4B;IAC5B,SAAS,EAAE,MAAM,CAAC;IAElB,mCAAmC;IACnC,KAAK,CAAC,EAAE,WAAW,CAAC;IAEpB,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,uBAAuB;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAiExD,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"AdMeshProvider.d.ts","sourceRoot":"","sources":["../../src/context/AdMeshProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAI3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,mBAAmB;IAClC,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;IAEf,4BAA4B;IAC5B,SAAS,EAAE,MAAM,CAAC;IAElB,mCAAmC;IACnC,KAAK,CAAC,EAAE,WAAW,CAAC;IAEpB,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,2EAA2E;IAC3E,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,gHAAgH;IAChH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,8FAA8F;IAC9F,QAAQ,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAEjE,uBAAuB;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAyFxD,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -30,6 +30,20 @@ export declare function useAdMesh(): {
30
30
  sessionId: string;
31
31
  /** Theme configuration */
32
32
  theme: import('..').AdMeshTheme | undefined;
33
+ /** User language in BCP 47 format (e.g., "en-US") - from AdMeshProvider */
34
+ language: string | undefined;
35
+ /** User country code in ISO 3166-1 alpha-2 format (e.g., "US") - from AdMeshProvider */
36
+ geo_country: string | undefined;
37
+ /** Anonymous hashed user ID - from AdMeshProvider */
38
+ userId: string | undefined;
39
+ /** AI model identifier (e.g., "gpt-4o") - from AdMeshProvider */
40
+ model: string | undefined;
41
+ /** Conversation history - from AdMeshProvider */
42
+ messages: {
43
+ role: string;
44
+ content: string;
45
+ id?: string;
46
+ }[] | undefined;
33
47
  /** Set of processed message IDs (for deduplication) */
34
48
  processedMessageIds: Set<string>;
35
49
  /** Mark a message as processed to prevent duplicate recommendations */
@@ -1 +1 @@
1
- {"version":3,"file":"useAdMesh.d.ts","sourceRoot":"","sources":["../../src/hooks/useAdMesh.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,SAAS;IAIrB,0BAA0B;;IAG1B,cAAc;;IAGd,iBAAiB;;IAGjB,0BAA0B;;IAG1B,uDAAuD;;IAGvD,uEAAuE;;IAGvE,oDAAoD;;EAGvD;AAED,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"useAdMesh.d.ts","sourceRoot":"","sources":["../../src/hooks/useAdMesh.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,SAAS;IAIrB,0BAA0B;;IAG1B,cAAc;;IAGd,iBAAiB;;IAGjB,0BAA0B;;IAG1B,2EAA2E;;IAG3E,wFAAwF;;IAGxF,qDAAqD;;IAGrD,iEAAiE;;IAGjE,iDAAiD;;;;;;IAGjD,uDAAuD;;IAGvD,uEAAuE;;IAGvE,oDAAoD;;EAGvD;AAED,eAAe,SAAS,CAAC"}
package/dist/index.d.ts CHANGED
@@ -30,6 +30,8 @@ export { AdMeshTailAd } from './components/AdMeshTailAd';
30
30
  export type { AdMeshTailAdProps } from './components/AdMeshTailAd';
31
31
  export { AdMeshBridgeFormat } from './components/AdMeshBridgeFormat';
32
32
  export type { AdMeshBridgeFormatProps } from './components/AdMeshBridgeFormat';
33
+ export { AdMeshFollowup } from './components/AdMeshFollowup';
34
+ export type { AdMeshFollowupProps } from './components/AdMeshFollowup';
33
35
  export { AdMeshTailAd as AdMeshSummaryUnit } from './components/AdMeshTailAd';
34
36
  export type { AdMeshTailAdProps as AdMeshSummaryUnitProps } from './components/AdMeshTailAd';
35
37
  export { AdMeshViewabilityTracker } from './components/AdMeshViewabilityTracker';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,YAAY,EAAE,eAAe,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAGnF,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGzD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAMlF,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,YAAY,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAGpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,YAAY,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AACzF,YAAY,EAAE,iCAAiC,EAAE,MAAM,2CAA2C,CAAC;AAGnG,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,y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