nextclaw 0.8.28 → 0.8.29
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/cli/index.js +35 -6
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -3162,7 +3162,7 @@ var ServiceCommands = class {
|
|
|
3162
3162
|
if (params.force) {
|
|
3163
3163
|
skildArgs.push("--force");
|
|
3164
3164
|
}
|
|
3165
|
-
|
|
3165
|
+
let result = await this.runCommandWithFallback(
|
|
3166
3166
|
["npx", "/opt/homebrew/bin/npx", "/usr/local/bin/npx"],
|
|
3167
3167
|
skildArgs,
|
|
3168
3168
|
{
|
|
@@ -3170,7 +3170,22 @@ var ServiceCommands = class {
|
|
|
3170
3170
|
timeoutMs: 18e4
|
|
3171
3171
|
}
|
|
3172
3172
|
);
|
|
3173
|
-
|
|
3173
|
+
let payload = this.parseSkildJsonOutput(result.stdout);
|
|
3174
|
+
if (!payload) {
|
|
3175
|
+
const forceArgs = skildArgs.includes("--force") ? skildArgs : [...skildArgs, "--force"];
|
|
3176
|
+
result = await this.runCommandWithFallback(
|
|
3177
|
+
["npx", "/opt/homebrew/bin/npx", "/usr/local/bin/npx"],
|
|
3178
|
+
forceArgs,
|
|
3179
|
+
{
|
|
3180
|
+
cwd: workspace,
|
|
3181
|
+
timeoutMs: 18e4
|
|
3182
|
+
}
|
|
3183
|
+
);
|
|
3184
|
+
payload = this.parseSkildJsonOutput(result.stdout);
|
|
3185
|
+
}
|
|
3186
|
+
if (!payload) {
|
|
3187
|
+
throw new Error("skild returned null json payload even after force reinstall");
|
|
3188
|
+
}
|
|
3174
3189
|
const installDir = typeof payload.installDir === "string" ? payload.installDir.trim() : "";
|
|
3175
3190
|
const installSkillFile = installDir ? join4(installDir, "SKILL.md") : "";
|
|
3176
3191
|
if (!installDir || !existsSync7(installSkillFile)) {
|
|
@@ -3208,13 +3223,17 @@ var ServiceCommands = class {
|
|
|
3208
3223
|
async uninstallMarketplaceSkill(slug) {
|
|
3209
3224
|
const workspace = getWorkspacePath5(loadConfig5().agents.defaults.workspace);
|
|
3210
3225
|
const targetDir = join4(workspace, "skills", slug);
|
|
3211
|
-
|
|
3226
|
+
const skildDir = join4(workspace, ".agents", "skills", slug);
|
|
3227
|
+
const existingTargets = [targetDir, skildDir].filter((path) => existsSync7(path));
|
|
3228
|
+
if (existingTargets.length === 0) {
|
|
3212
3229
|
throw new Error(`Skill not installed in workspace: ${slug}`);
|
|
3213
3230
|
}
|
|
3214
|
-
|
|
3231
|
+
for (const path of existingTargets) {
|
|
3232
|
+
rmSync3(path, { recursive: true, force: true });
|
|
3233
|
+
}
|
|
3215
3234
|
return {
|
|
3216
3235
|
message: `Uninstalled skill: ${slug}`,
|
|
3217
|
-
output: `Removed ${
|
|
3236
|
+
output: existingTargets.map((path) => `Removed ${path}`).join("\n")
|
|
3218
3237
|
};
|
|
3219
3238
|
}
|
|
3220
3239
|
installBuiltinMarketplaceSkill(slug, force) {
|
|
@@ -3291,7 +3310,17 @@ var ServiceCommands = class {
|
|
|
3291
3310
|
})();
|
|
3292
3311
|
try {
|
|
3293
3312
|
const parsed = JSON.parse(maybeJson);
|
|
3294
|
-
if (
|
|
3313
|
+
if (parsed === null) {
|
|
3314
|
+
return null;
|
|
3315
|
+
}
|
|
3316
|
+
if (Array.isArray(parsed)) {
|
|
3317
|
+
const firstObject = parsed.find((item) => item && typeof item === "object" && !Array.isArray(item));
|
|
3318
|
+
if (firstObject) {
|
|
3319
|
+
return firstObject;
|
|
3320
|
+
}
|
|
3321
|
+
throw new Error("skild json output array does not contain an object");
|
|
3322
|
+
}
|
|
3323
|
+
if (typeof parsed !== "object") {
|
|
3295
3324
|
throw new Error("skild json output is not an object");
|
|
3296
3325
|
}
|
|
3297
3326
|
return parsed;
|