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

@@ -5,7 +5,6 @@ function deps(over: Partial<InterpretDeps> & { llm: InterpretDeps['llm'] }): Int
return {
text: 'do the thing',
workspaceId: 'w1',
currentTier: 'FREE',
workspaces: [
{ id: 'w1', name: 'Acme Redesign' },
{ id: 'w2', name: 'Personal Notes' },
@@ -38,9 +37,8 @@ describe('interpretCommand — Tier 1 resolver', () => {
expect(res.action?.navigate).toEqual({ type: 'workspace', id: 'workspace:w1' });
});
it('resolves install_mcp to an action on FREE — MCP install is free/Solo (never tier_gated)', async () => {
it('resolves install_mcp to an action', async () => {
const res = await interpretCommand(deps({
currentTier: 'FREE',
text: 'install the postgres mcp server',
llm: llmReturning('{"kind":"action","actionId":"install_mcp","params":{"mcpId":"postgres"}}'),
}));
@@ -48,15 +46,6 @@ describe('interpretCommand — Tier 1 resolver', () => {
expect(res.action?.id).toBe('install_mcp');
});
it('passes the action through on a paid tier as well', async () => {
const res = await interpretCommand(deps({
currentTier: 'TEAMS',
llm: llmReturning('{"kind":"action","actionId":"install_mcp","params":{"mcpId":"postgres"}}'),
}));
expect(res.kind).toBe('action');
expect(res.action?.id).toBe('install_mcp');
});
it('returns none (never an invented action) for an out-of-registry id', async () => {
const res = await interpretCommand(deps({
llm: llmReturning('{"kind":"action","actionId":"delete_production_db","params":{}}'),

View File

@@ -2,7 +2,6 @@ import { describe, it, expect } from 'vitest';
import {
ACTION_IDS,
validateAndBuildAction,
checkTier,
buildActionCatalog,
type RegistryContext,
} from '../../src/local/command-registry.js';
@@ -90,17 +89,6 @@ describe('command-registry — closed action registry', () => {
});
});
describe('checkTier', () => {
it('never gates install_mcp — MCP install is free/Solo (PRO removed)', () => {
expect(checkTier('install_mcp', 'FREE')).toEqual({ gated: false });
expect(checkTier('install_mcp', 'TEAMS')).toEqual({ gated: false });
});
it('never gates a free/read action', () => {
expect(checkTier('open_app', 'FREE')).toEqual({ gated: false });
expect(checkTier('create_workspace', 'FREE')).toEqual({ gated: false });
});
});
it('renders a prompt catalog naming every action + nav/mcp targets', () => {
const catalog = buildActionCatalog();
for (const id of ACTION_IDS) expect(catalog).toContain(id);