@xagent/x-cli 1.1.56 → 1.1.58
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/.xcli/auto-read-config.json +100 -0
- package/README.md +4 -3
- package/dist/index.js +82 -68
- package/dist/index.js.map +1 -1
- package/package.json +8 -7
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
{
|
|
2
|
+
"enabled": true,
|
|
3
|
+
"showLoadingMessage": true,
|
|
4
|
+
"showSummaryMessage": true,
|
|
5
|
+
"folders": [
|
|
6
|
+
{
|
|
7
|
+
"name": "system",
|
|
8
|
+
"description": "System Architecture & State",
|
|
9
|
+
"priority": 1,
|
|
10
|
+
"files": [
|
|
11
|
+
{
|
|
12
|
+
"name": "architecture.md",
|
|
13
|
+
"title": "System Architecture",
|
|
14
|
+
"description": "Complete system design and technology stack",
|
|
15
|
+
"icon": "📋",
|
|
16
|
+
"required": true
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "critical-state.md",
|
|
20
|
+
"title": "Critical State",
|
|
21
|
+
"description": "Current system capabilities and status",
|
|
22
|
+
"icon": "🏗️",
|
|
23
|
+
"required": false
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "installation.md",
|
|
27
|
+
"title": "Installation",
|
|
28
|
+
"description": "Setup and deployment procedures",
|
|
29
|
+
"icon": "🏗️",
|
|
30
|
+
"required": false
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "api-schema.md",
|
|
34
|
+
"title": "API Schema",
|
|
35
|
+
"description": "API integration specifications",
|
|
36
|
+
"icon": "🏗️",
|
|
37
|
+
"required": false
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "auto-read-system.md",
|
|
41
|
+
"title": "Auto-Read System",
|
|
42
|
+
"description": "Documentation of this auto-loading feature",
|
|
43
|
+
"icon": "🏗️",
|
|
44
|
+
"required": false
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "sop",
|
|
50
|
+
"description": "Standard Operating Procedures",
|
|
51
|
+
"priority": 2,
|
|
52
|
+
"files": [
|
|
53
|
+
{
|
|
54
|
+
"name": "git-workflow.md",
|
|
55
|
+
"title": "Git Workflow SOP",
|
|
56
|
+
"description": "Git workflow standards and smart push guidelines",
|
|
57
|
+
"icon": "🔧",
|
|
58
|
+
"required": true
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "release-management.md",
|
|
62
|
+
"title": "Release Management SOP",
|
|
63
|
+
"description": "Automated release processes and version management",
|
|
64
|
+
"icon": "📖",
|
|
65
|
+
"required": false
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "automation-protection.md",
|
|
69
|
+
"title": "Automation Protection SOP",
|
|
70
|
+
"description": "Safeguards for automated NPM publishing",
|
|
71
|
+
"icon": "📖",
|
|
72
|
+
"required": false
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "npm-publishing-troubleshooting.md",
|
|
76
|
+
"title": "NPM Publishing Troubleshooting",
|
|
77
|
+
"description": "NPM publication issue resolution",
|
|
78
|
+
"icon": "📖",
|
|
79
|
+
"required": false
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
"customFolders": [
|
|
85
|
+
// Add custom folders here
|
|
86
|
+
// {
|
|
87
|
+
// "name": "guides",
|
|
88
|
+
// "description": "Project Guides",
|
|
89
|
+
// "priority": 3,
|
|
90
|
+
// "files": [
|
|
91
|
+
// {
|
|
92
|
+
// "name": "*.md",
|
|
93
|
+
// "pattern": true,
|
|
94
|
+
// "title": "Guide",
|
|
95
|
+
// "icon": "📚"
|
|
96
|
+
// }
|
|
97
|
+
// ]
|
|
98
|
+
// }
|
|
99
|
+
]
|
|
100
|
+
}
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## 1.1.
|
|
1
|
+
## 1.1.58 – Logo Assets & NPM Publication Complete
|
|
2
2
|
|
|
3
3
|
✅ **Live on NPM**: [@xagent/x-cli](https://www.npmjs.com/package/@xagent/x-cli) - Fully published and ready for global installation
|
|
4
4
|
|
|
@@ -430,8 +430,9 @@ The **`.agent` folder** is the most powerful feature of X CLI, enabling **self-d
|
|
|
430
430
|
When you run `npx -y @xagent/x-cli@latest`, the CLI automatically detects and reads `.agent/` documentation:
|
|
431
431
|
|
|
432
432
|
1. **Auto-Discovery**: Scans for `.agent/` folder in current directory
|
|
433
|
-
2. **
|
|
434
|
-
3. **
|
|
433
|
+
2. **Configuration Loading**: Reads `.xcli/auto-read-config.json` (distributed) or `.agent/auto-read-config.json` (project override)
|
|
434
|
+
3. **Smart Loading**: Reads configured documentation files into chat context
|
|
435
|
+
4. **Context Enhancement**: Provides comprehensive project understanding to AI
|
|
435
436
|
|
|
436
437
|
### 📂 **Key Components**
|
|
437
438
|
|
package/dist/index.js
CHANGED
|
@@ -9293,7 +9293,7 @@ EOF`;
|
|
|
9293
9293
|
var package_default = {
|
|
9294
9294
|
type: "module",
|
|
9295
9295
|
name: "@xagent/x-cli",
|
|
9296
|
-
version: "1.1.
|
|
9296
|
+
version: "1.1.58",
|
|
9297
9297
|
description: "An open-source AI agent that brings the power of Grok directly into your terminal.",
|
|
9298
9298
|
main: "dist/index.js",
|
|
9299
9299
|
module: "dist/index.js",
|
|
@@ -9307,6 +9307,13 @@ var package_default = {
|
|
|
9307
9307
|
bin: {
|
|
9308
9308
|
xcli: "dist/index.js"
|
|
9309
9309
|
},
|
|
9310
|
+
files: [
|
|
9311
|
+
"dist/**/*",
|
|
9312
|
+
".xcli/**/*",
|
|
9313
|
+
"README.md",
|
|
9314
|
+
"LICENSE",
|
|
9315
|
+
"docs/assets/logos/**/*"
|
|
9316
|
+
],
|
|
9310
9317
|
scripts: {
|
|
9311
9318
|
build: "tsup",
|
|
9312
9319
|
"build:tsc": "tsc",
|
|
@@ -9405,12 +9412,6 @@ var package_default = {
|
|
|
9405
9412
|
},
|
|
9406
9413
|
homepage: "https://grokcli.dev",
|
|
9407
9414
|
icon: "docs/assets/logos/x-cli-logo.svg",
|
|
9408
|
-
files: [
|
|
9409
|
-
"dist/**/*",
|
|
9410
|
-
"README.md",
|
|
9411
|
-
"LICENSE",
|
|
9412
|
-
"docs/assets/logos/**/*"
|
|
9413
|
-
],
|
|
9414
9415
|
publishConfig: {
|
|
9415
9416
|
access: "public"
|
|
9416
9417
|
},
|
|
@@ -18314,75 +18315,88 @@ function ChatInterfaceWithAgent({
|
|
|
18314
18315
|
if (fs__default.existsSync(".agent")) {
|
|
18315
18316
|
const initialMessages = [];
|
|
18316
18317
|
let docsRead = 0;
|
|
18317
|
-
|
|
18318
|
-
|
|
18319
|
-
|
|
18320
|
-
|
|
18321
|
-
|
|
18322
|
-
|
|
18323
|
-
|
|
18324
|
-
|
|
18325
|
-
|
|
18326
|
-
|
|
18327
|
-
|
|
18328
|
-
|
|
18329
|
-
|
|
18330
|
-
|
|
18331
|
-
|
|
18332
|
-
});
|
|
18333
|
-
docsRead++;
|
|
18334
|
-
} catch (_error) {
|
|
18318
|
+
let config2 = null;
|
|
18319
|
+
const configPaths = [
|
|
18320
|
+
path7__default.join(".xcli", "auto-read-config.json"),
|
|
18321
|
+
// User config (distributed)
|
|
18322
|
+
path7__default.join(".agent", "auto-read-config.json")
|
|
18323
|
+
// Dev override (gitignored)
|
|
18324
|
+
];
|
|
18325
|
+
for (const configPath of configPaths) {
|
|
18326
|
+
if (fs__default.existsSync(configPath)) {
|
|
18327
|
+
try {
|
|
18328
|
+
const configContent = fs__default.readFileSync(configPath, "utf8");
|
|
18329
|
+
config2 = JSON.parse(configContent);
|
|
18330
|
+
break;
|
|
18331
|
+
} catch (_error) {
|
|
18332
|
+
}
|
|
18335
18333
|
}
|
|
18336
18334
|
}
|
|
18337
|
-
const
|
|
18338
|
-
|
|
18339
|
-
|
|
18340
|
-
|
|
18341
|
-
|
|
18342
|
-
type: "assistant",
|
|
18343
|
-
content: `\u{1F527} **Git Workflow SOP (from .agent/sop/git-workflow.md)**
|
|
18344
|
-
|
|
18345
|
-
${workflowContent}`,
|
|
18346
|
-
timestamp: /* @__PURE__ */ new Date()
|
|
18347
|
-
});
|
|
18348
|
-
docsRead++;
|
|
18349
|
-
} catch (_error) {
|
|
18350
|
-
}
|
|
18335
|
+
const isEnabled = config2?.enabled !== false;
|
|
18336
|
+
const showLoadingMessage = config2?.showLoadingMessage !== false;
|
|
18337
|
+
const showSummaryMessage = config2?.showSummaryMessage !== false;
|
|
18338
|
+
if (!isEnabled) {
|
|
18339
|
+
return;
|
|
18351
18340
|
}
|
|
18352
|
-
|
|
18353
|
-
|
|
18354
|
-
|
|
18355
|
-
|
|
18356
|
-
|
|
18357
|
-
|
|
18358
|
-
|
|
18359
|
-
|
|
18360
|
-
|
|
18361
|
-
|
|
18362
|
-
|
|
18363
|
-
|
|
18364
|
-
|
|
18365
|
-
|
|
18366
|
-
|
|
18367
|
-
|
|
18368
|
-
|
|
18369
|
-
|
|
18370
|
-
|
|
18371
|
-
|
|
18341
|
+
if (showLoadingMessage) {
|
|
18342
|
+
initialMessages.push({
|
|
18343
|
+
type: "assistant",
|
|
18344
|
+
content: "\u{1F4DA} Reading core documentation into memory...",
|
|
18345
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
18346
|
+
});
|
|
18347
|
+
}
|
|
18348
|
+
const folders = config2?.folders || [
|
|
18349
|
+
{
|
|
18350
|
+
name: "system",
|
|
18351
|
+
priority: 1,
|
|
18352
|
+
files: [
|
|
18353
|
+
{ name: "architecture.md", title: "System Architecture", icon: "\u{1F4CB}", required: true },
|
|
18354
|
+
{ name: "critical-state.md", title: "Critical State", icon: "\u{1F3D7}\uFE0F", required: false },
|
|
18355
|
+
{ name: "installation.md", title: "Installation", icon: "\u{1F3D7}\uFE0F", required: false },
|
|
18356
|
+
{ name: "api-schema.md", title: "API Schema", icon: "\u{1F3D7}\uFE0F", required: false },
|
|
18357
|
+
{ name: "auto-read-system.md", title: "Auto-Read System", icon: "\u{1F3D7}\uFE0F", required: false }
|
|
18358
|
+
]
|
|
18359
|
+
},
|
|
18360
|
+
{
|
|
18361
|
+
name: "sop",
|
|
18362
|
+
priority: 2,
|
|
18363
|
+
files: [
|
|
18364
|
+
{ name: "git-workflow.md", title: "Git Workflow SOP", icon: "\u{1F527}", required: true },
|
|
18365
|
+
{ name: "release-management.md", title: "Release Management SOP", icon: "\u{1F4D6}", required: false },
|
|
18366
|
+
{ name: "automation-protection.md", title: "Automation Protection SOP", icon: "\u{1F4D6}", required: false },
|
|
18367
|
+
{ name: "npm-publishing-troubleshooting.md", title: "NPM Publishing Troubleshooting", icon: "\u{1F4D6}", required: false }
|
|
18368
|
+
]
|
|
18372
18369
|
}
|
|
18370
|
+
];
|
|
18371
|
+
if (config2?.customFolders) {
|
|
18372
|
+
folders.push(...config2.customFolders);
|
|
18373
18373
|
}
|
|
18374
|
-
|
|
18375
|
-
|
|
18376
|
-
const
|
|
18377
|
-
|
|
18378
|
-
|
|
18379
|
-
|
|
18374
|
+
folders.sort((a, b) => (a.priority || 999) - (b.priority || 999));
|
|
18375
|
+
for (const folder of folders) {
|
|
18376
|
+
const folderPath = path7__default.join(".agent", folder.name);
|
|
18377
|
+
if (!fs__default.existsSync(folderPath)) {
|
|
18378
|
+
continue;
|
|
18379
|
+
}
|
|
18380
|
+
for (const file of folder.files) {
|
|
18381
|
+
let filePaths = [];
|
|
18382
|
+
if (file.pattern) {
|
|
18383
|
+
continue;
|
|
18384
|
+
} else {
|
|
18385
|
+
filePaths = [file.name];
|
|
18386
|
+
}
|
|
18387
|
+
for (const fileName of filePaths) {
|
|
18388
|
+
const filePath = path7__default.join(folderPath, fileName);
|
|
18389
|
+
if (!fs__default.existsSync(filePath)) {
|
|
18390
|
+
if (file.required) ;
|
|
18391
|
+
continue;
|
|
18392
|
+
}
|
|
18380
18393
|
try {
|
|
18381
18394
|
const content = fs__default.readFileSync(filePath, "utf8");
|
|
18382
|
-
const
|
|
18395
|
+
const displayTitle = file.title || fileName.replace(".md", "").replace("-", " ").toUpperCase();
|
|
18396
|
+
const icon = file.icon || "\u{1F4C4}";
|
|
18383
18397
|
initialMessages.push({
|
|
18384
18398
|
type: "assistant",
|
|
18385
|
-
content:
|
|
18399
|
+
content: `${icon} **${displayTitle} (from .agent/${folder.name}/${fileName})**
|
|
18386
18400
|
|
|
18387
18401
|
${content}`,
|
|
18388
18402
|
timestamp: /* @__PURE__ */ new Date()
|
|
@@ -18393,7 +18407,7 @@ ${content}`,
|
|
|
18393
18407
|
}
|
|
18394
18408
|
}
|
|
18395
18409
|
}
|
|
18396
|
-
if (docsRead > 0) {
|
|
18410
|
+
if (showSummaryMessage && docsRead > 0) {
|
|
18397
18411
|
initialMessages.push({
|
|
18398
18412
|
type: "assistant",
|
|
18399
18413
|
content: `\u2705 ${docsRead} documentation files read - I have a complete understanding of the current architecture and operational procedures.`,
|