Skip to content

Commit d1ba935

Browse files
authored
Merge branch 'master' into add-truefoundry-node
2 parents 09c2135 + 9c11c3f commit d1ba935

File tree

424 files changed

+22246
-2480
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

424 files changed

+22246
-2480
lines changed

.github/workflows/build-unit-test-pr-comment.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ permissions:
88
pull-requests: read
99
contents: read
1010
actions: write
11+
issues: write
1112

1213
jobs:
1314
validate_and_dispatch:
@@ -91,7 +92,9 @@ jobs:
9192
env:
9293
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9394
HEAD_SHA: ${{ steps.check_permissions.outputs.headSha }}
95+
PR_NUMBER: ${{ steps.check_permissions.outputs.prNumber }}
9496
run: |
9597
gh workflow run ci-manual-build-unit-tests.yml \
9698
--repo "${{ github.repository }}" \
97-
-f ref="${HEAD_SHA}"
99+
-f ref="${HEAD_SHA}" \
100+
-f pr_number="${PR_NUMBER}"

.github/workflows/ci-manual-build-unit-tests.yml

Lines changed: 78 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,44 @@ on:
66
ref:
77
description: Commit SHA or ref to check out
88
required: true
9+
pr_number:
10+
description: PR number (optional, for check reporting)
11+
required: false
12+
type: string
13+
14+
permissions:
15+
contents: read
16+
checks: write
917

1018
jobs:
19+
create-check-run:
20+
name: Create Check Run
21+
runs-on: ubuntu-latest
22+
if: inputs.pr_number != ''
23+
outputs:
24+
check_run_id: ${{ steps.create.outputs.check_run_id }}
25+
steps:
26+
- name: Create pending check run on PR
27+
id: create
28+
uses: actions/github-script@v7
29+
with:
30+
github-token: ${{ secrets.GITHUB_TOKEN }}
31+
script: |
32+
const { data: checkRun } = await github.rest.checks.create({
33+
owner: context.repo.owner,
34+
repo: context.repo.repo,
35+
name: 'Build & Unit Tests - Checks',
36+
head_sha: '${{ inputs.ref }}',
37+
status: 'in_progress',
38+
output: {
39+
title: 'Build & Unit Tests - Checks',
40+
summary: 'Running build, unit tests, and lint...'
41+
}
42+
});
43+
44+
core.setOutput('check_run_id', checkRun.id);
45+
console.log(`Created check run ${checkRun.id} on commit ${{ inputs.ref }}`);
46+
1147
install-and-build:
1248
name: Install & Build
1349
runs-on: blacksmith-2vcpu-ubuntu-2204
@@ -47,9 +83,50 @@ jobs:
4783
post-build-unit-tests:
4884
name: Build & Unit Tests - Checks
4985
runs-on: ubuntu-latest
50-
needs: [install-and-build, unit-tests, lint]
86+
needs: [create-check-run, install-and-build, unit-tests, lint]
5187
if: always()
5288
steps:
89+
- name: Update check run on PR (if triggered from PR comment)
90+
if: inputs.pr_number != ''
91+
uses: actions/github-script@v7
92+
with:
93+
github-token: ${{ secrets.GITHUB_TOKEN }}
94+
script: |
95+
const checkRunId = '${{ needs.create-check-run.outputs.check_run_id }}';
96+
97+
if (!checkRunId) {
98+
console.log('No check run ID found, skipping update');
99+
return;
100+
}
101+
102+
const buildResult = '${{ needs.install-and-build.result }}';
103+
const testResult = '${{ needs.unit-tests.result }}';
104+
const lintResult = '${{ needs.lint.result }}';
105+
106+
const conclusion = (buildResult === 'success' && testResult === 'success' && lintResult === 'success')
107+
? 'success'
108+
: 'failure';
109+
110+
const summary = `
111+
**Build**: ${buildResult}
112+
**Unit Tests**: ${testResult}
113+
**Lint**: ${lintResult}
114+
`;
115+
116+
await github.rest.checks.update({
117+
owner: context.repo.owner,
118+
repo: context.repo.repo,
119+
check_run_id: parseInt(checkRunId),
120+
status: 'completed',
121+
conclusion: conclusion,
122+
output: {
123+
title: 'Build & Unit Tests - Checks',
124+
summary: summary
125+
}
126+
});
127+
128+
console.log(`Updated check run ${checkRunId} with conclusion: ${conclusion}`);
129+
53130
- name: Fail if any job failed
54131
if: needs.install-and-build.result == 'failure' || needs.unit-tests.result == 'failure' || needs.lint.result == 'failure'
55132
run: exit 1

