@acpfx/tts-pocket 0.2.6 → 0.2.8

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/bin/tts-pocket ADDED
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env node
2
+
3
+ "use strict";
4
+
5
+ const { spawnSync } = require("child_process");
6
+ const { join } = require("path");
7
+ const { existsSync } = require("fs");
8
+
9
+ function getBinaryPath() {
10
+ if (process.env.TTS_POCKET_BINARY_PATH) {
11
+ return process.env.TTS_POCKET_BINARY_PATH;
12
+ }
13
+
14
+ const ext = process.platform === "win32" ? ".exe" : "";
15
+ const binName = `tts-pocket-${process.platform}-${process.arch}${ext}`;
16
+ const binPath = join(__dirname, binName);
17
+
18
+ if (!existsSync(binPath)) {
19
+ throw new Error(
20
+ `Could not find the tts-pocket binary for your platform (${process.platform} ${process.arch}).\n` +
21
+ `Expected: ${binPath}\n` +
22
+ `The postinstall script may have failed. Try reinstalling:\n` +
23
+ ` npm install @acpfx/tts-pocket\n` +
24
+ `Or set TTS_POCKET_BINARY_PATH to a local build.`
25
+ );
26
+ }
27
+
28
+ return binPath;
29
+ }
30
+
31
+ const binPath = getBinaryPath();
32
+ const { status } = spawnSync(binPath, process.argv.slice(2), {
33
+ stdio: "inherit",
34
+ });
35
+ process.exitCode = status !== null ? status : 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acpfx/tts-pocket",
3
- "version": "0.2.6",
3
+ "version": "0.2.8",
4
4
  "description": "Local TTS via Pocket TTS (on-device, Rust/Candle, CPU-capable)",
5
5
  "repository": {
6
6
  "type": "git",
Binary file