MCPcopy Create free account
hub / github.com/cortexkit/magic-context / renderStatusText

Function renderStatusText

packages/pi-plugin/src/status-line.ts:78–90  ·  view source on GitHub ↗
(
	ctx: ExtensionContext,
	db: ContextDatabase,
	sessionId: string,
)

Source from the content-addressed store, hash-verified

76}
77
78function renderStatusText(
79 ctx: ExtensionContext,
80 db: ContextDatabase,
81 sessionId: string,
82): string {
83 const usage = ctx.getContextUsage?.();
84 const inputTokens =
85 typeof usage?.tokens === "number" ? usage.tokens : undefined;
86 const pct = typeof usage?.percent === "number" ? usage.percent : undefined;
87 const meta = readSessionMetaStatus(db, sessionId);
88 const state = renderHistorianState(meta, recompSessions.has(sessionId));
89 return `mc: ${inputTokens === undefined ? "--" : fmt(inputTokens)} (${pct === undefined ? "--" : `${Math.round(pct)}%`}) · ${state}`;
90}
91
92function renderHistorianState(
93 meta: SessionMetaStatus | undefined,

Callers 1

updateStatusLineFunction · 0.85

Calls 4

readSessionMetaStatusFunction · 0.85
renderHistorianStateFunction · 0.85
hasMethod · 0.80
fmtFunction · 0.70

Tested by

no test coverage detected