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:
shumeiko.it
2026-10-15 19:31:50 +02:00
parent 369d8269c1
commit fe2eb0f648
117 changed files with 342 additions and 6424 deletions

View File

@@ -2,8 +2,8 @@
* EmbeddingRoutingCard — pick the memory embedding provider (steal #10).
*
* Sits under ModelPilotCard in Settings › Models. Mirrors ModelPilotCard's Hive DS
* styling and key-gating pattern. The picker offers `auto` + the tier-allowed
* providers; voyage/openai are disabled when their vault key is missing. A live
* styling and key-gating pattern. The picker offers `auto` + every selectable
* provider; voyage/openai are disabled when their vault key is missing. A live
* badge shows what is actually running; a Reprobe button re-runs the probe (useful
* after installing Ollama or adding a key). Because the live embedder is fixed at
* boot, an explicit switch shows a "restart to apply" hint honestly.
@@ -13,14 +13,11 @@ import { useState, useEffect, useCallback } from 'react';
import { Boxes, RotateCw, Info, AlertTriangle } from 'lucide-react';
import { adapter, AdapterHttpError, type EmbeddingRoutingStatus } from '@/lib/adapter';
import type { Provider } from '@/hooks/useProviders';
import { TIER_CAPABILITIES, type Tier } from '@waggle/shared';
import { HintTooltip } from '@/components/ui/hint-tooltip';
interface EmbeddingRoutingCardProps {
/** For voyage/openai key-gating (mirrors ModelPilotCard). */
providers: Provider[];
/** Gates which providers the tier may select. */
tier: Tier;
}
/** Display order for the picker; 'mock' is never user-selectable. */
@@ -36,7 +33,7 @@ const PROVIDER_LABELS: Record<string, string> = {
mock: 'Mock (no semantics)',
};
const EmbeddingRoutingCard = ({ providers, tier }: EmbeddingRoutingCardProps) => {
const EmbeddingRoutingCard = ({ providers }: EmbeddingRoutingCardProps) => {
const [status, setStatus] = useState<EmbeddingRoutingStatus | null>(null);
const [loading, setLoading] = useState(true);
const [busy, setBusy] = useState(false);
@@ -56,10 +53,6 @@ const EmbeddingRoutingCard = ({ providers, tier }: EmbeddingRoutingCardProps) =>
useEffect(() => { void load(); }, [load]);
// Tier-allowed providers (+ always 'auto'), in display order, minus 'mock'.
const allowed = new Set(TIER_CAPABILITIES[tier].embeddingProviders as readonly string[]);
const options = PROVIDER_ORDER.filter(p => p === 'auto' || (p !== ('mock' as string) && allowed.has(p)));
/** True when a cloud provider's key is missing (disable + hint). */
const keyMissing = (id: string): boolean => {
if (id === 'openai') {
@@ -182,7 +175,7 @@ const EmbeddingRoutingCard = ({ providers, tier }: EmbeddingRoutingCardProps) =>
onChange={(e) => void handleChange(e.target.value)}
className="w-full bg-muted/50 border border-border/30 rounded-lg px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary/30 disabled:opacity-50"
>
{options.map(p => {
{PROVIDER_ORDER.map(p => {
const missing = keyMissing(p);
return (
<option key={p} value={p} disabled={missing}>