feat(initial): scaffold @push.rocks/smartchat with core, CLI, and web layers
Three-layer architecture built on @push.rocks/smartagent: - ts/ — ChatSession wrapping runAgent() with conversation state management - ts_cli/ — ink-based terminal chat TUI (React.createElement, no JSX) - ts_web/ — Lit web components (smartchat-window, smartchat-message, smartchat-input)
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import { React, h, Box, Text } from './plugins.js';
|
||||
import type { IChatUsage } from './plugins.js';
|
||||
|
||||
interface IStatusBarProps {
|
||||
modelName?: string;
|
||||
usage: IChatUsage;
|
||||
busy: boolean;
|
||||
}
|
||||
|
||||
export function StatusBar({ modelName, usage, busy }: IStatusBarProps): React.ReactElement {
|
||||
const children: React.ReactNode[] = [
|
||||
h(Text, { dimColor: true, key: 'model' }, modelName ? `model: ${modelName}` : 'smartchat'),
|
||||
h(Text, { dimColor: true, key: 'sep1' }, ' | '),
|
||||
h(Text, { dimColor: true, key: 'tokens' }, `tokens: ${usage.totalTokens.toLocaleString()}`),
|
||||
h(Text, { dimColor: true, key: 'sep2' }, ' | '),
|
||||
h(Text, { dimColor: true, key: 'turns' }, `turns: ${usage.turns}`),
|
||||
];
|
||||
|
||||
if (busy) {
|
||||
children.push(
|
||||
h(Text, { dimColor: true, key: 'sep3' }, ' | '),
|
||||
h(Text, { color: 'yellow', key: 'thinking' }, 'thinking...'),
|
||||
);
|
||||
}
|
||||
|
||||
return h(
|
||||
Box,
|
||||
{ borderStyle: 'single' as const, borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, paddingX: 1 },
|
||||
...children,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user