@telorun/debug-ui 0.6.0 → 0.6.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telorun/debug-ui",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "Browser-safe debug event UI for Telo: wire types, filtering, SSE client, and React components for watching a running app's event stream.",
5
5
  "keywords": [
6
6
  "telo",
@@ -46,7 +46,7 @@
46
46
  "@dagrejs/dagre": "^3.0.0",
47
47
  "@xyflow/react": "^12.10.2",
48
48
  "lucide-react": "^1.8.0",
49
- "@telorun/debug-wire": "0.3.0"
49
+ "@telorun/debug-wire": "0.4.0"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "react": ">=18",
@@ -2,7 +2,7 @@ import { type ReactNode, useMemo, useState } from "react";
2
2
  import type { AppEndpoint, EndpointReachability } from "../endpoints.js";
3
3
  import { distinctSuffixes, type EventFilter, matchesFilter } from "../filter.js";
4
4
  import { type DebugTheme, loadStoredTheme, storeTheme, useResolvedTheme } from "../theme.js";
5
- import { type DebugEvent, type DebugFrame, isLogFrame } from "../wire.js";
5
+ import { type DebugFrame, isEventFrame, isLogFrame } from "../wire.js";
6
6
  import { EndpointLinks } from "./EndpointLinks.js";
7
7
  import { EventGraph } from "./EventGraph.js";
8
8
  import { EventTable } from "./EventTable.js";
@@ -79,10 +79,9 @@ export function DebugPanel({
79
79
 
80
80
  // `revision` is the in-place-mutation signal; `frames` covers the fresh-array
81
81
  // pattern. Either changing recomputes the split.
82
- const events = useMemo(
83
- () => frames.filter((f): f is DebugEvent => !isLogFrame(f)),
84
- [frames, revision],
85
- );
82
+ // Structured `record` frames are neither events nor raw lines; narrowing on
83
+ // "not a log" would feed them to the event views, where `event` is undefined.
84
+ const events = useMemo(() => frames.filter(isEventFrame), [frames, revision]);
86
85
  const logs = useMemo(() => frames.filter(isLogFrame), [frames, revision]);
87
86
  const suffixes = useMemo(() => distinctSuffixes(events), [events]);
88
87
  const visible = useMemo(
package/src/graph.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type DebugEvent, type DebugFrame, eventSuffix, isLogFrame } from "./wire.js";
1
+ import { type DebugEvent, type DebugFrame, eventSuffix, isEventFrame } from "./wire.js";
2
2
 
3
3
  /**
4
4
  * Pure, framework-agnostic derivation of a resource graph from a debug event
@@ -171,8 +171,8 @@ export function deriveGraph(frames: readonly DebugFrame[]): GraphState {
171
171
  const edges = new Map<string, GraphEdge>();
172
172
 
173
173
  frames.forEach((frame, seq) => {
174
- if (isLogFrame(frame)) return;
175
- const event = frame as DebugEvent;
174
+ if (!isEventFrame(frame)) return;
175
+ const event = frame;
176
176
  const suffix = eventSuffix(event.event);
177
177
 
178
178
  if (suffix === "Created") {
@@ -436,8 +436,8 @@ export function deriveInvocations(frames: readonly DebugFrame[]): TraceState {
436
436
  const roots: Invocation[] = [];
437
437
 
438
438
  for (const frame of frames) {
439
- if (isLogFrame(frame)) continue;
440
- const event = frame as DebugEvent;
439
+ if (!isEventFrame(frame)) continue;
440
+ const event = frame;
441
441
  const p = (event.payload ?? undefined) as Record<string, unknown> | undefined;
442
442
  const id = num(p?.spanId);
443
443
  if (id === undefined || byId.has(id)) continue;