@cryptiklemur/lattice 1.11.2 → 1.11.4

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.
@@ -8,36 +8,14 @@ export function useChartFullscreen(): number | false {
8
8
  return useContext(ChartFullscreenContext);
9
9
  }
10
10
 
11
- function FullscreenChartArea(props: { children: ReactNode; ready: boolean }) {
12
- var containerRef = useRef<HTMLDivElement>(null);
13
- var [height, setHeight] = useState(0);
14
-
11
+ function useViewportChartHeight(): number {
12
+ var [h, setH] = useState(Math.round(window.innerHeight * 0.5));
15
13
  useEffect(function () {
16
- if (!props.ready || !containerRef.current) return;
17
- var h = containerRef.current.clientHeight;
18
- if (h > 0) setHeight(h - 48);
19
-
20
- var observer = new ResizeObserver(function (entries) {
21
- for (var i = 0; i < entries.length; i++) {
22
- var newH = entries[i].contentRect.height;
23
- if (newH > 0) setHeight(newH - 48);
24
- }
25
- });
26
- observer.observe(containerRef.current);
27
- return function () { observer.disconnect(); };
28
- }, [props.ready]);
29
-
30
- return (
31
- <div ref={containerRef} className="flex-1 p-6 overflow-auto min-h-0">
32
- {height > 0 ? (
33
- <ChartFullscreenContext.Provider value={height}>
34
- {props.children}
35
- </ChartFullscreenContext.Provider>
36
- ) : (
37
- <div className="flex items-center justify-center h-full text-base-content/20 font-mono text-[11px]">Expanding...</div>
38
- )}
39
- </div>
40
- );
14
+ function onResize() { setH(Math.round(window.innerHeight * 0.5)); }
15
+ window.addEventListener("resize", onResize);
16
+ return function () { window.removeEventListener("resize", onResize); };
17
+ }, []);
18
+ return h;
41
19
  }
42
20
 
43
21
  interface ChartCardProps {
@@ -49,6 +27,7 @@ interface ChartCardProps {
49
27
 
50
28
  export function ChartCard(props: ChartCardProps) {
51
29
  var [isFullscreen, setIsFullscreen] = useState(false);
30
+ var chartHeight = useViewportChartHeight();
52
31
  var cardRef = useRef<HTMLDivElement>(null);
53
32
  var [originRect, setOriginRect] = useState<DOMRect | null>(null);
54
33
  var [animating, setAnimating] = useState(false);
@@ -182,9 +161,13 @@ export function ChartCard(props: ChartCardProps) {
182
161
  </button>
183
162
  </div>
184
163
  </div>
185
- <FullscreenChartArea ready={!animating}>
186
- {props.children}
187
- </FullscreenChartArea>
164
+ <div className="flex-1 p-6 overflow-auto min-h-0">
165
+ <ChartFullscreenContext.Provider value={chartHeight}>
166
+ <div style={{ height: chartHeight + "px" }}>
167
+ {props.children}
168
+ </div>
169
+ </ChartFullscreenContext.Provider>
170
+ </div>
188
171
  </div>
189
172
  </div>
190
173
  </>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cryptiklemur/lattice",
3
- "version": "1.11.2",
3
+ "version": "1.11.4",
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>",
@@ -15,7 +15,7 @@ import type { ClientMessage, MeshMessage } from "@lattice/shared";
15
15
  import "./handlers/session";
16
16
  import "./handlers/chat";
17
17
  import "./handlers/attachment";
18
- import { loadInterruptedSessions, unwatchSessionLock } from "./project/sdk-bridge";
18
+ import { loadInterruptedSessions, unwatchSessionLock, cleanupClientPermissions } from "./project/sdk-bridge";
19
19
  import { clearActiveSession, getActiveSession } from "./handlers/chat";
20
20
  import "./handlers/fs";
21
21
  import "./handlers/terminal";
@@ -312,6 +312,7 @@ export async function startDaemon(portOverride?: number | null): Promise<void> {
312
312
  removeClient(ws.data.id);
313
313
  cleanupClientTerminals(ws.data.id);
314
314
  cleanupClientAttachments(ws.data.id);
315
+ cleanupClientPermissions(ws.data.id);
315
316
  console.log(`[lattice] Client disconnected: ${ws.data.id}`);
316
317
  },
317
318
  },
@@ -141,6 +141,22 @@ export function deletePendingPermission(requestId: string): void {
141
141
  pendingPermissions.delete(requestId);
142
142
  }
143
143
 
144
+ export function cleanupClientPermissions(clientId: string): void {
145
+ var toRemove: string[] = [];
146
+ pendingPermissions.forEach(function (entry, requestId) {
147
+ if (entry.clientId === clientId) {
148
+ toRemove.push(requestId);
149
+ entry.resolve({ behavior: "deny", message: "Client disconnected.", toolUseID: entry.toolUseID });
150
+ }
151
+ });
152
+ for (var i = 0; i < toRemove.length; i++) {
153
+ pendingPermissions.delete(toRemove[i]);
154
+ }
155
+ if (toRemove.length > 0) {
156
+ console.log("[lattice] Cleaned up " + toRemove.length + " pending permission(s) for disconnected client " + clientId);
157
+ }
158
+ }
159
+
144
160
  export function addAutoApprovedTool(sessionId: string, toolName: string): void {
145
161
  var tools = autoApprovedTools.get(sessionId);
146
162
  if (!tools) {