docker/images/runners/Dockerfile

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,21 @@ RUN pnpm install --prod --no-lockfile --silent
2020
RUN mv package.json extras.json
2121
RUN mv package.json.bak package.json
2222

23+
# Remove `catalog` and `workspace` references from package.json to allow `pnpm add` in extended images
24+
RUN node -e "const pkg = require('./package.json'); \
25+
Object.keys(pkg.dependencies || {}).forEach(k => { \
26+
const val = pkg.dependencies[k]; \
27+
if (val === 'catalog:' || val.startsWith('catalog:') || val.startsWith('workspace:')) \
28+
delete pkg.dependencies[k]; \
29+
}); \
30+
Object.keys(pkg.devDependencies || {}).forEach(k => { \
31+
const val = pkg.devDependencies[k]; \
32+
if (val === 'catalog:' || val.startsWith('catalog:') || val.startsWith('workspace:')) \
33+
delete pkg.devDependencies[k]; \
34+
}); \
35+
delete pkg.devDependencies; \
36+
require('fs').writeFileSync('./package.json', JSON.stringify(pkg, null, 2));"
37+
2338
# ==============================================================================
2439
# STAGE 2: Python runner build (@n8n/task-runner-python) with uv
2540
# Produces a relocatable venv tied to the python version used
@@ -107,7 +122,7 @@ ENV NODE_ENV=production \
107122
N8N_RELEASE_TYPE=${N8N_RELEASE_TYPE} \
108123
SHELL=/bin/sh
109124

110-
# Bring `uv` over from python-runner-builder
125+
# Bring `uv` over from python-runner-builder, to make the image easier to extend
111126
COPY --from=python-runner-builder /usr/local/bin/uv /usr/local/bin/uv
112127

113128
# Bring node over from node-alpine
@@ -117,6 +132,11 @@ COPY --from=node-alpine /usr/local/bin/node /usr/local/bin/node
117132
# libc6-compat is required by task-runner-launcher
118133
RUN apk add --no-cache ca-certificates tini libstdc++ libc6-compat
119134

135+
# Bring corepack and pnpm over, to make the image easier to extend
136+
COPY --from=node-alpine /usr/local/lib/node_modules /usr/local/lib/node_modules
137+
RUN ln -s ../lib/node_modules/corepack/dist/corepack.js /usr/local/bin/corepack && \
138+
ln -s ../lib/node_modules/corepack/dist/pnpm.js /usr/local/bin/pnpm
139+
120140
RUN addgroup -g 1000 -S runner \
121141
&& adduser -u 1000 -S -G runner -h /home/runner -D runner
122142

jest.config.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const { pathsToModuleNameMapper } = require('ts-jest');
22
const { compilerOptions } = require('get-tsconfig').getTsconfig().config;
3+
const { resolve } = require('path');
34

