@altimateai/ui-components 0.0.3 → 0.0.4-beta.1

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,12 +1,16 @@
1
1
  import React__default, { FC } from 'react';
2
- import { j as ChatbotProps, k as ChatbotProviderProps, A as Artifact, I as InteractionRequest, m as ChatMessage, n as AgentAction } from '../types-S_ndM2U1.js';
3
- export { x as AgentStreamResponse, p as AssistantMeta, v as ChatResponse, q as ChatSession, w as ChatState, s as ChatbotUrls, F as Feedback, r as FileUploadProps, u as InteractionChoice, t as InteractionType, o as LoadingState } from '../types-S_ndM2U1.js';
2
+ import { j as ChatbotProps, k as ChatbotProviderProps, m as ChatState, A as Artifact, n as ContextOption, I as InteractionRequest, o as ChatMessage, p as AgentAction, q as ChatResponse } from '../types-BKWf381e.js';
3
+ export { y as AgentStreamResponse, s as AssistantMeta, t as ChatSession, v as ChatbotUrls, F as Feedback, u as FileUploadProps, x as InteractionChoice, w as InteractionType, r as LoadingState } from '../types-BKWf381e.js';
4
+ import { UnknownAction } from '@reduxjs/toolkit';
4
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
- import '@reduxjs/toolkit';
6
6
  import 'zod';
7
7
 
8
8
  declare const Chatbot: FC<ChatbotProps>;
9
9
 
10
+ interface ChatContextType extends ChatState {
11
+ dispatch: React__default.Dispatch<UnknownAction>;
12
+ }
13
+ declare const useChatContext: () => ChatContextType;
10
14
  declare const ChatProvider: React__default.FC<ChatbotProviderProps>;
11
15
 
12
16
  interface ArtifactsProps {
@@ -23,6 +27,7 @@ interface ContextPanelProps {
23
27
  allowedFiles: string;
24
28
  contextFieldKey: string;
25
29
  };
30
+ contextOptions?: ContextOption[];
26
31
  }
27
32
  declare const ContextPanel: React.FC<ContextPanelProps>;
28
33
 
@@ -77,4 +82,14 @@ declare const ChatTriggerLink: ({ text }: {
77
82
  text: string;
78
83
  }) => react_jsx_runtime.JSX.Element;
79
84
 
80
- export { AgentAction, Artifact, Artifacts, CancelGenerationButton, ChatMessage, ChatProvider, ChatTriggerLink, ChatbotProps, ChatbotProviderProps, Chatbot as ChatbotV2, CoachAI, ContextPanel, FeedbackButtons, InteractionPrompt, InteractionRequest, LoadingIndicator, MessageItem, MessageList, MessageMenu, QuestionForm, RegenerateButton, StatusUpdates };
85
+ declare const useAgentChat: () => {
86
+ sendMessage: ({ message, isResponseToPrompt, context: newContext, dontAddUserMessage, }: {
87
+ message: string;
88
+ isResponseToPrompt?: boolean;
89
+ context?: Record<string, unknown>;
90
+ dontAddUserMessage?: boolean;
91
+ }) => Promise<ChatResponse>;
92
+ updateContextAndSendMessage: (message: string, context: Record<string, unknown>) => Promise<void>;
93
+ };
94
+
95
+ export { AgentAction, Artifact, Artifacts, CancelGenerationButton, ChatMessage, ChatProvider, ChatResponse, ChatState, ChatTriggerLink, ChatbotProps, ChatbotProviderProps, Chatbot as ChatbotV2, CoachAI, ContextOption, ContextPanel, FeedbackButtons, InteractionPrompt, InteractionRequest, LoadingIndicator, MessageItem, MessageList, MessageMenu, QuestionForm, RegenerateButton, StatusUpdates, useAgentChat, useChatContext };
@@ -1,20 +1,22 @@
1
- import { A as t, b as e, a as n, g as o, C as r, c as i, d as g, F as c, I as d, L as C, h as u, M as h, e as I, f as L, Q as M, R as m, S as b } from "../CoachForm.js";
1
+ import { A as s, b as e, a as n, g as o, C as r, c as i, d as g, F as C, I as u, L as c, i as d, M as h, e as I, f as L, Q as M, R as m, S as A, h as b, u as f } from "../CoachForm.js";
2
2
  export {
3
- t as Artifacts,
3
+ s as Artifacts,
4
4
  e as CancelGenerationButton,
5
5
  n as ChatProvider,
6
6
  o as ChatTriggerLink,
7
7
  r as ChatbotV2,
8
8
  i as CoachAI,
9
9
  g as ContextPanel,
10
- c as FeedbackButtons,
11
- d as InteractionPrompt,
12
- C as LoadingIndicator,
13
- u as LoadingState,
10
+ C as FeedbackButtons,
11
+ u as InteractionPrompt,
12
+ c as LoadingIndicator,
13
+ d as LoadingState,
14
14
  h as MessageItem,
15
15
  I as MessageList,
16
16
  L as MessageMenu,
17
17
  M as QuestionForm,
18
18
  m as RegenerateButton,
19
- b as StatusUpdates
19
+ A as StatusUpdates,
20
+ b as useAgentChat,
21
+ f as useChatContext
20
22
  };
