@xagent/x-cli 1.1.88 → 1.1.90

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,6 +1,6 @@
1
1
  <!-- Test comment for PR creation -->
2
2
 
3
- ## 1.1.88 – Logo Assets & NPM Publication Complete
3
+ ## 1.1.90 – Logo Assets & NPM Publication Complete
4
4
 
5
5
  ✅ **Live on NPM**: [@xagent/one-shot](https://www.npmjs.com/package/@xagent/one-shot) - Fully published and ready for global installation
6
6
 
@@ -35,6 +35,31 @@ A conversational AI CLI tool powered by x.ai with **Claude Code-level intelligen
35
35
  - **💬 [xAI Community Discord](https://discord.com/channels/1315720379607679066/1315822328139223064)** - Official xAI API community support
36
36
  - **📚 [Releases](https://github.com/x-cli-team/x-cli/releases)** - Version history and changelogs
37
37
 
38
+ ## Featured In
39
+
40
+ <!-- AUTO-GENERATED: DO NOT EDIT -->
41
+
42
+ - **[superagent-ai/grok-cli](https://github.com/superagent-ai/grok-cli)** – Submitted via [Issue #XX](https://github.com/superagent-ai/grok-cli/issues/XX)
43
+ ![submitted](https://img.shields.io/badge/status-submitted-blue?style=flat&logo=github)
44
+
45
+ - **[RMNCLDYO/grok-ai-toolkit](https://github.com/RMNCLDYO/grok-ai-toolkit)** – Submitted via [Issue #XX](https://github.com/RMNCLDYO/grok-ai-toolkit/issues/XX)
46
+ ![submitted](https://img.shields.io/badge/status-submitted-blue?style=flat&logo=github)
47
+
48
+ - **[coldcanuk/grok-cli](https://github.com/coldcanuk/grok-cli)** – Submitted via [Issue #XX](https://github.com/coldcanuk/grok-cli/issues/XX)
49
+ ![submitted](https://img.shields.io/badge/status-submitted-blue?style=flat&logo=github)
50
+
51
+ - **[HyperCoherence/Grok4Git](https://github.com/HyperCoherence/Grok4Git)** – Submitted via [Issue #XX](https://github.com/HyperCoherence/Grok4Git/issues/XX)
52
+ ![submitted](https://img.shields.io/badge/status-submitted-blue?style=flat&logo=github)
53
+
54
+ - **[MustCodeAl/awesome-ai-cli](https://github.com/MustCodeAl/awesome-ai-cli)** – Submitted via [Issue #XX](https://github.com/MustCodeAl/awesome-ai-cli/issues/XX)
55
+ ![submitted](https://img.shields.io/badge/status-submitted-blue?style=flat&logo=github)
56
+
57
+ - **[xai-org/xai-cookbook](https://github.com/xai-org/xai-cookbook)** – Submitted via [Issue #XX](https://github.com/xai-org/xai-cookbook/issues/XX)
58
+ ![submitted](https://img.shields.io/badge/status-submitted-blue?style=flat&logo=github)
59
+
60
+ - **[milisp/awesome-grok](https://github.com/milisp/awesome-grok)** – **Merged!**
61
+ ![featured](https://img.shields.io/badge/featured%20in-grok--one--shot-00d26a?style=flat&logo=github)
62
+
38
63
  ## 🆕 What's New in v1.0+
39
64
 
40
65
  ### 🎯 **P0: Plan Mode - Claude Code Parity** (Latest)
@@ -1146,7 +1171,3 @@ _Want to see your name here? Check out our [Contributing Guide](CONTRIBUTING.md)
1146
1171
  - 💡 **Feature requests** - Suggest new functionality
1147
1172
 
1148
1173
  Join our growing community of AI-powered terminal enthusiasts!
1149
-
1150
- # Test: Branch Protection Rules Test
1151
-
1152
- # test
package/dist/index.js CHANGED
@@ -10990,7 +10990,8 @@ var init_paste_detection = __esm({
10990
10990
  */
10991
10991
  countLines(content) {
10992
10992
  if (!content) return 0;
10993
- return content.split("\n").length;
10993
+ const lines = content.split(/\r\n|\r|\n/);
10994
+ return lines[lines.length - 1] === "" ? lines.length - 1 : lines.length;
10994
10995
  }
10995
10996
  /**
10996
10997
  * Gets default line threshold from environment or config
@@ -11204,18 +11205,10 @@ function useEnhancedInput({
11204
11205
  return;
11205
11206
  }
11206
11207
  if (inputChar && !key.ctrl && !key.meta) {
11207
- const previousInput = input;
11208
11208
  const result = insertText(input, cursorPosition, inputChar);
11209
11209
  setInputState(result.text);
11210
11210
  setCursorPositionState(result.position);
11211
11211
  setOriginalInput(result.text);
11212
- if (onPasteDetected && inputChar.length > 1) {
11213
- const pasteService = getPasteDetectionService();
11214
- const pasteEvent = pasteService.detectPaste(previousInput, result.text);
11215
- if (pasteEvent) {
11216
- onPasteDetected(pasteEvent);
11217
- }
11218
- }
11219
11212
  }
11220
11213
  }, [disabled, onSpecialKey, input, cursorPosition, multiline, handleSubmit, navigateHistory, setOriginalInput]);
11221
11214
  return {
@@ -16197,7 +16190,7 @@ var init_package = __esm({
16197
16190
  package_default = {
16198
16191
  type: "module",
16199
16192
  name: "@xagent/one-shot",
16200
- version: "1.1.88",
16193
+ version: "1.1.90",
16201
16194
  description: "An open-source AI agent that brings advanced AI capabilities directly into your terminal.",
16202
16195
  main: "dist/index.js",
16203
16196
  module: "dist/index.js",
@@ -16617,7 +16610,7 @@ function useInputHandler({
16617
16610
  const userEntry = {
16618
16611
  type: "user",
16619
16612
  content: pasteEvent.content,
16620
- // Full content for AI
16613
+ // Full content for AI (when submitted)
16621
16614
  displayContent: pasteEvent.summary,
16622
16615
  // Summary for UI display
16623
16616
  timestamp: /* @__PURE__ */ new Date(),
@@ -16629,7 +16622,6 @@ function useInputHandler({
16629
16622
  }
16630
16623
  };
16631
16624
  setChatHistory((prev) => [...prev, userEntry]);
16632
- processUserMessage(pasteEvent.content);
16633
16625
  };
16634
16626
  const handleInputChange = (newInput) => {
16635
16627
  if (newInput.startsWith("/")) {
@@ -16652,7 +16644,9 @@ function useInputHandler({
16652
16644
  onSubmit: handleInputSubmit,
16653
16645
  onSpecialKey: handleSpecialKey,
16654
16646
  onPasteDetected: handlePasteDetected,
16655
- disabled: isConfirmationActive
16647
+ disabled: isConfirmationActive,
16648
+ multiline: true
16649
+ // Enable multiline mode to handle pasted content properly
16656
16650
  });
16657
16651
  useInput((inputChar, key) => {
16658
16652
  if (onGlobalShortcut && onGlobalShortcut(inputChar, key)) {
@@ -18552,12 +18546,23 @@ ${error instanceof Error ? error.message : String(error)}`,
18552
18546
  return false;
18553
18547
  };
18554
18548
  const processUserMessage = async (userInput) => {
18555
- const userEntry = {
18556
- type: "user",
18557
- content: userInput,
18558
- timestamp: /* @__PURE__ */ new Date()
18559
- };
18560
- setChatHistory((prev) => [...prev, userEntry]);
18549
+ const pasteService = getPasteDetectionService();
18550
+ const shouldSummarize = pasteService.shouldSummarize(userInput);
18551
+ const recentEntry = chatHistory[chatHistory.length - 1];
18552
+ const isAlreadyShowingPasteSummary = recentEntry && recentEntry.isPasteSummary && recentEntry.content === userInput;
18553
+ if (!isAlreadyShowingPasteSummary) {
18554
+ const userEntry = {
18555
+ type: "user",
18556
+ content: userInput,
18557
+ displayContent: shouldSummarize ? pasteService.createPasteSummary(userInput, pasteService.getCurrentCounter() + 1) : userInput,
18558
+ timestamp: /* @__PURE__ */ new Date(),
18559
+ isPasteSummary: shouldSummarize
18560
+ };
18561
+ if (shouldSummarize) {
18562
+ pasteService.detectPaste("", userInput);
18563
+ }
18564
+ setChatHistory((prev) => [...prev, userEntry]);
18565
+ }
18561
18566
  setIsProcessing(true);
18562
18567
  clearInput();
18563
18568
  try {
@@ -18710,6 +18715,7 @@ var init_use_input_handler = __esm({
18710
18715
  "src/hooks/use-input-handler.ts"() {
18711
18716
  init_confirmation_service();
18712
18717
  init_use_enhanced_input();
18718
+ init_paste_detection();
18713
18719
  init_use_plan_mode();
18714
18720
  init_command_suggestions();
18715
18721
  init_model_config();
@@ -20649,8 +20655,13 @@ function ChatInput({
20649
20655
  isStreaming
20650
20656
  }) {
20651
20657
  const beforeCursor = input.slice(0, cursorPosition);
20652
- const lines = input.split("\n");
20658
+ const lines = input.split(/\r\n|\r|\n/);
20653
20659
  const isMultiline = lines.length > 1;
20660
+ const MAX_DISPLAY_LINES = 10;
20661
+ const shouldTruncateDisplay = lines.length > MAX_DISPLAY_LINES;
20662
+ if (shouldTruncateDisplay) {
20663
+ console.log(`\u{1F4C4} Large paste detected: ${lines.length} lines, showing truncated view`);
20664
+ }
20654
20665
  let currentLineIndex = 0;
20655
20666
  let currentCharIndex = 0;
20656
20667
  let totalChars = 0;
@@ -20673,31 +20684,33 @@ function ChatInput({
20673
20684
  {
20674
20685
  borderStyle: "round",
20675
20686
  borderColor,
20687
+ paddingX: 1,
20676
20688
  paddingY: 0,
20677
20689
  marginTop: 1,
20678
- children: lines.map((line, index) => {
20679
- const isCurrentLine = index === currentLineIndex;
20680
- const promptChar = index === 0 ? "\u276F " : " ";
20681
- if (isCurrentLine) {
20682
- const beforeCursorInLine = line.slice(0, currentCharIndex);
20683
- const cursorChar2 = line.slice(currentCharIndex, currentCharIndex + 1) || " ";
20684
- const afterCursorInLine = line.slice(currentCharIndex + 1);
20685
- return /* @__PURE__ */ jsxs(Box, { children: [
20686
- /* @__PURE__ */ jsx(Text, { color: promptColor, children: promptChar }),
20687
- /* @__PURE__ */ jsxs(Text, { children: [
20688
- beforeCursorInLine,
20689
- showCursor && /* @__PURE__ */ jsx(Text, { backgroundColor: "white", color: "black", children: cursorChar2 }),
20690
- !showCursor && cursorChar2 !== " " && cursorChar2,
20691
- afterCursorInLine
20692
- ] })
20693
- ] }, index);
20694
- } else {
20695
- return /* @__PURE__ */ jsxs(Box, { children: [
20696
- /* @__PURE__ */ jsx(Text, { color: promptColor, children: promptChar }),
20697
- /* @__PURE__ */ jsx(Text, { children: line })
20698
- ] }, index);
20699
- }
20700
- })
20690
+ flexDirection: "column",
20691
+ children: /* @__PURE__ */ jsx(Text, { children: shouldTruncateDisplay ? (
20692
+ // Show truncated view for very large pastes
20693
+ `\u276F [Large paste: ${lines.length} lines, ${input.length} chars]
20694
+ First few lines:
20695
+ ${lines.slice(0, 3).map((line) => ` ${line}`).join("\n")}
20696
+ ...
20697
+ Last few lines:
20698
+ ${lines.slice(-2).map((line) => ` ${line}`).join("\n")}
20699
+
20700
+ Press Enter to submit or edit to modify.`
20701
+ ) : (
20702
+ // Normal multiline display for reasonable sizes
20703
+ lines.map((line, index) => {
20704
+ const isCurrentLine = index === currentLineIndex;
20705
+ const promptChar = index === 0 ? "\u276F " : " ";
20706
+ let lineText = promptChar + line;
20707
+ if (isCurrentLine && showCursor) {
20708
+ const cursorPos = promptChar.length + currentCharIndex;
20709
+ lineText = lineText.slice(0, cursorPos) + "\u2588" + lineText.slice(cursorPos + 1);
20710
+ }
20711
+ return index === lines.length - 1 ? lineText : lineText + "\n";
20712
+ }).join("")
20713
+ ) })
20701
20714
  }
20702
20715
  );
20703
20716
  }
@@ -21779,7 +21792,7 @@ var require_package = __commonJS({
21779
21792
  module.exports = {
21780
21793
  type: "module",
21781
21794
  name: "@xagent/one-shot",
21782
- version: "1.1.88",
21795
+ version: "1.1.90",
21783
21796
  description: "An open-source AI agent that brings advanced AI capabilities directly into your terminal.",
21784
21797
  main: "dist/index.js",
21785
21798
  module: "dist/index.js",