fluxy-bot 0.5.72 → 0.5.73

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/bin/cli.js +48 -4
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -815,7 +815,7 @@ async function init() {
815
815
  console.error(` ${c.dim}${err.message}${c.reset}\n`);
816
816
  process.exit(1);
817
817
  }
818
- const { child, tunnelUrl, relayUrl, tunnelFailed, viteWarm } = result;
818
+ let { child, tunnelUrl, relayUrl, tunnelFailed, viteWarm } = result;
819
819
 
820
820
  // Wait for Vite to finish pre-transforming all modules (with timeout)
821
821
  await Promise.race([viteWarm, new Promise(r => setTimeout(r, 30_000))]);
@@ -827,9 +827,32 @@ async function init() {
827
827
  const nodePath = process.execPath;
828
828
  const realHome = os.homedir();
829
829
  const res = spawnSync(process.execPath, [process.argv[1], 'daemon', 'install'], {
830
- stdio: 'inherit',
830
+ stdio: 'pipe', // Suppress subprocess output — stepper handles UI
831
831
  env: { ...process.env, FLUXY_NODE_PATH: nodePath, FLUXY_REAL_HOME: realHome },
832
832
  });
833
+
834
+ // Wait for the daemon's supervisor to get a new tunnel URL
835
+ // (the old one died with the temp server we just killed)
836
+ if (res.status === 0) {
837
+ let daemonTunnelUrl = null;
838
+ for (let i = 0; i < 30; i++) {
839
+ await new Promise((r) => setTimeout(r, 1000));
840
+ try {
841
+ const cfg = JSON.parse(fs.readFileSync(CONFIG_PATH, 'utf-8'));
842
+ if (cfg.tunnelUrl && cfg.tunnelUrl !== tunnelUrl) {
843
+ daemonTunnelUrl = cfg.tunnelUrl;
844
+ break;
845
+ }
846
+ } catch {}
847
+ }
848
+ if (daemonTunnelUrl) tunnelUrl = daemonTunnelUrl;
849
+ // Also pick up relay URL that may have been saved earlier
850
+ try {
851
+ const cfg = JSON.parse(fs.readFileSync(CONFIG_PATH, 'utf-8'));
852
+ if (cfg.relay?.url) relayUrl = cfg.relay.url;
853
+ } catch {}
854
+ }
855
+
833
856
  stepper.advance();
834
857
  stepper.finish();
835
858
  if (tunnelFailed) {
@@ -930,7 +953,7 @@ async function start() {
930
953
  console.error(` ${c.dim}${err.message}${c.reset}\n`);
931
954
  process.exit(1);
932
955
  }
933
- const { child, tunnelUrl, relayUrl, tunnelFailed, viteWarm } = result;
956
+ let { child, tunnelUrl, relayUrl, tunnelFailed, viteWarm } = result;
934
957
 
935
958
  // Wait for Vite to finish pre-transforming all modules (with timeout)
936
959
  await Promise.race([viteWarm, new Promise(r => setTimeout(r, 30_000))]);
@@ -942,9 +965,30 @@ async function start() {
942
965
  const nodePath = process.execPath;
943
966
  const realHome = os.homedir();
944
967
  const res = spawnSync(process.execPath, [process.argv[1], 'daemon', 'install'], {
945
- stdio: 'inherit',
968
+ stdio: 'pipe', // Suppress subprocess output — stepper handles UI
946
969
  env: { ...process.env, FLUXY_NODE_PATH: nodePath, FLUXY_REAL_HOME: realHome },
947
970
  });
971
+
972
+ // Wait for the daemon's supervisor to get a new tunnel URL
973
+ if (res.status === 0) {
974
+ let daemonTunnelUrl = null;
975
+ for (let i = 0; i < 30; i++) {
976
+ await new Promise((r) => setTimeout(r, 1000));
977
+ try {
978
+ const cfg = JSON.parse(fs.readFileSync(CONFIG_PATH, 'utf-8'));
979
+ if (cfg.tunnelUrl && cfg.tunnelUrl !== tunnelUrl) {
980
+ daemonTunnelUrl = cfg.tunnelUrl;
981
+ break;
982
+ }
983
+ } catch {}
984
+ }
985
+ if (daemonTunnelUrl) tunnelUrl = daemonTunnelUrl;
986
+ try {
987
+ const cfg = JSON.parse(fs.readFileSync(CONFIG_PATH, 'utf-8'));
988
+ if (cfg.relay?.url) relayUrl = cfg.relay.url;
989
+ } catch {}
990
+ }
991
+
948
992
  stepper.advance();
949
993
  stepper.finish();
950
994
  if (tunnelFailed) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluxy-bot",
3
- "version": "0.5.72",
3
+ "version": "0.5.73",
4
4
  "releaseNotes": [
5
5
  "Fixed some bugs to iOs ",
6
6
  "2. ",