@page-speed/agent-everywhere 0.3.1 → 0.5.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 +110 -3
- package/dist/index.cjs +520 -39
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +326 -9
- package/dist/index.d.ts +326 -9
- package/dist/index.js +513 -41
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
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;
|
|
@@ -61,7 +91,16 @@ interface ExecutionStep {
|
|
|
61
91
|
code?: string;
|
|
62
92
|
output?: string;
|
|
63
93
|
}
|
|
64
|
-
type LayoutMode = 'panel' | 'widget' | 'overlay' | 'fullscreen' | 'split' | 'mobile';
|
|
94
|
+
type LayoutMode = 'panel' | 'widget' | 'overlay' | 'fullscreen' | 'split' | 'mobile' | 'native';
|
|
95
|
+
/**
|
|
96
|
+
* When the underlying agent session should open its WebSocket connection.
|
|
97
|
+
*
|
|
98
|
+
* - 'lazy' → connect on first submit (idle pages hold no connection). Default
|
|
99
|
+
* for the `native` variant, where the composer sits idle on most
|
|
100
|
+
* page loads.
|
|
101
|
+
* - 'eager' → connect as soon as the session provider mounts.
|
|
102
|
+
*/
|
|
103
|
+
type ConnectionStrategy = 'lazy' | 'eager';
|
|
65
104
|
type WidgetPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' | 'center';
|
|
66
105
|
interface LayoutConfig {
|
|
67
106
|
mode: LayoutMode;
|
|
@@ -922,6 +961,13 @@ interface UseSemanticBuilderOptions<TBlock = AgentBlock> {
|
|
|
922
961
|
pageName: string;
|
|
923
962
|
hasContentBrief: boolean;
|
|
924
963
|
}) => string;
|
|
964
|
+
/**
|
|
965
|
+
* Seed the synthetic "welcome" system message on mount and whenever the
|
|
966
|
+
* page/brief context changes. Default `true` (existing behavior). Set `false`
|
|
967
|
+
* to start with an empty transcript — used by the native variant so its idle
|
|
968
|
+
* composer is not preceded by a connection notice.
|
|
969
|
+
*/
|
|
970
|
+
seedWelcomeMessage?: boolean;
|
|
925
971
|
/** Optional WebSocket implementation (SSR/tests). */
|
|
926
972
|
webSocketImpl?: typeof WebSocket;
|
|
927
973
|
}
|
|
@@ -939,12 +985,14 @@ interface UseSemanticBuilderResult {
|
|
|
939
985
|
isStreaming: boolean;
|
|
940
986
|
sendMessage: (content: string, options?: SendMessageOptions) => Promise<boolean>;
|
|
941
987
|
retry: () => void;
|
|
988
|
+
/** Clear the transcript and reset to an empty conversation. */
|
|
989
|
+
reset: () => void;
|
|
942
990
|
}
|
|
943
|
-
declare function useSemanticBuilder<TBlock = AgentBlock>({ socketUrl, resolveSocketUrl, websiteId, pageCategoryId, pageName, pageSlug, blocks, contentBrief, enabled, onGeneratedBlocks, onUndoRequest, buildWelcomeMessage, webSocketImpl, }: UseSemanticBuilderOptions<TBlock>): UseSemanticBuilderResult;
|
|
991
|
+
declare function useSemanticBuilder<TBlock = AgentBlock>({ socketUrl, resolveSocketUrl, websiteId, pageCategoryId, pageName, pageSlug, blocks, contentBrief, enabled, onGeneratedBlocks, onUndoRequest, buildWelcomeMessage, seedWelcomeMessage, webSocketImpl, }: UseSemanticBuilderOptions<TBlock>): UseSemanticBuilderResult;
|
|
944
992
|
|
|
945
993
|
declare const buttonVariants: (props?: ({
|
|
946
|
-
variant?: "
|
|
947
|
-
size?: "
|
|
994
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
995
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
948
996
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
949
997
|
interface ButtonProps extends react.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
950
998
|
asChild?: boolean;
|
|
@@ -956,7 +1004,7 @@ declare const Input: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProp
|
|
|
956
1004
|
declare const Textarea: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & react.RefAttributes<HTMLTextAreaElement>>;
|
|
957
1005
|
|
|
958
1006
|
declare const badgeVariants: (props?: ({
|
|
959
|
-
variant?: "
|
|
1007
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "error" | "success" | "warning" | null | undefined;
|
|
960
1008
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
961
1009
|
interface BadgeProps extends react.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
962
1010
|
}
|
|
@@ -988,6 +1036,23 @@ interface MessageBubbleProps {
|
|
|
988
1036
|
unstyled?: boolean;
|
|
989
1037
|
}
|
|
990
1038
|
declare function MessageBubble({ role, children, className, unstyled }: MessageBubbleProps): react.JSX.Element;
|
|
1039
|
+
interface MessageContentProps {
|
|
1040
|
+
children: React.ReactNode;
|
|
1041
|
+
className?: string;
|
|
1042
|
+
/**
|
|
1043
|
+
* When the content is a plain string, render it as markdown (headings,
|
|
1044
|
+
* lists, bold/italic, code, links) instead of raw text. Defaults to true.
|
|
1045
|
+
* Set false for content that should be shown verbatim.
|
|
1046
|
+
*/
|
|
1047
|
+
markdown?: boolean;
|
|
1048
|
+
}
|
|
1049
|
+
declare function MessageContent({ children, className, markdown, }: MessageContentProps): react.JSX.Element;
|
|
1050
|
+
interface MessageContainerProps {
|
|
1051
|
+
role: MessageRole;
|
|
1052
|
+
children: React.ReactNode;
|
|
1053
|
+
className?: string;
|
|
1054
|
+
}
|
|
1055
|
+
declare function MessageContainer({ role, children, className }: MessageContainerProps): react.JSX.Element;
|
|
991
1056
|
|
|
992
1057
|
interface AgentAvatarProps {
|
|
993
1058
|
role: MessageRole;
|
|
@@ -1090,7 +1155,7 @@ interface PromptInputProps {
|
|
|
1090
1155
|
/** Input class */
|
|
1091
1156
|
inputClassName?: string;
|
|
1092
1157
|
/** Variant styling */
|
|
1093
|
-
variant?:
|
|
1158
|
+
variant?: "default" | "minimal" | "bordered";
|
|
1094
1159
|
/**
|
|
1095
1160
|
* Minimum number of visible text rows. Default 1 (grows as the user types).
|
|
1096
1161
|
*/
|
|
@@ -1316,6 +1381,11 @@ interface MessageListProps {
|
|
|
1316
1381
|
renderMessage?: (message: AgentMessage) => React.ReactNode;
|
|
1317
1382
|
/** Feedback handler passed to feedback-capable messages. */
|
|
1318
1383
|
onFeedback?: (messageId: string, vote: 'up' | 'down') => void;
|
|
1384
|
+
/**
|
|
1385
|
+
* Invoked when an inline confirmation-panel action is activated. Receives the
|
|
1386
|
+
* owning message id and the action id.
|
|
1387
|
+
*/
|
|
1388
|
+
onConfirmAction?: (messageId: string, actionId: string) => void;
|
|
1319
1389
|
className?: string;
|
|
1320
1390
|
}
|
|
1321
1391
|
/**
|
|
@@ -1324,7 +1394,7 @@ interface MessageListProps {
|
|
|
1324
1394
|
* content, attachments, and any structured data payload. This is the default
|
|
1325
1395
|
* conversation body shared by every surface.
|
|
1326
1396
|
*/
|
|
1327
|
-
declare function MessageList({ messages, showAvatars, renderMessage, className, }: MessageListProps): react.JSX.Element;
|
|
1397
|
+
declare function MessageList({ messages, showAvatars, renderMessage, onConfirmAction, className, }: MessageListProps): react.JSX.Element;
|
|
1328
1398
|
|
|
1329
1399
|
interface PersonaSelectorProps {
|
|
1330
1400
|
/** Available personas to choose from. */
|
|
@@ -1601,6 +1671,56 @@ interface SettingsPanelProps {
|
|
|
1601
1671
|
}
|
|
1602
1672
|
declare function SettingsPanel({ groups, onChange, className }: SettingsPanelProps): react.JSX.Element;
|
|
1603
1673
|
|
|
1674
|
+
interface ConfirmationAction {
|
|
1675
|
+
id: string;
|
|
1676
|
+
label: string;
|
|
1677
|
+
/** Button variant; defaults to 'default' for the first action, 'outline' otherwise. */
|
|
1678
|
+
variant?: ButtonProps['variant'];
|
|
1679
|
+
/** Disable this action. */
|
|
1680
|
+
disabled?: boolean;
|
|
1681
|
+
/** Render a loading/busy state and disable the button. */
|
|
1682
|
+
busy?: boolean;
|
|
1683
|
+
}
|
|
1684
|
+
interface ConfirmationPanelProps {
|
|
1685
|
+
/** Panel heading, e.g. "Proposed plan". */
|
|
1686
|
+
title?: string;
|
|
1687
|
+
/**
|
|
1688
|
+
* Short label shown beside the title (e.g. "0 pages to change"). Rendered as
|
|
1689
|
+
* a badge so scope/summary metadata reads at a glance.
|
|
1690
|
+
*/
|
|
1691
|
+
summary?: string;
|
|
1692
|
+
/**
|
|
1693
|
+
* The plan / confirmation body. When a string is passed it is rendered
|
|
1694
|
+
* through the same markdown pipeline as assistant messages, so headings,
|
|
1695
|
+
* paragraphs, and bullet/numbered lists keep their spacing and line breaks.
|
|
1696
|
+
* Pass `markdown={false}` to render verbatim, or pass a node for custom body.
|
|
1697
|
+
*/
|
|
1698
|
+
body?: React.ReactNode;
|
|
1699
|
+
/**
|
|
1700
|
+
* Render the string body as markdown. Defaults to true. Ignored for node
|
|
1701
|
+
* bodies (which are rendered as-is).
|
|
1702
|
+
*/
|
|
1703
|
+
markdown?: boolean;
|
|
1704
|
+
/** Leading icon for the header. Defaults to a clipboard list icon. */
|
|
1705
|
+
icon?: React.ReactNode;
|
|
1706
|
+
/** Action buttons (confirm / cancel / regenerate, …). */
|
|
1707
|
+
actions?: ConfirmationAction[];
|
|
1708
|
+
/** Invoked with the action id when an action button is activated. */
|
|
1709
|
+
onAction?: (id: string) => void;
|
|
1710
|
+
/** Accessible label for the panel region. Defaults to the title. */
|
|
1711
|
+
ariaLabel?: string;
|
|
1712
|
+
className?: string;
|
|
1713
|
+
}
|
|
1714
|
+
/**
|
|
1715
|
+
* An inline confirmation / proposed-plan / action panel.
|
|
1716
|
+
*
|
|
1717
|
+
* It is designed to flow inside the transcript like any other message — NOT to
|
|
1718
|
+
* be pinned above the input — so it never covers the latest assistant response.
|
|
1719
|
+
* The body reuses {@link MessageContent}, giving long plans the same markdown
|
|
1720
|
+
* rendering, typography, and spacing as normal assistant messages.
|
|
1721
|
+
*/
|
|
1722
|
+
declare function ConfirmationPanel({ title, summary, body, markdown, icon, actions, onAction, ariaLabel, className, }: ConfirmationPanelProps): react.JSX.Element;
|
|
1723
|
+
|
|
1604
1724
|
/**
|
|
1605
1725
|
* Lifecycle of an agent-to-agent handoff.
|
|
1606
1726
|
* - 'connecting' → the target agent is being brought online / routed to.
|
|
@@ -2543,6 +2663,12 @@ interface AgentSurfaceProps {
|
|
|
2543
2663
|
renderMessage?: (message: AgentMessage) => ReactNode;
|
|
2544
2664
|
/** Feedback handler passed to MessageList. */
|
|
2545
2665
|
onFeedback?: (messageId: string, vote: 'up' | 'down') => void;
|
|
2666
|
+
/**
|
|
2667
|
+
* Handler for inline confirmation-panel actions. Receives the owning message
|
|
2668
|
+
* id and the activated action id. Confirmation panels render inline in the
|
|
2669
|
+
* transcript (via `message.confirmation`), never pinned over the response.
|
|
2670
|
+
*/
|
|
2671
|
+
onConfirmAction?: (messageId: string, actionId: string) => void;
|
|
2546
2672
|
/**
|
|
2547
2673
|
* Structured report rendered in the data region. Used by the
|
|
2548
2674
|
* dashboard/split surfaces (sidebar or data panel). If omitted, a custom
|
|
@@ -2581,7 +2707,198 @@ interface AgentSurfaceProps {
|
|
|
2581
2707
|
* - 'widget' → FloatingWidget (embeddable launcher + conversation)
|
|
2582
2708
|
* - 'overlay' → OverlayModal (centered modal conversation)
|
|
2583
2709
|
* - 'mobile' → MobileShell (full-height mobile layout)
|
|
2710
|
+
* - 'native' → NativeSurface (unpositioned, host-placed composer + conversation)
|
|
2711
|
+
*
|
|
2712
|
+
* Note: `mode="native"` here is the simple, fully controlled-props case. For the
|
|
2713
|
+
* decoupled, shared-session case (a composer and conversation in separate DOM
|
|
2714
|
+
* regions), use `NativeAgentProvider` + `<AgentComposer>` / `<AgentConversation>`.
|
|
2715
|
+
*/
|
|
2716
|
+
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;
|
|
2717
|
+
|
|
2718
|
+
interface NativeAgentProviderProps {
|
|
2719
|
+
children: ReactNode;
|
|
2720
|
+
/** A fully-qualified `ws`/`wss` URL. Provide this OR `resolveSocketUrl`. */
|
|
2721
|
+
socketUrl?: string;
|
|
2722
|
+
/** Resolver that returns the socket URL for this conversation. */
|
|
2723
|
+
resolveSocketUrl?: SocketUrlResolver;
|
|
2724
|
+
/** Conversation/site identity used to establish the connection. */
|
|
2725
|
+
websiteId: string | number;
|
|
2726
|
+
/** Page/category identity used to establish the connection. */
|
|
2727
|
+
pageCategoryId: string;
|
|
2728
|
+
/** Display name for grounding/welcome (optional for general use). */
|
|
2729
|
+
pageName?: string;
|
|
2730
|
+
pageSlug?: string;
|
|
2731
|
+
/** Current page blocks forwarded to the agent for grounding. */
|
|
2732
|
+
blocks?: AgentBlock[];
|
|
2733
|
+
/** Optional content brief grounding context. */
|
|
2734
|
+
contentBrief?: Record<string, unknown> | null;
|
|
2735
|
+
/** Invoked when the agent returns generated blocks. */
|
|
2736
|
+
onGeneratedBlocks?: (blocks: AgentBlock[], updateMode?: BlockUpdateMode) => void;
|
|
2737
|
+
/** Optional WebSocket implementation (SSR/tests). */
|
|
2738
|
+
webSocketImpl?: typeof WebSocket;
|
|
2739
|
+
/** When to open the connection. Default 'lazy'. */
|
|
2740
|
+
connectionStrategy?: ConnectionStrategy;
|
|
2741
|
+
/**
|
|
2742
|
+
* Seed the synthetic "welcome" system message. Default `false` for the native
|
|
2743
|
+
* variant so the idle composer is not preceded by a connection notice.
|
|
2744
|
+
*/
|
|
2745
|
+
seedWelcomeMessage?: boolean;
|
|
2746
|
+
/** Surfaced connection/processing errors. */
|
|
2747
|
+
onError?: (message: string) => void;
|
|
2748
|
+
/** Fired the first time the session is activated. */
|
|
2749
|
+
onActivate?: () => void;
|
|
2750
|
+
}
|
|
2751
|
+
/**
|
|
2752
|
+
* Provides a single shared agent session to any number of decoupled pieces.
|
|
2753
|
+
* Place `<AgentComposer>` and `<AgentConversation>` (or your own UI built on
|
|
2754
|
+
* `useNativeAgent()`) anywhere inside this provider.
|
|
2755
|
+
*/
|
|
2756
|
+
declare function NativeAgentProvider({ children, socketUrl, resolveSocketUrl, websiteId, pageCategoryId, pageName, pageSlug, blocks, contentBrief, onGeneratedBlocks, webSocketImpl, connectionStrategy, seedWelcomeMessage, onError, onActivate, }: NativeAgentProviderProps): react.JSX.Element;
|
|
2757
|
+
|
|
2758
|
+
/** Online-status flavor used by header/status badges. */
|
|
2759
|
+
type NativeAgentStatus = 'online' | 'offline' | 'busy' | 'away';
|
|
2760
|
+
/**
|
|
2761
|
+
* The shared agent session broadcast by `NativeAgentProvider`. Every value is
|
|
2762
|
+
* derived from a single underlying WebSocket session, so any number of decoupled
|
|
2763
|
+
* pieces (composer, conversation, custom UI) stay in sync.
|
|
2764
|
+
*/
|
|
2765
|
+
interface NativeAgentContextValue {
|
|
2766
|
+
/** Conversation transcript, mapped to the shared `AgentMessage` shape. */
|
|
2767
|
+
messages: AgentMessage[];
|
|
2768
|
+
/** True once the session has been engaged (first submit or `activate()`). */
|
|
2769
|
+
isActive: boolean;
|
|
2770
|
+
/** True when the socket is ready or streaming. */
|
|
2771
|
+
isConnected: boolean;
|
|
2772
|
+
/**
|
|
2773
|
+
* True while the agent is working: connecting after activation, a prompt is
|
|
2774
|
+
* queued awaiting connection, or a response is streaming. Drives the typing
|
|
2775
|
+
* indicator without the host having to compute it.
|
|
2776
|
+
*/
|
|
2777
|
+
isResponding: boolean;
|
|
2778
|
+
/** True only while a response is actively streaming. */
|
|
2779
|
+
isStreaming: boolean;
|
|
2780
|
+
/** Raw connection state from the transport. */
|
|
2781
|
+
connectionState: ConnectionState;
|
|
2782
|
+
/** Human-readable connection label (e.g. "AI connected"). */
|
|
2783
|
+
statusLabel: string;
|
|
2784
|
+
/** Status badge flavor derived from `connectionState`. */
|
|
2785
|
+
status: NativeAgentStatus;
|
|
2786
|
+
/** Latest connection/processing error, or null. */
|
|
2787
|
+
error: string | null;
|
|
2788
|
+
/** Controlled composer draft value. */
|
|
2789
|
+
input: string;
|
|
2790
|
+
/** Update the controlled composer draft. */
|
|
2791
|
+
setInput: (value: string) => void;
|
|
2792
|
+
/**
|
|
2793
|
+
* Submit a prompt. Defaults to the current `input`. Activates the session and,
|
|
2794
|
+
* under the lazy strategy, opens the connection and queues the prompt until the
|
|
2795
|
+
* socket is ready.
|
|
2796
|
+
*/
|
|
2797
|
+
submit: (content?: string) => void;
|
|
2798
|
+
/** Engage the session (open the connection) without sending a prompt. */
|
|
2799
|
+
activate: () => void;
|
|
2800
|
+
/** Clear the transcript and return to the idle state. */
|
|
2801
|
+
reset: () => void;
|
|
2802
|
+
/** Retry after a connection error. */
|
|
2803
|
+
retry: () => void;
|
|
2804
|
+
}
|
|
2805
|
+
/**
|
|
2806
|
+
* Read the shared agent session. Throws if used outside a
|
|
2807
|
+
* `<NativeAgentProvider>`. Use this for fully custom UI built on the session.
|
|
2808
|
+
*/
|
|
2809
|
+
declare function useNativeAgent(): NativeAgentContextValue;
|
|
2810
|
+
/**
|
|
2811
|
+
* Internal: read the shared session if present, or `null` otherwise. Used by the
|
|
2812
|
+
* dual-mode pieces (`AgentComposer`, `AgentConversation`) so they can fall back
|
|
2813
|
+
* to fully prop-controlled (disconnected) operation when no provider is mounted.
|
|
2814
|
+
*/
|
|
2815
|
+
declare function useNativeAgentOptional(): NativeAgentContextValue | null;
|
|
2816
|
+
|
|
2817
|
+
interface AgentComposerProps {
|
|
2818
|
+
/** Controlled draft value. Pair with `onChange` for caller-controlled editing. */
|
|
2819
|
+
value?: string;
|
|
2820
|
+
/** Draft change handler. Presence switches editing to caller-controlled. */
|
|
2821
|
+
onChange?: (value: string) => void;
|
|
2822
|
+
/** Submit handler, receives the current value. Overrides the shared `submit`. */
|
|
2823
|
+
onSubmit?: (value: string) => void;
|
|
2824
|
+
/** Loading/streaming state for the send affordance. */
|
|
2825
|
+
loading?: boolean;
|
|
2826
|
+
/** Force-disable the input. */
|
|
2827
|
+
disabled?: boolean;
|
|
2828
|
+
placeholder?: string;
|
|
2829
|
+
/** PromptInput styling variant. */
|
|
2830
|
+
variant?: 'default' | 'minimal' | 'bordered';
|
|
2831
|
+
/**
|
|
2832
|
+
* Drop the default rounded/bordered shell and render only the input + slots,
|
|
2833
|
+
* for hosts that want to supply all chrome themselves.
|
|
2834
|
+
*/
|
|
2835
|
+
bare?: boolean;
|
|
2836
|
+
/** Node rendered above the input (e.g. suggestion chips). */
|
|
2837
|
+
suggestions?: ReactNode;
|
|
2838
|
+
/** Node rendered below the input (e.g. a hint line). */
|
|
2839
|
+
footer?: ReactNode;
|
|
2840
|
+
/** Actions rendered left of the textarea (e.g. an attach button). */
|
|
2841
|
+
leftActions?: ReactNode;
|
|
2842
|
+
/** Actions rendered right of the textarea, before send. */
|
|
2843
|
+
rightActions?: ReactNode;
|
|
2844
|
+
autoFocus?: boolean;
|
|
2845
|
+
className?: string;
|
|
2846
|
+
inputClassName?: string;
|
|
2847
|
+
}
|
|
2848
|
+
/**
|
|
2849
|
+
* The native composer. Renders unpositioned — apply layout (a fixed bottom bar,
|
|
2850
|
+
* a card, etc.) via `className`.
|
|
2851
|
+
*/
|
|
2852
|
+
declare function AgentComposer({ value: valueProp, onChange, onSubmit, loading: loadingProp, disabled: disabledProp, placeholder, variant, bare, suggestions, footer, leftActions, rightActions, autoFocus, className, inputClassName, }: AgentComposerProps): react.JSX.Element;
|
|
2853
|
+
|
|
2854
|
+
interface AgentConversationProps {
|
|
2855
|
+
/** Explicit transcript. Overrides the shared session messages. */
|
|
2856
|
+
messages?: AgentMessage[];
|
|
2857
|
+
/** Explicit loading state. Overrides the shared session `isResponding`. */
|
|
2858
|
+
isLoading?: boolean;
|
|
2859
|
+
/** Optional node rendered above the scroll region. */
|
|
2860
|
+
header?: ReactNode;
|
|
2861
|
+
/** Shown when the transcript is empty and the agent is idle. */
|
|
2862
|
+
emptyState?: ReactNode;
|
|
2863
|
+
showAvatars?: boolean;
|
|
2864
|
+
renderMessage?: (message: AgentMessage) => ReactNode;
|
|
2865
|
+
onFeedback?: (messageId: string, vote: 'up' | 'down') => void;
|
|
2866
|
+
onConfirmAction?: (messageId: string, actionId: string) => void;
|
|
2867
|
+
/** Auto-scroll to the latest message. Default true. */
|
|
2868
|
+
autoScroll?: boolean;
|
|
2869
|
+
className?: string;
|
|
2870
|
+
contentClassName?: string;
|
|
2871
|
+
}
|
|
2872
|
+
/**
|
|
2873
|
+
* The native conversation surface. Fills its parent (`h-full`) — the host sizes
|
|
2874
|
+
* and positions it.
|
|
2584
2875
|
*/
|
|
2585
|
-
declare function
|
|
2876
|
+
declare function AgentConversation({ messages: messagesProp, isLoading: isLoadingProp, header, emptyState, showAvatars, renderMessage, onFeedback, onConfirmAction, autoScroll, className, contentClassName, }: AgentConversationProps): react.JSX.Element;
|
|
2877
|
+
|
|
2878
|
+
interface NativeSurfaceProps {
|
|
2879
|
+
/** Conversation content (typically a MessageList). */
|
|
2880
|
+
children: React.ReactNode;
|
|
2881
|
+
/** Input slot rendered below the conversation. */
|
|
2882
|
+
input?: React.ReactNode;
|
|
2883
|
+
/** Header title. A header row renders only when a title or actions are given. */
|
|
2884
|
+
title?: string;
|
|
2885
|
+
/** Header subtitle/status. */
|
|
2886
|
+
subtitle?: string;
|
|
2887
|
+
/** Header icon. */
|
|
2888
|
+
icon?: React.ReactNode;
|
|
2889
|
+
/** Header actions (right side). */
|
|
2890
|
+
headerActions?: React.ReactNode;
|
|
2891
|
+
/** Suggestions/quick-replies above the input. */
|
|
2892
|
+
suggestions?: React.ReactNode;
|
|
2893
|
+
/** Footer below the input. */
|
|
2894
|
+
footer?: React.ReactNode;
|
|
2895
|
+
/** Typing/loading indicator state. */
|
|
2896
|
+
isLoading?: boolean;
|
|
2897
|
+
/** Auto-scroll to bottom on content change. Default true. */
|
|
2898
|
+
autoScroll?: boolean;
|
|
2899
|
+
className?: string;
|
|
2900
|
+
contentClassName?: string;
|
|
2901
|
+
}
|
|
2902
|
+
declare function NativeSurface({ children, input, title, subtitle, icon, headerActions, suggestions, footer, isLoading, autoScroll, className, contentClassName, }: NativeSurfaceProps): react.JSX.Element;
|
|
2586
2903
|
|
|
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 };
|
|
2904
|
+
export { type AgendaItem, type AgendaItemAction, type AgendaItemState, type AgendaSlotOption, type AgentAction, type AgentAttachment, AgentAvatar, type AgentBackend, type AgentBlock, AgentComposer, type AgentComposerProps, type AgentConfig, type AgentContextValue, AgentConversation, type AgentConversationProps, 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, type ConnectionStrategy, 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, type NativeAgentContextValue, NativeAgentProvider, type NativeAgentProviderProps, type NativeAgentStatus, NativeSurface, type NativeSurfaceProps, 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, useNativeAgent, useNativeAgentOptional, useSemanticBuilder };
|