fluxflow-cli 1.18.14 → 1.18.16
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/dist/fluxflow.js +135 -96
- package/package.json +1 -1
package/dist/fluxflow.js
CHANGED
|
@@ -1033,15 +1033,27 @@ var init_arg_parser = __esm({
|
|
|
1033
1033
|
while (searchIndex < argsString.length) {
|
|
1034
1034
|
let qIdx = argsString.indexOf(quote, searchIndex);
|
|
1035
1035
|
if (qIdx === -1) break;
|
|
1036
|
-
|
|
1036
|
+
let backslashCount = 0;
|
|
1037
|
+
for (let k = qIdx - 1; k >= 0 && argsString[k] === "\\"; k--) {
|
|
1038
|
+
backslashCount++;
|
|
1039
|
+
}
|
|
1040
|
+
if (backslashCount % 2 !== 0) {
|
|
1037
1041
|
searchIndex = qIdx + 1;
|
|
1038
1042
|
continue;
|
|
1039
1043
|
}
|
|
1040
|
-
const
|
|
1044
|
+
const afterRaw = argsString.substring(qIdx + 1);
|
|
1045
|
+
const after = afterRaw.trim();
|
|
1041
1046
|
const isLogicalEnd = after === "" || // End of entire string
|
|
1042
1047
|
after.startsWith(",") || // Next argument separator
|
|
1043
1048
|
/^(\w+)\s*=/.test(after) || // Next argument key=
|
|
1044
1049
|
after.startsWith(")") && (after.length === 1 || /^\)\s*([,\]\s]|tool:)/i.test(after));
|
|
1050
|
+
if (isLogicalEnd && afterRaw.startsWith("\n")) {
|
|
1051
|
+
const nextLine = after.split("\n")[0];
|
|
1052
|
+
if (!nextLine.includes("=") && !nextLine.includes(")")) {
|
|
1053
|
+
searchIndex = qIdx + 1;
|
|
1054
|
+
continue;
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1045
1057
|
if (isLogicalEnd) {
|
|
1046
1058
|
end = qIdx;
|
|
1047
1059
|
break;
|
|
@@ -1056,18 +1068,21 @@ var init_arg_parser = __esm({
|
|
|
1056
1068
|
i = argsString.length;
|
|
1057
1069
|
}
|
|
1058
1070
|
const isPathKey = key.toLowerCase().includes("path") || ["dest", "source", "to", "from"].includes(key.toLowerCase());
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1071
|
+
value = value.replace(/\\(.)/g, (match, char) => {
|
|
1072
|
+
switch (char) {
|
|
1073
|
+
case "n":
|
|
1074
|
+
return "\n";
|
|
1075
|
+
case "r":
|
|
1076
|
+
return "\r";
|
|
1077
|
+
case "t":
|
|
1078
|
+
return " ";
|
|
1079
|
+
case "\\":
|
|
1080
|
+
return "\\";
|
|
1081
|
+
default:
|
|
1082
|
+
if (char === quote) return quote;
|
|
1083
|
+
return match;
|
|
1069
1084
|
}
|
|
1070
|
-
}
|
|
1085
|
+
});
|
|
1071
1086
|
} else if (i < argsString.length && argsString[i] === "[") {
|
|
1072
1087
|
let balance = 0;
|
|
1073
1088
|
let inString = null;
|
|
@@ -1075,10 +1090,16 @@ var init_arg_parser = __esm({
|
|
|
1075
1090
|
let end = -1;
|
|
1076
1091
|
for (let j = i; j < argsString.length; j++) {
|
|
1077
1092
|
const char = argsString[j];
|
|
1078
|
-
if (
|
|
1093
|
+
if (inString && char === inString) {
|
|
1094
|
+
let backslashCount = 0;
|
|
1095
|
+
for (let k = j - 1; k >= 0 && argsString[k] === "\\"; k--) {
|
|
1096
|
+
backslashCount++;
|
|
1097
|
+
}
|
|
1098
|
+
if (backslashCount % 2 === 0) {
|
|
1099
|
+
inString = null;
|
|
1100
|
+
}
|
|
1101
|
+
} else if (!inString && (char === '"' || char === "'" || char === "`")) {
|
|
1079
1102
|
inString = char;
|
|
1080
|
-
} else if (inString && char === inString && argsString[j - 1] !== "\\") {
|
|
1081
|
-
inString = null;
|
|
1082
1103
|
}
|
|
1083
1104
|
if (!inString) {
|
|
1084
1105
|
if (char === "[") balance++;
|
|
@@ -1152,8 +1173,8 @@ STRICT POLICY
|
|
|
1152
1173
|
Suggest best options; don't ask for preferences
|
|
1153
1174
|
|
|
1154
1175
|
- WEB TOOLS -
|
|
1155
|
-
1. [tool:functions.WebSearch(query="...", limit=number)]. Limit 3-10. Proactive use for unknown topics
|
|
1156
|
-
2. [tool:functions.WebScrape(url="...")].
|
|
1176
|
+
1. [tool:functions.WebSearch(query="...", limit=number)]. Limit 3-10. Proactive use for unknown topics
|
|
1177
|
+
2. [tool:functions.WebScrape(url="...")]. Proactive use for specific webpage/docs/api
|
|
1157
1178
|
|
|
1158
1179
|
${mode === "Flux" ? `- PROJECT TOOLS (path = relative to CWD) -
|
|
1159
1180
|
1. [tool:functions.ReadFile(path="...", startLine=number, endLine=number)]. Supports images/docs. User gives image/doc: VIEW FIRST
|
|
@@ -5106,30 +5127,36 @@ ${originalTextProcessed.length > USER_CONTEXT_LENGTH ? "... (truncated) ...\n\n"
|
|
|
5106
5127
|
const startIdx = match.index + match[0].length - 1;
|
|
5107
5128
|
let balance = 0;
|
|
5108
5129
|
let inString = null;
|
|
5109
|
-
let isEscaped = false;
|
|
5110
5130
|
let endIdx = -1;
|
|
5111
5131
|
for (let i = startIdx; i < text.length; i++) {
|
|
5112
5132
|
const char = text[i];
|
|
5113
|
-
if (
|
|
5114
|
-
inString
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
|
|
5133
|
+
if (inString) {
|
|
5134
|
+
if (char === inString) {
|
|
5135
|
+
let backslashCount = 0;
|
|
5136
|
+
for (let j = i - 1; j >= 0 && text[j] === "\\"; j--) {
|
|
5137
|
+
backslashCount++;
|
|
5138
|
+
}
|
|
5139
|
+
if (backslashCount % 2 === 0) {
|
|
5140
|
+
inString = null;
|
|
5141
|
+
}
|
|
5142
|
+
}
|
|
5143
|
+
} else {
|
|
5144
|
+
if (char === '"' || char === "'" || char === "`") {
|
|
5145
|
+
inString = char;
|
|
5146
|
+
} else if (char === "(") {
|
|
5147
|
+
balance++;
|
|
5148
|
+
} else if (char === ")") {
|
|
5149
|
+
balance--;
|
|
5150
|
+
if (balance === 0) {
|
|
5151
|
+
let j = i + 1;
|
|
5152
|
+
while (j < text.length && /\s/.test(text[j])) j++;
|
|
5153
|
+
if (j < text.length && text[j] === "]") {
|
|
5154
|
+
endIdx = j;
|
|
5155
|
+
break;
|
|
5156
|
+
}
|
|
5128
5157
|
}
|
|
5129
5158
|
}
|
|
5130
5159
|
}
|
|
5131
|
-
if (char === "\\") isEscaped = !isEscaped;
|
|
5132
|
-
else isEscaped = false;
|
|
5133
5160
|
}
|
|
5134
5161
|
if (endIdx !== -1) {
|
|
5135
5162
|
result += "[tool:functions." + match[1] + "()]";
|
|
@@ -5157,30 +5184,36 @@ ${originalTextProcessed.length > USER_CONTEXT_LENGTH ? "... (truncated) ...\n\n"
|
|
|
5157
5184
|
const startIdx = match.index + match[0].length - 1;
|
|
5158
5185
|
let balance = 0;
|
|
5159
5186
|
let inString = null;
|
|
5160
|
-
let isEscaped = false;
|
|
5161
5187
|
let endIdx = -1;
|
|
5162
5188
|
for (let i = startIdx; i < text.length; i++) {
|
|
5163
5189
|
const char = text[i];
|
|
5164
|
-
if (
|
|
5165
|
-
inString
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5190
|
+
if (inString) {
|
|
5191
|
+
if (char === inString) {
|
|
5192
|
+
let backslashCount = 0;
|
|
5193
|
+
for (let j = i - 1; j >= 0 && text[j] === "\\"; j--) {
|
|
5194
|
+
backslashCount++;
|
|
5195
|
+
}
|
|
5196
|
+
if (backslashCount % 2 === 0) {
|
|
5197
|
+
inString = null;
|
|
5198
|
+
}
|
|
5199
|
+
}
|
|
5200
|
+
} else {
|
|
5201
|
+
if (char === '"' || char === "'" || char === "`") {
|
|
5202
|
+
inString = char;
|
|
5203
|
+
} else if (char === "(") {
|
|
5204
|
+
balance++;
|
|
5205
|
+
} else if (char === ")") {
|
|
5206
|
+
balance--;
|
|
5207
|
+
if (balance === 0) {
|
|
5208
|
+
let j = i + 1;
|
|
5209
|
+
while (j < text.length && /\s/.test(text[j])) j++;
|
|
5210
|
+
if (j < text.length && text[j] === "]") {
|
|
5211
|
+
endIdx = j;
|
|
5212
|
+
break;
|
|
5213
|
+
}
|
|
5179
5214
|
}
|
|
5180
5215
|
}
|
|
5181
5216
|
}
|
|
5182
|
-
if (char === "\\") isEscaped = !isEscaped;
|
|
5183
|
-
else isEscaped = false;
|
|
5184
5217
|
}
|
|
5185
5218
|
if (endIdx !== -1) {
|
|
5186
5219
|
result += text.substring(match.index, endIdx + 1);
|
|
@@ -5209,34 +5242,37 @@ ${originalTextProcessed.length > USER_CONTEXT_LENGTH ? "... (truncated) ...\n\n"
|
|
|
5209
5242
|
const startIdx = match.index + match[0].length - 1;
|
|
5210
5243
|
let balance = 0;
|
|
5211
5244
|
let inString = null;
|
|
5212
|
-
let isEscaped = false;
|
|
5213
5245
|
let endIdx = -1;
|
|
5214
5246
|
let closingParenIdx = -1;
|
|
5215
5247
|
for (let i = startIdx; i < text.length; i++) {
|
|
5216
5248
|
const char = text[i];
|
|
5217
|
-
if (
|
|
5218
|
-
inString
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
else if (char === ")") balance--;
|
|
5226
|
-
if (balance === 0) {
|
|
5227
|
-
closingParenIdx = i;
|
|
5228
|
-
let j = i + 1;
|
|
5229
|
-
while (j < text.length && /\s/.test(text[j])) j++;
|
|
5230
|
-
if (j < text.length && text[j] === "]") {
|
|
5231
|
-
endIdx = j;
|
|
5232
|
-
break;
|
|
5249
|
+
if (inString) {
|
|
5250
|
+
if (char === inString) {
|
|
5251
|
+
let backslashCount = 0;
|
|
5252
|
+
for (let j = i - 1; j >= 0 && text[j] === "\\"; j--) {
|
|
5253
|
+
backslashCount++;
|
|
5254
|
+
}
|
|
5255
|
+
if (backslashCount % 2 === 0) {
|
|
5256
|
+
inString = null;
|
|
5233
5257
|
}
|
|
5234
5258
|
}
|
|
5235
|
-
}
|
|
5236
|
-
if (char === "\\") {
|
|
5237
|
-
isEscaped = !isEscaped;
|
|
5238
5259
|
} else {
|
|
5239
|
-
|
|
5260
|
+
if (char === '"' || char === "'" || char === "`") {
|
|
5261
|
+
inString = char;
|
|
5262
|
+
} else if (char === "(") {
|
|
5263
|
+
balance++;
|
|
5264
|
+
} else if (char === ")") {
|
|
5265
|
+
balance--;
|
|
5266
|
+
if (balance === 0) {
|
|
5267
|
+
closingParenIdx = i;
|
|
5268
|
+
let j = i + 1;
|
|
5269
|
+
while (j < text.length && /\s/.test(text[j])) j++;
|
|
5270
|
+
if (j < text.length && text[j] === "]") {
|
|
5271
|
+
endIdx = j;
|
|
5272
|
+
break;
|
|
5273
|
+
}
|
|
5274
|
+
}
|
|
5275
|
+
}
|
|
5240
5276
|
}
|
|
5241
5277
|
}
|
|
5242
5278
|
if (endIdx !== -1) {
|
|
@@ -9355,34 +9391,37 @@ var init_app = __esm({
|
|
|
9355
9391
|
const startIdx = match.index + match[0].length - 1;
|
|
9356
9392
|
let balance = 0;
|
|
9357
9393
|
let inString = null;
|
|
9358
|
-
let isEscaped = false;
|
|
9359
9394
|
let endIdx = -1;
|
|
9360
9395
|
let closingParenIdx = -1;
|
|
9361
9396
|
for (let i = startIdx; i < text.length; i++) {
|
|
9362
9397
|
const char = text[i];
|
|
9363
|
-
if (
|
|
9364
|
-
inString
|
|
9365
|
-
|
|
9366
|
-
|
|
9367
|
-
|
|
9368
|
-
|
|
9369
|
-
|
|
9370
|
-
|
|
9371
|
-
else if (char === ")") balance--;
|
|
9372
|
-
if (balance === 0) {
|
|
9373
|
-
closingParenIdx = i;
|
|
9374
|
-
let j = i + 1;
|
|
9375
|
-
while (j < text.length && /\s/.test(text[j])) j++;
|
|
9376
|
-
if (j < text.length && text[j] === "]") {
|
|
9377
|
-
endIdx = j;
|
|
9378
|
-
break;
|
|
9398
|
+
if (inString) {
|
|
9399
|
+
if (char === inString) {
|
|
9400
|
+
let backslashCount = 0;
|
|
9401
|
+
for (let j = i - 1; j >= 0 && text[j] === "\\"; j--) {
|
|
9402
|
+
backslashCount++;
|
|
9403
|
+
}
|
|
9404
|
+
if (backslashCount % 2 === 0) {
|
|
9405
|
+
inString = null;
|
|
9379
9406
|
}
|
|
9380
9407
|
}
|
|
9381
|
-
}
|
|
9382
|
-
if (char === "\\") {
|
|
9383
|
-
isEscaped = !isEscaped;
|
|
9384
9408
|
} else {
|
|
9385
|
-
|
|
9409
|
+
if (char === '"' || char === "'" || char === "`") {
|
|
9410
|
+
inString = char;
|
|
9411
|
+
} else if (char === "(") {
|
|
9412
|
+
balance++;
|
|
9413
|
+
} else if (char === ")") {
|
|
9414
|
+
balance--;
|
|
9415
|
+
if (balance === 0) {
|
|
9416
|
+
closingParenIdx = i;
|
|
9417
|
+
let j = i + 1;
|
|
9418
|
+
while (j < text.length && /\s/.test(text[j])) j++;
|
|
9419
|
+
if (j < text.length && text[j] === "]") {
|
|
9420
|
+
endIdx = j;
|
|
9421
|
+
break;
|
|
9422
|
+
}
|
|
9423
|
+
}
|
|
9424
|
+
}
|
|
9386
9425
|
}
|
|
9387
9426
|
}
|
|
9388
9427
|
if (endIdx !== -1) {
|