crewx 0.1.0 → 0.1.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 (195) hide show
  1. package/LICENSE +197 -9
  2. package/README.md +120 -28
  3. package/crewx.yaml +1273 -0
  4. package/dist/agent.types.d.ts +92 -0
  5. package/dist/agent.types.js +16 -0
  6. package/dist/agent.types.js.map +1 -0
  7. package/dist/ai-provider.service.d.ts +25 -0
  8. package/dist/ai-provider.service.js +138 -0
  9. package/dist/ai-provider.service.js.map +1 -0
  10. package/dist/ai.service.d.ts +50 -0
  11. package/dist/ai.service.js +625 -0
  12. package/dist/ai.service.js.map +1 -0
  13. package/dist/app.module.d.ts +5 -0
  14. package/dist/app.module.js +88 -0
  15. package/dist/app.module.js.map +1 -0
  16. package/dist/cli/chat.handler.d.ts +19 -0
  17. package/dist/cli/chat.handler.js +429 -0
  18. package/dist/cli/chat.handler.js.map +1 -0
  19. package/dist/cli/cli.handler.d.ts +4 -0
  20. package/dist/cli/cli.handler.js +93 -0
  21. package/dist/cli/cli.handler.js.map +1 -0
  22. package/dist/cli/doctor.handler.d.ts +36 -0
  23. package/dist/cli/doctor.handler.js +382 -0
  24. package/dist/cli/doctor.handler.js.map +1 -0
  25. package/dist/cli/execute.handler.d.ts +2 -0
  26. package/dist/cli/execute.handler.js +269 -0
  27. package/dist/cli/execute.handler.js.map +1 -0
  28. package/dist/cli/help.handler.d.ts +2 -0
  29. package/dist/cli/help.handler.js +10 -0
  30. package/dist/cli/help.handler.js.map +1 -0
  31. package/dist/cli/init.handler.d.ts +25 -0
  32. package/dist/cli/init.handler.js +355 -0
  33. package/dist/cli/init.handler.js.map +1 -0
  34. package/dist/cli/query.handler.d.ts +2 -0
  35. package/dist/cli/query.handler.js +351 -0
  36. package/dist/cli/query.handler.js.map +1 -0
  37. package/dist/cli/templates.handler.d.ts +2 -0
  38. package/dist/cli/templates.handler.js +100 -0
  39. package/dist/cli/templates.handler.js.map +1 -0
  40. package/dist/cli-options.d.ts +22 -0
  41. package/dist/cli-options.js +195 -0
  42. package/dist/cli-options.js.map +1 -0
  43. package/dist/config/timeout.config.d.ts +14 -0
  44. package/dist/config/timeout.config.js +34 -0
  45. package/dist/config/timeout.config.js.map +1 -0
  46. package/dist/constants.d.ts +4 -0
  47. package/dist/constants.js +8 -0
  48. package/dist/constants.js.map +1 -0
  49. package/dist/conversation/base-conversation-history.provider.d.ts +12 -0
  50. package/dist/conversation/base-conversation-history.provider.js +45 -0
  51. package/dist/conversation/base-conversation-history.provider.js.map +1 -0
  52. package/dist/conversation/cli-conversation-history.provider.d.ts +16 -0
  53. package/dist/conversation/cli-conversation-history.provider.js +104 -0
  54. package/dist/conversation/cli-conversation-history.provider.js.map +1 -0
  55. package/dist/conversation/conversation-config.d.ts +9 -0
  56. package/dist/conversation/conversation-config.js +25 -0
  57. package/dist/conversation/conversation-config.js.map +1 -0
  58. package/dist/conversation/conversation-history.interface.d.ts +25 -0
  59. package/dist/conversation/conversation-history.interface.js +3 -0
  60. package/dist/conversation/conversation-history.interface.js.map +1 -0
  61. package/dist/conversation/conversation-provider.factory.d.ts +10 -0
  62. package/dist/conversation/conversation-provider.factory.js +50 -0
  63. package/dist/conversation/conversation-provider.factory.js.map +1 -0
  64. package/dist/conversation/conversation-storage.service.d.ts +15 -0
  65. package/dist/conversation/conversation-storage.service.js +182 -0
  66. package/dist/conversation/conversation-storage.service.js.map +1 -0
  67. package/dist/conversation/index.d.ts +7 -0
  68. package/dist/conversation/index.js +24 -0
  69. package/dist/conversation/index.js.map +1 -0
  70. package/dist/conversation/slack-conversation-history.provider.d.ts +22 -0
  71. package/dist/conversation/slack-conversation-history.provider.js +239 -0
  72. package/dist/conversation/slack-conversation-history.provider.js.map +1 -0
  73. package/dist/crewx.tool.d.ts +421 -0
  74. package/dist/crewx.tool.js +1240 -0
  75. package/dist/crewx.tool.js.map +1 -0
  76. package/dist/knowledge/DocumentManager.d.ts +4 -0
  77. package/dist/knowledge/DocumentManager.js +119 -0
  78. package/dist/knowledge/DocumentManager.js.map +1 -0
  79. package/dist/main.d.ts +1 -0
  80. package/dist/main.js +230 -0
  81. package/dist/main.js.map +1 -0
  82. package/dist/mcp.controller.d.ts +8 -0
  83. package/dist/mcp.controller.js +60 -0
  84. package/dist/mcp.controller.js.map +1 -0
  85. package/dist/project.service.d.ts +44 -0
  86. package/dist/project.service.js +299 -0
  87. package/dist/project.service.js.map +1 -0
  88. package/dist/providers/ai-provider.interface.d.ts +30 -0
  89. package/dist/providers/ai-provider.interface.js +11 -0
  90. package/dist/providers/ai-provider.interface.js.map +1 -0
  91. package/dist/providers/base-ai.provider.d.ts +42 -0
  92. package/dist/providers/base-ai.provider.js +515 -0
  93. package/dist/providers/base-ai.provider.js.map +1 -0
  94. package/dist/providers/claude.provider.d.ts +25 -0
  95. package/dist/providers/claude.provider.js +376 -0
  96. package/dist/providers/claude.provider.js.map +1 -0
  97. package/dist/providers/copilot.provider.d.ts +25 -0
  98. package/dist/providers/copilot.provider.js +280 -0
  99. package/dist/providers/copilot.provider.js.map +1 -0
  100. package/dist/providers/gemini.provider.d.ts +22 -0
  101. package/dist/providers/gemini.provider.js +163 -0
  102. package/dist/providers/gemini.provider.js.map +1 -0
  103. package/dist/services/agent-loader.service.d.ts +23 -0
  104. package/dist/services/agent-loader.service.js +313 -0
  105. package/dist/services/agent-loader.service.js.map +1 -0
  106. package/dist/services/config-validator.service.d.ts +28 -0
  107. package/dist/services/config-validator.service.js +427 -0
  108. package/dist/services/config-validator.service.js.map +1 -0
  109. package/dist/services/config.service.d.ts +25 -0
  110. package/dist/services/config.service.js +102 -0
  111. package/dist/services/config.service.js.map +1 -0
  112. package/dist/services/context-enhancement.service.d.ts +13 -0
  113. package/dist/services/context-enhancement.service.js +169 -0
  114. package/dist/services/context-enhancement.service.js.map +1 -0
  115. package/dist/services/document-loader.service.d.ts +16 -0
  116. package/dist/services/document-loader.service.js +137 -0
  117. package/dist/services/document-loader.service.js.map +1 -0
  118. package/dist/services/help.service.d.ts +5 -0
  119. package/dist/services/help.service.js +112 -0
  120. package/dist/services/help.service.js.map +1 -0
  121. package/dist/services/intelligent-compression.service.d.ts +20 -0
  122. package/dist/services/intelligent-compression.service.js +179 -0
  123. package/dist/services/intelligent-compression.service.js.map +1 -0
  124. package/dist/services/parallel-processing.service.d.ts +108 -0
  125. package/dist/services/parallel-processing.service.js +266 -0
  126. package/dist/services/parallel-processing.service.js.map +1 -0
  127. package/dist/services/result-formatter.service.d.ts +27 -0
  128. package/dist/services/result-formatter.service.js +126 -0
  129. package/dist/services/result-formatter.service.js.map +1 -0
  130. package/dist/services/task-management.service.d.ts +63 -0
  131. package/dist/services/task-management.service.js +270 -0
  132. package/dist/services/task-management.service.js.map +1 -0
  133. package/dist/services/template.service.d.ts +36 -0
  134. package/dist/services/template.service.js +195 -0
  135. package/dist/services/template.service.js.map +1 -0
  136. package/dist/services/tool-call.service.d.ts +53 -0
  137. package/dist/services/tool-call.service.js +819 -0
  138. package/dist/services/tool-call.service.js.map +1 -0
  139. package/dist/slack/formatters/message.formatter.d.ts +25 -0
  140. package/dist/slack/formatters/message.formatter.js +246 -0
  141. package/dist/slack/formatters/message.formatter.js.map +1 -0
  142. package/dist/slack/slack-bot.d.ts +23 -0
  143. package/dist/slack/slack-bot.js +435 -0
  144. package/dist/slack/slack-bot.js.map +1 -0
  145. package/dist/stderr.logger.d.ts +8 -0
  146. package/dist/stderr.logger.js +26 -0
  147. package/dist/stderr.logger.js.map +1 -0
  148. package/dist/tsconfig.tsbuildinfo +1 -0
  149. package/dist/utils/config-utils.d.ts +15 -0
  150. package/dist/utils/config-utils.js +69 -0
  151. package/dist/utils/config-utils.js.map +1 -0
  152. package/dist/utils/error-utils.d.ts +3 -0
  153. package/dist/utils/error-utils.js +27 -0
  154. package/dist/utils/error-utils.js.map +1 -0
  155. package/dist/utils/math-utils.d.ts +3 -0
  156. package/dist/utils/math-utils.js +10 -0
  157. package/dist/utils/math-utils.js.map +1 -0
  158. package/dist/utils/mcp-installer.d.ts +20 -0
  159. package/dist/utils/mcp-installer.js +199 -0
  160. package/dist/utils/mcp-installer.js.map +1 -0
  161. package/dist/utils/mention-parser.d.ts +18 -0
  162. package/dist/utils/mention-parser.js +136 -0
  163. package/dist/utils/mention-parser.js.map +1 -0
  164. package/dist/utils/simple-security.d.ts +3 -0
  165. package/dist/utils/simple-security.js +20 -0
  166. package/dist/utils/simple-security.js.map +1 -0
  167. package/dist/utils/stdin-utils.d.ts +2 -0
  168. package/dist/utils/stdin-utils.js +87 -0
  169. package/dist/utils/stdin-utils.js.map +1 -0
  170. package/dist/utils/string-utils.d.ts +1 -0
  171. package/dist/utils/string-utils.js +10 -0
  172. package/dist/utils/string-utils.js.map +1 -0
  173. package/dist/utils/template-processor.d.ts +32 -0
  174. package/dist/utils/template-processor.js +188 -0
  175. package/dist/utils/template-processor.js.map +1 -0
  176. package/docs/agent-configuration.md +373 -0
  177. package/docs/agent-registry-strategy.md +348 -0
  178. package/docs/branding-decision-crewx.md +395 -0
  179. package/docs/claude-code-docker-guide.md +264 -0
  180. package/docs/cli-guide.md +295 -0
  181. package/docs/development.md +595 -0
  182. package/docs/guides/agent-best-practices.md +97 -0
  183. package/docs/guides/bug-management.md +600 -0
  184. package/docs/guides/git-bug-reference.md +366 -0
  185. package/docs/mcp-integration.md +187 -0
  186. package/docs/process/development-workflow.md +84 -0
  187. package/docs/roadmap.md +528 -0
  188. package/docs/rules/branch-protection.md +40 -0
  189. package/docs/standards/rc-versioning.md +60 -0
  190. package/docs/standards/report-structure.md +67 -0
  191. package/docs/templates.md +517 -0
  192. package/docs/tools.md +583 -0
  193. package/docs/troubleshooting.md +585 -0
  194. package/package.json +106 -21
  195. package/bin/crewx.js +0 -20
