runtrim 0.1.14 → 0.1.15
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/runtrim.cjs +14 -4
- package/dist-cli/runtrim.js +14 -4
- package/package.json +1 -1
package/dist-cli/runtrim.cjs
CHANGED
|
@@ -10845,6 +10845,9 @@ async function syncRunsToCloud(input) {
|
|
|
10845
10845
|
});
|
|
10846
10846
|
const body = await res.json().catch(() => ({}));
|
|
10847
10847
|
if (!res.ok || !body.ok) {
|
|
10848
|
+
if (res.status === 401 || res.status === 403) {
|
|
10849
|
+
return { status: "skipped_invalid_token" };
|
|
10850
|
+
}
|
|
10848
10851
|
if (markPendingRunIds && markPendingRunIds.length > 0) {
|
|
10849
10852
|
for (const id of markPendingRunIds) updateRun(id, { pendingSync: true }, cwd);
|
|
10850
10853
|
}
|
|
@@ -11420,18 +11423,25 @@ program.command("sync").description("Sync local run history and project memory t
|
|
|
11420
11423
|
runs
|
|
11421
11424
|
});
|
|
11422
11425
|
if (result.status !== "synced") {
|
|
11423
|
-
spinner.fail(" Sync failed.");
|
|
11424
|
-
console.log("");
|
|
11425
11426
|
if (result.status === "skipped_no_token") {
|
|
11426
|
-
|
|
11427
|
+
spinner.stop();
|
|
11428
|
+
console.log("");
|
|
11429
|
+
console.log(DIM(" Cloud sync not configured."));
|
|
11427
11430
|
console.log(DIM(" Run ") + GO_ACCENT("runtrim login") + DIM(" to connect cloud sync."));
|
|
11428
11431
|
console.log(DIM(" Local CLI still works without a token."));
|
|
11429
11432
|
} else if (result.status === "skipped_invalid_token") {
|
|
11430
|
-
|
|
11433
|
+
spinner.stop();
|
|
11434
|
+
console.log("");
|
|
11435
|
+
console.log(DIM(" Cloud sync not configured. Run saved locally."));
|
|
11436
|
+
console.log(DIM(" Re-run: runtrim login"));
|
|
11431
11437
|
} else if (result.error) {
|
|
11438
|
+
spinner.fail(" Sync failed.");
|
|
11439
|
+
console.log("");
|
|
11432
11440
|
console.log(chalk.red(" Error: ") + chalk.white(result.error));
|
|
11433
11441
|
if (result.details) console.log(chalk.red(" Details: ") + chalk.white(result.details));
|
|
11434
11442
|
} else {
|
|
11443
|
+
spinner.fail(" Sync failed.");
|
|
11444
|
+
console.log("");
|
|
11435
11445
|
console.log(chalk.yellow(" Failed. Run saved locally. Use runtrim sync later."));
|
|
11436
11446
|
}
|
|
11437
11447
|
console.log("");
|
package/dist-cli/runtrim.js
CHANGED
|
@@ -10824,6 +10824,9 @@ async function syncRunsToCloud(input) {
|
|
|
10824
10824
|
});
|
|
10825
10825
|
const body = await res.json().catch(() => ({}));
|
|
10826
10826
|
if (!res.ok || !body.ok) {
|
|
10827
|
+
if (res.status === 401 || res.status === 403) {
|
|
10828
|
+
return { status: "skipped_invalid_token" };
|
|
10829
|
+
}
|
|
10827
10830
|
if (markPendingRunIds && markPendingRunIds.length > 0) {
|
|
10828
10831
|
for (const id of markPendingRunIds) updateRun(id, { pendingSync: true }, cwd);
|
|
10829
10832
|
}
|
|
@@ -11399,18 +11402,25 @@ program.command("sync").description("Sync local run history and project memory t
|
|
|
11399
11402
|
runs
|
|
11400
11403
|
});
|
|
11401
11404
|
if (result.status !== "synced") {
|
|
11402
|
-
spinner.fail(" Sync failed.");
|
|
11403
|
-
console.log("");
|
|
11404
11405
|
if (result.status === "skipped_no_token") {
|
|
11405
|
-
|
|
11406
|
+
spinner.stop();
|
|
11407
|
+
console.log("");
|
|
11408
|
+
console.log(DIM(" Cloud sync not configured."));
|
|
11406
11409
|
console.log(DIM(" Run ") + GO_ACCENT("runtrim login") + DIM(" to connect cloud sync."));
|
|
11407
11410
|
console.log(DIM(" Local CLI still works without a token."));
|
|
11408
11411
|
} else if (result.status === "skipped_invalid_token") {
|
|
11409
|
-
|
|
11412
|
+
spinner.stop();
|
|
11413
|
+
console.log("");
|
|
11414
|
+
console.log(DIM(" Cloud sync not configured. Run saved locally."));
|
|
11415
|
+
console.log(DIM(" Re-run: runtrim login"));
|
|
11410
11416
|
} else if (result.error) {
|
|
11417
|
+
spinner.fail(" Sync failed.");
|
|
11418
|
+
console.log("");
|
|
11411
11419
|
console.log(chalk.red(" Error: ") + chalk.white(result.error));
|
|
11412
11420
|
if (result.details) console.log(chalk.red(" Details: ") + chalk.white(result.details));
|
|
11413
11421
|
} else {
|
|
11422
|
+
spinner.fail(" Sync failed.");
|
|
11423
|
+
console.log("");
|
|
11414
11424
|
console.log(chalk.yellow(" Failed. Run saved locally. Use runtrim sync later."));
|
|
11415
11425
|
}
|
|
11416
11426
|
console.log("");
|