fix(editor): Hide $fromAI button for exact type matches only (#14996)

This commit is contained in:
Charlie Kolb
2025-04-29 17:46:33 +02:00
committed by GitHub
parent 7e764ce55c
commit 8613521aab

View File

@@ -47,10 +47,10 @@ function sanitizeFromAiParameterName(s: string) {
// nodeName | [nodeName, highestUnsupportedVersion] // nodeName | [nodeName, highestUnsupportedVersion]
const NODE_DENYLIST = [ const NODE_DENYLIST = [
'toolCode', '@n8n/n8n-nodes-langchain.toolCode',
'toolHttpRequest', '@n8n/n8n-nodes-langchain.toolHttpRequest',
'mcpClientTool', '@n8n/n8n-nodes-langchain.mcpClientTool',
['toolWorkflow', 1.2], ['@n8n/n8n-nodes-langchain.toolWorkflow', 1.2],
] as const; ] as const;
const PATH_DENYLIST = [ const PATH_DENYLIST = [
@@ -192,10 +192,10 @@ export function parseOverrides(
function isDeniedNode(nodeDenyData: string | readonly [string, number], node: INodeUi) { function isDeniedNode(nodeDenyData: string | readonly [string, number], node: INodeUi) {
if (typeof nodeDenyData === 'string') { if (typeof nodeDenyData === 'string') {
return node.type.endsWith(nodeDenyData); return node.type === nodeDenyData;
} else { } else {
const [name, version] = nodeDenyData; const [typeName, version] = nodeDenyData;
return node.type.endsWith(name) && node.typeVersion <= version; return node.type === typeName && node.typeVersion <= version;
} }
} }