mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-12 09:45:47 +00:00
* 🥢 fix: Fit MCP App Snapshots Within Message Documents
* 🥢 fix: Resolve Message Model Only at App Write Time
* 🥢 style: Sort MCP App Snapshot Persistence Imports
* 🥢 fix: Centralize MCP App Message Admission Across Writers
* 🥢 fix: Inject the App Budget Reader Without a Config Cycle
* test: Cover App Budget Initialization Across Mocked Hosts
---------
Co-authored-by: Lia <lia@librechat.ai>
(cherry picked from commit 411bb5444f)
Original-PR: https://github.com/LibreChat-AI/LibreChat/pull/16299
32 lines
840 B
JavaScript
32 lines
840 B
JavaScript
const mongoose = require('mongoose');
|
|
const { createMethods } = require('@librechat/data-schemas');
|
|
const {
|
|
matchModelName,
|
|
findMatchingPattern,
|
|
isDeploymentSkillId,
|
|
createMessageBudgetReader,
|
|
} = require('@librechat/api');
|
|
const getLogStores = require('~/cache/getLogStores');
|
|
|
|
const messageBudget = createMessageBudgetReader();
|
|
|
|
const methods = createMethods(mongoose, {
|
|
matchModelName,
|
|
findMatchingPattern,
|
|
isExternalSkillId: isDeploymentSkillId,
|
|
getCache: getLogStores,
|
|
getMCPAppMessageBudget: messageBudget.getBudget,
|
|
});
|
|
|
|
const seedDatabase = async () => {
|
|
await methods.initializeRoles();
|
|
await methods.seedDefaultRoles();
|
|
await methods.ensureDefaultCategories();
|
|
await methods.seedSystemGrants();
|
|
};
|
|
|
|
module.exports = {
|
|
...methods,
|
|
initializeMessageBudget: messageBudget.initialize,
|
|
seedDatabase,
|
|
};
|