diff --git a/api/server/routes/search.js b/api/server/routes/search.js index 2cd2fc3534..bed437d00c 100644 --- a/api/server/routes/search.js +++ b/api/server/routes/search.js @@ -20,7 +20,7 @@ router.get('/enable', async function (req, res) { const { status } = await client.health(); return res.send(status === 'available'); - } catch (error) { + } catch { return res.send(false); } }); diff --git a/api/test/__mocks__/openid-client.js b/api/test/__mocks__/openid-client.js index 766d8a305d..7148ef0dd7 100644 --- a/api/test/__mocks__/openid-client.js +++ b/api/test/__mocks__/openid-client.js @@ -19,7 +19,7 @@ module.exports = { })), }), }, - Strategy: jest.fn().mockImplementation((options, verify) => { + Strategy: jest.fn().mockImplementation(() => { // Store verify to call it if needed, or just mock the strategy behavior return { name: 'openid-mock-strategy' }; }), diff --git a/client/babel.config.cjs b/client/babel.config.cjs index 270f18f1a0..459ded7205 100644 --- a/client/babel.config.cjs +++ b/client/babel.config.cjs @@ -5,7 +5,7 @@ babel is used for frontend unit testing */ module.exports = { presets: [ - ['@babel/preset-env', { 'targets': { 'node': 'current' } }], //compiling ES2015+ syntax + ['@babel/preset-env', { targets: { node: 'current' } }], //compiling ES2015+ syntax ['@babel/preset-react', { runtime: 'automatic' }], '@babel/preset-typescript', ], @@ -21,8 +21,8 @@ module.exports = { [ 'babel-plugin-root-import', { - 'rootPathPrefix': '~/', - 'rootPathSuffix': './src', + rootPathPrefix: '~/', + rootPathSuffix: './src', }, ], ], diff --git a/client/src/components/Chat/Input/TextareaHeader.tsx b/client/src/components/Chat/Input/TextareaHeader.tsx index 00ba6e4651..41916b6bc7 100644 --- a/client/src/components/Chat/Input/TextareaHeader.tsx +++ b/client/src/components/Chat/Input/TextareaHeader.tsx @@ -14,7 +14,7 @@ export default memo(function TextareaHeader({ return null; } return ( -
+
{localize('com_ui_memory_storage_full')}
{localize(text)}
{localize('com_ui_api_key_name_required')}
{expiresAt == null ? localize('com_ui_api_key_no_expiration') : localize('com_ui_api_key_expires_on', { 0: formatDate(expiresAt) })} diff --git a/client/src/components/Nav/SettingsTabs/ApiKeys/Reveal.tsx b/client/src/components/Nav/SettingsTabs/ApiKeys/Reveal.tsx index 62347e6360..3043196add 100644 --- a/client/src/components/Nav/SettingsTabs/ApiKeys/Reveal.tsx +++ b/client/src/components/Nav/SettingsTabs/ApiKeys/Reveal.tsx @@ -17,9 +17,9 @@ export default function Reveal({ createdKey, onDone }: RevealProps) { return (
{localize('com_ui_api_key_warning')}
{localize('com_ui_agent_subagents_info')}
{localize('com_ui_agent_subagents_info_2')}
{localize('com_ui_agent_subagents_allow_self_info')}
{localize('com_ui_agent_subagents_share_files_info')}
{localize('com_ui_agent_subagents_max', { 0: maxSubagents })}
{localize('com_ui_agent_subagents_empty')}
{info}
{item.description}
{localize('com_ui_tools_no_description')}
{errors.url.message}
{skill.description}
+ {skill.body ?? ''} )} diff --git a/client/src/components/Skills/display/SkillDetailHeader.tsx b/client/src/components/Skills/display/SkillDetailHeader.tsx index 4c06132996..2d1938f125 100644 --- a/client/src/components/Skills/display/SkillDetailHeader.tsx +++ b/client/src/components/Skills/display/SkillDetailHeader.tsx @@ -33,7 +33,7 @@ const SkillDetailHeader = ({ skill, showActions = true }: SkillDetailHeaderProps - + {skill.name} {isPublic && ( @@ -42,7 +42,7 @@ const SkillDetailHeader = ({ skill, showActions = true }: SkillDetailHeaderProps side="top" render={ } @@ -54,7 +54,7 @@ const SkillDetailHeader = ({ skill, showActions = true }: SkillDetailHeaderProps side="top" render={ } @@ -62,12 +62,12 @@ const SkillDetailHeader = ({ skill, showActions = true }: SkillDetailHeaderProps )} {skill.description && ( - {skill.description} + {skill.description} )} - + {isShared && ( - + {localize('com_ui_by_author', { 0: skill.authorName })} )} diff --git a/client/src/components/Skills/forms/CategorySelector.tsx b/client/src/components/Skills/forms/CategorySelector.tsx index c0b6abebfd..e1234c68ab 100644 --- a/client/src/components/Skills/forms/CategorySelector.tsx +++ b/client/src/components/Skills/forms/CategorySelector.tsx @@ -42,7 +42,7 @@ const CategorySelector: React.FC = ({ className = '' }) = const trigger = ( (null); - const debouncedSetSelectedValues = (values: SelectedValues) => { - if (debounceTimeoutRef.current) { - clearTimeout(debounceTimeoutRef.current); - } + const debouncedSetSelectedValues = useCallback( + (values: SelectedValues) => { + if (debounceTimeoutRef.current) { + clearTimeout(debounceTimeoutRef.current); + } - debounceTimeoutRef.current = setTimeout(() => { - setSelectedValues(values); - }, 150); - }; + debounceTimeoutRef.current = setTimeout(() => { + setSelectedValues(values); + }, 150); + }, + [setSelectedValues], + ); useEffect(() => { if (!conversation?.endpoint) { @@ -126,5 +129,6 @@ export default function useSelectorEffects({ conversation?.endpoint, conversation?.agent_id, conversation?.assistant_id, + debouncedSetSelectedValues, ]); } diff --git a/client/src/utils/presets.ts b/client/src/utils/presets.ts index cf6933844b..2c9698bc7e 100644 --- a/client/src/utils/presets.ts +++ b/client/src/utils/presets.ts @@ -1,18 +1,7 @@ import type { TPreset, TPlugin } from 'librechat-data-provider'; -import { EModelEndpoint } from 'librechat-data-provider'; - -type TEndpoints = Array; export const getPresetTitle = (preset: TPreset, mention?: boolean) => { - const { - endpoint, - title: presetTitle, - model, - tools, - promptPrefix, - chatGptLabel, - modelLabel, - } = preset; + const { title: presetTitle, model, tools, promptPrefix, modelLabel } = preset; const modelInfo = model ?? ''; let title = ''; let label = ''; diff --git a/e2e/fixtures/subagent-history.test.cjs b/e2e/fixtures/subagent-history.test.cjs index d286c9afa3..523fc457d6 100644 --- a/e2e/fixtures/subagent-history.test.cjs +++ b/e2e/fixtures/subagent-history.test.cjs @@ -191,7 +191,7 @@ test('fake-model hook routes the history marker without changing ordinary replie test('browser history worker uses an isolated endpoint with enough retained output budget', async () => { const config = await fs.readFile(path.resolve(__dirname, '../config/librechat.e2e.yaml'), 'utf8'); - const endpoint = config.match(/- name: 'Mock Retained History'\n(?:(?! - name:).|\n)*/)?.[0]; + const endpoint = config.match(/- name: 'Mock Retained History'\n(?:(?! {4}- name:).|\n)*/)?.[0]; assert.ok(endpoint, 'history endpoint must remain available'); const retainedChars = Number(endpoint.match(/maxToolResultChars: (\d+)/)?.[1]); assert.ok(retainedChars > history.output('retention-budget', 0).length); diff --git a/e2e/specs/mock/scenarios/sidebar-single-scroll.spec.ts b/e2e/specs/mock/scenarios/sidebar-single-scroll.spec.ts index 008107d301..939fefdaf8 100644 --- a/e2e/specs/mock/scenarios/sidebar-single-scroll.spec.ts +++ b/e2e/specs/mock/scenarios/sidebar-single-scroll.spec.ts @@ -83,7 +83,10 @@ async function openSidebar(page: Page): Promise { await expect(historyRegion(page)).toBeVisible({ timeout: 30_000 }); const placement = async () => { const box = await historyRegion(page).boundingBox(); - return box === null ? 'unlaid' : box.x >= 0 ? 'on-screen' : 'off-screen'; + if (box === null) { + return 'unlaid'; + } + return box.x >= 0 ? 'on-screen' : 'off-screen'; }; await expect.poll(placement, { timeout: 30_000 }).not.toBe('unlaid'); for (let attempt = 0; attempt < 3 && (await placement()) === 'off-screen'; attempt++) { diff --git a/e2e/specs/mock/usage.spec.ts b/e2e/specs/mock/usage.spec.ts index c77448d237..85193e1ecb 100644 --- a/e2e/specs/mock/usage.spec.ts +++ b/e2e/specs/mock/usage.spec.ts @@ -283,8 +283,8 @@ test.describe('context usage gauge', () => { await page.setViewportSize({ width: viewport.width, height: viewport.height }); await expect .poll(() => - details.evaluate((element) => - getComputedStyle(element).gridTemplateColumns.split(' ').length, + details.evaluate( + (element) => getComputedStyle(element).gridTemplateColumns.split(' ').length, ), ) .toBe(viewport.columns); @@ -326,8 +326,8 @@ test.describe('context usage gauge', () => { await page.setViewportSize({ width: 375, height: 812 }); await expect .poll(() => - details.evaluate((element) => - getComputedStyle(element).gridTemplateColumns.split(' ').length, + details.evaluate( + (element) => getComputedStyle(element).gridTemplateColumns.split(' ').length, ), ) .toBe(1); diff --git a/packages/client/src/svgs/AssistantIcon.tsx b/packages/client/src/svgs/AssistantIcon.tsx index bd2d2bb5a7..c5d578fac1 100644 --- a/packages/client/src/svgs/AssistantIcon.tsx +++ b/packages/client/src/svgs/AssistantIcon.tsx @@ -21,7 +21,7 @@ export default function AssistantIcon({ strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" - className={cn('h-2/3 w-2/3 text-text-secondary', className)} + className={cn('text-text-secondary h-2/3 w-2/3', className)} xmlns="http://www.w3.org/2000/svg" aria-hidden="true" > diff --git a/packages/client/src/svgs/StopGeneratingIcon.tsx b/packages/client/src/svgs/StopGeneratingIcon.tsx index 22e51dfd75..237248bb83 100644 --- a/packages/client/src/svgs/StopGeneratingIcon.tsx +++ b/packages/client/src/svgs/StopGeneratingIcon.tsx @@ -14,7 +14,7 @@ export default function StopGeneratingIcon({ viewBox="0 0 24 24" strokeLinecap="round" strokeLinejoin="round" - className={cn('h-3 w-3 text-text-secondary', className)} + className={cn('text-text-secondary h-3 w-3', className)} height="1em" width="1em" xmlns="http://www.w3.org/2000/svg" diff --git a/packages/data-schemas/src/utils/tenantBulkWrite.spec.ts b/packages/data-schemas/src/utils/tenantBulkWrite.spec.ts index d2db95d448..aaed0446d6 100644 --- a/packages/data-schemas/src/utils/tenantBulkWrite.spec.ts +++ b/packages/data-schemas/src/utils/tenantBulkWrite.spec.ts @@ -1,8 +1,8 @@ import mongoose, { Schema } from 'mongoose'; import { MongoMemoryServer } from 'mongodb-memory-server'; -import { tenantStorage, runAsSystem, SYSTEM_TENANT_ID } from '~/config/tenantContext'; import { applyTenantIsolation, _resetStrictCache } from '~/models/plugins/tenantIsolation'; import { tenantSafeBulkWrite, _resetBulkWriteStrictCache } from './tenantBulkWrite'; +import { tenantStorage, runAsSystem } from '~/config/tenantContext'; let mongoServer: InstanceType; diff --git a/scripts/merge-locize-download.mjs b/scripts/merge-locize-download.mjs index b798f915aa..9e3760a1b2 100644 --- a/scripts/merge-locize-download.mjs +++ b/scripts/merge-locize-download.mjs @@ -86,4 +86,6 @@ for (const relative of await jsonFiles(baseDir)) { changedFiles += 1; } -console.log(`Preserved ${restored} repository translation value(s) across ${changedFiles} file(s).`); +console.log( + `Preserved ${restored} repository translation value(s) across ${changedFiles} file(s).`, +); diff --git a/scripts/validate-locize-download.mjs b/scripts/validate-locize-download.mjs index 10ad23bd4f..7f0559699d 100644 --- a/scripts/validate-locize-download.mjs +++ b/scripts/validate-locize-download.mjs @@ -100,7 +100,10 @@ for (const relative of baseFiles) { const englishRelative = path.join('en', 'translation.json'); if (currentSet.has(englishRelative)) { - const english = await loadJson(path.join(currentDir, englishRelative), `download/${englishRelative}`); + const english = await loadJson( + path.join(currentDir, englishRelative), + `download/${englishRelative}`, + ); if (english !== null) { const englishValues = flatten(english); for (const relative of currentFiles) {
{skill.body ?? ''}