@xagent/x-cli 1.1.49 → 1.1.50
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 +15 -1
- package/dist/index.js +83 -16
- 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.50 – 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
|
|
|
@@ -155,6 +155,20 @@ A conversational AI CLI tool powered by Grok with **Claude Code-level intelligen
|
|
|
155
155
|
|
|
156
156
|
### 🚀 Quick Start
|
|
157
157
|
|
|
158
|
+
#### 💎 **Try it now (no installation required!)**
|
|
159
|
+
|
|
160
|
+
<div align="center">
|
|
161
|
+
|
|
162
|
+
┌────────────────────────────────────┐
|
|
163
|
+
│ 🚀 One-Command Start │
|
|
164
|
+
├────────────────────────────────────┤
|
|
165
|
+
│ npx -y @xagent/x-cli@latest │
|
|
166
|
+
├────────────────────────────────────┤
|
|
167
|
+
│ Always latest version • Zero setup │
|
|
168
|
+
└────────────────────────────────────┘
|
|
169
|
+
|
|
170
|
+
</div>
|
|
171
|
+
|
|
158
172
|
**Option 1: Run without installing (Recommended)**
|
|
159
173
|
|
|
160
174
|
```bash
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import * as path7 from 'path';
|
|
|
5
5
|
import path7__default from 'path';
|
|
6
6
|
import * as os from 'os';
|
|
7
7
|
import os__default from 'os';
|
|
8
|
-
import
|
|
8
|
+
import React3, { useState, useRef, useEffect, useMemo, useCallback } from 'react';
|
|
9
9
|
import { Box, Text, render, useApp, useInput } from 'ink';
|
|
10
10
|
import { program, Command } from 'commander';
|
|
11
11
|
import * as dotenv from 'dotenv';
|
|
@@ -9291,7 +9291,7 @@ EOF`;
|
|
|
9291
9291
|
var package_default = {
|
|
9292
9292
|
type: "module",
|
|
9293
9293
|
name: "@xagent/x-cli",
|
|
9294
|
-
version: "1.1.
|
|
9294
|
+
version: "1.1.50",
|
|
9295
9295
|
description: "An open-source AI agent that brings the power of Grok directly into your terminal.",
|
|
9296
9296
|
main: "dist/index.js",
|
|
9297
9297
|
module: "dist/index.js",
|
|
@@ -14883,6 +14883,7 @@ function useInputHandler({
|
|
|
14883
14883
|
});
|
|
14884
14884
|
const [shiftTabPressCount, setShiftTabPressCount] = useState(0);
|
|
14885
14885
|
const [lastShiftTabTime, setLastShiftTabTime] = useState(0);
|
|
14886
|
+
const [verbosityLevel, setVerbosityLevel] = useState("normal");
|
|
14886
14887
|
const planMode = usePlanMode({}, agent);
|
|
14887
14888
|
const handleSpecialKey = (key) => {
|
|
14888
14889
|
if (isConfirmationActive) {
|
|
@@ -16229,6 +16230,49 @@ Auto-compact automatically enables compact mode when conversations exceed thresh
|
|
|
16229
16230
|
clearInput();
|
|
16230
16231
|
return true;
|
|
16231
16232
|
}
|
|
16233
|
+
if (trimmedInput === "/verbosity" || trimmedInput.startsWith("/verbosity ")) {
|
|
16234
|
+
const args = trimmedInput.split(" ").slice(1);
|
|
16235
|
+
const newLevel = args[0];
|
|
16236
|
+
if (!newLevel) {
|
|
16237
|
+
const levelEntry = {
|
|
16238
|
+
type: "assistant",
|
|
16239
|
+
content: `\u{1F50A} **Current Verbosity Level: ${verbosityLevel.toUpperCase()}**
|
|
16240
|
+
|
|
16241
|
+
**Available levels:**
|
|
16242
|
+
- \`normal\` - Full tool output and details
|
|
16243
|
+
- \`quiet\` - Reduced tool output, show summaries only
|
|
16244
|
+
- \`minimal\` - Show only tool names, hide detailed content
|
|
16245
|
+
|
|
16246
|
+
**Usage:** \`/verbosity <level>\`
|
|
16247
|
+
**Example:** \`/verbosity quiet\``,
|
|
16248
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
16249
|
+
};
|
|
16250
|
+
setChatHistory((prev) => [...prev, levelEntry]);
|
|
16251
|
+
} else if (["normal", "quiet", "minimal"].includes(newLevel)) {
|
|
16252
|
+
setVerbosityLevel(newLevel);
|
|
16253
|
+
const confirmEntry = {
|
|
16254
|
+
type: "assistant",
|
|
16255
|
+
content: `\u2705 **Verbosity level set to: ${newLevel.toUpperCase()}**
|
|
16256
|
+
|
|
16257
|
+
Tool outputs will now show ${newLevel === "minimal" ? "only tool names" : newLevel === "quiet" ? "summaries only" : "full details"}.`,
|
|
16258
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
16259
|
+
};
|
|
16260
|
+
setChatHistory((prev) => [...prev, confirmEntry]);
|
|
16261
|
+
} else {
|
|
16262
|
+
const errorEntry = {
|
|
16263
|
+
type: "assistant",
|
|
16264
|
+
content: `\u274C **Invalid verbosity level: ${newLevel}**
|
|
16265
|
+
|
|
16266
|
+
**Available levels:** normal, quiet, minimal
|
|
16267
|
+
|
|
16268
|
+
**Usage:** \`/verbosity <level>\``,
|
|
16269
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
16270
|
+
};
|
|
16271
|
+
setChatHistory((prev) => [...prev, errorEntry]);
|
|
16272
|
+
}
|
|
16273
|
+
clearInput();
|
|
16274
|
+
return true;
|
|
16275
|
+
}
|
|
16232
16276
|
const directBashCommands = [
|
|
16233
16277
|
"ls",
|
|
16234
16278
|
"pwd",
|
|
@@ -16430,6 +16474,7 @@ Auto-compact automatically enables compact mode when conversations exceed thresh
|
|
|
16430
16474
|
availableModels,
|
|
16431
16475
|
agent,
|
|
16432
16476
|
autoEditEnabled,
|
|
16477
|
+
verbosityLevel,
|
|
16433
16478
|
// Plan mode state and actions
|
|
16434
16479
|
planMode
|
|
16435
16480
|
};
|
|
@@ -16520,11 +16565,27 @@ function LoadingSpinner({
|
|
|
16520
16565
|
message,
|
|
16521
16566
|
progress
|
|
16522
16567
|
}) {
|
|
16523
|
-
|
|
16568
|
+
const [frameIndex, setFrameIndex] = useState(0);
|
|
16569
|
+
const [messageIndex, setMessageIndex] = useState(0);
|
|
16524
16570
|
const config2 = operationConfig[operation];
|
|
16525
|
-
const spinnerChar = config2.spinner[
|
|
16526
|
-
const operationMessage = message || config2.messages[
|
|
16571
|
+
const spinnerChar = config2.spinner[frameIndex % config2.spinner.length];
|
|
16572
|
+
const operationMessage = message || config2.messages[messageIndex % config2.messages.length];
|
|
16527
16573
|
const color = getSpinnerColor(operation);
|
|
16574
|
+
useEffect(() => {
|
|
16575
|
+
if (!isActive) return;
|
|
16576
|
+
const interval = setInterval(() => {
|
|
16577
|
+
setFrameIndex((prev) => prev + 1);
|
|
16578
|
+
}, 80);
|
|
16579
|
+
return () => clearInterval(interval);
|
|
16580
|
+
}, [isActive]);
|
|
16581
|
+
useEffect(() => {
|
|
16582
|
+
if (!isActive) return;
|
|
16583
|
+
const messageInterval = setInterval(() => {
|
|
16584
|
+
setMessageIndex((prev) => prev + 1);
|
|
16585
|
+
}, 80 * config2.spinner.length * 3);
|
|
16586
|
+
return () => clearInterval(messageInterval);
|
|
16587
|
+
}, [isActive, config2.spinner.length]);
|
|
16588
|
+
if (!isActive) return null;
|
|
16528
16589
|
const renderProgressBar = () => {
|
|
16529
16590
|
if (progress === void 0) return null;
|
|
16530
16591
|
const barLength = 20;
|
|
@@ -16804,8 +16865,8 @@ var handleLongContent = (content, maxLength = 5e3) => {
|
|
|
16804
16865
|
isTruncated: true
|
|
16805
16866
|
};
|
|
16806
16867
|
};
|
|
16807
|
-
var MemoizedChatEntry =
|
|
16808
|
-
({ entry, index }) => {
|
|
16868
|
+
var MemoizedChatEntry = React3.memo(
|
|
16869
|
+
({ entry, index, verbosityLevel }) => {
|
|
16809
16870
|
const renderDiff = (diffContent, filename) => {
|
|
16810
16871
|
return /* @__PURE__ */ jsx(
|
|
16811
16872
|
DiffRenderer,
|
|
@@ -16924,6 +16985,8 @@ var MemoizedChatEntry = React2.memo(
|
|
|
16924
16985
|
};
|
|
16925
16986
|
const shouldShowDiff = entry.toolCall?.function?.name === "str_replace_editor" && entry.toolResult?.success && entry.content.includes("Updated") && entry.content.includes("---") && entry.content.includes("+++");
|
|
16926
16987
|
const shouldShowFileContent = (entry.toolCall?.function?.name === "view_file" || entry.toolCall?.function?.name === "create_file") && entry.toolResult?.success && !shouldShowDiff;
|
|
16988
|
+
const shouldShowToolContent = verbosityLevel !== "minimal";
|
|
16989
|
+
const shouldShowFullContent = verbosityLevel === "normal";
|
|
16927
16990
|
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginTop: 1, children: [
|
|
16928
16991
|
/* @__PURE__ */ jsxs(Box, { children: [
|
|
16929
16992
|
/* @__PURE__ */ jsx(Text, { color: "magenta", children: "\u23FA" }),
|
|
@@ -16932,20 +16995,20 @@ var MemoizedChatEntry = React2.memo(
|
|
|
16932
16995
|
filePath ? `${actionName}(${filePath})` : actionName
|
|
16933
16996
|
] })
|
|
16934
16997
|
] }),
|
|
16935
|
-
/* @__PURE__ */ jsx(Box, { marginLeft: 2, flexDirection: "column", children: isExecuting ? /* @__PURE__ */ jsx(Text, { color: "cyan", children: "\u23BF Executing..." }) : shouldShowFileContent ? /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
|
|
16998
|
+
shouldShowToolContent && /* @__PURE__ */ jsx(Box, { marginLeft: 2, flexDirection: "column", children: isExecuting ? /* @__PURE__ */ jsx(Text, { color: "cyan", children: "\u23BF Executing..." }) : shouldShowFileContent && shouldShowFullContent ? /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
|
|
16936
16999
|
/* @__PURE__ */ jsx(Text, { color: "gray", children: "\u23BF File contents:" }),
|
|
16937
17000
|
/* @__PURE__ */ jsx(Box, { marginLeft: 2, flexDirection: "column", children: renderFileContent(entry.content) })
|
|
16938
|
-
] }) : shouldShowDiff ? (
|
|
17001
|
+
] }) : shouldShowDiff && shouldShowFullContent ? (
|
|
16939
17002
|
// For diff results, show only the summary line, not the raw content
|
|
16940
17003
|
/* @__PURE__ */ jsxs(Text, { color: "gray", children: [
|
|
16941
17004
|
"\u23BF ",
|
|
16942
17005
|
entry.content.split("\n")[0]
|
|
16943
17006
|
] })
|
|
16944
|
-
) : /* @__PURE__ */ jsxs(Text, { color: "gray", children: [
|
|
17007
|
+
) : verbosityLevel === "quiet" ? /* @__PURE__ */ jsx(Text, { color: "gray", children: "\u23BF Completed" }) : /* @__PURE__ */ jsxs(Text, { color: "gray", children: [
|
|
16945
17008
|
"\u23BF ",
|
|
16946
17009
|
formatToolContent(entry.content, toolName)
|
|
16947
17010
|
] }) }),
|
|
16948
|
-
shouldShowDiff && !isExecuting && /* @__PURE__ */ jsx(Box, { marginLeft: 4, flexDirection: "column", children: renderDiff(entry.content, filePath) })
|
|
17011
|
+
shouldShowDiff && !isExecuting && shouldShowFullContent && /* @__PURE__ */ jsx(Box, { marginLeft: 4, flexDirection: "column", children: renderDiff(entry.content, filePath) })
|
|
16949
17012
|
] }, index);
|
|
16950
17013
|
default:
|
|
16951
17014
|
return null;
|
|
@@ -16955,7 +17018,8 @@ var MemoizedChatEntry = React2.memo(
|
|
|
16955
17018
|
MemoizedChatEntry.displayName = "MemoizedChatEntry";
|
|
16956
17019
|
function ChatHistory({
|
|
16957
17020
|
entries,
|
|
16958
|
-
isConfirmationActive = false
|
|
17021
|
+
isConfirmationActive = false,
|
|
17022
|
+
verbosityLevel = "normal"
|
|
16959
17023
|
}) {
|
|
16960
17024
|
const filteredEntries = isConfirmationActive ? entries.filter(
|
|
16961
17025
|
(entry) => !(entry.type === "tool_call" && entry.content === "Executing...")
|
|
@@ -16965,7 +17029,8 @@ function ChatHistory({
|
|
|
16965
17029
|
MemoizedChatEntry,
|
|
16966
17030
|
{
|
|
16967
17031
|
entry,
|
|
16968
|
-
index
|
|
17032
|
+
index,
|
|
17033
|
+
verbosityLevel
|
|
16969
17034
|
},
|
|
16970
17035
|
`${entry.timestamp.getTime()}-${index}`
|
|
16971
17036
|
)) });
|
|
@@ -18100,6 +18165,7 @@ function ChatInterfaceWithAgent({
|
|
|
18100
18165
|
commandSuggestions,
|
|
18101
18166
|
availableModels,
|
|
18102
18167
|
autoEditEnabled,
|
|
18168
|
+
verbosityLevel,
|
|
18103
18169
|
planMode
|
|
18104
18170
|
} = useInputHandler({
|
|
18105
18171
|
agent,
|
|
@@ -18401,7 +18467,8 @@ function ChatInterfaceWithAgent({
|
|
|
18401
18467
|
ChatHistory,
|
|
18402
18468
|
{
|
|
18403
18469
|
entries: chatHistory,
|
|
18404
|
-
isConfirmationActive: !!confirmationOptions
|
|
18470
|
+
isConfirmationActive: !!confirmationOptions,
|
|
18471
|
+
verbosityLevel
|
|
18405
18472
|
}
|
|
18406
18473
|
) }),
|
|
18407
18474
|
/* @__PURE__ */ jsx(
|
|
@@ -18433,7 +18500,6 @@ function ChatInterfaceWithAgent({
|
|
|
18433
18500
|
progress: void 0
|
|
18434
18501
|
}
|
|
18435
18502
|
),
|
|
18436
|
-
/* @__PURE__ */ jsx(VersionNotification, { isVisible: !isProcessing && !isStreaming }),
|
|
18437
18503
|
planMode.isActive && /* @__PURE__ */ jsx(Box, { marginBottom: 1, children: /* @__PURE__ */ jsx(
|
|
18438
18504
|
PlanModeIndicator,
|
|
18439
18505
|
{
|
|
@@ -18453,6 +18519,7 @@ function ChatInterfaceWithAgent({
|
|
|
18453
18519
|
isStreaming
|
|
18454
18520
|
}
|
|
18455
18521
|
),
|
|
18522
|
+
/* @__PURE__ */ jsx(VersionNotification, { isVisible: !isProcessing && !isStreaming }),
|
|
18456
18523
|
/* @__PURE__ */ jsxs(Box, { flexDirection: "row", marginTop: 1, children: [
|
|
18457
18524
|
/* @__PURE__ */ jsxs(Box, { marginRight: 2, children: [
|
|
18458
18525
|
/* @__PURE__ */ jsxs(Text, { color: "cyan", children: [
|
|
@@ -19020,7 +19087,7 @@ program.name("grok").description(
|
|
|
19020
19087
|
checkAutoCompact();
|
|
19021
19088
|
checkStartupUpdates();
|
|
19022
19089
|
const initialMessage = Array.isArray(message) ? message.join(" ") : message;
|
|
19023
|
-
const app = render(
|
|
19090
|
+
const app = render(React3.createElement(ChatInterface, { agent, initialMessage }));
|
|
19024
19091
|
const cleanup = () => {
|
|
19025
19092
|
app.unmount();
|
|
19026
19093
|
agent.abortCurrentOperation();
|