agileflow 2.57.0 → 2.58.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agileflow",
3
- "version": "2.57.0",
3
+ "version": "2.58.0",
4
4
  "description": "AI-driven agile development system for Claude Code, Cursor, Windsurf, and more",
5
5
  "keywords": [
6
6
  "agile",
@@ -23,7 +23,7 @@
23
23
  * --detect Show current status
24
24
  * --help Show help
25
25
  *
26
- * Features: sessionstart, precompact, stop, archival, statusline
26
+ * Features: sessionstart, precompact, stop, archival, statusline, autoupdate
27
27
  */
28
28
 
29
29
  const fs = require('fs');
@@ -42,6 +42,7 @@ const FEATURES = {
42
42
  stop: { hook: 'Stop', script: 'agileflow-stop.sh', type: 'bash' },
43
43
  archival: { script: 'archive-completed-stories.sh', requiresHook: 'sessionstart' },
44
44
  statusline: { script: 'agileflow-statusline.sh' },
45
+ autoupdate: { metadataOnly: true }, // Stored in metadata.updates.autoUpdate
45
46
  };
46
47
 
47
48
  // Statusline component names
@@ -559,6 +560,21 @@ echo "[$MODEL] AgileFlow"
559
560
  success('Status line enabled');
560
561
  }
561
562
 
563
+ // Handle autoupdate (metadata only, no hooks needed)
564
+ if (feature === 'autoupdate') {
565
+ const frequency = options.checkFrequency || 'daily';
566
+ updateMetadata({
567
+ updates: {
568
+ autoUpdate: true,
569
+ checkFrequency: frequency,
570
+ showChangelog: true,
571
+ },
572
+ });
573
+ success(`Auto-update enabled (check frequency: ${frequency})`);
574
+ info('AgileFlow will automatically update on session start');
575
+ return true; // Skip settings.json write for this feature
576
+ }
577
+
562
578
  writeJSON('.claude/settings.json', settings);
563
579
  updateMetadata({
564
580
  features: { [feature]: { enabled: true, version: VERSION, at: new Date().toISOString() } },
@@ -607,6 +623,17 @@ function disableFeature(feature) {
607
623
  success('Status line disabled');
608
624
  }
609
625
 
626
+ // Disable autoupdate
627
+ if (feature === 'autoupdate') {
628
+ updateMetadata({
629
+ updates: {
630
+ autoUpdate: false,
631
+ },
632
+ });
633
+ success('Auto-update disabled');
634
+ return true; // Skip settings.json write for this feature
635
+ }
636
+
610
637
  writeJSON('.claude/settings.json', settings);
611
638
  updateMetadata({
612
639
  features: { [feature]: { enabled: false, version: VERSION, at: new Date().toISOString() } },
@@ -639,6 +666,9 @@ function updateMetadata(updates) {
639
666
  meta.features[key] = { ...meta.features[key], ...value };
640
667
  });
641
668
  }
669
+ if (updates.updates) {
670
+ meta.updates = { ...meta.updates, ...updates.updates };
671
+ }
642
672
 
643
673
  meta.version = VERSION;
644
674
  meta.updated = new Date().toISOString();
@@ -28,7 +28,7 @@ node .agileflow/scripts/agileflow-configure.js --disable=archival # Disable spec
28
28
 
29
29
  ### Features
30
30
 
31
- `sessionstart`, `precompact`, `stop`, `archival`, `statusline`
31
+ `sessionstart`, `precompact`, `stop`, `archival`, `statusline`, `autoupdate`
32
32
 
33
33
  ### Critical Rules
34
34
 
@@ -178,7 +178,8 @@ Based on selection, run appropriate command.
178
178
  {"label": "PreCompact Hook", "description": "Context preservation on compact"},
179
179
  {"label": "Stop Hook", "description": "Warns about uncommitted git changes"},
180
180
  {"label": "Archival", "description": "Auto-archive old completed stories"},
181
- {"label": "Status Line", "description": "Custom status bar"}
181
+ {"label": "Status Line", "description": "Custom status bar"},
182
+ {"label": "Auto-Update", "description": "Automatically update AgileFlow on session start"}
182
183
  ]
183
184
  }]</parameter>
184
185
  </invoke>
@@ -190,6 +191,29 @@ Map selections:
190
191
  - "Stop Hook" → `stop`
191
192
  - "Archival" → `archival`
192
193
  - "Status Line" → `statusline`
194
+ - "Auto-Update" → `autoupdate`
195
+
196
+ ## Auto-Update Configuration
197
+
198
+ Enable auto-update to automatically update AgileFlow when a new version is available:
199
+
200
+ ```bash
201
+ # Enable auto-update
202
+ node .agileflow/scripts/agileflow-configure.js --enable=autoupdate
203
+
204
+ # Or manually edit docs/00-meta/agileflow-metadata.json:
205
+ ```
206
+
207
+ ```json
208
+ {
209
+ "updates": {
210
+ "autoUpdate": true,
211
+ "checkFrequency": "daily"
212
+ }
213
+ }
214
+ ```
215
+
216
+ **Check frequencies:** `hourly`, `daily`, `weekly`, `never`
193
217
 
