@page-speed/agent-everywhere 0.3.1 → 0.4.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 +36 -1
- package/dist/index.cjs +108 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +115 -7
- package/dist/index.d.ts +115 -7
- package/dist/index.js +107 -39
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -22,6 +22,36 @@ interface AgentMessage {
|
|
|
22
22
|
feedback?: MessageFeedback;
|
|
23
23
|
/** For chart/data messages */
|
|
24
24
|
data?: DataPayload;
|
|
25
|
+
/**
|
|
26
|
+
* An inline confirmation / proposed-plan / action panel attached to this
|
|
27
|
+
* message. Rendered in the transcript flow (after the message content) so it
|
|
28
|
+
* never covers the assistant response. See `ConfirmationData`.
|
|
29
|
+
*/
|
|
30
|
+
confirmation?: ConfirmationData;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Data-only description of an inline confirmation / proposed-plan panel. The
|
|
34
|
+
* `MessageList` renders this with the `ConfirmationPanel` component, reusing the
|
|
35
|
+
* shared markdown rendering for the body so long plans keep readable spacing.
|
|
36
|
+
*/
|
|
37
|
+
interface ConfirmationData {
|
|
38
|
+
/** Panel heading, e.g. "Proposed plan". */
|
|
39
|
+
title?: string;
|
|
40
|
+
/** Short scope/summary label, e.g. "3 pages to change". */
|
|
41
|
+
summary?: string;
|
|
42
|
+
/** Plan / confirmation body. Rendered as markdown by default. */
|
|
43
|
+
body?: string;
|
|
44
|
+
/** Render the body verbatim instead of as markdown. */
|
|
45
|
+
markdown?: boolean;
|
|
46
|
+
/** Action buttons (confirm / cancel / regenerate, …). */
|
|
47
|
+
actions?: ConfirmationActionData[];
|
|
48
|
+
}
|
|
49
|
+
interface ConfirmationActionData {
|
|
50
|
+
id: string;
|
|
51
|
+
label: string;
|
|
52
|
+
variant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link';
|
|
53
|
+
disabled?: boolean;
|
|
54
|
+
busy?: boolean;
|
|
25
55
|
}
|
|
26
56
|
interface MessageMetadata {
|
|
27
57
|
model?: string;
|
|
@@ -943,8 +973,8 @@ interface UseSemanticBuilderResult {
|
|
|
943
973
|
declare function useSemanticBuilder<TBlock = AgentBlock>({ socketUrl, resolveSocketUrl, websiteId, pageCategoryId, pageName, pageSlug, blocks, contentBrief, enabled, onGeneratedBlocks, onUndoRequest, buildWelcomeMessage, webSocketImpl, }: UseSemanticBuilderOptions<TBlock>): UseSemanticBuilderResult;
|
|
944
974
|
|
|
945
975
|
declare const buttonVariants: (props?: ({
|
|
946
|
-
variant?: "
|
|
947
|
-
size?: "
|
|
976
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
977
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
948
978
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
949
979
|
interface ButtonProps extends react.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
950
980
|
asChild?: boolean;
|
|
@@ -956,7 +986,7 @@ declare const Input: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProp
|
|
|
956
986
|
declare const Textarea: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & react.RefAttributes<HTMLTextAreaElement>>;
|
|
957
987
|
|
|
958
988
|
declare const badgeVariants: (props?: ({
|
|
959
|
-
variant?: "
|
|
989
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "error" | "success" | "warning" | null | undefined;
|
|
960
990
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
961
991
|
interface BadgeProps extends react.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
962
992
|
}
|
|
@@ -988,6 +1018,23 @@ interface MessageBubbleProps {
|
|
|
988
1018
|
unstyled?: boolean;
|
|
989
1019
|
}
|
|
990
1020
|
declare function MessageBubble({ role, children, className, unstyled }: MessageBubbleProps): react.JSX.Element;
|
|
1021
|
+
interface MessageContentProps {
|
|
1022
|
+
children: React.ReactNode;
|
|
1023
|
+
className?: string;
|
|
1024
|
+
/**
|
|
1025
|
+
* When the content is a plain string, render it as markdown (headings,
|
|
1026
|
+
* lists, bold/italic, code, links) instead of raw text. Defaults to true.
|
|
1027
|
+
* Set false for content that should be shown verbatim.
|
|
1028
|
+
*/
|
|
1029
|
+
markdown?: boolean;
|
|
1030
|
+
}
|
|
1031
|
+
declare function MessageContent({ children, className, markdown, }: MessageContentProps): react.JSX.Element;
|
|
1032
|
+
interface MessageContainerProps {
|
|
1033
|
+
role: MessageRole;
|
|
1034
|
+
children: React.ReactNode;
|
|
1035
|
+
className?: string;
|
|
1036
|
+
}
|
|
1037
|
+
declare function MessageContainer({ role, children, className }: MessageContainerProps): react.JSX.Element;
|
|
991
1038
|
|
|
992
1039
|
interface AgentAvatarProps {
|
|
993
1040
|
role: MessageRole;
|
|
@@ -1090,7 +1137,7 @@ interface PromptInputProps {
|
|
|
1090
1137
|
/** Input class */
|
|
1091
1138
|
inputClassName?: string;
|
|
1092
1139
|
/** Variant styling */
|
|
1093
|
-
variant?:
|
|
1140
|
+
variant?: "default" | "minimal" | "bordered";
|
|
1094
1141
|
/**
|
|
1095
1142
|
* Minimum number of visible text rows. Default 1 (grows as the user types).
|
|
1096
1143
|
*/
|
|
@@ -1316,6 +1363,11 @@ interface MessageListProps {
|
|
|
1316
1363
|
renderMessage?: (message: AgentMessage) => React.ReactNode;
|
|
1317
1364
|
/** Feedback handler passed to feedback-capable messages. */
|
|
1318
1365
|
onFeedback?: (messageId: string, vote: 'up' | 'down') => void;
|
|
1366
|
+
/**
|
|
1367
|
+
* Invoked when an inline confirmation-panel action is activated. Receives the
|
|
1368
|
+
* owning message id and the action id.
|
|
1369
|
+
*/
|
|
1370
|
+
onConfirmAction?: (messageId: string, actionId: string) => void;
|
|
1319
1371
|
className?: string;
|
|
1320
1372
|
}
|
|
1321
1373
|
/**
|
|
@@ -1324,7 +1376,7 @@ interface MessageListProps {
|
|
|
1324
1376
|
* content, attachments, and any structured data payload. This is the default
|
|
1325
1377
|
* conversation body shared by every surface.
|
|
1326
1378
|
*/
|
|
1327
|
-
declare function MessageList({ messages, showAvatars, renderMessage, className, }: MessageListProps): react.JSX.Element;
|
|
1379
|
+
declare function MessageList({ messages, showAvatars, renderMessage, onConfirmAction, className, }: MessageListProps): react.JSX.Element;
|
|
1328
1380
|
|
|
1329
1381
|
interface PersonaSelectorProps {
|
|
1330
1382
|
/** Available personas to choose from. */
|
|
@@ -1601,6 +1653,56 @@ interface SettingsPanelProps {
|
|
|
1601
1653
|
}
|
|
1602
1654
|
declare function SettingsPanel({ groups, onChange, className }: SettingsPanelProps): react.JSX.Element;
|
|
1603
1655
|
|
|
1656
|
+
interface ConfirmationAction {
|
|
1657
|
+
id: string;
|
|
1658
|
+
label: string;
|
|
1659
|
+
/** Button variant; defaults to 'default' for the first action, 'outline' otherwise. */
|
|
1660
|
+
variant?: ButtonProps['variant'];
|
|
1661
|
+
/** Disable this action. */
|
|
1662
|
+
disabled?: boolean;
|
|
1663
|
+
/** Render a loading/busy state and disable the button. */
|
|
1664
|
+
busy?: boolean;
|
|
1665
|
+
}
|
|
1666
|
+
interface ConfirmationPanelProps {
|
|
1667
|
+
/** Panel heading, e.g. "Proposed plan". */
|
|
1668
|
+
title?: string;
|
|
1669
|
+
/**
|
|
1670
|
+
* Short label shown beside the title (e.g. "0 pages to change"). Rendered as
|
|
1671
|
+
* a badge so scope/summary metadata reads at a glance.
|
|
1672
|
+
*/
|
|
1673
|
+
summary?: string;
|
|
1674
|
+
/**
|
|
1675
|
+
* The plan / confirmation body. When a string is passed it is rendered
|
|
1676
|
+
* through the same markdown pipeline as assistant messages, so headings,
|
|
1677
|
+
* paragraphs, and bullet/numbered lists keep their spacing and line breaks.
|
|
1678
|
+
* Pass `markdown={false}` to render verbatim, or pass a node for custom body.
|
|
1679
|
+
*/
|
|
1680
|
+
body?: React.ReactNode;
|
|
1681
|
+
/**
|
|
1682
|
+
* Render the string body as markdown. Defaults to true. Ignored for node
|
|
1683
|
+
* bodies (which are rendered as-is).
|
|
1684
|
+
*/
|
|
1685
|
+
markdown?: boolean;
|
|
1686
|
+
/** Leading icon for the header. Defaults to a clipboard list icon. */
|
|
1687
|
+
icon?: React.ReactNode;
|
|
1688
|
+
/** Action buttons (confirm / cancel / regenerate, …). */
|
|
1689
|
+
actions?: ConfirmationAction[];
|
|
1690
|
+
/** Invoked with the action id when an action button is activated. */
|
|
1691
|
+
onAction?: (id: string) => void;
|
|
1692
|
+
/** Accessible label for the panel region. Defaults to the title. */
|
|
1693
|
+
ariaLabel?: string;
|
|
1694
|
+
className?: string;
|
|
1695
|
+
}
|
|
1696
|
+
/**
|
|
1697
|
+
* An inline confirmation / proposed-plan / action panel.
|
|
1698
|
+
*
|
|
1699
|
+
* It is designed to flow inside the transcript like any other message — NOT to
|
|
1700
|
+
* be pinned above the input — so it never covers the latest assistant response.
|
|
1701
|
+
* The body reuses {@link MessageContent}, giving long plans the same markdown
|
|
1702
|
+
* rendering, typography, and spacing as normal assistant messages.
|
|
1703
|
+
*/
|
|
1704
|
+
declare function ConfirmationPanel({ title, summary, body, markdown, icon, actions, onAction, ariaLabel, className, }: ConfirmationPanelProps): react.JSX.Element;
|
|
1705
|
+
|
|
1604
1706
|
/**
|
|
1605
1707
|
* Lifecycle of an agent-to-agent handoff.
|
|
1606
1708
|
* - 'connecting' → the target agent is being brought online / routed to.
|
|
@@ -2543,6 +2645,12 @@ interface AgentSurfaceProps {
|
|
|
2543
2645
|
renderMessage?: (message: AgentMessage) => ReactNode;
|
|
2544
2646
|
/** Feedback handler passed to MessageList. */
|
|
2545
2647
|
onFeedback?: (messageId: string, vote: 'up' | 'down') => void;
|
|
2648
|
+
/**
|
|
2649
|
+
* Handler for inline confirmation-panel actions. Receives the owning message
|
|
2650
|
+
* id and the activated action id. Confirmation panels render inline in the
|
|
2651
|
+
* transcript (via `message.confirmation`), never pinned over the response.
|
|
2652
|
+
*/
|
|
2653
|
+
onConfirmAction?: (messageId: string, actionId: string) => void;
|
|
2546
2654
|
/**
|
|
2547
2655
|
* Structured report rendered in the data region. Used by the
|
|
2548
2656
|
* dashboard/split surfaces (sidebar or data panel). If omitted, a custom
|
|
@@ -2582,6 +2690,6 @@ interface AgentSurfaceProps {
|
|
|
2582
2690
|
* - 'overlay' → OverlayModal (centered modal conversation)
|
|
2583
2691
|
* - 'mobile' → MobileShell (full-height mobile layout)
|
|
2584
2692
|
*/
|
|
2585
|
-
declare function AgentSurface({ mode, messages, isLoading, inputValue, onInputChange, onSubmit, inputPlaceholder, input, title, subtitle, icon, headerActions, suggestions, showAvatars, renderMessage, onFeedback, report, dataPanel, isOpen, onToggle, onClose, onExitFullscreen, position, status, className, }: AgentSurfaceProps): react.JSX.Element;
|
|
2693
|
+
declare function AgentSurface({ mode, messages, isLoading, inputValue, onInputChange, onSubmit, inputPlaceholder, input, title, subtitle, icon, headerActions, suggestions, showAvatars, renderMessage, onFeedback, onConfirmAction, report, dataPanel, isOpen, onToggle, onClose, onExitFullscreen, position, status, className, }: AgentSurfaceProps): react.JSX.Element;
|
|
2586
2694
|
|
|
2587
|
-
export { type AgendaItem, type AgendaItemAction, type AgendaItemState, type AgendaSlotOption, type AgentAction, type AgentAttachment, AgentAvatar, type AgentBackend, type AgentBlock, type AgentConfig, type AgentContextValue, type AgentEvent, type AgentEventType, type AgentFeatures, AgentHandoff, type AgentHandoffProps, type AgentMessage, type AgentPersona, AgentProvider, type AgentProviderProps, type AgentReport, type AgentState, type AgentStreamChunk, AgentSurface, type AgentSurfaceProps, AllocationBreakdown, type AllocationSegment, type AllocationSummaryStat, type AnalyticsBreakdownRow, AnalyticsDashboard, type AnalyticsDashboardProps, type AnalyticsDistributionSegment, type AnalyticsHighlight, type AnalyticsMetric, type AnalyticsRankedRow, type AnalyticsRecentItem, type AnalyticsTrend, type AssistantMessageBlocksEnvelope, type AssistantMessageCompleteEnvelope, type AssistantMessageDeltaEnvelope, type AssistantMessageStartEnvelope, type AssistantMessageThinkingDeltaEnvelope, type Attachment, type AttachmentKind, type AttachmentMediaType, type AttachmentType, Avatar, AvatarFallback, AvatarImage, Badge, type BlockUpdateMode, Button, ChartContainer, type ChartData, type ChartDataPoint, type ChartType, type ChatMessageRole, ChatPanel, Collapsible, CollapsibleContent, CollapsibleTrigger, type ComponentCapability, type ComponentCategory, type ComponentManifestEntry, type ComponentSlot, type ConnectionReadyEnvelope, type ConnectionState, ControlGrid, type ControlTile, type ControlTileType, ConversationAnalytics, ConversationArtifact, type ConversationArtifactProps, type ConversationHistoryItem, type DataPayload, DataPayloadView, DataTable, DynamicRenderer, type EditorAdjustment, type EditorTool, type EmotionScore, type EntityAction, EntityCard, type EntityCardData, type EntityField, type ErrorEnvelope, type ExecutionStep, type ExecutionStepStatus, type FeedbackCategory, type FeedbackSentiment, FileDropZone, FloatingWidget, FullBleedSurface, type FullBleedSurfaceProps, FullscreenDashboard, type GenerateReportOptions, GuidedLessonFlow, type HandoffAction, type HandoffAgent, type HandoffCandidate, type HandoffStatus, type HandoffVariant, ImageGenerator, type InlineSuggestion, InlineSuggestionsInput, Input, type LayoutConfig, type LayoutMode, type LessonStep, type LibraryPrompt, type Listing, type ListingAction, ListingFeed, type ListingField, type ManifestPropSpec, MediaEditorCanvas, MediaGallery, type MediaItem, type MediaKind, MessageActions, MessageBubble, type MessageFeedback, MessageList, type MessageListProps, type MessageMetadata, type MessageRole, MessageWithAttachments, MessageWithFeedback, MessageWithReasoning, MessageWithSteps, type MetricData, MetricsGrid, MobileShell, type MockBackendConfig, MultimodalInput, OnboardingWizard, type OptionCardItem, OptionCards, type OrchestrationCommand, OverlayModal, PerformanceMetrics, PersonaSelector, Progress, ProgressTracker, PromptInput, PromptLibrary, type PromptTemplate, QuickReplies, type QuickReply, QuizCard, type QuizOption, type QuizQuestion, type QuizResult, type ReasoningStatus, type ReasoningStep, type Recommendation, type RecommendationAction, RecommendationCards, type RecommendationTone, type RenderInstruction, type ReportSection, ReportView, ScheduleTimeline, ScrollArea, ScrollBar, type SemanticBuilderChatMessage, SemanticBuilderSocketClient, type SendMessageOptions, type SendOptions, SentimentDisplay, type SentimentScore, type ServerEnvelope, type SettingControl, type SettingsGroup, SettingsPanel, SlotRenderer, type SocketClientOptions, type SocketSendPayload, type SocketUrlResolver, SplitView, StatusBadge, SystemMessage, type TableColumn, type TableData, TemplateSelector, type TemplateVariable, Textarea, type ThemeConfig, Timestamp, type ToolCall, type ToolDefinition, type ToolResult, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type TrendDirection, type TrendTone, TypingIndicator, type UseSemanticBuilderOptions, type UseSemanticBuilderResult, type UserMessageEnvelope, type WidgetPosition, WritingAssistant, badgeVariants, buildSocketUrl, buttonVariants, calculatePercentage, cn, componentManifest, componentMap, componentRegistry, copyToClipboard, createMockBackend, debounce, delay, findComponentsByCapability, findComponentsByCategory, findComponentsBySurface, formatBytes, formatCurrency, formatNumber, formatRelativeTime, formatTime, generateId, getInitials, getManifestEntry, getSentimentBgColor, getSentimentColor, isBrowser, isInIframe, normalizeWebsiteId, parseTextWithBold, registerAllComponents, truncate, useAgent, useAgentBackend, useAgentInput, useAgentLayout, useAgentMessages, useSemanticBuilder };
|
|
2695
|
+
export { type AgendaItem, type AgendaItemAction, type AgendaItemState, type AgendaSlotOption, type AgentAction, type AgentAttachment, AgentAvatar, type AgentBackend, type AgentBlock, type AgentConfig, type AgentContextValue, type AgentEvent, type AgentEventType, type AgentFeatures, AgentHandoff, type AgentHandoffProps, type AgentMessage, type AgentPersona, AgentProvider, type AgentProviderProps, type AgentReport, type AgentState, type AgentStreamChunk, AgentSurface, type AgentSurfaceProps, AllocationBreakdown, type AllocationSegment, type AllocationSummaryStat, type AnalyticsBreakdownRow, AnalyticsDashboard, type AnalyticsDashboardProps, type AnalyticsDistributionSegment, type AnalyticsHighlight, type AnalyticsMetric, type AnalyticsRankedRow, type AnalyticsRecentItem, type AnalyticsTrend, type AssistantMessageBlocksEnvelope, type AssistantMessageCompleteEnvelope, type AssistantMessageDeltaEnvelope, type AssistantMessageStartEnvelope, type AssistantMessageThinkingDeltaEnvelope, type Attachment, type AttachmentKind, type AttachmentMediaType, type AttachmentType, Avatar, AvatarFallback, AvatarImage, Badge, type BlockUpdateMode, Button, ChartContainer, type ChartData, type ChartDataPoint, type ChartType, type ChatMessageRole, ChatPanel, Collapsible, CollapsibleContent, CollapsibleTrigger, type ComponentCapability, type ComponentCategory, type ComponentManifestEntry, type ComponentSlot, type ConfirmationAction, type ConfirmationActionData, type ConfirmationData, ConfirmationPanel, type ConfirmationPanelProps, type ConnectionReadyEnvelope, type ConnectionState, ControlGrid, type ControlTile, type ControlTileType, ConversationAnalytics, ConversationArtifact, type ConversationArtifactProps, type ConversationHistoryItem, type DataPayload, DataPayloadView, DataTable, DynamicRenderer, type EditorAdjustment, type EditorTool, type EmotionScore, type EntityAction, EntityCard, type EntityCardData, type EntityField, type ErrorEnvelope, type ExecutionStep, type ExecutionStepStatus, type FeedbackCategory, type FeedbackSentiment, FileDropZone, FloatingWidget, FullBleedSurface, type FullBleedSurfaceProps, FullscreenDashboard, type GenerateReportOptions, GuidedLessonFlow, type HandoffAction, type HandoffAgent, type HandoffCandidate, type HandoffStatus, type HandoffVariant, ImageGenerator, type InlineSuggestion, InlineSuggestionsInput, Input, type LayoutConfig, type LayoutMode, type LessonStep, type LibraryPrompt, type Listing, type ListingAction, ListingFeed, type ListingField, type ManifestPropSpec, MediaEditorCanvas, MediaGallery, type MediaItem, type MediaKind, MessageActions, MessageBubble, type MessageBubbleProps, MessageContainer, type MessageContainerProps, MessageContent, type MessageContentProps, type MessageFeedback, MessageList, type MessageListProps, type MessageMetadata, type MessageRole, MessageWithAttachments, MessageWithFeedback, MessageWithReasoning, MessageWithSteps, type MetricData, MetricsGrid, MobileShell, type MockBackendConfig, MultimodalInput, OnboardingWizard, type OptionCardItem, OptionCards, type OrchestrationCommand, OverlayModal, PerformanceMetrics, PersonaSelector, Progress, ProgressTracker, PromptInput, PromptLibrary, type PromptTemplate, QuickReplies, type QuickReply, QuizCard, type QuizOption, type QuizQuestion, type QuizResult, type ReasoningStatus, type ReasoningStep, type Recommendation, type RecommendationAction, RecommendationCards, type RecommendationTone, type RenderInstruction, type ReportSection, ReportView, ScheduleTimeline, ScrollArea, ScrollBar, type SemanticBuilderChatMessage, SemanticBuilderSocketClient, type SendMessageOptions, type SendOptions, SentimentDisplay, type SentimentScore, type ServerEnvelope, type SettingControl, type SettingsGroup, SettingsPanel, SlotRenderer, type SocketClientOptions, type SocketSendPayload, type SocketUrlResolver, SplitView, StatusBadge, SystemMessage, type TableColumn, type TableData, TemplateSelector, type TemplateVariable, Textarea, type ThemeConfig, Timestamp, type ToolCall, type ToolDefinition, type ToolResult, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type TrendDirection, type TrendTone, TypingIndicator, type UseSemanticBuilderOptions, type UseSemanticBuilderResult, type UserMessageEnvelope, type WidgetPosition, WritingAssistant, badgeVariants, buildSocketUrl, buttonVariants, calculatePercentage, cn, componentManifest, componentMap, componentRegistry, copyToClipboard, createMockBackend, debounce, delay, findComponentsByCapability, findComponentsByCategory, findComponentsBySurface, formatBytes, formatCurrency, formatNumber, formatRelativeTime, formatTime, generateId, getInitials, getManifestEntry, getSentimentBgColor, getSentimentColor, isBrowser, isInIframe, normalizeWebsiteId, parseTextWithBold, registerAllComponents, truncate, useAgent, useAgentBackend, useAgentInput, useAgentLayout, useAgentMessages, useSemanticBuilder };
|
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,36 @@ interface AgentMessage {
|
|
|
22
22
|
feedback?: MessageFeedback;
|
|
23
23
|
/** For chart/data messages */
|
|
24
24
|
data?: DataPayload;
|
|
25
|
+
/**
|
|
26
|
+
* An inline confirmation / proposed-plan / action panel attached to this
|
|
27
|
+
* message. Rendered in the transcript flow (after the message content) so it
|
|
28
|
+
* never covers the assistant response. See `ConfirmationData`.
|
|
29
|
+
*/
|
|
30
|
+
confirmation?: ConfirmationData;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Data-only description of an inline confirmation / proposed-plan panel. The
|
|
34
|
+
* `MessageList` renders this with the `ConfirmationPanel` component, reusing the
|
|
35
|
+
* shared markdown rendering for the body so long plans keep readable spacing.
|
|
36
|
+
*/
|
|
37
|
+
interface ConfirmationData {
|
|
38
|
+
/** Panel heading, e.g. "Proposed plan". */
|
|
39
|
+
title?: string;
|
|
40
|
+
/** Short scope/summary label, e.g. "3 pages to change". */
|
|
41
|
+
summary?: string;
|
|
42
|
+
/** Plan / confirmation body. Rendered as markdown by default. */
|
|
43
|
+
body?: string;
|
|
44
|
+
/** Render the body verbatim instead of as markdown. */
|
|
45
|
+
markdown?: boolean;
|
|
46
|
+
/** Action buttons (confirm / cancel / regenerate, …). */
|
|
47
|
+
actions?: ConfirmationActionData[];
|
|
48
|
+
}
|
|
49
|
+
interface ConfirmationActionData {
|
|
50
|
+
id: string;
|
|
51
|
+
label: string;
|
|
52
|
+
variant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link';
|
|
53
|
+
disabled?: boolean;
|
|
54
|
+
busy?: boolean;
|
|
25
55
|
}
|
|
26
56
|
interface MessageMetadata {
|
|
27
57
|
model?: string;
|
|
@@ -943,8 +973,8 @@ interface UseSemanticBuilderResult {
|
|
|
943
973
|
declare function useSemanticBuilder<TBlock = AgentBlock>({ socketUrl, resolveSocketUrl, websiteId, pageCategoryId, pageName, pageSlug, blocks, contentBrief, enabled, onGeneratedBlocks, onUndoRequest, buildWelcomeMessage, webSocketImpl, }: UseSemanticBuilderOptions<TBlock>): UseSemanticBuilderResult;
|
|
944
974
|
|
|
945
975
|
declare const buttonVariants: (props?: ({
|
|
946
|
-
variant?: "
|
|
947
|
-
size?: "
|
|
976
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
977
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
948
978
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
949
979
|
interface ButtonProps extends react.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
950
980
|
asChild?: boolean;
|
|
@@ -956,7 +986,7 @@ declare const Input: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProp
|
|
|
956
986
|
declare const Textarea: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & react.RefAttributes<HTMLTextAreaElement>>;
|
|
957
987
|
|
|
958
988
|
declare const badgeVariants: (props?: ({
|
|
959
|
-
variant?: "
|
|
989
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "error" | "success" | "warning" | null | undefined;
|
|
960
990
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
961
991
|
interface BadgeProps extends react.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
962
992
|
}
|
|
@@ -988,6 +1018,23 @@ interface MessageBubbleProps {
|
|
|
988
1018
|
unstyled?: boolean;
|
|
989
1019
|
}
|
|
990
1020
|
declare function MessageBubble({ role, children, className, unstyled }: MessageBubbleProps): react.JSX.Element;
|
|
1021
|
+
interface MessageContentProps {
|
|
1022
|
+
children: React.ReactNode;
|
|
1023
|
+
className?: string;
|
|
1024
|
+
/**
|
|
1025
|
+
* When the content is a plain string, render it as markdown (headings,
|
|
1026
|
+
* lists, bold/italic, code, links) instead of raw text. Defaults to true.
|
|
1027
|
+
* Set false for content that should be shown verbatim.
|
|
1028
|
+
*/
|
|
1029
|
+
markdown?: boolean;
|
|
1030
|
+
}
|
|
1031
|
+
declare function MessageContent({ children, className, markdown, }: MessageContentProps): react.JSX.Element;
|
|
1032
|
+
interface MessageContainerProps {
|
|
1033
|
+
role: MessageRole;
|
|
1034
|
+
children: React.ReactNode;
|
|
1035
|
+
className?: string;
|
|
1036
|
+
}
|
|
1037
|
+
declare function MessageContainer({ role, children, className }: MessageContainerProps): react.JSX.Element;
|
|
991
1038
|
|
|
992
1039
|
interface AgentAvatarProps {
|
|
993
1040
|
role: MessageRole;
|
|
@@ -1090,7 +1137,7 @@ interface PromptInputProps {
|
|
|
1090
1137
|
/** Input class */
|
|
1091
1138
|
inputClassName?: string;
|
|
1092
1139
|
/** Variant styling */
|
|
1093
|
-
variant?:
|
|
1140
|
+
variant?: "default" | "minimal" | "bordered";
|
|
1094
1141
|
/**
|
|
1095
1142
|
* Minimum number of visible text rows. Default 1 (grows as the user types).
|
|
1096
1143
|
*/
|
|
@@ -1316,6 +1363,11 @@ interface MessageListProps {
|
|
|
1316
1363
|
renderMessage?: (message: AgentMessage) => React.ReactNode;
|
|
1317
1364
|
/** Feedback handler passed to feedback-capable messages. */
|
|
1318
1365
|
onFeedback?: (messageId: string, vote: 'up' | 'down') => void;
|
|
1366
|
+
/**
|
|
1367
|
+
* Invoked when an inline confirmation-panel action is activated. Receives the
|
|
1368
|
+
* owning message id and the action id.
|
|
1369
|
+
*/
|
|
1370
|
+
onConfirmAction?: (messageId: string, actionId: string) => void;
|
|
1319
1371
|
className?: string;
|
|
1320
1372
|
}
|
|
1321
1373
|
/**
|
|
@@ -1324,7 +1376,7 @@ interface MessageListProps {
|
|
|
1324
1376
|
* content, attachments, and any structured data payload. This is the default
|
|
1325
1377
|
* conversation body shared by every surface.
|
|
1326
1378
|
*/
|
|
1327
|
-
declare function MessageList({ messages, showAvatars, renderMessage, className, }: MessageListProps): react.JSX.Element;
|
|
1379
|
+
declare function MessageList({ messages, showAvatars, renderMessage, onConfirmAction, className, }: MessageListProps): react.JSX.Element;
|
|
1328
1380
|
|
|
1329
1381
|
interface PersonaSelectorProps {
|
|
1330
1382
|
/** Available personas to choose from. */
|
|
@@ -1601,6 +1653,56 @@ interface SettingsPanelProps {
|
|
|
1601
1653
|
}
|
|
1602
1654
|
declare function SettingsPanel({ groups, onChange, className }: SettingsPanelProps): react.JSX.Element;
|
|
1603
1655
|
|
|
1656
|
+
interface ConfirmationAction {
|
|
1657
|
+
id: string;
|
|
1658
|
+
label: string;
|
|
1659
|
+
/** Button variant; defaults to 'default' for the first action, 'outline' otherwise. */
|
|
1660
|
+
variant?: ButtonProps['variant'];
|
|
1661
|
+
/** Disable this action. */
|
|
1662
|
+
disabled?: boolean;
|
|
1663
|
+
/** Render a loading/busy state and disable the button. */
|
|
1664
|
+
busy?: boolean;
|
|
1665
|
+
}
|
|
1666
|
+
interface ConfirmationPanelProps {
|
|
1667
|
+
/** Panel heading, e.g. "Proposed plan". */
|
|
1668
|
+
title?: string;
|
|
1669
|
+
/**
|
|
1670
|
+
* Short label shown beside the title (e.g. "0 pages to change"). Rendered as
|
|
1671
|
+
* a badge so scope/summary metadata reads at a glance.
|
|
1672
|
+
*/
|
|
1673
|
+
summary?: string;
|
|
1674
|
+
/**
|
|
1675
|
+
* The plan / confirmation body. When a string is passed it is rendered
|
|
1676
|
+
* through the same markdown pipeline as assistant messages, so headings,
|
|
1677
|
+
* paragraphs, and bullet/numbered lists keep their spacing and line breaks.
|
|
1678
|
+
* Pass `markdown={false}` to render verbatim, or pass a node for custom body.
|
|
1679
|
+
*/
|
|
1680
|
+
body?: React.ReactNode;
|
|
1681
|
+
/**
|
|
1682
|
+
* Render the string body as markdown. Defaults to true. Ignored for node
|
|
1683
|
+
* bodies (which are rendered as-is).
|
|
1684
|
+
*/
|
|
1685
|
+
markdown?: boolean;
|
|
1686
|
+
/** Leading icon for the header. Defaults to a clipboard list icon. */
|
|
1687
|
+
icon?: React.ReactNode;
|
|
1688
|
+
/** Action buttons (confirm / cancel / regenerate, …). */
|
|
1689
|
+
actions?: ConfirmationAction[];
|
|
1690
|
+
/** Invoked with the action id when an action button is activated. */
|
|
1691
|
+
onAction?: (id: string) => void;
|
|
1692
|
+
/** Accessible label for the panel region. Defaults to the title. */
|
|
1693
|
+
ariaLabel?: string;
|
|
1694
|
+
className?: string;
|
|
1695
|
+
}
|
|
1696
|
+
/**
|
|
1697
|
+
* An inline confirmation / proposed-plan / action panel.
|
|
1698
|
+
*
|
|
1699
|
+
* It is designed to flow inside the transcript like any other message — NOT to
|
|
1700
|
+
* be pinned above the input — so it never covers the latest assistant response.
|
|
1701
|
+
* The body reuses {@link MessageContent}, giving long plans the same markdown
|
|
1702
|
+
* rendering, typography, and spacing as normal assistant messages.
|
|
1703
|
+
*/
|
|
1704
|
+
declare function ConfirmationPanel({ title, summary, body, markdown, icon, actions, onAction, ariaLabel, className, }: ConfirmationPanelProps): react.JSX.Element;
|
|
1705
|
+
|
|
1604
1706
|
/**
|
|
1605
1707
|
* Lifecycle of an agent-to-agent handoff.
|
|
1606
1708
|
* - 'connecting' → the target agent is being brought online / routed to.
|
|
@@ -2543,6 +2645,12 @@ interface AgentSurfaceProps {
|
|
|
2543
2645
|
renderMessage?: (message: AgentMessage) => ReactNode;
|
|
2544
2646
|
/** Feedback handler passed to MessageList. */
|
|
2545
2647
|
onFeedback?: (messageId: string, vote: 'up' | 'down') => void;
|
|
2648
|
+
/**
|
|
2649
|
+
* Handler for inline confirmation-panel actions. Receives the owning message
|
|
2650
|
+
* id and the activated action id. Confirmation panels render inline in the
|
|
2651
|
+
* transcript (via `message.confirmation`), never pinned over the response.
|
|
2652
|
+
*/
|
|
2653
|
+
onConfirmAction?: (messageId: string, actionId: string) => void;
|
|
2546
2654
|
/**
|
|
2547
2655
|
* Structured report rendered in the data region. Used by the
|
|
2548
2656
|
* dashboard/split surfaces (sidebar or data panel). If omitted, a custom
|
|
@@ -2582,6 +2690,6 @@ interface AgentSurfaceProps {
|
|
|
2582
2690
|
* - 'overlay' → OverlayModal (centered modal conversation)
|
|
2583
2691
|
* - 'mobile' → MobileShell (full-height mobile layout)
|
|
2584
2692
|
*/
|
|
2585
|
-
declare function AgentSurface({ mode, messages, isLoading, inputValue, onInputChange, onSubmit, inputPlaceholder, input, title, subtitle, icon, headerActions, suggestions, showAvatars, renderMessage, onFeedback, report, dataPanel, isOpen, onToggle, onClose, onExitFullscreen, position, status, className, }: AgentSurfaceProps): react.JSX.Element;
|
|
2693
|
+
declare function AgentSurface({ mode, messages, isLoading, inputValue, onInputChange, onSubmit, inputPlaceholder, input, title, subtitle, icon, headerActions, suggestions, showAvatars, renderMessage, onFeedback, onConfirmAction, report, dataPanel, isOpen, onToggle, onClose, onExitFullscreen, position, status, className, }: AgentSurfaceProps): react.JSX.Element;
|
|
2586
2694
|
|
|
2587
|
-
export { type AgendaItem, type AgendaItemAction, type AgendaItemState, type AgendaSlotOption, type AgentAction, type AgentAttachment, AgentAvatar, type AgentBackend, type AgentBlock, type AgentConfig, type AgentContextValue, type AgentEvent, type AgentEventType, type AgentFeatures, AgentHandoff, type AgentHandoffProps, type AgentMessage, type AgentPersona, AgentProvider, type AgentProviderProps, type AgentReport, type AgentState, type AgentStreamChunk, AgentSurface, type AgentSurfaceProps, AllocationBreakdown, type AllocationSegment, type AllocationSummaryStat, type AnalyticsBreakdownRow, AnalyticsDashboard, type AnalyticsDashboardProps, type AnalyticsDistributionSegment, type AnalyticsHighlight, type AnalyticsMetric, type AnalyticsRankedRow, type AnalyticsRecentItem, type AnalyticsTrend, type AssistantMessageBlocksEnvelope, type AssistantMessageCompleteEnvelope, type AssistantMessageDeltaEnvelope, type AssistantMessageStartEnvelope, type AssistantMessageThinkingDeltaEnvelope, type Attachment, type AttachmentKind, type AttachmentMediaType, type AttachmentType, Avatar, AvatarFallback, AvatarImage, Badge, type BlockUpdateMode, Button, ChartContainer, type ChartData, type ChartDataPoint, type ChartType, type ChatMessageRole, ChatPanel, Collapsible, CollapsibleContent, CollapsibleTrigger, type ComponentCapability, type ComponentCategory, type ComponentManifestEntry, type ComponentSlot, type ConnectionReadyEnvelope, type ConnectionState, ControlGrid, type ControlTile, type ControlTileType, ConversationAnalytics, ConversationArtifact, type ConversationArtifactProps, type ConversationHistoryItem, type DataPayload, DataPayloadView, DataTable, DynamicRenderer, type EditorAdjustment, type EditorTool, type EmotionScore, type EntityAction, EntityCard, type EntityCardData, type EntityField, type ErrorEnvelope, type ExecutionStep, type ExecutionStepStatus, type FeedbackCategory, type FeedbackSentiment, FileDropZone, FloatingWidget, FullBleedSurface, type FullBleedSurfaceProps, FullscreenDashboard, type GenerateReportOptions, GuidedLessonFlow, type HandoffAction, type HandoffAgent, type HandoffCandidate, type HandoffStatus, type HandoffVariant, ImageGenerator, type InlineSuggestion, InlineSuggestionsInput, Input, type LayoutConfig, type LayoutMode, type LessonStep, type LibraryPrompt, type Listing, type ListingAction, ListingFeed, type ListingField, type ManifestPropSpec, MediaEditorCanvas, MediaGallery, type MediaItem, type MediaKind, MessageActions, MessageBubble, type MessageFeedback, MessageList, type MessageListProps, type MessageMetadata, type MessageRole, MessageWithAttachments, MessageWithFeedback, MessageWithReasoning, MessageWithSteps, type MetricData, MetricsGrid, MobileShell, type MockBackendConfig, MultimodalInput, OnboardingWizard, type OptionCardItem, OptionCards, type OrchestrationCommand, OverlayModal, PerformanceMetrics, PersonaSelector, Progress, ProgressTracker, PromptInput, PromptLibrary, type PromptTemplate, QuickReplies, type QuickReply, QuizCard, type QuizOption, type QuizQuestion, type QuizResult, type ReasoningStatus, type ReasoningStep, type Recommendation, type RecommendationAction, RecommendationCards, type RecommendationTone, type RenderInstruction, type ReportSection, ReportView, ScheduleTimeline, ScrollArea, ScrollBar, type SemanticBuilderChatMessage, SemanticBuilderSocketClient, type SendMessageOptions, type SendOptions, SentimentDisplay, type SentimentScore, type ServerEnvelope, type SettingControl, type SettingsGroup, SettingsPanel, SlotRenderer, type SocketClientOptions, type SocketSendPayload, type SocketUrlResolver, SplitView, StatusBadge, SystemMessage, type TableColumn, type TableData, TemplateSelector, type TemplateVariable, Textarea, type ThemeConfig, Timestamp, type ToolCall, type ToolDefinition, type ToolResult, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type TrendDirection, type TrendTone, TypingIndicator, type UseSemanticBuilderOptions, type UseSemanticBuilderResult, type UserMessageEnvelope, type WidgetPosition, WritingAssistant, badgeVariants, buildSocketUrl, buttonVariants, calculatePercentage, cn, componentManifest, componentMap, componentRegistry, copyToClipboard, createMockBackend, debounce, delay, findComponentsByCapability, findComponentsByCategory, findComponentsBySurface, formatBytes, formatCurrency, formatNumber, formatRelativeTime, formatTime, generateId, getInitials, getManifestEntry, getSentimentBgColor, getSentimentColor, isBrowser, isInIframe, normalizeWebsiteId, parseTextWithBold, registerAllComponents, truncate, useAgent, useAgentBackend, useAgentInput, useAgentLayout, useAgentMessages, useSemanticBuilder };
|
|
2695
|
+
export { type AgendaItem, type AgendaItemAction, type AgendaItemState, type AgendaSlotOption, type AgentAction, type AgentAttachment, AgentAvatar, type AgentBackend, type AgentBlock, type AgentConfig, type AgentContextValue, type AgentEvent, type AgentEventType, type AgentFeatures, AgentHandoff, type AgentHandoffProps, type AgentMessage, type AgentPersona, AgentProvider, type AgentProviderProps, type AgentReport, type AgentState, type AgentStreamChunk, AgentSurface, type AgentSurfaceProps, AllocationBreakdown, type AllocationSegment, type AllocationSummaryStat, type AnalyticsBreakdownRow, AnalyticsDashboard, type AnalyticsDashboardProps, type AnalyticsDistributionSegment, type AnalyticsHighlight, type AnalyticsMetric, type AnalyticsRankedRow, type AnalyticsRecentItem, type AnalyticsTrend, type AssistantMessageBlocksEnvelope, type AssistantMessageCompleteEnvelope, type AssistantMessageDeltaEnvelope, type AssistantMessageStartEnvelope, type AssistantMessageThinkingDeltaEnvelope, type Attachment, type AttachmentKind, type AttachmentMediaType, type AttachmentType, Avatar, AvatarFallback, AvatarImage, Badge, type BlockUpdateMode, Button, ChartContainer, type ChartData, type ChartDataPoint, type ChartType, type ChatMessageRole, ChatPanel, Collapsible, CollapsibleContent, CollapsibleTrigger, type ComponentCapability, type ComponentCategory, type ComponentManifestEntry, type ComponentSlot, type ConfirmationAction, type ConfirmationActionData, type ConfirmationData, ConfirmationPanel, type ConfirmationPanelProps, type ConnectionReadyEnvelope, type ConnectionState, ControlGrid, type ControlTile, type ControlTileType, ConversationAnalytics, ConversationArtifact, type ConversationArtifactProps, type ConversationHistoryItem, type DataPayload, DataPayloadView, DataTable, DynamicRenderer, type EditorAdjustment, type EditorTool, type EmotionScore, type EntityAction, EntityCard, type EntityCardData, type EntityField, type ErrorEnvelope, type ExecutionStep, type ExecutionStepStatus, type FeedbackCategory, type FeedbackSentiment, FileDropZone, FloatingWidget, FullBleedSurface, type FullBleedSurfaceProps, FullscreenDashboard, type GenerateReportOptions, GuidedLessonFlow, type HandoffAction, type HandoffAgent, type HandoffCandidate, type HandoffStatus, type HandoffVariant, ImageGenerator, type InlineSuggestion, InlineSuggestionsInput, Input, type LayoutConfig, type LayoutMode, type LessonStep, type LibraryPrompt, type Listing, type ListingAction, ListingFeed, type ListingField, type ManifestPropSpec, MediaEditorCanvas, MediaGallery, type MediaItem, type MediaKind, MessageActions, MessageBubble, type MessageBubbleProps, MessageContainer, type MessageContainerProps, MessageContent, type MessageContentProps, type MessageFeedback, MessageList, type MessageListProps, type MessageMetadata, type MessageRole, MessageWithAttachments, MessageWithFeedback, MessageWithReasoning, MessageWithSteps, type MetricData, MetricsGrid, MobileShell, type MockBackendConfig, MultimodalInput, OnboardingWizard, type OptionCardItem, OptionCards, type OrchestrationCommand, OverlayModal, PerformanceMetrics, PersonaSelector, Progress, ProgressTracker, PromptInput, PromptLibrary, type PromptTemplate, QuickReplies, type QuickReply, QuizCard, type QuizOption, type QuizQuestion, type QuizResult, type ReasoningStatus, type ReasoningStep, type Recommendation, type RecommendationAction, RecommendationCards, type RecommendationTone, type RenderInstruction, type ReportSection, ReportView, ScheduleTimeline, ScrollArea, ScrollBar, type SemanticBuilderChatMessage, SemanticBuilderSocketClient, type SendMessageOptions, type SendOptions, SentimentDisplay, type SentimentScore, type ServerEnvelope, type SettingControl, type SettingsGroup, SettingsPanel, SlotRenderer, type SocketClientOptions, type SocketSendPayload, type SocketUrlResolver, SplitView, StatusBadge, SystemMessage, type TableColumn, type TableData, TemplateSelector, type TemplateVariable, Textarea, type ThemeConfig, Timestamp, type ToolCall, type ToolDefinition, type ToolResult, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type TrendDirection, type TrendTone, TypingIndicator, type UseSemanticBuilderOptions, type UseSemanticBuilderResult, type UserMessageEnvelope, type WidgetPosition, WritingAssistant, badgeVariants, buildSocketUrl, buttonVariants, calculatePercentage, cn, componentManifest, componentMap, componentRegistry, copyToClipboard, createMockBackend, debounce, delay, findComponentsByCapability, findComponentsByCategory, findComponentsBySurface, formatBytes, formatCurrency, formatNumber, formatRelativeTime, formatTime, generateId, getInitials, getManifestEntry, getSentimentBgColor, getSentimentColor, isBrowser, isInIframe, normalizeWebsiteId, parseTextWithBold, registerAllComponents, truncate, useAgent, useAgentBackend, useAgentInput, useAgentLayout, useAgentMessages, useSemanticBuilder };
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { createContext, forwardRef, useRef, useImperativeHandle, useCallback, us
|
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
7
|
import { AnimatePresence, motion } from 'motion/react';
|
|
8
8
|
import { Markdown } from '@page-speed/markdown-to-jsx';
|
|
9
|
-
import { SendIcon, PaperclipIcon, FileTextIcon, MicIcon, ImageIcon, XIcon, SearchIcon, UploadIcon, FileIcon, UserCircleIcon, CheckIcon, SparklesIcon, BookmarkIcon, InfoIcon, CheckCircle2Icon, AlertTriangleIcon, LightbulbIcon, BrainIcon, ChevronDownIcon, ZapIcon, CopyIcon, ThumbsUpIcon, ThumbsDownIcon, BotIcon, UserIcon, DownloadIcon, MinusIcon, TrendingDownIcon, TrendingUpIcon, ChevronUpIcon, ArrowUpDownIcon, LinkIcon, PlayIcon, ExternalLinkIcon, WandIcon, LayoutGridIcon, Grid3X3Icon, ArrowUpRightIcon, ShuffleIcon, SkipForwardIcon, ChevronLeftIcon, ChevronRightIcon, XCircleIcon, HelpCircleIcon, Minimize2Icon, Maximize2Icon, RotateCcwIcon, MessageSquareIcon, GripVerticalIcon, PanelLeftOpenIcon, PanelLeftCloseIcon, CheckCircleIcon, AlertCircleIcon, MoreHorizontalIcon, ArrowLeftIcon, MoreVerticalIcon, Loader2Icon, ArrowRightIcon, AlignLeftIcon, ListIcon, HashIcon, TypeIcon, ClockIcon, CoinsIcon, ActivityIcon, ArrowUpIcon, ArrowDownIcon } from 'lucide-react';
|
|
9
|
+
import { SendIcon, PaperclipIcon, FileTextIcon, MicIcon, ImageIcon, XIcon, SearchIcon, UploadIcon, FileIcon, UserCircleIcon, CheckIcon, SparklesIcon, BookmarkIcon, InfoIcon, CheckCircle2Icon, AlertTriangleIcon, LightbulbIcon, BrainIcon, ChevronDownIcon, ZapIcon, CopyIcon, ThumbsUpIcon, ThumbsDownIcon, BotIcon, UserIcon, DownloadIcon, MinusIcon, TrendingDownIcon, TrendingUpIcon, ChevronUpIcon, ArrowUpDownIcon, LinkIcon, PlayIcon, ExternalLinkIcon, WandIcon, LayoutGridIcon, Grid3X3Icon, ArrowUpRightIcon, ShuffleIcon, SkipForwardIcon, ChevronLeftIcon, ChevronRightIcon, XCircleIcon, HelpCircleIcon, Minimize2Icon, Maximize2Icon, RotateCcwIcon, MessageSquareIcon, GripVerticalIcon, PanelLeftOpenIcon, PanelLeftCloseIcon, CheckCircleIcon, AlertCircleIcon, MoreHorizontalIcon, ClipboardListIcon, ArrowLeftIcon, MoreVerticalIcon, Loader2Icon, ArrowRightIcon, AlignLeftIcon, ListIcon, HashIcon, TypeIcon, ClockIcon, CoinsIcon, ActivityIcon, ArrowUpIcon, ArrowDownIcon } from 'lucide-react';
|
|
10
10
|
import { Slot } from '@radix-ui/react-slot';
|
|
11
11
|
import { cva } from 'class-variance-authority';
|
|
12
12
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
@@ -1212,7 +1212,7 @@ var PromptInput = forwardRef(
|
|
|
1212
1212
|
[handleSubmit]
|
|
1213
1213
|
);
|
|
1214
1214
|
const variantStyles = {
|
|
1215
|
-
default: "
|
|
1215
|
+
default: "px-3 py-2.5",
|
|
1216
1216
|
minimal: "px-3 py-2",
|
|
1217
1217
|
bordered: "border rounded-lg px-3 py-2.5"
|
|
1218
1218
|
};
|
|
@@ -1221,41 +1221,48 @@ var PromptInput = forwardRef(
|
|
|
1221
1221
|
minimal: "bg-transparent px-0",
|
|
1222
1222
|
bordered: "bg-muted/50"
|
|
1223
1223
|
};
|
|
1224
|
-
return /* @__PURE__ */ jsx(
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1224
|
+
return /* @__PURE__ */ jsx(
|
|
1225
|
+
"form",
|
|
1226
|
+
{
|
|
1227
|
+
onSubmit: handleSubmit,
|
|
1228
|
+
className: cn(variantStyles[variant], className),
|
|
1229
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex items-end gap-2", children: [
|
|
1230
|
+
leftActions,
|
|
1231
|
+
/* @__PURE__ */ jsx(
|
|
1232
|
+
"textarea",
|
|
1233
|
+
{
|
|
1234
|
+
ref: textareaRef,
|
|
1235
|
+
value,
|
|
1236
|
+
onChange: (e) => onChange(e.target.value),
|
|
1237
|
+
onKeyDown: handleKeyDown,
|
|
1238
|
+
placeholder,
|
|
1239
|
+
disabled: disabled || loading,
|
|
1240
|
+
autoFocus,
|
|
1241
|
+
rows: minRows,
|
|
1242
|
+
className: cn(
|
|
1243
|
+
"flex-1 resize-none border-0 px-0 py-1 text-sm leading-5 shadow-none",
|
|
1244
|
+
"placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0",
|
|
1245
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
1246
|
+
inputVariantStyles[variant],
|
|
1247
|
+
inputClassName
|
|
1248
|
+
)
|
|
1249
|
+
}
|
|
1250
|
+
),
|
|
1251
|
+
rightActions,
|
|
1252
|
+
showSendButton && /* @__PURE__ */ jsx(
|
|
1253
|
+
Button,
|
|
1254
|
+
{
|
|
1255
|
+
type: "submit",
|
|
1256
|
+
size: "sm",
|
|
1257
|
+
variant: variant === "minimal" ? "ghost" : "outline",
|
|
1258
|
+
disabled: !value.trim() || disabled || loading,
|
|
1259
|
+
className: "size-8 shrink-0 p-0",
|
|
1260
|
+
children: sendButtonContent || /* @__PURE__ */ jsx(SendIcon, { className: "size-4" })
|
|
1261
|
+
}
|
|
1243
1262
|
)
|
|
1244
|
-
}
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
showSendButton && /* @__PURE__ */ jsx(
|
|
1248
|
-
Button,
|
|
1249
|
-
{
|
|
1250
|
-
type: "submit",
|
|
1251
|
-
size: "sm",
|
|
1252
|
-
variant: variant === "minimal" ? "ghost" : "outline",
|
|
1253
|
-
disabled: !value.trim() || disabled || loading,
|
|
1254
|
-
className: "size-8 shrink-0 p-0",
|
|
1255
|
-
children: sendButtonContent || /* @__PURE__ */ jsx(SendIcon, { className: "size-4" })
|
|
1256
|
-
}
|
|
1257
|
-
)
|
|
1258
|
-
] }) });
|
|
1263
|
+
] })
|
|
1264
|
+
}
|
|
1265
|
+
);
|
|
1259
1266
|
}
|
|
1260
1267
|
);
|
|
1261
1268
|
PromptInput.displayName = "PromptInput";
|
|
@@ -7691,10 +7698,58 @@ function ReportView({ report, className }) {
|
|
|
7691
7698
|
))
|
|
7692
7699
|
] });
|
|
7693
7700
|
}
|
|
7701
|
+
function ConfirmationPanel({
|
|
7702
|
+
title = "Proposed plan",
|
|
7703
|
+
summary,
|
|
7704
|
+
body,
|
|
7705
|
+
markdown = true,
|
|
7706
|
+
icon,
|
|
7707
|
+
actions,
|
|
7708
|
+
onAction,
|
|
7709
|
+
ariaLabel,
|
|
7710
|
+
className
|
|
7711
|
+
}) {
|
|
7712
|
+
const hasBody = body !== void 0 && body !== null && body !== "";
|
|
7713
|
+
return /* @__PURE__ */ jsxs(
|
|
7714
|
+
motion.section,
|
|
7715
|
+
{
|
|
7716
|
+
initial: { opacity: 0, y: 6 },
|
|
7717
|
+
animate: { opacity: 1, y: 0 },
|
|
7718
|
+
transition: { duration: 0.2 },
|
|
7719
|
+
"aria-label": ariaLabel ?? title,
|
|
7720
|
+
className: cn(
|
|
7721
|
+
"flex w-full min-w-0 flex-col rounded-lg border bg-card p-4",
|
|
7722
|
+
className
|
|
7723
|
+
),
|
|
7724
|
+
children: [
|
|
7725
|
+
/* @__PURE__ */ jsxs("header", { className: "flex items-center gap-2", children: [
|
|
7726
|
+
/* @__PURE__ */ jsx("span", { className: "flex size-6 shrink-0 items-center justify-center rounded-md bg-muted/60 text-muted-foreground", children: icon ?? /* @__PURE__ */ jsx(ClipboardListIcon, { className: "size-3.5" }) }),
|
|
7727
|
+
/* @__PURE__ */ jsx("h4", { className: "min-w-0 flex-1 truncate font-medium text-sm", children: title }),
|
|
7728
|
+
summary && /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "shrink-0 text-[10px] font-normal", children: summary })
|
|
7729
|
+
] }),
|
|
7730
|
+
hasBody && /* @__PURE__ */ jsx("div", { className: "mt-2 min-w-0", children: typeof body === "string" ? /* @__PURE__ */ jsx(MessageContent, { markdown, children: body }) : body }),
|
|
7731
|
+
actions && actions.length > 0 && /* @__PURE__ */ jsx("div", { className: "mt-3 flex flex-wrap gap-2", children: actions.map((action, index) => /* @__PURE__ */ jsx(
|
|
7732
|
+
Button,
|
|
7733
|
+
{
|
|
7734
|
+
type: "button",
|
|
7735
|
+
size: "sm",
|
|
7736
|
+
variant: action.variant ?? (index === 0 ? "default" : "outline"),
|
|
7737
|
+
disabled: action.disabled || action.busy,
|
|
7738
|
+
"aria-busy": action.busy || void 0,
|
|
7739
|
+
onClick: () => onAction?.(action.id),
|
|
7740
|
+
children: action.label
|
|
7741
|
+
},
|
|
7742
|
+
action.id
|
|
7743
|
+
)) })
|
|
7744
|
+
]
|
|
7745
|
+
}
|
|
7746
|
+
);
|
|
7747
|
+
}
|
|
7694
7748
|
function MessageList({
|
|
7695
7749
|
messages,
|
|
7696
7750
|
showAvatars = true,
|
|
7697
7751
|
renderMessage,
|
|
7752
|
+
onConfirmAction,
|
|
7698
7753
|
className
|
|
7699
7754
|
}) {
|
|
7700
7755
|
return /* @__PURE__ */ jsx("div", { className: cn("flex flex-col gap-4", className), children: messages.map((message) => {
|
|
@@ -7711,7 +7766,18 @@ function MessageList({
|
|
|
7711
7766
|
hasSteps && /* @__PURE__ */ jsx(MessageWithSteps, { steps: message.steps }),
|
|
7712
7767
|
message.content && /* @__PURE__ */ jsx(MessageBubble, { role: message.role, children: /* @__PURE__ */ jsx(MessageContent, { children: message.content }) }),
|
|
7713
7768
|
hasAttachments && /* @__PURE__ */ jsx(MessageWithAttachments, { attachments: message.attachments }),
|
|
7714
|
-
message.data && /* @__PURE__ */ jsx(DataPayloadView, { payload: message.data })
|
|
7769
|
+
message.data && /* @__PURE__ */ jsx(DataPayloadView, { payload: message.data }),
|
|
7770
|
+
message.confirmation && /* @__PURE__ */ jsx(
|
|
7771
|
+
ConfirmationPanel,
|
|
7772
|
+
{
|
|
7773
|
+
title: message.confirmation.title,
|
|
7774
|
+
summary: message.confirmation.summary,
|
|
7775
|
+
body: message.confirmation.body,
|
|
7776
|
+
markdown: message.confirmation.markdown,
|
|
7777
|
+
actions: message.confirmation.actions,
|
|
7778
|
+
onAction: (actionId) => onConfirmAction?.(message.id, actionId)
|
|
7779
|
+
}
|
|
7780
|
+
)
|
|
7715
7781
|
] })
|
|
7716
7782
|
] }, message.id);
|
|
7717
7783
|
}) });
|
|
@@ -7932,6 +7998,7 @@ function AgentSurface({
|
|
|
7932
7998
|
showAvatars = true,
|
|
7933
7999
|
renderMessage,
|
|
7934
8000
|
onFeedback,
|
|
8001
|
+
onConfirmAction,
|
|
7935
8002
|
report,
|
|
7936
8003
|
dataPanel,
|
|
7937
8004
|
isOpen = true,
|
|
@@ -7948,7 +8015,8 @@ function AgentSurface({
|
|
|
7948
8015
|
messages,
|
|
7949
8016
|
showAvatars,
|
|
7950
8017
|
renderMessage,
|
|
7951
|
-
onFeedback
|
|
8018
|
+
onFeedback,
|
|
8019
|
+
onConfirmAction
|
|
7952
8020
|
}
|
|
7953
8021
|
);
|
|
7954
8022
|
const resolvedInput = input ?? (onInputChange && onSubmit !== void 0 ? /* @__PURE__ */ jsx("div", { className: "border-t p-2", children: /* @__PURE__ */ jsx(
|
|
@@ -8055,6 +8123,6 @@ function AgentSurface({
|
|
|
8055
8123
|
}
|
|
8056
8124
|
}
|
|
8057
8125
|
|
|
8058
|
-
export { AgentAvatar, AgentHandoff, AgentProvider, AgentSurface, AllocationBreakdown, AnalyticsDashboard, Avatar, AvatarFallback, AvatarImage, Badge, Button, ChartContainer, ChatPanel, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, ControlGrid, ConversationAnalytics, ConversationArtifact, DataPayloadView, DataTable, DynamicRenderer, EntityCard, FileDropZone, FloatingWidget, FullBleedSurface, FullscreenDashboard, GuidedLessonFlow, ImageGenerator, InlineSuggestionsInput, Input, ListingFeed, MediaEditorCanvas, MediaGallery, MessageActions, MessageBubble, MessageList, MessageWithAttachments, MessageWithFeedback, MessageWithReasoning, MessageWithSteps, MetricsGrid, MobileShell, MultimodalInput, OnboardingWizard, OptionCards, OverlayModal, PerformanceMetrics, PersonaSelector, Progress, ProgressTracker, PromptInput, PromptLibrary, QuickReplies, QuizCard, RecommendationCards, ReportView, ScheduleTimeline, ScrollArea, ScrollBar, SemanticBuilderSocketClient, SentimentDisplay, SettingsPanel, SlotRenderer, SplitView, StatusBadge, SystemMessage, TemplateSelector, Textarea, Timestamp, Tooltip4 as Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TypingIndicator, WritingAssistant, badgeVariants, buildSocketUrl, buttonVariants, calculatePercentage, cn, componentManifest, componentMap, componentRegistry, copyToClipboard, createMockBackend, debounce, delay, findComponentsByCapability, findComponentsByCategory, findComponentsBySurface, formatBytes, formatCurrency, formatNumber, formatRelativeTime, formatTime, generateId, getInitials, getManifestEntry, getSentimentBgColor, getSentimentColor, isBrowser, isInIframe, normalizeWebsiteId, parseTextWithBold, registerAllComponents, truncate, useAgent, useAgentBackend, useAgentInput, useAgentLayout, useAgentMessages, useSemanticBuilder };
|
|
8126
|
+
export { AgentAvatar, AgentHandoff, AgentProvider, AgentSurface, AllocationBreakdown, AnalyticsDashboard, Avatar, AvatarFallback, AvatarImage, Badge, Button, ChartContainer, ChatPanel, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, ConfirmationPanel, ControlGrid, ConversationAnalytics, ConversationArtifact, DataPayloadView, DataTable, DynamicRenderer, EntityCard, FileDropZone, FloatingWidget, FullBleedSurface, FullscreenDashboard, GuidedLessonFlow, ImageGenerator, InlineSuggestionsInput, Input, ListingFeed, MediaEditorCanvas, MediaGallery, MessageActions, MessageBubble, MessageContainer, MessageContent, MessageList, MessageWithAttachments, MessageWithFeedback, MessageWithReasoning, MessageWithSteps, MetricsGrid, MobileShell, MultimodalInput, OnboardingWizard, OptionCards, OverlayModal, PerformanceMetrics, PersonaSelector, Progress, ProgressTracker, PromptInput, PromptLibrary, QuickReplies, QuizCard, RecommendationCards, ReportView, ScheduleTimeline, ScrollArea, ScrollBar, SemanticBuilderSocketClient, SentimentDisplay, SettingsPanel, SlotRenderer, SplitView, StatusBadge, SystemMessage, TemplateSelector, Textarea, Timestamp, Tooltip4 as Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TypingIndicator, WritingAssistant, badgeVariants, buildSocketUrl, buttonVariants, calculatePercentage, cn, componentManifest, componentMap, componentRegistry, copyToClipboard, createMockBackend, debounce, delay, findComponentsByCapability, findComponentsByCategory, findComponentsBySurface, formatBytes, formatCurrency, formatNumber, formatRelativeTime, formatTime, generateId, getInitials, getManifestEntry, getSentimentBgColor, getSentimentColor, isBrowser, isInIframe, normalizeWebsiteId, parseTextWithBold, registerAllComponents, truncate, useAgent, useAgentBackend, useAgentInput, useAgentLayout, useAgentMessages, useSemanticBuilder };
|
|
8059
8127
|
//# sourceMappingURL=index.js.map
|
|
8060
8128
|
//# sourceMappingURL=index.js.map
|