diff --git a/packages/@n8n/api-types/src/frontend-settings.ts b/packages/@n8n/api-types/src/frontend-settings.ts index 11c59772736..1d050e88a4c 100644 --- a/packages/@n8n/api-types/src/frontend-settings.ts +++ b/packages/@n8n/api-types/src/frontend-settings.ts @@ -197,6 +197,10 @@ export interface FrontendSettings { enabled: boolean; setup: boolean; }; + /** + * @deprecated Gates the AI Transform node's code generation. No longer gates + * the Code node's "Ask AI" tab, which is hidden. Removed in v3. + */ askAi: { enabled: boolean; }; diff --git a/packages/cli/src/controllers/ai.controller.ts b/packages/cli/src/controllers/ai.controller.ts index d5147590713..3e6821bbdea 100644 --- a/packages/cli/src/controllers/ai.controller.ts +++ b/packages/cli/src/controllers/ai.controller.ts @@ -201,7 +201,13 @@ export class AiController { } } - @Post('/ask-ai') + /** + * @deprecated Both callers are deprecated: the Code node's "Ask AI" tab is + * hidden, and the AI Transform node is hidden and has an automated migration + * to the Code node. Removed in v3. + */ + @Licensed('feat:askAi') + @Post('/ask-ai', { ipRateLimit: { limit: 100 } }) async askAi( req: AuthenticatedRequest, _: Response, diff --git a/packages/cli/src/services/ai.service.ts b/packages/cli/src/services/ai.service.ts index 582c1839c97..e0e2bd3ff09 100644 --- a/packages/cli/src/services/ai.service.ts +++ b/packages/cli/src/services/ai.service.ts @@ -65,6 +65,7 @@ export class AiService { return await client.applySuggestion(payload, { id: user.id }); } + /** @deprecated Serves `POST /rest/ai/ask-ai`. Removed in v3. */ async askAi(payload: AiAskRequestDto, user: IUser) { const client = await this.getClient(); return await client.askAi(payload, { id: user.id }); diff --git a/packages/frontend/@n8n/i18n/src/locales/en.json b/packages/frontend/@n8n/i18n/src/locales/en.json index 75c239586f8..01e27e7a4ed 100644 --- a/packages/frontend/@n8n/i18n/src/locales/en.json +++ b/packages/frontend/@n8n/i18n/src/locales/en.json @@ -975,37 +975,10 @@ "codeNodeEditor.linter.eachItem.preferFirst": "Prefer `.first()` over `.item` so n8n can optimize execution", "codeNodeEditor.linter.bothModes.syntaxError": "Syntax error", "codeNodeEditor.linter.bothModes.dollarSignVariable": "Use a string literal instead of a variable so n8n can optimize execution.", - "codeNodeEditor.askAi.placeholder": "Tell AI what you want the code to achieve. You can reference input data fields using dot notation (e.g. user.email)", - "codeNodeEditor.askAi.intro": "Hey AI, generate JavaScript code that...", - "codeNodeEditor.askAi.help": "Help", - "codeNodeEditor.askAi.generateCode": "Generate Code", "codeNodeEditor.askAi.noInputData": "You can generate code once this node has incoming input data (from a node earlier in your workflow)", - "codeNodeEditor.askAi.sureLeaveTab": "Are you sure you want to switch tab? The code generation will stop", - "codeNodeEditor.askAi.areYouSure": "Are you sure?", - "codeNodeEditor.askAi.switchTab": "Switch Tab", "codeNodeEditor.askAi.noPrompt": "First enter a prompt above before generating code", - "codeNodeEditor.askAi.onlyAllItemsMode": "Ask AI generation works only in 'Run Once for All Items' mode", - "codeNodeEditor.askAi.promptTooShort": "Enter a minimum of {minLength} characters before attempting to generate code", - "codeNodeEditor.askAi.generateCodeAndReplace": "Generate and Replace Code", - "codeNodeEditor.askAi.replaceCurrentCode": "Replace current code?", - "codeNodeEditor.askAi.areYouSureToReplace": "Are you sure you want to generate new code? Your current code will be replaced.", - "codeNodeEditor.askAi.loadingPhrase0": "AI cogs whirring, almost there…", - "codeNodeEditor.askAi.loadingPhrase1": "up up down down left right b a start…", - "codeNodeEditor.askAi.loadingPhrase2": "Consulting Jan Oberhauser…", - "codeNodeEditor.askAi.loadingPhrase3": "Gathering bytes and pieces…", - "codeNodeEditor.askAi.loadingPhrase4": "Checking if another AI knows the answer…", - "codeNodeEditor.askAi.loadingPhrase5": "Checking on Stack Overflow…", - "codeNodeEditor.askAi.loadingPhrase6": "Crunching data, AI-style…", - "codeNodeEditor.askAi.loadingPhrase7": "Stand by, AI magic at work…", "codeNodeEditor.askAi.generationCompleted": "✨ Code generation completed", "codeNodeEditor.askAi.generationFailed": "Code generation failed", - "codeNodeEditor.askAi.generationFailedUnknown": "Code generation failed due to an unknown reason. Try again in a few minutes", - "codeNodeEditor.askAi.generationFailedWithReason": "Code generation failed with error: {error}. Try again in a few minutes", - "codeNodeEditor.askAi.generationFailedDown": "We're sorry, our AI service is currently unavailable. Please try again later. If the problem persists, contact support.", - "codeNodeEditor.askAi.generationFailedRate": "We've hit our rate limit with our AI partner (too many requests). Please wait a minute before trying again.", - "codeNodeEditor.askAi.generationFailedTooLarge": "Your workflow data is too large for AI to process. Simplify the data being sent into the Code node and retry.", - "codeNodeEditor.tabs.askAi": "✨ Ask AI", - "codeNodeEditor.tabs.code": "Code", "codeNodeEditor.examples": "Examples", "codeNodeEditor.parameters": "Parameters", "codeNodeEditor.optional": "optional", diff --git a/packages/frontend/editor-ui/src/app/components/FocusPanel.vue b/packages/frontend/editor-ui/src/app/components/FocusPanel.vue index d8dc3ab612c..a47acd2ddd4 100644 --- a/packages/frontend/editor-ui/src/app/components/FocusPanel.vue +++ b/packages/frontend/editor-ui/src/app/components/FocusPanel.vue @@ -496,7 +496,6 @@ function onRenameNode(value: string) { :is-read-only="isReadOnly" :target-node-parameter-context="targetNodeParameterContext" fill-parent - :disable-ask-ai="true" @update:model-value="onInputChange" /> { :default-value="parameter.default" :language="editorLanguage" :is-read-only="isReadOnly" - :disable-ask-ai="!askAi" fill-parent @update:model-value="valueChangedDebounced" /> @@ -1710,7 +1707,6 @@ onUpdated(async () => { :is-read-only="isReadOnly || editorIsReadOnly" :rows="editorRows" :ai-button-enabled="settingsStore.isCloudDeployment" - :disable-ask-ai="!askAi" @update:model-value="valueChangedDebounced" >