fluxflow-cli 3.16.2 → 3.16.3
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 +11 -3
- package/package.json +1 -1
package/dist/fluxflow.js
CHANGED
|
@@ -15348,10 +15348,18 @@ ${newMemoryListStr}
|
|
|
15348
15348
|
const summariesFile = path27.join(SECRET_DIR, "chat-summaries.json");
|
|
15349
15349
|
const flattenContext = (hist) => {
|
|
15350
15350
|
return hist.filter(
|
|
15351
|
-
(m) => (m.role === "user" || m.role === "agent" || m.role === "system") && m.role !== "think" && !m.isVisualFeedback && !m.isMeta && !String(m.id).startsWith("welcome")
|
|
15351
|
+
(m) => (m.role === "user" || m.role === "agent" || m.role === "system") && m.role !== "think" && !m.isVisualFeedback && !m.isMeta && !m.isTerminalRecord && !(m.text && m.text.includes("[TERMINAL_RECORD]")) && !String(m.id).startsWith("welcome")
|
|
15352
15352
|
).map((m) => {
|
|
15353
|
-
const
|
|
15354
|
-
|
|
15353
|
+
const rawText = m.fullText || m.text || "";
|
|
15354
|
+
const isToolResult = m.role === "system" || rawText.startsWith("[TOOL RESULT]:") || m.text && m.text.startsWith("[TOOL RESULT]:");
|
|
15355
|
+
let text = rawText;
|
|
15356
|
+
if (isToolResult && (rawText.includes("[TOOL RESULT]:") || m.text && m.text.includes("[TOOL RESULT]:"))) {
|
|
15357
|
+
text = "[TOOL RESULT]: ...truncated for summary";
|
|
15358
|
+
} else {
|
|
15359
|
+
text = text.replace(/(\[(?:tool|agent):[a-zA-Z0-9_\.]+)\([\s\S]*?\)(\])/g, "$1(...)$2");
|
|
15360
|
+
}
|
|
15361
|
+
const role = isToolResult ? "TOOL" : m.role === "agent" ? "AGENT" : "USER";
|
|
15362
|
+
return `[${role}]: ${text}`;
|
|
15355
15363
|
}).join("\n\n");
|
|
15356
15364
|
};
|
|
15357
15365
|
const runCondenser = async (flattenedText2, oldSummary2) => {
|