MCPcopy
hub / github.com/HKUDS/DeepTutor / systemEventDisplay

Function systemEventDisplay

web/components/memory/MemoryRunPanel.tsx:530–684  ·  view source on GitHub ↗
(
  stage: string,
  event: RunEvent["payload"],
  t: (k: string) => string,
)

Source from the content-addressed store, hash-verified

528}
529
530function systemEventDisplay(
531 stage: string,
532 event: RunEvent["payload"],
533 t: (k: string) => string,
534): {
535 icon: LucideIcon;
536 title: string;
537 detail: string;
538 tone: "ok" | "warn" | "muted";
539} | null {
540 const num = (k: string) =>
541 typeof event[k] === "number" ? String(event[k]) : null;
542 const str = (k: string) =>
543 typeof event[k] === "string" ? String(event[k]) : null;
544 switch (stage) {
545 case "run_started":
546 return {
547 icon: PlayCircle,
548 title: t("Run started"),
549 detail: `${event.mode}`,
550 tone: "muted",
551 };
552 case "trace_loaded": {
553 const total = num("total") ?? num("total_l2_entries");
554 const fresh = num("new") ?? num("new_l2_entries");
555 const parts = [
556 total ? `total=${total}` : null,
557 fresh ? `new=${fresh}` : null,
558 ].filter(Boolean);
559 return {
560 icon: PlayCircle,
561 title: t("Traces loaded"),
562 detail: parts.join(" · "),
563 tone: "muted",
564 };
565 }
566 case "chunked":
567 return {
568 icon: PlayCircle,
569 title: t("Chunked"),
570 detail: [
571 num("chunks") ? `chunks=${num("chunks")}` : null,
572 num("budget") ? `budget=${num("budget")}` : null,
573 num("chars") ? `chars=${num("chars")}` : null,
574 ]
575 .filter(Boolean)
576 .join(" · "),
577 tone: "muted",
578 };
579 case "progress": {
580 const turn = num("turn");
581 const total = num("total");
582 return {
583 icon: PlayCircle,
584 title: t("Progress"),
585 detail: turn && total ? `${turn}/${total}` : "",
586 tone: "muted",
587 };

Callers 1

SystemEventRowFunction · 0.85

Calls 4

tFunction · 0.85
numFunction · 0.85
strFunction · 0.70
filterMethod · 0.45

Tested by

no test coverage detected