@@ -0,0 +1,295 @@
1
+ # CLI Guide
2
+
3
+ Complete reference for CrewX's command-line interface.
4
+
5
+ ## Core Commands
6
+
7
+ ### `crewx` (default)
8
+ Shows help and available commands.
9
+
10
+ ```bash
11
+ crewx
12
+ ```
13
+
14
+ ### `crewx init`
15
+ Initialize project with `crewx.yaml` configuration.
16
+
17
+ ```bash
18
+ crewx init # Initialize with default configuration
19
+ crewx init --config custom.yaml # Use custom config filename
20
+ crewx init --force # Overwrite existing configuration
21
+ ```
22
+
23
+ **Features:**
24
+ - Creates `crewx.yaml` with default agents (Claude, Gemini, Copilot)
25
+ - Sets up `.crewx/logs` directory
26
+ - Prevents accidental overwrites (use `--force` to override)
27
+
28
+ > **Note:** For backward compatibility, `agents.yaml` is still supported, but `crewx.yaml` is preferred.
29
+
30
+ ### `crewx doctor`
31
+ System health check and diagnostics.
32
+
33
+ ```bash
34
+ crewx doctor # Full system diagnosis
35
+ crewx doctor --config path/to/config.yaml # Use custom config
36
+ ```
37
+
38
+ **Checks:**
39
+ - Configuration file (`crewx.yaml` or `agents.yaml`) validity
40
+ - AI CLI tool availability (Claude, Gemini, Copilot)
41
+ - Real test queries to verify responses
42
+ - Session limits and performance
43
+ - Provides troubleshooting recommendations
44
+
45
+ ### `crewx query`
46
+ Read-only analysis and queries.
47
+
48
+ ```bash
49
+ # Basic queries
50
+ crewx query "@claude analyze this function"
51
+ crewx query "@gemini explain the algorithm"
52
+
53
+ # Multiple agents in parallel
54
+ crewx query "@claude @gemini @copilot review security"
55
+
56
+ # With model selection
57
+ crewx query "@claude:opus detailed code review"
58
+ crewx query "@gemini:gemini-2.5-pro optimize algorithm"
59
+ crewx query "@copilot:gpt-5 suggest best practices"
60
+
61
+ # With conversation history
62
+ crewx query "@claude explain auth" --thread "auth-session"
63
+
64
+ # Pipeline input
65
+ echo "user auth code" | crewx query "@claude explain this"
66
+ ```
67
+
68
+ **Available Models:**
69
+ - **Claude**: `opus`, `sonnet`, `haiku`, `claude-sonnet-4-5`, `claude-sonnet-4-5-20250929`
70
+ - **Gemini**: `gemini-2.5-pro` (default), `gemini-2.5-flash`
71
+ - **Copilot**: `gpt-5`, `claude-sonnet-4`, `claude-sonnet-4.5`
72
+
73
+ ### `crewx execute`
74
+ Execute tasks with file creation/modification.
75
+
76
+ ```bash
77
+ # Basic execution
78
+ crewx execute "@claude create a React component"
79
+
80
+ # Multiple agents in parallel
81
+ crewx execute "@claude @gemini implement different sorting algorithms"
82
+
83
+ # With model selection
84
+ crewx execute "@claude:opus implement complex auth system"
85
+ crewx execute "@gemini:gemini-2.5-pro optimize critical code"
86
+
87
+ # With conversation history
88
+ crewx execute "@claude implement login" --thread "auth-feature"
89
+
90
+ # Pipeline workflows
91
+ crewx query "@architect design API" | \
92
+ crewx execute "@backend implement the design"
93
+ ```
94
+
95
+ ## Pipeline Workflows
96
+
97
+ Chain commands for complex multi-step workflows:
98
+
99
+ ```bash
100
+ # Multi-step development
101
+ crewx query "@architect design user auth system" | \
102
+ crewx execute "@backend implement API endpoints" | \
103
+ crewx execute "@frontend create UI components"
104
+
105
+ # Code review and improvement
106
+ crewx query "@claude analyze code quality" | \
107
+ crewx execute "@gemini implement improvements"
108
+
109
+ # Design, implement, test
110
+ crewx query "@architect design feature" | \
111
+ crewx execute "@developer build it" | \
112
+ crewx query "@tester verify implementation"
113
+ ```
114
+
115
+ ## Conversation History with `--thread`
116
+
117
+ Maintain context across multiple queries and executions:
118
+
119
+ ```bash
120
+ # Start a thread
121
+ crewx query "@claude design a login system" --thread "auth-feature"
122
+
123
+ # Continue in same thread (Claude remembers previous context)
124
+ crewx query "@claude add 2FA support" --thread "auth-feature"
125
+
126
+ # Execute with thread context
127
+ crewx execute "@claude implement the design" --thread "auth-feature"
128
+ ```
129
+
130
+ **Features:**
131
+ - **Persistent context** - Stored in `.crewx/conversations/`
132
+ - **Cross-session** - Available after restart
133
+ - **Thread isolation** - Different threads maintain separate contexts
134
+ - **Works with all commands** - `query`, `execute`, `chat`
135
+
136
+ **Example workflow:**
137
+ ```bash
138
+ # Design phase
139
+ crewx query "@architect design REST API" --thread "api-project"
140
+
141
+ # Implementation (remembers design)
142
+ crewx execute "@backend implement endpoints" --thread "api-project"
143
+
144
+ # Testing (remembers design + implementation)
145
+ crewx query "@tester review implementation" --thread "api-project"
146
+ ```
147
+
148
+ ## Slack Bot Integration
149
+
150
+ Run CrewX as a Slack bot:
151
+
152
+ ```bash
153
+ crewx slack # Start with Claude (default)
154
+ crewx slack --agent gemini # Use Gemini
155
+ crewx slack --agent copilot # Use GitHub Copilot
156
+ crewx slack --agent custom_agent # Use custom agent
157
+ ```
158
+
159
+ **Features:**
160
+ - Natural conversation with chosen AI agent
161
+ - Thread history maintenance
162
+ - @mentions and DMs
163
+ - Clean responses
164
+ - Reaction indicators (👀 processing, ✅ completed, ❌ error)
165
+
166
+ **Setup:**
167
+ 1. Create Slack App and configure bot tokens
168
+ 2. Set environment variables in `.env.slack`:
169
+ ```bash
170
+ SLACK_BOT_TOKEN=xoxb-...
171
+ SLACK_APP_TOKEN=xapp-...
172
+ SLACK_SIGNING_SECRET=...
173
+ SLACK_MAX_RESPONSE_LENGTH=400000 # Optional
174
+ ```
175
+ 3. Start: `npm run start:slack`
176
+
177
+ See [SLACK_INSTALL.md](../SLACK_INSTALL.md) for full setup guide.
178
+
179
+ ## Advanced Features
180
+
181
+ ### Task Tracking
182
+ Every operation is logged with unique task IDs:
183
+
184
+ ```bash
185
+ # Operations automatically create logs
186
+ crewx execute "@claude create component"
187
+ # Output includes: Task ID: abc123
188
+
189
+ # View task logs
190
+ crewx logs abc123
191
+ ```
192
+
193
+ ### Performance Metrics
194
+ - Execution time tracking
195
+ - Success/failure rates
196
+ - Parallel vs sequential comparison
197
+
198
+ ### Error Recovery
199
+ - Detailed error messages
200
+ - Resolution suggestions
201
+ - Session limit handling
202
+
203
+ ### Configuration Validation
204
+ Validates agent configurations before execution:
205
+ - Provider availability
206
+ - Required options
207
+ - Working directory existence
208
+
209
+ ## Environment Variables
210
+
211
+ Customize timeout values via `.env` or environment variables:
212
+
213
+ ```bash
214
+ # Claude Provider
215
+ CODECREW_TIMEOUT_CLAUDE_QUERY=600000 # 10 min
216
+ CODECREW_TIMEOUT_CLAUDE_EXECUTE=45000 # 45 sec
217
+
218
+ # Gemini Provider
219
+ CODECREW_TIMEOUT_GEMINI_QUERY=600000 # 10 min
220
+ CODECREW_TIMEOUT_GEMINI_EXECUTE=1200000 # 20 min
221
+
222
+ # Copilot Provider
223
+ CODECREW_TIMEOUT_COPILOT_QUERY=600000 # 10 min
224
+ CODECREW_TIMEOUT_COPILOT_EXECUTE=1200000 # 20 min
225
+
226
+ # System
227
+ CODECREW_TIMEOUT_PARALLEL=300000 # 5 min
228
+ CODECREW_TIMEOUT_STDIN_INITIAL=30000 # 30 sec
229
+ CODECREW_TIMEOUT_STDIN_CHUNK=600000 # 10 min
230
+ CODECREW_TIMEOUT_STDIN_COMPLETE=100 # 100ms
231
+ ```
232
+
233
+ **Usage:**
234
+ ```bash
235
+ # Using .env file
236
+ echo "CODECREW_TIMEOUT_CLAUDE_QUERY=900000" >> .env
237
+ crewx query "@claude complex analysis"
238
+
239
+ # Inline
240
+ CODECREW_TIMEOUT_CLAUDE_QUERY=1800000 crewx query "@claude deep analysis"
241
+ ```
242
+
243
+ ## Examples
244
+
245
+ ### Basic Analysis
246
+ ```bash
247
+ # Single agent query
248
+ crewx query "@claude explain this function"
249
+
250
+ # Multiple agents compare
251
+ crewx query "@claude @gemini @copilot which approach is better?"
252
+ ```
253
+
254
+ ### File Operations
255
+ ```bash
256
+ # Create files
257
+ crewx execute "@claude create a login component"
258
+
259
+ # Modify files
260
+ crewx execute "@claude refactor authentication"
261
+
262
+ # Multiple tasks
263
+ crewx execute "@claude create tests" "@gemini write docs"
264
+ ```
265
+
266
+ ### Complex Workflows
267
+ ```bash
268
+ # Design → Implement → Test
269
+ crewx query "@architect design user management" --thread "user-mgmt" && \
270
+ crewx execute "@backend implement it" --thread "user-mgmt" && \
271
+ crewx query "@tester create test plan" --thread "user-mgmt"
272
+
273
+ # Code review pipeline
274
+ git diff | crewx query "@claude review these changes" | \
275
+ crewx execute "@refactor improve code quality"
276
+ ```
277
+
278
+ ### Model Selection
279
+ ```bash
280
+ # Use specific models for different tasks
281
+ crewx query "@claude:haiku quick analysis" # Fast, concise
282
+ crewx query "@claude:opus comprehensive review" # Detailed, thorough
283
+ crewx execute "@gemini:gemini-2.5-flash rapid prototyping" # Fast execution
284
+ crewx execute "@gemini:gemini-2.5-pro production code" # High quality
285
+ ```
286
+
287
+ ## Tips
288
+
289
+ 1. **Use `query` for analysis** - Safe, read-only, no file changes
290
+ 2. **Use `execute` for implementation** - Can modify files, create new ones
291
+ 3. **Leverage `--thread`** - Maintain context across commands
292
+ 4. **Combine agents** - Use strengths of different AI models
293
+ 5. **Pipeline complex tasks** - Chain commands for multi-step workflows
294
+ 6. **Check with `doctor`** - Diagnose issues before running tasks
295
+ 7. **Use specific models** - Choose right model for the task complexity