-
Notifications
You must be signed in to change notification settings - Fork 0
n8n UI Customisations & Translation Infrastructure #6
base: master
Are you sure you want to change the base?
Changes from all commits
a70f138
d044bd9
b28fbe6
d985f87
79b704b
0dd8c95
83be2f8
74308b4
a118ed6
dc468b7
3d1ad1f
9b8f56b
f5a8751
b141e87
1ff41b1
df29fbb
27968c1
f2b4601
ea0adb5
ffe1f16
791bbea
4035bca
eb51df1
d1065da
37e9c14
1689f65
c95cb62
792f14b
b7c912f
240fb13
dfb40fa
4fffa77
0643993
a2f100f
7edae37
2f69cd1
fad4da2
8aefe38
f181095
fe6a37d
68504db
dc63166
a431204
b0fc1b1
97bfbf5
356357e
e017c3e
31477f3
26a9b80
5fc23c6
f9eda1e
33e2bdd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,39 +4,43 @@ on: | |
| workflow_call: | ||
| inputs: | ||
| branch: | ||
| description: "GitHub branch to test." | ||
| description: "GitHub branch to test." | ||
| required: false | ||
| type: string | ||
| test-mode: | ||
| description: "Test mode: local (pnpm start from local), docker-build, or docker-pull" | ||
| description: "Test mode: local (pnpm start from local), docker-build, or docker-pull" | ||
| required: false | ||
| default: "local" | ||
| default: "local" | ||
| type: string | ||
| test-command: | ||
| description: "Test command to run" | ||
| description: "Test command to run" | ||
| required: false | ||
| default: "pnpm --filter=n8n-playwright test:local" | ||
| default: "pnpm --filter=n8n-playwright test:local" | ||
| type: string | ||
| shards: | ||
| description: "Shards for parallel execution" | ||
| description: "Shards for parallel execution" | ||
| required: false | ||
| default: "[1, 2, 3, 4, 5, 6, 7, 8]" | ||
| default: "[1, 2, 3, 4, 5, 6, 7, 8]" | ||
| type: string | ||
| docker-image: | ||
| description: "Docker image to use (for docker-pull mode)" | ||
| description: "Docker image to use (for docker-pull mode)" | ||
| required: false | ||
| default: "n8nio/n8n:nightly" | ||
| default: "n8nio/n8n:nightly" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Duplicate YAML keys break workflow input definitionsHigh Severity Multiple workflow input fields have duplicate YAML keys for Additional Locations (1) |
||
| type: string | ||
| workers: | ||
| description: "Number of parallel workers" | ||
| required: false | ||
| default: "" | ||
| type: string | ||
| runner: | ||
| description: 'GitHub runner to use' | ||
| required: false | ||
| default: 'blacksmith-2vcpu-ubuntu-2204' | ||
| type: string | ||
|
|
||
| secrets: | ||
| CURRENTS_RECORD_KEY: | ||
|
|
@@ -63,6 +67,7 @@ env: | |
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,7 @@ on: | |
|
|
||
| jobs: | ||
| build-arm64: | ||
| runs-on: ubuntu-22.04-arm | ||
| runs-on: ubuntu-latest | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ARM64 build job runs on x86_64 runnerHigh Severity The |
||
| if: github.event.pull_request.merged == true | ||
| env: | ||
| NODE_OPTIONS: --max-old-space-size=6144 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import { defineConfig, globalIgnores } from 'eslint/config'; | ||
| import { nodeConfig } from '@n8n/eslint-config/node'; | ||
|
|
||
| export default defineConfig( | ||
| nodeConfig, | ||
| globalIgnores(['bin/*.js', 'nodes-testing/*.ts', 'coverage/*']), | ||
| { | ||
| rules: { | ||
| complexity: ['error', 15], | ||
| 'unicorn/filename-case': ['error', { case: 'kebabCase' }], | ||
| }, | ||
| }, | ||
| { | ||
| files: ['**/*.test.ts', '**/test/**/*.ts', '**/__test__/**/*.ts', '**/__tests__/**/*.ts'], | ||
| rules: {}, | ||
| }, | ||
| ); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| /** @type {import('jest').Config} */ | ||
| module.exports = { | ||
| ...require('../../../jest.config'), | ||
| globalSetup: '<rootDir>/test/setup.ts', | ||
| setupFilesAfterEnv: ['<rootDir>/test/setup-mocks.ts'], | ||
| // Include in coverage | ||
| collectCoverageFrom: [ | ||
| 'src/**/*.ts', | ||
| '!src/**/\\*\\.ts', | ||
| '!src/**/*.d.ts', | ||
| '!src/**/index.ts', // Exclude barrel files | ||
| '!src/**/__tests__/**', // Exclude test files | ||
| ], | ||
|
|
||
| // Set minimum thresholds | ||
| coverageThreshold: { | ||
| global: { | ||
| branches: 95, | ||
| functions: 95, | ||
| lines: 95, | ||
| statements: 95, | ||
| }, | ||
| }, | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| { | ||
| "name": "intento-agents", | ||
| "version": "1.0.0", | ||
| "description": "Agents functionality of intento extension for n8n", | ||
| "main": "dist/index", | ||
| "types": "dist/index.d.ts", | ||
|
|
||
| "scripts": { | ||
| "clean": "rimraf dist .turbo", | ||
| "typecheck": "tsc --noEmit", | ||
| "build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json", | ||
| "dev": "pnpm watch", | ||
| "format": "biome format --write .", | ||
| "format:check": "biome ci .", | ||
| "lint": "eslint . --quiet", | ||
| "lint:fix": "eslint . --fix", | ||
| "watch": "tsc-watch -p tsconfig.build.json --onCompilationComplete \"tsc-alias -p tsconfig.build.json\"", | ||
| "test": "jest --coverage", | ||
| "test:unit": "jest --coverage", | ||
| "test:dev": "jest --watch" | ||
| }, | ||
| "files": [ | ||
| "dist", | ||
| "bin" | ||
| ], | ||
| "devDependencies": { | ||
| "@n8n/typescript-config": "workspace:^", | ||
| "n8n-workflow": "workspace:^", | ||
| "intento-core": "workspace:^", | ||
| "intento-segmentation": "workspace:^", | ||
| "intento-translation": "workspace:^" | ||
| }, | ||
| "dependencies": { | ||
| "@echogarden/icu-segmentation-wasm": "^0.2.2", | ||
| "@echogarden/text-segmentation": "^0.4.1", | ||
| "n8n-workflow": "workspace:^", | ||
| "intento-core": "workspace:^", | ||
| "intento-segmentation": "workspace:^", | ||
| "intento-translation": "workspace:^" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| // intento-agents/translation | ||
| export * from 'translation/*'; |
|
apl-intento marked this conversation as resolved.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export * from './translation-agent'; | ||
| export * from './translation-agent-descriptor'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import type { IDescriptor } from 'intento-core'; | ||
|
|
||
| export const TranslationAgentDescriptor: IDescriptor = { | ||
| name: 'ai.text.translation.agent', | ||
| symbol: 'π€ [Translation Agent]', | ||
| tool: 'intentoTranslationAgentTool', | ||
| node: 'intentoTranslationAgentNode', | ||
| displayName: 'Translation Agent', | ||
| description: 'AI-powered translation agent for intelligent text translation workflows', | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| import { AgentRequestBase } from 'intento-core'; | ||
| import type { TranslationContext } from 'intento-translation'; | ||
| import type { IDataObject, LogMetadata } from 'n8n-workflow'; | ||
|
|
||
| export class TranslationAgentRequest extends AgentRequestBase { | ||
| readonly text: string[]; | ||
| readonly to: string; | ||
| readonly from?: string; | ||
|
|
||
| constructor(context: TranslationContext) { | ||
| super(); | ||
|
|
||
| this.text = context.text; | ||
| this.to = context.to; | ||
| this.from = context.from; | ||
|
|
||
| Object.freeze(this); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not think that is neccesarry |
||
| } | ||
|
|
||
| throwIfInvalid(): void { | ||
| if (!this.to || this.to.trim() === '') throw new Error('"to" is required'); | ||
| if (this.text.length === 0) throw new Error('"text" must contain at least one string to translate.'); | ||
| const wrongText = this.text.filter((t) => t === null || t === undefined); | ||
| if (wrongText.length > 0) throw new Error('"text" contains invalid string (null or undefined).'); | ||
| super.throwIfInvalid(); | ||
| } | ||
|
|
||
| asLogMetadata(): LogMetadata { | ||
| return { | ||
| ...super.asLogMetadata(), | ||
| from: this.from, | ||
| to: this.to, | ||
| textCount: this.text.length, | ||
| }; | ||
| } | ||
|
|
||
| asDataObject(): IDataObject { | ||
| return { | ||
| from: this.from, | ||
| to: this.to, | ||
| text: this.text, | ||
| }; | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate timeout-minutes YAML key in workflow
Medium Severity
The
build-and-push-dockerjob hastimeout-minutes: 30specified twice on consecutive lines (86 and 87). Duplicate YAML keys are invalid and may cause parsing issues or unpredictable behavior depending on the YAML parser used.