mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-08-04 14:57:42 +00:00
style: sort content protection imports
This commit is contained in:
parent
c32597d608
commit
277e062ac2
12 changed files with 30 additions and 30 deletions
|
|
@ -2,9 +2,9 @@ import { z } from 'zod';
|
|||
import { logger } from '@librechat/data-schemas';
|
||||
import type { StructuredToolInterface } from '@librechat/agents/langchain/tools';
|
||||
import type { FiltersConfig } from 'librechat-data-provider';
|
||||
import { ContentFilterError } from '../middleware/contentFilter';
|
||||
import { CHECK_BACKGROUND_TASK_NAME } from './background';
|
||||
import { createToolExecuteHandler } from './handlers';
|
||||
import { ContentFilterError } from '../middleware/contentFilter';
|
||||
|
||||
interface BatchInput {
|
||||
toolCalls: Array<{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import type { AppConfig } from '@librechat/data-schemas';
|
||||
import { Constants } from 'librechat-data-provider';
|
||||
import type { AppConfig } from '@librechat/data-schemas';
|
||||
import { getResumeContentInspection } from './inspection';
|
||||
|
||||
const strictExtractedTextConfig = {
|
||||
|
|
|
|||
|
|
@ -31,9 +31,9 @@ import type {
|
|||
} from '~/types';
|
||||
import type { ResolvedManualSkill, ResolvedAlwaysApplySkill, ResolvedSkillCatalog } from './skills';
|
||||
import type { LCAvailableTools, RequestScopedMCPConnectionStore } from '../mcp/types';
|
||||
import type { TFilterFilesByAgentAccess } from './resources';
|
||||
import type { ContentTraversalLimitError } from '../protection/adapters/nested';
|
||||
import type { TextContentFragment } from '../protection/types';
|
||||
import type { TFilterFilesByAgentAccess } from './resources';
|
||||
import {
|
||||
injectSkillCatalog,
|
||||
resolveSkillCatalog,
|
||||
|
|
@ -42,6 +42,11 @@ import {
|
|||
unionPrimeAllowedTools,
|
||||
MAX_PRIMED_SKILLS_PER_TURN,
|
||||
} from './skills';
|
||||
import {
|
||||
getContentTraversalFragments,
|
||||
isContentTraversalProtected,
|
||||
isContentTraversalLimitError,
|
||||
} from '../protection/adapters/nested';
|
||||
import {
|
||||
optionalChainWithEmptyCheck,
|
||||
extractLibreChatParams,
|
||||
|
|
@ -54,11 +59,6 @@ import {
|
|||
isFileAuthoringToolDefinition,
|
||||
} from './tools';
|
||||
import { extractAgentContent, extractSkillContent } from '../protection/adapters/submissions';
|
||||
import {
|
||||
getContentTraversalFragments,
|
||||
isContentTraversalProtected,
|
||||
isContentTraversalLimitError,
|
||||
} from '../protection/adapters/nested';
|
||||
import { normalizeServerName, requiresEphemeralUserConnection } from '~/mcp/utils';
|
||||
import { assertModelBoundContent } from '../middleware/modelBoundContent';
|
||||
import { registerMemoryTools, memoryToolUsageGuard } from './memory';
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
import { hasActivePiiPatterns } from 'librechat-data-provider';
|
||||
import type { FiltersConfig, MessageFilterPiiConfig } from 'librechat-data-provider';
|
||||
import type {
|
||||
AssistantContentInput,
|
||||
StoredMessageContentInput,
|
||||
} from '../protection/adapters/submissions';
|
||||
import type { ExternalChatMessage } from '../protection/adapters/messages';
|
||||
import type {
|
||||
CanonicalFileInspectionFile,
|
||||
CanonicalFileInspectionUser,
|
||||
GetCanonicalFilesForInspection,
|
||||
} from '../protection/files';
|
||||
import { ContentTraversalLimitError } from '../protection/adapters/nested';
|
||||
import type {
|
||||
AssistantContentInput,
|
||||
StoredMessageContentInput,
|
||||
} from '../protection/adapters/submissions';
|
||||
import type { ExternalChatMessage } from '../protection/adapters/messages';
|
||||
import { hasActiveFilePolicy, resolveCanonicalFileReferences } from '../protection/files';
|
||||
import { ContentTraversalLimitError } from '../protection/adapters/nested';
|
||||
import { assertModelBoundContent } from '../middleware/modelBoundContent';
|
||||
|
||||
const PAGE_LIMIT = 100;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
import { logger } from '@librechat/data-schemas';
|
||||
import { parseDocument } from '~/files/documents/crud';
|
||||
import {
|
||||
extractCodeArtifactRawText,
|
||||
extractCodeArtifactInspectionText,
|
||||
|
|
@ -11,6 +10,7 @@ import {
|
|||
MAX_TEXT_CACHE_BYTES,
|
||||
MAX_TEXT_EXTRACT_BYTES,
|
||||
} from './extract';
|
||||
import { parseDocument } from '~/files/documents/crud';
|
||||
|
||||
jest.mock('@librechat/data-schemas', () => ({
|
||||
logger: {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import type { FiltersConfig } from 'librechat-data-provider';
|
||||
import { CODE_OUTPUT_PREFLIGHT_MAX_BYTES, preflightCodeOutputBatch } from './preflight';
|
||||
import type { CodeOutputArtifact, PrepareCodeOutputInput, PreparedCodeOutput } from './preflight';
|
||||
import { CODE_OUTPUT_PREFLIGHT_MAX_BYTES, preflightCodeOutputBatch } from './preflight';
|
||||
|
||||
const BLOCK_PATTERN = {
|
||||
id: 'private-token',
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
import { hasActivePiiPatterns } from 'librechat-data-provider';
|
||||
import type { FileFilterField, FiltersConfig } from 'librechat-data-provider';
|
||||
import { ContentFilterError } from '../../middleware/contentFilter';
|
||||
import { inspectContent } from '../../protection/runtime';
|
||||
import { extractFileContent } from '../../protection/adapters/submissions';
|
||||
import type { FileContentInput } from '../../protection/adapters/submissions';
|
||||
import {
|
||||
UninspectableFileError,
|
||||
assertHydratedFileInspectable,
|
||||
getBlockedUninspectableFileField,
|
||||
} from '../../protection/files';
|
||||
import { extractFileContent } from '../../protection/adapters/submissions';
|
||||
import { ContentFilterError } from '../../middleware/contentFilter';
|
||||
import { inspectContent } from '../../protection/runtime';
|
||||
|
||||
const GENERATED_FILE_CONTENT_FIELDS = [
|
||||
'content',
|
||||
|
|
|
|||
|
|
@ -5,12 +5,12 @@ import {
|
|||
ContentTraversalLimitError,
|
||||
getContentTraversalFragments,
|
||||
} from '../protection/adapters/nested';
|
||||
import { extractAssistantContent, extractPresetContent } from '../protection/adapters/submissions';
|
||||
import {
|
||||
contentFilterBlockResponse,
|
||||
createContentFilter,
|
||||
isContentFilterError,
|
||||
} from './contentFilter';
|
||||
import { extractAssistantContent, extractPresetContent } from '../protection/adapters/submissions';
|
||||
import { UninspectableFileError } from '../protection/files';
|
||||
|
||||
jest.mock('@librechat/data-schemas', () => ({
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { inspectContent } from '../runtime';
|
||||
import {
|
||||
ContentTraversalLimitError,
|
||||
getContentTraversalFragments,
|
||||
getContentTraversalScopes,
|
||||
} from './nested';
|
||||
import { inspectContent } from '../runtime';
|
||||
import { extractChatContent } from './chat';
|
||||
|
||||
describe('extractChatContent', () => {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import type { ContentFieldMap, ContentSource, TextContentFragment } from '../types';
|
||||
import type { ModelParameterContentInput } from './submissions';
|
||||
import { extractModelParameterContent, extractToolArgumentContent } from './submissions';
|
||||
import {
|
||||
ContentTraversalLimitError,
|
||||
getContentTraversalFragments,
|
||||
getContentTraversalScopes,
|
||||
} from './nested';
|
||||
import { extractModelParameterContent, extractToolArgumentContent } from './submissions';
|
||||
import { getReferencedQuoteEntries, mergeQuotedText } from '../../utils/quotes';
|
||||
|
||||
export interface ChatSubmissionDecision {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import type { FiltersConfig } from 'librechat-data-provider';
|
||||
import type { SerializedSharedFile } from './protection';
|
||||
import { ContentFilterError } from '../middleware/contentFilter';
|
||||
import {
|
||||
CONTENT_TRAVERSAL_MAX_NODES,
|
||||
ContentTraversalLimitError,
|
||||
} from '../protection/adapters/nested';
|
||||
import { UninspectableFileError } from '../protection/files';
|
||||
import { ContentFilterError } from '../middleware/contentFilter';
|
||||
import { assertSharedFileMetadataAllowed } from './protection';
|
||||
import { UninspectableFileError } from '../protection/files';
|
||||
|
||||
const BLOCK_PATTERN = {
|
||||
id: 'private',
|
||||
|
|
|
|||
|
|
@ -6,12 +6,6 @@ import {
|
|||
} from 'librechat-data-provider';
|
||||
import type { JsonPointer, TextContentFragment } from '../protection/types';
|
||||
import type { FileContentInput } from '../protection/adapters/submissions';
|
||||
import {
|
||||
extractFileContent,
|
||||
extractStoredMessageContent,
|
||||
} from '../protection/adapters/submissions';
|
||||
import { assertModelBoundContent } from '../middleware/modelBoundContent';
|
||||
import { ContentFilterError } from '../middleware/contentFilter';
|
||||
import {
|
||||
CONTENT_TRAVERSAL_MAX_DEPTH,
|
||||
CONTENT_TRAVERSAL_MAX_NODES,
|
||||
|
|
@ -26,6 +20,12 @@ import {
|
|||
hasActiveFilePolicy,
|
||||
UninspectableFileError,
|
||||
} from '../protection/files';
|
||||
import {
|
||||
extractFileContent,
|
||||
extractStoredMessageContent,
|
||||
} from '../protection/adapters/submissions';
|
||||
import { assertModelBoundContent } from '../middleware/modelBoundContent';
|
||||
import { ContentFilterError } from '../middleware/contentFilter';
|
||||
import { inspectContent } from '../protection/runtime';
|
||||
|
||||
export interface SerializedSharedFile extends FileContentInput {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue