feat: 合并更新到1.11.2

This commit is contained in:
npc0-hue
2026-01-15 18:02:46 +08:00
7447 changed files with 739734 additions and 263694 deletions
+36 -17
View File
@@ -1,13 +1,14 @@
import type { AnnotationReplyConfig, ChatPromptConfig, CompletionPromptConfig, DatasetConfigs, PromptMode } from '@/models/debug'
import type { CollectionType } from '@/app/components/tools/types'
import type { LanguagesSupported } from '@/i18n-config/language'
import type { Tag } from '@/app/components/base/tag-management/constant'
import type { CollectionType } from '@/app/components/tools/types'
import type { UploadFileSetting } from '@/app/components/workflow/types'
import type { LanguagesSupported } from '@/i18n-config/language'
import type { AccessMode } from '@/models/access-control'
import type { ExternalDataTool } from '@/models/common'
import type {
RerankingModeEnum,
WeightedScoreEnum,
} from '@/models/datasets'
import type { UploadFileSetting } from '@/app/components/workflow/types'
import type { AccessMode } from '@/models/access-control'
import type { AnnotationReplyConfig, ChatPromptConfig, CompletionPromptConfig, DatasetConfigs, PromptMode } from '@/models/debug'
export enum Theme {
light = 'light',
@@ -59,8 +60,14 @@ export type VariableInput = {
/**
* App modes
*/
export const AppModes = ['advanced-chat', 'agent-chat', 'chat', 'completion', 'workflow'] as const
export type AppMode = typeof AppModes[number]
export enum AppModeEnum {
COMPLETION = 'completion',
WORKFLOW = 'workflow',
CHAT = 'chat',
ADVANCED_CHAT = 'advanced-chat',
AGENT_CHAT = 'agent-chat',
}
export const AppModes = [AppModeEnum.COMPLETION, AppModeEnum.WORKFLOW, AppModeEnum.CHAT, AppModeEnum.ADVANCED_CHAT, AppModeEnum.AGENT_CHAT] as const
/**
* Variable type
@@ -206,12 +213,12 @@ export type ModelConfig = {
suggested_questions?: string[]
pre_prompt: string
prompt_type: PromptMode
chat_prompt_config: ChatPromptConfig | {}
completion_prompt_config: CompletionPromptConfig | {}
chat_prompt_config?: ChatPromptConfig | null
completion_prompt_config?: CompletionPromptConfig | null
user_input_form: UserInputFormItem[]
dataset_query_variable?: string
more_like_this: {
enabled?: boolean
enabled: boolean
}
suggested_questions_after_answer: {
enabled: boolean
@@ -237,12 +244,20 @@ export type ModelConfig = {
strategy?: AgentStrategy
tools: ToolItem[]
}
external_data_tools?: ExternalDataTool[]
model: Model
dataset_configs: DatasetConfigs
file_upload?: {
image: VisionSettings
} & UploadFileSetting
files?: VisionFile[]
system_parameters: {
audio_file_size_limit: number
file_size_limit: number
image_file_size_limit: number
video_file_size_limit: number
workflow_file_upload_limit: number
}
created_at?: number
updated_at?: number
}
@@ -259,9 +274,10 @@ export type SiteConfig = {
title: string
/** Application Description will be shown in the Client */
description: string
/** Define the color in hex for different elements of the chatbot, such as:
/**
* Define the color in hex for different elements of the chatbot, such as:
* The header, the button , etc.
*/
*/
chat_color_theme: string
/** Invert the color of the theme set in chat_color_theme */
chat_color_theme_inverted: boolean
@@ -300,7 +316,7 @@ export type SiteConfig = {
use_icon_as_answer_icon: boolean
}
export type AppIconType = 'image' | 'emoji'
export type AppIconType = 'image' | 'emoji' | 'link'
/**
* App
@@ -313,12 +329,12 @@ export type App = {
/** Description */
description: string
/** Author Name */
author_name: string;
author_name: string
/**
* Icon Type
* @default 'emoji'
*/
*/
icon_type: AppIconType | null
/** Icon, stores file ID if icon_type is 'image' */
icon: string
@@ -330,7 +346,7 @@ export type App = {
use_icon_as_answer_icon: boolean
/** Mode */
mode: AppMode
mode: AppModeEnum
/** Enable web app */
enable_site: boolean
/** Enable web API */
@@ -360,9 +376,12 @@ export type App = {
updated_at: number
updated_by?: string
}
deleted_tools?: Array<{ id: string, tool_name: string }>
/** access control */
access_mode: AccessMode
max_active_requests?: number | null
/** whether workflow trigger has un-published draft */
has_draft_trigger?: boolean
}
export type AppSSO = {
@@ -378,7 +397,7 @@ export type AppTemplate = {
/** Description */
description: string
/** Mode */
mode: AppMode
mode: AppModeEnum
/** Model */
model_config: ModelConfig
}
+24
View File
@@ -0,0 +1,24 @@
declare module '*.svg' {
const value: any
export default value
}
declare module '*.png' {
const value: any
export default value
}
declare module '*.jpg' {
const value: any
export default value
}
declare module '*.jpeg' {
const value: any
export default value
}
declare module '*.gif' {
const value: any
export default value
}
+4
View File
@@ -0,0 +1,4 @@
export enum FlowType {
appFlow = 'appFlow',
ragPipeline = 'ragPipeline',
}
+12 -12
View File
@@ -27,9 +27,9 @@ type License = {
export type SystemFeatures = {
plugin_installation_permission: {
plugin_installation_scope: InstallationScope,
plugin_installation_scope: InstallationScope
restrict_to_marketplace_only: boolean
},
}
sso_enforced_for_signin: boolean
sso_enforced_for_signin_protocol: SSOProtocol | ''
sso_enforced_for_web: boolean
@@ -59,11 +59,6 @@ export type SystemFeatures = {
allow_email_code_login: boolean
allow_email_password_login: boolean
}
is_custom_auth2: string // extend: Customizing AUTH2
is_custom_auth2_logout: string // extend: AUTH2 logout url
ding_talk_client_id: string // Extend: DingTalk third-party login
ding_talk_corp_id: string // Extend: DingTalk sidebar login
ding_talk: boolean // Extend: switch DingTalk sidebar login
}
export const defaultSystemFeatures: SystemFeatures = {
@@ -103,19 +98,16 @@ export const defaultSystemFeatures: SystemFeatures = {
allow_email_code_login: false,
allow_email_password_login: false,
},
is_custom_auth2: '', // extend: Customizing AUTH2
ding_talk_client_id: '', // Extend: DingTalk third-party login
ding_talk_corp_id: '', // Extend: DingTalk sidebar login
ding_talk: false, // Extend: switch DingTalk sidebar login
}
export enum DatasetAttr {
DATA_API_PREFIX = 'data-api-prefix',
DATA_PUBLIC_API_PREFIX = 'data-public-api-prefix',
DATA_ADMIN_API_PREFIX = 'data-admin-api-prefix',
DATA_MARKETPLACE_API_PREFIX = 'data-marketplace-api-prefix',
DATA_MARKETPLACE_URL_PREFIX = 'data-marketplace-url-prefix',
DATA_PUBLIC_EDITION = 'data-public-edition',
DATA_PUBLIC_AMPLITUDE_API_KEY = 'data-public-amplitude-api-key',
DATA_PUBLIC_COOKIE_DOMAIN = 'data-public-cookie-domain',
DATA_PUBLIC_SUPPORT_MAIL_LOGIN = 'data-public-support-mail-login',
DATA_PUBLIC_SENTRY_DSN = 'data-public-sentry-dsn',
DATA_PUBLIC_MAINTENANCE_NOTICE = 'data-public-maintenance-notice',
@@ -132,4 +124,12 @@ export enum DatasetAttr {
DATA_PUBLIC_ENABLE_WEBSITE_JINAREADER = 'data-public-enable-website-jinareader',
DATA_PUBLIC_ENABLE_WEBSITE_FIRECRAWL = 'data-public-enable-website-firecrawl',
DATA_PUBLIC_ENABLE_WEBSITE_WATERCRAWL = 'data-public-enable-website-watercrawl',
DATA_PUBLIC_ENABLE_SINGLE_DOLLAR_LATEX = 'data-public-enable-single-dollar-latex',
NEXT_PUBLIC_ZENDESK_WIDGET_KEY = 'next-public-zendesk-widget-key',
NEXT_PUBLIC_ZENDESK_FIELD_ID_ENVIRONMENT = 'next-public-zendesk-field-id-environment',
NEXT_PUBLIC_ZENDESK_FIELD_ID_VERSION = 'next-public-zendesk-field-id-version',
NEXT_PUBLIC_ZENDESK_FIELD_ID_EMAIL = 'next-public-zendesk-field-id-email',
NEXT_PUBLIC_ZENDESK_FIELD_ID_WORKSPACE_ID = 'next-public-zendesk-field-id-workspace-id',
NEXT_PUBLIC_ZENDESK_FIELD_ID_PLAN = 'next-public-zendesk-field-id-plan',
DATA_PUBLIC_BATCH_CONCURRENCY = 'data-public-batch-concurrency',
}
+31
View File
@@ -0,0 +1,31 @@
import type { NamespaceCamelCase, Resources } from '../i18n-config/resources'
import 'i18next'
declare module 'i18next' {
// eslint-disable-next-line ts/consistent-type-definitions
interface CustomTypeOptions {
defaultNS: 'common'
resources: Resources
keySeparator: false
}
}
export type I18nKeysByPrefix<
NS extends NamespaceCamelCase,
Prefix extends string = '',
> = Prefix extends ''
? keyof Resources[NS]
: keyof Resources[NS] extends infer K
? K extends `${Prefix}${infer Rest}`
? Rest
: never
: never
export type I18nKeysWithPrefix<
NS extends NamespaceCamelCase,
Prefix extends string = '',
> = Prefix extends ''
? keyof Resources[NS]
: Extract<keyof Resources[NS], `${Prefix}${string}`>
type A = I18nKeysWithPrefix<'billing'>
+13
View File
@@ -0,0 +1,13 @@
// TypeScript type definitions for custom JSX elements
// Custom JSX elements for emoji-mart web components
import 'react'
declare module 'react' {
namespace JSX {
// eslint-disable-next-line ts/consistent-type-definitions
interface IntrinsicElements {
'em-emoji': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>
}
}
}
+36
View File
@@ -0,0 +1,36 @@
declare module 'lamejs' {
export class Mp3Encoder {
constructor(channels: number, sampleRate: number, bitRate: number)
encodeBuffer(left: Int16Array, right?: Int16Array | null): Int8Array
flush(): Int8Array
}
export class WavHeader {
static readHeader(data: DataView): {
channels: number
sampleRate: number
}
}
const lamejs: {
Mp3Encoder: typeof Mp3Encoder
WavHeader: typeof WavHeader
}
export default lamejs
}
declare module 'lamejs/src/js/MPEGMode' {
const MPEGMode: any
export default MPEGMode
}
declare module 'lamejs/src/js/Lame' {
const Lame: any
export default Lame
}
declare module 'lamejs/src/js/BitStream' {
const BitStream: any
export default BitStream
}
+4
View File
@@ -0,0 +1,4 @@
declare module '*.mdx' {
const MDXComponent: (props?: Record<string, unknown>) => JSX.Element
export default MDXComponent
}
+47
View File
@@ -0,0 +1,47 @@
import type { CredentialTypeEnum } from '@/app/components/plugins/plugin-auth'
export type DataSourceNodeProcessingResponse = {
event: 'datasource_processing'
total: number
completed: number
}
export type DataSourceNodeError = {
event: 'datasource_error'
message: string
code?: string
}
export type OnlineDriveFile = {
id: string
name: string
size: number
type: 'file' | 'folder'
}
export type OnlineDriveData = {
bucket: string
files: OnlineDriveFile[]
is_truncated: boolean
next_page_parameters: Record<string, any>
}
export type DataSourceNodeCompletedResponse = {
event: 'datasource_completed'
data: any
time_consuming: number
}
export type DataSourceNodeErrorResponse = {
event: 'datasource_error'
error: string
}
export type DataSourceCredential = {
avatar_url?: string
credential: Record<string, any>
id: string
is_default: boolean
name: string
type: CredentialTypeEnum
}
+23
View File
@@ -0,0 +1,23 @@
declare module 'react-18-input-autosize' {
import type { ChangeEvent, CSSProperties, FocusEvent, KeyboardEvent } from 'react'
export type AutosizeInputProps = {
value?: string | number
defaultValue?: string | number
onChange?: (event: ChangeEvent<HTMLInputElement>) => void
onFocus?: (event: FocusEvent<HTMLInputElement>) => void
onBlur?: (event: FocusEvent<HTMLInputElement>) => void
onKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void
placeholder?: string
className?: string
inputClassName?: string
style?: CSSProperties
inputStyle?: CSSProperties
minWidth?: number | string
maxWidth?: number | string
[key: string]: any
}
const AutosizeInput: React.FC<AutosizeInputProps>
export default AutosizeInput
}
+35 -18
View File
@@ -1,25 +1,26 @@
import type { RefObject } from 'react'
import type { Viewport } from 'reactflow'
import type { BlockEnum, CommonNodeType, ConversationVariable, Edge, EnvironmentVariable, InputVar, Node, ValueSelector, VarType, Variable } from '@/app/components/workflow/types'
import type { TransferMethod } from '@/types/app'
import type { ErrorHandleTypeEnum } from '@/app/components/workflow/nodes/_base/components/error-handle/types'
import type { BeforeRunFormProps } from '@/app/components/workflow/nodes/_base/components/before-run-form'
import type { ErrorHandleTypeEnum } from '@/app/components/workflow/nodes/_base/components/error-handle/types'
import type { SpecialResultPanelProps } from '@/app/components/workflow/run/special-result-panel'
import type { MutableRefObject } from 'react'
import type { BlockEnum, CommonNodeType, ConversationVariable, Edge, EnvironmentVariable, InputVar, Node, ValueSelector, Variable, VarType } from '@/app/components/workflow/types'
import type { RAGPipelineVariables } from '@/models/pipeline'
import type { TransferMethod } from '@/types/app'
export type AgentLogItem = {
node_execution_id: string,
id: string,
node_id: string,
parent_id?: string,
label: string,
data: object, // debug data
error?: string,
status: string,
node_execution_id: string
message_id: string
node_id: string
parent_id?: string
label: string
data: object // debug data
error?: string
status: string
metadata?: {
elapsed_time?: number
provider?: string
icon?: string
},
}
}
export type AgentLogItemWithChildren = AgentLogItem & {
@@ -37,8 +38,14 @@ export type NodeTracing = {
node_type: BlockEnum
title: string
inputs: any
inputs_truncated: boolean
process_data: any
process_data_truncated: boolean
outputs?: Record<string, any>
outputs_truncated: boolean
outputs_full_content?: {
download_url: string
}
status: string
parallel_run_id?: string
error?: string
@@ -119,10 +126,11 @@ export type FetchWorkflowDraftResponse = {
id: string
name: string
email: string
},
}
tool_published: boolean
environment_variables?: EnvironmentVariable[]
conversation_variables?: ConversationVariable[]
rag_pipeline_variables?: RAGPipelineVariables
version: string
marked_name: string
marked_comment: string
@@ -131,7 +139,7 @@ export type FetchWorkflowDraftResponse = {
export type VersionHistory = FetchWorkflowDraftResponse
export type FetchWorkflowDraftPageParams = {
appId: string
url: string
initialPage: number
limit: number
userId?: string
@@ -329,7 +337,7 @@ export type NodesDefaultConfigsResponse = {
}[]
export type ConversationVariableResponse = {
data: (ConversationVariable & { updated_at: number; created_at: number })[]
data: (ConversationVariable & { updated_at: number, created_at: number })[]
has_more: boolean
limit: number
total: number
@@ -345,12 +353,13 @@ export type WorkflowConfigResponse = {
}
export type PublishWorkflowParams = {
url: string
title: string
releaseNotes: string
}
export type UpdateWorkflowParams = {
workflowId: string
url: string
title: string
releaseNotes: string
}
@@ -363,7 +372,7 @@ export type PanelProps = {
getInputVars: (textList: string[]) => InputVar[]
toVarInputs: (variables: Variable[]) => InputVar[]
runInputData: Record<string, any>
runInputDataRef: MutableRefObject<Record<string, any>>
runInputDataRef: RefObject<Record<string, any>>
setRunInputData: (data: Record<string, any>) => void
runResult: any
}
@@ -378,6 +387,11 @@ export enum VarInInspectType {
system = 'sys',
}
export type FullContent = {
size_bytes: number
download_url: string
}
export type VarInInspect = {
id: string
type: VarInInspectType
@@ -388,6 +402,9 @@ export type VarInInspect = {
value: any
edited: boolean
visible: boolean
is_truncated: boolean
full_content: FullContent
schemaType?: string
}
export type NodeWithVar = {