@cryptiklemur/lattice 1.41.3 → 1.42.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/client/src/components/dashboard/DashboardView.tsx +44 -95
- package/client/src/components/mesh/PairingDialog.tsx +4 -5
- package/client/src/components/settings/MeshStatus.tsx +3 -3
- package/client/src/components/sidebar/ProjectRail.tsx +72 -2
- package/client/src/components/sidebar/SessionList.tsx +1 -1
- package/client/src/router.tsx +0 -2
- package/package.json +1 -1
- package/server/src/daemon.ts +2 -2
- package/server/src/project/sdk-bridge.ts +35 -0
- package/shared/src/models.ts +1 -0
|
@@ -7,8 +7,8 @@ import { useTimeTick } from "../../hooks/useTimeTick";
|
|
|
7
7
|
import { LatticeLogomark } from "../ui/LatticeLogomark";
|
|
8
8
|
import { QuickStats } from "../analytics/QuickStats";
|
|
9
9
|
import {
|
|
10
|
-
Network, FolderOpen,
|
|
11
|
-
ChevronRight,
|
|
10
|
+
Network, FolderOpen, MessageSquare, Menu,
|
|
11
|
+
ChevronRight, CircleDot, Circle,
|
|
12
12
|
} from "lucide-react";
|
|
13
13
|
import type { ServerMessage, SessionSummary, LatticeConfig } from "@lattice/shared";
|
|
14
14
|
import { formatSessionTitle } from "../../utils/formatSessionTitle";
|
|
@@ -89,12 +89,12 @@ export function DashboardView() {
|
|
|
89
89
|
return map;
|
|
90
90
|
}, [sessions]);
|
|
91
91
|
|
|
92
|
-
var
|
|
92
|
+
var remoteNodes = nodes.filter(function (n) { return !n.isLocal; });
|
|
93
93
|
|
|
94
94
|
return (
|
|
95
95
|
<div className="flex-1 overflow-auto">
|
|
96
|
-
<div className="max-w-2xl mx-auto px-4 sm:px-8 py-
|
|
97
|
-
<div className="flex items-center gap-3 mb-
|
|
96
|
+
<div className="max-w-2xl mx-auto px-4 sm:px-8 py-6 sm:py-10">
|
|
97
|
+
<div className="flex items-center gap-3 mb-2">
|
|
98
98
|
<button
|
|
99
99
|
className="btn btn-ghost btn-sm btn-square lg:hidden"
|
|
100
100
|
aria-label="Toggle sidebar"
|
|
@@ -102,74 +102,42 @@ export function DashboardView() {
|
|
|
102
102
|
>
|
|
103
103
|
<Menu size={18} />
|
|
104
104
|
</button>
|
|
105
|
-
<LatticeLogomark size={
|
|
106
|
-
<
|
|
107
|
-
<h1 className="text-xl font-mono font-bold text-base-content">Lattice</h1>
|
|
108
|
-
<p className="text-[13px] text-base-content/40">Multi-machine agentic dashboard</p>
|
|
109
|
-
</div>
|
|
105
|
+
<LatticeLogomark size={28} />
|
|
106
|
+
<h1 className="text-lg font-mono font-bold text-base-content">Lattice</h1>
|
|
110
107
|
</div>
|
|
111
108
|
|
|
112
|
-
<div className="
|
|
113
|
-
<
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
<div className="text-xl font-mono font-bold text-base-content">
|
|
119
|
-
{onlineNodes.length}
|
|
120
|
-
<span className="text-base-content/30 text-sm font-normal">/{nodes.length}</span>
|
|
121
|
-
</div>
|
|
122
|
-
</div>
|
|
123
|
-
|
|
124
|
-
<div className="bg-base-200 rounded-xl p-3 px-4 border border-base-content/15">
|
|
125
|
-
<div className="flex items-center gap-2 mb-1.5">
|
|
126
|
-
<FolderOpen size={14} className="text-accent" />
|
|
127
|
-
<span className="text-[11px] font-semibold tracking-wider uppercase text-base-content/40">Projects</span>
|
|
128
|
-
</div>
|
|
129
|
-
<div className="text-xl font-mono font-bold text-base-content">{projects.length}</div>
|
|
130
|
-
</div>
|
|
131
|
-
|
|
132
|
-
<div className="bg-base-200 rounded-xl p-3 px-4 border border-base-content/15">
|
|
133
|
-
<div className="flex items-center gap-2 mb-1.5">
|
|
134
|
-
<MessageSquare size={14} className="text-info" />
|
|
135
|
-
<span className="text-[11px] font-semibold tracking-wider uppercase text-base-content/40">Sessions</span>
|
|
136
|
-
</div>
|
|
137
|
-
<div className="text-xl font-mono font-bold text-base-content">{totalSessions}</div>
|
|
138
|
-
</div>
|
|
139
|
-
|
|
140
|
-
<div className="bg-base-200 rounded-xl p-3 px-4 border border-base-content/15">
|
|
141
|
-
<div className="flex items-center gap-2 mb-1.5">
|
|
142
|
-
<Activity size={14} className="text-success" />
|
|
143
|
-
<span className="text-[11px] font-semibold tracking-wider uppercase text-base-content/40">Status</span>
|
|
144
|
-
</div>
|
|
145
|
-
<div className="text-xl font-mono font-bold text-success">OK</div>
|
|
146
|
-
</div>
|
|
109
|
+
<div className="flex items-center gap-4 text-[11px] font-mono text-base-content/30 mb-10 ml-[43px]">
|
|
110
|
+
<span>{onlineNodes.length}/{nodes.length} nodes</span>
|
|
111
|
+
<span className="text-base-content/15">/</span>
|
|
112
|
+
<span>{projects.length} projects</span>
|
|
113
|
+
<span className="text-base-content/15">/</span>
|
|
114
|
+
<span>{sessions.length} sessions</span>
|
|
147
115
|
</div>
|
|
148
116
|
|
|
149
|
-
<div className="
|
|
117
|
+
<div className="mb-12">
|
|
150
118
|
<QuickStats />
|
|
151
119
|
</div>
|
|
152
120
|
|
|
153
121
|
{sessions.length > 0 && (
|
|
154
|
-
<div className="mb-
|
|
122
|
+
<div className="mb-12">
|
|
155
123
|
<h2 className="text-[11px] font-semibold tracking-wider uppercase text-base-content/40 mb-3">Recent Sessions</h2>
|
|
156
|
-
<div className="flex flex-col gap-1
|
|
124
|
+
<div className="flex flex-col gap-1">
|
|
157
125
|
{sessions.slice(0, 8).map(function (s) {
|
|
158
126
|
return (
|
|
159
127
|
<button
|
|
160
128
|
key={s.id}
|
|
161
129
|
onClick={function () { openSessionTab(s.id, s.projectSlug, s.title); sidebar.navigateToSession(s.projectSlug, s.id); }}
|
|
162
|
-
className="flex items-center gap-3 px-3 py-2 rounded-
|
|
130
|
+
className="flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-base-200 transition-colors duration-[120ms] cursor-pointer text-left focus-visible:ring-2 focus-visible:ring-primary group"
|
|
163
131
|
>
|
|
164
|
-
<MessageSquare size={12} className="text-base-content/
|
|
165
|
-
<span className="flex-1 text-[12px] text-base-content truncate">{formatSessionTitle(s.title) || "Untitled"}</span>
|
|
166
|
-
<span className="
|
|
132
|
+
<MessageSquare size={12} className="text-base-content/20 flex-shrink-0" />
|
|
133
|
+
<span className="flex-1 text-[12px] text-base-content/70 truncate group-hover:text-base-content">{formatSessionTitle(s.title) || "Untitled"}</span>
|
|
134
|
+
<span className="text-[10px] font-mono text-base-content/25 flex-shrink-0">
|
|
167
135
|
{getProjectTitle(s.projectSlug)}
|
|
168
136
|
</span>
|
|
169
|
-
<span className="text-[10px] text-base-content/
|
|
137
|
+
<span className="text-[10px] text-base-content/20 font-mono flex-shrink-0">
|
|
170
138
|
{relativeTime(s.updatedAt)}
|
|
171
139
|
</span>
|
|
172
|
-
<ChevronRight size={
|
|
140
|
+
<ChevronRight size={10} className="text-base-content/15 flex-shrink-0 opacity-0 group-hover:opacity-100" />
|
|
173
141
|
</button>
|
|
174
142
|
);
|
|
175
143
|
})}
|
|
@@ -178,26 +146,28 @@ export function DashboardView() {
|
|
|
178
146
|
)}
|
|
179
147
|
|
|
180
148
|
{projects.length > 0 && (
|
|
181
|
-
<div className="mb-
|
|
149
|
+
<div className="mb-12">
|
|
182
150
|
<h2 className="text-[11px] font-semibold tracking-wider uppercase text-base-content/40 mb-3">Projects</h2>
|
|
183
|
-
<div className="grid grid-cols-1 sm:grid-cols-2 gap-
|
|
151
|
+
<div className="grid grid-cols-1 sm:grid-cols-2 gap-2">
|
|
184
152
|
{projects.map(function (project) {
|
|
185
153
|
var projectSessions = sessionsByProject.get(project.slug) || [];
|
|
186
154
|
return (
|
|
187
155
|
<button
|
|
188
|
-
key={project.slug}
|
|
156
|
+
key={project.slug + "@" + project.nodeId}
|
|
189
157
|
onClick={function () { sidebar.setActiveProjectSlug(project.slug); }}
|
|
190
|
-
className="flex items-
|
|
158
|
+
className="flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-base-200 transition-colors duration-[120ms] cursor-pointer text-left focus-visible:ring-2 focus-visible:ring-primary group"
|
|
191
159
|
>
|
|
192
|
-
<FolderOpen size={
|
|
160
|
+
<FolderOpen size={14} className="text-base-content/20 flex-shrink-0" />
|
|
193
161
|
<div className="flex-1 min-w-0">
|
|
194
|
-
<div className="text-[13px] font-semibold text-base-content truncate">{project.title}</div>
|
|
195
|
-
<div className="text-[
|
|
196
|
-
<div className="text-[10px] text-base-content/30 mt-1">
|
|
162
|
+
<div className="text-[13px] font-semibold text-base-content/70 truncate group-hover:text-base-content">{project.title}</div>
|
|
163
|
+
<div className="text-[10px] text-base-content/25 font-mono">
|
|
197
164
|
{projectSessions.length} session{projectSessions.length !== 1 ? "s" : ""}
|
|
165
|
+
{project.isRemote && (
|
|
166
|
+
<span className="ml-1.5 text-base-content/20">on {project.nodeName}</span>
|
|
167
|
+
)}
|
|
198
168
|
</div>
|
|
199
169
|
</div>
|
|
200
|
-
<ChevronRight size={
|
|
170
|
+
<ChevronRight size={12} className="text-base-content/15 flex-shrink-0 opacity-0 group-hover:opacity-100" />
|
|
201
171
|
</button>
|
|
202
172
|
);
|
|
203
173
|
})}
|
|
@@ -205,40 +175,19 @@ export function DashboardView() {
|
|
|
205
175
|
</div>
|
|
206
176
|
)}
|
|
207
177
|
|
|
208
|
-
{
|
|
178
|
+
{remoteNodes.length > 0 && (
|
|
209
179
|
<div>
|
|
210
|
-
<h2 className="text-[11px] font-semibold tracking-wider uppercase text-base-content/40 mb-3">Mesh
|
|
211
|
-
<div className="flex flex-
|
|
212
|
-
{
|
|
180
|
+
<h2 className="text-[11px] font-semibold tracking-wider uppercase text-base-content/40 mb-3">Mesh</h2>
|
|
181
|
+
<div className="flex flex-wrap gap-x-6 gap-y-2">
|
|
182
|
+
{remoteNodes.map(function (node) {
|
|
213
183
|
return (
|
|
214
|
-
<div key={node.id} className="flex items-center gap-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
<
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
<div className="text-[11px] text-base-content/40">{node.address}:{node.port}</div>
|
|
222
|
-
</div>
|
|
223
|
-
{node.isLocal && localConfig && (
|
|
224
|
-
<div className="flex gap-1.5 flex-shrink-0">
|
|
225
|
-
{localConfig.tls && (
|
|
226
|
-
<span className="flex items-center gap-1 px-1.5 py-0.5 rounded-md text-[10px] font-mono bg-base-content/8 text-base-content/40">
|
|
227
|
-
<Lock size={9} />
|
|
228
|
-
TLS
|
|
229
|
-
</span>
|
|
230
|
-
)}
|
|
231
|
-
{localConfig.debug && (
|
|
232
|
-
<span className="flex items-center gap-1 px-1.5 py-0.5 rounded-md text-[10px] font-mono bg-warning/20 text-warning">
|
|
233
|
-
<Bug size={9} />
|
|
234
|
-
Debug
|
|
235
|
-
</span>
|
|
236
|
-
)}
|
|
237
|
-
</div>
|
|
238
|
-
)}
|
|
239
|
-
<div className="text-[11px] text-base-content/40 flex-shrink-0">
|
|
240
|
-
{node.projects.length} project{node.projects.length !== 1 ? "s" : ""}
|
|
241
|
-
</div>
|
|
184
|
+
<div key={node.id} className="flex items-center gap-2">
|
|
185
|
+
{node.online
|
|
186
|
+
? <CircleDot size={10} className="text-success flex-shrink-0" />
|
|
187
|
+
: <Circle size={10} className="text-base-content/20 flex-shrink-0" />
|
|
188
|
+
}
|
|
189
|
+
<span className="text-[12px] text-base-content/50">{node.name}</span>
|
|
190
|
+
<span className="text-[10px] text-base-content/20 font-mono">{node.projects.length}p</span>
|
|
242
191
|
</div>
|
|
243
192
|
);
|
|
244
193
|
})}
|
|
@@ -26,6 +26,7 @@ export var PairingDialog = memo(function PairingDialog(props: PairingDialogProps
|
|
|
26
26
|
var [selectedAddress, setSelectedAddress] = useState("");
|
|
27
27
|
var modalRef = useRef<HTMLDivElement>(null);
|
|
28
28
|
var inputRef = useRef<HTMLInputElement>(null);
|
|
29
|
+
var pairTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
29
30
|
|
|
30
31
|
useEffect(function () {
|
|
31
32
|
if (!props.isOpen) {
|
|
@@ -38,6 +39,7 @@ export var PairingDialog = memo(function PairingDialog(props: PairingDialogProps
|
|
|
38
39
|
setAddresses([]);
|
|
39
40
|
setSelectedAddress("");
|
|
40
41
|
setTab("generate");
|
|
42
|
+
if (pairTimeoutRef.current) { clearTimeout(pairTimeoutRef.current); pairTimeoutRef.current = null; }
|
|
41
43
|
return;
|
|
42
44
|
}
|
|
43
45
|
|
|
@@ -109,7 +111,8 @@ export var PairingDialog = memo(function PairingDialog(props: PairingDialogProps
|
|
|
109
111
|
setPairStatus("connecting");
|
|
110
112
|
setPairError(null);
|
|
111
113
|
|
|
112
|
-
|
|
114
|
+
if (pairTimeoutRef.current) clearTimeout(pairTimeoutRef.current);
|
|
115
|
+
pairTimeoutRef.current = setTimeout(function () {
|
|
113
116
|
setPairStatus(function (prev) {
|
|
114
117
|
if (prev === "connecting") {
|
|
115
118
|
setPairError("Pairing timed out. Check the code and try again.");
|
|
@@ -120,10 +123,6 @@ export var PairingDialog = memo(function PairingDialog(props: PairingDialogProps
|
|
|
120
123
|
}, 30000);
|
|
121
124
|
|
|
122
125
|
ws.send({ type: "mesh:pair", code: trimmed });
|
|
123
|
-
|
|
124
|
-
return function () {
|
|
125
|
-
clearTimeout(timeout);
|
|
126
|
-
};
|
|
127
126
|
}
|
|
128
127
|
|
|
129
128
|
function handleCopyCode() {
|
|
@@ -41,14 +41,14 @@ function NodeRow(props: NodeRowProps) {
|
|
|
41
41
|
</span>
|
|
42
42
|
)}
|
|
43
43
|
</div>
|
|
44
|
-
<div className="text-[11px] text-base-content/40">
|
|
44
|
+
<div className="text-[11px] text-base-content/40 truncate">
|
|
45
45
|
{(props.node.addresses && props.node.addresses.length > 0
|
|
46
46
|
? props.node.addresses
|
|
47
47
|
: [props.node.address + (props.node.port ? ":" + props.node.port : "")]
|
|
48
48
|
).map(function (addr, i) {
|
|
49
49
|
return (
|
|
50
|
-
<span key={addr}
|
|
51
|
-
{i > 0 && <span className="text-base-content/20
|
|
50
|
+
<span key={addr}>
|
|
51
|
+
{i > 0 && <span className="text-base-content/20 mx-1">/</span>}
|
|
52
52
|
{addr}
|
|
53
53
|
</span>
|
|
54
54
|
);
|
|
@@ -19,6 +19,7 @@ function getProjectInitials(title: string): string {
|
|
|
19
19
|
interface ProjectGroup {
|
|
20
20
|
slug: string;
|
|
21
21
|
title: string;
|
|
22
|
+
activeSessions: number;
|
|
22
23
|
nodes: Array<{ nodeId: string; nodeName: string; online: boolean; path: string }>;
|
|
23
24
|
}
|
|
24
25
|
|
|
@@ -36,8 +37,9 @@ function groupProjectsBySlug(projects: ProjectInfo[], nodes: NodeInfo[]): Projec
|
|
|
36
37
|
};
|
|
37
38
|
if (existing) {
|
|
38
39
|
existing.nodes.push(nodeEntry);
|
|
40
|
+
existing.activeSessions += p.activeSessions ?? 0;
|
|
39
41
|
} else {
|
|
40
|
-
groups.set(p.slug, { slug: p.slug, title: p.title, nodes: [nodeEntry] });
|
|
42
|
+
groups.set(p.slug, { slug: p.slug, title: p.title, activeSessions: p.activeSessions ?? 0, nodes: [nodeEntry] });
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
return Array.from(groups.values());
|
|
@@ -95,6 +97,12 @@ function ProjectButton(props: ProjectButtonProps) {
|
|
|
95
97
|
{initials}
|
|
96
98
|
</button>
|
|
97
99
|
|
|
100
|
+
{props.group.activeSessions > 0 && (
|
|
101
|
+
<div className="absolute -top-1 -right-1 min-w-[16px] h-[16px] rounded-full bg-primary text-primary-content text-[9px] font-bold flex items-center justify-center pointer-events-none px-1">
|
|
102
|
+
{props.group.activeSessions}
|
|
103
|
+
</div>
|
|
104
|
+
)}
|
|
105
|
+
|
|
98
106
|
<div className="absolute bottom-0 right-0 flex gap-[2px] pointer-events-none">
|
|
99
107
|
{props.group.nodes.map(function (n) {
|
|
100
108
|
return (
|
|
@@ -137,6 +145,59 @@ function ProjectButton(props: ProjectButtonProps) {
|
|
|
137
145
|
);
|
|
138
146
|
}
|
|
139
147
|
|
|
148
|
+
function NodeIndicator({ node }: { node: NodeInfo }) {
|
|
149
|
+
var [hovered, setHovered] = useState(false);
|
|
150
|
+
var [tooltipTop, setTooltipTop] = useState(0);
|
|
151
|
+
var sidebar = useSidebar();
|
|
152
|
+
var initial = node.name.charAt(0).toUpperCase();
|
|
153
|
+
|
|
154
|
+
return (
|
|
155
|
+
<div className="relative flex items-center">
|
|
156
|
+
<button
|
|
157
|
+
onClick={function () { sidebar.openSettings("nodes"); }}
|
|
158
|
+
onMouseEnter={function (e) {
|
|
159
|
+
var rect = e.currentTarget.getBoundingClientRect();
|
|
160
|
+
setTooltipTop(rect.top + rect.height / 2);
|
|
161
|
+
setHovered(true);
|
|
162
|
+
}}
|
|
163
|
+
onMouseLeave={function () { setHovered(false); }}
|
|
164
|
+
className={
|
|
165
|
+
"w-[28px] h-[28px] flex items-center justify-center text-[10px] font-bold rounded-full cursor-pointer transition-all duration-[120ms] flex-shrink-0 border-2 " +
|
|
166
|
+
(node.online
|
|
167
|
+
? "border-success/50 bg-base-200 text-base-content/50 hover:bg-base-200/80"
|
|
168
|
+
: "border-error/30 bg-base-200/50 text-base-content/25 hover:bg-base-200/60")
|
|
169
|
+
}
|
|
170
|
+
>
|
|
171
|
+
{initial}
|
|
172
|
+
</button>
|
|
173
|
+
{hovered && (
|
|
174
|
+
<div
|
|
175
|
+
className="pointer-events-none z-[9000] bg-base-300 border border-base-content/20 rounded-lg px-2.5 py-1.5 shadow-xl"
|
|
176
|
+
style={{
|
|
177
|
+
position: "fixed",
|
|
178
|
+
left: "calc(64px + 8px)",
|
|
179
|
+
top: tooltipTop + "px",
|
|
180
|
+
transform: "translateY(-50%)",
|
|
181
|
+
}}
|
|
182
|
+
>
|
|
183
|
+
<div className="flex items-center gap-1.5">
|
|
184
|
+
<div className={"w-[6px] h-[6px] rounded-full flex-shrink-0 " + (node.online ? "bg-success" : "bg-error")} />
|
|
185
|
+
<span className="text-[12px] font-bold text-base-content whitespace-nowrap">{node.name}</span>
|
|
186
|
+
</div>
|
|
187
|
+
{node.addresses && node.addresses.length > 0 && (
|
|
188
|
+
<div className="text-[10px] text-base-content/40 mt-0.5 whitespace-nowrap">
|
|
189
|
+
{node.addresses[0]}
|
|
190
|
+
</div>
|
|
191
|
+
)}
|
|
192
|
+
<div className="text-[10px] text-base-content/30 mt-0.5">
|
|
193
|
+
{node.projects.length} project{node.projects.length !== 1 ? "s" : ""}
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
)}
|
|
197
|
+
</div>
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
|
|
140
201
|
interface ProjectRailProps {
|
|
141
202
|
projects: ProjectInfo[];
|
|
142
203
|
nodes: NodeInfo[];
|
|
@@ -151,6 +212,7 @@ export function ProjectRail(props: ProjectRailProps) {
|
|
|
151
212
|
var ws = useWebSocket();
|
|
152
213
|
var sidebar = useSidebar();
|
|
153
214
|
var groups = groupProjectsBySlug(props.projects, props.nodes);
|
|
215
|
+
var remoteNodes = props.nodes.filter(function (n) { return !n.isLocal; });
|
|
154
216
|
var [contextMenu, setContextMenu] = useState<ContextMenuState>({
|
|
155
217
|
visible: false,
|
|
156
218
|
x: 0,
|
|
@@ -255,10 +317,18 @@ export function ProjectRail(props: ProjectRailProps) {
|
|
|
255
317
|
})}
|
|
256
318
|
|
|
257
319
|
|
|
258
|
-
{groups.length > 0 && (
|
|
320
|
+
{groups.length > 0 && remoteNodes.length > 0 && (
|
|
259
321
|
<div className="w-6 h-px bg-base-300 my-0.5 flex-shrink-0" />
|
|
260
322
|
)}
|
|
261
323
|
|
|
324
|
+
{remoteNodes.map(function (node) {
|
|
325
|
+
return (
|
|
326
|
+
<NodeIndicator key={node.id} node={node} />
|
|
327
|
+
);
|
|
328
|
+
})}
|
|
329
|
+
|
|
330
|
+
<div className="w-6 h-px bg-base-300 my-0.5 flex-shrink-0" />
|
|
331
|
+
|
|
262
332
|
<button
|
|
263
333
|
onClick={function () { sidebar.openAddProject(); }}
|
|
264
334
|
className="w-[42px] h-[42px] flex items-center justify-center rounded-full border-2 border-dashed border-base-content/25 text-base-content/20 hover:border-base-content/40 hover:text-base-content/40 transition-colors duration-[120ms] flex-shrink-0 cursor-pointer"
|
|
@@ -292,7 +292,7 @@ export function SessionList(props: SessionListProps) {
|
|
|
292
292
|
hasMoreRef.current = true;
|
|
293
293
|
sendRef.current({ type: "session:list_request", projectSlug: props.projectSlug, offset: 0, limit: PAGE_SIZE });
|
|
294
294
|
var interval = setInterval(function () {
|
|
295
|
-
if (props.projectSlug) {
|
|
295
|
+
if (props.projectSlug && ws.status === "connected") {
|
|
296
296
|
sendRef.current({ type: "session:list_request", projectSlug: props.projectSlug, offset: 0, limit: PAGE_SIZE });
|
|
297
297
|
}
|
|
298
298
|
}, 10000);
|
package/client/src/router.tsx
CHANGED
|
@@ -15,7 +15,6 @@ import { AddProjectModal } from "./components/sidebar/AddProjectModal";
|
|
|
15
15
|
import { useSidebar } from "./hooks/useSidebar";
|
|
16
16
|
import { useWorkspace } from "./hooks/useWorkspace";
|
|
17
17
|
import { useWebSocket } from "./hooks/useWebSocket";
|
|
18
|
-
import { UpdateBanner } from "./components/ui/UpdateBanner";
|
|
19
18
|
import { NodeDisconnectedOverlay } from "./components/ui/NodeDisconnectedOverlay";
|
|
20
19
|
import { useSwipeDrawer } from "./hooks/useSwipeDrawer";
|
|
21
20
|
import { exitSettings, getSidebarStore, handlePopState, closeDrawer, toggleDrawer } from "./stores/sidebar";
|
|
@@ -424,7 +423,6 @@ function RootLayout() {
|
|
|
424
423
|
/>
|
|
425
424
|
|
|
426
425
|
<main id="main-content" className="drawer-content flex flex-col h-full min-w-0 overflow-hidden relative">
|
|
427
|
-
<UpdateBanner />
|
|
428
426
|
<Outlet />
|
|
429
427
|
<NodeDisconnectedOverlay />
|
|
430
428
|
</main>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cryptiklemur/lattice",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.42.1",
|
|
4
4
|
"description": "Multi-machine agentic dashboard for Claude Code. Monitor sessions, manage MCP servers and skills, orchestrate across mesh-networked nodes.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Aaron Scherer <me@aaronscherer.me>",
|
package/server/src/daemon.ts
CHANGED
|
@@ -18,7 +18,7 @@ import { detectIdeProjectName } from "./handlers/settings";
|
|
|
18
18
|
import "./handlers/session";
|
|
19
19
|
import "./handlers/chat";
|
|
20
20
|
import "./handlers/attachment";
|
|
21
|
-
import { loadInterruptedSessions, unwatchSessionLock, cleanupClientPermissions } from "./project/sdk-bridge";
|
|
21
|
+
import { loadInterruptedSessions, unwatchSessionLock, cleanupClientPermissions, getActiveSessionCountForProject } from "./project/sdk-bridge";
|
|
22
22
|
import { clearActiveSession, getActiveSession } from "./handlers/chat";
|
|
23
23
|
import { clearActiveProject } from "./handlers/fs";
|
|
24
24
|
import { clearClientRemoteNode } from "./ws/router";
|
|
@@ -410,7 +410,7 @@ export async function startDaemon(portOverride?: number | null): Promise<void> {
|
|
|
410
410
|
var currentIdentity = loadOrCreateIdentity();
|
|
411
411
|
broadcast({ type: "mesh:nodes", nodes: buildNodesMessage() });
|
|
412
412
|
var localProjects = currentConfig.projects.map(function (p: typeof currentConfig.projects[number]) {
|
|
413
|
-
return { slug: p.slug, path: p.path, title: p.title, nodeId: currentIdentity.id, nodeName: currentConfig.name, isRemote: false, ideProjectName: detectIdeProjectName(p.path) };
|
|
413
|
+
return { slug: p.slug, path: p.path, title: p.title, nodeId: currentIdentity.id, nodeName: currentConfig.name, isRemote: false, ideProjectName: detectIdeProjectName(p.path), activeSessions: getActiveSessionCountForProject(p.path) };
|
|
414
414
|
});
|
|
415
415
|
var remoteProjects = getAllRemoteProjects(currentIdentity.id);
|
|
416
416
|
broadcast({
|
|
@@ -212,6 +212,41 @@ export function getActiveStreamCount(): number {
|
|
|
212
212
|
return activeStreams.size;
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
+
export function getActiveSessionCountForProject(projectPath: string): number {
|
|
216
|
+
var count = 0;
|
|
217
|
+
var hash = projectPath.replace(/\//g, "-");
|
|
218
|
+
var dir = join(homedir(), ".claude", "projects", hash);
|
|
219
|
+
|
|
220
|
+
for (var [sessionId] of activeStreams) {
|
|
221
|
+
if (existsSync(join(dir, sessionId + ".jsonl"))) count++;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
for (var [sessionId2] of streamMetadata) {
|
|
225
|
+
void sessionId2;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
if (isClaudeCliRunningInProject(projectPath)) count++;
|
|
229
|
+
|
|
230
|
+
return count;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
function isClaudeCliRunningInProject(projectPath: string): boolean {
|
|
234
|
+
try {
|
|
235
|
+
var result = Bun.spawnSync(["pgrep", "-x", "claude"], { stderr: "ignore" });
|
|
236
|
+
if (result.exitCode !== 0) return false;
|
|
237
|
+
var pids = result.stdout.toString().trim().split("\n");
|
|
238
|
+
for (var i = 0; i < pids.length; i++) {
|
|
239
|
+
var pid = parseInt(pids[i], 10);
|
|
240
|
+
if (isNaN(pid) || pid === process.pid) continue;
|
|
241
|
+
try {
|
|
242
|
+
var cwd = readlinkSync("/proc/" + pid + "/cwd");
|
|
243
|
+
if (cwd === projectPath) return true;
|
|
244
|
+
} catch {}
|
|
245
|
+
}
|
|
246
|
+
} catch {}
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
|
|
215
250
|
/**
|
|
216
251
|
* Check if a session is controlled by an external process (not Lattice).
|
|
217
252
|
* Lattice's own active streams are handled by isProcessing on the client,
|