@xagent-ai/cli 1.0.1 → 1.1.0

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 (136) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
  2. package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  3. package/README.md +280 -280
  4. package/README_CN.md +3 -3
  5. package/dist/ai-client.d.ts.map +1 -1
  6. package/dist/ai-client.js +84 -82
  7. package/dist/ai-client.js.map +1 -1
  8. package/dist/auth.d.ts +0 -1
  9. package/dist/auth.d.ts.map +1 -1
  10. package/dist/auth.js +75 -105
  11. package/dist/auth.js.map +1 -1
  12. package/dist/cli.js +166 -13
  13. package/dist/cli.js.map +1 -1
  14. package/dist/config.d.ts +3 -1
  15. package/dist/config.d.ts.map +1 -1
  16. package/dist/config.js +48 -7
  17. package/dist/config.js.map +1 -1
  18. package/dist/context-compressor.d.ts +5 -5
  19. package/dist/context-compressor.js +8 -8
  20. package/dist/context-compressor.js.map +1 -1
  21. package/dist/gui-subagent/action-parser/actionParser.d.ts +7 -0
  22. package/dist/gui-subagent/action-parser/actionParser.d.ts.map +1 -1
  23. package/dist/gui-subagent/action-parser/actionParser.js +6 -3
  24. package/dist/gui-subagent/action-parser/actionParser.js.map +1 -1
  25. package/dist/gui-subagent/action-parser/constants.d.ts +6 -0
  26. package/dist/gui-subagent/action-parser/constants.d.ts.map +1 -1
  27. package/dist/gui-subagent/action-parser/constants.js +5 -3
  28. package/dist/gui-subagent/action-parser/constants.js.map +1 -1
  29. package/dist/gui-subagent/action-parser/index.d.ts +6 -0
  30. package/dist/gui-subagent/action-parser/index.d.ts.map +1 -1
  31. package/dist/gui-subagent/action-parser/index.js +5 -3
  32. package/dist/gui-subagent/action-parser/index.js.map +1 -1
  33. package/dist/gui-subagent/action-parser/types.d.ts +4 -0
  34. package/dist/gui-subagent/action-parser/types.d.ts.map +1 -1
  35. package/dist/gui-subagent/action-parser/types.js +3 -3
  36. package/dist/gui-subagent/agent/gui-agent.d.ts +39 -0
  37. package/dist/gui-subagent/agent/gui-agent.d.ts.map +1 -1
  38. package/dist/gui-subagent/agent/gui-agent.js +164 -89
  39. package/dist/gui-subagent/agent/gui-agent.js.map +1 -1
  40. package/dist/gui-subagent/agent/index.d.ts +1 -1
  41. package/dist/gui-subagent/agent/index.d.ts.map +1 -1
  42. package/dist/gui-subagent/agent/index.js.map +1 -1
  43. package/dist/gui-subagent/index.d.ts +27 -1
  44. package/dist/gui-subagent/index.d.ts.map +1 -1
  45. package/dist/gui-subagent/index.js +6 -0
  46. package/dist/gui-subagent/index.js.map +1 -1
  47. package/dist/logger.js +1 -1
  48. package/dist/logger.js.map +1 -1
  49. package/dist/mcp.d.ts +1 -0
  50. package/dist/mcp.d.ts.map +1 -1
  51. package/dist/mcp.js +140 -29
  52. package/dist/mcp.js.map +1 -1
  53. package/dist/remote-ai-client.d.ts +111 -0
  54. package/dist/remote-ai-client.d.ts.map +1 -0
  55. package/dist/remote-ai-client.js +558 -0
  56. package/dist/remote-ai-client.js.map +1 -0
  57. package/dist/sdk-output-adapter.d.ts +232 -0
  58. package/dist/sdk-output-adapter.d.ts.map +1 -0
  59. package/dist/sdk-output-adapter.js +636 -0
  60. package/dist/sdk-output-adapter.js.map +1 -0
  61. package/dist/sdk-session-v2.d.ts +13 -0
  62. package/dist/sdk-session-v2.d.ts.map +1 -0
  63. package/dist/sdk-session-v2.js +46 -0
  64. package/dist/sdk-session-v2.js.map +1 -0
  65. package/dist/sdk-session.d.ts +13 -0
  66. package/dist/sdk-session.d.ts.map +1 -0
  67. package/dist/sdk-session.js +48 -0
  68. package/dist/sdk-session.js.map +1 -0
  69. package/dist/session-manager.js +3 -3
  70. package/dist/session-manager.js.map +1 -1
  71. package/dist/session.d.ts +46 -3
  72. package/dist/session.d.ts.map +1 -1
  73. package/dist/session.js +539 -104
  74. package/dist/session.js.map +1 -1
  75. package/dist/skill-invoker.d.ts +40 -4
  76. package/dist/skill-invoker.d.ts.map +1 -1
  77. package/dist/skill-invoker.js +310 -1184
  78. package/dist/skill-invoker.js.map +1 -1
  79. package/dist/skill-loader.d.ts +15 -1
  80. package/dist/skill-loader.d.ts.map +1 -1
  81. package/dist/skill-loader.js +49 -32
  82. package/dist/skill-loader.js.map +1 -1
  83. package/dist/slash-commands.d.ts +4 -2
  84. package/dist/slash-commands.d.ts.map +1 -1
  85. package/dist/slash-commands.js +149 -15
  86. package/dist/slash-commands.js.map +1 -1
  87. package/dist/smart-approval.d.ts +2 -1
  88. package/dist/smart-approval.d.ts.map +1 -1
  89. package/dist/smart-approval.js +29 -3
  90. package/dist/smart-approval.js.map +1 -1
  91. package/dist/system-prompt-generator.d.ts +4 -5
  92. package/dist/system-prompt-generator.d.ts.map +1 -1
  93. package/dist/system-prompt-generator.js +131 -81
  94. package/dist/system-prompt-generator.js.map +1 -1
  95. package/dist/tools.d.ts +17 -6
  96. package/dist/tools.d.ts.map +1 -1
  97. package/dist/tools.js +264 -211
  98. package/dist/tools.js.map +1 -1
  99. package/dist/types.d.ts +0 -1
  100. package/dist/types.d.ts.map +1 -1
  101. package/dist/types.js +0 -1
  102. package/dist/types.js.map +1 -1
  103. package/docs/architecture/mcp-integration-guide.md +194 -131
  104. package/docs/architecture/overview.md +169 -93
  105. package/docs/architecture/tool-system-design.md +56 -11
  106. package/docs/cli/commands.md +238 -189
  107. package/docs/smart-mode.md +281 -257
  108. package/docs/third-party-models.md +247 -256
  109. package/package.json +6 -2
  110. package/src/ai-client.ts +107 -105
  111. package/src/auth.ts +82 -116
  112. package/src/cancellation.ts +1 -1
  113. package/src/cli.ts +178 -13
  114. package/src/config.ts +57 -8
  115. package/src/context-compressor.ts +8 -8
  116. package/src/gui-subagent/action-parser/actionParser.ts +6 -3
  117. package/src/gui-subagent/action-parser/constants.ts +5 -3
  118. package/src/gui-subagent/action-parser/index.ts +5 -3
  119. package/src/gui-subagent/action-parser/types.ts +3 -3
  120. package/src/gui-subagent/agent/gui-agent.ts +210 -103
  121. package/src/gui-subagent/agent/index.ts +1 -1
  122. package/src/gui-subagent/index.ts +26 -2
  123. package/src/index.ts +18 -18
  124. package/src/logger.ts +1 -1
  125. package/src/mcp.ts +149 -30
  126. package/src/remote-ai-client.ts +671 -0
  127. package/src/session-manager.ts +3 -3
  128. package/src/session.ts +704 -156
  129. package/src/skill-invoker.ts +340 -1293
  130. package/src/skill-loader.ts +55 -34
  131. package/src/slash-commands.ts +165 -15
  132. package/src/smart-approval.ts +34 -3
  133. package/src/system-prompt-generator.ts +145 -88
  134. package/src/tools.ts +309 -224
  135. package/src/types.ts +0 -1
  136. package/scripts/init-skills-path.js +0 -58
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Describe the bug**
11
+ A clear and concise description of what the bug is.
12
+
13
+ **To Reproduce**
14
+ Steps to reproduce the behavior:
15
+ 1. Go to '...'
16
+ 2. Click on '....'
17
+ 3. Scroll down to '....'
18
+ 4. See error
19
+
20
+ **Expected behavior**
21
+ A clear and concise description of what you expected to happen.
22
+
23
+ **Screenshots**
24
+ If applicable, add screenshots to help explain your problem.
25
+
26
+ **Desktop (please complete the following information):**
27
+ - OS: [e.g. iOS]
28
+ - Browser [e.g. chrome, safari]
29
+ - Version [e.g. 22]
30
+
31
+ **Smartphone (please complete the following information):**
32
+ - Device: [e.g. iPhone6]
33
+ - OS: [e.g. iOS8.1]
34
+ - Browser [e.g. stock browser, safari]
35
+ - Version [e.g. 22]
36
+
37
+ **Additional context**
38
+ Add any other context about the problem here.
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Is your feature request related to a problem? Please describe.**
11
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12
+
13
+ **Describe the solution you'd like**
14
+ A clear and concise description of what you want to happen.
15
+
16
+ **Describe alternatives you've considered**
17
+ A clear and concise description of any alternative solutions or features you've considered.
18
+
19
+ **Additional context**
20
+ Add any other context or screenshots about the feature request here.
package/README.md CHANGED
@@ -1,280 +1,280 @@
1
- # 🤖 xAgent CLI - Your Autonomous Life AI Assistant
2
-
3
- <div align="center">
4
-
5
- ![License](https://img.shields.io/badge/License-MIT-yellow?style=flat-square&logo=opensourceinitiative)
6
- ![Node.js](https://img.shields.io/node/v/xagent-cli?logo=node.js)
7
- ![TypeScript](https://img.shields.io/badge/TypeScript-5.3-blue?style=flat-square&logo=typescript)
8
- ![Version](https://img.shields.io/npm/v/%40xagent-ai%2Fcli?logo=npm)
9
- ![Downloads](https://img.shields.io/npm/dt/%40xagent-ai%2Fcli)
10
-
11
- </div>
12
-
13
- <div align="center">
14
-
15
- ![xAgent CLI Screenshot](./assets/xagent-cli.png)
16
-
17
- **[English](README.md)** | **[中文](README_CN.md)**
18
-
19
- </div>
20
-
21
- ---
22
-
23
- <div align="center">
24
-
25
- ### 🚀 The Future of AI Assistants is Here
26
-
27
- **xAgent CLI** is not just another AI coding assistant — it's an **intelligent agent for personal PCs and autonomous living** that transforms how you interact with your digital life.
28
-
29
- </div>
30
-
31
- ---
32
-
33
- ## ✨ Why xAgent CLI?
34
-
35
- | 🎯 | Universal AI Companion |
36
- |------|------------------------|
37
- | 🏠 | **Life Automation** - From file organization to smart scheduling |
38
- | 💻 | **Professional Development** - Code, debug, and deploy with AI |
39
- | 🌐 | **Multi-Model Support** - Free access to Kimi K2, Qwen3 Coder, DeepSeek v3 |
40
- | 🔧 | **GUI Automation** - Precise mouse/keyboard control for any task |
41
- | 🔒 | **Flexible Security** - 5 execution modes from YOLO to DEFAULT |
42
-
43
- ---
44
-
45
- ## ⚡ Quick Start
46
-
47
- ```bash
48
- # Install
49
- npm i -g xagent-cli
50
-
51
- # Launch
52
- xagent
53
- ```
54
-
55
- **That's it!** Start automating your digital life in seconds.
56
-
57
- ---
58
-
59
- ## 📊 Feature Comparison
60
-
61
- | Feature | xAgent CLI | Claude Code | Gemini CLI |
62
- |:--------|:----------:|:-----------:|:----------:|
63
- | **Life Automation** | ✅ | ❌ | ❌ |
64
- | **PC Smart Management** | ✅ | ❌ | ❌ |
65
- | Todo Planning | ✅ | ✅ | ❌ |
66
- | SubAgent System | ✅ | ✅ | ❌ |
67
- | Plan Mode | ✅ | ✅ | ❌ |
68
- | Task Tools | ✅ | ✅ | ❌ |
69
- | Conversation Recovery | ✅ | ✅ | ❌ |
70
- | Context Auto-compression | ✅ | ✅ | ✅ |
71
- | Web Search | ✅ | ❌ | ⚠️ |
72
- | Thinking Mode | ✅ | ✅ | ❌ |
73
- | Workflow System | ✅ | ❌ | ❌ |
74
-
75
- ---
76
-
77
- ## 🎯 What Can xAgent Do?
78
-
79
- ### 🏠 Life Assistant
80
- ```text
81
- > Organize my desktop, categorize files by type
82
- > Set up daily backup to cloud storage
83
- > Remind me of meetings at 3 PM
84
- > Find largest files eating disk space
85
- ```
86
-
87
- ### 💼 Productivity Booster
88
- ```text
89
- > Batch rename files with date format
90
- > Download all PDFs from a webpage
91
- > Analyze Excel data, generate charts
92
- > Translate documents preserving format
93
- ```
94
-
95
- ### 👨‍💻 Developer Companion
96
- ```text
97
- > Analyze project architecture
98
- > Find and fix bug root causes
99
- > Create RESTful APIs with auth
100
- > Code review PRs automatically
101
- ```
102
-
103
- ### 🔄 Automation Expert
104
- ```text
105
- > Download stock prices, send email alerts
106
- > Auto-update project dependencies
107
- > Monitor websites, alert on downtime
108
- ```
109
-
110
- ---
111
-
112
- ## 🛠️ Execution Modes
113
-
114
- | Mode | Permissions | Best For |
115
- |------|-------------|----------|
116
- | 🟢 **YOLO** | Full control | Complete AI autonomy |
117
- | 🟡 **ACCEPT_EDITS** | File only | Safe coding |
118
- | 🔵 **PLAN** | Plan → Execute | Complex tasks |
119
- | ⚪ **DEFAULT** | Approval required | Security-first |
120
- | 🟣 **SMART** | Intelligent | Daily use (recommended) |
121
-
122
- ---
123
-
124
- ## 🔑 Free to Use
125
-
126
- xAgent offers **completely free** access with multiple authentication options:
127
-
128
- | Method | Description |
129
- |--------|-------------|
130
- | 🔐 **xAgent Account** | Browser-based login (recommended) |
131
- | 🔑 **API Key** | Server environments |
132
- | 🌐 **Third-Party APIs** | GLM-4, DeepSeek, Qwen, Kimi, and more |
133
-
134
- ---
135
-
136
- ## 🏗️ Technology Stack
137
-
138
- <div align="center">
139
-
140
- ![Node.js](https://img.shields.io/badge/Node.js-22+-green?style=for-the-badge&logo=node.js)
141
- ![TypeScript](https://img.shields.io/badge/TypeScript-5.3-blue?style=for-the-badge&logo=typescript)
142
- ![React](https://img.shields.io/badge/React-Ink-purple?style=for-the-badge&logo=react)
143
- ![esbuild](https://img.shields.io/badge/esbuild-orange?style=for-the-badge)
144
- ![Vitest](https://img.shields.io/badge/Vitest-testing?style=for-the-badge&logo=vitest)
145
-
146
- </div>
147
-
148
- ---
149
-
150
- ## 📦 Project Structure
151
-
152
- ```
153
- xagent-cli/
154
- ├── src/
155
- │ ├── tools/ # 12+ built-in tools
156
- │ ├── agents/ # SubAgent system
157
- │ ├── gui-subagent/ # GUI automation
158
- │ ├── workflow/ # Workflow engine
159
- │ ├── checkpoint/ # State persistence
160
- │ └── mcp/ # MCP integration
161
- ├── dist/ # Compiled output
162
- ├── docs/ # Documentation
163
- ├── test/ # Test suite
164
- └── package.json
165
- ```
166
-
167
- ---
168
-
169
- ## 🧪 Testing & Quality
170
-
171
- ```bash
172
- npm test # Unit tests
173
- npm run lint # ESLint
174
- npm run format # Prettier
175
- npm run typecheck # TypeScript
176
- ```
177
-
178
- ---
179
-
180
- ## ⚙️ Configuration
181
-
182
- Customize xAgent by editing `~/.xagent/settings.json`:
183
-
184
- ```json
185
- {
186
- "theme": "Default",
187
- "selectedAuthType": "openai_compatible",
188
- "apiKey": "your-api-key",
189
- "baseUrl": "https://open.bigmodel.cn/api/coding/paas/v4",
190
- "modelName": "glm-4.7",
191
- "guiSubagentModel": "doubao-1-5-ui-tars-250428",
192
- "guiSubagentBaseUrl": "https://ark.cn-beijing.volces.com/api/v3",
193
- "guiSubagentApiKey": "your-api-key",
194
- "searchApiKey": "",
195
- "executionMode": "smart",
196
- "approvalMode": "smart",
197
- "checkpointing": {
198
- "enabled": false,
199
- "autoCreate": true,
200
- "maxCheckpoints": 10
201
- },
202
- "thinking": {
203
- "enabled": true,
204
- "mode": "normal",
205
- "displayMode": "compact"
206
- },
207
- "contextCompression": {
208
- "enabled": true,
209
- "maxMessages": 30,
210
- "maxContextSize": 1500000,
211
- "preserveRecentMessages": 0,
212
- "enableSummary": true
213
- },
214
- "contextFileName": "XAGENT.md",
215
- "mcpServers": {},
216
- "language": "en",
217
- "autoUpdate": true,
218
- "telemetryEnabled": true,
219
- "showToolDetails": false,
220
- "showAIDebugInfo": false,
221
- "loggerLevel": "info",
222
- "contextCompress": {
223
- "enabled": false,
224
- "autoTrigger": false,
225
- "messageThreshold": 50,
226
- "tokenThreshold": 100000,
227
- "strategy": "summary",
228
- "preserveRecent": 5
229
- },
230
- "type": "openai_compatible"
231
- }
232
- ```
233
-
234
- ---
235
-
236
- ## 📚 Documentation
237
-
238
- - 📖 [Architecture](docs/architecture/overview.md)
239
- - 🔧 [Tool System](docs/architecture/tool-system-design.md)
240
- - 🔌 [SKILL, Worflow and MCP Integration](docs/architecture/mcp-integration-guide.md)
241
- - 💻 [CLI Commands](docs/cli/commands.md)
242
- - 🤝 [Contributing](CONTRIBUTING.md)
243
- - 🔑 [Third-Party Models](docs/third-party-models.md)
244
-
245
- ---
246
-
247
- ## 🤝 Contributing
248
-
249
- We welcome contributions! Here's how to get started:
250
-
251
- 1. 🍴 Fork the repository
252
- 2. 🌿 Create a feature branch
253
- 3. ✅ Ensure tests pass
254
- 4. 📝 Submit a PR
255
-
256
- ---
257
-
258
- ## 📄 License
259
-
260
- MIT License - See [LICENSE](./LICENSE)
261
-
262
- ---
263
-
264
- ## 🙏 Acknowledgments
265
-
266
- <div align="center">
267
-
268
- Built with ❤️ using [Ink](https://github.com/vadimdemedes/ink) • Powered by [xAgent Platform](https://platform.xagent.cn/)
269
-
270
- </div>
271
-
272
- ---
273
-
274
- <div align="center">
275
-
276
- ### 🌟 Star us on GitHub!
277
-
278
- **Empowering Your Digital Life with AI**
279
-
280
- </div>
1
+ # 🤖 xAgent CLI - Your Autonomous Life AI Assistant
2
+
3
+ <div align="center">
4
+
5
+ ![License](https://img.shields.io/badge/License-MIT-yellow?style=flat-square&logo=opensourceinitiative)
6
+ ![Node.js](https://img.shields.io/node/v/xagent-cli?logo=node.js)
7
+ ![TypeScript](https://img.shields.io/badge/TypeScript-5.3-blue?style=flat-square&logo=typescript)
8
+ ![Version](https://img.shields.io/npm/v/%40xagent-ai%2Fcli?logo=npm)
9
+ ![Downloads](https://img.shields.io/npm/dt/%40xagent-ai%2Fcli)
10
+
11
+ </div>
12
+
13
+ <div align="center">
14
+
15
+ ![xAgent CLI Screenshot](./assets/xagent-cli.png)
16
+
17
+ **[Official Website](http://154.8.140.52)** | **[English](README.md)** | **[中文](README_CN.md)**
18
+
19
+ </div>
20
+
21
+ ---
22
+
23
+ <div align="center">
24
+
25
+ ### 🚀 The Future of AI Assistants is Here
26
+
27
+ **xAgent CLI** is not just another AI coding assistant — it's an **intelligent agent for personal PCs and autonomous living** that transforms how you interact with your digital life.
28
+
29
+ </div>
30
+
31
+ ---
32
+
33
+ ## ✨ Why xAgent CLI?
34
+
35
+ | 🎯 | Universal AI Companion |
36
+ |------|------------------------|
37
+ | 🏠 | **Life Automation** - From file organization to smart scheduling |
38
+ | 💻 | **Professional Development** - Code, debug, and deploy with AI |
39
+ | 🌐 | **Multi-Model Support** - Free access to Kimi K2, Qwen3 Coder, DeepSeek v3 |
40
+ | 🔧 | **GUI Automation** - Precise mouse/keyboard control for any task |
41
+ | 🔒 | **Flexible Security** - 5 execution modes from YOLO to DEFAULT |
42
+
43
+ ---
44
+
45
+ ## ⚡ Quick Start
46
+
47
+ ```bash
48
+ # Install
49
+ npm i -g @xagent-ai/cli
50
+
51
+ # Launch
52
+ xagent start
53
+ ```
54
+
55
+ **That's it!** Start automating your digital life in seconds.
56
+
57
+ ---
58
+
59
+ ## 📊 Feature Comparison
60
+
61
+ | Feature | xAgent CLI | Claude Code | Gemini CLI |
62
+ |:--------|:----------:|:-----------:|:----------:|
63
+ | **Life Automation** | ✅ | ❌ | ❌ |
64
+ | **PC Smart Management** | ✅ | ❌ | ❌ |
65
+ | Todo Planning | ✅ | ✅ | ❌ |
66
+ | SubAgent System | ✅ | ✅ | ❌ |
67
+ | Plan Mode | ✅ | ✅ | ❌ |
68
+ | Task Tools | ✅ | ✅ | ❌ |
69
+ | Conversation Recovery | ✅ | ✅ | ❌ |
70
+ | Context Auto-compression | ✅ | ✅ | ✅ |
71
+ | Web Search | ✅ | ❌ | ⚠️ |
72
+ | Thinking Mode | ✅ | ✅ | ❌ |
73
+ | Workflow System | ✅ | ❌ | ❌ |
74
+
75
+ ---
76
+
77
+ ## 🎯 What Can xAgent Do?
78
+
79
+ ### 🏠 Life Assistant
80
+ ```text
81
+ > Organize my desktop, categorize files by type
82
+ > Set up daily backup to cloud storage
83
+ > Remind me of meetings at 3 PM
84
+ > Find largest files eating disk space
85
+ ```
86
+
87
+ ### 💼 Productivity Booster
88
+ ```text
89
+ > Batch rename files with date format
90
+ > Download all PDFs from a webpage
91
+ > Analyze Excel data, generate charts
92
+ > Translate documents preserving format
93
+ ```
94
+
95
+ ### 👨‍💻 Developer Companion
96
+ ```text
97
+ > Analyze project architecture
98
+ > Find and fix bug root causes
99
+ > Create RESTful APIs with auth
100
+ > Code review PRs automatically
101
+ ```
102
+
103
+ ### 🔄 Automation Expert
104
+ ```text
105
+ > Download stock prices, send email alerts
106
+ > Auto-update project dependencies
107
+ > Monitor websites, alert on downtime
108
+ ```
109
+
110
+ ---
111
+
112
+ ## 🛠️ Execution Modes
113
+
114
+ | Mode | Permissions | Best For |
115
+ |------|-------------|----------|
116
+ | 🟢 **YOLO** | Full control | Complete AI autonomy |
117
+ | 🟡 **ACCEPT_EDITS** | File only | Safe coding |
118
+ | 🔵 **PLAN** | Plan → Execute | Complex tasks |
119
+ | ⚪ **DEFAULT** | Approval required | Security-first |
120
+ | 🟣 **SMART** | Intelligent | Daily use (recommended) |
121
+
122
+ ---
123
+
124
+ ## 🔑 Free to Use
125
+
126
+ xAgent offers **completely free** access with multiple authentication options:
127
+
128
+ | Method | Description |
129
+ |--------|-------------|
130
+ | 🔐 **xAgent Account** | Browser-based login (recommended) |
131
+ | 🔑 **API Key** | Server environments |
132
+ | 🌐 **Third-Party APIs** | GLM-4, DeepSeek, Qwen, Kimi, and more |
133
+
134
+ ---
135
+
136
+ ## 🏗️ Technology Stack
137
+
138
+ <div align="center">
139
+
140
+ ![Node.js](https://img.shields.io/badge/Node.js-22+-green?style=for-the-badge&logo=node.js)
141
+ ![TypeScript](https://img.shields.io/badge/TypeScript-5.3-blue?style=for-the-badge&logo=typescript)
142
+ ![React](https://img.shields.io/badge/React-Ink-purple?style=for-the-badge&logo=react)
143
+ ![esbuild](https://img.shields.io/badge/esbuild-orange?style=for-the-badge)
144
+ ![Vitest](https://img.shields.io/badge/Vitest-testing?style=for-the-badge&logo=vitest)
145
+
146
+ </div>
147
+
148
+ ---
149
+
150
+ ## 📦 Project Structure
151
+
152
+ ```
153
+ xagent-cli/
154
+ ├── src/
155
+ │ ├── tools/ # 12+ built-in tools
156
+ │ ├── agents/ # SubAgent system
157
+ │ ├── gui-subagent/ # GUI automation
158
+ │ ├── workflow/ # Workflow engine
159
+ │ ├── checkpoint/ # State persistence
160
+ │ └── mcp/ # MCP integration
161
+ ├── dist/ # Compiled output
162
+ ├── docs/ # Documentation
163
+ ├── test/ # Test suite
164
+ └── package.json
165
+ ```
166
+
167
+ ---
168
+
169
+ ## 🧪 Testing & Quality
170
+
171
+ ```bash
172
+ npm test # Unit tests
173
+ npm run lint # ESLint
174
+ npm run format # Prettier
175
+ npm run typecheck # TypeScript
176
+ ```
177
+
178
+ ---
179
+
180
+ ## ⚙️ Configuration
181
+
182
+ Customize xAgent by editing `~/.xagent/settings.json`:
183
+
184
+ ```json
185
+ {
186
+ "theme": "Default",
187
+ "selectedAuthType": "openai_compatible",
188
+ "apiKey": "your-api-key",
189
+ "baseUrl": "https://open.bigmodel.cn/api/coding/paas/v4",
190
+ "modelName": "glm-4.7",
191
+ "guiSubagentModel": "doubao-1-5-ui-tars-250428",
192
+ "guiSubagentBaseUrl": "https://ark.cn-beijing.volces.com/api/v3",
193
+ "guiSubagentApiKey": "your-api-key",
194
+ "searchApiKey": "",
195
+ "executionMode": "smart",
196
+ "approvalMode": "smart",
197
+ "checkpointing": {
198
+ "enabled": false,
199
+ "autoCreate": true,
200
+ "maxCheckpoints": 10
201
+ },
202
+ "thinking": {
203
+ "enabled": true,
204
+ "mode": "normal",
205
+ "displayMode": "compact"
206
+ },
207
+ "contextCompression": {
208
+ "enabled": true,
209
+ "maxMessages": 30,
210
+ "maxContextSize": 1500000,
211
+ "preserveRecentMessages": 0,
212
+ "enableSummary": true
213
+ },
214
+ "contextFileName": "XAGENT.md",
215
+ "mcpServers": {},
216
+ "language": "en",
217
+ "autoUpdate": true,
218
+ "telemetryEnabled": true,
219
+ "showToolDetails": false,
220
+ "showAIDebugInfo": false,
221
+ "loggerLevel": "info",
222
+ "contextCompress": {
223
+ "enabled": false,
224
+ "autoTrigger": false,
225
+ "messageThreshold": 50,
226
+ "tokenThreshold": 100000,
227
+ "strategy": "summary",
228
+ "preserveRecent": 5
229
+ },
230
+ "type": "openai_compatible"
231
+ }
232
+ ```
233
+
234
+ ---
235
+
236
+ ## 📚 Documentation
237
+
238
+ - 📖 [Architecture](docs/architecture/overview.md)
239
+ - 🔧 [Tool System](docs/architecture/tool-system-design.md)
240
+ - 🔌 [SKILL, Worflow and MCP Integration](docs/architecture/mcp-integration-guide.md)
241
+ - 💻 [CLI Commands](docs/cli/commands.md)
242
+ - 🤝 [Contributing](CONTRIBUTING.md)
243
+ - 🔑 [Third-Party Models](docs/third-party-models.md)
244
+
245
+ ---
246
+
247
+ ## 🤝 Contributing
248
+
249
+ We welcome contributions! Here's how to get started:
250
+
251
+ 1. 🍴 Fork the repository
252
+ 2. 🌿 Create a feature branch
253
+ 3. ✅ Ensure tests pass
254
+ 4. 📝 Submit a PR
255
+
256
+ ---
257
+
258
+ ## 📄 License
259
+
260
+ MIT License - See [LICENSE](./LICENSE)
261
+
262
+ ---
263
+
264
+ ## 🙏 Acknowledgments
265
+
266
+ <div align="center">
267
+
268
+ Built with ❤️ using [Ink](https://github.com/vadimdemedes/ink) • Powered by [xAgent Platform](https://platform.xagent.cn/)
269
+
270
+ </div>
271
+
272
+ ---
273
+
274
+ <div align="center">
275
+
276
+ ### 🌟 Star us on GitHub!
277
+
278
+ **Empowering Your Digital Life with AI**
279
+
280
+ </div>
package/README_CN.md CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
  ![xAgent CLI 截图](./assets/xagent-cli.png)
16
16
 
17
- **[English](README.md)** | **[中文](README_CN.md)**
17
+ **[官网](http://154.8.140.52)** | **[English](README.md)** | **[中文](README_CN.md)**
18
18
 
19
19
  </div>
20
20
 
@@ -46,10 +46,10 @@
46
46
 
47
47
  ```bash
48
48
  # 安装
49
- npm i -g xagent-cli
49
+ npm i -g @xagent-ai/cli
50
50
 
51
51
  # 启动
52
- xagent
52
+ xagent start
53
53
  ```
54
54
 
55
55
  **就这么简单!** 几秒钟内开始自动化你的数字生活。
@@ -1 +1 @@
1
- {"version":3,"file":"ai-client.d.ts","sourceRoot":"","sources":["../src/ai-client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxC,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,aAAa,GAAG,UAAU,CAAC;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAA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