Skip to content

Commit e94b7e3

Browse files
authored
Merge branch 'main' into flowise-304
2 parents aef5b3b + 106f211 commit e94b7e3

437 files changed

Lines changed: 21228 additions & 7041 deletions

File tree

Some content is hidden

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

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,7 @@ extensions/
114114
# Only allow apps/oss-app, ignore all other apps
115115
apps/*/
116116
!apps/oss-app/
117+
118+
# Claude - session/user specific files
119+
.claude/plans/
120+
.claude/settings.local.json

CONTRIBUTING.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,48 @@ Flowise has 3 different modules in a single mono repository.
116116

117117
11. Commit code and submit Pull Request from forked branch pointing to [Flowise main](https://github.com/FlowiseAI/Flowise/tree/main).
118118

119+
### Testing
120+
121+
- Unit tests are **co-located** with their source files — a test for `Foo.ts` lives in `Foo.test.ts` in the same directory. This is the standard used across all packages in this repo.
122+
123+
- Run tests per package:
124+
125+
```bash
126+
cd packages/server && pnpm test
127+
cd packages/components && pnpm test
128+
cd packages/agentflow && pnpm test
129+
```
130+
131+
Or from the repo root using `--filter`:
132+
133+
```bash
134+
pnpm --filter flowise-components test
135+
pnpm --filter @flowiseai/agentflow test
136+
pnpm --filter "./packages/server" test # root and server share the same package name.
137+
```
138+
139+
- Or run all tests from the repo root:
140+
141+
```bash
142+
pnpm test
143+
```
144+
145+
- When adding new functionality, place your test file next to the source file it tests:
146+
147+
```
148+
packages/components/nodes/tools/MyTool/
149+
├── MyTool.ts
150+
└── MyTool.test.ts ← co-located test
151+
```
152+
119153
## 🌱 Env Variables
120154

121155
Flowise support different environment variables to configure your instance. You can specify the following variables in the `.env` file inside `packages/server` folder. Read [more](https://docs.flowiseai.com/environment-variables)
122156

123157
| Variable | Description | Type | Default |
124158
| ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ | ----------------------------------- |
125159
| PORT | The HTTP port Flowise runs on | Number | 3000 |
160+
| CORS_ALLOW_CREDENTIALS | Enables CORS `Access-Control-Allow-Credentials` when `true` | Boolean | false |
126161
| CORS_ORIGINS | The allowed origins for all cross-origin HTTP calls | String | |
127162
| IFRAME_ORIGINS | The allowed origins for iframe src embedding | String | |
128163
| FLOWISE_FILE_SIZE_LIMIT | Upload File Size Limit | String | 50mb |

docker/.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ PORT=3000
7474
############################################################################################################
7575

7676
# NUMBER_OF_PROXIES= 1
77+
# CORS_ALLOW_CREDENTIALS=false
7778
# CORS_ORIGINS=*
7879
# IFRAME_ORIGINS=*
7980
# FLOWISE_FILE_SIZE_LIMIT=50mb
@@ -190,6 +191,7 @@ JWT_REFRESH_TOKEN_EXPIRY_IN_MINUTES=43200
190191

191192
# HTTP_DENY_LIST=
192193
# HTTP_SECURITY_CHECK=true
194+
# PATH_TRAVERSAL_SAFETY=true
193195
# CUSTOM_MCP_SECURITY_CHECK=true
194196
# CUSTOM_MCP_PROTOCOL=sse #(stdio | sse)
195197
# TRUST_PROXY=true #(true | false | 1 | loopback| linklocal | uniquelocal | IP addresses | loopback, IP addresses)

docker/docker-compose-queue-prebuilt.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ services:
153153
- CUSTOM_MCP_PROTOCOL=${CUSTOM_MCP_PROTOCOL}
154154
- HTTP_DENY_LIST=${HTTP_DENY_LIST}
155155
- HTTP_SECURITY_CHECK=${HTTP_SECURITY_CHECK}
156+
- PATH_TRAVERSAL_SAFETY=${PATH_TRAVERSAL_SAFETY}
156157
- TRUST_PROXY=${TRUST_PROXY}
157158
healthcheck:
158159
test: ['CMD', 'curl', '-f', 'http://localhost:${PORT:-3000}/api/v1/ping']
@@ -300,6 +301,7 @@ services:
300301
- CUSTOM_MCP_PROTOCOL=${CUSTOM_MCP_PROTOCOL}
301302
- HTTP_DENY_LIST=${HTTP_DENY_LIST}
302303
- HTTP_SECURITY_CHECK=${HTTP_SECURITY_CHECK}
304+
- PATH_TRAVERSAL_SAFETY=${PATH_TRAVERSAL_SAFETY}
303305
- TRUST_PROXY=${TRUST_PROXY}
304306
healthcheck:
305307
test: ['CMD', 'curl', '-f', 'http://localhost:${WORKER_PORT:-5566}/healthz']

docker/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ services:
138138
- CUSTOM_MCP_PROTOCOL=${CUSTOM_MCP_PROTOCOL}
139139
- HTTP_DENY_LIST=${HTTP_DENY_LIST}
140140
- HTTP_SECURITY_CHECK=${HTTP_SECURITY_CHECK}
141+
- PATH_TRAVERSAL_SAFETY=${PATH_TRAVERSAL_SAFETY}
141142
- TRUST_PROXY=${TRUST_PROXY}
142143
ports:
143144
- '${PORT}:${PORT}'

docker/worker/.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ WORKER_PORT=5566
7474
############################################################################################################
7575

7676
# NUMBER_OF_PROXIES= 1
77+
# CORS_ALLOW_CREDENTIALS=false
7778
# CORS_ORIGINS=*
7879
# IFRAME_ORIGINS=*
7980
# FLOWISE_FILE_SIZE_LIMIT=50mb
@@ -190,6 +191,7 @@ JWT_REFRESH_TOKEN_EXPIRY_IN_MINUTES=43200
190191

191192
# HTTP_DENY_LIST=
192193
# HTTP_SECURITY_CHECK=true
194+
# PATH_TRAVERSAL_SAFETY=true
193195
# CUSTOM_MCP_SECURITY_CHECK=true
194196
# CUSTOM_MCP_PROTOCOL=sse #(stdio | sse)
195197
# TRUST_PROXY=true #(true | false | 1 | loopback| linklocal | uniquelocal | IP addresses | loopback, IP addresses)

docker/worker/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ services:
138138
- CUSTOM_MCP_PROTOCOL=${CUSTOM_MCP_PROTOCOL}
139139
- HTTP_DENY_LIST=${HTTP_DENY_LIST}
140140
- HTTP_SECURITY_CHECK=${HTTP_SECURITY_CHECK}
141+
- PATH_TRAVERSAL_SAFETY=${PATH_TRAVERSAL_SAFETY}
141142
- TRUST_PROXY=${TRUST_PROXY}
142143
ports:
143144
- '${WORKER_PORT}:${WORKER_PORT}'

package.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "flowise",
3-
"version": "3.0.13",
3+
"version": "3.1.1",
44
"private": true,
55
"homepage": "https://flowiseai.com",
66
"workspaces": [
@@ -86,20 +86,24 @@
8686
"unset-value": "2.0.1",
8787
"webpack-dev-middleware": "7.4.2",
8888
"ws": "8.18.3",
89-
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
89+
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz",
90+
"uuid": "^10.0.0",
91+
"request>uuid": "^3.4.0"
9092
}
9193
},
9294
"engines": {
9395
"node": ">=18.15.0 <19.0.0 || ^20",
9496
"pnpm": "^10.26.0"
9597
},
9698
"resolutions": {
99+
"@anthropic-ai/sdk": "^0.73.0",
97100
"@google/generative-ai": "^0.24.0",
98101
"@grpc/grpc-js": "^1.10.10",
99-
"@langchain/core": "0.3.61",
102+
"@langchain/core": "1.1.20",
100103
"@qdrant/openapi-typescript-fetch": "1.2.6",
101-
"openai": "4.96.0",
102-
"protobufjs": "7.4.0"
104+
"openai": "6.19.0",
105+
"protobufjs": "7.4.0",
106+
"uuid": "^10.0.0"
103107
},
104108
"eslintIgnore": [
105109
"**/dist",

