clawdock 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/dist/index.js +22 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -438,15 +438,21 @@ program.command("run <bundle>").description("Pull and run an agent locally").opt
|
|
|
438
438
|
authProfiles[provider] = { type: "api-key", apiKey };
|
|
439
439
|
fs.writeFileSync(authProfilesPath, JSON.stringify(authProfiles, null, 2));
|
|
440
440
|
}
|
|
441
|
-
const
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
{
|
|
441
|
+
const introMessage = "Hello! I just pulled you from ClawDock. Introduce yourself.";
|
|
442
|
+
let child;
|
|
443
|
+
if (isWindows) {
|
|
444
|
+
const cmd = `"${runtimeBin}" agent --agent ${agentName} --local -m "${introMessage}"`;
|
|
445
|
+
child = spawn(cmd, [], {
|
|
445
446
|
stdio: "inherit",
|
|
446
447
|
env: { ...process.env },
|
|
447
|
-
shell:
|
|
448
|
-
}
|
|
449
|
-
|
|
448
|
+
shell: true
|
|
449
|
+
});
|
|
450
|
+
} else {
|
|
451
|
+
child = spawn(runtimeBin, ["agent", "--agent", agentName, "--local", "-m", introMessage], {
|
|
452
|
+
stdio: "inherit",
|
|
453
|
+
env: { ...process.env }
|
|
454
|
+
});
|
|
455
|
+
}
|
|
450
456
|
child.on("error", (err) => {
|
|
451
457
|
console.error(`\u274C Failed to start: ${err.message}`);
|
|
452
458
|
process.exit(1);
|
|
@@ -476,18 +482,21 @@ program.command("run <bundle>").description("Pull and run an agent locally").opt
|
|
|
476
482
|
}
|
|
477
483
|
};
|
|
478
484
|
fs.writeFileSync(configPath, JSON.stringify(nullclawConfig, null, 2));
|
|
479
|
-
const
|
|
485
|
+
const nullChild = isWindows ? spawn(`"${runtimeBin}" --config "${configPath}" --workspace "${workspaceDir}"`, [], {
|
|
480
486
|
stdio: "inherit",
|
|
481
487
|
cwd: workspaceDir,
|
|
482
|
-
shell:
|
|
488
|
+
shell: true
|
|
489
|
+
}) : spawn(runtimeBin, ["--config", configPath, "--workspace", workspaceDir], {
|
|
490
|
+
stdio: "inherit",
|
|
491
|
+
cwd: workspaceDir
|
|
483
492
|
});
|
|
484
|
-
|
|
493
|
+
nullChild.on("error", (err) => {
|
|
485
494
|
console.error(`\u274C Failed to start NullClaw: ${err.message}`);
|
|
486
495
|
process.exit(1);
|
|
487
496
|
});
|
|
488
|
-
|
|
489
|
-
process.on("SIGINT", () =>
|
|
490
|
-
process.on("SIGTERM", () =>
|
|
497
|
+
nullChild.on("exit", (code) => process.exit(code || 0));
|
|
498
|
+
process.on("SIGINT", () => nullChild.kill("SIGINT"));
|
|
499
|
+
process.on("SIGTERM", () => nullChild.kill("SIGTERM"));
|
|
491
500
|
}
|
|
492
501
|
});
|
|
493
502
|
program.command("update").description("Update clawdock CLI to the latest version").action(async () => {
|