@foblex/flow 18.6.0 → 19.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AI.md +113 -9
- package/README.md +5 -0
- package/fesm2022/foblex-flow.mjs +7126 -4545
- package/fesm2022/foblex-flow.mjs.map +1 -1
- package/index.d.ts +4964 -3917
- package/package.json +1 -1
- package/schematics/ng-add/index.d.ts +5 -1
- package/schematics/ng-add/index.js +58 -2
- package/schematics/ng-add/index.js.map +1 -1
- package/schematics/ng-add/schema.json +7 -1
- package/styles/domains/_connector.scss +22 -8
package/package.json
CHANGED
|
@@ -11,8 +11,64 @@ const KNOWN_THEME_STYLE_PATHS = new Set([
|
|
|
11
11
|
DEFAULT_THEME_STYLE_PATH,
|
|
12
12
|
'@foblex/flow/styles/default.scss',
|
|
13
13
|
]);
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
const AGENT_RULES_PATH = 'AGENTS.md';
|
|
15
|
+
const AGENT_RULES_BEGIN = '<!-- BEGIN:foblex-flow-agent-rules -->';
|
|
16
|
+
const AGENT_RULES_END = '<!-- END:foblex-flow-agent-rules -->';
|
|
17
|
+
const AGENT_RULES_BLOCK = `${AGENT_RULES_BEGIN}
|
|
18
|
+
|
|
19
|
+
## Foblex Flow (\`@foblex/flow\`)
|
|
20
|
+
|
|
21
|
+
Before writing any code that uses \`@foblex/flow\`, read the AI guide bundled with the
|
|
22
|
+
package: \`node_modules/@foblex/flow/AI.md\`. It contains the verified API surface, hard
|
|
23
|
+
rules (no React Flow patterns, the app owns graph state), a minimal working setup, and a
|
|
24
|
+
checklist of common silent failures.
|
|
25
|
+
|
|
26
|
+
Additional references:
|
|
27
|
+
|
|
28
|
+
- Complete LLM-readable API reference: https://flow.foblex.com/llms-full.txt
|
|
29
|
+
- Docs index for agents: https://flow.foblex.com/llms.txt
|
|
30
|
+
- Diagnostic codes (\`FFxxxx\` console warnings/errors): https://flow.foblex.com/docs/errors
|
|
31
|
+
- Styling rules: \`node_modules/@foblex/flow/STYLING.md\`
|
|
32
|
+
|
|
33
|
+
${AGENT_RULES_END}`;
|
|
34
|
+
function ngAdd(options = {}) {
|
|
35
|
+
return (0, schematics_1.chain)([
|
|
36
|
+
addDependencies(),
|
|
37
|
+
addDefaultTheme(),
|
|
38
|
+
...(options.skipAgentRules ? [] : [addAgentRules()]),
|
|
39
|
+
installDependencies(),
|
|
40
|
+
]);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Writes a marker-delimited Foblex Flow section into the workspace `AGENTS.md`, so AI
|
|
44
|
+
* coding agents (Cursor, Copilot, Claude Code, Codex, …) read the bundled
|
|
45
|
+
* `node_modules/@foblex/flow/AI.md` before generating code. Re-running `ng add` only
|
|
46
|
+
* rewrites the managed block; the rest of the file is left untouched.
|
|
47
|
+
*/
|
|
48
|
+
function addAgentRules() {
|
|
49
|
+
return (tree, context) => {
|
|
50
|
+
var _a, _b;
|
|
51
|
+
const existing = tree.exists(AGENT_RULES_PATH)
|
|
52
|
+
? ((_b = (_a = tree.read(AGENT_RULES_PATH)) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '')
|
|
53
|
+
: null;
|
|
54
|
+
if (existing === null) {
|
|
55
|
+
tree.create(AGENT_RULES_PATH, `# AGENTS.md\n\n${AGENT_RULES_BLOCK}\n`);
|
|
56
|
+
context.logger.info(`✅ Created "${AGENT_RULES_PATH}" with Foblex Flow agent rules.`);
|
|
57
|
+
return tree;
|
|
58
|
+
}
|
|
59
|
+
const begin = existing.indexOf(AGENT_RULES_BEGIN);
|
|
60
|
+
const end = existing.indexOf(AGENT_RULES_END);
|
|
61
|
+
const updated = begin >= 0 && end > begin
|
|
62
|
+
? existing.slice(0, begin) +
|
|
63
|
+
AGENT_RULES_BLOCK +
|
|
64
|
+
existing.slice(end + AGENT_RULES_END.length)
|
|
65
|
+
: `${existing.replace(/\s*$/, '')}\n\n${AGENT_RULES_BLOCK}\n`;
|
|
66
|
+
if (updated !== existing) {
|
|
67
|
+
tree.overwrite(AGENT_RULES_PATH, updated);
|
|
68
|
+
context.logger.info(`✅ Updated Foblex Flow agent rules in "${AGENT_RULES_PATH}".`);
|
|
69
|
+
}
|
|
70
|
+
return tree;
|
|
71
|
+
};
|
|
16
72
|
}
|
|
17
73
|
function addDependencies() {
|
|
18
74
|
return (tree, context) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/f-flow/schematics/ng-add/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/f-flow/schematics/ng-add/index.ts"],"names":[],"mappings":";;AAyCA,sBAOC;AA/CD,2DAAiF;AACjF,4DAA0E;AAC1E,yDAA8D;AAC9D,2EAGkD;AAClD,uEAAmE;AAEnE,MAAM,wBAAwB,GAAG,+CAA+C,CAAC;AACjF,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAC;IACtC,wBAAwB;IACxB,kCAAkC;CACnC,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG,WAAW,CAAC;AACrC,MAAM,iBAAiB,GAAG,wCAAwC,CAAC;AACnE,MAAM,eAAe,GAAG,sCAAsC,CAAC;AAC/D,MAAM,iBAAiB,GAAG,GAAG,iBAAiB;;;;;;;;;;;;;;;;EAgB5C,eAAe,EAAE,CAAC;AAMpB,SAAgB,KAAK,CAAC,UAAwB,EAAE;IAC9C,OAAO,IAAA,kBAAK,EAAC;QACX,eAAe,EAAE;QACjB,eAAe,EAAE;QACjB,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC;QACpD,mBAAmB,EAAE;KACtB,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,SAAS,aAAa;IACpB,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;;QAC/C,MAAM,QAAQ,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I,CAAC,4CAA4C,CAAC,CAAC;QAElE,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -3,5 +3,11 @@
|
|
|
3
3
|
"$id": "NgAdd",
|
|
4
4
|
"title": "Foblex Flow ng-add",
|
|
5
5
|
"type": "object",
|
|
6
|
-
"properties": {
|
|
6
|
+
"properties": {
|
|
7
|
+
"skipAgentRules": {
|
|
8
|
+
"type": "boolean",
|
|
9
|
+
"default": false,
|
|
10
|
+
"description": "Skip writing the Foblex Flow section into the workspace AGENTS.md (AI agent rules)."
|
|
11
|
+
}
|
|
12
|
+
}
|
|
7
13
|
}
|
|
@@ -80,15 +80,18 @@
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
&.f-node-output-connected,
|
|
83
|
-
&.f-node-input-connected
|
|
83
|
+
&.f-node-input-connected,
|
|
84
|
+
&.f-connector-connected {
|
|
84
85
|
background: var(--ff-connector-connected-color);
|
|
85
86
|
border-color: var(--ff-connector-connected-color);
|
|
86
87
|
}
|
|
87
88
|
|
|
88
89
|
&.f-node-output-not-connectable,
|
|
89
90
|
&.f-node-input-not-connectable,
|
|
91
|
+
&.f-connector-not-connectable,
|
|
90
92
|
&.f-node-input-disabled,
|
|
91
|
-
&.f-node-output-disabled
|
|
93
|
+
&.f-node-output-disabled,
|
|
94
|
+
&.f-connector-disabled {
|
|
92
95
|
background: var(--ff-connector-disabled-color);
|
|
93
96
|
border-color: var(--ff-connector-disabled-border-color);
|
|
94
97
|
box-shadow: none;
|
|
@@ -101,13 +104,17 @@
|
|
|
101
104
|
} @else {
|
|
102
105
|
@include _connector-scope($scoped) {
|
|
103
106
|
.f-node-input,
|
|
104
|
-
.f-node-output
|
|
107
|
+
.f-node-output,
|
|
108
|
+
.f-connector-source,
|
|
109
|
+
.f-connector-target,
|
|
110
|
+
.f-connector-source-target {
|
|
105
111
|
&:not(.f-node) {
|
|
106
112
|
@include _socket-frame();
|
|
107
113
|
}
|
|
108
114
|
}
|
|
109
115
|
|
|
110
|
-
.f-node-input
|
|
116
|
+
.f-node-input,
|
|
117
|
+
.f-connector-target {
|
|
111
118
|
&:not(.f-node) {
|
|
112
119
|
border-radius: var(--ff-connector-input-radius);
|
|
113
120
|
}
|
|
@@ -115,9 +122,14 @@
|
|
|
115
122
|
|
|
116
123
|
.f-connections-dragging {
|
|
117
124
|
.f-node-input,
|
|
118
|
-
.f-node-output
|
|
125
|
+
.f-node-output,
|
|
126
|
+
.f-connector-source,
|
|
127
|
+
.f-connector-target,
|
|
128
|
+
.f-connector-source-target {
|
|
119
129
|
&:not(.f-connector-connectable) {
|
|
120
|
-
&:not(.f-node-input-connected):not(.f-node-output-connected)
|
|
130
|
+
&:not(.f-node-input-connected):not(.f-node-output-connected):not(
|
|
131
|
+
.f-connector-connected
|
|
132
|
+
) {
|
|
121
133
|
border-color: var(--ff-connector-disabled-border-color);
|
|
122
134
|
}
|
|
123
135
|
}
|
|
@@ -129,7 +141,8 @@
|
|
|
129
141
|
|
|
130
142
|
@mixin connector-outlet($scoped: true) {
|
|
131
143
|
@include _connector-scope($scoped) {
|
|
132
|
-
.f-node-outlet
|
|
144
|
+
.f-node-outlet,
|
|
145
|
+
.f-connector-outlet {
|
|
133
146
|
display: inline-flex;
|
|
134
147
|
align-items: center;
|
|
135
148
|
justify-content: center;
|
|
@@ -143,7 +156,8 @@
|
|
|
143
156
|
color: var(--ff-outlet-color);
|
|
144
157
|
pointer-events: all;
|
|
145
158
|
|
|
146
|
-
&.f-node-outlet-disabled
|
|
159
|
+
&.f-node-outlet-disabled,
|
|
160
|
+
&.f-connector-disabled {
|
|
147
161
|
background: var(--ff-outlet-disabled-background-color);
|
|
148
162
|
border-color: var(--ff-outlet-disabled-border-color);
|
|
149
163
|
color: var(--ff-outlet-disabled-color);
|