feat: letta code
This commit is contained in:
24
src/cli/components/Transcript.tsx
Normal file
24
src/cli/components/Transcript.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import { Box, Text } from "ink";
|
||||
|
||||
export type Row =
|
||||
| { kind: "user"; text: string; id?: string }
|
||||
| { kind: "assistant"; text: string; id?: string }
|
||||
| { kind: "reasoning"; text: string; id?: string };
|
||||
|
||||
export function Transcript({ rows }: { rows: Row[] }) {
|
||||
return (
|
||||
<Box flexDirection="column">
|
||||
{rows.map((r, i) => {
|
||||
if (r.kind === "user")
|
||||
return <Text key={r.id ?? i}>{`> ${r.text}`}</Text>;
|
||||
if (r.kind === "assistant")
|
||||
return <Text key={r.id ?? i}>{r.text}</Text>;
|
||||
return (
|
||||
<Text key={r.id ?? i} dimColor>
|
||||
{r.text}
|
||||
</Text>
|
||||
); // reasoning
|
||||
})}
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user