@sylphx/flow 1.4.11 → 1.4.12

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,14 @@
1
1
  # @sylphx/flow
2
2
 
3
+ ## 1.4.12
4
+
5
+ ### Patch Changes
6
+
7
+ - d88d280: Show missing templates in sync preview:
8
+ - Added "Will install (new templates)" section
9
+ - Users can now see which templates will be newly installed
10
+ - Better visibility into what changes sync will make
11
+
3
12
  ## 1.4.11
4
13
 
5
14
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sylphx/flow",
3
- "version": "1.4.11",
3
+ "version": "1.4.12",
4
4
  "description": "AI-powered development workflow automation with autonomous loop mode and smart configuration",
5
5
  "type": "module",
6
6
  "bin": {
@@ -31,8 +31,9 @@ const FLOW_RULES = scanTemplateDir(getRulesDir());
31
31
  * Categorized files for sync
32
32
  */
33
33
  interface CategorizedFiles {
34
- inFlow: string[]; // Files that exist in Flow templates
34
+ inFlow: string[]; // Files that exist locally and in Flow templates (will reinstall)
35
35
  unknown: string[]; // Files not in Flow templates (custom or removed)
36
+ missing: string[]; // Flow templates that don't exist locally (will install)
36
37
  }
37
38
 
38
39
  /**
@@ -50,11 +51,15 @@ interface SyncManifest {
50
51
  }
51
52
 
52
53
  /**
53
- * Categorize files into Flow templates vs unknown
54
+ * Categorize files into Flow templates vs unknown, and detect missing templates
54
55
  */
55
56
  function categorizeFiles(files: string[], flowTemplates: string[]): CategorizedFiles {
56
57
  const inFlow: string[] = [];
57
58
  const unknown: string[] = [];
59
+ const existingBasenames = files.map((f) => path.basename(f));
60
+
61
+ // Find missing Flow templates (in flowTemplates but not in files)
62
+ const missing = flowTemplates.filter((template) => !existingBasenames.includes(template));
58
63
 
59
64
  for (const file of files) {
60
65
  const basename = path.basename(file);
@@ -65,7 +70,7 @@ function categorizeFiles(files: string[], flowTemplates: string[]): CategorizedF
65
70
  }
66
71
  }
67
72
 
68
- return { inFlow, unknown };
73
+ return { inFlow, unknown, missing };
69
74
  }
70
75
 
71
76
  /**
@@ -73,9 +78,9 @@ function categorizeFiles(files: string[], flowTemplates: string[]): CategorizedF
73
78
  */
74
79
  export async function buildSyncManifest(cwd: string, target: Target): Promise<SyncManifest> {
75
80
  const manifest: SyncManifest = {
76
- agents: { inFlow: [], unknown: [] },
77
- slashCommands: { inFlow: [], unknown: [] },
78
- rules: { inFlow: [], unknown: [] },
81
+ agents: { inFlow: [], unknown: [], missing: [] },
82
+ slashCommands: { inFlow: [], unknown: [], missing: [] },
83
+ rules: { inFlow: [], unknown: [], missing: [] },
79
84
  mcpServers: { inRegistry: [], notInRegistry: [] },
80
85
  preserve: [],
81
86
  };
@@ -214,6 +219,40 @@ export function showSyncPreview(manifest: SyncManifest, cwd: string): void {
214
219
  }
215
220
  }
216
221
 
222
+ // Missing templates section (will be installed)
223
+ const hasMissingFiles =
224
+ manifest.agents.missing.length > 0 ||
225
+ manifest.slashCommands.missing.length > 0 ||
226
+ manifest.rules.missing.length > 0;
227
+
228
+ if (hasMissingFiles) {
229
+ console.log(chalk.green('Will install (new templates):\n'));
230
+
231
+ if (manifest.agents.missing.length > 0) {
232
+ console.log(chalk.dim(' Agents:'));
233
+ manifest.agents.missing.forEach((file) => {
234
+ console.log(chalk.dim(` + ${file}`));
235
+ });
236
+ console.log('');
237
+ }
238
+
239
+ if (manifest.slashCommands.missing.length > 0) {
240
+ console.log(chalk.dim(' Commands:'));
241
+ manifest.slashCommands.missing.forEach((file) => {
242
+ console.log(chalk.dim(` + ${file}`));
243
+ });
244
+ console.log('');
245
+ }
246
+
247
+ if (manifest.rules.missing.length > 0) {
248
+ console.log(chalk.dim(' Rules:'));
249
+ manifest.rules.missing.forEach((file) => {
250
+ console.log(chalk.dim(` + ${file}`));
251
+ });
252
+ console.log('');
253
+ }
254
+ }
255
+
217
256
  // Unknown files section
218
257
  const hasUnknownFiles =
219
258
  manifest.agents.unknown.length > 0 ||