@sylphx/flow 1.4.3 → 1.4.5

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,17 @@
1
1
  # @sylphx/flow
2
2
 
3
+ ## 1.4.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 4de084e: Add comprehensive debug logging to trace sync file operations:
8
+
9
+ - **Deletion verification**: Check file exists before/after unlink to verify actual deletion
10
+ - **Installation logging**: Show force flag status, file paths, and write verification
11
+ - **Force flag propagation**: Log when force mode is activated for agents and slash commands
12
+
13
+ This diagnostic release helps identify why sync appears successful but git shows no changes.
14
+
3
15
  ## 1.4.3
4
16
 
5
17
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sylphx/flow",
3
- "version": "1.4.3",
3
+ "version": "1.4.5",
4
4
  "description": "AI-powered development workflow automation with autonomous loop mode and smart configuration",
5
5
  "type": "module",
6
6
  "bin": {
@@ -168,6 +168,11 @@ export async function installComponents(
168
168
  if (target.setupAgents && options.agents !== false) {
169
169
  const agentSpinner = quiet ? null : ora({ text: 'Installing agents', color: 'cyan' }).start();
170
170
  try {
171
+ // DEBUG: Log force flag
172
+ if (!quiet && options.clear) {
173
+ console.log(`[DEBUG] Installing agents with force=${options.clear}`);
174
+ }
175
+
171
176
  const agentResult = await target.setupAgents(process.cwd(), { ...options, quiet: true, force: options.clear });
172
177
  result.installed.agents = agentResult.count;
173
178
 
@@ -247,6 +252,11 @@ export async function installComponents(
247
252
  color: 'cyan',
248
253
  }).start();
249
254
  try {
255
+ // DEBUG: Log force flag
256
+ if (!quiet && options.clear) {
257
+ console.log(`[DEBUG] Installing slash commands with force=${options.clear}`);
258
+ }
259
+
250
260
  const commandsResult = await target.setupSlashCommands(process.cwd(), { ...options, quiet: true, force: options.clear });
251
261
  result.installed.slashCommands = commandsResult.count;
252
262
 
@@ -124,9 +124,36 @@ export async function installToDirectory(
124
124
  let content = fs.readFileSync(sourcePath, 'utf8');
125
125
  content = await transform(content, file);
126
126
 
127
+ // DEBUG: Log installation details (always show in force mode)
128
+ if (options.force) {
129
+ console.log(
130
+ `[DEBUG] Installing ${file} - force=${options.force}, exists=${!!localInfo}, path=${targetPath}`
131
+ );
132
+ }
133
+
127
134
  // Force mode: always overwrite without checking
128
135
  if (options.force) {
136
+ const contentPreview = content.substring(0, 100).replace(/\n/g, ' ');
137
+ console.log(`[DEBUG] Writing content (first 100 chars): ${contentPreview}...`);
138
+
129
139
  fs.writeFileSync(targetPath, content, 'utf8');
140
+
141
+ // DEBUG: Verify write and read back
142
+ const written = fs.existsSync(targetPath);
143
+ if (!written) {
144
+ console.warn(`[DEBUG] ⚠ Failed to write: ${targetPath}`);
145
+ } else {
146
+ const readBack = fs.readFileSync(targetPath, 'utf8');
147
+ const readBackPreview = readBack.substring(0, 100).replace(/\n/g, ' ');
148
+ console.log(`[DEBUG] Read back (first 100 chars): ${readBackPreview}...`);
149
+
150
+ if (readBack !== content) {
151
+ console.warn(`[DEBUG] ⚠ Content mismatch! Written ${content.length} bytes, read ${readBack.length} bytes`);
152
+ } else {
153
+ console.log(`[DEBUG] ✓ Verified write: ${targetPath}`);
154
+ }
155
+ }
156
+
130
157
  results.push({
131
158
  file,
132
159
  status: localInfo ? 'updated' : 'added',
@@ -388,12 +388,25 @@ export async function executeSyncDelete(
388
388
  // Delete Flow templates
389
389
  for (const file of flowFiles) {
390
390
  try {
391
+ const existsBefore = fs.existsSync(file);
392
+ if (!existsBefore) {
393
+ console.log(chalk.dim(` ⊘ Already deleted: ${path.basename(file)}`));
394
+ continue;
395
+ }
396
+
391
397
  await fs.promises.unlink(file);
392
- console.log(chalk.dim(` ✓ Deleted: ${path.basename(file)}`));
393
- templatesDeleted++;
398
+
399
+ // Verify deletion
400
+ const existsAfter = fs.existsSync(file);
401
+ if (existsAfter) {
402
+ console.warn(chalk.yellow(` ⚠ File still exists after deletion: ${path.basename(file)}`));
403
+ } else {
404
+ console.log(chalk.dim(` ✓ Deleted: ${path.basename(file)}`));
405
+ templatesDeleted++;
406
+ }
394
407
  } catch (error) {
395
408
  if ((error as NodeJS.ErrnoException).code !== 'ENOENT') {
396
- console.warn(chalk.yellow(` ⚠ Failed to delete: ${path.basename(file)}`));
409
+ console.warn(chalk.yellow(` ⚠ Failed to delete: ${path.basename(file)} - ${error}`));
397
410
  }
398
411
  }
399
412
  }