refactor: remove the billing tier model (P0.1)
The community edition has no monetization (ADR-0001). Remove the tier model (packages/shared/src/tiers.ts), the requireTier middleware and every tier gate, GET/PATCH /api/tier and the trial start, and the Stripe integration, which depends on the tier model. Personal features a tier used to limit are open to everyone: unlimited workspaces and connectors, every embedding provider including LiteLLM, per-workspace costs, Approvals. The workspace session cap is one constant (100). Team and enterprise surfaces are hidden instead of unlocked (team dock zone, Settings Team/Enterprise/Plan tabs, workspace Team tab); cloud sync reports unavailable, as it did for free users. The sidecar ignores the tier keys in config.json but does not delete them: both editions may still share ~/.waggle. Web billing UI is deleted: plan cards, upgrade and trial modals, payment success route, the KVARK sales block, tier 403 handling.
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
/**
|
||||
* Connector tier cap (review LOW #1, founder-requested enforcement). After the
|
||||
* Solo/Team collapse EVERY tier has an unlimited connectorLimit (-1), so
|
||||
* connectorCapExceeded never caps a real tier. These tests pin that unlimited
|
||||
* contract; re-connecting an already-connected connector (token refresh) is a
|
||||
* no-op regardless.
|
||||
*/
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { getCapabilities } from '@waggle/shared';
|
||||
import { connectorCapExceeded } from '../../src/local/routes/connectors.js';
|
||||
|
||||
describe('connectorCapExceeded', () => {
|
||||
it('FREE (Solo) is unlimited (-1) — never capped', () => {
|
||||
expect(getCapabilities('FREE').connectorLimit).toBe(-1);
|
||||
const many = Array.from({ length: 50 }, (_, i) => `c${i}`);
|
||||
expect(connectorCapExceeded('FREE', many, 'new-one')).toBeNull();
|
||||
});
|
||||
|
||||
it('FREE re-connecting an already-connected connector → allowed (token refresh)', () => {
|
||||
const many = Array.from({ length: 50 }, (_, i) => `c${i}`);
|
||||
expect(connectorCapExceeded('FREE', many, 'c0')).toBeNull();
|
||||
});
|
||||
|
||||
it('TEAMS is unlimited — never capped', () => {
|
||||
const many = Array.from({ length: 50 }, (_, i) => `c${i}`);
|
||||
expect(connectorCapExceeded('TEAMS', many, 'new-one')).toBeNull();
|
||||
});
|
||||
|
||||
it('TRIAL is unlimited — never capped', () => {
|
||||
const many = Array.from({ length: 50 }, (_, i) => `c${i}`);
|
||||
expect(connectorCapExceeded('TRIAL', many, 'new-one')).toBeNull();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user