@lumavox/react 0.35.2 → 0.37.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 +2 -2
- package/dist/use-agent.d.ts +6 -0
- package/dist/use-agent.js +8 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -59,10 +59,10 @@ redial.
|
|
|
59
59
|
| `error` | `{ kind, message }`: the session, an `error` frame, the close, the microphone — with its cause beside it (`error`, `frame` or `close`) |
|
|
60
60
|
| `speaking` `recording` | the adapter is playing; the recorder is open |
|
|
61
61
|
| `interrupted` | the device has the audio — a call, Siri, another app |
|
|
62
|
-
| `send` `note` `startAudio` `sendAudio` `endAudio` `cancel` `mute` `reconnect` `end` `close` | the conversation's — `end` has its report written, then closes |
|
|
62
|
+
| `send` `note` `confirmTool` `startAudio` `sendAudio` `endAudio` `cancel` `mute` `reconnect` `end` `close` | the conversation's — `confirmTool(callId, yes)` answers a tool that asked first; `end` has its report written, then closes |
|
|
63
63
|
| `setVolume(level)` | how loud the agent's voice plays, 0 to 1: `audio`'s own, for a slider |
|
|
64
64
|
| `startRecording({ rate, transcribeOnly, speech, thoughts })` `stopRecording({ transcribeOnly, discard })` | through the `audio` adapter; a held turn's own voice and thinking, as `send`'s |
|
|
65
|
-
| `listen(options)` `stopListening()` `listening` `hearing` | hands-free: each utterance a turn, talking over the agent stopping it (`@lumavox/client`'s `listen`); `listen({ halfDuplex: true })` where echo cannot be cancelled — nothing heard while the agent speaks |
|
|
65
|
+
| `listen(options)` `stopListening()` `listening` `hearing` | hands-free: each utterance a turn, talking over the agent stopping it (`@lumavox/client`'s `listen`); `listen({ halfDuplex: true })` where echo cannot be cancelled — nothing heard while the agent speaks; `listen({ context })` sends your app's context with every utterance |
|
|
66
66
|
| `newSession()` | a new conversation with the same agent |
|
|
67
67
|
| `conversation` | the `Conversation` itself |
|
|
68
68
|
|
package/dist/use-agent.d.ts
CHANGED
|
@@ -132,6 +132,12 @@ export interface AgentControls extends Snapshot {
|
|
|
132
132
|
note(text: string, options?: {
|
|
133
133
|
reply?: boolean;
|
|
134
134
|
}): boolean;
|
|
135
|
+
/**
|
|
136
|
+
* Answer a `tool.confirm` (`onToolConfirm`) with the person's tap, as
|
|
137
|
+
* `Conversation.confirmTool`: a turn of theirs, which runs the tool
|
|
138
|
+
* first on a yes. With no conversation open it answers as a `send` would.
|
|
139
|
+
*/
|
|
140
|
+
confirmTool(callId: string, yes: boolean, options?: TurnOptions): Promise<TurnOutcome>;
|
|
135
141
|
startAudio(options: StartAudioOptions): string | null;
|
|
136
142
|
sendAudio(pcm: ArrayBuffer | Int16Array): boolean;
|
|
137
143
|
endAudio: Conversation["endAudio"];
|
package/dist/use-agent.js
CHANGED
|
@@ -396,6 +396,14 @@ export function useAgent(target, options = {}) {
|
|
|
396
396
|
},
|
|
397
397
|
startAudio: (start) => current.current?.startAudio(start) ?? null,
|
|
398
398
|
note: (text, noteOptions) => current.current?.note(text, noteOptions) ?? false,
|
|
399
|
+
confirmTool(callId, yes, turn) {
|
|
400
|
+
// The person's turn, as a `send`: what the agent is still saying
|
|
401
|
+
// of its question stops. A call belongs to the conversation that
|
|
402
|
+
// asked, so none is waited for.
|
|
403
|
+
hush();
|
|
404
|
+
return (current.current?.confirmTool(callId, yes, turnNow(turn)) ??
|
|
405
|
+
Promise.resolve(notOpen));
|
|
406
|
+
},
|
|
399
407
|
sendAudio: (pcm) => current.current?.sendAudio(pcm) ?? false,
|
|
400
408
|
endAudio: ((end) => current.current
|
|
401
409
|
? current.current.endAudio(end)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lumavox/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.0",
|
|
4
4
|
"description": "React and React Native hooks for Lumavox agents: a conversation that keeps itself connected, sessions, memory and relations, over @lumavox/client.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"typecheck": "tsc --noEmit && tsc --noEmit -p test"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@lumavox/client": "0.
|
|
45
|
+
"@lumavox/client": "0.37.0",
|
|
46
46
|
"react": ">=18"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@biomejs/biome": "2.6.4",
|
|
50
|
-
"@lumavox/client": "0.
|
|
50
|
+
"@lumavox/client": "0.37.0",
|
|
51
51
|
"@testing-library/react": "^16.3.3",
|
|
52
52
|
"@types/node": "^24",
|
|
53
53
|
"@types/react": "^19",
|