Files
mcpctl/src/cli/src/commands/console/components/toolbar.tsx
Michal 03827f11e4 feat: eager vLLM warmup and smart page titles in paginate stage
- Add warmup() to LlmProvider interface for eager subprocess startup
- ManagedVllmProvider.warmup() starts vLLM in background on project load
- ProviderRegistry.warmupAll() triggers all managed providers
- NamedProvider proxies warmup() to inner provider
- paginate stage generates LLM-powered descriptive page titles when
  available, cached by content hash, falls back to generic "Page N"
- project-mcp-endpoint calls warmupAll() on router creation so vLLM
  is loading while the session initializes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 19:07:39 +00:00

47 lines
1.4 KiB
TypeScript

/**
* Toolbar — compact 1-line bar showing Tools / Resources / Prompts / Raw JSON-RPC.
*
* Shown between the header and timeline when an interactive session is ungated.
* Items are selectable via Tab (focus on/off), ←/→ (cycle), Enter (open).
*/
import { Box, Text } from 'ink';
interface ToolbarProps {
toolCount: number;
resourceCount: number;
promptCount: number;
focusedItem: number; // -1 = not focused, 0-3 = which item
}
const ITEMS = [
{ label: 'Tools', key: 'tools' },
{ label: 'Resources', key: 'resources' },
{ label: 'Prompts', key: 'prompts' },
{ label: 'Raw JSON-RPC', key: 'raw' },
] as const;
export function Toolbar({ toolCount, resourceCount, promptCount, focusedItem }: ToolbarProps) {
const counts = [toolCount, resourceCount, promptCount, -1]; // -1 = no count for raw
return (
<Box paddingX={1} height={1}>
{ITEMS.map((item, i) => {
const focused = focusedItem === i;
const count = counts[i]!;
const separator = i < ITEMS.length - 1 ? ' | ' : '';
return (
<Text key={item.key}>
<Text color={focused ? 'cyan' : undefined} bold={focused} dimColor={!focused}>
{` ${item.label}`}
{count >= 0 && <Text>{` (${count})`}</Text>}
</Text>
{separator && <Text dimColor>{separator}</Text>}
</Text>
);
})}
</Box>
);
}