// ╔══════════════════════════════════════════════════════════════════╗
// ║  SAEEOL 애드온 시스템                                           ║
// ║                                                                   ║
// ║  원자 단위 기능 → 애드온 → 티어별 자동 활성화                      ║
// ║                                                                   ║
// ║  LIGHT  = core + llm + lifecycle                                  ║
// ║  CODE   = LIGHT + server + tools + data + dev                     ║
// ║  MASTER = CODE + web + remote + analytics                         ║
// ╚══════════════════════════════════════════════════════════════════╝

export type Tier = "light" | "code" | "master"

export interface Addon {
  /** 애드온 ID */
  id: string
  /** 분류 */
  category: "core" | "llm" | "lifecycle" | "server" | "tools" | "data" | "web" | "remote" | "analytics" | "dev"
  /** 포함 명령어 */
  commands: (() => Promise<Record<string, any>>)[]
  /** 필요 티어 (이 티어부터 활성화) */
  minTier: Tier
  /** 필수/선택 */
  required: boolean
}

// 티어 우선순위
const tierPriority: Record<Tier, number> = { light: 0, code: 1, master: 2 }

export function tierActive(addon: Addon, tier: Tier): boolean {
  return tierPriority[tier] >= tierPriority[addon.minTier]
}
