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 base/ components as read-only (#25219) (#37161)
Evan629145202019
diff --git a/web/app/components/base/agent-log-modal/detail.tsx b/web/app/components/base/agent-log-modal/detail.tsxindex e3f638769cb..fc3f491cedd 100644--- a/web/app/components/base/agent-log-modal/detail.tsx+++ b/web/app/components/base/agent-log-modal/detail.tsx@@ -15,12 +15,12 @@ import { fetchAgentLogDetail } from '@/service/log'import ResultPanel from './result'import TracingPanel from './tracing'-type AgentLogDetailProps = {+type AgentLogDetailProps = Readonly<{activeTab?: 'DETAIL' | 'TRACING'conversationID: stringlog: IChatItemmessageID: string-}+}>const AgentLogDetail: FC<AgentLogDetailProps> = ({ activeTab = 'DETAIL', conversationID, messageID, log }) => {const { t } = useTranslation()const [currentTab, setCurrentTab] = useState<string>(activeTab)diff --git a/web/app/components/base/agent-log-modal/index.tsx b/web/app/components/base/agent-log-modal/index.tsxindex abcba5b530e..42c0250f8a9 100644--- a/web/app/components/base/agent-log-modal/index.tsx+++ b/web/app/components/base/agent-log-modal/index.tsx@@ -7,11 +7,11 @@ import { useEffect, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import AgentLogDetail from './detail'-type AgentLogModalProps = {+type AgentLogModalProps = Readonly<{currentLogItem?: IChatItemwidth: numberonCancel: () => void-}+}>const AgentLogModal: FC<AgentLogModalProps> = ({currentLogItem,width,diff --git a/web/app/components/base/agent-log-modal/iteration.tsx b/web/app/components/base/agent-log-modal/iteration.tsxindex ebfb863f6f3..3f8f8cca727 100644--- a/web/app/components/base/agent-log-modal/iteration.tsx+++ b/web/app/components/base/agent-log-modal/iteration.tsx@@ -6,11 +6,11 @@ import { useTranslation } from 'react-i18next'import Divider from '@/app/components/base/divider'import ToolCall from './tool-call'-type Props = {+type Props = Readonly<{isFinal: booleanindex: numberiterationInfo: AgentIteration-}+}>const Iteration: FC<Props> = ({ iterationInfo, isFinal, index }) => {const { t } = useTranslation()diff --git a/web/app/components/base/agent-log-modal/result.tsx b/web/app/components/base/agent-log-modal/result.tsxindex 6266b1855bd..6eb72a0b75d 100644--- a/web/app/components/base/agent-log-modal/result.tsx+++ b/web/app/components/base/agent-log-modal/result.tsx@@ -6,7 +6,7 @@ import { CodeLanguage } from '@/app/components/workflow/nodes/code/types'import StatusPanel from '@/app/components/workflow/run/status'import useTimestamp from '@/hooks/use-timestamp'-type ResultPanelProps = {+type ResultPanelProps = Readonly<{status: stringelapsed_time?: numbertotal_tokens?: number@@ -18,7 +18,7 @@ type ResultPanelProps = {agentMode?: stringtools?: string[]iterations?: number-}+}>const ResultPanel: FC<ResultPanelProps> = ({elapsed_time,diff --git a/web/app/components/base/agent-log-modal/tool-call.tsx b/web/app/components/base/agent-log-modal/tool-call.tsxindex 29c2261a37c..d00b9790f79 100644--- a/web/app/components/base/agent-log-modal/tool-call.tsx+++ b/web/app/components/base/agent-log-modal/tool-call.tsx@@ -15,14 +15,14 @@ import { CodeLanguage } from '@/app/components/workflow/nodes/code/types'import { BlockEnum } from '@/app/components/workflow/types'import { useLocale } from '@/context/i18n'-type Props = {+type Props = Readonly<{toolCall: ToolCallisLLM: booleanisFinal?: booleantokens?: numberobservation?: anyfinalAnswer?: any-}+}>const ToolCallItem: FC<Props> = ({ toolCall, isLLM = false, isFinal, tokens, observation, finalAnswer }) => {const [collapseState, setCollapseState] = useState<boolean>(true)diff --git a/web/app/components/base/agent-log-modal/tracing.tsx b/web/app/components/base/agent-log-modal/tracing.tsxindex a3c4886182c..0edd2176940 100644--- a/web/app/components/base/agent-log-modal/tracing.tsx+++ b/web/app/components/base/agent-log-modal/tracing.tsx@@ -3,9 +3,9 @@ import type { FC } from 'react'import type { AgentIteration } from '@/models/log'import Iteration from './iteration'-type TracingPanelProps = {+type TracingPanelProps = Readonly<{list: AgentIteration[]-}+}>const TracingPanel: FC<TracingPanelProps> = ({ list }) => {return (diff --git a/web/app/components/base/audio-gallery/AudioPlayer.tsx b/web/app/components/base/audio-gallery/AudioPlayer.tsxindex c31e4aa2e8e..184f10a3b90 100644--- a/web/app/components/base/audio-gallery/AudioPlayer.tsx+++ b/web/app/components/base/audio-gallery/AudioPlayer.tsx@@ -6,10 +6,10 @@ import { useTranslation } from 'react-i18next'import useTheme from '@/hooks/use-theme'import { Theme } from '@/types/app'-type AudioPlayerProps = {+type AudioPlayerProps = Readonly<{src?: string // Keep backward compatibilitysrcs?: string[] // Support multiple sources-}+}>const AudioPlayer: React.FC<AudioPlayerProps> = ({ src, srcs }) => {const { t } = useTranslation()const [isPlaying, setIsPlaying] = useState(false)diff --git a/web/app/components/base/audio-gallery/index.tsx b/web/app/components/base/audio-gallery/index.tsxindex e5f0b7f46be..9995f81c0b4 100644--- a/web/app/components/base/audio-gallery/index.tsx+++ b/web/app/components/base/audio-gallery/index.tsx@@ -1,9 +1,9 @@import * as React from 'react'import AudioPlayer from './AudioPlayer'-type Props = {+type Props = Readonly<{srcs: string[]-}+}>const AudioGallery: React.FC<Props> = ({ srcs }) => {const validSrcs = srcs.filter(src => src)diff --git a/web/app/components/base/badge/index.tsx b/web/app/components/base/badge/index.tsxindex f2453060486..366087d3791 100644--- a/web/app/components/base/badge/index.tsx+++ b/web/app/components/base/badge/index.tsx@@ -26,14 +26,14 @@ const BadgeVariants = cva(},)-type BadgeProps = {+type BadgeProps = Readonly<{size?: 's' | 'm' | 'l'iconOnly?: booleanuppercase?: booleanstate?: BadgeStatestyleCss?: CSSPropertieschildren?: ReactNode-} & React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof BadgeVariants>+}> & React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof BadgeVariants>function getBadgeState(state: BadgeState) {switch (state) {diff --git a/web/app/components/base/carousel/index.tsx b/web/app/components/base/carousel/index.tsxindex 52486b9751a..38c3f65971f 100644--- a/web/app/components/base/carousel/index.tsx+++ b/web/app/components/base/carousel/index.tsx@@ -10,11 +10,11 @@ type UseCarouselParameters = Parameters<typeof useEmblaCarousel>type CarouselOptions = UseCarouselParameters[0]type CarouselPlugin = UseCarouselParameters[1]-type CarouselProps = {+type CarouselProps = Readonly<{opts?: CarouselOptionsplugins?: CarouselPluginorientation?: 'horizontal' | 'vertical'-}+}>type CarouselContextValue = {carouselRef: ReturnType<typeof useEmblaCarousel>[0]@@ -160,9 +160,9 @@ const CarouselItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLD)CarouselItem.displayName = 'CarouselItem'-type CarouselActionProps = {+type CarouselActionProps = Readonly<{children?: React.ReactNode-} & Omit<React.HTMLAttributes<HTMLButtonElement>, 'disabled' | 'onClick'>+}> & Omit<React.HTMLAttributes<HTMLButtonElement>, 'disabled' | 'onClick'>const CarouselPrevious = React.forwardRef<HTMLButtonElement, CarouselActionProps>(({ children, ...props }, ref) => {diff --git a/web/app/components/base/linked-apps-panel/index.tsx b/web/app/components/base/linked-apps-panel/index.tsxindex 681817061f5..579f548291f 100644--- a/web/app/components/base/linked-apps-panel/index.tsx+++ b/web/app/components/base/linked-apps-panel/index.tsx@@ -8,11 +8,11 @@ import AppIcon from '@/app/components/base/app-icon'import Link from '@/next/link'import { AppModeEnum } from '@/types/app'-type ILikedItemProps = {+type ILikedItemProps = Readonly<{appStatus?: booleandetail: RelatedAppisMobile: boolean-}+}>const appTypeMap = {[AppModeEnum.CHAT]: 'Chatbot',@@ -40,10 +40,10 @@ const LikedItem = ({)}-type Props = {+type Props = Readonly<{relatedApps: RelatedApp[]isMobile: boolean-}+}>const LinkedAppsPanel: FC<Props> = ({relatedApps,diff --git a/web/app/components/base/loading/index.tsx b/web/app/components/base/loading/index.tsxindex f66ba3511d5..97a7df6378c 100644--- a/web/app/components/base/loading/index.tsx+++ b/web/app/components/base/loading/index.tsx@@ -4,10 +4,10 @@ import { cn } from '@langgenius/dify-ui/cn'import { useTranslation } from 'react-i18next'import './style.css'-type ILoadingProps = {+type ILoadingProps = Readonly<{type?: 'area' | 'app'className?: string-}+}>const Loading = (props?: ILoadingProps) => {const { type = 'area', className } = props || {}diff --git a/web/app/components/base/new-audio-button/index.tsx b/web/app/components/base/new-audio-button/index.tsxindex c702b829bdd..e81a084aed7 100644--- a/web/app/components/base/new-audio-button/index.tsx+++ b/web/app/components/base/new-audio-button/index.tsx@@ -9,11 +9,11 @@ import ActionButton, { ActionButtonState } from '@/app/components/base/action-buimport { AudioPlayerManager } from '@/app/components/base/audio-btn/audio.player.manager'import { useParams, usePathname } from '@/next/navigation'-type AudioBtnProps = {+type AudioBtnProps = Readonly<{id?: stringvoice?: stringvalue?: string-}+}>type AudioState = 'initial' | 'loading' | 'playing' | 'paused' | 'ended'diff --git a/web/app/components/base/tab-header/index.tsx b/web/app/components/base/tab-header/index.tsxindex dd72fd964b7..ebe2350acc3 100644--- a/web/app/components/base/tab-header/index.tsx+++ b/web/app/components/base/tab-header/index.tsx@@ -12,14 +12,14 @@ type Item = {disabled?: boolean}-export type ITabHeaderProps = {+export type ITabHeaderProps = Readonly<{items: Item[]value: stringitemClassName?: stringitemWrapClassName?: stringactiveItemClassName?: stringonChange: (value: string) => void-}+}>const TabHeader: FC<ITabHeaderProps> = ({items,diff --git a/web/app/components/base/tab-slider-plain/index.tsx b/web/app/components/base/tab-slider-plain/index.tsxindex a70d8597de9..b523252dc65 100644--- a/web/app/components/base/tab-slider-plain/index.tsx+++ b/web/app/components/base/tab-slider-plain/index.tsx@@ -8,13 +8,13 @@ type Option = {text: string | React.JSX.Element}-type ItemProps = {+type ItemProps = Readonly<{className?: stringisActive: booleanonClick: (v: string) => voidoption: OptionsmallItem?: boolean-}+}>const Item: FC<ItemProps> = ({className,isActive,@@ -51,7 +51,7 @@ const Item: FC<ItemProps> = ({)}-type Props = {+type Props = Readonly<{className?: stringvalue: stringonChange: (v: string) => void@@ -59,7 +59,7 @@ type Props = {noBorderBottom?: booleansmallItem?: booleanitemClassName?: string-}+}>const TabSlider: FC<Props> = ({className,