@inkeep/agents-ui 0.15.25 → 0.15.27

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 (99) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +166 -174
  3. package/dist/primitives/atoms/dialog.cjs +1 -1
  4. package/dist/primitives/atoms/dialog.js +110 -106
  5. package/dist/primitives/atoms/file-upload.cjs +1 -0
  6. package/dist/primitives/atoms/file-upload.d.ts +35 -0
  7. package/dist/primitives/atoms/file-upload.js +45 -0
  8. package/dist/primitives/atoms/icons/built-in-icons.cjs +1 -1
  9. package/dist/primitives/atoms/icons/built-in-icons.d.ts +8 -1
  10. package/dist/primitives/atoms/icons/built-in-icons.js +86 -79
  11. package/dist/primitives/atoms/icons/collections/pi.cjs +1 -1
  12. package/dist/primitives/atoms/icons/collections/pi.d.ts +6 -0
  13. package/dist/primitives/atoms/icons/collections/pi.js +103 -13
  14. package/dist/primitives/atoms/icons/inkeep-default-icons.cjs +1 -1
  15. package/dist/primitives/atoms/icons/inkeep-default-icons.js +9 -1
  16. package/dist/primitives/components/embedded-chat/file-upload-input.cjs +1 -0
  17. package/dist/primitives/components/embedded-chat/file-upload-input.d.ts +68 -0
  18. package/dist/primitives/components/embedded-chat/file-upload-input.js +328 -0
  19. package/dist/primitives/components/embedded-chat/image-preview-modal.cjs +1 -0
  20. package/dist/primitives/components/embedded-chat/image-preview-modal.d.ts +15 -0
  21. package/dist/primitives/components/embedded-chat/image-preview-modal.js +71 -0
  22. package/dist/primitives/components/embedded-chat/use-inkeep-chat.cjs +3 -3
  23. package/dist/primitives/components/embedded-chat/use-inkeep-chat.d.ts +7 -5
  24. package/dist/primitives/components/embedded-chat/use-inkeep-chat.js +287 -247
  25. package/dist/primitives/components/embedded-chat.cjs +4 -4
  26. package/dist/primitives/components/embedded-chat.d.ts +7 -116
  27. package/dist/primitives/components/embedded-chat.js +1082 -1484
  28. package/dist/primitives/components/embedded-search.d.ts +1 -1
  29. package/dist/primitives/hooks/index.cjs +1 -1
  30. package/dist/primitives/hooks/index.js +15 -14
  31. package/dist/primitives/hooks/use-input-notification.cjs +1 -0
  32. package/dist/primitives/hooks/use-input-notification.d.ts +9 -0
  33. package/dist/primitives/hooks/use-input-notification.js +18 -0
  34. package/dist/primitives/hooks/use-scrolling-fades.cjs +1 -1
  35. package/dist/primitives/hooks/use-scrolling-fades.d.ts +1 -0
  36. package/dist/primitives/hooks/use-scrolling-fades.js +21 -5
  37. package/dist/primitives/index.cjs +1 -1
  38. package/dist/primitives/index.js +146 -154
  39. package/dist/primitives/providers/base-events-provider.cjs +1 -1
  40. package/dist/primitives/providers/base-events-provider.js +1 -1
  41. package/dist/primitives/providers/feedback-provider.cjs +1 -1
  42. package/dist/primitives/providers/feedback-provider.js +37 -38
  43. package/dist/primitives/providers/image-preview-provider.cjs +1 -0
  44. package/dist/primitives/providers/image-preview-provider.d.ts +15 -0
  45. package/dist/primitives/providers/image-preview-provider.js +23 -0
  46. package/dist/primitives/providers/index.cjs +1 -1
  47. package/dist/primitives/providers/index.d.ts +0 -3
  48. package/dist/primitives/providers/index.js +54 -63
  49. package/dist/primitives/utils/component-ids.cjs +1 -1
  50. package/dist/primitives/utils/component-ids.d.ts +54 -98
  51. package/dist/primitives/utils/component-ids.js +44 -66
  52. package/dist/primitives/utils/default-settings.cjs +1 -1
  53. package/dist/primitives/utils/default-settings.d.ts +0 -2
  54. package/dist/primitives/utils/default-settings.js +6 -8
  55. package/dist/react/embedded-chat.cjs +1 -1
  56. package/dist/react/embedded-chat.js +283 -287
  57. package/dist/react/index.cjs +1 -1
  58. package/dist/react/index.js +166 -174
  59. package/dist/styled/components/chat-history.cjs +1 -1
  60. package/dist/styled/components/chat-history.d.ts +1 -1
  61. package/dist/styled/components/chat-history.js +31 -29
  62. package/dist/styled/components/embedded-chat/file-upload-input.cjs +1 -0
  63. package/dist/styled/components/embedded-chat/file-upload-input.d.ts +20 -0
  64. package/dist/styled/components/embedded-chat/file-upload-input.js +300 -0
  65. package/dist/styled/components/embedded-chat/image-preview-modal.cjs +1 -0
  66. package/dist/styled/components/embedded-chat/image-preview-modal.d.ts +11 -0
  67. package/dist/styled/components/embedded-chat/image-preview-modal.js +77 -0
  68. package/dist/styled/components/embedded-chat.cjs +1 -1
  69. package/dist/styled/components/embedded-chat.d.ts +4 -50
  70. package/dist/styled/components/embedded-chat.js +567 -1010
  71. package/dist/styled/components/message.cjs +1 -1
  72. package/dist/styled/components/message.js +89 -88
  73. package/dist/styled/components/ui/recipes/citation.d.ts +1 -1
  74. package/dist/styled/components/ui/recipes/index.cjs +1 -1
  75. package/dist/styled/components/ui/recipes/index.d.ts +0 -1
  76. package/dist/styled/components/ui/recipes/index.js +31 -33
  77. package/dist/styled/index.cjs +1 -1
  78. package/dist/styled/index.js +154 -162
  79. package/dist/styled/inkeep.css.cjs +241 -61
  80. package/dist/styled/inkeep.css.js +241 -61
  81. package/dist/types/config/ai.d.ts +1 -10
  82. package/dist/types/icons/built-in.d.ts +1 -1
  83. package/dist/types/icons/custom.d.ts +8 -0
  84. package/dist/types/index.d.ts +0 -1
  85. package/package.json +7 -6
  86. package/dist/primitives/providers/attachment-item-provider.cjs +0 -1
  87. package/dist/primitives/providers/attachment-item-provider.d.ts +0 -9
  88. package/dist/primitives/providers/attachment-item-provider.js +0 -13
  89. package/dist/primitives/providers/attachments-bar-provider.cjs +0 -1
  90. package/dist/primitives/providers/attachments-bar-provider.d.ts +0 -30
  91. package/dist/primitives/providers/attachments-bar-provider.js +0 -57
  92. package/dist/primitives/providers/message-attachments-provider.cjs +0 -1
  93. package/dist/primitives/providers/message-attachments-provider.d.ts +0 -13
  94. package/dist/primitives/providers/message-attachments-provider.js +0 -27
  95. package/dist/primitives/utils/get-message-metadata.d.ts +0 -8
  96. package/dist/styled/components/ui/recipes/attachment.cjs +0 -1
  97. package/dist/styled/components/ui/recipes/attachment.d.ts +0 -4
  98. package/dist/styled/components/ui/recipes/attachment.js +0 -28
  99. package/dist/types/config/settings/workflow.d.ts +0 -86
