Skip to content

Commit 6555050

Browse files
authored
Merge branch 'main' into fix/eval-base-url
2 parents a311e0d + 1e4b0d8 commit 6555050

File tree

101 files changed

+51030
-38979
lines changed

Some content is hidden

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

101 files changed

+51030
-38979
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# dependencies
66
**/node_modules
77
**/package-lock.json
8+
!**/examples/package-lock.json
89
**/yarn.lock
910

1011
## logs

packages/agentflow/.eslintignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
dist
2+
node_modules
3+
build
4+
*.config.ts
5+
*.config.js
6+
vite.config.ts
7+
examples/dist
8+
examples/vite.config.ts

packages/agentflow/.eslintrc.js

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
const features = ['canvas', 'generator', 'node-editor', 'node-palette']
2+
const crossFeatureRules = features.map((feature) => ({
3+
target: `./src/features/${feature}`,
4+
from: './src/features',
5+
except: [`./${feature}`],
6+
message: 'Features cannot import from other features. Move shared logic to core.'
7+
}))
8+
9+
module.exports = {
10+
extends: [
11+
'eslint:recommended',
12+
'plugin:react/recommended',
13+
'plugin:react/jsx-runtime',
14+
'plugin:react-hooks/recommended',
15+
'plugin:jsx-a11y/recommended',
16+
'plugin:@typescript-eslint/recommended',
17+
'plugin:prettier/recommended'
18+
],
19+
parser: '@typescript-eslint/parser',
20+
parserOptions: {
21+
ecmaVersion: 'latest',
22+
sourceType: 'module',
23+
ecmaFeatures: {
24+
jsx: true
25+
}
26+
},
27+
settings: {
28+
react: {
29+
version: 'detect'
30+
}
31+
},
32+
plugins: ['react', 'react-hooks', '@typescript-eslint', 'unused-imports', 'jsx-a11y', 'simple-import-sort', 'import'],
33+
ignorePatterns: ['dist', 'node_modules', 'build', 'vite.config.ts', 'examples/dist', '**/*.json'],
34+
rules: {
35+
'@typescript-eslint/explicit-module-boundary-types': 'off',
36+
'@typescript-eslint/no-explicit-any': 'warn',
37+
'@typescript-eslint/no-unused-vars': 'off',
38+
'no-unused-vars': 'off',
39+
'unused-imports/no-unused-imports': 'warn',
40+
'unused-imports/no-unused-vars': [
41+
'warn',
42+
{
43+
vars: 'all',
44+
varsIgnorePattern: '^_',
45+
args: 'after-used',
46+
argsIgnorePattern: '^_'
47+
}
48+
],
49+
'no-console': ['warn', { allow: ['warn', 'error', 'info'] }],
50+
'react/prop-types': 'off',
51+
'react/react-in-jsx-scope': 'off',
52+
'simple-import-sort/imports': [
53+
'error',
54+
{
55+
groups: [
56+
// Side effect imports
57+
['^\\u0000'],
58+
// React and React-related packages first
59+
['^react', '^react-dom'],
60+
// Other external packages (starting with @ or letter)
61+
['^@?\\w'],
62+
// Internal packages (using @ alias)
63+
['^@/'],
64+
// Parent imports (../)
65+
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
66+
// Same directory imports (./)
67+
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
68+
// Type imports
69+
['^.+\\.?(css|scss)$']
70+
]
71+
}
72+
],
73+
'simple-import-sort/exports': 'error',
74+
'import/first': 'error',
75+
'import/newline-after-import': 'error',
76+
'import/no-duplicates': 'error',
77+
'prettier/prettier': 'error',
78+
// Architectural boundary enforcement
79+
'import/no-restricted-paths': [
80+
'error',
81+
{
82+
zones: [
83+
// atoms/ can only import from core/types (not from features, infrastructure, or core utils)
84+
{
85+
target: './src/atoms',
86+
from: './src/features',
87+
message: 'Atoms cannot import from features. Keep atoms dumb and reusable.'
88+
},
89+
{
90+
target: './src/atoms',
91+
from: './src/infrastructure',
92+
message: 'Atoms cannot import from infrastructure. Use props instead of contexts.'
93+
},
94+
{
95+
target: './src/atoms',
96+
from: './src/core',
97+
except: ['./types'],
98+
message: 'Atoms can only import types from core/types, not utilities or business logic.'
99+
},
100+
// core/ cannot import from anything (leaf node)
101+
{
102+
target: './src/core',
103+
from: './src/atoms',
104+
message: 'Core is a leaf node and cannot import from atoms.'
105+
},
106+
{
107+
target: './src/core',
108+
from: './src/features',
109+
message: 'Core is a leaf node and cannot import from features.'
110+
},
111+
{
112+
target: './src/core',
113+
from: './src/infrastructure',
114+
message: 'Core is a leaf node and cannot import from infrastructure.'
115+
},
116+
// infrastructure/ can only import from core/
117+
{
118+
target: './src/infrastructure',
119+
from: './src/atoms',
120+
message: 'Infrastructure cannot import from atoms. Move shared code to core.'
121+
},
122+
{
123+
target: './src/infrastructure',
124+
from: './src/features',
125+
message: 'Infrastructure cannot import from features. Move shared code to core.'
126+
},
127+
// features/ cannot import from other features (prevent cross-feature dependencies)
128+
...crossFeatureRules
129+
]
130+
}
131+
]
132+
},
133+
env: {
134+
browser: true,
135+
es2021: true,
136+
node: true
137+
},
138+
overrides: [
139+
{
140+
files: ['examples/**/*.{js,jsx,ts,tsx}'],
141+
rules: {
142+
'no-console': 'off',
143+
'@typescript-eslint/no-non-null-assertion': 'off'
144+
}
145+
}
146+
]
147+
}

packages/agentflow/.npmignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Source files
2+
/src
3+
/tests
4+
/*.ts
5+
/*.tsx
6+
tsconfig.json
7+
vite.config.ts
8+
9+
# Dev files
10+
.turbo
11+
node_modules
12+
13+
# Keep dist
14+
!dist

packages/agentflow/.prettierignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
dist
2+
node_modules
3+
build
4+
*.config.ts
5+
*.config.js
6+
vite.config.ts
7+
examples/dist
8+
examples/vite.config.ts
9+
pnpm-lock.yaml
10+
package-lock.json

packages/agentflow/.prettierrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"printWidth": 140,
3+
"singleQuote": true,
4+
"jsxSingleQuote": true,
5+
"trailingComma": "none",
6+
"tabWidth": 4,
7+
"semi": false,
8+
"endOfLine": "auto"
9+
}

0 commit comments

Comments
 (0)