@agno-hq/chat-react 0.3.1 → 0.3.3
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 +35 -5
- package/dist/chat/index.cjs +94 -82
- package/dist/chat/index.d.cts +72 -17
- package/dist/chat/index.d.ts +72 -17
- package/dist/chat/index.js +1 -1
- package/dist/{chunk-JEPFGKHH.cjs → chunk-3IEYJIYJ.cjs} +249 -222
- package/dist/chunk-3IEYJIYJ.cjs.map +1 -0
- package/dist/{chunk-BZC2674Z.js → chunk-E4CFQ457.js} +103 -79
- package/dist/chunk-E4CFQ457.js.map +1 -0
- package/dist/index.cjs +95 -83
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/styles.css +57 -19
- package/package.json +9 -11
- package/dist/chunk-BZC2674Z.js.map +0 -1
- package/dist/chunk-JEPFGKHH.cjs.map +0 -1
package/dist/chat/index.d.ts
CHANGED
|
@@ -148,6 +148,10 @@ interface ChatClassNames {
|
|
|
148
148
|
markdown?: string;
|
|
149
149
|
/** "Working…" line shown while streaming with no content yet. */
|
|
150
150
|
activity?: string;
|
|
151
|
+
/** `<MessageActions>` — the icon row under a finished answer. */
|
|
152
|
+
messageActions?: string;
|
|
153
|
+
/** The copy button in that row. */
|
|
154
|
+
messageCopyButton?: string;
|
|
151
155
|
/** `<ChatInput>` wrapper. */
|
|
152
156
|
input?: string;
|
|
153
157
|
/** Row holding attach / textarea / send. */
|
|
@@ -291,8 +295,12 @@ declare function sourceHost(url?: string): string | undefined;
|
|
|
291
295
|
/**
|
|
292
296
|
* The site's own icon. Same-origin to the site being cited, so no third-party
|
|
293
297
|
* favicon service is involved and nothing is requested until a card renders.
|
|
298
|
+
* `/favicon.ico` by convention; `/favicon.svg` is the next guess, for sites
|
|
299
|
+
* that only declare an SVG icon (see `faviconFallbacks`).
|
|
294
300
|
*/
|
|
295
301
|
declare function faviconUrl(url?: string): string | undefined;
|
|
302
|
+
/** Every same-origin icon path worth trying, in order. Empty for a bad URL. */
|
|
303
|
+
declare function faviconFallbacks(url?: string): string[];
|
|
296
304
|
/** `docs.agno.com/introduction` — the host plus a trimmed path, for card chrome. */
|
|
297
305
|
declare function displayUrl(url?: string): string | undefined;
|
|
298
306
|
/**
|
|
@@ -356,6 +364,36 @@ declare const SourcesProvider: React$1.Provider<Source[]>;
|
|
|
356
364
|
/** The sources of the surrounding message; empty outside one. */
|
|
357
365
|
declare function useSources(): Source[];
|
|
358
366
|
|
|
367
|
+
/**
|
|
368
|
+
* The copy control — one component wherever something can be copied: the
|
|
369
|
+
* header of a fenced code block, the action row under an answer, a host's own
|
|
370
|
+
* surface. It owns the "copied" flash and the clipboard fallbacks, so every
|
|
371
|
+
* copy affordance in a transcript behaves the same way.
|
|
372
|
+
*/
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Copy text, by whichever route the browser allows.
|
|
376
|
+
*
|
|
377
|
+
* The async Clipboard API is the right one, but it rejects on an insecure
|
|
378
|
+
* origin and whenever the document isn't focused — so a selection-based copy
|
|
379
|
+
* stands behind it. Returns whether anything was actually copied: the button
|
|
380
|
+
* should not claim success it didn't have.
|
|
381
|
+
*
|
|
382
|
+
* Exported because a host building its own copy affordance wants the same
|
|
383
|
+
* fallbacks, and because the failure paths are worth testing.
|
|
384
|
+
*/
|
|
385
|
+
declare function writeClipboard(text: string): Promise<boolean>;
|
|
386
|
+
interface CopyButtonProps {
|
|
387
|
+
/** What to copy — a string, or a function for text that is costly to build. */
|
|
388
|
+
text: string | (() => string);
|
|
389
|
+
/** Accessible name and tooltip. Defaults to "Copy". */
|
|
390
|
+
label?: string;
|
|
391
|
+
/** Icon size, in px. */
|
|
392
|
+
size?: number;
|
|
393
|
+
className?: string;
|
|
394
|
+
}
|
|
395
|
+
declare function CopyButton({ text, label, size, className }: CopyButtonProps): React$1.ReactElement;
|
|
396
|
+
|
|
359
397
|
/**
|
|
360
398
|
* Markdown for a chat transcript, rendered by [Streamdown](https://streamdown.ai).
|
|
361
399
|
*
|
|
@@ -399,18 +437,6 @@ interface MarkdownProps {
|
|
|
399
437
|
/** Escape hatch onto Streamdown itself — anything not set here. */
|
|
400
438
|
options?: Omit<StreamdownProps, 'children' | 'className' | 'components'>;
|
|
401
439
|
}
|
|
402
|
-
/**
|
|
403
|
-
* Copy text, by whichever route the browser allows.
|
|
404
|
-
*
|
|
405
|
-
* The async Clipboard API is the right one, but it rejects on an insecure
|
|
406
|
-
* origin and whenever the document isn't focused — so a selection-based copy
|
|
407
|
-
* stands behind it. Returns whether anything was actually copied: the button
|
|
408
|
-
* should not claim success it didn't have.
|
|
409
|
-
*
|
|
410
|
-
* Exported because a host building its own copy affordance wants the same
|
|
411
|
-
* fallbacks, and because the failure paths are worth testing.
|
|
412
|
-
*/
|
|
413
|
-
declare function writeClipboard(text: string): Promise<boolean>;
|
|
414
440
|
declare function Markdown({ content, className, sources, streaming, codeCopy, linkComponent, options, }: MarkdownProps): React$1.ReactElement;
|
|
415
441
|
type RenderMarkdown = (content: string) => React$1.ReactNode;
|
|
416
442
|
|
|
@@ -778,6 +804,10 @@ interface MessageProps {
|
|
|
778
804
|
hideTools?: boolean;
|
|
779
805
|
/** Hide the sources block under the answer. */
|
|
780
806
|
hideSources?: boolean;
|
|
807
|
+
/** Hide the action row (copy, and whatever `actions` adds) under the answer. */
|
|
808
|
+
hideActions?: boolean;
|
|
809
|
+
/** More actions for the row, after copy — regenerate, feedback, and so on. */
|
|
810
|
+
actions?: React$1.ReactNode;
|
|
781
811
|
/**
|
|
782
812
|
* Render the "Related questions" the agent suggested under this message,
|
|
783
813
|
* sending the clicked one here. Off by default: `<ChatWindow>` pins them
|
|
@@ -791,7 +821,26 @@ interface MessageProps {
|
|
|
791
821
|
className?: string;
|
|
792
822
|
classNames?: ChatClassNames;
|
|
793
823
|
}
|
|
794
|
-
declare function Message({ message, renderMarkdown, activity, avatar, children, className, classNames, entityType, userInitials, hideReasoning, hideTools, hideSources, onFollowup, }: MessageProps): React$1.ReactElement;
|
|
824
|
+
declare function Message({ message, renderMarkdown, activity, avatar, children, className, classNames, entityType, userInitials, hideReasoning, hideTools, hideSources, hideActions, actions, onFollowup, }: MessageProps): React$1.ReactElement;
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* The action row under a finished answer — the Figma `_Chat messages/Actions`
|
|
828
|
+
* strip: small icon buttons in a line, copy first. The package ships copy;
|
|
829
|
+
* anything a product adds (regenerate, feedback, "view JSON") goes in as
|
|
830
|
+
* children and lines up with it.
|
|
831
|
+
*/
|
|
832
|
+
|
|
833
|
+
interface MessageActionsProps {
|
|
834
|
+
/** The message the actions apply to; copy takes its content. */
|
|
835
|
+
message: ChatMessage;
|
|
836
|
+
/** Leave the copy button out (a host that copies differently). */
|
|
837
|
+
hideCopy?: boolean;
|
|
838
|
+
/** More actions, rendered after copy. */
|
|
839
|
+
children?: React$1.ReactNode;
|
|
840
|
+
className?: string;
|
|
841
|
+
classNames?: ChatClassNames;
|
|
842
|
+
}
|
|
843
|
+
declare function MessageActions({ message, hideCopy, children, className, classNames, }: MessageActionsProps): React$1.ReactElement | null;
|
|
795
844
|
|
|
796
845
|
/**
|
|
797
846
|
* The AgentOS chat dock: a rounded card holding an auto-growing textarea and a
|
|
@@ -1106,7 +1155,10 @@ declare function useLinkPreview(url: string | undefined, enabled: boolean): {
|
|
|
1106
1155
|
preview: LinkPreview | null;
|
|
1107
1156
|
loading: boolean;
|
|
1108
1157
|
};
|
|
1109
|
-
/**
|
|
1158
|
+
/**
|
|
1159
|
+
* The site's icon: `/favicon.ico`, then `/favicon.svg`, then a glyph when the
|
|
1160
|
+
* origin serves neither.
|
|
1161
|
+
*/
|
|
1110
1162
|
declare function Favicon({ url, kind, size, className, }: {
|
|
1111
1163
|
url?: string;
|
|
1112
1164
|
kind?: Source['kind'];
|
|
@@ -1321,8 +1373,11 @@ declare const Pulse: ({ size, className }: IconProps) => React$1.ReactElement;
|
|
|
1321
1373
|
declare const Trash: ({ size, className }: IconProps) => React$1.ReactElement;
|
|
1322
1374
|
declare const ChatBubble: ({ size, className }: IconProps) => React$1.ReactElement;
|
|
1323
1375
|
declare const Spinner: ({ size, className }: IconProps) => React$1.ReactElement;
|
|
1324
|
-
/**
|
|
1325
|
-
|
|
1376
|
+
/**
|
|
1377
|
+
* The stop control: AgentOS's `square-stop`, a small outlined square in the
|
|
1378
|
+
* same button the arrow sends from — 10.67px in a 32px or 24px button.
|
|
1379
|
+
*/
|
|
1380
|
+
declare const Stop: ({ size, className }: IconProps) => React$1.ReactElement;
|
|
1326
1381
|
/** The Agno mark — used as the agent avatar, exactly as in AgentOS. */
|
|
1327
1382
|
declare function AgnoMark({ size, className }: IconProps): React$1.ReactElement;
|
|
1328
1383
|
/** The AgentOS `team` glyph, drawn in the current colour. */
|
|
@@ -1332,4 +1387,4 @@ declare function GridLoader({ className }: {
|
|
|
1332
1387
|
className?: string;
|
|
1333
1388
|
}): React$1.ReactElement;
|
|
1334
1389
|
|
|
1335
|
-
export { AgnoChat, type AgnoChatProps, AgnoMark, ArrowUp, BehindTheScenes, type BehindTheScenesProps, BookOpen, Box, Brain, ChatBubble, type ChatClassNames, type ChatContextValue, ChatInput, type ChatInputProps, ChatLauncher, type ChatLauncherProps, ChatProvider, type ChatProviderProps, type ChatTextareaProps, ChatWindow, type ChatWindowProps, Check, ChevronDown, Citations, type CitationsProps, Close, Copy, EntityBadge, type EntityBadgeProps, EntitySelector, EventLog, Favicon, FileAudio, FileIcon, type FileLimits, FilePreview, type FilePreviewProps, FileType, FileVideo, Followups, type FollowupsProps, Globe, GridLoader, HoverPreview, type HoverPreviewProps, HumanInput, type HumanInputProps, type LauncherPanel, type LauncherPosition, type LinkComponent, LinkIcon, type LinkPreview, LinkPreviewCard, type LinkPreviewCardProps, Markdown, type MarkdownProps, MemberResponses, Memory, Message, MessageList, type MessageListProps, type MessageProps, Multimedia, Paperclip, Plus, Pulse, type QuickPrompt, QuickPrompts, type QuickPromptsProps, Reasoning, type RenderMarkdown, Rerun, type ResolveLinkPreview, type SendOptions, SessionList, type SessionListProps, type Source, SourceCard, SourcesProvider, Spinner, StatusIndicator, Stop, TeamGlyph, ToolCalls, Trash, type UseAgnoChat, type UseAgnoChatOptions, WorkflowSteps, Wrench, admitFiles, behindTheScenesItems, behindTheScenesLabel, collectSources, displayUrl, faviconUrl, fileAccepted, getProviderIcon, hasBehindTheScenes, linkCitations, normalizeFollowups, quickPromptLabel, quickPromptText, sourceHost, sourcesFromMarkdown, useAgnoChat, useChatContext, useLinkComponent, useLinkPreview, useOptionalChatContext, useResolvedChat, useResolvedClassNames, useSources, withoutSourcesLine, writeClipboard };
|
|
1390
|
+
export { AgnoChat, type AgnoChatProps, AgnoMark, ArrowUp, BehindTheScenes, type BehindTheScenesProps, BookOpen, Box, Brain, ChatBubble, type ChatClassNames, type ChatContextValue, ChatInput, type ChatInputProps, ChatLauncher, type ChatLauncherProps, ChatProvider, type ChatProviderProps, type ChatTextareaProps, ChatWindow, type ChatWindowProps, Check, ChevronDown, Citations, type CitationsProps, Close, Copy, CopyButton, type CopyButtonProps, EntityBadge, type EntityBadgeProps, EntitySelector, EventLog, Favicon, FileAudio, FileIcon, type FileLimits, FilePreview, type FilePreviewProps, FileType, FileVideo, Followups, type FollowupsProps, Globe, GridLoader, HoverPreview, type HoverPreviewProps, HumanInput, type HumanInputProps, type LauncherPanel, type LauncherPosition, type LinkComponent, LinkIcon, type LinkPreview, LinkPreviewCard, type LinkPreviewCardProps, Markdown, type MarkdownProps, MemberResponses, Memory, Message, MessageActions, type MessageActionsProps, MessageList, type MessageListProps, type MessageProps, Multimedia, Paperclip, Plus, Pulse, type QuickPrompt, QuickPrompts, type QuickPromptsProps, Reasoning, type RenderMarkdown, Rerun, type ResolveLinkPreview, type SendOptions, SessionList, type SessionListProps, type Source, SourceCard, SourcesProvider, Spinner, StatusIndicator, Stop, TeamGlyph, ToolCalls, Trash, type UseAgnoChat, type UseAgnoChatOptions, WorkflowSteps, Wrench, admitFiles, behindTheScenesItems, behindTheScenesLabel, collectSources, displayUrl, faviconFallbacks, faviconUrl, fileAccepted, getProviderIcon, hasBehindTheScenes, linkCitations, normalizeFollowups, quickPromptLabel, quickPromptText, sourceHost, sourcesFromMarkdown, useAgnoChat, useChatContext, useLinkComponent, useLinkPreview, useOptionalChatContext, useResolvedChat, useResolvedClassNames, useSources, withoutSourcesLine, writeClipboard };
|
package/dist/chat/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { AgnoChat, AgnoMark, ArrowUp, BehindTheScenes, BookOpen, Box, Brain, ChatBubble, ChatInput, ChatLauncher, ChatProvider, ChatWindow, Check, ChevronDown, Citations, Close, Copy, EntityBadge, EntitySelector, EventLog, Favicon, FileAudio, FileIcon, FilePreview, FileType, FileVideo, Followups, Globe, GridLoader, HoverPreview, HumanInput, LinkIcon, LinkPreviewCard, Markdown, MemberResponses, Memory, Message, MessageList, Multimedia, Paperclip, Plus, Pulse, QuickPrompts, Reasoning, Rerun, SessionList, SourceCard, SourcesProvider, Spinner, StatusIndicator, Stop, TeamGlyph, ToolCalls, Trash, WorkflowSteps, Wrench, admitFiles, behindTheScenesItems, behindTheScenesLabel, collectSources, displayUrl, faviconUrl, fileAccepted, getProviderIcon, hasBehindTheScenes, linkCitations, normalizeFollowups, quickPromptLabel, quickPromptText, sourceHost, sourcesFromMarkdown, useAgnoChat, useChatContext, useLinkComponent, useLinkPreview, useOptionalChatContext, useResolvedChat, useResolvedClassNames, useSources, withoutSourcesLine, writeClipboard } from '../chunk-
|
|
2
|
+
export { AgnoChat, AgnoMark, ArrowUp, BehindTheScenes, BookOpen, Box, Brain, ChatBubble, ChatInput, ChatLauncher, ChatProvider, ChatWindow, Check, ChevronDown, Citations, Close, Copy, CopyButton, EntityBadge, EntitySelector, EventLog, Favicon, FileAudio, FileIcon, FilePreview, FileType, FileVideo, Followups, Globe, GridLoader, HoverPreview, HumanInput, LinkIcon, LinkPreviewCard, Markdown, MemberResponses, Memory, Message, MessageActions, MessageList, Multimedia, Paperclip, Plus, Pulse, QuickPrompts, Reasoning, Rerun, SessionList, SourceCard, SourcesProvider, Spinner, StatusIndicator, Stop, TeamGlyph, ToolCalls, Trash, WorkflowSteps, Wrench, admitFiles, behindTheScenesItems, behindTheScenesLabel, collectSources, displayUrl, faviconFallbacks, faviconUrl, fileAccepted, getProviderIcon, hasBehindTheScenes, linkCitations, normalizeFollowups, quickPromptLabel, quickPromptText, sourceHost, sourcesFromMarkdown, useAgnoChat, useChatContext, useLinkComponent, useLinkPreview, useOptionalChatContext, useResolvedChat, useResolvedClassNames, useSources, withoutSourcesLine, writeClipboard } from '../chunk-E4CFQ457.js';
|
|
3
3
|
import '../chunk-6V2YIPHF.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
5
5
|
//# sourceMappingURL=index.js.map
|