agenttop 0.11.0 → 0.11.1
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/index.js
CHANGED
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
startMcpServer,
|
|
25
25
|
unarchiveSession,
|
|
26
26
|
unpinSession
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-27WRQSJY.js";
|
|
28
28
|
|
|
29
29
|
// src/index.tsx
|
|
30
30
|
import { readFileSync as readFileSync3 } from "fs";
|
|
@@ -34,7 +34,7 @@ import React19 from "react";
|
|
|
34
34
|
import { render } from "ink";
|
|
35
35
|
|
|
36
36
|
// src/ui/App.tsx
|
|
37
|
-
import { useState as useState18, useEffect as useEffect10, useCallback as
|
|
37
|
+
import { useState as useState18, useEffect as useEffect10, useCallback as useCallback8 } from "react";
|
|
38
38
|
import { Box as Box18, Text as Text17, useApp, useStdout as useStdout4 } from "ink";
|
|
39
39
|
|
|
40
40
|
// src/config/themes.ts
|
|
@@ -678,7 +678,7 @@ var compareVersions = (a, b) => {
|
|
|
678
678
|
};
|
|
679
679
|
|
|
680
680
|
// src/ui/components/StatusBar.tsx
|
|
681
|
-
import React, { useState, useEffect } from "react";
|
|
681
|
+
import React, { useState, useEffect, useRef } from "react";
|
|
682
682
|
import { Box, Text } from "ink";
|
|
683
683
|
|
|
684
684
|
// src/ui/theme.ts
|
|
@@ -726,13 +726,20 @@ var applyTheme = (theme) => {
|
|
|
726
726
|
|
|
727
727
|
// src/ui/components/StatusBar.tsx
|
|
728
728
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
729
|
+
var formatTime = () => (/* @__PURE__ */ new Date()).toLocaleTimeString("en-GB", { hour12: false });
|
|
729
730
|
var StatusBar = React.memo(({ sessionCount, alertCount, version, updateInfo }) => {
|
|
730
|
-
const [
|
|
731
|
+
const [timeStr, setTimeStr] = useState(formatTime);
|
|
732
|
+
const lastRef = useRef(timeStr);
|
|
731
733
|
useEffect(() => {
|
|
732
|
-
const interval = setInterval(() =>
|
|
734
|
+
const interval = setInterval(() => {
|
|
735
|
+
const next = formatTime();
|
|
736
|
+
if (next !== lastRef.current) {
|
|
737
|
+
lastRef.current = next;
|
|
738
|
+
setTimeStr(next);
|
|
739
|
+
}
|
|
740
|
+
}, 1e3);
|
|
733
741
|
return () => clearInterval(interval);
|
|
734
742
|
}, []);
|
|
735
|
-
const timeStr = time.toLocaleTimeString("en-GB", { hour12: false });
|
|
736
743
|
return /* @__PURE__ */ jsxs(Box, { borderStyle: "single", borderColor: colors.border, paddingX: 1, justifyContent: "space-between", children: [
|
|
737
744
|
/* @__PURE__ */ jsxs(Text, { color: colors.header, bold: true, children: [
|
|
738
745
|
"agenttop v",
|
|
@@ -767,7 +774,7 @@ var formatTokens = (n) => {
|
|
|
767
774
|
if (n >= 1e3) return (n / 1e3).toFixed(1) + "k";
|
|
768
775
|
return String(n);
|
|
769
776
|
};
|
|
770
|
-
var
|
|
777
|
+
var formatTime2 = (ts) => {
|
|
771
778
|
const d = new Date(ts);
|
|
772
779
|
return d.toLocaleTimeString("en-GB", { hour12: false });
|
|
773
780
|
};
|
|
@@ -1061,7 +1068,7 @@ var ActivityFeed = React3.memo(
|
|
|
1061
1068
|
const tagColor = merged ? slugColorMap.get(call.sessionId) || colors.muted : void 0;
|
|
1062
1069
|
return /* @__PURE__ */ jsx3(Box3, { paddingX: 1, overflow: "hidden", children: /* @__PURE__ */ jsxs3(Text3, { wrap: "truncate", children: [
|
|
1063
1070
|
tag && /* @__PURE__ */ jsx3(Text3, { color: tagColor, children: tag.padEnd(5) }),
|
|
1064
|
-
/* @__PURE__ */ jsx3(Text3, { color: isSelected ? colors.bright : colors.muted, underline: isSelected, children:
|
|
1071
|
+
/* @__PURE__ */ jsx3(Text3, { color: isSelected ? colors.bright : colors.muted, underline: isSelected, children: formatTime2(call.timestamp) }),
|
|
1065
1072
|
" ",
|
|
1066
1073
|
/* @__PURE__ */ jsx3(Text3, { color: getToolColor(call.toolName), bold: true, underline: isSelected, children: call.toolName.padEnd(8) }),
|
|
1067
1074
|
/* @__PURE__ */ jsxs3(Text3, { color: isSelected ? colors.bright : colors.text, underline: isSelected, children: [
|
|
@@ -1117,7 +1124,7 @@ var AlertBar = React4.memo(({ alerts, maxVisible = 4 }) => {
|
|
|
1117
1124
|
] }),
|
|
1118
1125
|
/* @__PURE__ */ jsxs4(Text4, { color: colors.muted, children: [
|
|
1119
1126
|
" ",
|
|
1120
|
-
|
|
1127
|
+
formatTime2(alert.timestamp),
|
|
1121
1128
|
" "
|
|
1122
1129
|
] }),
|
|
1123
1130
|
/* @__PURE__ */ jsxs4(Text4, { color: colors.warning, children: [
|
|
@@ -1548,7 +1555,7 @@ var ToolCallDetail = React8.memo(({ event, focused, height }) => {
|
|
|
1548
1555
|
/* @__PURE__ */ jsx8(Text8, { color: getToolColor(event.call.toolName), bold: true, children: event.call.toolName }),
|
|
1549
1556
|
/* @__PURE__ */ jsxs8(Text8, { color: colors.muted, children: [
|
|
1550
1557
|
" ",
|
|
1551
|
-
|
|
1558
|
+
formatTime2(event.call.timestamp)
|
|
1552
1559
|
] }),
|
|
1553
1560
|
/* @__PURE__ */ jsxs8(Text8, { color: colors.muted, children: [
|
|
1554
1561
|
" ",
|
|
@@ -1582,7 +1589,7 @@ var ToolCallDetail = React8.memo(({ event, focused, height }) => {
|
|
|
1582
1589
|
});
|
|
1583
1590
|
|
|
1584
1591
|
// src/ui/components/SettingsMenu.tsx
|
|
1585
|
-
import React9, { useState as useState4, useMemo, useEffect as useEffect2, useRef } from "react";
|
|
1592
|
+
import React9, { useState as useState4, useMemo, useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
1586
1593
|
import { Box as Box9, Text as Text9, useInput as useInput3, useStdout } from "ink";
|
|
1587
1594
|
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1588
1595
|
var KEYBIND_LABELS = {
|
|
@@ -1751,7 +1758,7 @@ var SettingsMenu = React9.memo(({ config, onClose, onOpenThemeMenu }) => {
|
|
|
1751
1758
|
const [selectablePos, setSelectablePos] = useState4(0);
|
|
1752
1759
|
const [rebinding, setRebinding] = useState4(false);
|
|
1753
1760
|
const [toast, setToast] = useState4("");
|
|
1754
|
-
const toastTimer =
|
|
1761
|
+
const toastTimer = useRef2(null);
|
|
1755
1762
|
const showToast = (msg) => {
|
|
1756
1763
|
if (toastTimer.current) clearTimeout(toastTimer.current);
|
|
1757
1764
|
setToast(msg);
|
|
@@ -1882,7 +1889,7 @@ var SettingsMenu = React9.memo(({ config, onClose, onOpenThemeMenu }) => {
|
|
|
1882
1889
|
});
|
|
1883
1890
|
|
|
1884
1891
|
// src/ui/components/ThemeMenu.tsx
|
|
1885
|
-
import React11, { useState as useState6, useCallback, useRef as
|
|
1892
|
+
import React11, { useState as useState6, useCallback, useRef as useRef3, useEffect as useEffect3 } from "react";
|
|
1886
1893
|
import { Box as Box11, Text as Text11, useInput as useInput5, useStdout as useStdout2 } from "ink";
|
|
1887
1894
|
|
|
1888
1895
|
// src/ui/components/ThemeEditor.tsx
|
|
@@ -2018,7 +2025,7 @@ var ThemeMenu = React11.memo(({ config, onClose }) => {
|
|
|
2018
2025
|
const [nameInput, setNameInput] = useState6("");
|
|
2019
2026
|
const [namingAction, setNamingAction] = useState6("copy");
|
|
2020
2027
|
const [toast, setToast] = useState6("");
|
|
2021
|
-
const toastTimer =
|
|
2028
|
+
const toastTimer = useRef3(null);
|
|
2022
2029
|
const showToast = (msg) => {
|
|
2023
2030
|
if (toastTimer.current) clearTimeout(toastTimer.current);
|
|
2024
2031
|
setToast(msg);
|
|
@@ -2240,7 +2247,7 @@ var ThemeMenu = React11.memo(({ config, onClose }) => {
|
|
|
2240
2247
|
});
|
|
2241
2248
|
|
|
2242
2249
|
// src/ui/components/AlertRulesMenu.tsx
|
|
2243
|
-
import React12, { useState as useState7, useRef as
|
|
2250
|
+
import React12, { useState as useState7, useRef as useRef4, useEffect as useEffect4 } from "react";
|
|
2244
2251
|
import { Box as Box12, Text as Text12, useInput as useInput6, useStdout as useStdout3 } from "ink";
|
|
2245
2252
|
import { jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2246
2253
|
var MATCH_OPTIONS = ["input", "output", "toolName", "all"];
|
|
@@ -2291,7 +2298,7 @@ var AlertRulesMenu = React12.memo(({ config, onClose, onSave }) => {
|
|
|
2291
2298
|
const [selectedIdx, setSelectedIdx] = useState7(0);
|
|
2292
2299
|
const [view, setView] = useState7("list");
|
|
2293
2300
|
const [toast, setToast] = useState7("");
|
|
2294
|
-
const toastTimer =
|
|
2301
|
+
const toastTimer = useRef4(null);
|
|
2295
2302
|
const [formData, setFormData] = useState7(emptyForm());
|
|
2296
2303
|
const [formField, setFormField] = useState7(0);
|
|
2297
2304
|
const [formError, setFormError] = useState7("");
|
|
@@ -2954,7 +2961,7 @@ var SplitPanel = React17.memo(
|
|
|
2954
2961
|
);
|
|
2955
2962
|
|
|
2956
2963
|
// src/ui/hooks/useSessions.ts
|
|
2957
|
-
import { useState as useState11, useEffect as useEffect6, useCallback as useCallback3, useRef as
|
|
2964
|
+
import { useState as useState11, useEffect as useEffect6, useCallback as useCallback3, useRef as useRef5, useMemo as useMemo2 } from "react";
|
|
2958
2965
|
|
|
2959
2966
|
// src/discovery/sessionsAsync.ts
|
|
2960
2967
|
import { readdir, stat as stat2, open as open2 } from "fs/promises";
|
|
@@ -3470,7 +3477,7 @@ var useSessions = (allUsers, filter, archivedIds, viewingArchive) => {
|
|
|
3470
3477
|
const [sessions2, setSessions] = useState11([]);
|
|
3471
3478
|
const [selectedIndex, setSelectedIndex] = useState11(0);
|
|
3472
3479
|
const [expandedKeys, setExpandedKeys] = useState11(/* @__PURE__ */ new Set());
|
|
3473
|
-
const usageOverrides =
|
|
3480
|
+
const usageOverrides = useRef5(/* @__PURE__ */ new Map());
|
|
3474
3481
|
const refresh = useCallback3(() => {
|
|
3475
3482
|
const found = getCachedSessions();
|
|
3476
3483
|
const filtered = enrichAndFilter(found, usageOverrides.current, filter, archivedIds, viewingArchive);
|
|
@@ -3493,7 +3500,7 @@ var useSessions = (allUsers, filter, archivedIds, viewingArchive) => {
|
|
|
3493
3500
|
}, [refresh, sessions2.length > 0]);
|
|
3494
3501
|
const groups = useMemo2(() => buildGroups(sessions2, expandedKeys), [sessions2, expandedKeys]);
|
|
3495
3502
|
const visibleItems = useMemo2(() => buildVisibleItems(groups), [groups]);
|
|
3496
|
-
const itemCountRef =
|
|
3503
|
+
const itemCountRef = useRef5(visibleItems.length);
|
|
3497
3504
|
itemCountRef.current = visibleItems.length;
|
|
3498
3505
|
const selectedItem = visibleItems[selectedIndex] ?? null;
|
|
3499
3506
|
const selectedSession = selectedItem?.type === "ungrouped" ? selectedItem.session : selectedItem?.type === "session" ? selectedItem.session : null;
|
|
@@ -3545,18 +3552,42 @@ var useSessions = (allUsers, filter, archivedIds, viewingArchive) => {
|
|
|
3545
3552
|
};
|
|
3546
3553
|
|
|
3547
3554
|
// src/ui/hooks/useActivityStream.ts
|
|
3548
|
-
import { useState as useState12, useEffect as useEffect7, useRef as
|
|
3555
|
+
import { useState as useState12, useEffect as useEffect7, useRef as useRef6, useMemo as useMemo3, useCallback as useCallback4 } from "react";
|
|
3549
3556
|
var MAX_EVENTS = 200;
|
|
3557
|
+
var DEBOUNCE_MS = 80;
|
|
3550
3558
|
var useActivityStream = (session, allUsers) => {
|
|
3551
3559
|
const [calls, setCalls] = useState12([]);
|
|
3552
3560
|
const [results, setResults] = useState12([]);
|
|
3553
|
-
const watcherRef =
|
|
3561
|
+
const watcherRef = useRef6(null);
|
|
3562
|
+
const pendingCallsRef = useRef6([]);
|
|
3563
|
+
const pendingResultsRef = useRef6([]);
|
|
3564
|
+
const flushTimerRef = useRef6(null);
|
|
3554
3565
|
const sessions2 = session === null ? [] : Array.isArray(session) ? session : [session];
|
|
3555
3566
|
const sessionKey = sessions2.map((s) => s.sessionId).sort().join(",");
|
|
3556
3567
|
const sessionIdSet = new Set(sessions2.map((s) => s.sessionId));
|
|
3568
|
+
const flush = useCallback4(() => {
|
|
3569
|
+
flushTimerRef.current = null;
|
|
3570
|
+
const pc = pendingCallsRef.current;
|
|
3571
|
+
const pr = pendingResultsRef.current;
|
|
3572
|
+
if (pc.length > 0) {
|
|
3573
|
+
const batch = pc.splice(0);
|
|
3574
|
+
setCalls((prev) => [...prev, ...batch].slice(-MAX_EVENTS));
|
|
3575
|
+
}
|
|
3576
|
+
if (pr.length > 0) {
|
|
3577
|
+
const batch = pr.splice(0);
|
|
3578
|
+
setResults((prev) => [...prev, ...batch].slice(-MAX_EVENTS * 2));
|
|
3579
|
+
}
|
|
3580
|
+
}, []);
|
|
3581
|
+
const scheduleFlush = useCallback4(() => {
|
|
3582
|
+
if (!flushTimerRef.current) {
|
|
3583
|
+
flushTimerRef.current = setTimeout(flush, DEBOUNCE_MS);
|
|
3584
|
+
}
|
|
3585
|
+
}, [flush]);
|
|
3557
3586
|
useEffect7(() => {
|
|
3558
3587
|
setCalls([]);
|
|
3559
3588
|
setResults([]);
|
|
3589
|
+
pendingCallsRef.current = [];
|
|
3590
|
+
pendingResultsRef.current = [];
|
|
3560
3591
|
if (sessions2.length === 0) return;
|
|
3561
3592
|
let cancelled = false;
|
|
3562
3593
|
const loadExisting = async () => {
|
|
@@ -3583,18 +3614,21 @@ var useActivityStream = (session, allUsers) => {
|
|
|
3583
3614
|
const callHandler = (newCalls) => {
|
|
3584
3615
|
const matched = newCalls.filter((c) => sessionIdSet.has(c.sessionId));
|
|
3585
3616
|
if (matched.length === 0) return;
|
|
3586
|
-
|
|
3617
|
+
pendingCallsRef.current.push(...matched);
|
|
3618
|
+
scheduleFlush();
|
|
3587
3619
|
};
|
|
3588
3620
|
const resultHandler = (newResults) => {
|
|
3589
3621
|
const matched = newResults.filter((r) => sessionIdSet.has(r.sessionId));
|
|
3590
3622
|
if (matched.length === 0) return;
|
|
3591
|
-
|
|
3623
|
+
pendingResultsRef.current.push(...matched);
|
|
3624
|
+
scheduleFlush();
|
|
3592
3625
|
};
|
|
3593
3626
|
const watcher = new Watcher(callHandler, allUsers, void 0, void 0, resultHandler);
|
|
3594
3627
|
watcherRef.current = watcher;
|
|
3595
3628
|
watcher.start();
|
|
3596
3629
|
return () => {
|
|
3597
3630
|
cancelled = true;
|
|
3631
|
+
if (flushTimerRef.current) clearTimeout(flushTimerRef.current);
|
|
3598
3632
|
watcher.stop();
|
|
3599
3633
|
watcherRef.current = null;
|
|
3600
3634
|
};
|
|
@@ -3623,7 +3657,7 @@ var applyFilter = (events, filter) => {
|
|
|
3623
3657
|
var useFilteredEvents = (rawEvents, filter) => useMemo4(() => applyFilter(rawEvents, filter), [rawEvents, filter]);
|
|
3624
3658
|
|
|
3625
3659
|
// src/ui/hooks/useAlerts.ts
|
|
3626
|
-
import { useState as useState13, useEffect as useEffect8, useRef as
|
|
3660
|
+
import { useState as useState13, useEffect as useEffect8, useRef as useRef7 } from "react";
|
|
3627
3661
|
|
|
3628
3662
|
// src/notifications.ts
|
|
3629
3663
|
import { execFile as execFile2 } from "child_process";
|
|
@@ -3704,9 +3738,9 @@ var AlertLogger = class {
|
|
|
3704
3738
|
var MAX_ALERTS = 100;
|
|
3705
3739
|
var useAlerts = (enabled, alertLevel, allUsers, config) => {
|
|
3706
3740
|
const [alerts, setAlerts] = useState13([]);
|
|
3707
|
-
const engineRef =
|
|
3708
|
-
const watcherRef =
|
|
3709
|
-
const loggerRef =
|
|
3741
|
+
const engineRef = useRef7(new SecurityEngine(alertLevel));
|
|
3742
|
+
const watcherRef = useRef7(null);
|
|
3743
|
+
const loggerRef = useRef7(null);
|
|
3710
3744
|
useEffect8(() => {
|
|
3711
3745
|
if (!enabled) return;
|
|
3712
3746
|
engineRef.current = new SecurityEngine(alertLevel);
|
|
@@ -3743,27 +3777,27 @@ var useAlerts = (enabled, alertLevel, allUsers, config) => {
|
|
|
3743
3777
|
};
|
|
3744
3778
|
|
|
3745
3779
|
// src/ui/hooks/useTextInput.ts
|
|
3746
|
-
import { useState as useState14, useCallback as
|
|
3780
|
+
import { useState as useState14, useCallback as useCallback5 } from "react";
|
|
3747
3781
|
var useTextInput = (onConfirm, onCancel) => {
|
|
3748
3782
|
const [value, setValue] = useState14("");
|
|
3749
3783
|
const [isActive, setIsActive] = useState14(false);
|
|
3750
|
-
const start =
|
|
3784
|
+
const start = useCallback5((initial = "") => {
|
|
3751
3785
|
setValue(initial);
|
|
3752
3786
|
setIsActive(true);
|
|
3753
3787
|
}, []);
|
|
3754
|
-
const cancel =
|
|
3788
|
+
const cancel = useCallback5(() => {
|
|
3755
3789
|
setValue("");
|
|
3756
3790
|
setIsActive(false);
|
|
3757
3791
|
onCancel?.();
|
|
3758
3792
|
}, [onCancel]);
|
|
3759
|
-
const confirm =
|
|
3793
|
+
const confirm = useCallback5(() => {
|
|
3760
3794
|
const result = value;
|
|
3761
3795
|
setIsActive(false);
|
|
3762
3796
|
setValue("");
|
|
3763
3797
|
onConfirm?.(result);
|
|
3764
3798
|
return result;
|
|
3765
3799
|
}, [value, onConfirm]);
|
|
3766
|
-
const handleInput =
|
|
3800
|
+
const handleInput = useCallback5(
|
|
3767
3801
|
(input, key) => {
|
|
3768
3802
|
if (!isActive) return false;
|
|
3769
3803
|
if (key.escape) {
|
|
@@ -4078,7 +4112,7 @@ var useUpdateChecker = (disabled, checkOnLaunch, checkInterval) => {
|
|
|
4078
4112
|
};
|
|
4079
4113
|
|
|
4080
4114
|
// src/ui/hooks/useSetupFlow.ts
|
|
4081
|
-
import { useState as useState16, useCallback as
|
|
4115
|
+
import { useState as useState16, useCallback as useCallback6 } from "react";
|
|
4082
4116
|
|
|
4083
4117
|
// src/hooks/installer.ts
|
|
4084
4118
|
import { existsSync, readFileSync, writeFileSync, copyFileSync, mkdirSync as mkdirSync2, chmodSync } from "fs";
|
|
@@ -4204,19 +4238,19 @@ var useSetupFlow = (initialConfig, firstRun) => {
|
|
|
4204
4238
|
const [showTour, setShowTour] = useState16(false);
|
|
4205
4239
|
const [showSettings, setShowSettings] = useState16(false);
|
|
4206
4240
|
const [showThemeMenu, setShowThemeMenu] = useState16(false);
|
|
4207
|
-
const handleSettingsClose =
|
|
4241
|
+
const handleSettingsClose = useCallback6((c) => {
|
|
4208
4242
|
setLiveConfig(c);
|
|
4209
4243
|
saveConfig(c);
|
|
4210
4244
|
setShowSettings(false);
|
|
4211
4245
|
}, []);
|
|
4212
|
-
const handleThemeMenuClose =
|
|
4246
|
+
const handleThemeMenuClose = useCallback6((c) => {
|
|
4213
4247
|
setLiveConfig(c);
|
|
4214
4248
|
saveConfig(c);
|
|
4215
4249
|
setShowThemeMenu(false);
|
|
4216
4250
|
setShowSettings(true);
|
|
4217
4251
|
}, []);
|
|
4218
|
-
const handleOpenThemeMenu =
|
|
4219
|
-
const handleSetupComplete =
|
|
4252
|
+
const handleOpenThemeMenu = useCallback6(() => setShowThemeMenu(true), []);
|
|
4253
|
+
const handleSetupComplete = useCallback6(
|
|
4220
4254
|
(results) => {
|
|
4221
4255
|
const nc = { ...liveConfig };
|
|
4222
4256
|
const [hc, mc] = results;
|
|
@@ -4241,7 +4275,7 @@ var useSetupFlow = (initialConfig, firstRun) => {
|
|
|
4241
4275
|
},
|
|
4242
4276
|
[liveConfig]
|
|
4243
4277
|
);
|
|
4244
|
-
const handleThemePickerSelect =
|
|
4278
|
+
const handleThemePickerSelect = useCallback6(
|
|
4245
4279
|
(themeName) => {
|
|
4246
4280
|
const nc = { ...liveConfig, theme: themeName, prompts: { ...liveConfig.prompts, theme: "done" } };
|
|
4247
4281
|
setLiveConfig(nc);
|
|
@@ -4251,24 +4285,24 @@ var useSetupFlow = (initialConfig, firstRun) => {
|
|
|
4251
4285
|
},
|
|
4252
4286
|
[liveConfig]
|
|
4253
4287
|
);
|
|
4254
|
-
const handleThemePickerSkip =
|
|
4288
|
+
const handleThemePickerSkip = useCallback6(() => {
|
|
4255
4289
|
setShowThemePicker(false);
|
|
4256
4290
|
if (liveConfig.prompts.tour === "pending") setShowTour(true);
|
|
4257
4291
|
}, [liveConfig]);
|
|
4258
|
-
const handleThemePickerDismiss =
|
|
4292
|
+
const handleThemePickerDismiss = useCallback6(() => {
|
|
4259
4293
|
const nc = { ...liveConfig, prompts: { ...liveConfig.prompts, theme: "dismissed" } };
|
|
4260
4294
|
setLiveConfig(nc);
|
|
4261
4295
|
saveConfig(nc);
|
|
4262
4296
|
setShowThemePicker(false);
|
|
4263
4297
|
if (nc.prompts.tour === "pending") setShowTour(true);
|
|
4264
4298
|
}, [liveConfig]);
|
|
4265
|
-
const handleTourComplete =
|
|
4299
|
+
const handleTourComplete = useCallback6(() => {
|
|
4266
4300
|
const nc = { ...liveConfig, prompts: { ...liveConfig.prompts, tour: "done" } };
|
|
4267
4301
|
setLiveConfig(nc);
|
|
4268
4302
|
saveConfig(nc);
|
|
4269
4303
|
setShowTour(false);
|
|
4270
4304
|
}, [liveConfig]);
|
|
4271
|
-
const handleTourSkip =
|
|
4305
|
+
const handleTourSkip = useCallback6(() => {
|
|
4272
4306
|
setShowTour(false);
|
|
4273
4307
|
}, []);
|
|
4274
4308
|
return {
|
|
@@ -4294,7 +4328,7 @@ var useSetupFlow = (initialConfig, firstRun) => {
|
|
|
4294
4328
|
};
|
|
4295
4329
|
|
|
4296
4330
|
// src/ui/hooks/useSplitPanel.ts
|
|
4297
|
-
import { useState as useState17, useCallback as
|
|
4331
|
+
import { useState as useState17, useCallback as useCallback7 } from "react";
|
|
4298
4332
|
var useSplitPanel = () => {
|
|
4299
4333
|
const [splitMode, setSplitMode] = useState17(false);
|
|
4300
4334
|
const [leftSession, setLeftSession] = useState17(null);
|
|
@@ -4305,7 +4339,7 @@ var useSplitPanel = () => {
|
|
|
4305
4339
|
const [rightFilter, setRightFilter] = useState17("");
|
|
4306
4340
|
const [leftShowDetail, setLeftShowDetail] = useState17(false);
|
|
4307
4341
|
const [rightShowDetail, setRightShowDetail] = useState17(false);
|
|
4308
|
-
const clearSplitState =
|
|
4342
|
+
const clearSplitState = useCallback7(() => {
|
|
4309
4343
|
setSplitMode(false);
|
|
4310
4344
|
setLeftSession(null);
|
|
4311
4345
|
setRightSession(null);
|
|
@@ -4316,7 +4350,7 @@ var useSplitPanel = () => {
|
|
|
4316
4350
|
setLeftShowDetail(false);
|
|
4317
4351
|
setRightShowDetail(false);
|
|
4318
4352
|
}, []);
|
|
4319
|
-
const resetPanel =
|
|
4353
|
+
const resetPanel = useCallback7((side) => {
|
|
4320
4354
|
if (side === "left") {
|
|
4321
4355
|
setLeftSession(null);
|
|
4322
4356
|
setLeftScroll(0);
|
|
@@ -4329,7 +4363,7 @@ var useSplitPanel = () => {
|
|
|
4329
4363
|
setRightShowDetail(false);
|
|
4330
4364
|
}
|
|
4331
4365
|
}, []);
|
|
4332
|
-
const switchPanel =
|
|
4366
|
+
const switchPanel = useCallback7(
|
|
4333
4367
|
(dir, setActivePanel) => {
|
|
4334
4368
|
if (splitMode) {
|
|
4335
4369
|
const order = ["sessions", "left", "right"];
|
|
@@ -4395,8 +4429,8 @@ var App = ({ options: options2, config: initialConfig, version, firstRun }) => {
|
|
|
4395
4429
|
const [showEventDetail, setShowEventDetail] = useState18(false);
|
|
4396
4430
|
const [showUpdateModal, setShowUpdateModal] = useState18(false);
|
|
4397
4431
|
const [showAlertRules, setShowAlertRules] = useState18(false);
|
|
4398
|
-
const refreshArchived =
|
|
4399
|
-
const persistSidebarWidth =
|
|
4432
|
+
const refreshArchived = useCallback8(() => setArchivedIds(new Set(Object.keys(getArchived()))), []);
|
|
4433
|
+
const persistSidebarWidth = useCallback8((v) => {
|
|
4400
4434
|
setSidebarWidth((prev) => {
|
|
4401
4435
|
const next = typeof v === "function" ? v(prev) : v;
|
|
4402
4436
|
if (next !== prev) {
|
|
@@ -4494,21 +4528,21 @@ var App = ({ options: options2, config: initialConfig, version, firstRun }) => {
|
|
|
4494
4528
|
const alertHeight = options2.noSecurity ? 0 : 6;
|
|
4495
4529
|
const mainHeight = termHeight - 3 - alertHeight - 1 - (inputMode !== "normal" ? 1 : 0);
|
|
4496
4530
|
const viewportRows = mainHeight - 2;
|
|
4497
|
-
const switchPanel =
|
|
4531
|
+
const switchPanel = useCallback8(
|
|
4498
4532
|
(dir) => split.switchPanel(dir, setActivePanel),
|
|
4499
4533
|
[split.switchPanel]
|
|
4500
4534
|
);
|
|
4501
|
-
const clearSplitState =
|
|
4535
|
+
const clearSplitState = useCallback8(() => {
|
|
4502
4536
|
split.clearSplitState();
|
|
4503
4537
|
setActivePanel("sessions");
|
|
4504
4538
|
}, [split.clearSplitState]);
|
|
4505
|
-
const getActiveFilter =
|
|
4539
|
+
const getActiveFilter = useCallback8(() => {
|
|
4506
4540
|
if (activePanel === "sessions") return filter;
|
|
4507
4541
|
if (activePanel === "left") return split.leftFilter;
|
|
4508
4542
|
if (activePanel === "right") return split.rightFilter;
|
|
4509
4543
|
return activityFilter;
|
|
4510
4544
|
}, [activePanel, filter, split.leftFilter, split.rightFilter, activityFilter]);
|
|
4511
|
-
const handleTogglePin =
|
|
4545
|
+
const handleTogglePin = useCallback8(
|
|
4512
4546
|
(sessionId) => {
|
|
4513
4547
|
const cfg = loadConfig();
|
|
4514
4548
|
if (cfg.pinnedSessions.includes(sessionId)) {
|
|
@@ -4520,7 +4554,7 @@ var App = ({ options: options2, config: initialConfig, version, firstRun }) => {
|
|
|
4520
4554
|
},
|
|
4521
4555
|
[refresh]
|
|
4522
4556
|
);
|
|
4523
|
-
const handleMovePinned =
|
|
4557
|
+
const handleMovePinned = useCallback8(
|
|
4524
4558
|
(sessionId, dir) => {
|
|
4525
4559
|
movePinned(sessionId, dir);
|
|
4526
4560
|
refresh();
|