packages/agentflow/.eslintrc.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ module.exports = {
8181
'import/first': 'error',
8282
'import/newline-after-import': 'error',
8383
'import/no-duplicates': 'error',
84+
// Allow autoFocus on custom components (e.g. RichTextEditor in dialogs) — they manage
85+
// focus programmatically per WAI-ARIA dialog patterns. Native elements are still flagged.
86+
'jsx-a11y/no-autofocus': ['error', { ignoreNonDOM: true }],
8487
'prettier/prettier': 'error',
8588
// Ban @/features alias — features use relative imports internally, and no other
8689
// layer should import from features (enforced by import/no-restricted-paths below).
@@ -116,8 +119,8 @@ module.exports = {
116119
{
117120
target: './src/atoms',
118121
from: './src/core',
119-
except: ['./types'],
120-
message: 'Atoms can only import types from core/types, not utilities or business logic.'
122+
except: ['./types', './theme', './primitives'],
123+
message: 'Atoms can only import from core/types, core/theme, and core/primitives.'
121124
},
122125
// core/ cannot import from anything (leaf node)
123126
{

packages/agentflow/ARCHITECTURE.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ atoms/
4242
- No API calls
4343
- Stateless or minimal local state
4444
- Imported by features, never the reverse
45-
- **Forbidden**: Importing from `features/` or `infrastructure/` (except types from `core/types` for prop definitions)
45+
- **Forbidden**: Importing from `features/` or `infrastructure/` (except types from `core/types` for prop definitions, design tokens from `core/theme`, and primitives from `core/primitives`)
4646

4747
**Goal:** 100% visual consistency.
4848

@@ -110,6 +110,9 @@ features/
110110
core/
111111
├── types/ # Global interfaces (Node, Edge, Flow)
112112
│ └── index.ts
113+
├── primitives/ # Domain-free utilities (safe for atoms)
114+
│ ├── inputDefaults.ts # getDefaultValueForType
115+
│ └── index.ts
113116
├── node-config/ # Node configuration (icons, colors, default types)
114117
│ ├── nodeIcons.ts # AGENTFLOW_ICONS, DEFAULT_AGENTFLOW_NODES
115118
│ └── ...
@@ -124,7 +127,7 @@ core/
124127
│ ├── flowValidation.ts # validateFlow, validateNode
125128
│ ├── connectionValidation.ts # isValidConnectionAgentflowV2
126129
│ └── ...
127-
├── utils/ # Generic utilities
130+
├── utils/ # Domain-aware utilities (NOT importable by atoms)
128131
│ ├── nodeFactory.ts # initNode, getUniqueNodeId
129132
│ └── ...
130133
└── index.ts # Barrel export (use sparingly)
@@ -138,6 +141,15 @@ core/
138141
- Pure functions where possible
139142
- Can be tested in isolation
140143

144+
#### `core/primitives/` vs `core/utils/`
145+
146+
`core/` contains two utility directories with different import permissions:
147+
148+
- **`primitives/`** — Domain-free, general-purpose functions with no knowledge of nodes, flows, or any business concept. These are pure data transformations (e.g., computing a default value from a type string). **Safe to import from `atoms/`.**
149+
- **`utils/`** — Domain-aware utilities that understand node structures, flow data, or validation logic (e.g., `initNode`, `buildDynamicOutputAnchors`). **Only importable by `features/` and `infrastructure/`.**
150+
151+
When adding a new utility, ask: _"Does this function need to know what a Node or Flow is?"_ If no → `primitives/`. If yes → `utils/`.
152+
141153
**Goal:** To be the framework-agnostic source of truth.
142154

143155
---
@@ -210,7 +222,7 @@ infrastructure/
210222

211223
- `features``atoms`, `infrastructure`, `core`
212224
- `infrastructure``core`
213-
- `atoms``core/types` only (for type definitions)
225+
- `atoms``core/types`, `core/theme`, and `core/primitives` only
214226
- `core` → nothing (leaf node) ✅
215227
- **Atoms and Core are "leaf" nodes** - they cannot import from `features/` or `infrastructure/`
216228

0 commit comments

Comments
 (0)