agentic-ui-kit 0.2.0 → 0.3.0
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.
- package/README.md +109 -2
- package/dist/core.js +96 -1
- package/dist/index.js +1417 -287
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +30 -2
- package/dist/types/core/src/index.d.ts +8 -1
- package/dist/types/core/src/partial-json.d.ts +8 -0
- package/dist/types/core/src/types.d.ts +5 -0
- package/dist/types/core/src/ui-markup.d.ts +92 -0
- package/dist/types/core/src/ui-tree.d.ts +110 -0
- package/dist/types/core/src/visualize.d.ts +60 -0
- package/dist/types/react/src/components/chat-notice.d.ts +11 -0
- package/dist/types/react/src/components/markdown.d.ts +19 -1
- package/dist/types/react/src/components/message-list.d.ts +5 -1
- package/dist/types/react/src/components/messages.d.ts +3 -2
- package/dist/types/react/src/components/tools.d.ts +20 -7
- package/dist/types/react/src/components/ui-tree.d.ts +87 -0
- package/dist/types/react/src/components/widget-frame.d.ts +97 -0
- package/dist/types/react/src/index.d.ts +15 -3
- package/dist/types/react/src/primitives/chat-theme.d.ts +13 -1
- package/dist/types/react/src/primitives/icons.d.ts +95 -0
- package/dist/types/react/src/primitives/labels.d.ts +193 -0
- package/dist/types/react/src/views/chat-transcript.d.ts +27 -0
- package/dist/types/react/src/views/chat-view.d.ts +15 -2
- package/dist/ui-markup-6xbP-myu.js +1082 -0
- package/package.json +1 -1
- package/dist/sse-BA_ebMcH.js +0 -408
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Message, Part } from "../../../core/src/index.js";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
import { type WidgetHost } from "../components/widget-frame";
|
|
4
|
+
import { type Density } from "./chat-view";
|
|
5
|
+
export interface ChatTranscriptProps {
|
|
6
|
+
messages: Message[];
|
|
7
|
+
renderPart?: (part: Part) => ReactNode;
|
|
8
|
+
/** What widgets may load and how their links open. Widgets here cannot send messages or call tools. */
|
|
9
|
+
widgets?: Omit<WidgetHost, "onPrompt" | "onCallTool">;
|
|
10
|
+
/** Above the conversation, e.g. a ChatHeader with the title and who shared it. */
|
|
11
|
+
header?: ReactNode;
|
|
12
|
+
/** Atop the conversation, scrolling with it: who shared it and what it is. E.g. a ChatNotice. */
|
|
13
|
+
notice?: ReactNode;
|
|
14
|
+
/** Pinned under the last message, e.g. "Continue this chat" or "Shared snapshot, may be out of date". */
|
|
15
|
+
footer?: ReactNode;
|
|
16
|
+
/** Where reading starts. Default "top", the start of the conversation. */
|
|
17
|
+
start?: "top" | "bottom";
|
|
18
|
+
density?: Density;
|
|
19
|
+
contentWidth?: string;
|
|
20
|
+
contentPadding?: string;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A conversation to read, not to continue: a shared chat, an export, a log. Same messages as ChatView,
|
|
25
|
+
* with no composer, approvals, retry, edit or feedback. Copy stays.
|
|
26
|
+
*/
|
|
27
|
+
export declare function ChatTranscript({ messages, renderPart, widgets, header, notice, footer, start, density, contentWidth, contentPadding, className, }: ChatTranscriptProps): import("react").JSX.Element;
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import type { Message, Part } from "../../../core/src/index.js";
|
|
2
|
-
import { type ReactNode } from "react";
|
|
2
|
+
import { type CSSProperties, type ReactNode } from "react";
|
|
3
3
|
import type { PendingApproval } from "../hooks/use-chat";
|
|
4
4
|
import { type ComposerProps } from "../components/composer";
|
|
5
5
|
import type { Feedback } from "../components/messages";
|
|
6
|
+
import { type WidgetHost } from "../components/widget-frame";
|
|
6
7
|
export type Density = "full" | "panel" | "inline";
|
|
8
|
+
/**
|
|
9
|
+
* Column defaults per density; `contentWidth` / `contentPadding` override them. Only the message size changes
|
|
10
|
+
* with density: UI text is the same in all three. A theme can set the other text-size variables per density
|
|
11
|
+
* with `[data-chat-density="panel"] { --chat-ui-font-size: … }`.
|
|
12
|
+
*/
|
|
13
|
+
export declare const densityVars: Record<Density, CSSProperties>;
|
|
7
14
|
export interface ChatViewProps {
|
|
8
15
|
messages: Message[];
|
|
9
16
|
busy?: boolean;
|
|
@@ -16,6 +23,12 @@ export interface ChatViewProps {
|
|
|
16
23
|
onEdit?: (userId: string) => void;
|
|
17
24
|
onFeedback?: (assistantId: string, feedback: Feedback) => void;
|
|
18
25
|
renderPart?: (part: Part) => ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* What widgets (sandboxed visuals) may do: the domains they may load, and their callbacks. A widget's
|
|
28
|
+
* sendPrompt sends through `onSend` and its links open in a new tab unless set here; set a callback to
|
|
29
|
+
* `undefined` to turn it off.
|
|
30
|
+
*/
|
|
31
|
+
widgets?: WidgetHost;
|
|
19
32
|
/** Usually a `<ChatHeader>`. */
|
|
20
33
|
header?: ReactNode;
|
|
21
34
|
/** Passed to the composer: toolbar slots, placeholder, controlled text. */
|
|
@@ -36,7 +49,7 @@ export interface ChatViewProps {
|
|
|
36
49
|
className?: string;
|
|
37
50
|
}
|
|
38
51
|
/** A whole chat: header, the conversation, the docked composer. An empty chat shows `emptyState`. */
|
|
39
|
-
export declare function ChatView({ messages, busy, onSend, onStop, approvals, onApprove, onRetry, onEdit, onFeedback, renderPart, header, composer, emptyState, disclaimer, density, contentWidth, contentPadding, className, }: ChatViewProps): import("react").JSX.Element;
|
|
52
|
+
export declare function ChatView({ messages, busy, onSend, onStop, approvals, onApprove, onRetry, onEdit, onFeedback, renderPart, widgets, header, composer, emptyState, disclaimer, density, contentWidth, contentPadding, className, }: ChatViewProps): import("react").JSX.Element;
|
|
40
53
|
export interface EmptyStateProps {
|
|
41
54
|
/** "Good evening, Alex". */
|
|
42
55
|
greeting: ReactNode;
|