@sylphx/flow 1.8.0 → 1.8.1

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 +52 -0
  2. package/assets/output-styles/silent.md +141 -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,57 @@
1
1
  # @sylphx/flow
2
2
 
3
+ ## 1.8.1
4
+
5
+ ### Patch Changes
6
+
7
+ - ad56fc3: Add structured completion report format to prompts
8
+
9
+ Added comprehensive 3-tier report structure to guide task completion reporting:
10
+
11
+ **Tier 1 - Always Required:**
12
+
13
+ - Summary, Changes, Commits, Tests, Documentation, Breaking Changes, Known Issues
14
+
15
+ **Tier 2 - When Relevant:**
16
+
17
+ - Dependencies, Tech Debt, Files Cleanup/Refactor, Next Actions
18
+
19
+ **Tier 3 - Major Changes Only:**
20
+
21
+ - Performance, Security, Migration, Verification, Rollback, Optimization Opportunities
22
+
23
+ Benefits:
24
+
25
+ - Forces LLM to remember completed work (must write report)
26
+ - Provides reviewable, structured output
27
+ - Prevents incomplete reporting
28
+ - Consistent format across all tasks
29
+
30
+ Includes detailed example for authentication refactoring showing proper usage of each section.
31
+
32
+ - a4b0b48: Fix broken imports and Ctrl+C handling
33
+
34
+ - Fix Ctrl+C gracefully exits during target selection instead of showing stack trace
35
+ - Restore accidentally deleted object-utils.ts file
36
+ - Correct 16 broken relative import paths from refactor reorganization:
37
+ - target-config.ts: Fix imports to config/, core/, services/ (5 paths)
38
+ - sync-utils.ts: Fix imports to types, servers, paths (3 paths)
39
+ - mcp-config.ts: Fix imports to config/, core/, target-config (4 paths)
40
+ - target-utils.ts: Fix import to types (1 path)
41
+ - execute.ts, setup.ts, flow-orchestrator.ts: Fix sync-utils paths (3 paths)
42
+
43
+ All module resolution errors fixed. Application now runs successfully.
44
+
45
+ - 7e3a3a1: Refactor codebase for better modularity and maintainability
46
+
47
+ - Split flow-command.ts into focused modules (1207 → 258 lines, 78% reduction)
48
+ - Reorganize utils into feature-based directories (config, display, files, security)
49
+ - Extract reusable utilities (version, banner, status, prompt resolution)
50
+ - Create modular flow command structure in src/commands/flow/
51
+ - Add JSONC parser utility for JSON with comments support
52
+ - Update all imports to use new modular structure
53
+ - Improve code organization and separation of concerns
54
+
3
55
  ## 1.8.0
4
56
 
5
57
  ### Minor Changes
@@ -15,23 +15,156 @@ 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
+ ```
72
+
73
+ #### 🔵 Tier 3: Major Changes Only
74
+
75
+ ```markdown
76
+ ## Performance
77
+ - Bundle: [size change]
78
+ - Speed: [improvement/regression]
79
+ - Memory: [change]
80
+
81
+ ## Security
82
+ - Fixed: [vulnerabilities]
83
+ - Added: [security measures]
84
+
85
+ ## Migration
86
+ Steps for users:
87
+ 1. [Action 1]
88
+ 2. [Action 2]
89
+
90
+ ## Verification
91
+ How to test:
92
+ 1. [Step 1]
93
+ 2. [Step 2]
94
+
95
+ ## Rollback
96
+ If issues:
97
+ 1. [Rollback step]
98
+
99
+ ## Optimization Opportunities
100
+ - [Future improvements]
101
+ ```
102
+
103
+ ### Example Report
104
+
105
+ ```markdown
106
+ ## Summary
107
+ Refactored authentication system to use JWT tokens instead of sessions.
108
+
109
+ ## Changes
110
+ - Replaced session middleware with JWT validation
111
+ - Added token refresh endpoint
112
+ - Updated user login flow
113
+
114
+ ## Commits
115
+ - feat(auth): add JWT token generation (a1b2c3d)
116
+ - feat(auth): implement token refresh (e4f5g6h)
117
+ - refactor(auth): remove session storage (i7j8k9l)
118
+ - docs(auth): update API documentation (m0n1o2p)
119
+
120
+ ## Tests
121
+ - Status: ✅ All passing (142/142)
122
+ - Coverage: 82% → 88% (+6%)
123
+ - New tests: 8 unit, 2 integration
124
+
125
+ ## Documentation
126
+ - Updated: API.md, auth-flow.md
127
+ - Added: jwt-setup.md
128
+
129
+ ## Breaking Changes
130
+ - Session cookies no longer supported
131
+ - `/auth/session` endpoint removed
132
+ - Users must implement token storage
133
+
134
+ ## Known Issues
135
+ - None
136
+
137
+ ## Dependencies
138
+ - Added: jsonwebtoken@9.0.0 (JWT signing/verification)
139
+ - Removed: express-session@1.17.0 (replaced by JWT)
140
+
141
+ ## Migration
142
+ Users need to:
143
+ 1. Update client to store tokens: `localStorage.setItem('token', response.token)`
144
+ 2. Add Authorization header: `Authorization: Bearer ${token}`
145
+ 3. Implement token refresh on 401 errors
146
+
147
+ ## Performance
148
+ - Bundle: -15KB (removed session dependencies)
149
+ - Login speed: -120ms (no server session lookup)
150
+
151
+ ## Verification
152
+ 1. Run: `npm test`
153
+ 2. Test login: Should receive token in response
154
+ 3. Test protected route: Should work with Authorization header
155
+ ```
156
+
157
+ ---
27
158
 
28
159
  ## Never
29
160
 
30
- <!-- P0 --> Don't narrate during execution.
161
+ Don't narrate during execution.
31
162
 
32
163
  <example>
33
164
  ❌ "Now I'm going to search for the authentication logic..."
34
165
  ✅ [Uses Grep tool silently]
35
166
  </example>
36
167
 
37
- <!-- P1 --> Don't create report files (ANALYSIS.md, FINDINGS.md, REPORT.md).
168
+ Don't create report files (ANALYSIS.md, FINDINGS.md, REPORT.md).
169
+
170
+ 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.1",
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",