@lobehub/chat 1.22.23 → 1.22.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -63,6 +63,13 @@
63
63
  "when": 1725366565650,
64
64
  "tag": "0008_add_rag_evals",
65
65
  "breakpoints": true
66
+ },
67
+ {
68
+ "idx": 9,
69
+ "version": "7",
70
+ "when": 1729699958471,
71
+ "tag": "0009_remove_unused_user_tables",
72
+ "breakpoints": true
66
73
  }
67
74
  ],
68
75
  "version": "6"
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable sort-keys-fix/sort-keys-fix */
2
2
  import { LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk';
3
- import { boolean, integer, jsonb, pgTable, primaryKey, text } from 'drizzle-orm/pg-core';
3
+ import { boolean, jsonb, pgTable, primaryKey, text } from 'drizzle-orm/pg-core';
4
4
 
5
5
  import { DEFAULT_PREFERENCE } from '@/const/user';
6
6
  import { CustomPluginParams } from '@/types/tool/plugin';
@@ -48,59 +48,6 @@ export const userSettings = pgTable('user_settings', {
48
48
  tool: jsonb('tool'),
49
49
  });
50
50
 
51
- export const userSubscriptions = pgTable('user_subscriptions', {
52
- id: text('id').primaryKey().notNull(),
53
- userId: text('user_id')
54
- .references(() => users.id, { onDelete: 'cascade' })
55
- .notNull(),
56
- stripeId: text('stripe_id'),
57
-
58
- currency: text('currency'),
59
- pricing: integer('pricing'),
60
- billingPaidAt: integer('billing_paid_at'),
61
- billingCycleStart: integer('billing_cycle_start'),
62
- billingCycleEnd: integer('billing_cycle_end'),
63
-
64
- cancelAtPeriodEnd: boolean('cancel_at_period_end'),
65
- cancelAt: integer('cancel_at'),
66
-
67
- nextBilling: jsonb('next_billing'),
68
-
69
- plan: text('plan'),
70
- recurring: text('recurring'),
71
-
72
- storageLimit: integer('storage_limit'),
73
-
74
- status: integer('status'),
75
- createdAt: createdAt(),
76
- updatedAt: updatedAt(),
77
- });
78
-
79
- export type NewUserSubscription = typeof userSubscriptions.$inferInsert;
80
- export type UserSubscriptionItem = typeof userSubscriptions.$inferSelect;
81
-
82
- export const userBudgets = pgTable('user_budgets', {
83
- id: text('id')
84
- .primaryKey()
85
- .references(() => users.id, { onDelete: 'cascade' })
86
- .notNull(),
87
-
88
- freeBudgetId: text('free_budget_id'),
89
- freeBudgetKey: text('free_budget_key'),
90
-
91
- subscriptionBudgetId: text('subscription_budget_id'),
92
- subscriptionBudgetKey: text('subscription_budget_key'),
93
-
94
- packageBudgetId: text('package_budget_id'),
95
- packageBudgetKey: text('package_budget_key'),
96
-
97
- createdAt: createdAt(),
98
- updatedAt: updatedAt(),
99
- });
100
-
101
- export type NewUserBudgets = typeof userBudgets.$inferInsert;
102
- export type UserBudgetItem = typeof userBudgets.$inferSelect;
103
-
104
51
  export const installedPlugins = pgTable(
105
52
  'user_installed_plugins',
106
53
  {
@@ -1,3 +1,5 @@
1
+ import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
2
+
1
3
  import AgentChat from './AgentChat';
2
4
  import AgentMeta from './AgentMeta';
3
5
  import AgentModal from './AgentModal';
@@ -10,6 +12,7 @@ import { Provider, createStore } from './store';
10
12
  type AgentSettingsProps = StoreUpdaterProps;
11
13
 
12
14
  export const AgentSettings = (props: AgentSettingsProps) => {
15
+ const { enablePlugins } = useServerConfigStore(featureFlagsSelectors);
13
16
  return (
14
17
  <Provider createStore={createStore}>
15
18
  <StoreUpdater {...props} />
@@ -18,7 +21,7 @@ export const AgentSettings = (props: AgentSettingsProps) => {
18
21
  <AgentChat />
19
22
  <AgentModal />
20
23
  <AgentTTS />
21
- <AgentPlugin />
24
+ {enablePlugins && <AgentPlugin />}
22
25
  </Provider>
23
26
  );
24
27
  };
@@ -5,6 +5,7 @@ import { useTranslation } from 'react-i18next';
5
5
 
6
6
  import { useAgentStore } from '@/store/agent';
7
7
  import { agentSelectors } from '@/store/agent/selectors';
8
+ import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
8
9
  import { useUserStore } from '@/store/user';
9
10
  import { modelProviderSelectors } from '@/store/user/selectors';
10
11
 
@@ -12,21 +13,24 @@ import DropdownMenu from './Dropdown';
12
13
 
13
14
  const Tools = memo(() => {
14
15
  const { t } = useTranslation('setting');
16
+ const { enablePlugins } = useServerConfigStore(featureFlagsSelectors);
15
17
 
16
18
  const model = useAgentStore(agentSelectors.currentAgentModel);
17
19
  const enableFC = useUserStore(modelProviderSelectors.isModelEnabledFunctionCall(model));
18
20
 
19
21
  return (
20
- <Suspense fallback={<ActionIcon icon={LucideLoader2} spin />}>
21
- <DropdownMenu>
22
- <ActionIcon
23
- disable={!enableFC}
24
- icon={Blocks}
25
- placement={'bottom'}
26
- title={t(enableFC ? 'tools.title' : 'tools.disabled')}
27
- />
28
- </DropdownMenu>
29
- </Suspense>
22
+ enablePlugins && (
23
+ <Suspense fallback={<ActionIcon icon={LucideLoader2} spin />}>
24
+ <DropdownMenu>
25
+ <ActionIcon
26
+ disable={!enableFC}
27
+ icon={Blocks}
28
+ placement={'bottom'}
29
+ title={t(enableFC ? 'tools.title' : 'tools.disabled')}
30
+ />
31
+ </DropdownMenu>
32
+ </Suspense>
33
+ )
30
34
  );
31
35
  });
32
36
 
@@ -19,6 +19,7 @@ describe('featureFlagsSelectors', () => {
19
19
  expect(result).toEqual({
20
20
  enableWebrtc: false,
21
21
  isAgentEditable: false,
22
+ enablePlugins: true,
22
23
  showCreateSession: true,
23
24
  enableRAGEval: false,
24
25
  showDalle: true,