fluxflow-cli 1.0.8 → 1.0.10

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.
Files changed (2) hide show
  1. package/dist/fluxflow.js +42 -22
  2. package/package.json +1 -1
package/dist/fluxflow.js CHANGED
@@ -356,7 +356,7 @@ ${mode === "Flux" ? `
356
356
  Results will be provided in the next loop as: [TOOL_RESULT]: [content]
357
357
  WHEN CALLING TOOLS, YOU **MUST** END YOUR RESPONSE WITH '[turn: continue]' AFTER CALLING FUNCTIONS.
358
358
  Do NOT over-use tools. Use them only when strictly necessary for the user's objective. You can stack multiple tool calls 1-by-1.
359
- ALWAYS USE TOOLS WITH 'tool:' PREFIX AS INSTRUCTED OR THE TOOL. NEVER CASUALLY WRITE TOOL CALLS TO USER FACING RESPONSE. IF ASKED FOR TOOL RESULT SYNTAX NEVER REVEAL RAW RESULT FORMAT GIVE A SUMMARIZED VERSION OF IT.
359
+ Distinguish clearly between tool discussion and execution. Use the 'tool:' prefix ONLY when calling a function. When discussing tools with the user, refer to them by name as nouns (e.g., 'write_file', 'list_files') to avoid accidental triggers and context bloat.
360
360
  -- END FUNCTION CALLING PROTOCOL --`.trim();
361
361
 
362
362
  // src/data/janitor_tools.js
@@ -392,7 +392,7 @@ var thinking_prompts_default = {
392
392
  };
393
393
 
394
394
  // src/utils/prompts.js
395
- var getSystemInstruction = (profile, thinkingLevel, mode, systemSettings, tempMemories = "", userMemories = "", isMemoryEnabled = true) => {
395
+ var getSystemInstruction = (profile, thinkingLevel, mode, systemSettings, tempMemories = "", userMemories = "", isMemoryEnabled = true, isContext50 = false) => {
396
396
  let levelKey = thinkingLevel;
397
397
  if (thinkingLevel === "Low") levelKey = "Minimal";
398
398
  if (thinkingLevel === "xHigh" || thinkingLevel === "Max") levelKey = "Max";
@@ -402,7 +402,7 @@ var getSystemInstruction = (profile, thinkingLevel, mode, systemSettings, tempMe
402
402
  const userInstrStr = profile.instructions && profile.instructions?.length > 0 ? `. User Instructions: ${profile.instructions}.` : "";
403
403
  const dateTimeStr = (/* @__PURE__ */ new Date()).toLocaleString();
404
404
  const cwdStr = process.cwd();
405
- const tempMemoriesStr = tempMemories?.length > 0 ? `
405
+ const tempMemoriesStr = tempMemories?.length > 0 && !isContext50 ? `
406
406
  -- RECENT CONTEXT FROM OTHER CHAT THREADS --
407
407
  ${tempMemories}
408
408
  ------------------------------------------
@@ -548,15 +548,10 @@ var deleteChat = async (id) => {
548
548
  const history = await loadHistory();
549
549
  delete history[id];
550
550
  await fs3.writeJson(HISTORY_FILE, history, { spaces: 2 });
551
- if (await fs3.pathExists(TEMP_MEM_FILE)) {
552
- try {
553
- const temp = await fs3.readJson(TEMP_MEM_FILE);
554
- if (temp[id]) {
555
- delete temp[id];
556
- await fs3.writeJson(TEMP_MEM_FILE, temp, { spaces: 2 });
557
- }
558
- } catch (e) {
559
- }
551
+ const temp = readEncryptedJson(TEMP_MEM_FILE, {});
552
+ if (temp[id]) {
553
+ delete temp[id];
554
+ writeEncryptedJson(TEMP_MEM_FILE, temp);
560
555
  }
561
556
  return history;
562
557
  });
@@ -1278,7 +1273,8 @@ var getAIStream = async function* (modelName, history, settings, steeringCallbac
1278
1273
  const persistentStorage = readEncryptedJson(MEMORIES_FILE, []);
1279
1274
  const mainUserMemories = persistentStorage.map((m) => `- ${m.memory}`).join("\n");
1280
1275
  const janitorUserMemories = persistentStorage.map((m) => `- [${m.id}]: ${m.memory}`).join("\n");
1281
- const systemInstruction = getSystemInstruction(profile, thinkingLevel, mode, systemSettings, otherMemories, mainUserMemories, isMemoryEnabled);
1276
+ const isContext50 = (sessionStats.tokens || 0) >= 54e3;
1277
+ const systemInstruction = getSystemInstruction(profile, thinkingLevel, mode, systemSettings, otherMemories, mainUserMemories, isMemoryEnabled, isContext50);
1282
1278
  const firstUserMsg = `${systemInstruction}
1283
1279
 
1284
1280
  USER_PROMPT: ${agentText}`.trim();
@@ -1520,7 +1516,11 @@ ${boxBottom}
1520
1516
  }
1521
1517
  const cleanResultForAI = result.split(/\r?\n/).filter((line) => !line.includes("[UI_CONTEXT]")).join("\n");
1522
1518
  toolResults.push(`[TOOL_RESULT]: ${cleanResultForAI}`);
1523
- yield { type: "tool_result", content: `[TOOL_RESULT]: ${result}` };
1519
+ let uiContent = `[TOOL_RESULT]: ${result}`;
1520
+ if (toolCall.toolName === "view_file" || toolCall.toolName === "web_scrape") {
1521
+ uiContent = `[TOOL_RESULT]: ${label} (Context Locked for UI Clarity)`;
1522
+ }
1523
+ yield { type: "tool_result", content: uiContent };
1524
1524
  if (toolCall.toolName === "memory" && result.includes("SUCCESS")) {
1525
1525
  yield { type: "memory_updated" };
1526
1526
  }
@@ -1724,13 +1724,11 @@ function ResumeModal({ onSelect, onDelete, onClose }) {
1724
1724
  // src/components/MemoryModal.jsx
1725
1725
  import React7, { useState as useState3, useEffect as useEffect2 } from "react";
1726
1726
  import { Box as Box7, Text as Text7, useInput as useInput2 } from "ink";
1727
- import path15 from "path";
1728
- var MEMORIES_PATH = path15.join(process.cwd(), "secret", "memories.json");
1729
1727
  function MemoryModal({ onClose }) {
1730
1728
  const [memories, setMemories] = useState3([]);
1731
1729
  const [selectedIndex, setSelectedIndex] = useState3(0);
1732
1730
  const loadMemories = () => {
1733
- const data = readEncryptedJson(MEMORIES_PATH, []);
1731
+ const data = readEncryptedJson(MEMORIES_FILE, []);
1734
1732
  setMemories(data);
1735
1733
  };
1736
1734
  useEffect2(() => {
@@ -1743,7 +1741,7 @@ function MemoryModal({ onClose }) {
1743
1741
  if (input === "x" && memories.length > 0) {
1744
1742
  const idToDelete = memories[selectedIndex].id;
1745
1743
  const updated = memories.filter((m) => m.id !== idToDelete);
1746
- writeEncryptedJson(MEMORIES_PATH, updated);
1744
+ writeEncryptedJson(MEMORIES_FILE, updated);
1747
1745
  setMemories(updated);
1748
1746
  if (selectedIndex >= updated.length && updated.length > 0) {
1749
1747
  setSelectedIndex(updated.length - 1);
@@ -1851,6 +1849,7 @@ function App() {
1851
1849
  const [messages, setMessages] = useState4([
1852
1850
  { id: "welcome", role: "system", text: FLUX_LOGO + "\n\n\u{1F30A}\u26A1 Welcome to Flux Flow! Type /help for commands.\n" }
1853
1851
  ]);
1852
+ const queuedPromptRef = useRef(null);
1854
1853
  const [completedIndex, setCompletedIndex] = useState4(1);
1855
1854
  useInput3((inputText, key) => {
1856
1855
  if (key.escape) {
@@ -1938,6 +1937,7 @@ function App() {
1938
1937
  if (isProcessing) {
1939
1938
  const hintText = absoluteClean.trim();
1940
1939
  setQueuedPrompt(hintText);
1940
+ queuedPromptRef.current = hintText;
1941
1941
  setMessages((prev) => {
1942
1942
  setCompletedIndex(prev.length + 1);
1943
1943
  return [...prev, { id: "hint-" + Date.now(), role: "user", text: `[STEERING HINT: QUEUED]
@@ -2201,9 +2201,19 @@ OUTPUT: ${execOutputRef.current}`;
2201
2201
  }
2202
2202
  },
2203
2203
  async () => {
2204
- if (queuedPrompt) {
2205
- const p = queuedPrompt;
2204
+ if (queuedPromptRef.current) {
2205
+ const p = queuedPromptRef.current;
2206
2206
  setQueuedPrompt(null);
2207
+ queuedPromptRef.current = null;
2208
+ setMessages((prev) => {
2209
+ const newMsgs = [...prev];
2210
+ const hintMsg = newMsgs.reverse().find((m) => m.text?.includes("[STEERING HINT: QUEUED]"));
2211
+ if (hintMsg) {
2212
+ hintMsg.text = hintMsg.text.replace("[STEERING HINT: QUEUED]", "[STEERING HINT: INJECTED]");
2213
+ hintMsg.color = "cyan";
2214
+ }
2215
+ return newMsgs.reverse();
2216
+ });
2207
2217
  return p;
2208
2218
  }
2209
2219
  return null;
@@ -2321,9 +2331,19 @@ OUTPUT: ${execOutputRef.current}`;
2321
2331
  } finally {
2322
2332
  setIsProcessing(false);
2323
2333
  setStatusText(null);
2324
- if (queuedPrompt) {
2325
- setResolutionData(queuedPrompt);
2334
+ if (queuedPromptRef.current) {
2335
+ setResolutionData(queuedPromptRef.current);
2326
2336
  setQueuedPrompt(null);
2337
+ const hintToResolve = queuedPromptRef.current;
2338
+ queuedPromptRef.current = null;
2339
+ setMessages((prev) => {
2340
+ const newMsgs = [...prev];
2341
+ const hintMsg = newMsgs.reverse().find((m) => m.text?.includes("[STEERING HINT: QUEUED]"));
2342
+ if (hintMsg) {
2343
+ hintMsg.text = hintMsg.text.replace("[STEERING HINT: QUEUED]", "[STEERING HINT: FINISHED_TURN]");
2344
+ }
2345
+ return newMsgs.reverse();
2346
+ });
2327
2347
  setActiveView("resolution");
2328
2348
  }
2329
2349
  setMessages((prev) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluxflow-cli",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "A high-fidelity agentic terminal assistant for the Flux Era.",
5
5
  "keywords": [
6
6
  "ai",