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:
@@ -15,7 +15,6 @@ import { WaggleConfig } from '@waggle/core';
|
||||
import { allowLocalFromEnv, safeFetch } from '@waggle/agent';
|
||||
import { emitNotification } from './notifications.js';
|
||||
import { emitAuditEvent } from './events.js';
|
||||
import { requireTier } from '../../middleware/assert-tier.js';
|
||||
|
||||
// ── Local team DB ────────────────────────────────────────────────────
|
||||
|
||||
@@ -140,7 +139,7 @@ export async function teamRoutes(fastify: FastifyInstance) {
|
||||
* POST /api/team/connect
|
||||
* Connect to a team server by validating the token against the server's health endpoint.
|
||||
*/
|
||||
fastify.post('/api/team/connect', { preHandler: [requireTier('TEAMS')] }, async (request, reply) => {
|
||||
fastify.post('/api/team/connect', async (request, reply) => {
|
||||
const { serverUrl, token } = request.body as { serverUrl: string; token: string };
|
||||
|
||||
if (!serverUrl || !token) {
|
||||
@@ -454,7 +453,7 @@ export async function teamRoutes(fastify: FastifyInstance) {
|
||||
}
|
||||
|
||||
// GET /api/team/governance/permissions — get effective permissions for current user
|
||||
fastify.get('/api/team/governance/permissions', { preHandler: [requireTier('ENTERPRISE')] }, async (request, reply) => {
|
||||
fastify.get('/api/team/governance/permissions', async (request, reply) => {
|
||||
const { workspaceId } = request.query as { workspaceId?: string };
|
||||
const waggleConfig = new WaggleConfig(dataDir);
|
||||
const teamServer = waggleConfig.getTeamServer();
|
||||
|
||||
Reference in New Issue
Block a user