@@ -1,4 +1,4 @@
1
- import { q as DH, r as wMe, t as gMe, l as K1, k as J1n, u as pMe, s as vMe, v as Y1n, w as mMe, x as kMe, y as Uee, z as yMe, B as Q1n, D as $H, E as jMe, G as EMe } from "./CoachForm.js";
1
+ import { r as DH, t as wMe, v as gMe, m as K1, l as J1n, w as pMe, s as vMe, x as Y1n, y as mMe, z as kMe, B as Uee, D as yMe, E as Q1n, G as $H, H as jMe, J as EMe } from "./CoachForm.js";
2
2
  import { c as Hee, g as CMe, s as bI } from "./redux-toolkit.modern.js";
3
3
  var Wee = { exports: {} };
4
4
  (function(Ae, It) {
package/dist/index.d.ts CHANGED
@@ -4,8 +4,8 @@ import * as React$1 from 'react';
4
4
  import { ButtonHTMLAttributes, ReactNode, HTMLAttributes, FC, MouseEvent } from 'react';
5
5
  import { B as ButtonProps } from './Button-Dln4BC6y.js';
6
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
- import { T as TaskLabels, a as TeamMateContextProps, b as TeamMateState, c as TeamMateConfig, d as TeamMateActionType, e as TeamMateAvailability } from './types-S_ndM2U1.js';
8
- export { i as Citation, f as CoachAiConfirmationResponse, C as CoachAiResponse, g as ContentCategory, L as Learning, P as PersonalizationScope, h as TeamMateComponentProps, l as learningSchema } from './types-S_ndM2U1.js';
7
+ import { T as TaskLabels, a as TeamMateContextProps, b as TeamMateState, c as TeamMateConfig, d as TeamMateActionType, e as TeamMateAvailability } from './types-BKWf381e.js';
8
+ export { i as Citation, f as CoachAiConfirmationResponse, C as CoachAiResponse, g as ContentCategory, L as Learning, P as PersonalizationScope, h as TeamMateComponentProps, l as learningSchema } from './types-BKWf381e.js';
9
9
  import * as _reduxjs_toolkit from '@reduxjs/toolkit';
10
10
  import { PayloadAction } from '@reduxjs/toolkit';
11
11
  import * as immer from 'immer';
package/dist/index.js CHANGED
@@ -1,21 +1,21 @@
1
1
  import { j as e, i as r, h as s, C as t, D as n, L as i, T as m, m as d, l as p, k as C } from "./main.js";
2
- import { Alert as l, Card as v, CardBody as T, CardFooter as u, CardImg as f, CardSubtitle as P, CardText as F, CardTitle as M, Col as k, Container as B, Fade as L, Form as g, FormFeedback as y, FormGroup as G, Input as I, InputGroup as h, Label as A, List as S, ListGroup as b, ListGroupItem as x, Modal as j, ModalBody as D, Nav as w, NavItem as H, NavLink as N, Offcanvas as O, OffcanvasBody as z, OffcanvasHeader as K, Popover as R, PopoverBody as V, PopoverHeader as W, Row as X, Spinner as Y } from "reactstrap";
3
- import { A as $, C as q, I as E, T as J } from "./redux-toolkit.modern.js";
4
- import { _ as U, a4 as Z, X as aa, K as oa, a3 as ea, a2 as ra, Y as sa, W as ta, a7 as na, a8 as ia, a6 as ma, V as da, a5 as pa, $ as Ca, a0 as ca, a1 as la, P as va } from "./CoachForm.js";
2
+ import { Alert as l, Card as v, CardBody as T, CardFooter as u, CardImg as f, CardSubtitle as F, CardText as M, CardTitle as P, Col as k, Container as B, Fade as L, Form as g, FormFeedback as y, FormGroup as G, Input as I, InputGroup as h, Label as A, List as S, ListGroup as b, ListGroupItem as x, Modal as j, ModalBody as D, Nav as O, NavItem as w, NavLink as H, Offcanvas as N, OffcanvasBody as z, OffcanvasHeader as R, Popover as V, PopoverBody as X, PopoverHeader as Y, Row as Z, Spinner as _ } from "reactstrap";
3
+ import { A as E, C as J, I as K, T as Q } from "./redux-toolkit.modern.js";
4
+ import { a0 as W, a6 as $, Z as aa, O as oa, a5 as ea, a4 as ra, _ as sa, Y as ta, a9 as na, aa as ia, a8 as ma, X as da, a7 as pa, a1 as Ca, a2 as ca, a3 as la, V as va } from "./CoachForm.js";
5
5
  export {
6
6
  l as Alert,
7
- $ as ApiHelper,
8
- U as Badge,
7
+ E as ApiHelper,
8
+ W as Badge,
9
9
  v as Card,
10
10
  T as CardBody,
11
11
  u as CardFooter,
12
12
  f as CardImg,
13
- P as CardSubtitle,
14
- F as CardText,
15
- M as CardTitle,
16
- Z as CoachForm,
13
+ F as CardSubtitle,
14
+ M as CardText,
15
+ P as CardTitle,
16
+ $ as CoachForm,
17
17
  e as CoachFormButton,
18
- q as CodeBlock,
18
+ J as CodeBlock,
19
19
  k as Col,
20
20
  B as Container,
21
21
  aa as ContentCategory,
@@ -27,7 +27,7 @@ export {
27
27
  g as Form,
28
28
  y as FormFeedback,
29
29
  G as FormGroup,
30
- E as IconButton,
30
+ K as IconButton,
31
31
  I as Input,
32
32
  h as InputGroup,
33
33
  A as Label,
@@ -40,22 +40,22 @@ export {
40
40
  ra as MermaidDiagram,
41
41
  j as Modal,
42
42
  D as ModalBody,
43
- w as Nav,
44
- H as NavItem,
45
- N as NavLink,
46
- O as Offcanvas,
43
+ O as Nav,
44
+ w as NavItem,
45
+ H as NavLink,
46
+ N as Offcanvas,
47
47
  z as OffcanvasBody,
48
- K as OffcanvasHeader,
48
+ R as OffcanvasHeader,
49
49
  sa as PersonalizationScope,
50
50
  ta as Popconfirm,
51
- R as Popover,
52
- V as PopoverBody,
53
- W as PopoverHeader,
51
+ V as Popover,
52
+ X as PopoverBody,
53
+ Y as PopoverHeader,
54
54
  na as ProjectGovernorAllowedFiles,
55
55
  ia as ProjectGovernorCheckSchema,
56
56
  ma as ProjectGovernorCheckTypes,
57
- X as Row,
58
- Y as Spinner,
57
+ Z as Row,
58
+ _ as Spinner,
59
59
  da as Stack,
60
60
  pa as TaskLabels,
61
61
  Ca as TeamMateActionType,
@@ -64,7 +64,7 @@ export {
64
64
  d as TeamMates,
65
65
  la as TeamMatesConfig,
66
66
  p as TeammateActions,
67
- J as Tooltip,
67
+ Q as Tooltip,
68
68
  va as learningSchema,
69
69
  C as useTeamMateContext
70
70
  };
package/dist/is_dark.js CHANGED
@@ -1,4 +1,4 @@
1
- import { H as s, U as r } from "./CoachForm.js";
1
+ import { K as s, U as r } from "./CoachForm.js";
2
2
  const i = (n) => {
3
3
  const { r: t, g: a, b: o } = s.parse(n), e = 0.2126 * r.channel.toLinear(t) + 0.7152 * r.channel.toLinear(a) + 0.0722 * r.channel.toLinear(o);
4
4
  return r.lang.round(e);
package/dist/main.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Card as vt, CardBody as an, CardTitle as un, FormGroup as Pt, Input as Ft, FormFeedback as Xn, Collapse as Gn, Alert as ln, Col as Zn, CardImg as Qn, CardSubtitle as Jn, CardText as er, Row as tr } from "reactstrap";
2
2
  import { g as mt, a as cn, A as ve, C as nr, I as Ie, T as rr } from "./redux-toolkit.modern.js";
3
- import { K as dn, N as lt, O as or, P as ir, T as fn, V as se, W as sr, X as ar, Y as ur, Z as lr, _ as cr, $ as tt, a0 as dr, a1 as fr } from "./CoachForm.js";
3
+ import { O as dn, P as lt, T as or, V as ir, W as fn, X as se, Y as sr, Z as ar, _ as ur, $ as lr, a0 as cr, a1 as tt, a2 as dr, a3 as fr } from "./CoachForm.js";
4
4
  import { j as v, A as pn, i as pr, k as gr, b as hr, C as vr, D as mr, E as Er, e as yr, d as br } from "./index2.js";
5
5
  import * as te from "react";
6
6
  import Z, { createContext as _e, useReducer as gn, useCallback as we, useMemo as fe, useContext as be, useLayoutEffect as Cr, useEffect as le, useRef as Se, useId as hn, useInsertionEffect as Sr, Children as De, isValidElement as _r, useState as re, lazy as Ar } from "react";
@@ -1,4 +1,4 @@
1
- import { J as Zy, k as Dn, l as fa, s as Qy, m as Jy, n as jy } from "./CoachForm.js";
1
+ import { N as Zy, l as Dn, m as fa, s as Qy, n as Jy, o as jy } from "./CoachForm.js";
2
2
  import { c as za, g as Vu, s as Cn } from "./redux-toolkit.modern.js";
3
3
  import { i as em } from "./is_dark.js";
4
4
  var Uu = { exports: {} };
@@ -7,7 +7,17 @@ import './redux-toolkit.css';var hs = typeof globalThis < "u" ? globalThis : typ
7
7
  function bs(e) {
8
8
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
9
9
  }
10
- const ps = (e) => e.title ? /* @__PURE__ */ O.jsx(mt, { title: e.title, children: /* @__PURE__ */ O.jsx(en, { ...e, title: void 0, type: e.type ?? "button", size: "icon", children: e.children }) }) : /* @__PURE__ */ O.jsx(en, { ...e, type: e.type ?? "button", size: "icon", children: e.children }), Ct = kt(null), Ee = {
10
+ const ps = (e) => e.title ? /* @__PURE__ */ O.jsx(mt, { title: e.title, children: /* @__PURE__ */ O.jsx(
11
+ en,
12
+ {
13
+ ...e,
14
+ title: void 0,
15
+ type: e.type ?? "button",
16
+ size: "icon",
17
+ variant: e.variant ?? "ghost",
18
+ children: e.children
19
+ }
20
+ ) }) : /* @__PURE__ */ O.jsx(en, { ...e, type: e.type ?? "button", size: "icon", variant: e.variant ?? "ghost", children: e.children }), Ct = kt(null), Ee = {
11
21
  didCatch: !1,
12
22
  error: null
13
23
  };
@@ -1,4 +1,4 @@
1
- import { i as kt, p as vt, j as wt, k as rt, l as I, s as St, m as Et, n as Tt, o as et } from "./CoachForm.js";
1
+ import { j as kt, p as vt, k as wt, l as rt, m as I, s as St, n as Et, o as Tt, q as et } from "./CoachForm.js";
2
2
  import { s as q } from "./redux-toolkit.modern.js";
3
3
  import { i as It } from "./is_dark.js";
4
4
  var X = function() {
@@ -23,14 +23,22 @@ interface Feedback {
23
23
  rating?: "up" | "down";
24
24
  comment?: string;
25
25
  }
26
+ interface ContextOption {
27
+ label: string;
28
+ key: string;
29
+ options: {
30
+ id: string;
31
+ label: string;
32
+ }[];
33
+ }
26
34
  interface ChatSession {
27
35
  id: string;
28
36
  messages: ChatMessage[];
29
37
  context?: {
30
38
  files?: File[];
31
- selectedOptions?: string[];
32
39
  [x: string]: unknown;
33
40
  };
41
+ selectedModel?: string | null;
34
42
  }
35
43
  interface FileUploadProps {
36
44
  allowedFiles: string;
@@ -48,6 +56,7 @@ interface ChatbotProps {
48
56
  assistantMeta?: AssistantMeta;
49
57
  context?: Record<string, unknown>;
50
58
  fileUploadProps?: FileUploadProps;
59
+ contextOptions?: ContextOption[];
51
60
  }
52
61
  interface ChatbotProviderProps extends ChatbotProps {
53
62
  taskLabel?: keyof typeof TaskLabels;
@@ -59,6 +68,9 @@ interface ChatbotProviderProps extends ChatbotProps {
59
68
  components?: {
60
69
  feedback?: ReactNode;
61
70
  };
71
+ contextOptions?: ContextOption[];
72
+ isMarkdownResponse?: boolean;
73
+ models?: string[];
62
74
  }
63
75
  type InteractionType = "text" | "select" | "multiSelect" | "confirm";
64
76
  interface InteractionChoice {
@@ -117,6 +129,8 @@ interface ChatState {
117
129
  urls?: ChatbotUrls;
118
130
  disableContext?: boolean;
119
131
  requestParams?: RequestInit;
132
+ isMarkdownResponse?: boolean;
133
+ models?: string[];
120
134
  components?: {
121
135
  feedback?: ReactNode;
122
136
  };
@@ -224,6 +238,8 @@ interface TeamMateComponentProps<T = void> {
224
238
  frontendUrl?: string;
225
239
  urls?: ChatbotUrls;
226
240
  requestParams?: RequestInit;
241
+ context?: ChatSession["context"];
242
+ contextOptions?: ContextOption[];
227
243
  }
228
244
  interface TeamMateConfig<T = unknown> {
229
245
  name: string;
@@ -247,4 +263,4 @@ interface Citation {
247
263
  taskLabel: TaskLabels;
248
264
  }
249
265
 
250
- export { type Artifact as A, type CoachAiResponse as C, type Feedback as F, type InteractionRequest as I, type Learning as L, PersonalizationScope as P, TaskLabels as T, type TeamMateContextProps as a, type TeamMateState as b, type TeamMateConfig as c, TeamMateActionType as d, TeamMateAvailability as e, type CoachAiConfirmationResponse as f, ContentCategory as g, type TeamMateComponentProps as h, type Citation as i, type ChatbotProps as j, type ChatbotProviderProps as k, learningSchema as l, type ChatMessage as m, type AgentAction as n, LoadingState as o, type AssistantMeta as p, type ChatSession as q, type FileUploadProps as r, type ChatbotUrls as s, type InteractionType as t, type InteractionChoice as u, type ChatResponse as v, type ChatState as w, type AgentStreamResponse as x };
266
+ export { type Artifact as A, type CoachAiResponse as C, type Feedback as F, type InteractionRequest as I, type Learning as L, PersonalizationScope as P, TaskLabels as T, type TeamMateContextProps as a, type TeamMateState as b, type TeamMateConfig as c, TeamMateActionType as d, TeamMateAvailability as e, type CoachAiConfirmationResponse as f, ContentCategory as g, type TeamMateComponentProps as h, type Citation as i, type ChatbotProps as j, type ChatbotProviderProps as k, learningSchema as l, type ChatState as m, type ContextOption as n, type ChatMessage as o, type AgentAction as p, type ChatResponse as q, LoadingState as r, type AssistantMeta as s, type ChatSession as t, type FileUploadProps as u, type ChatbotUrls as v, type InteractionType as w, type InteractionChoice as x, type AgentStreamResponse as y };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altimateai/ui-components",
3
- "version": "0.0.3",
3
+ "version": "0.0.4-beta.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/AltimateAI/altimate-components.git"