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

@ -29,7 +29,7 @@ enabled = true
enabled = true
port = 55323
[inbucket]
[local_smtp]
enabled = true
port = 55324
@ -130,6 +130,11 @@ verify_jwt = true
# would reject modern sb_secret_ service calls before code can authorize them.
verify_jwt = false
[functions.audio-purge]
# pg_cron invokes this worker with an exact service credential that the handler
# validates. Gateway JWT verification would reject modern sb_secret_ keys first.
verify_jwt = false
[functions.embed-chunks]
verify_jwt = true

View file

@ -40,6 +40,7 @@ export type PlanQuotaFeature =
| 'llm_sonnet'
| 'llm_opus'
| 'realtime_session'
| 'knowledge_embedding'
export type PlanQuotaPeriod = 'daily' | 'weekly'
@ -56,6 +57,7 @@ export const PLAN_QUOTA: Readonly<Record<PlanQuotaTier, Readonly<Record<PlanQuot
llm_sonnet: { limit: 0, period: 'daily' },
llm_opus: { limit: 0, period: 'daily' },
realtime_session: { limit: 0, period: 'daily' },
knowledge_embedding: { limit: 5_000, period: 'weekly' },
},
pro: {
stt_transcribe: { limit: -1, period: 'daily' },
@ -64,6 +66,7 @@ export const PLAN_QUOTA: Readonly<Record<PlanQuotaTier, Readonly<Record<PlanQuot
llm_opus: { limit: 50, period: 'daily' },
// 세션 수 기준 (~$0.016/분 mini — 세션당 평균 수 분 가정)
realtime_session: { limit: 30, period: 'daily' },
knowledge_embedding: { limit: 50_000, period: 'daily' },
},
pro_plus: {
stt_transcribe: { limit: -1, period: 'daily' },
@ -71,6 +74,7 @@ export const PLAN_QUOTA: Readonly<Record<PlanQuotaTier, Readonly<Record<PlanQuot
llm_sonnet: { limit: 1500, period: 'daily' },
llm_opus: { limit: 300, period: 'daily' },
realtime_session: { limit: 120, period: 'daily' },
knowledge_embedding: { limit: 150_000, period: 'daily' },
},
team: {
stt_transcribe: { limit: -1, period: 'daily' },
@ -78,6 +82,7 @@ export const PLAN_QUOTA: Readonly<Record<PlanQuotaTier, Readonly<Record<PlanQuot
llm_sonnet: { limit: 3000, period: 'daily' },
llm_opus: { limit: 600, period: 'daily' },
realtime_session: { limit: 300, period: 'daily' },
knowledge_embedding: { limit: 300_000, period: 'daily' },
},
enterprise: {
stt_transcribe: { limit: -1, period: 'daily' },
@ -85,6 +90,7 @@ export const PLAN_QUOTA: Readonly<Record<PlanQuotaTier, Readonly<Record<PlanQuot
llm_sonnet: { limit: -1, period: 'daily' },
llm_opus: { limit: -1, period: 'daily' },
realtime_session: { limit: -1, period: 'daily' },
knowledge_embedding: { limit: -1, period: 'daily' },
},
}

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']