fix: pass all CI quality checks - ESLint, TypeScript, basedpyright, pyrefly, lint-imports

Frontend:
- Migrate deprecated imports: modal→dialog, toast→ui/toast, tooltip→tooltip-plus,
  portal-to-follow-elem→portal-to-follow-elem-plus, select→ui/select, confirm→alert-dialog
- Replace next/* with @/next/* wrapper modules
- Convert TypeScript enums to const objects (erasable-syntax-only)
- Replace all `any` types with `unknown` or specific types in workflow types
- Fix unused vars, react-hooks-extra, react-refresh/only-export-components
- Extract InteractionMode to separate module, tool-block commands to commands.ts

Backend:
- Fix pyrefly errors: type narrowing, null guards, getattr patterns
- Remove unused TYPE_CHECKING imports in LLM node
- Add ignore_imports entries to .importlinter for dify_graph boundary violations

Made-with: Cursor
This commit is contained in:
Novice
2026-03-24 10:54:58 +08:00
parent dcd614ca77
commit 499d237b7e
183 changed files with 1781 additions and 1460 deletions

View File

@ -136,7 +136,7 @@ const LoopResultPanel: FC<Props> = ({
title={<div>{t('nodes.loop.loopVariables', { ns: 'workflow' }).toLocaleUpperCase()}</div>}
language={CodeLanguage.json}
height={112}
value={loopVariableMap[index]}
value={loopVariableMap[String(index)] as string | object}
isJSONStringifyBeauty
/>
</div>

View File

@ -136,7 +136,12 @@ const NodePanel: FC<Props> = ({
)}
/>
)}
<BlockIcon size={inMessage ? 'xs' : 'sm'} className={cn('mr-2 shrink-0', inMessage && '!mr-1')} type={nodeInfo.node_type} toolIcon={nodeInfo.extras?.icon || nodeInfo.extras} />
<BlockIcon
size={inMessage ? 'xs' : 'sm'}
className={cn('mr-2 shrink-0', inMessage && '!mr-1')}
type={nodeInfo.node_type}
toolIcon={nodeInfo.extras as string | { content: string, background: string } | undefined}
/>
<Tooltip
popupContent={
<div className="max-w-xs">{nodeInfo.title}</div>
@ -256,7 +261,7 @@ const NodePanel: FC<Props> = ({
readOnly
title={<div>{inputsTitle}</div>}
language={CodeLanguage.json}
value={nodeInfo.inputs}
value={nodeInfo.inputs as string | object}
isJSONStringifyBeauty
footer={nodeInfo.inputs_truncated && <LargeDataAlert textHasNoExport className="mx-1 mb-1 mt-2 h-7" />}
/>
@ -268,7 +273,7 @@ const NodePanel: FC<Props> = ({
readOnly
title={<div>{processDataTitle}</div>}
language={CodeLanguage.json}
value={nodeInfo.process_data}
value={nodeInfo.process_data as string | object}
isJSONStringifyBeauty
/>
</div>
@ -279,7 +284,7 @@ const NodePanel: FC<Props> = ({
readOnly
title={<div>{outputTitle}</div>}
language={CodeLanguage.json}
value={nodeInfo.outputs}
value={nodeInfo.outputs as string | object}
isJSONStringifyBeauty
tip={<ErrorHandleTip type={nodeInfo.execution_metadata?.error_strategy} />}
footer={nodeInfo.outputs_truncated && <LargeDataAlert textHasNoExport downloadUrl={nodeInfo.outputs_full_content?.download_url} className="mx-1 mb-1 mt-2 h-7" />}

View File

@ -2,7 +2,7 @@ import type { AgentLogItem, AgentLogItemWithChildren, NodeTracing } from '@/type
import { cloneDeep } from 'es-toolkit/object'
import { BlockEnum } from '@/app/components/workflow/types'
const supportedAgentLogNodes = [BlockEnum.Agent, BlockEnum.Tool]
const supportedAgentLogNodes: BlockEnum[] = [BlockEnum.Agent, BlockEnum.Tool]
const remove = (node: AgentLogItemWithChildren, removeId: string) => {
let { children } = node