openutau-mcp 0.2.0 → 0.2.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.
Files changed (2) hide show
  1. package/bin.js +23 -3
  2. package/package.json +6 -6
package/bin.js CHANGED
@@ -12,7 +12,7 @@ import * as path from "node:path";
12
12
  import { createRequire } from "node:module";
13
13
  import { fileURLToPath } from "node:url";
14
14
 
15
- const VERSION = "0.2.0";
15
+ const VERSION = "0.2.1";
16
16
  const PKG_DIR = path.dirname(fileURLToPath(import.meta.url));
17
17
  const require = createRequire(import.meta.url);
18
18
 
@@ -121,9 +121,25 @@ async function ensureEngine() {
121
121
  log(`engine ready`);
122
122
  }
123
123
 
124
+ // Portable mode: with OPENUTAU_MCP_HOME set, everything (engine extraction,
125
+ // voicebanks, prefs, logs, render cache) lives under that one directory. The
126
+ // engine's OpenUtau.Core already derives its data/cache paths from XDG_DATA_HOME
127
+ // / XDG_CACHE_HOME on Linux, so the launcher points those at the portable root.
128
+ function childEnv() {
129
+ const env = { ...process.env };
130
+ if (process.env.OPENUTAU_MCP_HOME && process.platform === "linux") {
131
+ env.XDG_DATA_HOME = path.join(process.env.OPENUTAU_MCP_HOME, "data");
132
+ env.XDG_CACHE_HOME = path.join(process.env.OPENUTAU_MCP_HOME, "cache");
133
+ }
134
+ return env;
135
+ }
136
+
124
137
  function warnNoVoicebanks() {
138
+ const portable = process.env.OPENUTAU_MCP_HOME && process.platform === "linux";
125
139
  let singers;
126
- if (process.platform === "linux") {
140
+ if (portable) {
141
+ singers = path.join(process.env.OPENUTAU_MCP_HOME, "data", "OpenUtau", "Singers");
142
+ } else if (process.platform === "linux") {
127
143
  singers = path.join(process.env.XDG_DATA_HOME || path.join(homedir(), ".local", "share"), "OpenUtau", "Singers");
128
144
  } else if (process.platform === "darwin") {
129
145
  singers = path.join(homedir(), "Library", "OpenUtau", "Singers");
@@ -139,7 +155,11 @@ function warnNoVoicebanks() {
139
155
  await ensureEngine();
140
156
  warnNoVoicebanks();
141
157
 
142
- const child = spawn(EXE, [], { cwd: CACHE, stdio: "inherit" });
158
+ const child = spawn(EXE, [], {
159
+ cwd: process.env.OPENUTAU_MCP_HOME || CACHE,
160
+ env: childEnv(),
161
+ stdio: "inherit",
162
+ });
143
163
  for (const sig of ["SIGINT", "SIGTERM", "SIGHUP"]) {
144
164
  process.on(sig, () => child.kill("SIGTERM"));
145
165
  }
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "openutau-mcp",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "MCP server for AI singing: create/edit .ustx projects and render WAV with OpenUtau engine (no GUI needed)",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "openutau-mcp": "./bin.js"
8
8
  },
9
9
  "optionalDependencies": {
10
- "openutau-mcp-linux-x64": "0.2.0",
11
- "openutau-mcp-linux-arm64": "0.2.0",
12
- "openutau-mcp-win-x64": "0.2.0",
13
- "openutau-mcp-win-arm64": "0.2.0",
14
- "openutau-mcp-darwin-arm64": "0.2.0"
10
+ "openutau-mcp-linux-x64": "0.2.1",
11
+ "openutau-mcp-linux-arm64": "0.2.1",
12
+ "openutau-mcp-win-x64": "0.2.1",
13
+ "openutau-mcp-win-arm64": "0.2.1",
14
+ "openutau-mcp-darwin-arm64": "0.2.1"
15
15
  },
16
16
  "engines": {
17
17
  "node": ">=18"