@sowonai/crewx-cli 0.4.0-dev.3 → 0.4.0-dev.31

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 (89) hide show
  1. package/README.md +40 -6
  2. package/dist/ai-provider.service.d.ts +7 -12
  3. package/dist/ai-provider.service.js +41 -19
  4. package/dist/ai-provider.service.js.map +1 -1
  5. package/dist/ai.service.d.ts +5 -45
  6. package/dist/ai.service.js +7 -584
  7. package/dist/ai.service.js.map +1 -1
  8. package/dist/app.module.js +67 -9
  9. package/dist/app.module.js.map +1 -1
  10. package/dist/cli/chat.handler.d.ts +2 -1
  11. package/dist/cli/chat.handler.js +26 -11
  12. package/dist/cli/chat.handler.js.map +1 -1
  13. package/dist/cli/doctor.handler.js +8 -40
  14. package/dist/cli/doctor.handler.js.map +1 -1
  15. package/dist/cli/execute.handler.js +8 -6
  16. package/dist/cli/execute.handler.js.map +1 -1
  17. package/dist/cli/mcp.handler.js.map +1 -1
  18. package/dist/cli/query.handler.js +4 -2
  19. package/dist/cli/query.handler.js.map +1 -1
  20. package/dist/cli-options.d.ts +2 -0
  21. package/dist/cli-options.js +10 -0
  22. package/dist/cli-options.js.map +1 -1
  23. package/dist/crewx.tool.d.ts +18 -2
  24. package/dist/crewx.tool.js +509 -105
  25. package/dist/crewx.tool.js.map +1 -1
  26. package/dist/providers/dynamic-provider.factory.d.ts +9 -51
  27. package/dist/providers/dynamic-provider.factory.js +44 -506
  28. package/dist/providers/dynamic-provider.factory.js.map +1 -1
  29. package/dist/providers/logger.adapter.d.ts +4 -0
  30. package/dist/providers/logger.adapter.js +56 -0
  31. package/dist/providers/logger.adapter.js.map +1 -0
  32. package/dist/services/agent-loader.service.d.ts +6 -2
  33. package/dist/services/agent-loader.service.js +207 -25
  34. package/dist/services/agent-loader.service.js.map +1 -1
  35. package/dist/services/config.service.d.ts +7 -27
  36. package/dist/services/config.service.js +80 -38
  37. package/dist/services/config.service.js.map +1 -1
  38. package/dist/services/parallel-processing.service.d.ts +17 -17
  39. package/dist/services/parallel-processing.service.js +259 -196
  40. package/dist/services/parallel-processing.service.js.map +1 -1
  41. package/dist/services/provider-bridge.service.d.ts +35 -0
  42. package/dist/services/provider-bridge.service.js +224 -0
  43. package/dist/services/provider-bridge.service.js.map +1 -0
  44. package/dist/services/remote-agent.service.d.ts +4 -7
  45. package/dist/services/remote-agent.service.js +41 -95
  46. package/dist/services/remote-agent.service.js.map +1 -1
  47. package/dist/services/template.service.d.ts +2 -0
  48. package/dist/services/template.service.js +46 -1
  49. package/dist/services/template.service.js.map +1 -1
  50. package/dist/services/tool-call.service.d.ts +2 -36
  51. package/dist/services/tool-call.service.js.map +1 -1
  52. package/dist/slack/formatters/message.formatter.d.ts +5 -2
  53. package/dist/slack/formatters/message.formatter.js +55 -2
  54. package/dist/slack/formatters/message.formatter.js.map +1 -1
  55. package/dist/slack/slack-bot.js +1 -2
  56. package/dist/slack/slack-bot.js.map +1 -1
  57. package/dist/utils/stdin-utils.d.ts +4 -25
  58. package/dist/utils/stdin-utils.js +2 -23
  59. package/dist/utils/stdin-utils.js.map +1 -1
  60. package/dist/utils/template-processor.d.ts +2 -29
  61. package/dist/utils/template-processor.js +1 -1
  62. package/dist/utils/template-processor.js.map +1 -1
  63. package/dist/utils/terminal-message-formatter.d.ts +23 -0
  64. package/dist/utils/terminal-message-formatter.js +136 -0
  65. package/dist/utils/terminal-message-formatter.js.map +1 -0
  66. package/package.json +2 -3
  67. package/scripts/postbuild-cli.mjs +20 -1
  68. package/templates/agents/default.yaml +926 -0
  69. package/templates/agents/minimal.yaml +16 -0
  70. package/templates/documents/crewcode-manual.md +292 -0
  71. package/templates/versions.json +19 -0
  72. package/dist/providers/base-ai.provider.d.ts +0 -50
  73. package/dist/providers/base-ai.provider.js +0 -624
  74. package/dist/providers/base-ai.provider.js.map +0 -1
  75. package/dist/providers/claude.provider.d.ts +0 -25
  76. package/dist/providers/claude.provider.js +0 -362
  77. package/dist/providers/claude.provider.js.map +0 -1
  78. package/dist/providers/codex.provider.d.ts +0 -17
  79. package/dist/providers/codex.provider.js +0 -99
  80. package/dist/providers/codex.provider.js.map +0 -1
  81. package/dist/providers/copilot.provider.d.ts +0 -25
  82. package/dist/providers/copilot.provider.js +0 -266
  83. package/dist/providers/copilot.provider.js.map +0 -1
  84. package/dist/providers/gemini.provider.d.ts +0 -22
  85. package/dist/providers/gemini.provider.js +0 -147
  86. package/dist/providers/gemini.provider.js.map +0 -1
  87. package/dist/utils/mention-parser.d.ts +0 -18
  88. package/dist/utils/mention-parser.js +0 -136
  89. package/dist/utils/mention-parser.js.map +0 -1
