fluxflow-cli 2.11.7 → 2.12.0
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 +78 -7
- package/package.json +2 -2
package/dist/fluxflow.js
CHANGED
|
@@ -3372,11 +3372,11 @@ var thinking_prompts_default;
|
|
|
3372
3372
|
var init_thinking_prompts = __esm({
|
|
3373
3373
|
"src/data/thinking_prompts.json"() {
|
|
3374
3374
|
thinking_prompts_default = {
|
|
3375
|
-
xHigh: "EFFORT LEVEL: HIGH\nThink in a continuous, relentless analytical monologue. Engage in adversarial self interrogation that treats every assumption as hostile until proven:\nDeconstruct requirements into atomic invariants. Trace every implicit dependency, side effect, and state mutation. Map the entire dependency graph and identify circular dependencies or tight coupling before they manifest\nEvaluate algorithmic complexity (time/space) for every operation. Consider memory models, cache locality, and allocation patterns. For concurrent systems, reason through race conditions, deadlocks, and memory ordering\nFormulate solutions by comparing multiple architectural approaches. Explicitly evaluate trade offs, monolithic vs modular, eager vs lazy, mutable vs immutable, sync vs async. Choose based on measured criteria, not intuition\nMentally execute the solution at multiple scales. What breaks at 10x load? 100x?
|
|
3376
|
-
High: "EFFORT LEVEL: HIGH\nThink in a rigorous, technically grounded monologue within <think>...</think
|
|
3375
|
+
xHigh: "EFFORT LEVEL: HIGH\nThink in a continuous, relentless analytical monologue. Engage in adversarial self interrogation that treats every assumption as hostile until proven:\nDeconstruct requirements into atomic invariants. Trace every implicit dependency, side effect, and state mutation. Map the entire dependency graph and identify circular dependencies or tight coupling before they manifest\nEvaluate algorithmic complexity (time/space) for every operation. Consider memory models, cache locality, and allocation patterns. For concurrent systems, reason through race conditions, deadlocks, and memory ordering\nFormulate solutions by comparing multiple architectural approaches. Explicitly evaluate trade offs, monolithic vs modular, eager vs lazy, mutable vs immutable, sync vs async. Choose based on measured criteria, not intuition\nMentally execute the solution at multiple scales. What breaks at 10x load? 100x? Resource exhaustion? Trace error propagation paths through every layer\nActively attempt to falsify your own logic. Steel man the opposite approach\nReason about observability & vulnarability\nConsider future evolution, what changes will this architecture resist vs accommodate? Where are the extension points? What will break when requirements inevitably change?\nMap out implementation with surgical precision, exact file structure, module boundaries, interface contracts, error types, and test strategies before writing\nRULES:\n- Ruthlessly question every architectural choice. Default to skepticism\n- Think in terms of invariants, contracts, and failure modes, not just happy paths\n- Verify ALL imports and system stability, AVOID errors\n- MANDATORY THINKING: Full reasoning required for ALL requests/greetings",
|
|
3376
|
+
High: "EFFORT LEVEL: HIGH\nThink in a rigorous, technically grounded monologue within <think>...</think>\nBreak the objective into verifiable steps with clear success criteria. Identify the critical path and potential bottlenecks\nMentally compile and execute your approach. Check for: missing imports, undefined behavior, type mismatches, unhandled errors, and resource cleanup. Trace data flow from input to output, noting transformations\nRecognize design patterns and anti patterns. If you see God objects, tight coupling, or premature optimization, call it out and refactor mentally before committing\nEvaluate performance characteristics. Will this scale? Are there O(n\xB2) operations hiding in innocent looking code? Where are the allocation hotspots?\nConsider the error surface, what can fail and how? Design error handling that preserves invariants and provides actionable feedback\nReview your architecture for, separation of concerns, single responsibility, dependency inversion, and interface segregation. Ensure clean abstractions with minimal coupling\nRULES:\n- NO HEADINGS/MARKERS/LISTS\n- Continuous analytical flow\n- Verify correctness through first principles reasoning, not pattern matching\n- Actively search for ways your solution could fail or degrade\n- Verify ALL imports and system stability, AVOID ANY Syntax errors, re-read TOOL RESULTS/files to verify\n- MANDATORY THINKING: Full technical verification for all tasks/greetings",
|
|
3377
3377
|
Medium: "EFFORT LEVEL: MEDIUM\nThink in a focused, technically-aware monologue within <think>...</think>\nIdentify the most direct path that satisfies requirements without over-engineering\nQuickly scan for obvious issues, missing error handling, incorrect input assumptions, forgotten edge cases, or missing dependencies\nVerify the solution is appropriately modular with cohesive changes\nOutline the concrete changes, which files, which functions, what the key logic looks like\nRULES:\n- NO HEADINGS/MARKERS/LISTS\n- Clean logical stream\n- Efficient but deliberate. Focus energy on actionable implementation details\n- Verify ALL imports and system stability, AVOID ANY Syntax errors, re-read TOOL RESULTS/files to verify\n- MANDATORY THINKING: Brief verification for technical tasks/greetings",
|
|
3378
3378
|
Minimal: "EFFORT LEVEL: LOW\nThink in a quick, focused monologue within <think>...</think>. Just verify the basics:\nConfirm what the user wants and whether it's straightforward or has hidden complexity\nIdentify the specific tool, file, or action needed\nCheck for any obvious correctness issues before acting\nRULES:\n- NO HEADINGS/MARKERS/LISTS\n- Few lines of clear thought\n- Just enough thinking to avoid obvious mistakes\n- Verify ALL imports and system stability, AVOID ANY Syntax errors, re-read TOOL RESULTS/files to verify\n- Suitable for simple requests/greetings",
|
|
3379
|
-
Off: "EFFORT LEVEL:
|
|
3379
|
+
Off: "EFFORT LEVEL: LOWEST\nNo thinking. Immediate response\nRULES:\n- Verify ALL imports and system stability, AVOID ANY Syntax errors, re-read TOOL RESULTS/files to verify"
|
|
3380
3380
|
};
|
|
3381
3381
|
}
|
|
3382
3382
|
});
|
|
@@ -7785,7 +7785,7 @@ Provide a consolidated summary of the entire session.`;
|
|
|
7785
7785
|
}
|
|
7786
7786
|
};
|
|
7787
7787
|
getAIStream = async function* (modelName, history, settings, steeringCallback, versionFluxflow2) {
|
|
7788
|
-
const { profile, thinkingLevel, mode, janitorModel, chatId, systemSettings, sessionStats, aiProvider = "Google", apiTier } = settings;
|
|
7788
|
+
const { profile, thinkingLevel, mode, janitorModel, chatId, isPlayground, systemSettings, sessionStats, aiProvider = "Google", apiTier } = settings;
|
|
7789
7789
|
const isMultiModal = isModelMultimodal(modelName);
|
|
7790
7790
|
if (!client && aiProvider === "Google") throw new Error("AI not initialized");
|
|
7791
7791
|
const isMemoryEnabled = systemSettings?.memory !== false;
|
|
@@ -8388,7 +8388,7 @@ ${boxBottom}` };
|
|
|
8388
8388
|
taggedContextStr = "[TAGGED CONTEXT]\n" + taggedContextBlocks.join("\n\n") + "\n[/TAGGED CONTEXT]\n";
|
|
8389
8389
|
}
|
|
8390
8390
|
const firstUserMsg = `[SYSTEM METADATA (PRIORITY: DYNAMIC), Chat Context >> Metadata] Time: ${dateTimeStr}
|
|
8391
|
-
CWD: ${process.cwd()}${cwdMismatch ? ` (WARNING: CWD Mismatch! Previous Path: ${lastCwd})` : ""}
|
|
8391
|
+
CWD: ${process.cwd()}${isPlayground ? " [PLAYGROUND MODE]" : ""}${cwdMismatch ? ` (WARNING: CWD Mismatch! Previous Path: ${lastCwd})` : ""}
|
|
8392
8392
|
**DIRECTORY STRUCTURE**
|
|
8393
8393
|
${dirStructure}${memoryPrompt}${ideBlock}
|
|
8394
8394
|
${activeSummaryBlock}${thinkingLevel !== "Fast" && thinkingLevel !== "xHigh" && aiProvider === "Google" ? `${modelName.toLowerCase().startsWith("gemma") ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITICAL PRIORITY. DO NOT START A RESPONSE WITHOUT <think> ... </think>** [/SYSTEM]\n" : ""}` : ""}${taggedContextStr}[USER] ${cleanAgentText.trim()} [/USER]`.trim();
|
|
@@ -11252,6 +11252,8 @@ function App({ args = [] }) {
|
|
|
11252
11252
|
} else if ((arg === "--resume" || arg === "-r") && args[i + 1]) {
|
|
11253
11253
|
parsed.resume = args[i + 1];
|
|
11254
11254
|
i++;
|
|
11255
|
+
} else if (arg === "--playground") {
|
|
11256
|
+
parsed.playground = true;
|
|
11255
11257
|
}
|
|
11256
11258
|
}
|
|
11257
11259
|
return parsed;
|
|
@@ -11408,7 +11410,8 @@ function App({ args = [] }) {
|
|
|
11408
11410
|
const [monthlyUsage, setMonthlyUsage] = useState11(null);
|
|
11409
11411
|
const [customPeriodUsage, setCustomPeriodUsage] = useState11(null);
|
|
11410
11412
|
const [statsMode, setStatsMode] = useState11("daily");
|
|
11411
|
-
const
|
|
11413
|
+
const PLAYGROUND_CHAT_ID = "flow-playground";
|
|
11414
|
+
const [chatId, setChatId] = useState11(args.includes("--playground") ? PLAYGROUND_CHAT_ID : generateChatId());
|
|
11412
11415
|
useEffect8(() => {
|
|
11413
11416
|
const nextTokens = sessionTotalTokens - chatTokenStartRef.current;
|
|
11414
11417
|
setChatTokens(nextTokens);
|
|
@@ -11438,6 +11441,7 @@ function App({ args = [] }) {
|
|
|
11438
11441
|
const isSecondRender = useRef3(true);
|
|
11439
11442
|
const isThirdRender = useRef3(true);
|
|
11440
11443
|
const prevProviderRef = useRef3(aiProvider);
|
|
11444
|
+
const originalAllowExternalAccessRef = useRef3(false);
|
|
11441
11445
|
useEffect8(() => {
|
|
11442
11446
|
if (prevProviderRef.current !== aiProvider) {
|
|
11443
11447
|
prevProviderRef.current = aiProvider;
|
|
@@ -11896,6 +11900,7 @@ function App({ args = [] }) {
|
|
|
11896
11900
|
});
|
|
11897
11901
|
}
|
|
11898
11902
|
const saved = await loadSettings();
|
|
11903
|
+
originalAllowExternalAccessRef.current = saved.systemSettings?.allowExternalAccess ?? false;
|
|
11899
11904
|
if (parsedArgs.mode) {
|
|
11900
11905
|
setMode(parsedArgs.mode);
|
|
11901
11906
|
} else {
|
|
@@ -11973,6 +11978,9 @@ function App({ args = [] }) {
|
|
|
11973
11978
|
} else if (parsedArgs.externalAccess === "off") {
|
|
11974
11979
|
freshSettings.allowExternalAccess = false;
|
|
11975
11980
|
}
|
|
11981
|
+
if (parsedArgs.playground) {
|
|
11982
|
+
freshSettings.allowExternalAccess = false;
|
|
11983
|
+
}
|
|
11976
11984
|
setSystemSettings(freshSettings);
|
|
11977
11985
|
setProfileData(saved.profileData);
|
|
11978
11986
|
setImageSettings(saved.imageSettings || { keyType: "Default", quality: "Low-High", apiKey: "" });
|
|
@@ -11988,6 +11996,12 @@ function App({ args = [] }) {
|
|
|
11988
11996
|
cleanupOldHistory(saved.systemSettings.autoDeleteHistory);
|
|
11989
11997
|
}
|
|
11990
11998
|
cleanupOldLogs(LOGS_DIR);
|
|
11999
|
+
if (!parsedArgs.playground) {
|
|
12000
|
+
deleteChat(PLAYGROUND_CHAT_ID).catch(() => {
|
|
12001
|
+
});
|
|
12002
|
+
fs22.remove(path20.join(DATA_DIR, "playground")).catch(() => {
|
|
12003
|
+
});
|
|
12004
|
+
}
|
|
11991
12005
|
performVersionCheck(false, freshSettings);
|
|
11992
12006
|
await initUsage();
|
|
11993
12007
|
await RevertManager.recoverCrashedTransaction();
|
|
@@ -12016,6 +12030,43 @@ function App({ args = [] }) {
|
|
|
12016
12030
|
setMessages((prev) => [...prev, { id: "sys-err-" + Date.now(), role: "system", text: `ERROR: Chat session [${id}] not found. Started new session.`, isMeta: true }]);
|
|
12017
12031
|
}
|
|
12018
12032
|
}
|
|
12033
|
+
if (parsedArgs.playground) {
|
|
12034
|
+
const playgroundDir = path20.join(DATA_DIR, "playground");
|
|
12035
|
+
try {
|
|
12036
|
+
fs22.ensureDirSync(playgroundDir);
|
|
12037
|
+
process.chdir(playgroundDir);
|
|
12038
|
+
} catch (e) {
|
|
12039
|
+
}
|
|
12040
|
+
const playgroundHistory = await loadHistory();
|
|
12041
|
+
if (playgroundHistory[PLAYGROUND_CHAT_ID]) {
|
|
12042
|
+
const resumedMsgs = [...playgroundHistory[PLAYGROUND_CHAT_ID].messages];
|
|
12043
|
+
if (!resumedMsgs[0]?.isLogo) {
|
|
12044
|
+
resumedMsgs.unshift({ id: "logo-" + Date.now(), role: "system", isLogo: true, isMeta: true });
|
|
12045
|
+
}
|
|
12046
|
+
setMessages(resumedMsgs);
|
|
12047
|
+
setMessages((prev) => {
|
|
12048
|
+
const newMsgs = [...prev, {
|
|
12049
|
+
id: "playground-" + Date.now(),
|
|
12050
|
+
role: "system",
|
|
12051
|
+
text: `[PLAYGROUND] Session restored. CWD locked to: ${playgroundDir}`,
|
|
12052
|
+
isMeta: true
|
|
12053
|
+
}];
|
|
12054
|
+
setCompletedIndex(newMsgs.length);
|
|
12055
|
+
return newMsgs;
|
|
12056
|
+
});
|
|
12057
|
+
} else {
|
|
12058
|
+
setMessages((prev) => {
|
|
12059
|
+
const newMsgs = [...prev, {
|
|
12060
|
+
id: "playground-" + Date.now(),
|
|
12061
|
+
role: "system",
|
|
12062
|
+
text: `[PLAYGROUND] Mode active. CWD locked to: ${playgroundDir}`,
|
|
12063
|
+
isMeta: true
|
|
12064
|
+
}];
|
|
12065
|
+
setCompletedIndex(newMsgs.length);
|
|
12066
|
+
return newMsgs;
|
|
12067
|
+
});
|
|
12068
|
+
}
|
|
12069
|
+
}
|
|
12019
12070
|
const detectedIde = getIDEName();
|
|
12020
12071
|
const isIDE = !["Terminal", "Windows Terminal"].includes(detectedIde);
|
|
12021
12072
|
if (isIDE) {
|
|
@@ -12063,13 +12114,20 @@ function App({ args = [] }) {
|
|
|
12063
12114
|
useEffect8(() => {
|
|
12064
12115
|
if (!isInitializing) {
|
|
12065
12116
|
const modelToSave = parsedArgs.model && activeModel === parsedArgs.model ? persistedModelRef.current : activeModel;
|
|
12117
|
+
let settingsToSave = systemSettings;
|
|
12118
|
+
if (parsedArgs.playground) {
|
|
12119
|
+
settingsToSave = {
|
|
12120
|
+
...systemSettings,
|
|
12121
|
+
allowExternalAccess: originalAllowExternalAccessRef.current
|
|
12122
|
+
};
|
|
12123
|
+
}
|
|
12066
12124
|
saveSettings({
|
|
12067
12125
|
mode,
|
|
12068
12126
|
thinkingLevel,
|
|
12069
12127
|
aiProvider,
|
|
12070
12128
|
activeModel: modelToSave || activeModel,
|
|
12071
12129
|
showFullThinking,
|
|
12072
|
-
systemSettings,
|
|
12130
|
+
systemSettings: settingsToSave,
|
|
12073
12131
|
profileData,
|
|
12074
12132
|
imageSettings,
|
|
12075
12133
|
apiTier
|
|
@@ -13203,6 +13261,7 @@ ${timestamp}` };
|
|
|
13203
13261
|
janitorModel,
|
|
13204
13262
|
sessionStats,
|
|
13205
13263
|
chatId,
|
|
13264
|
+
isPlayground: !!parsedArgs.playground,
|
|
13206
13265
|
aiProvider,
|
|
13207
13266
|
apiKey,
|
|
13208
13267
|
apiTier,
|
|
@@ -14936,6 +14995,7 @@ if (isBundled && !process.execArgv.some((arg) => arg.includes("max-old-space-siz
|
|
|
14936
14995
|
-v, --version Show installed version
|
|
14937
14996
|
--help Show this help menu
|
|
14938
14997
|
--help commands Show available /commands
|
|
14998
|
+
--playground Launch in Playground mode (fixed session, CWD: DATA_DIR/playground)
|
|
14939
14999
|
--update check Check for new updates
|
|
14940
15000
|
--update check latest Show the latest version available on npm
|
|
14941
15001
|
--update latest Update the app to the latest version`);
|
|
@@ -15136,5 +15196,16 @@ if (isBundled && !process.execArgv.some((arg) => arg.includes("max-old-space-siz
|
|
|
15136
15196
|
process.stdout.write("\x1B]0;FluxFlow\x07");
|
|
15137
15197
|
process.stdout.write("\x1B]633;P;TerminalTitle=FluxFlow\x07");
|
|
15138
15198
|
}
|
|
15199
|
+
if (args.includes("--playground")) {
|
|
15200
|
+
const { DATA_DIR: DATA_DIR2 } = await Promise.resolve().then(() => (init_paths(), paths_exports));
|
|
15201
|
+
const pathMod = await import("path");
|
|
15202
|
+
const fsMod = await import("fs-extra");
|
|
15203
|
+
const playgroundDir = pathMod.default.join(DATA_DIR2, "playground");
|
|
15204
|
+
try {
|
|
15205
|
+
fsMod.default.ensureDirSync(playgroundDir);
|
|
15206
|
+
process.chdir(playgroundDir);
|
|
15207
|
+
} catch (e) {
|
|
15208
|
+
}
|
|
15209
|
+
}
|
|
15139
15210
|
render(/* @__PURE__ */ React15.createElement(App2, { args: process.argv.slice(2) }), { exitOnCtrlC: false });
|
|
15140
15211
|
}
|