@love-moon/conductor-cli 0.2.29 → 0.2.30

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@love-moon/conductor-cli",
3
- "version": "0.2.29",
4
- "gitCommitId": "56ce873",
3
+ "version": "0.2.30",
4
+ "gitCommitId": "e6a71ad",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "conductor": "bin/conductor.js"
@@ -18,8 +18,8 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@love-moon/ai-bridge": "0.1.4",
21
- "@love-moon/ai-sdk": "0.2.29",
22
- "@love-moon/conductor-sdk": "0.2.29",
21
+ "@love-moon/ai-sdk": "0.2.30",
22
+ "@love-moon/conductor-sdk": "0.2.30",
23
23
  "chrome-launcher": "^1.2.1",
24
24
  "chrome-remote-interface": "^0.33.0",
25
25
  "dotenv": "^16.4.5",
package/src/daemon.js CHANGED
@@ -1174,13 +1174,18 @@ export function startDaemon(config = {}, deps = {}) {
1174
1174
  });
1175
1175
  }
1176
1176
 
1177
- function runCommand(command, args, timeoutMs = 120_000) {
1177
+ function runCommand(command, args, options = 120_000) {
1178
1178
  return new Promise((resolve) => {
1179
1179
  let stdout = "";
1180
1180
  let stderr = "";
1181
+ const normalizedOptions =
1182
+ typeof options === "number"
1183
+ ? { timeoutMs: options }
1184
+ : (options || {});
1181
1185
  const child = spawnFn(command, args, {
1182
1186
  stdio: ["ignore", "pipe", "pipe"],
1183
- env: { ...process.env },
1187
+ env: normalizedOptions.env || { ...process.env },
1188
+ cwd: normalizedOptions.cwd || process.cwd(),
1184
1189
  });
1185
1190
  const timer = setTimeout(() => {
1186
1191
  try {
@@ -1188,7 +1193,7 @@ export function startDaemon(config = {}, deps = {}) {
1188
1193
  } catch {
1189
1194
  /* ignore */
1190
1195
  }
1191
- }, timeoutMs);
1196
+ }, normalizedOptions.timeoutMs ?? 120_000);
1192
1197
  child.stdout?.on("data", (chunk) => {
1193
1198
  if (stdout.length < 4000) stdout += chunk.toString().slice(0, 2000);
1194
1199
  });
@@ -1207,11 +1212,7 @@ export function startDaemon(config = {}, deps = {}) {
1207
1212
  }
1208
1213
 
1209
1214
  function runBufferedCommand(command, args, options = {}) {
1210
- return runCommand(
1211
- command,
1212
- args,
1213
- typeof options === "number" ? options : options?.timeoutMs ?? 120_000,
1214
- );
1215
+ return runCommand(command, args, options);
1215
1216
  }
1216
1217
 
1217
1218
  async function readInstalledCliVersion() {
@@ -315,8 +315,16 @@ export async function repairAndVerifyGlobalNodePty({
315
315
  await ensurePnpmOnlyBuiltDependencies({ runCommand, dependencies, global: true });
316
316
  }
317
317
 
318
+ const packageDirectory = await resolveGlobalPackageDirectory({
319
+ packageManager,
320
+ packageName,
321
+ runCommand,
322
+ });
323
+
318
324
  if (packageManager === "pnpm") {
319
- const rebuildResult = await runCommand("pnpm", ["rebuild", "-g", ...dependencies]);
325
+ const rebuildResult = await runCommand("pnpm", ["rebuild", ...dependencies], {
326
+ cwd: packageDirectory,
327
+ });
320
328
  if (!rebuildResult.success) {
321
329
  throw new Error(
322
330
  `pnpm rebuild failed: ${String(rebuildResult.stderr || rebuildResult.stdout || "unknown error").trim()}`,
@@ -336,12 +344,6 @@ export async function repairAndVerifyGlobalNodePty({
336
344
  );
337
345
  }
338
346
  }
339
-
340
- const packageDirectory = await resolveGlobalPackageDirectory({
341
- packageManager,
342
- packageName,
343
- runCommand,
344
- });
345
347
  await verifyNodePtyForPackageDirectory({
346
348
  packageDirectory,
347
349
  runCommand,