@alquimia-ai/ui 1.9.3 → 2.2.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.
Files changed (90) hide show
  1. package/dist/{alert-dialog-CP71C4vl.d.mts → alert-dialog-HrXEPlTh.d.mts} +1 -1
  2. package/dist/{alert-dialog-CP71C4vl.d.ts → alert-dialog-HrXEPlTh.d.ts} +1 -1
  3. package/dist/components/atoms/index.d.mts +48 -3
  4. package/dist/components/atoms/index.d.ts +48 -3
  5. package/dist/components/atoms/index.js +2086 -1427
  6. package/dist/components/atoms/index.js.map +1 -1
  7. package/dist/components/atoms/index.mjs +1658 -1408
  8. package/dist/components/atoms/index.mjs.map +1 -1
  9. package/dist/components/genui/index.d.mts +79 -0
  10. package/dist/components/genui/index.d.ts +79 -0
  11. package/dist/components/genui/index.js +4693 -0
  12. package/dist/components/genui/index.js.map +1 -0
  13. package/dist/components/genui/index.mjs +4622 -0
  14. package/dist/components/genui/index.mjs.map +1 -0
  15. package/dist/components/hooks/index.d.mts +2 -1
  16. package/dist/components/hooks/index.d.ts +2 -1
  17. package/dist/components/hooks/index.js +572 -211
  18. package/dist/components/hooks/index.js.map +1 -1
  19. package/dist/components/hooks/index.mjs +505 -193
  20. package/dist/components/hooks/index.mjs.map +1 -1
  21. package/dist/components/molecules/documents/index.d.mts +1 -0
  22. package/dist/components/molecules/documents/index.d.ts +1 -0
  23. package/dist/components/molecules/documents/index.js +2596 -1889
  24. package/dist/components/molecules/documents/index.js.map +1 -1
  25. package/dist/components/molecules/documents/index.mjs +2435 -1769
  26. package/dist/components/molecules/documents/index.mjs.map +1 -1
  27. package/dist/components/molecules/index.d.mts +2 -2
  28. package/dist/components/molecules/index.d.ts +2 -2
  29. package/dist/components/molecules/index.js +2464 -2119
  30. package/dist/components/molecules/index.js.map +1 -1
  31. package/dist/components/molecules/index.mjs +2283 -2095
  32. package/dist/components/molecules/index.mjs.map +1 -1
  33. package/dist/components/molecules/viewers/index.js +1485 -1188
  34. package/dist/components/molecules/viewers/index.js.map +1 -1
  35. package/dist/components/molecules/viewers/index.mjs +1436 -1170
  36. package/dist/components/molecules/viewers/index.mjs.map +1 -1
  37. package/dist/components/organisms/index.d.mts +16 -2
  38. package/dist/components/organisms/index.d.ts +16 -2
  39. package/dist/components/organisms/index.js +3289 -2637
  40. package/dist/components/organisms/index.js.map +1 -1
  41. package/dist/components/organisms/index.mjs +3210 -2610
  42. package/dist/components/organisms/index.mjs.map +1 -1
  43. package/dist/components/templates/index.d.mts +25 -3
  44. package/dist/components/templates/index.d.ts +25 -3
  45. package/dist/components/templates/index.js +1671 -1302
  46. package/dist/components/templates/index.js.map +1 -1
  47. package/dist/components/templates/index.mjs +1594 -1283
  48. package/dist/components/templates/index.mjs.map +1 -1
  49. package/dist/index.d.mts +11 -6
  50. package/dist/index.d.ts +11 -6
  51. package/dist/index.js +4233 -3012
  52. package/dist/index.js.map +1 -1
  53. package/dist/index.mjs +3619 -2987
  54. package/dist/index.mjs.map +1 -1
  55. package/dist/lib/index.js +106 -54
  56. package/dist/lib/index.js.map +1 -1
  57. package/dist/lib/index.mjs +42 -43
  58. package/dist/lib/index.mjs.map +1 -1
  59. package/dist/providers/index.d.mts +17 -0
  60. package/dist/providers/index.d.ts +17 -0
  61. package/dist/providers/index.js +177 -0
  62. package/dist/providers/index.js.map +1 -0
  63. package/dist/providers/index.mjs +101 -0
  64. package/dist/providers/index.mjs.map +1 -0
  65. package/dist/styles.css +68 -0
  66. package/dist/styles.css.map +1 -0
  67. package/dist/styles.d.mts +2 -0
  68. package/dist/styles.d.ts +2 -0
  69. package/dist/tailwind.config.js +4 -10
  70. package/dist/{toast-2xT7L1tJ.d.mts → toast-DEc6eGUE.d.mts} +1 -1
  71. package/dist/{toast-2xT7L1tJ.d.ts → toast-DEc6eGUE.d.ts} +1 -1
  72. package/dist/types/index.d.mts +5 -5
  73. package/dist/types/index.d.ts +5 -5
  74. package/dist/types/index.js +52 -19
  75. package/dist/types/index.js.map +1 -1
  76. package/dist/types/index.mjs +6 -8
  77. package/dist/types/index.mjs.map +1 -1
  78. package/package.json +29 -9
  79. package/dist/components/index.d.mts +0 -23
  80. package/dist/components/index.d.ts +0 -23
  81. package/dist/components/index.js +0 -1734
  82. package/dist/components/index.js.map +0 -1
  83. package/dist/components/index.mjs +0 -1702
  84. package/dist/components/index.mjs.map +0 -1
  85. package/dist/components/templates/cards/index.d.mts +0 -26
  86. package/dist/components/templates/cards/index.d.ts +0 -26
  87. package/dist/components/templates/cards/index.js +0 -1536
  88. package/dist/components/templates/cards/index.js.map +0 -1
  89. package/dist/components/templates/cards/index.mjs +0 -1504
  90. package/dist/components/templates/cards/index.mjs.map +0 -1
