Rename AI Tycoon to Token Empire across entire codebase
Balance Check / balance-simulation (pull_request) Successful in 38s
Balance Check / multi-run-balance (pull_request) Successful in 13m44s

Full rebrand: UI display text, package scope (@ai-tycoon/* -> @token-empire/*),
localStorage keys, Docker/CI image paths, database names, and documentation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-27 21:04:07 -04:00
parent be93e57853
commit c1cc70eeb9
123 changed files with 248 additions and 248 deletions
@@ -1,7 +1,7 @@
import { describe, it, expect } from 'vitest';
import { processAchievements } from './achievementSystem';
import { createTestState } from '../__test-utils__';
import type { AchievementDefinition } from '@ai-tycoon/shared';
import type { AchievementDefinition } from '@token-empire/shared';
function makeDef(overrides: Partial<AchievementDefinition> = {}): AchievementDefinition {
return {
@@ -1,4 +1,4 @@
import type { GameState, AchievementState, AchievementDefinition } from '@ai-tycoon/shared';
import type { GameState, AchievementState, AchievementDefinition } from '@token-empire/shared';
export interface AchievementTickResult {
achievements: AchievementState;
@@ -1,8 +1,8 @@
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
import { processCompetitors } from './competitorSystem';
import { createTestState, createSeededRNG } from '../__test-utils__';
import { FRESHNESS_DECAY_RATE } from '@ai-tycoon/shared';
import type { Competitor } from '@ai-tycoon/shared';
import { FRESHNESS_DECAY_RATE } from '@token-empire/shared';
import type { Competitor } from '@token-empire/shared';
const rng = createSeededRNG(42);
beforeEach(() => rng.install());
@@ -1,10 +1,10 @@
import type { GameState, CompetitorState, Competitor } from '@ai-tycoon/shared';
import type { GameState, CompetitorState, Competitor } from '@token-empire/shared';
import {
COMPETITOR_PRODUCT_THRESHOLDS,
COMPETITOR_CATCHUP_SHARE_THRESHOLD,
COMPETITOR_CATCHUP_PRICE_CUT,
FRESHNESS_DECAY_RATE,
} from '@ai-tycoon/shared';
} from '@token-empire/shared';
function updateCompetitorProducts(rival: Competitor): Competitor['products'] {
const cap = rival.estimatedCapability;
@@ -1,8 +1,8 @@
import { describe, it, expect } from 'vitest';
import { createTestState } from '../__test-utils__';
import { computeCapacity, finalizeCompute } from './computeSystem';
import type { InfrastructureState } from '@ai-tycoon/shared';
import { INITIAL_INFRASTRUCTURE, FLOPS_TO_TOKENS_MULTIPLIER, COMPUTE_SNAPSHOT_INTERVAL, MAX_COMPUTE_HISTORY } from '@ai-tycoon/shared';
import type { InfrastructureState } from '@token-empire/shared';
import { INITIAL_INFRASTRUCTURE, FLOPS_TO_TOKENS_MULTIPLIER, COMPUTE_SNAPSHOT_INTERVAL, MAX_COMPUTE_HISTORY } from '@token-empire/shared';
function createInfrastructure(overrides: Partial<InfrastructureState> = {}): InfrastructureState {
return { ...INITIAL_INFRASTRUCTURE, ...overrides };
@@ -1,5 +1,5 @@
import type { GameState, ComputeState, InfrastructureState } from '@ai-tycoon/shared';
import { FLOPS_TO_TOKENS_MULTIPLIER, COMPUTE_SNAPSHOT_INTERVAL, MAX_COMPUTE_HISTORY } from '@ai-tycoon/shared';
import type { GameState, ComputeState, InfrastructureState } from '@token-empire/shared';
import { FLOPS_TO_TOKENS_MULTIPLIER, COMPUTE_SNAPSHOT_INTERVAL, MAX_COMPUTE_HISTORY } from '@token-empire/shared';
import type { ResearchBonuses } from './researchBonuses';
export interface CapacityResult {
@@ -1,7 +1,7 @@
import { describe, it, expect } from 'vitest';
import { processData } from './dataSystem';
import { createTestState } from '../__test-utils__';
import type { DataPartnership } from '@ai-tycoon/shared';
import type { DataPartnership } from '@token-empire/shared';
function makePartnership(tokensPerTick: number): DataPartnership {
return {
@@ -1,4 +1,4 @@
import type { GameState, DataState } from '@ai-tycoon/shared';
import type { GameState, DataState } from '@token-empire/shared';
export function processData(state: GameState): DataState {
const subscribers = state.market.consumerTiers.totalUsers;
@@ -2,7 +2,7 @@ import { describe, it, expect } from 'vitest';
import { processEconomy } from './economySystem';
import { createTestState, createTestCluster } from '../__test-utils__';
import type { MarketTickResult } from './marketSystem';
import type { InfrastructureState } from '@ai-tycoon/shared';
import type { InfrastructureState } from '@token-empire/shared';
function createMarketResult(
overrides: Partial<MarketTickResult> = {},
@@ -1,5 +1,5 @@
import type { GameState, EconomyState, InfrastructureState } from '@ai-tycoon/shared';
import { FINANCIAL_SNAPSHOT_INTERVAL, MAX_FINANCIAL_HISTORY, REGULATION_COMPLIANCE_PER_CAPABILITY } from '@ai-tycoon/shared';
import type { GameState, EconomyState, InfrastructureState } from '@token-empire/shared';
import { FINANCIAL_SNAPSHOT_INTERVAL, MAX_FINANCIAL_HISTORY, REGULATION_COMPLIANCE_PER_CAPABILITY } from '@token-empire/shared';
import { TECH_TREE } from '../data/techTree';
import type { MarketTickResult } from './marketSystem';
@@ -1,5 +1,5 @@
import type { GameState, Era } from '@ai-tycoon/shared';
import { ERA_THRESHOLDS } from '@ai-tycoon/shared';
import type { GameState, Era } from '@token-empire/shared';
import { ERA_THRESHOLDS } from '@token-empire/shared';
export function checkEraTransition(state: GameState): Era | null {
const current = state.meta.currentEra;
@@ -1,5 +1,5 @@
import type { GameState, FundingState, FundingRoundType } from '@ai-tycoon/shared';
import { FUNDING_ROUNDS } from '@ai-tycoon/shared';
import type { GameState, FundingState, FundingRoundType } from '@token-empire/shared';
import { FUNDING_ROUNDS } from '@token-empire/shared';
const ROUND_ORDER: FundingRoundType[] = ['seed', 'seriesA', 'seriesB', 'seriesC', 'seriesD', 'ipo'];
@@ -3,7 +3,7 @@ import type {
DeploymentCohort, PipelineStage, RackSkuId,
SwitchTier, DCNetworkSummary, CampusNetworkSummary, ClusterNetworkSummary,
RepairBatch, CampusRetrofitQueue, DCTier, IntraNodeInterconnect, NetworkFabric, RackSkuConfig,
} from '@ai-tycoon/shared';
} from '@token-empire/shared';
import {
LOCATION_CONFIGS,
RACK_SKU_CONFIGS,
@@ -22,7 +22,7 @@ import {
COOLING_TYPE_CONFIGS,
NETWORK_FABRIC_CONFIGS,
estimateNetworkSlots,
} from '@ai-tycoon/shared';
} from '@token-empire/shared';
import type { TickNotification } from '../tick';
import type { ResearchBonuses } from './researchBonuses';
@@ -1,11 +1,11 @@
import type { ApiTierState, ApiTierId, DeveloperEcosystem, TierServingMetrics } from '@ai-tycoon/shared';
import type { ApiTierState, ApiTierId, DeveloperEcosystem, TierServingMetrics } from '@token-empire/shared';
import {
API_TIER_ORDER,
API_CONVERSION_RATES,
API_TIER_CHURN_RATES,
API_TOKENS_PER_DEVELOPER_PER_TICK,
REJECTION_CHURN_MULTIPLIER,
} from '@ai-tycoon/shared';
} from '@token-empire/shared';
export interface ApiTickResult {
apiTiers: ApiTierState;
@@ -1,4 +1,4 @@
import type { ConsumerTierState, ConsumerTierId, TierServingMetrics } from '@ai-tycoon/shared';
import type { ConsumerTierState, ConsumerTierId, TierServingMetrics } from '@token-empire/shared';
import {
CONSUMER_TIER_ORDER,
CONVERSION_RATES,
@@ -14,7 +14,7 @@ import {
PRICE_SATISFACTION_WEIGHT,
PRICE_CHURN_EXPONENT,
PRICE_CHURN_MAX_MULTIPLIER,
} from '@ai-tycoon/shared';
} from '@token-empire/shared';
export interface ConsumerTickResult {
consumerTiers: ConsumerTierState;
@@ -1,4 +1,4 @@
import type { DeveloperEcosystem } from '@ai-tycoon/shared';
import type { DeveloperEcosystem } from '@token-empire/shared';
import {
BASE_DEV_GROWTH,
FREE_TIER_DEV_MULTIPLIER,
@@ -9,8 +9,8 @@ import {
STARTUP_ADOPTION_PER_DEV,
ENTERPRISE_REFERRAL_PER_STARTUP,
TAM_BASE_SIZES,
} from '@ai-tycoon/shared';
import type { Era } from '@ai-tycoon/shared';
} from '@token-empire/shared';
import type { Era } from '@token-empire/shared';
export function processDeveloperEcosystem(
eco: DeveloperEcosystem,
@@ -6,7 +6,7 @@ import type {
EnterprisePipelineStage,
DeveloperEcosystem,
TierServingMetrics,
} from '@ai-tycoon/shared';
} from '@token-empire/shared';
import {
BASE_LEAD_RATE,
LEAD_EXPIRY_TICKS,
@@ -19,7 +19,7 @@ import {
ENTERPRISE_CAPABILITY_REQUIREMENTS,
ENTERPRISE_TOKENS_PER_TICK,
ENTERPRISE_REJECTION_SLA_MULTIPLIER,
} from '@ai-tycoon/shared';
} from '@token-empire/shared';
import { ENTERPRISE_NAMES } from '../../data/enterpriseNames';
let leadIdCounter = 0;
@@ -1,6 +1,6 @@
import type { GameState, MarketState, ModelCapabilities } from '@ai-tycoon/shared';
import { CONSUMER_TOKENS_PER_SUBSCRIBER, API_TOKENS_PER_DEVELOPER_PER_TICK, BATCH_API_DEMAND_PER_DEV, makeInitialServingMetrics } from '@ai-tycoon/shared';
import type { TrafficPriority, TierServingMetrics } from '@ai-tycoon/shared';
import type { GameState, MarketState, ModelCapabilities } from '@token-empire/shared';
import { CONSUMER_TOKENS_PER_SUBSCRIBER, API_TOKENS_PER_DEVELOPER_PER_TICK, BATCH_API_DEMAND_PER_DEV, makeInitialServingMetrics } from '@token-empire/shared';
import type { TrafficPriority, TierServingMetrics } from '@token-empire/shared';
import { computeSeasonal } from './seasonalSystem';
import { updateObsolescence } from './obsolescenceSystem';
import { buildPlayerProfile, buildCompetitorProfile, computeMarketShares, updateTAMGrowth } from './tamSystem';
@@ -1,10 +1,10 @@
import type { ObsolescenceState, Era } from '@ai-tycoon/shared';
import type { ObsolescenceState, Era } from '@token-empire/shared';
import {
OBSOLESCENCE_BASELINE_GROWTH,
OBSOLESCENCE_ERA_ACCELERATOR,
FRESHNESS_DECAY_RATE,
NEW_MODEL_BOOST_TICKS,
} from '@ai-tycoon/shared';
} from '@token-empire/shared';
export function updateObsolescence(
obs: ObsolescenceState,
@@ -1,4 +1,4 @@
import type { CodeAssistantState, AgentsPlatformState, ModelCapabilities } from '@ai-tycoon/shared';
import type { CodeAssistantState, AgentsPlatformState, ModelCapabilities } from '@token-empire/shared';
import {
CODE_ASSISTANT_MIN_CODING_SCORE,
CODE_ASSISTANT_BASE_ADOPTION_RATE,
@@ -6,7 +6,7 @@ import {
AGENTS_PLATFORM_MIN_AGENTS_SCORE,
AGENTS_PLATFORM_BASE_ADOPTION_RATE,
AGENTS_PLATFORM_CHURN_RATE,
} from '@ai-tycoon/shared';
} from '@token-empire/shared';
export interface ProductLineResult {
codeAssistant: CodeAssistantState;
@@ -1,5 +1,5 @@
import type { SeasonalPhase } from '@ai-tycoon/shared';
import { SEASONAL_CYCLE_TICKS, SEASONAL_MULTIPLIERS } from '@ai-tycoon/shared';
import type { SeasonalPhase } from '@token-empire/shared';
import { SEASONAL_CYCLE_TICKS, SEASONAL_MULTIPLIERS } from '@token-empire/shared';
export interface SeasonalResult {
phase: SeasonalPhase;
@@ -5,8 +5,8 @@ import type {
ServingMetrics,
ModelUtilizationEntry,
BatchApiState,
} from '@ai-tycoon/shared';
import type { BaseModel, ModelsState, SizeTier } from '@ai-tycoon/shared';
} from '@token-empire/shared';
import type { BaseModel, ModelsState, SizeTier } from '@token-empire/shared';
import {
MODEL_SIZE_THROUGHPUT_SCALER,
MOE_SPEED_MULTIPLIER,
@@ -18,8 +18,8 @@ import {
BASE_LATENCY_MS,
QUEUE_LATENCY_MS_PER_PERCENT,
BATCH_API_MAX_PENDING,
} from '@ai-tycoon/shared';
import { makeInitialServingMetrics } from '@ai-tycoon/shared';
} from '@token-empire/shared';
import { makeInitialServingMetrics } from '@token-empire/shared';
export interface ModelServingSlot {
modelId: string;
@@ -6,7 +6,7 @@ import type {
Era,
ObsolescenceState,
DeveloperEcosystem,
} from '@ai-tycoon/shared';
} from '@token-empire/shared';
import {
TAM_BASE_SIZES,
TAM_GROWTH_PER_TICK,
@@ -17,7 +17,7 @@ import {
NEW_MODEL_BOOST_VALUE,
CONSUMER_TIER_BASE_PERCEIVED_VALUE,
PERCEIVED_VALUE_REPUTATION_RANGE,
} from '@ai-tycoon/shared';
} from '@token-empire/shared';
export interface ParticipantProfile {
id: string;
@@ -1,4 +1,4 @@
import type { GameState } from '@ai-tycoon/shared';
import type { GameState } from '@token-empire/shared';
import { processMarketV2 } from './market/index';
import type { ResearchBonuses } from './researchBonuses';
@@ -10,7 +10,7 @@ import { processModels } from './modelSystem';
import {
POINT_RELEASE_CAPABILITY_GAIN,
VRAM_REQUIREMENTS_BY_GENERATION,
} from '@ai-tycoon/shared';
} from '@token-empire/shared';
import type { ResearchBonuses } from './researchBonuses';
const rng = createSeededRNG(42);
@@ -2,7 +2,7 @@ import type {
GameState, ModelsState, BaseModel, ModelCapabilities, SafetyProfile,
TrainingPipeline, TrainingEvent, TrainingEventType,
ModelVariant, VariantCreationJob,
} from '@ai-tycoon/shared';
} from '@token-empire/shared';
import {
uuid, VRAM_REQUIREMENTS_BY_GENERATION,
MOE_CAPABILITY_MULTIPLIER, MOE_SPEED_MULTIPLIER,
@@ -17,7 +17,7 @@ import {
POINT_RELEASE_CAPABILITY_GAIN,
SIZE_TIER_LABELS,
MODEL_BASE_SAFETY,
} from '@ai-tycoon/shared';
} from '@token-empire/shared';
import type { ResearchBonuses } from './researchBonuses';
export interface ModelTickResult {
@@ -6,7 +6,7 @@ import {
LOW_SAFETY_THRESHOLD,
SAFETY_RECORD_RECOVERY_RATE,
SAFETY_INCIDENT_REPUTATION_HIT,
} from '@ai-tycoon/shared';
} from '@token-empire/shared';
const rng = createSeededRNG(42);
beforeEach(() => rng.install());
@@ -1,4 +1,4 @@
import type { GameState, ReputationState } from '@ai-tycoon/shared';
import type { GameState, ReputationState } from '@token-empire/shared';
import {
MAX_REPUTATION_HISTORY,
SAFETY_INCIDENT_PROBABILITY_BASE,
@@ -6,7 +6,7 @@ import {
LOW_SAFETY_THRESHOLD,
SAFETY_RECORD_RECOVERY_RATE,
PUBLIC_PERCEPTION_GROWTH_RATE,
} from '@ai-tycoon/shared';
} from '@token-empire/shared';
import type { ResearchBonuses } from './researchBonuses';
export interface ReputationTickResult {
@@ -1,4 +1,4 @@
import type { GameState, ResearchState, ActiveResearch, ComputeState } from '@ai-tycoon/shared';
import type { GameState, ResearchState, ActiveResearch, ComputeState } from '@token-empire/shared';
import { TECH_TREE } from '../data/techTree';
export interface ResearchTickResult {
@@ -1,5 +1,5 @@
import type { GameState, TalentState } from '@ai-tycoon/shared';
import { ERA_BUDGET_COST_MULTIPLIER } from '@ai-tycoon/shared';
import type { GameState, TalentState } from '@token-empire/shared';
import { ERA_BUDGET_COST_MULTIPLIER } from '@token-empire/shared';
const SALARY_PER_HEADCOUNT_PER_TICK = 5;