flowmind 1.5.4 → 1.5.7
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/CHANGELOG.md +18 -1
- package/README.md +2 -0
- package/README_CN.md +2 -0
- package/bin/flowmind.js +19 -110
- package/core/cli-ink.js +79 -0
- package/core/log-query-parser.js +324 -0
- package/core/update-notifier.js +127 -0
- package/dashboard/app.jsx +69 -10
- package/dashboard/components/ActivityFeed.jsx +5 -4
- package/dashboard/components/DragonPanel.jsx +17 -1
- package/dashboard/components/McpStatusBar.jsx +19 -1
- package/dashboard/components/StatsRow.jsx +27 -2
- package/package.json +2 -1
- package/scripts/check-update.js +52 -0
- package/skills/auto-flow/index.js +58 -82
- package/skills/log-audit/index.js +55 -27
- package/skills/sls-log-audit/index.js +7 -30
- package/skills/yuque-sync-design/index.js +2 -2
- package/tui/app.jsx +117 -5
- package/tui/components/ChatPanel.jsx +9 -6
- package/tui/components/DragonTotem.jsx +12 -1
- package/tui/components/Sidebar.jsx +19 -7
- package/tui/components/StatusBar.jsx +28 -1
- package/tui/format-result.js +60 -0
- package/tui/layout.js +60 -0
package/tui/layout.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
const MIN_COLUMNS = 88;
|
|
2
|
+
const MIN_ROWS = 20;
|
|
3
|
+
const DEFAULT_SIDEBAR_WIDTH = 32;
|
|
4
|
+
const MIN_SIDEBAR_WIDTH = 24;
|
|
5
|
+
const MAX_SIDEBAR_WIDTH = 40;
|
|
6
|
+
const MIN_CHAT_WIDTH = 28;
|
|
7
|
+
|
|
8
|
+
function normalizeDimension(value) {
|
|
9
|
+
const numeric = Number(value);
|
|
10
|
+
if (!Number.isFinite(numeric) || numeric < 0) {
|
|
11
|
+
return 0;
|
|
12
|
+
}
|
|
13
|
+
return Math.floor(numeric);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function getTuiLayout(columns, rows) {
|
|
17
|
+
const safeColumns = normalizeDimension(columns);
|
|
18
|
+
const safeRows = normalizeDimension(rows);
|
|
19
|
+
const tooSmall = safeColumns < MIN_COLUMNS || safeRows < MIN_ROWS;
|
|
20
|
+
|
|
21
|
+
if (tooSmall) {
|
|
22
|
+
return {
|
|
23
|
+
columns: safeColumns,
|
|
24
|
+
rows: safeRows,
|
|
25
|
+
tooSmall: true,
|
|
26
|
+
sidebarWidth: Math.min(DEFAULT_SIDEBAR_WIDTH, safeColumns),
|
|
27
|
+
chatWidth: Math.max(0, safeColumns - DEFAULT_SIDEBAR_WIDTH - 2)
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const sidebarWidth = clamp(
|
|
32
|
+
Math.round(safeColumns * 0.28),
|
|
33
|
+
MIN_SIDEBAR_WIDTH,
|
|
34
|
+
Math.min(MAX_SIDEBAR_WIDTH, Math.max(MIN_SIDEBAR_WIDTH, safeColumns - MIN_CHAT_WIDTH - 2))
|
|
35
|
+
);
|
|
36
|
+
const chatWidth = Math.max(MIN_CHAT_WIDTH, safeColumns - sidebarWidth - 2);
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
columns: safeColumns,
|
|
40
|
+
rows: safeRows,
|
|
41
|
+
tooSmall: false,
|
|
42
|
+
sidebarWidth,
|
|
43
|
+
chatWidth
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function clamp(value, min, max) {
|
|
48
|
+
return Math.max(min, Math.min(max, value));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
module.exports = {
|
|
52
|
+
DEFAULT_SIDEBAR_WIDTH,
|
|
53
|
+
MAX_SIDEBAR_WIDTH,
|
|
54
|
+
MIN_CHAT_WIDTH,
|
|
55
|
+
MIN_COLUMNS,
|
|
56
|
+
MIN_ROWS,
|
|
57
|
+
MIN_SIDEBAR_WIDTH,
|
|
58
|
+
getTuiLayout,
|
|
59
|
+
normalizeDimension
|
|
60
|
+
};
|