@xagent/x-cli 1.1.67 → 1.1.68
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 +6 -2
- package/dist/index.js +102 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- Test comment for PR creation -->
|
|
2
|
+
|
|
3
|
+
## 1.1.68 – Logo Assets & NPM Publication Complete
|
|
2
4
|
|
|
3
5
|
✅ **Live on NPM**: [@xagent/x-cli](https://www.npmjs.com/package/@xagent/x-cli) - Fully published and ready for global installation
|
|
4
6
|
|
|
@@ -1078,7 +1080,7 @@ To add yourself as a contributor:
|
|
|
1078
1080
|
|
|
1079
1081
|
- **[@unblock-everything](https://github.com/unblock-everything)** — [x.ai](https://x.ai) — Cold-ass honkey 😎
|
|
1080
1082
|
- **[@Bucko89](https://github.com/Bucko89)** — [GMA](https://getmyagencies.com) — Grinding daily
|
|
1081
|
-
- **[@base-buzz](https://github.com/base-buzz)** — [
|
|
1083
|
+
- **[@base-buzz](https://github.com/base-buzz)** — [BaseBUzz](team.basebuzz.com)
|
|
1082
1084
|
|
|
1083
1085
|
_Want to see your name here? Check out our [Contributing Guide](CONTRIBUTING.md) and submit a pull request!_
|
|
1084
1086
|
|
|
@@ -1102,3 +1104,5 @@ _Want to see your name here? Check out our [Contributing Guide](CONTRIBUTING.md)
|
|
|
1102
1104
|
- 💡 **Feature requests** - Suggest new functionality
|
|
1103
1105
|
|
|
1104
1106
|
Join our growing community of AI-powered terminal enthusiasts!
|
|
1107
|
+
|
|
1108
|
+
# Test: Branch Protection Rules Test
|
package/dist/index.js
CHANGED
|
@@ -14655,7 +14655,7 @@ ${guardrail.createdFrom ? `- Created from incident: ${guardrail.createdFrom}` :
|
|
|
14655
14655
|
var package_default = {
|
|
14656
14656
|
type: "module",
|
|
14657
14657
|
name: "@xagent/x-cli",
|
|
14658
|
-
version: "1.1.
|
|
14658
|
+
version: "1.1.68",
|
|
14659
14659
|
description: "An open-source AI agent that brings the power of Grok directly into your terminal.",
|
|
14660
14660
|
main: "dist/index.js",
|
|
14661
14661
|
module: "dist/index.js",
|
|
@@ -16501,23 +16501,109 @@ ${commitMessage}`
|
|
|
16501
16501
|
setChatHistory((prev) => [...prev, commitEntry]);
|
|
16502
16502
|
if (commitResult.success) {
|
|
16503
16503
|
const pushResult = await agent.executeBashCommand("git push");
|
|
16504
|
-
|
|
16505
|
-
|
|
16506
|
-
|
|
16504
|
+
if (pushResult.success) {
|
|
16505
|
+
const pushEntry = {
|
|
16506
|
+
type: "tool_result",
|
|
16507
|
+
content: `\u{1F680} **Push Successful**: ${pushResult.output?.split("\n")[0] || "Changes pushed to remote"}`,
|
|
16508
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
16509
|
+
toolCall: {
|
|
16510
|
+
id: `git_push_${Date.now()}`,
|
|
16511
|
+
type: "function",
|
|
16512
|
+
function: {
|
|
16513
|
+
name: "bash",
|
|
16514
|
+
arguments: JSON.stringify({ command: "git push" })
|
|
16515
|
+
}
|
|
16516
|
+
},
|
|
16517
|
+
toolResult: pushResult
|
|
16518
|
+
};
|
|
16519
|
+
setChatHistory((prev) => [...prev, pushEntry]);
|
|
16520
|
+
} else {
|
|
16521
|
+
const pushError = pushResult.error || pushResult.output || "";
|
|
16522
|
+
if (pushError.includes("protected branch") || pushError.includes("Changes must be made through a pull request") || pushError.includes("GH006")) {
|
|
16523
|
+
const branchProtectionEntry = {
|
|
16524
|
+
type: "assistant",
|
|
16525
|
+
content: "\u{1F6E1}\uFE0F **Branch Protection Detected**: Direct pushes to this branch are blocked.\n\n\u{1F504} **Creating PR workflow...**",
|
|
16526
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
16527
|
+
};
|
|
16528
|
+
setChatHistory((prev) => [...prev, branchProtectionEntry]);
|
|
16529
|
+
const featureBranch = `feature/${(/* @__PURE__ */ new Date()).toISOString().slice(0, 19).replace(/[:-]/g, "").replace("T", "-")}-smart-push`;
|
|
16530
|
+
const createBranchResult = await agent.executeBashCommand(`git checkout -b ${featureBranch}`);
|
|
16531
|
+
if (createBranchResult.success) {
|
|
16532
|
+
const pushBranchResult = await agent.executeBashCommand(`git push -u origin ${featureBranch}`);
|
|
16533
|
+
if (pushBranchResult.success) {
|
|
16534
|
+
const branchSuccessEntry = {
|
|
16535
|
+
type: "tool_result",
|
|
16536
|
+
content: `\u2705 **Feature Branch Created**: \`${featureBranch}\`
|
|
16537
|
+
|
|
16538
|
+
\u{1F4CB} **Attempting to create Pull Request...**`,
|
|
16539
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
16540
|
+
};
|
|
16541
|
+
setChatHistory((prev) => [...prev, branchSuccessEntry]);
|
|
16542
|
+
const prResult = await agent.executeBashCommand(`gh pr create --title "${cleanCommitMessage}" --body "Auto-generated PR from smart-push" --head ${featureBranch} --base main`);
|
|
16543
|
+
if (prResult.success) {
|
|
16544
|
+
const prUrl = prResult.output?.match(/https:\/\/github\.com\/[^\s]+/)?.[0];
|
|
16545
|
+
const prSuccessEntry = {
|
|
16546
|
+
type: "tool_result",
|
|
16547
|
+
content: `\u2705 **Pull Request Created Successfully!**
|
|
16507
16548
|
|
|
16508
|
-
|
|
16509
|
-
|
|
16510
|
-
|
|
16511
|
-
|
|
16512
|
-
|
|
16513
|
-
|
|
16514
|
-
|
|
16515
|
-
|
|
16549
|
+
\u{1F517} **PR URL**: ${prUrl || "Check GitHub for the link"}
|
|
16550
|
+
|
|
16551
|
+
\u{1F3AF} **Next Steps**:
|
|
16552
|
+
\u2022 Review the PR on GitHub
|
|
16553
|
+
\u2022 Wait for CI checks to pass
|
|
16554
|
+
\u2022 Request approval and merge`,
|
|
16555
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
16556
|
+
};
|
|
16557
|
+
setChatHistory((prev) => [...prev, prSuccessEntry]);
|
|
16558
|
+
} else {
|
|
16559
|
+
const prManualEntry = {
|
|
16560
|
+
type: "assistant",
|
|
16561
|
+
content: `\u26A0\uFE0F **PR Creation Failed**: GitHub CLI may not be available.
|
|
16562
|
+
|
|
16563
|
+
\u{1F4A1} **Create PR Manually**:
|
|
16564
|
+
\u2022 Go to GitHub repository
|
|
16565
|
+
\u2022 Create PR from \`${featureBranch}\` \u2192 \`main\`
|
|
16566
|
+
\u2022 Title: \`${cleanCommitMessage}\``,
|
|
16567
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
16568
|
+
};
|
|
16569
|
+
setChatHistory((prev) => [...prev, prManualEntry]);
|
|
16570
|
+
}
|
|
16571
|
+
} else {
|
|
16572
|
+
const pushFailEntry = {
|
|
16573
|
+
type: "tool_result",
|
|
16574
|
+
content: `\u274C **Failed to push feature branch**: ${pushBranchResult.error}`,
|
|
16575
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
16576
|
+
};
|
|
16577
|
+
setChatHistory((prev) => [...prev, pushFailEntry]);
|
|
16578
|
+
}
|
|
16579
|
+
} else {
|
|
16580
|
+
const branchFailEntry = {
|
|
16581
|
+
type: "tool_result",
|
|
16582
|
+
content: `\u274C **Failed to create feature branch**: ${createBranchResult.error}`,
|
|
16583
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
16584
|
+
};
|
|
16585
|
+
setChatHistory((prev) => [...prev, branchFailEntry]);
|
|
16516
16586
|
}
|
|
16517
|
-
}
|
|
16518
|
-
|
|
16519
|
-
|
|
16520
|
-
|
|
16587
|
+
} else {
|
|
16588
|
+
const pushFailEntry = {
|
|
16589
|
+
type: "tool_result",
|
|
16590
|
+
content: `\u274C **Push Failed**: ${pushResult.error || "Unknown error"}
|
|
16591
|
+
|
|
16592
|
+
Try running \`git push\` manually.`,
|
|
16593
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
16594
|
+
toolCall: {
|
|
16595
|
+
id: `git_push_${Date.now()}`,
|
|
16596
|
+
type: "function",
|
|
16597
|
+
function: {
|
|
16598
|
+
name: "bash",
|
|
16599
|
+
arguments: JSON.stringify({ command: "git push" })
|
|
16600
|
+
}
|
|
16601
|
+
},
|
|
16602
|
+
toolResult: pushResult
|
|
16603
|
+
};
|
|
16604
|
+
setChatHistory((prev) => [...prev, pushFailEntry]);
|
|
16605
|
+
}
|
|
16606
|
+
}
|
|
16521
16607
|
}
|
|
16522
16608
|
} catch (error) {
|
|
16523
16609
|
const errorEntry = {
|