🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
✨ feat(subscription): add Plus, Pro and Max personal plan ids (#21362)
YuTengjing0a917ae502a0
diff --git a/locales/en-US/subscription.json b/locales/en-US/subscription.jsonindex c89a182aea7..da59acccddd 100644--- a/locales/en-US/subscription.json+++ b/locales/en-US/subscription.json@@ -491,8 +491,11 @@"plans.plan.free.title": "Free","plans.plan.hobby.desc": "For users with their own API who pay as they go","plans.plan.hobby.title": "Hobby",+ "plans.plan.max.title": "Max",+ "plans.plan.plus.title": "Plus","plans.plan.premium.desc": "For professional users who frequently use AI","plans.plan.premium.title": "Premium",+ "plans.plan.pro.title": "Pro","plans.plan.starter.desc": "For occasional AI users","plans.plan.starter.title": "Starter","plans.plan.ultimate.desc": "For heavy users who need complex AI conversations",diff --git a/locales/zh-CN/subscription.json b/locales/zh-CN/subscription.jsonindex b5c19c219ca..45c2082492d 100644--- a/locales/zh-CN/subscription.json+++ b/locales/zh-CN/subscription.json@@ -491,8 +491,11 @@"plans.plan.free.title": "免费版","plans.plan.hobby.desc": "适合拥有自定义 API、按量付费的用户","plans.plan.hobby.title": "自助版",+ "plans.plan.max.title": "Max",+ "plans.plan.plus.title": "Plus","plans.plan.premium.desc": "适合频繁使用 AI 的专业用户","plans.plan.premium.title": "进阶版",+ "plans.plan.pro.title": "Pro","plans.plan.starter.desc": "适合偶尔使用 AI 的用户","plans.plan.starter.title": "基础版","plans.plan.ultimate.desc": "适合需要复杂 AI 对话的重度用户",diff --git a/packages/locales/src/default/subscription.ts b/packages/locales/src/default/subscription.tsindex a2a114a529a..b04f20d51e9 100644--- a/packages/locales/src/default/subscription.ts+++ b/packages/locales/src/default/subscription.ts@@ -572,8 +572,11 @@ export default {'plans.plan.free.title': 'Free','plans.plan.hobby.desc': 'For users with their own API who pay as they go','plans.plan.hobby.title': 'Hobby',+ 'plans.plan.max.title': 'Max',+ 'plans.plan.plus.title': 'Plus','plans.plan.premium.desc': 'For professional users who frequently use AI','plans.plan.premium.title': 'Premium',+ 'plans.plan.pro.title': 'Pro','plans.plan.starter.desc': 'For occasional AI users','plans.plan.starter.title': 'Starter','plans.plan.ultimate.desc': 'For heavy users who need complex AI conversations',diff --git a/packages/types/src/subscription.ts b/packages/types/src/subscription.tsindex c78805956df..3278b1a5919 100644--- a/packages/types/src/subscription.ts+++ b/packages/types/src/subscription.ts@@ -1,7 +1,15 @@export enum Plans {Free = 'free',Hobby = 'hobby',+ Max = 'max',+ Plus = 'plus',Premium = 'premium',+ /**+ * Shares its string value with the workspace `pro` tier. Personal and+ * workspace plans are stored, priced and resolved separately, so the two are+ * never compared against each other.+ */+ Pro = 'pro',Starter = 'starter',Ultimate = 'ultimate',}diff --git a/src/features/Conversation/Error/PlanLimitCard/budget.test.ts b/src/features/Conversation/Error/PlanLimitCard/budget.test.tsindex f42a8c924bf..9cde9ab9a7f 100644--- a/src/features/Conversation/Error/PlanLimitCard/budget.test.ts+++ b/src/features/Conversation/Error/PlanLimitCard/budget.test.ts@@ -24,12 +24,16 @@ describe('PlanLimitCard budget helpers', () => {expect(getNextUpgradePlan(Plans.Premium)).toBe(Plans.Ultimate);expect(getNextUpgradePlan(Plans.Ultimate)).toBeUndefined();expect(getNextUpgradePlan(Plans.Hobby)).toBeUndefined();+ expect(getNextUpgradePlan(Plans.Plus)).toBe(Plans.Pro);+ expect(getNextUpgradePlan(Plans.Pro)).toBe(Plans.Max);+ expect(getNextUpgradePlan(Plans.Max)).toBeUndefined();expect(getNextUpgradePlan(undefined)).toBeUndefined();});it('should detect known plan ids', () => {expect(isKnownPlan(Plans.Free)).toBe(true);expect(isKnownPlan(Plans.Hobby)).toBe(true);+ expect(isKnownPlan(Plans.Max)).toBe(true);expect(isKnownPlan('legacy')).toBe(false);expect(isKnownPlan(undefined)).toBe(false);});diff --git a/src/features/Conversation/Error/PlanLimitCard/budget.ts b/src/features/Conversation/Error/PlanLimitCard/budget.tsindex 11bfb22a4e6..c7687bcfff3 100644--- a/src/features/Conversation/Error/PlanLimitCard/budget.ts+++ b/src/features/Conversation/Error/PlanLimitCard/budget.ts@@ -28,7 +28,9 @@ export const isKnownPlan = (plan?: string): plan is Plans => !!plan && PLAN_VALUconst PLAN_UPGRADE_PATH: Partial<Record<Plans, Plans>> = {[Plans.Free]: Plans.Starter,+ [Plans.Plus]: Plans.Pro,[Plans.Premium]: Plans.Ultimate,+ [Plans.Pro]: Plans.Max,[Plans.Starter]: Plans.Premium,};diff --git a/src/features/Conversation/Error/PlanLimitCard/index.tsx b/src/features/Conversation/Error/PlanLimitCard/index.tsxindex 74b9d3e6008..e1c9932e3ca 100644--- a/src/features/Conversation/Error/PlanLimitCard/index.tsx+++ b/src/features/Conversation/Error/PlanLimitCard/index.tsx@@ -21,7 +21,10 @@ const CREDIT_UNIT = 1_000_000;const PLAN_TITLE_KEYS = {[Plans.Free]: 'plans.plan.free.title',[Plans.Hobby]: 'plans.plan.hobby.title',+ [Plans.Max]: 'plans.plan.max.title',+ [Plans.Plus]: 'plans.plan.plus.title',[Plans.Premium]: 'plans.plan.premium.title',+ [Plans.Pro]: 'plans.plan.pro.title',[Plans.Starter]: 'plans.plan.starter.title',[Plans.Ultimate]: 'plans.plan.ultimate.title',} as const satisfies Record<Plans, string>;diff --git a/src/features/PlanIcon/index.tsx b/src/features/PlanIcon/index.tsxindex 5e003f83725..bbaec38a437 100644--- a/src/features/PlanIcon/index.tsx+++ b/src/features/PlanIcon/index.tsx@@ -1,6 +1,6 @@import { Plans } from '@lobechat/types';import { Center, createStaticStyles, cssVar, Flexbox, Tag } from '@lobehub/ui';-import { Atom, Box, CircleSlash, Sparkle, Zap } from 'lucide-react';+import { Atom, Box, CircleSlash, Crown, Gem, Rocket, Sparkle, Zap } from 'lucide-react';import { type CSSProperties, type MouseEvent } from 'react';import { memo } from 'react';import { useTranslation } from 'react-i18next';@@ -41,7 +41,28 @@ export const themes = {color: '#FCFA6E',},},-};+ [Plans.Plus]: {+ icon: Rocket,+ theme: {+ background: 'linear-gradient(45deg, #8B5CF6, #5B21B6)',+ color: '#EDE9FE',+ },+ },+ [Plans.Pro]: {+ icon: Crown,+ theme: {+ background: 'linear-gradient(45deg, #10B981, #047857)',+ color: '#D1FAE5',+ },+ },+ [Plans.Max]: {+ icon: Gem,+ theme: {+ background: 'linear-gradient(45deg, #374151, #111827)',+ color: '#FDE68A',+ },+ },+} satisfies Record<Plans, unknown>;const styles = createStaticStyles(({ css }) => ({icon: css`