@vinaverse/react-native 0.1.0-alpha.6 → 0.1.0-alpha.7

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.
Files changed (47) hide show
  1. package/README.md +19 -11
  2. package/dist/ask.cjs +9 -5
  3. package/dist/ask.d.cts +14 -3
  4. package/dist/ask.d.ts +14 -3
  5. package/dist/ask.js +3 -3
  6. package/dist/chat.cjs +76 -73
  7. package/dist/chat.d.cts +16 -4
  8. package/dist/chat.d.ts +16 -4
  9. package/dist/chat.js +2 -3
  10. package/dist/{chunk-OWUKWVEZ.cjs → chunk-6QYDPGRS.cjs} +46 -2
  11. package/dist/chunk-6QYDPGRS.cjs.map +1 -0
  12. package/dist/{chunk-H2Y2YW2Q.cjs → chunk-AGZ7IH7E.cjs} +71 -72
  13. package/dist/chunk-AGZ7IH7E.cjs.map +1 -0
  14. package/dist/chunk-EFEXTVIT.js +88 -0
  15. package/dist/chunk-EFEXTVIT.js.map +1 -0
  16. package/dist/{chunk-SF6LJTVJ.js → chunk-HTUXHZ7X.js} +25 -30
  17. package/dist/chunk-HTUXHZ7X.js.map +1 -0
  18. package/dist/{chunk-OGPMGGYS.cjs → chunk-MG32E4JI.cjs} +20 -13
  19. package/dist/chunk-MG32E4JI.cjs.map +1 -0
  20. package/dist/{chunk-Y7P7DDHD.js → chunk-NJ6ARGZS.js} +12 -11
  21. package/dist/chunk-NJ6ARGZS.js.map +1 -0
  22. package/dist/{chunk-NJWRZ55G.js → chunk-POJP52GE.js} +16 -9
  23. package/dist/chunk-POJP52GE.js.map +1 -0
  24. package/dist/{chunk-643GOUTG.cjs → chunk-V6HHPE5K.cjs} +13 -12
  25. package/dist/chunk-V6HHPE5K.cjs.map +1 -0
  26. package/dist/index.cjs +86 -83
  27. package/dist/index.d.cts +2 -2
  28. package/dist/index.d.ts +2 -2
  29. package/dist/index.js +4 -5
  30. package/dist/launcher.cjs +14 -11
  31. package/dist/launcher.d.cts +4 -3
  32. package/dist/launcher.d.ts +4 -3
  33. package/dist/launcher.js +3 -4
  34. package/package.json +4 -4
  35. package/dist/chunk-643GOUTG.cjs.map +0 -1
  36. package/dist/chunk-H2Y2YW2Q.cjs.map +0 -1
  37. package/dist/chunk-NJWRZ55G.js.map +0 -1
  38. package/dist/chunk-OGPMGGYS.cjs.map +0 -1
  39. package/dist/chunk-OWUKWVEZ.cjs.map +0 -1
  40. package/dist/chunk-PRXHS57U.js +0 -40
  41. package/dist/chunk-PRXHS57U.js.map +0 -1
  42. package/dist/chunk-PYPO6F7L.cjs +0 -44
  43. package/dist/chunk-PYPO6F7L.cjs.map +0 -1
  44. package/dist/chunk-SF6LJTVJ.js.map +0 -1
  45. package/dist/chunk-WKRCCPSN.js +0 -48
  46. package/dist/chunk-WKRCCPSN.js.map +0 -1
  47. package/dist/chunk-Y7P7DDHD.js.map +0 -1