194
218
  ## Format Migration Details
195
219
 
@@ -46,7 +46,8 @@ module.exports = {
46
46
  const npmLatestVersion = await getLatestVersion('agileflow');
47
47
 
48
48
  if (npmLatestVersion && semver.lt(localCliVersion, npmLatestVersion)) {
49
- displayLogo();
49
+ // Don't show logo here - it will be shown by promptInstall() or after self-update
50
+ console.log(chalk.hex('#e8683a').bold('\n AgileFlow Update Available\n'));
50
51
  info(`Newer version available: v${localCliVersion} → v${npmLatestVersion}`);
51
52
  console.log(chalk.dim(' Fetching latest version from npm...\n'));
52
53
 
@@ -69,7 +70,10 @@ module.exports = {
69
70
  // If we self-updated, show confirmation
70
71
  if (options.selfUpdated) {
71
72
  const packageJson = require(path.join(__dirname, '..', '..', '..', 'package.json'));
72
- displayLogo();
73
+ // Only show logo here if using -y flag (since promptInstall won't be called)
74
+ if (options.yes) {
75
+ displayLogo();
76
+ }
73
77
  success(`Using latest CLI v${packageJson.version}`);
74
78
  console.log();
75
79
  }
@@ -39,6 +39,35 @@ module.exports = {
39
39
  try {
40
40
  const directory = path.resolve(options.directory || '.');
41
41
 
42
+ // Get local CLI version and npm registry version early to decide on self-update
43
+ const packageJson = require(path.join(__dirname, '..', '..', '..', 'package.json'));
44
+ const localCliVersion = packageJson.version;
45
+ const npmLatestVersion = await getLatestVersion('agileflow');
46
+
47
+ // Self-update check: if CLI is outdated and we haven't already self-updated, re-run with latest
48
+ const shouldSelfUpdate = options.selfUpdate !== false && !options.selfUpdated;
49
+ if (npmLatestVersion && semver.lt(localCliVersion, npmLatestVersion) && shouldSelfUpdate) {
50
+ // Don't show logo - the self-updated process will show it
51
+ console.log(chalk.hex('#e8683a').bold('\n AgileFlow CLI Update\n'));
52
+ info(`Updating CLI from v${localCliVersion} to v${npmLatestVersion}...`);
53
+ console.log(chalk.dim(' Fetching latest version from npm...\n'));
54
+
55
+ // Build the command with all current options forwarded
56
+ const args = ['agileflow@latest', 'update', '--self-updated'];
57
+ if (options.directory) args.push('-d', options.directory);
58
+ if (options.force) args.push('--force');
59
+
60
+ const result = spawnSync('npx', args, {
61
+ stdio: 'inherit',
62
+ cwd: process.cwd(),
63
+ shell: process.platform === 'win32',
64
+ });
65
+
66
+ // Exit with the same code as the spawned process
67
+ process.exit(result.status ?? 0);
68
+ }
69
+
70
+ // Now show the logo (either first run without update, or after self-update)
42
71
  displayLogo();
43
72
 
44
73
  // Check for existing installation
@@ -52,13 +81,6 @@ module.exports = {
52
81
 
53
82
  displaySection('Updating AgileFlow', `Current version: ${status.version}`);
54
83
 
55
- // Get local CLI version and npm registry version
56
- const packageJson = require(path.join(__dirname, '..', '..', '..', 'package.json'));
57
- const localCliVersion = packageJson.version;
58
-
59
- console.log(chalk.dim('Checking npm registry for latest version...'));
60
- const npmLatestVersion = await getLatestVersion('agileflow');
61
-
62
84
  if (!npmLatestVersion) {
63
85
  warning('Could not check npm registry for latest version');
64
86
  console.log(chalk.dim('Continuing with local CLI version...\n'));
@@ -72,28 +94,6 @@ module.exports = {
72
94
  console.log(chalk.bold('Latest (npm):'), npmLatestVersion);
73
95
  }
74
96
 
75
- // Self-update: if CLI is outdated and we haven't already self-updated, re-run with latest
76
- const shouldSelfUpdate = options.selfUpdate !== false && !options.selfUpdated;
77
- if (npmLatestVersion && semver.lt(localCliVersion, npmLatestVersion) && shouldSelfUpdate) {
78
- console.log();
79
- info(`Updating CLI from v${localCliVersion} to v${npmLatestVersion}...`);
80
- console.log(chalk.dim(' Fetching latest version from npm...\n'));
81
-
82
- // Build the command with all current options forwarded
83
- const args = ['agileflow@latest', 'update', '--self-updated'];
84
- if (options.directory) args.push('-d', options.directory);
85
- if (options.force) args.push('--force');
86
-
87
- const result = spawnSync('npx', args, {
88
- stdio: 'inherit',
89
- cwd: process.cwd(),
90
- shell: process.platform === 'win32',
91
- });
92
-
93
- // Exit with the same code as the spawned process
94
- process.exit(result.status ?? 0);
95
- }
96
-
97
97
  // If we self-updated, show confirmation
98
98
  if (options.selfUpdated) {
99
99
  success(`CLI updated to v${localCliVersion}`);