@xagent/x-cli 1.1.51 → 1.1.52
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 +77 -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.52",
|
|
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,82 @@ function ChatInterfaceWithAgent({
|
|
|
18309
18309
|
});
|
|
18310
18310
|
console.log(" ");
|
|
18311
18311
|
setChatHistory([]);
|
|
18312
|
+
if (fs__default.existsSync(".agent")) {
|
|
18313
|
+
const initialMessages = [];
|
|
18314
|
+
const archPath = path7__default.join(".agent", "system", "architecture.md");
|
|
18315
|
+
if (fs__default.existsSync(archPath)) {
|
|
18316
|
+
try {
|
|
18317
|
+
const archContent = fs__default.readFileSync(archPath, "utf8");
|
|
18318
|
+
initialMessages.push({
|
|
18319
|
+
type: "assistant",
|
|
18320
|
+
content: `\u{1F4CB} **System Architecture (from .agent/system/architecture.md)**
|
|
18321
|
+
|
|
18322
|
+
${archContent}`,
|
|
18323
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
18324
|
+
});
|
|
18325
|
+
} catch (_error) {
|
|
18326
|
+
}
|
|
18327
|
+
}
|
|
18328
|
+
const workflowPath = path7__default.join(".agent", "sop", "git-workflow.md");
|
|
18329
|
+
if (fs__default.existsSync(workflowPath)) {
|
|
18330
|
+
try {
|
|
18331
|
+
const workflowContent = fs__default.readFileSync(workflowPath, "utf8");
|
|
18332
|
+
initialMessages.push({
|
|
18333
|
+
type: "assistant",
|
|
18334
|
+
content: `\u{1F527} **Git Workflow SOP (from .agent/sop/git-workflow.md)**
|
|
18335
|
+
|
|
18336
|
+
${workflowContent}`,
|
|
18337
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
18338
|
+
});
|
|
18339
|
+
} catch (_error) {
|
|
18340
|
+
}
|
|
18341
|
+
}
|
|
18342
|
+
const sopDir = path7__default.join(".agent", "sop");
|
|
18343
|
+
if (fs__default.existsSync(sopDir)) {
|
|
18344
|
+
const sopFiles = ["release-management.md", "automation-protection.md"];
|
|
18345
|
+
for (const file of sopFiles) {
|
|
18346
|
+
const filePath = path7__default.join(sopDir, file);
|
|
18347
|
+
if (fs__default.existsSync(filePath)) {
|
|
18348
|
+
try {
|
|
18349
|
+
const content = fs__default.readFileSync(filePath, "utf8");
|
|
18350
|
+
const title = file.replace(".md", "").replace("-", " ").toUpperCase();
|
|
18351
|
+
initialMessages.push({
|
|
18352
|
+
type: "assistant",
|
|
18353
|
+
content: `\u{1F4D6} **${title} SOP (from .agent/sop/${file})**
|
|
18354
|
+
|
|
18355
|
+
${content}`,
|
|
18356
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
18357
|
+
});
|
|
18358
|
+
} catch (_error) {
|
|
18359
|
+
}
|
|
18360
|
+
}
|
|
18361
|
+
}
|
|
18362
|
+
}
|
|
18363
|
+
const systemDir = path7__default.join(".agent", "system");
|
|
18364
|
+
if (fs__default.existsSync(systemDir)) {
|
|
18365
|
+
const systemFiles = ["critical-state.md", "installation.md", "api-schema.md"];
|
|
18366
|
+
for (const file of systemFiles) {
|
|
18367
|
+
const filePath = path7__default.join(systemDir, file);
|
|
18368
|
+
if (fs__default.existsSync(filePath)) {
|
|
18369
|
+
try {
|
|
18370
|
+
const content = fs__default.readFileSync(filePath, "utf8");
|
|
18371
|
+
const title = file.replace(".md", "").replace("-", " ").toUpperCase();
|
|
18372
|
+
initialMessages.push({
|
|
18373
|
+
type: "assistant",
|
|
18374
|
+
content: `\u{1F3D7}\uFE0F **${title} (from .agent/system/${file})**
|
|
18375
|
+
|
|
18376
|
+
${content}`,
|
|
18377
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
18378
|
+
});
|
|
18379
|
+
} catch (_error) {
|
|
18380
|
+
}
|
|
18381
|
+
}
|
|
18382
|
+
}
|
|
18383
|
+
}
|
|
18384
|
+
if (initialMessages.length > 0) {
|
|
18385
|
+
setChatHistory(initialMessages);
|
|
18386
|
+
}
|
|
18387
|
+
}
|
|
18312
18388
|
}, []);
|
|
18313
18389
|
useEffect(() => {
|
|
18314
18390
|
const newEntries = chatHistory.slice(lastChatHistoryLength.current);
|