fix(pricing): every tier claim now true or honest; build real priority queue
All checks were successful
Deploy to Production / deploy (push) Successful in 1m21s
All checks were successful
Deploy to Production / deploy (push) Successful in 1m21s
Audited all tiers vs code. BUILT priority build queue (both enqueue sites set BullMQ priority by plan, enterprise>team>pro>hobby). Made honest what is not built and cannot be built remotely: Custom domain -> coming soon; Team RBAC -> Audit log + RBAC coming soon; dropped Team 99.9 SLA; reworded FAQ rate-limit, cold-start sub-50ms, 30-day-retention and auto-TLS claims to reality; quota FAQ no longer promises unbuilt overage billing; JSON-LD offers aligned, Team price 149->199. Verified-true kept: server limits 1/5/25/inf and daily caps 5/40/50 enforced, faster paid Claude analysis, source export. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,15 @@
|
||||
import type { Plan } from '@bmm/llm';
|
||||
import { Queue } from 'bullmq';
|
||||
import { getRedis } from './redis.js';
|
||||
|
||||
// BullMQ priority: LOWER number = processed sooner. Paid tiers jump ahead of
|
||||
// free in the shared build queue — this is what makes the "priority build
|
||||
// queue" plan claim actually true.
|
||||
const PLAN_PRIORITY: Record<Plan, number> = { enterprise: 1, team: 2, pro: 3, hobby: 4 };
|
||||
export function buildPriority(plan: Plan): number {
|
||||
return PLAN_PRIORITY[plan] ?? 4;
|
||||
}
|
||||
|
||||
export interface BuildJobData {
|
||||
buildId: string;
|
||||
serverId: string;
|
||||
|
||||
@@ -37,7 +37,7 @@ import { encryptSecret } from '../lib/crypto.js';
|
||||
import { stopContainer } from '../lib/docker.js';
|
||||
import { SERVER_LIMITS, getOrgBilling } from '../lib/plan.js';
|
||||
import { cacheSpec, loadSpec, overwriteSpec } from '../lib/preview-cache.js';
|
||||
import { getBuildQueue } from '../lib/queue.js';
|
||||
import { buildPriority, getBuildQueue } from '../lib/queue.js';
|
||||
import { BUILD_DAILY_LIMIT, PREVIEW_DAILY_LIMIT, checkDailyLimit } from '../lib/rate-limit.js';
|
||||
import { buildChannel, getSubscriber } from '../lib/redis.js';
|
||||
import { requireAuth } from '../plugins/session.js';
|
||||
@@ -525,17 +525,21 @@ export async function serverRoutes(app: FastifyInstance): Promise<void> {
|
||||
.returning();
|
||||
if (!build) return reply.code(500).send({ error: 'build_create_failed' });
|
||||
|
||||
await getBuildQueue().add('generate', {
|
||||
buildId: build.id,
|
||||
serverId: server.id,
|
||||
orgId: user.orgId,
|
||||
prompt,
|
||||
version: 1,
|
||||
slug,
|
||||
serverName: name,
|
||||
secrets: secretValues,
|
||||
previewId,
|
||||
});
|
||||
await getBuildQueue().add(
|
||||
'generate',
|
||||
{
|
||||
buildId: build.id,
|
||||
serverId: server.id,
|
||||
orgId: user.orgId,
|
||||
prompt,
|
||||
version: 1,
|
||||
slug,
|
||||
serverName: name,
|
||||
secrets: secretValues,
|
||||
previewId,
|
||||
},
|
||||
{ priority: buildPriority(plan) },
|
||||
);
|
||||
|
||||
await audit({
|
||||
orgId: user.orgId,
|
||||
@@ -631,16 +635,20 @@ export async function serverRoutes(app: FastifyInstance): Promise<void> {
|
||||
.set({ status: 'queued', updatedAt: new Date() })
|
||||
.where(eq(mcpServers.id, server.id));
|
||||
|
||||
await getBuildQueue().add('generate', {
|
||||
buildId: build.id,
|
||||
serverId: server.id,
|
||||
orgId: user.orgId,
|
||||
prompt: parsed.data.prompt,
|
||||
version: nextVersion,
|
||||
slug: server.slug,
|
||||
serverName: server.name,
|
||||
secrets: parsed.data.secrets,
|
||||
});
|
||||
await getBuildQueue().add(
|
||||
'generate',
|
||||
{
|
||||
buildId: build.id,
|
||||
serverId: server.id,
|
||||
orgId: user.orgId,
|
||||
prompt: parsed.data.prompt,
|
||||
version: nextVersion,
|
||||
slug: server.slug,
|
||||
serverName: server.name,
|
||||
secrets: parsed.data.secrets,
|
||||
},
|
||||
{ priority: buildPriority(billing.plan) },
|
||||
);
|
||||
|
||||
await audit({
|
||||
orgId: user.orgId,
|
||||
|
||||
Reference in New Issue
Block a user