mirror of
https://github.com/BigMarc/grammargem.git
synced 2026-10-13 17:01:55 +02:00
Native SwiftUI menu-bar app: global hotkey → capture selected text (AX API / clipboard fallback) → grammar (Harper) / local AI (MLX) → replace in place. Free/paid entitlement gate + Lemon Squeezy device-cap licensing, $0 marginal cost per user. Heavyweight engines behind protocol stubs so it builds out of the box. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
33 lines
1.1 KiB
Swift
33 lines
1.1 KiB
Swift
import Foundation
|
|
|
|
/// A single value object derived from license tier that every paid path checks.
|
|
/// Free is deliberately useful (full Harper grammar, system-wide) while the AI
|
|
/// superpowers + multi-device are the upgrade triggers (spec §5).
|
|
struct Entitlements: Equatable {
|
|
let tier: Tier
|
|
|
|
/// Layer-1 grammar is ALWAYS free + unlimited (the open-source core).
|
|
var unlimitedGrammar: Bool { true }
|
|
|
|
/// Layer-2 AI actions: unlimited when paid; capped per day on free.
|
|
var unlimitedAIActions: Bool { tier.isPaid }
|
|
var dailyAIActionCap: Int {
|
|
tier.isPaid ? Int.max : AppConfig.Limits.freeDailyAIActions
|
|
}
|
|
|
|
/// Writing Modes: free gets Polish only; paid gets all + custom.
|
|
var allModes: Bool { tier.isPaid }
|
|
|
|
/// Paid-only features.
|
|
var appAwareSwitching: Bool { tier.isPaid }
|
|
var snippets: Bool { tier.isPaid }
|
|
var canUseLargeModel: Bool { tier.isPaid }
|
|
|
|
/// Personal dictionary: 25 entries free, unlimited paid.
|
|
var dictionaryCap: Int {
|
|
tier.isPaid ? Int.max : AppConfig.Limits.freeDictionaryCap
|
|
}
|
|
|
|
var deviceCap: Int { tier.deviceCap }
|
|
}
|