@goodandready/dsh-tts 0.3.23 → 0.4.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-tts",
3
- "version": "0.3.23",
3
+ "version": "0.4.1",
4
4
  "description": "Text-to-speech for DeepSeek Harness: speak agent replies in the Web UI with a provider fallback chain (OpenAI, ElevenLabs, Google, Azure, Groq, Deepgram, OpenRouter, Edge, Piper, eSpeak).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -13,9 +13,12 @@
13
13
  },
14
14
  "files": [
15
15
  "lib/",
16
+ "scripts/",
16
17
  "cordis.patch.yml",
17
18
  "README.md",
18
- "LICENSE"
19
+ "LICENSE",
20
+ "README.ru.md",
21
+ "README.zh.md"
19
22
  ],
20
23
  "keywords": [
21
24
  "dsh",
@@ -38,7 +41,9 @@
38
41
  "url": "https://github.com/GooDAnDReaDY/dsh-tts/issues"
39
42
  },
40
43
  "scripts": {
41
- "test": "node --test test/*.test.mjs"
44
+ "test": "node --test test/*.test.mjs",
45
+ "build:client": "node scripts/build-client.mjs",
46
+ "pretest": "node scripts/build-client.mjs"
42
47
  },
43
48
  "dsh": {
44
49
  "bundle": {
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env node
2
+ // Concatenate lib/client-src fragments into lib/client.js (single ModuleLoader entry).
3
+ import { readdir, readFile, writeFile } from 'node:fs/promises'
4
+ import path from 'node:path'
5
+ import { fileURLToPath } from 'node:url'
6
+
7
+ const root = path.dirname(path.dirname(fileURLToPath(import.meta.url)))
8
+ const srcDir = path.join(root, 'lib', 'client-src')
9
+ const outFile = path.join(root, 'lib', 'client.js')
10
+
11
+ const files = (await readdir(srcDir)).filter((f) => f.endsWith('.js')).sort()
12
+ if (files.length === 0) throw new Error('no client-src fragments')
13
+ let out = ''
14
+ for (const f of files) {
15
+ out += await readFile(path.join(srcDir, f), 'utf8')
16
+ if (!out.endsWith('\n')) out += '\n'
17
+ }
18
+ await writeFile(outFile, out, 'utf8')
19
+ console.log(`built lib/client.js from ${files.length} fragments (${out.length} bytes)`)
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env python3
2
+ """F5-TTS control stub.
3
+
4
+ Honest status only: ping answers when this script can run. It does not
5
+ synthesize audio. Real F5 inference is out of scope for this package until a
6
+ supported external runtime is documented and wired.
7
+ """
8
+ import sys
9
+ import json
10
+
11
+
12
+ def main():
13
+ if len(sys.argv) > 1 and sys.argv[1] == '--ping':
14
+ print(json.dumps({"ok": True, "status": "ready", "synthesize": False}))
15
+ sys.exit(0)
16
+
17
+ for line in sys.stdin:
18
+ line = line.strip()
19
+ if not line:
20
+ continue
21
+ try:
22
+ req = json.loads(line)
23
+ cmd = req.get("cmd")
24
+ if cmd == "ping":
25
+ print(json.dumps({"ok": True, "status": "pong", "synthesize": False}))
26
+ elif cmd == "synthesize":
27
+ print(json.dumps({
28
+ "ok": False,
29
+ "error": "F5 synthesis is not bundled; use Edge/Piper/eSpeak offline providers",
30
+ }))
31
+ else:
32
+ print(json.dumps({"ok": False, "error": f"unknown cmd: {cmd}"}))
33
+ sys.stdout.flush()
34
+ except Exception as e:
35
+ print(json.dumps({"ok": False, "error": str(e)}))
36
+ sys.stdout.flush()
37
+
38
+
39
+ if __name__ == "__main__":
40
+ main()