@sylphx/flow 1.0.3 → 1.0.4

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
+ ## 1.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix false "missing components" warning by checking if directories contain files
8
+
3
9
  ## 1.0.3
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sylphx/flow",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "AI-powered development workflow automation with autonomous loop mode and smart configuration",
5
5
  "type": "module",
6
6
  "bin": {
@@ -203,24 +203,28 @@ export class StateDetector {
203
203
  const fullPath = path.join(this.projectPath, componentPath);
204
204
  const exists = await fs.access(fullPath).then(() => true).catch(() => false);
205
205
 
206
- state.components[componentName].installed = exists;
206
+ if (!exists) {
207
+ state.components[componentName].installed = false;
208
+ return;
209
+ }
207
210
 
208
- if (exists) {
209
- // 计算文件数量
210
- const files = await fs.readdir(fullPath).catch(() => []);
211
- const count = pattern === '*.js' ? files.filter(f => f.endsWith('.js')).length :
212
- pattern === '*.md' ? files.filter(f => f.endsWith('.md')).length : files.length;
211
+ // 计算文件数量
212
+ const files = await fs.readdir(fullPath).catch(() => []);
213
+ const count = pattern === '*.js' ? files.filter(f => f.endsWith('.js')).length :
214
+ pattern === '*.md' ? files.filter(f => f.endsWith('.md')).length : files.length;
213
215
 
214
- if (componentName === 'agents' || componentName === 'slashCommands' || componentName === 'rules') {
215
- state.components[componentName].count = count;
216
- }
216
+ // Component is only installed if it has files
217
+ state.components[componentName].installed = count > 0;
217
218
 
218
- // 这里可以读取版本信息(如果保存了的话)
219
- const versionPath = path.join(fullPath, '.version');
220
- const versionExists = await fs.access(versionPath).then(() => true).catch(() => false);
221
- if (versionExists) {
222
- state.components[componentName].version = await fs.readFile(versionPath, 'utf-8');
223
- }
219
+ if (componentName === 'agents' || componentName === 'slashCommands' || componentName === 'rules') {
220
+ state.components[componentName].count = count;
221
+ }
222
+
223
+ // 这里可以读取版本信息(如果保存了的话)
224
+ const versionPath = path.join(fullPath, '.version');
225
+ const versionExists = await fs.access(versionPath).then(() => true).catch(() => false);
226
+ if (versionExists) {
227
+ state.components[componentName].version = await fs.readFile(versionPath, 'utf-8');
224
228
  }
225
229
  } catch {
226
230
  state.components[componentName].installed = false;