clawdock 0.2.9 → 0.3.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.
- package/dist/index.js +34 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -125,6 +125,15 @@ program.command("push [path]").description("Publish an agent bundle").option("--
|
|
|
125
125
|
formData.append("tarball", new Blob([tarball]), `${manifest.name}.tar.gz`);
|
|
126
126
|
formData.append("is_public", opts.private ? "false" : "true");
|
|
127
127
|
if (opts.changelog) formData.append("changelog", opts.changelog);
|
|
128
|
+
const readmeCandidates = ["README.md", "readme.md", "SOUL.md"];
|
|
129
|
+
for (const candidate of readmeCandidates) {
|
|
130
|
+
const readmePath = path.join(dir, candidate);
|
|
131
|
+
if (fs.existsSync(readmePath)) {
|
|
132
|
+
const content = fs.readFileSync(readmePath, "utf-8");
|
|
133
|
+
formData.append("readme", content);
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
128
137
|
try {
|
|
129
138
|
const result = await apiRequest("POST", "/v1/bundles/publish", formData, true);
|
|
130
139
|
console.log(`\u2705 Published ${result.owner}/${result.slug}@${result.version}`);
|
|
@@ -396,6 +405,31 @@ program.command("run <bundle>").description("Pull and run an agent locally").opt
|
|
|
396
405
|
console.error(" Run without --no-pull to download first.");
|
|
397
406
|
process.exit(1);
|
|
398
407
|
}
|
|
408
|
+
const postInstallScript = path.join(workspaceDir, "scripts", "post-install.sh");
|
|
409
|
+
const postInstallScriptWin = path.join(workspaceDir, "scripts", "post-install.bat");
|
|
410
|
+
const scriptToRun = isWindows ? fs.existsSync(postInstallScriptWin) ? postInstallScriptWin : fs.existsSync(postInstallScript) ? postInstallScript : null : fs.existsSync(postInstallScript) ? postInstallScript : null;
|
|
411
|
+
if (scriptToRun) {
|
|
412
|
+
console.log(`\u{1F4E6} Running post-install script...`);
|
|
413
|
+
try {
|
|
414
|
+
const scriptCmd = isWindows && scriptToRun.endsWith(".bat") ? `"${scriptToRun}"` : `bash "${scriptToRun}"`;
|
|
415
|
+
execSync(scriptCmd, {
|
|
416
|
+
stdio: "inherit",
|
|
417
|
+
cwd: workspaceDir,
|
|
418
|
+
env: {
|
|
419
|
+
...process.env,
|
|
420
|
+
CLAWDOCK_WORKSPACE: workspaceDir,
|
|
421
|
+
CLAWDOCK_AGENT: agentName,
|
|
422
|
+
CLAWDOCK_OWNER: owner,
|
|
423
|
+
CLAWDOCK_SLUG: slug
|
|
424
|
+
},
|
|
425
|
+
shell: isWindows ? "cmd.exe" : void 0
|
|
426
|
+
});
|
|
427
|
+
console.log(` \u2705 Post-install complete`);
|
|
428
|
+
} catch (err) {
|
|
429
|
+
console.warn(` \u26A0\uFE0F Post-install script failed: ${err.message}`);
|
|
430
|
+
console.warn(` Continuing anyway...`);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
399
433
|
const resolvedModel = model || (provider ? `${provider}/claude-sonnet-4` : null);
|
|
400
434
|
console.log(`
|
|
401
435
|
\u{1F980} Starting ${owner}/${slug}...`);
|