@@ -5,7 +5,8 @@ import { Billing } from "@opencode-ai/console-core/billing.js"
55import { Database , eq , and , isNull , sql } from "@opencode-ai/console-core/drizzle/index.js"
66import { BillingTable , SubscriptionTable } from "@opencode-ai/console-core/schema/billing.sql.js"
77import { Actor } from "@opencode-ai/console-core/actor.js"
8- import { Subscription } from "@opencode-ai/console-core/black.js"
8+ import { Subscription } from "@opencode-ai/console-core/subscription.js"
9+ import { BlackData } from "@opencode-ai/console-core/black.js"
910import { withActor } from "~/context/auth.withActor"
1011import { queryBillingInfo } from "../../common"
1112import styles from "./black-section.module.css"
@@ -31,17 +32,19 @@ const querySubscription = query(async (workspaceID: string) => {
3132 . then ( ( r ) => r [ 0 ] ) ,
3233 )
3334 if ( ! row ?. subscription ) return null
35+ const blackData = BlackData . getLimits ( { plan : row . subscription . plan } )
3436
3537 return {
3638 plan : row . subscription . plan ,
3739 useBalance : row . subscription . useBalance ?? false ,
3840 rollingUsage : Subscription . analyzeRollingUsage ( {
39- plan : row . subscription . plan ,
41+ limit : blackData . rollingLimit ,
42+ window : blackData . rollingWindow ,
4043 usage : row . rollingUsage ?? 0 ,
4144 timeUpdated : row . timeRollingUpdated ?? new Date ( ) ,
4245 } ) ,
4346 weeklyUsage : Subscription . analyzeWeeklyUsage ( {
44- plan : row . subscription . plan ,
47+ limit : blackData . fixedLimit ,
4548 usage : row . fixedUsage ?? 0 ,
4649 timeUpdated : row . timeFixedUpdated ?? new Date ( ) ,
4750 } ) ,
0 commit comments