@manny-est/node-red-flowpilot 0.3.0 → 0.4.1
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/CHANGELOG.md +35 -0
- package/PROJECT-OVERVIEW.md +42 -7
- package/README.md +15 -0
- package/USER-GUIDE.md +45 -1
- package/flowpilot-core.css +1189 -0
- package/flowpilot-core.js +6427 -0
- package/flowpilot.html +9 -5896
- package/flowpilot.js +280 -29
- package/lib/build-system-prompt.js +32 -0
- package/lib/default-system-prompt.js +0 -2
- package/lib/generation-system-prompt.js +5 -1
- package/lib/modify-system-prompt.js +16 -6
- package/lib/persona-prompt.js +74 -0
- package/lib/popout/view.html +33 -0
- package/lib/storage.js +26 -0
- package/package.json +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,41 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to FlowPilot are documented here.
|
|
4
4
|
|
|
5
|
+
## [0.4.1] - 2026-06-29
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- **Critical**: the editor hung at "Loading plugins" on any Node-RED instance with `adminAuth` enabled, due to a 401 on `/flowpilot/core.js`. 0.4.0's pop-out refactor moved FlowPilot's frontend into a separately-served script, but the route serving it (along with `core.css` and the pop-out's `view.html`) was gated behind `RED.auth.needsPermission(...)` — a check that requires an `Authorization` header, which a plain `<script src>`/`<link>`/`window.open` request can never carry. These three static client-asset routes are no longer gated (they contain no secrets); every data/action route is unaffected and still requires authentication exactly as before.
|
|
9
|
+
- **Critical**, found while verifying the fix above: every settings/chat/generate/document/modify/build request (anything going through the shared `ajaxJson` helper) also failed with "Unauthorized" on `adminAuth` instances, for the same root cause — these requests use an absolute URL (needed for the pop-out to resolve correctly), and Node-RED's editor only auto-attaches the admin auth token to relative URLs. The SSE-streaming `fetch()` calls already worked around this (`fetchHeaders()`); `ajaxJson` now attaches the same bearer token itself.
|
|
10
|
+
|
|
11
|
+
## [0.4.0] - 2026-06-27
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
- Personality slider in Settings → Behavior (1-10): 1 is a plain Node-RED engineer, 10 is a comically over-the-top airline captain who happens to be a Node-RED expert. Default (3) matches the original "subtle co-pilot" voice. Applies to Chat replies AND the natural-language "explanation" field of Generate/Document/Modify (e.g. announcing a flow it just built) — never to node names, ids, or any structural JSON. Explanations, troubleshooting, diffs, and errors always stay plain and accurate regardless of intensity. Generated fresh per request from the slider value via `lib/persona-prompt.js`, rather than being baked into the persisted system prompt.
|
|
15
|
+
- Copy button on every code block shown in chat (Preview JSON/debug, or any code the model pastes inline) — previously only the Generate/Document/Modify review panel's JSON tab had one.
|
|
16
|
+
- `/compact` and `/expand` slash commands — hide/restore labels on the selected node(s), instant and deterministic (no AI round-trip). Invokes Node-RED's own native `core:hide-selected-node-labels`/`core:show-selected-node-labels` actions directly, so group-member expansion, no-op skipping, and one-Ctrl+Z batching across the whole selection are handled by Node-RED itself, not reimplemented.
|
|
17
|
+
- `/build` — describe a goal in plain language and FlowPilot plans it, proposes a first flow, then walks an interactive build → deploy → attach debug output → review → fix loop with you, bounded by a configurable iteration cap (Settings → Behavior, default 5). Every proposal and fix still goes through the same diff-review-then-Apply flow as Modify — nothing auto-applies, and the AI never deploys for you.
|
|
18
|
+
- A detached pop-out window (new header icon) mirrors the full cockpit — chat, action bar, status strip, slash commands, mode switching — in its own browser window, useful on multi-monitor setups. Sending, Clear Chat, and Apply for Generate/Document/Modify/Build review panels all work from the pop-out; it closes automatically if the main editor window does.
|
|
19
|
+
- Group awareness: FlowPilot now sees which group a selected node belongs to, and Generate/Build/Modify can create, extend, rename, and ungroup visual groups (a real bordered container, not just a label) — not just individual nodes.
|
|
20
|
+
- `/disable` and `/enable` slash commands — disable/re-enable the selected node(s) (skipped on Deploy without removing them), instant and deterministic (no AI round-trip), same mechanism as `/compact`/`/expand`.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
- Removed the static "Personality:" paragraph from the default system prompt — superseded by the slider above. Existing users with that exact paragraph already saved in a customized system prompt get it surgically stripped on next load/save; any other customization they made is preserved.
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
- Setting the Personality slider to 10 still felt mild — the prompt's own closing line ("a little goes a long way even at high intensity") undercut the "go all out" instruction for max intensity. The restraint instruction now scales with intensity: low/mid stays subtle, 8-10 explicitly says to lean all the way in on every qualifying moment instead of holding back.
|
|
27
|
+
- The Personality slider's thumb didn't reach the true ends of the track — a generic `.fp-form input` rule applied an 8px padding + border to every input including the new range slider, insetting the native track from both edges. Range inputs now get zero padding/border.
|
|
28
|
+
- Markdown tables in chat replies rendered as raw, broken-looking `| a | b |` text — `renderMarkdown()` never had table support at all. Added GFM-style pipe table rendering.
|
|
29
|
+
- Fenced code blocks indented under a list item (e.g. "1. Try this:\n ```bash\n ...\n ```", which models produce constantly) failed to render as code at all — the fence-detection regex required zero leading whitespace, so the whole block fell through as plain paragraph text with the literal ` ``` ` markers visible. Fence detection now tolerates leading whitespace.
|
|
30
|
+
- The Debug log list showed newest-first, so finding a just-arrived message in a long buffer meant scrolling up past everything else. Now oldest-first/newest-last, matching the chat panel's natural scroll-to-bottom behavior.
|
|
31
|
+
- A stopped, errored, or empty-response turn could leave a dangling, unanswered entry in conversation history (pushed before the request, never rolled back on failure), corrupting the shape of every later request in that conversation.
|
|
32
|
+
- The model's JSON envelope could fail to parse, or get confused with an unrelated JSON-looking snippet embedded in its own prose (e.g. inline code like `{{payload}}`, or an illustrative logging example), when something brace-shaped appeared before the real envelope. Candidates are now matched with string-aware brace matching and must look like a recognized envelope shape before being accepted.
|
|
33
|
+
- The `/build` loop could judge a step "done" against only the first of several debug messages fired by one trigger (e.g. after a flow got accidentally forked), missing the full picture. It now waits briefly for all messages from one trigger before reviewing them together, and explicitly checks off each goal requirement instead of trusting a "looks plausible" read.
|
|
34
|
+
- The pop-out window's Settings request 404'd, because every internal URL was relative — correct from the main editor's route, but one level too deep from the pop-out's own nested route.
|
|
35
|
+
- Selecting a GROUP itself (its border/background, not a member node) showed "1 node selected" instead of expanding to its actual members, and the group's internal wiring wasn't included as context either.
|
|
36
|
+
- "Ungroup" could report success while changing nothing (the model was targeting a non-real `group` property instead of actual membership); separately, a model correctly using the documented group-creation field could have its result silently dropped before ever reaching the apply step. Both fixed.
|
|
37
|
+
- Fully ungrouping (reconciling a group down to zero members) emptied the group's membership but left a small, empty group container behind on the canvas instead of removing it — now matches what Node-RED's own "Ungroup Selection" does.
|
|
38
|
+
- Modify's node-insertion step could, on a partial failure (e.g. 2 of 3 new nodes succeed, the 3rd doesn't), leave the successful ones on the canvas with no undo entry and no message acknowledging anything had landed — now always covers whatever succeeded with one undo step, and reports a partial result honestly instead of staying silent about it.
|
|
39
|
+
|
|
5
40
|
## [0.3.0] - 2026-06-23
|
|
6
41
|
|
|
7
42
|
### Added
|
package/PROJECT-OVERVIEW.md
CHANGED
|
@@ -45,10 +45,27 @@ top of a stable foundation, with a working, reviewable build at every step:
|
|
|
45
45
|
information *before* answering or proposing a change — an
|
|
46
46
|
"explore-then-propose" loop, bounded by a step count and token ceiling,
|
|
47
47
|
with a visible cost summary and a Stop button.
|
|
48
|
+
- **Phase 8 — Issue fixes and NR5 support.** Closed early user-reported
|
|
49
|
+
issues (a stuck "streaming" indicator, missing wiring on some generated
|
|
50
|
+
flows, an unconfigurable request timeout, an unexplained temperature
|
|
51
|
+
setting), declared and verified Node-RED 5.x support, added "Preview
|
|
52
|
+
JSON/debug" links so users can see exactly what a request will send, and
|
|
53
|
+
an opt-out redaction toggle for local/private AI setups.
|
|
54
|
+
- **Phase 8.5 — Personality, an agentic build loop, a pop-out window, and
|
|
55
|
+
group handling.** A captain-personality slider (separate from technical
|
|
56
|
+
accuracy, which never changes), deterministic `/compact`/`/expand` label
|
|
57
|
+
commands, and a `/build` command that closes FlowPilot's biggest
|
|
58
|
+
remaining gap: a *visible, user-gated* build → deploy → attach debug
|
|
59
|
+
output → review → fix loop, instead of generating a flow and never
|
|
60
|
+
finding out if it works. A detached pop-out window mirrors the full
|
|
61
|
+
cockpit in its own browser window for multi-monitor setups. FlowPilot can
|
|
62
|
+
now also see and manage visual groups (create, extend, rename, ungroup),
|
|
63
|
+
not just individual nodes.
|
|
48
64
|
|
|
49
65
|
Throughout, every phase preserved the same core guarantees: nothing is sent
|
|
50
66
|
without the user's selection or request, every proposed change is a
|
|
51
|
-
reviewable diff, and every applied change is a normal Node-RED undo step
|
|
67
|
+
reviewable diff, and every applied change is a normal Node-RED undo step —
|
|
68
|
+
including every step of the `/build` loop and every group mutation.
|
|
52
69
|
|
|
53
70
|
## Current feature set
|
|
54
71
|
|
|
@@ -81,18 +98,36 @@ reviewable diff, and every applied change is a normal Node-RED undo step.
|
|
|
81
98
|
typing a model name blind.
|
|
82
99
|
- **`/demo`** — a guided first request that walks through Generate end to
|
|
83
100
|
end.
|
|
101
|
+
- **`/compact` / `/expand`** — instantly hide/restore the selected node(s)'
|
|
102
|
+
labels, no AI round-trip.
|
|
103
|
+
- **`/build`** — a visible, user-gated build → deploy → attach debug output
|
|
104
|
+
→ review → fix loop for "make this actually work," bounded by a
|
|
105
|
+
configurable iteration cap.
|
|
106
|
+
- **Group handling** — context includes a selected node's group membership;
|
|
107
|
+
Generate/Build/Modify can create, extend, rename, and ungroup visual
|
|
108
|
+
groups.
|
|
109
|
+
- **Personality slider** — adjustable captain-voice intensity (1-10) for
|
|
110
|
+
conversational framing; technical content always stays plain.
|
|
111
|
+
- **Pop-out window** — the full cockpit (chat, action bar, status strip,
|
|
112
|
+
slash commands) in a separate browser window.
|
|
84
113
|
|
|
85
114
|
## Architecture at a glance
|
|
86
115
|
|
|
87
|
-
- **`flowpilot.html`** — the editor-side plugin:
|
|
88
|
-
|
|
89
|
-
|
|
116
|
+
- **`flowpilot.html`** — the editor-side plugin entry point: registers the
|
|
117
|
+
sidebar panel and loads the shared client module below.
|
|
118
|
+
- **`flowpilot-core.js`** — the shared client logic (chat/generate/modify/
|
|
119
|
+
document/build, selection/context handling, settings UI, diff review and
|
|
120
|
+
apply, group mutations) — used by both the sidebar and the pop-out window,
|
|
121
|
+
so they stay in sync by construction rather than by copy-pasted code.
|
|
122
|
+
Served via a dedicated static route alongside the pop-out's own minimal
|
|
123
|
+
page (`lib/popout/view.html`), which loads this same module and relays
|
|
124
|
+
state to/from the main editor window over `postMessage`.
|
|
90
125
|
- **`flowpilot.js`** — the Node-RED runtime plugin: HTTP routes
|
|
91
126
|
(`/flowpilot/*`), provider calls, response parsing/validation, and audit
|
|
92
127
|
logging.
|
|
93
|
-
- **`lib/`** — system prompts (default/generation/document/modify
|
|
94
|
-
OpenAI-compatible provider adapter, and on-disk storage
|
|
95
|
-
transcripts, audit log).
|
|
128
|
+
- **`lib/`** — system prompts (default/generation/document/modify/build/
|
|
129
|
+
persona), the OpenAI-compatible provider adapter, and on-disk storage
|
|
130
|
+
(settings, transcripts, audit log).
|
|
96
131
|
- **Storage** — FlowPilot keeps its own settings, audit log, and
|
|
97
132
|
per-conversation transcripts under `<node-red-userDir>/flowpilot/`,
|
|
98
133
|
separate from the plugin code itself.
|
package/README.md
CHANGED
|
@@ -73,6 +73,21 @@ See the [User Guide](USER-GUIDE.md#privacy-and-safety) for the full details.
|
|
|
73
73
|
- **Clarifying questions** — if an instruction is too vague to act on
|
|
74
74
|
safely, FlowPilot asks ONE question instead of guessing.
|
|
75
75
|
- **Streaming replies** — optional SSE streaming for chat responses.
|
|
76
|
+
- **`/build`** — describe a goal and FlowPilot plans it, proposes a first
|
|
77
|
+
flow, then walks an interactive build → deploy → debug → review → fix loop
|
|
78
|
+
with you, bounded by a configurable iteration cap. Every step still goes
|
|
79
|
+
through the same diff-review-then-apply flow as Modify.
|
|
80
|
+
- **Group handling** — FlowPilot sees which group a selected node belongs to,
|
|
81
|
+
and Generate/Build/Modify can create, extend, rename, and ungroup visual
|
|
82
|
+
groups, not just individual nodes.
|
|
83
|
+
- **Pop-out window** — the full chat/action-bar/status-strip cockpit in a
|
|
84
|
+
separate browser window, handy for multi-monitor setups.
|
|
85
|
+
- **Personality slider** — an adjustable captain-voice intensity (1-10) for
|
|
86
|
+
conversational framing; technical content (explanations, diffs, errors)
|
|
87
|
+
always stays plain regardless of setting.
|
|
88
|
+
- **`/compact` / `/expand` / `/disable` / `/enable`** — instant, deterministic
|
|
89
|
+
slash commands for label visibility and enabling/disabling the selected
|
|
90
|
+
node(s); no AI round-trip.
|
|
76
91
|
|
|
77
92
|
## Requirements
|
|
78
93
|
|
package/USER-GUIDE.md
CHANGED
|
@@ -144,6 +144,15 @@ canvas, FlowPilot sees their configuration and wiring (sanitized — see
|
|
|
144
144
|
Chat remembers recent exchanges (configurable under **Behavior → Remember
|
|
145
145
|
last N exchanges**) so you can have a back-and-forth conversation.
|
|
146
146
|
|
|
147
|
+
### Personality
|
|
148
|
+
|
|
149
|
+
**Settings → Behavior → Personality** is a 1-10 slider controlling how much
|
|
150
|
+
of a subtle airline-captain voice FlowPilot's conversational replies carry —
|
|
151
|
+
1 is a plain Node-RED engineer, 10 leans all the way into the bit. It only
|
|
152
|
+
affects framing language (greetings, transitions, "what can you do?").
|
|
153
|
+
Explanations, diffs, troubleshooting, and errors always stay plain and
|
|
154
|
+
accurate regardless of the setting.
|
|
155
|
+
|
|
147
156
|
### Query intents: Explain, Troubleshoot, Review, Suggest
|
|
148
157
|
|
|
149
158
|
One-click buttons that pre-fill the prompt box with a ready-to-edit
|
|
@@ -191,6 +200,27 @@ change is a single native Node-RED undo step (Ctrl+Z).
|
|
|
191
200
|
|
|
192
201
|

|
|
193
202
|
|
|
203
|
+
### Group handling
|
|
204
|
+
|
|
205
|
+
FlowPilot can see which visual group a selected node belongs to, and
|
|
206
|
+
Generate/Build/Modify can create, extend, rename, and ungroup visual groups
|
|
207
|
+
(the same bordered containers as the editor's own "Group selection") — not
|
|
208
|
+
just individual nodes. Select grouped nodes and describe the grouping you
|
|
209
|
+
want, or mention an existing group by name in a Modify instruction; review
|
|
210
|
+
and apply like any other change.
|
|
211
|
+
|
|
212
|
+
### Build (the agentic loop)
|
|
213
|
+
|
|
214
|
+
Describe a goal (e.g. "fetch the weather every hour and log it to a file")
|
|
215
|
+
and arm **Build**, or type `/build <goal>` directly. FlowPilot plans the
|
|
216
|
+
work, proposes a first flow, and once you apply and deploy it, walks an
|
|
217
|
+
interactive loop with you: attach the resulting Debug output, FlowPilot
|
|
218
|
+
reviews it against the goal, and either confirms it's working or proposes a
|
|
219
|
+
fix — repeating until it works or a configurable attempt limit is reached
|
|
220
|
+
(**Settings → Behavior → Build loop iteration cap**). Every proposal and fix
|
|
221
|
+
still goes through the same review-then-apply flow as Modify — FlowPilot
|
|
222
|
+
never deploys for you.
|
|
223
|
+
|
|
194
224
|
### Document
|
|
195
225
|
|
|
196
226
|
Select node(s), arm **Document**, and (optionally) add notes about what you
|
|
@@ -211,6 +241,16 @@ summarizing the selection, which you review and place like any other change.
|
|
|
211
241
|
|
|
212
242
|

|
|
213
243
|
|
|
244
|
+
### Pop-out window
|
|
245
|
+
|
|
246
|
+
Click the pop-out icon in the sidebar header to open FlowPilot's full
|
|
247
|
+
cockpit — chat, action bar, status strip, slash commands — in its own
|
|
248
|
+
browser window. Handy for multi-monitor setups: keep the conversation and
|
|
249
|
+
diffs visible on one screen while the canvas fills another. Sending, Clear
|
|
250
|
+
Chat, mode switching, and Apply for Generate/Document/Modify/Build review
|
|
251
|
+
panels all work from the pop-out; it closes automatically if the main editor
|
|
252
|
+
window does.
|
|
253
|
+
|
|
214
254
|
### Debug context attachment
|
|
215
255
|
|
|
216
256
|
Click the **bug icon** to view recent messages from Node-RED's Debug sidebar.
|
|
@@ -266,12 +306,16 @@ Behavior → Stream chat replies**.
|
|
|
266
306
|
Type these directly into the prompt box:
|
|
267
307
|
|
|
268
308
|
- `/help` — show the full command/feature briefing
|
|
269
|
-
- `/generate`, `/document`, `/modify` — arm that Execute mode
|
|
309
|
+
- `/generate`, `/document`, `/modify`, `/build` — arm that Execute mode
|
|
270
310
|
- `/query` (or `/chat`) — back to Query mode
|
|
271
311
|
- `/clear` — start a fresh conversation (clears chat and memory)
|
|
272
312
|
- `/history` — open the Flight log
|
|
273
313
|
- `/settings` — open Settings
|
|
274
314
|
- `/demo` — load a sample Generate request into the prompt box
|
|
315
|
+
- `/compact` / `/expand` — hide/restore labels on the selected node(s),
|
|
316
|
+
instant and deterministic, no AI round-trip
|
|
317
|
+
- `/disable` / `/enable` — disable/re-enable the selected node(s) (skipped on
|
|
318
|
+
Deploy without removing them), instant and deterministic, no AI round-trip
|
|
275
319
|
|
|
276
320
|

|
|
277
321
|
|