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:
@@ -28,7 +28,6 @@ export interface InstallTarget {
|
||||
|
||||
/** Why an install attempt did not succeed (drives the caller's follow-up UI). */
|
||||
export type InstallReason =
|
||||
| 'tier' // PRO required — the adapter already dispatched waggle:tier-insufficient
|
||||
| 'security' // SecurityGate blocked / requires approval
|
||||
| 'error' // network / server / unknown failure (toast already shown)
|
||||
| 'needs-credentials' // connector needs a token the caller did not supply (card collects it / OAuth → Hub)
|
||||
@@ -72,10 +71,3 @@ export function describeError(e: unknown): string {
|
||||
return 'Server unreachable';
|
||||
}
|
||||
|
||||
/** A thrown AdapterHttpError that is a 403 tier rejection (the adapter has
|
||||
* already dispatched waggle:tier-insufficient). The connector connect path
|
||||
* throws (vs the fetchRaw install paths whose tier body is inspected inline). */
|
||||
export function isTierError(e: unknown): boolean {
|
||||
const err = e as { status?: number; body?: { error?: unknown } } | undefined;
|
||||
return err?.status === 403 && err?.body?.error === 'TIER_INSUFFICIENT';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user