package/README.md CHANGED
@@ -53,7 +53,7 @@ const imagePolicy = { hosts: ['images.example.com'], aspectRatio: 1.6, Placehold
53
53
  <Tabs />
54
54
  <AgentLauncher subject={user?.id ?? null} mode={side} Mark={YourMark}
55
55
  route={currentTab} routes={['home', 'explore']} hidden={sheetOpen} // never with the keyboard up
56
- storage={preferences} onOpen={({ route, mode }) => openChat(route, mode)}
56
+ storage={preferences} onOpen={({ route, mode, entryPoint }) => openChat(route, mode, entryPoint)}
57
57
  style={{ position: 'absolute', right: 16, bottom: tabBarHeight + 16 }} />
58
58
  </AgentRuntimeProvider>
59
59
 
@@ -61,6 +61,7 @@ const imagePolicy = { hosts: ['images.example.com'], aspectRatio: 1.6, Placehold
61
61
  <AgentChat
62
62
  agentKey={{ subject: user?.id ?? null, mode: side, scope: businessId }}
63
63
  place={{ screen: 'professional', entity: { type: 'professional', id } }}
64
+ entryPoint={entryPoint} // 'launcher', 'ask', 'deep_link': session_opened says it
64
65
  askAbout={`Tell me about ${name}`} // offered when the session was told another place
65
66
  starters={startersFor(screen)} // when the session brings no welcome
66
67
  components={components}
@@ -73,23 +74,30 @@ const imagePolicy = { hosts: ['images.example.com'], aspectRatio: 1.6, Placehold
73
74
  />
74
75
 
75
76
  // On the app's own page about a professional
76
- <AskAboutRow title={`Ask ${agentName} about ${name}`} onPress={() => openChat('professional', side)} />
77
+ <AskAboutRow title={`Ask ${agentName} about ${name}`} onPress={({ entryPoint }) => openChat('professional', side, entryPoint)} />
77
78
  ```
78
79
 
79
- - **Parts:** `AgentChat` draws the conversation, a conversation that ended (`components.Ended`, start over), the backend
80
- out of reach (`components.Unreachable`, try again), no agent at all (`components.UnavailableScreen`, the whole
81
- screen: off, or the session refused, with a person through `onContact`), and under the composer thumbs on the newest
82
- whole reply and the privacy link (`components.Footer`, `null` to hide); each slot gets the kit's part as `Default`,
83
- to wrap it. `opener` is a first question as a chip the person taps (a flow that asks for itself), until they say
84
- anything; nothing is ever sent in their name. `AgentLauncher` is a round button with
80
+ - **Parts:** `AgentChat` draws the conversation, a conversation that ended (`components.Ended`: `onStartNew`,
81
+ `reason`, `code`, `onContact`), the backend out of reach (`components.Unreachable`: `onRetry`, `reason`,
82
+ `onContact`), no agent at all (`components.UnavailableScreen`, the whole screen: off, or the session refused;
83
+ `reason`, `code`, `onRetry`, `onContact`), and under the composer thumbs on the newest whole reply seen live and the
84
+ privacy link (`components.Footer`, `null` to hide). Each slot replaces its screen entirely, layout and words, and gets
85
+ the kit's part as `Default` to wrap instead; to change only the words, pass `copy`. A person to contact
86
+ (`onContact`) reaches every full-screen slot. `opener` is a first question as a chip the person taps (a flow that asks for itself), until they say
87
+ anything; nothing is ever sent in their name. So a setup flow starts when the person taps it, never on its own:
88
+ starting it automatically would put words in their mouth, which the kit declines by design. `AgentLauncher` is a round button with
85
89
  a greeting bubble once per person and mode (`storage`: your preferences store; `greeting`: words or words by mode,
86
90
  read through `announce`; `storageKey` maps the record to one your app already keeps, so nobody is greeted twice),
87
91
  your `Mark` inside, floating where `placement` says (`edge`, `bottom` above your tab bar, `inset`; `style` after it),
88
92
  with `appearance` (a `ring`, the `shadow`, the bubble's `tail`), shown on your `routes` only, never with the keyboard
89
- up (`hideWithKeyboard`), stepping aside when you say (`hidden`), and only when the status offers it; its button,
93
+ up (`hideWithKeyboard`; on iOS it goes as the keyboard starts to rise, on Android once it is up), stepping aside when you say (`hidden`), and only when the status offers it; its button,
90
94
  bubble and entrance are slots (`LauncherButton`, `LauncherGreeting`, `LauncherEntrance`: a short fade and scale,
91
- none with reduced motion). `AskAboutRow` is "ask the agent about this" on
92
- your own pages, shown when the agent is available, decided once per visit.
95
+ none with reduced motion). Its `onOpen` and the ask row's `onPress` give `entryPoint` (`launcher`, `ask`): pass it to
96
+ `AgentChat`'s `entryPoint` (or `deep_link`, or your own words) and `session_opened` says where the chat was opened
97
+ from. Every agent part asks the runtime to `sweep()` when the app comes back to the foreground. `AskAboutRow` is "ask the agent about this" on
98
+ your own pages, decided once as the page draws, from the status already read: it is never added under a drawn page
99
+ (an agent whose status arrives later shows from the next visit), and `appearance` gives it a tint (`background`) and the
100
+ `chevron` or none.
93
101
  - **Policies and adapters:** `imagePolicy` (photo hosts, frame, the stand-in for a missing photo) applies to every card
94
102
  and every fetch ahead; `announce` reads finished replies and the greeting your way; `onChip` hears a tapped chip.
95
103
  Card renderers get the card read once (`read`).
package/dist/ask.cjs CHANGED
@@ -1,27 +1,31 @@
1
1
  'use strict';
2
2
 
3
- var chunk643GOUTG_cjs = require('./chunk-643GOUTG.cjs');
4
- var chunkOWUKWVEZ_cjs = require('./chunk-OWUKWVEZ.cjs');
3
+ var chunkV6HHPE5K_cjs = require('./chunk-V6HHPE5K.cjs');
4
+ var chunk6QYDPGRS_cjs = require('./chunk-6QYDPGRS.cjs');
5
5
  var agent = require('@vinaverse/react/agent');
6
6
 
7
7
 
8
8
 
9
9
  Object.defineProperty(exports, "AskAboutRow", {
10
10
  enumerable: true,
11
- get: function () { return chunk643GOUTG_cjs.AskAboutRow; }
11
+ get: function () { return chunkV6HHPE5K_cjs.AskAboutRow; }
12
12
  });
13
13
  Object.defineProperty(exports, "ThemeProvider", {
14
14
  enumerable: true,
15
- get: function () { return chunkOWUKWVEZ_cjs.ThemeProvider; }
15
+ get: function () { return chunk6QYDPGRS_cjs.ThemeProvider; }
16
16
  });
17
17
  Object.defineProperty(exports, "useTheme", {
18
18
  enumerable: true,
19
- get: function () { return chunkOWUKWVEZ_cjs.useTheme; }
19
+ get: function () { return chunk6QYDPGRS_cjs.useTheme; }
20
20
  });
21
21
  Object.defineProperty(exports, "AgentRuntimeProvider", {
22
22
  enumerable: true,
23
23
  get: function () { return agent.AgentRuntimeProvider; }
24
24
  });
25
+ Object.defineProperty(exports, "forgetGreeting", {
26
+ enumerable: true,
27
+ get: function () { return agent.forgetGreeting; }
28
+ });
25
29
  Object.defineProperty(exports, "greetedKey", {
26
30
  enumerable: true,
27
31
  get: function () { return agent.greetedKey; }
package/dist/ask.d.cts CHANGED
@@ -1,20 +1,31 @@
1
- export { AgentRuntimeProvider, GreetingStorage, UseAgentConversation, UseAgentLauncher, greetedKey, useAgentConversation, useAgentFeatures, useAgentLauncher, useAgentName, useAgentProfile, useAgentRuntime, useAgentStatus } from '@vinaverse/react/agent';
1
+ export { AgentRuntimeProvider, GreetingStorage, UseAgentConversation, UseAgentLauncher, forgetGreeting, greetedKey, useAgentConversation, useAgentFeatures, useAgentLauncher, useAgentName, useAgentProfile, useAgentRuntime, useAgentStatus } from '@vinaverse/react/agent';
2
2
  import { CopyOverrides } from '@vinaverse/react';
3
3
  import { ComponentType, ReactNode } from 'react';
4
4
  import { a as ThemeOverrides, C as ColorSchemeSetting } from './theme-BhiEGv64.cjs';
5
5
  export { T as Theme, b as ThemeProvider, u as useTheme } from './theme-BhiEGv64.cjs';
6
6
  import '@vinaverse/tokens';
7
7
 
8
+ /** The row's look beyond the theme. */
9
+ interface AskAboutRowAppearance {
10
+ /** A tint behind the row; default the theme's `surface`. */
11
+ readonly background?: string;
12
+ /** The chevron at the row's end. Default true. */
13
+ readonly chevron?: boolean;
14
+ }
8
15
  interface AskAboutRowProps {
9
16
  /** "Ask Example Agent about Riley Sample". */
10
17
  readonly title: string;
11
18
  readonly body?: string;
12
- readonly onPress: () => void;
19
+ /** The person asks: open the chat with `entryPoint` (`ask`), so the session says where it was opened from. */
20
+ readonly onPress: (from: {
21
+ readonly entryPoint: 'ask';
22
+ }) => void;
13
23
  /** The app's brand mark at the row's start; default the agent name's first letter. */
14
24
  readonly Mark?: ComponentType<{
15
25
  readonly size: number;
16
26
  readonly color: string;
17
27
  }>;
28
+ readonly appearance?: AskAboutRowAppearance;
18
29
  readonly locale?: string;
19
30
  readonly copy?: CopyOverrides;
20
31
  readonly theme?: ThemeOverrides;
@@ -22,4 +33,4 @@ interface AskAboutRowProps {
22
33
  }
23
34
  declare function AskAboutRow(props: AskAboutRowProps): ReactNode;
24
35
 
25
- export { AskAboutRow, type AskAboutRowProps, ColorSchemeSetting, ThemeOverrides };
36
+ export { AskAboutRow, type AskAboutRowAppearance, type AskAboutRowProps, ColorSchemeSetting, ThemeOverrides };
package/dist/ask.d.ts CHANGED
@@ -1,20 +1,31 @@
1
- export { AgentRuntimeProvider, GreetingStorage, UseAgentConversation, UseAgentLauncher, greetedKey, useAgentConversation, useAgentFeatures, useAgentLauncher, useAgentName, useAgentProfile, useAgentRuntime, useAgentStatus } from '@vinaverse/react/agent';
1
+ export { AgentRuntimeProvider, GreetingStorage, UseAgentConversation, UseAgentLauncher, forgetGreeting, greetedKey, useAgentConversation, useAgentFeatures, useAgentLauncher, useAgentName, useAgentProfile, useAgentRuntime, useAgentStatus } from '@vinaverse/react/agent';
2
2
  import { CopyOverrides } from '@vinaverse/react';
3
3
  import { ComponentType, ReactNode } from 'react';
4
4
  import { a as ThemeOverrides, C as ColorSchemeSetting } from './theme-BhiEGv64.js';
5
5
  export { T as Theme, b as ThemeProvider, u as useTheme } from './theme-BhiEGv64.js';
6
6
  import '@vinaverse/tokens';
7
7
 
8
+ /** The row's look beyond the theme. */
9
+ interface AskAboutRowAppearance {
10
+ /** A tint behind the row; default the theme's `surface`. */
11
+ readonly background?: string;
12
+ /** The chevron at the row's end. Default true. */
13
+ readonly chevron?: boolean;
14
+ }
8
15
  interface AskAboutRowProps {
9
16
  /** "Ask Example Agent about Riley Sample". */
10
17
  readonly title: string;
11
18
  readonly body?: string;
12
- readonly onPress: () => void;
19
+ /** The person asks: open the chat with `entryPoint` (`ask`), so the session says where it was opened from. */
20
+ readonly onPress: (from: {
21
+ readonly entryPoint: 'ask';
22
+ }) => void;
13
23
  /** The app's brand mark at the row's start; default the agent name's first letter. */
14
24
  readonly Mark?: ComponentType<{
15
25
  readonly size: number;
16
26
  readonly color: string;
17
27
  }>;
28
+ readonly appearance?: AskAboutRowAppearance;
18
29
  readonly locale?: string;
19
30
  readonly copy?: CopyOverrides;
20
31
  readonly theme?: ThemeOverrides;
@@ -22,4 +33,4 @@ interface AskAboutRowProps {
22
33
  }
23
34
  declare function AskAboutRow(props: AskAboutRowProps): ReactNode;
24
35
 
25
- export { AskAboutRow, type AskAboutRowProps, ColorSchemeSetting, ThemeOverrides };
36
+ export { AskAboutRow, type AskAboutRowAppearance, type AskAboutRowProps, ColorSchemeSetting, ThemeOverrides };
package/dist/ask.js CHANGED
@@ -1,5 +1,5 @@
1
- export { AskAboutRow } from './chunk-Y7P7DDHD.js';
2
- export { ThemeProvider, useTheme } from './chunk-WKRCCPSN.js';
3
- export { AgentRuntimeProvider, greetedKey, useAgentConversation, useAgentFeatures, useAgentLauncher, useAgentName, useAgentProfile, useAgentRuntime, useAgentStatus } from '@vinaverse/react/agent';
1
+ export { AskAboutRow } from './chunk-NJ6ARGZS.js';
2
+ export { ThemeProvider, useTheme } from './chunk-EFEXTVIT.js';
3
+ export { AgentRuntimeProvider, forgetGreeting, greetedKey, useAgentConversation, useAgentFeatures, useAgentLauncher, useAgentName, useAgentProfile, useAgentRuntime, useAgentStatus } from '@vinaverse/react/agent';
4
4
  //# sourceMappingURL=ask.js.map
5
5
  //# sourceMappingURL=ask.js.map
package/dist/chat.cjs CHANGED
@@ -1,266 +1,269 @@
1
1
  'use strict';
2
2
 
3
- var chunkH2Y2YW2Q_cjs = require('./chunk-H2Y2YW2Q.cjs');
4
- var chunkPYPO6F7L_cjs = require('./chunk-PYPO6F7L.cjs');
5
- var chunkOWUKWVEZ_cjs = require('./chunk-OWUKWVEZ.cjs');
3
+ var chunkAGZ7IH7E_cjs = require('./chunk-AGZ7IH7E.cjs');
4
+ var chunk6QYDPGRS_cjs = require('./chunk-6QYDPGRS.cjs');
6
5
 
7
6
 
8
7
 
9
8
  Object.defineProperty(exports, "ActivityLine", {
10
9
  enumerable: true,
11
- get: function () { return chunkH2Y2YW2Q_cjs.ActivityLine; }
10
+ get: function () { return chunkAGZ7IH7E_cjs.ActivityLine; }
12
11
  });
13
12
  Object.defineProperty(exports, "AgentChat", {
14
13
  enumerable: true,
15
- get: function () { return chunkH2Y2YW2Q_cjs.AgentChat; }
14
+ get: function () { return chunkAGZ7IH7E_cjs.AgentChat; }
16
15
  });
17
16
  Object.defineProperty(exports, "AgentFooter", {
18
17
  enumerable: true,
19
- get: function () { return chunkH2Y2YW2Q_cjs.AgentFooter; }
18
+ get: function () { return chunkAGZ7IH7E_cjs.AgentFooter; }
20
19
  });
21
20
  Object.defineProperty(exports, "AgentRuntimeProvider", {
22
21
  enumerable: true,
23
- get: function () { return chunkH2Y2YW2Q_cjs.AgentRuntimeProvider; }
22
+ get: function () { return chunkAGZ7IH7E_cjs.AgentRuntimeProvider; }
24
23
  });
25
24
  Object.defineProperty(exports, "Avatar", {
26
25
  enumerable: true,
27
- get: function () { return chunkH2Y2YW2Q_cjs.Avatar; }
26
+ get: function () { return chunkAGZ7IH7E_cjs.Avatar; }
28
27
  });
29
28
  Object.defineProperty(exports, "Button", {
30
29
  enumerable: true,
31
- get: function () { return chunkH2Y2YW2Q_cjs.Button; }
30
+ get: function () { return chunkAGZ7IH7E_cjs.Button; }
32
31
  });
33
32
  Object.defineProperty(exports, "CardActions", {
34
33
  enumerable: true,
35
- get: function () { return chunkH2Y2YW2Q_cjs.CardActions; }
34
+ get: function () { return chunkAGZ7IH7E_cjs.CardActions; }
36
35
  });
37
36
  Object.defineProperty(exports, "CardCarousel", {
38
37
  enumerable: true,
39
- get: function () { return chunkH2Y2YW2Q_cjs.CardCarousel; }
38
+ get: function () { return chunkAGZ7IH7E_cjs.CardCarousel; }
40
39
  });
41
40
  Object.defineProperty(exports, "CardFrame", {
42
41
  enumerable: true,
43
- get: function () { return chunkH2Y2YW2Q_cjs.CardFrame; }
42
+ get: function () { return chunkAGZ7IH7E_cjs.CardFrame; }
44
43
  });
45
44
  Object.defineProperty(exports, "CardView", {
46
45
  enumerable: true,
47
- get: function () { return chunkH2Y2YW2Q_cjs.CardView; }
46
+ get: function () { return chunkAGZ7IH7E_cjs.CardView; }
48
47
  });
49
48
  Object.defineProperty(exports, "ChatHeader", {
50
49
  enumerable: true,
51
- get: function () { return chunkH2Y2YW2Q_cjs.ChatHeader; }
50
+ get: function () { return chunkAGZ7IH7E_cjs.ChatHeader; }
52
51
  });
53
52
  Object.defineProperty(exports, "ChatSkeleton", {
54
53
  enumerable: true,
55
- get: function () { return chunkH2Y2YW2Q_cjs.ChatSkeleton; }
54
+ get: function () { return chunkAGZ7IH7E_cjs.ChatSkeleton; }
56
55
  });
57
56
  Object.defineProperty(exports, "Composer", {
58
57
  enumerable: true,
59
- get: function () { return chunkH2Y2YW2Q_cjs.Composer; }
58
+ get: function () { return chunkAGZ7IH7E_cjs.Composer; }
60
59
  });
61
60
  Object.defineProperty(exports, "DefaultBubble", {
62
61
  enumerable: true,
63
- get: function () { return chunkH2Y2YW2Q_cjs.DefaultBubble; }
62
+ get: function () { return chunkAGZ7IH7E_cjs.DefaultBubble; }
64
63
  });
65
64
  Object.defineProperty(exports, "DefaultComposer", {
66
65
  enumerable: true,
67
- get: function () { return chunkH2Y2YW2Q_cjs.DefaultComposer; }
66
+ get: function () { return chunkAGZ7IH7E_cjs.DefaultComposer; }
68
67
  });
69
68
  Object.defineProperty(exports, "DefaultEnded", {
70
69
  enumerable: true,
71
- get: function () { return chunkH2Y2YW2Q_cjs.DefaultEnded; }
70
+ get: function () { return chunkAGZ7IH7E_cjs.DefaultEnded; }
72
71
  });
73
72
  Object.defineProperty(exports, "DefaultHeader", {
74
73
  enumerable: true,
75
- get: function () { return chunkH2Y2YW2Q_cjs.DefaultHeader; }
74
+ get: function () { return chunkAGZ7IH7E_cjs.DefaultHeader; }
76
75
  });
77
76
  Object.defineProperty(exports, "DefaultTurnFailed", {
78
77
  enumerable: true,
79
- get: function () { return chunkH2Y2YW2Q_cjs.DefaultTurnFailed; }
78
+ get: function () { return chunkAGZ7IH7E_cjs.DefaultTurnFailed; }
80
79
  });
81
80
  Object.defineProperty(exports, "DefaultUnavailable", {
82
81
  enumerable: true,
83
- get: function () { return chunkH2Y2YW2Q_cjs.DefaultUnavailable; }
82
+ get: function () { return chunkAGZ7IH7E_cjs.DefaultUnavailable; }
84
83
  });
85
84
  Object.defineProperty(exports, "DefaultUnavailableScreen", {
86
85
  enumerable: true,
87
- get: function () { return chunkH2Y2YW2Q_cjs.DefaultUnavailableScreen; }
86
+ get: function () { return chunkAGZ7IH7E_cjs.DefaultUnavailableScreen; }
88
87
  });
89
88
  Object.defineProperty(exports, "DefaultUnreachable", {
90
89
  enumerable: true,
91
- get: function () { return chunkH2Y2YW2Q_cjs.DefaultUnreachable; }
90
+ get: function () { return chunkAGZ7IH7E_cjs.DefaultUnreachable; }
92
91
  });
93
92
  Object.defineProperty(exports, "DisclosureBar", {
94
93
  enumerable: true,
95
- get: function () { return chunkH2Y2YW2Q_cjs.DisclosureBar; }
94
+ get: function () { return chunkAGZ7IH7E_cjs.DisclosureBar; }
96
95
  });
97
96
  Object.defineProperty(exports, "FailureActionButton", {
98
97
  enumerable: true,
99
- get: function () { return chunkH2Y2YW2Q_cjs.FailureActionButton; }
98
+ get: function () { return chunkAGZ7IH7E_cjs.FailureActionButton; }
100
99
  });
101
100
  Object.defineProperty(exports, "InfoCard", {
102
101
  enumerable: true,
103
- get: function () { return chunkH2Y2YW2Q_cjs.InfoCard; }
102
+ get: function () { return chunkAGZ7IH7E_cjs.InfoCard; }
104
103
  });
105
104
  Object.defineProperty(exports, "LinksCard", {
106
105
  enumerable: true,
107
- get: function () { return chunkH2Y2YW2Q_cjs.LinksCard; }
106
+ get: function () { return chunkAGZ7IH7E_cjs.LinksCard; }
108
107
  });
109
108
  Object.defineProperty(exports, "ListingCard", {
110
109
  enumerable: true,
111
- get: function () { return chunkH2Y2YW2Q_cjs.ListingCard; }
110
+ get: function () { return chunkAGZ7IH7E_cjs.ListingCard; }
112
111
  });
113
112
  Object.defineProperty(exports, "MessageBubble", {
114
113
  enumerable: true,
115
- get: function () { return chunkH2Y2YW2Q_cjs.MessageBubble; }
114
+ get: function () { return chunkAGZ7IH7E_cjs.MessageBubble; }
116
115
  });
117
116
  Object.defineProperty(exports, "MessageList", {
118
117
  enumerable: true,
119
- get: function () { return chunkH2Y2YW2Q_cjs.MessageList; }
118
+ get: function () { return chunkAGZ7IH7E_cjs.MessageList; }
120
119
  });
121
120
  Object.defineProperty(exports, "NextStepCard", {
122
121
  enumerable: true,
123
- get: function () { return chunkH2Y2YW2Q_cjs.NextStepCard; }
122
+ get: function () { return chunkAGZ7IH7E_cjs.NextStepCard; }
124
123
  });
125
124
  Object.defineProperty(exports, "ProposalCard", {
126
125
  enumerable: true,
127
- get: function () { return chunkH2Y2YW2Q_cjs.ProposalCard; }
126
+ get: function () { return chunkAGZ7IH7E_cjs.ProposalCard; }
128
127
  });
129
128
  Object.defineProperty(exports, "QuestionCard", {
130
129
  enumerable: true,
131
- get: function () { return chunkH2Y2YW2Q_cjs.QuestionCard; }
130
+ get: function () { return chunkAGZ7IH7E_cjs.QuestionCard; }
132
131
  });
133
132
  Object.defineProperty(exports, "Row", {
134
133
  enumerable: true,
135
- get: function () { return chunkH2Y2YW2Q_cjs.Row; }
134
+ get: function () { return chunkAGZ7IH7E_cjs.Row; }
136
135
  });
137
136
  Object.defineProperty(exports, "StatusBanner", {
138
137
  enumerable: true,
139
- get: function () { return chunkH2Y2YW2Q_cjs.StatusBanner; }
138
+ get: function () { return chunkAGZ7IH7E_cjs.StatusBanner; }
140
139
  });
141
140
  Object.defineProperty(exports, "StreamingBubble", {
142
141
  enumerable: true,
143
- get: function () { return chunkH2Y2YW2Q_cjs.StreamingBubble; }
142
+ get: function () { return chunkAGZ7IH7E_cjs.StreamingBubble; }
144
143
  });
145
144
  Object.defineProperty(exports, "SystemRow", {
146
145
  enumerable: true,
147
- get: function () { return chunkH2Y2YW2Q_cjs.SystemRow; }
146
+ get: function () { return chunkAGZ7IH7E_cjs.SystemRow; }
148
147
  });
149
148
  Object.defineProperty(exports, "TimeSlotsCard", {
150
149
  enumerable: true,
151
- get: function () { return chunkH2Y2YW2Q_cjs.TimeSlotsCard; }
150
+ get: function () { return chunkAGZ7IH7E_cjs.TimeSlotsCard; }
152
151
  });
153
152
  Object.defineProperty(exports, "VinaverseChat", {
154
153
  enumerable: true,
155
- get: function () { return chunkH2Y2YW2Q_cjs.VinaverseChat; }
154
+ get: function () { return chunkAGZ7IH7E_cjs.VinaverseChat; }
156
155
  });
157
156
  Object.defineProperty(exports, "VinaverseChatProvider", {
158
157
  enumerable: true,
159
- get: function () { return chunkH2Y2YW2Q_cjs.VinaverseChatProvider; }
158
+ get: function () { return chunkAGZ7IH7E_cjs.VinaverseChatProvider; }
160
159
  });
161
160
  Object.defineProperty(exports, "Welcome", {
162
161
  enumerable: true,
163
- get: function () { return chunkH2Y2YW2Q_cjs.Welcome; }
162
+ get: function () { return chunkAGZ7IH7E_cjs.Welcome; }
164
163
  });
165
164
  Object.defineProperty(exports, "allowedImage", {
166
165
  enumerable: true,
167
- get: function () { return chunkH2Y2YW2Q_cjs.allowedImage; }
166
+ get: function () { return chunkAGZ7IH7E_cjs.allowedImage; }
168
167
  });
169
168
  Object.defineProperty(exports, "answerText", {
170
169
  enumerable: true,
171
- get: function () { return chunkH2Y2YW2Q_cjs.answerText; }
170
+ get: function () { return chunkAGZ7IH7E_cjs.answerText; }
172
171
  });
173
172
  Object.defineProperty(exports, "carousels", {
174
173
  enumerable: true,
175
- get: function () { return chunkH2Y2YW2Q_cjs.carousels; }
174
+ get: function () { return chunkAGZ7IH7E_cjs.carousels; }
176
175
  });
177
176
  Object.defineProperty(exports, "defaultCard", {
178
177
  enumerable: true,
179
- get: function () { return chunkH2Y2YW2Q_cjs.defaultCard; }
178
+ get: function () { return chunkAGZ7IH7E_cjs.defaultCard; }
180
179
  });
181
180
  Object.defineProperty(exports, "fieldText", {
182
181
  enumerable: true,
183
- get: function () { return chunkH2Y2YW2Q_cjs.fieldText; }
182
+ get: function () { return chunkAGZ7IH7E_cjs.fieldText; }
183
+ });
184
+ Object.defineProperty(exports, "forgetGreeting", {
185
+ enumerable: true,
186
+ get: function () { return chunkAGZ7IH7E_cjs.forgetGreeting; }
184
187
  });
185
188
  Object.defineProperty(exports, "greetedKey", {
186
189
  enumerable: true,
187
- get: function () { return chunkH2Y2YW2Q_cjs.greetedKey; }
190
+ get: function () { return chunkAGZ7IH7E_cjs.greetedKey; }
188
191
  });
189
192
  Object.defineProperty(exports, "itemType", {
190
193
  enumerable: true,
191
- get: function () { return chunkH2Y2YW2Q_cjs.itemType; }
194
+ get: function () { return chunkAGZ7IH7E_cjs.itemType; }
192
195
  });
193
196
  Object.defineProperty(exports, "monogram", {
194
197
  enumerable: true,
195
- get: function () { return chunkH2Y2YW2Q_cjs.monogram; }
198
+ get: function () { return chunkAGZ7IH7E_cjs.monogram; }
196
199
  });
197
200
  Object.defineProperty(exports, "newestWholeReply", {
198
201
  enumerable: true,
199
- get: function () { return chunkH2Y2YW2Q_cjs.newestWholeReply; }
202
+ get: function () { return chunkAGZ7IH7E_cjs.newestWholeReply; }
200
203
  });
201
204
  Object.defineProperty(exports, "ratingText", {
202
205
  enumerable: true,
203
- get: function () { return chunkH2Y2YW2Q_cjs.ratingText; }
206
+ get: function () { return chunkAGZ7IH7E_cjs.ratingText; }
204
207
  });
205
208
  Object.defineProperty(exports, "useAgentConversation", {
206
209
  enumerable: true,
207
- get: function () { return chunkH2Y2YW2Q_cjs.useAgentConversation; }
210
+ get: function () { return chunkAGZ7IH7E_cjs.useAgentConversation; }
208
211
  });
209
212
  Object.defineProperty(exports, "useAgentFeatures", {
210
213
  enumerable: true,
211
- get: function () { return chunkH2Y2YW2Q_cjs.useAgentFeatures; }
214
+ get: function () { return chunkAGZ7IH7E_cjs.useAgentFeatures; }
212
215
  });
213
216
  Object.defineProperty(exports, "useAgentLauncher", {
214
217
  enumerable: true,
215
- get: function () { return chunkH2Y2YW2Q_cjs.useAgentLauncher; }
218
+ get: function () { return chunkAGZ7IH7E_cjs.useAgentLauncher; }
216
219
  });
217
220
  Object.defineProperty(exports, "useAgentName", {
218
221
  enumerable: true,
219
- get: function () { return chunkH2Y2YW2Q_cjs.useAgentName; }
222
+ get: function () { return chunkAGZ7IH7E_cjs.useAgentName; }
220
223
  });
221
224
  Object.defineProperty(exports, "useAgentProfile", {
222
225
  enumerable: true,
223
- get: function () { return chunkH2Y2YW2Q_cjs.useAgentProfile; }
226
+ get: function () { return chunkAGZ7IH7E_cjs.useAgentProfile; }
224
227
  });
225
228
  Object.defineProperty(exports, "useAgentRuntime", {
226
229
  enumerable: true,
227
- get: function () { return chunkH2Y2YW2Q_cjs.useAgentRuntime; }
230
+ get: function () { return chunkAGZ7IH7E_cjs.useAgentRuntime; }
228
231
  });
229
232
  Object.defineProperty(exports, "useAgentStatus", {
230
233
  enumerable: true,
231
- get: function () { return chunkH2Y2YW2Q_cjs.useAgentStatus; }
234
+ get: function () { return chunkAGZ7IH7E_cjs.useAgentStatus; }
232
235
  });
233
236
  Object.defineProperty(exports, "useChat", {
234
237
  enumerable: true,
235
- get: function () { return chunkH2Y2YW2Q_cjs.useChat; }
238
+ get: function () { return chunkAGZ7IH7E_cjs.useChat; }
236
239
  });
237
- Object.defineProperty(exports, "announce", {
240
+ Object.defineProperty(exports, "ThemeProvider", {
238
241
  enumerable: true,
239
- get: function () { return chunkPYPO6F7L_cjs.announce; }
242
+ get: function () { return chunk6QYDPGRS_cjs.ThemeProvider; }
240
243
  });
241
- Object.defineProperty(exports, "useNativeLifecycle", {
244
+ Object.defineProperty(exports, "announce", {
242
245
  enumerable: true,
243
- get: function () { return chunkPYPO6F7L_cjs.useNativeLifecycle; }
246
+ get: function () { return chunk6QYDPGRS_cjs.announce; }
244
247
  });
245
- Object.defineProperty(exports, "useReducedMotion", {
248
+ Object.defineProperty(exports, "createTheme", {
246
249
  enumerable: true,
247
- get: function () { return chunkPYPO6F7L_cjs.useReducedMotion; }
250
+ get: function () { return chunk6QYDPGRS_cjs.createTheme; }
248
251
  });
249
- Object.defineProperty(exports, "ThemeProvider", {
252
+ Object.defineProperty(exports, "themeProblems", {
250
253
  enumerable: true,
251
- get: function () { return chunkOWUKWVEZ_cjs.ThemeProvider; }
254
+ get: function () { return chunk6QYDPGRS_cjs.themeProblems; }
252
255
  });
253
- Object.defineProperty(exports, "createTheme", {
256
+ Object.defineProperty(exports, "useNativeLifecycle", {
254
257
  enumerable: true,
255
- get: function () { return chunkOWUKWVEZ_cjs.createTheme; }
258
+ get: function () { return chunk6QYDPGRS_cjs.useNativeLifecycle; }
256
259
  });
257
- Object.defineProperty(exports, "themeProblems", {
260
+ Object.defineProperty(exports, "useReducedMotion", {
258
261
  enumerable: true,
259
- get: function () { return chunkOWUKWVEZ_cjs.themeProblems; }
262
+ get: function () { return chunk6QYDPGRS_cjs.useReducedMotion; }
260
263
  });
261
264
  Object.defineProperty(exports, "useTheme", {
262
265
  enumerable: true,
263
- get: function () { return chunkOWUKWVEZ_cjs.useTheme; }
266
+ get: function () { return chunk6QYDPGRS_cjs.useTheme; }
264
267
  });
265
268
  //# sourceMappingURL=chat.cjs.map
266
269
  //# sourceMappingURL=chat.cjs.map
package/dist/chat.d.cts CHANGED
@@ -1,9 +1,9 @@
1
- export { AgentRuntimeProvider, GreetingStorage, UseAgentConversation, UseAgentLauncher, greetedKey, useAgentConversation, useAgentFeatures, useAgentLauncher, useAgentName, useAgentProfile, useAgentRuntime, useAgentStatus } from '@vinaverse/react/agent';
1
+ export { AgentRuntimeProvider, GreetingStorage, UseAgentConversation, UseAgentLauncher, forgetGreeting, greetedKey, useAgentConversation, useAgentFeatures, useAgentLauncher, useAgentName, useAgentProfile, useAgentRuntime, useAgentStatus } from '@vinaverse/react/agent';
2
2
  import * as react from 'react';
3
3
  import { ComponentType, ReactElement, ReactNode, RefObject } from 'react';
4
4
  import * as _vinaverse_client_conversation from '@vinaverse/client/conversation';
5
5
  import { MessageItem, Welcome as Welcome$1, TimelineItem, CardItem, HeldCard, Question, ProposalOutcome, ConversationStore, SystemItem } from '@vinaverse/client/conversation';
6
- import { ReadCard, AgentCardTarget, AgentKey, AgentPlace, AgentFailureReason, AgentRating } from '@vinaverse/client/agent';
6
+ import { ReadCard, AgentCardTarget, AgentKey, AgentPlace, AgentEntryPoint, AgentFailureReason, AgentRating } from '@vinaverse/client/agent';
7
7
  import { ImageProps, StyleProp, ViewStyle } from 'react-native';
8
8
  import { CopyOverrides } from '@vinaverse/react';
9
9
  import { a as ThemeOverrides, C as ColorSchemeSetting } from './theme-BhiEGv64.cjs';
@@ -269,10 +269,19 @@ declare function VinaverseChatProvider(props: Omit<VinaverseChatProps, 'hideHead
269
269
  }): ReactNode;
270
270
  declare function VinaverseChat(props: VinaverseChatProps): ReactNode;
271
271
 
272
+ /**
273
+ * The full-screen states (`Ended`, `Unreachable`, `UnavailableScreen`) are slots: each gets everything its screen
274
+ * needs (why, the actions, a person to contact) and the kit's own part as `Default`, so an app replaces the layout and
275
+ * the words entirely, or only the words through `copy`.
276
+ */
272
277
  interface AgentEndedProps {
273
278
  readonly onStartNew: () => void;
279
+ /** Why: `ended`, `not_found`, `expired`, `mismatch`, `completed`. */
280
+ readonly reason: AgentFailureReason | null;
274
281
  /** The API's code (`conversation_not_found`, `conversation_expired`), when it gave one. */
275
282
  readonly code: string | null;
283
+ /** A person instead (the chat's `onContact`); absent when the app gave none. */
284
+ readonly onContact: (() => void) | undefined;
276
285
  }
277
286
  /** No agent here: switched off for this tenant, mode or person, or the backend refused the session. */
278
287
  interface AgentUnavailableScreenProps {
@@ -288,13 +297,15 @@ interface AgentUnreachableProps {
288
297
  readonly onRetry: () => void;
289
298
  /** Why: `network`, `server`, `rate_limited`, … */
290
299
  readonly reason: AgentFailureReason | null;
300
+ /** A person instead (the chat's `onContact`); absent when the app gave none. */
301
+ readonly onContact: (() => void) | undefined;
291
302
  }
292
303
  /** A slot gets the kit's own part as `Default`, to wrap rather than rewrite. */
293
304
  type Slot<P> = ComponentType<P & {
294
305
  readonly Default: ComponentType<P>;
295
306
  }>;
296
307
  interface AgentFooterProps {
297
- /** The newest whole reply's turn, to rate; null when there is none. */
308
+ /** The newest whole reply's turn, to rate; null when there is none or it was restored from before. */
298
309
  readonly turnId: string | null;
299
310
  readonly rating: AgentRating | undefined;
300
311
  readonly onRate: (rating: AgentRating) => void;
@@ -316,7 +327,8 @@ interface AgentChatProps extends Omit<VinaverseChatProps, 'conversation' | 'comp
316
327
  readonly agentKey: AgentKey;
317
328
  /** Where the person asks from, told to the agent as a session opens. */
318
329
  readonly place?: AgentPlace | null;
319
- readonly entryPoint?: string | null;
330
+ /** How the person came in: `launcher` and `ask` from the kit's parts, `deep_link`, or the app's own words. */
331
+ readonly entryPoint?: AgentEntryPoint | null;
320
332
  /** The question about this place, offered when the session was told another one (`moved`). */
321
333
  readonly askAbout?: string | null;
322
334
  /** A person: offered on a failed turn, "couldn't connect" and no agent. */