@lumavox/react 0.4.0 → 0.6.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 +3 -1
- package/dist/use-agent.js +9 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -61,7 +61,9 @@ redial.
|
|
|
61
61
|
| `conversation` | the `Conversation` itself |
|
|
62
62
|
|
|
63
63
|
Every `@lumavox/client` handler is an option (`onText`, `onDone`, …), and
|
|
64
|
-
`speech` and `thoughts
|
|
64
|
+
`speech` and `thoughts`; **`tools`**, the agent's app tools your app runs
|
|
65
|
+
— `{ open_page: ({ page }) => … }` — named when it connects, each call
|
|
66
|
+
running the latest render's handler. **`audio`**, an `AgentAudio` — a player and a
|
|
65
67
|
recorder — makes replies audible and `startRecording` work: replies play
|
|
66
68
|
as they arrive and stop on `cancel`, `mute` or a new message; recording
|
|
67
69
|
opens the microphone first and the recording at the rate it was granted.
|
package/dist/use-agent.js
CHANGED
|
@@ -33,6 +33,7 @@ const PASSED = [
|
|
|
33
33
|
"onChunk",
|
|
34
34
|
"onToolStart",
|
|
35
35
|
"onToolEnd",
|
|
36
|
+
"onToolConfirm",
|
|
36
37
|
"onUsage",
|
|
37
38
|
"onMuted",
|
|
38
39
|
"onAudioStart",
|
|
@@ -127,9 +128,17 @@ export function useAgent(target, options = {}) {
|
|
|
127
128
|
setSession(detail);
|
|
128
129
|
id = detail.id;
|
|
129
130
|
}
|
|
131
|
+
// The app's tools are named at connect; each call runs the latest
|
|
132
|
+
// render's handler.
|
|
133
|
+
const named = latest.current.tools;
|
|
134
|
+
const tools = named && {};
|
|
135
|
+
for (const name in named) {
|
|
136
|
+
tools[name] = (...args) => latest.current.tools?.[name]?.(...args);
|
|
137
|
+
}
|
|
130
138
|
made = client.connect(id, wire(), {
|
|
131
139
|
speech: latest.current.speech,
|
|
132
140
|
thoughts: latest.current.thoughts,
|
|
141
|
+
tools,
|
|
133
142
|
});
|
|
134
143
|
current.current = made;
|
|
135
144
|
opening.current = false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lumavox/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.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",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"typecheck": "tsc --noEmit && tsc --noEmit -p test"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@lumavox/client": "0.
|
|
32
|
+
"@lumavox/client": "0.6.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"react": ">=18"
|