gossipcat 0.4.12 → 0.4.15

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/README.md CHANGED
@@ -12,7 +12,7 @@
12
12
  <a href="https://github.com/gossipcat-ai/gossipcat-ai/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT License" /></a>
13
13
  <a href="#quickstart"><img src="https://img.shields.io/badge/node-22%2B-green" alt="Node 22+" /></a>
14
14
  <a href="https://github.com/gossipcat-ai/gossipcat-ai/stargazers"><img src="https://img.shields.io/github/stars/gossipcat-ai/gossipcat-ai?style=social" alt="GitHub stars" /></a>
15
- <a href="https://socket.dev/npm/package/gossipcat"><img src="https://badge.socket.dev/npm/package/gossipcat/0.4.2" alt="Socket Score" /></a>
15
+ <a href="https://socket.dev/npm/package/gossipcat"><img src="https://badge.socket.dev/npm/package/gossipcat/0.4.14" alt="Socket Score" /></a>
16
16
  </p>
17
17
 
18
18
  <p align="center">
@@ -223,12 +223,12 @@ Gossipcat is on **[npm](https://www.npmjs.com/package/gossipcat)** and **[GitHub
223
223
 
224
224
  **Pin to a specific npm version:**
225
225
  ```bash
226
- npm install -g gossipcat@0.4.1
226
+ npm install -g gossipcat@0.4.14
227
227
  ```
228
228
 
229
229
  **Pin to a specific GitHub release tarball** (version-locked, bypasses npm registry):
230
230
  ```bash
231
- npm install -g https://github.com/gossipcat-ai/gossipcat-ai/releases/download/v0.4.1/gossipcat-0.4.1.tgz
231
+ npm install -g https://github.com/gossipcat-ai/gossipcat-ai/releases/download/v0.4.14/gossipcat-0.4.14.tgz
232
232
  ```
233
233
 
234
234
  **Project-local install** (each project gets its own gossipcat):
@@ -585,6 +585,9 @@ Record a `hallucination_caught` signal: ask Claude *"record a hallucination_caug
585
585
  ### "I want to use my own model / provider"
586
586
  Edit `.gossip/config.json` directly. Any OpenAI-compatible endpoint works via `provider: "openai"` + `base_url`. Local models work via Ollama (`provider: "local"`). See the [Configuration](#configuration) section.
587
587
 
588
+ ### "An agent produced output but the consensus report is empty"
589
+ The strict `<agent_finding>` parser drops tags whose `type` isn't one of `finding | suggestion | insight` (see invariant #8 in `docs/HANDBOOK.md`). When that happens, the `gossip_signals` receipt surfaces the drop count and a `finding_dropped_format` pipeline signal is emitted. Check the consensus round's `droppedFindingsByType` field on the dashboard — it names the offending type. If you see `&lt;agent_finding&gt;` instead of raw `<agent_finding>`, a transport layer is entity-encoding the output; pass agent output verbatim to `gossip_relay`.
590
+
588
591
  ### "Multiple Claude Code instances all want gossipcat"
589
592
  Already supported as of v0.1.1 — each instance gets its own dynamic port. If you want a stable port for one specific instance (e.g. for browser bookmarks), set `GOSSIPCAT_PORT=24420` for that one project's environment.
590
593
 
@@ -717,6 +720,9 @@ These tools are called by the internal LLM (the orchestrator — Claude Code wit
717
720
  | `gossip_session_save` | Save session context for next session |
718
721
  | `gossip_remember` | Search an agent's cognitive memory |
719
722
  | `gossip_progress` | Check in-progress task status |
723
+ | `gossip_watch` | Stream signals as agents emit them, between dispatch and collect (catches pipeline drops mid-round) |
724
+ | `gossip_verify_memory` | Verify a memory claim against current code — FRESH / STALE / CONTRADICTED / INCONCLUSIVE — before acting on backlog items |
725
+ | `gossip_reload` | Self-terminate the MCP process so Claude Code respawns with a fresh bundle (dev loop after code changes) |
720
726
  | `gossip_tools` | List all available tools |
721
727
  | `gossip_update` | Check for or apply gossipcat updates from npm |
722
728
  | `gossip_bug_feedback` | File a GitHub issue on the gossipcat repo from an in-session bug report |
@@ -872,6 +878,11 @@ Gossipcat auto-detects the host environment:
872
878
  | Statistical skill effectiveness (z-test on per-category accuracy, auto pass/fail verdicts) | ✅ Shipped |
873
879
  | Native subagents get skill injection + cognitive memory recall | ✅ Shipped |
874
880
  | Relay cross-reviewers get `file_read` + `file_grep` (closes tool-blindness gap with natives) | ✅ Shipped |
881
+ | Worktree-aware consensus (`resolutionRoots` + auto-discover for feature-branch reviews) | ✅ Shipped |
882
+ | Signal pipeline observability (format-drop receipts + `finding_dropped_format` meta-signal + `gossip_watch` stream) | ✅ Shipped |
883
+ | Consensus round retraction (`gossip_signals action: retract` with tombstones) | ✅ Shipped |
884
+ | Worktree sandbox hardening (Layer 1+2+3 boundary enforcement + rotated audit log) | ✅ Shipped |
885
+ | In-session bundle hot-swap (`gossip_reload`) | ✅ Shipped |
875
886
  | npm package — one-liner install with bundled MCP server + dashboard | ✅ Shipped |
876
887
  | Full implementation workflow (agents write code) | 🔄 In progress |
877
888
  | Dashboard enrichment (graphs, trends, session history) | ☐ Planned |
@@ -0,0 +1 @@
1
+ @import"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap";@import"https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&display=swap";/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0}}}@layer theme{:root,:host{--font-sans:"Inter", system-ui, sans-serif;--font-mono:"JetBrains Mono", monospace;--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-emerald-400:oklch(76.5% .177 163.223);--color-sky-400:oklch(74.6% .16 232.661);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-zinc-400:oklch(70.5% .015 286.067);--color-zinc-500:oklch(55.2% .016 285.938);--color-black:#000;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-xl:36rem;--container-3xl:48rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-normal:0em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-snug:1.375;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--animate-ping:ping 1s cubic-bezier(0, 0, .2, 1) infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--blur-xl:24px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-background:#0a0a0f;--color-foreground:#f0f0f5;--color-card:#13131a;--color-muted:#1c1c26;--color-muted-foreground:#9898a8;--color-border:#8b5cf61f;--color-primary:#8b5cf6;--color-primary-foreground:#fafafa;--color-accent:#1e1e30;--color-destructive:#f87171;--color-confirmed:#34d399;--color-disputed:#f87171;--color-unverified:#fbbf24;--color-unique:#c084fc;--color-impact:#60a5fa;--color-text-dim:#666674;--color-chart:#75dddd;--font-inter:"Inter", system-ui, sans-serif}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.-inset-3{inset:calc(var(--spacing) * -3)}.inset-0{inset:calc(var(--spacing) * 0)}.inset-y-0{inset-block:calc(var(--spacing) * 0)}.-top-1{top:calc(var(--spacing) * -1)}.top-0{top:calc(var(--spacing) * 0)}.top-1\/2{top:50%}.-right-1{right:calc(var(--spacing) * -1)}.right-0{right:calc(var(--spacing) * 0)}.bottom-0{bottom:calc(var(--spacing) * 0)}.left-0{left:calc(var(--spacing) * 0)}.left-1\/2{left:50%}.z-50{z-index:50}.row-span-2{grid-row:span 2/span 2}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-12{margin-top:calc(var(--spacing) * 12)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mr-1\.5{margin-right:calc(var(--spacing) * 1.5)}.mr-3{margin-right:calc(var(--spacing) * 3)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-2\.5{margin-bottom:calc(var(--spacing) * 2.5)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1{height:calc(var(--spacing) * 1)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-3{height:calc(var(--spacing) * 3)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-56{height:calc(var(--spacing) * 56)}.h-\[18px\]{height:18px}.h-\[22px\]{height:22px}.h-full{height:100%}.h-px{height:1px}.max-h-32{max-height:calc(var(--spacing) * 32)}.max-h-40{max-height:calc(var(--spacing) * 40)}.max-h-\[70vh\]{max-height:70vh}.max-h-\[calc\(100vh-48px\)\]{max-height:calc(100vh - 48px)}.max-h-\[calc\(100vh-220px\)\]{max-height:calc(100vh - 220px)}.min-h-screen{min-height:100vh}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-14{width:calc(var(--spacing) * 14)}.w-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-24{width:calc(var(--spacing) * 24)}.w-32{width:calc(var(--spacing) * 32)}.w-56{width:calc(var(--spacing) * 56)}.w-\[18px\]{width:18px}.w-\[22px\]{width:22px}.w-\[480px\]{width:480px}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-3xl{max-width:var(--container-3xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-\[12px\]{max-width:12px}.max-w-\[300px\]{max-width:300px}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[4px\]{min-width:4px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.rotate-90{rotate:90deg}.animate-ping{animation:var(--animate-ping)}.animate-pulse{animation:var(--animate-pulse)}.cursor-default{cursor:default}.cursor-help{cursor:help}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.grid-cols-\[60px_1fr_38px\]{grid-template-columns:60px 1fr 38px}.grid-cols-\[72px_1fr_44px\]{grid-template-columns:72px 1fr 44px}.grid-cols-\[128px_1fr_auto_44px\]{grid-template-columns:128px 1fr auto 44px}.grid-cols-\[auto_1fr_auto\]{grid-template-columns:auto 1fr auto}.grid-rows-\[auto_auto\]{grid-template-rows:auto auto}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-px{gap:1px}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-y-1{row-gap:calc(var(--spacing) * 1)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}.self-center{align-self:center}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-t-md{border-top-left-radius:var(--radius-md);border-top-right-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-l-\[3px\]{border-left-style:var(--tw-border-style);border-left-width:3px}.border-amber-500\/25{border-color:#f99c0040}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/25{border-color:color-mix(in oklab,var(--color-amber-500) 25%,transparent)}}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/30{border-color:color-mix(in oklab,var(--color-amber-500) 30%,transparent)}}.border-blue-500\/15{border-color:#3080ff26}@supports (color:color-mix(in lab,red,red)){.border-blue-500\/15{border-color:color-mix(in oklab,var(--color-blue-500) 15%,transparent)}}.border-border{border-color:var(--color-border)}.border-border\/15{border-color:#8b5cf605}@supports (color:color-mix(in lab,red,red)){.border-border\/15{border-color:color-mix(in oklab,var(--color-border) 15%,transparent)}}.border-border\/20{border-color:#8b5cf606}@supports (color:color-mix(in lab,red,red)){.border-border\/20{border-color:color-mix(in oklab,var(--color-border) 20%,transparent)}}.border-border\/30{border-color:#8b5cf609}@supports (color:color-mix(in lab,red,red)){.border-border\/30{border-color:color-mix(in oklab,var(--color-border) 30%,transparent)}}.border-border\/40{border-color:#8b5cf60c}@supports (color:color-mix(in lab,red,red)){.border-border\/40{border-color:color-mix(in oklab,var(--color-border) 40%,transparent)}}.border-border\/50{border-color:#8b5cf610}@supports (color:color-mix(in lab,red,red)){.border-border\/50{border-color:color-mix(in oklab,var(--color-border) 50%,transparent)}}.border-border\/60{border-color:#8b5cf613}@supports (color:color-mix(in lab,red,red)){.border-border\/60{border-color:color-mix(in oklab,var(--color-border) 60%,transparent)}}.border-confirmed\/20{border-color:#34d39933}@supports (color:color-mix(in lab,red,red)){.border-confirmed\/20{border-color:color-mix(in oklab,var(--color-confirmed) 20%,transparent)}}.border-confirmed\/25{border-color:#34d39940}@supports (color:color-mix(in lab,red,red)){.border-confirmed\/25{border-color:color-mix(in oklab,var(--color-confirmed) 25%,transparent)}}.border-confirmed\/30{border-color:#34d3994d}@supports (color:color-mix(in lab,red,red)){.border-confirmed\/30{border-color:color-mix(in oklab,var(--color-confirmed) 30%,transparent)}}.border-confirmed\/40{border-color:#34d39966}@supports (color:color-mix(in lab,red,red)){.border-confirmed\/40{border-color:color-mix(in oklab,var(--color-confirmed) 40%,transparent)}}.border-destructive\/20{border-color:#f8717133}@supports (color:color-mix(in lab,red,red)){.border-destructive\/20{border-color:color-mix(in oklab,var(--color-destructive) 20%,transparent)}}.border-destructive\/30{border-color:#f871714d}@supports (color:color-mix(in lab,red,red)){.border-destructive\/30{border-color:color-mix(in oklab,var(--color-destructive) 30%,transparent)}}.border-disputed\/10{border-color:#f871711a}@supports (color:color-mix(in lab,red,red)){.border-disputed\/10{border-color:color-mix(in oklab,var(--color-disputed) 10%,transparent)}}.border-disputed\/20{border-color:#f8717133}@supports (color:color-mix(in lab,red,red)){.border-disputed\/20{border-color:color-mix(in oklab,var(--color-disputed) 20%,transparent)}}.border-disputed\/30{border-color:#f871714d}@supports (color:color-mix(in lab,red,red)){.border-disputed\/30{border-color:color-mix(in oklab,var(--color-disputed) 30%,transparent)}}.border-disputed\/40{border-color:#f8717166}@supports (color:color-mix(in lab,red,red)){.border-disputed\/40{border-color:color-mix(in oklab,var(--color-disputed) 40%,transparent)}}.border-muted-foreground\/25{border-color:#9898a840}@supports (color:color-mix(in lab,red,red)){.border-muted-foreground\/25{border-color:color-mix(in oklab,var(--color-muted-foreground) 25%,transparent)}}.border-orange-400\/20{border-color:#ff8b1a33}@supports (color:color-mix(in lab,red,red)){.border-orange-400\/20{border-color:color-mix(in oklab,var(--color-orange-400) 20%,transparent)}}.border-orange-400\/40{border-color:#ff8b1a66}@supports (color:color-mix(in lab,red,red)){.border-orange-400\/40{border-color:color-mix(in oklab,var(--color-orange-400) 40%,transparent)}}.border-primary\/25{border-color:#8b5cf640}@supports (color:color-mix(in lab,red,red)){.border-primary\/25{border-color:color-mix(in oklab,var(--color-primary) 25%,transparent)}}.border-primary\/30{border-color:#8b5cf64d}@supports (color:color-mix(in lab,red,red)){.border-primary\/30{border-color:color-mix(in oklab,var(--color-primary) 30%,transparent)}}.border-primary\/50{border-color:#8b5cf680}@supports (color:color-mix(in lab,red,red)){.border-primary\/50{border-color:color-mix(in oklab,var(--color-primary) 50%,transparent)}}.border-red-400\/20{border-color:#ff656833}@supports (color:color-mix(in lab,red,red)){.border-red-400\/20{border-color:color-mix(in oklab,var(--color-red-400) 20%,transparent)}}.border-red-400\/40{border-color:#ff656866}@supports (color:color-mix(in lab,red,red)){.border-red-400\/40{border-color:color-mix(in oklab,var(--color-red-400) 40%,transparent)}}.border-text-dim\/20{border-color:#66667433}@supports (color:color-mix(in lab,red,red)){.border-text-dim\/20{border-color:color-mix(in oklab,var(--color-text-dim) 20%,transparent)}}.border-text-dim\/30{border-color:#6666744d}@supports (color:color-mix(in lab,red,red)){.border-text-dim\/30{border-color:color-mix(in oklab,var(--color-text-dim) 30%,transparent)}}.border-unique\/20{border-color:#c084fc33}@supports (color:color-mix(in lab,red,red)){.border-unique\/20{border-color:color-mix(in oklab,var(--color-unique) 20%,transparent)}}.border-unique\/40{border-color:#c084fc66}@supports (color:color-mix(in lab,red,red)){.border-unique\/40{border-color:color-mix(in oklab,var(--color-unique) 40%,transparent)}}.border-unverified\/15{border-color:#fbbf2426}@supports (color:color-mix(in lab,red,red)){.border-unverified\/15{border-color:color-mix(in oklab,var(--color-unverified) 15%,transparent)}}.border-unverified\/20{border-color:#fbbf2433}@supports (color:color-mix(in lab,red,red)){.border-unverified\/20{border-color:color-mix(in oklab,var(--color-unverified) 20%,transparent)}}.border-unverified\/25{border-color:#fbbf2440}@supports (color:color-mix(in lab,red,red)){.border-unverified\/25{border-color:color-mix(in oklab,var(--color-unverified) 25%,transparent)}}.border-unverified\/30{border-color:#fbbf244d}@supports (color:color-mix(in lab,red,red)){.border-unverified\/30{border-color:color-mix(in oklab,var(--color-unverified) 30%,transparent)}}.border-unverified\/40{border-color:#fbbf2466}@supports (color:color-mix(in lab,red,red)){.border-unverified\/40{border-color:color-mix(in oklab,var(--color-unverified) 40%,transparent)}}.border-yellow-400\/20{border-color:#fac80033}@supports (color:color-mix(in lab,red,red)){.border-yellow-400\/20{border-color:color-mix(in oklab,var(--color-yellow-400) 20%,transparent)}}.border-yellow-400\/40{border-color:#fac80066}@supports (color:color-mix(in lab,red,red)){.border-yellow-400\/40{border-color:color-mix(in oklab,var(--color-yellow-400) 40%,transparent)}}.border-zinc-500\/20{border-color:#71717b33}@supports (color:color-mix(in lab,red,red)){.border-zinc-500\/20{border-color:color-mix(in oklab,var(--color-zinc-500) 20%,transparent)}}.border-zinc-500\/40{border-color:#71717b66}@supports (color:color-mix(in lab,red,red)){.border-zinc-500\/40{border-color:color-mix(in oklab,var(--color-zinc-500) 40%,transparent)}}.border-t-border\/60{border-top-color:#8b5cf613}@supports (color:color-mix(in lab,red,red)){.border-t-border\/60{border-top-color:color-mix(in oklab,var(--color-border) 60%,transparent)}}.border-r-border\/60{border-right-color:#8b5cf613}@supports (color:color-mix(in lab,red,red)){.border-r-border\/60{border-right-color:color-mix(in oklab,var(--color-border) 60%,transparent)}}.border-b-border\/60{border-bottom-color:#8b5cf613}@supports (color:color-mix(in lab,red,red)){.border-b-border\/60{border-bottom-color:color-mix(in oklab,var(--color-border) 60%,transparent)}}.border-l-border\/40{border-left-color:#8b5cf60c}@supports (color:color-mix(in lab,red,red)){.border-l-border\/40{border-left-color:color-mix(in oklab,var(--color-border) 40%,transparent)}}.border-l-confirmed\/60{border-left-color:#34d39999}@supports (color:color-mix(in lab,red,red)){.border-l-confirmed\/60{border-left-color:color-mix(in oklab,var(--color-confirmed) 60%,transparent)}}.border-l-disputed\/60{border-left-color:#f8717199}@supports (color:color-mix(in lab,red,red)){.border-l-disputed\/60{border-left-color:color-mix(in oklab,var(--color-disputed) 60%,transparent)}}.border-l-unverified\/50{border-left-color:#fbbf2480}@supports (color:color-mix(in lab,red,red)){.border-l-unverified\/50{border-left-color:color-mix(in oklab,var(--color-unverified) 50%,transparent)}}.bg-\[var\(--color-impact\)\]{background-color:var(--color-impact)}.bg-amber-500\/8{background-color:#f99c0014}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/8{background-color:color-mix(in oklab,var(--color-amber-500) 8%,transparent)}}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500) 10%,transparent)}}.bg-background{background-color:var(--color-background)}.bg-background\/40{background-color:#0a0a0f66}@supports (color:color-mix(in lab,red,red)){.bg-background\/40{background-color:color-mix(in oklab,var(--color-background) 40%,transparent)}}.bg-background\/60{background-color:#0a0a0f99}@supports (color:color-mix(in lab,red,red)){.bg-background\/60{background-color:color-mix(in oklab,var(--color-background) 60%,transparent)}}.bg-background\/70{background-color:#0a0a0fb3}@supports (color:color-mix(in lab,red,red)){.bg-background\/70{background-color:color-mix(in oklab,var(--color-background) 70%,transparent)}}.bg-background\/80{background-color:#0a0a0fcc}@supports (color:color-mix(in lab,red,red)){.bg-background\/80{background-color:color-mix(in oklab,var(--color-background) 80%,transparent)}}.bg-blue-500\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/10{background-color:color-mix(in oklab,var(--color-blue-500) 10%,transparent)}}.bg-border{background-color:var(--color-border)}.bg-border\/30{background-color:#8b5cf609}@supports (color:color-mix(in lab,red,red)){.bg-border\/30{background-color:color-mix(in oklab,var(--color-border) 30%,transparent)}}.bg-card{background-color:var(--color-card)}.bg-card\/30{background-color:#13131a4d}@supports (color:color-mix(in lab,red,red)){.bg-card\/30{background-color:color-mix(in oklab,var(--color-card) 30%,transparent)}}.bg-card\/50{background-color:#13131a80}@supports (color:color-mix(in lab,red,red)){.bg-card\/50{background-color:color-mix(in oklab,var(--color-card) 50%,transparent)}}.bg-card\/60{background-color:#13131a99}@supports (color:color-mix(in lab,red,red)){.bg-card\/60{background-color:color-mix(in oklab,var(--color-card) 60%,transparent)}}.bg-card\/70{background-color:#13131ab3}@supports (color:color-mix(in lab,red,red)){.bg-card\/70{background-color:color-mix(in oklab,var(--color-card) 70%,transparent)}}.bg-card\/80{background-color:#13131acc}@supports (color:color-mix(in lab,red,red)){.bg-card\/80{background-color:color-mix(in oklab,var(--color-card) 80%,transparent)}}.bg-chart{background-color:var(--color-chart)}.bg-chart\/70{background-color:#75ddddb3}@supports (color:color-mix(in lab,red,red)){.bg-chart\/70{background-color:color-mix(in oklab,var(--color-chart) 70%,transparent)}}.bg-confirmed{background-color:var(--color-confirmed)}.bg-confirmed\/5{background-color:#34d3990d}@supports (color:color-mix(in lab,red,red)){.bg-confirmed\/5{background-color:color-mix(in oklab,var(--color-confirmed) 5%,transparent)}}.bg-confirmed\/10{background-color:#34d3991a}@supports (color:color-mix(in lab,red,red)){.bg-confirmed\/10{background-color:color-mix(in oklab,var(--color-confirmed) 10%,transparent)}}.bg-confirmed\/70{background-color:#34d399b3}@supports (color:color-mix(in lab,red,red)){.bg-confirmed\/70{background-color:color-mix(in oklab,var(--color-confirmed) 70%,transparent)}}.bg-confirmed\/\[0\.06\]{background-color:#34d3990f}@supports (color:color-mix(in lab,red,red)){.bg-confirmed\/\[0\.06\]{background-color:color-mix(in oklab,var(--color-confirmed) 6%,transparent)}}.bg-destructive{background-color:var(--color-destructive)}.bg-destructive\/5{background-color:#f871710d}@supports (color:color-mix(in lab,red,red)){.bg-destructive\/5{background-color:color-mix(in oklab,var(--color-destructive) 5%,transparent)}}.bg-destructive\/10{background-color:#f871711a}@supports (color:color-mix(in lab,red,red)){.bg-destructive\/10{background-color:color-mix(in oklab,var(--color-destructive) 10%,transparent)}}.bg-destructive\/15{background-color:#f8717126}@supports (color:color-mix(in lab,red,red)){.bg-destructive\/15{background-color:color-mix(in oklab,var(--color-destructive) 15%,transparent)}}.bg-destructive\/\[0\.04\]{background-color:#f871710a}@supports (color:color-mix(in lab,red,red)){.bg-destructive\/\[0\.04\]{background-color:color-mix(in oklab,var(--color-destructive) 4%,transparent)}}.bg-disputed{background-color:var(--color-disputed)}.bg-disputed\/5{background-color:#f871710d}@supports (color:color-mix(in lab,red,red)){.bg-disputed\/5{background-color:color-mix(in oklab,var(--color-disputed) 5%,transparent)}}.bg-disputed\/10{background-color:#f871711a}@supports (color:color-mix(in lab,red,red)){.bg-disputed\/10{background-color:color-mix(in oklab,var(--color-disputed) 10%,transparent)}}.bg-disputed\/50{background-color:#f8717180}@supports (color:color-mix(in lab,red,red)){.bg-disputed\/50{background-color:color-mix(in oklab,var(--color-disputed) 50%,transparent)}}.bg-disputed\/70{background-color:#f87171b3}@supports (color:color-mix(in lab,red,red)){.bg-disputed\/70{background-color:color-mix(in oklab,var(--color-disputed) 70%,transparent)}}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-muted{background-color:var(--color-muted)}.bg-muted-foreground\/10{background-color:#9898a81a}@supports (color:color-mix(in lab,red,red)){.bg-muted-foreground\/10{background-color:color-mix(in oklab,var(--color-muted-foreground) 10%,transparent)}}.bg-muted-foreground\/60{background-color:#9898a899}@supports (color:color-mix(in lab,red,red)){.bg-muted-foreground\/60{background-color:color-mix(in oklab,var(--color-muted-foreground) 60%,transparent)}}.bg-muted\/20{background-color:#1c1c2633}@supports (color:color-mix(in lab,red,red)){.bg-muted\/20{background-color:color-mix(in oklab,var(--color-muted) 20%,transparent)}}.bg-muted\/30{background-color:#1c1c264d}@supports (color:color-mix(in lab,red,red)){.bg-muted\/30{background-color:color-mix(in oklab,var(--color-muted) 30%,transparent)}}.bg-muted\/40{background-color:#1c1c2666}@supports (color:color-mix(in lab,red,red)){.bg-muted\/40{background-color:color-mix(in oklab,var(--color-muted) 40%,transparent)}}.bg-muted\/50{background-color:#1c1c2680}@supports (color:color-mix(in lab,red,red)){.bg-muted\/50{background-color:color-mix(in oklab,var(--color-muted) 50%,transparent)}}.bg-orange-400{background-color:var(--color-orange-400)}.bg-orange-400\/10{background-color:#ff8b1a1a}@supports (color:color-mix(in lab,red,red)){.bg-orange-400\/10{background-color:color-mix(in oklab,var(--color-orange-400) 10%,transparent)}}.bg-orange-500\/10{background-color:#fe6e001a}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/10{background-color:color-mix(in oklab,var(--color-orange-500) 10%,transparent)}}.bg-primary{background-color:var(--color-primary)}.bg-primary\/10{background-color:#8b5cf61a}@supports (color:color-mix(in lab,red,red)){.bg-primary\/10{background-color:color-mix(in oklab,var(--color-primary) 10%,transparent)}}.bg-primary\/70{background-color:#8b5cf6b3}@supports (color:color-mix(in lab,red,red)){.bg-primary\/70{background-color:color-mix(in oklab,var(--color-primary) 70%,transparent)}}.bg-primary\/\[0\.02\]{background-color:#8b5cf605}@supports (color:color-mix(in lab,red,red)){.bg-primary\/\[0\.02\]{background-color:color-mix(in oklab,var(--color-primary) 2%,transparent)}}.bg-primary\/\[0\.03\]{background-color:#8b5cf608}@supports (color:color-mix(in lab,red,red)){.bg-primary\/\[0\.03\]{background-color:color-mix(in oklab,var(--color-primary) 3%,transparent)}}.bg-primary\/\[0\.06\]{background-color:#8b5cf60f}@supports (color:color-mix(in lab,red,red)){.bg-primary\/\[0\.06\]{background-color:color-mix(in oklab,var(--color-primary) 6%,transparent)}}.bg-red-400{background-color:var(--color-red-400)}.bg-red-400\/10{background-color:#ff65681a}@supports (color:color-mix(in lab,red,red)){.bg-red-400\/10{background-color:color-mix(in oklab,var(--color-red-400) 10%,transparent)}}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500) 10%,transparent)}}.bg-sky-400{background-color:var(--color-sky-400)}.bg-text-dim{background-color:var(--color-text-dim)}.bg-text-dim\/\[0\.08\]{background-color:#66667414}@supports (color:color-mix(in lab,red,red)){.bg-text-dim\/\[0\.08\]{background-color:color-mix(in oklab,var(--color-text-dim) 8%,transparent)}}.bg-unique{background-color:var(--color-unique)}.bg-unique\/10{background-color:#c084fc1a}@supports (color:color-mix(in lab,red,red)){.bg-unique\/10{background-color:color-mix(in oklab,var(--color-unique) 10%,transparent)}}.bg-unique\/50{background-color:#c084fc80}@supports (color:color-mix(in lab,red,red)){.bg-unique\/50{background-color:color-mix(in oklab,var(--color-unique) 50%,transparent)}}.bg-unverified{background-color:var(--color-unverified)}.bg-unverified\/5{background-color:#fbbf240d}@supports (color:color-mix(in lab,red,red)){.bg-unverified\/5{background-color:color-mix(in oklab,var(--color-unverified) 5%,transparent)}}.bg-unverified\/10{background-color:#fbbf241a}@supports (color:color-mix(in lab,red,red)){.bg-unverified\/10{background-color:color-mix(in oklab,var(--color-unverified) 10%,transparent)}}.bg-unverified\/15{background-color:#fbbf2426}@supports (color:color-mix(in lab,red,red)){.bg-unverified\/15{background-color:color-mix(in oklab,var(--color-unverified) 15%,transparent)}}.bg-unverified\/60{background-color:#fbbf2499}@supports (color:color-mix(in lab,red,red)){.bg-unverified\/60{background-color:color-mix(in oklab,var(--color-unverified) 60%,transparent)}}.bg-unverified\/\[0\.06\]{background-color:#fbbf240f}@supports (color:color-mix(in lab,red,red)){.bg-unverified\/\[0\.06\]{background-color:color-mix(in oklab,var(--color-unverified) 6%,transparent)}}.bg-yellow-400{background-color:var(--color-yellow-400)}.bg-yellow-400\/10{background-color:#fac8001a}@supports (color:color-mix(in lab,red,red)){.bg-yellow-400\/10{background-color:color-mix(in oklab,var(--color-yellow-400) 10%,transparent)}}.bg-yellow-500\/10{background-color:#edb2001a}@supports (color:color-mix(in lab,red,red)){.bg-yellow-500\/10{background-color:color-mix(in oklab,var(--color-yellow-500) 10%,transparent)}}.bg-zinc-500{background-color:var(--color-zinc-500)}.bg-zinc-500\/10{background-color:#71717b1a}@supports (color:color-mix(in lab,red,red)){.bg-zinc-500\/10{background-color:color-mix(in oklab,var(--color-zinc-500) 10%,transparent)}}.object-contain{object-fit:contain}.p-1{padding:calc(var(--spacing) * 1)}.p-3{padding:calc(var(--spacing) * 3)}.p-3\.5{padding:calc(var(--spacing) * 3.5)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-20{padding-block:calc(var(--spacing) * 20)}.py-\[1px\]{padding-block:1px}.pt-1\.5{padding-top:calc(var(--spacing) * 1.5)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pr-5{padding-right:calc(var(--spacing) * 5)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-top{vertical-align:top}.font-inter{font-family:var(--font-inter)}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[7px\]{font-size:7px}.text-\[8px\]{font-size:8px}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.text-\[17px\]{font-size:17px}.text-\[30px\]{font-size:30px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[0\.14em\]{--tw-tracking:.14em;letter-spacing:.14em}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-400{color:var(--color-amber-400)}.text-background{color:var(--color-background)}.text-blue-400{color:var(--color-blue-400)}.text-confirmed{color:var(--color-confirmed)}.text-confirmed\/50{color:#34d39980}@supports (color:color-mix(in lab,red,red)){.text-confirmed\/50{color:color-mix(in oklab,var(--color-confirmed) 50%,transparent)}}.text-confirmed\/60{color:#34d39999}@supports (color:color-mix(in lab,red,red)){.text-confirmed\/60{color:color-mix(in oklab,var(--color-confirmed) 60%,transparent)}}.text-confirmed\/70{color:#34d399b3}@supports (color:color-mix(in lab,red,red)){.text-confirmed\/70{color:color-mix(in oklab,var(--color-confirmed) 70%,transparent)}}.text-destructive{color:var(--color-destructive)}.text-destructive\/70{color:#f87171b3}@supports (color:color-mix(in lab,red,red)){.text-destructive\/70{color:color-mix(in oklab,var(--color-destructive) 70%,transparent)}}.text-disputed{color:var(--color-disputed)}.text-disputed\/50{color:#f8717180}@supports (color:color-mix(in lab,red,red)){.text-disputed\/50{color:color-mix(in oklab,var(--color-disputed) 50%,transparent)}}.text-disputed\/70{color:#f87171b3}@supports (color:color-mix(in lab,red,red)){.text-disputed\/70{color:color-mix(in oklab,var(--color-disputed) 70%,transparent)}}.text-emerald-400{color:var(--color-emerald-400)}.text-foreground{color:var(--color-foreground)}.text-foreground\/80{color:#f0f0f5cc}@supports (color:color-mix(in lab,red,red)){.text-foreground\/80{color:color-mix(in oklab,var(--color-foreground) 80%,transparent)}}.text-foreground\/90{color:#f0f0f5e6}@supports (color:color-mix(in lab,red,red)){.text-foreground\/90{color:color-mix(in oklab,var(--color-foreground) 90%,transparent)}}.text-muted-foreground{color:var(--color-muted-foreground)}.text-muted-foreground\/30{color:#9898a84d}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/30{color:color-mix(in oklab,var(--color-muted-foreground) 30%,transparent)}}.text-muted-foreground\/40{color:#9898a866}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/40{color:color-mix(in oklab,var(--color-muted-foreground) 40%,transparent)}}.text-muted-foreground\/50{color:#9898a880}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/50{color:color-mix(in oklab,var(--color-muted-foreground) 50%,transparent)}}.text-muted-foreground\/60{color:#9898a899}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/60{color:color-mix(in oklab,var(--color-muted-foreground) 60%,transparent)}}.text-muted-foreground\/70{color:#9898a8b3}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/70{color:color-mix(in oklab,var(--color-muted-foreground) 70%,transparent)}}.text-muted-foreground\/80{color:#9898a8cc}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/80{color:color-mix(in oklab,var(--color-muted-foreground) 80%,transparent)}}.text-muted-foreground\/90{color:#9898a8e6}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/90{color:color-mix(in oklab,var(--color-muted-foreground) 90%,transparent)}}.text-orange-400{color:var(--color-orange-400)}.text-orange-400\/50{color:#ff8b1a80}@supports (color:color-mix(in lab,red,red)){.text-orange-400\/50{color:color-mix(in oklab,var(--color-orange-400) 50%,transparent)}}.text-primary{color:var(--color-primary)}.text-primary-foreground{color:var(--color-primary-foreground)}.text-primary\/50{color:#8b5cf680}@supports (color:color-mix(in lab,red,red)){.text-primary\/50{color:color-mix(in oklab,var(--color-primary) 50%,transparent)}}.text-primary\/60{color:#8b5cf699}@supports (color:color-mix(in lab,red,red)){.text-primary\/60{color:color-mix(in oklab,var(--color-primary) 60%,transparent)}}.text-primary\/70{color:#8b5cf6b3}@supports (color:color-mix(in lab,red,red)){.text-primary\/70{color:color-mix(in oklab,var(--color-primary) 70%,transparent)}}.text-red-400{color:var(--color-red-400)}.text-red-400\/50{color:#ff656880}@supports (color:color-mix(in lab,red,red)){.text-red-400\/50{color:color-mix(in oklab,var(--color-red-400) 50%,transparent)}}.text-sky-400{color:var(--color-sky-400)}.text-text-dim{color:var(--color-text-dim)}.text-unique{color:var(--color-unique)}.text-unique\/50{color:#c084fc80}@supports (color:color-mix(in lab,red,red)){.text-unique\/50{color:color-mix(in oklab,var(--color-unique) 50%,transparent)}}.text-unverified{color:var(--color-unverified)}.text-unverified\/50{color:#fbbf2480}@supports (color:color-mix(in lab,red,red)){.text-unverified\/50{color:color-mix(in oklab,var(--color-unverified) 50%,transparent)}}.text-unverified\/60{color:#fbbf2499}@supports (color:color-mix(in lab,red,red)){.text-unverified\/60{color:color-mix(in oklab,var(--color-unverified) 60%,transparent)}}.text-unverified\/70{color:#fbbf24b3}@supports (color:color-mix(in lab,red,red)){.text-unverified\/70{color:color-mix(in oklab,var(--color-unverified) 70%,transparent)}}.text-unverified\/80{color:#fbbf24cc}@supports (color:color-mix(in lab,red,red)){.text-unverified\/80{color:color-mix(in oklab,var(--color-unverified) 80%,transparent)}}.text-yellow-400{color:var(--color-yellow-400)}.text-yellow-400\/50{color:#fac80080}@supports (color:color-mix(in lab,red,red)){.text-yellow-400\/50{color:color-mix(in oklab,var(--color-yellow-400) 50%,transparent)}}.text-zinc-400{color:var(--color-zinc-400)}.text-zinc-500{color:var(--color-zinc-500)}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.decoration-disputed\/40{text-decoration-color:#f8717166}@supports (color:color-mix(in lab,red,red)){.decoration-disputed\/40{-webkit-text-decoration-color:color-mix(in oklab,var(--color-disputed) 40%,transparent);text-decoration-color:color-mix(in oklab,var(--color-disputed) 40%,transparent)}}.opacity-30{opacity:.3}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-55{opacity:.55}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-90{opacity:.9}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_6px_rgba\(52\,211\,153\,0\.5\)\]{--tw-shadow:0 0 6px var(--tw-shadow-color,#34d39980);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_6px_rgba\(248\,113\,113\,0\.6\)\]{--tw-shadow:0 0 6px var(--tw-shadow-color,#f8717199);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_1px_3px_rgba\(0\,0\,0\,0\.35\)\]{--tw-shadow:inset 0 1px 3px var(--tw-shadow-color,#00000059);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur-xl{--tw-blur:blur(var(--blur-xl));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-\[0_0_28px_rgba\(139\,92\,246\,0\.45\)\]{--tw-drop-shadow-size:drop-shadow(0 0 28px var(--tw-drop-shadow-color,#8b5cf673));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\:text-muted-foreground\/60:is(:where(.group):hover *){color:#9898a899}@supports (color:color-mix(in lab,red,red)){.group-hover\:text-muted-foreground\/60:is(:where(.group):hover *){color:color-mix(in oklab,var(--color-muted-foreground) 60%,transparent)}}.group-hover\:text-primary:is(:where(.group):hover *){color:var(--color-primary)}.group-hover\:opacity-50:is(:where(.group):hover *){opacity:.5}}.placeholder\:text-muted-foreground::placeholder{color:var(--color-muted-foreground)}.placeholder\:text-muted-foreground\/50::placeholder{color:#9898a880}@supports (color:color-mix(in lab,red,red)){.placeholder\:text-muted-foreground\/50::placeholder{color:color-mix(in oklab,var(--color-muted-foreground) 50%,transparent)}}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.hover\:-translate-y-0\.5:hover{--tw-translate-y:calc(var(--spacing) * -.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\:-translate-y-px:hover{--tw-translate-y:-1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\:border-border\/60:hover{border-color:#8b5cf613}@supports (color:color-mix(in lab,red,red)){.hover\:border-border\/60:hover{border-color:color-mix(in oklab,var(--color-border) 60%,transparent)}}.hover\:border-confirmed\/40:hover{border-color:#34d39966}@supports (color:color-mix(in lab,red,red)){.hover\:border-confirmed\/40:hover{border-color:color-mix(in oklab,var(--color-confirmed) 40%,transparent)}}.hover\:border-disputed\/40:hover{border-color:#f8717166}@supports (color:color-mix(in lab,red,red)){.hover\:border-disputed\/40:hover{border-color:color-mix(in oklab,var(--color-disputed) 40%,transparent)}}.hover\:border-orange-400\/40:hover{border-color:#ff8b1a66}@supports (color:color-mix(in lab,red,red)){.hover\:border-orange-400\/40:hover{border-color:color-mix(in oklab,var(--color-orange-400) 40%,transparent)}}.hover\:border-primary\/30:hover{border-color:#8b5cf64d}@supports (color:color-mix(in lab,red,red)){.hover\:border-primary\/30:hover{border-color:color-mix(in oklab,var(--color-primary) 30%,transparent)}}.hover\:border-red-400\/40:hover{border-color:#ff656866}@supports (color:color-mix(in lab,red,red)){.hover\:border-red-400\/40:hover{border-color:color-mix(in oklab,var(--color-red-400) 40%,transparent)}}.hover\:border-unique\/40:hover{border-color:#c084fc66}@supports (color:color-mix(in lab,red,red)){.hover\:border-unique\/40:hover{border-color:color-mix(in oklab,var(--color-unique) 40%,transparent)}}.hover\:border-unverified\/40:hover{border-color:#fbbf2466}@supports (color:color-mix(in lab,red,red)){.hover\:border-unverified\/40:hover{border-color:color-mix(in oklab,var(--color-unverified) 40%,transparent)}}.hover\:border-yellow-400\/40:hover{border-color:#fac80066}@supports (color:color-mix(in lab,red,red)){.hover\:border-yellow-400\/40:hover{border-color:color-mix(in oklab,var(--color-yellow-400) 40%,transparent)}}.hover\:border-zinc-500\/40:hover{border-color:#71717b66}@supports (color:color-mix(in lab,red,red)){.hover\:border-zinc-500\/40:hover{border-color:color-mix(in oklab,var(--color-zinc-500) 40%,transparent)}}.hover\:border-t-border\/60:hover{border-top-color:#8b5cf613}@supports (color:color-mix(in lab,red,red)){.hover\:border-t-border\/60:hover{border-top-color:color-mix(in oklab,var(--color-border) 60%,transparent)}}.hover\:border-r-border\/60:hover{border-right-color:#8b5cf613}@supports (color:color-mix(in lab,red,red)){.hover\:border-r-border\/60:hover{border-right-color:color-mix(in oklab,var(--color-border) 60%,transparent)}}.hover\:border-b-border\/60:hover{border-bottom-color:#8b5cf613}@supports (color:color-mix(in lab,red,red)){.hover\:border-b-border\/60:hover{border-bottom-color:color-mix(in oklab,var(--color-border) 60%,transparent)}}.hover\:bg-accent:hover{background-color:var(--color-accent)}.hover\:bg-accent\/20:hover{background-color:#1e1e3033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent\/20:hover{background-color:color-mix(in oklab,var(--color-accent) 20%,transparent)}}.hover\:bg-accent\/30:hover{background-color:#1e1e304d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent\/30:hover{background-color:color-mix(in oklab,var(--color-accent) 30%,transparent)}}.hover\:bg-accent\/40:hover{background-color:#1e1e3066}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent\/40:hover{background-color:color-mix(in oklab,var(--color-accent) 40%,transparent)}}.hover\:bg-accent\/50:hover{background-color:#1e1e3080}@supports (color:color-mix(in lab,red,red)){.hover\:bg-accent\/50:hover{background-color:color-mix(in oklab,var(--color-accent) 50%,transparent)}}.hover\:bg-card\/70:hover{background-color:#13131ab3}@supports (color:color-mix(in lab,red,red)){.hover\:bg-card\/70:hover{background-color:color-mix(in oklab,var(--color-card) 70%,transparent)}}.hover\:bg-card\/90:hover{background-color:#13131ae6}@supports (color:color-mix(in lab,red,red)){.hover\:bg-card\/90:hover{background-color:color-mix(in oklab,var(--color-card) 90%,transparent)}}.hover\:bg-confirmed\/10:hover{background-color:#34d3991a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-confirmed\/10:hover{background-color:color-mix(in oklab,var(--color-confirmed) 10%,transparent)}}.hover\:bg-destructive\/\[0\.03\]:hover{background-color:#f8717108}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/\[0\.03\]:hover{background-color:color-mix(in oklab,var(--color-destructive) 3%,transparent)}}.hover\:bg-disputed\/10:hover{background-color:#f871711a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-disputed\/10:hover{background-color:color-mix(in oklab,var(--color-disputed) 10%,transparent)}}.hover\:bg-muted:hover{background-color:var(--color-muted)}.hover\:bg-muted\/30:hover{background-color:#1c1c264d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-muted\/30:hover{background-color:color-mix(in oklab,var(--color-muted) 30%,transparent)}}.hover\:bg-muted\/40:hover{background-color:#1c1c2666}@supports (color:color-mix(in lab,red,red)){.hover\:bg-muted\/40:hover{background-color:color-mix(in oklab,var(--color-muted) 40%,transparent)}}.hover\:bg-muted\/50:hover{background-color:#1c1c2680}@supports (color:color-mix(in lab,red,red)){.hover\:bg-muted\/50:hover{background-color:color-mix(in oklab,var(--color-muted) 50%,transparent)}}.hover\:bg-unverified\/10:hover{background-color:#fbbf241a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-unverified\/10:hover{background-color:color-mix(in oklab,var(--color-unverified) 10%,transparent)}}.hover\:text-foreground:hover{color:var(--color-foreground)}.hover\:text-primary:hover{color:var(--color-primary)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-90:hover{opacity:.9}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-sm:hover{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-black\/20:hover{--tw-shadow-color:#0003}@supports (color:color-mix(in lab,red,red)){.hover\:shadow-black\/20:hover{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 20%, transparent) var(--tw-shadow-alpha), transparent)}}}.focus\:border-primary:focus{border-color:var(--color-primary)}.focus\:border-primary\/40:focus{border-color:#8b5cf666}@supports (color:color-mix(in lab,red,red)){.focus\:border-primary\/40:focus{border-color:color-mix(in oklab,var(--color-primary) 40%,transparent)}}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-primary\/20:focus{--tw-ring-color:#8b5cf633}@supports (color:color-mix(in lab,red,red)){.focus\:ring-primary\/20:focus{--tw-ring-color:color-mix(in oklab, var(--color-primary) 20%, transparent)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:opacity-30:disabled{opacity:.3}@media(min-width:40rem){.sm\:w-\[480px\]{width:480px}.sm\:max-w-\[480px\]{max-width:480px}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(min-width:48rem){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(min-width:64rem){.lg\:sticky{position:sticky}.lg\:top-4{top:calc(var(--spacing) * 4)}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-\[260px_1fr\]{grid-template-columns:260px 1fr}.lg\:grid-cols-\[280px_1fr\]{grid-template-columns:280px 1fr}.lg\:items-start{align-items:flex-start}}.\[\&_\.cite-file\]\:rounded .cite-file{border-radius:.25rem}.\[\&_\.cite-file\]\:bg-blue-500\/10 .cite-file{background-color:#3080ff1a}@supports (color:color-mix(in lab,red,red)){.\[\&_\.cite-file\]\:bg-blue-500\/10 .cite-file{background-color:color-mix(in oklab,var(--color-blue-500) 10%,transparent)}}.\[\&_\.cite-file\]\:px-1 .cite-file{padding-inline:calc(var(--spacing) * 1)}.\[\&_\.cite-file\]\:font-mono .cite-file{font-family:var(--font-mono)}.\[\&_\.cite-file\]\:text-blue-400 .cite-file{color:var(--color-blue-400)}.\[\&_\.cite-fn\]\:rounded .cite-fn{border-radius:.25rem}.\[\&_\.cite-fn\]\:bg-purple-500\/10 .cite-fn{background-color:#ac4bff1a}@supports (color:color-mix(in lab,red,red)){.\[\&_\.cite-fn\]\:bg-purple-500\/10 .cite-fn{background-color:color-mix(in oklab,var(--color-purple-500) 10%,transparent)}}.\[\&_\.cite-fn\]\:px-1 .cite-fn{padding-inline:calc(var(--spacing) * 1)}.\[\&_\.cite-fn\]\:font-mono .cite-fn{font-family:var(--font-mono)}.\[\&_\.cite-fn\]\:text-purple-400 .cite-fn{color:var(--color-purple-400)}.\[\&_\.inline-code\]\:rounded .inline-code{border-radius:.25rem}.\[\&_\.inline-code\]\:bg-muted .inline-code{background-color:var(--color-muted)}.\[\&_\.inline-code\]\:bg-muted\/40 .inline-code{background-color:#1c1c2666}@supports (color:color-mix(in lab,red,red)){.\[\&_\.inline-code\]\:bg-muted\/40 .inline-code{background-color:color-mix(in oklab,var(--color-muted) 40%,transparent)}}.\[\&_\.inline-code\]\:px-1 .inline-code{padding-inline:calc(var(--spacing) * 1)}.\[\&_\.inline-code\]\:py-0\.5 .inline-code{padding-block:calc(var(--spacing) * .5)}.\[\&_\.inline-code\]\:font-mono .inline-code{font-family:var(--font-mono)}.\[\&_\.inline-code\]\:text-\[11px\] .inline-code{font-size:11px}.\[\&_\.inline-code\]\:text-foreground\/80 .inline-code{color:#f0f0f5cc}@supports (color:color-mix(in lab,red,red)){.\[\&_\.inline-code\]\:text-foreground\/80 .inline-code{color:color-mix(in oklab,var(--color-foreground) 80%,transparent)}}.\[\&_\.inline-code-block\]\:my-1\.5 .inline-code-block{margin-block:calc(var(--spacing) * 1.5)}.\[\&_\.inline-code-block\]\:my-2 .inline-code-block{margin-block:calc(var(--spacing) * 2)}.\[\&_\.inline-code-block\]\:block .inline-code-block{display:block}.\[\&_\.inline-code-block\]\:overflow-x-auto .inline-code-block{overflow-x:auto}.\[\&_\.inline-code-block\]\:rounded .inline-code-block{border-radius:.25rem}.\[\&_\.inline-code-block\]\:bg-muted\/30 .inline-code-block{background-color:#1c1c264d}@supports (color:color-mix(in lab,red,red)){.\[\&_\.inline-code-block\]\:bg-muted\/30 .inline-code-block{background-color:color-mix(in oklab,var(--color-muted) 30%,transparent)}}.\[\&_\.inline-code-block\]\:bg-muted\/70 .inline-code-block{background-color:#1c1c26b3}@supports (color:color-mix(in lab,red,red)){.\[\&_\.inline-code-block\]\:bg-muted\/70 .inline-code-block{background-color:color-mix(in oklab,var(--color-muted) 70%,transparent)}}.\[\&_\.inline-code-block\]\:p-2 .inline-code-block{padding:calc(var(--spacing) * 2)}.\[\&_\.inline-code-block\]\:font-mono .inline-code-block{font-family:var(--font-mono)}.\[\&_\.inline-code-block\]\:text-\[11px\] .inline-code-block{font-size:11px}.\[\&_\.inline-code-block\]\:text-foreground\/70 .inline-code-block{color:#f0f0f5b3}@supports (color:color-mix(in lab,red,red)){.\[\&_\.inline-code-block\]\:text-foreground\/70 .inline-code-block{color:color-mix(in oklab,var(--color-foreground) 70%,transparent)}}}body{background-color:var(--color-background);color:var(--color-foreground);font-family:var(--font-sans);-webkit-font-smoothing:antialiased;font-size:15px;line-height:1.55}html:after{content:"";pointer-events:none;z-index:9998;background:radial-gradient(90% 85%,#0000 65%,#0003);position:fixed;top:0;right:0;bottom:0;left:0}@keyframes crt-flicker{0%{opacity:1}8%{opacity:.6}9%{opacity:1}22%{opacity:1}23%{opacity:.4}24%{opacity:1}60%{opacity:1}61%{opacity:.7}62%{opacity:.3}63%{opacity:1}85%{opacity:1}86%{opacity:.5}87%{opacity:1}}@keyframes crt-scanlines-move{0%{background-position:0 0}to{background-position:0 8px}}@keyframes crt-rgb-bleed{0%{text-shadow:2px 0 #ff005080,-2px 0 #00c8ff80}25%{text-shadow:-2px 0 #ff005080,2px 0 #00c8ff80}50%{text-shadow:1px 0 #ff00504d,-1px 0 #00c8ff4d}75%{text-shadow:-1px 0 #ff005080,1px 0 #00c8ff80}to{text-shadow:2px 0 #ff005080,-2px 0 #00c8ff80}}.crt-logo{cursor:pointer;display:inline-block;position:relative}.crt-logo:before{content:"";pointer-events:none;opacity:0;z-index:2;background:repeating-linear-gradient(#0000 0,#0000 3px,#00000040 3px,#00000040 4px);border-radius:12px;transition:opacity .15s;position:absolute;top:0;right:0;bottom:0;left:0}.crt-logo:after{content:"";pointer-events:none;opacity:0;z-index:1;background:radial-gradient(#8b5cf626,#0000 70%);border-radius:16px;transition:opacity .15s;position:absolute;top:-4px;right:-4px;bottom:-4px;left:-4px}.crt-logo:hover:before,.crt-logo--glitch:before{opacity:1;animation:.1s linear infinite crt-scanlines-move}.crt-logo:hover:after,.crt-logo--glitch:after{opacity:1}.crt-logo:hover .crt-logo-img,.crt-logo--glitch .crt-logo-img{filter:brightness(1.25)saturate(1.1)drop-shadow(0 0 32px #8b5cf6b3);animation:.6s step-end infinite crt-flicker}::-webkit-scrollbar{width:5px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:#8b5cf626;border-radius:3px}::-webkit-scrollbar-thumb:hover{background:#8b5cf640}[data-tooltip]{position:relative}[data-tooltip]:after{content:attr(data-tooltip);color:var(--color-foreground);white-space:pre-line;text-align:left;pointer-events:none;opacity:0;z-index:1000;background:#0e0e14fa;border:1px solid #8b5cf640;border-radius:6px;width:max-content;max-width:220px;padding:8px 12px;font-family:Inter,sans-serif;font-size:11px;font-weight:500;line-height:1.45;transition:opacity .15s 50ms;position:absolute;bottom:100%;left:50%;transform:translate(-50%)translateY(-6px);box-shadow:0 6px 20px #000000b3}[data-tooltip]:before{content:"";pointer-events:none;opacity:0;z-index:1000;border:4px solid #0000;border-top-color:#0e0e14fa;transition:opacity .15s 50ms;position:absolute;bottom:100%;left:50%;transform:translate(-50%)}[data-tooltip]:hover:after,[data-tooltip]:hover:before{opacity:1}[data-tooltip-pos=bottom]:after{top:100%;bottom:auto;transform:translate(-50%)translateY(6px)}[data-tooltip-pos=bottom]:before{border-top-color:#0000;border-bottom-color:#0e0e14fa;top:100%;bottom:auto}[data-tooltip-pos=left]:after{left:auto;right:0;transform:translateY(-6px)}[data-tooltip-pos=left]:before{left:auto;right:12px;transform:none}[data-tooltip-pos=right]:after{left:0;right:auto;transform:translateY(-6px)}[data-tooltip-pos=right]:before{left:12px;right:auto;transform:none}.task-md{white-space:pre-wrap;word-break:break-word}.task-md h1.md-h1{color:var(--color-foreground);margin-top:.75rem;margin-bottom:.375rem;font-size:1rem;font-weight:700;line-height:1.4}.task-md h2.md-h2{color:var(--color-foreground);margin-top:.625rem;margin-bottom:.3rem;font-size:.875rem;font-weight:700;line-height:1.4}.task-md h3.md-h3{color:var(--color-foreground);margin-top:.5rem;margin-bottom:.25rem;font-size:.8rem;font-weight:600;line-height:1.4}.task-md ul.md-list{margin:.375rem 0;padding-left:1.25rem;list-style:outside}.task-md ul.md-list li{margin:.2rem 0;line-height:1.5}.task-md code.md-inline-code{font-family:var(--font-mono);color:var(--color-foreground);background:#8b5cf61f;border:1px solid #8b5cf626;border-radius:3px;padding:.1em .35em;font-size:.72rem}.task-md pre.md-code-block{font-family:var(--font-mono);white-space:pre;color:var(--color-foreground);background:#00000059;border:1px solid #8b5cf61f;border-radius:5px;margin:.5rem 0;padding:.6rem .75rem;font-size:.72rem;line-height:1.5;overflow-x:auto}.task-md pre.md-code-block code{font-size:inherit;background:0 0;border:none;padding:0}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}}
@@ -64,5 +64,5 @@ Higher = this agent sees what peers don't.`}),i.jsx(Hc,{label:"impact",value:c.i
64
64
  Severity-weighted findings.
65
65
  Critical and high findings count more.`})]})]})}function Hc({label:u,value:c,fillClass:m,tooltip:o}){const f=Number.isFinite(c)?c:0;return i.jsxs("div",{className:"grid grid-cols-[60px_1fr_38px] items-center gap-2.5",children:[i.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wider text-muted-foreground","data-tooltip":o,children:u}),i.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-background/80",children:i.jsx("div",{className:`h-full rounded-full transition-all ${m}`,style:{width:`${Math.max(0,Math.min(100,f*100))}%`}})}),i.jsxs("span",{className:"text-right font-mono text-[11px] font-bold tabular-nums text-foreground",children:[Math.round(f*100),"%"]})]})}function E0({agents:u}){const c=[...u].sort((f,x)=>{var M,R,G,H;const _=((M=f.lastTask)==null?void 0:M.timestamp)??"",y=((R=x.lastTask)==null?void 0:R.timestamp)??"";if(_!==y)return y.localeCompare(_);const b=((G=f.scores)==null?void 0:G.signals)||0,h=((H=x.scores)==null?void 0:H.signals)||0;return b!==h?h-b:f.id.localeCompare(x.id)}),m=c.slice(0,4),o=c.length>4;return i.jsxs("section",{children:[i.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[i.jsxs("h2",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Team ",i.jsx("span",{className:"text-primary",children:u.length})]}),o&&i.jsx("a",{href:"/dashboard/team",className:"font-mono text-xs text-muted-foreground transition hover:text-primary",children:"view all"})]}),i.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:m.map(f=>i.jsx(_0,{agent:f},f.id))})]})}const M0={completed:{label:"COMPLETED",cls:"text-confirmed bg-confirmed/10"},failed:{label:"FAILED",cls:"text-destructive bg-destructive/10"},cancelled:{label:"CANCELLED",cls:"text-muted-foreground bg-muted/30"},running:{label:"RUNNING",cls:"text-unverified bg-unverified/10 animate-pulse"}};function A0({task:u,onClose:c}){if(U.useEffect(()=>{if(!u)return;const f=x=>{x.key==="Escape"&&c()};return document.addEventListener("keydown",f),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",f),document.body.style.overflow=""}},[u,c]),!u)return null;const m=M0[u.status],o=(u.inputTokens||0)+(u.outputTokens||0);return i.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto bg-background/80 p-6 backdrop-blur-sm",onClick:c,children:i.jsxs("div",{className:"relative mt-12 w-full max-w-3xl rounded-lg border border-border bg-card shadow-2xl",onClick:f=>f.stopPropagation(),children:[i.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-border/60 px-5 py-4",children:[i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold ${m.cls}`,children:m.label}),i.jsx("span",{className:"shrink-0 rounded border border-amber-500/30 bg-amber-500/10 px-1.5 py-0.5 font-mono text-[10px] font-semibold text-amber-400",children:u.taskId.slice(0,8)}),i.jsx("a",{href:`/dashboard/agent/${encodeURIComponent(u.agentId)}`,className:"truncate font-mono text-xs text-muted-foreground transition hover:text-primary",children:u.agentId})]}),i.jsxs("div",{className:"mt-2 flex flex-wrap gap-3 font-mono text-[10px] text-muted-foreground",children:[i.jsx("span",{children:Xe(u.timestamp)}),u.duration!=null&&i.jsxs("span",{children:["· ",l0(u.duration)]}),o>0&&i.jsxs("span",{children:["· ",o.toLocaleString()," tokens (",(u.inputTokens||0).toLocaleString()," in / ",(u.outputTokens||0).toLocaleString()," out)"]})]})]}),i.jsx("button",{onClick:c,className:"shrink-0 rounded-md border border-border/40 bg-card px-2 py-1 font-mono text-xs text-muted-foreground transition hover:bg-accent/50 hover:text-foreground","aria-label":"Close",children:"✕"})]}),i.jsxs("div",{className:"max-h-[calc(100vh-220px)] space-y-5 overflow-y-auto px-5 py-4",children:[i.jsxs("section",{children:[i.jsx("h3",{className:"mb-2 font-mono text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:"Task"}),i.jsx("div",{className:"task-md rounded-md border border-border/40 bg-background/40 p-3 text-xs leading-relaxed text-foreground/90 overflow-x-auto",dangerouslySetInnerHTML:{__html:gm(u.task)}})]}),u.result?i.jsxs("section",{children:[i.jsx("h3",{className:"mb-2 font-mono text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:"Result"}),i.jsx("div",{className:"rounded-md border border-border/40 bg-background/40 p-3 font-mono text-xs leading-relaxed text-foreground/90 whitespace-pre-wrap [&_.cite-file]:rounded [&_.cite-file]:bg-blue-500/10 [&_.cite-file]:px-1 [&_.cite-file]:text-blue-400 [&_.cite-fn]:rounded [&_.cite-fn]:bg-purple-500/10 [&_.cite-fn]:px-1 [&_.cite-fn]:text-purple-400 [&_.inline-code]:rounded [&_.inline-code]:bg-muted/40 [&_.inline-code]:px-1 [&_.inline-code-block]:my-2 [&_.inline-code-block]:block [&_.inline-code-block]:rounded [&_.inline-code-block]:bg-muted/30 [&_.inline-code-block]:p-2",dangerouslySetInnerHTML:{__html:ms(u.result)}})]}):i.jsxs("section",{children:[i.jsx("h3",{className:"mb-2 font-mono text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:"Result"}),i.jsx("div",{className:"rounded-md border border-border/40 bg-background/40 p-3 text-center font-mono text-xs text-muted-foreground",children:u.status==="running"?"Task is still running...":"No result recorded."})]})]})]})})}const z0=8;function C0(u){const c=u.toLowerCase();return c==="completed"||c==="done"||c==="success"||c==="succeeded"?"completed":c==="running"||c==="active"||c==="in_progress"||c==="pending"?"running":c==="failed"||c==="error"||c==="errored"||c==="timeout"||c==="timed_out"?"failed":c==="cancelled"||c==="canceled"||c==="queued"||c==="waiting"?"cancelled":"unknown"}const D0={completed:{label:"Done",iconBox:"bg-confirmed/10 border-confirmed/30",text:"text-confirmed",pulse:!1},running:{label:"Running",iconBox:"bg-unverified/10 border-unverified/30",text:"text-unverified",pulse:!0},failed:{label:"Failed",iconBox:"bg-destructive/10 border-destructive/30",text:"text-destructive",pulse:!1},cancelled:{label:"Cancelled",iconBox:"bg-muted-foreground/10 border-muted-foreground/25",text:"text-muted-foreground",pulse:!1},unknown:{label:"Unknown",iconBox:"bg-muted-foreground/10 border-muted-foreground/25",text:"text-muted-foreground",pulse:!1}},O0={completed:i.jsx("polyline",{points:"5 12 10 17 19 7"}),running:i.jsxs(i.Fragment,{children:[i.jsx("circle",{cx:"12",cy:"12",r:"3",fill:"currentColor",stroke:"none"}),i.jsx("circle",{cx:"12",cy:"12",r:"8",opacity:"0.45"})]}),failed:i.jsxs(i.Fragment,{children:[i.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"}),i.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"})]}),cancelled:i.jsx("line",{x1:"6",y1:"12",x2:"18",y2:"12"}),unknown:i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"M9.5 9a2.5 2.5 0 1 1 3.5 2.3c-.8.4-1 .9-1 1.7"}),i.jsx("line",{x1:"12",y1:"16.5",x2:"12",y2:"16.5"})]})};function R0(u){return u.length>8?u.slice(0,8):u}function w0({tasks:u,limit:c=z0}){const m=u.items.slice(0,c),o=u.items.length>c;return i.jsxs("section",{className:"flex h-full flex-col",children:[i.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[i.jsxs("h2",{className:"font-mono text-xs font-bold uppercase tracking-widest text-foreground",children:["Tasks ",i.jsx("span",{className:"text-primary",children:u.total})]}),o&&i.jsx("a",{href:"/dashboard/tasks",className:"font-mono text-xs text-muted-foreground transition hover:text-foreground",children:"view all"})]}),i.jsx("div",{className:"flex-1 rounded-md border border-border/40 bg-card/80",children:m.length===0?i.jsx(Fl,{title:"No tasks yet",hint:"Dispatch with gossip_run to populate this view."}):m.map((f,x)=>{const _=C0(f.status),y=D0[_];return i.jsxs("div",{className:`flex items-start gap-3 px-3.5 py-2.5 hover:bg-accent/20 transition-colors ${x>0?"border-t border-border/20":""}`,children:[i.jsx("span",{className:`mt-0.5 flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-full border ${y.iconBox} ${y.text} ${y.pulse?"animate-pulse":""}`,"aria-label":`Status: ${y.label}`,"data-tooltip":y.label,children:i.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:O0[_]})}),i.jsx("span",{className:"mt-0.5 shrink-0 rounded border border-border/40 bg-background/60 px-1.5 py-0.5 font-mono text-[10px] font-semibold text-muted-foreground","data-tooltip":f.taskId,children:R0(f.taskId)}),i.jsx("span",{className:"min-w-0 flex-1 line-clamp-2 font-inter text-[11px] leading-snug text-muted-foreground",children:f.task}),i.jsx("span",{className:"mt-0.5 shrink-0 font-mono text-xs font-bold text-foreground",children:f.agentId}),i.jsx("span",{className:"mt-0.5 shrink-0 font-mono text-[10px] text-muted-foreground/50",children:Xe(f.timestamp)})]},f.taskId)})})]})}const U0=new Set(["shipped","closed"]);function vm(u){var f,x,_,y;if(u.filename==="MEMORY.md")return"record";const c=u.filename.split("_")[0].toLowerCase(),m=(x=(f=u.frontmatter)==null?void 0:f.type)==null?void 0:x.toLowerCase(),o=(y=(_=u.frontmatter)==null?void 0:_.status)==null?void 0:y.toLowerCase();return c==="session"?"session":c==="feedback"||c==="user"?"rule":c==="project"?o&&U0.has(o)?"record":"backlog":c==="gossip"?"record":m==="session"?"session":m==="feedback"||m==="user"?"rule":m==="reference"?"record":"backlog"}const ym=[{type:"backlog",label:"Backlog",blurb:"Open work, pending decisions"},{type:"record",label:"Record",blurb:"Shipped & closed reference"},{type:"session",label:"Session",blurb:"Per-session recaps"},{type:"rule",label:"Rule",blurb:"Feedback & user preferences"}];function q0(u){return u.origin?`${u.origin}/${u.filename}`:u.filename}function H0(u){const c=new Set,m=[];for(const o of u){const f=q0(o);c.has(f)||(c.add(f),m.push(o))}return m}const k0={backlog:"text-primary",record:"text-text-dim",session:"text-confirmed",rule:"text-unverified"},B0={backlog:"border-primary/30 bg-primary/[0.06]",record:"border-text-dim/30 bg-text-dim/[0.08]",session:"border-confirmed/30 bg-confirmed/[0.06]",rule:"border-unverified/30 bg-unverified/[0.06]"};function Y0({folder:u,memories:c,onBack:m,onOpen:o}){const f=ym.find(b=>b.type===u),x=k0[u],_=B0[u],y=U.useMemo(()=>[...c].sort((b,h)=>b.filename<h.filename?1:-1),[c]);return i.jsxs("section",{className:"flex h-full flex-col",children:[i.jsxs("div",{className:"mb-3 flex items-center gap-2 font-mono text-xs",children:[i.jsx("button",{onClick:m,className:"font-bold uppercase tracking-widest text-muted-foreground transition hover:text-primary",children:"Memory"}),i.jsx("span",{className:"text-muted-foreground/40",children:"›"}),i.jsx("span",{className:`font-bold uppercase tracking-widest ${x}`,children:f.label}),i.jsx("span",{className:"ml-1 text-muted-foreground/60",children:y.length})]}),y.length===0?i.jsx("div",{className:"flex-1",children:i.jsx(Fl,{title:`No ${f.label.toLowerCase()} memories`,hint:f.blurb})}):i.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:y.map(b=>{const h=G0(b),M=L0(b),R=X0(b.frontmatter);return i.jsxs("button",{onClick:()=>o(b),className:"group flex flex-col gap-1.5 rounded-md border border-border/40 bg-muted p-3 text-left transition hover:border-primary/30 hover:bg-accent/40",children:[i.jsx("span",{className:`inline-block w-fit rounded-sm border px-1.5 py-[1px] font-mono text-[9px] font-bold uppercase tracking-[0.14em] ${_} ${x}`,children:f.label}),i.jsx("span",{className:"line-clamp-2 text-[13px] font-medium leading-snug text-foreground group-hover:text-primary",children:h}),i.jsxs("div",{className:"flex items-center justify-between gap-2 font-mono text-[10px] text-muted-foreground/70",children:[i.jsx("span",{className:"min-w-0 truncate",children:M}),R&&i.jsx("span",{className:"shrink-0",children:Xe(R)})]})]},`${b.agentId||""}/${b.filename}`)})})]})}function G0(u){var o;const c=(o=u.frontmatter)==null?void 0:o.name;if(c)return c;const m=u.content.split(`
66
66
  `).find(f=>f.trim().length>0);if(m){const f=m.replace(/^#+\s*/,"").trim();if(f)return f.slice(0,80)}return u.filename.replace(/\.md$/,"")}function L0(u){const c=u.filename.replace(/\.md$/,"");return c||(u.agentId==="_project"?"project":u.agentId||"unknown")}function X0(u){if(u)for(const c of["timestamp","updated","updatedAt","modified","created","date"]){const m=u[c];if(m&&!isNaN(new Date(m).getTime()))return m}}function Q0({memory:u,onClose:c}){if(U.useEffect(()=>{if(!u)return;const y=b=>{b.key==="Escape"&&c()};return document.addEventListener("keydown",y),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",y),document.body.style.overflow=""}},[u,c]),!u)return null;const m=vm(u),o=u.agentId==="_project"?"project":u.agentId||"unknown",f=`.gossip/agents/${u.agentId||"_project"}/memory/knowledge/${u.filename}`,x=Z0(u.frontmatter),_=Object.entries(u.frontmatter||{});return i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center overflow-y-auto bg-background/80 p-6 backdrop-blur-sm",onClick:c,children:i.jsxs("div",{className:"relative flex max-h-[calc(100vh-48px)] w-full max-w-xl flex-col overflow-hidden rounded-lg border border-primary/30 bg-card",style:{boxShadow:"0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 3px rgba(139, 92, 246, 0.06)"},onClick:y=>y.stopPropagation(),children:[i.jsxs("div",{className:"flex items-center gap-2.5 border-b border-border/60 px-4 py-3.5",children:[i.jsx("span",{className:"shrink-0 rounded-sm border border-primary/30 bg-primary/[0.06] px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase tracking-[0.14em] text-primary",children:m}),i.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs font-medium text-foreground",children:u.filename}),i.jsx("button",{onClick:c,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded text-muted-foreground transition hover:bg-muted hover:text-foreground","aria-label":"Close",children:i.jsx("span",{className:"text-base leading-none",children:"✕"})})]}),i.jsxs("div",{className:"flex-1 space-y-4 overflow-y-auto px-4 py-4 text-[13px] leading-relaxed text-foreground",children:[i.jsxs("section",{children:[i.jsx("h3",{className:"mb-1.5 font-mono text-[10px] font-semibold uppercase tracking-[0.14em] text-primary",children:"Owner"}),i.jsxs("div",{className:"flex flex-wrap gap-3 font-mono text-[11px] text-muted-foreground",children:[i.jsx("span",{children:o}),x&&i.jsxs("span",{children:["· updated ",Xe(x)]})]}),i.jsx("div",{className:"mt-1 truncate font-mono text-[10px] text-muted-foreground/60",children:f})]}),_.length>0&&i.jsxs("section",{children:[i.jsx("h3",{className:"mb-1.5 font-mono text-[10px] font-semibold uppercase tracking-[0.14em] text-primary",children:"Frontmatter"}),i.jsx("div",{className:"overflow-hidden rounded-md border border-border/40 bg-background/40",children:i.jsx("table",{className:"w-full text-left font-mono text-[11px]",children:i.jsx("tbody",{children:_.map(([y,b])=>i.jsxs("tr",{className:"border-b border-border/20 last:border-b-0",children:[i.jsx("td",{className:"w-32 px-3 py-1.5 text-muted-foreground/70",children:y}),i.jsx("td",{className:"px-3 py-1.5 break-all text-foreground/90",children:b})]},y))})})})]}),i.jsxs("section",{children:[i.jsx("h3",{className:"mb-1.5 font-mono text-[10px] font-semibold uppercase tracking-[0.14em] text-primary",children:"Content"}),i.jsx("div",{className:"task-md overflow-x-auto rounded-md border border-border/40 bg-background/40 p-3 text-xs leading-relaxed text-foreground/90",dangerouslySetInnerHTML:{__html:gm(u.content)}})]})]})]})})}function Z0(u){if(u)for(const c of["timestamp","updated","updatedAt","modified","created","date"]){const m=u[c];if(m&&!isNaN(new Date(m).getTime()))return m}}const V0=new Set(["shipped","closed"]),K0={backlog:"text-primary",record:"text-text-dim",session:"text-confirmed",rule:"text-unverified"},$0={backlog:{bg:"bg-primary",glow:"rgba(139, 92, 246, 0.6)"},record:{bg:"bg-text-dim",glow:"rgba(102, 102, 116, 0.55)"},session:{bg:"bg-confirmed",glow:"rgba(52, 211, 153, 0.55)"},rule:{bg:"bg-unverified",glow:"rgba(251, 191, 36, 0.55)"}},J0={backlog:"bg-primary/[0.06] border-primary/30",record:"bg-text-dim/[0.08] border-text-dim/20",session:"bg-confirmed/[0.06] border-confirmed/25",rule:"bg-unverified/[0.06] border-unverified/25"},F0={backlog:i.jsx("path",{d:"M20 7h-7L10.3 4.3A1 1 0 0 0 9.6 4H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2z"}),record:i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20"}),i.jsx("path",{d:"M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"})]}),session:i.jsxs(i.Fragment,{children:[i.jsx("circle",{cx:"12",cy:"12",r:"10"}),i.jsx("polyline",{points:"12 6 12 12 16 14"})]}),rule:i.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})},W0=1440*60*1e3;function I0({memories:u,heading:c="Memory",statusFilter:m=!1}){const[o,f]=U.useState(null),[x,_]=U.useState(null),[y,b]=U.useState("all"),h=U.useMemo(()=>H0(u),[u]),M=U.useMemo(()=>!m||y==="all"?h:h.filter(G=>{var ne;const H=(((ne=G.frontmatter)==null?void 0:ne.status)||"").toLowerCase();return y==="shipped"?V0.has(H):H==="open"||!H}),[h,m,y]),R=U.useMemo(()=>{const G={backlog:[],record:[],session:[],rule:[]},H={backlog:!1,record:!1,session:!1,rule:!1},ne=Date.now();for(const le of M){const V=vm(le);G[V].push(le),!H[V]&&P0(le,ne)&&(H[V]=!0)}return{buckets:G,recent:H}},[M]);return o?i.jsxs(i.Fragment,{children:[i.jsx(Y0,{folder:o,memories:R.buckets[o],onBack:()=>f(null),onOpen:_}),i.jsx(Q0,{memory:x,onClose:()=>_(null)})]}):i.jsxs("section",{className:"flex h-full flex-col",children:[i.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[i.jsxs("h2",{className:"font-mono text-xs font-bold uppercase tracking-widest text-foreground",children:[c," ",i.jsx("span",{className:"text-primary",children:M.length})]}),m&&i.jsx("div",{className:"flex gap-1 font-mono text-[10px]",role:"tablist","aria-label":"Status filter",children:["all","open","shipped"].map(G=>i.jsx("button",{role:"tab","aria-selected":y===G,onClick:()=>b(G),className:`rounded-sm border px-2 py-0.5 uppercase tracking-widest transition ${y===G?"border-primary/50 bg-primary/10 text-primary":"border-border/30 text-muted-foreground hover:border-primary/30 hover:text-foreground"}`,children:G},G))})]}),i.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:ym.map(({type:G,label:H,blurb:ne})=>{const le=R.buckets[G].length,V=R.recent[G],xe=K0[G],fe=$0[G],K=J0[G],Z=le===0;return i.jsxs("button",{onClick:()=>f(G),disabled:Z,className:`group relative grid grid-cols-[auto_1fr_auto] grid-rows-[auto_auto] items-center gap-x-3 gap-y-1 rounded-md border bg-muted p-3.5 text-left transition ${Z?"cursor-default border-border/20 opacity-55":"border-border/40 hover:border-primary/30 hover:bg-accent/40"}`,children:[i.jsxs("span",{className:`relative row-span-2 flex h-9 w-9 items-center justify-center rounded-sm border ${K} ${xe}`,"aria-hidden":!0,children:[V&&i.jsx("span",{className:`pointer-events-none absolute -right-1 -top-1 h-1.5 w-1.5 rounded-full ${fe.bg}`,style:{boxShadow:`0 0 8px ${fe.glow}`},"data-tooltip":"Activity in the last 24h","aria-label":"Activity in the last 24h"}),i.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:F0[G]})]}),i.jsx("span",{className:"self-end font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:H}),i.jsx("span",{className:`row-span-2 self-center font-mono text-sm font-bold tabular-nums ${Z?"text-muted-foreground/40":xe}`,children:le}),i.jsx("span",{className:"self-start font-mono text-[10px] leading-snug text-muted-foreground/70",children:ne})]},G)})})]})}function P0(u,c){const m=u.frontmatter;if(!m)return!1;for(const o of["lastAccessed","updated","timestamp","updatedAt","modified","created","date"]){const f=m[o];if(!f)continue;const x=new Date(f).getTime();if(!isNaN(x)&&c-x<=W0)return!0}return!1}function eg(u){const c=new Map;for(const o of u){const f=c.get(o.agentId)??[];f.push(o),c.set(o.agentId,f)}const m=[];for(const[o,f]of c){f.sort((_,y)=>_.day.localeCompare(y.day));const x=f.length>0?f[f.length-1].accuracy:0;m.push({agentId:o,points:f,latest:x})}return m.sort((o,f)=>f.latest-o.latest),m}function tg({values:u}){if(u.length===0)return i.jsx("svg",{width:120,height:20});if(u.length===1){const x=20-u[0]*20;return i.jsx("svg",{width:120,height:20,children:i.jsx("circle",{cx:120/2,cy:x,r:2,fill:"currentColor"})})}const o=120/(u.length-1),f=u.map((x,_)=>`${(_*o).toFixed(1)},${(20-x*20).toFixed(1)}`).join(" ");return i.jsx("svg",{width:120,height:20,className:"text-primary",children:i.jsx("polyline",{points:f,fill:"none",stroke:"currentColor",strokeWidth:1.5})})}function ng(){const[u,c]=U.useState(null),[m,o]=U.useState(null);U.useEffect(()=>{Je("fleet-trend?days=30").then(c).catch(x=>o(String((x==null?void 0:x.message)??x)))},[]);const f=U.useMemo(()=>u?eg(u.points):[],[u]);return i.jsxs("section",{className:"rounded-lg border border-border bg-card p-4",children:[i.jsxs("header",{className:"mb-3 flex items-baseline justify-between",children:[i.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:"Fleet Health Trend"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:"last 30d"})]}),m&&i.jsx("p",{className:"text-xs text-muted-foreground",children:"unavailable"}),!m&&u&&f.length===0&&i.jsx("p",{className:"text-xs text-muted-foreground",children:"no recent consensus signals"}),!m&&f.length>0&&i.jsx("ul",{className:"space-y-1.5",children:f.map(x=>i.jsxs("li",{className:"flex items-center justify-between gap-3 text-xs",children:[i.jsx("span",{className:"truncate font-mono text-foreground",children:x.agentId}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(tg,{values:x.points.map(_=>_.accuracy)}),i.jsxs("span",{className:"w-10 text-right tabular-nums text-muted-foreground",children:[Math.round(x.latest*100),"%"]})]})]},x.agentId))})]})}const kc=[{key:"passed",label:"passed",bar:"bg-emerald-400",dot:"bg-emerald-400",text:"text-emerald-400"},{key:"pending",label:"pending",bar:"bg-sky-400",dot:"bg-sky-400",text:"text-sky-400"},{key:"insufficient_evidence",label:"insufficient",bar:"bg-yellow-400",dot:"bg-yellow-400",text:"text-yellow-400"},{key:"inconclusive",label:"inconclusive",bar:"bg-orange-400",dot:"bg-orange-400",text:"text-orange-400"},{key:"silent_skill",label:"silent",bar:"bg-zinc-500",dot:"bg-zinc-500",text:"text-zinc-400"},{key:"failed",label:"failed",bar:"bg-red-400",dot:"bg-red-400",text:"text-red-400"}];function lg({overview:u}){const c=u==null?void 0:u.skillVerdictSummary,m=c?kc.reduce((o,f)=>o+(c[f.key]??0),0):0;return i.jsxs("section",{className:"rounded-lg border border-border bg-card p-4",children:[i.jsxs("header",{className:"mb-3 flex items-baseline justify-between",children:[i.jsx("h3",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:"Skill Verdicts"}),i.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground/70",children:[m," total"]})]}),!c||m===0?i.jsx("p",{className:"font-mono text-[11px] text-muted-foreground/60",children:"no skill verdicts yet"}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"mb-3 flex h-2 w-full gap-px overflow-hidden rounded-sm bg-muted/40",children:kc.map(o=>{const f=c[o.key]??0;if(f===0)return null;const x=f/m*100;return i.jsx("div",{className:o.bar,style:{width:`${x}%`},title:`${o.label}: ${f}`},o.key)})}),i.jsx("ul",{className:"grid grid-cols-3 gap-x-4 gap-y-1.5 font-mono text-[11px]",children:kc.map(o=>{const f=c[o.key]??0,x=f===0;return i.jsxs("li",{className:`flex items-center gap-1.5 ${x?"opacity-40":""}`,children:[i.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${o.dot}`}),i.jsx("span",{className:"text-muted-foreground",children:o.label}),i.jsx("span",{className:`ml-auto tabular-nums ${x?"text-muted-foreground/50":o.text}`,children:f})]},o.key)})})]})]})}const ag={agreement:"confirmed",consensus_verified:"confirmed",unique_confirmed:"unique",unique_unconfirmed:"unique?",disagreement:"disputed",hallucination_caught:"hallucination",new_finding:"new",unverified:"unverified"};function ig(u,c){return u?u.length>c?u.slice(0,c-1)+"…":u:""}function sg(){const[u,c]=U.useState(null),[m,o]=U.useState(null);return U.useEffect(()=>{Je("signals?limit=5").then(f=>c(f.items??[])).catch(f=>o(String((f==null?void 0:f.message)??f)))},[]),i.jsxs("section",{className:"rounded-lg border border-border bg-card p-4",children:[i.jsxs("header",{className:"mb-3 flex items-baseline justify-between",children:[i.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:"Recent Signals"}),i.jsx("button",{type:"button",onClick:()=>Ph("/signals"),className:"text-xs text-primary hover:underline",children:"all signals →"})]}),m&&i.jsx("p",{className:"text-xs text-muted-foreground",children:"unavailable"}),!m&&u&&u.length===0&&i.jsx("p",{className:"text-xs text-muted-foreground",children:"no signals recorded"}),!m&&u&&u.length>0&&i.jsx("ul",{className:"space-y-1.5",children:u.map((f,x)=>i.jsxs("li",{className:"flex items-center gap-2 text-xs",children:[i.jsx("span",{className:"w-14 shrink-0 text-muted-foreground tabular-nums",children:Xe(f.timestamp)}),i.jsx("span",{className:"w-20 shrink-0 font-mono uppercase tracking-wide text-foreground",children:ag[f.signal]??f.signal}),i.jsx("span",{className:"w-24 shrink-0 truncate font-mono text-muted-foreground",children:f.agentId}),i.jsx("span",{className:"flex-1 truncate text-muted-foreground",children:ig(f.evidence??"",80)})]},`${f.timestamp}-${x}`))})]})}const cm=["bg-disputed","bg-unverified","bg-unique","bg-muted-foreground/60","bg-primary/70","bg-confirmed/70"];function rm(u){let c=0;for(let m=0;m<u.length;m++)c=c*31+u.charCodeAt(m)>>>0;return cm[c%cm.length]}function ug({overview:u}){const c=u==null?void 0:u.droppedFindingTypeCounts,m=c?Object.entries(c).sort((f,x)=>x[1]-f[1]):[],o=m.reduce((f,[,x])=>f+x,0);return i.jsxs("section",{className:"rounded-lg border border-border bg-card p-4",children:[i.jsxs("header",{className:"mb-3 flex items-baseline justify-between",children:[i.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:"Dropped Finding Types"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:"last 20 rounds"})]}),o===0?i.jsx("p",{className:"text-xs text-muted-foreground",children:"all clean — no invalid types"}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"mb-3 flex h-3 w-full overflow-hidden rounded",children:m.map(([f,x])=>{const _=x/o*100;return i.jsx("div",{className:rm(f),style:{width:`${_}%`},title:`invalid type "${f}" emitted ${x} times in last 20 consensus rounds`},f)})}),i.jsx("ul",{className:"space-y-1 text-xs",children:m.map(([f,x])=>i.jsxs("li",{className:"flex items-center gap-2",children:[i.jsx("span",{className:`h-2 w-2 rounded-sm ${rm(f)}`}),i.jsx("span",{className:"truncate font-mono text-foreground",children:f}),i.jsx("span",{className:"ml-auto tabular-nums text-muted-foreground",children:x})]},f))})]})]})}function cg({categoryAccuracy:u,categoryCorrect:c,categoryHallucinated:m}){const o=Object.keys(u??{});if(o.length===0)return i.jsx(Fl,{title:"No category data yet",hint:"Accuracy accrues after ≥5 signals per category.",compact:!0});const f=o.map(x=>{const _=Math.max(0,Math.min(1,u[x]??0)),y=(c==null?void 0:c[x])??0,b=(m==null?void 0:m[x])??0;return{key:x,acc:_,c:y,h:b,n:y+b}}).sort((x,_)=>_.acc-x.acc);return i.jsx("div",{className:"space-y-2",children:f.map(x=>{const _=x.acc>=.9?"bg-confirmed":x.acc>=.7?"bg-unverified":"bg-disputed",y=x.n>0?`${x.c} correct / ${x.h} hallucinated / ${x.n} total`:void 0;return i.jsxs("div",{className:`grid grid-cols-[128px_1fr_auto_44px] items-center gap-3 ${x.n>0&&x.n<10?"opacity-50":""}`,title:x.n>0&&x.n<10?`${y} — low sample (n<10)`:y,children:[i.jsx("span",{className:"truncate font-mono text-[11px] text-muted-foreground",children:x.key.replace(/_/g," ")}),i.jsx("div",{className:"h-2 overflow-hidden rounded-sm bg-muted/30",children:i.jsx("div",{className:`h-full rounded-sm transition-all ${_}`,style:{width:`${x.acc*100}%`}})}),i.jsx("span",{className:"shrink-0 text-right font-mono text-[10px] tabular-nums text-muted-foreground/60 w-16",children:x.n>0?i.jsxs(i.Fragment,{children:[x.c,"/",x.n,x.h>0&&i.jsxs("span",{className:"ml-1 text-disputed/70",children:["·",x.h,"✗"]})]}):"—"}),i.jsxs("span",{className:"text-right font-mono text-[11px] font-bold tabular-nums text-foreground",children:[Math.round(x.acc*100),"%"]})]},x.key)})})}const rg={pending:"border-border/50 bg-muted/30 text-muted-foreground",passed:"border-confirmed/40 bg-confirmed/10 text-confirmed",failed:"border-disputed/40 bg-disputed/10 text-disputed",silent_skill:"border-unverified/40 bg-unverified/10 text-unverified",insufficient_evidence:"border-unverified/40 bg-unverified/10 text-unverified",inconclusive:"border-unique/40 bg-unique/10 text-unique",flagged_for_manual_review:"border-disputed/40 bg-disputed/10 text-disputed"};function og(u){const c=Math.round(u*100),m=c>0?"+":"",o=c>0?"text-confirmed":c<0?"text-disputed":"text-muted-foreground";return{text:`${m}${c}pp`,cls:o}}function dg({slot:u}){const c=u.status,m=c?rg[c]:"border-border/50 bg-muted/30 text-muted-foreground",o=c==="inconclusive"&&(u.inconclusiveStrikes??0)>0,f=u.forcedDevelops??[],x=f.length>0?f[f.length-1]:null,_=typeof u.effectiveness=="number"?og(u.effectiveness):null;return i.jsxs("div",{className:`rounded-md border bg-card/80 p-3 ${u.enabled?"border-border/50":"border-border/30 opacity-60"}`,children:[i.jsxs("div",{className:"flex items-start justify-between gap-2",children:[i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[i.jsxs("span",{className:`font-mono text-xs font-semibold ${u.enabled?"text-foreground":"text-muted-foreground line-through"}`,children:[u.mode==="contextual"&&"⚡ ",u.name]}),i.jsx("span",{className:"rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[9px] text-muted-foreground",children:u.source}),u.mode==="contextual"&&i.jsx("span",{className:"rounded-sm border border-amber-500/30 bg-amber-500/10 px-1.5 py-0.5 font-mono text-[9px] text-amber-400",children:"contextual"})]}),i.jsxs("div",{className:"mt-1 font-mono text-[10px] text-muted-foreground/60",children:["bound ",Xe(u.boundAt)]})]}),c&&i.jsx("span",{className:`shrink-0 rounded-sm border px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase ${m}`,children:c.replace(/_/g," ")})]}),i.jsxs("div",{className:"mt-2 flex items-center gap-3 font-mono text-[10px]",children:[_&&i.jsx("span",{className:_.cls,title:"Effectiveness: change in hallucination rate pre/post",children:_.text}),o&&i.jsxs("span",{className:"text-unique",title:u.inconclusiveAt?`last strike ${Xe(u.inconclusiveAt)}`:void 0,children:[u.inconclusiveStrikes," strike",u.inconclusiveStrikes===1?"":"s"]})]}),f.length>0&&i.jsxs("div",{className:"mt-2 border-t border-border/40 pt-2 font-mono text-[10px] text-muted-foreground",title:x!=null&&x.reason?`latest: ${x.reason}`:void 0,children:["forced ",f.length," time",f.length===1?"":"s",x&&` · last ${Xe(x.timestamp)}`]})]})}function fg({open:u,onOpenChange:c,children:m}){return U.useEffect(()=>{if(!u)return;const o=x=>{x.key==="Escape"&&c(!1)};document.addEventListener("keydown",o);const f=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",o),document.body.style.overflow=f}},[u,c]),u?i.jsxs("div",{className:"fixed inset-0 z-50",children:[i.jsx("div",{className:"absolute inset-0 bg-background/70 backdrop-blur-sm",onClick:()=>c(!1)}),i.jsx("div",{className:"absolute inset-y-0 right-0 flex",children:i.jsx("div",{onClick:o=>o.stopPropagation(),className:"contents",children:m})})]}):null}function mg({side:u="right",className:c="",children:m,...o}){return i.jsx("div",{className:`h-full border-l border-border/60 bg-card shadow-xl p-6 ${c}`,...o,children:m})}function xg({className:u="",...c}){return i.jsx("div",{className:`mb-2 ${u}`,...c})}function hg({className:u="",...c}){return i.jsx("h2",{className:`font-semibold ${u}`,...c})}function gg({citation:u}){const c=u.snippet.split(`
67
- `);return i.jsxs("div",{className:"rounded-md border border-border/40 bg-card/60 overflow-hidden",children:[i.jsx("div",{className:"flex items-center justify-between px-3 py-1 border-b border-border/40 bg-muted/40",children:i.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground",children:[u.file,":",u.line]})}),i.jsx("pre",{className:"px-3 py-2 font-mono text-[11px] leading-relaxed overflow-x-auto",children:c.map((m,o)=>i.jsx("div",{className:"whitespace-pre",children:m||" "},o))})]})}const pg={critical:"text-red-400 bg-red-500/10",high:"text-orange-400 bg-orange-500/10",medium:"text-yellow-400 bg-yellow-500/10",low:"text-muted-foreground bg-muted/50"},bg={confirmed:"bg-confirmed",disputed:"bg-disputed",unverified:"bg-unverified",unique:"bg-unique",insight:"bg-muted",newFinding:"bg-unique"};function xs({open:u,onOpenChange:c,consensusId:m,findingId:o}){const[f,x]=U.useState(null),[_,y]=U.useState(null);return U.useEffect(()=>{if(!u||!m||!o){x(null),y(null);return}x(null),y(null),Je(`finding/${encodeURIComponent(m)}/${encodeURIComponent(o)}`).then(x).catch(b=>y(b.message||"failed to load finding"))},[u,m,o]),i.jsx(fg,{open:u,onOpenChange:c,children:i.jsxs(mg,{side:"right",className:"w-[480px] sm:w-[480px] sm:max-w-[480px] overflow-y-auto",children:[i.jsx(xg,{children:i.jsx(hg,{className:"font-mono text-sm",children:"Finding detail"})}),_&&i.jsx("div",{className:"mt-4 text-[11px] text-disputed",children:_}),!_&&!f&&i.jsx("div",{className:"mt-4 text-[11px] text-muted-foreground",children:"Loading…"}),f&&i.jsxs("div",{className:"mt-4 space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[i.jsx("span",{className:`font-mono text-[9px] uppercase tracking-widest px-2 py-0.5 rounded ${bg[f.finding.tag]||"bg-muted"}`,children:f.finding.tag}),f.finding.severity&&i.jsx("span",{className:`font-mono text-[9px] uppercase tracking-widest px-2 py-0.5 rounded ${pg[f.finding.severity]||"bg-muted"}`,children:f.finding.severity}),i.jsxs("span",{className:"font-mono text-[9px] text-muted-foreground",children:["by ",f.finding.originalAgentId]}),f.retracted&&i.jsx("span",{className:"font-mono text-[9px] uppercase tracking-widest px-2 py-0.5 rounded bg-disputed/50",children:"retracted"})]}),i.jsx("div",{className:"text-[12px] leading-relaxed whitespace-pre-wrap",children:f.finding.finding.replace(/<cite tag="file">[^<]+<\/cite>/g,"").trim()}),f.citations.length>0&&i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"font-mono text-[10px] uppercase tracking-widest text-muted-foreground",children:"Citations"}),f.citations.map((b,h)=>i.jsx(gg,{citation:b},h))]}),i.jsxs("div",{className:"space-y-1",children:[i.jsx("div",{className:"font-mono text-[10px] uppercase tracking-widest text-muted-foreground",children:"Coverage"}),f.finding.confirmedBy.length>0&&i.jsxs("div",{className:"text-[11px]",children:[i.jsx("span",{className:"text-confirmed",children:"✓"})," confirmed by ",f.finding.confirmedBy.join(", ")]}),f.finding.disputedBy.map((b,h)=>i.jsxs("div",{className:"text-[11px]",children:[i.jsx("span",{className:"text-disputed",children:"✗"})," disputed by ",b.agentId,": ",i.jsx("span",{className:"text-muted-foreground",children:b.reason})]},h)),f.finding.confirmedBy.length===0&&f.finding.disputedBy.length===0&&i.jsx("div",{className:"text-[11px] text-muted-foreground",children:"No peer review"})]}),f.signals.length>0&&i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"font-mono text-[10px] uppercase tracking-widest text-muted-foreground",children:["Signals (",f.signals.length,")"]}),i.jsx("div",{className:"space-y-1",children:f.signals.map((b,h)=>i.jsxs("div",{className:"text-[11px] border-l-2 border-border/40 pl-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-mono font-semibold",children:b.signal}),i.jsx("span",{className:"text-muted-foreground",children:"·"}),i.jsx("span",{children:b.agentId}),b.counterpartId&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-muted-foreground",children:"→"}),i.jsx("span",{children:b.counterpartId})]}),i.jsx("span",{className:"text-muted-foreground ml-auto",children:Xe(b.timestamp)})]}),b.evidence&&i.jsx("div",{className:"text-muted-foreground mt-0.5",children:b.evidence.slice(0,200)})]},h))})]}),i.jsx("div",{className:"pt-2 border-t border-border/40",children:i.jsxs("a",{href:`#/consensus/${f.consensusId}`,className:"font-mono text-[10px] text-primary hover:underline",children:["→ consensus round ",f.consensusId]})})]})]})})}const vg={agreement:"text-confirmed bg-confirmed/10",consensus_verified:"text-confirmed bg-confirmed/10",unique_confirmed:"text-unique bg-unique/10",unique_unconfirmed:"text-unique bg-unique/10",new_finding:"text-unique bg-unique/10",disagreement:"text-disputed bg-disputed/10",hallucination_caught:"text-disputed bg-disputed/10",unverified:"text-unverified bg-unverified/10"};function yg({agentId:u}){const[c,m]=U.useState([]),[o,f]=U.useState(!0),[x,_]=U.useState("all"),[y,b]=U.useState(null);U.useEffect(()=>{let G=!1;return f(!0),Je(`signals?agent=${encodeURIComponent(u)}&limit=100`).then(H=>{G||(m(H.items||[]),f(!1))}).catch(()=>{G||(m([]),f(!1))}),()=>{G=!0}},[u]);const h=[...c].sort((G,H)=>(H.timestamp||"").localeCompare(G.timestamp||"")),M=x==="all"||x==="signals"?h:[],R=({k:G,label:H,enabled:ne})=>i.jsx("button",{type:"button",onClick:()=>ne&&_(G),disabled:!ne,className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold transition ${x===G?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"} ${ne?"":"opacity-40 cursor-not-allowed"}`,children:H});return i.jsxs("div",{className:"rounded-md border border-border/40 bg-card/80 px-4 py-3",children:[i.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[i.jsx("span",{className:"font-mono text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:"Activity"}),i.jsxs("div",{className:"flex gap-1",children:[i.jsx(R,{k:"all",label:"All",enabled:!0}),i.jsx(R,{k:"signals",label:"Signals",enabled:!0}),i.jsx(R,{k:"tasks",label:"Tasks (none yet)",enabled:!1}),i.jsx(R,{k:"skills",label:"Skills (none yet)",enabled:!1})]})]}),o?i.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"Loading…"}):M.length===0?i.jsx(Fl,{title:"No activity yet",hint:"Signals, task completions, and skill binds will appear here.",compact:!0}):i.jsx("div",{className:"space-y-1",children:M.map((G,H)=>{const ne=vg[G.signal]||"text-muted-foreground bg-muted",le=!!(G.consensusId&&G.findingId),V=i.jsxs("div",{className:"flex items-start gap-2 py-1.5",children:[i.jsx("span",{className:"shrink-0 font-mono text-[9px] text-muted-foreground/60 tabular-nums w-16",children:Xe(G.timestamp)}),i.jsx("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold ${ne}`,children:G.signal}),i.jsxs("div",{className:"min-w-0 flex-1 text-[11px] text-muted-foreground",children:[G.counterpartId&&i.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground/70",children:["→ ",G.counterpartId," · "]}),G.evidence&&i.jsx("span",{children:G.evidence.length>160?G.evidence.slice(0,160)+"…":G.evidence})]})]});return le?i.jsx("button",{type:"button",onClick:()=>b({consensusId:G.consensusId,findingId:G.findingId}),className:"w-full rounded-sm text-left transition hover:bg-accent/40",children:V},H):i.jsx("div",{children:V},H)})}),i.jsx(xs,{open:!!y,onOpenChange:G=>{G||b(null)},consensusId:(y==null?void 0:y.consensusId)??null,findingId:(y==null?void 0:y.findingId)??null})]})}const jg={agreement:"bg-confirmed",consensus_verified:"bg-confirmed",unique_confirmed:"bg-unique",unique_unconfirmed:"bg-unique/50",disagreement:"bg-disputed/70",hallucination_caught:"bg-disputed",new_finding:"bg-unique",unverified:"bg-unverified"},Ng={agreement:"Confirmed",consensus_verified:"Confirmed",unique_confirmed:"Unique (confirmed)",unique_unconfirmed:"Unique",disagreement:"Disputed",hallucination_caught:"Hallucination",new_finding:"New finding",unverified:"Unverified"};function Sg({agentId:u}){const[c,m]=U.useState([]),[o,f]=U.useState(0),[x,_]=U.useState(!1),[y,b]=U.useState(null);if(U.useEffect(()=>{Je(`signals?agent=${encodeURIComponent(u)}&limit=100`).then(H=>{m(H.items||[]),f(H.total||0)}).catch(()=>{})},[u]),c.length===0)return i.jsx("div",{className:"rounded-md border border-border/40 bg-card/80 px-4 py-3",children:i.jsx(Fl,{title:"No signal history yet",hint:"Signals are recorded during consensus rounds.",compact:!0})});const h=[...c].reverse(),M={confirmed:0,disputed:0,unique:0,unverified:0};for(const H of c)H.signal==="agreement"||H.signal==="consensus_verified"?M.confirmed++:H.signal==="disagreement"||H.signal==="hallucination_caught"?M.disputed++:H.signal==="unique_confirmed"||H.signal==="unique_unconfirmed"||H.signal==="new_finding"?M.unique++:H.signal==="unverified"&&M.unverified++;const R=c.length,G=o>R;return i.jsxs("div",{className:"rounded-md border border-border/40 bg-card/80 px-4 py-3",children:[i.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-baseline gap-2",children:[i.jsx("span",{className:"font-mono text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:"Signal Timeline"}),i.jsx("span",{className:"font-mono text-[9px] text-muted-foreground/50",children:G?`last ${R} of ${o}`:`${o} total`})]}),i.jsxs("div",{className:"flex items-center gap-3 font-mono text-[10px]",children:[i.jsxs("span",{className:"text-confirmed",children:[M.confirmed," confirmed"]}),M.disputed>0&&i.jsxs("span",{className:"text-disputed",children:[M.disputed," disputed"]}),M.unique>0&&i.jsxs("span",{className:"text-unique",children:[M.unique," unique"]}),M.unverified>0&&i.jsxs("span",{className:"text-unverified",children:[M.unverified," unverified"]})]})]}),i.jsx("div",{className:"flex items-center gap-0.5",children:h.map((H,ne)=>{const le=!!(H.consensusId&&H.findingId);return i.jsx("button",{type:"button",disabled:!le,onClick:()=>{H.consensusId&&H.findingId&&(b({consensusId:H.consensusId,findingId:H.findingId}),_(!0))},className:`h-4 w-1.5 rounded-sm transition-opacity hover:opacity-80 ${jg[H.signal]||"bg-muted"} ${le?"cursor-pointer":"cursor-default"}`,title:`${Ng[H.signal]||H.signal} — ${Xe(H.timestamp)}${le?" (click for detail)":""}`},ne)})}),i.jsx("div",{className:"mt-2 flex flex-wrap gap-3",children:[{color:"bg-confirmed",label:"Confirmed"},{color:"bg-disputed",label:"Disputed"},{color:"bg-unique",label:"Unique"},{color:"bg-unverified",label:"Unverified"}].map(H=>i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("div",{className:`h-2 w-2 rounded-sm ${H.color}`}),i.jsx("span",{className:"font-mono text-[9px] text-muted-foreground/60",children:H.label})]},H.label))}),i.jsx(xs,{open:x,onOpenChange:_,consensusId:(y==null?void 0:y.consensusId)??null,findingId:(y==null?void 0:y.findingId)??null})]})}function Tg(u){const c=u.toLowerCase();return c==="completed"||c==="done"||c==="success"||c==="succeeded"?"completed":c==="running"||c==="active"||c==="in_progress"||c==="pending"?"running":c==="failed"||c==="error"||c==="errored"||c==="timeout"||c==="timed_out"?"failed":c==="cancelled"||c==="canceled"||c==="queued"||c==="waiting"?"cancelled":"unknown"}const _g={completed:{label:"Done",iconBox:"bg-confirmed/10 border-confirmed/30",text:"text-confirmed",pulse:!1},running:{label:"Running",iconBox:"bg-unverified/10 border-unverified/30",text:"text-unverified",pulse:!0},failed:{label:"Failed",iconBox:"bg-destructive/10 border-destructive/30",text:"text-destructive",pulse:!1},cancelled:{label:"Cancelled",iconBox:"bg-muted-foreground/10 border-muted-foreground/25",text:"text-muted-foreground",pulse:!1},unknown:{label:"Unknown",iconBox:"bg-muted-foreground/10 border-muted-foreground/25",text:"text-muted-foreground",pulse:!1}},Eg={completed:i.jsx("polyline",{points:"5 12 10 17 19 7"}),running:i.jsxs(i.Fragment,{children:[i.jsx("circle",{cx:"12",cy:"12",r:"3",fill:"currentColor",stroke:"none"}),i.jsx("circle",{cx:"12",cy:"12",r:"8",opacity:"0.45"})]}),failed:i.jsxs(i.Fragment,{children:[i.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"}),i.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"})]}),cancelled:i.jsx("line",{x1:"6",y1:"12",x2:"18",y2:"12"}),unknown:i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"M9.5 9a2.5 2.5 0 1 1 3.5 2.3c-.8.4-1 .9-1 1.7"}),i.jsx("line",{x1:"12",y1:"16.5",x2:"12",y2:"16.5"})]})};function Mg(u){if(!u)return"—";if(u<1e3)return"< 1s";if(u<6e4)return Math.floor(u/1e3)+"s";if(u<36e5){const o=Math.floor(u/6e4),f=Math.floor(u%6e4/1e3);return f>0?`${o}m ${f}s`:`${o}m`}const c=Math.floor(u/36e5),m=Math.floor(u%36e5/6e4);return m>0?`${c}h ${m}m`:`${c}h`}function jm({task:u,onClick:c}){const m=Tg(u.status),o=_g[m];return i.jsxs("tr",{className:`border-b border-border hover:bg-accent/30 transition-colors ${c?"cursor-pointer":""}`,onClick:c?f=>{f.target.closest("a")||c(u)}:void 0,children:[i.jsx("td",{className:"py-2.5 pl-4 pr-2",children:i.jsxs("span",{className:"inline-flex items-center gap-2","aria-label":`Status: ${o.label}`,children:[i.jsx("span",{className:`flex h-[22px] w-[22px] shrink-0 items-center justify-center rounded-full border ${o.iconBox} ${o.text} ${o.pulse?"animate-pulse":""}`,"aria-hidden":!0,children:i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:Eg[m]})}),i.jsx("span",{className:`font-mono text-[10px] font-semibold uppercase tracking-wider ${o.text}`,children:o.label})]})}),i.jsx("td",{className:"py-2.5 pr-3",children:i.jsx("span",{className:"rounded border border-amber-500/25 bg-amber-500/8 px-2 py-1 font-mono text-[10px] font-semibold text-amber-400",children:u.taskId.slice(0,8)})}),i.jsx("td",{className:"py-2.5 pr-3 font-mono text-xs text-muted-foreground",children:i.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent(u.agentId)}`,className:"inline-flex items-center gap-1.5 transition hover:text-primary",children:[i.jsx("span",{className:"inline-block h-2 w-2 shrink-0 rounded-full",style:{backgroundColor:Va(u.agentId)}}),u.agentId]})}),i.jsx("td",{className:"py-2.5 pr-3 font-inter text-sm text-foreground/80",children:(()=>{const f=u.task.replace(/\n.*/s,"");return f.length>100?f.slice(0,100)+"…":f})()}),i.jsx("td",{className:"py-2.5 pr-3 font-mono text-xs text-muted-foreground",children:m==="running"?"running":Mg(u.duration)}),i.jsx("td",{className:"py-2.5 pr-4 text-right font-mono text-xs text-muted-foreground",children:Xe(u.timestamp)})]})}const Ag=3,zg=720*60*60*1e3;function Cg({agentId:u,agents:c,tasks:m,consensus:o}){const f=c.find(D=>D.id===u),[x,_]=U.useState([]),[y,b]=U.useState([]),[h,M]=U.useState(null),[R,G]=U.useState(null),[H,ne]=U.useState(null),[le,V]=U.useState(0),[xe,fe]=U.useState(0);U.useEffect(()=>{Je(`memory/${u}`).then(D=>{_(D.knowledge||[])}).catch(()=>_([]))},[u]),U.useEffect(()=>{let D=!1;return Je("consensus-reports?page=1&pageSize=200").then(W=>{D||b(W.reports||[])}).catch(()=>{D||b([])}),()=>{D=!0}},[]);const K=U.useMemo(()=>{var C;const D=Date.now(),W=new Map;for(const X of y){const B=Date.parse(X.timestamp);if(Number.isNaN(B)||D-B>zg)continue;const ee=(C=X.authorDiagnostics)==null?void 0:C[u];if(ee)for(const ue of ee)W.set(ue.code,(W.get(ue.code)??0)+1)}const g=[];for(const[X,B]of W)B>=Ag&&g.push({code:X,count:B});return g},[y,u]);if(!f)return i.jsxs("div",{className:"py-20 text-center text-muted-foreground",children:["Agent not found: ",u]});const Z=f.scores,z=(m==null?void 0:m.items.filter(D=>D.agentId===u))||[],se=(o==null?void 0:o.runs.filter(D=>D.agents.includes(u)))||[],Q=[{label:"accuracy",value:Z.accuracy,fill:Z.accuracy>=.7?"bg-confirmed":Z.accuracy>=.4?"bg-unverified":"bg-disputed"},{label:"reliability",value:Z.reliability,fill:"bg-chart"},{label:"unique",value:Z.uniqueness,fill:"bg-unique"},{label:"impact",value:Z.impactScore,fill:"bg-[var(--color-impact)]"}],J=Z.unverifiedsEmitted??0,ae=Z.unverifiedsReceived??0,oe=J+ae,Ee=[{label:"Signals",value:String(Z.signals),color:"text-foreground"},{label:"Agreements",value:String(Z.agreements),color:"text-confirmed"},{label:"Disagreements",value:String(Z.disagreements),color:"text-disputed"},{label:"Hallucinations",value:String(Z.hallucinations),color:Z.hallucinations>0?"text-disputed":"text-muted-foreground"},{label:"Unverified",value:oe>0?`${J}↑ ${ae}↓`:"0",color:oe>0?"text-unverified":"text-muted-foreground",title:oe>0?`${J} emitted (as reviewer) · ${ae} received (as author)`:void 0},{label:"Tokens",value:f.totalTokens.toLocaleString(),color:"text-foreground"}],k=10,F=Math.max(1,Math.ceil(z.length/k)),re=Math.min(le,F-1),L=z.slice(re*k,(re+1)*k),S=U.useMemo(()=>{const D=new Map;for(const W of x){const g=W.filename.match(/^(\d{4}-\d{2}-\d{2})/),C=g?g[1]:"undated",X=D.get(C)||[];X.push(W),D.set(C,X)}return Array.from(D.entries()).sort(([W],[g])=>W==="undated"?1:g==="undated"?-1:g.localeCompare(W)).map(([W,g])=>({day:W,items:g}))},[x]),Y=Math.min(xe,Math.max(0,S.length-1)),$=S[Y];return i.jsxs(i.Fragment,{children:[(()=>{const D=fs(Z);return D==="benched"?i.jsx("div",{className:"mb-6 rounded-lg border border-destructive/30 bg-destructive/5 px-4 py-3",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-mono text-xs font-bold text-destructive",children:"BENCHED"}),i.jsxs("span",{className:"text-xs text-destructive/70",children:["Auto-bench rule fired (",Z.bench.reason??"unknown","). Agent excluded from dispatch until scores recover."]})]})}):D==="struggling"?i.jsx("div",{className:"mb-6 rounded-lg border border-unverified/30 bg-unverified/5 px-4 py-3",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-mono text-xs font-bold text-unverified",children:"STRUGGLING"}),i.jsxs("span",{className:"text-xs text-unverified/70",children:[Z.consecutiveFailures,"+ consecutive failures. Deprioritized until clean signals recorded."]})]})}):D==="kept-for-coverage"?i.jsx("div",{className:"mb-6 rounded-lg border border-unverified/30 bg-unverified/5 px-4 py-3",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-mono text-xs font-bold text-unverified",children:"KEPT FOR COVERAGE"}),i.jsxs("span",{className:"text-xs text-unverified/70",children:["Would be benched (",Z.bench.reason??"rule","), but is the sole provider of a category — kept to preserve coverage."]})]})}):null})(),K.length>0&&i.jsx("div",{className:"mb-6 space-y-2",children:K.map(({code:D,count:W})=>i.jsxs("div",{className:"rounded-lg border border-unverified/30 bg-unverified/5 px-4 py-3","data-diagnostic-code":D,children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-mono text-xs font-bold text-unverified",children:"PARSE DIAGNOSTIC"}),i.jsx("span",{className:"font-mono text-[11px] text-unverified/80",dangerouslySetInnerHTML:{__html:Qc(D)}}),i.jsxs("span",{className:"font-mono text-[11px] text-unverified/60",children:["· ",W," fires in 30d"]})]}),i.jsxs("div",{className:"mt-1 text-xs text-muted-foreground/80",children:["This agent's raw output has repeatedly tripped ",i.jsx("span",{className:"font-mono",children:D}),". Inspect recent consensus rounds on this page for the per-finding banner, or check upstream pipeline layers (sanitizer / renderer / relay encoding)."]})]},D))}),i.jsx("div",{className:"relative mb-6 rounded-xl border border-border bg-card p-5",children:i.jsxs("div",{className:"flex items-center gap-6",children:[i.jsx("div",{className:"relative shrink-0",children:i.jsx(Kc,{agentId:f.id,size:120,signals:Z.signals,accuracy:Z.accuracy,uniqueness:Z.uniqueness,impact:Z.impactScore})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("h1",{className:"truncate font-mono text-2xl font-bold text-foreground",children:f.id}),i.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[f.provider,"/",f.model]}),i.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[i.jsx("span",{className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold ${f.native?"text-primary bg-primary/10":"text-confirmed bg-confirmed/10"}`,children:f.native?"NATIVE":"RELAY"}),f.preset&&i.jsx("span",{className:"rounded-sm bg-muted px-2 py-0.5 font-mono text-[10px] text-muted-foreground",children:f.preset}),(()=>{const D=fs(Z);return D==="benched"?i.jsx("span",{className:"rounded-sm bg-destructive/10 px-2 py-0.5 font-mono text-[10px] font-bold text-destructive",children:"BENCHED"}):D==="struggling"?i.jsxs("span",{className:"rounded-sm bg-unverified/10 px-2 py-0.5 font-mono text-[10px] font-bold text-unverified",children:["STRUGGLING (",Z.consecutiveFailures," FAILS)"]}):D==="kept-for-coverage"?i.jsx("span",{className:"rounded-sm border border-unverified/40 px-2 py-0.5 font-mono text-[10px] font-bold text-unverified",children:"KEPT FOR COVERAGE"}):Z.consecutiveFailures>0?i.jsxs("span",{className:"rounded-sm bg-unverified/10 px-2 py-0.5 font-mono text-[10px] font-bold text-unverified",children:[Z.consecutiveFailures," CONSECUTIVE FAILS"]}):null})(),i.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground/60",children:[Z.signals," signals",f.lastTask?` · ${Xe(f.lastTask.timestamp)}`:""]})]})]}),i.jsxs("div",{className:"flex shrink-0 flex-col items-end rounded-md border border-border bg-background/60 px-3 py-2","data-tooltip":`Dispatch weight ${Z.dispatchWeight.toFixed(2)}
67
+ `);return i.jsxs("div",{className:"rounded-md border border-border/40 bg-card/60 overflow-hidden",children:[i.jsx("div",{className:"flex items-center justify-between px-3 py-1 border-b border-border/40 bg-muted/40",children:i.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground",children:[u.file,":",u.line]})}),i.jsx("pre",{className:"px-3 py-2 font-mono text-[11px] leading-relaxed overflow-x-auto",children:c.map((m,o)=>i.jsx("div",{className:"whitespace-pre",children:m||" "},o))})]})}const pg={critical:"text-red-400 bg-red-500/10",high:"text-orange-400 bg-orange-500/10",medium:"text-yellow-400 bg-yellow-500/10",low:"text-muted-foreground bg-muted/50"},bg={confirmed:"bg-confirmed",disputed:"bg-disputed",unverified:"bg-unverified",unique:"bg-unique",insight:"bg-muted",newFinding:"bg-unique"};function xs({open:u,onOpenChange:c,consensusId:m,findingId:o}){const[f,x]=U.useState(null),[_,y]=U.useState(null);return U.useEffect(()=>{if(!u||!m||!o){x(null),y(null);return}x(null),y(null),Je(`finding/${encodeURIComponent(m)}/${encodeURIComponent(o)}`).then(x).catch(b=>y(b.message||"failed to load finding"))},[u,m,o]),i.jsx(fg,{open:u,onOpenChange:c,children:i.jsxs(mg,{side:"right",className:"w-[480px] sm:w-[480px] sm:max-w-[480px] overflow-y-auto",children:[i.jsx(xg,{children:i.jsx(hg,{className:"font-mono text-sm",children:"Finding detail"})}),_&&i.jsx("div",{className:"mt-4 text-[11px] text-disputed",children:_}),!_&&!f&&i.jsx("div",{className:"mt-4 text-[11px] text-muted-foreground",children:"Loading…"}),f&&i.jsxs("div",{className:"mt-4 space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[i.jsx("span",{className:`font-mono text-[9px] uppercase tracking-widest px-2 py-0.5 rounded ${bg[f.finding.tag]||"bg-muted"}`,children:f.finding.tag}),f.finding.severity&&i.jsx("span",{className:`font-mono text-[9px] uppercase tracking-widest px-2 py-0.5 rounded ${pg[f.finding.severity]||"bg-muted"}`,children:f.finding.severity}),i.jsxs("span",{className:"font-mono text-[9px] text-muted-foreground",children:["by ",f.finding.originalAgentId]}),f.retracted&&i.jsx("span",{className:"font-mono text-[9px] uppercase tracking-widest px-2 py-0.5 rounded bg-disputed/50",children:"retracted"})]}),i.jsx("div",{className:"text-[12px] leading-relaxed whitespace-pre-wrap",children:f.finding.finding.replace(/<cite tag="file">[^<]+<\/cite>/g,"").trim()}),f.citations.length>0&&i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"font-mono text-[10px] uppercase tracking-widest text-muted-foreground",children:"Citations"}),f.citations.map((b,h)=>i.jsx(gg,{citation:b},h))]}),i.jsxs("div",{className:"space-y-1",children:[i.jsx("div",{className:"font-mono text-[10px] uppercase tracking-widest text-muted-foreground",children:"Coverage"}),f.finding.confirmedBy.length>0&&i.jsxs("div",{className:"text-[11px]",children:[i.jsx("span",{className:"text-confirmed",children:"✓"})," confirmed by ",f.finding.confirmedBy.join(", ")]}),f.finding.disputedBy.map((b,h)=>i.jsxs("div",{className:"text-[11px]",children:[i.jsx("span",{className:"text-disputed",children:"✗"})," disputed by ",b.agentId,": ",i.jsx("span",{className:"text-muted-foreground",children:b.reason})]},h)),f.finding.confirmedBy.length===0&&f.finding.disputedBy.length===0&&i.jsx("div",{className:"text-[11px] text-muted-foreground",children:"No peer review"})]}),f.signals.length>0&&i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"font-mono text-[10px] uppercase tracking-widest text-muted-foreground",children:["Signals (",f.signals.length,")"]}),i.jsx("div",{className:"space-y-1",children:f.signals.map((b,h)=>i.jsxs("div",{className:"text-[11px] border-l-2 border-border/40 pl-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-mono font-semibold",children:b.signal}),i.jsx("span",{className:"text-muted-foreground",children:"·"}),i.jsx("span",{children:b.agentId}),b.counterpartId&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-muted-foreground",children:"→"}),i.jsx("span",{children:b.counterpartId})]}),i.jsx("span",{className:"text-muted-foreground ml-auto",children:Xe(b.timestamp)})]}),b.evidence&&i.jsx("div",{className:"text-muted-foreground mt-0.5",children:b.evidence.slice(0,200)})]},h))})]}),i.jsx("div",{className:"pt-2 border-t border-border/40",children:i.jsxs("a",{href:`#/consensus/${f.consensusId}`,className:"font-mono text-[10px] text-primary hover:underline",children:["→ consensus round ",f.consensusId]})})]})]})})}const vg={agreement:"text-confirmed bg-confirmed/10",consensus_verified:"text-confirmed bg-confirmed/10",unique_confirmed:"text-unique bg-unique/10",unique_unconfirmed:"text-unique bg-unique/10",new_finding:"text-unique bg-unique/10",disagreement:"text-disputed bg-disputed/10",hallucination_caught:"text-disputed bg-disputed/10",unverified:"text-unverified bg-unverified/10"};function yg({agentId:u}){const[c,m]=U.useState([]),[o,f]=U.useState(!0),[x,_]=U.useState("all"),[y,b]=U.useState(null);U.useEffect(()=>{let G=!1;return f(!0),Je(`signals?agent=${encodeURIComponent(u)}&limit=100`).then(H=>{G||(m(H.items||[]),f(!1))}).catch(()=>{G||(m([]),f(!1))}),()=>{G=!0}},[u]);const h=[...c].sort((G,H)=>(H.timestamp||"").localeCompare(G.timestamp||"")),M=x==="all"||x==="signals"?h:[],R=({k:G,label:H,enabled:ne})=>i.jsx("button",{type:"button",onClick:()=>ne&&_(G),disabled:!ne,className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold transition ${x===G?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"} ${ne?"":"opacity-40 cursor-not-allowed"}`,children:H});return i.jsxs("div",{className:"rounded-md border border-border/40 bg-card/80 px-4 py-3",children:[i.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[i.jsx("span",{className:"font-mono text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:"Activity"}),i.jsxs("div",{className:"flex gap-1",children:[i.jsx(R,{k:"all",label:"All",enabled:!0}),i.jsx(R,{k:"signals",label:"Signals",enabled:!0}),i.jsx(R,{k:"tasks",label:"Tasks (none yet)",enabled:!1}),i.jsx(R,{k:"skills",label:"Skills (none yet)",enabled:!1})]})]}),o?i.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"Loading…"}):M.length===0?i.jsx(Fl,{title:"No activity yet",hint:"Signals, task completions, and skill binds will appear here.",compact:!0}):i.jsx("div",{className:"space-y-1",children:M.map((G,H)=>{const ne=vg[G.signal]||"text-muted-foreground bg-muted",le=!!(G.consensusId&&G.findingId),V=i.jsxs("div",{className:"flex items-start gap-2 py-1.5",children:[i.jsx("span",{className:"shrink-0 font-mono text-[9px] text-muted-foreground/60 tabular-nums w-16",children:Xe(G.timestamp)}),i.jsx("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold ${ne}`,children:G.signal}),i.jsxs("div",{className:"min-w-0 flex-1 text-[11px] text-muted-foreground",children:[G.counterpartId&&i.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground/70",children:["→ ",G.counterpartId," · "]}),G.evidence&&i.jsx("span",{children:G.evidence.length>160?G.evidence.slice(0,160)+"…":G.evidence})]})]});return le?i.jsx("button",{type:"button",onClick:()=>b({consensusId:G.consensusId,findingId:G.findingId}),className:"w-full rounded-sm text-left transition hover:bg-accent/40",children:V},H):i.jsx("div",{children:V},H)})}),i.jsx(xs,{open:!!y,onOpenChange:G=>{G||b(null)},consensusId:(y==null?void 0:y.consensusId)??null,findingId:(y==null?void 0:y.findingId)??null})]})}const jg={agreement:"bg-confirmed",consensus_verified:"bg-confirmed",unique_confirmed:"bg-unique",unique_unconfirmed:"bg-unique/50",disagreement:"bg-disputed/70",hallucination_caught:"bg-disputed",new_finding:"bg-unique",unverified:"bg-unverified"},Ng={agreement:"Confirmed",consensus_verified:"Confirmed",unique_confirmed:"Unique (confirmed)",unique_unconfirmed:"Unique",disagreement:"Disputed",hallucination_caught:"Hallucination",new_finding:"New finding",unverified:"Unverified"};function Sg({agentId:u}){const[c,m]=U.useState([]),[o,f]=U.useState(0),[x,_]=U.useState(!1),[y,b]=U.useState(null);if(U.useEffect(()=>{Je(`signals?agent=${encodeURIComponent(u)}&limit=100`).then(H=>{m(H.items||[]),f(H.total||0)}).catch(()=>{})},[u]),c.length===0)return i.jsx("div",{className:"rounded-md border border-border/40 bg-card/80 px-4 py-3",children:i.jsx(Fl,{title:"No signal history yet",hint:"Signals are recorded during consensus rounds.",compact:!0})});const h=[...c].reverse(),M={confirmed:0,disputed:0,unique:0,unverified:0};for(const H of c)H.signal==="agreement"||H.signal==="consensus_verified"?M.confirmed++:H.signal==="disagreement"||H.signal==="hallucination_caught"?M.disputed++:H.signal==="unique_confirmed"||H.signal==="unique_unconfirmed"||H.signal==="new_finding"?M.unique++:H.signal==="unverified"&&M.unverified++;const R=c.length,G=o>R;return i.jsxs("div",{className:"rounded-md border border-border/40 bg-card/80 px-4 py-3",children:[i.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-baseline gap-2",children:[i.jsx("span",{className:"font-mono text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:"Signal Timeline"}),i.jsx("span",{className:"font-mono text-[9px] text-muted-foreground/50",children:G?`last ${R} of ${o}`:`${o} total`})]}),i.jsxs("div",{className:"flex items-center gap-3 font-mono text-[10px]",children:[i.jsxs("span",{className:"text-confirmed",children:[M.confirmed," confirmed"]}),M.disputed>0&&i.jsxs("span",{className:"text-disputed",children:[M.disputed," disputed"]}),M.unique>0&&i.jsxs("span",{className:"text-unique",children:[M.unique," unique"]}),M.unverified>0&&i.jsxs("span",{className:"text-unverified",children:[M.unverified," unverified"]})]})]}),i.jsx("div",{className:"flex items-center gap-0.5",children:h.map((H,ne)=>{const le=!!(H.consensusId&&H.findingId);return i.jsx("button",{type:"button",disabled:!le,onClick:()=>{H.consensusId&&H.findingId&&(b({consensusId:H.consensusId,findingId:H.findingId}),_(!0))},className:`h-4 min-w-[4px] max-w-[12px] flex-1 rounded-sm transition-opacity hover:opacity-80 ${jg[H.signal]||"bg-muted"} ${le?"cursor-pointer":"cursor-default"}`,title:`${Ng[H.signal]||H.signal} — ${Xe(H.timestamp)}${le?" (click for detail)":""}`},ne)})}),i.jsx("div",{className:"mt-2 flex flex-wrap gap-3",children:[{color:"bg-confirmed",label:"Confirmed"},{color:"bg-disputed",label:"Disputed"},{color:"bg-unique",label:"Unique (confirmed)"},{color:"bg-unique/50",label:"Unique (unconfirmed)"},{color:"bg-unverified",label:"Unverified"}].map(H=>i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("div",{className:`h-2 w-2 rounded-sm ${H.color}`}),i.jsx("span",{className:"font-mono text-[9px] text-muted-foreground/60",children:H.label})]},H.label))}),i.jsx(xs,{open:x,onOpenChange:_,consensusId:(y==null?void 0:y.consensusId)??null,findingId:(y==null?void 0:y.findingId)??null})]})}function Tg(u){const c=u.toLowerCase();return c==="completed"||c==="done"||c==="success"||c==="succeeded"?"completed":c==="running"||c==="active"||c==="in_progress"||c==="pending"?"running":c==="failed"||c==="error"||c==="errored"||c==="timeout"||c==="timed_out"?"failed":c==="cancelled"||c==="canceled"||c==="queued"||c==="waiting"?"cancelled":"unknown"}const _g={completed:{label:"Done",iconBox:"bg-confirmed/10 border-confirmed/30",text:"text-confirmed",pulse:!1},running:{label:"Running",iconBox:"bg-unverified/10 border-unverified/30",text:"text-unverified",pulse:!0},failed:{label:"Failed",iconBox:"bg-destructive/10 border-destructive/30",text:"text-destructive",pulse:!1},cancelled:{label:"Cancelled",iconBox:"bg-muted-foreground/10 border-muted-foreground/25",text:"text-muted-foreground",pulse:!1},unknown:{label:"Unknown",iconBox:"bg-muted-foreground/10 border-muted-foreground/25",text:"text-muted-foreground",pulse:!1}},Eg={completed:i.jsx("polyline",{points:"5 12 10 17 19 7"}),running:i.jsxs(i.Fragment,{children:[i.jsx("circle",{cx:"12",cy:"12",r:"3",fill:"currentColor",stroke:"none"}),i.jsx("circle",{cx:"12",cy:"12",r:"8",opacity:"0.45"})]}),failed:i.jsxs(i.Fragment,{children:[i.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"}),i.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"})]}),cancelled:i.jsx("line",{x1:"6",y1:"12",x2:"18",y2:"12"}),unknown:i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"M9.5 9a2.5 2.5 0 1 1 3.5 2.3c-.8.4-1 .9-1 1.7"}),i.jsx("line",{x1:"12",y1:"16.5",x2:"12",y2:"16.5"})]})};function Mg(u){if(!u)return"—";if(u<1e3)return"< 1s";if(u<6e4)return Math.floor(u/1e3)+"s";if(u<36e5){const o=Math.floor(u/6e4),f=Math.floor(u%6e4/1e3);return f>0?`${o}m ${f}s`:`${o}m`}const c=Math.floor(u/36e5),m=Math.floor(u%36e5/6e4);return m>0?`${c}h ${m}m`:`${c}h`}function jm({task:u,onClick:c}){const m=Tg(u.status),o=_g[m];return i.jsxs("tr",{className:`border-b border-border hover:bg-accent/30 transition-colors ${c?"cursor-pointer":""}`,onClick:c?f=>{f.target.closest("a")||c(u)}:void 0,children:[i.jsx("td",{className:"py-2.5 pl-4 pr-2",children:i.jsxs("span",{className:"inline-flex items-center gap-2","aria-label":`Status: ${o.label}`,children:[i.jsx("span",{className:`flex h-[22px] w-[22px] shrink-0 items-center justify-center rounded-full border ${o.iconBox} ${o.text} ${o.pulse?"animate-pulse":""}`,"aria-hidden":!0,children:i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:Eg[m]})}),i.jsx("span",{className:`font-mono text-[10px] font-semibold uppercase tracking-wider ${o.text}`,children:o.label})]})}),i.jsx("td",{className:"py-2.5 pr-3",children:i.jsx("span",{className:"rounded border border-amber-500/25 bg-amber-500/8 px-2 py-1 font-mono text-[10px] font-semibold text-amber-400",children:u.taskId.slice(0,8)})}),i.jsx("td",{className:"py-2.5 pr-3 font-mono text-xs text-muted-foreground",children:i.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent(u.agentId)}`,className:"inline-flex items-center gap-1.5 transition hover:text-primary",children:[i.jsx("span",{className:"inline-block h-2 w-2 shrink-0 rounded-full",style:{backgroundColor:Va(u.agentId)}}),u.agentId]})}),i.jsx("td",{className:"py-2.5 pr-3 font-inter text-sm text-foreground/80",children:(()=>{const f=u.task.replace(/\n.*/s,"");return f.length>100?f.slice(0,100)+"…":f})()}),i.jsx("td",{className:"py-2.5 pr-3 font-mono text-xs text-muted-foreground",children:m==="running"?"running":Mg(u.duration)}),i.jsx("td",{className:"py-2.5 pr-4 text-right font-mono text-xs text-muted-foreground",children:Xe(u.timestamp)})]})}const Ag=3,zg=720*60*60*1e3;function Cg({agentId:u,agents:c,tasks:m,consensus:o}){const f=c.find(D=>D.id===u),[x,_]=U.useState([]),[y,b]=U.useState([]),[h,M]=U.useState(null),[R,G]=U.useState(null),[H,ne]=U.useState(null),[le,V]=U.useState(0),[xe,fe]=U.useState(0);U.useEffect(()=>{Je(`memory/${u}`).then(D=>{_(D.knowledge||[])}).catch(()=>_([]))},[u]),U.useEffect(()=>{let D=!1;return Je("consensus-reports?page=1&pageSize=200").then(W=>{D||b(W.reports||[])}).catch(()=>{D||b([])}),()=>{D=!0}},[]);const K=U.useMemo(()=>{var C;const D=Date.now(),W=new Map;for(const X of y){const B=Date.parse(X.timestamp);if(Number.isNaN(B)||D-B>zg)continue;const ee=(C=X.authorDiagnostics)==null?void 0:C[u];if(ee)for(const ue of ee)W.set(ue.code,(W.get(ue.code)??0)+1)}const g=[];for(const[X,B]of W)B>=Ag&&g.push({code:X,count:B});return g},[y,u]);if(!f)return i.jsxs("div",{className:"py-20 text-center text-muted-foreground",children:["Agent not found: ",u]});const Z=f.scores,z=(m==null?void 0:m.items.filter(D=>D.agentId===u))||[],se=(o==null?void 0:o.runs.filter(D=>D.agents.includes(u)))||[],Q=[{label:"accuracy",value:Z.accuracy,fill:Z.accuracy>=.7?"bg-confirmed":Z.accuracy>=.4?"bg-unverified":"bg-disputed"},{label:"reliability",value:Z.reliability,fill:"bg-chart"},{label:"unique",value:Z.uniqueness,fill:"bg-unique"},{label:"impact",value:Z.impactScore,fill:"bg-[var(--color-impact)]"}],J=Z.unverifiedsEmitted??0,ae=Z.unverifiedsReceived??0,oe=J+ae,Ee=[{label:"Signals",value:String(Z.signals),color:"text-foreground"},{label:"Agreements",value:String(Z.agreements),color:"text-confirmed"},{label:"Disagreements",value:String(Z.disagreements),color:"text-disputed"},{label:"Hallucinations",value:String(Z.hallucinations),color:Z.hallucinations>0?"text-disputed":"text-muted-foreground"},{label:"Unverified",value:oe>0?`${J}↑ ${ae}↓`:"0",color:oe>0?"text-unverified":"text-muted-foreground",title:oe>0?`${J} emitted (as reviewer) · ${ae} received (as author)`:void 0},{label:"Tokens",value:f.totalTokens.toLocaleString(),color:"text-foreground"}],k=10,F=Math.max(1,Math.ceil(z.length/k)),re=Math.min(le,F-1),L=z.slice(re*k,(re+1)*k),S=U.useMemo(()=>{const D=new Map;for(const W of x){const g=W.filename.match(/^(\d{4}-\d{2}-\d{2})/),C=g?g[1]:"undated",X=D.get(C)||[];X.push(W),D.set(C,X)}return Array.from(D.entries()).sort(([W],[g])=>W==="undated"?1:g==="undated"?-1:g.localeCompare(W)).map(([W,g])=>({day:W,items:g}))},[x]),Y=Math.min(xe,Math.max(0,S.length-1)),$=S[Y];return i.jsxs(i.Fragment,{children:[(()=>{const D=fs(Z);return D==="benched"?i.jsx("div",{className:"mb-6 rounded-lg border border-destructive/30 bg-destructive/5 px-4 py-3",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-mono text-xs font-bold text-destructive",children:"BENCHED"}),i.jsxs("span",{className:"text-xs text-destructive/70",children:["Auto-bench rule fired (",Z.bench.reason??"unknown","). Agent excluded from dispatch until scores recover."]})]})}):D==="struggling"?i.jsx("div",{className:"mb-6 rounded-lg border border-unverified/30 bg-unverified/5 px-4 py-3",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-mono text-xs font-bold text-unverified",children:"STRUGGLING"}),i.jsxs("span",{className:"text-xs text-unverified/70",children:[Z.consecutiveFailures,"+ consecutive failures. Deprioritized until clean signals recorded."]})]})}):D==="kept-for-coverage"?i.jsx("div",{className:"mb-6 rounded-lg border border-unverified/30 bg-unverified/5 px-4 py-3",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-mono text-xs font-bold text-unverified",children:"KEPT FOR COVERAGE"}),i.jsxs("span",{className:"text-xs text-unverified/70",children:["Would be benched (",Z.bench.reason??"rule","), but is the sole provider of a category — kept to preserve coverage."]})]})}):null})(),K.length>0&&i.jsx("div",{className:"mb-6 space-y-2",children:K.map(({code:D,count:W})=>i.jsxs("div",{className:"rounded-lg border border-unverified/30 bg-unverified/5 px-4 py-3","data-diagnostic-code":D,children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-mono text-xs font-bold text-unverified",children:"PARSE DIAGNOSTIC"}),i.jsx("span",{className:"font-mono text-[11px] text-unverified/80",dangerouslySetInnerHTML:{__html:Qc(D)}}),i.jsxs("span",{className:"font-mono text-[11px] text-unverified/60",children:["· ",W," fires in 30d"]})]}),i.jsxs("div",{className:"mt-1 text-xs text-muted-foreground/80",children:["This agent's raw output has repeatedly tripped ",i.jsx("span",{className:"font-mono",children:D}),". Inspect recent consensus rounds on this page for the per-finding banner, or check upstream pipeline layers (sanitizer / renderer / relay encoding)."]})]},D))}),i.jsx("div",{className:"relative mb-6 rounded-xl border border-border bg-card p-5",children:i.jsxs("div",{className:"flex items-center gap-6",children:[i.jsx("div",{className:"relative shrink-0",children:i.jsx(Kc,{agentId:f.id,size:120,signals:Z.signals,accuracy:Z.accuracy,uniqueness:Z.uniqueness,impact:Z.impactScore})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("h1",{className:"truncate font-mono text-2xl font-bold text-foreground",children:f.id}),i.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[f.provider,"/",f.model]}),i.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[i.jsx("span",{className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold ${f.native?"text-primary bg-primary/10":"text-confirmed bg-confirmed/10"}`,children:f.native?"NATIVE":"RELAY"}),f.preset&&i.jsx("span",{className:"rounded-sm bg-muted px-2 py-0.5 font-mono text-[10px] text-muted-foreground",children:f.preset}),(()=>{const D=fs(Z);return D==="benched"?i.jsx("span",{className:"rounded-sm bg-destructive/10 px-2 py-0.5 font-mono text-[10px] font-bold text-destructive",children:"BENCHED"}):D==="struggling"?i.jsxs("span",{className:"rounded-sm bg-unverified/10 px-2 py-0.5 font-mono text-[10px] font-bold text-unverified",children:["STRUGGLING (",Z.consecutiveFailures," FAILS)"]}):D==="kept-for-coverage"?i.jsx("span",{className:"rounded-sm border border-unverified/40 px-2 py-0.5 font-mono text-[10px] font-bold text-unverified",children:"KEPT FOR COVERAGE"}):Z.consecutiveFailures>0?i.jsxs("span",{className:"rounded-sm bg-unverified/10 px-2 py-0.5 font-mono text-[10px] font-bold text-unverified",children:[Z.consecutiveFailures," CONSECUTIVE FAILS"]}):null})(),i.jsxs("span",{className:"font-mono text-[10px] text-muted-foreground/60",children:[Z.signals," signals",f.lastTask?` · ${Xe(f.lastTask.timestamp)}`:""]})]})]}),i.jsxs("div",{className:"flex shrink-0 flex-col items-end rounded-md border border-border bg-background/60 px-3 py-2","data-tooltip":`Dispatch weight ${Z.dispatchWeight.toFixed(2)}
68
68
  Scale 0.3 → 2.0`,"data-tooltip-pos":"left",children:[i.jsx("span",{className:"font-mono text-2xl font-bold tabular-nums leading-none text-foreground",children:Z.dispatchWeight.toFixed(2)}),i.jsx("span",{className:"mt-1 font-mono text-[9px] uppercase text-muted-foreground/50",children:"weight"})]})]})}),i.jsx("section",{className:"mb-6",children:i.jsx(Sg,{agentId:u})}),i.jsxs("section",{className:"mb-8 grid grid-cols-1 gap-6 lg:grid-cols-2",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"mb-3 font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:"Metrics"}),i.jsxs("div",{className:"rounded-lg border border-border/40 bg-card/80 p-4 shadow-[inset_0_1px_3px_rgba(0,0,0,0.35)]",children:[i.jsx("div",{className:"space-y-2.5",children:Q.map(D=>i.jsxs("div",{className:"grid grid-cols-[72px_1fr_44px] items-center gap-3",children:[i.jsx("span",{className:"font-mono text-[10px] uppercase tracking-wider text-muted-foreground",children:D.label}),i.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-background/80",children:i.jsx("div",{className:`h-full rounded-full transition-all ${D.fill}`,style:{width:`${Math.max(0,Math.min(100,D.value*100))}%`}})}),i.jsxs("span",{className:"text-right font-mono text-[11px] font-bold tabular-nums text-foreground",children:[Math.round(D.value*100),"%"]})]},D.label))}),i.jsx("div",{className:"mt-4 grid grid-cols-6 gap-px overflow-hidden rounded-md border border-border/30 bg-border/30",children:Ee.map(D=>i.jsxs("div",{className:"bg-background/60 px-2 py-2 text-center",title:D.title,children:[i.jsx("div",{className:`font-mono text-sm font-bold tabular-nums ${D.color}`,children:D.value}),i.jsx("div",{className:"mt-0.5 font-mono text-[9px] uppercase tracking-wider text-muted-foreground/70",children:D.label})]},D.label))})]})]}),i.jsxs("div",{children:[i.jsx("h2",{className:"mb-3 font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:"Category Competency"}),i.jsx(cg,{categoryAccuracy:Z.categoryAccuracy,categoryCorrect:Z.categoryCorrect,categoryHallucinated:Z.categoryHallucinated})]})]}),(f.skillSlots.length>0||f.skills.length>0)&&i.jsxs("section",{className:"mb-8",children:[i.jsxs("h2",{className:"mb-3 font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Skills ",i.jsx("span",{className:"text-primary",children:f.skillSlots.length||f.skills.length})]}),f.skillSlots.length>0?i.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3",children:f.skillSlots.map(D=>i.jsx(dg,{slot:D},D.name))}):i.jsx("div",{className:"flex flex-wrap gap-1.5",children:f.skills.map(D=>i.jsx("span",{className:"rounded-sm border border-border bg-card px-2.5 py-1 font-mono text-xs text-muted-foreground",children:D},D))})]}),i.jsxs("section",{className:"mb-8",children:[i.jsxs("h2",{className:"mb-3 font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Consensus Runs ",i.jsx("span",{className:"text-primary",children:se.length})]}),se.length>0?i.jsx("div",{className:"space-y-2",children:se.slice(0,20).map((D,W)=>{const g=D.counts,C=(g.agreement||0)+(g.disagreement||0)+(g.hallucination||0)+(g.unverified||0)+(g.unique||0)+(g.new||0),X=C||1,B=[{key:"confirmed",count:g.agreement||0,color:"bg-confirmed",text:"text-confirmed"},{key:"disputed",count:(g.disagreement||0)+(g.hallucination||0),color:"bg-disputed",text:"text-disputed"},{key:"unverified",count:g.unverified||0,color:"bg-unverified",text:"text-unverified"},{key:"unique",count:(g.unique||0)+(g.new||0),color:"bg-unique",text:"text-unique"}],ee={agreement:{label:"CONFIRMED",cls:"text-confirmed bg-confirmed/10"},consensus_verified:{label:"CONFIRMED",cls:"text-confirmed bg-confirmed/10"},disagreement:{label:"DISPUTED",cls:"text-disputed bg-disputed/10"},hallucination_caught:{label:"DISPUTED",cls:"text-disputed bg-disputed/10"},unverified:{label:"UNVERIFIED",cls:"text-unverified bg-unverified/10"},unique_confirmed:{label:"UNIQUE",cls:"text-unique bg-unique/10"},unique_unconfirmed:{label:"UNIQUE",cls:"text-unique bg-unique/10"},new_finding:{label:"NEW",cls:"text-unique bg-unique/10"}},ue=D.signals.filter(de=>de.signal!=="signal_retracted"&&ee[de.signal]),pe=D.taskId+":"+W,ke=R===pe;return i.jsxs("div",{className:"rounded-md border border-border/40 bg-card",children:[i.jsx("button",{type:"button",onClick:()=>G(ke?null:pe),disabled:ue.length===0,className:`flex w-full items-center p-3 text-left transition ${ue.length>0?"hover:bg-accent/20":"cursor-default"}`,children:i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("span",{className:"font-mono text-sm font-semibold text-foreground",children:[ue.length>0&&i.jsx("span",{className:"mr-1.5 inline-block text-muted-foreground",children:ke?"▾":"▸"}),C," findings"]}),i.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:Xe(D.timestamp)})]}),i.jsx("div",{className:"mt-1.5 flex gap-2",children:B.map(de=>de.count>0&&i.jsxs("span",{className:`font-mono text-[10px] font-semibold ${de.text}`,children:[de.count," ",de.key]},de.key))}),i.jsx("div",{className:"mt-1.5 flex h-1.5 overflow-hidden rounded-sm",children:B.map(de=>de.count>0&&i.jsx("div",{className:de.color,style:{width:`${de.count/X*100}%`}},de.key))})]})}),ke&&ue.length>0&&i.jsx("div",{className:"border-t border-border/30 px-3 pb-2 pt-2",children:i.jsx("div",{className:"space-y-1",children:ue.map((de,Yt)=>{const Vt=ee[de.signal],Bn=!!(de.findingId&&D.taskId),Yn=i.jsxs("div",{className:"flex items-start gap-2 py-1",children:[i.jsx("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold ${Vt.cls}`,children:Vt.label}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"text-xs text-muted-foreground [&_.cite-file]:rounded [&_.cite-file]:bg-blue-500/10 [&_.cite-file]:px-1 [&_.cite-file]:font-mono [&_.cite-file]:text-blue-400 [&_.cite-fn]:rounded [&_.cite-fn]:bg-purple-500/10 [&_.cite-fn]:px-1 [&_.cite-fn]:font-mono [&_.cite-fn]:text-purple-400",dangerouslySetInnerHTML:{__html:ms(de.evidence||"")}}),i.jsxs("span",{className:"ml-2 font-mono text-[10px] text-muted-foreground/50",children:[de.agentId,de.counterpartId?` + ${de.counterpartId}`:""]})]})]});return Bn?i.jsx("button",{type:"button",onClick:()=>ne({consensusId:D.taskId,findingId:de.findingId}),className:"block w-full rounded-sm text-left transition hover:bg-accent/40",children:Yn},Yt):i.jsx("div",{children:Yn},Yt)})})})]},pe)})}):i.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No consensus participation recorded."})]}),i.jsx("section",{className:"mb-8",children:i.jsx(yg,{agentId:u})}),i.jsx(xs,{open:!!H,onOpenChange:D=>{D||ne(null)},consensusId:(H==null?void 0:H.consensusId)??null,findingId:(H==null?void 0:H.findingId)??null}),i.jsxs("section",{className:"mb-8",children:[i.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[i.jsxs("h2",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Tasks ",i.jsx("span",{className:"text-primary",children:z.length})]}),F>1&&i.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[i.jsx("button",{onClick:()=>V(D=>Math.max(0,D-1)),disabled:re===0,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"◂ Prev"}),i.jsxs("span",{children:[re+1," / ",F]}),i.jsx("button",{onClick:()=>V(D=>Math.min(F-1,D+1)),disabled:re>=F-1,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"Next ▸"})]})]}),z.length>0?i.jsx("div",{className:"overflow-hidden rounded-md border border-border/40",children:i.jsxs("table",{className:"w-full text-left",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"border-b border-border bg-card",children:[i.jsx("th",{className:"py-2 pl-4 pr-2 text-xs font-medium text-muted-foreground",style:{width:32}}),i.jsx("th",{className:"py-2 pr-3 font-mono text-xs font-medium text-muted-foreground",children:"ID"}),i.jsx("th",{className:"py-2 pr-3 font-mono text-xs font-medium text-muted-foreground",children:"Agent"}),i.jsx("th",{className:"py-2 pr-3 text-xs font-medium text-muted-foreground",children:"Description"}),i.jsx("th",{className:"py-2 pr-3 font-mono text-xs font-medium text-muted-foreground",children:"Duration"}),i.jsx("th",{className:"py-2 pr-4 text-right font-mono text-xs font-medium text-muted-foreground",children:"When"})]})}),i.jsx("tbody",{children:L.map(D=>i.jsx(jm,{task:D},D.taskId))})]})}):i.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No tasks recorded."})]}),i.jsxs("section",{className:"mb-8",children:[i.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[i.jsxs("h2",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Memory ",i.jsxs("span",{className:"text-primary",children:[x.length," files"]}),$&&i.jsxs("span",{className:"ml-2 font-mono text-[10px] text-muted-foreground",children:["· ",$.day," (",$.items.length,")"]})]}),S.length>1&&i.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[i.jsx("button",{onClick:()=>fe(D=>Math.max(0,D-1)),disabled:Y===0,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"◂ Newer"}),i.jsxs("span",{children:[Y+1," / ",S.length]}),i.jsx("button",{onClick:()=>fe(D=>Math.min(S.length-1,D+1)),disabled:Y>=S.length-1,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"Older ▸"})]})]}),$&&$.items.length>0?i.jsx("div",{className:"space-y-1.5",children:$.items.map(D=>{var X,B;const W=h===D.filename,g=((X=D.frontmatter)==null?void 0:X.type)||"memory",C=((B=D.frontmatter)==null?void 0:B.name)||D.filename.replace(/\.md$/,"");return i.jsxs("div",{className:"rounded-md border border-border/40 bg-card/80",children:[i.jsxs("button",{onClick:()=>M(W?null:D.filename),className:"flex w-full items-center gap-2 p-3 text-left transition hover:bg-accent/50",children:[i.jsx("span",{className:`font-mono text-xs ${W?"text-primary":"text-muted-foreground"}`,children:W?"▾":"▸"}),i.jsx("span",{className:"shrink-0 rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase text-muted-foreground",children:g}),i.jsx("span",{className:"truncate font-mono text-xs font-semibold text-foreground",children:C}),i.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px] text-muted-foreground",children:D.filename})]}),W&&i.jsx("div",{className:"border-t border-border px-4 py-3",children:i.jsx("pre",{className:"whitespace-pre-wrap font-mono text-xs leading-relaxed text-muted-foreground",children:D.content})})]},D.filename)})}):i.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No memory files."})]})]})}const om={dispatch:"text-muted-foreground/80",consensus:"text-primary/70",error:"text-disputed",timeout:"text-unverified",worker:"text-muted-foreground/70",gemini:"text-muted-foreground/70",skill:"text-muted-foreground/80",boot:"text-muted-foreground/50",relay:"text-muted-foreground/80",gossip:"text-muted-foreground/80",utility:"text-muted-foreground/60",memory:"text-muted-foreground/80",persist:"text-muted-foreground/50",toolserver:"text-muted-foreground/50",other:"text-muted-foreground/70"},Dg=[[/^\[gossipcat\]\s*\[worker:/,"worker"],[/^\[gossipcat\]\s*\[Gemini\]/,"gemini"],[/^\[gossipcat\]\s*\[ToolServer\]/,"toolserver"],[/^\[gossipcat\]\s*dispatch\b/,"dispatch"],[/^\[gossipcat\]\s*relay\b/,"relay"],[/^\[gossipcat\]\s*Cross-review\b/,"consensus"],[/^\[gossipcat\]\s*Consensus\b/,"consensus"],[/^\[gossipcat\]\s*Skill\b/,"skill"],[/^\[gossipcat\]\s*Bootstrap\b/,"boot"],[/^\[gossipcat\]\s*Booted:/,"boot"],[/^\[gossipcat\]\s*Dashboard:/,"boot"],[/^\[gossipcat\]\s*Adaptive\b/,"boot"],[/^\[gossipcat\]\s*Gossip\b/,"gossip"],[/^\[gossipcat\]\s*utility\b/,"utility"],[/^\[gossipcat\]\s*Compacted\b/,"memory"],[/native agent/,"boot"],[/persist|Persist/,"persist"],[/timeout|Timeout|timed.out/,"timeout"],[/^\[gossipcat\].*(?:Error|error|failed|Failed)/,"error"]];function Og(u){for(const[c,m]of Dg)if(c.test(u))return m;return"other"}const Rg=[{key:"all",label:"All"},{key:"dispatch",label:"Dispatch"},{key:"consensus",label:"Consensus"},{key:"error",label:"Errors"},{key:"timeout",label:"Timeouts"},{key:"worker",label:"Workers"},{key:"skill",label:"Skills"},{key:"relay",label:"Relay"},{key:"boot",label:"Boot"}],dm=1e3;function wg(){const[u,c]=U.useState([]),[m,o]=U.useState(0),[f,x]=U.useState(0),[_,y]=U.useState("all"),[b,h]=U.useState(!0),[M,R]=U.useState(!0),G=U.useRef(null),H=U.useRef(0);U.useEffect(()=>{let V=!1;return(async()=>{try{const fe=await Je("logs?tail=500");if(V)return;c(fe.entries),o(fe.totalLines),x(fe.fileSize),H.current=fe.totalLines+1}catch{}})(),()=>{V=!0}},[]),U.useEffect(()=>{if(M)return hm(V=>{var fe;if(V.type!=="log_lines")return;const xe=(fe=V.data)==null?void 0:fe.lines;xe!=null&&xe.length&&c(K=>{const Z=xe.map((se,Q)=>({line:H.current+Q,text:se,category:Og(se)}));H.current+=xe.length,o(se=>se+xe.length);const z=[...K,...Z];return z.length>dm?z.slice(-dm):z})})},[M]),U.useEffect(()=>{b&&G.current&&G.current.scrollIntoView({behavior:"smooth"})},[u,b]);const ne=_==="all"?u:u.filter(V=>V.category===_),le=U.useCallback(V=>V<1024?`${V} B`:V<1048576?`${(V/1024).toFixed(1)} KB`:`${(V/1048576).toFixed(1)} MB`,[]);return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[i.jsxs("h2",{className:"font-mono text-xs font-bold uppercase tracking-widest text-foreground",children:["MCP Log ",i.jsxs("span",{className:"text-primary",children:[m," lines"]})]}),i.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/50",children:le(f)}),M&&i.jsxs("span",{className:"flex items-center gap-1 font-mono text-[10px] text-confirmed",children:[i.jsx("span",{className:"inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-confirmed"}),"live"]})]}),i.jsxs("div",{className:"mb-3 flex items-center gap-1.5",children:[Rg.map(V=>i.jsx("button",{onClick:()=>y(V.key),className:`rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition ${_===V.key?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:V.label},V.key)),i.jsxs("div",{className:"ml-auto flex gap-1.5",children:[i.jsx("button",{onClick:()=>R(!M),className:`rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition ${M?"bg-confirmed/10 text-confirmed":"text-muted-foreground"}`,children:M?"● Live":"○ Paused"}),i.jsx("button",{onClick:()=>h(!b),className:`rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition ${b?"bg-primary/10 text-primary":"text-muted-foreground"}`,children:b?"⤓ Auto":"⤓ Scroll"})]})]}),i.jsx("div",{className:"overflow-hidden rounded-md border border-border bg-card",children:i.jsxs("div",{className:"max-h-[70vh] overflow-y-auto p-3 font-mono text-xs leading-relaxed",children:[ne.map(V=>i.jsxs("div",{className:"flex gap-2 hover:bg-muted/30",children:[i.jsx("span",{className:"w-10 shrink-0 select-none text-right text-muted-foreground/30",children:V.line}),i.jsx("span",{className:om[V.category]||om.other,children:V.text})]},V.line)),ne.length===0&&i.jsx("div",{className:"py-8 text-center text-sm text-muted-foreground",children:u.length===0?"Loading...":"No matching log entries."}),i.jsx("div",{ref:G})]})})]})}const Ug=["critical","high","medium","low"],qg=["manual","impl","meta","auto-provisional"];function fm(u,c){return u.includes(c)?u.filter(m=>m!==c):[...u,c]}const Zt="mb-1 block font-mono text-[9px] font-semibold uppercase tracking-widest text-muted-foreground/70",kn="w-full rounded border border-border bg-background px-2 py-1 font-mono text-[10px] text-foreground focus:border-primary focus:outline-none";function Hg({filters:u,onChange:c,agents:m,signalTypes:o}){const f=x=>_=>{const y=_.target.value;c({[x]:y===""?void 0:y})};return i.jsxs("aside",{className:"space-y-3 rounded-md border border-border/60 bg-card/70 p-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h2",{className:"font-mono text-[11px] font-semibold uppercase tracking-widest text-primary",children:"Filters"}),i.jsx("button",{type:"button",className:"font-mono text-[9px] text-muted-foreground/70 hover:text-foreground",onClick:()=>c({agents:[],counterpart:void 0,signals:[],category:void 0,severity:void 0,since:void 0,until:void 0,consensusId:void 0,findingId:void 0,source:void 0}),children:"clear"})]}),i.jsxs("div",{children:[i.jsxs("label",{className:Zt,children:["Agents (",u.agents.length," selected)"]}),i.jsxs("div",{className:"max-h-32 overflow-y-auto rounded border border-border/60 bg-background p-1",children:[m.length===0&&i.jsx("div",{className:"px-1 py-0.5 font-mono text-[10px] text-muted-foreground/50",children:"no agents"}),m.map(x=>i.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 px-1 py-0.5 font-mono text-[10px] text-foreground hover:bg-muted/40",children:[i.jsx("input",{type:"checkbox",className:"h-3 w-3",checked:u.agents.includes(x),onChange:()=>c({agents:fm(u.agents,x)})}),i.jsx("span",{children:x})]},x))]})]}),i.jsxs("div",{children:[i.jsx("label",{className:Zt,children:"Counterpart"}),i.jsxs("select",{className:kn,value:u.counterpart??"",onChange:f("counterpart"),children:[i.jsx("option",{value:"",children:"any"}),m.map(x=>i.jsx("option",{value:x,children:x},x))]})]}),i.jsxs("div",{children:[i.jsxs("label",{className:Zt,children:["Signal types (",u.signals.length,")"]}),i.jsxs("div",{className:"max-h-32 overflow-y-auto rounded border border-border/60 bg-background p-1",children:[o.length===0&&i.jsx("div",{className:"px-1 py-0.5 font-mono text-[10px] text-muted-foreground/50",children:"no signals"}),o.map(x=>i.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 px-1 py-0.5 font-mono text-[10px] text-foreground hover:bg-muted/40",children:[i.jsx("input",{type:"checkbox",className:"h-3 w-3",checked:u.signals.includes(x),onChange:()=>c({signals:fm(u.signals,x)})}),i.jsx("span",{children:x})]},x))]})]}),i.jsxs("div",{children:[i.jsx("label",{className:Zt,children:"Severity"}),i.jsxs("select",{className:kn,value:u.severity??"",onChange:f("severity"),children:[i.jsx("option",{value:"",children:"any"}),Ug.map(x=>i.jsx("option",{value:x,children:x},x))]})]}),i.jsxs("div",{children:[i.jsx("label",{className:Zt,children:"Source"}),i.jsxs("select",{className:kn,value:u.source??"",onChange:f("source"),children:[i.jsx("option",{value:"",children:"any"}),qg.map(x=>i.jsx("option",{value:x,children:x},x))]})]}),i.jsxs("div",{children:[i.jsx("label",{className:Zt,children:"Category"}),i.jsx("input",{type:"text",className:kn,value:u.category??"",onChange:f("category"),placeholder:"e.g. trust_boundaries"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsxs("div",{children:[i.jsx("label",{className:Zt,children:"Since"}),i.jsx("input",{type:"datetime-local",className:kn,value:u.since?u.since.slice(0,16):"",onChange:x=>c({since:x.target.value?new Date(x.target.value).toISOString():void 0})})]}),i.jsxs("div",{children:[i.jsx("label",{className:Zt,children:"Until"}),i.jsx("input",{type:"datetime-local",className:kn,value:u.until?u.until.slice(0,16):"",onChange:x=>c({until:x.target.value?new Date(x.target.value).toISOString():void 0})})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:Zt,children:"Consensus ID (prefix)"}),i.jsx("input",{type:"text",className:kn,value:u.consensusId??"",onChange:f("consensusId"),placeholder:"e.g. d07eac46"})]}),i.jsxs("div",{children:[i.jsx("label",{className:Zt,children:"Finding ID (prefix)"}),i.jsx("input",{type:"text",className:kn,value:u.findingId??"",onChange:f("findingId"),placeholder:"e.g. d07eac46-5f464e89:sonnet"})]})]})}const kg={agents:[],signals:[]},Bg=["agreement","consensus_verified","unique_confirmed","unique_unconfirmed","disagreement","hallucination_caught","new_finding","unverified","impl_test_pass","impl_test_fail","impl_typecheck_pass","impl_typecheck_fail","task_completed","tool_turns","format_compliance"],Yg={critical:"text-red-400 bg-red-500/10",high:"text-orange-400 bg-orange-500/10",medium:"text-yellow-400 bg-yellow-500/10",low:"text-muted-foreground bg-muted/50"},Za=100;function Gg(u,c,m=Za){const o=new URLSearchParams;o.set("limit",String(m)),o.set("offset",String(c)),u.agents.length===1&&o.set("agent",u.agents[0]),u.counterpart&&o.set("counterpart",u.counterpart);for(const f of u.signals)o.append("signal",f);return u.category&&o.set("category",u.category),u.severity&&o.set("severity",u.severity),u.since&&o.set("since",u.since),u.until&&o.set("until",u.until),u.consensusId&&o.set("consensus_id",u.consensusId),u.findingId&&o.set("finding_id",u.findingId),u.source&&o.set("source",u.source),o}function Bc(u,c){return u?u.length>c?u.slice(0,c)+"…":u:""}function Lg(){const[u,c]=U.useState(kg),[m,o]=U.useState([]),[f,x]=U.useState(0),[_,y]=U.useState(0),[b,h]=U.useState(!1),[M,R]=U.useState(null),[G,H]=U.useState([]),[ne,le]=U.useState(!1),[V,xe]=U.useState(null),[fe,K]=U.useState(null),Z=U.useRef(null),z=U.useRef(0),se=U.useCallback(async(k,F)=>{const re=++z.current;h(!0),R(null);try{const L=Gg(k,F*Za),S=await Je(`signals?${L.toString()}`);if(re!==z.current)return;o(S.items??[]),y(S.total??0)}catch(L){if(re!==z.current)return;R(L instanceof Error?L.message:"fetch failed")}finally{re===z.current&&h(!1)}},[]);U.useEffect(()=>{Je("agents").then(k=>{const F=(k??[]).map(re=>re.id).filter(Boolean).sort();F.length>0&&H(F)}).catch(()=>{})},[]),U.useEffect(()=>{x(0)},[u]),U.useEffect(()=>(Z.current&&clearTimeout(Z.current),Z.current=setTimeout(()=>{se(u,f)},250),()=>{Z.current&&clearTimeout(Z.current)}),[u,f,se]);const Q=U.useCallback(k=>{c(F=>({...F,...k}))},[]),J=Math.max(1,Math.ceil(_/Za)),ae=Math.min(f,J-1),oe=(k,F)=>{!k||!F||(xe(k),K(F),le(!0))},Ee=U.useMemo(()=>{const k=[];return u.agents.length&&k.push(`${u.agents.length} agents`),u.signals.length&&k.push(`${u.signals.length} signals`),u.severity&&k.push(u.severity),u.source&&k.push(u.source),(u.since||u.until)&&k.push("time window"),k.length?k.join(" · "):"all signals"},[u]);return i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"flex items-baseline justify-between",children:i.jsxs("div",{children:[i.jsx("h1",{className:"font-mono text-sm font-bold uppercase tracking-widest text-primary",children:"Signals"}),i.jsxs("p",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/70",children:[Ee," — showing ",m.length," of ",_]})]})}),i.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-[260px_1fr] lg:items-start",children:[i.jsx(Hg,{filters:u,onChange:Q,agents:G,signalTypes:Bg}),i.jsxs("section",{className:"min-w-0 overflow-hidden rounded-md border border-border/60 bg-card/70",children:[M&&i.jsx("div",{className:"border-b border-border/60 bg-disputed/10 px-3 py-2 font-mono text-[10px] text-disputed",children:M}),i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"w-full border-collapse font-mono text-[10px]",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"border-b border-border/60 text-left text-muted-foreground/70",children:[i.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest",children:"Time"}),i.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest",children:"Agent"}),i.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest",children:"Signal"}),i.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest",children:"Counterpart"}),i.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest",children:"Sev"}),i.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest",children:"Finding"}),i.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest",children:"Consensus"}),i.jsx("th",{className:"px-2 py-1.5 font-semibold uppercase tracking-widest",children:"Evidence"})]})}),i.jsxs("tbody",{children:[m.length===0&&!b&&i.jsx("tr",{children:i.jsx("td",{colSpan:8,className:"px-2 py-8 text-center text-muted-foreground/50",children:"no signals match these filters"})}),m.map((k,F)=>{const re=!!(k.consensusId&&k.findingId);return i.jsxs("tr",{className:`border-b border-border/30 ${re?"cursor-pointer hover:bg-muted/30":""}`,onClick:()=>re&&oe(k.consensusId,k.findingId),children:[i.jsx("td",{className:"whitespace-nowrap px-2 py-1 text-muted-foreground/80",title:k.timestamp,children:Xe(k.timestamp)}),i.jsx("td",{className:"whitespace-nowrap px-2 py-1 text-foreground",children:k.agentId}),i.jsx("td",{className:"whitespace-nowrap px-2 py-1 text-foreground",children:k.signal}),i.jsx("td",{className:"whitespace-nowrap px-2 py-1 text-muted-foreground/80",children:k.counterpartId??"—"}),i.jsx("td",{className:"whitespace-nowrap px-2 py-1",children:k.severity?i.jsx("span",{className:`rounded px-1 py-0.5 text-[9px] uppercase ${Yg[k.severity]??"bg-muted"}`,children:k.severity}):i.jsx("span",{className:"text-muted-foreground/40",children:"—"})}),i.jsx("td",{className:"whitespace-nowrap px-2 py-1 text-muted-foreground/70",title:k.findingId,children:k.findingId?Bc(k.findingId,24):"—"}),i.jsx("td",{className:"whitespace-nowrap px-2 py-1 text-muted-foreground/70",title:k.consensusId,children:k.consensusId?Bc(k.consensusId,16):"—"}),i.jsx("td",{className:"max-w-[300px] truncate px-2 py-1 text-muted-foreground/80",title:k.evidence,children:Bc(k.evidence,80)})]},`${k.timestamp}-${k.agentId}-${F}`)})]})]})}),i.jsxs("div",{className:"flex items-center justify-between border-t border-border/60 px-3 py-2",children:[i.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/60",children:b?"loading…":`${ae*Za+1}–${ae*Za+m.length} of ${_}`}),i.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[i.jsx("button",{type:"button",onClick:()=>x(k=>Math.max(0,k-1)),disabled:ae===0||b,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"◂ Prev"}),i.jsxs("span",{className:"tabular-nums",children:[ae+1," / ",J]}),i.jsx("button",{type:"button",onClick:()=>x(k=>Math.min(J-1,k+1)),disabled:ae>=J-1||b,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"Next ▸"})]})]})]})]}),i.jsx(xs,{open:ne,onOpenChange:le,consensusId:V,findingId:fe})]})}function Xg(){const[u,c]=U.useState(null),[m,o]=U.useState(!1);U.useEffect(()=>{o0().then(c)},[]);const f=U.useCallback(async x=>{o(!1),await r0(x)?c(!0):o(!0)},[]);return{authed:u,login:f,error:m}}function Qg(u){U.useEffect(()=>(xm(),hm(u)),[u])}const Zg=5e3;function Vg(){const[u,c]=U.useState({overview:null,agents:null,tasks:null,consensus:null,consensusReports:null,nativeMemories:null,gossipMemories:null,memories:null,loading:!0,error:null}),m=U.useRef(!1),o=U.useCallback(async()=>{if(!m.current){m.current=!0;try{const[f,x,_,y,b,h,M]=await Promise.all([Je("overview"),Je("agents"),Je("tasks?limit=2000"),Je("consensus?pageSize=500"),Je("consensus-reports?page=1&pageSize=5").catch(()=>({reports:[]})),Je("native-memory").catch(()=>({knowledge:[]})),Je("gossip-memory").catch(()=>({knowledge:[]}))]),R=[...h.knowledge||[]].map(H=>({...H,origin:"native"})).sort((H,ne)=>ne.filename>H.filename?1:-1),G=[...M.knowledge||[]].map(H=>({...H,origin:"gossip"})).sort((H,ne)=>ne.filename>H.filename?1:-1);c({overview:f,agents:x,tasks:_,consensus:y,consensusReports:b,nativeMemories:R,gossipMemories:G,memories:R,loading:!1,error:null})}catch(f){c(x=>({...x,loading:!1,error:f.message}))}finally{m.current=!1}}},[]);return U.useEffect(()=>{o()},[o]),U.useEffect(()=>{const f=setInterval(()=>{o()},Zg);return()=>clearInterval(f)},[o]),{...u,refresh:o}}function Kg({agents:u,tasks:c}){const[m,o]=U.useState("weight"),[f,x]=U.useState("desc"),[_,y]=U.useState(""),b=U.useMemo(()=>{const K=new Map;if(c)for(const Z of c.items){const z=K.get(Z.agentId);(!z||Z.timestamp>z.timestamp)&&K.set(Z.agentId,Z)}return K},[c]),h=u.filter(pm).length,M=u.filter(K=>K.scores.accuracy>=.5).length,R=u.reduce((K,Z)=>K+Z.scores.signals,0),G=u.reduce((K,Z)=>K+Z.totalTokens,0),H=_.trim().toLowerCase(),ne=H?u.filter(K=>K.id.toLowerCase().includes(H)||K.provider.toLowerCase().includes(H)||K.model.toLowerCase().includes(H)):u,le=K=>{const Z=K.scores;switch(m){case"weight":return Z.dispatchWeight;case"accuracy":return Z.accuracy;case"uniqueness":return Z.uniqueness;case"impact":return Z.impactScore;case"signals":return Z.signals;case"agreements":return Z.agreements;case"hallucinations":return Z.hallucinations;case"lastTask":{const z=b.get(K.id);return z?new Date(z.timestamp).getTime():0}}},V=[...ne].sort((K,Z)=>{const z=le(K),se=le(Z);return f==="desc"?se-z:z-se}),xe=K=>{m===K?x(Z=>Z==="desc"?"asc":"desc"):(o(K),x("desc"))},fe=K=>m===K?f==="desc"?"▾":"▴":"";return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"mb-6",children:[i.jsxs("h1",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Team ",i.jsx("span",{className:"ml-2 text-primary",children:u.length})]}),i.jsx("div",{className:"mt-2 grid grid-cols-2 gap-px overflow-hidden rounded-md border border-border/40 bg-border/30 sm:grid-cols-4",children:[{label:"Healthy",value:M,color:"text-confirmed"},{label:"Benched",value:h,color:h>0?"text-destructive":"text-muted-foreground"},{label:"Total Signals",value:R.toLocaleString(),color:"text-foreground"},{label:"Tokens Used",value:G.toLocaleString(),color:"text-foreground"}].map(K=>i.jsxs("div",{className:"bg-card/80 px-4 py-3",children:[i.jsx("div",{className:`font-mono text-lg font-bold tabular-nums ${K.color}`,children:K.value}),i.jsx("div",{className:"mt-0.5 font-mono text-[10px] uppercase tracking-wider text-muted-foreground/70",children:K.label})]},K.label))})]}),i.jsx("div",{className:"mb-3",children:i.jsx("input",{type:"text",value:_,onChange:K=>y(K.target.value),placeholder:"Search agents by id, provider, or model...",className:"w-full max-w-md rounded-md border border-border/40 bg-card/80 px-3 py-1.5 font-mono text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-primary/40 focus:outline-none"})}),i.jsx("div",{className:"overflow-hidden rounded-md border border-border/40 bg-card/80",children:i.jsxs("table",{className:"w-full text-left",children:[i.jsxs("colgroup",{children:[i.jsx("col",{style:{width:44}}),i.jsx("col",{}),i.jsx("col",{style:{width:80}}),i.jsx("col",{style:{width:260}}),i.jsx("col",{style:{width:80}}),i.jsx("col",{style:{width:60}}),i.jsx("col",{})]}),i.jsx("thead",{children:i.jsxs("tr",{className:"border-b border-border/40 bg-muted/20 font-mono text-[10px] uppercase tracking-wider text-muted-foreground/80",children:[i.jsx("th",{className:"py-2.5 pl-5 pr-2 text-center",children:"#"}),i.jsx("th",{className:"py-2.5 pr-3 text-left",children:"Agent"}),i.jsxs("th",{className:"py-2.5 pr-4 text-right cursor-pointer select-none hover:text-foreground",onClick:()=>xe("weight"),children:["Weight ",fe("weight")]}),i.jsx("th",{className:"py-2.5 pr-4 text-left align-top",children:i.jsxs("div",{className:"flex items-center gap-2 text-[10px]",children:[i.jsxs("button",{onClick:()=>xe("accuracy"),className:"flex items-center gap-1 hover:text-foreground",children:[i.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-confirmed"}),"Acc",fe("accuracy")]}),i.jsx("span",{className:"text-muted-foreground/30",children:"·"}),i.jsxs("button",{onClick:()=>xe("uniqueness"),className:"flex items-center gap-1 hover:text-foreground",children:[i.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-unique"}),"Unq",fe("uniqueness")]}),i.jsx("span",{className:"text-muted-foreground/30",children:"·"}),i.jsxs("button",{onClick:()=>xe("impact"),className:"flex items-center gap-1 hover:text-foreground",children:[i.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-[var(--color-impact)]"}),"Imp",fe("impact")]})]})}),i.jsxs("th",{className:"py-2.5 pr-4 text-right cursor-pointer select-none hover:text-foreground",onClick:()=>xe("signals"),children:["Signals ",fe("signals")]}),i.jsxs("th",{className:"py-2.5 pr-4 text-right cursor-pointer select-none hover:text-foreground",onClick:()=>xe("hallucinations"),"data-tooltip":"Hallucinations — fabricated findings caught by cross-review",children:["Halluc ",fe("hallucinations")]}),i.jsxs("th",{className:"py-2.5 pr-5 text-left cursor-pointer select-none hover:text-foreground",onClick:()=>xe("lastTask"),children:["Last Task ",fe("lastTask")]})]})}),i.jsx("tbody",{children:V.map((K,Z)=>{const z=K.scores,se=b.get(K.id),Q=z.dispatchWeight>=1.2?"text-confirmed":z.dispatchWeight>=.8?"text-foreground":"text-disputed",J=f==="desc"&&(m==="weight"||m==="accuracy"||m==="impact")?Z+1:null;return i.jsxs("tr",{className:"group border-t border-border/20 align-top transition-colors hover:bg-accent/20",children:[i.jsx("td",{className:"py-3 pl-5 pr-2 text-center align-top",children:i.jsx("span",{className:`font-mono text-[11px] tabular-nums ${J===1?"font-bold text-primary":J===2||J===3?"font-semibold text-foreground/80":"text-muted-foreground/40"}`,children:J??"·"})}),i.jsx("td",{className:"py-2.5 pr-3 align-top",children:i.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent(K.id)}`,className:"flex items-center gap-3",children:[i.jsx(Kc,{agentId:K.id,size:32,signals:z.signals,accuracy:z.accuracy,uniqueness:z.uniqueness,impact:z.impactScore}),i.jsxs("div",{className:"min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"truncate font-mono text-xs font-semibold text-foreground group-hover:text-primary",children:K.id}),(()=>{const ae=fs(z);return ae==="benched"?i.jsx("span",{className:"shrink-0 rounded bg-destructive/15 px-1 font-mono text-[8px] font-bold uppercase tracking-wider text-destructive","data-tooltip":`Benched (${z.bench.reason??"auto"}). Excluded from dispatch until recovery.`,children:"benched"}):ae==="struggling"?i.jsx("span",{className:"shrink-0 rounded bg-unverified/15 px-1 font-mono text-[8px] font-bold uppercase tracking-wider text-unverified","data-tooltip":"Struggling: consecutive failures tripped the circuit breaker. Deprioritized until new clean signals recover the score.",children:"struggling"}):ae==="kept-for-coverage"?i.jsx("span",{className:"shrink-0 rounded border border-unverified/40 px-1 font-mono text-[8px] font-bold uppercase tracking-wider text-unverified","data-tooltip":`Would bench (${z.bench.reason??"rule"}), but kept as sole provider of a category.`,children:"kept for coverage"}):null})()]}),i.jsxs("div",{className:"truncate font-mono text-[10px] text-muted-foreground/50",children:[K.provider,"/",K.model]})]})]})}),i.jsx("td",{className:"py-3 pr-4 text-right align-top",children:i.jsx("span",{className:`font-mono text-sm font-bold tabular-nums ${Q}`,children:z.dispatchWeight.toFixed(2)})}),i.jsx("td",{className:"py-3 pr-4 align-top",children:i.jsxs("div",{className:"space-y-1",children:[i.jsx(Yc,{label:"A",value:z.accuracy,fillClass:z.accuracy>=.7?"bg-confirmed":z.accuracy>=.4?"bg-unverified":"bg-disputed"}),i.jsx(Yc,{label:"U",value:z.uniqueness,fillClass:"bg-unique"}),i.jsx(Yc,{label:"I",value:z.impactScore,fillClass:"bg-[var(--color-impact)]"})]})}),i.jsx("td",{className:"py-3 pr-4 text-right align-top font-mono text-xs tabular-nums text-foreground",children:z.signals.toLocaleString()}),i.jsx("td",{className:"py-3 pr-4 text-right align-top font-mono text-xs tabular-nums",children:i.jsx("span",{className:z.hallucinations>0?"font-bold text-destructive":"text-muted-foreground/40","data-tooltip":`Agreements ${z.agreements} · Disagreements ${z.disagreements} · Hallucinations ${z.hallucinations}`,children:z.hallucinations})}),i.jsx("td",{className:"py-3 pr-5 align-top",children:se?i.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[i.jsx("span",{className:"shrink-0 rounded border border-amber-500/30 bg-amber-500/10 px-1.5 py-0.5 font-mono text-[9px] font-semibold text-amber-400",children:se.taskId.slice(0,8)}),i.jsx("span",{className:"truncate font-inter text-[11px] text-muted-foreground/80",style:{maxWidth:260},children:se.task}),i.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px] text-muted-foreground/50",children:Xe(se.timestamp)})]}):i.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/30",children:"no tasks"})})]},K.id)})})]})})]})}function Yc({label:u,value:c,fillClass:m}){return i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"w-2 font-mono text-[8px] uppercase text-muted-foreground/50",children:u}),i.jsx("div",{className:"h-1 flex-1 overflow-hidden rounded-full bg-background/60",children:i.jsx("div",{className:`h-full rounded-full ${m}`,style:{width:`${Math.max(0,Math.min(100,c*100))}%`}})}),i.jsxs("span",{className:"w-8 text-right font-mono text-[10px] tabular-nums text-foreground/80",children:[Math.round(c*100),"%"]})]})}function $g({tasks:u}){const[c,m]=U.useState(""),[o,f]=U.useState(0),[x,_]=U.useState(null),y=100,b=u.items.filter(V=>V.status==="completed").length,h=u.items.filter(V=>V.status==="failed").length,M=u.items.filter(V=>V.status==="running").length,R=c.trim().toLowerCase(),G=R?u.items.filter(V=>{var xe,fe,K,Z;return((xe=V.task)==null?void 0:xe.toLowerCase().includes(R))||((fe=V.agentId)==null?void 0:fe.toLowerCase().includes(R))||((K=V.taskId)==null?void 0:K.toLowerCase().includes(R))||((Z=V.status)==null?void 0:Z.toLowerCase().includes(R))}):u.items,H=Math.max(1,Math.ceil(G.length/y)),ne=Math.min(o,H-1),le=G.slice(ne*y,(ne+1)*y);return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"mb-6",children:[i.jsxs("h1",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Tasks ",i.jsx("span",{className:"ml-2 text-primary",children:u.total})]}),i.jsxs("div",{className:"mt-2 flex gap-4 font-mono text-[11px] text-muted-foreground",children:[i.jsxs("span",{children:[i.jsx("span",{className:"text-confirmed",children:b})," completed"]}),h>0&&i.jsxs("span",{children:[i.jsx("span",{className:"text-destructive",children:h})," failed"]}),M>0&&i.jsxs("span",{children:[i.jsx("span",{className:"text-unverified",children:M})," running"]}),i.jsxs("span",{children:["showing ",le.length," of ",G.length,R&&` (filtered from ${u.items.length})`]})]})]}),i.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[i.jsx("input",{type:"text",value:c,onChange:V=>{m(V.target.value),f(0)},placeholder:"Search tasks by description, agent, id, status...",className:"w-full max-w-md rounded-md border border-border/40 bg-card/80 px-3 py-1.5 font-mono text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-primary/40 focus:outline-none"}),H>1&&i.jsxs("div",{className:"flex shrink-0 items-center gap-2 font-mono text-[11px] text-muted-foreground",children:[i.jsx("button",{onClick:()=>f(V=>Math.max(0,V-1)),disabled:ne===0,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"◂ Prev"}),i.jsxs("span",{children:[ne+1," / ",H]}),i.jsx("button",{onClick:()=>f(V=>Math.min(H-1,V+1)),disabled:ne>=H-1,className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 transition hover:bg-accent/50 disabled:opacity-30",children:"Next ▸"})]})]}),i.jsx("div",{className:"overflow-hidden rounded-md border border-border/40 bg-card/80",children:le.length===0?i.jsx("div",{className:"py-12 text-center text-sm text-muted-foreground",children:R?"No tasks match your search.":"No tasks yet."}):i.jsxs("table",{className:"w-full text-left",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"border-b border-border/40 bg-muted/30",children:[i.jsx("th",{className:"py-2.5 pl-4 pr-2 text-xs font-medium text-muted-foreground",style:{width:32}}),i.jsx("th",{className:"py-2.5 pr-3 font-mono text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"ID"}),i.jsx("th",{className:"py-2.5 pr-3 font-mono text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"Agent"}),i.jsx("th",{className:"py-2.5 pr-3 text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"Description"}),i.jsx("th",{className:"py-2.5 pr-3 font-mono text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"Duration"}),i.jsx("th",{className:"py-2.5 pr-4 text-right font-mono text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"When"})]})}),i.jsx("tbody",{children:le.map(V=>i.jsx(jm,{task:V,onClick:_},V.taskId))})]})}),i.jsx(A0,{task:x,onClose:()=>_(null)})]})}function Jg({consensus:u,consensusReports:c}){const[m,o]=U.useState(!1),f=m?u.runs:u.runs.filter(h=>!h.retracted),x=u.runs.filter(h=>h.retracted).length,_=f.reduce((h,M)=>h+(M.counts.agreement||0),0),y=f.reduce((h,M)=>h+((M.counts.disagreement||0)+(M.counts.hallucination||0)),0),b=f.reduce((h,M)=>h+(M.counts.unverified||0),0);return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"mb-6",children:[i.jsxs("h1",{className:"font-mono text-[11px] font-bold uppercase tracking-widest text-foreground",children:["Debates ",i.jsx("span",{className:"ml-2 text-foreground",children:f.length}),!m&&x>0&&i.jsxs("span",{className:"ml-2 font-normal normal-case tracking-normal text-muted-foreground/60",children:["/ ",u.totalRuns??u.runs.length," total"]})]}),i.jsxs("div",{className:"mt-2 flex gap-4 font-mono text-[11px] text-muted-foreground",children:[i.jsxs("span",{children:[i.jsx("span",{className:"text-confirmed",children:_})," confirmed"]}),i.jsxs("span",{children:[i.jsx("span",{className:"text-disputed",children:y})," disputed"]}),b>0&&i.jsxs("span",{children:[i.jsx("span",{className:"text-unverified",children:b})," unverified"]}),i.jsxs("span",{children:[u.totalSignals," total signals"]})]}),x>0&&i.jsxs("div",{className:"mt-2 flex items-center gap-2 font-mono text-[11px] text-muted-foreground/70",children:[i.jsx("span",{children:m?`${x} retracted run${x===1?"":"s"} shown`:`${x} retracted run${x===1?"":"s"} hidden`}),i.jsx("button",{type:"button",onClick:()=>o(h=>!h),className:"rounded-sm border border-border/40 bg-card px-2 py-0.5 text-[10px] transition hover:bg-accent/50 hover:text-foreground",children:m?"hide":"show"})]})]}),i.jsx(bm,{consensus:u,filteredRuns:f,reports:c,showAll:!0,hideHeader:!0})]})}function Fg(){const u=mm(),{overview:c,agents:m,tasks:o,consensus:f,consensusReports:x,nativeMemories:_,gossipMemories:y,loading:b,refresh:h}=Vg(),[M,R]=U.useState(0),G=U.useCallback(le=>{le.type!=="log_lines"&&h()},[h]);if(Qg(G),b||!c||!f)return i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx(im,{}),i.jsx("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:"Loading dashboard..."})]});let H;const ne=u.match(/^\/agent\/(.+)$/);if(ne&&m){const le=decodeURIComponent(ne[1]);H=i.jsx(Cg,{agentId:le,agents:m,tasks:o,consensus:f})}else u==="/team"&&m?H=i.jsx(Kg,{agents:m,tasks:o}):u==="/tasks"&&o?H=i.jsx($g,{tasks:o}):u==="/debates"&&f?H=i.jsx(Jg,{consensus:f,consensusReports:x}):u==="/logs"?H=i.jsx(wg,{}):u==="/signals"?H=i.jsx(Lg,{}):H=i.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-[280px_1fr] lg:items-start",children:[i.jsxs("aside",{className:"space-y-4 lg:sticky lg:top-4",children:[i.jsx(i0,{overview:c,activeTasks:M}),m&&i.jsx(c0,{agents:m})]}),i.jsxs("main",{className:"min-w-0 space-y-6",children:[i.jsx(m0,{onCountChange:R}),o&&i.jsx(w0,{tasks:o,limit:5}),m&&i.jsx(E0,{agents:m}),i.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[i.jsx(ng,{}),i.jsx(lg,{overview:c})]}),i.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[i.jsx(sg,{}),i.jsx(ug,{overview:c})]}),i.jsx(bm,{consensus:f,reports:x}),(y||_)&&i.jsx(I0,{memories:[...y??[],..._??[]],heading:"Memory",statusFilter:!0})]})]});return i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx(im,{}),i.jsx("main",{className:"mx-auto max-w-7xl space-y-6 px-6 py-6",children:H})]})}function Wg(){const{authed:u,login:c,error:m}=Xg();return u===null?i.jsx("div",{className:"flex min-h-screen items-center justify-center text-muted-foreground",children:"Loading..."}):u?i.jsx(Fg,{}):i.jsx(e0,{onLogin:c,error:m})}Ih.createRoot(document.getElementById("root")).render(i.jsx(U.StrictMode,{children:i.jsx(Wg,{})}));
@@ -22,8 +22,8 @@
22
22
  <link rel="icon" type="image/png" href="/dashboard/favicon.png" />
23
23
  <link rel="preconnect" href="https://fonts.googleapis.com" />
24
24
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet" />
25
- <script type="module" crossorigin src="/dashboard/assets/index-B4qaI5QV.js"></script>
26
- <link rel="stylesheet" crossorigin href="/dashboard/assets/index-CDDNlYn-.css">
25
+ <script type="module" crossorigin src="/dashboard/assets/index-BFOANmol.js"></script>
26
+ <link rel="stylesheet" crossorigin href="/dashboard/assets/index-B2_6u4lC.css">
27
27
  </head>
28
28
  <body>
29
29
  <div id="root"></div>