@drakulavich/kesha-voice-kit 1.0.2 → 1.0.4

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.
@@ -0,0 +1,14 @@
1
+ // OpenClaw plugin entry stub for Kesha Voice Kit.
2
+ //
3
+ // The actual wiring lives in openclaw.plugin.json's configPatch, which
4
+ // installs `kesha --json {{MediaPath}}` under tools.media.audio. This
5
+ // file exists only to satisfy OpenClaw's requirement that native
6
+ // plugins declare at least one JavaScript extension in
7
+ // package.json#openclaw.extensions — Kesha has no hooks, tools, or
8
+ // services to register beyond the config patch itself.
9
+ export default {
10
+ id: "kesha-voice-kit",
11
+ register() {
12
+ // intentionally empty — see openclaw.plugin.json
13
+ },
14
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drakulavich/kesha-voice-kit",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Open-source voice toolkit for Apple Silicon. Speech-to-text, language detection. 25 languages.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -17,11 +17,20 @@
17
17
  "package.json",
18
18
  "tsconfig.json",
19
19
  "openclaw.plugin.json",
20
+ "openclaw-plugin.js",
20
21
  "SKILL.md",
21
22
  "scripts/postinstall.cjs",
22
23
  "LICENSE",
23
24
  "README.md"
24
25
  ],
26
+ "openclaw": {
27
+ "extensions": [
28
+ "./openclaw-plugin.js"
29
+ ]
30
+ },
31
+ "keshaEngine": {
32
+ "version": "1.0.2"
33
+ },
25
34
  "scripts": {
26
35
  "test": "bun test",
27
36
  "test:unit": "bun test tests/unit/",
@@ -1,12 +1,25 @@
1
1
  #!/usr/bin/env node
2
- const { execSync } = require("child_process");
2
+ // Warn if Bun is not on PATH. Uses fs-only probing instead of
3
+ // child_process.execSync("bun --version") so that OpenClaw's
4
+ // dangerous-code scanner does not flag the plugin install.
5
+ const fs = require("fs");
6
+ const path = require("path");
3
7
 
4
- try {
5
- execSync("bun --version", { stdio: "ignore" });
6
- } catch {
8
+ const exe = process.platform === "win32" ? "bun.exe" : "bun";
9
+ const dirs = (process.env.PATH || "").split(path.delimiter).filter(Boolean);
10
+
11
+ const found = dirs.some((dir) => {
12
+ try {
13
+ return fs.existsSync(path.join(dir, exe));
14
+ } catch {
15
+ return false;
16
+ }
17
+ });
18
+
19
+ if (!found) {
7
20
  console.warn(
8
21
  "\n⚠️ Kesha Voice Kit requires Bun runtime.\n" +
9
- " Install Bun: curl -fsSL https://bun.sh/install | bash\n" +
10
- " Then run: kesha install\n"
22
+ " Install Bun: curl -fsSL https://bun.sh/install | bash\n" +
23
+ " Then run: kesha install\n",
11
24
  );
12
25
  }
@@ -25,8 +25,16 @@ export async function downloadEngine(noCache = false, backend?: string): Promise
25
25
  } else {
26
26
  const binaryName = getEngineBinaryName();
27
27
  const pkg = await Bun.file(new URL("../package.json", import.meta.url)).json();
28
- const version = typeof pkg.version === "string" ? pkg.version : "unknown";
29
- const url = `https://github.com/${GITHUB_REPO}/releases/download/v${version}/${binaryName}`;
28
+ // The engine version is tracked separately from the CLI version so
29
+ // CLI-only patch releases don't require cutting a new GitHub release
30
+ // + Rust rebuild. Fall back to the CLI version for backwards compat.
31
+ const engineVersion =
32
+ typeof pkg.keshaEngine?.version === "string"
33
+ ? pkg.keshaEngine.version
34
+ : typeof pkg.version === "string"
35
+ ? pkg.version
36
+ : "unknown";
37
+ const url = `https://github.com/${GITHUB_REPO}/releases/download/v${engineVersion}/${binaryName}`;
30
38
 
31
39
  mkdirSync(dirname(binPath), { recursive: true });
32
40