@xagent/x-cli 1.1.56 → 1.1.57
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 +4 -3
- package/dist/index.js +65 -60
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## 1.1.
|
|
1
|
+
## 1.1.57 – 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 `.agent/auto-read-config.json` for custom settings
|
|
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.57",
|
|
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",
|
|
@@ -18314,75 +18314,80 @@ function ChatInterfaceWithAgent({
|
|
|
18314
18314
|
if (fs__default.existsSync(".agent")) {
|
|
18315
18315
|
const initialMessages = [];
|
|
18316
18316
|
let docsRead = 0;
|
|
18317
|
-
|
|
18318
|
-
|
|
18319
|
-
|
|
18320
|
-
timestamp: /* @__PURE__ */ new Date()
|
|
18321
|
-
});
|
|
18322
|
-
const archPath = path7__default.join(".agent", "system", "architecture.md");
|
|
18323
|
-
if (fs__default.existsSync(archPath)) {
|
|
18317
|
+
let config2 = null;
|
|
18318
|
+
const configPath = path7__default.join(".agent", "auto-read-config.json");
|
|
18319
|
+
if (fs__default.existsSync(configPath)) {
|
|
18324
18320
|
try {
|
|
18325
|
-
const
|
|
18326
|
-
|
|
18327
|
-
type: "assistant",
|
|
18328
|
-
content: `\u{1F4CB} **System Architecture (from .agent/system/architecture.md)**
|
|
18329
|
-
|
|
18330
|
-
${archContent}`,
|
|
18331
|
-
timestamp: /* @__PURE__ */ new Date()
|
|
18332
|
-
});
|
|
18333
|
-
docsRead++;
|
|
18321
|
+
const configContent = fs__default.readFileSync(configPath, "utf8");
|
|
18322
|
+
config2 = JSON.parse(configContent);
|
|
18334
18323
|
} catch (_error) {
|
|
18335
18324
|
}
|
|
18336
18325
|
}
|
|
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
|
-
}
|
|
18326
|
+
const isEnabled = config2?.enabled !== false;
|
|
18327
|
+
const showLoadingMessage = config2?.showLoadingMessage !== false;
|
|
18328
|
+
const showSummaryMessage = config2?.showSummaryMessage !== false;
|
|
18329
|
+
if (!isEnabled) {
|
|
18330
|
+
return;
|
|
18351
18331
|
}
|
|
18352
|
-
|
|
18353
|
-
|
|
18354
|
-
|
|
18355
|
-
|
|
18356
|
-
|
|
18357
|
-
|
|
18358
|
-
|
|
18359
|
-
|
|
18360
|
-
|
|
18361
|
-
|
|
18362
|
-
|
|
18363
|
-
|
|
18364
|
-
|
|
18365
|
-
|
|
18366
|
-
|
|
18367
|
-
|
|
18368
|
-
|
|
18369
|
-
|
|
18370
|
-
|
|
18371
|
-
|
|
18332
|
+
if (showLoadingMessage) {
|
|
18333
|
+
initialMessages.push({
|
|
18334
|
+
type: "assistant",
|
|
18335
|
+
content: "\u{1F4DA} Reading core documentation into memory...",
|
|
18336
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
18337
|
+
});
|
|
18338
|
+
}
|
|
18339
|
+
const folders = config2?.folders || [
|
|
18340
|
+
{
|
|
18341
|
+
name: "system",
|
|
18342
|
+
priority: 1,
|
|
18343
|
+
files: [
|
|
18344
|
+
{ name: "architecture.md", title: "System Architecture", icon: "\u{1F4CB}", required: true },
|
|
18345
|
+
{ name: "critical-state.md", title: "Critical State", icon: "\u{1F3D7}\uFE0F", required: false },
|
|
18346
|
+
{ name: "installation.md", title: "Installation", icon: "\u{1F3D7}\uFE0F", required: false },
|
|
18347
|
+
{ name: "api-schema.md", title: "API Schema", icon: "\u{1F3D7}\uFE0F", required: false },
|
|
18348
|
+
{ name: "auto-read-system.md", title: "Auto-Read System", icon: "\u{1F3D7}\uFE0F", required: false }
|
|
18349
|
+
]
|
|
18350
|
+
},
|
|
18351
|
+
{
|
|
18352
|
+
name: "sop",
|
|
18353
|
+
priority: 2,
|
|
18354
|
+
files: [
|
|
18355
|
+
{ name: "git-workflow.md", title: "Git Workflow SOP", icon: "\u{1F527}", required: true },
|
|
18356
|
+
{ name: "release-management.md", title: "Release Management SOP", icon: "\u{1F4D6}", required: false },
|
|
18357
|
+
{ name: "automation-protection.md", title: "Automation Protection SOP", icon: "\u{1F4D6}", required: false },
|
|
18358
|
+
{ name: "npm-publishing-troubleshooting.md", title: "NPM Publishing Troubleshooting", icon: "\u{1F4D6}", required: false }
|
|
18359
|
+
]
|
|
18372
18360
|
}
|
|
18361
|
+
];
|
|
18362
|
+
if (config2?.customFolders) {
|
|
18363
|
+
folders.push(...config2.customFolders);
|
|
18373
18364
|
}
|
|
18374
|
-
|
|
18375
|
-
|
|
18376
|
-
const
|
|
18377
|
-
|
|
18378
|
-
|
|
18379
|
-
|
|
18365
|
+
folders.sort((a, b) => (a.priority || 999) - (b.priority || 999));
|
|
18366
|
+
for (const folder of folders) {
|
|
18367
|
+
const folderPath = path7__default.join(".agent", folder.name);
|
|
18368
|
+
if (!fs__default.existsSync(folderPath)) {
|
|
18369
|
+
continue;
|
|
18370
|
+
}
|
|
18371
|
+
for (const file of folder.files) {
|
|
18372
|
+
let filePaths = [];
|
|
18373
|
+
if (file.pattern) {
|
|
18374
|
+
continue;
|
|
18375
|
+
} else {
|
|
18376
|
+
filePaths = [file.name];
|
|
18377
|
+
}
|
|
18378
|
+
for (const fileName of filePaths) {
|
|
18379
|
+
const filePath = path7__default.join(folderPath, fileName);
|
|
18380
|
+
if (!fs__default.existsSync(filePath)) {
|
|
18381
|
+
if (file.required) ;
|
|
18382
|
+
continue;
|
|
18383
|
+
}
|
|
18380
18384
|
try {
|
|
18381
18385
|
const content = fs__default.readFileSync(filePath, "utf8");
|
|
18382
|
-
const
|
|
18386
|
+
const displayTitle = file.title || fileName.replace(".md", "").replace("-", " ").toUpperCase();
|
|
18387
|
+
const icon = file.icon || "\u{1F4C4}";
|
|
18383
18388
|
initialMessages.push({
|
|
18384
18389
|
type: "assistant",
|
|
18385
|
-
content:
|
|
18390
|
+
content: `${icon} **${displayTitle} (from .agent/${folder.name}/${fileName})**
|
|
18386
18391
|
|
|
18387
18392
|
${content}`,
|
|
18388
18393
|
timestamp: /* @__PURE__ */ new Date()
|
|
@@ -18393,7 +18398,7 @@ ${content}`,
|
|
|
18393
18398
|
}
|
|
18394
18399
|
}
|
|
18395
18400
|
}
|
|
18396
|
-
if (docsRead > 0) {
|
|
18401
|
+
if (showSummaryMessage && docsRead > 0) {
|
|
18397
18402
|
initialMessages.push({
|
|
18398
18403
|
type: "assistant",
|
|
18399
18404
|
content: `\u2705 ${docsRead} documentation files read - I have a complete understanding of the current architecture and operational procedures.`,
|