@guideai/react-native 0.8.0 → 0.10.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.
Files changed (33) hide show
  1. package/README.md +25 -3
  2. package/dist/{GuideAIChat-W8KQ4Y6i.cjs → GuideAIChat-BtbkPIvE.cjs} +285 -26
  3. package/dist/GuideAIChat-BtbkPIvE.cjs.map +1 -0
  4. package/dist/{GuideAIChat-Ba6n1ePs.js → GuideAIChat-CKW6dgl_.js} +286 -27
  5. package/dist/GuideAIChat-CKW6dgl_.js.map +1 -0
  6. package/dist/index.cjs +1 -1
  7. package/dist/index.d.ts +119 -12
  8. package/dist/index.mjs +2 -2
  9. package/dist/ui.cjs +2 -2
  10. package/dist/ui.d.ts +24 -8
  11. package/dist/ui.mjs +3 -3
  12. package/dist/{useConversations-SbhtYN_R.js → useConversations-BljCr0Od.js} +1085 -52
  13. package/dist/useConversations-BljCr0Od.js.map +1 -0
  14. package/dist/{useConversations-CJEaVqch.cjs → useConversations-UiwD_WVF.cjs} +1085 -52
  15. package/dist/useConversations-UiwD_WVF.cjs.map +1 -0
  16. package/dist/voice.cjs +2873 -19
  17. package/dist/voice.cjs.map +1 -1
  18. package/dist/voice.d.ts +25 -9
  19. package/dist/voice.mjs +2874 -20
  20. package/dist/voice.mjs.map +1 -1
  21. package/package.json +6 -2
  22. package/dist/GuideAIChat-Ba6n1ePs.js.map +0 -1
  23. package/dist/GuideAIChat-CxyWFl_o.cjs +0 -2493
  24. package/dist/GuideAIChat-CxyWFl_o.cjs.map +0 -1
  25. package/dist/GuideAIChat-DOC4zx-a.js +0 -2494
  26. package/dist/GuideAIChat-DOC4zx-a.js.map +0 -1
  27. package/dist/GuideAIChat-W8KQ4Y6i.cjs.map +0 -1
  28. package/dist/useConversations-B_7km_uH.js +0 -4243
  29. package/dist/useConversations-B_7km_uH.js.map +0 -1
  30. package/dist/useConversations-CJEaVqch.cjs.map +0 -1
  31. package/dist/useConversations-CTbQBTz-.cjs +0 -4242
  32. package/dist/useConversations-CTbQBTz-.cjs.map +0 -1
  33. package/dist/useConversations-SbhtYN_R.js.map +0 -1
package/dist/voice.d.ts CHANGED
@@ -32,6 +32,11 @@ interface GuideAIMessage {
32
32
  * `explainOnWhiteboard(id)`.
33
33
  */
34
34
  whiteboard?: boolean;
35
+ /**
36
+ * This answer can also be taught as a Full lesson (the Blueprint offers
37
+ * it). Draw a button that calls `explainOnWhiteboard(id, { lesson: true })`.
38
+ */
39
+ lesson?: boolean;
35
40
  /**
36
41
  * Pictures the agent drew. They are also in `content` as Markdown
37
42
  * images where they belong; use this list to place them yourself.
@@ -71,6 +76,11 @@ interface GuideAIVoiceResult {
71
76
  * calls, the transport. That split is what lets the agent be upgraded
72
77
  * underneath a host's UI without them changing a line.
73
78
  */
79
+ /** How `send` reports the answer while it is being written. */
80
+ interface GuideAISendOptions {
81
+ /** Each piece of the answer as it arrives. */
82
+ onDelta?(delta: string): void;
83
+ }
74
84
  interface UseGuideAIResult {
75
85
  /**
76
86
  * The conversation so far, oldest first, ready to draw. An answer that
@@ -86,11 +96,16 @@ interface UseGuideAIResult {
86
96
  followUps: string[];
87
97
  /** The Blueprint has the whiteboard block. */
88
98
  whiteboardAvailable: boolean;
99
+ /** The Blueprint offers Full lessons beside the whiteboard. */
100
+ lessonsAvailable: boolean;
89
101
  /**
90
- * Explain an answer on the whiteboard, with the question it answered.
91
- * Mount `<GuideAIWhiteboard />` once to show the board.
102
+ * Explain an answer on the whiteboard, with the question it answered;
103
+ * `{ lesson: true }` for the Full lesson. Mount `<GuideAIWhiteboard />`
104
+ * once to show the board.
92
105
  */
93
- explainOnWhiteboard(messageId: string): Promise<boolean>;
106
+ explainOnWhiteboard(messageId: string, options?: {
107
+ lesson?: boolean;
108
+ }): Promise<boolean>;
94
109
  /**
95
110
  * The current input text, and its setter.
96
111
  *
@@ -104,9 +119,10 @@ interface UseGuideAIResult {
104
119
  * Send `input`, or an explicit string.
105
120
  *
106
121
  * Ignores empty text and calls made while a turn is in flight, so a
107
- * host does not have to guard their send button.
122
+ * host does not have to guard their send button. `onDelta` hears the
123
+ * answer as it is written (live voice speaks it from there).
108
124
  */
109
- send(question?: string): Promise<string | null>;
125
+ send(question?: string, options?: GuideAISendOptions): Promise<string | null>;
110
126
  /** True from send() until the turn settles. Drives a disabled state. */
111
127
  busy: boolean;
112
128
  /** Whether `send()` would do anything right now. */
@@ -117,15 +133,15 @@ interface UseGuideAIResult {
117
133
  retry(): Promise<void>;
118
134
  /** Start a new conversation. The current one stays in the chat history (useConversations). */
119
135
  clear(): void;
120
- /** Approve the message's `pendingAction`; the agent carries it out. */
121
- confirm(messageId: string): Promise<void>;
136
+ /** Approve the message's `pendingAction`; the agent carries it out. Resolves with its reply. */
137
+ confirm(messageId: string): Promise<string | null>;
122
138
  /** Decline the message's `pendingAction`. Nothing is changed. */
123
139
  cancel(messageId: string): void;
124
140
  /**
125
141
  * Push-to-talk: transcribe a recording and send it as the next message.
126
142
  * Recording is the host's (no native module here); this uploads it.
127
143
  */
128
- sendVoice(recording: GuideAIVoiceRecording): Promise<GuideAIVoiceResult>;
144
+ sendVoice(recording: GuideAIVoiceRecording, options?: GuideAISendOptions): Promise<GuideAIVoiceResult>;
129
145
  /** True while a recording is being transcribed. */
130
146
  transcribing: boolean;
131
147
  }
@@ -245,7 +261,7 @@ interface UseLiveVoiceResult extends VoiceLanguageFields {
245
261
  * const live = useLiveVoice(chat);
246
262
  * <Button onPress={live.active ? live.stop : live.start} title={live.active ? 'End' : 'Talk'} />
247
263
  */
248
- declare function useLiveVoice(chat: Pick<UseGuideAIResult, 'sendVoice' | 'busy' | 'transcribing'>, options?: UseLiveVoiceOptions): UseLiveVoiceResult;
264
+ declare function useLiveVoice(chat: Pick<UseGuideAIResult, 'sendVoice' | 'busy' | 'transcribing'> & Partial<Pick<UseGuideAIResult, 'send' | 'messages' | 'confirm' | 'cancel'>>, options?: UseLiveVoiceOptions): UseLiveVoiceResult;
249
265
 
250
266
  /** The answer as plain words to say. */
251
267
  declare function toSpeakable(markdown: string): string;