@xagent/x-cli 1.1.64 → 1.1.66
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 +21 -24
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
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.66",
|
|
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",
|
|
@@ -17097,26 +17097,15 @@ function useConfirmations(confirmationService, state) {
|
|
|
17097
17097
|
handleRejection
|
|
17098
17098
|
};
|
|
17099
17099
|
}
|
|
17100
|
-
function useConsoleSetup() {
|
|
17100
|
+
function useConsoleSetup(quiet = false) {
|
|
17101
17101
|
useEffect(() => {
|
|
17102
|
+
if (quiet) return;
|
|
17102
17103
|
const isWindows = process.platform === "win32";
|
|
17103
17104
|
const isPowerShell = process.env.ComSpec?.toLowerCase().includes("powershell") || process.env.PSModulePath !== void 0;
|
|
17104
17105
|
if (!isWindows || !isPowerShell) {
|
|
17105
17106
|
console.clear();
|
|
17106
17107
|
}
|
|
17107
|
-
|
|
17108
|
-
console.log(" ");
|
|
17109
|
-
const logoOutput = "X-CLI\n" + package_default.version;
|
|
17110
|
-
const logoLines = logoOutput.split("\n");
|
|
17111
|
-
logoLines.forEach((line) => {
|
|
17112
|
-
if (line.trim()) {
|
|
17113
|
-
console.log(" " + line);
|
|
17114
|
-
} else {
|
|
17115
|
-
console.log(line);
|
|
17116
|
-
}
|
|
17117
|
-
});
|
|
17118
|
-
console.log(" ");
|
|
17119
|
-
}, []);
|
|
17108
|
+
}, [quiet]);
|
|
17120
17109
|
}
|
|
17121
17110
|
function useSessionLogging(chatHistory) {
|
|
17122
17111
|
const lastChatHistoryLength = useRef(0);
|
|
@@ -18828,7 +18817,8 @@ function ChatInterfaceRenderer({
|
|
|
18828
18817
|
}
|
|
18829
18818
|
function ChatInterfaceWithAgent({
|
|
18830
18819
|
agent,
|
|
18831
|
-
initialMessage
|
|
18820
|
+
initialMessage,
|
|
18821
|
+
quiet = false
|
|
18832
18822
|
}) {
|
|
18833
18823
|
const [chatHistory, setChatHistory] = useState([]);
|
|
18834
18824
|
const [isProcessing, setIsProcessing] = useState(false);
|
|
@@ -18838,10 +18828,10 @@ function ChatInterfaceWithAgent({
|
|
|
18838
18828
|
const [confirmationOptions, setConfirmationOptions] = useState(null);
|
|
18839
18829
|
const [showContextTooltip, setShowContextTooltip] = useState(false);
|
|
18840
18830
|
const processingStartTime = useRef(0);
|
|
18841
|
-
useConsoleSetup();
|
|
18831
|
+
useConsoleSetup(quiet);
|
|
18832
|
+
useAutoRead(setChatHistory);
|
|
18842
18833
|
useEffect(() => {
|
|
18843
18834
|
setChatHistory([]);
|
|
18844
|
-
useAutoRead(setChatHistory);
|
|
18845
18835
|
}, []);
|
|
18846
18836
|
useSessionLogging(chatHistory);
|
|
18847
18837
|
const { contextInfo } = useContextInfo(agent);
|
|
@@ -18931,7 +18921,8 @@ function ChatInterfaceWithAgent({
|
|
|
18931
18921
|
}
|
|
18932
18922
|
function ChatInterface({
|
|
18933
18923
|
agent,
|
|
18934
|
-
initialMessage
|
|
18924
|
+
initialMessage,
|
|
18925
|
+
quiet = false
|
|
18935
18926
|
}) {
|
|
18936
18927
|
const [currentAgent, setCurrentAgent] = useState(
|
|
18937
18928
|
agent || null
|
|
@@ -18946,7 +18937,8 @@ function ChatInterface({
|
|
|
18946
18937
|
ChatInterfaceWithAgent,
|
|
18947
18938
|
{
|
|
18948
18939
|
agent: currentAgent,
|
|
18949
|
-
initialMessage
|
|
18940
|
+
initialMessage,
|
|
18941
|
+
quiet
|
|
18950
18942
|
}
|
|
18951
18943
|
);
|
|
18952
18944
|
}
|
|
@@ -19313,7 +19305,7 @@ Respond with ONLY the commit message, no additional text.`;
|
|
|
19313
19305
|
process.exit(1);
|
|
19314
19306
|
}
|
|
19315
19307
|
} catch (error) {
|
|
19316
|
-
console.error("\u274C Error during commit and push:", error.message);
|
|
19308
|
+
console.error("\u274C Error during commit and push:", error instanceof Error ? error.message : String(error));
|
|
19317
19309
|
process.exit(1);
|
|
19318
19310
|
}
|
|
19319
19311
|
}
|
|
@@ -19367,7 +19359,7 @@ async function processPromptHeadless(prompt, apiKey, baseURL, model, maxToolRoun
|
|
|
19367
19359
|
console.log(
|
|
19368
19360
|
JSON.stringify({
|
|
19369
19361
|
role: "assistant",
|
|
19370
|
-
content: `Error: ${error.message}`
|
|
19362
|
+
content: `Error: ${error instanceof Error ? error.message : String(error)}`
|
|
19371
19363
|
})
|
|
19372
19364
|
);
|
|
19373
19365
|
process.exit(1);
|
|
@@ -19388,6 +19380,9 @@ program.name("grok").description(
|
|
|
19388
19380
|
"--max-tool-rounds <rounds>",
|
|
19389
19381
|
"maximum number of tool execution rounds (default: 400)",
|
|
19390
19382
|
"400"
|
|
19383
|
+
).option(
|
|
19384
|
+
"-q, --quiet",
|
|
19385
|
+
"suppress startup banner and messages"
|
|
19391
19386
|
).action(async (message, options) => {
|
|
19392
19387
|
if (options.directory) {
|
|
19393
19388
|
try {
|
|
@@ -19429,12 +19424,14 @@ program.name("grok").description(
|
|
|
19429
19424
|
process.exit(1);
|
|
19430
19425
|
}
|
|
19431
19426
|
const agent = new GrokAgent(apiKey, baseURL, model, maxToolRounds);
|
|
19432
|
-
|
|
19427
|
+
if (!options.quiet) {
|
|
19428
|
+
console.log("\u{1F916} Starting X CLI Conversational Assistant...\n");
|
|
19429
|
+
}
|
|
19433
19430
|
ensureUserSettingsDirectory();
|
|
19434
19431
|
checkAutoCompact();
|
|
19435
19432
|
checkStartupUpdates();
|
|
19436
19433
|
const initialMessage = Array.isArray(message) ? message.join(" ") : message;
|
|
19437
|
-
const app = render(React4.createElement(ChatInterface, { agent, initialMessage }));
|
|
19434
|
+
const app = render(React4.createElement(ChatInterface, { agent, initialMessage, quiet: options.quiet }));
|
|
19438
19435
|
const cleanup = () => {
|
|
19439
19436
|
app.unmount();
|
|
19440
19437
|
agent.abortCurrentOperation();
|