@sylphx/flow 1.8.0 → 1.8.2

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.
Files changed (126) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/assets/output-styles/silent.md +145 -8
  3. package/assets/rules/core.md +19 -2
  4. package/package.json +2 -12
  5. package/src/commands/flow/execute.ts +470 -0
  6. package/src/commands/flow/index.ts +11 -0
  7. package/src/commands/flow/prompt.ts +35 -0
  8. package/src/commands/flow/setup.ts +312 -0
  9. package/src/commands/flow/targets.ts +18 -0
  10. package/src/commands/flow/types.ts +47 -0
  11. package/src/commands/flow-command.ts +18 -967
  12. package/src/commands/flow-orchestrator.ts +14 -5
  13. package/src/commands/hook-command.ts +1 -1
  14. package/src/commands/init-core.ts +12 -3
  15. package/src/commands/run-command.ts +1 -1
  16. package/src/config/rules.ts +1 -1
  17. package/src/core/error-handling.ts +1 -1
  18. package/src/core/loop-controller.ts +1 -1
  19. package/src/core/state-detector.ts +1 -1
  20. package/src/core/target-manager.ts +1 -1
  21. package/src/index.ts +1 -1
  22. package/src/shared/files/index.ts +1 -1
  23. package/src/shared/processing/index.ts +1 -1
  24. package/src/targets/claude-code.ts +3 -3
  25. package/src/targets/opencode.ts +3 -3
  26. package/src/utils/agent-enhancer.ts +2 -2
  27. package/src/utils/{mcp-config.ts → config/mcp-config.ts} +4 -4
  28. package/src/utils/{paths.ts → config/paths.ts} +1 -1
  29. package/src/utils/{settings.ts → config/settings.ts} +1 -1
  30. package/src/utils/{target-config.ts → config/target-config.ts} +5 -5
  31. package/src/utils/{target-utils.ts → config/target-utils.ts} +3 -3
  32. package/src/utils/display/banner.ts +25 -0
  33. package/src/utils/display/status.ts +55 -0
  34. package/src/utils/{file-operations.ts → files/file-operations.ts} +2 -2
  35. package/src/utils/files/jsonc.ts +36 -0
  36. package/src/utils/{sync-utils.ts → files/sync-utils.ts} +3 -3
  37. package/src/utils/index.ts +42 -61
  38. package/src/utils/version.ts +47 -0
  39. package/src/components/benchmark-monitor.tsx +0 -331
  40. package/src/components/reindex-progress.tsx +0 -261
  41. package/src/composables/functional/index.ts +0 -14
  42. package/src/composables/functional/useEnvironment.ts +0 -171
  43. package/src/composables/functional/useFileSystem.ts +0 -139
  44. package/src/composables/index.ts +0 -4
  45. package/src/composables/useEnv.ts +0 -13
  46. package/src/composables/useRuntimeConfig.ts +0 -27
  47. package/src/core/ai-sdk.ts +0 -603
  48. package/src/core/app-factory.ts +0 -381
  49. package/src/core/builtin-agents.ts +0 -9
  50. package/src/core/command-system.ts +0 -550
  51. package/src/core/config-system.ts +0 -550
  52. package/src/core/connection-pool.ts +0 -390
  53. package/src/core/di-container.ts +0 -155
  54. package/src/core/headless-display.ts +0 -96
  55. package/src/core/interfaces/index.ts +0 -22
  56. package/src/core/interfaces/repository.interface.ts +0 -91
  57. package/src/core/interfaces/service.interface.ts +0 -133
  58. package/src/core/interfaces.ts +0 -96
  59. package/src/core/result.ts +0 -351
  60. package/src/core/service-config.ts +0 -252
  61. package/src/core/session-service.ts +0 -121
  62. package/src/core/storage-factory.ts +0 -115
  63. package/src/core/stream-handler.ts +0 -288
  64. package/src/core/type-utils.ts +0 -427
  65. package/src/core/unified-storage.ts +0 -456
  66. package/src/core/validation/limit.ts +0 -46
  67. package/src/core/validation/query.ts +0 -20
  68. package/src/db/auto-migrate.ts +0 -322
  69. package/src/db/base-database-client.ts +0 -144
  70. package/src/db/cache-db.ts +0 -218
  71. package/src/db/cache-schema.ts +0 -75
  72. package/src/db/database.ts +0 -70
  73. package/src/db/index.ts +0 -252
  74. package/src/db/memory-db.ts +0 -153
  75. package/src/db/memory-schema.ts +0 -29
  76. package/src/db/schema.ts +0 -289
  77. package/src/db/session-repository.ts +0 -733
  78. package/src/domains/index.ts +0 -6
  79. package/src/domains/utilities/index.ts +0 -6
  80. package/src/domains/utilities/time/index.ts +0 -5
  81. package/src/domains/utilities/time/tools.ts +0 -291
  82. package/src/services/agent-service.ts +0 -273
  83. package/src/services/evaluation-service.ts +0 -271
  84. package/src/services/functional/evaluation-logic.ts +0 -296
  85. package/src/services/functional/file-processor.ts +0 -273
  86. package/src/services/functional/index.ts +0 -12
  87. package/src/services/memory.service.ts +0 -476
  88. package/src/types/api/batch.ts +0 -108
  89. package/src/types/api/errors.ts +0 -118
  90. package/src/types/api/index.ts +0 -55
  91. package/src/types/api/requests.ts +0 -76
  92. package/src/types/api/responses.ts +0 -180
  93. package/src/types/api/websockets.ts +0 -85
  94. package/src/types/benchmark.ts +0 -49
  95. package/src/types/database.types.ts +0 -510
  96. package/src/types/memory-types.ts +0 -63
  97. package/src/utils/advanced-tokenizer.ts +0 -191
  98. package/src/utils/ai-model-fetcher.ts +0 -19
  99. package/src/utils/async-file-operations.ts +0 -516
  100. package/src/utils/audio-player.ts +0 -345
  101. package/src/utils/codebase-helpers.ts +0 -211
  102. package/src/utils/console-ui.ts +0 -79
  103. package/src/utils/database-errors.ts +0 -140
  104. package/src/utils/debug-logger.ts +0 -49
  105. package/src/utils/file-scanner.ts +0 -259
  106. package/src/utils/help.ts +0 -20
  107. package/src/utils/immutable-cache.ts +0 -106
  108. package/src/utils/jsonc.ts +0 -158
  109. package/src/utils/memory-tui.ts +0 -414
  110. package/src/utils/models-dev.ts +0 -91
  111. package/src/utils/parallel-operations.ts +0 -487
  112. package/src/utils/process-manager.ts +0 -155
  113. package/src/utils/prompts.ts +0 -120
  114. package/src/utils/search-tool-builder.ts +0 -214
  115. package/src/utils/session-manager.ts +0 -168
  116. package/src/utils/session-title.ts +0 -87
  117. package/src/utils/simplified-errors.ts +0 -410
  118. package/src/utils/template-engine.ts +0 -94
  119. package/src/utils/test-audio.ts +0 -71
  120. package/src/utils/todo-context.ts +0 -46
  121. package/src/utils/token-counter.ts +0 -288
  122. /package/src/utils/{cli-output.ts → display/cli-output.ts} +0 -0
  123. /package/src/utils/{logger.ts → display/logger.ts} +0 -0
  124. /package/src/utils/{notifications.ts → display/notifications.ts} +0 -0
  125. /package/src/utils/{secret-utils.ts → security/secret-utils.ts} +0 -0
  126. /package/src/utils/{security.ts → security/security.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,77 @@
1
1
  # @sylphx/flow
2
2
 
3
+ ## 1.8.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 9059450: Enhance Next Actions section with suggestions when no clear next step
8
+
9
+ Updated completion report structure to include proactive suggestions in Next Actions section:
10
+
11
+ - Remaining work (existing functionality)
12
+ - Suggestions when no clear next step (new)
13
+
14
+ Benefits:
15
+
16
+ - Guides user on potential improvements
17
+ - Provides proactive recommendations
18
+ - Helps prevent "what's next?" moments
19
+ - Encourages continuous iteration
20
+
21
+ Example updated to show suggestion format: "Consider adding rate limiting, implement refresh token rotation, add logging for security events"
22
+
23
+ ## 1.8.1
24
+
25
+ ### Patch Changes
26
+
27
+ - ad56fc3: Add structured completion report format to prompts
28
+
29
+ Added comprehensive 3-tier report structure to guide task completion reporting:
30
+
31
+ **Tier 1 - Always Required:**
32
+
33
+ - Summary, Changes, Commits, Tests, Documentation, Breaking Changes, Known Issues
34
+
35
+ **Tier 2 - When Relevant:**
36
+
37
+ - Dependencies, Tech Debt, Files Cleanup/Refactor, Next Actions
38
+
39
+ **Tier 3 - Major Changes Only:**
40
+
41
+ - Performance, Security, Migration, Verification, Rollback, Optimization Opportunities
42
+
43
+ Benefits:
44
+
45
+ - Forces LLM to remember completed work (must write report)
46
+ - Provides reviewable, structured output
47
+ - Prevents incomplete reporting
48
+ - Consistent format across all tasks
49
+
50
+ Includes detailed example for authentication refactoring showing proper usage of each section.
51
+
52
+ - a4b0b48: Fix broken imports and Ctrl+C handling
53
+
54
+ - Fix Ctrl+C gracefully exits during target selection instead of showing stack trace
55
+ - Restore accidentally deleted object-utils.ts file
56
+ - Correct 16 broken relative import paths from refactor reorganization:
57
+ - target-config.ts: Fix imports to config/, core/, services/ (5 paths)
58
+ - sync-utils.ts: Fix imports to types, servers, paths (3 paths)
59
+ - mcp-config.ts: Fix imports to config/, core/, target-config (4 paths)
60
+ - target-utils.ts: Fix import to types (1 path)
61
+ - execute.ts, setup.ts, flow-orchestrator.ts: Fix sync-utils paths (3 paths)
62
+
63
+ All module resolution errors fixed. Application now runs successfully.
64
+
65
+ - 7e3a3a1: Refactor codebase for better modularity and maintainability
66
+
67
+ - Split flow-command.ts into focused modules (1207 → 258 lines, 78% reduction)
68
+ - Reorganize utils into feature-based directories (config, display, files, security)
69
+ - Extract reusable utilities (version, banner, status, prompt resolution)
70
+ - Create modular flow command structure in src/commands/flow/
71
+ - Add JSONC parser utility for JSON with comments support
72
+ - Update all imports to use new modular structure
73
+ - Improve code organization and separation of concerns
74
+
3
75
  ## 1.8.0
4
76
 
5
77
  ### Minor Changes
@@ -15,23 +15,160 @@ User sees work through:
15
15
  - Test results
16
16
  - Commits
17
17
 
18
+ ---
19
+
18
20
  ## At Completion
19
21
 
20
- <!-- P0 --> Report what was accomplished, verification status, artifacts created.
22
+ Report what was accomplished. Structured, comprehensive, reviewable.
21
23
 
22
- <example>
23
- ✅ "Refactored 3 files. All tests passing. Published v1.2.3."
24
- "Fixed auth bug. Added test. Verified."
25
- ❌ [Silent after completing work]
26
- </example>
24
+ ### Report Structure
25
+
26
+ #### 🔴 Tier 1: Always Required
27
+
28
+ ```markdown
29
+ ## Summary
30
+ [1-2 sentences: what was done]
31
+
32
+ ## Changes
33
+ - [Key changes made]
34
+
35
+ ## Commits
36
+ - [List of commits with hashes]
37
+
38
+ ## Tests
39
+ - Status: ✅/❌
40
+ - Coverage: [if changed]
41
+
42
+ ## Documentation
43
+ - Updated: [files]
44
+ - Added: [files]
45
+
46
+ ## Breaking Changes
47
+ - [List, or "None"]
48
+
49
+ ## Known Issues
50
+ - [List, or "None"]
51
+ ```
52
+
53
+ #### 🟡 Tier 2: When Relevant
54
+
55
+ ```markdown
56
+ ## Dependencies
57
+ - Added: [package@version (reason)]
58
+ - Removed: [package@version (reason)]
59
+ - Updated: [package: old → new]
60
+
61
+ ## Tech Debt
62
+ - Removed: [what was cleaned]
63
+ - Added: [what was introduced, why acceptable]
64
+
65
+ ## Files
66
+ - Cleanup: [files removed/simplified]
67
+ - Refactored: [files restructured]
68
+
69
+ ## Next Actions
70
+ - [ ] [Remaining work]
71
+ - [Suggestions when no clear next step]
72
+ ```
73
+
74
+ #### 🔵 Tier 3: Major Changes Only
75
+
76
+ ```markdown
77
+ ## Performance
78
+ - Bundle: [size change]
79
+ - Speed: [improvement/regression]
80
+ - Memory: [change]
81
+
82
+ ## Security
83
+ - Fixed: [vulnerabilities]
84
+ - Added: [security measures]
85
+
86
+ ## Migration
87
+ Steps for users:
88
+ 1. [Action 1]
89
+ 2. [Action 2]
90
+
91
+ ## Verification
92
+ How to test:
93
+ 1. [Step 1]
94
+ 2. [Step 2]
95
+
96
+ ## Rollback
97
+ If issues:
98
+ 1. [Rollback step]
99
+
100
+ ## Optimization Opportunities
101
+ - [Future improvements]
102
+ ```
103
+
104
+ ### Example Report
105
+
106
+ ```markdown
107
+ ## Summary
108
+ Refactored authentication system to use JWT tokens instead of sessions.
109
+
110
+ ## Changes
111
+ - Replaced session middleware with JWT validation
112
+ - Added token refresh endpoint
113
+ - Updated user login flow
114
+
115
+ ## Commits
116
+ - feat(auth): add JWT token generation (a1b2c3d)
117
+ - feat(auth): implement token refresh (e4f5g6h)
118
+ - refactor(auth): remove session storage (i7j8k9l)
119
+ - docs(auth): update API documentation (m0n1o2p)
120
+
121
+ ## Tests
122
+ - Status: ✅ All passing (142/142)
123
+ - Coverage: 82% → 88% (+6%)
124
+ - New tests: 8 unit, 2 integration
125
+
126
+ ## Documentation
127
+ - Updated: API.md, auth-flow.md
128
+ - Added: jwt-setup.md
129
+
130
+ ## Breaking Changes
131
+ - Session cookies no longer supported
132
+ - `/auth/session` endpoint removed
133
+ - Users must implement token storage
134
+
135
+ ## Known Issues
136
+ - None
137
+
138
+ ## Dependencies
139
+ - Added: jsonwebtoken@9.0.0 (JWT signing/verification)
140
+ - Removed: express-session@1.17.0 (replaced by JWT)
141
+
142
+ ## Next Actions
143
+ - Suggestions: Consider adding rate limiting, implement refresh token rotation, add logging for security events
144
+
145
+ ## Migration
146
+ Users need to:
147
+ 1. Update client to store tokens: `localStorage.setItem('token', response.token)`
148
+ 2. Add Authorization header: `Authorization: Bearer ${token}`
149
+ 3. Implement token refresh on 401 errors
150
+
151
+ ## Performance
152
+ - Bundle: -15KB (removed session dependencies)
153
+ - Login speed: -120ms (no server session lookup)
154
+
155
+ ## Verification
156
+ 1. Run: `npm test`
157
+ 2. Test login: Should receive token in response
158
+ 3. Test protected route: Should work with Authorization header
159
+ ```
160
+
161
+ ---
27
162
 
28
163
  ## Never
29
164
 
30
- <!-- P0 --> Don't narrate during execution.
165
+ Don't narrate during execution.
31
166
 
32
167
  <example>
33
168
  ❌ "Now I'm going to search for the authentication logic..."
34
169
  ✅ [Uses Grep tool silently]
35
170
  </example>
36
171
 
37
- <!-- P1 --> Don't create report files (ANALYSIS.md, FINDINGS.md, REPORT.md).
172
+ Don't create report files (ANALYSIS.md, FINDINGS.md, REPORT.md).
173
+
174
+ Report directly to user at completion.
@@ -143,11 +143,28 @@ When stuck:
143
143
 
144
144
  **Output Style**: Concise and direct. No fluff, no apologies, no hedging. Show, don't tell. Code examples over explanations. One clear statement over three cautious ones.
145
145
 
146
- **Task Completion**: Report accomplishments, verification, changes.
146
+ **Task Completion**: Report accomplishments using structured format.
147
+
148
+ Always include:
149
+ - Summary (what was done)
150
+ - Commits (with hashes)
151
+ - Tests (status + coverage)
152
+ - Documentation (updated files)
153
+ - Breaking changes (if any)
154
+ - Known issues (if any)
155
+
156
+ When relevant, add:
157
+ - Dependencies changed
158
+ - Tech debt status
159
+ - Files cleanup/refactor
160
+ - Next actions
161
+
162
+ See output-styles for detailed report structure.
147
163
 
148
164
  <example>
149
- "Refactored 5 files. 47 tests passing. No breaking changes."
165
+ Structured report with all required sections
150
166
  ❌ [Silent after completing work]
167
+ ❌ "Done" (no details)
151
168
  </example>
152
169
 
153
170
  **Minimal Effective Prompt**: All docs, comments, delegation messages.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sylphx/flow",
3
- "version": "1.8.0",
3
+ "version": "1.8.2",
4
4
  "description": "AI-powered development workflow automation with autonomous loop mode and smart configuration",
5
5
  "type": "module",
6
6
  "bin": {
@@ -27,17 +27,7 @@
27
27
  "gray-matter": "^4.0.3",
28
28
  "yaml": "^2.8.1",
29
29
  "zod": "^4.1.12",
30
- "debug": "^4.4.3",
31
- "react": "^19.2.0",
32
- "ink": "^6.4.0",
33
- "drizzle-orm": "^0.44.7",
34
- "@modelcontextprotocol/sdk": "^1.21.0",
35
- "@libsql/client": "^0.15.15",
36
- "@lancedb/lancedb": "^0.22.2",
37
- "@huggingface/transformers": "^3.7.6",
38
- "chokidar": "^4.0.3",
39
- "ignore": "^7.0.5",
40
- "ai": "^5.0.88"
30
+ "debug": "^4.4.3"
41
31
  },
42
32
  "devDependencies": {
43
33
  "@types/node": "^24.9.2",