Implement BudgetService for tracking and enforcing agent usage limits: - Daily token limit tracking (default 10M tokens) - Per-agent token limit enforcement (default 2M tokens) - Maximum concurrent agent cap (default 10) - Task duration limits (default 120 minutes) - Hard/soft limit enforcement modes - Real-time usage summaries with budget status (within_budget/approaching_limit/at_limit/exceeded) - Per-agent usage breakdown with percentage calculations Includes BudgetModule for NestJS DI and 23 unit tests. Fixes #329 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
11 lines
266 B
TypeScript
11 lines
266 B
TypeScript
import { Module } from "@nestjs/common";
|
|
import { ConfigModule } from "@nestjs/config";
|
|
import { BudgetService } from "./budget.service";
|
|
|
|
@Module({
|
|
imports: [ConfigModule],
|
|
providers: [BudgetService],
|
|
exports: [BudgetService],
|
|
})
|
|
export class BudgetModule {}
|