@@ -0,0 +1,79 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { A2uiComponent, SurfaceAction, A2uiSurface, UIAction } from '@alquimia-ai/tools/genui';
4
+
5
+ /** Props every A2UI component receives from the renderer. */
6
+ interface A2uiNodeProps {
7
+ node: A2uiComponent;
8
+ value?: unknown;
9
+ onChange?: (value: unknown) => void;
10
+ onAction?: (action: SurfaceAction) => void;
11
+ children?: React.ReactNode;
12
+ }
13
+ /** The default catalog registry: catalog component name -> React component. */
14
+ declare const coreUiRegistry: Record<string, React.ComponentType<A2uiNodeProps>>;
15
+
16
+ interface A2uiRendererProps {
17
+ surface: A2uiSurface;
18
+ registry: Record<string, React.ComponentType<A2uiNodeProps>>;
19
+ onAgentAction: (action: UIAction) => void;
20
+ onLocalAction?: (action: UIAction) => void;
21
+ }
22
+ declare function A2uiRenderer({ surface, registry, onAgentAction, onLocalAction }: A2uiRendererProps): react_jsx_runtime.JSX.Element | null;
23
+
24
+ type ChatMessage = {
25
+ id?: string;
26
+ role?: string;
27
+ content?: string;
28
+ };
29
+ /** The subset of the `useAlquimia` return that AssistantChat consumes. */
30
+ interface GenuiChatController {
31
+ messages: ChatMessage[];
32
+ input: string;
33
+ handleInputChange: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;
34
+ handleSubmit: (event: React.FormEvent<HTMLFormElement>, traceParentId?: string, sessionId?: string) => Promise<void> | void;
35
+ handleLoadingCancel?: () => void;
36
+ isLoading?: boolean;
37
+ isMessageStreaming?: boolean;
38
+ streamingMessageId?: string | null;
39
+ genui?: {
40
+ surfaces: Array<{
41
+ controlId: string;
42
+ surface: A2uiSurface;
43
+ afterCount: number;
44
+ submitted?: boolean;
45
+ dismissedWith?: string;
46
+ }>;
47
+ onAgentAction: (controlId: string) => (action: UIAction) => void;
48
+ awaitingUser: boolean;
49
+ dismiss?: (userMessage?: string) => void;
50
+ };
51
+ }
52
+ interface AssistantChatProps {
53
+ /** The value returned by `useAlquimia({ genui: {...} })`. */
54
+ alquimia: GenuiChatController;
55
+ /** Catalog component name -> React component. Defaults to the built-in catalog; pass your own to swap component libraries. */
56
+ registry?: Record<string, React.ComponentType<A2uiNodeProps>>;
57
+ /** Conversation id passed to `handleSubmit`. Optional if the SDK already has one. */
58
+ conversationId?: string | null;
59
+ placeholder?: string;
60
+ suggestions?: string[];
61
+ className?: string;
62
+ /** Override the typing indicator shown while the agent is working. Defaults to animated dots. */
63
+ thinkIndicator?: React.ReactNode;
64
+ }
65
+ /**
66
+ * Batteries-included GenUI chat. A thin composition of the SDK's existing organisms
67
+ * (`AssistantMessageArea` + `AssistantInput`) — it does NOT reimplement message
68
+ * rendering, so it inherits markdown, error rendering, timestamps, and streaming for
69
+ * free. Its only job is to (a) turn `genui.surfaces` into an `interleave` callback the
70
+ * message area renders in place, and (b) gate the typing indicator while a surface
71
+ * awaits the user. All orchestration lives in `useAlquimia({ genui })`.
72
+ *
73
+ * To use a different component library, swap `registry` (and pass your own catalog to
74
+ * the hook). To customize the shell, compose the organisms directly instead of using
75
+ * this wrapper.
76
+ */
77
+ declare function AssistantChat({ alquimia, registry, conversationId, placeholder, suggestions, className, thinkIndicator, }: AssistantChatProps): react_jsx_runtime.JSX.Element;
78
+
79
+ export { type A2uiNodeProps, A2uiRenderer, type A2uiRendererProps, AssistantChat, type AssistantChatProps, type GenuiChatController, coreUiRegistry };
@@ -0,0 +1,79 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { A2uiComponent, SurfaceAction, A2uiSurface, UIAction } from '@alquimia-ai/tools/genui';
4
+
5
+ /** Props every A2UI component receives from the renderer. */
6
+ interface A2uiNodeProps {
7
+ node: A2uiComponent;
8
+ value?: unknown;
9
+ onChange?: (value: unknown) => void;
10
+ onAction?: (action: SurfaceAction) => void;
11
+ children?: React.ReactNode;
12
+ }
13
+ /** The default catalog registry: catalog component name -> React component. */
14
+ declare const coreUiRegistry: Record<string, React.ComponentType<A2uiNodeProps>>;
15
+
16
+ interface A2uiRendererProps {
17
+ surface: A2uiSurface;
18
+ registry: Record<string, React.ComponentType<A2uiNodeProps>>;
19
+ onAgentAction: (action: UIAction) => void;
20
+ onLocalAction?: (action: UIAction) => void;
21
+ }
22
+ declare function A2uiRenderer({ surface, registry, onAgentAction, onLocalAction }: A2uiRendererProps): react_jsx_runtime.JSX.Element | null;
23
+
24
+ type ChatMessage = {
25
+ id?: string;
26
+ role?: string;
27
+ content?: string;
28
+ };
29
+ /** The subset of the `useAlquimia` return that AssistantChat consumes. */
30
+ interface GenuiChatController {
31
+ messages: ChatMessage[];
32
+ input: string;
33
+ handleInputChange: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;
34
+ handleSubmit: (event: React.FormEvent<HTMLFormElement>, traceParentId?: string, sessionId?: string) => Promise<void> | void;
35
+ handleLoadingCancel?: () => void;
36
+ isLoading?: boolean;
37
+ isMessageStreaming?: boolean;
38
+ streamingMessageId?: string | null;
39
+ genui?: {
40
+ surfaces: Array<{
41
+ controlId: string;
42
+ surface: A2uiSurface;
43
+ afterCount: number;
44
+ submitted?: boolean;
45
+ dismissedWith?: string;
46
+ }>;
47
+ onAgentAction: (controlId: string) => (action: UIAction) => void;
48
+ awaitingUser: boolean;
49
+ dismiss?: (userMessage?: string) => void;
50
+ };
51
+ }
52
+ interface AssistantChatProps {
53
+ /** The value returned by `useAlquimia({ genui: {...} })`. */
54
+ alquimia: GenuiChatController;
55
+ /** Catalog component name -> React component. Defaults to the built-in catalog; pass your own to swap component libraries. */
56
+ registry?: Record<string, React.ComponentType<A2uiNodeProps>>;
57
+ /** Conversation id passed to `handleSubmit`. Optional if the SDK already has one. */
58
+ conversationId?: string | null;
59
+ placeholder?: string;
60
+ suggestions?: string[];
61
+ className?: string;
62
+ /** Override the typing indicator shown while the agent is working. Defaults to animated dots. */
63
+ thinkIndicator?: React.ReactNode;
64
+ }
65
+ /**
66
+ * Batteries-included GenUI chat. A thin composition of the SDK's existing organisms
67
+ * (`AssistantMessageArea` + `AssistantInput`) — it does NOT reimplement message
68
+ * rendering, so it inherits markdown, error rendering, timestamps, and streaming for
69
+ * free. Its only job is to (a) turn `genui.surfaces` into an `interleave` callback the
70
+ * message area renders in place, and (b) gate the typing indicator while a surface
71
+ * awaits the user. All orchestration lives in `useAlquimia({ genui })`.
72
+ *
73
+ * To use a different component library, swap `registry` (and pass your own catalog to
74
+ * the hook). To customize the shell, compose the organisms directly instead of using
75
+ * this wrapper.
76
+ */
77
+ declare function AssistantChat({ alquimia, registry, conversationId, placeholder, suggestions, className, thinkIndicator, }: AssistantChatProps): react_jsx_runtime.JSX.Element;
78
+
79
+ export { type A2uiNodeProps, A2uiRenderer, type A2uiRendererProps, AssistantChat, type AssistantChatProps, type GenuiChatController, coreUiRegistry };