fluxy-bot 0.5.53 → 0.5.55

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/bin/cli.js CHANGED
@@ -140,6 +140,8 @@ class Stepper {
140
140
  this.frame = 0;
141
141
  this.interval = null;
142
142
  this.done = false;
143
+ this.infoLines = []; // extra lines shown below the progress bar
144
+ this._totalLines = 0; // total lines rendered last frame (for cursor rewind)
143
145
  }
144
146
 
145
147
  start() {
@@ -151,11 +153,16 @@ class Stepper {
151
153
  this.render();
152
154
  }
153
155
 
156
+ setInfo(lines) {
157
+ this.infoLines = lines || [];
158
+ this.render();
159
+ }
160
+
154
161
  render() {
155
162
  if (this.done) return;
156
163
 
157
- if (this.current > 0 || this.frame > 0) {
158
- process.stdout.write(`\x1b[${this.steps.length + 2}A`);
164
+ if (this._totalLines > 0) {
165
+ process.stdout.write(`\x1b[${this._totalLines}A`);
159
166
  }
160
167
 
161
168
  const ratio = this.current / this.steps.length;
@@ -171,6 +178,19 @@ class Stepper {
171
178
  }
172
179
 
173
180
  console.log(`\n ${progressBar(ratio)} ${c.dim}${Math.round(ratio * 100)}%${c.reset}`);
181
+
182
+ // steps + blank + progress = steps.length + 2, plus info lines
183
+ let lineCount = this.steps.length + 2;
184
+
185
+ if (this.infoLines.length) {
186
+ console.log('');
187
+ for (const line of this.infoLines) {
188
+ console.log(line);
189
+ }
190
+ lineCount += 1 + this.infoLines.length;
191
+ }
192
+
193
+ this._totalLines = lineCount;
174
194
  }
175
195
 
176
196
  advance() {
@@ -182,7 +202,15 @@ class Stepper {
182
202
  this.done = true;
183
203
  if (this.interval) clearInterval(this.interval);
184
204
 
185
- process.stdout.write(`\x1b[${this.steps.length + 2}A`);
205
+ if (this._totalLines > 0) {
206
+ process.stdout.write(`\x1b[${this._totalLines}A`);
207
+ }
208
+ // Clear all previously rendered lines
209
+ for (let i = 0; i < this._totalLines; i++) {
210
+ process.stdout.write('\x1b[2K\n');
211
+ }
212
+ process.stdout.write(`\x1b[${this._totalLines}A`);
213
+
186
214
  for (const step of this.steps) {
187
215
  console.log(` ${c.blue}✔${c.reset} ${step}`);
188
216
  }
@@ -363,7 +391,7 @@ function bootServer({ onTunnelUp, onReady } = {}) {
363
391
  const tunnelMatch = text.match(/__TUNNEL_URL__=(\S+)/);
364
392
  if (tunnelMatch) {
365
393
  tunnelUrl = tunnelMatch[1];
366
- if (!tunnelFired && onTunnelUp) { tunnelFired = true; onTunnelUp(); }
394
+ if (!tunnelFired && onTunnelUp) { tunnelFired = true; onTunnelUp(tunnelUrl); }
367
395
  }
368
396
 
369
397
  const relayMatch = text.match(/__RELAY_URL__=(\S+)/);
@@ -438,11 +466,24 @@ async function init() {
438
466
 
439
467
  // Server + Tunnel
440
468
  stepper.advance();
469
+ const config = JSON.parse(fs.readFileSync(CONFIG_PATH, 'utf-8'));
441
470
  let result;
442
471
  try {
443
472
  result = await bootServer({
444
- onTunnelUp: () => stepper.advance(), // Connecting tunnel done
445
- onReady: () => stepper.advance(), // Verifying connection done
473
+ onTunnelUp: (url) => {
474
+ stepper.advance(); // Connecting tunnel done
475
+ // Show the direct URL while waiting for the custom domain to become reachable
476
+ if (config.relay?.url) {
477
+ stepper.setInfo([
478
+ ` ${c.dim}Waiting for ${c.reset}${c.white}${config.relay.url.replace('https://', '')}${c.reset}${c.dim} to become reachable (can take up to 2 min)${c.reset}`,
479
+ ` ${c.dim}In the meanwhile you can access:${c.reset} ${c.blue}${link(url)}${c.reset}`,
480
+ ]);
481
+ }
482
+ },
483
+ onReady: () => {
484
+ stepper.setInfo([]);
485
+ stepper.advance(); // Verifying connection done
486
+ },
446
487
  });
447
488
  } catch (err) {
448
489
  stepper.finish();
@@ -530,11 +571,23 @@ async function start() {
530
571
  stepper.advance(); // config exists
531
572
  stepper.advance(); // starting
532
573
 
574
+ const config = JSON.parse(fs.readFileSync(CONFIG_PATH, 'utf-8'));
533
575
  let result;
534
576
  try {
535
577
  result = await bootServer({
536
- onTunnelUp: () => stepper.advance(), // Connecting tunnel done
537
- onReady: () => stepper.advance(), // Verifying connection done
578
+ onTunnelUp: (url) => {
579
+ stepper.advance(); // Connecting tunnel done
580
+ if (config.relay?.url) {
581
+ stepper.setInfo([
582
+ ` ${c.dim}Waiting for ${c.reset}${c.white}${config.relay.url.replace('https://', '')}${c.reset}${c.dim} to become reachable (can take up to 2 min)${c.reset}`,
583
+ ` ${c.dim}In the meanwhile you can access:${c.reset} ${c.blue}${link(url)}${c.reset}`,
584
+ ]);
585
+ }
586
+ },
587
+ onReady: () => {
588
+ stepper.setInfo([]);
589
+ stepper.advance(); // Verifying connection done
590
+ },
538
591
  });
539
592
  } catch (err) {
540
593
  stepper.finish();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluxy-bot",
3
- "version": "0.5.53",
3
+ "version": "0.5.55",
4
4
  "releaseNotes": [
5
5
  "Fixed some bugs to iOs ",
6
6
  "2. ",
@@ -192,6 +192,12 @@ export async function startSupervisor() {
192
192
  'POST /api/onboard',
193
193
  'GET /api/push/vapid-public-key',
194
194
  'GET /api/push/status',
195
+ 'POST /api/auth/claude/start',
196
+ 'POST /api/auth/claude/exchange',
197
+ 'GET /api/auth/claude/status',
198
+ 'POST /api/auth/codex/start',
199
+ 'POST /api/auth/codex/cancel',
200
+ 'GET /api/auth/codex/status',
195
201
  ];
196
202
 
197
203
  function isExemptRoute(method: string, url: string): boolean {