@flowdrop/flowdrop 1.8.0 → 1.8.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.
|
@@ -82,6 +82,13 @@ export function extractCommands(llmResponse) {
|
|
|
82
82
|
currentExplanation.push(line);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
+
// Flush dangling multiline buffer (LLM never closed """ and the response
|
|
86
|
+
// ended before any closing fence). Surface as a command so the parser
|
|
87
|
+
// produces a visible error rather than silently dropping the content.
|
|
88
|
+
if (multilineBuffer !== null) {
|
|
89
|
+
commands.push(multilineBuffer.join('\n'));
|
|
90
|
+
multilineBuffer = null;
|
|
91
|
+
}
|
|
85
92
|
// Flush remaining explanation text
|
|
86
93
|
if (currentExplanation.length > 0) {
|
|
87
94
|
explanationParts.push(currentExplanation.join('\n'));
|
package/dist/commands/parser.js
CHANGED
|
@@ -259,6 +259,18 @@ export function parseCommand(input) {
|
|
|
259
259
|
if (!trimmed) {
|
|
260
260
|
return { ok: false, error: 'Empty command', input };
|
|
261
261
|
}
|
|
262
|
+
// Detect an unclosed multiline """ block — common when a low-quality LLM
|
|
263
|
+
// omits the closing """ on its own line. The opener pattern is `"""\n`
|
|
264
|
+
// (triple-quote followed by a newline), and a well-formed value must end
|
|
265
|
+
// with `"""`. If we see the opener but not the closer, surface a clear
|
|
266
|
+
// error instead of falling through to a generic "Invalid syntax".
|
|
267
|
+
if (trimmed.includes('"""\n') && !trimmed.endsWith('"""')) {
|
|
268
|
+
return {
|
|
269
|
+
ok: false,
|
|
270
|
+
error: 'Unclosed """ block — missing closing """ on its own line',
|
|
271
|
+
input
|
|
272
|
+
};
|
|
273
|
+
}
|
|
262
274
|
for (const rule of rules) {
|
|
263
275
|
const match = trimmed.match(rule.pattern);
|
|
264
276
|
if (match) {
|
|
@@ -191,6 +191,11 @@
|
|
|
191
191
|
const msg = displayMessages[messageIndex];
|
|
192
192
|
if (!msg?.commandPreview) return;
|
|
193
193
|
|
|
194
|
+
// Capture pre-existing parse errors before execution. If the LLM produced
|
|
195
|
+
// a malformed batch (e.g. unclosed """), retrying tends to reproduce the
|
|
196
|
+
// same shape and just locks the input behind isLoading for the cascade.
|
|
197
|
+
const hadParseErrors = msg.commandPreview.some((c) => c.status === 'error');
|
|
198
|
+
|
|
194
199
|
const context = getCommandContext();
|
|
195
200
|
if (!context) {
|
|
196
201
|
for (const cmd of msg.commandPreview) {
|
|
@@ -271,7 +276,12 @@
|
|
|
271
276
|
return;
|
|
272
277
|
}
|
|
273
278
|
|
|
274
|
-
if (
|
|
279
|
+
if (
|
|
280
|
+
!hadParseErrors &&
|
|
281
|
+
getBehaviorSettings().chatAutoRetry &&
|
|
282
|
+
workflowId &&
|
|
283
|
+
autoRetryCount < MAX_AUTO_RETRIES
|
|
284
|
+
) {
|
|
275
285
|
autoRetryCount++;
|
|
276
286
|
const errorText = buildBatchErrorMessage(
|
|
277
287
|
completedCount,
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "A drop-in visual workflow editor for any web application. You own the backend. You own the data. You own the orchestration.",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"private": false,
|
|
6
|
-
"version": "1.8.
|
|
6
|
+
"version": "1.8.1",
|
|
7
7
|
"author": "Shibin Das (D34dMan)",
|
|
8
8
|
"bugs": {
|
|
9
9
|
"url": "https://github.com/flowdrop-io/flowdrop/issues"
|