45
/** @type {import('ts-jest').TsJestGlobalOptions} */
56
const tsJestOptions = {
@@ -42,11 +43,14 @@ const config = {
4243
},
4344
transformIgnorePatterns: [`/node_modules/(?!${esmDependenciesPattern})/`],
4445
// This resolve the path mappings from the tsconfig relative to each jest.config.js
45-
moduleNameMapper: compilerOptions?.paths
46-
? pathsToModuleNameMapper(compilerOptions.paths, {
47-
prefix: `<rootDir>${compilerOptions.baseUrl ? `/${compilerOptions.baseUrl.replace(/^\.\//, '')}` : ''}`,
48-
})
49-
: {},
46+
moduleNameMapper: {
47+
'^@n8n/utils$': resolve(__dirname, 'packages/@n8n/utils/dist/index.cjs'),
48+
...(compilerOptions?.paths
49+
? pathsToModuleNameMapper(compilerOptions.paths, {
50+
prefix: `<rootDir>${compilerOptions.baseUrl ? `/${compilerOptions.baseUrl.replace(/^\.\//, '')}` : ''}`,
51+
})
52+
: {}),
53+
},
5054
setupFilesAfterEnv: ['jest-expect-message'],
5155
collectCoverage: isCoverageEnabled,
5256
coverageReporters: ['text-summary', 'lcov', 'html-spa'],

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
"axios": "1.12.0",
9797
"chokidar": "4.0.3",
9898
"esbuild": "^0.25.0",
99+
"expr-eval@2.0.2": "npm:expr-eval-fork@3.0.0",
99100
"multer": "^2.0.2",
100101
"prebuild-install": "7.1.3",
101102
"pug": "^3.0.3",

packages/@n8n/ai-workflow-builder.ee/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"clean": "rimraf dist .turbo",
66
"typecheck": "tsc --noEmit",
77
"build": "tsc -p ./tsconfig.build.json && tsc-alias -p tsconfig.build.json",
8+
"build:with-cli": "pnpm build && pnpm --filter=n8n build",
89
"format": "biome format --write src",
910
"format:check": "biome ci src",
1011
"test": "jest",

packages/@n8n/ai-workflow-builder.ee/src/tools/engines/node-search-engine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { sublimeSearch } from '@n8n/utils/dist/search/sublimeSearch';
1+
import { sublimeSearch } from '@n8n/utils';
22
import type { INodeTypeDescription, NodeConnectionType } from 'n8n-workflow';
33
import { NodeConnectionTypes } from 'n8n-workflow';
44

packages/@n8n/api-types/src/chat-hub.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
import type { StructuredChunk } from 'n8n-workflow';
1+
import {
2+
type StructuredChunk,
3+
type JINA_AI_TOOL_NODE_TYPE,
4+
type SEAR_XNG_TOOL_NODE_TYPE,
5+
type INode,
6+
INodeSchema,
7+
} from 'n8n-workflow';
28
import { z } from 'zod';
39
import { Z } from 'zod-class';
410

@@ -28,6 +34,8 @@ export const PROVIDER_CREDENTIAL_TYPE_MAP: Record<
2834
google: 'googlePalmApi',
2935
};
3036

37+
export type ChatHubAgentTool = typeof JINA_AI_TOOL_NODE_TYPE | typeof SEAR_XNG_TOOL_NODE_TYPE;
38+
3139
/**
3240
* Chat Hub conversation model configuration
3341
*/
@@ -107,6 +115,7 @@ export const emptyChatModelsResponse: ChatModelsResponse = {
107115
anthropic: { models: [] },
108116
google: { models: [] },
109117
n8n: { models: [] },
118+
// eslint-disable-next-line @typescript-eslint/naming-convention
110119
'custom-agent': { models: [] },
111120
};
112121

@@ -122,6 +131,7 @@ export class ChatHubSendMessageRequest extends Z.class({
122131
name: z.string(),
123132
}),
124133
),
134+
tools: z.array(INodeSchema),
125135
}) {}
126136

127137
export class ChatHubRegenerateMessageRequest extends Z.class({
@@ -153,6 +163,7 @@ export class ChatHubUpdateConversationRequest extends Z.class({
153163
model: z.string().max(64).optional(),
154164
workflowId: z.string().max(36).optional(),
155165
agentId: z.string().uuid().optional(),
166+
tools: z.array(INodeSchema).optional(),
156167
}) {}
157168

158169
export type ChatHubMessageType = 'human' | 'ai' | 'system' | 'tool' | 'generic';
@@ -174,6 +185,7 @@ export interface ChatHubSessionDto {
174185
agentName: string | null;
175186
createdAt: string;
176187
updatedAt: string;
188+
tools: INode[];
177189
}
178190

179191
export interface ChatHubMessageDto {
@@ -216,6 +228,7 @@ export interface ChatHubAgentDto {
216228
credentialId: string | null;
217229
provider: ChatHubLLMProvider;
218230
model: string;
231+
tools: INode[];
219232
createdAt: string;
220233
updatedAt: string;
221234
}
@@ -227,6 +240,7 @@ export class ChatHubCreateAgentRequest extends Z.class({
227240
credentialId: z.string(),
228241
provider: chatHubProviderSchema.exclude(['n8n', 'custom-agent']),
229242
model: z.string().max(64),
243+
tools: z.array(INodeSchema),
230244
}) {}
231245

232246
export class ChatHubUpdateAgentRequest extends Z.class({
@@ -236,6 +250,7 @@ export class ChatHubUpdateAgentRequest extends Z.class({
236250
credentialId: z.string().optional(),
237251
provider: chatHubProviderSchema.optional(),
238252
model: z.string().max(64).optional(),
253+
tools: z.array(INodeSchema).optional(),
239254
}) {}
240255

241256
export interface EnrichedStructuredChunk extends StructuredChunk {

packages/@n8n/api-types/src/dto/data-table/list-data-table-content-query.dto.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,5 @@ export class ListDataTableContentQueryDto extends Z.class({
7979
skip: paginationSchema.skip.optional(),
8080
filter: filterValidator.optional(),
8181
sortBy: sortByValidator.optional(),
82+
search: z.string().optional(),
8283
}) {}

packages/@n8n/api-types/src/dto/oidc/config.dto.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ export class OidcConfigDto extends Z.class({
1010
.enum(['none', 'login', 'consent', 'select_account', 'create'])
1111
.optional()
1212
.default('select_account'),
13+
authenticationContextClassReference: z.array(z.string()).default([]),
1314
}) {}

0 commit comments

Comments
 (0)