@inkeep/agents-ui-cloud 0.15.15 → 0.15.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.
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@inkeep/agents-ui"),l=require("../default-settings.cjs"),g=require("./use-user-properties.cjs"),S=require("../utils/transform-source/index.cjs"),d=i=>{const s=o.mergeProps(l.defaultInkeepBaseSettings,i??{}),a=g.useUserProperties(s),{analyticsApiBaseUrl:m,transformSource:u}=s,c={userProperties:a,async onEvent(e){["modal_opened","modal_closed"].includes(e.eventName)},transformSource(e,t,r){const n=u?.(e,t,r);return S.transformInkeepSource?.(n??e,t,r)??n}};return o.mergeProps(s,c)};exports.useBaseSettings=d;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@inkeep/agents-ui"),l=require("../default-settings.cjs"),d=require("./use-user-properties.cjs"),g=require("../utils/transform-source/index.cjs"),S=i=>{const s=o.mergeProps(l.defaultInkeepBaseSettings,i??{}),a=d.useUserProperties(s),{analyticsApiBaseUrl:m,transformSource:c}=s,u={userProperties:a,async onEvent(e){["modal_opened","modal_closed"].includes(e.eventName)},async onFeedback(e){return e},transformSource(e,t,r){const n=c?.(e,t,r);return g.transformInkeepSource?.(n??e,t,r)??n}};return o.mergeProps(s,u)};exports.useBaseSettings=S;
@@ -1,45 +1,36 @@
1
1
  "use client";
2
- import { mergeProps as n } from "@inkeep/agents-ui";
3
- import { defaultInkeepBaseSettings as c } from "../default-settings.js";
2
+ import { mergeProps as o } from "@inkeep/agents-ui";
3
+ import { defaultInkeepBaseSettings as m } from "../default-settings.js";
4
4
  import { useUserProperties as p } from "./use-user-properties.js";
5
5
  import { transformInkeepSource as u } from "../utils/transform-source/index.js";
