@vinaverse/react-native 0.1.0-alpha.3 → 0.1.0-alpha.5

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/dist/index.d.cts CHANGED
@@ -1,69 +1,13 @@
1
+ import { GreetingStorage } from '@vinaverse/react/agent';
2
+ export { AgentRuntimeProvider, GreetingStorage, UseAgentConversation, UseAgentLauncher, greetedKey, useAgentConversation, useAgentFeatures, useAgentLauncher, useAgentName, useAgentProfile, useAgentRuntime, useAgentStatus } from '@vinaverse/react/agent';
1
3
  import * as react from 'react';
2
- import { ReactNode, ComponentType, ReactElement, RefObject } from 'react';
3
- import { HeldCard, CardItem, Question, MessageItem, TimelineItem, SystemItem, ProposalOutcome, ConversationStore } from '@vinaverse/client/conversation';
4
- import { CopyOverrides } from '@vinaverse/react';
4
+ import { ComponentType, ReactElement, ReactNode, RefObject } from 'react';
5
+ import * as _vinaverse_client_conversation from '@vinaverse/client/conversation';
6
+ import { MessageItem, Welcome as Welcome$1, TimelineItem, CardItem, HeldCard, Question, ProposalOutcome, ConversationStore, SystemItem } from '@vinaverse/client/conversation';
7
+ import { ReadCard, AgentCardTarget, AgentKey, AgentPlace, AgentFailureReason, AgentRating } from '@vinaverse/client/agent';
5
8
  import { ImageProps, StyleProp, ViewStyle } from 'react-native';
6
- import { ColorScheme, Colors, font, space, radius, motion, size } from '@vinaverse/tokens';
7
-
8
- declare function CardFrame(props: {
9
- readonly label: string;
10
- readonly restored?: boolean;
11
- readonly children?: ReactNode;
12
- readonly testID?: string;
13
- }): react.JSX.Element;
14
-
15
- interface CardProps {
16
- readonly card: HeldCard;
17
- /** A proposal being decided: draw its buttons busy. */
18
- readonly busy: boolean;
19
- /** Restored after a restart: draw it as it was, taking no answer or action. */
20
- readonly restored: boolean;
21
- /** The kit's own renderer for this kind, to wrap rather than rewrite. */
22
- readonly Default: ComponentType<Omit<CardProps, 'Default'>>;
23
- }
24
-
25
- /** The kit's own renderer for a kind. */
26
- declare function defaultCard(kind: string): ComponentType<Omit<CardProps, 'Default'>>;
27
- declare const CardView: react.NamedExoticComponent<{
28
- readonly item: CardItem;
29
- }>;
30
-
31
- declare function InfoCard(props: Omit<CardProps, 'Default'>): react.JSX.Element;
32
-
33
- declare function NextStepCard(props: Omit<CardProps, 'Default'>): react.JSX.Element;
34
-
35
- /** A field's value as text, by its type (`text`, `list`, `time_range`, `address`, `money_cents`). */
36
- declare function fieldText(type: string, value: unknown, locale: string | undefined, timeZone: string | undefined): string;
37
- declare function ProposalCard(props: Omit<CardProps, 'Default'>): react.JSX.Element | null;
38
-
39
- declare function QuestionCard(props: Omit<CardProps, 'Default'>): react.JSX.Element | null;
40
- /** A recorded answer, in words. */
41
- declare function answerText(question: Question, locale: string | undefined, otherLabel: string): string | null;
42
-
43
- declare function TimeSlotsCard(props: Omit<CardProps, 'Default'>): react.JSX.Element;
44
-
45
- declare const ActivityLine: react.NamedExoticComponent<object>;
46
-
47
- declare const Avatar: react.NamedExoticComponent<{
48
- readonly name: string;
49
- readonly uri: string | null;
50
- readonly person?: boolean;
51
- }>;
52
-
53
- interface ButtonProps {
54
- readonly label: string;
55
- readonly onPress: () => void;
56
- readonly variant?: 'primary' | 'secondary' | 'text';
57
- readonly disabled?: boolean;
58
- readonly busy?: boolean;
59
- /** A role other than a button: `radio` and `checkbox` for choices. */
60
- readonly role?: 'button' | 'radio' | 'checkbox' | 'link';
61
- readonly selected?: boolean;
62
- readonly hint?: string;
63
- readonly children?: ReactNode;
64
- readonly testID?: string;
65
- }
66
- declare const Button: react.NamedExoticComponent<ButtonProps>;
9
+ import { CopyOverrides } from '@vinaverse/react';
10
+ import { Colors, radius, space, ColorScheme, font, motion, size } from '@vinaverse/tokens';
67
11
 
