@xagent/x-cli 1.1.50 → 1.1.51

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 CHANGED
@@ -1,4 +1,4 @@
1
- ## 1.1.50 – Logo Assets & NPM Publication Complete
1
+ ## 1.1.51 – 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
 
package/dist/index.js CHANGED
@@ -58,7 +58,9 @@ var init_settings_manager = __esm({
58
58
  "grok-3-latest",
59
59
  "grok-3-fast",
60
60
  "grok-3-mini-fast"
61
- ]
61
+ ],
62
+ verbosityLevel: "quiet",
63
+ explainLevel: "brief"
62
64
  };
63
65
  DEFAULT_PROJECT_SETTINGS = {
64
66
  model: "grok-code-fast-1"
@@ -9291,7 +9293,7 @@ EOF`;
9291
9293
  var package_default = {
9292
9294
  type: "module",
9293
9295
  name: "@xagent/x-cli",
9294
- version: "1.1.50",
9296
+ version: "1.1.51",
9295
9297
  description: "An open-source AI agent that brings the power of Grok directly into your terminal.",
9296
9298
  main: "dist/index.js",
9297
9299
  module: "dist/index.js",
@@ -14883,7 +14885,22 @@ function useInputHandler({
14883
14885
  });
14884
14886
  const [shiftTabPressCount, setShiftTabPressCount] = useState(0);
14885
14887
  const [lastShiftTabTime, setLastShiftTabTime] = useState(0);
14886
- const [verbosityLevel, setVerbosityLevel] = useState("normal");
14888
+ const [verbosityLevel, setVerbosityLevel] = useState(() => {
14889
+ try {
14890
+ const manager = getSettingsManager();
14891
+ return manager.getUserSetting("verbosityLevel") || "quiet";
14892
+ } catch {
14893
+ return "quiet";
14894
+ }
14895
+ });
14896
+ const [explainLevel, setExplainLevel] = useState(() => {
14897
+ try {
14898
+ const manager = getSettingsManager();
14899
+ return manager.getUserSetting("explainLevel") || "brief";
14900
+ } catch {
14901
+ return "brief";
14902
+ }
14903
+ });
14887
14904
  const planMode = usePlanMode({}, agent);
14888
14905
  const handleSpecialKey = (key) => {
14889
14906
  if (isConfirmationActive) {
@@ -15130,6 +15147,8 @@ Built-in Commands:
15130
15147
  /clear - Clear chat history
15131
15148
  /help - Show this help
15132
15149
  /models - Switch between available models
15150
+ /verbosity - Control output verbosity (quiet/normal/verbose)
15151
+ /explain - Control operation explanations (off/brief/detailed)
15133
15152
  /version - Show version information and check for updates
15134
15153
  /upgrade - Check for updates and upgrade automatically
15135
15154
  /switch - Switch to specific version (/switch <version>)
@@ -16239,22 +16258,27 @@ Auto-compact automatically enables compact mode when conversations exceed thresh
16239
16258
  content: `\u{1F50A} **Current Verbosity Level: ${verbosityLevel.toUpperCase()}**
16240
16259
 
16241
16260
  **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
16261
+ - \`quiet\` - Minimal output, suppress prefixes and extra formatting
16262
+ - \`normal\` - Current default behavior with full details
16263
+ - \`verbose\` - Additional details and debug information
16245
16264
 
16246
16265
  **Usage:** \`/verbosity <level>\`
16247
16266
  **Example:** \`/verbosity quiet\``,
16248
16267
  timestamp: /* @__PURE__ */ new Date()
16249
16268
  };
16250
16269
  setChatHistory((prev) => [...prev, levelEntry]);
