@inkeep/agents-ui 0.0.0-dev-20260509025038 → 0.0.0-dev-20260511170227

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.
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react/jsx-runtime"),h=require("react"),j=require("./config-provider.cjs"),w=require("./chat-auth-provider.cjs"),B=require("../hooks/use-events-api.cjs"),O=require("./base-events-provider.cjs"),U=({children:y})=>{const{baseSettings:n,aiChatSettings:P,componentType:r}=j.useInkeepConfig(),{tags:a,analyticsProperties:i,privacyPreferences:b,userProperties:t}=n,c="0.16.1",p=h.useMemo(()=>({widgetLibraryVersion:c,componentType:r,tags:a}),[r,a,c]),{effectiveAuthToken:o,applicableRefreshSession:f,getCaptchaHeader:m,invalidateCaptcha:E}=w.useChatAuth(),{baseUrl:A,appId:C,analyticsApiBaseUrl:I}=P,v=b?.optOutAllAnalytics??!1,{logEvent:l}=B.useEventsApi({baseUrl:I??A,appId:C,authToken:o,getCaptchaHeader:m,invalidateCaptcha:E,refreshSession:f}),k={logEvent:h.useCallback(async s=>{const u={...p,...s.properties,...i},q={eventName:s.eventName,properties:u};if(!v&&o){const e=s.properties??{},d=typeof e.conversationId=="string"?e.conversationId:void 0,g=typeof e.messageId=="string"?e.messageId:void 0,S=!!t&&Object.keys(t).length>0;l({body:{type:s.eventName,...d?{conversationId:d}:{},...g?{messageId:g}:{},...S?{userProperties:t}:{},properties:u}})}try{return await n.onEvent?.(q)}catch(e){console.warn("[events] onEvent callback threw",e)}},[n,p,i,l,v,o,t])};return T.jsx(O.BaseEventsContext.Provider,{value:k,children:y})};exports.ChatBaseEventsProvider=U;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react/jsx-runtime"),g=require("react"),j=require("./config-provider.cjs"),B=require("./chat-auth-provider.cjs"),O=require("../hooks/use-events-api.cjs"),U=require("./base-events-provider.cjs"),x=({children:h})=>{const{baseSettings:n,aiChatSettings:y,componentType:c}=j.useInkeepConfig(),{tags:t,analyticsProperties:r,privacyPreferences:b,userProperties:o}=n,p="0.16.1",a=g.useMemo(()=>({widgetLibraryVersion:p,componentType:c}),[c,p]),{effectiveAuthToken:i,applicableRefreshSession:f,getCaptchaHeader:E,invalidateCaptcha:P}=B.useChatAuth(),{baseUrl:m,appId:A,analyticsApiBaseUrl:C}=y,l=b?.optOutAllAnalytics??!1,{logEvent:v}=O.useEventsApi({baseUrl:C??m,appId:A,authToken:i,getCaptchaHeader:E,invalidateCaptcha:P,refreshSession:f}),I={logEvent:g.useCallback(async s=>{const k={eventName:s.eventName,properties:{...a,...t?{tags:t}:{},...s.properties,...r}};if(!l&&i){const e=s.properties??{},u=typeof e.conversationId=="string"?e.conversationId:void 0,d=typeof e.messageId=="string"?e.messageId:void 0,q=!!o&&Object.keys(o).length>0,S={...t?{tags:t}:{},...r??{}},w={...a,...s.properties};v({body:{type:s.eventName,...u?{conversationId:u}:{},...d?{messageId:d}:{},...q?{userProperties:o}:{},properties:S,metadata:w}})}try{return await n.onEvent?.(k)}catch(e){console.warn("[events] onEvent callback threw",e)}},[n,a,t,r,v,l,i,o])};return T.jsx(U.BaseEventsContext.Provider,{value:I,children:h})};exports.ChatBaseEventsProvider=x;
@@ -1,65 +1,73 @@
1
1
  "use client";
