2025-07-23 15:21:28 -04:00
|
|
|
import React from "react";
|
|
|
|
|
import { Box, Text } from "ink";
|
|
|
|
|
|
|
|
|
|
interface TerminalInterfaceProps {
|
|
|
|
|
message: string | null;
|
|
|
|
|
setMessage: () => void;
|
|
|
|
|
CustomInput: React.FC<{ onSubmit: () => void }>;
|
2025-07-29 17:37:13 -04:00
|
|
|
repoName: string;
|
2025-07-23 15:21:28 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const TerminalInterface: React.FC<TerminalInterfaceProps> = ({
|
|
|
|
|
message,
|
|
|
|
|
setMessage,
|
|
|
|
|
CustomInput,
|
2025-07-29 17:37:13 -04:00
|
|
|
repoName,
|
2025-07-23 15:21:28 -04:00
|
|
|
}) => {
|
|
|
|
|
return (
|
|
|
|
|
<Box flexDirection="column" padding={1}>
|
|
|
|
|
<Box justifyContent="center" marginBottom={0}>
|
|
|
|
|
<Text bold>LangChain Open SWE CLI</Text>
|
|
|
|
|
</Box>
|
|
|
|
|
<Box flexDirection="column">
|
|
|
|
|
<Text>Describe your coding task in as much detail as possible...</Text>
|
|
|
|
|
</Box>
|
|
|
|
|
<Box
|
|
|
|
|
borderStyle="round"
|
|
|
|
|
borderColor="gray"
|
|
|
|
|
paddingX={2}
|
|
|
|
|
paddingY={1}
|
|
|
|
|
marginTop={0}
|
|
|
|
|
marginBottom={0}
|
|
|
|
|
>
|
2025-07-29 17:37:13 -04:00
|
|
|
<CustomInput onSubmit={() => setMessage()} />
|
2025-07-23 15:21:28 -04:00
|
|
|
</Box>
|
|
|
|
|
{message && (
|
|
|
|
|
<Box marginTop={1}>
|
|
|
|
|
<Text color="green">You typed: {message}</Text>
|
|
|
|
|
</Box>
|
|
|
|
|
)}
|
2025-07-29 17:37:13 -04:00
|
|
|
{repoName && (
|
|
|
|
|
<Box marginTop={0} marginBottom={0}>
|
|
|
|
|
<Text color="gray">Repository: {repoName}</Text>
|
|
|
|
|
</Box>
|
|
|
|
|
)}
|
2025-07-23 15:21:28 -04:00
|
|
|
</Box>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default TerminalInterface;
|