16251
- } else if (["normal", "quiet", "minimal"].includes(newLevel)) {
16270
+ } else if (["quiet", "normal", "verbose"].includes(newLevel)) {
16252
16271
  setVerbosityLevel(newLevel);
16272
+ try {
16273
+ const manager = getSettingsManager();
16274
+ manager.updateUserSetting("verbosityLevel", newLevel);
16275
+ } catch (_error) {
16276
+ }
16253
16277
  const confirmEntry = {
16254
16278
  type: "assistant",
16255
16279
  content: `\u2705 **Verbosity level set to: ${newLevel.toUpperCase()}**
16256
16280
 
16257
- Tool outputs will now show ${newLevel === "minimal" ? "only tool names" : newLevel === "quiet" ? "summaries only" : "full details"}.`,
16281
+ Tool outputs will now show ${newLevel === "quiet" ? "minimal output" : newLevel === "normal" ? "full details" : "extra details and debug information"}.`,
16258
16282
  timestamp: /* @__PURE__ */ new Date()
16259
16283
  };
16260
16284
  setChatHistory((prev) => [...prev, confirmEntry]);
@@ -16263,7 +16287,7 @@ Tool outputs will now show ${newLevel === "minimal" ? "only tool names" : newLev
16263
16287
  type: "assistant",
16264
16288
  content: `\u274C **Invalid verbosity level: ${newLevel}**
16265
16289
 
16266
- **Available levels:** normal, quiet, minimal
16290
+ **Available levels:** quiet, normal, verbose
16267
16291
 
16268
16292
  **Usage:** \`/verbosity <level>\``,
16269
16293
  timestamp: /* @__PURE__ */ new Date()
@@ -16273,6 +16297,54 @@ Tool outputs will now show ${newLevel === "minimal" ? "only tool names" : newLev
16273
16297
  clearInput();
16274
16298
  return true;
16275
16299
  }
16300
+ if (trimmedInput === "/explain" || trimmedInput.startsWith("/explain ")) {
16301
+ const args = trimmedInput.split(" ").slice(1);
16302
+ const newLevel = args[0];
16303
+ if (!newLevel) {
16304
+ const levelEntry = {
16305
+ type: "assistant",
16306
+ content: `\u{1F4A1} **Current Explain Level: ${explainLevel.toUpperCase()}**
16307
+
16308
+ **Available levels:**
16309
+ - \`off\` - No explanations
16310
+ - \`brief\` - Short reasons for operations
16311
+ - \`detailed\` - Comprehensive explanations with context
16312
+
16313
+ **Usage:** \`/explain <level>\`
16314
+ **Example:** \`/explain brief\``,
16315
+ timestamp: /* @__PURE__ */ new Date()
16316
+ };
16317
+ setChatHistory((prev) => [...prev, levelEntry]);
16318
+ } else if (["off", "brief", "detailed"].includes(newLevel)) {
16319
+ setExplainLevel(newLevel);
16320
+ try {
16321
+ const manager = getSettingsManager();
16322
+ manager.updateUserSetting("explainLevel", newLevel);
16323
+ } catch (_error) {
16324
+ }
16325
+ const confirmEntry = {
16326
+ type: "assistant",
16327
+ content: `\u2705 **Explain level set to: ${newLevel.toUpperCase()}**
16328
+
16329
+ Operations will now ${newLevel === "off" ? "show no explanations" : newLevel === "brief" ? "show brief reasons" : "show detailed explanations with context"}.`,
16330
+ timestamp: /* @__PURE__ */ new Date()
16331
+ };
16332
+ setChatHistory((prev) => [...prev, confirmEntry]);
16333
+ } else {
16334
+ const errorEntry = {
16335
+ type: "assistant",
16336
+ content: `\u274C **Invalid explain level: ${newLevel}**
16337
+
16338
+ **Available levels:** off, brief, detailed
16339
+
16340
+ **Usage:** \`/explain <level>\``,
16341
+ timestamp: /* @__PURE__ */ new Date()
16342
+ };
16343
+ setChatHistory((prev) => [...prev, errorEntry]);
16344
+ }
16345
+ clearInput();
16346
+ return true;
16347
+ }
16276
16348
  const directBashCommands = [
16277
16349
  "ls",
16278
16350
  "pwd",
@@ -16475,6 +16547,7 @@ Tool outputs will now show ${newLevel === "minimal" ? "only tool names" : newLev
16475
16547
  agent,
16476
16548
  autoEditEnabled,
16477
16549
  verbosityLevel,
16550
+ explainLevel,
16478
16551
  // Plan mode state and actions
16479
16552
  planMode
16480
16553
  };
@@ -16866,7 +16939,35 @@ var handleLongContent = (content, maxLength = 5e3) => {
16866
16939
  };
16867
16940
  };
16868
16941
  var MemoizedChatEntry = React3.memo(
16869
- ({ entry, index, verbosityLevel }) => {
16942
+ ({ entry, index, verbosityLevel, explainLevel }) => {
16943
+ const getExplanation = (toolName, filePath, _isExecuting) => {
16944
+ if (explainLevel === "off") return null;
16945
+ const explanations = {
16946
+ view_file: {
16947
+ brief: `Reading ${filePath} to examine its contents`,
16948
+ detailed: `Reading the file ${filePath} to examine its current contents, structure, and implementation details for analysis or modification.`
16949
+ },
16950
+ str_replace_editor: {
16951
+ brief: `Updating ${filePath} with changes`,
16952
+ detailed: `Applying targeted modifications to ${filePath} using precise string replacement to update specific code sections while preserving the rest of the file structure.`
16953
+ },
16954
+ create_file: {
16955
+ brief: `Creating new file ${filePath}`,
16956
+ detailed: `Creating a new file at ${filePath} with the specified content, establishing the initial structure and implementation for this component or module.`
16957
+ },
16958
+ bash: {
16959
+ brief: `Executing command: ${filePath}`,
16960
+ detailed: `Running the shell command "${filePath}" to perform system operations, file management, or external tool execution as requested.`
16961
+ },
16962
+ search: {
16963
+ brief: `Searching for: ${filePath}`,
16964
+ detailed: `Performing a comprehensive search across the codebase for "${filePath}" to locate relevant files, functions, or code patterns that match the query.`
16965
+ }
16966
+ };
16967
+ const explanation = explanations[toolName];
16968
+ if (!explanation) return null;
16969
+ return explainLevel === "detailed" ? explanation.detailed : explanation.brief;
16970
+ };
16870
16971
  const renderDiff = (diffContent, filename) => {
16871
16972
  return /* @__PURE__ */ jsx(
16872
16973
  DiffRenderer,
@@ -16985,8 +17086,9 @@ var MemoizedChatEntry = React3.memo(
16985
17086
  };
16986
17087
  const shouldShowDiff = entry.toolCall?.function?.name === "str_replace_editor" && entry.toolResult?.success && entry.content.includes("Updated") && entry.content.includes("---") && entry.content.includes("+++");
16987
17088
  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";
17089
+ const shouldShowToolContent = verbosityLevel !== "quiet";
17090
+ const shouldShowFullContent = verbosityLevel === "normal" || verbosityLevel === "verbose";
17091
+ const explanation = getExplanation(toolName, filePath);
16990
17092
  return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginTop: 1, children: [
16991
17093
  /* @__PURE__ */ jsxs(Box, { children: [
16992
17094
  /* @__PURE__ */ jsx(Text, { color: "magenta", children: "\u23FA" }),
@@ -16995,6 +17097,10 @@ var MemoizedChatEntry = React3.memo(
16995
17097
  filePath ? `${actionName}(${filePath})` : actionName
16996
17098
  ] })
16997
17099
  ] }),
17100
+ explanation && /* @__PURE__ */ jsx(Box, { marginLeft: 2, children: /* @__PURE__ */ jsxs(Text, { color: "blue", italic: true, children: [
17101
+ "\u{1F4A1} ",
17102
+ explanation
17103
+ ] }) }),
16998
17104
  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: [
16999
17105
  /* @__PURE__ */ jsx(Text, { color: "gray", children: "\u23BF File contents:" }),
17000
17106
  /* @__PURE__ */ jsx(Box, { marginLeft: 2, flexDirection: "column", children: renderFileContent(entry.content) })
@@ -17004,7 +17110,7 @@ var MemoizedChatEntry = React3.memo(
17004
17110
  "\u23BF ",
17005
17111
  entry.content.split("\n")[0]
17006
17112
  ] })
17007
- ) : verbosityLevel === "quiet" ? /* @__PURE__ */ jsx(Text, { color: "gray", children: "\u23BF Completed" }) : /* @__PURE__ */ jsxs(Text, { color: "gray", children: [
17113
+ ) : !shouldShowFullContent ? /* @__PURE__ */ jsx(Text, { color: "gray", children: "\u23BF Completed" }) : /* @__PURE__ */ jsxs(Text, { color: "gray", children: [
17008
17114
  "\u23BF ",
17009
17115
  formatToolContent(entry.content, toolName)
17010
17116
  ] }) }),
@@ -17019,7 +17125,8 @@ MemoizedChatEntry.displayName = "MemoizedChatEntry";
17019
17125
  function ChatHistory({
17020
17126
  entries,
17021
17127
  isConfirmationActive = false,
17022
- verbosityLevel = "normal"
17128
+ verbosityLevel = "quiet",
17129
+ explainLevel = "brief"
17023
17130
  }) {
17024
17131
  const filteredEntries = isConfirmationActive ? entries.filter(
17025
17132
  (entry) => !(entry.type === "tool_call" && entry.content === "Executing...")
@@ -17030,7 +17137,8 @@ function ChatHistory({
17030
17137
  {
17031
17138
  entry,
17032
17139
  index,
17033
- verbosityLevel
17140
+ verbosityLevel,
17141
+ explainLevel
17034
17142
  },
17035
17143
  `${entry.timestamp.getTime()}-${index}`
17036
17144
  )) });
@@ -18166,6 +18274,7 @@ function ChatInterfaceWithAgent({
18166
18274
  availableModels,
18167
18275
  autoEditEnabled,
18168
18276
  verbosityLevel,
18277
+ explainLevel,
18169
18278
  planMode
18170
18279
  } = useInputHandler({
18171
18280
  agent,
@@ -18468,7 +18577,8 @@ function ChatInterfaceWithAgent({
18468
18577
  {
18469
18578
  entries: chatHistory,
18470
18579
  isConfirmationActive: !!confirmationOptions,
18471
- verbosityLevel
18580
+ verbosityLevel,
18581
+ explainLevel
18472
18582
  }
18473
18583
  ) }),
18474
18584
  /* @__PURE__ */ jsx(