@@ -27,6 +27,14 @@ export interface CustomIcons {
27
27
  chatHistory: string;
28
28
  chatHistoryPanel: string;
29
29
  backToChat: string;
30
+ fileUpload: string;
31
+ filePdf: string;
32
+ fileText: string;
33
+ fileMarkdown: string;
34
+ fileHtml: string;
35
+ fileCsv: string;
36
+ fileLog: string;
37
+ fileJson: string;
30
38
  }
31
39
  export type CustomIconMap = {
32
40
  [K in keyof CustomIcons]?: InkeepCustomIcon;
@@ -1,6 +1,5 @@
1
1
  export * from './config/settings/actions';
2
2
  export * from './config/settings/form';
3
- export * from './config/settings/workflow';
4
3
  export * from './config/settings/jsonschema';
5
4
  export * from './config';
6
5
  export * from './config/ai';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-ui",
3
- "version": "0.15.25",
3
+ "version": "0.15.27",
4
4
  "description": "",
5
5
  "homepage": "",
6
6
  "repository": {
@@ -65,11 +65,12 @@
65
65
  "@radix-ui/react-use-callback-ref": "^1.1.0",
66
66
  "@radix-ui/react-use-controllable-state": "^1.1.0",
67
67
  "@radix-ui/react-use-layout-effect": "^1.1.1",
68
- "@zag-js/combobox": "^1.33.1",
69
- "@zag-js/focus-trap": "^1.33.1",
70
- "@zag-js/presence": "^1.33.1",
71
- "@zag-js/react": "^1.33.1",
72
- "@zag-js/remove-scroll": "^1.33.1",
68
+ "@zag-js/combobox": "^1.38.1",
69
+ "@zag-js/file-upload": "^1.38.1",
70
+ "@zag-js/focus-trap": "^1.38.1",
71
+ "@zag-js/presence": "^1.38.1",
72
+ "@zag-js/react": "^1.38.1",
73
+ "@zag-js/remove-scroll": "^1.38.1",
73
74
  "ai": "6.0.44",
74
75
  "altcha-lib": "^1.2.0",
75
76
  "aria-hidden": "^1.2.4",
@@ -1 +0,0 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),e=require("react"),n=e.createContext(void 0),c=({children:t,attachment:r})=>o.jsx(n.Provider,{value:{attachment:r},children:t}),m=()=>{const t=e.useContext(n);if(!t)throw new Error("useAttachmentItem must be used within a AttachmentItemProvider");return t};exports.AttachmentItemProvider=c;exports.useAttachmentItem=m;
@@ -1,9 +0,0 @@
1
- import { MessageAttachment } from '../../types/index.ts';
2
- export type AttachmentItemContextValue = {
3
- attachment: MessageAttachment;
4
- };
5
- export declare const AttachmentItemProvider: React.FC<{
6
- children: React.ReactNode;
7
- attachment: MessageAttachment;
8
- }>;
9
- export declare const useAttachmentItem: () => AttachmentItemContextValue;
@@ -1,13 +0,0 @@
1
- "use client";
2
- import { jsx as o } from "react/jsx-runtime";
3
- import { createContext as n, useContext as m } from "react";
4
- const e = n(void 0), i = ({ children: t, attachment: r }) => /* @__PURE__ */ o(e.Provider, { value: { attachment: r }, children: t }), u = () => {
5
- const t = m(e);
6
- if (!t)
7
- throw new Error("useAttachmentItem must be used within a AttachmentItemProvider");
8
- return t;
9
- };
10
- export {
11
- i as AttachmentItemProvider,
12
- u as useAttachmentItem
13
- };
@@ -1 +0,0 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react/jsx-runtime"),n=require("react"),b=require("../hooks/use-boolean.cjs"),d=n.createContext(void 0);function B(){const[t,s]=n.useState(null),{value:m,setTrue:v,setFalse:c}=b.useBoolean(!1),[a,u]=n.useState({title:"",content:""}),[f,l]=n.useState({title:void 0,content:void 0}),o={data:a,errors:f,labels:{title:t?.workflowModalProps?.titleInputLabel||"Title",content:t?.contentType.contentInputLabel||"Content"},validate(){const e={};return a.title.trim()||(e.title=`${o.labels.title} is required`),a.content.trim()||(e.content=`${o.labels.content} is required`),e},onChange(e){const{name:r,value:i}=e.target;u(h=>({...h,[r]:i}))},onSubmit(e){if(e.preventDefault(),!t?.contentType)return;const r=o.validate();if(Object.values(r).some(i=>!!i)){l(r);return}c(),u({title:"",content:""}),l({title:void 0,content:void 0})}};return{selectedInput:t,selectInput:s,isOpen:m,onOpen:v,onClose:c,form:o}}function A({children:t}){const s=B();return p.jsx(d.Provider,{value:s,children:t})}const w=()=>{const t=n.useContext(d);if(!t)throw new Error("useAttachmentsBar must be used within a AttachmentsBarProvider");return t};exports.AttachmentsBarProvider=A;exports.useAttachmentsBar=w;
@@ -1,30 +0,0 @@
1
- import { WorkflowModalSingleInput } from '../../types/index.ts';
2
- import { Dispatch, SetStateAction } from 'react';
3
- export type AttachmentsBarContextValue = ReturnType<typeof useChatAttachmentsBar>;
4
- type FormErrors = Record<'title' | 'content', string | undefined>;
5
- declare function useChatAttachmentsBar(): {
6
- selectedInput: WorkflowModalSingleInput | null;
7
- selectInput: Dispatch<SetStateAction<WorkflowModalSingleInput | null>>;
8
- isOpen: boolean;
9
- onOpen: () => void;
10
- onClose: () => void;
11
- form: {
12
- data: {
13
- title: string;
14
- content: string;
15
- };
16
- errors: FormErrors;
17
- labels: {
18
- title: string;
19
- content: string;
20
- };
21
- validate(): FormErrors;
22
- onChange(event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>): void;
23
- onSubmit(e: React.FormEvent<HTMLFormElement>): void;
24
- };
25
- };
26
- export declare function AttachmentsBarProvider({ children }: {
27
- children: React.ReactNode;
28
- }): import("react/jsx-runtime").JSX.Element;
29
- export declare const useAttachmentsBar: () => AttachmentsBarContextValue;
30
- export {};
@@ -1,57 +0,0 @@
1
- "use client";
2
- import { jsx as h } from "react/jsx-runtime";
3
- import { createContext as b, useContext as w, useState as i } from "react";
4
- import { useBoolean as B } from "../hooks/use-boolean.js";
5
- const m = b(void 0);
6
- function C() {
7
- const [t, r] = i(null), { value: d, setTrue: f, setFalse: c } = B(!1), [s, l] = i({ title: "", content: "" }), [v, u] = i({
8
- title: void 0,
9
- content: void 0
10
- }), n = {
11
- data: s,
12
- errors: v,
13
- labels: {
14
- title: t?.workflowModalProps?.titleInputLabel || "Title",
15
- content: t?.contentType.contentInputLabel || "Content"
16
- },
17
- validate() {
18
- const e = {};
19
- return s.title.trim() || (e.title = `${n.labels.title} is required`), s.content.trim() || (e.content = `${n.labels.content} is required`), e;
20
- },
21
- onChange(e) {
22
- const { name: o, value: a } = e.target;
23
- l((p) => ({ ...p, [o]: a }));
24
- },
25
- onSubmit(e) {
26
- if (e.preventDefault(), !t?.contentType) return;
27
- const o = n.validate();
28
- if (Object.values(o).some((a) => !!a)) {
29
- u(o);
30
- return;
31
- }
32
- c(), l({ title: "", content: "" }), u({ title: void 0, content: void 0 });
33
- }
34
- };
35
- return {
36
- selectedInput: t,
37
- selectInput: r,
38
- isOpen: d,
39
- onOpen: f,
40
- onClose: c,
41
- form: n
42
- };
43
- }
44
- function I({ children: t }) {
45
- const r = C();
46
- return /* @__PURE__ */ h(m.Provider, { value: r, children: t });
47
- }
48
- const P = () => {
49
- const t = w(m);
50
- if (!t)
51
- throw new Error("useAttachmentsBar must be used within a AttachmentsBarProvider");
52
- return t;
53
- };
54
- export {
55
- I as AttachmentsBarProvider,
56
- P as useAttachmentsBar
57
- };
@@ -1 +0,0 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),t=require("react"),i=require("../hooks/use-boolean.cjs"),s=t.createContext(void 0);function l({children:e}){const[n,o]=t.useState(null),{value:r,setTrue:a,setFalse:c}=i.useBoolean(!1);return u.jsx(s.Provider,{value:{selectedItem:n,selectItem:o,isOpen:r,onOpen:a,onClose:c},children:e})}const m=()=>{const e=t.useContext(s);if(!e)throw new Error("useMessageAttachments must be used within a MessageAttachmentsProvider");return e};exports.MessageAttachmentsProvider=l;exports.useMessageAttachments=m;
@@ -1,13 +0,0 @@
1
- import { default as React } from 'react';
2
- import { MessageAttachment } from '../../types/index.ts';
3
- export type MessageAttachmentsContextValue = {
4
- selectedItem: MessageAttachment | null;
5
- selectItem: (input: MessageAttachmentsContextValue['selectedItem']) => void;
6
- isOpen: boolean;
7
- onOpen: () => void;
8
- onClose: () => void;
9
- };
10
- export declare function MessageAttachmentsProvider({ children }: {
11
- children: React.ReactNode;
12
- }): import("react/jsx-runtime").JSX.Element;
13
- export declare const useMessageAttachments: () => MessageAttachmentsContextValue;
@@ -1,27 +0,0 @@
1
- "use client";
2
- import { jsx as c } from "react/jsx-runtime";
3
- import u, { createContext as m, useContext as i } from "react";
4
- import { useBoolean as l } from "../hooks/use-boolean.js";
5
- const t = m(
6
- void 0
7
- );
8
- function p({ children: e }) {
9
- const [s, o] = u.useState(null), { value: n, setTrue: r, setFalse: a } = l(!1);
10
- return /* @__PURE__ */ c(
11
- t.Provider,
12
- {
13
- value: { selectedItem: s, selectItem: o, isOpen: n, onOpen: r, onClose: a },
14
- children: e
15
- }
16
- );
17
- }
18
- const v = () => {
19
- const e = i(t);
20
- if (!e)
21
- throw new Error("useMessageAttachments must be used within a MessageAttachmentsProvider");
22
- return e;
23
- };
24
- export {
25
- p as MessageAttachmentsProvider,
26
- v as useMessageAttachments
27
- };
@@ -1,8 +0,0 @@
1
- import { MessageAttachment, MessageAttributes, Workflow } from '../../types/index.ts';
2
- export declare function getMessageMetadata(workflow: Workflow | null, attachments: MessageAttachment[], isNewChat: boolean): {
3
- context: string | undefined;
4
- attributes: MessageAttributes;
5
- } | undefined;
6
- export declare function serializeWorkflow(workflow: Workflow): string | undefined;
7
- export declare function stringifyAttachments(attachments: MessageAttachment[] | undefined): string | undefined;
8
- export declare function serializeAttachments(_attachments: MessageAttachment[]): string | undefined;
@@ -1 +0,0 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("class-variance-authority"),e=require("./button.cjs"),a=t.cva("",{variants:{slot:{root:["flex items-center pl-2","text-xs rounded-md h-6","bg-gray-300 dark:bg-white-alpha-200","min-w-0 w-fit"],icon:["mr-[0.5em]","text-gray-600 dark:text-white-alpha-600"],title:["overflow-hidden whitespace-nowrap text-ellipsis inline-block"],delete:[e.button({variant:"iconButton",size:"md"}),"h-4 px-1 min-w-[unset]","text-gray-600 dark:text-white-alpha-600","hover:bg-transparent hover:text-gray-700","dark:hover:text-white-alpha-500","[&_svg]:w-4 [&_svg]:h-4"]}}});exports.attachment=a;
@@ -1,4 +0,0 @@
1
- import { ClassProp } from 'class-variance-authority/types';
2
- export declare const attachment: (props?: ({
3
- slot?: "root" | "icon" | "title" | "delete" | null | undefined;
4
- } & ClassProp) | undefined) => string;
@@ -1,28 +0,0 @@
1
- "use client";
2
- import { cva as t } from "class-variance-authority";
3
- import { button as e } from "./button.js";
4
- const i = t("", {
5
- variants: {
6
- slot: {
7
- root: [
8
- "flex items-center pl-2",
9
- "text-xs rounded-md h-6",
10
- "bg-gray-300 dark:bg-white-alpha-200",
11
- "min-w-0 w-fit"
12
- ],
13
- icon: ["mr-[0.5em]", "text-gray-600 dark:text-white-alpha-600"],
14
- title: ["overflow-hidden whitespace-nowrap text-ellipsis inline-block"],
15
- delete: [
16
- e({ variant: "iconButton", size: "md" }),
17
- "h-4 px-1 min-w-[unset]",
18
- "text-gray-600 dark:text-white-alpha-600",
19
- "hover:bg-transparent hover:text-gray-700",
20
- "dark:hover:text-white-alpha-500",
21
- "[&_svg]:w-4 [&_svg]:h-4"
22
- ]
23
- }
24
- }
25
- });
26
- export {
27
- i as attachment
28
- };
@@ -1,86 +0,0 @@
1
- import { InkeepCustomIcon } from '../../icons';
2
- /**
3
- * Workflow defines the interaction steps for the AI bot.
4
- */
5
- export interface Workflow {
6
- id: string;
7
- displayName: string;
8
- goals: string[];
9
- informationToCollect: WorkflowInformationToCollect[];
10
- botPersona?: string;
11
- context?: string[];
12
- guidance?: string[];
13
- initialReplyMessage: string;
14
- supportedInputs?: WorkflowInputTypes[];
15
- }
16
- export interface WorkflowInformationToCollect {
17
- description: string;
18
- required: boolean;
19
- }
20
- /**
21
- * WorkflowInputTypes represents possible ways of collecting attachments in a Workflow.
22
- */
23
- export type WorkflowInputTypes = WorkflowFunctionalMultiInput | WorkflowModalSingleInput;
24
- /**
25
- * WorkflowFunctionalMultiInput represents a function to be called when the attachment is invoked.
26
- */
27
- export interface WorkflowFunctionalMultiInput extends WorkflowBaseInputTypes {
28
- type: 'FUNCTIONAL_MULTI_ATTACHMENT';
29
- onInvoke: (workflow: Workflow, selectedInputType: WorkflowInputTypes, callback: (messageAttachments: MessageAttachment[]) => void, currentMessageAttachments: MessageAttachment[]) => void;
30
- }
31
- /**
32
- * BaseType is a base interface for data types.
33
- */
34
- interface WorkflowBaseContentType {
35
- type: string;
36
- contentInputLabel: string;
37
- attachmentIcon?: InkeepCustomIcon;
38
- }
39
- /**
40
- * MessageAttachmentContentType represents possible type of information that can be attached to a Workflow.
41
- */
42
- export type MessageAttachmentContentType = WorkflowCodeContentType | WorkflowTextContentType;
43
- /**
44
- * WorkflowModalSingleInput represents a modal input type.
45
- */
46
- export interface WorkflowModalSingleInput extends WorkflowBaseInputTypes {
47
- type: 'MODAL';
48
- contentType: MessageAttachmentContentType;
49
- workflowModalProps?: WorkflowModalProps;
50
- }
51
- /**
52
- * WorkflowInputType defines the type of attachments in a Workflow.
53
- */
54
- export interface WorkflowBaseInputTypes {
55
- id: string;
56
- type: string;
57
- displayName: string;
58
- }
59
- export interface WorkflowModalProps {
60
- titleInputLabel?: string;
61
- modalHelpText?: string;
62
- modalHelpElement?: React.ReactElement;
63
- }
64
- export interface WorkflowCodeContentType extends WorkflowBaseContentType {
65
- type: 'CODE';
66
- language: string;
67
- }
68
- export interface WorkflowTextContentType extends WorkflowBaseContentType {
69
- type: 'text';
70
- }
71
- export interface MessageAttachment {
72
- contentType: MessageAttachmentContentType;
73
- title: string;
74
- content: string;
75
- id: string;
76
- context?: string[];
77
- }
78
- export interface MessageAttributes {
79
- attachments?: MessageAttachment[];
80
- workflow?: Workflow;
81
- }
82
- export interface MessageMetadata {
83
- attributes?: MessageAttributes;
84
- context?: string;
85
- }
86
- export {};