@sylphx/flow 3.12.1 → 3.13.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @sylphx/flow
2
2
 
3
+ ## 3.13.0 (2026-02-04)
4
+
5
+ ### ✨ Features
6
+
7
+ - **auto-upgrade:** add periodic background update check every 30 minutes ([4a14414](https://github.com/SylphxAI/flow/commit/4a14414350f31899a5dadaf596216c53406f7ffc))
8
+
3
9
  ## 3.12.1 (2026-02-04)
4
10
 
5
11
  ### 🐛 Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sylphx/flow",
3
- "version": "3.12.1",
3
+ "version": "3.13.0",
4
4
  "description": "One CLI to rule them all. Unified orchestration layer for AI coding assistants. Auto-detection, auto-installation, auto-upgrade.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -242,6 +242,9 @@ export async function executeFlowV2(
242
242
  const autoUpgrade = new AutoUpgrade(projectPath);
243
243
  const upgradeResult = await autoUpgrade.runAutoUpgrade(selectedTargetId);
244
244
 
245
+ // Start periodic background checks (every 30 minutes)
246
+ autoUpgrade.startPeriodicCheck(selectedTargetId);
247
+
245
248
  // Show upgrade notice (minimal - only if upgraded)
246
249
  if (upgradeResult.flowUpgraded && upgradeResult.flowVersion) {
247
250
  console.log(chalk.dim(`↑ flow ${upgradeResult.flowVersion.latest}`));
@@ -43,10 +43,14 @@ export interface AutoUpgradeOptions {
43
43
  skipTarget?: boolean;
44
44
  }
45
45
 
46
+ // Default interval: 30 minutes
47
+ const DEFAULT_CHECK_INTERVAL_MS = 30 * 60 * 1000;
48
+
46
49
  export class AutoUpgrade {
47
50
  private projectPath: string;
48
51
  private options: AutoUpgradeOptions;
49
52
  private targetInstaller: TargetInstaller;
53
+ private periodicCheckInterval: NodeJS.Timeout | null = null;
50
54
 
51
55
  constructor(projectPath: string = process.cwd(), options: AutoUpgradeOptions = {}) {
52
56
  this.projectPath = projectPath;
@@ -396,4 +400,64 @@ export class AutoUpgrade {
396
400
  return false;
397
401
  }
398
402
  }
403
+
404
+ /**
405
+ * Start periodic background checks for updates
406
+ * Runs every intervalMs (default 30 minutes)
407
+ * Silently upgrades if updates are available
408
+ * @param targetId - Optional target CLI ID to check
409
+ * @param intervalMs - Check interval in milliseconds (default 30 minutes)
410
+ */
411
+ startPeriodicCheck(targetId?: string, intervalMs: number = DEFAULT_CHECK_INTERVAL_MS): void {
412
+ // Clear any existing interval
413
+ this.stopPeriodicCheck();
414
+
415
+ // Start periodic check
416
+ this.periodicCheckInterval = setInterval(() => {
417
+ this.performPeriodicUpgrade(targetId).catch(() => {
418
+ // Silent fail
419
+ });
420
+ }, intervalMs);
421
+
422
+ // Don't prevent process from exiting
423
+ this.periodicCheckInterval.unref();
424
+ }
425
+
426
+ /**
427
+ * Stop periodic background checks
428
+ */
429
+ stopPeriodicCheck(): void {
430
+ if (this.periodicCheckInterval) {
431
+ clearInterval(this.periodicCheckInterval);
432
+ this.periodicCheckInterval = null;
433
+ }
434
+ }
435
+
436
+ /**
437
+ * Perform periodic upgrade check and silent upgrade
438
+ */
439
+ private async performPeriodicUpgrade(targetId?: string): Promise<void> {
440
+ // Perform background check first (updates version info)
441
+ await this.performBackgroundCheck(targetId);
442
+
443
+ // Read the fresh version info
444
+ const info = await this.readVersionInfo();
445
+ if (!info) return;
446
+
447
+ const currentVersion = await this.getCurrentFlowVersion();
448
+
449
+ // Silently upgrade Flow if needed
450
+ if (info.flowLatest && info.flowLatest !== currentVersion) {
451
+ await this.upgradeFlowSilent();
452
+ }
453
+
454
+ // Silently upgrade target if needed
455
+ if (targetId && info.targetLatest?.[targetId] && info.targetCurrent?.[targetId]) {
456
+ const current = info.targetCurrent[targetId];
457
+ const latest = info.targetLatest[targetId];
458
+ if (current !== latest) {
459
+ await this.upgradeTargetSilent(targetId);
460
+ }
461
+ }
462
+ }
399
463
  }