68
12
  interface HeaderProps {
69
13
  readonly name: string;
@@ -87,6 +31,14 @@ interface ComposerProps {
87
31
  }
88
32
  interface EmptyStateProps {
89
33
  readonly agentName: string;
34
+ /** The tenant's greeting and chips for the session's mode (`Session.welcome`), or null. */
35
+ readonly welcome: Welcome$1 | null;
36
+ /** Sends a chip's `message` as the person's own text. */
37
+ readonly onChip: (message: string) => void;
38
+ }
39
+ /** `components.CardGroup`: the cards one turn drew together with `group.layout: carousel`, in order. */
40
+ interface CardGroupProps {
41
+ readonly items: readonly CardItem[];
90
42
  }
91
43
  /** The props the kit gives its list: FlashList's, so FlashList or LegendList take them as they are. */
92
44
  interface ListProps {
@@ -132,56 +84,60 @@ interface FailureAction {
132
84
  readonly onPress: (state: FailureState) => void;
133
85
  }
134
86
 
135
- declare function DefaultHeader(props: Omit<HeaderProps, 'Default'>): react.JSX.Element;
136
- declare const ChatHeader: react.NamedExoticComponent<object>;
87
+ declare function CardCarousel(props: CardGroupProps): react.JSX.Element;
137
88
 
138
- declare const ChatSkeleton: react.NamedExoticComponent<object>;
89
+ declare function CardFrame(props: {
90
+ readonly label: string;
91
+ readonly restored?: boolean;
92
+ readonly children?: ReactNode;
93
+ readonly testID?: string;
94
+ }): react.JSX.Element;
95
+ /** A rating in millionths as the locale writes it, one decimal: 4.8, or 4,8 in Spanish and Portuguese. */
96
+ declare function ratingText(valuePpm: number, locale: string | undefined): string;
97
+ /** A photo the image policy allows: https, and from one of its hosts when it names them. */
98
+ declare function allowedImage(url: string | undefined, hosts: readonly string[] | undefined): string | null;
139
99
 
140
- declare function DefaultComposer(props: Omit<ComposerProps, 'Default'>): react.JSX.Element;
141
- declare const Composer: react.NamedExoticComponent<{
142
- readonly onError?: (error: unknown) => void;
100
+ interface CardProps {
101
+ readonly card: HeldCard;
102
+ /** The card read once for drawing, every field checked (`readCard`): kind, target, photo, rating, price, group, links. */
103
+ readonly read: ReadCard | null;
104
+ /** A proposal being decided: draw its buttons busy. */
105
+ readonly busy: boolean;
106
+ /** Restored after a restart: draw it as it was, taking no answer or action. */
107
+ readonly restored: boolean;
108
+ /** The kit's own renderer for this kind, to wrap rather than rewrite. */
109
+ readonly Default: ComponentType<Omit<CardProps, 'Default'>>;
110
+ }
111
+
112
+ /** The kit's own renderer for a kind. */
113
+ declare function defaultCard(kind: string): ComponentType<Omit<CardProps, 'Default'>>;
114
+ declare const CardView: react.NamedExoticComponent<{
115
+ readonly item: CardItem;
143
116
  }>;
144
117
 
145
- declare const DisclosureBar: react.NamedExoticComponent<object>;
118
+ declare function InfoCard(props: Omit<CardProps, 'Default'>): react.JSX.Element;
119
+ /** A card's actions: a link that passes the deep-link rule opens the tenant's page, any other goes to the session. */
120
+ declare function CardActions(props: Omit<CardProps, 'Default'>): react.JSX.Element | null;
146
121
 
147
- /** The tenant's failure action as a button, or nothing when there is none. */
148
- declare function FailureActionButton(props: {
149
- readonly state: FailureState;
150
- }): ReactNode;
122
+ declare function LinksCard(props: Omit<CardProps, 'Default'>): react.JSX.Element;
151
123
 
152
- declare function DefaultBubble(props: Omit<MessageBubbleProps, 'Default'>): react.JSX.Element;
153
- declare const MessageBubble: react.NamedExoticComponent<{
154
- readonly item: MessageItem;
155
- /** The first of a run from the same author: its label is shown. */
156
- readonly showAuthor: boolean;
157
- }>;
158
- /** The reply streaming now: the only cell that re-renders as the text arrives. */
159
- declare const StreamingBubble: react.NamedExoticComponent<{
160
- readonly item: MessageItem;
161
- readonly showAuthor: boolean;
162
- }>;
124
+ declare function ListingCard(props: Omit<CardProps, 'Default'>): react.JSX.Element;
125
+ /** The first letters of the first two words: "Bell's Barber Lounge" is "BB". */
126
+ declare function monogram(title: string): string;
163
127
 
164
- /** Rows of one kind recycle together. */
165
- declare function itemType(item: TimelineItem): string;
166
- declare const Row: react.NamedExoticComponent<{
167
- readonly item: TimelineItem;
168
- readonly showAuthor: boolean;
169
- }>;
170
- declare const MessageList: react.NamedExoticComponent<object>;
128
+ declare function NextStepCard(props: Omit<CardProps, 'Default'>): react.JSX.Element;
171
129
 
172
- declare const StatusBanner: react.NamedExoticComponent<object>;
173
- /** The kit's own "Couldn't connect." banner: try again, and the tenant's failure action when there is one. */
174
- declare function DefaultUnavailable(props: {
175
- readonly state: FailureState;
176
- }): ReactNode;
130
+ /** A field's value as text, by its type (`text`, `list`, `time_range`, `address`, `money_cents`). */
131
+ declare function fieldText(type: string, value: unknown, locale: string | undefined, timeZone: string | undefined): string;
132
+ declare function ProposalCard(props: Omit<CardProps, 'Default'>): react.JSX.Element | null;
177
133
 
178
- declare const SystemRow: react.NamedExoticComponent<{
179
- readonly item: SystemItem;
180
- }>;
181
- /** The kit's own failed-turn row: "Something went wrong.", and the tenant's failure action when there is one. */
182
- declare function DefaultTurnFailed(props: {
183
- readonly state: FailureState;
184
- }): ReactNode;
134
+ declare function QuestionCard(props: Omit<CardProps, 'Default'>): react.JSX.Element | null;
135
+ /** A recorded answer, in words. */
136
+ declare function answerText(question: Question, locale: string | undefined, otherLabel: string): string | null;
137
+
138
+ declare function TimeSlotsCard(props: Omit<CardProps, 'Default'>): react.JSX.Element;
139
+
140
+ declare const ActivityLine: react.NamedExoticComponent<object>;
185
141
 
186
142
  type ProposalDecision = 'confirm' | 'decline';
187
143
  /** What the kit asks of the tenant's app. Only `onProposal` and `onOpenLink` are needed for the cards that use them. */
@@ -191,7 +147,10 @@ interface ChatHandlers {
191
147
  * happened (`confirmed`, `declined`, `failed`, or `expired` when it had expired). The kit reports it to the session.
192
148
  */
193
149
  readonly onProposal?: (card: HeldCard, decision: ProposalDecision) => Promise<ProposalOutcome>;
194
- /** Open a card's link in your app (it already passed the deep-link rule); route by the page it names. */
150
+ /**
151
+ * Open a card's link in your app: a deep link that already passed the deep-link rule (route by the page it names),
152
+ * or a `links` card's https page (your in-app browser; without this handler the system opens it).
153
+ */
195
154
  readonly onOpenLink?: (link: string, card: HeldCard) => void;
196
155
  /** A card action without a link (`show_times`, …): sent to the session; this tells your app too. */
197
156
  readonly onCardAction?: (card: HeldCard, action: string) => void;
@@ -206,6 +165,28 @@ interface ChatHandlers {
206
165
  readonly failureAction?: FailureAction;
207
166
  /** Development warnings: a theme that is hard to read, copy that says "assistant". */
208
167
  readonly onWarning?: (message: string) => void;
168
+ /**
169
+ * The person tapped a card about something of yours (its `ref`: a professional, a space, a booking): open its page
170
+ * with your router. Without it, only the card's own actions open anything.
171
+ */
172
+ readonly onOpenTarget?: (target: AgentCardTarget, card: HeldCard) => void;
173
+ /** Card photos arrive: fetch them ahead with your image library (`Image.prefetch`), so the cards draw at once. */
174
+ readonly prefetchImage?: (url: string) => void;
175
+ /** Reads a line to a screen reader (a finished reply, the launcher's greeting). Default: the platform's. */
176
+ readonly announce?: (text: string) => void;
177
+ /** A chip was tapped (a welcome chip, a starter, the suggestion); its message is sent as the person's own. */
178
+ readonly onChip?: (chip: Chip) => void;
179
+ }
180
+ /** Which card photos are drawn, in what frame, and what stands in for one that is not. */
181
+ interface ImagePolicy {
182
+ /** Hosts a photo may come from (exact names); default any https host. */
183
+ readonly hosts?: readonly string[];
184
+ /** Width / height of a listing's photo frame. Default 1.6 (16:10). */
185
+ readonly aspectRatio?: number;
186
+ /** What stands in for a missing, refused or failed photo. Default the name's monogram. */
187
+ readonly Placeholder?: ComponentType<{
188
+ readonly title: string;
189
+ }>;
209
190
  }
210
191
  /** Parts a tenant can replace. Each gets the default's props and the default itself (`Default`), to wrap it. */
211
192
  interface ChatSlots {
@@ -220,6 +201,11 @@ interface ChatSlots {
220
201
  readonly Error?: ComponentType<FailureProps>;
221
202
  /** No session to talk to: replaces the "Couldn't connect." banner. */
222
203
  readonly Unavailable?: ComponentType<FailureProps>;
204
+ /**
205
+ * Draws a turn's cards that ask for a carousel (`group.layout: carousel`) in one row: the kit's `CardCarousel`, or
206
+ * yours. Without it they draw one under another. Opt-in, so an app that never draws a carousel does not ship one.
207
+ */
208
+ readonly CardGroup?: ComponentType<CardGroupProps>;
223
209
  /** Card renderers by kind (`professional`, `proposal`, …). */
224
210
  readonly cards?: Readonly<Partial<Record<string, ComponentType<CardProps>>>>;
225
211
  }
@@ -233,7 +219,12 @@ interface ChatContextValue {
233
219
  readonly failureAction: {
234
220
  readonly label: string | undefined;
235
221
  } | null;
222
+ /** Chips for an empty conversation when the session brings no welcome. */
223
+ readonly starters: readonly Chip[] | undefined;
224
+ readonly imagePolicy: ImagePolicy | undefined;
236
225
  }
226
+ /** A tap target that sends `message` as the person's own text (a welcome chip, a starter, a suggestion). */
227
+ type Chip = Welcome$1['chips'][number];
237
228
  /** The conversation, handlers and slots; only inside `VinaverseChat` (or `VinaverseChatProvider`). */
238
229
  declare function useChat(): ChatContextValue;
239
230
 
@@ -293,13 +284,315 @@ interface VinaverseChatProps extends ChatHandlers {
293
284
  */
294
285
  readonly keyboardBehavior?: 'padding' | 'height' | 'position' | 'none';
295
286
  readonly style?: StyleProp<ViewStyle>;
287
+ /** Chips for an empty conversation when the session brings no welcome (`Session.welcome` comes first). Keep stable. */
288
+ readonly starters?: readonly Chip[];
289
+ /** Which card photos are drawn, their frame, and what stands in for one that is not. Keep stable. */
290
+ readonly imagePolicy?: ImagePolicy;
291
+ /** One chip above the composer: a question about where the person now is (`AgentChat` offers it when they moved). */
292
+ readonly suggestion?: Chip | null;
293
+ /** Drawn under the composer, inside the kit's providers (`AgentChat`'s thumbs and footer). */
294
+ readonly footer?: ReactNode;
296
295
  }
297
296
  /** The providers alone, for a tenant composing its own layout from the exported parts. */
298
- declare function VinaverseChatProvider(props: Omit<VinaverseChatProps, 'hideHeader' | 'keyboardVerticalOffset' | 'keyboardBehavior' | 'style'> & {
297
+ declare function VinaverseChatProvider(props: Omit<VinaverseChatProps, 'hideHeader' | 'keyboardVerticalOffset' | 'keyboardBehavior' | 'style' | 'suggestion' | 'footer'> & {
299
298
  readonly children?: ReactNode;
300
299
  }): ReactNode;
301
300
  declare function VinaverseChat(props: VinaverseChatProps): ReactNode;
302
301
 
302
+ interface AgentEndedProps {
303
+ readonly onStartNew: () => void;
304
+ /** The API's code (`conversation_not_found`, `conversation_expired`), when it gave one. */
305
+ readonly code: string | null;
306
+ }
307
+ /** No agent here: switched off for this tenant, mode or person, or the backend refused the session. */
308
+ interface AgentUnavailableScreenProps {
309
+ /** Why: `off`, `auth`, `invalid_session`, … */
310
+ readonly reason: AgentFailureReason | null;
311
+ readonly code: string | null;
312
+ /** A person instead (the chat's `onContact`); absent when the app gave none. */
313
+ readonly onContact: (() => void) | undefined;
314
+ /** Ask again (after a sign-in, or the agent switched back on). */
315
+ readonly onRetry: () => void;
316
+ }
317
+ interface AgentUnreachableProps {
318
+ readonly onRetry: () => void;
319
+ /** Why: `network`, `server`, `rate_limited`, … */
320
+ readonly reason: AgentFailureReason | null;
321
+ }
322
+ /** A slot gets the kit's own part as `Default`, to wrap rather than rewrite. */
323
+ type Slot$1<P> = ComponentType<P & {
324
+ readonly Default: ComponentType<P>;
325
+ }>;
326
+ interface AgentFooterProps {
327
+ /** The newest whole reply's turn, to rate; null when there is none. */
328
+ readonly turnId: string | null;
329
+ readonly rating: AgentRating | undefined;
330
+ readonly onRate: (rating: AgentRating) => void;
331
+ readonly onOpenPrivacy: (() => void) | undefined;
332
+ }
333
+ interface AgentChatSlots extends ChatSlots {
334
+ readonly Ended?: Slot$1<AgentEndedProps>;
335
+ readonly Unreachable?: Slot$1<AgentUnreachableProps>;
336
+ /**
337
+ * The whole screen when there is no agent (off, or the session refused). Not `Unavailable`: that is the chat's own
338
+ * "couldn't connect" banner, still drawn for a session that drops.
339
+ */
340
+ readonly UnavailableScreen?: Slot$1<AgentUnavailableScreenProps>;
341
+ /** Under the composer; null hides it. Default: thumbs on the newest whole reply, and the privacy link. */
342
+ readonly Footer?: Slot$1<AgentFooterProps> | null;
343
+ }
344
+ interface AgentChatProps extends Omit<VinaverseChatProps, 'conversation' | 'components' | 'suggestion' | 'footer'> {
345
+ /** Whose conversation: one per person, mode, business and thread. */
346
+ readonly agentKey: AgentKey;
347
+ /** Where the person asks from, told to the agent as a session opens. */
348
+ readonly place?: AgentPlace | null;
349
+ readonly entryPoint?: string | null;
350
+ /** The question about this place, offered when the session was told another one (`moved`). */
351
+ readonly askAbout?: string | null;
352
+ /** A person: offered on a failed turn, "couldn't connect" and no agent. */
353
+ readonly onContact?: () => void;
354
+ readonly onOpenPrivacy?: () => void;
355
+ /** The agent's name until the session or the status gives one. */
356
+ readonly agentName?: string;
357
+ /**
358
+ * A first question for a flow that asks for itself (setting a business up): a chip the person taps, offered until they
359
+ * say anything. Never sent in their name: what the transcript shows as theirs, they typed or tapped.
360
+ */
361
+ readonly opener?: Chip | null;
362
+ readonly components?: AgentChatSlots;
363
+ }
364
+ declare function AgentChat(props: AgentChatProps): ReactNode;
365
+ /** The newest reply when it came whole (not cut off, not a refusal): the one to rate. */
366
+ declare function newestWholeReply(view: {
367
+ readonly items: readonly _vinaverse_client_conversation.TimelineItem[];
368
+ }): string | null;
369
+ /** The conversation is over: a new one starts only when the person asks. */
370
+ declare function DefaultEnded(props: AgentEndedProps): ReactNode;
371
+ /** No agent here: says so, and offers a person when the app has one. */
372
+ declare function DefaultUnavailableScreen(props: AgentUnavailableScreenProps): ReactNode;
373
+ /** The app's backend could not be reached, after its tries: try again. */
374
+ declare function DefaultUnreachable(props: AgentUnreachableProps): ReactNode;
375
+ /** Thumbs on the newest whole reply (thanks once given), and the privacy link. */
376
+ declare function AgentFooter(props: AgentFooterProps): ReactNode;
377
+
378
+ /** The launcher's button side, in dp. */
379
+ declare const LAUNCHER_SIZE = 56;
380
+ /** The launcher's look: a ring around the button, its shadow, the bubble's tail toward it. */
381
+ interface LauncherAppearance {
382
+ /** Default none. */
383
+ readonly ring?: {
384
+ readonly color: string;
385
+ readonly width: number;
386
+ } | null;
387
+ /** Default true. */
388
+ readonly shadow?: boolean;
389
+ /** Default true. */
390
+ readonly tail?: boolean;
391
+ }
392
+ /** Where it floats: the screen's edge, its distance from the bottom (above a tab bar) and from the side. */
393
+ interface LauncherPlacement {
394
+ /** Default `right`. */
395
+ readonly edge?: 'left' | 'right';
396
+ /** Default 16. */
397
+ readonly bottom?: number;
398
+ /** Default 16. */
399
+ readonly inset?: number;
400
+ }
401
+ interface LauncherButtonProps {
402
+ readonly label: string;
403
+ readonly name: string;
404
+ readonly onPress: () => void;
405
+ readonly Mark: ComponentType<{
406
+ readonly size: number;
407
+ readonly color: string;
408
+ }> | undefined;
409
+ readonly ring: {
410
+ readonly color: string;
411
+ readonly width: number;
412
+ } | null;
413
+ readonly shadow: boolean;
414
+ }
415
+ interface LauncherGreetingProps {
416
+ readonly text: string;
417
+ readonly closeLabel: string;
418
+ readonly onOpen: () => void;
419
+ readonly onClose: () => void;
420
+ readonly tail: boolean;
421
+ readonly edge: 'left' | 'right';
422
+ }
423
+ /** How the button and the bubble come in; `reducedMotion` when the person asked for none. */
424
+ interface LauncherEntranceProps {
425
+ readonly part: 'button' | 'greeting';
426
+ readonly reducedMotion: boolean;
427
+ readonly children: ReactNode;
428
+ }
429
+ type Slot<P> = ComponentType<P & {
430
+ readonly Default: ComponentType<P>;
431
+ }>;
432
+ /** Where the person opened the agent from: the app's route, and the mode. */
433
+ interface LauncherContext {
434
+ readonly route: string | null;
435
+ readonly mode: string;
436
+ }
437
+ interface AgentLauncherProps {
438
+ readonly subject: string | null;
439
+ readonly mode: string;
440
+ readonly onOpen: (from: LauncherContext) => void;
441
+ /** The app's current route; with `routes`, the launcher shows only on those. */
442
+ readonly route?: string | null;
443
+ readonly routes?: readonly string[];
444
+ /** The app says step aside (a sheet is up, a map with its own cards…). */
445
+ readonly hidden?: boolean;
446
+ /** Hidden while the keyboard is up. Default true. */
447
+ readonly hideWithKeyboard?: boolean;
448
+ /** Where it remembers the greeting was shown (the app's preferences store); default: for this launch only. */
449
+ readonly storage?: GreetingStorage;
450
+ /** The storage's key for a person and mode (a record the app already keeps); default `greetedKey`. */
451
+ readonly storageKey?: (subject: string | null, mode: string) => string;
452
+ /** The greeting's words, or by mode; default the copy's `launcherGreeting`. */
453
+ readonly greeting?: string | ((mode: string) => string);
454
+ /** How long after showing the greeting appears. Default 1200 ms. */
455
+ readonly delayMs?: number;
456
+ /** The app's brand mark inside the button; default the agent name's first letter. */
457
+ readonly Mark?: ComponentType<{
458
+ readonly size: number;
459
+ readonly color: string;
460
+ }>;
461
+ /** Reads the greeting to a screen reader as it appears. Default: the platform's. */
462
+ readonly announce?: (text: string) => void;
463
+ readonly components?: {
464
+ readonly Button?: Slot<LauncherButtonProps>;
465
+ readonly Greeting?: Slot<LauncherGreetingProps>;
466
+ /** Default: a short fade and scale; none with reduced motion. */
467
+ readonly Entrance?: Slot<LauncherEntranceProps>;
468
+ };
469
+ readonly appearance?: LauncherAppearance;
470
+ /** Where it floats over the app's screens; `style` comes after it, for anything else. */
471
+ readonly placement?: LauncherPlacement;
472
+ readonly style?: StyleProp<ViewStyle>;
473
+ /** As on the chat: the person's locale, the app's words, theme and color scheme. */
474
+ readonly locale?: string;
475
+ readonly copy?: CopyOverrides;
476
+ readonly theme?: ThemeOverrides;
477
+ readonly colorScheme?: ColorSchemeSetting;
478
+ }
479
+ declare function AgentLauncher(props: AgentLauncherProps): ReactNode;
480
+ /** Whether the keyboard is up. */
481
+ declare function useKeyboardShown(): boolean;
482
+ /** The kit's entrance: a short fade and scale up; none when the person asked for reduced motion. */
483
+ declare function LauncherEntrance(props: LauncherEntranceProps): ReactNode;
484
+ /** The kit's greeting bubble: the words (a tap opens the agent), a close button, and a tail toward the button. */
485
+ declare function LauncherGreeting(props: LauncherGreetingProps): ReactNode;
486
+ /** The kit's round button: the app's mark, else the agent name's first letter; its ring and shadow as asked. */
487
+ declare function LauncherButton(props: LauncherButtonProps): ReactNode;
488
+
489
+ interface AskAboutRowProps {
490
+ /** "Ask Example Agent about Riley Sample". */
491
+ readonly title: string;
492
+ readonly body?: string;
493
+ readonly onPress: () => void;
494
+ /** The app's brand mark at the row's start; default the agent name's first letter. */
495
+ readonly Mark?: ComponentType<{
496
+ readonly size: number;
497
+ readonly color: string;
498
+ }>;
499
+ readonly locale?: string;
500
+ readonly copy?: CopyOverrides;
501
+ readonly theme?: ThemeOverrides;
502
+ readonly colorScheme?: ColorSchemeSetting;
503
+ }
504
+ declare function AskAboutRow(props: AskAboutRowProps): ReactNode;
505
+
506
+ declare const Avatar: react.NamedExoticComponent<{
507
+ readonly name: string;
508
+ readonly uri: string | null;
509
+ readonly person?: boolean;
510
+ }>;
511
+
512
+ interface ButtonProps {
513
+ readonly label: string;
514
+ readonly onPress: () => void;
515
+ readonly variant?: 'primary' | 'secondary' | 'text';
516
+ readonly disabled?: boolean;
517
+ readonly busy?: boolean;
518
+ /** A role other than a button: `radio` and `checkbox` for choices. */
519
+ readonly role?: 'button' | 'radio' | 'checkbox' | 'link';
520
+ readonly selected?: boolean;
521
+ readonly hint?: string;
522
+ readonly children?: ReactNode;
523
+ readonly testID?: string;
524
+ }
525
+ declare const Button: react.NamedExoticComponent<ButtonProps>;
526
+
527
+ declare function DefaultHeader(props: Omit<HeaderProps, 'Default'>): react.JSX.Element;
528
+ declare const ChatHeader: react.NamedExoticComponent<object>;
529
+
530
+ declare const ChatSkeleton: react.NamedExoticComponent<object>;
531
+
532
+ declare function DefaultComposer(props: Omit<ComposerProps, 'Default'>): react.JSX.Element;
533
+ declare const Composer: react.NamedExoticComponent<{
534
+ readonly onError?: (error: unknown) => void;
535
+ }>;
536
+
537
+ declare const DisclosureBar: react.NamedExoticComponent<object>;
538
+
539
+ /** The tenant's failure action as a button, or nothing when there is none. */
540
+ declare function FailureActionButton(props: {
541
+ readonly state: FailureState;
542
+ }): ReactNode;
543
+
544
+ declare function DefaultBubble(props: Omit<MessageBubbleProps, 'Default'>): react.JSX.Element;
545
+ declare const MessageBubble: react.NamedExoticComponent<{
546
+ readonly item: MessageItem;
547
+ /** The first of a run from the same author: its label is shown. */
548
+ readonly showAuthor: boolean;
549
+ }>;
550
+ /** The reply streaming now: the only cell that re-renders as the text arrives. */
551
+ declare const StreamingBubble: react.NamedExoticComponent<{
552
+ readonly item: MessageItem;
553
+ readonly showAuthor: boolean;
554
+ }>;
555
+
556
+ /** Rows of one kind recycle together. */
557
+ declare function itemType(item: TimelineItem): string;
558
+ /**
559
+ * Runs of two or more consecutive cards with one carousel group (`group.layout: carousel`, the same `group.id`): by
560
+ * the first card's key, and the keys of the cards the run draws after it. A run equal to the previous one is the
561
+ * same array, so its row does not render again.
562
+ */
563
+ declare function carousels(items: readonly TimelineItem[], previous: ReadonlyMap<string, readonly CardItem[]>): {
564
+ runs: Map<string, readonly CardItem[]>;
565
+ inside: Set<string>;
566
+ };
567
+ declare const Row: react.NamedExoticComponent<{
568
+ readonly item: TimelineItem;
569
+ readonly showAuthor: boolean;
570
+ /** The carousel this card starts (`components.CardGroup`). */
571
+ readonly run?: readonly CardItem[] | undefined;
572
+ /** A card a carousel earlier in the list draws. */
573
+ readonly inside?: boolean;
574
+ }>;
575
+ declare const MessageList: react.NamedExoticComponent<object>;
576
+
577
+ declare const StatusBanner: react.NamedExoticComponent<object>;
578
+ /** The kit's own "Couldn't connect." banner: try again, and the tenant's failure action when there is one. */
579
+ declare function DefaultUnavailable(props: {
580
+ readonly state: FailureState;
581
+ }): ReactNode;
582
+
583
+ declare const SystemRow: react.NamedExoticComponent<{
584
+ readonly item: SystemItem;
585
+ }>;
586
+ /** The kit's own failed-turn row: "Something went wrong.", and the tenant's failure action when there is one. */
587
+ declare function DefaultTurnFailed(props: {
588
+ readonly state: FailureState;
589
+ }): ReactNode;
590
+
591
+ declare const Welcome: react.NamedExoticComponent<{
592
+ readonly welcome: Welcome$1;
593
+ readonly onChip: (message: string) => void;
594
+ }>;
595
+
303
596
  /** The part of the conversation store the adapter drives. */
304
597
  interface LifecycleTarget {
305
598
  setForeground(foreground: boolean): void;
@@ -311,4 +604,4 @@ declare function useReducedMotion(): boolean;
311
604
  /** Reads a line to a screen reader, without moving focus. */
312
605
  declare function announce(text: string): void;
313
606
 
314
- export { ActivityLine, Avatar, Button, type ButtonProps, CardFrame, type CardProps, CardView, type ChatHandlers, ChatHeader, ChatSkeleton, type ChatSlots, type ColorSchemeSetting, Composer, type ComposerProps, DefaultBubble, DefaultComposer, DefaultHeader, DefaultTurnFailed, DefaultUnavailable, DisclosureBar, type EmptyStateProps, type FailureAction, FailureActionButton, type FailureProps, type FailureState, type HeaderProps, InfoCard, type LifecycleTarget, type ListProps, MessageBubble, type MessageBubbleProps, MessageList, NextStepCard, ProposalCard, type ProposalDecision, QuestionCard, Row, StatusBanner, StreamingBubble, SystemRow, type Theme, type ThemeOverrides, ThemeProvider, TimeSlotsCard, VinaverseChat, type VinaverseChatProps, VinaverseChatProvider, announce, answerText, createTheme, defaultCard, fieldText, itemType, themeProblems, useChat, useNativeLifecycle, useReducedMotion, useTheme };
607
+ export { ActivityLine, AgentChat, type AgentChatProps, type AgentChatSlots, type AgentEndedProps, AgentFooter, type AgentFooterProps, AgentLauncher, type AgentLauncherProps, type AgentUnavailableScreenProps, type AgentUnreachableProps, AskAboutRow, type AskAboutRowProps, Avatar, Button, type ButtonProps, CardActions, CardCarousel, CardFrame, type CardGroupProps, type CardProps, CardView, type ChatHandlers, ChatHeader, ChatSkeleton, type ChatSlots, type Chip, type ColorSchemeSetting, Composer, type ComposerProps, DefaultBubble, DefaultComposer, DefaultEnded, DefaultHeader, DefaultTurnFailed, DefaultUnavailable, DefaultUnavailableScreen, DefaultUnreachable, DisclosureBar, type EmptyStateProps, type FailureAction, FailureActionButton, type FailureProps, type FailureState, type HeaderProps, type ImagePolicy, InfoCard, LAUNCHER_SIZE, type LauncherAppearance, LauncherButton, type LauncherButtonProps, type LauncherContext, LauncherEntrance, type LauncherEntranceProps, LauncherGreeting, type LauncherGreetingProps, type LauncherPlacement, type LifecycleTarget, LinksCard, type ListProps, ListingCard, MessageBubble, type MessageBubbleProps, MessageList, NextStepCard, ProposalCard, type ProposalDecision, QuestionCard, Row, StatusBanner, StreamingBubble, SystemRow, type Theme, type ThemeOverrides, ThemeProvider, TimeSlotsCard, VinaverseChat, type VinaverseChatProps, VinaverseChatProvider, Welcome, allowedImage, announce, answerText, carousels, createTheme, defaultCard, fieldText, itemType, monogram, newestWholeReply, ratingText, themeProblems, useChat, useKeyboardShown, useNativeLifecycle, useReducedMotion, useTheme };