forked from getagentseal/codeburn
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplans.ts
More file actions
63 lines (57 loc) · 1.55 KB
/
Copy pathplans.ts
File metadata and controls
63 lines (57 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import type { Plan, PlanId, PlanProvider } from './config.js'
export const PLAN_PROVIDERS: PlanProvider[] = ['all', 'claude', 'codex', 'cursor']
export const PLAN_IDS: PlanId[] = ['claude-pro', 'claude-max', 'claude-max-5x', 'cursor-pro', 'custom', 'none']
export const PRESET_PLANS: Record<'claude-pro' | 'claude-max' | 'claude-max-5x' | 'cursor-pro', Omit<Plan, 'setAt'>> = {
'claude-pro': {
id: 'claude-pro',
monthlyUsd: 20,
provider: 'claude',
resetDay: 1,
},
'claude-max': {
id: 'claude-max',
monthlyUsd: 200,
provider: 'claude',
resetDay: 1,
},
'claude-max-5x': {
id: 'claude-max-5x',
monthlyUsd: 100,
provider: 'claude',
resetDay: 1,
},
'cursor-pro': {
id: 'cursor-pro',
monthlyUsd: 20,
provider: 'cursor',
resetDay: 1,
},
}
export function isPlanProvider(value: string): value is PlanProvider {
return PLAN_PROVIDERS.includes(value as PlanProvider)
}
export function isPlanId(value: string): value is PlanId {
return PLAN_IDS.includes(value as PlanId)
}
export function getPresetPlan(id: string): Omit<Plan, 'setAt'> | null {
if (id in PRESET_PLANS) {
return PRESET_PLANS[id as keyof typeof PRESET_PLANS]
}
return null
}
export function planDisplayName(id: PlanId): string {
switch (id) {
case 'claude-pro':
return 'Claude Pro'
case 'claude-max':
return 'Claude Max 20x'
case 'claude-max-5x':
return 'Claude Max 5x'
case 'cursor-pro':
return 'Cursor Pro'
case 'custom':
return 'Custom'
case 'none':
return 'None'
}
}