@@ -0,0 +1,16 @@
1
+ # CrewX Minimal Layout Definition
2
+ #
3
+ # This layout provides a lightweight structure that simply wraps the agent prompt
4
+ # and preserves backward compatibility with inline system prompts.
5
+
6
+ layouts:
7
+ minimal: |
8
+ <system_prompt key="{{vars.security_key}}">
9
+ {{{agent.inline.prompt}}}
10
+ </system_prompt>
11
+
12
+ {{#if vars.user_input}}
13
+ <user_query key="{{vars.security_key}}">
14
+ {{{vars.user_input}}}
15
+ </user_query>
16
+ {{/if}}
@@ -0,0 +1,292 @@
1
+ # CrewX User Manual
2
+
3
+ ## Quick Start
4
+
5
+ CrewX is a multi-AI agent collaboration tool that works with Claude, Gemini, and GitHub Copilot.
6
+
7
+ ## Basic Commands
8
+
9
+ ### Query (Read-Only Analysis)
10
+ ```bash
11
+ crewx query "@agent your question"
12
+ crewx q "@agent your question" # shortcut
13
+ ```
14
+
15
+ ### Execute (File Creation/Modification)
16
+ ```bash
17
+ crewx execute "@agent your task"
18
+ crewx x "@agent your task" # shortcut
19
+ ```
20
+
21
+ ### System Commands
22
+ ```bash
23
+ crewx init # Initialize agents.yaml
24
+ crewx doctor # Check AI provider status
25
+ crewx logs [id] # View task logs
26
+ ```
27
+
28
+ ## Agent Mention Syntax
29
+
30
+ ### Basic Agent Mention
31
+ ```bash
32
+ crewx q "@claude analyze this code"
33
+ crewx q "@gemini search latest AI news"
34
+ crewx q "@copilot suggest improvements"
35
+ ```
36
+
37
+ ### Model Selection
38
+ Specify AI model using colon syntax:
39
+ ```bash
40
+ crewx q "@claude:opus complex architecture design"
41
+ crewx q "@claude:sonnet general development tasks"
42
+ crewx q "@claude:haiku quick simple questions"
43
+ crewx q "@gemini:gemini-2.5-pro advanced analysis"
44
+ ```
45
+
46
+ ### Multiple Agents (Parallel Execution)
47
+ Query multiple agents simultaneously:
48
+ ```bash
49
+ crewx q "@claude @gemini @copilot review this code"
50
+ ```
51
+
52
+ Each agent processes independently and results are returned in parallel.
53
+
54
+ ## Built-in Agents
55
+
56
+ ### @crewx (This Agent)
57
+ Your CrewX assistant. Fallback mechanism: claude → gemini → copilot
58
+ ```bash
59
+ crewx q "@crewx how do I use multiple agents?"
60
+ ```
61
+
62
+ ### @claude (Anthropic Claude)
63
+ Best for: Complex reasoning, code analysis, architecture
64
+ ```bash
65
+ crewx q "@claude explain this design pattern"
66
+ ```
67
+
68
+ ### @gemini (Google Gemini)
69
+ Best for: Performance optimization, data analysis, research
70
+ ```bash
71
+ crewx q "@gemini optimize this algorithm"
72
+ ```
73
+
74
+ ### @copilot (GitHub Copilot)
75
+ Best for: Code implementation, best practices, testing
76
+ ```bash
77
+ crewx q "@copilot write unit tests for this function"
78
+ ```
79
+
80
+ ## Custom Agents
81
+
82
+ ### Creating Custom Agents
83
+
84
+ Create `agents.yaml` in your project:
85
+
86
+ ```yaml
87
+ agents:
88
+ - id: "my_agent"
89
+ name: "My Custom Agent"
90
+ role: "developer"
91
+ inline:
92
+ provider: "claude"
93
+ model: "sonnet"
94
+ system_prompt: |
95
+ You are a specialized assistant for...
96
+ ```
97
+
98
+ ### Using Custom Agents
99
+ ```bash
100
+ crewx q "@my_agent your question"
101
+ ```
102
+
103
+ ## Document System
104
+
105
+ ### Using Documents in Agents
106
+
107
+ Reference documents in system_prompt:
108
+
109
+ ```yaml
110
+ agents:
111
+ - id: "helper"
112
+ inline:
113
+ system_prompt: |
114
+ <manual>
115
+ {{{documents.user-guide.content}}}
116
+ </manual>
117
+ ```
118
+
119
+ ### Document Levels
120
+ 1. `documents.yaml` - Global documents
121
+ 2. `agents.yaml` documents: - Project documents
122
+ 3. `agent.inline.documents` - Agent-specific
123
+
124
+ ### Template Variables
125
+ - `{{{documents.name.content}}}` - Full content
126
+ - `{{{documents.name.toc}}}` - Table of contents
127
+ - `{{documents.name.summary}}` - Summary
128
+
129
+ ## MCP Integration
130
+
131
+ ### VS Code
132
+ Add to `.vscode/mcp.json`:
133
+ ```json
134
+ {
135
+ "servers": {
136
+ "crewx": {
137
+ "command": "npx",
138
+ "args": ["-y", "crewx", "mcp"],
139
+ "env": {
140
+ "CREWX_CONFIG": "${workspaceFolder}/crewx.yaml"
141
+ }
142
+ }
143
+ }
144
+ }
145
+ ```
146
+
147
+ ### Claude Desktop
148
+ Add to `claude_desktop_config.json`:
149
+ ```json
150
+ {
151
+ "mcpServers": {
152
+ "crewx": {
153
+ "command": "npx",
154
+ "args": ["-y", "crewx", "mcp"]
155
+ }
156
+ }
157
+ }
158
+ ```
159
+
160
+ ## Common Patterns
161
+
162
+ ### Code Review
163
+ ```bash
164
+ crewx q "@claude @copilot review this pull request"
165
+ ```
166
+
167
+ ### Architecture Design
168
+ ```bash
169
+ crewx q "@claude:opus design user authentication system"
170
+ ```
171
+
172
+ ### Implementation
173
+ ```bash
174
+ crewx x "@copilot implement JWT middleware"
175
+ ```
176
+
177
+ ### Multi-Perspective Analysis
178
+ ```bash
179
+ crewx q "@claude @gemini @copilot analyze performance issues"
180
+ ```
181
+
182
+ ## Troubleshooting
183
+
184
+ ### Check AI Provider Status
185
+ ```bash
186
+ crewx doctor
187
+ ```
188
+
189
+ ### View Task Logs
190
+ ```bash
191
+ crewx logs
192
+ crewx logs task_1234567890_abcdef
193
+ ```
194
+
195
+ ### Common Issues
196
+
197
+ **Agent not found:**
198
+ - Check `agents.yaml` exists
199
+ - Verify agent ID is correct
200
+ - Use `@crewx` for built-in help
201
+
202
+ **AI provider unavailable:**
203
+ - Run `crewx doctor`
204
+ - Install required CLI: claude, gemini, copilot
205
+ - Check authentication
206
+
207
+ **Template errors:**
208
+ - Verify document references exist
209
+ - Check YAML syntax
210
+ - Use `{{{...}}}` for unescaped content
211
+
212
+ ## Tips & Best Practices
213
+
214
+ ### Choose the Right Model
215
+ - **opus**: Complex reasoning, architecture
216
+ - **sonnet**: Balanced performance (default)
217
+ - **haiku**: Fast, simple tasks
218
+
219
+ ### Leverage Parallel Execution
220
+ Query multiple agents for comprehensive analysis:
221
+ ```bash
222
+ crewx q "@claude @gemini @copilot what's the best approach?"
223
+ ```
224
+
225
+ ### Use Documents for Context
226
+ Provide project-specific knowledge to agents via documents:
227
+ - Coding standards
228
+ - API documentation
229
+ - Architecture guidelines
230
+
231
+ ### Read-Only vs Execute Mode
232
+ - **Query mode**: Safe analysis, no modifications
233
+ - **Execute mode**: Can create/modify files
234
+
235
+ ### Task Logs
236
+ Review logs to understand agent execution:
237
+ ```bash
238
+ crewx logs # List recent tasks
239
+ crewx logs [taskId] # View specific task
240
+ ```
241
+
242
+ ## Advanced Features
243
+
244
+ ### Template Processing
245
+ Documents support Handlebars templates:
246
+ ```yaml
247
+ system_prompt: |
248
+ Project guidelines:
249
+ {{{documents.guidelines.content}}}
250
+
251
+ Available APIs:
252
+ {{{documents.api-docs.toc}}}
253
+ ```
254
+
255
+ ### Lazy Loading
256
+ Large documents can be loaded on-demand:
257
+ ```yaml
258
+ documents:
259
+ large-manual:
260
+ path: "docs/manual.md"
261
+ lazy: true
262
+ ```
263
+
264
+ ### Agent-Specific Options
265
+ Configure CLI options per agent:
266
+ ```yaml
267
+ agents:
268
+ - id: "reviewer"
269
+ options:
270
+ query:
271
+ - "--add-dir=."
272
+ - "--verbose"
273
+ execute:
274
+ - "--add-dir=."
275
+ - "--allowedTools=Edit"
276
+ ```
277
+
278
+ ## Getting Help
279
+
280
+ ### Ask @crewx
281
+ ```bash
282
+ crewx q "@crewx how do I...?"
283
+ ```
284
+
285
+ ### Documentation
286
+ - GitHub: https://github.com/sowonlabs/crewx
287
+ - CLI Reference: README.cli.md
288
+ - Agent Configuration: README.md
289
+
290
+ ### Community
291
+ - Report issues: GitHub Issues
292
+ - Discussions: GitHub Discussions
@@ -0,0 +1,19 @@
1
+ {
2
+ "latest": "v0.1.8",
3
+ "versions": {
4
+ "v0.1.8": {
5
+ "released": "2025-01-01",
6
+ "templates": ["default", "minimal", "development", "production"],
7
+ "description": "Initial template system with @crewx agent and model selection support",
8
+ "minCrewxVersion": "0.1.8",
9
+ "maxCrewxVersion": null
10
+ },
11
+ "main": {
12
+ "released": "development",
13
+ "templates": ["default", "minimal", "secure-wrapper", "development", "production"],
14
+ "description": "Development branch - latest unreleased features",
15
+ "minCrewxVersion": "0.1.8",
16
+ "maxCrewxVersion": null
17
+ }
18
+ }
19
+ }
@@ -1,50 +0,0 @@
1
- import { Logger } from '@nestjs/common';
2
- import { AIProvider, AIQueryOptions, AIResponse } from '@sowonai/crewx-sdk';
3
- import { ToolCallService } from '../services/tool-call.service';
4
- export declare abstract class BaseAIProvider implements AIProvider {
5
- abstract readonly name: string;
6
- protected readonly logger: Logger;
7
- protected toolCallService?: ToolCallService;
8
- private readonly logsDir;
9
- private cachedPath;
10
- protected readonly timeoutConfig: import("@sowonai/crewx-sdk").TimeoutConfig;
11
- constructor(loggerContext: string);
12
- protected abstract getCliCommand(): string;
13
- protected abstract getDefaultArgs(): string[];
14
- protected abstract getExecuteArgs(): string[];
15
- protected abstract getNotInstalledMessage(): string;
16
- protected getPromptInArgs(): boolean;
17
- protected getDefaultQueryTimeout(): number;
18
- protected getDefaultExecuteTimeout(): number;
19
- protected getDefaultModel(): string | null;
20
- protected getEnv(): Record<string, string>;
21
- protected substituteModelPlaceholders(args: string[], model: string): string[];
22
- protected setToolCallService(toolCallService: ToolCallService): void;
23
- protected parseToolUse(content: string): {
24
- isToolUse: boolean;
25
- toolName?: string;
26
- toolInput?: any;
27
- };
28
- protected parseToolUseProviderSpecific(parsed: any): {
29
- isToolUse: boolean;
30
- toolName?: string;
31
- toolInput?: any;
32
- };
33
- protected filterToolUseFromResponse(content: string): string;
34
- parseProviderError(stderr: string, stdout: string): {
35
- error: boolean;
36
- message: string;
37
- };
38
- getToolPath(): Promise<string | null>;
39
- protected wrapUserQueryWithSecurity(userQuery: string, securityKey: string): string;
40
- protected extractUserQuery(wrappedQuery: string, securityKey: string): string;
41
- isAvailable(): Promise<boolean>;
42
- private createTaskLogFile;
43
- private appendTaskLog;
44
- query(prompt: string, options?: AIQueryOptions): Promise<AIResponse>;
45
- execute(prompt: string, options?: AIQueryOptions): Promise<AIResponse>;
46
- protected shouldPipeContext(_options?: AIQueryOptions): boolean;
47
- private buildPipedContext;
48
- protected isStructuredPayload(value: string): boolean;
49
- protected createStructuredPayload(prompt: string, context: string | null, options?: AIQueryOptions): string;
50
- }