6
- const k = (i) => {
7
- const s = n(
8
- c,
9
- i ?? {}
10
- ), a = p(s), {
6
+ const B = (a) => {
7
+ const r = o(
8
+ m,
9
+ a ?? {}
10
+ ), i = p(r), {
11
11
  analyticsApiBaseUrl: f,
12
12
  // privacyPreferences,
13
13
  // env,
14
- transformSource: m
15
- } = s;
16
- return n(
17
- s,
14
+ transformSource: c
15
+ } = r;
16
+ return o(
17
+ r,
18
18
  {
19
- userProperties: a,
19
+ userProperties: i,
20
20
  async onEvent(e) {
21
21
  ["modal_opened", "modal_closed"].includes(e.eventName);
22
22
  },
23
- // we don't have this endpoint in the new api yet so we shouldn't show the feedback buttons
24
- // async onFeedback(feedback) {
25
- // return submitFeedback({
26
- // type: feedback.type,
27
- // messageId: feedback.messageId,
28
- // reasons: feedback.reasons,
29
- // // TODO
30
- // apiKey: '',
31
- // apiUrl: analyticsApiBaseUrl ?? '',
32
- // userProperties,
33
- // properties: feedback.properties,
34
- // })
35
- // },
36
- transformSource(e, t, r) {
37
- const o = m?.(e, t, r);
38
- return u?.(o ?? e, t, r) ?? o;
23
+ // we don't have this endpoint yet but we still want to show the feedback buttons
24
+ async onFeedback(e) {
25
+ return e;
26
+ },
27
+ transformSource(e, s, t) {
28
+ const n = c?.(e, s, t);
29
+ return u?.(n ?? e, s, t) ?? n;
39
30
  }
40
31
  }
41
32
  );
42
33
  };
43
34
  export {
44
- k as useBaseSettings
35
+ B as useBaseSettings
45
36
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),n=require("@inkeep/agents-ui"),a=require("../default-settings.cjs"),s=require("../utils/search-implementation.cjs"),u=({baseSettings:r,searchSettings:e})=>o.useMemo(()=>{const t=n.mergeProps(a.defaultInkeepSearchSettings,e??{}),c=e?.onSearch?e.onSearch:s.createInkeepSearchImplementation({baseSettings:r,searchSettings:t});return n.mergeProps(t,{onSearch:c})},[r,e]);exports.useSearchSettings=u;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),n=require("@inkeep/agents-ui"),a=require("../default-settings.cjs"),u=require("../utils/search-implementation.cjs"),s=({baseSettings:t,searchSettings:r})=>o.useMemo(()=>{const e=n.mergeProps(a.defaultInkeepSearchSettings,r??{});e.url&&(e.url=e.url.replace(/\/+$/,""));const c=r?.onSearch?r.onSearch:u.createInkeepSearchImplementation({baseSettings:t,searchSettings:e});return n.mergeProps(e,{onSearch:c})},[t,r]);exports.useSearchSettings=s;
@@ -3,21 +3,23 @@ import { useMemo as n } from "react";
3
3
  import { mergeProps as t } from "@inkeep/agents-ui";
4
4
  import { defaultInkeepSearchSettings as c } from "../default-settings.js";
5
5
  import { createInkeepSearchImplementation as p } from "../utils/search-implementation.js";
6
- const u = ({
7
- baseSettings: r,
8
- searchSettings: e
6
+ const S = ({
7
+ baseSettings: o,
8
+ searchSettings: r
9
9
  }) => n(() => {
10
- const o = t(
10
+ const e = t(
11
11
  c,
12
- e ?? {}
13
- ), m = e?.onSearch ? e.onSearch : p({
14
- baseSettings: r,
15
- searchSettings: o
12
+ r ?? {}
13
+ );
14
+ e.url && (e.url = e.url.replace(/\/+$/, ""));
15
+ const m = r?.onSearch ? r.onSearch : p({
16
+ baseSettings: o,
17
+ searchSettings: e
16
18
  });
17
- return t(o, {
19
+ return t(e, {
18
20
  onSearch: m
19
21
  });
20
- }, [r, e]);
22
+ }, [o, r]);
21
23
  export {
22
- u as useSearchSettings
24
+ S as useSearchSettings
23
25
  };
package/dist/index.d.cts CHANGED
@@ -2,9 +2,11 @@ import { InkeepAIChatSettings } from '@inkeep/agents-ui/types';
2
2
  import { InkeepBaseSettings } from '@inkeep/agents-ui/types';
3
3
  import { InkeepChatButtonModalProps as InkeepChatButtonModalProps_2 } from '@inkeep/agents-ui';
4
4
  import { InkeepChatButtonProps as InkeepChatButtonProps_2 } from '@inkeep/agents-ui';
5
+ import { InkeepComponentInstance } from '@inkeep/agents-ui/types';
5
6
  import { InkeepEmbeddedChatProps as InkeepEmbeddedChatProps_2 } from '@inkeep/agents-ui';
6
7
  import { InkeepEmbeddedSearchAndChatProps as InkeepEmbeddedSearchAndChatProps_2 } from '@inkeep/agents-ui';
7
8
  import { InkeepEmbeddedSearchProps as InkeepEmbeddedSearchProps_2 } from '@inkeep/agents-ui';
9
+ import { InkeepJSComponent } from '@inkeep/agents-ui/types';
8
10
  import { InkeepModalSearchAndChatProps as InkeepModalSearchAndChatProps_2 } from '@inkeep/agents-ui';
9
11
  import { InkeepSearchBarProps as InkeepSearchBarProps_2 } from '@inkeep/agents-ui';
10
12
  import { InkeepSearchSettings } from '@inkeep/agents-ui/types';
@@ -60,12 +62,23 @@ export declare interface InkeepCloudBaseSettings extends InkeepBaseSettings {
60
62
  env?: 'development' | 'production';
61
63
  }
62
64
 
65
+ export declare type InkeepCloudComponentInitializer = {
66
+ (props: InkeepCloudComponentProps): InkeepComponentInstance | undefined;
67
+ (targetSelector: string, props: InkeepCloudComponentProps): InkeepComponentInstance | undefined;
68
+ };
69
+
70
+ export declare type InkeepCloudComponentProps = InkeepCloudSettings & {
71
+ [key: string]: any;
72
+ };
73
+
63
74
  export declare interface InkeepCloudConfig {
64
75
  baseSettings: InkeepCloudBaseSettings;
65
76
  aiChatSettings: InkeepCloudAIChatSettings;
66
77
  searchSettings: InkeepCloudSearchSettings;
67
78
  }
68
79
 
80
+ export declare type InkeepCloudJS = Partial<Record<InkeepJSComponent, InkeepCloudComponentInitializer>>;
81
+
69
82
  export declare interface InkeepCloudSearchSettings extends InkeepSearchSettings {
70
83
  /**
71
84
  * The API key to use for authenticating with Inkeep's services.
@@ -99,6 +112,13 @@ export declare interface InkeepCloudSearchSettings extends InkeepSearchSettings
99
112
  onSearchWithFilters?: (searchInput: SearchInput, abortSignal: AbortSignal) => Promise<SearchHit[]>;
100
113
  }
101
114
 
115
+ export declare interface InkeepCloudSettings {
116
+ baseSettings?: InkeepCloudBaseSettings;
117
+ aiChatSettings?: InkeepCloudAIChatSettings;
118
+ searchSettings?: InkeepCloudSearchSettings;
119
+ openSettings?: OpenSettingsModal;
120
+ }
121
+
102
122
  export declare function InkeepEmbeddedChat(props: InkeepEmbeddedChatProps): JSX.Element;
103
123
 
104
124
  export declare interface InkeepEmbeddedChatProps extends InkeepEmbeddedChatProps_2 {
package/dist/index.d.ts CHANGED
@@ -2,9 +2,11 @@ import { InkeepAIChatSettings } from '@inkeep/agents-ui/types';
2
2
  import { InkeepBaseSettings } from '@inkeep/agents-ui/types';
3
3
  import { InkeepChatButtonModalProps as InkeepChatButtonModalProps_2 } from '@inkeep/agents-ui';
4
4
  import { InkeepChatButtonProps as InkeepChatButtonProps_2 } from '@inkeep/agents-ui';
5
+ import { InkeepComponentInstance } from '@inkeep/agents-ui/types';
5
6
  import { InkeepEmbeddedChatProps as InkeepEmbeddedChatProps_2 } from '@inkeep/agents-ui';
6
7
  import { InkeepEmbeddedSearchAndChatProps as InkeepEmbeddedSearchAndChatProps_2 } from '@inkeep/agents-ui';
7
8
  import { InkeepEmbeddedSearchProps as InkeepEmbeddedSearchProps_2 } from '@inkeep/agents-ui';
9
+ import { InkeepJSComponent } from '@inkeep/agents-ui/types';
8
10
  import { InkeepModalSearchAndChatProps as InkeepModalSearchAndChatProps_2 } from '@inkeep/agents-ui';
9
11
  import { InkeepSearchBarProps as InkeepSearchBarProps_2 } from '@inkeep/agents-ui';
10
12
  import { InkeepSearchSettings } from '@inkeep/agents-ui/types';
@@ -60,12 +62,23 @@ export declare interface InkeepCloudBaseSettings extends InkeepBaseSettings {
60
62
  env?: 'development' | 'production';
61
63
  }
62
64
 
65
+ export declare type InkeepCloudComponentInitializer = {
66
+ (props: InkeepCloudComponentProps): InkeepComponentInstance | undefined;
67
+ (targetSelector: string, props: InkeepCloudComponentProps): InkeepComponentInstance | undefined;
68
+ };
69
+
70
+ export declare type InkeepCloudComponentProps = InkeepCloudSettings & {
71
+ [key: string]: any;
72
+ };
73
+
63
74
  export declare interface InkeepCloudConfig {
64
75
  baseSettings: InkeepCloudBaseSettings;
65
76
  aiChatSettings: InkeepCloudAIChatSettings;
66
77
  searchSettings: InkeepCloudSearchSettings;
67
78
  }
68
79
 
80
+ export declare type InkeepCloudJS = Partial<Record<InkeepJSComponent, InkeepCloudComponentInitializer>>;
81
+
69
82
  export declare interface InkeepCloudSearchSettings extends InkeepSearchSettings {
70
83
  /**
71
84
  * The API key to use for authenticating with Inkeep's services.
@@ -99,6 +112,13 @@ export declare interface InkeepCloudSearchSettings extends InkeepSearchSettings
99
112
  onSearchWithFilters?: (searchInput: SearchInput, abortSignal: AbortSignal) => Promise<SearchHit[]>;
100
113
  }
101
114
 
115
+ export declare interface InkeepCloudSettings {
116
+ baseSettings?: InkeepCloudBaseSettings;
117
+ aiChatSettings?: InkeepCloudAIChatSettings;
118
+ searchSettings?: InkeepCloudSearchSettings;
119
+ openSettings?: OpenSettingsModal;
120
+ }
121
+
102
122
  export declare function InkeepEmbeddedChat(props: InkeepEmbeddedChatProps): JSX.Element;
103
123
 
104
124
  export declare interface InkeepEmbeddedChatProps extends InkeepEmbeddedChatProps_2 {
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@inkeep/agents-ui-cloud",
3
- "version": "0.15.15",
3
+ "version": "0.15.17",
4
4
  "description": "",
5
5
  "license": "Inkeep, Inc. Customer License (IICL) v1.1",
6
6
  "homepage": "",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/inkeep/widget",
9
+ "url": "git+https://github.com/inkeep/agents-ui",
10
10
  "directory": "packages/react"
11
11
  },
12
12
  "type": "module",
@@ -40,7 +40,7 @@
40
40
  "dependencies": {
41
41
  "@radix-ui/react-use-controllable-state": "^1.1.0",
42
42
  "lucide-react": "^0.503.0",
43
- "@inkeep/agents-ui": "0.15.15"
43
+ "@inkeep/agents-ui": "0.15.17"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@biomejs/biome": "1.9.4",