@cryptiklemur/lattice 1.42.0 → 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.
|
@@ -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
|
);
|
|
@@ -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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cryptiklemur/lattice",
|
|
3
|
-
"version": "1.42.
|
|
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>",
|