2
- import { jsx as S } from "react/jsx-runtime";
3
- import { useMemo as T, useCallback as U } from "react";
4
- import { useInkeepConfig as x } from "./config-provider.js";
5
- import { useChatAuth as B } from "./chat-auth-provider.js";
6
- import { useEventsApi as N } from "../hooks/use-events-api.js";
7
- import { BaseEventsContext as O } from "./base-events-provider.js";
8
- const z = ({ children: g }) => {
9
- const { baseSettings: s, aiChatSettings: u, componentType: r } = x(), { tags: a, analyticsProperties: i, privacyPreferences: h, userProperties: t } = s, c = "0.16.1", p = T(
2
+ import { jsx as T } from "react/jsx-runtime";
3
+ import { useMemo as U, useCallback as x } from "react";
4
+ import { useInkeepConfig as B } from "./config-provider.js";
5
+ import { useChatAuth as N } from "./chat-auth-provider.js";
6
+ import { useEventsApi as O } from "../hooks/use-events-api.js";
7
+ import { BaseEventsContext as j } from "./base-events-provider.js";
8
+ const D = ({ children: g }) => {
9
+ const { baseSettings: n, aiChatSettings: f, componentType: c } = B(), { tags: t, analyticsProperties: r, privacyPreferences: u, userProperties: o } = n, p = "0.16.1", a = U(
10
10
  () => ({
11
- widgetLibraryVersion: c,
12
- componentType: r,
13
- tags: a
11
+ widgetLibraryVersion: p,
12
+ componentType: c
14
13
  }),
15
- [r, a, c]
16
- ), { effectiveAuthToken: n, applicableRefreshSession: y, getCaptchaHeader: b, invalidateCaptcha: A } = B(), { baseUrl: E, appId: C, analyticsApiBaseUrl: I } = u, l = h?.optOutAllAnalytics ?? !1, { logEvent: v } = N({
17
- baseUrl: I ?? E,
18
- appId: C,
19
- authToken: n,
20
- getCaptchaHeader: b,
21
- invalidateCaptcha: A,
22
- refreshSession: y
23
- }), P = { logEvent: U(
24
- async (o) => {
25
- const m = {
26
- ...p,
27
- ...o.properties,
28
- ...i
29
- }, k = {
30
- eventName: o.eventName,
31
- properties: m
14
+ [c, p]
15
+ ), { effectiveAuthToken: i, applicableRefreshSession: h, getCaptchaHeader: y, invalidateCaptcha: b } = N(), { baseUrl: A, appId: E, analyticsApiBaseUrl: C } = f, l = u?.optOutAllAnalytics ?? !1, { logEvent: v } = O({
16
+ baseUrl: C ?? A,
17
+ appId: E,
18
+ authToken: i,
19
+ getCaptchaHeader: y,
20
+ invalidateCaptcha: b,
21
+ refreshSession: h
22
+ }), I = { logEvent: x(
23
+ async (s) => {
24
+ const P = {
25
+ eventName: s.eventName,
26
+ properties: {
27
+ ...a,
28
+ ...t ? { tags: t } : {},
29
+ ...s.properties,
30
+ ...r
31
+ }
32
32
  };
33
- if (!l && n) {
34
- const e = o.properties ?? {}, d = typeof e.conversationId == "string" ? e.conversationId : void 0, f = typeof e.messageId == "string" ? e.messageId : void 0, w = !!t && Object.keys(t).length > 0;
33
+ if (!l && i) {
34
+ const e = s.properties ?? {}, m = typeof e.conversationId == "string" ? e.conversationId : void 0, d = typeof e.messageId == "string" ? e.messageId : void 0, k = !!o && Object.keys(o).length > 0, w = {
35
+ ...t ? { tags: t } : {},
36
+ ...r ?? {}
37
+ }, S = {
38
+ ...a,
39
+ ...s.properties
40
+ };
35
41
  v({
36
42
  body: {
37
- type: o.eventName,
38
- ...d ? { conversationId: d } : {},
39
- ...f ? { messageId: f } : {},
40
- ...w ? { userProperties: t } : {},
41
- properties: m
43
+ type: s.eventName,
44
+ ...m ? { conversationId: m } : {},
45
+ ...d ? { messageId: d } : {},
46
+ ...k ? { userProperties: o } : {},
47
+ properties: w,
48
+ metadata: S
42
49
  }
43
50
  });
44
51
  }
45
52
  try {
46
- return await s.onEvent?.(k);
53
+ return await n.onEvent?.(P);
47
54
  } catch (e) {
48
55
  console.warn("[events] onEvent callback threw", e);
49
56
  }
50
57
  },
51
58
  [
52
- s,
53
- p,
54
- i,
59
+ n,
60
+ a,
61
+ t,
62
+ r,
55
63
  v,
56
64
  l,
57
- n,
58
- t
65
+ i,
66
+ o
59
67
  ]
60
68
  ) };
61
- return /* @__PURE__ */ S(O.Provider, { value: P, children: g });
69
+ return /* @__PURE__ */ T(j.Provider, { value: I, children: g });
62
70
  };
63
71
  export {
64
- z as ChatBaseEventsProvider
72
+ D as ChatBaseEventsProvider
65
73
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-ui",
3
- "version": "0.0.0-dev-20260509025038",
3
+ "version": "0.0.0-dev-20260511170227",
4
4
  "description": "",
5
5
  "homepage": "",
6
6
  "repository": {