@xagent/x-cli 1.1.67 → 1.1.69
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/README.md +17 -3
- package/dist/index.js +232 -23
- package/dist/index.js.map +1 -1
- package/docs/README.md +212 -0
- package/package.json +2 -1
package/docs/README.md
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
# X-CLI Workflow Documentation
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
This documentation directory contains comprehensive guides for X-CLI's revolutionary "Research → Recommend → Execute → Auto-Doc" workflow system. These documents explain how to effectively use and integrate with the complete AI-assisted development workflow.
|
|
6
|
+
|
|
7
|
+
## Documentation Structure
|
|
8
|
+
|
|
9
|
+
### 📚 User Guide (`workflow-user-guide.md`)
|
|
10
|
+
**Primary guide for end users and developers**
|
|
11
|
+
|
|
12
|
+
- **Complete workflow walkthrough** - Step-by-step guide through all phases
|
|
13
|
+
- **Interactive examples** - Real console output and decision flows
|
|
14
|
+
- **Best practices** - Task formulation, decision making, error recovery
|
|
15
|
+
- **Advanced usage** - CLI flags, environment variables, configuration
|
|
16
|
+
- **Troubleshooting** - Common issues and solutions
|
|
17
|
+
- **Integration examples** - CI/CD, development workflows
|
|
18
|
+
|
|
19
|
+
**Perfect for:**
|
|
20
|
+
- New users learning the workflow
|
|
21
|
+
- Developers implementing features
|
|
22
|
+
- Teams adopting X-CLI workflows
|
|
23
|
+
|
|
24
|
+
### 🔧 API Reference (`api-reference.md`)
|
|
25
|
+
**Technical documentation for developers and integrators**
|
|
26
|
+
|
|
27
|
+
- **Complete type definitions** - All interfaces and data structures
|
|
28
|
+
- **Service class documentation** - Methods, parameters, return values
|
|
29
|
+
- **Configuration options** - Environment variables, config files
|
|
30
|
+
- **Integration examples** - Programmatic usage, CI/CD integration
|
|
31
|
+
- **Error handling** - Exception types and recovery patterns
|
|
32
|
+
- **Performance optimization** - Memory management, caching strategies
|
|
33
|
+
|
|
34
|
+
**Perfect for:**
|
|
35
|
+
- Building custom integrations
|
|
36
|
+
- Extending X-CLI with new tools
|
|
37
|
+
- CI/CD pipeline development
|
|
38
|
+
- Advanced configuration
|
|
39
|
+
|
|
40
|
+
### 🏗️ Architecture Overview (`.agent/system/workflow-overview.md`)
|
|
41
|
+
**System design and technical architecture**
|
|
42
|
+
|
|
43
|
+
- **Core principles** - Safety, operator-in-the-loop, context intelligence
|
|
44
|
+
- **Workflow phases** - Detailed breakdown of each stage
|
|
45
|
+
- **Integration points** - How components work together
|
|
46
|
+
- **Safety guarantees** - Data protection and error boundaries
|
|
47
|
+
- **Future extensions** - Planned features and integrations
|
|
48
|
+
|
|
49
|
+
**Perfect for:**
|
|
50
|
+
- Understanding system design
|
|
51
|
+
- Planning integrations
|
|
52
|
+
- Technical architecture reviews
|
|
53
|
+
|
|
54
|
+
## Quick Start
|
|
55
|
+
|
|
56
|
+
### For End Users
|
|
57
|
+
1. **Read the User Guide** - Start with `workflow-user-guide.md`
|
|
58
|
+
2. **Try basic examples** - Use the command examples provided
|
|
59
|
+
3. **Explore advanced features** - Check configuration and integration sections
|
|
60
|
+
|
|
61
|
+
### For Developers
|
|
62
|
+
1. **Review API Reference** - Understand available interfaces
|
|
63
|
+
2. **Check Architecture** - Learn system design principles
|
|
64
|
+
3. **Follow Integration Examples** - See real-world usage patterns
|
|
65
|
+
|
|
66
|
+
### For Teams
|
|
67
|
+
1. **Study User Guide** - Train team members on workflow usage
|
|
68
|
+
2. **Review Architecture** - Understand safety and reliability features
|
|
69
|
+
3. **Plan Integration** - Use API Reference for CI/CD and tool integration
|
|
70
|
+
|
|
71
|
+
## Key Concepts
|
|
72
|
+
|
|
73
|
+
### The Workflow
|
|
74
|
+
|
|
75
|
+
X-CLI transforms complex tasks into safe, structured experiences through four phases:
|
|
76
|
+
|
|
77
|
+
1. **🤖 Research** - AI analyzes task with project context
|
|
78
|
+
2. **💡 Recommend** - Presents options with trade-offs for approval
|
|
79
|
+
3. **⚡ Execute** - Runs approved plan with safety guarantees
|
|
80
|
+
4. **📝 Auto-Doc** - Documents completion and learns lessons
|
|
81
|
+
|
|
82
|
+
### Safety First
|
|
83
|
+
|
|
84
|
+
- **Zero data loss** - All changes have patches and backups
|
|
85
|
+
- **Version control** - Automatic git commits for all modifications
|
|
86
|
+
- **Error recovery** - Intelligent handling of execution failures
|
|
87
|
+
- **Audit trail** - Complete record of all decisions and actions
|
|
88
|
+
|
|
89
|
+
### Context Intelligence
|
|
90
|
+
|
|
91
|
+
- **Automatic loading** - Project docs provide AI context on startup
|
|
92
|
+
- **Knowledge accumulation** - Past executions inform future recommendations
|
|
93
|
+
- **Adaptive learning** - System improves through documented lessons
|
|
94
|
+
- **Project memory** - Institutional knowledge preserved in `.agent/` files
|
|
95
|
+
|
|
96
|
+
## Usage Examples
|
|
97
|
+
|
|
98
|
+
### Simple Task
|
|
99
|
+
```bash
|
|
100
|
+
$ xcli "add input validation to user registration form"
|
|
101
|
+
|
|
102
|
+
🔍 Researching and analyzing...
|
|
103
|
+
[... structured analysis output ...]
|
|
104
|
+
Proceed with recommendation? (Y/n) [R=revise] Y
|
|
105
|
+
|
|
106
|
+
🚀 Starting execution...
|
|
107
|
+
✅ Execution completed: 3/3 steps successful
|
|
108
|
+
📝 Documentation saved
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Complex Task with Recovery
|
|
112
|
+
```bash
|
|
113
|
+
$ xcli "implement payment processing system"
|
|
114
|
+
|
|
115
|
+
🔍 Researching and analyzing...
|
|
116
|
+
[... comprehensive analysis ...]
|
|
117
|
+
Proceed with recommendation? (Y/n) [R=revise] Y
|
|
118
|
+
|
|
119
|
+
🚀 Starting execution...
|
|
120
|
+
🚨 ISSUE ENCOUNTERED: test failures detected
|
|
121
|
+
🔄 Initiating adaptive recovery...
|
|
122
|
+
[... recovery analysis ...]
|
|
123
|
+
Proceed with recovery plan? (Y/n) [R=revise] Y
|
|
124
|
+
|
|
125
|
+
✅ Recovery completed. Resuming execution...
|
|
126
|
+
✅ Execution completed: 8/8 steps successful
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### CI/CD Integration
|
|
130
|
+
```yaml
|
|
131
|
+
- name: Implement Feature
|
|
132
|
+
run: |
|
|
133
|
+
npx @xagent/x-cli@latest --headless "add error logging"
|
|
134
|
+
env:
|
|
135
|
+
X_API_KEY: ${{ secrets.X_API_KEY }}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Configuration
|
|
139
|
+
|
|
140
|
+
### Environment Variables
|
|
141
|
+
```bash
|
|
142
|
+
# Required
|
|
143
|
+
X_API_KEY=your_api_key
|
|
144
|
+
|
|
145
|
+
# Optional
|
|
146
|
+
XCLI_PATCH_DIR=/custom/patches # Custom patch storage
|
|
147
|
+
XCLI_CONTEXT_BUDGET=500 # Context size limit (KB)
|
|
148
|
+
XCLI_MAX_RECOVERY_ATTEMPTS=3 # Recovery retry limit
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Configuration Files
|
|
152
|
+
- **User settings**: `~/.xcli/config.json`
|
|
153
|
+
- **Project settings**: `.xcli/project.json`
|
|
154
|
+
- **Context docs**: `.agent/` directory structure
|
|
155
|
+
|
|
156
|
+
## Integration Points
|
|
157
|
+
|
|
158
|
+
### Programmatic Usage
|
|
159
|
+
```typescript
|
|
160
|
+
import { ResearchRecommendService } from '@xagent/x-cli';
|
|
161
|
+
|
|
162
|
+
const service = new ResearchRecommendService(agent);
|
|
163
|
+
const result = await service.researchRecommendExecute(request);
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Tool Extensions
|
|
167
|
+
- Add custom tools to the GrokAgent
|
|
168
|
+
- Extend execution capabilities
|
|
169
|
+
- Integrate with external systems
|
|
170
|
+
|
|
171
|
+
### CI/CD Pipelines
|
|
172
|
+
- Headless mode for automation
|
|
173
|
+
- Structured output for parsing
|
|
174
|
+
- Patch file generation for reviews
|
|
175
|
+
|
|
176
|
+
## Support & Resources
|
|
177
|
+
|
|
178
|
+
### Getting Help
|
|
179
|
+
- **User Guide** - Step-by-step walkthroughs and examples
|
|
180
|
+
- **API Reference** - Technical details and integration guides
|
|
181
|
+
- **Architecture Docs** - System design and principles
|
|
182
|
+
- **Generated Docs** - Auto-created `.agent/tasks/` files
|
|
183
|
+
|
|
184
|
+
### Common Issues
|
|
185
|
+
- **Context loading** - Check `.agent/` directory structure
|
|
186
|
+
- **API errors** - Verify X_API_KEY configuration
|
|
187
|
+
- **Execution failures** - Review patch files and backups
|
|
188
|
+
- **Performance** - Adjust context budget and timeouts
|
|
189
|
+
|
|
190
|
+
### Community
|
|
191
|
+
- **GitHub Issues** - Bug reports and feature requests
|
|
192
|
+
- **Discord Community** - Usage questions and discussions
|
|
193
|
+
- **Documentation PRs** - Help improve these guides
|
|
194
|
+
|
|
195
|
+
## Version History
|
|
196
|
+
|
|
197
|
+
### Current Version: Sprint Complete ✅
|
|
198
|
+
- **5-stage implementation** complete
|
|
199
|
+
- **Full workflow operational**
|
|
200
|
+
- **Production-ready features**
|
|
201
|
+
- **Comprehensive documentation**
|
|
202
|
+
|
|
203
|
+
### Key Features Delivered
|
|
204
|
+
- ✅ Intelligent context loading (Stage 1)
|
|
205
|
+
- ✅ Research → Recommend flow (Stage 2)
|
|
206
|
+
- ✅ Safe execution with patches/backups (Stage 3)
|
|
207
|
+
- ✅ Adaptive error recovery (Stage 4)
|
|
208
|
+
- ✅ Auto-documentation & learning (Stage 5)
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
*This documentation represents the complete guide to X-CLI's workflow system. Start with the User Guide for practical usage, then explore the API Reference for technical integration details.*
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@xagent/x-cli",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.69",
|
|
5
5
|
"description": "An open-source AI agent that brings the power of Grok directly into your terminal.",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"dev:watch": "npm run build && node --watch dist/index.js",
|
|
31
31
|
"start": "node dist/index.js",
|
|
32
32
|
"local": "npm run build && npm link && node dist/index.js",
|
|
33
|
+
"test:workflow": "node scripts/test-workflow.js",
|
|
33
34
|
"start:bun": "bun run dist/index.js",
|
|
34
35
|
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
|
|
35
36
|
"typecheck": "tsc --noEmit",
|