centaurus-cli 2.9.8 → 2.9.9
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/dist/cli-adapter.d.ts.map +1 -1
- package/dist/cli-adapter.js +11 -2
- package/dist/cli-adapter.js.map +1 -1
- package/dist/services/clipboard-service.d.ts +9 -14
- package/dist/services/clipboard-service.d.ts.map +1 -1
- package/dist/services/clipboard-service.js +83 -83
- package/dist/services/clipboard-service.js.map +1 -1
- package/dist/tools/read-binary-file.js +6 -6
- package/dist/tools/read-binary-file.js.map +1 -1
- package/dist/ui/components/App.d.ts.map +1 -1
- package/dist/ui/components/App.js +51 -48
- package/dist/ui/components/App.js.map +1 -1
- package/dist/ui/components/ClipboardFileAutocomplete.d.ts +10 -0
- package/dist/ui/components/ClipboardFileAutocomplete.d.ts.map +1 -0
- package/dist/ui/components/{ClipboardImageAutocomplete.js → ClipboardFileAutocomplete.js} +14 -12
- package/dist/ui/components/ClipboardFileAutocomplete.js.map +1 -0
- package/dist/ui/components/DetailedPlanReviewScreen.js +1 -1
- package/dist/ui/components/DetailedPlanReviewScreen.js.map +1 -1
- package/dist/ui/components/InputBox.d.ts +2 -2
- package/dist/ui/components/InputBox.d.ts.map +1 -1
- package/dist/ui/components/InputBox.js +41 -21
- package/dist/ui/components/InputBox.js.map +1 -1
- package/dist/ui/components/KeyboardHelp.d.ts.map +1 -1
- package/dist/ui/components/KeyboardHelp.js +2 -0
- package/dist/ui/components/KeyboardHelp.js.map +1 -1
- package/dist/ui/components/MessageDisplay.d.ts +4 -4
- package/dist/ui/components/MessageDisplay.d.ts.map +1 -1
- package/dist/ui/components/MessageDisplay.js +33 -31
- package/dist/ui/components/MessageDisplay.js.map +1 -1
- package/dist/ui/components/PlanAcceptedMessage.js +2 -2
- package/dist/ui/components/PlanAcceptedMessage.js.map +1 -1
- package/dist/ui/components/TaskCompletedMessage.js +2 -2
- package/dist/ui/components/TaskCompletedMessage.js.map +1 -1
- package/dist/ui/components/ToolExecutionMessage.js +6 -6
- package/dist/ui/components/ToolExecutionMessage.js.map +1 -1
- package/dist/ui/components/ToolResult.js +1 -1
- package/dist/ui/components/ToolResult.js.map +1 -1
- package/dist/utils/context-sanitizer.d.ts +50 -0
- package/dist/utils/context-sanitizer.d.ts.map +1 -0
- package/dist/utils/context-sanitizer.js +119 -0
- package/dist/utils/context-sanitizer.js.map +1 -0
- package/package.json +1 -1
- package/dist/ui/components/ClipboardImageAutocomplete.d.ts +0 -14
- package/dist/ui/components/ClipboardImageAutocomplete.d.ts.map +0 -1
- package/dist/ui/components/ClipboardImageAutocomplete.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Box, Text } from 'ink';
|
|
3
3
|
import { formatFileSize } from '../../services/clipboard-service.js';
|
|
4
|
-
export const
|
|
4
|
+
export const ClipboardFileAutocomplete = ({ files, selectedIndex, isLoading = false }) => {
|
|
5
5
|
// Show loading state
|
|
6
6
|
if (isLoading) {
|
|
7
7
|
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#ff9900", paddingX: 1, marginLeft: 1, marginTop: 0 },
|
|
@@ -11,29 +11,31 @@ export const ClipboardImageAutocomplete = ({ images, selectedIndex, isLoading =
|
|
|
11
11
|
React.createElement(Text, { color: "#ff9900" }, "\u23F3 Loading..."))));
|
|
12
12
|
}
|
|
13
13
|
// Show empty state
|
|
14
|
-
if (
|
|
14
|
+
if (files.length === 0) {
|
|
15
15
|
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#ff9900", paddingX: 1, marginLeft: 1, marginTop: 0 },
|
|
16
16
|
React.createElement(Box, { marginBottom: 0 },
|
|
17
|
-
React.createElement(Text, { color: "#666666", dimColor: true }, "Clipboard
|
|
17
|
+
React.createElement(Text, { color: "#666666", dimColor: true }, "Clipboard Files")),
|
|
18
18
|
React.createElement(Box, { paddingX: 1 },
|
|
19
|
-
React.createElement(Text, { color: "#888888" }, "No
|
|
19
|
+
React.createElement(Text, { color: "#888888" }, "No files in clipboard")),
|
|
20
20
|
React.createElement(Box, { marginTop: 0 },
|
|
21
|
-
React.createElement(Text, { color: "#666666", dimColor: true }, "Copy
|
|
21
|
+
React.createElement(Text, { color: "#666666", dimColor: true }, "Copy a file or image first"))));
|
|
22
22
|
}
|
|
23
23
|
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "#ff9900", paddingX: 1, marginLeft: 1, marginTop: 0 },
|
|
24
24
|
React.createElement(Box, { marginBottom: 0 },
|
|
25
|
-
React.createElement(Text, { color: "#666666", dimColor: true }, "Clipboard
|
|
26
|
-
|
|
25
|
+
React.createElement(Text, { color: "#666666", dimColor: true }, "Clipboard Files (# to attach)")),
|
|
26
|
+
files.map((file, index) => {
|
|
27
27
|
const isSelected = index === selectedIndex;
|
|
28
|
-
|
|
28
|
+
const icon = file.mimeType?.startsWith('image/') ? '📋' : '📄';
|
|
29
|
+
return (React.createElement(Box, { key: file.id, paddingX: 1 },
|
|
29
30
|
React.createElement(Text, { color: isSelected ? '#ff9900' : '#aaaaaa', bold: isSelected, inverse: isSelected },
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
icon,
|
|
32
|
+
" ",
|
|
33
|
+
file.displayName),
|
|
32
34
|
React.createElement(Text, { color: "#666666" },
|
|
33
35
|
" ",
|
|
34
|
-
formatFileSize(
|
|
36
|
+
formatFileSize(file.sizeBytes))));
|
|
35
37
|
}),
|
|
36
38
|
React.createElement(Box, { marginTop: 0 },
|
|
37
39
|
React.createElement(Text, { color: "#666666", dimColor: true }, "\u2191\u2193 to select, Enter to attach"))));
|
|
38
40
|
};
|
|
39
|
-
//# sourceMappingURL=
|
|
41
|
+
//# sourceMappingURL=ClipboardFileAutocomplete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClipboardFileAutocomplete.js","sourceRoot":"","sources":["../../../src/ui/components/ClipboardFileAutocomplete.tsx"],"names":[],"mappings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Approve, onEdit }) => {
|
|
|
85
85
|
React.createElement(Box, { flexDirection: "column", marginY: 0 }, visibleItems.map((item, index) => {
|
|
86
86
|
const isTask = item.type === 'task';
|
|
87
87
|
return (React.createElement(Box, { key: scrollOffset + index },
|
|
88
|
-
React.createElement(Text, { color: isTask ? '#cccccc' : '#999999', wrap: "
|
|
88
|
+
React.createElement(Text, { color: isTask ? '#cccccc' : '#999999', wrap: "wrap" },
|
|
89
89
|
item.status,
|
|
90
90
|
" ",
|
|
91
91
|
item.content)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DetailedPlanReviewScreen.js","sourceRoot":"","sources":["../../../src/ui/components/DetailedPlanReviewScreen.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAa,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AASrD,MAAM,CAAC,MAAM,wBAAwB,GAA4C,CAAC,EAC9E,IAAI,EACJ,SAAS,EACT,MAAM,EACT,EAAE,EAAE;IACD,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,CAAC;IAC/B,MAAM,cAAc,GAAG,MAAM,EAAE,IAAI,IAAI,EAAE,CAAC;IAE1C,uFAAuF;IACvF,MAAM,YAAY,GAAG,CAAC,CAAC,CAAC,uBAAuB;IAC/C,MAAM,iBAAiB,GAAG,CAAC,CAAC,CAAC,yBAAyB;IACtD,MAAM,mBAAmB,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5G,MAAM,mBAAmB,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,cAAc,GAAG,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EACX,QAAQ,EAAE,CAAC;YAEX,oBAAC,IAAI,IAAC,KAAK,EAAC,SAAS,EAAC,IAAI,0BAAqB;YAC/C,oBAAC,GAAG,IAAC,SAAS,EAAE,CAAC;gBACb,oBAAC,GAAG,IAAC,WAAW,EAAE,CAAC;oBACf,oBAAC,IAAI,IAAC,KAAK,EAAC,SAAS,aAAc;oBACnC,oBAAC,IAAI,IAAC,KAAK,EAAC,SAAS,EAAC,IAAI,cAAS;oBACnC,oBAAC,IAAI,IAAC,KAAK,EAAC,SAAS,WAAY;oBACjC,oBAAC,IAAI,IAAC,KAAK,EAAC,SAAS,EAAC,IAAI,kBAAa;oBACvC,oBAAC,IAAI,IAAC,KAAK,EAAC,SAAS,kBAAmB,CACtC;gBACN,oBAAC,GAAG;oBACA,oBAAC,IAAI,IAAC,KAAK,EAAC,SAAS,aAAc;oBACnC,oBAAC,IAAI,IAAC,KAAK,EAAC,SAAS,EAAC,IAAI,cAAS;oBACnC,oBAAC,IAAI,IAAC,KAAK,EAAC,SAAS,iBAAkB,CACrC,CACJ,CACJ,CACJ,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SubshellContext } from '../../context/types.js';
|
|
3
|
-
import {
|
|
3
|
+
import { ClipboardFile } from '../../services/clipboard-service.js';
|
|
4
4
|
interface InputBoxProps {
|
|
5
|
-
onSubmit: (value: string,
|
|
5
|
+
onSubmit: (value: string, clipboardFiles?: ClipboardFile[]) => void;
|
|
6
6
|
placeholder?: string;
|
|
7
7
|
autoAcceptMode: boolean;
|
|
8
8
|
model?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputBox.d.ts","sourceRoot":"","sources":["../../../src/ui/components/InputBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAIpE,OAAO,EAAE,eAAe,EAAE,MAAM,wB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AC,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,KAAK,IAAI,CAAC;IACpE,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,IAAI,CAAA;KAAE,CAAC,CAAC;IAC9E,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,KAAK,IAAI,CAAC;CAC/D;AA+CD,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA0zE3C,CAAC"}
|
|
@@ -11,7 +11,7 @@ import { CommandHistoryManager } from '../../utils/command-history.js';
|
|
|
11
11
|
import { SlashCommandAutocomplete } from './SlashCommandAutocomplete.js';
|
|
12
12
|
import { FileTagAutocomplete } from './FileTagAutocomplete.js';
|
|
13
13
|
import { filterCommands } from '../../config/slash-commands.js';
|
|
14
|
-
import {
|
|
14
|
+
import { getClipboardFiles } from '../../services/clipboard-service.js';
|
|
15
15
|
import { useTerminalDimensions, TERMINAL_HEIGHT_CONSTANTS } from '../../hooks/useTerminalDimensions.js';
|
|
16
16
|
import { AIAutocompleteAgent, AI_AUTOCOMPLETE_DEBOUNCE_MS } from '../../services/ai-autocomplete-agent.js';
|
|
17
17
|
import { workflowStorage } from '../../services/workflow-storage.js';
|
|
@@ -105,8 +105,8 @@ export const InputBox = React.memo(({ onSubmit, placeholder = 'Ask anything...',
|
|
|
105
105
|
const [fileTagSelectedIndex, setFileTagSelectedIndex] = useState(0);
|
|
106
106
|
const [activeFileTagStart, setActiveFileTagStart] = useState(null);
|
|
107
107
|
const [confirmedFileTags, setConfirmedFileTags] = useState([]);
|
|
108
|
-
// Clipboard
|
|
109
|
-
const [
|
|
108
|
+
// Clipboard File State (Alt+V paste)
|
|
109
|
+
const [confirmedClipboardFiles, setConfirmedClipboardFiles] = useState([]);
|
|
110
110
|
// Track visual line count to force re-renders when text wraps
|
|
111
111
|
// This is necessary because Ink doesn't automatically update layout when text wraps
|
|
112
112
|
const [visualLineCount, setVisualLineCount] = useState(1);
|
|
@@ -901,24 +901,30 @@ export const InputBox = React.memo(({ onSubmit, placeholder = 'Ask anything...',
|
|
|
901
901
|
// Option+V on Mac often sends '√', which we also support.
|
|
902
902
|
const isAltV = (key.meta && input === 'v') || (input === '√');
|
|
903
903
|
if (isAltV && !commandMode) {
|
|
904
|
-
// Check clipboard for
|
|
904
|
+
// Check clipboard for files asynchronously
|
|
905
905
|
(async () => {
|
|
906
906
|
try {
|
|
907
|
-
const
|
|
908
|
-
if (
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
907
|
+
const files = await getClipboardFiles();
|
|
908
|
+
if (files.length > 0) {
|
|
909
|
+
// Check limits (max 5 files allowed)
|
|
910
|
+
const currentCount = confirmedClipboardFiles.length;
|
|
911
|
+
const newCount = files.length;
|
|
912
|
+
if (currentCount + newCount > 5) {
|
|
913
|
+
logDebug(`Alt+V: Rejected file paste, limit exceeded (${currentCount} + ${newCount} > 5)`);
|
|
914
|
+
setRejectFlash(true);
|
|
915
|
+
setTimeout(() => setRejectFlash(false), 1000);
|
|
916
|
+
return;
|
|
917
|
+
}
|
|
918
|
+
logDebug(`Alt+V: Found ${files.length} file(s) in clipboard, adding to input`);
|
|
919
|
+
// Add files to confirmed list with unique ID
|
|
920
|
+
const newFilesWithIds = files.map(file => ({
|
|
921
|
+
...file,
|
|
922
|
+
id: `${file.id}_${Date.now()}_${Math.random().toString(36).substring(7)}`
|
|
923
|
+
}));
|
|
924
|
+
setConfirmedClipboardFiles(prev => [...prev, ...newFilesWithIds]);
|
|
919
925
|
}
|
|
920
926
|
else {
|
|
921
|
-
logDebug('Alt+V: No
|
|
927
|
+
logDebug('Alt+V: No file in clipboard');
|
|
922
928
|
}
|
|
923
929
|
}
|
|
924
930
|
catch (error) {
|
|
@@ -927,6 +933,20 @@ export const InputBox = React.memo(({ onSubmit, placeholder = 'Ask anything...',
|
|
|
927
933
|
})();
|
|
928
934
|
return;
|
|
929
935
|
}
|
|
936
|
+
// Alt+X / Cmd+X: Remove the last attached file/image
|
|
937
|
+
// Detect Alt+X on Windows/Linux or Cmd+X on Mac.
|
|
938
|
+
// Option+X on Mac often produces '≈'
|
|
939
|
+
const isAltX = (key.meta && input === 'x') || (input === '≈');
|
|
940
|
+
if (isAltX && !commandMode) {
|
|
941
|
+
if (confirmedClipboardFiles.length > 0) {
|
|
942
|
+
logDebug(`Alt+X: Removing last attached file`);
|
|
943
|
+
setConfirmedClipboardFiles(prev => prev.slice(0, -1));
|
|
944
|
+
}
|
|
945
|
+
else {
|
|
946
|
+
logDebug(`Alt+X: No files to remove`);
|
|
947
|
+
}
|
|
948
|
+
return;
|
|
949
|
+
}
|
|
930
950
|
// DELETE WORD BACKWARDS
|
|
931
951
|
// 1. Ctrl+W
|
|
932
952
|
// 2. Cmd+Backspace (Mac) - often mapped to delete line, but here we treat key.meta as modifier
|
|
@@ -1970,7 +1990,7 @@ export const InputBox = React.memo(({ onSubmit, placeholder = 'Ask anything...',
|
|
|
1970
1990
|
return match;
|
|
1971
1991
|
});
|
|
1972
1992
|
}
|
|
1973
|
-
onSubmit(resolvedValue,
|
|
1993
|
+
onSubmit(resolvedValue, confirmedClipboardFiles.length > 0 ? confirmedClipboardFiles : undefined);
|
|
1974
1994
|
setValue('');
|
|
1975
1995
|
setCursorOffset(0);
|
|
1976
1996
|
setCompletions([]);
|
|
@@ -1982,7 +2002,7 @@ export const InputBox = React.memo(({ onSubmit, placeholder = 'Ask anything...',
|
|
|
1982
2002
|
setSelection(null);
|
|
1983
2003
|
setAutocompleteSuggestion(null);
|
|
1984
2004
|
setConfirmedFileTags([]); // Clear confirmed tags on submit
|
|
1985
|
-
|
|
2005
|
+
setConfirmedClipboardFiles([]); // Clear confirmed clipboard files on submit
|
|
1986
2006
|
}
|
|
1987
2007
|
};
|
|
1988
2008
|
// Rendering Logic with Scrolling
|
|
@@ -2158,9 +2178,9 @@ export const InputBox = React.memo(({ onSubmit, placeholder = 'Ask anything...',
|
|
|
2158
2178
|
React.createElement(Text, { color: "#00ccff", bold: true }, "Auto ["),
|
|
2159
2179
|
detectedIntent === 'command' ? (React.createElement(Text, { color: "#00cc66", bold: true }, "Terminal")) : (React.createElement(Text, { color: "#00ccff" }, "Agent")),
|
|
2160
2180
|
React.createElement(Text, { color: "#00ccff", bold: true }, "]"))) : backgroundMode ? (React.createElement(Text, { color: "#9966ff", bold: true }, "Background")) : commandMode ? (React.createElement(Text, { color: "#00cc66", bold: true }, "Terminal")) : planMode ? (React.createElement(Text, { color: "#ffaa00", bold: true }, "Plan")) : (React.createElement(Text, { color: "#00ccff" }, "Agent"))))),
|
|
2161
|
-
|
|
2181
|
+
confirmedClipboardFiles.length > 0 && (React.createElement(Box, { marginBottom: 1, flexDirection: "row", flexWrap: "wrap", gap: 1 }, confirmedClipboardFiles.map((file, index) => (React.createElement(Box, { key: file.id, borderStyle: "round", borderColor: "#ff69b4", paddingX: 1 },
|
|
2162
2182
|
React.createElement(Text, { color: "#ff69b4", bold: true },
|
|
2163
|
-
"
|
|
2183
|
+
"file_",
|
|
2164
2184
|
index + 1)))))),
|
|
2165
2185
|
showQuotaMessage && (React.createElement(Box, { justifyContent: "flex-end", marginBottom: 1 },
|
|
2166
2186
|
React.createElement(Text, { color: "#ff3366", bold: true },
|