chore: land in-progress workspace changes before 1.16.2

The tree carried uncommitted work from several areas (web push, mobile
screens, admin charts, test-hygiene cleanup, CI and map docs). It is landed
as one commit so the release pipeline can start from a clean tree; the
desktop transcript-correction behaviour shipped in the previous commit and
is unchanged here.
This commit is contained in:
Yun Chan 2026-11-05 21:58:44 +09:00
parent 9c2b6a9782
commit 7fe49c437e
144 changed files with 3760 additions and 4523 deletions

View file

@ -14,12 +14,11 @@
// Adapter: createSupabaseEmbeddingUsageStore (subscriptions + daily_usage
// via the existing service-role `increment_daily_usage` RPC).
//
// TODO(plan-catalog): the per-tier budget below belongs in
// packages/core/src/plan-catalog.ts `PLAN_QUOTA` (feature `knowledge_embedding`)
// and should be read from core-contract.generated.ts once it is added there.
// Per-tier budgets are canonical in packages/core/src/plan-catalog.ts and reach
// this runtime through the generated contract.
import type { createClient } from '@supabase/supabase-js'
import type { PlanQuotaPeriod, PlanQuotaTier } from './core-contract.generated.ts'
import { PLAN_QUOTA, type PlanQuotaPeriod, type PlanQuotaTier } from './core-contract.generated.ts'
/** daily_usage.feature key for embedding spend. */
export const EMBEDDING_QUOTA_FEATURE = 'knowledge_embedding'
@ -52,11 +51,11 @@ export interface EmbeddingQuotaPolicy {
* documents a week.
*/
export const EMBEDDING_QUOTA: Readonly<Record<PlanQuotaTier, EmbeddingQuotaPolicy>> = Object.freeze({
free: { limit: 5_000, period: 'weekly' },
pro: { limit: 50_000, period: 'daily' },
pro_plus: { limit: 150_000, period: 'daily' },
team: { limit: 300_000, period: 'daily' },
enterprise: { limit: -1, period: 'daily' },
free: PLAN_QUOTA.free.knowledge_embedding,
pro: PLAN_QUOTA.pro.knowledge_embedding,
pro_plus: PLAN_QUOTA.pro_plus.knowledge_embedding,
team: PLAN_QUOTA.team.knowledge_embedding,
enterprise: PLAN_QUOTA.enterprise.knowledge_embedding,
})
const QUOTA_TIERS: readonly PlanQuotaTier[] = ['free', 'pro', 'pro_plus', 'team', 'enterprise']