[eric] usage: the lane labels live in their own module; the previous commit's test imported the React component and was red when pushed

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
ciregenz
2026-09-04 14:36:32 -07:00
co-authored by Claude Fable 5.1
parent b965bf9118
commit 5ac58919e5
3 changed files with 19 additions and 19 deletions
@@ -1,3 +1,4 @@
import { laneLabel } from './usageLanes';
import React, { useState, useEffect } from 'react';
import Box from '@mui/material/Box';
import Typography from '@mui/material/Typography';
@@ -32,24 +33,6 @@ interface UsageSummary {
hourly_activity: number[];
}
// The router's provider ids, in the words a user would recognise. `claude` is the Claude Pro/Max
// OAuth lane; `anthropic` is a pay-per-use key OR the OpenSwarm-managed node, which the router does
// not tell apart at this level, so the label says both.
export const LANE_LABELS: Record<string, string> = {
claude: 'Claude subscription (Pro/Max)',
anthropic: 'Anthropic API key or OpenSwarm Pro',
codex: 'ChatGPT subscription',
openai: 'OpenAI API key',
'gemini-cli': 'Gemini subscription',
antigravity: 'Gemini subscription (Antigravity)',
gemini: 'Google API key',
openrouter: 'OpenRouter key',
};
export function laneLabel(provider: string): string {
return LANE_LABELS[provider] ?? provider;
}
function fmtCount(n: number): string {
return n >= 10000 ? `${(n / 1000).toFixed(1)}k` : Math.round(n).toLocaleString();
}
@@ -2,7 +2,7 @@ import { test } from 'node:test';
import assert from 'node:assert/strict';
import fs from 'node:fs';
import path from 'node:path';
import { laneLabel } from './UsageStats';
import { laneLabel } from './usageLanes';
// Chuya (1.7.9, 2026-09-04) read "$0.40 API value covered" as money she was being charged and filmed it
// going to $0.41 as proof the app was billing her instead of using her subscription. The figure is an
@@ -0,0 +1,17 @@
// The router's provider ids, in the words a user would recognise. `claude` is the Claude Pro/Max
// OAuth lane; `anthropic` is a pay-per-use key OR the OpenSwarm-managed node, which the router does
// not tell apart at this level, so the label says both.
export const LANE_LABELS: Record<string, string> = {
claude: 'Claude subscription (Pro/Max)',
anthropic: 'Anthropic API key or OpenSwarm Pro',
codex: 'ChatGPT subscription',
openai: 'OpenAI API key',
'gemini-cli': 'Gemini subscription',
antigravity: 'Gemini subscription (Antigravity)',
gemini: 'Google API key',
openrouter: 'OpenRouter key',
};
export function laneLabel(provider: string): string {
return LANE_LABELS[provider] ?? provider;
}