@node-webrtc-rust/bindings 0.3.2 → 0.5.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 +6 -6
- package/index.d.ts +13 -0
- package/index.js +13 -35
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -77,12 +77,12 @@ Each platform package is a thin wrapper: its `"main"` field points directly at t
|
|
|
77
77
|
|
|
78
78
|
**When the binary might be missing after install:**
|
|
79
79
|
|
|
80
|
-
| Situation
|
|
81
|
-
|
|
|
82
|
-
| Normal install on a supported platform
|
|
83
|
-
| `npm install --omit=optional`
|
|
84
|
-
| Unsupported OS/arch
|
|
85
|
-
| Publish/version mismatch for the optional pkg | Install may succeed; `require()` fails at runtime
|
|
80
|
+
| Situation | Result |
|
|
81
|
+
| --------------------------------------------- | ----------------------------------------------------------------- |
|
|
82
|
+
| Normal install on a supported platform | Matching optional package is present |
|
|
83
|
+
| `npm install --omit=optional` | No platform package — runtime fails unless a local `.node` exists |
|
|
84
|
+
| Unsupported OS/arch | No matching optional package |
|
|
85
|
+
| Publish/version mismatch for the optional pkg | Install may succeed; `require()` fails at runtime |
|
|
86
86
|
|
|
87
87
|
### At runtime (`require('@node-webrtc-rust/bindings')`)
|
|
88
88
|
|
package/index.d.ts
CHANGED
|
@@ -119,6 +119,9 @@ export interface JsBargeInConfig {
|
|
|
119
119
|
enabled?: boolean
|
|
120
120
|
useVad?: boolean
|
|
121
121
|
flushTts?: boolean
|
|
122
|
+
requireSttPartial?: boolean
|
|
123
|
+
minSttPartialChars?: number
|
|
124
|
+
agentPlaybackGuardMs?: number
|
|
122
125
|
}
|
|
123
126
|
export const enum JsVadSampleRate {
|
|
124
127
|
Hz8000 = '8000',
|
|
@@ -136,6 +139,8 @@ export interface JsVadConfig {
|
|
|
136
139
|
gateStt?: boolean
|
|
137
140
|
gateSttOpenOnPending?: boolean
|
|
138
141
|
sttGateHoldMs?: number
|
|
142
|
+
sttListenTimeoutMs?: number
|
|
143
|
+
utteranceFinalizeTimeoutMs?: number
|
|
139
144
|
}
|
|
140
145
|
export const enum JsSttVendor {
|
|
141
146
|
Openai = 'openai',
|
|
@@ -180,6 +185,12 @@ export const enum JsSpeechEventType {
|
|
|
180
185
|
UserSpeechFinal = 'user_speech_final',
|
|
181
186
|
AgentSpeakingStart = 'agent_speaking_start',
|
|
182
187
|
AgentSpeakingEnd = 'agent_speaking_end',
|
|
188
|
+
VadTriggered = 'vad_triggered',
|
|
189
|
+
SttStreamStart = 'stt_stream_start',
|
|
190
|
+
SttStreamEnd = 'stt_stream_end',
|
|
191
|
+
UserSttStart = 'user_stt_start',
|
|
192
|
+
UserSttEnd = 'user_stt_end',
|
|
193
|
+
UserSttNotFound = 'user_stt_not_found',
|
|
183
194
|
BargeIn = 'barge_in',
|
|
184
195
|
Error = 'error'
|
|
185
196
|
}
|
|
@@ -343,6 +354,8 @@ export declare class JsVoiceAgent {
|
|
|
343
354
|
stop(): Promise<void>
|
|
344
355
|
sendTextToTts(text: string): Promise<void>
|
|
345
356
|
flushTts(): Promise<void>
|
|
357
|
+
/** Wait until outbound TTS playback finishes (synthesis queue drained and agent not speaking). */
|
|
358
|
+
waitTtsPlaybackIdle(): Promise<void>
|
|
346
359
|
/** Pull the next speech event for async stream consumption. */
|
|
347
360
|
pullSpeechEvent(): Promise<JsSpeechEvent | null>
|
|
348
361
|
setOnSpeechEvent(callback: (...args: any[]) => any): void
|
package/index.js
CHANGED
|
@@ -62,9 +62,7 @@ switch (platform) {
|
|
|
62
62
|
case 'win32':
|
|
63
63
|
switch (arch) {
|
|
64
64
|
case 'x64':
|
|
65
|
-
localFileExisted = existsSync(
|
|
66
|
-
join(__dirname, 'node-webrtc-rust.win32-x64-msvc.node')
|
|
67
|
-
)
|
|
65
|
+
localFileExisted = existsSync(join(__dirname, 'node-webrtc-rust.win32-x64-msvc.node'))
|
|
68
66
|
try {
|
|
69
67
|
if (localFileExisted) {
|
|
70
68
|
nativeBinding = require('./node-webrtc-rust.win32-x64-msvc.node')
|
|
@@ -76,9 +74,7 @@ switch (platform) {
|
|
|
76
74
|
}
|
|
77
75
|
break
|
|
78
76
|
case 'ia32':
|
|
79
|
-
localFileExisted = existsSync(
|
|
80
|
-
join(__dirname, 'node-webrtc-rust.win32-ia32-msvc.node')
|
|
81
|
-
)
|
|
77
|
+
localFileExisted = existsSync(join(__dirname, 'node-webrtc-rust.win32-ia32-msvc.node'))
|
|
82
78
|
try {
|
|
83
79
|
if (localFileExisted) {
|
|
84
80
|
nativeBinding = require('./node-webrtc-rust.win32-ia32-msvc.node')
|
|
@@ -90,9 +86,7 @@ switch (platform) {
|
|
|
90
86
|
}
|
|
91
87
|
break
|
|
92
88
|
case 'arm64':
|
|
93
|
-
localFileExisted = existsSync(
|
|
94
|
-
join(__dirname, 'node-webrtc-rust.win32-arm64-msvc.node')
|
|
95
|
-
)
|
|
89
|
+
localFileExisted = existsSync(join(__dirname, 'node-webrtc-rust.win32-arm64-msvc.node'))
|
|
96
90
|
try {
|
|
97
91
|
if (localFileExisted) {
|
|
98
92
|
nativeBinding = require('./node-webrtc-rust.win32-arm64-msvc.node')
|
|
@@ -131,9 +125,7 @@ switch (platform) {
|
|
|
131
125
|
}
|
|
132
126
|
break
|
|
133
127
|
case 'arm64':
|
|
134
|
-
localFileExisted = existsSync(
|
|
135
|
-
join(__dirname, 'node-webrtc-rust.darwin-arm64.node')
|
|
136
|
-
)
|
|
128
|
+
localFileExisted = existsSync(join(__dirname, 'node-webrtc-rust.darwin-arm64.node'))
|
|
137
129
|
try {
|
|
138
130
|
if (localFileExisted) {
|
|
139
131
|
nativeBinding = require('./node-webrtc-rust.darwin-arm64.node')
|
|
@@ -167,9 +159,7 @@ switch (platform) {
|
|
|
167
159
|
switch (arch) {
|
|
168
160
|
case 'x64':
|
|
169
161
|
if (isMusl()) {
|
|
170
|
-
localFileExisted = existsSync(
|
|
171
|
-
join(__dirname, 'node-webrtc-rust.linux-x64-musl.node')
|
|
172
|
-
)
|
|
162
|
+
localFileExisted = existsSync(join(__dirname, 'node-webrtc-rust.linux-x64-musl.node'))
|
|
173
163
|
try {
|
|
174
164
|
if (localFileExisted) {
|
|
175
165
|
nativeBinding = require('./node-webrtc-rust.linux-x64-musl.node')
|
|
@@ -180,9 +170,7 @@ switch (platform) {
|
|
|
180
170
|
loadError = e
|
|
181
171
|
}
|
|
182
172
|
} else {
|
|
183
|
-
localFileExisted = existsSync(
|
|
184
|
-
join(__dirname, 'node-webrtc-rust.linux-x64-gnu.node')
|
|
185
|
-
)
|
|
173
|
+
localFileExisted = existsSync(join(__dirname, 'node-webrtc-rust.linux-x64-gnu.node'))
|
|
186
174
|
try {
|
|
187
175
|
if (localFileExisted) {
|
|
188
176
|
nativeBinding = require('./node-webrtc-rust.linux-x64-gnu.node')
|
|
@@ -196,9 +184,7 @@ switch (platform) {
|
|
|
196
184
|
break
|
|
197
185
|
case 'arm64':
|
|
198
186
|
if (isMusl()) {
|
|
199
|
-
localFileExisted = existsSync(
|
|
200
|
-
join(__dirname, 'node-webrtc-rust.linux-arm64-musl.node')
|
|
201
|
-
)
|
|
187
|
+
localFileExisted = existsSync(join(__dirname, 'node-webrtc-rust.linux-arm64-musl.node'))
|
|
202
188
|
try {
|
|
203
189
|
if (localFileExisted) {
|
|
204
190
|
nativeBinding = require('./node-webrtc-rust.linux-arm64-musl.node')
|
|
@@ -209,9 +195,7 @@ switch (platform) {
|
|
|
209
195
|
loadError = e
|
|
210
196
|
}
|
|
211
197
|
} else {
|
|
212
|
-
localFileExisted = existsSync(
|
|
213
|
-
join(__dirname, 'node-webrtc-rust.linux-arm64-gnu.node')
|
|
214
|
-
)
|
|
198
|
+
localFileExisted = existsSync(join(__dirname, 'node-webrtc-rust.linux-arm64-gnu.node'))
|
|
215
199
|
try {
|
|
216
200
|
if (localFileExisted) {
|
|
217
201
|
nativeBinding = require('./node-webrtc-rust.linux-arm64-gnu.node')
|
|
@@ -226,7 +210,7 @@ switch (platform) {
|
|
|
226
210
|
case 'arm':
|
|
227
211
|
if (isMusl()) {
|
|
228
212
|
localFileExisted = existsSync(
|
|
229
|
-
join(__dirname, 'node-webrtc-rust.linux-arm-musleabihf.node')
|
|
213
|
+
join(__dirname, 'node-webrtc-rust.linux-arm-musleabihf.node'),
|
|
230
214
|
)
|
|
231
215
|
try {
|
|
232
216
|
if (localFileExisted) {
|
|
@@ -239,7 +223,7 @@ switch (platform) {
|
|
|
239
223
|
}
|
|
240
224
|
} else {
|
|
241
225
|
localFileExisted = existsSync(
|
|
242
|
-
join(__dirname, 'node-webrtc-rust.linux-arm-gnueabihf.node')
|
|
226
|
+
join(__dirname, 'node-webrtc-rust.linux-arm-gnueabihf.node'),
|
|
243
227
|
)
|
|
244
228
|
try {
|
|
245
229
|
if (localFileExisted) {
|
|
@@ -254,9 +238,7 @@ switch (platform) {
|
|
|
254
238
|
break
|
|
255
239
|
case 'riscv64':
|
|
256
240
|
if (isMusl()) {
|
|
257
|
-
localFileExisted = existsSync(
|
|
258
|
-
join(__dirname, 'node-webrtc-rust.linux-riscv64-musl.node')
|
|
259
|
-
)
|
|
241
|
+
localFileExisted = existsSync(join(__dirname, 'node-webrtc-rust.linux-riscv64-musl.node'))
|
|
260
242
|
try {
|
|
261
243
|
if (localFileExisted) {
|
|
262
244
|
nativeBinding = require('./node-webrtc-rust.linux-riscv64-musl.node')
|
|
@@ -267,9 +249,7 @@ switch (platform) {
|
|
|
267
249
|
loadError = e
|
|
268
250
|
}
|
|
269
251
|
} else {
|
|
270
|
-
localFileExisted = existsSync(
|
|
271
|
-
join(__dirname, 'node-webrtc-rust.linux-riscv64-gnu.node')
|
|
272
|
-
)
|
|
252
|
+
localFileExisted = existsSync(join(__dirname, 'node-webrtc-rust.linux-riscv64-gnu.node'))
|
|
273
253
|
try {
|
|
274
254
|
if (localFileExisted) {
|
|
275
255
|
nativeBinding = require('./node-webrtc-rust.linux-riscv64-gnu.node')
|
|
@@ -282,9 +262,7 @@ switch (platform) {
|
|
|
282
262
|
}
|
|
283
263
|
break
|
|
284
264
|
case 's390x':
|
|
285
|
-
localFileExisted = existsSync(
|
|
286
|
-
join(__dirname, 'node-webrtc-rust.linux-s390x-gnu.node')
|
|
287
|
-
)
|
|
265
|
+
localFileExisted = existsSync(join(__dirname, 'node-webrtc-rust.linux-s390x-gnu.node'))
|
|
288
266
|
try {
|
|
289
267
|
if (localFileExisted) {
|
|
290
268
|
nativeBinding = require('./node-webrtc-rust.linux-s390x-gnu.node')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node-webrtc-rust/bindings",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "NAPI-RS native bindings for node-webrtc-rust — WebRTC peer connections, data channels, and conference audio mixing",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webrtc",
|
|
@@ -58,12 +58,12 @@
|
|
|
58
58
|
"@napi-rs/cli": "^2.18.0"
|
|
59
59
|
},
|
|
60
60
|
"optionalDependencies": {
|
|
61
|
-
"@node-webrtc-rust/bindings-win32-x64-msvc": "0.
|
|
62
|
-
"@node-webrtc-rust/bindings-darwin-x64": "0.
|
|
63
|
-
"@node-webrtc-rust/bindings-linux-x64-gnu": "0.
|
|
64
|
-
"@node-webrtc-rust/bindings-darwin-arm64": "0.
|
|
65
|
-
"@node-webrtc-rust/bindings-linux-arm64-gnu": "0.
|
|
66
|
-
"@node-webrtc-rust/bindings-linux-x64-musl": "0.
|
|
61
|
+
"@node-webrtc-rust/bindings-win32-x64-msvc": "0.5.0",
|
|
62
|
+
"@node-webrtc-rust/bindings-darwin-x64": "0.5.0",
|
|
63
|
+
"@node-webrtc-rust/bindings-linux-x64-gnu": "0.5.0",
|
|
64
|
+
"@node-webrtc-rust/bindings-darwin-arm64": "0.5.0",
|
|
65
|
+
"@node-webrtc-rust/bindings-linux-arm64-gnu": "0.5.0",
|
|
66
|
+
"@node-webrtc-rust/bindings-linux-x64-musl": "0.5.0"
|
|
67
67
|
},
|
|
68
68
|
"engines": {
|
|
69
69
|
"node": ">=18"
|