speechflow 1.0.0 → 1.1.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/CHANGELOG.md +8 -0
- package/README.md +9 -8
- package/dst/speechflow-node-a2a-meter.js +5 -1
- package/dst/speechflow-node-a2a-meter.js.map +1 -1
- package/dst/speechflow-node-a2t-deepgram.d.ts +3 -0
- package/dst/speechflow-node-a2t-deepgram.js +16 -1
- package/dst/speechflow-node-a2t-deepgram.js.map +1 -1
- package/dst/speechflow-node-t2a-elevenlabs.d.ts +3 -0
- package/dst/speechflow-node-t2a-elevenlabs.js +8 -1
- package/dst/speechflow-node-t2a-elevenlabs.js.map +1 -1
- package/dst/speechflow-node-t2t-deepl.d.ts +3 -0
- package/dst/speechflow-node-t2t-deepl.js +8 -1
- package/dst/speechflow-node-t2t-deepl.js.map +1 -1
- package/dst/speechflow-node-t2t-openai.js +1 -1
- package/dst/speechflow-node-x2x-trace.js +1 -1
- package/dst/speechflow-node-x2x-trace.js.map +1 -1
- package/dst/speechflow-node-xio-device.js +3 -1
- package/dst/speechflow-node-xio-device.js.map +1 -1
- package/dst/speechflow-node-xio-file.js +3 -1
- package/dst/speechflow-node-xio-file.js.map +1 -1
- package/dst/speechflow-node-xio-mqtt.js +7 -5
- package/dst/speechflow-node-xio-mqtt.js.map +1 -1
- package/dst/speechflow-node-xio-websocket.js +5 -5
- package/dst/speechflow-node-xio-websocket.js.map +1 -1
- package/dst/speechflow-node.d.ts +5 -1
- package/dst/speechflow-node.js +8 -2
- package/dst/speechflow-node.js.map +1 -1
- package/dst/speechflow.js +50 -10
- package/dst/speechflow.js.map +1 -1
- package/etc/speechflow.yaml +4 -4
- package/package.json +10 -9
- package/src/speechflow-node-a2a-meter.ts +5 -1
- package/src/speechflow-node-a2t-deepgram.ts +17 -1
- package/src/speechflow-node-t2a-elevenlabs.ts +9 -1
- package/src/speechflow-node-t2t-deepl.ts +9 -1
- package/src/speechflow-node-t2t-openai.ts +1 -1
- package/src/speechflow-node-x2x-trace.ts +1 -1
- package/src/speechflow-node-xio-device.ts +4 -1
- package/src/speechflow-node-xio-file.ts +3 -1
- package/src/speechflow-node-xio-mqtt.ts +8 -6
- package/src/speechflow-node-xio-websocket.ts +6 -6
- package/src/speechflow-node.ts +9 -2
- package/src/speechflow.ts +52 -10
package/src/speechflow.ts
CHANGED
|
@@ -26,6 +26,8 @@ import installedPackages from "installed-packages"
|
|
|
26
26
|
import dotenvx from "@dotenvx/dotenvx"
|
|
27
27
|
import syspath from "syspath"
|
|
28
28
|
import * as arktype from "arktype"
|
|
29
|
+
import Table from "cli-table3"
|
|
30
|
+
import chalk from "chalk"
|
|
29
31
|
|
|
30
32
|
/* internal dependencies */
|
|
31
33
|
import SpeechFlowNode from "./speechflow-node"
|
|
@@ -63,11 +65,13 @@ type wsPeerInfo = {
|
|
|
63
65
|
"[-a|--address <ip-address>] " +
|
|
64
66
|
"[-p|--port <tcp-port>] " +
|
|
65
67
|
"[-C|--cache <directory>] " +
|
|
68
|
+
"[-S|--status] " +
|
|
66
69
|
"[-e|--expression <expression>] " +
|
|
67
70
|
"[-f|--file <file>] " +
|
|
68
71
|
"[-c|--config <id>@<yaml-config-file>] " +
|
|
69
72
|
"[<argument> [...]]"
|
|
70
73
|
)
|
|
74
|
+
.version(false)
|
|
71
75
|
.option("V", {
|
|
72
76
|
alias: "version",
|
|
73
77
|
type: "boolean",
|
|
@@ -112,6 +116,14 @@ type wsPeerInfo = {
|
|
|
112
116
|
default: path.join(dataDir, "cache"),
|
|
113
117
|
describe: "directory for cached files (primarily AI model files)"
|
|
114
118
|
})
|
|
119
|
+
.option("S", {
|
|
120
|
+
alias: "status",
|
|
121
|
+
type: "boolean",
|
|
122
|
+
array: false,
|
|
123
|
+
coerce,
|
|
124
|
+
default: false,
|
|
125
|
+
describe: "show one-time status of nodes"
|
|
126
|
+
})
|
|
115
127
|
.option("e", {
|
|
116
128
|
alias: "expression",
|
|
117
129
|
type: "string",
|
|
@@ -142,7 +154,6 @@ type wsPeerInfo = {
|
|
|
142
154
|
.help("h", "show usage help")
|
|
143
155
|
.alias("h", "help")
|
|
144
156
|
.showHelpOnFail(true)
|
|
145
|
-
.version(false)
|
|
146
157
|
.strict()
|
|
147
158
|
.demand(0)
|
|
148
159
|
.parse(hideBin(process.argv))
|
|
@@ -268,6 +279,45 @@ type wsPeerInfo = {
|
|
|
268
279
|
}
|
|
269
280
|
}
|
|
270
281
|
|
|
282
|
+
/* static configuration */
|
|
283
|
+
const cfg = {
|
|
284
|
+
audioChannels: 1,
|
|
285
|
+
audioBitDepth: 16,
|
|
286
|
+
audioLittleEndian: true,
|
|
287
|
+
audioSampleRate: 48000,
|
|
288
|
+
textEncoding: "utf8",
|
|
289
|
+
cacheDir: args.C
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/* handle one-time status query of nodes */
|
|
293
|
+
if (args.S) {
|
|
294
|
+
const table = new Table({
|
|
295
|
+
head: [
|
|
296
|
+
chalk.reset.bold("NODE"),
|
|
297
|
+
chalk.reset.bold("PROPERTY"),
|
|
298
|
+
chalk.reset.bold("VALUE")
|
|
299
|
+
],
|
|
300
|
+
colWidths: [ 15, 15, 50 - (2 * 2 + 2 * 3) ],
|
|
301
|
+
style: { "padding-left": 1, "padding-right": 1, border: [ "grey" ], compact: true },
|
|
302
|
+
chars: { "left-mid": "", mid: "", "mid-mid": "", "right-mid": "" }
|
|
303
|
+
})
|
|
304
|
+
for (const name of Object.keys(nodes)) {
|
|
305
|
+
cli!.log("info", `gathering status of node <${name}>`)
|
|
306
|
+
const node = new nodes[name](name, cfg, {}, [])
|
|
307
|
+
const status = await node.status()
|
|
308
|
+
if (Object.keys(status).length > 0) {
|
|
309
|
+
let first = true
|
|
310
|
+
for (const key of Object.keys(status)) {
|
|
311
|
+
table.push([ first ? chalk.bold(name) : "", key, chalk.blue(status[key]) ])
|
|
312
|
+
first = false
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
const output = table.toString()
|
|
317
|
+
process.stdout.write(output + "\n")
|
|
318
|
+
process.exit(0)
|
|
319
|
+
}
|
|
320
|
+
|
|
271
321
|
/* graph processing: PASS 1: parse DSL and create and connect nodes */
|
|
272
322
|
const flowlink = new FlowLink<SpeechFlowNode>({
|
|
273
323
|
trace: (msg: string) => {
|
|
@@ -277,14 +327,6 @@ type wsPeerInfo = {
|
|
|
277
327
|
const variables = { argv: args._, env: process.env }
|
|
278
328
|
const graphNodes = new Set<SpeechFlowNode>()
|
|
279
329
|
const nodeNums = new Map<typeof SpeechFlowNode, number>()
|
|
280
|
-
const cfg = {
|
|
281
|
-
audioChannels: 1,
|
|
282
|
-
audioBitDepth: 16,
|
|
283
|
-
audioLittleEndian: true,
|
|
284
|
-
audioSampleRate: 48000,
|
|
285
|
-
textEncoding: "utf8",
|
|
286
|
-
cacheDir: args.C
|
|
287
|
-
}
|
|
288
330
|
let ast: unknown
|
|
289
331
|
try {
|
|
290
332
|
ast = flowlink.compile(config)
|
|
@@ -678,7 +720,7 @@ type wsPeerInfo = {
|
|
|
678
720
|
if (cli !== null)
|
|
679
721
|
cli.log("error", err.message)
|
|
680
722
|
else
|
|
681
|
-
process.stderr.write(`${pkg.name}: ERROR: ${err.message}\n`)
|
|
723
|
+
process.stderr.write(`${pkg.name}: ${chalk.red("ERROR")}: ${err.message} ${err.stack}\n`)
|
|
682
724
|
process.exit(1)
|
|
683
725
|
})
|
|
684
726
|
|