Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
refactor(web): mark Props of app/ components as read-only (#25219) (#37301)
Rohit Gahlawat9c6577804cf3
diff --git a/web/app/components/app/configuration/config-prompt/advanced-prompt-input.tsx b/web/app/components/app/configuration/config-prompt/advanced-prompt-input.tsxindex 339a6d62f6f..4ecca3c6168 100644--- a/web/app/components/app/configuration/config-prompt/advanced-prompt-input.tsx+++ b/web/app/components/app/configuration/config-prompt/advanced-prompt-input.tsx@@ -33,7 +33,7 @@ import MessageTypeSelector from './message-type-selector'import PromptEditorHeightResizeWrap from './prompt-editor-height-resize-wrap'import s from './style.module.css'-type Props = {+type Props = Readonly<{type: PromptRoleisChatMode: booleanvalue: string@@ -45,7 +45,7 @@ type Props = {isContextMissing: booleanonHideContextMissingTip: () => voidnoResize?: boolean-}+}>const AdvancedPromptInput: FC<Props> = ({type,diff --git a/web/app/components/app/configuration/config-prompt/conversation-history/edit-modal.tsx b/web/app/components/app/configuration/config-prompt/conversation-history/edit-modal.tsxindex 9738accdf75..d68a2695a51 100644--- a/web/app/components/app/configuration/config-prompt/conversation-history/edit-modal.tsx+++ b/web/app/components/app/configuration/config-prompt/conversation-history/edit-modal.tsx@@ -7,13 +7,13 @@ import * as React from 'react'import { useState } from 'react'import { useTranslation } from 'react-i18next'-type Props = {+type Props = Readonly<{isShow: booleansaveLoading: booleandata: ConversationHistoriesRoleonClose: () => voidonSave: (data: any) => void-}+}>const EditModal: FC<Props> = ({isShow,diff --git a/web/app/components/app/configuration/config-prompt/conversation-history/history-panel.tsx b/web/app/components/app/configuration/config-prompt/conversation-history/history-panel.tsxindex cc5862eced4..fd7a685e75d 100644--- a/web/app/components/app/configuration/config-prompt/conversation-history/history-panel.tsx+++ b/web/app/components/app/configuration/config-prompt/conversation-history/history-panel.tsx@@ -6,10 +6,10 @@ import Panel from '@/app/components/app/configuration/base/feature-panel'import OperationBtn from '@/app/components/app/configuration/base/operation-btn'import { MessageClockCircle } from '@/app/components/base/icons/src/vender/solid/general'-type Props = {+type Props = Readonly<{showWarning: booleanonShowEditModal: () => void-}+}>const HistoryPanel: FC<Props> = ({showWarning,diff --git a/web/app/components/app/configuration/config-prompt/message-type-selector.tsx b/web/app/components/app/configuration/config-prompt/message-type-selector.tsxindex cba5737cf8d..4dec3f4433f 100644--- a/web/app/components/app/configuration/config-prompt/message-type-selector.tsx+++ b/web/app/components/app/configuration/config-prompt/message-type-selector.tsx@@ -6,10 +6,10 @@ import * as React from 'react'import { ChevronSelectorVertical } from '@/app/components/base/icons/src/vender/line/arrows'import { PromptRole } from '@/models/debug'-type Props = {+type Props = Readonly<{value: PromptRoleonChange: (value: PromptRole) => void-}+}>const allTypes = [PromptRole.system, PromptRole.user, PromptRole.assistant]const MessageTypeSelector: FC<Props> = ({diff --git a/web/app/components/app/configuration/config-prompt/prompt-editor-height-resize-wrap.tsx b/web/app/components/app/configuration/config-prompt/prompt-editor-height-resize-wrap.tsxindex ac8029a2e7d..6c94336ca5c 100644--- a/web/app/components/app/configuration/config-prompt/prompt-editor-height-resize-wrap.tsx+++ b/web/app/components/app/configuration/config-prompt/prompt-editor-height-resize-wrap.tsx@@ -5,7 +5,7 @@ import { useDebounceFn } from 'ahooks'import * as React from 'react'import { useCallback, useEffect, useState } from 'react'-type Props = {+type Props = Readonly<{className?: stringheight: numberminHeight: number@@ -13,7 +13,7 @@ type Props = {children: React.JSX.Elementfooter?: React.JSX.ElementhideResize?: boolean-}+}>const PromptEditorHeightResizeWrap: FC<Props> = ({className,diff --git a/web/app/components/app/configuration/config-var/config-modal/field.tsx b/web/app/components/app/configuration/config-var/config-modal/field.tsxindex 6ed837812bc..83fcbc36197 100644--- a/web/app/components/app/configuration/config-var/config-modal/field.tsx+++ b/web/app/components/app/configuration/config-var/config-modal/field.tsx@@ -4,12 +4,12 @@ import { cn } from '@langgenius/dify-ui/cn'import * as React from 'react'import { useTranslation } from 'react-i18next'-type Props = {+type Props = Readonly<{className?: stringtitle: stringisOptional?: booleanchildren: React.JSX.Element-}+}>const Field: FC<Props> = ({className,diff --git a/web/app/components/app/configuration/config-var/config-modal/type-select.tsx b/web/app/components/app/configuration/config-var/config-modal/type-select.tsxindex 352b3139ff9..26d1b5c4a81 100644--- a/web/app/components/app/configuration/config-var/config-modal/type-select.tsx+++ b/web/app/components/app/configuration/config-var/config-modal/type-select.tsx@@ -20,7 +20,7 @@ export type Item = {name: string}-type Props = {+type Props = Readonly<{value: string | numberonSelect: (value: Item) => voiditems: Item[]@@ -28,7 +28,7 @@ type Props = {popupInnerClassName?: stringreadonly?: booleanhideChecked?: boolean-}+}>const TypeSelector: FC<Props> = ({value,onSelect,diff --git a/web/app/components/app/configuration/config-var/select-var-type.tsx b/web/app/components/app/configuration/config-var/select-var-type.tsxindex 92302cf0e39..015e4b1d5ee 100644--- a/web/app/components/app/configuration/config-var/select-var-type.tsx+++ b/web/app/components/app/configuration/config-var/select-var-type.tsx@@ -14,9 +14,9 @@ import { ApiConnection } from '@/app/components/base/icons/src/vender/solid/deveimport InputVarTypeIcon from '@/app/components/workflow/nodes/_base/components/input-var-type-icon'import { InputVarType } from '@/app/components/workflow/types'-type Props = {+type Props = Readonly<{onChange: (value: string) => void-}+}>type ItemProps = {text: stringdiff --git a/web/app/components/app/configuration/config/agent-setting-button.tsx b/web/app/components/app/configuration/config/agent-setting-button.tsxindex 600ed1cc622..68a3f8cef16 100644--- a/web/app/components/app/configuration/config/agent-setting-button.tsx+++ b/web/app/components/app/configuration/config/agent-setting-button.tsx@@ -8,12 +8,12 @@ import { useState } from 'react'import { useTranslation } from 'react-i18next'import AgentSetting from './agent/agent-setting'-type Props = {+type Props = Readonly<{isFunctionCall: booleanisChatModel: booleanagentConfig?: AgentConfigonAgentSettingChange: (payload: AgentConfig) => void-}+}>const AgentSettingButton: FC<Props> = ({onAgentSettingChange,diff --git a/web/app/components/app/configuration/config/agent/agent-setting/index.tsx b/web/app/components/app/configuration/config/agent/agent-setting/index.tsxindex 51f4a16a255..04f1b4b2a61 100644--- a/web/app/components/app/configuration/config/agent/agent-setting/index.tsx+++ b/web/app/components/app/configuration/config/agent/agent-setting/index.tsx@@ -14,13 +14,13 @@ import { Unblur } from '@/app/components/base/icons/src/vender/solid/education'import { DEFAULT_AGENT_PROMPT, MAX_ITERATIONS_NUM } from '@/config'import ItemPanel from './item-panel'-type Props = {+type Props = Readonly<{isChatModel: booleanpayload: AgentConfigisFunctionCall: booleanonCancel: () => voidonSave: (payload: any) => void-}+}>const maxIterationsMin = 1diff --git a/web/app/components/app/configuration/config/agent/agent-setting/item-panel.tsx b/web/app/components/app/configuration/config/agent/agent-setting/item-panel.tsxindex 1fc67ab6613..b860a8fd86e 100644--- a/web/app/components/app/configuration/config/agent/agent-setting/item-panel.tsx+++ b/web/app/components/app/configuration/config/agent/agent-setting/item-panel.tsx@@ -4,13 +4,13 @@ import { cn } from '@langgenius/dify-ui/cn'import * as React from 'react'import { Infotip } from '@/app/components/base/infotip'-type Props = {+type Props = Readonly<{className?: stringicon: React.JSX.Elementname: stringdescription: stringchildren: React.JSX.Element-}+}>const ItemPanel: FC<Props> = ({className,diff --git a/web/app/components/app/configuration/config/agent/agent-tools/setting-built-in-tool.tsx b/web/app/components/app/configuration/config/agent/agent-tools/setting-built-in-tool.tsxindex f6c74eee325..ccfbd3be14b 100644--- a/web/app/components/app/configuration/config/agent/agent-tools/setting-built-in-tool.tsx+++ b/web/app/components/app/configuration/config/agent/agent-tools/setting-built-in-tool.tsx@@ -37,7 +37,7 @@ import { useLocale } from '@/context/i18n'import { getLanguage } from '@/i18n-config/language'import { fetchBuiltInToolList, fetchCustomToolList, fetchModelToolList, fetchWorkflowToolList } from '@/service/tools'-type Props = {+type Props = Readonly<{showBackButton?: booleancollection: Collection | ToolWithProviderisBuiltIn?: boolean@@ -49,7 +49,7 @@ type Props = {onSave?: (value: Record<string, any>) => voidcredentialId?: stringonAuthorizationItemClick?: (id: string) => void-}+}>const SettingBuiltInTool: FC<Props> = ({showBackButton = false,diff --git a/web/app/components/app/configuration/config/assistant-type-picker/index.tsx b/web/app/components/app/configuration/config/assistant-type-picker/index.tsxindex 89f02efe6cb..1ab4074950e 100644--- a/web/app/components/app/configuration/config/assistant-type-picker/index.tsx+++ b/web/app/components/app/configuration/config/assistant-type-picker/index.tsx@@ -21,7 +21,7 @@ import { CuteRobot } from '@/app/components/base/icons/src/vender/solid/communicimport { BubbleText } from '@/app/components/base/icons/src/vender/solid/education'import AgentSetting from '../agent/agent-setting'-type Props = {+type Props = Readonly<{value: stringdisabled: booleanonChange: (value: string) => void@@ -29,7 +29,7 @@ type Props = {isChatModel: booleanagentConfig?: AgentConfigonAgentSettingChange: (payload: AgentConfig) => void-}+}>type ItemProps = {text: stringdiff --git a/web/app/components/app/configuration/config/automatic/idea-output.tsx b/web/app/components/app/configuration/config/automatic/idea-output.tsxindex 32844975fd2..9725becd8a4 100644--- a/web/app/components/app/configuration/config/automatic/idea-output.tsx+++ b/web/app/components/app/configuration/config/automatic/idea-output.tsx@@ -9,10 +9,10 @@ import { ArrowDownRoundFill } from '@/app/components/base/icons/src/vender/solidconst i18nPrefix = 'generate'-type Props = {+type Props = Readonly<{value: stringonChange: (value: string) => void-}+}>const IdeaOutput: FC<Props> = ({value,diff --git a/web/app/components/app/configuration/config/automatic/instruction-editor-in-workflow.tsx b/web/app/components/app/configuration/config/automatic/instruction-editor-in-workflow.tsxindex 31a96c58187..92012ea8d3e 100644--- a/web/app/components/app/configuration/config/automatic/instruction-editor-in-workflow.tsx+++ b/web/app/components/app/configuration/config/automatic/instruction-editor-in-workflow.tsx@@ -10,14 +10,14 @@ import { useWorkflowStore } from '@/app/components/workflow/store'import { VarType } from '@/app/components/workflow/types'import InstructionEditor from './instruction-editor'-type Props = {+type Props = Readonly<{nodeId: stringvalue: stringeditorKey: stringonChange: (text: string) => voidgeneratorType: GeneratorTypeisShowCurrentBlock: boolean-}+}>const InstructionEditorInWorkflow: FC<Props> = ({nodeId,diff --git a/web/app/components/app/configuration/config/automatic/instruction-editor.tsx b/web/app/components/app/configuration/config/automatic/instruction-editor.tsxindex 18169f39ad3..5be69cc25c4 100644--- a/web/app/components/app/configuration/config/automatic/instruction-editor.tsx+++ b/web/app/components/app/configuration/config/automatic/instruction-editor.tsx@@ -12,7 +12,7 @@ import { Type } from '@/app/components/workflow/nodes/llm/types'import { BlockEnum } from '@/app/components/workflow/types'import { useEventEmitterContextContext } from '@/context/event-emitter'-type Props = {+type Props = Readonly<{editorKey: stringvalue: stringonChange: (text: string) => void@@ -25,7 +25,7 @@ type Props = {}) => TypeisShowCurrentBlock: booleanisShowLastRunBlock: boolean-}+}>const i18nPrefix = 'generate'diff --git a/web/app/components/app/configuration/config/automatic/prompt-res-in-workflow.tsx b/web/app/components/app/configuration/config/automatic/prompt-res-in-workflow.tsxindex 23399261d6d..58a05677e00 100644--- a/web/app/components/app/configuration/config/automatic/prompt-res-in-workflow.tsx+++ b/web/app/components/app/configuration/config/automatic/prompt-res-in-workflow.tsx@@ -7,10 +7,10 @@ import { Type } from '@/app/components/workflow/nodes/llm/types'import { BlockEnum } from '@/app/components/workflow/types'import PromptRes from './prompt-res'-type Props = {+type Props = Readonly<{value: stringnodeId: string-}+}>const PromptResInWorkflow: FC<Props> = ({value,diff --git a/web/app/components/app/configuration/config/automatic/prompt-res.tsx b/web/app/components/app/configuration/config/automatic/prompt-res.tsxindex ced438a18aa..cdf5ad9b138 100644--- a/web/app/components/app/configuration/config/automatic/prompt-res.tsx+++ b/web/app/components/app/configuration/config/automatic/prompt-res.tsx@@ -5,10 +5,10 @@ import * as React from 'react'import { useEffect } from 'react'import PromptEditor from '@/app/components/base/prompt-editor'-type Props = {+type Props = Readonly<{value: stringworkflowVariableBlock: WorkflowVariableBlockType-}+}>const keyIdPrefix = 'prompt-res-editor'const PromptRes: FC<Props> = ({diff --git a/web/app/components/app/configuration/config/automatic/prompt-toast.tsx b/web/app/components/app/configuration/config/automatic/prompt-toast.tsxindex 8a17e6b0ce2..1a45a291cc3 100644--- a/web/app/components/app/configuration/config/automatic/prompt-toast.tsx+++ b/web/app/components/app/configuration/config/automatic/prompt-toast.tsx@@ -6,10 +6,10 @@ import { useTranslation } from 'react-i18next'import { Markdown } from '@/app/components/base/markdown'import s from './style.module.css'-type Props = {+type Props = Readonly<{message: stringclassName?: string-}+}>const PromptToast = ({message,className,diff --git a/web/app/components/app/configuration/config/automatic/result.tsx b/web/app/components/app/configuration/config/automatic/result.tsxindex 98d0d1390c4..c0cfcf4ab1d 100644--- a/web/app/components/app/configuration/config/automatic/result.tsx+++ b/web/app/components/app/configuration/config/automatic/result.tsx@@ -14,7 +14,7 @@ import PromptToast from './prompt-toast'import { GeneratorType } from './types'import VersionSelector from './version-selector'-type Props = {+type Props = Readonly<{isBasicMode?: booleannodeId?: stringcurrent: GenRes@@ -23,7 +23,7 @@ type Props = {versions: GenRes[]onApply: () => voidgeneratorType: GeneratorType-}+}>const Result: FC<Props> = ({isBasicMode,diff --git a/web/app/components/app/configuration/dataset-config/context-var/var-picker.tsx b/web/app/components/app/configuration/dataset-config/context-var/var-picker.tsxindex ba1d35bc87f..0bbde5af371 100644--- a/web/app/components/app/configuration/dataset-config/context-var/var-picker.tsx+++ b/web/app/components/app/configuration/dataset-config/context-var/var-picker.tsx@@ -14,14 +14,14 @@ import { useTranslation } from 'react-i18next'import IconTypeIcon from '@/app/components/app/configuration/config-var/input-type-icon'type Option = { name: string, value: string, type: string }-export type Props = {+export type Props = Readonly<{triggerClassName?: stringclassName?: stringvalue: string | undefinedoptions: Option[]onChange: (value: string) => voidnotSelectedVarTip?: string | null-}+}>const VarItem: FC<{ item: Option }> = ({ item }) => (<div className="flex h-[18px] items-center space-x-1 rounded-sm bg-[#EFF8FF] px-1">diff --git a/web/app/components/app/configuration/dataset-config/index.tsx b/web/app/components/app/configuration/dataset-config/index.tsxindex a89725419e1..6ea2a638396 100644--- a/web/app/components/app/configuration/dataset-config/index.tsx+++ b/web/app/components/app/configuration/dataset-config/index.tsx@@ -39,10 +39,10 @@ import CardItem from './card-item'import ContextVar from './context-var'import ParamsConfig from './params-config'-type Props = {+type Props = Readonly<{readonly?: booleanhideMetadataFilter?: boolean-}+}>const DatasetConfig: FC<Props> = ({ readonly, hideMetadataFilter }) => {const { t } = useTranslation()const userProfile = useAppContextSelector(s => s.userProfile)diff --git a/web/app/components/app/configuration/dataset-config/params-config/config-content.tsx b/web/app/components/app/configuration/dataset-config/params-config/config-content.tsxindex 5702776d602..0d0a56e5845 100644--- a/web/app/components/app/configuration/dataset-config/params-config/config-content.tsx+++ b/web/app/components/app/configuration/dataset-config/params-config/config-content.tsx@@ -27,7 +27,7 @@ import { RerankingModeEnum } from '@/models/datasets'import { RETRIEVE_TYPE } from '@/types/app'import WeightedScore from './weighted-score'-type Props = {+type Props = Readonly<{datasetConfigs: DatasetConfigsonChange: (configs: DatasetConfigs, isRetrievalModeChange?: boolean) => voidselectedDatasets?: DataSet[]@@ -35,7 +35,7 @@ type Props = {singleRetrievalModelConfig?: ModelConfigonSingleRetrievalModelChange?: ModelParameterModalProps['setModel']onSingleRetrievalModelParamsChange?: ModelParameterModalProps['onCompletionParamsChange']-}+}>const noopModelChange: ModelParameterModalProps['setModel'] = () => {}const noopParamsChange: ModelParameterModalProps['onCompletionParamsChange'] = () => {}diff --git a/web/app/components/app/configuration/debug/chat-user-input.tsx b/web/app/components/app/configuration/debug/chat-user-input.tsxindex c518bbc32dc..65322cae1b1 100644--- a/web/app/components/app/configuration/debug/chat-user-input.tsx+++ b/web/app/components/app/configuration/debug/chat-user-input.tsx@@ -10,9 +10,9 @@ import Input from '@/app/components/base/input'import BoolInput from '@/app/components/workflow/nodes/_base/components/before-run-form/bool-input'import ConfigContext from '@/context/debug-configuration'-type Props = {+type Props = Readonly<{inputs: Inputs-}+}>const ChatUserInput = ({inputs,diff --git a/web/app/components/app/create-from-dsl-modal/uploader.tsx b/web/app/components/app/create-from-dsl-modal/uploader.tsxindex 0d25fb2f58c..4cde6d522ca 100644--- a/web/app/components/app/create-from-dsl-modal/uploader.tsx+++ b/web/app/components/app/create-from-dsl-modal/uploader.tsx@@ -13,13 +13,13 @@ import ActionButton from '@/app/components/base/action-button'import { Yaml as YamlIcon } from '@/app/components/base/icons/src/public/files'import { formatFileSize } from '@/utils/format'-type Props = {+type Props = Readonly<{file: File | undefinedupdateFile: (file?: File) => voidclassName?: stringaccept?: stringdisplayName?: string-}+}>const Uploader: FC<Props> = ({file,diff --git a/web/app/components/app/log-annotation/index.tsx b/web/app/components/app/log-annotation/index.tsxindex 857b306f105..be0de309024 100644--- a/web/app/components/app/log-annotation/index.tsx+++ b/web/app/components/app/log-annotation/index.tsx@@ -14,9 +14,9 @@ import TabSlider from '@/app/components/base/tab-slider-plain'import { useRouter } from '@/next/navigation'import { AppModeEnum } from '@/types/app'-type Props = {+type Props = Readonly<{pageType: PageType-}+}>const LogAnnotation: FC<Props> = ({pageType,diff --git a/web/app/components/app/log/model-info.tsx b/web/app/components/app/log/model-info.tsxindex 0344c706b30..ce1f27a3153 100644--- a/web/app/components/app/log/model-info.tsx+++ b/web/app/components/app/log/model-info.tsx@@ -20,9 +20,9 @@ const PARAM_MAP = {frequency_penalty: 'Frequency Penalty',}-type Props = {+type Props = Readonly<{model: any-}+}>const ModelInfo: FC<Props> = ({model,diff --git a/web/app/components/app/log/var-panel.tsx b/web/app/components/app/log/var-panel.tsxindex 3c70775dbab..d68ae5774a1 100644--- a/web/app/components/app/log/var-panel.tsx+++ b/web/app/components/app/log/var-panel.tsx@@ -12,10 +12,10 @@ import { useTranslation } from 'react-i18next'import { Variable02 } from '@/app/components/base/icons/src/vender/solid/development'import ImagePreview from '@/app/components/base/image-uploader/image-preview'-type Props = {+type Props = Readonly<{varList: { label: string, value: string }[]message_files: string[]-}+}>const VarPanel: FC<Props> = ({varList,diff --git a/web/app/components/app/overview/embedded/index.tsx b/web/app/components/app/overview/embedded/index.tsxindex b68096b1c50..70b90c3cc04 100644--- a/web/app/components/app/overview/embedded/index.tsx+++ b/web/app/components/app/overview/embedded/index.tsx@@ -27,7 +27,7 @@ import {import WorkflowHiddenInputFields from '../workflow-hidden-input-fields'import style from './style.module.css'-type Props = {+type Props = Readonly<{siteInfo?: SiteInfoisShow: booleanonClose: () => void@@ -35,7 +35,7 @@ type Props = {appBaseUrl?: stringhiddenInputs?: WorkflowHiddenStartVariable[]className?: string-}+}>const OPTION_KEYS = ['iframe', 'scripts', 'chromePlugin'] as constconst prefixEmbedded = 'overview.appInfo.embedded'