@guideai/react-native 0.8.0 → 0.9.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 +19 -0
- package/dist/GuideAIChat-BFu10t6D.cjs +2794 -0
- package/dist/GuideAIChat-BFu10t6D.cjs.map +1 -0
- package/dist/GuideAIChat-BQQ8lUKs.js +2795 -0
- package/dist/GuideAIChat-BQQ8lUKs.js.map +1 -0
- package/dist/GuideAIChat-CNmEo5bZ.cjs +2794 -0
- package/dist/GuideAIChat-CNmEo5bZ.cjs.map +1 -0
- package/dist/GuideAIChat-SU0CVNby.js +2795 -0
- package/dist/GuideAIChat-SU0CVNby.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +61 -6
- package/dist/index.mjs +2 -2
- package/dist/ui.cjs +2 -2
- package/dist/ui.d.ts +11 -5
- package/dist/ui.mjs +3 -3
- package/dist/useConversations-C-OmzdeA.js +4300 -0
- package/dist/useConversations-C-OmzdeA.js.map +1 -0
- package/dist/useConversations-Chn_GKOz.cjs +4299 -0
- package/dist/useConversations-Chn_GKOz.cjs.map +1 -0
- package/dist/useConversations-Ckyqbxqi.cjs +4299 -0
- package/dist/useConversations-Ckyqbxqi.cjs.map +1 -0
- package/dist/useConversations-DzhYCIiY.js +4300 -0
- package/dist/useConversations-DzhYCIiY.js.map +1 -0
- package/dist/voice.cjs +2835 -19
- package/dist/voice.cjs.map +1 -1
- package/dist/voice.d.ts +12 -6
- package/dist/voice.mjs +2836 -20
- package/dist/voice.mjs.map +1 -1
- package/package.json +6 -2
package/dist/voice.d.ts
CHANGED
|
@@ -71,6 +71,11 @@ interface GuideAIVoiceResult {
|
|
|
71
71
|
* calls, the transport. That split is what lets the agent be upgraded
|
|
72
72
|
* underneath a host's UI without them changing a line.
|
|
73
73
|
*/
|
|
74
|
+
/** How `send` reports the answer while it is being written. */
|
|
75
|
+
interface GuideAISendOptions {
|
|
76
|
+
/** Each piece of the answer as it arrives. */
|
|
77
|
+
onDelta?(delta: string): void;
|
|
78
|
+
}
|
|
74
79
|
interface UseGuideAIResult {
|
|
75
80
|
/**
|
|
76
81
|
* The conversation so far, oldest first, ready to draw. An answer that
|
|
@@ -104,9 +109,10 @@ interface UseGuideAIResult {
|
|
|
104
109
|
* Send `input`, or an explicit string.
|
|
105
110
|
*
|
|
106
111
|
* Ignores empty text and calls made while a turn is in flight, so a
|
|
107
|
-
* host does not have to guard their send button.
|
|
112
|
+
* host does not have to guard their send button. `onDelta` hears the
|
|
113
|
+
* answer as it is written (live voice speaks it from there).
|
|
108
114
|
*/
|
|
109
|
-
send(question?: string): Promise<string | null>;
|
|
115
|
+
send(question?: string, options?: GuideAISendOptions): Promise<string | null>;
|
|
110
116
|
/** True from send() until the turn settles. Drives a disabled state. */
|
|
111
117
|
busy: boolean;
|
|
112
118
|
/** Whether `send()` would do anything right now. */
|
|
@@ -117,15 +123,15 @@ interface UseGuideAIResult {
|
|
|
117
123
|
retry(): Promise<void>;
|
|
118
124
|
/** Start a new conversation. The current one stays in the chat history (useConversations). */
|
|
119
125
|
clear(): void;
|
|
120
|
-
/** Approve the message's `pendingAction`; the agent carries it out. */
|
|
121
|
-
confirm(messageId: string): Promise<
|
|
126
|
+
/** Approve the message's `pendingAction`; the agent carries it out. Resolves with its reply. */
|
|
127
|
+
confirm(messageId: string): Promise<string | null>;
|
|
122
128
|
/** Decline the message's `pendingAction`. Nothing is changed. */
|
|
123
129
|
cancel(messageId: string): void;
|
|
124
130
|
/**
|
|
125
131
|
* Push-to-talk: transcribe a recording and send it as the next message.
|
|
126
132
|
* Recording is the host's (no native module here); this uploads it.
|
|
127
133
|
*/
|
|
128
|
-
sendVoice(recording: GuideAIVoiceRecording): Promise<GuideAIVoiceResult>;
|
|
134
|
+
sendVoice(recording: GuideAIVoiceRecording, options?: GuideAISendOptions): Promise<GuideAIVoiceResult>;
|
|
129
135
|
/** True while a recording is being transcribed. */
|
|
130
136
|
transcribing: boolean;
|
|
131
137
|
}
|
|
@@ -245,7 +251,7 @@ interface UseLiveVoiceResult extends VoiceLanguageFields {
|
|
|
245
251
|
* const live = useLiveVoice(chat);
|
|
246
252
|
* <Button onPress={live.active ? live.stop : live.start} title={live.active ? 'End' : 'Talk'} />
|
|
247
253
|
*/
|
|
248
|
-
declare function useLiveVoice(chat: Pick<UseGuideAIResult, 'sendVoice' | 'busy' | 'transcribing'
|
|
254
|
+
declare function useLiveVoice(chat: Pick<UseGuideAIResult, 'sendVoice' | 'busy' | 'transcribing'> & Partial<Pick<UseGuideAIResult, 'send' | 'messages' | 'confirm' | 'cancel'>>, options?: UseLiveVoiceOptions): UseLiveVoiceResult;
|
|
249
255
|
|
|
250
256
|
/** The answer as plain words to say. */
|
|
251
257
|
declare function toSpeakable(markdown: string): string;
|