@xagent/one-shot 1.1.89 → 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 +1 -5
- package/dist/index.js +57 -44
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!-- Test comment for PR creation -->
|
|
2
2
|
|
|
3
|
-
## 1.1.
|
|
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
|
|
|
@@ -1171,7 +1171,3 @@ _Want to see your name here? Check out our [Contributing Guide](CONTRIBUTING.md)
|
|
|
1171
1171
|
- 💡 **Feature requests** - Suggest new functionality
|
|
1172
1172
|
|
|
1173
1173
|
Join our growing community of AI-powered terminal enthusiasts!
|
|
1174
|
-
|
|
1175
|
-
# Test: Branch Protection Rules Test
|
|
1176
|
-
|
|
1177
|
-
# 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
|
-
|
|
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.
|
|
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
|
|
18556
|
-
|
|
18557
|
-
|
|
18558
|
-
|
|
18559
|
-
|
|
18560
|
-
|
|
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(
|
|
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
|
-
|
|
20679
|
-
|
|
20680
|
-
|
|
20681
|
-
|
|
20682
|
-
|
|
20683
|
-
|
|
20684
|
-
|
|
20685
|
-
|
|
20686
|
-
|
|
20687
|
-
|
|
20688
|
-
|
|
20689
|
-
|
|
20690
|
-
|
|
20691
|
-
|
|
20692
|
-
|
|
20693
|
-
|
|
20694
|
-
|
|
20695
|
-
|
|
20696
|
-
|
|
20697
|
-
|
|
20698
|
-
|
|
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.
|
|
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",
|