MCPcopy Create free account
hub / github.com/anus-dev/ANUS / ContextUsageDisplay

Function ContextUsageDisplay

packages/cli/src/ui/components/ContextUsageDisplay.tsx:12–26  ·  view source on GitHub ↗
({
  promptTokenCount,
  model,
}: {
  promptTokenCount: number;
  model: string;
})

Source from the content-addressed store, hash-verified

10import { tokenLimit } from '@anus-dev/anus-core';
11
12export const ContextUsageDisplay = ({
13 promptTokenCount,
14 model,
15}: {
16 promptTokenCount: number;
17 model: string;
18}) => {
19 const percentage = promptTokenCount / tokenLimit(model);
20
21 return (
22 <Text color={Colors.Gray}>
23 ({((1 - percentage) * 100).toFixed(0)}% context left)
24 </Text>
25 );
26};

Callers

nothing calls this directly

Calls 1

tokenLimitFunction · 0.85

Tested by

no test coverage detected