@xagent/x-cli 1.1.51 → 1.1.53
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 +1 -1
- package/dist/index.js +94 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
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.53",
|
|
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",
|
|
@@ -18309,6 +18309,99 @@ function ChatInterfaceWithAgent({
|
|
|
18309
18309
|
});
|
|
18310
18310
|
console.log(" ");
|
|
18311
18311
|
setChatHistory([]);
|
|
18312
|
+
if (fs__default.existsSync(".agent")) {
|
|
18313
|
+
const initialMessages = [];
|
|
18314
|
+
let docsRead = 0;
|
|
18315
|
+
initialMessages.push({
|
|
18316
|
+
type: "assistant",
|
|
18317
|
+
content: "\u{1F4DA} Reading core documentation into memory...",
|
|
18318
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
18319
|
+
});
|
|
18320
|
+
const archPath = path7__default.join(".agent", "system", "architecture.md");
|
|
18321
|
+
if (fs__default.existsSync(archPath)) {
|
|
18322
|
+
try {
|
|
18323
|
+
const archContent = fs__default.readFileSync(archPath, "utf8");
|
|
18324
|
+
initialMessages.push({
|
|
18325
|
+
type: "assistant",
|
|
18326
|
+
content: `\u{1F4CB} **System Architecture (from .agent/system/architecture.md)**
|
|
18327
|
+
|
|
18328
|
+
${archContent}`,
|
|
18329
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
18330
|
+
});
|
|
18331
|
+
docsRead++;
|
|
18332
|
+
} catch (_error) {
|
|
18333
|
+
}
|
|
18334
|
+
}
|
|
18335
|
+
const workflowPath = path7__default.join(".agent", "sop", "git-workflow.md");
|
|
18336
|
+
if (fs__default.existsSync(workflowPath)) {
|
|
18337
|
+
try {
|
|
18338
|
+
const workflowContent = fs__default.readFileSync(workflowPath, "utf8");
|
|
18339
|
+
initialMessages.push({
|
|
18340
|
+
type: "assistant",
|
|
18341
|
+
content: `\u{1F527} **Git Workflow SOP (from .agent/sop/git-workflow.md)**
|
|
18342
|
+
|
|
18343
|
+
${workflowContent}`,
|
|
18344
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
18345
|
+
});
|
|
18346
|
+
docsRead++;
|
|
18347
|
+
} catch (_error) {
|
|
18348
|
+
}
|
|
18349
|
+
}
|
|
18350
|
+
const sopDir = path7__default.join(".agent", "sop");
|
|
18351
|
+
if (fs__default.existsSync(sopDir)) {
|
|
18352
|
+
const sopFiles = ["release-management.md", "automation-protection.md"];
|
|
18353
|
+
for (const file of sopFiles) {
|
|
18354
|
+
const filePath = path7__default.join(sopDir, file);
|
|
18355
|
+
if (fs__default.existsSync(filePath)) {
|
|
18356
|
+
try {
|
|
18357
|
+
const content = fs__default.readFileSync(filePath, "utf8");
|
|
18358
|
+
const title = file.replace(".md", "").replace("-", " ").toUpperCase();
|
|
18359
|
+
initialMessages.push({
|
|
18360
|
+
type: "assistant",
|
|
18361
|
+
content: `\u{1F4D6} **${title} SOP (from .agent/sop/${file})**
|
|
18362
|
+
|
|
18363
|
+
${content}`,
|
|
18364
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
18365
|
+
});
|
|
18366
|
+
docsRead++;
|
|
18367
|
+
} catch (_error) {
|
|
18368
|
+
}
|
|
18369
|
+
}
|
|
18370
|
+
}
|
|
18371
|
+
}
|
|
18372
|
+
const systemDir = path7__default.join(".agent", "system");
|
|
18373
|
+
if (fs__default.existsSync(systemDir)) {
|
|
18374
|
+
const systemFiles = ["critical-state.md", "installation.md", "api-schema.md", "auto-read-system.md"];
|
|
18375
|
+
for (const file of systemFiles) {
|
|
18376
|
+
const filePath = path7__default.join(systemDir, file);
|
|
18377
|
+
if (fs__default.existsSync(filePath)) {
|
|
18378
|
+
try {
|
|
18379
|
+
const content = fs__default.readFileSync(filePath, "utf8");
|
|
18380
|
+
const title = file.replace(".md", "").replace("-", " ").toUpperCase();
|
|
18381
|
+
initialMessages.push({
|
|
18382
|
+
type: "assistant",
|
|
18383
|
+
content: `\u{1F3D7}\uFE0F **${title} (from .agent/system/${file})**
|
|
18384
|
+
|
|
18385
|
+
${content}`,
|
|
18386
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
18387
|
+
});
|
|
18388
|
+
docsRead++;
|
|
18389
|
+
} catch (_error) {
|
|
18390
|
+
}
|
|
18391
|
+
}
|
|
18392
|
+
}
|
|
18393
|
+
}
|
|
18394
|
+
if (docsRead > 0) {
|
|
18395
|
+
initialMessages.push({
|
|
18396
|
+
type: "assistant",
|
|
18397
|
+
content: `\u2705 ${docsRead} documentation files read - I have a complete understanding of the current architecture and operational procedures.`,
|
|
18398
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
18399
|
+
});
|
|
18400
|
+
}
|
|
18401
|
+
if (initialMessages.length > 0) {
|
|
18402
|
+
setChatHistory(initialMessages);
|
|
18403
|
+
}
|
|
18404
|
+
}
|
|
18312
18405
|
}, []);
|
|
18313
18406
|
useEffect(() => {
|
|
18314
18407
|
const newEntries = chatHistory.slice(lastChatHistoryLength.current);
|