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
chore: fix type annotations (#6600)
非法操作585444c50c99
diff --git a/web/app/components/app/configuration/config-var/index.tsx b/web/app/components/app/configuration/config-var/index.tsxindex a4f8b6839ff..9ef624ed97a 100644--- a/web/app/components/app/configuration/config-var/index.tsx+++ b/web/app/components/app/configuration/config-var/index.tsx@@ -96,7 +96,7 @@ const ConfigVar: FC<IConfigVarProps> = ({ promptVariables, readonly, onPromptVar...rest,type: type === InputVarType.textInput ? 'string' : type,key: variable,- name: label,+ name: label as string,}if (payload.type === InputVarType.textInput)diff --git a/web/app/components/app/configuration/prompt-mode/advanced-mode-waring.tsx b/web/app/components/app/configuration/prompt-mode/advanced-mode-waring.tsxindex 759a15213db..6fb58ba9a1c 100644--- a/web/app/components/app/configuration/prompt-mode/advanced-mode-waring.tsx+++ b/web/app/components/app/configuration/prompt-mode/advanced-mode-waring.tsx@@ -4,7 +4,6 @@ import React from 'react'import { useTranslation } from 'react-i18next'import { useContext } from 'use-context-selector'import I18n from '@/context/i18n'-import { FlipBackward } from '@/app/components/base/icons/src/vender/line/arrows'import { LanguagesSupported } from '@/i18n/language'type Props = {onReturnToSimpleMode: () => void@@ -38,7 +37,6 @@ const AdvancedModeWarning: FC<Props> = ({onClick={onReturnToSimpleMode}className='shrink-0 flex items-center h-6 px-2 bg-indigo-600 shadow-xs border border-gray-200 rounded-lg text-white text-xs font-semibold cursor-pointer space-x-1'>- <FlipBackward className='w-3 h-3 text-white' /><div className='text-xs font-semibold uppercase'>{t('appDebug.promptMode.switchBack')}</div></div><divdiff --git a/web/app/components/base/notion-page-selector/notion-page-selector-modal/index.tsx b/web/app/components/base/notion-page-selector/notion-page-selector-modal/index.tsxindex b120ef94b25..e7fba570566 100644--- a/web/app/components/base/notion-page-selector/notion-page-selector-modal/index.tsx+++ b/web/app/components/base/notion-page-selector/notion-page-selector-modal/index.tsx@@ -2,15 +2,15 @@ import { useState } from 'react'import { useTranslation } from 'react-i18next'import { XMarkIcon } from '@heroicons/react/24/outline'import NotionPageSelector from '../base'-import type { NotionPageSelectorValue } from '../base'import s from './index.module.css'+import type { NotionPage } from '@/models/common'import cn from '@/utils/classnames'import Modal from '@/app/components/base/modal'type NotionPageSelectorModalProps = {isShow: booleanonClose: () => void- onSave: (selectedPages: NotionPageSelectorValue[]) => void+ onSave: (selectedPages: NotionPage[]) => voiddatasetId: string}const NotionPageSelectorModal = ({@@ -20,12 +20,12 @@ const NotionPageSelectorModal = ({datasetId,}: NotionPageSelectorModalProps) => {const { t } = useTranslation()- const [selectedPages, setSelectedPages] = useState<NotionPageSelectorValue[]>([])+ const [selectedPages, setSelectedPages] = useState<NotionPage[]>([])const handleClose = () => {onClose()}- const handleSelectPage = (newSelectedPages: NotionPageSelectorValue[]) => {+ const handleSelectPage = (newSelectedPages: NotionPage[]) => {setSelectedPages(newSelectedPages)}const handleSave = () => {diff --git a/web/app/components/base/select/index.tsx b/web/app/components/base/select/index.tsxindex 24da8855faa..dee983690b3 100644--- a/web/app/components/base/select/index.tsx+++ b/web/app/components/base/select/index.tsx@@ -191,7 +191,7 @@ const SimpleSelect: FC<ISelectProps> = ({onClick={(e) => {e.stopPropagation()setSelectedItem(null)- onSelect({ value: null })+ onSelect({ name: '', value: '' })}}className="h-5 w-5 text-gray-400 cursor-pointer"aria-hidden="false"diff --git a/web/app/components/explore/category.tsx b/web/app/components/explore/category.tsxindex 2b6cfbd9be5..cf655c5333b 100644--- a/web/app/components/explore/category.tsx+++ b/web/app/components/explore/category.tsx@@ -28,7 +28,7 @@ const Category: FC<ICategoryProps> = ({allCategoriesEn,}) => {const { t } = useTranslation()- const isAllCategories = !list.includes(value)+ const isAllCategories = !list.includes(value as AppCategory)const itemClassName = (isSelected: boolean) => cn('flex items-center px-3 py-[7px] h-[32px] rounded-lg border-[0.5px] border-transparent text-gray-700 font-medium leading-[18px] cursor-pointer hover:bg-gray-200',diff --git a/web/app/components/header/account-setting/model-provider-page/declarations.ts b/web/app/components/header/account-setting/model-provider-page/declarations.tsindex abc81262b90..15470321637 100644--- a/web/app/components/header/account-setting/model-provider-page/declarations.ts+++ b/web/app/components/header/account-setting/model-provider-page/declarations.ts@@ -12,6 +12,7 @@ export enum FormTypeEnum {secretInput = 'secret-input',select = 'select',radio = 'radio',+ boolean = 'boolean',files = 'files',}diff --git a/web/app/components/header/dataset-nav/index.tsx b/web/app/components/header/dataset-nav/index.tsxindex f415658eeee..abf76608a80 100644--- a/web/app/components/header/dataset-nav/index.tsx+++ b/web/app/components/header/dataset-nav/index.tsx@@ -11,6 +11,7 @@ import useSWR from 'swr'import useSWRInfinite from 'swr/infinite'import { flatten } from 'lodash-es'import Nav from '../nav'+import type { NavItem } from '../nav/nav-selector'import { fetchDatasetDetail, fetchDatasets } from '@/service/datasets'import type { DataSetListResponse } from '@/models/datasets'@@ -31,7 +32,7 @@ const DatasetNav = () => {datasetId,}: null,- apiParams => fetchDatasetDetail(apiParams.datasetId))+ apiParams => fetchDatasetDetail(apiParams.datasetId as string))const { data: datasetsData, setSize } = useSWRInfinite(datasetId ? getKey : () => null, fetchDatasets, { revalidateFirstPage: false, revalidateAll: true })const datasetItems = flatten(datasetsData?.map(datasetData => datasetData.data))@@ -46,14 +47,14 @@ const DatasetNav = () => {text={t('common.menus.datasets')}activeSegment='datasets'link='/datasets'- curNav={currentDataset}+ curNav={currentDataset as Omit<NavItem, 'link'>}navs={datasetItems.map(dataset => ({id: dataset.id,name: dataset.name,link: `/datasets/${dataset.id}/documents`,icon: dataset.icon,icon_background: dataset.icon_background,- }))}+ })) as NavItem[]}createText={t('common.menus.newDataset')}onCreate={() => router.push('/datasets/create')}onLoadmore={handleLoadmore}diff --git a/web/app/components/header/nav/nav-selector/index.tsx b/web/app/components/header/nav/nav-selector/index.tsxindex 51192c6580e..26f538d72dc 100644--- a/web/app/components/header/nav/nav-selector/index.tsx+++ b/web/app/components/header/nav/nav-selector/index.tsx@@ -23,13 +23,13 @@ export type NavItem = {link: stringicon: stringicon_background: string- mode: string+ mode?: string}export type INavSelectorProps = {navs: NavItem[]curNav?: Omit<NavItem, 'link'>createText: string- isApp: boolean+ isApp?: booleanonCreate: (state: string) => voidonLoadmore?: () => void}diff --git a/web/app/components/tools/provider/card.tsx b/web/app/components/tools/provider/card.tsxindex 7f87d65e3af..6a688186cf5 100644--- a/web/app/components/tools/provider/card.tsx+++ b/web/app/components/tools/provider/card.tsx@@ -36,7 +36,7 @@ const ProviderCard = ({}, [collection.labels, labelList, language])return (- <div className={cn('group flex col-span-1 bg-white border-2 border-solid border-transparent rounded-xl shadow-sm min-h-[160px] flex flex-col transition-all duration-200 ease-in-out cursor-pointer hover:shadow-lg', active && '!border-primary-400')} onClick={onSelect}>+ <div className={cn('group col-span-1 bg-white border-2 border-solid border-transparent rounded-xl shadow-sm min-h-[160px] flex flex-col transition-all duration-200 ease-in-out cursor-pointer hover:shadow-lg', active && '!border-primary-400')} onClick={onSelect}><div className='flex pt-[14px] px-[14px] pb-3 h-[66px] items-center gap-3 grow-0 shrink-0'><div className='relative shrink-0'>{typeof collection.icon === 'string' && (diff --git a/web/app/components/tools/provider/detail.tsx b/web/app/components/tools/provider/detail.tsxindex ee02e4966d3..546b9cd9a1a 100644--- a/web/app/components/tools/provider/detail.tsx+++ b/web/app/components/tools/provider/detail.tsx@@ -85,7 +85,7 @@ const ProviderDetail = ({const [customCollection, setCustomCollection] = useState<CustomCollectionBackend | WorkflowToolProviderResponse | null>(null)const [isShowEditCollectionToolModal, setIsShowEditCustomCollectionModal] = useState(false)const [showConfirmDelete, setShowConfirmDelete] = useState(false)- const [deleteAction, setDeleteAction] = useState(null)+ const [deleteAction, setDeleteAction] = useState('')const doUpdateCustomToolCollection = async (data: CustomCollectionBackend) => {await updateCustomCollection(data)onRefreshData()diff --git a/web/app/components/tools/workflow-tool/index.tsx b/web/app/components/tools/workflow-tool/index.tsxindex 436b2c55ab3..0f9fe4c4c1a 100644--- a/web/app/components/tools/workflow-tool/index.tsx+++ b/web/app/components/tools/workflow-tool/index.tsx@@ -173,7 +173,7 @@ const WorkflowToolAsModal: FC<Props> = ({<div><div className='py-2 leading-5 text-sm font-medium text-gray-900'>{t('tools.createTool.description')}</div><textarea- className='w-full h-10 px-3 py-2 text-sm font-normal bg-gray-100 rounded-lg border border-transparent outline-none appearance-none caret-primary-600 placeholder:text-gray-400 hover:bg-gray-50 hover:border hover:border-gray-300 focus:bg-gray-50 focus:border focus:border-gray-300 focus:shadow-xs h-[80px] resize-none'+ className='w-full px-3 py-2 text-sm font-normal bg-gray-100 rounded-lg border border-transparent outline-none appearance-none caret-primary-600 placeholder:text-gray-400 hover:bg-gray-50 hover:border hover:border-gray-300 focus:bg-gray-50 focus:border focus:border-gray-300 focus:shadow-xs h-[80px] resize-none'placeholder={t('tools.createTool.descriptionPlaceholder') || ''}value={description}onChange={e => setDescription(e.target.value)}diff --git a/web/app/components/workflow/block-selector/index-bar.tsx b/web/app/components/workflow/block-selector/index-bar.tsxindex f485384969c..6eab51246d0 100644--- a/web/app/components/workflow/block-selector/index-bar.tsx+++ b/web/app/components/workflow/block-selector/index-bar.tsx@@ -1,6 +1,7 @@import { pinyin } from 'pinyin-pro'+import type { FC, RefObject } from 'react'-export const groupItems = (items, getFirstChar) => {+export const groupItems = (items: Array<any>, getFirstChar: (item: string) => string) => {const groups = items.reduce((acc, item) => {const firstChar = getFirstChar(item)if (!firstChar || firstChar.length === 0)@@ -34,9 +35,14 @@ export const groupItems = (items, getFirstChar) => {return { letters, groups }}-const IndexBar = ({ letters, itemRefs }) => {- const handleIndexClick = (letter) => {- const element = itemRefs.current[letter]+type IndexBarProps = {+ letters: string[]+ itemRefs: RefObject<{ [key: string]: HTMLElement | null }>+}++const IndexBar: FC<IndexBarProps> = ({ letters, itemRefs }) => {+ const handleIndexClick = (letter: string) => {+ const element = itemRefs.current?.[letter]if (element)element.scrollIntoView({ behavior: 'smooth' })}