@caddis/cli 0.4.87 → 0.4.88
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/bundles/antigravity-plugin/plugin.json +1 -1
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_exit.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_file_lock.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_frontmatter.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_redact.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_roadmap.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_rows.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_status.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_tidy.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_todo.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_workstreams.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_worktree_safety.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/caddis_guide.json +2413 -0
- package/bundles/antigravity-plugin/scripts/caddis_hub_collect.py +23 -1
- package/bundles/antigravity-plugin/scripts/caddis_todo.py +46 -2
- package/bundles/antigravity-plugin/scripts/schemas/hub-collect.schema.json +4 -0
- package/bundles/antigravity-plugin/scripts/schemas/hub-plans.schema.json +4 -0
- package/bundles/manifest.json +2 -2
- package/dist/export/assets/export-CEtCs5rg.css +1 -0
- package/dist/export/assets/{export-Dro73_I7.js → export-v-kcNvPW.js} +28 -28
- package/dist/export/assets/mark-small-B1q4Vk3J.svg +8 -0
- package/dist/export/fonts/atkinson-500.21d6ef26.woff2 +0 -0
- package/dist/export/fonts/atkinson-600.ce9f3210.woff2 +0 -0
- package/dist/export/index.html +2 -2
- package/dist/ui/assets/{Activity-BgqFFOv1.js → Activity-C9TCizJV.js} +1 -1
- package/dist/ui/assets/{Guide-Df0Kg8wI.js → Guide-6aEYW9oW.js} +1 -1
- package/dist/ui/assets/RoadmapTab-hUK2kzCW.js +31 -0
- package/dist/ui/assets/index-DE7v-v_o.css +1 -0
- package/dist/ui/assets/{index-DQbpiY2a.js → index-d44hkSAE.js} +2 -2
- package/dist/ui/assets/mark-small-B1q4Vk3J.svg +8 -0
- package/dist/ui/fonts/atkinson-500.21d6ef26.woff2 +0 -0
- package/dist/ui/fonts/atkinson-600.ce9f3210.woff2 +0 -0
- package/dist/ui/index.html +2 -2
- package/package.json +1 -1
- package/dist/export/assets/export-N0paGhbL.css +0 -1
- package/dist/export/assets/mark-small-CwCIyjyC.svg +0 -8
- package/dist/ui/assets/RoadmapTab-CV7WCGBL.js +0 -31
- package/dist/ui/assets/index-DEge93wH.css +0 -1
- package/dist/ui/assets/mark-small-CwCIyjyC.svg +0 -8
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" shape-rendering="crispEdges" role="img" aria-label="Caddis">
|
|
2
|
+
<path fill="#0D42FC" d="M12 1h1v1h-1zM11 2h1v1h-1zM12 2h1v1h-1zM10 3h1v1h-1zM11 3h1v1h-1zM12 3h1v1h-1zM9 4h1v1h-1zM10 4h1v1h-1zM11 4h1v1h-1zM12 4h1v1h-1zM10 5h1v1h-1zM11 5h1v1h-1zM7 6h1v1h-1zM10 6h1v1h-1zM6 7h1v1h-1zM7 7h1v1h-1zM5 8h1v1h-1zM6 8h1v1h-1zM7 8h1v1h-1zM5 9h1v1h-1zM6 9h1v1h-1zM7 9h1v1h-1zM4 10h1v1h-1zM5 10h1v1h-1zM6 10h1v1h-1zM4 11h1v1h-1zM5 11h1v1h-1zM6 11h1v1h-1zM4 12h1v1h-1zM5 12h1v1h-1zM6 12h1v1h-1zM4 13h1v1h-1zM5 13h1v1h-1zM4 14h1v1h-1zM5 14h1v1h-1zM4 15h1v1h-1z"/>
|
|
3
|
+
<path fill="#00CAD5" d="M19 3h1v1h-1zM20 3h1v1h-1zM16 4h1v1h-1zM17 4h1v1h-1zM18 4h1v1h-1zM19 4h1v1h-1zM20 4h1v1h-1zM13 5h1v1h-1zM14 5h1v1h-1zM15 5h1v1h-1zM16 5h1v1h-1zM17 5h1v1h-1zM18 5h1v1h-1zM19 5h1v1h-1zM12 6h1v1h-1zM13 6h1v1h-1zM14 6h1v1h-1zM15 6h1v1h-1zM16 6h1v1h-1zM17 6h1v1h-1zM18 6h1v1h-1zM11 7h1v1h-1zM12 7h1v1h-1zM13 7h1v1h-1zM14 7h1v1h-1zM11 8h1v1h-1zM12 8h1v1h-1z"/>
|
|
4
|
+
<path fill="#91D202" d="M8 5h1v1h-1zM9 5h1v1h-1zM8 6h1v1h-1zM9 6h1v1h-1zM8 7h1v1h-1zM9 7h1v1h-1zM10 7h1v1h-1zM8 8h1v1h-1zM9 8h1v1h-1zM10 8h1v1h-1zM9 9h1v1h-1zM10 9h1v1h-1zM11 9h1v1h-1zM12 9h1v1h-1zM10 10h1v1h-1zM11 10h1v1h-1zM12 10h1v1h-1zM13 10h1v1h-1zM14 10h1v1h-1zM12 11h1v1h-1zM13 11h1v1h-1zM15 13h1v1h-1zM14 14h1v1h-1zM15 14h1v1h-1zM14 15h1v1h-1zM15 15h1v1h-1zM13 16h1v1h-1zM14 16h1v1h-1zM15 16h1v1h-1zM12 17h1v1h-1zM13 17h1v1h-1zM14 17h1v1h-1zM10 18h1v1h-1zM11 18h1v1h-1zM12 18h1v1h-1zM13 18h1v1h-1zM8 19h1v1h-1zM9 19h1v1h-1zM10 19h1v1h-1zM11 19h1v1h-1zM12 19h1v1h-1zM7 20h1v1h-1zM8 20h1v1h-1zM9 20h1v1h-1zM10 20h1v1h-1zM7 21h1v1h-1zM8 21h1v1h-1zM7 22h1v1h-1z"/>
|
|
5
|
+
<path fill="#FC4E23" d="M20 7h1v1h-1zM18 8h1v1h-1zM19 8h1v1h-1zM20 8h1v1h-1zM17 9h1v1h-1zM18 9h1v1h-1zM19 9h1v1h-1zM15 10h1v1h-1zM16 10h1v1h-1zM17 10h1v1h-1zM18 10h1v1h-1zM14 11h1v1h-1zM15 11h1v1h-1zM16 11h1v1h-1zM17 11h1v1h-1zM13 12h1v1h-1zM14 12h1v1h-1zM15 12h1v1h-1zM12 13h1v1h-1zM13 13h1v1h-1zM14 13h1v1h-1zM13 14h1v1h-1z"/>
|
|
6
|
+
<path fill="#FDAD01" d="M7 10h1v1h-1zM7 11h1v1h-1zM8 11h1v1h-1zM9 11h1v1h-1zM7 12h1v1h-1zM8 12h1v1h-1zM9 12h1v1h-1zM10 12h1v1h-1zM9 13h1v1h-1zM10 13h1v1h-1zM11 13h1v1h-1zM10 14h1v1h-1zM11 14h1v1h-1zM12 14h1v1h-1zM11 15h1v1h-1zM12 15h1v1h-1zM13 15h1v1h-1zM12 16h1v1h-1zM15 17h1v1h-1zM14 18h1v1h-1zM15 18h1v1h-1zM16 18h1v1h-1zM17 18h1v1h-1zM14 19h1v1h-1zM15 19h1v1h-1zM16 19h1v1h-1zM17 19h1v1h-1zM18 19h1v1h-1zM19 19h1v1h-1zM15 20h1v1h-1zM16 20h1v1h-1zM17 20h1v1h-1zM18 20h1v1h-1zM19 20h1v1h-1zM20 20h1v1h-1zM17 21h1v1h-1zM18 21h1v1h-1zM19 21h1v1h-1z"/>
|
|
7
|
+
<path fill="#8730FB" d="M16 12h1v1h-1zM17 12h1v1h-1zM7 13h1v1h-1zM8 13h1v1h-1zM16 13h1v1h-1zM17 13h1v1h-1zM18 13h1v1h-1zM6 14h1v1h-1zM7 14h1v1h-1zM8 14h1v1h-1zM16 14h1v1h-1zM17 14h1v1h-1zM18 14h1v1h-1zM19 14h1v1h-1zM5 15h1v1h-1zM6 15h1v1h-1zM7 15h1v1h-1zM17 15h1v1h-1zM18 15h1v1h-1zM19 15h1v1h-1zM4 16h1v1h-1zM5 16h1v1h-1zM6 16h1v1h-1zM18 16h1v1h-1zM19 16h1v1h-1zM20 16h1v1h-1zM3 17h1v1h-1zM4 17h1v1h-1zM5 17h1v1h-1zM18 17h1v1h-1zM19 17h1v1h-1zM2 18h1v1h-1zM3 18h1v1h-1zM4 18h1v1h-1zM18 18h1v1h-1zM19 18h1v1h-1zM2 19h1v1h-1zM3 19h1v1h-1z"/>
|
|
8
|
+
</svg>
|
|
Binary file
|
|
Binary file
|
package/dist/export/index.html
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'self'; style-src 'self'; img-src 'self' data:; font-src 'self'; connect-src 'none'; base-uri 'none'; form-action 'none'" />
|
|
7
7
|
<title>Roadmap</title>
|
|
8
8
|
<link rel="icon" href="data:," />
|
|
9
|
-
<script type="module" crossorigin src="./assets/export-
|
|
10
|
-
<link rel="stylesheet" crossorigin href="./assets/export-
|
|
9
|
+
<script type="module" crossorigin src="./assets/export-v-kcNvPW.js"></script>
|
|
10
|
+
<link rel="stylesheet" crossorigin href="./assets/export-CEtCs5rg.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
|
13
13
|
<div id="root"></div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as K,a as _,D as I,b as O,d as z,r as C,j as n,e as B}from"./index-
|
|
1
|
+
import{c as K,a as _,D as I,b as O,d as z,r as C,j as n,e as B}from"./index-d44hkSAE.js";import{l as Y}from"./time-D00tu2ZP.js";/**
|
|
2
2
|
* @license lucide-react v1.61.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as T,j as s}from"./index-
|
|
1
|
+
import{r as T,j as s}from"./index-d44hkSAE.js";const M=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1250 1250" role="img" aria-label="Caddis">
|
|
2
2
|
<path class="p-blue" fill="#0D42FC" d="M640 98C705 150 720 215 680 275C640 340 590 375 540 420C480 470 410 520 395 605C385 700 355 790 270 855C310 780 315 700 305 640C300 540 340 460 480 340L545 285C600 235 645 180 640 98Z M545 535L625 585C610 610 595 635 580 650L500 597C515 575 530 555 545 535Z"/>
|
|
3
3
|
<path class="p-purple" fill="#8730FB" d="M210 1025C200 950 225 890 270 855C330 810 400 750 445 670L525 720C440 830 330 930 250 985C235 998 222 1012 210 1025Z M875 622C960 690 1030 780 1028 850C1025 910 990 950 960 975L905 950C935 900 935 850 900 790C875 755 840 720 800 672C830 650 850 635 875 622Z"/>
|
|
4
4
|
<path class="p-cyan" fill="#00CAD5" d="M1025 182C1050 250 1030 320 985 360C940 395 880 390 820 405C750 420 690 460 668 500L592 452C650 360 760 310 880 290C950 275 990 235 1025 182Z"/>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import{c as x,f as I,r as N,b as $,j as s,g as S,o as z,h as B,N as H,i as F,d as K,e as U,l as V,k as q,p as G,P as W,T as f,m as X}from"./index-d44hkSAE.js";import{n as gs}from"./index-d44hkSAE.js";import{l as w}from"./time-D00tu2ZP.js";/**
|
|
2
|
+
* @license lucide-react v1.61.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const T={name:"arrow-right-left",size:24,node:[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]};T.node;const J=x(T);/**
|
|
7
|
+
* @license lucide-react v1.61.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const R={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};R.node;const Q=x(R);/**
|
|
12
|
+
* @license lucide-react v1.61.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const E={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};E.node;const Y=x(E);/**
|
|
17
|
+
* @license lucide-react v1.61.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const P={name:"loader",size:24,node:[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]};P.node;const Z=x(P);/**
|
|
22
|
+
* @license lucide-react v1.61.0 - ISC
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the ISC license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/const C={name:"octagon-alert",size:24,node:[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]],aliases:["alert-octagon"]};C.node;const ss=x(C);/**
|
|
27
|
+
* @license lucide-react v1.61.0 - ISC
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the ISC license.
|
|
30
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/const D={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};D.node;const es=x(D),as={todo:Y,"in-progress":Z,done:Q,moved:J,blocked:ss},L={size:14,"aria-hidden":!0};function v({tile:e}){const a=as[e];return s.jsx(a,{...L})}function _({done:e,total:a}){const l=a?Math.round(100*e/a):0;return s.jsxs("div",{className:"rm-bar-wrap",children:[s.jsx("div",{className:"rm-bar",role:"img","aria-label":`${e} of ${a} phases done`,children:s.jsx("i",{style:{width:`${l}%`}})}),s.jsxs("span",{className:"rm-bar-text",children:[e,"/",a," phases · ",l,"%"]})]})}function ns({phase:e}){return s.jsxs(s.Fragment,{children:[e.prs.map(a=>a.url?s.jsxs("a",{className:"rm-pr mono","data-testid":"rm-pr",href:a.url,target:"_blank",rel:"noreferrer noopener",children:["#",a.number]},a.number):s.jsxs("span",{className:"rm-pr mono","data-testid":"rm-pr",children:["#",a.number]},a.number)),s.jsx("span",{className:`rm-stage tile-${e.tile}`,"data-testid":"rm-stage",children:e.stage})]})}function u({status:e}){const a=e==="done"||e==="not-needed";return s.jsx("span",{className:`chip ${a?"chip-resolved":e==="in-progress"?"chip-waiting":"chip-hub"}`,children:e})}function rs(e,a){const l=document.getElementById(`ms-${e}-${a}`);l instanceof HTMLDetailsElement&&(l.open=!0),l==null||l.scrollIntoView({block:"start"})}function ls({m:e,match:a}){const l=r=>!a||a.phases.has(r.ref),t=e.milestones.length;return s.jsxs("section",{className:"rm-section","data-testid":"rm-timeline","aria-label":"Timeline",children:[s.jsx("h3",{className:"flow-h",children:"Timeline"}),s.jsxs("div",{className:"rm-timeline-grid",style:{"--rm-cols":t},children:[s.jsxs("div",{className:"rm-head-row",children:[s.jsx("div",{className:"rm-cell rm-head rm-lane",children:"Plan / milestone"}),e.milestones.map(r=>s.jsxs("div",{className:"rm-cell rm-head",children:[s.jsx("strong",{children:r.id})," ",s.jsx(u,{status:r.status}),s.jsx("span",{className:"rm-sub",children:r.depends.length?`after ${r.depends.join(", ")}`:"starts first"}),r.blockers.length>0&&s.jsxs("span",{className:"rm-gate-count",children:[r.blockers.length," gate(s)"]})]},r.id))]}),e.lanes.map(r=>s.jsxs("div",{className:"rm-row",children:[s.jsxs("div",{className:"rm-cell rm-lane",children:[r.plan,s.jsxs("span",{className:"rm-sub",children:[r.done,"/",r.total," done"]})]}),e.milestones.map(n=>s.jsx("div",{className:"rm-cell",children:n.phases.filter(c=>c.plan===r.plan&&l(c)).map(c=>s.jsxs("div",{className:"rm-tile","data-state":c.tile,"data-risk":c.highRisk?"high":void 0,title:`${c.ref} ${c.name} | ${c.tracker||c.stage}`,children:[s.jsx(v,{tile:c.tile}),s.jsx("b",{className:"mono",children:c.num}),s.jsx("span",{children:c.name}),s.jsx("span",{className:"sr-only",children:f[c.tile]}),c.highRisk&&s.jsx("i",{className:"rm-risk","aria-label":"high risk"})]},c.ref))},n.id))]},r.plan)),e.blockers.length>0&&s.jsxs("div",{className:"rm-row",children:[s.jsx("div",{className:"rm-cell rm-lane",children:"Owner and outside"}),e.milestones.map(r=>s.jsx("div",{className:"rm-cell",children:r.blockers.map((n,c)=>s.jsxs("div",{className:"rm-gate-note",title:n.reason,children:[n.type,": ",n.reason.length>60?`${n.reason.slice(0,60)}…`:n.reason]},c))},r.id))]})]}),s.jsx("div",{className:"rm-timeline-list","data-testid":"rm-timeline-list",children:e.milestones.map(r=>s.jsxs("div",{children:[s.jsxs("h4",{className:"rm-list-h",children:[r.id," ",s.jsx(u,{status:r.status})]}),r.phases.filter(l).map(n=>s.jsxs("div",{className:"rm-tile","data-state":n.tile,"data-risk":n.highRisk?"high":void 0,children:[s.jsx(v,{tile:n.tile}),s.jsxs("b",{className:"mono",children:[n.plan," ",n.num]}),s.jsx("span",{children:n.name}),s.jsx("span",{className:"sr-only",children:f[n.tile]}),n.highRisk&&s.jsx("i",{className:"rm-risk","aria-label":"high risk"})]},n.ref))]},r.id))}),s.jsxs("div",{className:"rm-legend","data-testid":"rm-legend",children:[s.jsx("span",{children:"to do · in progress · done · moved · blocked: each tile has an icon and a label"}),s.jsx("span",{children:"red dot = Risk high (stops for review)"})]})]})}function is({m:e,match:a}){return s.jsxs("section",{className:"rm-section","data-testid":"rm-milestones","aria-label":"Milestones and phases",children:[s.jsx("h3",{className:"flow-h",children:"Milestones and phases"}),e.milestones.filter(l=>!a||a.milestones.has(l.id)).map(l=>s.jsxs("details",{className:"rm-ms",id:`ms-${e.slug}-${l.id}`,open:a?!0:void 0,children:[s.jsxs("summary",{children:[s.jsx("strong",{children:l.id})," ",s.jsx(u,{status:l.status}),s.jsxs("span",{className:"rm-sub",children:["owner ",l.owner,l.target?` · target ${l.target}`:""," · after ",l.depends.join(", ")||"-"]})]}),l.phases.length===0?s.jsx("p",{className:"col-empty",children:"No build phases."}):s.jsx("ul",{className:"flow-list",children:l.phases.filter(t=>!a||a.phases.has(t.ref)).map(t=>s.jsxs("li",{className:"flow-row","data-testid":"rm-phase","data-state":t.tile,children:[s.jsxs("div",{className:"flow-row-head",children:[s.jsx("code",{className:"mono",children:t.ref}),s.jsx("span",{className:"flow-title",children:t.name}),s.jsx(ns,{phase:t})]}),s.jsxs("span",{className:"flow-why",children:[[t.model&&`model ${t.model}`,t.lane&&`lane ${t.lane.split(" ")[0]}`,t.risk&&`risk ${t.risk}`].filter(Boolean).join(" · ")||"no model, lane or risk recorded",t.tracker?` · Tracker: ${t.tracker}`:""]})]},t.ref))})]},`${l.id}-${a?"q":"n"}`))]})}function ts({m:e,repo:a,crumbHref:l,match:t,variant:r}){const n=e.kpis,c=i=>()=>rs(e.slug,i);return s.jsxs("div",{className:"rm-detail","data-testid":"rm-detail",children:[s.jsxs("nav",{className:"rm-crumbs","data-testid":"rm-crumbs","aria-label":"Breadcrumb",children:[l?s.jsx("a",{href:l,children:"Roadmaps"}):s.jsx("span",{children:"Roadmaps"})," › ",s.jsx("span",{children:K(a)})," › ",s.jsx("strong",{children:e.slug})]}),e.detailError&&s.jsxs("div",{className:"lane-note","data-testid":"rm-errors",children:["Roadmap detail is unavailable: ",e.detailError,". Phase names, Tracker cells and PR links are missing."]}),s.jsxs("header",{"data-testid":"rm-header",children:[s.jsxs("h2",{className:"rm-title",children:["Roadmap ",e.slug]}),s.jsxs("p",{className:"page-subtitle",children:[n.milestonesDone," of ",n.milestonesTotal," milestones · ",n.phasesDone," of ",n.phasesTotal," phases done",e.branch?s.jsxs(s.Fragment,{children:[" · branch ",s.jsx("code",{children:e.branch})]}):null,e.originCommit?s.jsxs(s.Fragment,{children:[" · origin ",s.jsx("code",{children:e.originCommit})]}):null]}),e.lanes.length>0&&s.jsx("div",{className:"rm-chips","data-testid":"rm-chips",children:e.lanes.map(i=>s.jsxs("span",{className:"rm-chip",children:[s.jsx("b",{children:i.plan})," ",s.jsxs("span",{className:"mono",children:[i.done,"/",i.total," phases"]})]},i.plan))})]}),s.jsxs("section",{className:`rm-section rm-waiting${e.gates.length?" has":""}`,"data-testid":"rm-waiting","aria-label":"Waiting for you",children:[s.jsx("h3",{className:"flow-h",children:"Waiting for you"}),e.gates.length===0?s.jsx("p",{className:"col-empty",children:"No owner gate is waiting."}):s.jsx("ul",{className:"flow-list",children:e.gates.map((i,d)=>s.jsxs("li",{className:"flow-row",children:[s.jsxs("div",{className:"flow-row-head",children:[s.jsx("strong",{children:i.milestone}),s.jsx("span",{className:"chip chip-owner-gate",children:"owner-gate"})]}),s.jsx("span",{className:"flow-why",children:i.reason}),i.check&&s.jsx("code",{className:"mono",children:i.check})]},d))})]}),s.jsxs("section",{className:"rm-kpis kpi-strip","data-testid":"rm-kpis","aria-label":"Summary",children:[s.jsxs("div",{className:"kpi-tile",children:[s.jsx("span",{className:"kpi-label",children:"Phases done"}),s.jsxs("span",{className:"kpi-num",children:[n.phasesDone," / ",n.phasesTotal]})]}),s.jsxs("div",{className:"kpi-tile",children:[s.jsx("span",{className:"kpi-label",children:"Milestones done"}),s.jsxs("span",{className:"kpi-num",children:[n.milestonesDone," / ",n.milestonesTotal]})]}),s.jsxs("div",{className:"kpi-tile",children:[s.jsx("span",{className:"kpi-label",children:"In progress"}),s.jsx("span",{className:"kpi-num",children:n.inProgress.length}),s.jsx("span",{className:"kpi-sub tone-muted",children:n.inProgress.join(", ")||"none"})]}),s.jsxs("div",{className:"kpi-tile",children:[s.jsx("span",{className:"kpi-label",children:"High-risk phases"}),s.jsx("span",{className:`kpi-num${n.highRisk?" bad":""}`,children:n.highRisk})]}),s.jsxs("div",{className:"kpi-tile deploy",children:[s.jsx("span",{className:"kpi-label",children:"Next batch for the runner"}),s.jsx("span",{className:"kpi-val",children:n.next})]})]}),s.jsxs("section",{className:"rm-section","data-testid":"rm-flow","aria-label":"Flow",children:[s.jsx("h3",{className:"flow-h",children:"Flow"}),s.jsx("div",{className:"rm-chain",children:e.milestones.map((i,d)=>s.jsxs("span",{className:"rm-chain-item",children:[d>0&&s.jsx("span",{"aria-hidden":"true",children:"→"}),s.jsxs("button",{type:"button",className:`rm-node tone-${i.tone}`,onClick:c(i.id),children:[s.jsx("b",{children:i.id})," ",s.jsx(u,{status:i.status}),s.jsxs("span",{className:"rm-sub",children:[i.depends.length?`after ${i.depends.join(", ")}`:"starts first"," · ",i.done,"/",i.total," ph"]})]})]},i.id))})]}),s.jsxs("section",{className:"rm-section","data-testid":"rm-board","aria-label":"Now, next, later",children:[s.jsx("h3",{className:"flow-h",children:"Now, next, later"}),s.jsx("div",{className:"rm-cols",children:["now","next","later"].map(i=>s.jsxs("div",{children:[s.jsx("h4",{className:"rm-list-h",children:i[0].toUpperCase()+i.slice(1)}),e.board[i].length===0?s.jsx("p",{className:"col-empty",children:"none"}):e.board[i].map(d=>s.jsxs("button",{type:"button",className:`rm-rcard tone-${d.tone}`,onClick:c(d.id),children:[s.jsxs("span",{children:[s.jsx("strong",{children:d.id})," ",s.jsx(u,{status:d.status})]}),s.jsx(_,{done:d.done,total:d.total}),d.blockers.map((g,k)=>s.jsx("span",{className:"rm-sub",children:g.type},k))]},d.id))]},i))})]}),s.jsx(ls,{m:e,match:t}),s.jsxs("section",{className:"rm-section","data-testid":"rm-gates","aria-label":"Gates and blockers",children:[s.jsxs("h3",{className:"flow-h",children:["Gates and blockers · ",e.blockers.length," open"]}),e.blockers.length===0?s.jsx("p",{className:"col-empty",children:"No blockers."}):s.jsx("ul",{className:"flow-list",children:e.blockers.map((i,d)=>s.jsxs("li",{className:"flow-row",children:[s.jsxs("div",{className:"flow-row-head",children:[s.jsx("strong",{children:i.milestone}),s.jsx("span",{className:`chip ${i.type==="owner-gate"?"chip-owner-gate":"chip-hub"}`,children:i.type})]}),s.jsx("span",{className:"flow-why",children:i.reason}),i.check&&s.jsx("code",{className:"mono",children:i.check})]},d))})]}),s.jsx(is,{m:e,match:t}),r==="hub"&&s.jsxs("section",{className:"rm-section","data-testid":"rm-runner","aria-label":"Runner",children:[s.jsx("h3",{className:"flow-h",children:"Runner"}),e.runner.running?s.jsxs("p",{children:["Running batch ",s.jsx("code",{children:e.runner.running.batch}),e.runner.running.since?` since ${w(e.runner.running.since)}`:"",e.runner.running.host?` (host ${e.runner.running.host}${e.runner.running.pid?`, pid ${e.runner.running.pid}`:""})`:"","."]}):s.jsx("p",{className:"col-empty",children:"No runner holds this roadmap now."}),e.runner.staleBatch!==null&&s.jsxs("p",{children:["A stale runner lock remains (batch ",s.jsx("code",{children:e.runner.staleBatch}),"): the runner that held it is gone."]}),e.runner.lastStop&&s.jsxs("p",{children:["Last stop record: ",e.runner.lastStopAt?`${w(e.runner.lastStopAt)}: `:"",e.runner.lastStop,"."]}),e.runner.errors.map(i=>s.jsxs("p",{className:"tone-warn",children:["Could not read ",i,"."]},i)),e.runner.next&&s.jsxs("p",{children:["Next batch: ",s.jsx("code",{children:e.runner.next})]})]})]})}function cs({repo:e,m:a,variant:l}){const t=$(e);return s.jsxs("div",{className:"rm-list-view",children:[(a.errors.length>0||a.repoError||a.roadmaps.some(r=>r.detailError))&&s.jsxs("div",{className:"lane-note","data-testid":"rm-errors",children:[a.repoError&&s.jsxs("div",{children:["Could not read this repo: ",a.repoError]}),a.errors.map(r=>s.jsxs("div",{children:["Could not read ",r.slug,": ",r.error]},r.slug)),a.roadmaps.filter(r=>r.detailError).map(r=>s.jsxs("div",{children:["Detail unavailable for ",r.slug,": ",r.detailError]},r.slug))]}),s.jsx("ul",{className:"flow-list rm-cards","data-testid":"rm-list","aria-label":"Roadmaps",children:a.roadmaps.map(r=>{const n=V(r);return s.jsx("li",{children:s.jsxs("a",{className:`rm-rcard rm-card tone-${n.tone}`,"data-testid":"rm-card",href:O(l,t,r.slug),children:[s.jsxs("span",{children:[s.jsx("strong",{children:n.slug})," ",s.jsx("span",{className:"rm-sub",children:n.branch??""})]}),s.jsx(_,{done:n.phasesDone,total:n.phasesTotal}),s.jsxs("span",{className:"rm-sub",children:[n.milestonesDone,"/",n.milestonesTotal," milestones"]}),s.jsx("span",{className:"rm-dots",children:n.dots.map(c=>s.jsx("span",{className:`rm-dot s-${c.status}`,children:c.id},c.id))}),s.jsxs("span",{className:"rm-sub",children:["next: ",n.next,l==="hub"?` · runner: ${n.runner}`:"",n.gates>0?` · ${n.gates} open gate${n.gates===1?"":"s"}`:""]})]})},r.slug)})})]})}const ds={todo:"todo","in-progress":"prog",blocked:"block",done:"done",moved:"done"},y=e=>e.replace(/^☐\s*/u,"").trim();function os({plan:e}){if(e.rows.length===0)return null;const a=X(e);return s.jsxs("span",{className:"rm-pkpis","data-testid":"rm-plan-kpis",children:[s.jsxs("span",{className:"rm-pkpi",children:[s.jsxs("span",{className:"rm-pkpi-num",children:[a.done," / ",a.total]})," ","done"]}),s.jsx("span",{className:"rm-pbar",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":a.pct,"aria-label":"Share of rows done",children:s.jsx("span",{style:{width:`${a.pct}%`}})}),s.jsxs("span",{className:"rm-pkpi rm-pkpi-pct",children:[a.pct," %"]}),s.jsxs("span",{className:`rm-pkpi${a.inProgress?" tone-prog":""}`,children:[s.jsx("span",{className:"rm-pkpi-num",children:a.inProgress})," in progress"]}),s.jsxs("span",{className:`rm-pkpi${a.blocked?" tone-block":""}`,children:[s.jsx("span",{className:"rm-pkpi-num",children:a.blocked})," blocked"]}),s.jsxs("span",{className:"rm-pkpi",children:[s.jsx("span",{className:"rm-pkpi-num",children:a.todo})," to do"]})]})}function M({plan:e,startOpen:a}){const l=G(e);return s.jsxs("details",{className:"rm-section rm-plan","data-testid":"rm-plan-board","aria-label":e.title,open:a||void 0,children:[s.jsxs("summary",{className:"rm-plan-sum",children:[s.jsx("span",{className:"rm-plan-title",children:e.title}),s.jsxs("span",{className:"rm-sub",children:[e.open," open"]}),s.jsx(os,{plan:e})]}),e.rows.length===0?s.jsx("p",{className:"col-empty",children:"This plan has no Tracker table."}):s.jsx("div",{className:"rm-cols rm-cols-4",children:W.map(t=>s.jsxs("div",{"data-col":t.key,children:[s.jsxs("h4",{className:"rm-list-h",children:[t.label," · ",l[t.key].length]}),l[t.key].length===0?s.jsx("p",{className:"col-empty",children:"none"}):l[t.key].map((r,n)=>s.jsxs("div",{className:`rm-rcard rm-pcard tone-${ds[r.state]}${r.state==="moved"?" is-moved":""}`,children:[s.jsx("strong",{children:r.phase}),y(r.status)?s.jsx("span",{className:"rm-sub",children:y(r.status)}):null]},`${r.phase}-${n}`))]},t.key))})]})}function A(e){const[a]=N.useState(()=>q(e));return a}function hs({plans:e}){const a=A(e);return s.jsxs("div",{className:"flow","data-testid":"rm-plans",children:[s.jsx("p",{className:"page-subtitle",children:"No roadmap here. These plans are active. Click a plan to open or close it."}),e.map(l=>s.jsx(M,{plan:l,startOpen:l.path===a},l.path))]})}function ms({plans:e}){const a=A(e);return e.length===0?null:s.jsxs("div",{className:"flow","data-testid":"rm-other-plans",children:[s.jsx("h2",{className:"rm-title",children:"Plans with no roadmap"}),e.map(l=>s.jsx(M,{plan:l,startOpen:l.path===a},l.path))]})}const O=(e,a,l)=>e==="site"?l?`#/roadmap/${encodeURIComponent(l)}`:"#/":U(a,"roadmap",l);function js({repo:e,slug:a,stale:l=!1,lastOkAt:t=null,variant:r="hub"}){const n=I(e),[c,i]=N.useState(""),d=N.useRef(null);N.useEffect(()=>{const p=o=>{var b;const h=o.target,j=h instanceof HTMLElement&&/^(INPUT|TEXTAREA|SELECT)$/.test(h.tagName);o.key==="/"&&!j&&!o.ctrlKey&&!o.metaKey&&!o.altKey&&(o.preventDefault(),(b=d.current)==null||b.focus())};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[]);const g=$(e),k=l&&s.jsxs("p",{className:"lane-note","data-testid":"rm-stale",children:["Roadmap data is old. Last good read ",S(t),". The numbers below are greyed."]});let m;if(n.mode==="none")m=s.jsxs("div",{className:"notice","data-testid":"rm-none",children:[s.jsx("h2",{className:"rm-title",children:H}),s.jsxs("p",{children:["Create one with ",s.jsx("code",{className:"cmd",children:F}),"."]})]});else if(n.mode==="error")m=s.jsxs("div",{className:"lane-note","data-testid":"rm-errors",children:["Could not read this repo: ",n.repoError]});else if(n.mode==="plans")m=s.jsx(hs,{plans:n.plans});else{const p=a?n.roadmaps.find(o=>o.slug===a):r==="hub"&&z(n)?n.roadmaps[0]:void 0;if(p){const o=n.roadmaps.length+n.errors.length>1,h=B(p,c);m=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"rm-searchbar",children:[s.jsxs("label",{className:"rm-search",children:[s.jsx(es,{...L}),s.jsx("span",{className:"sr-only",children:"Search this roadmap"}),s.jsx("input",{ref:d,type:"search","data-testid":"rm-search",placeholder:"Search phases, PRs, milestones (press /)",value:c,onChange:j=>i(j.target.value),onKeyDown:j=>{j.key==="Escape"&&i("")}})]}),s.jsx("span",{className:"rm-match","data-testid":"rm-match-count","aria-live":"polite",children:h?`${h.count} ${h.count===1?"match":"matches"}`:""})]}),s.jsx(ts,{m:p,repo:e,crumbHref:o?O(r,g):null,match:h,variant:r})]})}else m=s.jsxs(s.Fragment,{children:[a&&s.jsxs("p",{className:"lane-note","data-testid":"rm-missing",children:["No roadmap named ",a," in this repo."]}),s.jsx(cs,{repo:e,m:n,variant:r})]})}return s.jsxs("div",{className:`rm${l?" stale":""}`,"data-testid":"roadmap-tab",children:[k,m,n.mode==="roadmaps"?s.jsx(ms,{plans:n.otherPlans}):null]})}export{gs as collectorStale,js as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@font-face{font-family:Atkinson Hyperlegible Next;font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/atkinson-400.849ae6f0.woff2) format("woff2")}@font-face{font-family:Atkinson Hyperlegible Next;font-style:normal;font-weight:500;font-display:swap;src:url(/fonts/atkinson-500.21d6ef26.woff2) format("woff2")}@font-face{font-family:Atkinson Hyperlegible Next;font-style:normal;font-weight:600;font-display:swap;src:url(/fonts/atkinson-600.ce9f3210.woff2) format("woff2")}@font-face{font-family:Atkinson Hyperlegible Next;font-style:normal;font-weight:700;font-display:swap;src:url(/fonts/atkinson-700.3a9cc18a.woff2) format("woff2")}@font-face{font-family:Maple Mono;font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/maple-mono-400.071799fd.woff2) format("woff2")}@font-face{font-family:Maple Mono;font-style:normal;font-weight:700;font-display:swap;src:url(/fonts/maple-mono-700.1e17b237.woff2) format("woff2")}:root{--caddis-blue: #0d42fc;--caddis-cyan: #00cad5;--caddis-green: #91d202;--caddis-amber: #fdad01;--caddis-orange: #fc4e23;--caddis-violet: #8730fb;--caddis-bg-dark: #282a36;--caddis-bg-light: #f8f8f2}@media(prefers-reduced-motion:no-preference){.caddis-mark-build path{opacity:0;transform-box:fill-box;transform-origin:center;animation:caddis-piece-in .64s cubic-bezier(.2,.7,.2,1) forwards}.caddis-mark-build .p-blue{--from: -60px, -60px;animation-delay:0ms}.caddis-mark-build .p-purple{--from: -60px, 60px;animation-delay:90ms}.caddis-mark-build .p-cyan{--from: 60px, -60px;animation-delay:.18s}.caddis-mark-build .p-amber{--from: -40px, 60px;animation-delay:.27s}.caddis-mark-build .p-green{--from: 0px, 70px;animation-delay:.36s}.caddis-mark-build .p-orange{--from: 60px, 40px;animation-delay:.45s}}@keyframes caddis-piece-in{0%{opacity:0;transform:translate(var(--from, 0, 0)) scale(.85)}to{opacity:1;transform:none}}:root,[data-theme=dark]{color-scheme:dark;--bg-canvas: #191a23;--bg-lane: #21222c;--bg-card: #282a36;--bg-elevated: #343746;--border-dim: #363949;--border-bright: #4b4f65;--text-main: #f8f8f2;--text-sub: #c0c4d6;--text-dim: #9ca3c4;--purple: #bd93f9;--pink: #ff79c6;--green: #50fa7b;--yellow: #f1fa8c;--red: #ff5555;--cyan: #8be9fd;--orange: #ffb86c;--tone-yellow-bg: rgba(241, 250, 140, .08);--tone-yellow-bd: rgba(241, 250, 140, .42);--tone-red-bg: rgba(255, 85, 85, .09);--tone-red-bd: rgba(255, 85, 85, .45);--tone-pink-bg: rgba(255, 121, 198, .11);--tone-pink-bd: rgba(255, 121, 198, .45);--tone-cyan-bg: rgba(139, 233, 253, .09);--tone-cyan-bd: rgba(139, 233, 253, .36);--tone-green-bg: rgba(80, 250, 123, .09);--tone-green-bd: rgba(80, 250, 123, .36);--tone-purple-bg: rgba(189, 147, 249, .12);--tone-purple-bd: rgba(189, 147, 249, .42);--focus-ring: #bd93f9;--sidebar-w: 232px}[data-theme=light]{color-scheme:light;--bg-canvas: #f2f3f8;--bg-lane: #f9f9fc;--bg-card: #ffffff;--bg-elevated: #ebedf5;--border-dim: #dcdde8;--border-bright: #bfc2d4;--text-main: #1b1c26;--text-sub: #424659;--text-dim: #60667f;--purple: #6837e8;--pink: #cf2384;--green: #128038;--yellow: #8f6100;--red: #d12121;--cyan: #096b7d;--orange: #b85000;--tone-yellow-bg: rgba(217, 155, 8, .11);--tone-yellow-bd: rgba(168, 112, 0, .42);--tone-red-bg: rgba(209, 33, 33, .07);--tone-red-bd: rgba(209, 33, 33, .38);--tone-pink-bg: rgba(207, 35, 132, .08);--tone-pink-bd: rgba(207, 35, 132, .38);--tone-cyan-bg: rgba(9, 107, 125, .08);--tone-cyan-bd: rgba(9, 107, 125, .32);--tone-green-bg: rgba(18, 128, 56, .08);--tone-green-bd: rgba(18, 128, 56, .32);--tone-purple-bg: rgba(104, 55, 232, .09);--tone-purple-bd: rgba(104, 55, 232, .35);--focus-ring: #6837e8}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}html,body{min-height:100%;width:100%;max-width:100%;background:var(--bg-canvas);color:var(--text-main);font-family:Atkinson Hyperlegible Next,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-size:15px;line-height:1.5;-webkit-font-smoothing:antialiased;overflow-x:hidden}h1,h2,h3,h4,strong,b{font-weight:600}.mono,code{font-family:Maple Mono,ui-monospace,SFMono-Regular,Consolas,monospace;font-feature-settings:"zero" on;font-size:.92em}code.cmd{background:var(--bg-elevated);padding:1px 6px;border-radius:4px;color:var(--yellow);overflow-wrap:anywhere}button,a{font-family:inherit}button:focus-visible,a:focus-visible,[tabindex]:focus-visible{outline:2px solid var(--focus-ring);outline-offset:2px}@keyframes work-pulse{0%,to{opacity:1}50%{opacity:.35}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}.pulse-dot{width:8px;height:8px;border-radius:50%;background:var(--cyan);display:inline-block;animation:work-pulse 2.2s ease-in-out infinite;flex-shrink:0}.app-shell{display:flex;min-height:100vh;width:100%;max-width:100%}.mobile-topbar{display:none;position:sticky;top:0;z-index:45;background:var(--bg-card);border-bottom:1px solid var(--border-dim);padding:10px 14px;align-items:center;justify-content:space-between;gap:10px}.menu-btn{display:inline-flex;align-items:center;gap:8px;background:var(--bg-elevated);border:1px solid var(--border-bright);color:var(--text-main);padding:6px 10px;border-radius:7px;font-size:14px;font-weight:500;cursor:pointer}.drawer-backdrop{display:none;position:fixed;top:0;right:0;bottom:0;left:0;background:#0000008c;z-index:49}.drawer-backdrop.open{display:block}.sidebar{width:var(--sidebar-w);background:var(--bg-card);border-right:1px solid var(--border-dim);position:fixed;top:0;bottom:0;left:0;z-index:50;display:flex;flex-direction:column;justify-content:space-between;transition:transform .2s ease;overflow-x:hidden;overflow-y:auto}.sidebar-top{padding:16px 12px;display:flex;flex-direction:column;gap:18px}.brand-row{display:flex;align-items:center;padding:0 6px}.brand-logo{display:flex;align-items:center;gap:10px;font-weight:700;font-size:16px;color:var(--text-main);min-width:0}.brand-mark{width:36px;height:36px;flex-shrink:0}.brand-stack{display:flex;flex-direction:column;gap:4px;min-width:0}.brand-wordmark{width:100px;height:20px}.brand-sub{font-size:12px;font-weight:400;letter-spacing:.08em;text-transform:uppercase;color:var(--text-dim)}.nav-list{display:flex;flex-direction:column;gap:4px;list-style:none}.nav-section-label{font-size:13px;font-weight:500;color:var(--text-dim);padding:0 10px;margin-bottom:-10px}.nav-empty{padding:6px 10px;color:var(--text-dim);font-size:14px}.nav-link{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 10px;border-radius:8px;color:var(--text-sub);text-decoration:none;font-weight:500;font-size:15px;transition:background .12s ease,color .12s ease;min-width:0}.nav-link:hover{background:var(--bg-elevated);color:var(--text-main)}.nav-link.active{background:var(--tone-purple-bg);color:var(--purple);font-weight:600}.nav-link-left{display:flex;align-items:center;gap:10px;min-width:0}.nav-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.soon{font-size:11.5px;color:var(--text-dim);border:1px solid var(--border-dim);border-radius:99px;padding:0 7px}.inbox-badge{display:inline-flex;align-items:center;justify-content:center;padding:1px 8px;border-radius:99px;font-size:12px;font-weight:600;background:linear-gradient(135deg,var(--yellow),var(--red));color:#191a23;flex-shrink:0}.repo-dot{width:9px;height:9px;margin:0 4.5px;border-radius:50%;flex-shrink:0}.repo-dot.attention{background:var(--yellow);box-shadow:0 0 0 2px var(--tone-yellow-bg)}.repo-dot.blocked{background:var(--red);box-shadow:0 0 0 2px var(--tone-red-bg)}.repo-dot.ok{background:var(--green)}.repo-dot.idle{background:var(--text-dim)}.sidebar-footer{padding:14px 12px;border-top:1px solid var(--border-dim);display:flex;flex-direction:column;gap:12px;background:var(--bg-lane)}.footer-meta{font-size:13px;color:var(--text-sub);display:flex;flex-direction:column;gap:8px}.updated-line{display:flex;align-items:center;gap:7px;color:var(--text-dim);font-size:12.5px;line-height:1.35}.spend-box{display:flex;flex-direction:column;gap:5px}.spend-row{display:flex;align-items:center;justify-content:space-between;gap:6px;font-size:13px}.meter-track{width:100%;height:6px;background:var(--bg-elevated);border-radius:99px;overflow:hidden}.meter-fill{height:100%;background:var(--purple);border-radius:99px}.meter-fill.hot{background:var(--orange)}.versions{color:var(--text-dim);font-size:11.5px;overflow-wrap:anywhere}.theme-switch{display:flex;gap:4px;background:var(--bg-elevated);border-radius:8px;padding:3px}.theme-btn{flex:1;display:inline-flex;align-items:center;justify-content:center;gap:5px;background:transparent;border:0;border-radius:6px;color:var(--text-sub);padding:5px 4px;font-size:12.5px;cursor:pointer}.theme-btn.active{background:var(--bg-card);color:var(--purple);font-weight:600}.main-area{flex:1;margin-left:var(--sidebar-w);min-width:0;width:100%}.page-wrap{max-width:1420px;margin:0 auto;padding:28px 28px 48px;display:flex;flex-direction:column;gap:28px;min-width:0}.page-header{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap}.page-title{font-size:22px;font-weight:600;color:var(--text-main);display:flex;align-items:center;gap:10px}.page-subtitle{font-size:14px;color:var(--text-sub)}.notice{display:flex;flex-direction:column;gap:8px;background:var(--bg-card);border:1px solid var(--border-dim);border-radius:10px;padding:18px 20px;max-width:560px}.banners{display:flex;flex-direction:column;gap:8px}.banner{display:flex;align-items:flex-start;gap:10px;border-radius:8px;padding:10px 14px;font-size:14px;border:1px solid var(--tone-yellow-bd);background:var(--tone-yellow-bg)}.banner svg{flex-shrink:0;margin-top:2px}.banner.warn svg{color:var(--yellow)}.banner.bad{border-color:var(--tone-red-bd);background:var(--tone-red-bg)}.banner.bad svg{color:var(--red)}.kpi-strip{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px}.kpi-tile{background:var(--bg-card);border:1px solid var(--border-dim);border-radius:10px;padding:13px 16px;display:flex;flex-direction:column;justify-content:space-between;gap:6px;text-decoration:none;color:var(--text-main);transition:border-color .15s ease;min-width:0}.kpi-tile:hover{border-color:var(--purple)}.kpi-tile.urgent{border-color:var(--tone-yellow-bd);background:var(--tone-yellow-bg)}.kpi-tile.danger{border-color:var(--tone-red-bd);background:var(--tone-red-bg)}.kpi-label{font-size:13.5px;color:var(--text-sub);font-weight:500;display:flex;align-items:center;gap:7px;min-width:0}.kpi-val{font-size:19px;font-weight:600;display:flex;align-items:baseline;gap:6px;flex-wrap:wrap}.kpi-sub{font-size:13px;font-weight:400}@media(max-width:1100px){.kpi-strip{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:720px){.mobile-topbar{display:flex}.app-shell{flex-direction:column}.sidebar{width:250px;transform:translate(-100%);visibility:hidden}.sidebar.drawer-open{transform:translate(0);visibility:visible}.main-area{margin-left:0}.page-wrap{padding:16px 12px 36px;gap:20px}.kpi-strip{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}}:root,[data-theme=dark]{--mk-accent: #00cad5;--mk-sel: #343746;--mk-bad: #ff7a7a;--mk-good: #91d202;--mk-warn: #fdad01;--mk-warn-bg: rgba(253, 173, 1, .1);--mk-warn-line: rgba(253, 173, 1, .45);--chip-waiting-bg: rgba(0, 202, 213, .16);--chip-waiting-fg: #5fe6ee;--chip-gate-bg: rgba(135, 48, 251, .22);--chip-gate-fg: #c9a7ff;--chip-bad-bg: rgba(255, 122, 122, .16);--chip-bad-fg: #ff9b9b;--chip-coord-bg: rgba(253, 173, 1, .16);--chip-coord-fg: #fdad01;--chip-done-bg: rgba(145, 210, 2, .16);--chip-done-fg: #a8e23a}[data-theme=light]{--mk-accent: #0d42fc;--mk-sel: #e8eefe;--mk-bad: #c0262d;--mk-good: #3d6b00;--mk-warn: #8a5a00;--mk-warn-bg: rgba(253, 173, 1, .14);--mk-warn-line: rgba(154, 101, 0, .45);--chip-waiting-bg: #dff7f8;--chip-waiting-fg: #006b72;--chip-gate-bg: #efe5ff;--chip-gate-fg: #5b1bb5;--chip-bad-bg: #fde4e4;--chip-bad-fg: #a11d24;--chip-coord-bg: #fff1cf;--chip-coord-fg: #7a5000;--chip-done-bg: #e9f6d2;--chip-done-fg: #3d6b00}.btn{display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:0 14px;border-radius:8px;border:1px solid var(--border-bright);background:transparent;color:var(--text-main);font-size:14px;font-weight:500;cursor:pointer}.btn:hover:not(:disabled){background:var(--bg-elevated)}.btn:disabled{opacity:.55;cursor:not-allowed}.kpi-tile .kpi-num{font-size:30px;font-weight:600;line-height:1.1}.kpi-num.accent{color:var(--mk-accent)}.kpi-num.bad{color:var(--mk-bad)}.tone-good{color:var(--mk-good)}.tone-warn{color:var(--mk-warn)}.tone-bad{color:var(--mk-bad)}.tone-muted{color:var(--text-dim)}.kpi-tile.deploy .kpi-val{font-size:15px}.mailbox{display:flex;flex-wrap:wrap;gap:16px;align-items:flex-start}.mailbox-folders{flex:1 1 180px;display:flex;flex-direction:column;gap:2px;padding:8px;border-radius:12px;background:var(--bg-lane);border:1px solid var(--border-dim)}.folder-btn,.item-btn{display:flex;align-items:center;gap:10px;width:100%;min-height:44px;padding:0 10px;border:0;border-radius:8px;text-align:left;background:transparent;color:var(--text-main);font-size:15px;cursor:pointer}.folder-btn span:first-of-type{flex-grow:1}.folder-btn.sel,.item-btn.sel{background:var(--mk-sel)}.folder-btn:hover,.item-btn:hover{background:var(--bg-elevated)}.mailbox-list{flex:2 1 280px;min-width:0;display:flex;flex-direction:column;gap:4px;padding:8px;border-radius:12px;background:var(--bg-lane);border:1px solid var(--border-dim)}.item-btn{align-items:flex-start;padding:10px;min-height:56px}.unread-dot{width:9px;height:9px;margin-top:6px;border-radius:50%;flex-shrink:0;background:transparent}.unread-dot.on{background:var(--mk-accent)}.item-main{display:flex;flex-direction:column;gap:3px;min-width:0}.item-meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-size:13px;color:var(--text-dim)}.item-title{font-weight:400;overflow-wrap:anywhere}.chip{padding:1px 8px;border-radius:99px;font-size:12px;font-weight:600}.chip-waiting{background:var(--chip-waiting-bg);color:var(--chip-waiting-fg)}.chip-owner-gate{background:var(--chip-gate-bg);color:var(--chip-gate-fg)}.chip-blocked,.chip-blocked-merge{background:var(--chip-bad-bg);color:var(--chip-bad-fg)}.chip-coordinator,.chip-hub{background:var(--chip-coord-bg);color:var(--chip-coord-fg)}.chip-resolved{background:var(--chip-done-bg);color:var(--chip-done-fg)}.list-empty{padding:24px 12px;text-align:center;color:var(--text-sub)}.mailbox-detail{flex:3 1 320px;min-width:0;display:flex;flex-direction:column;gap:14px;padding:18px;border-radius:12px;background:var(--bg-lane);border:1px solid var(--border-dim)}.mailbox-detail h2{font-size:20px;line-height:1.3;overflow-wrap:anywhere}.detail-block{display:flex;flex-direction:column;gap:4px}.detail-label{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--text-dim)}.detail-actions{display:flex;flex-wrap:wrap;gap:10px}.back-btn{display:none}.notify-row{display:flex;flex-wrap:wrap;align-items:center;gap:10px;font-size:14px;color:var(--text-sub)}@media(max-width:720px){.mailbox{flex-direction:column;align-items:stretch}.mailbox.show-detail .mailbox-folders,.mailbox.show-detail .mailbox-list{display:none}.mailbox:not(.show-detail) .mailbox-detail{display:none}.mailbox-folders{flex-direction:row;flex-wrap:wrap}.folder-btn{width:auto;flex:1 1 140px}.back-btn{display:inline-flex;align-self:flex-start}}.lanes{display:flex;flex-direction:column;gap:14px}.lane{border-radius:12px;background:var(--bg-lane);border:1px solid var(--border-dim)}.lane.down .lane-body .card.grey>:not(.action-row),.lane.stopped .lane-body .card.grey>:not(.action-row){opacity:.55}.lane.stopped .lane-note{background:var(--mk-warn-bg);border-color:var(--mk-warn-line)}.lane-head{display:flex;align-items:center;gap:10px;width:100%;min-height:48px;padding:0 14px;border:0;background:transparent;color:var(--text-main);font-size:15px;text-align:left;cursor:pointer;border-radius:12px}.lane-head .chev{margin-left:auto;flex-shrink:0;color:var(--text-dim)}.lane-name{font-weight:400;font-family:Maple Mono,ui-monospace,monospace;font-size:14px}.lane-summary{color:var(--text-dim);font-size:13.5px;min-width:0;overflow-wrap:anywhere}.lane-body{padding:0 14px 14px;display:flex;flex-direction:column;gap:12px}.lane-note{padding:10px 12px;border-radius:8px;background:var(--bg-elevated);border:1px solid var(--border-dim);font-size:14px}.lane.down .lane-note{background:var(--mk-warn-bg);border-color:var(--mk-warn-line)}.lane-cols{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}.lane-col{display:flex;flex-direction:column;gap:8px;min-width:0}.col-title{font-size:12.5px;letter-spacing:.04em;text-transform:uppercase;color:var(--text-dim);font-weight:600}.card{display:flex;flex-direction:column;gap:2px;padding:9px 11px;border-radius:8px;background:var(--bg-card);border:1px solid var(--border-dim);overflow-wrap:anywhere}.card-title{font-weight:500;font-size:14px}.card-sub{font-size:13px}.col-empty{font-size:13px;color:var(--text-dim)}@media(max-width:1100px){.lane-cols{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:720px){.lane-cols{grid-template-columns:minmax(0,1fr)}.lane-head{flex-wrap:wrap;padding:10px 14px}}.first-run{border:1px dashed var(--border, var(--mk-line, #6272a4));border-radius:10px;padding:16px;margin:0 0 16px;display:grid;gap:8px;justify-items:start}.first-run h2{margin:0;font-size:1.1rem}.first-run p{margin:0;display:flex;gap:8px;align-items:center;flex-wrap:wrap}.first-run-reason{color:var(--text-dim);font-size:.85rem}.chip-stale{background:transparent;border:1px dashed currentColor;color:var(--text-dim)}.kpi-strip.stale .kpi-num,.kpi-strip.stale .kpi-val,.lanes.stale .lane-body{opacity:.55}.gh-fail{overflow-wrap:anywhere}.quota-low{color:var(--mk-warn, var(--text));font-size:.85rem;overflow-wrap:anywhere}.action-row{display:flex;flex-direction:column;gap:6px;min-width:0}.action-buttons{display:flex;flex-wrap:wrap;gap:8px}.action-row.compact .btn-act{min-height:30px;padding:0 10px;font-size:12.5px}.action-reason,.request-status{font-size:13px;overflow-wrap:anywhere}.action-reason{color:var(--text-dim)}.recommendation{padding:10px 12px;border-radius:8px;border:1px solid var(--border-dim);background:var(--bg-elevated);overflow-wrap:anywhere}.rec-approve{color:var(--mk-good)}.rec-hold{color:var(--mk-warn)}.rec-evidence{font-size:13.5px}.rec-note{font-size:12.5px;color:var(--text-dim)}.quota-line{font-size:.85rem;color:var(--text-dim);overflow-wrap:anywhere}.repo-tabs{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 14px}.repo-tabs .folder-btn{width:auto;min-height:38px;padding:0 14px;border:1px solid var(--border-dim)}.flow{display:flex;flex-direction:column;gap:18px;min-width:0}.flow-status.stopped,.flow-status.down{background:var(--mk-warn-bg);border-color:var(--mk-warn-line)}.flow-section{display:flex;flex-direction:column;gap:8px;min-width:0}.flow-h{margin:0;font-size:13px;letter-spacing:.04em;text-transform:uppercase;color:var(--text-dim)}.flow-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}.flow-row{display:flex;flex-direction:column;gap:6px;padding:10px 12px;border-radius:8px;background:var(--bg-card);border:1px solid var(--border-dim);overflow-wrap:anywhere;min-width:0}.flow-row.grey>:not(.action-row){opacity:.55}.flow-row-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:8px}.flow-pos{color:var(--text-dim);font-size:13px}.flow-title{font-weight:600;font-size:14.5px}.flow-flags{display:flex;flex-wrap:wrap;gap:6px}.flow-flags .chip,.flow-row-head .chip{border:1px solid currentColor}.flow-why{font-size:13px;color:var(--text-sub)}.card .action-row{margin-top:4px}.repo-tabs a.folder-btn{text-decoration:none;display:inline-flex}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}summary:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--focus-ring);outline-offset:2px}.rm{display:flex;flex-direction:column;gap:14px;min-width:0}.rm.stale .rm-detail,.rm.stale .rm-list-view{opacity:.6}.rm-title{margin:0;font-size:18px}.rm-detail{display:flex;flex-direction:column;gap:18px;min-width:0}.rm-crumbs{font-size:13px;color:var(--text-sub);overflow-wrap:anywhere}.rm-crumbs a{color:var(--mk-accent)}.rm-section{display:flex;flex-direction:column;gap:8px;min-width:0}.rm-waiting.has .flow-row{border-color:var(--tone-pink-bd);background:var(--tone-pink-bg)}.rm-searchbar{display:flex;flex-wrap:wrap;align-items:center;gap:10px}.rm-search{display:flex;align-items:center;gap:8px;flex:1 1 240px;min-height:40px;padding:0 10px;border:1px solid var(--border-bright);border-radius:8px;background:var(--bg-card)}.rm-search input{flex:1;min-width:0;border:0;background:transparent;color:var(--text-main);font:inherit;min-height:38px}.rm-search input:focus-visible{outline-offset:6px}.rm-match{font-size:13px;color:var(--text-sub)}.rm-chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}.rm-chip{padding:4px 10px;border:1px solid var(--border-dim);border-radius:8px;background:var(--bg-card);font-size:13px}.rm-sub{display:block;font-size:12px;color:var(--text-dim)}.rm-bar-wrap{display:flex;flex-direction:column;gap:2px}.rm-bar{height:8px;border-radius:99px;background:var(--bg-elevated);overflow:hidden}.rm-bar i{display:block;height:100%;background:var(--mk-good)}.rm-bar-text{font-size:12px;color:var(--text-dim)}.rm-chain{display:flex;flex-wrap:wrap;align-items:stretch;gap:6px}.rm-chain-item{display:inline-flex;align-items:center;gap:6px}.rm-node,.rm-rcard{display:flex;flex-direction:column;gap:4px;padding:8px 10px;border:1px solid var(--border-dim);border-radius:9px;background:var(--bg-card);color:var(--text-main);font:inherit;text-align:left;text-decoration:none;cursor:pointer;min-width:0;overflow-wrap:anywhere}.rm-node:hover,.rm-rcard:hover{background:var(--bg-elevated)}.rm-node.tone-done,.rm-rcard.tone-done{border-left:4px solid var(--mk-good)}.rm-node.tone-prog,.rm-rcard.tone-prog{border-left:4px solid var(--mk-accent)}.rm-node.tone-wait,.rm-rcard.tone-wait{border-left:4px solid var(--chip-gate-fg)}.rm-node.tone-block,.rm-rcard.tone-block{border-left:4px solid var(--mk-warn)}.rm-cols{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.rm-rcard strong{font-weight:500}.rm-cols .rm-rcard{width:100%;margin-bottom:8px}.rm-cols.rm-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.rm-pcard{cursor:default}.rm-pcard:hover{background:var(--bg-card)}.rm-pcard.is-moved{opacity:.55}.rm-list-h{margin:0 0 6px;font-size:14px}.rm-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(260px,100%),1fr))}.rm-cards li{min-width:0}.rm-cards .rm-rcard{height:100%}.rm-dots{display:flex;flex-wrap:wrap;gap:4px}.rm-dot{font-size:11px;padding:0 6px;border-radius:99px;background:var(--bg-elevated);color:var(--text-sub)}.rm-dot.s-done{background:var(--chip-done-bg);color:var(--chip-done-fg)}.rm-dot.s-in-progress{background:var(--chip-waiting-bg);color:var(--chip-waiting-fg)}.rm-timeline-grid{display:flex;flex-direction:column;overflow-x:auto;border:1px solid var(--border-dim);border-radius:8px}.rm-timeline-grid>.rm-head-row,.rm-timeline-grid>.rm-row{display:grid;grid-template-columns:150px repeat(var(--rm-cols, 1),minmax(120px,1fr))}.rm-cell{padding:6px;border-top:1px solid var(--border-dim);border-left:1px dashed var(--border-dim);min-width:0}.rm-head{background:var(--bg-lane);font-weight:600;border-top:0}.rm-lane{font-weight:500;border-left:0;overflow-wrap:anywhere}.rm-gate-count,.rm-gate-note{display:inline-block;margin:2px 0;padding:1px 6px;font-size:11px;border:1px dashed var(--mk-warn);border-radius:6px;background:var(--mk-warn-bg);overflow-wrap:anywhere}.rm-tile{position:relative;display:flex;align-items:center;gap:5px;margin:0 0 4px;padding:3px 6px;font-size:12px;border:1px solid var(--border-bright);border-radius:6px;background:var(--bg-card);max-width:100%;overflow-wrap:anywhere}.rm-tile[data-state=done]{background:var(--chip-done-bg);color:var(--chip-done-fg)}.rm-tile[data-state=in-progress]{background:var(--chip-waiting-bg);color:var(--chip-waiting-fg)}.rm-tile[data-state=blocked]{background:var(--mk-warn-bg);border-color:var(--mk-warn-line)}.rm-tile[data-state=moved]{background:repeating-linear-gradient(135deg,var(--chip-done-bg) 0 5px,var(--bg-card) 5px 10px)}.rm-risk{width:7px;height:7px;margin-left:auto;border-radius:50%;background:var(--mk-bad);flex:none}.rm-timeline-list{display:none}@media(max-width:900px){.rm-timeline-grid{display:none}.rm-timeline-list{display:block}.rm-cols,.rm-cols.rm-cols-4{grid-template-columns:1fr}}.rm-legend{display:flex;flex-wrap:wrap;gap:4px 14px;font-size:12px;color:var(--text-dim)}.rm-ms{border:1px solid var(--border-dim);border-radius:10px;background:var(--bg-card);padding:8px 12px;margin-bottom:8px}.rm-ms>summary{cursor:pointer;display:flex;flex-wrap:wrap;align-items:baseline;gap:8px}.rm-ms[open]>.flow-list{margin-top:8px}.rm-plan{border:1px solid var(--border-dim);border-radius:10px;background:var(--bg-card);padding:12px 14px}.rm-plan[open]{gap:12px}.rm-plan-sum{cursor:pointer;display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;list-style:none}.rm-plan-sum::-webkit-details-marker{display:none}.rm-plan-sum:before{content:"▸";color:var(--text-sub);transition:transform .15s ease}.rm-plan[open]>.rm-plan-sum:before{transform:rotate(90deg)}.rm-plan-title{font-weight:600;font-size:15.5px;min-width:0;overflow-wrap:anywhere}.rm-pkpis{flex-basis:100%;display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;padding-left:20px;font-size:13.5px;color:var(--text-sub)}.rm-pkpi-num{font-family:Maple Mono,ui-monospace,monospace;font-feature-settings:"zero" on;color:var(--text-main)}.rm-pkpi.tone-prog .rm-pkpi-num{color:var(--mk-accent)}.rm-pkpi.tone-block .rm-pkpi-num{color:var(--mk-warn)}.rm-pbar{display:inline-block;width:120px;height:6px;border-radius:3px;background:var(--border-dim);overflow:hidden}.rm-pbar>span{display:block;height:100%;background:var(--green)}.rm-pr{color:var(--mk-accent);font-size:13px}.rm-stage{font-size:12px;padding:1px 8px;border-radius:99px;background:var(--bg-elevated);color:var(--text-sub)}.rm-stage.tile-done{background:var(--chip-done-bg);color:var(--chip-done-fg)}.rm-stage.tile-in-progress{background:var(--chip-waiting-bg);color:var(--chip-waiting-fg)}.rm-stage.tile-blocked{background:var(--mk-warn-bg);color:var(--mk-warn)}.btn-act{min-height:32px;padding:0 10px;font-size:13px}.act-filters{display:flex;flex-wrap:wrap;align-items:center;gap:10px}.act-filters select{min-height:38px;padding:0 8px;border:1px solid var(--border-bright);border-radius:8px;background:var(--bg-card);color:var(--text-main);font:inherit;max-width:100%}.act-kinds{display:flex;flex-wrap:wrap;gap:6px}.act-kind{min-height:36px;padding:0 12px;border:1px solid var(--border-bright);border-radius:99px;background:transparent;color:var(--text-main);font:inherit;font-size:13px;cursor:pointer}.act-kind[aria-pressed=true]{background:var(--mk-sel);border-color:var(--mk-accent)}.act-time{font-size:12px;color:var(--text-dim)}.act-kindtag{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--text-dim)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RoadmapTab-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RoadmapTab-hUK2kzCW.js","assets/time-D00tu2ZP.js","assets/Guide-6aEYW9oW.js","assets/Guide-zcVFGUxR.css","assets/Activity-C9TCizJV.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var Gi={exports:{}},Rr={},Xi={exports:{}},b={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react.production.min.js
|
|
@@ -218,4 +218,4 @@ Error generating stack: `+l.message+`
|
|
|
218
218
|
*
|
|
219
219
|
* This source code is licensed under the ISC license.
|
|
220
220
|
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
-
*/const kd={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};kd.node;const Ah=de(kd),ps={hotfix:"Mark hotfix",unhotfix:"Unmark hotfix",hold:"Hold",release:"Release",approve:"Approve",decline:"Decline"},Jo={hotfix:"hotfix",unhotfix:"hotfix",hold:"hold",release:"hold",approve:"approve",decline:"approve"},xd=i=>i.repo_id??null,Sd=(i,s,a)=>`${i}:${Jo[s]}:${a}`;function hs(i,s){const a=xd(i),d=_d(i,s.pr)??s.headSha;if(!a||!d)return[];const f=h=>({key:Sd(a,h,s.pr),label:ps[h],body:{repo_id:a,action:h,pr:s.pr,head_sha:d}});return[f(s.hotfix?"unhotfix":"hotfix"),f(s.held?"release":"hold")]}function Nd(i,s){const a=xd(i);if(!a)return[];const d=s.pr!==null?_d(i,s.pr)??s.head_sha:null;return["approve","decline"].map(f=>({key:Sd(a,f,s.what),label:ps[f],body:{repo_id:a,action:f,pr:s.pr,head_sha:d,what:s.what}}))}function _d(i,s){var a,d,f;return((f=(d=(a=i.github)==null?void 0:a.prs)==null?void 0:d.find(h=>h.number===s))==null?void 0:f.head_sha)??null}function jd(i){return i.actions?i.actions.enabled?null:i.actions.reason??"Actions need a live coordinator.":"Actions need a live coordinator."}function Ed(i,s){var f;const a=jd(i);return a||s.pr===null?a:(((f=i.coordinator)==null?void 0:f.queue)??[]).some(h=>(h==null?void 0:h.pr)===s.pr)?null:`PR #${s.pr} is not in the coordinator queue.`}function Fh(i,s){var f;const a=((f=i.coordinator)==null?void 0:f.requests)??[],d=Jo[s.body.action];for(let h=a.length-1;h>=0;h--){const v=a[h],S=v.action;if(!(!(S in Jo)||Jo[S]!==d)&&(s.body.what!==void 0?v.what===s.body.what&&v.pr===s.body.pr:v.pr===s.body.pr))return v}return null}function Cd(i){const s=ps[i.action]??i.action;switch(i.status){case"requested":return`${s}: requested. Waiting for the coordinator.`;case"done":return`${s}: done.`;case"rejected":return`${s}: rejected${i.reason?`: ${i.reason}`:""}.`;case"expired":return`${s}: expired before the coordinator read it.`;case"not_picked_up":return`${s}: not picked up. The coordinator has not read requests for 2 min.`}}const Td=i=>i==="done"?"good":i==="requested"?"muted":i==="not_picked_up"?"warn":"bad";function Uh(i,s,a){const d=Fh(i,s);return(a==null?void 0:a.status)==="sending"?{text:`${s.label}: sending...`,tone:"muted"}:(a==null?void 0:a.status)==="refused"?{text:`${s.label}: refused. ${a.reason??""}`.trim(),tone:"bad"}:(a==null?void 0:a.status)==="sent"&&(!d||d.id!==a.requestId)?{text:`${s.label}: requested. Waiting for the coordinator.`,tone:"muted"}:d?{text:Cd(d),tone:Td(d.status)}:null}function tl({repo:i,specs:s,act:a,compact:d=!1,reason:f}){if(s.length===0)return null;const h=f!==void 0?f:jd(i),v=new Set,S=[];for(const y of s){if(v.has(y.key))continue;v.add(y.key);const E=Uh(i,y,a.local[y.key]);E&&S.push({key:y.key,...E})}return c.jsxs("div",{className:`action-row${d?" compact":""}`,"data-testid":"actions",children:[c.jsx("div",{className:"action-buttons",children:s.map(y=>{var E;return c.jsx("button",{type:"button",className:"btn btn-act",disabled:h!==null||((E=a.local[y.key])==null?void 0:E.status)==="sending",title:h??void 0,onClick:()=>a.run(y),"data-testid":`act-${y.body.action}`,children:y.label},`${y.key}:${y.body.action}`)})}),h&&!d&&c.jsx("span",{className:"action-reason","data-testid":"action-reason",children:h}),S.map(y=>c.jsx("span",{className:`request-status tone-${y.tone}`,"data-testid":"request-status",role:"status",children:y.text},y.key))]})}function $d({item:i}){const s=i.recommendation,a=i.from?`from ${i.from}`:i.source==="coordinator"?"from the coordinator":"from the asking session";return c.jsxs("div",{className:"detail-block recommendation","data-testid":"recommendation",children:[c.jsxs("span",{className:"detail-label",children:["Recommendation, ",a]}),s?c.jsxs(c.Fragment,{children:[c.jsxs("span",{children:[c.jsx("strong",{className:`rec-${s.decision}`,children:s.decision==="approve"?"Approve":"Hold"}),s.reason?`: ${s.reason}`:""]}),s.evidence&&c.jsxs("span",{className:"rec-evidence",children:["Evidence: ",s.evidence]})]}):c.jsx("span",{children:"No recommendation was recorded. Read the source before you decide."}),c.jsx("span",{className:"rec-note",children:"A recommendation is not an approval. Only your click approves."})]})}const Sc="caddis hub";function Hh(i){return i>0?`(${i}) ${Sc}`:Sc}function Vn(i,s){if(!i)return"unknown";const a=Date.parse(i);if(Number.isNaN(a))return"unknown";const d=Math.max(0,Math.round((s-a)/1e3));if(d<5)return"just now";if(d<60)return`${d} s ago`;const f=Math.floor(d/60);if(f<60)return`${f} min ago`;const h=Math.floor(f/60);return h<24?`${h} h ago`:`${Math.floor(h/24)} d ago`}const Bh=(i,s)=>`Updated ${Vn(i,s)}`;function Or(i){if(!i)return"unknown";const s=new Date(i);return Number.isNaN(s.getTime())?"unknown":s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Wh(i){const s=Number(i==null?void 0:i.cap_eur),a=Number(i==null?void 0:i.committed_eur),d=(i==null?void 0:i.configured)===!0&&Number.isFinite(s)&&s>0,f=Number.isFinite(a)?a:0;return{configured:d,capEur:d?s:0,committedEur:f,pct:d?Math.min(100,Math.max(0,f/s*100)):0}}const us=i=>Object.values(i.sources??{}).some(s=>!s.ok||s.stale),Vh=500;function zd(i){const s=i==null?void 0:i.github_rate;if(!s||typeof s!="object")return null;let a=null;for(const[d,f]of Object.entries(s)){const h=f,v=typeof(h==null?void 0:h.remaining)=="number"&&Number.isFinite(h.remaining)?h.remaining:NaN;Number.isNaN(v)||(!a||v<a.remaining)&&(a={account:d,remaining:v,resetAt:typeof(h==null?void 0:h.reset_at)=="string"?h.reset_at:null})}return a}function qh(i){const s=zd(i);return s&&s.remaining<Vh?s:null}const ct=i=>Array.isArray(i)?i:[],Qh={todo:"to do","in-progress":"in progress",done:"done",moved:"moved",blocked:"blocked"},yn=new Set(["done","not-needed"]),jg="No roadmap or plan",Eg="/caddis:roadmap",Cg=[{key:"todo",label:"To do"},{key:"in-progress",label:"In progress"},{key:"blocked",label:"Blocked"},{key:"done",label:"Done"}];function Tg(i){const s={todo:[],"in-progress":[],blocked:[],done:[]};for(const a of i.rows)s[a.state==="moved"?"done":a.state].push(a);return s}const Le=i=>i&&typeof i=="object"&&!Array.isArray(i)?i:{},te=i=>typeof i=="string"?i:"",Ot=i=>typeof i=="string"&&i?i:null,bo=i=>typeof i=="number"&&Number.isInteger(i)?i:0,Pd=new Set(["todo","in-progress","done","moved","blocked"]);function Kh(i,s){const a=i.github;return[...new Set(ct(s).filter(d=>typeof d=="number"&&Number.isInteger(d)))].map(d=>{var v,S;const f=(v=a==null?void 0:a.prs)==null?void 0:v.find(y=>y.number===d),h=((S=a==null?void 0:a.merges)==null?void 0:S.some(y=>y.number===d))??!1;return{number:d,url:a!=null&&a.repo?`https://github.com/${a.repo}/pull/${d}`:null,stage:f?"in review":h?"merged":null,detail:f?`required checks ${f.required_state}`:null}})}function Yh(i,s){const a=Le(s),d=te(a.ref),f=d.lastIndexOf("#"),h=te(a.state),v=Pd.has(te(a.tile))?te(a.tile):h==="done"?"done":"todo",S=te(a.risk),y=Kh(i,a.prs),E=y.filter(j=>j.stage).map(j=>`#${j.number} ${j.stage}${j.detail?` (${j.detail})`:""}`);return{ref:d,plan:te(a.plan)||(f>0?d.slice(0,f):""),num:bo(a.num)||f>0&&Number(d.slice(f+1))||0,name:te(a.name)||d,model:te(a.model),lane:te(a.lane),risk:S,highRisk:S.toLowerCase().includes("high"),tracker:te(a.tracker),tile:v,prs:y,stage:E.length?E.join(", "):Qh[v]}}const Nc=(i,s)=>{const a=Le(s);return{milestone:i,type:te(a.type),reason:te(a.reason),check:te(a.check)}};function Gh(i,s){return yn.has(i)?"done":s.some(a=>a.type==="owner-gate")?"wait":s.length||i==="blocked"?"block":i==="in-progress"?"prog":"todo"}const ts=i=>i==="done"||i==="moved";function Xh(i,s){const a=Le(i),d=Le(a.lock),f=Le(a.stale_lock),h=Le(a.last_stop);let v=null;return te(h.reason)==="running"?v="running now":te(h.reason)&&(v=`${te(h.reason)}${h.exit!==void 0&&h.exit!==null?` (exit ${String(h.exit)})`:""}`),{running:Object.keys(d).length?{batch:String(d.batch??""),since:Ot(d.started_utc),host:Ot(d.host),pid:d.pid===void 0?null:String(d.pid)}:null,staleBatch:Object.keys(f).length?String(f.batch??""):null,lastStop:v,lastStopAt:Ot(h.utc),stopReason:te(h.reason)||null,errors:ct(a.errors).map(String),next:s}}function Zh(i){const s=new Map(i.map(d=>[d.id,d.status])),a={now:[],next:[],later:[]};for(const d of i){if(yn.has(d.status))continue;const f=d.depends.every(h=>yn.has(s.get(h)??""));d.status==="in-progress"||f&&d.blockers.length===0?a.now.push(d):d.depends.some(h=>a.now.some(v=>v.id===h))?a.next.push(d):a.later.push(d)}return a}function Jh(i,s){const a=Le(s),d=ct(a.milestones).map(j=>{const L=Le(j),P=te(L.id),O=ct(L.blockers).map(W=>Nc(P,W)),_=ct(L.phases).map(W=>Yh(i,W)),K=te(L.status);return{id:P,status:K,owner:te(L.owner)||"runner",target:Ot(L.target),depends:ct(L.depends).map(String),phases:_,blockers:O,done:_.filter(W=>ts(W.tile)).length,total:_.length,tone:Gh(K,O)}}),f=d.flatMap(j=>j.phases),h=Le(a.next),v=Object.keys(h).length?`${te(h.milestone)} ${te(h.plan)}#${String(h.phase)}`:null,S=(ct(a.lanes).length?ct(a.lanes).map(String):[...new Set(f.map(j=>j.plan))]).map(j=>({plan:j,done:f.filter(L=>L.plan===j&&ts(L.tile)).length,total:f.filter(L=>L.plan===j).length})),y=d.flatMap(j=>j.blockers),E=Array.isArray(a.waiting)?ct(a.waiting).map(j=>Nc(te(Le(j).milestone),{...Le(j),type:"owner-gate"})):d.filter(j=>!yn.has(j.status)).flatMap(j=>j.blockers.filter(L=>L.type==="owner-gate"));return{slug:te(a.roadmap),branch:Ot(a.branch),originCommit:Ot(a.origin_commit),milestones:d,lanes:S,gates:E,blockers:y,kpis:{phasesDone:f.filter(j=>ts(j.tile)).length,phasesTotal:f.length,milestonesDone:bo(a.done)||d.filter(j=>yn.has(j.status)).length,milestonesTotal:bo(a.total)||d.length,inProgress:f.filter(j=>j.tile==="in-progress").map(j=>j.ref),highRisk:f.filter(j=>j.highRisk).length,next:v??"none ready"},board:Zh(d),runner:Xh(a.runner,v),detailError:Ot(a.detail_error)}}const bh=i=>typeof i=="string"&&Pd.has(i)?i:"todo",em=i=>(i.split("/").pop()??"").replace(/\.md$/,"");function tm(i){return ct(Le(i).plans).map(s=>Le(s)).filter(s=>!s.error&&!["done","closed","archived"].includes(te(s.status).toLowerCase())).map(s=>({path:te(s.path),title:te(s.title)||te(s.path),rows:ct(s.tracker).map(a=>({phase:te(Le(a).phase),status:te(Le(a).status),state:bh(Le(a).state)})),open:bo(s.open_rows)}))}function Rd(i){const s=Le(i.roadmaps),a=Ot(i.error)??Ot(s.error),d=[],f=[];for(const E of ct(s.roadmaps)){const j=Le(E);te(j.error)?f.push({slug:te(j.roadmap),error:te(j.error)}):te(j.roadmap)&&d.push(Jh(i,j))}const h=tm(i.plans),v=new Set(d.flatMap(E=>E.lanes.map(j=>j.plan))),S=h.filter(E=>E.rows.length>0&&E.open>0&&!v.has(em(E.path))),y={roadmaps:d,errors:f,plans:h,otherPlans:S,repoError:a};return d.length||f.length?{mode:"roadmaps",...y}:a&&!i.roadmaps&&!i.plans?{mode:"error",...y}:h.length?{mode:"plans",...y}:{mode:a?"error":"none",...y}}const $g=i=>i.mode==="roadmaps"&&i.roadmaps.length===1&&i.errors.length===0;function zg(i){const s=i.milestones.flatMap(v=>v.phases).filter(v=>v.tile==="blocked").length,{phasesDone:a,phasesTotal:d}=i.kpis,f=i.gates.length?"wait":s?"block":d&&a>=d?"done":i.kpis.inProgress.length||a?"prog":"todo",h=i.runner;return{slug:i.slug,branch:i.branch,milestonesDone:i.kpis.milestonesDone,milestonesTotal:i.kpis.milestonesTotal,phasesDone:a,phasesTotal:d,pct:d?Math.round(100*a/d):0,next:i.runner.next??"none ready",runner:h.running||h.stopReason==="running"?"running":h.stopReason?`stopped: ${h.stopReason}`:"idle",gates:i.gates.length,dots:i.milestones.map(v=>({id:v.id,status:v.status})),tone:f}}function nm(i){const s=[];for(const a of Rd(i).roadmaps){const d=new Map(a.milestones.map(f=>[f.id,f.status]));for(const f of a.milestones)yn.has(f.status)||!f.depends.every(h=>yn.has(d.get(h)??""))||f.blockers.filter(h=>h.type==="owner-gate").forEach((h,v)=>s.push({roadmap:a.slug,milestone:f.id,reason:h.reason,check:h.check,id:`${a.slug}:${f.id}:${v}`}))}return s}const rm=i=>i.roadmaps.reduce((s,a)=>s+a.gates.length,0),_c=(i,s)=>i.toLowerCase().includes(s);function Pg(i,s){const a=s.trim().toLowerCase();if(!a)return null;const d={milestones:new Set,phases:new Set,count:0};for(const f of i.milestones){const h=_c([f.id,f.status,f.owner,f.target??""].join(" "),a);let v=!1;for(const S of f.phases){const y=_c([S.ref,S.name,S.model,S.lane,S.risk,S.tracker,S.prs.map(E=>`#${E.number}`).join(" ")].join(" "),a);(y||h)&&(d.phases.add(S.ref),v=!0),y&&(d.count+=1)}h&&(d.count+=1),(h||v)&&d.milestones.add(f.id)}return d}function om(i){const s=rm(Rd(i));return s>0?`Roadmap · ${s} gate${s===1?"":"s"}`:"Roadmap"}const lm=i=>!i.sources.collector.ok||i.sources.collector.stale,jc={waiting:"Waiting","owner-gate":"Owner gate",blocked:"Blocked","blocked-merge":"Blocked merge",coordinator:"Coordinator",hub:"Hub"},im={collector:"Roadmap and relay data",agents:"Session list",github:"GitHub data",coordinator:"Coordinator data"},qn=i=>Array.isArray(i)?i:[],Et=i=>i&&typeof i=="object"&&!Array.isArray(i)?i:{},rt=i=>typeof i=="string"&&i?i:null,Qn=i=>typeof i=="number"&&Number.isFinite(i)?i:null,Mr=i=>{var s;return((s=i.github)==null?void 0:s.repo)??i.name},Ec=i=>i.replace(/\\/g,"/").replace(/\/+$/,"").toLowerCase(),vn=(i,s)=>!!i&&!!s&&Ec(i)===Ec(s);function Ld(i){var a;const s=[];for(const d of qn((a=i.relays)==null?void 0:a.relays)){const f=Et(d),h=rt(f.name),v=rt(f.status);!h||!v||s.push({name:h,status:v,statusArg:rt(f.status_arg)??"",updatedAt:rt(f.updated_at),nextStep:rt(f.next_step)})}return s}function Dd(i){return Array.isArray(i.owner_items)?i.owner_items:Ld(i).filter(s=>s.status==="OWNER-GATE"&&s.statusArg).map(s=>({id:`gate:${s.name}:${s.statusArg}`,what:`owner gate ${s.statusArg} (${s.name})`,pr:null,head_sha:null,source:"relay",recommendation:null,from:s.name,since:s.updatedAt,relay:s.name}))}function Ir(i){var a;const s=[];for(const d of qn((a=i.coordinator)==null?void 0:a.queue)){const f=Et(d),h=Qn(f.pr);if(h===null)continue;const v=[];for(const S of qn(f.waits_on)){const y=Et(S),E=Qn(y.pr);E!==null&&v.push({repo:rt(y.repo)??"",pr:E})}s.push({pr:h,headSha:rt(f.head_sha)??"",title:rt(f.title)??"",state:rt(f.state)??"waiting",whyWaiting:rt(f.why_waiting)??"",waitsOn:v,hotfix:f.hotfix===!0,held:f.held===!0,since:rt(f.entered_ready_at)})}return s}function Od(i){var a;const s=(a=i.coordinator)==null?void 0:a.merging_now;return Qn(s)??Qn(Et(s).pr)}function sm(i){const s=new Set,a=[];for(const d of i)d.waiting_class!=="owner"||s.has(d.session_id)||(s.add(d.session_id),a.push(d));return a}function am(i,s){var h,v;let a=null;for(const S of i.repos){const y=Mr(S);for(const E of qn((h=S.coordinator)==null?void 0:h.deploy_checks)){const j=Et(E),L=Date.parse(rt(j.at)??""),P=Qn(j.pr);if(Number.isNaN(L)||P===null)continue;const O=rt(j.health);(!a||L>a.at)&&(a={at:L,label:`${y} #${P}`,ok:O==="ok"?!0:O==="failed"?!1:null,how:`health ${O??"unknown"}`})}for(const E of((v=S.github)==null?void 0:v.merges)??[]){const j=Date.parse(E.merged_at);if(Number.isNaN(j)||a&&a.at>=j)continue;const L=E.runs??[],P=L.some(_=>_.conclusion==="failure"),O=L.length>0&&L.every(_=>_.conclusion==="success");a={at:j,label:`${y} #${E.number}`,ok:P?!1:O?!0:null,how:P?"deploy failed":O?"deploy pass":"merged"}}}if(!a)return null;const d=Math.max(0,Math.round((s-a.at)/6e4)),f=d<60?`${d} min ago`:d<1440?`${Math.floor(d/60)} h ago`:`${Math.floor(d/1440)} d ago`;return{label:a.label,sub:`${f} · ${a.how}`,ok:a.ok}}function um(i,s,a){var h;let d=0;for(const v of i.repos)(h=v.coordinator)!=null&&h.responding&&(d+=Ir(v).filter(S=>S.state!=="blocked").length);const f=i.sessions.filter(v=>!["idle","done","unknown"].includes(v.status)).length;return{waitingOnYou:a.filter(v=>v.folder==="needs").length,blockedMerges:a.filter(v=>v.kind==="blocked-merge").length,inQueue:d,workingSessions:f,lastDeploy:am(i,s)}}function cm(i){const s=new Date(i);return Number.isNaN(s.getTime())?"unknown":s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}const Cc=(i,s)=>{var a;return(a=i.github)!=null&&a.repo?`gh pr checks ${s} -R ${i.github.repo}`:`gh pr checks ${s}`};function dm(i,s){var v,S;const a=[],d=new Set,f=y=>{d.has(y.id)||(d.add(y.id),a.push(y))},h=y=>i.repos.find(E=>vn(E.path,y));for(const y of sm(i.sessions)){const E=h(y.repo_path),j=y.name??y.session_id.slice(0,8);f({id:`waiting:${y.session_id}`,kind:"waiting",folder:"needs",repo:E?Mr(E):"no repo",title:`${j} waits on ${y.waiting_for??"you"}`,why:"The session cannot continue until you answer.",next:"Open the session and answer.",cmd:j,since:y.waiting_since,source:"agents"})}for(const y of i.repos){const E=Mr(y),j=Ld(y);for(const _ of Dd(y)){const K=_.relay?j.find(V=>V.name===_.relay):void 0,W=_.source==="relay"?(v=/^owner gate (\S+) /.exec(_.what))==null?void 0:v[1]:void 0;f({id:`owner:${y.path}:${_.id}`,kind:"owner-gate",folder:"approvals",repo:E,repoPath:y.path,title:W?`Gate ${W}: owner approval needed`:`${_.pr!==null?`PR #${_.pr}: `:""}${_.what}`,why:_.source==="relay"?"The plan stops at this owner gate. The next phase cannot start without you.":"This is on the owner-only list. Only your click approves it.",next:(K==null?void 0:K.nextStep)??(_.source==="relay"?"Read the relay, then decide.":"Read the recommendation, then decide."),cmd:_.relay?`.caddis/relay/${_.relay}.md`:_.what,since:_.since,owner:_,source:_.source==="relay"?"collector":"coordinator"})}for(const _ of nm(y))f({id:`rmgate:${y.path}:${_.id}`,kind:"owner-gate",folder:"approvals",repo:E,repoPath:y.path,title:`Roadmap ${_.roadmap}, gate ${_.milestone}: ${_.reason}`,why:`Milestone ${_.milestone} of roadmap ${_.roadmap} waits for you. Everything before it is done.`,next:"Decide, then record the gate in the roadmap with /caddis:roadmap (a docs PR).",cmd:_.check||"/caddis:roadmap",since:null,source:"collector"});for(const _ of j)_.status==="BLOCKED"&&_.statusArg.toLowerCase().startsWith("owner")&&f({id:`blocked:${y.path}:${_.name}`,kind:"blocked",folder:"needs",repo:E,repoPath:y.path,title:`Relay ${_.name}: STATUS: BLOCKED owner`,why:"The relay says the owner must decide before the next step.",next:_.nextStep??"Read the relay and decide.",cmd:`.caddis/relay/${_.name}.md`,since:_.updatedAt,source:"collector"});const L=!!y.coordinator&&y.coordinator.responding;for(const _ of Ir(y))_.state==="blocked"&&f({id:`merge:${y.path}:${_.pr}`,kind:"blocked-merge",folder:"blocked",repo:E,repoPath:y.path,title:`PR #${_.pr}${_.title?` ${_.title}`:""}: blocked`,why:_.whyWaiting||"The coordinator skips it until it is unblocked.",next:"Ask the PR session to fix it, or hold the PR.",cmd:Cc(y,_.pr),since:_.since,queue:{pr:_.pr,headSha:_.headSha,hotfix:_.hotfix,held:_.held},source:"coordinator"});const P=new Map(Ir(y).map(_=>[_.pr,_]));for(const _ of((S=y.github)==null?void 0:S.prs)??[]){if(_.draft||_.required_state!=="fail")continue;const K=_.checks.filter(V=>V.required&&V.conclusion==="failure").map(V=>V.name),W=P.get(_.number);f({id:`merge:${y.path}:${_.number}`,kind:"blocked-merge",folder:"blocked",repo:E,repoPath:y.path,title:`PR #${_.number}: required check ${K.length>0?`${K.join(", ")} `:""}failed`,why:L?"The coordinator skips it until the check passes at the head.":"This repo has no live coordinator, so its session merges its own PRs.",next:"Fix the check in the PR session.",cmd:Cc(y,_.number),since:_.updated_at,...W?{queue:{pr:W.pr,headSha:W.headSha,hotfix:W.hotfix,held:W.held}}:{},source:"github"})}const O=y.coordinator;O&&!O.responding&&O.heartbeat_at&&O.status!=="stopped"&&f({id:`coordinator:${y.path}`,kind:"coordinator",folder:"needs",repo:E,repoPath:y.path,title:`Coordinator not responding since ${cm(O.heartbeat_at)}`,why:"No heartbeat for 3 min. Its queue is frozen; the lane shows GitHub data.",next:"Check the coordinator session, then restart it.",cmd:"/caddis:coordinate",since:O.heartbeat_at,source:"coordinator"})}for(const y of["collector","agents","github","coordinator"]){const E=i.sources[y];E.ok||!E.stale||f({id:`hub:${y}`,kind:"hub",folder:"needs",repo:"hub",title:`${im[y]} has failed for over 3 min`,why:E.last_error??"The source has not answered.",next:"Read the error. The hub keeps the last good data.",cmd:"caddis hub status",since:E.last_ok_at})}return{items:a,tiles:um(i,s,a)}}const fm=24*36e5,pm=()=>({open:{},resolved:[]}),hm=(i,s)=>{var d;const a=(d=i.sources)==null?void 0:d[s];return!!a&&(!a.ok||a.stale)};function mm(i,s){var d;if(!s.repoPath)return!1;const a=(d=i.repos)==null?void 0:d.find(f=>vn(f.path,s.repoPath));if(!a)return!1;if(s.source==="github"){const f=a.github;return!!f&&typeof f.error=="string"&&!Array.isArray(f.prs)}if(s.source==="collector"){const f=Et(a.relays);return(typeof a.error=="string"||typeof f.error=="string")&&!Array.isArray(f.relays)}return!1}function Tc(i,s,a){const d=new Set(s.map(h=>h.id)),f=s.map(h=>h.stale?{...h,stale:!1}:h);for(const[h,v]of Object.entries(i))d.has(h)||!v.source||!hm(a,v.source)&&!mm(a,v)||f.push({...v,stale:!0});return f}function gm(i,s,a){const d=new Map(s.map(h=>[h.id,h])),f=i.resolved.filter(h=>a-h.resolvedAt<fm&&!d.has(h.item.id));for(const[h,v]of Object.entries(i.open))!d.has(h)&&!f.some(S=>S.item.id===h)&&f.push({item:v,resolvedAt:a});return f.sort((h,v)=>v.resolvedAt-h.resolvedAt),{open:Object.fromEntries(d),resolved:f}}function $c(i){const s=Et(i);return typeof s.id=="string"&&typeof s.title=="string"&&typeof s.kind=="string"&&typeof s.folder=="string"}function ym(i){const s=Et(i),a={};for(const[f,h]of Object.entries(Et(s.open)))$c(h)&&(a[f]=h);const d=[];for(const f of qn(s.resolved)){const h=Et(f),v=Qn(h.resolvedAt);$c(h.item)&&v!==null&&d.push({item:h.item,resolvedAt:v})}return{open:a,resolved:d}}const zc="Start a session in the folder: the hub adds it.";function Md(){return c.jsxs("section",{className:"first-run","data-testid":"first-run","aria-label":"Get started",children:[c.jsx("h2",{children:"No repos yet"}),c.jsxs("p",{children:[c.jsx(yd,{size:16,"aria-hidden":"true"})," Start a Claude Code session in a repo. The hub finds it by itself."]}),c.jsx("p",{children:"Or add a folder. The hub checks that it is a git repo."}),c.jsxs("button",{type:"button",className:"btn",disabled:!0,title:zc,"data-testid":"add-folder",children:[c.jsx(_h,{size:16,"aria-hidden":"true"}),"Add a folder"]}),c.jsxs("span",{className:"first-run-reason",children:[" ",zc]})]})}const Lr={size:15,"aria-hidden":!0};function Id({tiles:i,stale:s=!1}){const a=i.lastDeploy;return c.jsxs("div",{className:`kpi-strip${s?" stale":""}`,"data-testid":"tiles","data-stale":s?"true":void 0,children:[c.jsxs("div",{className:`kpi-tile${i.waitingOnYou>0?" urgent":""}`,children:[c.jsxs("span",{className:"kpi-label",children:[c.jsx(Ih,{...Lr}),"Waiting on you"]}),c.jsx("span",{className:"kpi-num accent","data-testid":"tile-waiting",children:i.waitingOnYou})]}),c.jsxs("div",{className:`kpi-tile${i.blockedMerges>0?" danger":""}`,children:[c.jsxs("span",{className:"kpi-label",children:[c.jsx(wh,{...Lr}),"Blocked merges"]}),c.jsx("span",{className:"kpi-num bad","data-testid":"tile-blocked",children:i.blockedMerges})]}),c.jsxs("div",{className:"kpi-tile",children:[c.jsxs("span",{className:"kpi-label",children:[c.jsx(jh,{...Lr}),"In merge queue"]}),c.jsx("span",{className:"kpi-num","data-testid":"tile-queue",children:i.inQueue})]}),c.jsxs("div",{className:"kpi-tile",children:[c.jsxs("span",{className:"kpi-label",children:[c.jsx(yd,{...Lr}),"Working sessions"]}),c.jsx("span",{className:"kpi-num","data-testid":"tile-working",children:i.workingSessions})]}),c.jsxs("div",{className:"kpi-tile deploy",children:[c.jsxs("span",{className:"kpi-label",children:[c.jsx(Rh,{...Lr}),"Last prod deploy"]}),a?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:`kpi-val ${a.ok===!0?"tone-good":a.ok===!1?"tone-bad":""}`,children:a.label}),c.jsx("span",{className:"kpi-sub tone-muted",children:a.sub})]}):c.jsx("span",{className:"kpi-val tone-muted",children:"No deploy yet"})]})]})}const vm=[{id:"needs",label:"Needs you",Icon:Zc},{id:"approvals",label:"Approvals",Icon:Lh},{id:"blocked",label:"Blocked",Icon:Dh},{id:"resolved",label:"Resolved, 24 h",Icon:yh}],Pc=(i,s)=>i?Vn(i,s).replace(/ ago$/,""):"unknown";function wm(i){var s;try{(s=navigator.clipboard)==null||s.writeText(i)}catch{}}function km(i,s){return i?s.owner?Nd(i,s.owner):s.queue?hs(i,s.queue):[]:[]}function xm({state:i,nowMs:s,api:a,act:d}){const[f,h]=Z.useState("needs"),[v,S]=Z.useState(null),[y,E]=Z.useState(!1),[j,L]=Z.useState(!1),{model:P,resolved:O,read:_}=a,K={needs:P.items.filter(M=>M.folder==="needs").length,approvals:P.items.filter(M=>M.folder==="approvals").length,blocked:P.items.filter(M=>M.folder==="blocked").length,resolved:O.length},W=f==="resolved"?O.map(M=>({item:M.item,resolved:!0,since:new Date(M.resolvedAt).toISOString()})):P.items.filter(M=>M.folder===f).map(M=>({item:M,resolved:!1,since:M.since})),V=W.find(M=>M.item.id===v)??W[0]??null,Ee=M=>{h(M),S(null),E(!1)},$e=M=>{S(M.item.id),E(!0),M.resolved||a.markRead(M.item.id)};return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"page-header",children:[c.jsx("h1",{className:"page-title",children:"Inbox"}),c.jsxs("span",{className:"page-subtitle",children:[i.repos.length," repos · ",i.sessions.length," sessions"]})]}),i.repos.length===0&&c.jsx(Md,{}),c.jsx(Id,{tiles:P.tiles,stale:us(i)}),a.notify.supported&&c.jsxs("div",{className:"notify-row",children:[c.jsxs("button",{type:"button",className:"btn",onClick:a.notify.enable,disabled:a.notify.enabled,children:[c.jsx(Zc,{size:16,"aria-hidden":"true"}),a.notify.enabled?"Notifications on":"Notify me"]}),c.jsx("span",{children:a.notify.enabled?"One browser notification per new item.":"Opt in to a browser notification for each new item."})]}),c.jsxs("div",{className:`mailbox${y&&V?" show-detail":""}`,children:[c.jsx("div",{className:"mailbox-folders",role:"tablist","aria-label":"Folders",children:vm.map(({id:M,label:he,Icon:me})=>c.jsxs("button",{type:"button",role:"tab","aria-selected":f===M,className:`folder-btn${f===M?" sel":""}`,onClick:()=>Ee(M),"data-testid":`folder-${M}`,children:[c.jsx(me,{size:16,"aria-hidden":"true"}),c.jsx("span",{children:he}),c.jsx("strong",{children:K[M]})]},M))}),c.jsxs("div",{className:"mailbox-list","data-testid":"inbox-list",children:[W.map(M=>{const he=!M.resolved&&!_.has(M.item.id);return c.jsxs("button",{type:"button",className:`item-btn${(V==null?void 0:V.item.id)===M.item.id?" sel":""}`,onClick:()=>$e(M),"data-testid":"inbox-item",children:[c.jsx("span",{className:`unread-dot${he?" on":""}`,role:"img","aria-label":he?"Unread":"Read"}),c.jsxs("span",{className:"item-main",children:[c.jsxs("span",{className:"item-meta",children:[c.jsx("span",{className:`chip chip-${M.resolved?"resolved":M.item.kind}`,children:M.resolved?"Resolved":jc[M.item.kind]}),c.jsx("span",{className:"mono",children:M.item.repo}),c.jsxs("span",{children:["· ",Pc(M.since,s)]}),!M.resolved&&M.item.stale&&c.jsx("span",{className:"chip chip-stale","data-testid":"stale-chip",title:"Its source is failing. Last good data is shown.",children:"stale"})]}),c.jsx("span",{className:"item-title",children:M.item.title})]})]},M.item.id)}),W.length===0&&c.jsxs("div",{className:"list-empty","data-testid":"inbox-empty",children:[c.jsx("strong",{children:f==="resolved"?"Nothing resolved in the last 24 h":"Nothing needs you"}),c.jsxs("div",{children:["Last check ",Vn(i.generated_at,s),"."]})]})]}),V&&c.jsxs("article",{className:"mailbox-detail","data-testid":"inbox-detail","aria-label":"Item detail",children:[c.jsxs("button",{type:"button",className:"btn back-btn",onClick:()=>E(!1),children:[c.jsx(vh,{size:16,"aria-hidden":"true"}),"Back"]}),c.jsxs("span",{className:"item-meta",children:[c.jsx("span",{className:`chip chip-${V.resolved?"resolved":V.item.kind}`,children:V.resolved?"Resolved":jc[V.item.kind]}),c.jsx("span",{className:"mono",children:V.item.repo}),c.jsxs("span",{children:["· ",V.resolved?"resolved":"since"," ",Pc(V.since,s)]}),!V.resolved&&V.item.stale&&c.jsx("span",{className:"chip chip-stale",children:"stale"})]}),c.jsx("h2",{children:V.item.title}),c.jsxs("div",{className:"detail-block",children:[c.jsx("span",{className:"detail-label",children:"Why it matters"}),c.jsx("span",{children:V.resolved?"The source cleared. No action is needed.":V.item.why})]}),!V.resolved&&V.item.owner&&c.jsx($d,{item:V.item.owner}),c.jsxs("div",{className:"detail-block",children:[c.jsx("span",{className:"detail-label",children:"Next step"}),c.jsx("span",{children:V.resolved?"Nothing.":V.item.next}),c.jsx("code",{className:"cmd",children:V.item.cmd})]}),c.jsx("div",{className:"detail-actions",children:c.jsxs("button",{type:"button",className:"btn",onClick:()=>{wm(V.item.cmd),L(!0),window.setTimeout(()=>L(!1),1500)},children:[j?c.jsx(xh,{size:16,"aria-hidden":"true"}):c.jsx(rd,{size:16,"aria-hidden":"true"}),V.item.kind==="waiting"?"Copy session name":"Copy command"]})}),!V.resolved&&(()=>{const M=i.repos.find(Se=>vn(Se.path,V.item.repoPath)),he=km(M,V.item);if(!M||he.length===0)return null;const me=V.item.owner?Ed(M,V.item.owner):void 0;return c.jsx(tl,{repo:M,specs:he,act:d,reason:me})})()]})]})]})}const Ad="caddis-hub-inbox-history",Rc="caddis-hub-inbox-read",Xo="caddis-hub-inbox-notified",Lc="caddis-hub-inbox-notify",Fd="caddis-hub-lanes-folded";function tn(){try{return window.localStorage}catch{return null}}function ms(i,s){try{const a=s==null?void 0:s.getItem(i);return a?JSON.parse(a):null}catch{return null}}function gs(i,s,a){try{a==null||a.setItem(i,JSON.stringify(s))}catch{}}const Sm=(i=tn())=>{const s=ms(Ad,i);return s?ym(s):pm()},Nm=(i,s=tn())=>gs(Ad,i,s);function ns(i,s=tn()){const a=ms(i,s);return new Set(Array.isArray(a)?a.filter(d=>typeof d=="string"):[])}function rs(i,s,a=tn()){gs(i,[...s].slice(-500),a)}const _m={items:[],tiles:{waitingOnYou:0,blockedMerges:0,inQueue:0,workingSessions:0,lastDeploy:null}},os=()=>typeof window<"u"&&"Notification"in window;function jm(i,s){const a=Z.useMemo(()=>i?dm(i,s):_m,[i,s]),[d,f]=Z.useState(()=>Sm()),h=Z.useMemo(()=>{if(!i)return a;const P=Tc(d.open,a.items,i),O=_=>P.filter(_).length;return{items:P,tiles:{...a.tiles,waitingOnYou:O(_=>_.folder==="needs"),blockedMerges:O(_=>_.kind==="blocked-merge")}}},[i,a,d.open]),[v,S]=Z.useState(()=>ns(Rc)),[y,E]=Z.useState(()=>{var P;try{return os()&&((P=tn())==null?void 0:P.getItem(Lc))==="1"&&Notification.permission==="granted"}catch{return!1}});Z.useEffect(()=>{i&&f(P=>{const O=gm(P,Tc(P.open,a.items,i),Date.now());return Nm(O),O})},[i,a]),Z.useEffect(()=>{if(!y||!i)return;const P=ns(Xo);let O=!1;for(const _ of h.items)if(!P.has(_.id)){P.add(_.id),O=!0;try{new Notification(`caddis hub: ${_.repo}`,{body:_.title,tag:_.id})}catch{}}O&&rs(Xo,P)},[y,i,h]);const j=Z.useCallback(P=>{S(O=>{if(O.has(P))return O;const _=new Set(O).add(P);return rs(Rc,_),_})},[]),L=Z.useCallback(()=>{os()&&Notification.requestPermission().then(P=>{var _;if(P!=="granted")return;try{(_=tn())==null||_.setItem(Lc,"1")}catch{}const O=ns(Xo);for(const K of h.items)O.add(K.id);rs(Xo,O),E(!0)})},[h]);return{model:h,resolved:d.resolved,read:v,markRead:j,notify:{supported:os(),enabled:y,enable:L}}}const Dc="No coordinator: each session merges its own PRs.",Em="/caddis:coordinate",Cm="gh auth login -h github.com",Ud=i=>{const s=i?new Date(i):null;return s&&!Number.isNaN(s.getTime())?s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"unknown"},Oc=i=>`Coordinator not responding since ${Ud(i)}`,Mc=i=>`Coordinator stopped at ${Ud(i)}`;function Tm(i,s){const a=i?Date.parse(i):NaN;if(Number.isNaN(a))return"unknown";const d=Math.max(0,Math.round((s-a)/6e4));return d<60?`${d} min ago`:d<1440?`${Math.floor(d/60)} h ago`:`${Math.floor(d/1440)} d ago`}const $m=(i,s,a)=>i==="waiting"?{sub:`waiting: ${s??"unknown"}`,tone:a==="peer"?"muted":"warn"}:i==="busy"||i==="running"||i==="working"?{sub:"busy",tone:"good"}:{sub:i,tone:"muted"},ls=(i,s)=>{const a=i.whyWaiting||i.state,d=[i.hotfix?"hotfix":"",i.held&&!a.includes("held")?"held":"",a].filter(Boolean);return{key:`q${i.pr}`,title:`#${i.pr} ${i.title}`.trim(),sub:s?"last known queue":d.join(" · "),tone:i.hotfix||i.held?"warn":"muted",grey:s,queue:{pr:i.pr,headSha:i.headSha,hotfix:i.hotfix,held:i.held}}};function zm(i,s,a){var $e,M,he,me,Se;const d=s.coordinator,f=d?d.status==="stopped"?"stopped":d.responding?"coordinator":"down":"none",h=Mr(s),v=i.sessions.filter(G=>vn(G.repo_path,s.path)).map(G=>{const re=$m(G.status,G.waiting_for,G.waiting_class);return{key:`s${G.session_id}`,title:G.name??G.session_id.slice(0,8),sub:re.sub,tone:re.tone}}),S=[],y=new Set;for(const G of(($e=s.github)==null?void 0:$e.prs)??[]){if(G.draft||G.required_state!=="fail")continue;const re=G.checks.filter(De=>De.required&&De.conclusion==="failure").map(De=>De.name);y.add(G.number),S.push({key:`b${G.number}`,title:`#${G.number} ${G.title}`,sub:re.length>0?`${re.join(", ")} failed`:"required check failed",tone:"bad"})}const E=Ir(s),j=[],L=[];if(f==="coordinator"){const G=Od(s);for(const re of E)re.state==="blocked"?y.has(re.pr)||(y.add(re.pr),S.push({key:`b${re.pr}`,title:`#${re.pr} ${re.title}`.trim(),sub:re.whyWaiting||"blocked",tone:"bad"})):re.state==="merging"||re.pr===G?L.push(ls(re,!1)):j.push(ls(re,!1))}else if(f==="down"||f==="stopped")for(const G of E)G.state!=="blocked"&&j.push(ls(G,!0));const P=(((M=s.github)==null?void 0:M.merges)??[]).slice().sort((G,re)=>Date.parse(re.merged_at)-Date.parse(G.merged_at)).slice(0,3).map(G=>{const re=G.runs??[],De=re.some(Oe=>Oe.conclusion==="failure"),wt=re.length>0&&re.every(Oe=>Oe.conclusion==="success"),Ve=Tm(G.merged_at,a);return{key:`d${G.number}`,title:`#${G.number} ${G.title}`,sub:De?`deploy failed · ${Ve}`:wt?`deployed ${Ve}`:`merged ${Ve}`,tone:De?"bad":wt?"good":"muted"}});let O=null;f==="none"?O=`${Dc} Start one with ${Em}.`:f==="down"?O=`${Oc((d==null?void 0:d.heartbeat_at)??null)}. The lane shows GitHub data; the last known queue is greyed.`:f==="stopped"&&(O=`${Mc((d==null?void 0:d.stopped_at)??null)}. Each session merges its own PRs until one starts again (/caddis:coordinate). The last known queue is greyed.`);const _=(he=i.sources)!=null&&he.agents?!i.sources.agents.ok:!1,K=(me=s.github)!=null&&me.error?{account:s.github.account??null,error:s.github.error,command:Cm}:null;let W;f==="down"?W=Oc((d==null?void 0:d.heartbeat_at)??null):f==="stopped"?W=Mc((d==null?void 0:d.stopped_at)??null):W=[f==="none"?"No coordinator":"",_?"sessions unknown":v.length>0?`${v.length} session${v.length===1?"":"s"}`:"no sessions running",S.length>0?`${S.length} blocked`:"",j.length>0?`${j.length} waiting`:"",L.length>0?`${L.length} merging`:"",P.length>0?`${P.length} deployed`:""].filter(Boolean).join(" · ");const V=i.sessions.some(G=>vn(G.repo_path,s.path)&&G.waiting_class==="owner"),Ee=f==="down"||s.error||(Se=s.github)!=null&&Se.error?"blocked":V?"attention":f==="none"||f==="stopped"?"idle":"ok";return{id:s.path,name:h,mode:f,tone:Ee,note:O,github:K,summary:W,columns:[{id:"sessions",title:"Sessions",cards:v,emptyText:_?'Sessions unknown: "claude agents" failed':"No sessions running"},{id:"blocked",title:"Blocked",cards:S,emptyText:"None"},{id:"waiting",title:"Waiting for its turn",cards:j,emptyText:f==="none"?Dc:"None"},{id:"merging",title:"Merging now",cards:L,emptyText:"None"},{id:"done",title:"Done and deployed",cards:P,emptyText:"None"}]}}const Pm=(i,s)=>i.repos.map(a=>zm(i,a,s)),Rm={ok:"var(--green)",attention:"var(--mk-warn)",blocked:"var(--mk-bad)",idle:"var(--text-dim)"};function Lm(){const i=ms(Fd,tn());return i&&typeof i=="object"&&!Array.isArray(i)?i:{}}function Dm({state:i,nowMs:s,api:a,act:d}){const[f,h]=Z.useState(()=>Lm()),v=Pm(i,s),S=y=>{h(E=>{const j={...E,[y]:!E[y]};return gs(Fd,j,tn()),j})};return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"page-header",children:[c.jsx("h1",{className:"page-title",children:"Overview"}),c.jsxs("span",{className:"page-subtitle",children:[i.repos.length," repos · ",i.sessions.length," sessions"]})]}),i.repos.length===0&&c.jsx(Md,{}),c.jsx(Id,{tiles:a.model.tiles,stale:us(i)}),c.jsx("div",{className:`lanes${us(i)?" stale":""}`,"data-testid":"lanes",children:v.map(y=>{const E=!f[y.id],j=i.repos.find(L=>vn(L.path,y.id));return c.jsxs("section",{className:`lane ${y.mode}`,"data-testid":"lane","aria-label":y.name,children:[c.jsxs("button",{type:"button",className:"lane-head","aria-expanded":E,onClick:()=>S(y.id),children:[c.jsx("span",{"aria-hidden":"true",style:{width:9,height:9,borderRadius:"50%",background:Rm[y.tone],flexShrink:0}}),c.jsx("span",{className:"lane-name",children:y.name}),c.jsx("span",{className:"lane-summary","data-testid":"lane-summary",children:y.summary}),c.jsx(Sh,{className:"chev",size:18,"aria-hidden":"true",style:{transform:E?"rotate(180deg)":"none"}})]}),E&&c.jsxs("div",{className:"lane-body",children:[y.github&&c.jsxs("div",{className:"lane-note gh-fail","data-testid":"gh-fail",role:"status",children:["GitHub access failed for ",y.github.account?`account ${y.github.account}`:"this repo",y.github.error?` (${y.github.error})`:"",". Sign in again with"," ",c.jsx("code",{className:"cmd",children:y.github.command})]}),y.note&&c.jsx("div",{className:"lane-note","data-testid":"lane-note",children:y.note}),c.jsx("div",{className:"lane-cols",children:y.columns.map(L=>c.jsxs("div",{className:"lane-col","data-testid":`col-${L.id}`,children:[c.jsxs("span",{className:"col-title",children:[L.title," · ",L.cards.length]}),L.cards.map(P=>c.jsxs("div",{className:`card${P.grey?" grey":""}`,"data-testid":"lane-card",children:[c.jsx("span",{className:"card-title",children:P.title}),c.jsx("span",{className:`card-sub tone-${P.tone}`,children:P.sub}),j&&P.queue&&c.jsx(tl,{repo:j,specs:hs(j,P.queue),act:d,compact:!0})]},P.key)),L.cards.length===0&&c.jsx("span",{className:"col-empty",children:L.emptyText})]},L.id))})]})]},y.id)})})]})}function Om(i){const s=i.replace(/^#\/?/,"").split("/"),a=s[0];if(a==="overview")return{page:"overview"};if(a==="activity")return{page:"activity"};if(a==="guide")return{page:"guide"};if(a==="repo"&&s[1])try{const d=s[2]==="roadmap"||s[2]==="sessions"?s[2]:"flow",f=d==="roadmap"&&s[3]?decodeURIComponent(s[3]):null;return{page:"repo",id:decodeURIComponent(s[1]),tab:d,roadmap:f}}catch{return{page:"inbox"}}return{page:"inbox"}}const ys=i=>i.repo_id??i.path,cs=i=>`#/repo/${encodeURIComponent(i)}`;function Mm(i,s,a){return s==="flow"?cs(i):`${cs(i)}/${s}${s==="roadmap"&&a?`/${encodeURIComponent(a)}`:""}`}const Im=["D1","D2","D3","D4","D5"],el=i=>i&&typeof i=="object"&&!Array.isArray(i)?i:{};function Am(i){const s=(a,d)=>{if(a.state==="merging")return[0,0,0,"",d];const f=a.hotfix?1:2;return a.state==="ready"&&!a.held?[f,0,a.since?0:1,a.since??"",d]:[f,1,0,"",d]};return i.map((a,d)=>({q:a,r:s(a,d)})).sort((a,d)=>{for(let f=0;f<a.r.length;f++){const h=a.r[f],v=d.r[f];if(h<v)return-1;if(h>v)return 1}return 0}).map(a=>a.q)}function Hd(i){const s=i.coordinator;return s?s.status==="stopped"?"stopped":s.responding?"live":"down":"none"}function Fm(i){const s=i.coordinator,a=typeof el(s==null?void 0:s.coordinator_session).name=="string"?String(el(s==null?void 0:s.coordinator_session).name):null;switch(Hd(i)){case"none":return"No coordinator: each session merges its own PRs. Start one with /caddis:coordinate.";case"stopped":return`Coordinator stopped at ${Or(s==null?void 0:s.stopped_at)}. The last known queue is greyed.`;case"down":return`Coordinator not responding since ${Or(s==null?void 0:s.heartbeat_at)}. The last known queue is greyed.`;case"live":return`Coordinator ${a??""} live, heartbeat ${Or(s==null?void 0:s.heartbeat_at)}.`.replace(" "," ")}}function Um(i){var a;const s=[];for(const d of qn((a=i.coordinator)==null?void 0:a.deploy_checks)){const f=el(d);if(typeof f.pr!="number")continue;const h=el(f.checks),v=Object.keys(h).length?Im.map(S=>({name:S,mark:typeof h[S]=="string"?String(h[S]):"skip"})):null;s.push({pr:f.pr,mergeSha:typeof f.merge_sha=="string"?f.merge_sha.slice(0,10):"",run:typeof f.deploy_run=="number"?f.deploy_run:null,health:typeof f.health=="string"?f.health:"unknown",at:typeof f.at=="string"?f.at:null,checks:v,reason:typeof f.reason=="string"&&f.reason?f.reason:null})}return s.reverse()}function Hm(i,s){var v,S;const a=Hd(s),d=Od(s),f=Am(Ir(s)),h=new Set(f.map(y=>y.pr));return{mode:a,statusText:Fm(s),grey:a==="stopped"||a==="down",merging:a==="live"?d:null,queue:f.map((y,E)=>({...y,position:E+1,merging:y.state==="merging"||y.pr===d})),deploys:Um(s),owner:Dd(s),unqueued:(((v=s.github)==null?void 0:v.prs)??[]).filter(y=>!y.draft&&!h.has(y.number)).map(y=>({number:y.number,title:y.title,requiredState:y.required_state,headSha:y.head_sha})),requests:[...((S=s.coordinator)==null?void 0:S.requests)??[]].reverse()}}const Ic={waiting:0,busy:1,idle:2},Bm=i=>({key:i.key,name:i.name??i.session_id,kind:i.kind,status:i.status,waitingFor:i.waiting_for,waitingClass:i.waiting_class,since:i.waiting_since,copies:i.copies,copyWarning:i.copies>1?`${i.copies} copies`:null});function Wm(i,s){const a=i.sources.agents,d=i.sessions.filter(h=>vn(h.repo_path,s.path)).map(Bm).sort((h,v)=>+(v.waitingClass==="owner")-+(h.waitingClass==="owner")||(Ic[h.status]??3)-(Ic[v.status]??3)||h.name.localeCompare(v.name)),f=!a.ok&&a.last_ok_at===null;return{unknown:f,error:a.ok?null:a.last_error,rows:f?[]:d}}async function Vm(i){try{return await navigator.clipboard.writeText(i),!0}catch{return!1}}const qm={owner:"you",peer:"a peer session"};function Qm({state:i,repo:s,nowMs:a}){const d=Wm(i,s),[f,h]=Z.useState(null),v=async(S,y)=>{await Vm(y)&&(h(S),window.setTimeout(()=>h(E=>E===S?null:E),2e3))};return c.jsxs("div",{className:"flow","data-testid":"sessions",children:[d.error&&c.jsxs("div",{className:"lane-note","data-testid":"sessions-error",children:[d.unknown?"Sessions unknown: ":"The last sessions read failed: ",d.error]}),d.unknown?c.jsx("p",{className:"col-empty",children:"The hub could not read the session list. PRs and deploys are on the Flow tab."}):d.rows.length===0?c.jsx("p",{className:"col-empty","data-testid":"sessions-empty",children:"No sessions running. PRs and deploys are on the Flow tab."}):c.jsx("ul",{className:"flow-list","data-testid":"sessions-table","aria-label":"Sessions of this repo",children:d.rows.map(S=>c.jsxs("li",{className:"flow-row","data-testid":"session-row",children:[c.jsxs("div",{className:"flow-row-head",children:[c.jsx("span",{className:"flow-title mono",children:S.name}),c.jsx("span",{className:`chip tone-${S.status==="waiting"?"warn":S.status==="busy"?"good":"muted"}`,children:S.status}),S.copyWarning&&c.jsx("span",{className:"chip tone-bad","data-testid":"session-copies",children:S.copyWarning}),c.jsxs("button",{type:"button",className:"btn btn-act",onClick:()=>void v(S.key,S.name),"aria-label":`Copy session name ${S.name}`,children:[c.jsx(rd,{size:14,"aria-hidden":"true"}),f===S.key?"Copied":"Copy name"]})]}),c.jsxs("span",{className:"flow-why",children:[S.kind,S.waitingFor?` · waiting for ${S.waitingClass?qm[S.waitingClass]:"an answer"}: ${S.waitingFor}`:"",S.since?` · since ${Vn(S.since,a)}`:""]}),S.copyWarning&&c.jsxs("span",{className:"flow-why tone-bad",children:["The same session runs in ",S.copies," windows. Close the extra copy."]})]},S.key))})]})}const Km=Z.lazy(()=>fs(()=>import("./RoadmapTab-CV7WCGBL.js"),__vite__mapDeps([0,1]))),Ym=[{id:"flow",label:"Flow"},{id:"roadmap",label:"Roadmap"},{id:"sessions",label:"Sessions"}],Gm={ready:"good",merging:"good",blocked:"bad",held:"warn",ci:"muted",waiting:"muted"};function Xm({repo:i,item:s,grey:a,act:d}){return c.jsxs("li",{className:`flow-row${a?" grey":""}`,"data-testid":"queue-item",children:[c.jsxs("div",{className:"flow-row-head",children:[c.jsx("span",{className:"flow-pos mono",children:s.position}),c.jsxs("span",{className:"flow-title",children:["#",s.pr," ",s.title]})]}),c.jsxs("div",{className:"flow-flags",children:[c.jsx("span",{className:`chip tone-${Gm[s.state]??"muted"}`,children:s.state}),s.merging&&c.jsx("span",{className:"chip tone-good",children:"merging now"}),s.hotfix&&c.jsx("span",{className:"chip tone-warn","data-testid":"flag-hotfix",children:"hotfix"}),s.held&&c.jsx("span",{className:"chip tone-warn","data-testid":"flag-held",children:"held"})]}),s.whyWaiting&&c.jsx("span",{className:"flow-why",children:s.whyWaiting}),s.waitsOn.length>0&&c.jsxs("span",{className:"flow-why",children:["Waits on ",s.waitsOn.map(f=>`${f.repo.replace("__","/")}#${f.pr}`).join(", ")]}),c.jsx(tl,{repo:i,specs:hs(i,{pr:s.pr,headSha:s.headSha,hotfix:s.hotfix,held:s.held}),act:d})]})}function Zm({state:i,repo:s,nowMs:a,act:d}){const f=Hm(i,s);return c.jsxs("div",{className:"flow","data-testid":"flow",children:[c.jsx("div",{className:`lane-note flow-status ${f.mode}`,"data-testid":"flow-status",children:f.statusText}),f.owner.length>0&&c.jsxs("section",{className:"flow-section","aria-label":"Owner approvals",children:[c.jsxs("h2",{className:"flow-h",children:["Needs your approval · ",f.owner.length]}),c.jsx("ul",{className:"flow-list",children:f.owner.map(h=>c.jsxs("li",{className:"flow-row","data-testid":"owner-item",children:[c.jsxs("span",{className:"flow-title",children:[h.pr!==null?`#${h.pr} `:"",h.what]}),c.jsx($d,{item:h}),c.jsx(tl,{repo:s,specs:Nd(s,h),act:d,reason:Ed(s,h)})]},h.id))})]}),c.jsxs("section",{className:"flow-section","aria-label":"Merge queue",children:[c.jsxs("h2",{className:"flow-h",children:["Merge queue · ",f.queue.length,f.grey?" · last known":""]}),f.mode==="none"?c.jsx("p",{className:"col-empty",children:"No queue: this repo has no coordinator."}):f.queue.length===0?c.jsx("p",{className:"col-empty",children:"The queue is empty."}):c.jsx("ol",{className:"flow-list",children:f.queue.map(h=>c.jsx(Xm,{repo:s,item:h,grey:f.grey,act:d},h.pr))})]}),c.jsxs("section",{className:"flow-section","aria-label":"Deploy checks",children:[c.jsx("h2",{className:"flow-h",children:"Deploy checks"}),f.deploys.length===0?c.jsx("p",{className:"col-empty",children:"No deploy check recorded."}):c.jsx("ul",{className:"flow-list",children:f.deploys.map(h=>c.jsxs("li",{className:"flow-row","data-testid":"deploy-check",children:[c.jsxs("div",{className:"flow-row-head",children:[c.jsxs("span",{className:"flow-title",children:["#",h.pr," ",c.jsx("span",{className:"mono",children:h.mergeSha})]}),c.jsxs("span",{className:`chip tone-${h.health==="ok"?"good":h.health==="failed"?"bad":"muted"}`,children:["health ",h.health]})]}),h.checks&&c.jsx("div",{className:"flow-flags","data-testid":"deploy-marks",children:h.checks.map(v=>c.jsxs("span",{className:`chip tone-${v.mark==="pass"?"good":v.mark==="fail"?"bad":"muted"}`,children:[v.name," ",v.mark]},v.name))}),c.jsxs("span",{className:"flow-why",children:[h.run!==null?`run ${h.run} · `:"",Vn(h.at,a),h.reason?` · ${h.reason}`:""]})]},`${h.pr}-${h.mergeSha}`))})]}),f.unqueued.length>0&&c.jsxs("section",{className:"flow-section","aria-label":"Open PRs not in the queue",children:[c.jsxs("h2",{className:"flow-h",children:["Open PRs not in the queue · ",f.unqueued.length]}),c.jsx("ul",{className:"flow-list",children:f.unqueued.map(h=>c.jsxs("li",{className:"flow-row","data-testid":"unqueued-pr",children:[c.jsxs("span",{className:"flow-title",children:["#",h.number," ",h.title]}),c.jsxs("span",{className:`flow-why tone-${h.requiredState==="fail"?"bad":h.requiredState==="pass"?"good":"muted"}`,children:["required checks ",h.requiredState]})]},h.number))})]}),f.requests.length>0&&c.jsxs("section",{className:"flow-section","aria-label":"Your requests",children:[c.jsx("h2",{className:"flow-h",children:"Your requests"}),c.jsx("ul",{className:"flow-list",children:f.requests.slice(0,10).map(h=>c.jsxs("li",{className:"flow-row","data-testid":"request-log",children:[c.jsx("span",{className:`tone-${Td(h.status)}`,children:Cd(h)}),c.jsxs("span",{className:"flow-why",children:[h.pr!==null?`PR #${h.pr}`:h.what," · ",Vn(h.created_at,a)]})]},h.id))})]})]})}function Jm({state:i,repo:s,nowMs:a,act:d,tab:f,roadmap:h}){const v=ys(s);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"page-header",children:[c.jsx("h1",{className:"page-title",children:Mr(s)}),c.jsx("span",{className:"page-subtitle",children:s.name})]}),c.jsx("nav",{className:"repo-tabs",role:"tablist","aria-label":"Repo views",children:Ym.map(S=>c.jsx("a",{role:"tab","aria-selected":f===S.id,"aria-current":f===S.id?"page":void 0,className:`folder-btn${f===S.id?" sel":""}`,href:Mm(v,S.id),"data-testid":`tab-${S.id}`,children:S.id==="roadmap"?om(s):S.label},S.id))}),f==="flow"&&c.jsx(Zm,{state:i,repo:s,nowMs:a,act:d}),f==="roadmap"&&c.jsx(Z.Suspense,{fallback:c.jsx("p",{className:"page-subtitle",children:"Loading..."}),children:c.jsx(Km,{repo:s,slug:h,stale:lm(i),lastOkAt:i.sources.collector.last_ok_at},h??"")}),f==="sessions"&&c.jsx(Qm,{state:i,repo:s,nowMs:a})]})}const bm=1,Ac={collector:"Plans and roadmaps",agents:"Claude sessions",github:"GitHub",coordinator:"Coordinator"};function eg(i){var d,f;const s=[];(i.schema>bm||i.update_needed)&&s.push({id:"schema",tone:"bad",text:"This hub is older than its data. Update the hub:",command:"npm i -g @caddis/cli@latest"});const a=(d=i.sources)==null?void 0:d.agents;a&&!a.ok&&s.push({id:"agents-failed",tone:"bad",text:`Session list unavailable: "claude agents" failed${a.last_error?` (${a.last_error})`:""}.`});for(const h of Object.keys(Ac)){const v=(f=i.sources)==null?void 0:f[h];v!=null&&v.stale&&(h==="agents"&&!v.ok||s.push({id:`stale-${h}`,tone:"warn",text:`${Ac[h]} data is stale. Last good read: ${v.last_ok_at?Or(v.last_ok_at):"never"}.`}))}return s}function tg({state:i}){const s=eg(i);return s.length===0?null:c.jsx("div",{className:"banners",role:"region","aria-label":"Warnings",children:s.map(a=>c.jsxs("div",{className:`banner ${a.tone}`,role:"status","data-testid":`banner-${a.id}`,children:[a.tone==="bad"?c.jsx(Ph,{size:16,"aria-hidden":"true"}):c.jsx(Mh,{size:16,"aria-hidden":"true"}),c.jsxs("span",{children:[a.text,a.command&&c.jsxs(c.Fragment,{children:[" ",c.jsx("code",{className:"cmd",children:a.command})]})]})]},a.id))})}const Bd="caddis-hub-theme",ng=["dark","light","system"];function Wd(){try{return window.localStorage}catch{return null}}function rg(i=Wd()){try{const s=i==null?void 0:i.getItem(Bd);return s==="dark"||s==="light"||s==="system"?s:"system"}catch{return"system"}}function og(i,s=Wd()){try{s==null||s.setItem(Bd,i)}catch{}}function lg(i,s){return i==="system"?s?"dark":"light":i}const ig={dark:zh,light:Oh,system:$h};function sg({state:i,nowMs:s,theme:a,onTheme:d}){const f=Wh(i==null?void 0:i.spend),h=i==null?void 0:i.versions,v=qh(i),S=zd(i);return c.jsxs("footer",{className:"sidebar-footer",children:[c.jsxs("div",{className:"footer-meta",children:[c.jsxs("div",{className:"updated-line",children:[c.jsx(Nh,{size:14,"aria-hidden":"true"}),c.jsx("span",{"data-testid":"data-age",children:i?Bh(i.generated_at,s):"Waiting for data"})]}),c.jsxs("div",{className:"spend-box",children:[c.jsxs("div",{className:"spend-row",children:[c.jsx("span",{children:"agy spend (24 h)"}),c.jsx("span",{className:"mono",children:f.configured?`${f.committedEur.toFixed(2)} / ${f.capEur.toFixed(0)} EUR`:"no cap set"})]}),c.jsx("div",{className:"meter-track",role:"progressbar","aria-label":"agy spend","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(f.pct),children:c.jsx("div",{className:`meter-fill${f.pct>=80?" hot":""}`,style:{width:`${f.pct}%`}})})]}),S&&!v&&c.jsxs("div",{className:"quota-line mono","data-testid":"quota",children:["GitHub quota ",S.remaining," left (",S.account,")"]}),v&&c.jsxs("div",{className:"quota-low","data-testid":"quota-low",role:"status",children:["GitHub quota low: ",v.remaining," left (",v.account,")",v.resetAt?`, resets ${Or(v.resetAt)}`:"",". Polling slows."]}),h&&c.jsxs("div",{className:"versions mono",children:["hub ",h.hub," | pool ",h.pool??"-"," | plugin ",h.plugin??"-"]})]}),c.jsx("div",{className:"theme-switch",role:"group","aria-label":"Theme",children:ng.map(y=>{const E=ig[y];return c.jsxs("button",{type:"button",className:`theme-btn${a===y?" active":""}`,"aria-pressed":a===y,title:y,onClick:()=>d(y),children:[c.jsx(E,{size:15,"aria-hidden":"true"}),c.jsx("span",{children:y})]},y)})})]})}const ag="/assets/mark-small-CwCIyjyC.svg",ug="/assets/wordmark-CD0s2ofS.svg";function Fc(){return c.jsxs("span",{className:"brand-logo",children:[c.jsx("img",{src:ag,alt:"",width:36,height:36,className:"brand-mark"}),c.jsxs("span",{className:"brand-stack",children:[c.jsx("img",{src:ug,alt:"CADDIS",width:100,height:20,className:"brand-wordmark"}),c.jsx("span",{className:"brand-sub",children:"hub"})]})]})}function cg(i,s){var f;return i.error||(f=i.github)!=null&&f.error?"blocked":s.sessions.some(h=>h.repo_path===i.path&&h.waiting_class==="owner")||i.coordinator&&s.sources.coordinator.stale?"attention":!i.coordinator&&!s.sessions.some(h=>h.repo_path===i.path)?"idle":"ok"}function Dr({href:i,active:s,icon:a,label:d,badge:f,onGo:h}){return c.jsx("li",{children:c.jsxs("a",{className:`nav-link${s?" active":""}`,href:i,"aria-current":s?"page":void 0,onClick:h,children:[c.jsxs("span",{className:"nav-link-left",children:[a,c.jsx("span",{className:"nav-text",children:d})]}),f]})})}function dg({route:i,state:s,inbox:a,open:d,onToggle:f,children:h}){const v=()=>f(!1);return c.jsxs(c.Fragment,{children:[c.jsxs("header",{className:"mobile-topbar",children:[c.jsxs("button",{type:"button",className:"menu-btn","aria-label":"Open navigation menu","aria-expanded":d,"aria-controls":"app-sidebar",onClick:()=>f(!d),children:[d?c.jsx(Ah,{size:18}):c.jsx(Th,{size:18}),c.jsx("span",{children:"Menu"})]}),c.jsx(Fc,{})]}),c.jsx("div",{className:`drawer-backdrop${d?" open":""}`,onClick:v,"aria-hidden":"true"}),c.jsxs("aside",{className:`sidebar${d?" drawer-open":""}`,id:"app-sidebar",children:[c.jsxs("nav",{className:"sidebar-top","aria-label":"Main",children:[c.jsx("div",{className:"brand-row",children:c.jsx(Fc,{})}),c.jsxs("ul",{className:"nav-list",children:[c.jsx(Dr,{href:"#/inbox",active:i.page==="inbox",icon:c.jsx(Eh,{size:18}),label:"Inbox",badge:a>0?c.jsx("span",{className:"inbox-badge",children:a}):void 0,onGo:v}),c.jsx(Dr,{href:"#/overview",active:i.page==="overview",icon:c.jsx(Ch,{size:18}),label:"Overview",onGo:v})]}),c.jsx("div",{className:"nav-section-label",children:"Repos"}),c.jsxs("ul",{className:"nav-list",children:[(s==null?void 0:s.repos.length)===0&&c.jsx("li",{className:"nav-empty",children:"No repos yet"}),s==null?void 0:s.repos.map(S=>{const y=ys(S),E=i.page==="repo"&&i.id===y;return c.jsx(Dr,{href:cs(y),active:E,icon:c.jsx("span",{className:`repo-dot ${cg(S,s)}`,"aria-hidden":"true"}),label:S.name,onGo:v},S.path)})]}),c.jsx("div",{className:"nav-section-label",children:"More"}),c.jsxs("ul",{className:"nav-list",children:[c.jsx(Dr,{href:"#/activity",active:i.page==="activity",icon:c.jsx(gh,{size:18}),label:"Activity",onGo:v}),c.jsx(Dr,{href:"#/guide",active:i.page==="guide",icon:c.jsx(kh,{size:18}),label:"caddis guide",onGo:v})]})]}),h]})]})}const fg="/assets/favicon-DtHQyAC1.svg",pg="/assets/favicon-dot-DHAVYP15.svg",hg=i=>i?pg:fg;function mg(i){let s=document.querySelector('link[rel="icon"]');s||(s=document.createElement("link"),s.rel="icon",document.head.appendChild(s)),s.type="image/svg+xml",s.href=hg(i)}const gg=()=>{var i;return((i=window.matchMedia)==null?void 0:i.call(window,"(prefers-color-scheme: dark)").matches)??!0};function yg(){const[i,s]=Z.useState(()=>rg());return Z.useEffect(()=>{const a=()=>{document.documentElement.dataset.theme=lg(i,gg())};if(a(),i!=="system"||!window.matchMedia)return;const d=window.matchMedia("(prefers-color-scheme: dark)");return d.addEventListener("change",a),()=>d.removeEventListener("change",a)},[i]),[i,a=>{og(a),s(a)}]}const vg=1e4;function wg(){const[i,s]=Z.useState(null),[a,d]=Z.useState(null),[f,h]=Z.useState(!0),v=Z.useRef(void 0),S=Z.useRef(!0),y=Z.useCallback(async()=>{try{const j=await nh();if(!S.current)return;s(j),d(null)}catch(j){if(!S.current)return;d(j instanceof is&&j.status===401?"unauthorized":"network")}finally{S.current&&h(!1)}},[]);Z.useEffect(()=>{S.current=!0;const j=()=>window.clearInterval(v.current),L=()=>{j(),v.current=window.setInterval(()=>void y(),vg)},P=()=>{document.hidden?j():(y(),L())};return y(),document.hidden||L(),document.addEventListener("visibilitychange",P),()=>{S.current=!1,j(),document.removeEventListener("visibilitychange",P)}},[y]);const E=Z.useCallback(()=>void y(),[y]);return{state:i,error:a,loading:f,refresh:E}}const kg=Z.lazy(()=>fs(()=>import("./Guide-Df0Kg8wI.js"),__vite__mapDeps([2,3])).then(i=>({default:i.Guide}))),xg=Z.lazy(()=>fs(()=>import("./Activity-BgqFFOv1.js"),__vite__mapDeps([4,1])));function Sg(i){const[s,a]=Z.useState(()=>Date.now());return Z.useEffect(()=>{const d=window.setInterval(()=>a(Date.now()),i);return()=>window.clearInterval(d)},[i]),s}function Ng(){const[i,s]=Z.useState(()=>window.location.hash);return Z.useEffect(()=>{const a=()=>s(window.location.hash);return window.addEventListener("hashchange",a),()=>window.removeEventListener("hashchange",a)},[]),Om(i)}function _g(){const{state:i,error:s,loading:a,refresh:d}=wg(),f=lh(d),h=Sg(5e3),v=Ng(),[S,y]=yg(),[E,j]=Z.useState(!1),L=jm(i,h),P=L.model.items.length;Z.useEffect(()=>{document.title=Hh(P),mg(P>0)},[P]);let O;if(s==="unauthorized")O=c.jsxs("div",{className:"notice","data-testid":"signin",children:[c.jsx("h1",{className:"page-title",children:"Signed out"}),c.jsxs("p",{children:["Run ",c.jsx("code",{className:"cmd",children:"caddis hub open"})," to sign in."]})]});else if(!i)O=c.jsx("p",{className:"page-subtitle",children:a?"Loading...":"The hub did not answer. Retrying."});else if(v.page==="inbox")O=c.jsx(xm,{state:i,nowMs:h,api:L,act:f});else if(v.page==="overview")O=c.jsx(Dm,{state:i,nowMs:h,api:L,act:f});else if(v.page==="repo"){const _=i.repos.find(K=>ys(K)===v.id);O=_?c.jsx(Jm,{state:i,repo:_,nowMs:h,act:f,tab:v.tab,roadmap:v.roadmap},v.id):c.jsxs("div",{className:"notice",children:[c.jsx("h1",{className:"page-title",children:v.id}),c.jsx("p",{children:"This repo is not in the hub registry."})]})}else v.page==="guide"?O=c.jsx(Z.Suspense,{fallback:c.jsx("p",{className:"page-subtitle",children:"Loading..."}),children:c.jsx(kg,{guide:i.guide,versions:i.versions})}):O=c.jsx(Z.Suspense,{fallback:c.jsx("p",{className:"page-subtitle",children:"Loading..."}),children:c.jsx(xg,{state:i})});return c.jsxs("div",{className:"app-shell",children:[c.jsx(dg,{route:v,state:i,inbox:P,open:E,onToggle:j,children:c.jsx(sg,{state:i,nowMs:h,theme:S,onTheme:y})}),c.jsx("main",{className:"main-area",id:"main-content",children:c.jsxs("div",{className:"page-wrap",children:[i&&c.jsx(tg,{state:i}),s==="network"&&i&&c.jsx("div",{className:"banner warn",role:"status",children:"The hub did not answer. Showing the last data."}),O]})})]})}eh();const Uc=document.getElementById("root");Uc&&Gp.createRoot(Uc).render(c.jsx(Z.StrictMode,{children:c.jsx(_g,{})}));export{Im as D,jg as N,Cg as P,Qh as T,qn as a,ys as b,de as c,Mr as d,Mm as e,Rd as f,Or as g,Pg as h,Eg as i,c as j,lm as k,zg as l,$g as o,Tg as p,Z as r};
|
|
221
|
+
*/const kd={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};kd.node;const Ah=de(kd),ps={hotfix:"Mark hotfix",unhotfix:"Unmark hotfix",hold:"Hold",release:"Release",approve:"Approve",decline:"Decline"},Jo={hotfix:"hotfix",unhotfix:"hotfix",hold:"hold",release:"hold",approve:"approve",decline:"approve"},xd=i=>i.repo_id??null,Sd=(i,s,a)=>`${i}:${Jo[s]}:${a}`;function hs(i,s){const a=xd(i),d=_d(i,s.pr)??s.headSha;if(!a||!d)return[];const f=h=>({key:Sd(a,h,s.pr),label:ps[h],body:{repo_id:a,action:h,pr:s.pr,head_sha:d}});return[f(s.hotfix?"unhotfix":"hotfix"),f(s.held?"release":"hold")]}function Nd(i,s){const a=xd(i);if(!a)return[];const d=s.pr!==null?_d(i,s.pr)??s.head_sha:null;return["approve","decline"].map(f=>({key:Sd(a,f,s.what),label:ps[f],body:{repo_id:a,action:f,pr:s.pr,head_sha:d,what:s.what}}))}function _d(i,s){var a,d,f;return((f=(d=(a=i.github)==null?void 0:a.prs)==null?void 0:d.find(h=>h.number===s))==null?void 0:f.head_sha)??null}function jd(i){return i.actions?i.actions.enabled?null:i.actions.reason??"Actions need a live coordinator.":"Actions need a live coordinator."}function Ed(i,s){var f;const a=jd(i);return a||s.pr===null?a:(((f=i.coordinator)==null?void 0:f.queue)??[]).some(h=>(h==null?void 0:h.pr)===s.pr)?null:`PR #${s.pr} is not in the coordinator queue.`}function Fh(i,s){var f;const a=((f=i.coordinator)==null?void 0:f.requests)??[],d=Jo[s.body.action];for(let h=a.length-1;h>=0;h--){const v=a[h],S=v.action;if(!(!(S in Jo)||Jo[S]!==d)&&(s.body.what!==void 0?v.what===s.body.what&&v.pr===s.body.pr:v.pr===s.body.pr))return v}return null}function Cd(i){const s=ps[i.action]??i.action;switch(i.status){case"requested":return`${s}: requested. Waiting for the coordinator.`;case"done":return`${s}: done.`;case"rejected":return`${s}: rejected${i.reason?`: ${i.reason}`:""}.`;case"expired":return`${s}: expired before the coordinator read it.`;case"not_picked_up":return`${s}: not picked up. The coordinator has not read requests for 2 min.`}}const Td=i=>i==="done"?"good":i==="requested"?"muted":i==="not_picked_up"?"warn":"bad";function Uh(i,s,a){const d=Fh(i,s);return(a==null?void 0:a.status)==="sending"?{text:`${s.label}: sending...`,tone:"muted"}:(a==null?void 0:a.status)==="refused"?{text:`${s.label}: refused. ${a.reason??""}`.trim(),tone:"bad"}:(a==null?void 0:a.status)==="sent"&&(!d||d.id!==a.requestId)?{text:`${s.label}: requested. Waiting for the coordinator.`,tone:"muted"}:d?{text:Cd(d),tone:Td(d.status)}:null}function tl({repo:i,specs:s,act:a,compact:d=!1,reason:f}){if(s.length===0)return null;const h=f!==void 0?f:jd(i),v=new Set,S=[];for(const y of s){if(v.has(y.key))continue;v.add(y.key);const E=Uh(i,y,a.local[y.key]);E&&S.push({key:y.key,...E})}return c.jsxs("div",{className:`action-row${d?" compact":""}`,"data-testid":"actions",children:[c.jsx("div",{className:"action-buttons",children:s.map(y=>{var E;return c.jsx("button",{type:"button",className:"btn btn-act",disabled:h!==null||((E=a.local[y.key])==null?void 0:E.status)==="sending",title:h??void 0,onClick:()=>a.run(y),"data-testid":`act-${y.body.action}`,children:y.label},`${y.key}:${y.body.action}`)})}),h&&!d&&c.jsx("span",{className:"action-reason","data-testid":"action-reason",children:h}),S.map(y=>c.jsx("span",{className:`request-status tone-${y.tone}`,"data-testid":"request-status",role:"status",children:y.text},y.key))]})}function $d({item:i}){const s=i.recommendation,a=i.from?`from ${i.from}`:i.source==="coordinator"?"from the coordinator":"from the asking session";return c.jsxs("div",{className:"detail-block recommendation","data-testid":"recommendation",children:[c.jsxs("span",{className:"detail-label",children:["Recommendation, ",a]}),s?c.jsxs(c.Fragment,{children:[c.jsxs("span",{children:[c.jsx("strong",{className:`rec-${s.decision}`,children:s.decision==="approve"?"Approve":"Hold"}),s.reason?`: ${s.reason}`:""]}),s.evidence&&c.jsxs("span",{className:"rec-evidence",children:["Evidence: ",s.evidence]})]}):c.jsx("span",{children:"No recommendation was recorded. Read the source before you decide."}),c.jsx("span",{className:"rec-note",children:"A recommendation is not an approval. Only your click approves."})]})}const Sc="caddis hub";function Hh(i){return i>0?`(${i}) ${Sc}`:Sc}function Vn(i,s){if(!i)return"unknown";const a=Date.parse(i);if(Number.isNaN(a))return"unknown";const d=Math.max(0,Math.round((s-a)/1e3));if(d<5)return"just now";if(d<60)return`${d} s ago`;const f=Math.floor(d/60);if(f<60)return`${f} min ago`;const h=Math.floor(f/60);return h<24?`${h} h ago`:`${Math.floor(h/24)} d ago`}const Bh=(i,s)=>`Updated ${Vn(i,s)}`;function Or(i){if(!i)return"unknown";const s=new Date(i);return Number.isNaN(s.getTime())?"unknown":s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Wh(i){const s=Number(i==null?void 0:i.cap_eur),a=Number(i==null?void 0:i.committed_eur),d=(i==null?void 0:i.configured)===!0&&Number.isFinite(s)&&s>0,f=Number.isFinite(a)?a:0;return{configured:d,capEur:d?s:0,committedEur:f,pct:d?Math.min(100,Math.max(0,f/s*100)):0}}const us=i=>Object.values(i.sources??{}).some(s=>!s.ok||s.stale),Vh=500;function zd(i){const s=i==null?void 0:i.github_rate;if(!s||typeof s!="object")return null;let a=null;for(const[d,f]of Object.entries(s)){const h=f,v=typeof(h==null?void 0:h.remaining)=="number"&&Number.isFinite(h.remaining)?h.remaining:NaN;Number.isNaN(v)||(!a||v<a.remaining)&&(a={account:d,remaining:v,resetAt:typeof(h==null?void 0:h.reset_at)=="string"?h.reset_at:null})}return a}function qh(i){const s=zd(i);return s&&s.remaining<Vh?s:null}const ct=i=>Array.isArray(i)?i:[],Qh={todo:"to do","in-progress":"in progress",done:"done",moved:"moved",blocked:"blocked"},yn=new Set(["done","not-needed"]),Eg="No roadmap or plan",Cg="/caddis:roadmap",Tg=[{key:"todo",label:"To do"},{key:"in-progress",label:"In progress"},{key:"blocked",label:"Blocked"},{key:"done",label:"Done"}];function Kh(i){const s={todo:[],"in-progress":[],blocked:[],done:[]};for(const a of i.rows)s[a.state==="moved"?"done":a.state].push(a);return s}function $g(i){const s=Kh(i),a=i.rows.length,d=s.done.length;return{total:a,done:d,inProgress:s["in-progress"].length,blocked:s.blocked.length,todo:s.todo.length,pct:a===0?0:Math.round(d/a*100)}}function zg(i){let s=null;for(const a of i)a.open===0||a.rows.length===0||(!s||(a.changedAt??-1)>(s.changedAt??-1))&&(s=a);return s?s.path:null}const Le=i=>i&&typeof i=="object"&&!Array.isArray(i)?i:{},te=i=>typeof i=="string"?i:"",Ot=i=>typeof i=="string"&&i?i:null,bo=i=>typeof i=="number"&&Number.isInteger(i)?i:0,Pd=new Set(["todo","in-progress","done","moved","blocked"]);function Yh(i,s){const a=i.github;return[...new Set(ct(s).filter(d=>typeof d=="number"&&Number.isInteger(d)))].map(d=>{var v,S;const f=(v=a==null?void 0:a.prs)==null?void 0:v.find(y=>y.number===d),h=((S=a==null?void 0:a.merges)==null?void 0:S.some(y=>y.number===d))??!1;return{number:d,url:a!=null&&a.repo?`https://github.com/${a.repo}/pull/${d}`:null,stage:f?"in review":h?"merged":null,detail:f?`required checks ${f.required_state}`:null}})}function Gh(i,s){const a=Le(s),d=te(a.ref),f=d.lastIndexOf("#"),h=te(a.state),v=Pd.has(te(a.tile))?te(a.tile):h==="done"?"done":"todo",S=te(a.risk),y=Yh(i,a.prs),E=y.filter(j=>j.stage).map(j=>`#${j.number} ${j.stage}${j.detail?` (${j.detail})`:""}`);return{ref:d,plan:te(a.plan)||(f>0?d.slice(0,f):""),num:bo(a.num)||f>0&&Number(d.slice(f+1))||0,name:te(a.name)||d,model:te(a.model),lane:te(a.lane),risk:S,highRisk:S.toLowerCase().includes("high"),tracker:te(a.tracker),tile:v,prs:y,stage:E.length?E.join(", "):Qh[v]}}const Nc=(i,s)=>{const a=Le(s);return{milestone:i,type:te(a.type),reason:te(a.reason),check:te(a.check)}};function Xh(i,s){return yn.has(i)?"done":s.some(a=>a.type==="owner-gate")?"wait":s.length||i==="blocked"?"block":i==="in-progress"?"prog":"todo"}const ts=i=>i==="done"||i==="moved";function Zh(i,s){const a=Le(i),d=Le(a.lock),f=Le(a.stale_lock),h=Le(a.last_stop);let v=null;return te(h.reason)==="running"?v="running now":te(h.reason)&&(v=`${te(h.reason)}${h.exit!==void 0&&h.exit!==null?` (exit ${String(h.exit)})`:""}`),{running:Object.keys(d).length?{batch:String(d.batch??""),since:Ot(d.started_utc),host:Ot(d.host),pid:d.pid===void 0?null:String(d.pid)}:null,staleBatch:Object.keys(f).length?String(f.batch??""):null,lastStop:v,lastStopAt:Ot(h.utc),stopReason:te(h.reason)||null,errors:ct(a.errors).map(String),next:s}}function Jh(i){const s=new Map(i.map(d=>[d.id,d.status])),a={now:[],next:[],later:[]};for(const d of i){if(yn.has(d.status))continue;const f=d.depends.every(h=>yn.has(s.get(h)??""));d.status==="in-progress"||f&&d.blockers.length===0?a.now.push(d):d.depends.some(h=>a.now.some(v=>v.id===h))?a.next.push(d):a.later.push(d)}return a}function bh(i,s){const a=Le(s),d=ct(a.milestones).map(j=>{const L=Le(j),P=te(L.id),O=ct(L.blockers).map(W=>Nc(P,W)),_=ct(L.phases).map(W=>Gh(i,W)),K=te(L.status);return{id:P,status:K,owner:te(L.owner)||"runner",target:Ot(L.target),depends:ct(L.depends).map(String),phases:_,blockers:O,done:_.filter(W=>ts(W.tile)).length,total:_.length,tone:Xh(K,O)}}),f=d.flatMap(j=>j.phases),h=Le(a.next),v=Object.keys(h).length?`${te(h.milestone)} ${te(h.plan)}#${String(h.phase)}`:null,S=(ct(a.lanes).length?ct(a.lanes).map(String):[...new Set(f.map(j=>j.plan))]).map(j=>({plan:j,done:f.filter(L=>L.plan===j&&ts(L.tile)).length,total:f.filter(L=>L.plan===j).length})),y=d.flatMap(j=>j.blockers),E=Array.isArray(a.waiting)?ct(a.waiting).map(j=>Nc(te(Le(j).milestone),{...Le(j),type:"owner-gate"})):d.filter(j=>!yn.has(j.status)).flatMap(j=>j.blockers.filter(L=>L.type==="owner-gate"));return{slug:te(a.roadmap),branch:Ot(a.branch),originCommit:Ot(a.origin_commit),milestones:d,lanes:S,gates:E,blockers:y,kpis:{phasesDone:f.filter(j=>ts(j.tile)).length,phasesTotal:f.length,milestonesDone:bo(a.done)||d.filter(j=>yn.has(j.status)).length,milestonesTotal:bo(a.total)||d.length,inProgress:f.filter(j=>j.tile==="in-progress").map(j=>j.ref),highRisk:f.filter(j=>j.highRisk).length,next:v??"none ready"},board:Jh(d),runner:Zh(a.runner,v),detailError:Ot(a.detail_error)}}const em=i=>typeof i=="string"&&Pd.has(i)?i:"todo",tm=i=>(i.split("/").pop()??"").replace(/\.md$/,"");function nm(i){return ct(Le(i).plans).map(s=>Le(s)).filter(s=>!s.error&&!["done","closed","archived"].includes(te(s.status).toLowerCase())).map(s=>({path:te(s.path),title:te(s.title)||te(s.path),rows:ct(s.tracker).map(a=>({phase:te(Le(a).phase),status:te(Le(a).status),state:em(Le(a).state)})),open:bo(s.open_rows),changedAt:typeof s.changed_at=="number"&&Number.isFinite(s.changed_at)?s.changed_at:null}))}function Rd(i){const s=Le(i.roadmaps),a=Ot(i.error)??Ot(s.error),d=[],f=[];for(const E of ct(s.roadmaps)){const j=Le(E);te(j.error)?f.push({slug:te(j.roadmap),error:te(j.error)}):te(j.roadmap)&&d.push(bh(i,j))}const h=nm(i.plans),v=new Set(d.flatMap(E=>E.lanes.map(j=>j.plan))),S=h.filter(E=>E.rows.length>0&&E.open>0&&!v.has(tm(E.path))),y={roadmaps:d,errors:f,plans:h,otherPlans:S,repoError:a};return d.length||f.length?{mode:"roadmaps",...y}:a&&!i.roadmaps&&!i.plans?{mode:"error",...y}:h.length?{mode:"plans",...y}:{mode:a?"error":"none",...y}}const Pg=i=>i.mode==="roadmaps"&&i.roadmaps.length===1&&i.errors.length===0;function Rg(i){const s=i.milestones.flatMap(v=>v.phases).filter(v=>v.tile==="blocked").length,{phasesDone:a,phasesTotal:d}=i.kpis,f=i.gates.length?"wait":s?"block":d&&a>=d?"done":i.kpis.inProgress.length||a?"prog":"todo",h=i.runner;return{slug:i.slug,branch:i.branch,milestonesDone:i.kpis.milestonesDone,milestonesTotal:i.kpis.milestonesTotal,phasesDone:a,phasesTotal:d,pct:d?Math.round(100*a/d):0,next:i.runner.next??"none ready",runner:h.running||h.stopReason==="running"?"running":h.stopReason?`stopped: ${h.stopReason}`:"idle",gates:i.gates.length,dots:i.milestones.map(v=>({id:v.id,status:v.status})),tone:f}}function rm(i){const s=[];for(const a of Rd(i).roadmaps){const d=new Map(a.milestones.map(f=>[f.id,f.status]));for(const f of a.milestones)yn.has(f.status)||!f.depends.every(h=>yn.has(d.get(h)??""))||f.blockers.filter(h=>h.type==="owner-gate").forEach((h,v)=>s.push({roadmap:a.slug,milestone:f.id,reason:h.reason,check:h.check,id:`${a.slug}:${f.id}:${v}`}))}return s}const om=i=>i.roadmaps.reduce((s,a)=>s+a.gates.length,0),_c=(i,s)=>i.toLowerCase().includes(s);function Lg(i,s){const a=s.trim().toLowerCase();if(!a)return null;const d={milestones:new Set,phases:new Set,count:0};for(const f of i.milestones){const h=_c([f.id,f.status,f.owner,f.target??""].join(" "),a);let v=!1;for(const S of f.phases){const y=_c([S.ref,S.name,S.model,S.lane,S.risk,S.tracker,S.prs.map(E=>`#${E.number}`).join(" ")].join(" "),a);(y||h)&&(d.phases.add(S.ref),v=!0),y&&(d.count+=1)}h&&(d.count+=1),(h||v)&&d.milestones.add(f.id)}return d}function lm(i){const s=om(Rd(i));return s>0?`Roadmap · ${s} gate${s===1?"":"s"}`:"Roadmap"}const im=i=>!i.sources.collector.ok||i.sources.collector.stale,jc={waiting:"Waiting","owner-gate":"Owner gate",blocked:"Blocked","blocked-merge":"Blocked merge",coordinator:"Coordinator",hub:"Hub"},sm={collector:"Roadmap and relay data",agents:"Session list",github:"GitHub data",coordinator:"Coordinator data"},qn=i=>Array.isArray(i)?i:[],Et=i=>i&&typeof i=="object"&&!Array.isArray(i)?i:{},rt=i=>typeof i=="string"&&i?i:null,Qn=i=>typeof i=="number"&&Number.isFinite(i)?i:null,Mr=i=>{var s;return((s=i.github)==null?void 0:s.repo)??i.name},Ec=i=>i.replace(/\\/g,"/").replace(/\/+$/,"").toLowerCase(),vn=(i,s)=>!!i&&!!s&&Ec(i)===Ec(s);function Ld(i){var a;const s=[];for(const d of qn((a=i.relays)==null?void 0:a.relays)){const f=Et(d),h=rt(f.name),v=rt(f.status);!h||!v||s.push({name:h,status:v,statusArg:rt(f.status_arg)??"",updatedAt:rt(f.updated_at),nextStep:rt(f.next_step)})}return s}function Dd(i){return Array.isArray(i.owner_items)?i.owner_items:Ld(i).filter(s=>s.status==="OWNER-GATE"&&s.statusArg).map(s=>({id:`gate:${s.name}:${s.statusArg}`,what:`owner gate ${s.statusArg} (${s.name})`,pr:null,head_sha:null,source:"relay",recommendation:null,from:s.name,since:s.updatedAt,relay:s.name}))}function Ir(i){var a;const s=[];for(const d of qn((a=i.coordinator)==null?void 0:a.queue)){const f=Et(d),h=Qn(f.pr);if(h===null)continue;const v=[];for(const S of qn(f.waits_on)){const y=Et(S),E=Qn(y.pr);E!==null&&v.push({repo:rt(y.repo)??"",pr:E})}s.push({pr:h,headSha:rt(f.head_sha)??"",title:rt(f.title)??"",state:rt(f.state)??"waiting",whyWaiting:rt(f.why_waiting)??"",waitsOn:v,hotfix:f.hotfix===!0,held:f.held===!0,since:rt(f.entered_ready_at)})}return s}function Od(i){var a;const s=(a=i.coordinator)==null?void 0:a.merging_now;return Qn(s)??Qn(Et(s).pr)}function am(i){const s=new Set,a=[];for(const d of i)d.waiting_class!=="owner"||s.has(d.session_id)||(s.add(d.session_id),a.push(d));return a}function um(i,s){var h,v;let a=null;for(const S of i.repos){const y=Mr(S);for(const E of qn((h=S.coordinator)==null?void 0:h.deploy_checks)){const j=Et(E),L=Date.parse(rt(j.at)??""),P=Qn(j.pr);if(Number.isNaN(L)||P===null)continue;const O=rt(j.health);(!a||L>a.at)&&(a={at:L,label:`${y} #${P}`,ok:O==="ok"?!0:O==="failed"?!1:null,how:`health ${O??"unknown"}`})}for(const E of((v=S.github)==null?void 0:v.merges)??[]){const j=Date.parse(E.merged_at);if(Number.isNaN(j)||a&&a.at>=j)continue;const L=E.runs??[],P=L.some(_=>_.conclusion==="failure"),O=L.length>0&&L.every(_=>_.conclusion==="success");a={at:j,label:`${y} #${E.number}`,ok:P?!1:O?!0:null,how:P?"deploy failed":O?"deploy pass":"merged"}}}if(!a)return null;const d=Math.max(0,Math.round((s-a.at)/6e4)),f=d<60?`${d} min ago`:d<1440?`${Math.floor(d/60)} h ago`:`${Math.floor(d/1440)} d ago`;return{label:a.label,sub:`${f} · ${a.how}`,ok:a.ok}}function cm(i,s,a){var h;let d=0;for(const v of i.repos)(h=v.coordinator)!=null&&h.responding&&(d+=Ir(v).filter(S=>S.state!=="blocked").length);const f=i.sessions.filter(v=>!["idle","done","unknown"].includes(v.status)).length;return{waitingOnYou:a.filter(v=>v.folder==="needs").length,blockedMerges:a.filter(v=>v.kind==="blocked-merge").length,inQueue:d,workingSessions:f,lastDeploy:um(i,s)}}function dm(i){const s=new Date(i);return Number.isNaN(s.getTime())?"unknown":s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}const Cc=(i,s)=>{var a;return(a=i.github)!=null&&a.repo?`gh pr checks ${s} -R ${i.github.repo}`:`gh pr checks ${s}`};function fm(i,s){var v,S;const a=[],d=new Set,f=y=>{d.has(y.id)||(d.add(y.id),a.push(y))},h=y=>i.repos.find(E=>vn(E.path,y));for(const y of am(i.sessions)){const E=h(y.repo_path),j=y.name??y.session_id.slice(0,8);f({id:`waiting:${y.session_id}`,kind:"waiting",folder:"needs",repo:E?Mr(E):"no repo",title:`${j} waits on ${y.waiting_for??"you"}`,why:"The session cannot continue until you answer.",next:"Open the session and answer.",cmd:j,since:y.waiting_since,source:"agents"})}for(const y of i.repos){const E=Mr(y),j=Ld(y);for(const _ of Dd(y)){const K=_.relay?j.find(V=>V.name===_.relay):void 0,W=_.source==="relay"?(v=/^owner gate (\S+) /.exec(_.what))==null?void 0:v[1]:void 0;f({id:`owner:${y.path}:${_.id}`,kind:"owner-gate",folder:"approvals",repo:E,repoPath:y.path,title:W?`Gate ${W}: owner approval needed`:`${_.pr!==null?`PR #${_.pr}: `:""}${_.what}`,why:_.source==="relay"?"The plan stops at this owner gate. The next phase cannot start without you.":"This is on the owner-only list. Only your click approves it.",next:(K==null?void 0:K.nextStep)??(_.source==="relay"?"Read the relay, then decide.":"Read the recommendation, then decide."),cmd:_.relay?`.caddis/relay/${_.relay}.md`:_.what,since:_.since,owner:_,source:_.source==="relay"?"collector":"coordinator"})}for(const _ of rm(y))f({id:`rmgate:${y.path}:${_.id}`,kind:"owner-gate",folder:"approvals",repo:E,repoPath:y.path,title:`Roadmap ${_.roadmap}, gate ${_.milestone}: ${_.reason}`,why:`Milestone ${_.milestone} of roadmap ${_.roadmap} waits for you. Everything before it is done.`,next:"Decide, then record the gate in the roadmap with /caddis:roadmap (a docs PR).",cmd:_.check||"/caddis:roadmap",since:null,source:"collector"});for(const _ of j)_.status==="BLOCKED"&&_.statusArg.toLowerCase().startsWith("owner")&&f({id:`blocked:${y.path}:${_.name}`,kind:"blocked",folder:"needs",repo:E,repoPath:y.path,title:`Relay ${_.name}: STATUS: BLOCKED owner`,why:"The relay says the owner must decide before the next step.",next:_.nextStep??"Read the relay and decide.",cmd:`.caddis/relay/${_.name}.md`,since:_.updatedAt,source:"collector"});const L=!!y.coordinator&&y.coordinator.responding;for(const _ of Ir(y))_.state==="blocked"&&f({id:`merge:${y.path}:${_.pr}`,kind:"blocked-merge",folder:"blocked",repo:E,repoPath:y.path,title:`PR #${_.pr}${_.title?` ${_.title}`:""}: blocked`,why:_.whyWaiting||"The coordinator skips it until it is unblocked.",next:"Ask the PR session to fix it, or hold the PR.",cmd:Cc(y,_.pr),since:_.since,queue:{pr:_.pr,headSha:_.headSha,hotfix:_.hotfix,held:_.held},source:"coordinator"});const P=new Map(Ir(y).map(_=>[_.pr,_]));for(const _ of((S=y.github)==null?void 0:S.prs)??[]){if(_.draft||_.required_state!=="fail")continue;const K=_.checks.filter(V=>V.required&&V.conclusion==="failure").map(V=>V.name),W=P.get(_.number);f({id:`merge:${y.path}:${_.number}`,kind:"blocked-merge",folder:"blocked",repo:E,repoPath:y.path,title:`PR #${_.number}: required check ${K.length>0?`${K.join(", ")} `:""}failed`,why:L?"The coordinator skips it until the check passes at the head.":"This repo has no live coordinator, so its session merges its own PRs.",next:"Fix the check in the PR session.",cmd:Cc(y,_.number),since:_.updated_at,...W?{queue:{pr:W.pr,headSha:W.headSha,hotfix:W.hotfix,held:W.held}}:{},source:"github"})}const O=y.coordinator;O&&!O.responding&&O.heartbeat_at&&O.status!=="stopped"&&f({id:`coordinator:${y.path}`,kind:"coordinator",folder:"needs",repo:E,repoPath:y.path,title:`Coordinator not responding since ${dm(O.heartbeat_at)}`,why:"No heartbeat for 3 min. Its queue is frozen; the lane shows GitHub data.",next:"Check the coordinator session, then restart it.",cmd:"/caddis:coordinate",since:O.heartbeat_at,source:"coordinator"})}for(const y of["collector","agents","github","coordinator"]){const E=i.sources[y];E.ok||!E.stale||f({id:`hub:${y}`,kind:"hub",folder:"needs",repo:"hub",title:`${sm[y]} has failed for over 3 min`,why:E.last_error??"The source has not answered.",next:"Read the error. The hub keeps the last good data.",cmd:"caddis hub status",since:E.last_ok_at})}return{items:a,tiles:cm(i,s,a)}}const pm=24*36e5,hm=()=>({open:{},resolved:[]}),mm=(i,s)=>{var d;const a=(d=i.sources)==null?void 0:d[s];return!!a&&(!a.ok||a.stale)};function gm(i,s){var d;if(!s.repoPath)return!1;const a=(d=i.repos)==null?void 0:d.find(f=>vn(f.path,s.repoPath));if(!a)return!1;if(s.source==="github"){const f=a.github;return!!f&&typeof f.error=="string"&&!Array.isArray(f.prs)}if(s.source==="collector"){const f=Et(a.relays);return(typeof a.error=="string"||typeof f.error=="string")&&!Array.isArray(f.relays)}return!1}function Tc(i,s,a){const d=new Set(s.map(h=>h.id)),f=s.map(h=>h.stale?{...h,stale:!1}:h);for(const[h,v]of Object.entries(i))d.has(h)||!v.source||!mm(a,v.source)&&!gm(a,v)||f.push({...v,stale:!0});return f}function ym(i,s,a){const d=new Map(s.map(h=>[h.id,h])),f=i.resolved.filter(h=>a-h.resolvedAt<pm&&!d.has(h.item.id));for(const[h,v]of Object.entries(i.open))!d.has(h)&&!f.some(S=>S.item.id===h)&&f.push({item:v,resolvedAt:a});return f.sort((h,v)=>v.resolvedAt-h.resolvedAt),{open:Object.fromEntries(d),resolved:f}}function $c(i){const s=Et(i);return typeof s.id=="string"&&typeof s.title=="string"&&typeof s.kind=="string"&&typeof s.folder=="string"}function vm(i){const s=Et(i),a={};for(const[f,h]of Object.entries(Et(s.open)))$c(h)&&(a[f]=h);const d=[];for(const f of qn(s.resolved)){const h=Et(f),v=Qn(h.resolvedAt);$c(h.item)&&v!==null&&d.push({item:h.item,resolvedAt:v})}return{open:a,resolved:d}}const zc="Start a session in the folder: the hub adds it.";function Md(){return c.jsxs("section",{className:"first-run","data-testid":"first-run","aria-label":"Get started",children:[c.jsx("h2",{children:"No repos yet"}),c.jsxs("p",{children:[c.jsx(yd,{size:16,"aria-hidden":"true"})," Start a Claude Code session in a repo. The hub finds it by itself."]}),c.jsx("p",{children:"Or add a folder. The hub checks that it is a git repo."}),c.jsxs("button",{type:"button",className:"btn",disabled:!0,title:zc,"data-testid":"add-folder",children:[c.jsx(_h,{size:16,"aria-hidden":"true"}),"Add a folder"]}),c.jsxs("span",{className:"first-run-reason",children:[" ",zc]})]})}const Lr={size:15,"aria-hidden":!0};function Id({tiles:i,stale:s=!1}){const a=i.lastDeploy;return c.jsxs("div",{className:`kpi-strip${s?" stale":""}`,"data-testid":"tiles","data-stale":s?"true":void 0,children:[c.jsxs("div",{className:`kpi-tile${i.waitingOnYou>0?" urgent":""}`,children:[c.jsxs("span",{className:"kpi-label",children:[c.jsx(Ih,{...Lr}),"Waiting on you"]}),c.jsx("span",{className:"kpi-num accent","data-testid":"tile-waiting",children:i.waitingOnYou})]}),c.jsxs("div",{className:`kpi-tile${i.blockedMerges>0?" danger":""}`,children:[c.jsxs("span",{className:"kpi-label",children:[c.jsx(wh,{...Lr}),"Blocked merges"]}),c.jsx("span",{className:"kpi-num bad","data-testid":"tile-blocked",children:i.blockedMerges})]}),c.jsxs("div",{className:"kpi-tile",children:[c.jsxs("span",{className:"kpi-label",children:[c.jsx(jh,{...Lr}),"In merge queue"]}),c.jsx("span",{className:"kpi-num","data-testid":"tile-queue",children:i.inQueue})]}),c.jsxs("div",{className:"kpi-tile",children:[c.jsxs("span",{className:"kpi-label",children:[c.jsx(yd,{...Lr}),"Working sessions"]}),c.jsx("span",{className:"kpi-num","data-testid":"tile-working",children:i.workingSessions})]}),c.jsxs("div",{className:"kpi-tile deploy",children:[c.jsxs("span",{className:"kpi-label",children:[c.jsx(Rh,{...Lr}),"Last prod deploy"]}),a?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:`kpi-val ${a.ok===!0?"tone-good":a.ok===!1?"tone-bad":""}`,children:a.label}),c.jsx("span",{className:"kpi-sub tone-muted",children:a.sub})]}):c.jsx("span",{className:"kpi-val tone-muted",children:"No deploy yet"})]})]})}const wm=[{id:"needs",label:"Needs you",Icon:Zc},{id:"approvals",label:"Approvals",Icon:Lh},{id:"blocked",label:"Blocked",Icon:Dh},{id:"resolved",label:"Resolved, 24 h",Icon:yh}],Pc=(i,s)=>i?Vn(i,s).replace(/ ago$/,""):"unknown";function km(i){var s;try{(s=navigator.clipboard)==null||s.writeText(i)}catch{}}function xm(i,s){return i?s.owner?Nd(i,s.owner):s.queue?hs(i,s.queue):[]:[]}function Sm({state:i,nowMs:s,api:a,act:d}){const[f,h]=Z.useState("needs"),[v,S]=Z.useState(null),[y,E]=Z.useState(!1),[j,L]=Z.useState(!1),{model:P,resolved:O,read:_}=a,K={needs:P.items.filter(M=>M.folder==="needs").length,approvals:P.items.filter(M=>M.folder==="approvals").length,blocked:P.items.filter(M=>M.folder==="blocked").length,resolved:O.length},W=f==="resolved"?O.map(M=>({item:M.item,resolved:!0,since:new Date(M.resolvedAt).toISOString()})):P.items.filter(M=>M.folder===f).map(M=>({item:M,resolved:!1,since:M.since})),V=W.find(M=>M.item.id===v)??W[0]??null,Ee=M=>{h(M),S(null),E(!1)},$e=M=>{S(M.item.id),E(!0),M.resolved||a.markRead(M.item.id)};return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"page-header",children:[c.jsx("h1",{className:"page-title",children:"Inbox"}),c.jsxs("span",{className:"page-subtitle",children:[i.repos.length," repos · ",i.sessions.length," sessions"]})]}),i.repos.length===0&&c.jsx(Md,{}),c.jsx(Id,{tiles:P.tiles,stale:us(i)}),a.notify.supported&&c.jsxs("div",{className:"notify-row",children:[c.jsxs("button",{type:"button",className:"btn",onClick:a.notify.enable,disabled:a.notify.enabled,children:[c.jsx(Zc,{size:16,"aria-hidden":"true"}),a.notify.enabled?"Notifications on":"Notify me"]}),c.jsx("span",{children:a.notify.enabled?"One browser notification per new item.":"Opt in to a browser notification for each new item."})]}),c.jsxs("div",{className:`mailbox${y&&V?" show-detail":""}`,children:[c.jsx("div",{className:"mailbox-folders",role:"tablist","aria-label":"Folders",children:wm.map(({id:M,label:he,Icon:me})=>c.jsxs("button",{type:"button",role:"tab","aria-selected":f===M,className:`folder-btn${f===M?" sel":""}`,onClick:()=>Ee(M),"data-testid":`folder-${M}`,children:[c.jsx(me,{size:16,"aria-hidden":"true"}),c.jsx("span",{children:he}),c.jsx("strong",{children:K[M]})]},M))}),c.jsxs("div",{className:"mailbox-list","data-testid":"inbox-list",children:[W.map(M=>{const he=!M.resolved&&!_.has(M.item.id);return c.jsxs("button",{type:"button",className:`item-btn${(V==null?void 0:V.item.id)===M.item.id?" sel":""}`,onClick:()=>$e(M),"data-testid":"inbox-item",children:[c.jsx("span",{className:`unread-dot${he?" on":""}`,role:"img","aria-label":he?"Unread":"Read"}),c.jsxs("span",{className:"item-main",children:[c.jsxs("span",{className:"item-meta",children:[c.jsx("span",{className:`chip chip-${M.resolved?"resolved":M.item.kind}`,children:M.resolved?"Resolved":jc[M.item.kind]}),c.jsx("span",{className:"mono",children:M.item.repo}),c.jsxs("span",{children:["· ",Pc(M.since,s)]}),!M.resolved&&M.item.stale&&c.jsx("span",{className:"chip chip-stale","data-testid":"stale-chip",title:"Its source is failing. Last good data is shown.",children:"stale"})]}),c.jsx("span",{className:"item-title",children:M.item.title})]})]},M.item.id)}),W.length===0&&c.jsxs("div",{className:"list-empty","data-testid":"inbox-empty",children:[c.jsx("strong",{children:f==="resolved"?"Nothing resolved in the last 24 h":"Nothing needs you"}),c.jsxs("div",{children:["Last check ",Vn(i.generated_at,s),"."]})]})]}),V&&c.jsxs("article",{className:"mailbox-detail","data-testid":"inbox-detail","aria-label":"Item detail",children:[c.jsxs("button",{type:"button",className:"btn back-btn",onClick:()=>E(!1),children:[c.jsx(vh,{size:16,"aria-hidden":"true"}),"Back"]}),c.jsxs("span",{className:"item-meta",children:[c.jsx("span",{className:`chip chip-${V.resolved?"resolved":V.item.kind}`,children:V.resolved?"Resolved":jc[V.item.kind]}),c.jsx("span",{className:"mono",children:V.item.repo}),c.jsxs("span",{children:["· ",V.resolved?"resolved":"since"," ",Pc(V.since,s)]}),!V.resolved&&V.item.stale&&c.jsx("span",{className:"chip chip-stale",children:"stale"})]}),c.jsx("h2",{children:V.item.title}),c.jsxs("div",{className:"detail-block",children:[c.jsx("span",{className:"detail-label",children:"Why it matters"}),c.jsx("span",{children:V.resolved?"The source cleared. No action is needed.":V.item.why})]}),!V.resolved&&V.item.owner&&c.jsx($d,{item:V.item.owner}),c.jsxs("div",{className:"detail-block",children:[c.jsx("span",{className:"detail-label",children:"Next step"}),c.jsx("span",{children:V.resolved?"Nothing.":V.item.next}),c.jsx("code",{className:"cmd",children:V.item.cmd})]}),c.jsx("div",{className:"detail-actions",children:c.jsxs("button",{type:"button",className:"btn",onClick:()=>{km(V.item.cmd),L(!0),window.setTimeout(()=>L(!1),1500)},children:[j?c.jsx(xh,{size:16,"aria-hidden":"true"}):c.jsx(rd,{size:16,"aria-hidden":"true"}),V.item.kind==="waiting"?"Copy session name":"Copy command"]})}),!V.resolved&&(()=>{const M=i.repos.find(Se=>vn(Se.path,V.item.repoPath)),he=xm(M,V.item);if(!M||he.length===0)return null;const me=V.item.owner?Ed(M,V.item.owner):void 0;return c.jsx(tl,{repo:M,specs:he,act:d,reason:me})})()]})]})]})}const Ad="caddis-hub-inbox-history",Rc="caddis-hub-inbox-read",Xo="caddis-hub-inbox-notified",Lc="caddis-hub-inbox-notify",Fd="caddis-hub-lanes-folded";function tn(){try{return window.localStorage}catch{return null}}function ms(i,s){try{const a=s==null?void 0:s.getItem(i);return a?JSON.parse(a):null}catch{return null}}function gs(i,s,a){try{a==null||a.setItem(i,JSON.stringify(s))}catch{}}const Nm=(i=tn())=>{const s=ms(Ad,i);return s?vm(s):hm()},_m=(i,s=tn())=>gs(Ad,i,s);function ns(i,s=tn()){const a=ms(i,s);return new Set(Array.isArray(a)?a.filter(d=>typeof d=="string"):[])}function rs(i,s,a=tn()){gs(i,[...s].slice(-500),a)}const jm={items:[],tiles:{waitingOnYou:0,blockedMerges:0,inQueue:0,workingSessions:0,lastDeploy:null}},os=()=>typeof window<"u"&&"Notification"in window;function Em(i,s){const a=Z.useMemo(()=>i?fm(i,s):jm,[i,s]),[d,f]=Z.useState(()=>Nm()),h=Z.useMemo(()=>{if(!i)return a;const P=Tc(d.open,a.items,i),O=_=>P.filter(_).length;return{items:P,tiles:{...a.tiles,waitingOnYou:O(_=>_.folder==="needs"),blockedMerges:O(_=>_.kind==="blocked-merge")}}},[i,a,d.open]),[v,S]=Z.useState(()=>ns(Rc)),[y,E]=Z.useState(()=>{var P;try{return os()&&((P=tn())==null?void 0:P.getItem(Lc))==="1"&&Notification.permission==="granted"}catch{return!1}});Z.useEffect(()=>{i&&f(P=>{const O=ym(P,Tc(P.open,a.items,i),Date.now());return _m(O),O})},[i,a]),Z.useEffect(()=>{if(!y||!i)return;const P=ns(Xo);let O=!1;for(const _ of h.items)if(!P.has(_.id)){P.add(_.id),O=!0;try{new Notification(`caddis hub: ${_.repo}`,{body:_.title,tag:_.id})}catch{}}O&&rs(Xo,P)},[y,i,h]);const j=Z.useCallback(P=>{S(O=>{if(O.has(P))return O;const _=new Set(O).add(P);return rs(Rc,_),_})},[]),L=Z.useCallback(()=>{os()&&Notification.requestPermission().then(P=>{var _;if(P!=="granted")return;try{(_=tn())==null||_.setItem(Lc,"1")}catch{}const O=ns(Xo);for(const K of h.items)O.add(K.id);rs(Xo,O),E(!0)})},[h]);return{model:h,resolved:d.resolved,read:v,markRead:j,notify:{supported:os(),enabled:y,enable:L}}}const Dc="No coordinator: each session merges its own PRs.",Cm="/caddis:coordinate",Tm="gh auth login -h github.com",Ud=i=>{const s=i?new Date(i):null;return s&&!Number.isNaN(s.getTime())?s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"unknown"},Oc=i=>`Coordinator not responding since ${Ud(i)}`,Mc=i=>`Coordinator stopped at ${Ud(i)}`;function $m(i,s){const a=i?Date.parse(i):NaN;if(Number.isNaN(a))return"unknown";const d=Math.max(0,Math.round((s-a)/6e4));return d<60?`${d} min ago`:d<1440?`${Math.floor(d/60)} h ago`:`${Math.floor(d/1440)} d ago`}const zm=(i,s,a)=>i==="waiting"?{sub:`waiting: ${s??"unknown"}`,tone:a==="peer"?"muted":"warn"}:i==="busy"||i==="running"||i==="working"?{sub:"busy",tone:"good"}:{sub:i,tone:"muted"},ls=(i,s)=>{const a=i.whyWaiting||i.state,d=[i.hotfix?"hotfix":"",i.held&&!a.includes("held")?"held":"",a].filter(Boolean);return{key:`q${i.pr}`,title:`#${i.pr} ${i.title}`.trim(),sub:s?"last known queue":d.join(" · "),tone:i.hotfix||i.held?"warn":"muted",grey:s,queue:{pr:i.pr,headSha:i.headSha,hotfix:i.hotfix,held:i.held}}};function Pm(i,s,a){var $e,M,he,me,Se;const d=s.coordinator,f=d?d.status==="stopped"?"stopped":d.responding?"coordinator":"down":"none",h=Mr(s),v=i.sessions.filter(G=>vn(G.repo_path,s.path)).map(G=>{const re=zm(G.status,G.waiting_for,G.waiting_class);return{key:`s${G.session_id}`,title:G.name??G.session_id.slice(0,8),sub:re.sub,tone:re.tone}}),S=[],y=new Set;for(const G of(($e=s.github)==null?void 0:$e.prs)??[]){if(G.draft||G.required_state!=="fail")continue;const re=G.checks.filter(De=>De.required&&De.conclusion==="failure").map(De=>De.name);y.add(G.number),S.push({key:`b${G.number}`,title:`#${G.number} ${G.title}`,sub:re.length>0?`${re.join(", ")} failed`:"required check failed",tone:"bad"})}const E=Ir(s),j=[],L=[];if(f==="coordinator"){const G=Od(s);for(const re of E)re.state==="blocked"?y.has(re.pr)||(y.add(re.pr),S.push({key:`b${re.pr}`,title:`#${re.pr} ${re.title}`.trim(),sub:re.whyWaiting||"blocked",tone:"bad"})):re.state==="merging"||re.pr===G?L.push(ls(re,!1)):j.push(ls(re,!1))}else if(f==="down"||f==="stopped")for(const G of E)G.state!=="blocked"&&j.push(ls(G,!0));const P=(((M=s.github)==null?void 0:M.merges)??[]).slice().sort((G,re)=>Date.parse(re.merged_at)-Date.parse(G.merged_at)).slice(0,3).map(G=>{const re=G.runs??[],De=re.some(Oe=>Oe.conclusion==="failure"),wt=re.length>0&&re.every(Oe=>Oe.conclusion==="success"),Ve=$m(G.merged_at,a);return{key:`d${G.number}`,title:`#${G.number} ${G.title}`,sub:De?`deploy failed · ${Ve}`:wt?`deployed ${Ve}`:`merged ${Ve}`,tone:De?"bad":wt?"good":"muted"}});let O=null;f==="none"?O=`${Dc} Start one with ${Cm}.`:f==="down"?O=`${Oc((d==null?void 0:d.heartbeat_at)??null)}. The lane shows GitHub data; the last known queue is greyed.`:f==="stopped"&&(O=`${Mc((d==null?void 0:d.stopped_at)??null)}. Each session merges its own PRs until one starts again (/caddis:coordinate). The last known queue is greyed.`);const _=(he=i.sources)!=null&&he.agents?!i.sources.agents.ok:!1,K=(me=s.github)!=null&&me.error?{account:s.github.account??null,error:s.github.error,command:Tm}:null;let W;f==="down"?W=Oc((d==null?void 0:d.heartbeat_at)??null):f==="stopped"?W=Mc((d==null?void 0:d.stopped_at)??null):W=[f==="none"?"No coordinator":"",_?"sessions unknown":v.length>0?`${v.length} session${v.length===1?"":"s"}`:"no sessions running",S.length>0?`${S.length} blocked`:"",j.length>0?`${j.length} waiting`:"",L.length>0?`${L.length} merging`:"",P.length>0?`${P.length} deployed`:""].filter(Boolean).join(" · ");const V=i.sessions.some(G=>vn(G.repo_path,s.path)&&G.waiting_class==="owner"),Ee=f==="down"||s.error||(Se=s.github)!=null&&Se.error?"blocked":V?"attention":f==="none"||f==="stopped"?"idle":"ok";return{id:s.path,name:h,mode:f,tone:Ee,note:O,github:K,summary:W,columns:[{id:"sessions",title:"Sessions",cards:v,emptyText:_?'Sessions unknown: "claude agents" failed':"No sessions running"},{id:"blocked",title:"Blocked",cards:S,emptyText:"None"},{id:"waiting",title:"Waiting for its turn",cards:j,emptyText:f==="none"?Dc:"None"},{id:"merging",title:"Merging now",cards:L,emptyText:"None"},{id:"done",title:"Done and deployed",cards:P,emptyText:"None"}]}}const Rm=(i,s)=>i.repos.map(a=>Pm(i,a,s)),Lm={ok:"var(--green)",attention:"var(--mk-warn)",blocked:"var(--mk-bad)",idle:"var(--text-dim)"};function Dm(){const i=ms(Fd,tn());return i&&typeof i=="object"&&!Array.isArray(i)?i:{}}function Om({state:i,nowMs:s,api:a,act:d}){const[f,h]=Z.useState(()=>Dm()),v=Rm(i,s),S=y=>{h(E=>{const j={...E,[y]:!E[y]};return gs(Fd,j,tn()),j})};return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"page-header",children:[c.jsx("h1",{className:"page-title",children:"Overview"}),c.jsxs("span",{className:"page-subtitle",children:[i.repos.length," repos · ",i.sessions.length," sessions"]})]}),i.repos.length===0&&c.jsx(Md,{}),c.jsx(Id,{tiles:a.model.tiles,stale:us(i)}),c.jsx("div",{className:`lanes${us(i)?" stale":""}`,"data-testid":"lanes",children:v.map(y=>{const E=!f[y.id],j=i.repos.find(L=>vn(L.path,y.id));return c.jsxs("section",{className:`lane ${y.mode}`,"data-testid":"lane","aria-label":y.name,children:[c.jsxs("button",{type:"button",className:"lane-head","aria-expanded":E,onClick:()=>S(y.id),children:[c.jsx("span",{"aria-hidden":"true",style:{width:9,height:9,borderRadius:"50%",background:Lm[y.tone],flexShrink:0}}),c.jsx("span",{className:"lane-name",children:y.name}),c.jsx("span",{className:"lane-summary","data-testid":"lane-summary",children:y.summary}),c.jsx(Sh,{className:"chev",size:18,"aria-hidden":"true",style:{transform:E?"rotate(180deg)":"none"}})]}),E&&c.jsxs("div",{className:"lane-body",children:[y.github&&c.jsxs("div",{className:"lane-note gh-fail","data-testid":"gh-fail",role:"status",children:["GitHub access failed for ",y.github.account?`account ${y.github.account}`:"this repo",y.github.error?` (${y.github.error})`:"",". Sign in again with"," ",c.jsx("code",{className:"cmd",children:y.github.command})]}),y.note&&c.jsx("div",{className:"lane-note","data-testid":"lane-note",children:y.note}),c.jsx("div",{className:"lane-cols",children:y.columns.map(L=>c.jsxs("div",{className:"lane-col","data-testid":`col-${L.id}`,children:[c.jsxs("span",{className:"col-title",children:[L.title," · ",L.cards.length]}),L.cards.map(P=>c.jsxs("div",{className:`card${P.grey?" grey":""}`,"data-testid":"lane-card",children:[c.jsx("span",{className:"card-title",children:P.title}),c.jsx("span",{className:`card-sub tone-${P.tone}`,children:P.sub}),j&&P.queue&&c.jsx(tl,{repo:j,specs:hs(j,P.queue),act:d,compact:!0})]},P.key)),L.cards.length===0&&c.jsx("span",{className:"col-empty",children:L.emptyText})]},L.id))})]})]},y.id)})})]})}function Mm(i){const s=i.replace(/^#\/?/,"").split("/"),a=s[0];if(a==="overview")return{page:"overview"};if(a==="activity")return{page:"activity"};if(a==="guide")return{page:"guide"};if(a==="repo"&&s[1])try{const d=s[2]==="roadmap"||s[2]==="sessions"?s[2]:"flow",f=d==="roadmap"&&s[3]?decodeURIComponent(s[3]):null;return{page:"repo",id:decodeURIComponent(s[1]),tab:d,roadmap:f}}catch{return{page:"inbox"}}return{page:"inbox"}}const ys=i=>i.repo_id??i.path,cs=i=>`#/repo/${encodeURIComponent(i)}`;function Im(i,s,a){return s==="flow"?cs(i):`${cs(i)}/${s}${s==="roadmap"&&a?`/${encodeURIComponent(a)}`:""}`}const Am=["D1","D2","D3","D4","D5"],el=i=>i&&typeof i=="object"&&!Array.isArray(i)?i:{};function Fm(i){const s=(a,d)=>{if(a.state==="merging")return[0,0,0,"",d];const f=a.hotfix?1:2;return a.state==="ready"&&!a.held?[f,0,a.since?0:1,a.since??"",d]:[f,1,0,"",d]};return i.map((a,d)=>({q:a,r:s(a,d)})).sort((a,d)=>{for(let f=0;f<a.r.length;f++){const h=a.r[f],v=d.r[f];if(h<v)return-1;if(h>v)return 1}return 0}).map(a=>a.q)}function Hd(i){const s=i.coordinator;return s?s.status==="stopped"?"stopped":s.responding?"live":"down":"none"}function Um(i){const s=i.coordinator,a=typeof el(s==null?void 0:s.coordinator_session).name=="string"?String(el(s==null?void 0:s.coordinator_session).name):null;switch(Hd(i)){case"none":return"No coordinator: each session merges its own PRs. Start one with /caddis:coordinate.";case"stopped":return`Coordinator stopped at ${Or(s==null?void 0:s.stopped_at)}. The last known queue is greyed.`;case"down":return`Coordinator not responding since ${Or(s==null?void 0:s.heartbeat_at)}. The last known queue is greyed.`;case"live":return`Coordinator ${a??""} live, heartbeat ${Or(s==null?void 0:s.heartbeat_at)}.`.replace(" "," ")}}function Hm(i){var a;const s=[];for(const d of qn((a=i.coordinator)==null?void 0:a.deploy_checks)){const f=el(d);if(typeof f.pr!="number")continue;const h=el(f.checks),v=Object.keys(h).length?Am.map(S=>({name:S,mark:typeof h[S]=="string"?String(h[S]):"skip"})):null;s.push({pr:f.pr,mergeSha:typeof f.merge_sha=="string"?f.merge_sha.slice(0,10):"",run:typeof f.deploy_run=="number"?f.deploy_run:null,health:typeof f.health=="string"?f.health:"unknown",at:typeof f.at=="string"?f.at:null,checks:v,reason:typeof f.reason=="string"&&f.reason?f.reason:null})}return s.reverse()}function Bm(i,s){var v,S;const a=Hd(s),d=Od(s),f=Fm(Ir(s)),h=new Set(f.map(y=>y.pr));return{mode:a,statusText:Um(s),grey:a==="stopped"||a==="down",merging:a==="live"?d:null,queue:f.map((y,E)=>({...y,position:E+1,merging:y.state==="merging"||y.pr===d})),deploys:Hm(s),owner:Dd(s),unqueued:(((v=s.github)==null?void 0:v.prs)??[]).filter(y=>!y.draft&&!h.has(y.number)).map(y=>({number:y.number,title:y.title,requiredState:y.required_state,headSha:y.head_sha})),requests:[...((S=s.coordinator)==null?void 0:S.requests)??[]].reverse()}}const Ic={waiting:0,busy:1,idle:2},Wm=i=>({key:i.key,name:i.name??i.session_id,kind:i.kind,status:i.status,waitingFor:i.waiting_for,waitingClass:i.waiting_class,since:i.waiting_since,copies:i.copies,copyWarning:i.copies>1?`${i.copies} copies`:null});function Vm(i,s){const a=i.sources.agents,d=i.sessions.filter(h=>vn(h.repo_path,s.path)).map(Wm).sort((h,v)=>+(v.waitingClass==="owner")-+(h.waitingClass==="owner")||(Ic[h.status]??3)-(Ic[v.status]??3)||h.name.localeCompare(v.name)),f=!a.ok&&a.last_ok_at===null;return{unknown:f,error:a.ok?null:a.last_error,rows:f?[]:d}}async function qm(i){try{return await navigator.clipboard.writeText(i),!0}catch{return!1}}const Qm={owner:"you",peer:"a peer session"};function Km({state:i,repo:s,nowMs:a}){const d=Vm(i,s),[f,h]=Z.useState(null),v=async(S,y)=>{await qm(y)&&(h(S),window.setTimeout(()=>h(E=>E===S?null:E),2e3))};return c.jsxs("div",{className:"flow","data-testid":"sessions",children:[d.error&&c.jsxs("div",{className:"lane-note","data-testid":"sessions-error",children:[d.unknown?"Sessions unknown: ":"The last sessions read failed: ",d.error]}),d.unknown?c.jsx("p",{className:"col-empty",children:"The hub could not read the session list. PRs and deploys are on the Flow tab."}):d.rows.length===0?c.jsx("p",{className:"col-empty","data-testid":"sessions-empty",children:"No sessions running. PRs and deploys are on the Flow tab."}):c.jsx("ul",{className:"flow-list","data-testid":"sessions-table","aria-label":"Sessions of this repo",children:d.rows.map(S=>c.jsxs("li",{className:"flow-row","data-testid":"session-row",children:[c.jsxs("div",{className:"flow-row-head",children:[c.jsx("span",{className:"flow-title mono",children:S.name}),c.jsx("span",{className:`chip tone-${S.status==="waiting"?"warn":S.status==="busy"?"good":"muted"}`,children:S.status}),S.copyWarning&&c.jsx("span",{className:"chip tone-bad","data-testid":"session-copies",children:S.copyWarning}),c.jsxs("button",{type:"button",className:"btn btn-act",onClick:()=>void v(S.key,S.name),"aria-label":`Copy session name ${S.name}`,children:[c.jsx(rd,{size:14,"aria-hidden":"true"}),f===S.key?"Copied":"Copy name"]})]}),c.jsxs("span",{className:"flow-why",children:[S.kind,S.waitingFor?` · waiting for ${S.waitingClass?Qm[S.waitingClass]:"an answer"}: ${S.waitingFor}`:"",S.since?` · since ${Vn(S.since,a)}`:""]}),S.copyWarning&&c.jsxs("span",{className:"flow-why tone-bad",children:["The same session runs in ",S.copies," windows. Close the extra copy."]})]},S.key))})]})}const Ym=Z.lazy(()=>fs(()=>import("./RoadmapTab-hUK2kzCW.js"),__vite__mapDeps([0,1]))),Gm=[{id:"flow",label:"Flow"},{id:"roadmap",label:"Roadmap"},{id:"sessions",label:"Sessions"}],Xm={ready:"good",merging:"good",blocked:"bad",held:"warn",ci:"muted",waiting:"muted"};function Zm({repo:i,item:s,grey:a,act:d}){return c.jsxs("li",{className:`flow-row${a?" grey":""}`,"data-testid":"queue-item",children:[c.jsxs("div",{className:"flow-row-head",children:[c.jsx("span",{className:"flow-pos mono",children:s.position}),c.jsxs("span",{className:"flow-title",children:["#",s.pr," ",s.title]})]}),c.jsxs("div",{className:"flow-flags",children:[c.jsx("span",{className:`chip tone-${Xm[s.state]??"muted"}`,children:s.state}),s.merging&&c.jsx("span",{className:"chip tone-good",children:"merging now"}),s.hotfix&&c.jsx("span",{className:"chip tone-warn","data-testid":"flag-hotfix",children:"hotfix"}),s.held&&c.jsx("span",{className:"chip tone-warn","data-testid":"flag-held",children:"held"})]}),s.whyWaiting&&c.jsx("span",{className:"flow-why",children:s.whyWaiting}),s.waitsOn.length>0&&c.jsxs("span",{className:"flow-why",children:["Waits on ",s.waitsOn.map(f=>`${f.repo.replace("__","/")}#${f.pr}`).join(", ")]}),c.jsx(tl,{repo:i,specs:hs(i,{pr:s.pr,headSha:s.headSha,hotfix:s.hotfix,held:s.held}),act:d})]})}function Jm({state:i,repo:s,nowMs:a,act:d}){const f=Bm(i,s);return c.jsxs("div",{className:"flow","data-testid":"flow",children:[c.jsx("div",{className:`lane-note flow-status ${f.mode}`,"data-testid":"flow-status",children:f.statusText}),f.owner.length>0&&c.jsxs("section",{className:"flow-section","aria-label":"Owner approvals",children:[c.jsxs("h2",{className:"flow-h",children:["Needs your approval · ",f.owner.length]}),c.jsx("ul",{className:"flow-list",children:f.owner.map(h=>c.jsxs("li",{className:"flow-row","data-testid":"owner-item",children:[c.jsxs("span",{className:"flow-title",children:[h.pr!==null?`#${h.pr} `:"",h.what]}),c.jsx($d,{item:h}),c.jsx(tl,{repo:s,specs:Nd(s,h),act:d,reason:Ed(s,h)})]},h.id))})]}),c.jsxs("section",{className:"flow-section","aria-label":"Merge queue",children:[c.jsxs("h2",{className:"flow-h",children:["Merge queue · ",f.queue.length,f.grey?" · last known":""]}),f.mode==="none"?c.jsx("p",{className:"col-empty",children:"No queue: this repo has no coordinator."}):f.queue.length===0?c.jsx("p",{className:"col-empty",children:"The queue is empty."}):c.jsx("ol",{className:"flow-list",children:f.queue.map(h=>c.jsx(Zm,{repo:s,item:h,grey:f.grey,act:d},h.pr))})]}),c.jsxs("section",{className:"flow-section","aria-label":"Deploy checks",children:[c.jsx("h2",{className:"flow-h",children:"Deploy checks"}),f.deploys.length===0?c.jsx("p",{className:"col-empty",children:"No deploy check recorded."}):c.jsx("ul",{className:"flow-list",children:f.deploys.map(h=>c.jsxs("li",{className:"flow-row","data-testid":"deploy-check",children:[c.jsxs("div",{className:"flow-row-head",children:[c.jsxs("span",{className:"flow-title",children:["#",h.pr," ",c.jsx("span",{className:"mono",children:h.mergeSha})]}),c.jsxs("span",{className:`chip tone-${h.health==="ok"?"good":h.health==="failed"?"bad":"muted"}`,children:["health ",h.health]})]}),h.checks&&c.jsx("div",{className:"flow-flags","data-testid":"deploy-marks",children:h.checks.map(v=>c.jsxs("span",{className:`chip tone-${v.mark==="pass"?"good":v.mark==="fail"?"bad":"muted"}`,children:[v.name," ",v.mark]},v.name))}),c.jsxs("span",{className:"flow-why",children:[h.run!==null?`run ${h.run} · `:"",Vn(h.at,a),h.reason?` · ${h.reason}`:""]})]},`${h.pr}-${h.mergeSha}`))})]}),f.unqueued.length>0&&c.jsxs("section",{className:"flow-section","aria-label":"Open PRs not in the queue",children:[c.jsxs("h2",{className:"flow-h",children:["Open PRs not in the queue · ",f.unqueued.length]}),c.jsx("ul",{className:"flow-list",children:f.unqueued.map(h=>c.jsxs("li",{className:"flow-row","data-testid":"unqueued-pr",children:[c.jsxs("span",{className:"flow-title",children:["#",h.number," ",h.title]}),c.jsxs("span",{className:`flow-why tone-${h.requiredState==="fail"?"bad":h.requiredState==="pass"?"good":"muted"}`,children:["required checks ",h.requiredState]})]},h.number))})]}),f.requests.length>0&&c.jsxs("section",{className:"flow-section","aria-label":"Your requests",children:[c.jsx("h2",{className:"flow-h",children:"Your requests"}),c.jsx("ul",{className:"flow-list",children:f.requests.slice(0,10).map(h=>c.jsxs("li",{className:"flow-row","data-testid":"request-log",children:[c.jsx("span",{className:`tone-${Td(h.status)}`,children:Cd(h)}),c.jsxs("span",{className:"flow-why",children:[h.pr!==null?`PR #${h.pr}`:h.what," · ",Vn(h.created_at,a)]})]},h.id))})]})]})}function bm({state:i,repo:s,nowMs:a,act:d,tab:f,roadmap:h}){const v=ys(s);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"page-header",children:[c.jsx("h1",{className:"page-title",children:Mr(s)}),c.jsx("span",{className:"page-subtitle",children:s.name})]}),c.jsx("nav",{className:"repo-tabs",role:"tablist","aria-label":"Repo views",children:Gm.map(S=>c.jsx("a",{role:"tab","aria-selected":f===S.id,"aria-current":f===S.id?"page":void 0,className:`folder-btn${f===S.id?" sel":""}`,href:Im(v,S.id),"data-testid":`tab-${S.id}`,children:S.id==="roadmap"?lm(s):S.label},S.id))}),f==="flow"&&c.jsx(Jm,{state:i,repo:s,nowMs:a,act:d}),f==="roadmap"&&c.jsx(Z.Suspense,{fallback:c.jsx("p",{className:"page-subtitle",children:"Loading..."}),children:c.jsx(Ym,{repo:s,slug:h,stale:im(i),lastOkAt:i.sources.collector.last_ok_at},h??"")}),f==="sessions"&&c.jsx(Km,{state:i,repo:s,nowMs:a})]})}const eg=1,Ac={collector:"Plans and roadmaps",agents:"Claude sessions",github:"GitHub",coordinator:"Coordinator"};function tg(i){var d,f;const s=[];(i.schema>eg||i.update_needed)&&s.push({id:"schema",tone:"bad",text:"This hub is older than its data. Update the hub:",command:"npm i -g @caddis/cli@latest"});const a=(d=i.sources)==null?void 0:d.agents;a&&!a.ok&&s.push({id:"agents-failed",tone:"bad",text:`Session list unavailable: "claude agents" failed${a.last_error?` (${a.last_error})`:""}.`});for(const h of Object.keys(Ac)){const v=(f=i.sources)==null?void 0:f[h];v!=null&&v.stale&&(h==="agents"&&!v.ok||s.push({id:`stale-${h}`,tone:"warn",text:`${Ac[h]} data is stale. Last good read: ${v.last_ok_at?Or(v.last_ok_at):"never"}.`}))}return s}function ng({state:i}){const s=tg(i);return s.length===0?null:c.jsx("div",{className:"banners",role:"region","aria-label":"Warnings",children:s.map(a=>c.jsxs("div",{className:`banner ${a.tone}`,role:"status","data-testid":`banner-${a.id}`,children:[a.tone==="bad"?c.jsx(Ph,{size:16,"aria-hidden":"true"}):c.jsx(Mh,{size:16,"aria-hidden":"true"}),c.jsxs("span",{children:[a.text,a.command&&c.jsxs(c.Fragment,{children:[" ",c.jsx("code",{className:"cmd",children:a.command})]})]})]},a.id))})}const Bd="caddis-hub-theme",rg=["dark","light","system"];function Wd(){try{return window.localStorage}catch{return null}}function og(i=Wd()){try{const s=i==null?void 0:i.getItem(Bd);return s==="dark"||s==="light"||s==="system"?s:"system"}catch{return"system"}}function lg(i,s=Wd()){try{s==null||s.setItem(Bd,i)}catch{}}function ig(i,s){return i==="system"?s?"dark":"light":i}const sg={dark:zh,light:Oh,system:$h};function ag({state:i,nowMs:s,theme:a,onTheme:d}){const f=Wh(i==null?void 0:i.spend),h=i==null?void 0:i.versions,v=qh(i),S=zd(i);return c.jsxs("footer",{className:"sidebar-footer",children:[c.jsxs("div",{className:"footer-meta",children:[c.jsxs("div",{className:"updated-line",children:[c.jsx(Nh,{size:14,"aria-hidden":"true"}),c.jsx("span",{"data-testid":"data-age",children:i?Bh(i.generated_at,s):"Waiting for data"})]}),c.jsxs("div",{className:"spend-box",children:[c.jsxs("div",{className:"spend-row",children:[c.jsx("span",{children:"agy spend (24 h)"}),c.jsx("span",{className:"mono",children:f.configured?`${f.committedEur.toFixed(2)} / ${f.capEur.toFixed(0)} EUR`:"no cap set"})]}),c.jsx("div",{className:"meter-track",role:"progressbar","aria-label":"agy spend","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(f.pct),children:c.jsx("div",{className:`meter-fill${f.pct>=80?" hot":""}`,style:{width:`${f.pct}%`}})})]}),S&&!v&&c.jsxs("div",{className:"quota-line mono","data-testid":"quota",children:["GitHub quota ",S.remaining," left (",S.account,")"]}),v&&c.jsxs("div",{className:"quota-low","data-testid":"quota-low",role:"status",children:["GitHub quota low: ",v.remaining," left (",v.account,")",v.resetAt?`, resets ${Or(v.resetAt)}`:"",". Polling slows."]}),h&&c.jsxs("div",{className:"versions mono",children:["hub ",h.hub," | pool ",h.pool??"-"," | plugin ",h.plugin??"-"]})]}),c.jsx("div",{className:"theme-switch",role:"group","aria-label":"Theme",children:rg.map(y=>{const E=sg[y];return c.jsxs("button",{type:"button",className:`theme-btn${a===y?" active":""}`,"aria-pressed":a===y,title:y,onClick:()=>d(y),children:[c.jsx(E,{size:15,"aria-hidden":"true"}),c.jsx("span",{children:y})]},y)})})]})}const ug="/assets/mark-small-B1q4Vk3J.svg",cg="/assets/wordmark-CD0s2ofS.svg";function Fc(){return c.jsxs("span",{className:"brand-logo",children:[c.jsx("img",{src:ug,alt:"",width:36,height:36,className:"brand-mark"}),c.jsxs("span",{className:"brand-stack",children:[c.jsx("img",{src:cg,alt:"CADDIS",width:100,height:20,className:"brand-wordmark"}),c.jsx("span",{className:"brand-sub",children:"hub"})]})]})}function dg(i,s){var f;return i.error||(f=i.github)!=null&&f.error?"blocked":s.sessions.some(h=>h.repo_path===i.path&&h.waiting_class==="owner")||i.coordinator&&s.sources.coordinator.stale?"attention":!i.coordinator&&!s.sessions.some(h=>h.repo_path===i.path)?"idle":"ok"}function Dr({href:i,active:s,icon:a,label:d,badge:f,onGo:h}){return c.jsx("li",{children:c.jsxs("a",{className:`nav-link${s?" active":""}`,href:i,"aria-current":s?"page":void 0,onClick:h,children:[c.jsxs("span",{className:"nav-link-left",children:[a,c.jsx("span",{className:"nav-text",children:d})]}),f]})})}function fg({route:i,state:s,inbox:a,open:d,onToggle:f,children:h}){const v=()=>f(!1);return c.jsxs(c.Fragment,{children:[c.jsxs("header",{className:"mobile-topbar",children:[c.jsxs("button",{type:"button",className:"menu-btn","aria-label":"Open navigation menu","aria-expanded":d,"aria-controls":"app-sidebar",onClick:()=>f(!d),children:[d?c.jsx(Ah,{size:18}):c.jsx(Th,{size:18}),c.jsx("span",{children:"Menu"})]}),c.jsx(Fc,{})]}),c.jsx("div",{className:`drawer-backdrop${d?" open":""}`,onClick:v,"aria-hidden":"true"}),c.jsxs("aside",{className:`sidebar${d?" drawer-open":""}`,id:"app-sidebar",children:[c.jsxs("nav",{className:"sidebar-top","aria-label":"Main",children:[c.jsx("div",{className:"brand-row",children:c.jsx(Fc,{})}),c.jsxs("ul",{className:"nav-list",children:[c.jsx(Dr,{href:"#/inbox",active:i.page==="inbox",icon:c.jsx(Eh,{size:18}),label:"Inbox",badge:a>0?c.jsx("span",{className:"inbox-badge",children:a}):void 0,onGo:v}),c.jsx(Dr,{href:"#/overview",active:i.page==="overview",icon:c.jsx(Ch,{size:18}),label:"Overview",onGo:v})]}),c.jsx("div",{className:"nav-section-label",children:"Repos"}),c.jsxs("ul",{className:"nav-list",children:[(s==null?void 0:s.repos.length)===0&&c.jsx("li",{className:"nav-empty",children:"No repos yet"}),s==null?void 0:s.repos.map(S=>{const y=ys(S),E=i.page==="repo"&&i.id===y;return c.jsx(Dr,{href:cs(y),active:E,icon:c.jsx("span",{className:`repo-dot ${dg(S,s)}`,"aria-hidden":"true"}),label:S.name,onGo:v},S.path)})]}),c.jsx("div",{className:"nav-section-label",children:"More"}),c.jsxs("ul",{className:"nav-list",children:[c.jsx(Dr,{href:"#/activity",active:i.page==="activity",icon:c.jsx(gh,{size:18}),label:"Activity",onGo:v}),c.jsx(Dr,{href:"#/guide",active:i.page==="guide",icon:c.jsx(kh,{size:18}),label:"caddis guide",onGo:v})]})]}),h]})]})}const pg="/assets/favicon-DtHQyAC1.svg",hg="/assets/favicon-dot-DHAVYP15.svg",mg=i=>i?hg:pg;function gg(i){let s=document.querySelector('link[rel="icon"]');s||(s=document.createElement("link"),s.rel="icon",document.head.appendChild(s)),s.type="image/svg+xml",s.href=mg(i)}const yg=()=>{var i;return((i=window.matchMedia)==null?void 0:i.call(window,"(prefers-color-scheme: dark)").matches)??!0};function vg(){const[i,s]=Z.useState(()=>og());return Z.useEffect(()=>{const a=()=>{document.documentElement.dataset.theme=ig(i,yg())};if(a(),i!=="system"||!window.matchMedia)return;const d=window.matchMedia("(prefers-color-scheme: dark)");return d.addEventListener("change",a),()=>d.removeEventListener("change",a)},[i]),[i,a=>{lg(a),s(a)}]}const wg=1e4;function kg(){const[i,s]=Z.useState(null),[a,d]=Z.useState(null),[f,h]=Z.useState(!0),v=Z.useRef(void 0),S=Z.useRef(!0),y=Z.useCallback(async()=>{try{const j=await nh();if(!S.current)return;s(j),d(null)}catch(j){if(!S.current)return;d(j instanceof is&&j.status===401?"unauthorized":"network")}finally{S.current&&h(!1)}},[]);Z.useEffect(()=>{S.current=!0;const j=()=>window.clearInterval(v.current),L=()=>{j(),v.current=window.setInterval(()=>void y(),wg)},P=()=>{document.hidden?j():(y(),L())};return y(),document.hidden||L(),document.addEventListener("visibilitychange",P),()=>{S.current=!1,j(),document.removeEventListener("visibilitychange",P)}},[y]);const E=Z.useCallback(()=>void y(),[y]);return{state:i,error:a,loading:f,refresh:E}}const xg=Z.lazy(()=>fs(()=>import("./Guide-6aEYW9oW.js"),__vite__mapDeps([2,3])).then(i=>({default:i.Guide}))),Sg=Z.lazy(()=>fs(()=>import("./Activity-C9TCizJV.js"),__vite__mapDeps([4,1])));function Ng(i){const[s,a]=Z.useState(()=>Date.now());return Z.useEffect(()=>{const d=window.setInterval(()=>a(Date.now()),i);return()=>window.clearInterval(d)},[i]),s}function _g(){const[i,s]=Z.useState(()=>window.location.hash);return Z.useEffect(()=>{const a=()=>s(window.location.hash);return window.addEventListener("hashchange",a),()=>window.removeEventListener("hashchange",a)},[]),Mm(i)}function jg(){const{state:i,error:s,loading:a,refresh:d}=kg(),f=lh(d),h=Ng(5e3),v=_g(),[S,y]=vg(),[E,j]=Z.useState(!1),L=Em(i,h),P=L.model.items.length;Z.useEffect(()=>{document.title=Hh(P),gg(P>0)},[P]);let O;if(s==="unauthorized")O=c.jsxs("div",{className:"notice","data-testid":"signin",children:[c.jsx("h1",{className:"page-title",children:"Signed out"}),c.jsxs("p",{children:["Run ",c.jsx("code",{className:"cmd",children:"caddis hub open"})," to sign in."]})]});else if(!i)O=c.jsx("p",{className:"page-subtitle",children:a?"Loading...":"The hub did not answer. Retrying."});else if(v.page==="inbox")O=c.jsx(Sm,{state:i,nowMs:h,api:L,act:f});else if(v.page==="overview")O=c.jsx(Om,{state:i,nowMs:h,api:L,act:f});else if(v.page==="repo"){const _=i.repos.find(K=>ys(K)===v.id);O=_?c.jsx(bm,{state:i,repo:_,nowMs:h,act:f,tab:v.tab,roadmap:v.roadmap},v.id):c.jsxs("div",{className:"notice",children:[c.jsx("h1",{className:"page-title",children:v.id}),c.jsx("p",{children:"This repo is not in the hub registry."})]})}else v.page==="guide"?O=c.jsx(Z.Suspense,{fallback:c.jsx("p",{className:"page-subtitle",children:"Loading..."}),children:c.jsx(xg,{guide:i.guide,versions:i.versions})}):O=c.jsx(Z.Suspense,{fallback:c.jsx("p",{className:"page-subtitle",children:"Loading..."}),children:c.jsx(Sg,{state:i})});return c.jsxs("div",{className:"app-shell",children:[c.jsx(fg,{route:v,state:i,inbox:P,open:E,onToggle:j,children:c.jsx(ag,{state:i,nowMs:h,theme:S,onTheme:y})}),c.jsx("main",{className:"main-area",id:"main-content",children:c.jsxs("div",{className:"page-wrap",children:[i&&c.jsx(ng,{state:i}),s==="network"&&i&&c.jsx("div",{className:"banner warn",role:"status",children:"The hub did not answer. Showing the last data."}),O]})})]})}eh();const Uc=document.getElementById("root");Uc&&Gp.createRoot(Uc).render(c.jsx(Z.StrictMode,{children:c.jsx(jg,{})}));export{Am as D,Eg as N,Tg as P,Qh as T,qn as a,ys as b,de as c,Mr as d,Im as e,Rd as f,Or as g,Lg as h,Cg as i,c as j,zg as k,Rg as l,$g as m,im as n,Pg as o,Kh as p,Z as r};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" shape-rendering="crispEdges" role="img" aria-label="Caddis">
|
|
2
|
+
<path fill="#0D42FC" d="M12 1h1v1h-1zM11 2h1v1h-1zM12 2h1v1h-1zM10 3h1v1h-1zM11 3h1v1h-1zM12 3h1v1h-1zM9 4h1v1h-1zM10 4h1v1h-1zM11 4h1v1h-1zM12 4h1v1h-1zM10 5h1v1h-1zM11 5h1v1h-1zM7 6h1v1h-1zM10 6h1v1h-1zM6 7h1v1h-1zM7 7h1v1h-1zM5 8h1v1h-1zM6 8h1v1h-1zM7 8h1v1h-1zM5 9h1v1h-1zM6 9h1v1h-1zM7 9h1v1h-1zM4 10h1v1h-1zM5 10h1v1h-1zM6 10h1v1h-1zM4 11h1v1h-1zM5 11h1v1h-1zM6 11h1v1h-1zM4 12h1v1h-1zM5 12h1v1h-1zM6 12h1v1h-1zM4 13h1v1h-1zM5 13h1v1h-1zM4 14h1v1h-1zM5 14h1v1h-1zM4 15h1v1h-1z"/>
|
|
3
|
+
<path fill="#00CAD5" d="M19 3h1v1h-1zM20 3h1v1h-1zM16 4h1v1h-1zM17 4h1v1h-1zM18 4h1v1h-1zM19 4h1v1h-1zM20 4h1v1h-1zM13 5h1v1h-1zM14 5h1v1h-1zM15 5h1v1h-1zM16 5h1v1h-1zM17 5h1v1h-1zM18 5h1v1h-1zM19 5h1v1h-1zM12 6h1v1h-1zM13 6h1v1h-1zM14 6h1v1h-1zM15 6h1v1h-1zM16 6h1v1h-1zM17 6h1v1h-1zM18 6h1v1h-1zM11 7h1v1h-1zM12 7h1v1h-1zM13 7h1v1h-1zM14 7h1v1h-1zM11 8h1v1h-1zM12 8h1v1h-1z"/>
|
|
4
|
+
<path fill="#91D202" d="M8 5h1v1h-1zM9 5h1v1h-1zM8 6h1v1h-1zM9 6h1v1h-1zM8 7h1v1h-1zM9 7h1v1h-1zM10 7h1v1h-1zM8 8h1v1h-1zM9 8h1v1h-1zM10 8h1v1h-1zM9 9h1v1h-1zM10 9h1v1h-1zM11 9h1v1h-1zM12 9h1v1h-1zM10 10h1v1h-1zM11 10h1v1h-1zM12 10h1v1h-1zM13 10h1v1h-1zM14 10h1v1h-1zM12 11h1v1h-1zM13 11h1v1h-1zM15 13h1v1h-1zM14 14h1v1h-1zM15 14h1v1h-1zM14 15h1v1h-1zM15 15h1v1h-1zM13 16h1v1h-1zM14 16h1v1h-1zM15 16h1v1h-1zM12 17h1v1h-1zM13 17h1v1h-1zM14 17h1v1h-1zM10 18h1v1h-1zM11 18h1v1h-1zM12 18h1v1h-1zM13 18h1v1h-1zM8 19h1v1h-1zM9 19h1v1h-1zM10 19h1v1h-1zM11 19h1v1h-1zM12 19h1v1h-1zM7 20h1v1h-1zM8 20h1v1h-1zM9 20h1v1h-1zM10 20h1v1h-1zM7 21h1v1h-1zM8 21h1v1h-1zM7 22h1v1h-1z"/>
|
|
5
|
+
<path fill="#FC4E23" d="M20 7h1v1h-1zM18 8h1v1h-1zM19 8h1v1h-1zM20 8h1v1h-1zM17 9h1v1h-1zM18 9h1v1h-1zM19 9h1v1h-1zM15 10h1v1h-1zM16 10h1v1h-1zM17 10h1v1h-1zM18 10h1v1h-1zM14 11h1v1h-1zM15 11h1v1h-1zM16 11h1v1h-1zM17 11h1v1h-1zM13 12h1v1h-1zM14 12h1v1h-1zM15 12h1v1h-1zM12 13h1v1h-1zM13 13h1v1h-1zM14 13h1v1h-1zM13 14h1v1h-1z"/>
|
|
6
|
+
<path fill="#FDAD01" d="M7 10h1v1h-1zM7 11h1v1h-1zM8 11h1v1h-1zM9 11h1v1h-1zM7 12h1v1h-1zM8 12h1v1h-1zM9 12h1v1h-1zM10 12h1v1h-1zM9 13h1v1h-1zM10 13h1v1h-1zM11 13h1v1h-1zM10 14h1v1h-1zM11 14h1v1h-1zM12 14h1v1h-1zM11 15h1v1h-1zM12 15h1v1h-1zM13 15h1v1h-1zM12 16h1v1h-1zM15 17h1v1h-1zM14 18h1v1h-1zM15 18h1v1h-1zM16 18h1v1h-1zM17 18h1v1h-1zM14 19h1v1h-1zM15 19h1v1h-1zM16 19h1v1h-1zM17 19h1v1h-1zM18 19h1v1h-1zM19 19h1v1h-1zM15 20h1v1h-1zM16 20h1v1h-1zM17 20h1v1h-1zM18 20h1v1h-1zM19 20h1v1h-1zM20 20h1v1h-1zM17 21h1v1h-1zM18 21h1v1h-1zM19 21h1v1h-1z"/>
|
|
7
|
+
<path fill="#8730FB" d="M16 12h1v1h-1zM17 12h1v1h-1zM7 13h1v1h-1zM8 13h1v1h-1zM16 13h1v1h-1zM17 13h1v1h-1zM18 13h1v1h-1zM6 14h1v1h-1zM7 14h1v1h-1zM8 14h1v1h-1zM16 14h1v1h-1zM17 14h1v1h-1zM18 14h1v1h-1zM19 14h1v1h-1zM5 15h1v1h-1zM6 15h1v1h-1zM7 15h1v1h-1zM17 15h1v1h-1zM18 15h1v1h-1zM19 15h1v1h-1zM4 16h1v1h-1zM5 16h1v1h-1zM6 16h1v1h-1zM18 16h1v1h-1zM19 16h1v1h-1zM20 16h1v1h-1zM3 17h1v1h-1zM4 17h1v1h-1zM5 17h1v1h-1zM18 17h1v1h-1zM19 17h1v1h-1zM2 18h1v1h-1zM3 18h1v1h-1zM4 18h1v1h-1zM18 18h1v1h-1zM19 18h1v1h-1zM2 19h1v1h-1zM3 19h1v1h-1z"/>
|
|
8
|
+
</svg>
|
|
Binary file
|
|
Binary file
|
package/dist/ui/index.html
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
<title>caddis hub</title>
|
|
7
7
|
<link rel="icon" type="image/svg+xml" href="/assets/favicon-DtHQyAC1.svg" />
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-d44hkSAE.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DE7v-v_o.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
12
12
|
<div id="root"></div>
|