svamp-cli 0.2.240 → 0.2.242
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.mjs
CHANGED
|
@@ -394,7 +394,7 @@ async function main() {
|
|
|
394
394
|
} else if (!subcommand || subcommand === "start") {
|
|
395
395
|
await handleInteractiveCommand();
|
|
396
396
|
} else if (subcommand === "--version" || subcommand === "-v") {
|
|
397
|
-
const pkg = await import('./package-
|
|
397
|
+
const pkg = await import('./package-CvKooOTz.mjs').catch(() => ({ default: { version: "unknown" } }));
|
|
398
398
|
console.log(`svamp version: ${pkg.default.version}`);
|
|
399
399
|
} else {
|
|
400
400
|
console.error(`Unknown command: ${subcommand}`);
|
|
@@ -1212,7 +1212,7 @@ async function handleSkillsCommand() {
|
|
|
1212
1212
|
await printSkillsHelp();
|
|
1213
1213
|
return;
|
|
1214
1214
|
}
|
|
1215
|
-
const { skillsFind, skillsInstall, skillsList, skillsRemove, skillsPublish } = await import('./commands-
|
|
1215
|
+
const { skillsFind, skillsInstall, skillsList, skillsRemove, skillsPublish } = await import('./commands-DztssZPZ.mjs');
|
|
1216
1216
|
if (skillsSubcommand === "find" || skillsSubcommand === "search") {
|
|
1217
1217
|
const query = skillsArgs.slice(1).filter((a) => !a.startsWith("--")).join(" ");
|
|
1218
1218
|
if (!query) {
|
|
@@ -271,17 +271,32 @@ async function skillsPublish(skillPath, opts) {
|
|
|
271
271
|
}
|
|
272
272
|
const serverUrl = process.env.HYPHA_SERVER_URL || getSkillsServer();
|
|
273
273
|
let server;
|
|
274
|
-
|
|
274
|
+
{
|
|
275
275
|
const mod = await import('hypha-rpc');
|
|
276
276
|
const connectToServer = mod.connectToServer || mod.default?.connectToServer;
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
277
|
+
const attempts = 3;
|
|
278
|
+
let lastErr;
|
|
279
|
+
for (let i = 1; i <= attempts; i++) {
|
|
280
|
+
try {
|
|
281
|
+
server = await connectToServer({
|
|
282
|
+
server_url: serverUrl,
|
|
283
|
+
token,
|
|
284
|
+
workspace: getSkillsWorkspaceName()
|
|
285
|
+
});
|
|
286
|
+
lastErr = void 0;
|
|
287
|
+
break;
|
|
288
|
+
} catch (err) {
|
|
289
|
+
lastErr = err;
|
|
290
|
+
if (i < attempts) {
|
|
291
|
+
console.error(`Hypha connection failed (attempt ${i}/${attempts}): ${err.message} \u2014 retrying\u2026`);
|
|
292
|
+
await new Promise((r) => setTimeout(r, 700 * i));
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
if (lastErr || !server) {
|
|
297
|
+
console.error(`Failed to connect to Hypha after ${attempts} attempts: ${lastErr?.message ?? "unknown error"}`);
|
|
298
|
+
process.exit(1);
|
|
299
|
+
}
|
|
285
300
|
}
|
|
286
301
|
let am;
|
|
287
302
|
try {
|