forge-remote 0.1.8 → 0.1.10

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/init.js +23 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forge-remote",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "Desktop relay for Forge Remote — monitor and control Claude Code sessions from your phone",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
package/src/init.js CHANGED
@@ -576,7 +576,8 @@ export async function runInit({ projectId: overrideProjectId } = {}) {
576
576
  console.log(chalk.yellow(" ⚠ Firestore already enabled — continuing."));
577
577
  results.firestoreEnabled = true;
578
578
  } else {
579
- const maxFirestoreRetries = 2;
579
+ const maxFirestoreRetries = 4;
580
+ let billingPromptShown = false;
580
581
 
581
582
  for (let attempt = 0; attempt < maxFirestoreRetries; attempt++) {
582
583
  try {
@@ -614,13 +615,31 @@ export async function runInit({ projectId: overrideProjectId } = {}) {
614
615
  break;
615
616
  }
616
617
 
618
+ // Detect API propagation delay — retry automatically with a wait.
617
619
  if (
620
+ fullOutput.includes("has not been used in project") ||
621
+ fullOutput.includes("it is disabled")
622
+ ) {
623
+ if (attempt < maxFirestoreRetries - 1) {
624
+ console.log(
625
+ chalk.yellow(
626
+ ` ⚠ Firestore API still propagating (attempt ${attempt + 1}/${maxFirestoreRetries}). Waiting 15s...`,
627
+ ),
628
+ );
629
+ await new Promise((r) => setTimeout(r, 15000));
630
+ continue;
631
+ }
632
+ }
633
+
634
+ if (
635
+ !billingPromptShown &&
618
636
  (fullOutput.includes("billing") ||
619
637
  fullOutput.includes("FAILED_PRECONDITION") ||
620
- fullOutput.includes("403")) &&
621
- attempt === 0
638
+ (fullOutput.includes("403") &&
639
+ !fullOutput.includes("has not been used")))
622
640
  ) {
623
- // First attempt failed due to billing — guide the user through upgrading.
641
+ // Failed due to billing — guide the user through upgrading.
642
+ billingPromptShown = true;
624
643
  console.log(
625
644
  chalk.yellow(
626
645
  "\n Firestore requires the Blaze (pay-as-you-go) plan.",