loki-mode 9.48.2 → 9.49.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/loki-issue-to-pr.yml +1 -1
- package/SKILL.md +2 -2
- package/VERSION +1 -1
- package/autonomy/loki +137 -12
- package/autonomy/provider-offer.sh +47 -0
- package/autonomy/quickstart.sh +306 -9
- package/dashboard/__init__.py +1 -1
- package/dashboard/static/index.html +7 -1
- package/docs/INSTALLATION.md +1 -1
- package/docs/KNOWN-ISSUES.md +42 -0
- package/loki-ts/dist/loki.js +317 -317
- package/mcp/__init__.py +1 -1
- package/package.json +1 -1
- package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
- package/web-app/dist/assets/{AdminPage-PyyVXg4b.js → AdminPage-DpV2vW3y.js} +1 -1
- package/web-app/dist/assets/{Avatar-CTUlr_Xf.js → Avatar-BXeMYK1_.js} +1 -1
- package/web-app/dist/assets/{Badge-BQeXvmg8.js → Badge-D8WddQk1.js} +1 -1
- package/web-app/dist/assets/{Button-Dc6-P6pz.js → Button-CFzTTVeJ.js} +1 -1
- package/web-app/dist/assets/{CockpitPage-BspOJ3Fv.js → CockpitPage-D1eQe9QF.js} +4 -4
- package/web-app/dist/assets/{ComparePage-CFXIM--Z.js → ComparePage-uX3OPphr.js} +1 -1
- package/web-app/dist/assets/{ErrorBoundary-C7vQYDW9.js → ErrorBoundary-wE3oxaG6.js} +1 -1
- package/web-app/dist/assets/{EvidenceReceiptPanel-CqjsjTOs.js → EvidenceReceiptPanel-B_Wouz6N.js} +1 -1
- package/web-app/dist/assets/{GitHubIssuesPanel-DyuNDMgD.js → GitHubIssuesPanel-DRlEeFuw.js} +1 -1
- package/web-app/dist/assets/{GitHubPRsPanel-BtAq20xF.js → GitHubPRsPanel-CCv6_I74.js} +2 -2
- package/web-app/dist/assets/{HomePage-BuVFOrO8.js → HomePage-EG-jq8nR.js} +1 -1
- package/web-app/dist/assets/{LoginPage-CuhhrxGb.js → LoginPage-CEOnBICH.js} +1 -1
- package/web-app/dist/assets/{MagicPage-D2KZPX3F.js → MagicPage-DeWaFdsG.js} +1 -1
- package/web-app/dist/assets/MetricsPage-CG8CuSSJ.js +6 -0
- package/web-app/dist/assets/{NotFoundPage-CTnnaWlL.js → NotFoundPage-Mz5rOat6.js} +1 -1
- package/web-app/dist/assets/{ProjectPage-uJFaoM8-.js → ProjectPage-D2Fh6tVw.js} +8 -8
- package/web-app/dist/assets/{ProjectsPage-8lKAOBIW.js → ProjectsPage-B8cRWkWa.js} +2 -2
- package/web-app/dist/assets/{SettingsPage-D1BBd5qy.js → SettingsPage-DKpsst6x.js} +1 -1
- package/web-app/dist/assets/{ShowcasePage-CmQ0n8iO.js → ShowcasePage-qab065PM.js} +1 -1
- package/web-app/dist/assets/SystemSettingsPage-9qmEH2Y6.js +1 -0
- package/web-app/dist/assets/{TeamsPage-BS0TtVUa.js → TeamsPage-CW6lvW-0.js} +1 -1
- package/web-app/dist/assets/{TemplatesPage-C2zPnnf2.js → TemplatesPage-B-a61T6a.js} +1 -1
- package/web-app/dist/assets/{TerminalOutput-Dle1klqq.js → TerminalOutput-CJy13rAn.js} +1 -1
- package/web-app/dist/assets/{activity-DQp5U9f9.js → activity-CA4moIvC.js} +1 -1
- package/web-app/dist/assets/{bell-BqkTmgL7.js → bell-JyOeobLN.js} +1 -1
- package/web-app/dist/assets/{bot-DILhaIGH.js → bot-Cu4UwP5w.js} +1 -1
- package/web-app/dist/assets/{check-BC9x7oPm.js → check-Drzd8-9c.js} +1 -1
- package/web-app/dist/assets/{chevron-left--yqvAfjx.js → chevron-left-ClvdXm3Y.js} +1 -1
- package/web-app/dist/assets/{circle-alert-DOH6PcgZ.js → circle-alert-CstyZfKG.js} +1 -1
- package/web-app/dist/assets/{clock-DKSDFsE6.js → clock-Bnz6tlQN.js} +1 -1
- package/web-app/dist/assets/{cloud-DRBU3JYs.js → cloud-IPIgE4P3.js} +1 -1
- package/web-app/dist/assets/{code-xml-D2LqszR9.js → code-xml-BOZbQiOt.js} +1 -1
- package/web-app/dist/assets/{database-D7ceedlh.js → database-CHclPjog.js} +1 -1
- package/web-app/dist/assets/{dollar-sign-D0A47egY.js → dollar-sign-D6RFNgdZ.js} +1 -1
- package/web-app/dist/assets/{file-code-corner-CH_Qbtjo.js → file-code-corner-CNayCvOY.js} +1 -1
- package/web-app/dist/assets/{file-plus-CUNMjHk9.js → file-plus-BmVfFwsX.js} +1 -1
- package/web-app/dist/assets/folder-open-ChzGfLRr.js +11 -0
- package/web-app/dist/assets/{globe-gZnaGg8N.js → globe-DtXgCG3Z.js} +1 -1
- package/web-app/dist/assets/{hammer-BhJC5DMK.js → hammer-DCa0I_7V.js} +1 -1
- package/web-app/dist/assets/{index-BMmYYws0.js → index-Cu-njJ8o.js} +3 -3
- package/web-app/dist/assets/index-D98GzaW8.css +1 -0
- package/web-app/dist/assets/{layers-glXeoUbJ.js → layers-DxIhn7NZ.js} +1 -1
- package/web-app/dist/assets/{lightbulb-gXn8H0Lf.js → lightbulb-D7Pzhd06.js} +1 -1
- package/web-app/dist/assets/{loader-circle-Do2ke8xm.js → loader-circle-DXgc_u5I.js} +1 -1
- package/web-app/dist/assets/{lock-Bgplb1_n.js → lock-qRAVU53b.js} +1 -1
- package/web-app/dist/assets/{mail-j4Lo8hfB.js → mail-CHe3KyCw.js} +1 -1
- package/web-app/dist/assets/{minus-dhrzKSK5.js → minus-B8p0FoYZ.js} +1 -1
- package/web-app/dist/assets/{package-CInWQQ97.js → package-C5LDn8SI.js} +1 -1
- package/web-app/dist/assets/{plus-BpYvoLlZ.js → plus-CRd_FHOA.js} +1 -1
- package/web-app/dist/assets/{refresh-cw-F6koqEgF.js → refresh-cw-DKoSN8s3.js} +1 -1
- package/web-app/dist/assets/{rotate-ccw-CQ2W5S8f.js → rotate-ccw-Nf8zB8G0.js} +1 -1
- package/web-app/dist/assets/{save-DMCYGm06.js → save-B8ytQLgW.js} +1 -1
- package/web-app/dist/assets/{server-Bj8EX4Z1.js → server-D_VRDkaD.js} +1 -1
- package/web-app/dist/assets/{shield-alert-CiYuulCU.js → shield-alert-PsDkSyFD.js} +1 -1
- package/web-app/dist/assets/{thumbs-up-BqEh1puP.js → thumbs-up-Da1QQhqo.js} +11 -6
- package/web-app/dist/assets/{trash-2-CCwouZJJ.js → trash-2-ChoylpGQ.js} +1 -1
- package/web-app/dist/assets/{trending-down-Cx1vhE4o.js → trending-down-CX2fUeho.js} +1 -1
- package/web-app/dist/assets/{trending-up-BUhVYJ2T.js → trending-up-CGyYgZH7.js} +1 -1
- package/web-app/dist/assets/{upload-D5IsZeFM.js → upload-KkeVyg67.js} +1 -1
- package/web-app/dist/assets/{usePolling-CJbfhFcH.js → usePolling-C5f4xrXD.js} +1 -1
- package/web-app/dist/assets/{user-BRLhezsD.js → user-WCGccIST.js} +1 -1
- package/web-app/dist/index.html +2 -2
- package/web-app/server.py +121 -1
- package/web-app/dist/assets/MetricsPage-DFEYJl9z.js +0 -6
- package/web-app/dist/assets/SystemSettingsPage-CSHaVyuD.js +0 -6
- package/web-app/dist/assets/copy-BKW4U4Qr.js +0 -6
- package/web-app/dist/assets/folder-open-CQ_SVq94.js +0 -6
- package/web-app/dist/assets/git-commit-horizontal-DQUBe0oD.js +0 -6
- package/web-app/dist/assets/index-84JUN_aA.css +0 -1
|
@@ -1,26 +1,31 @@
|
|
|
1
|
-
import{c
|
|
1
|
+
import{c}from"./index-Cu-njJ8o.js";/**
|
|
2
2
|
* @license lucide-react v0.577.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const
|
|
6
|
+
*/const e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],n=c("circle-dot",e);/**
|
|
7
7
|
* @license lucide-react v0.577.0 - ISC
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const t=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]],
|
|
11
|
+
*/const t=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]],s=c("file-question-mark",t);/**
|
|
12
12
|
* @license lucide-react v0.577.0 - ISC
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the ISC license.
|
|
15
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const
|
|
16
|
+
*/const o=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],l=c("git-commit-horizontal",o);/**
|
|
17
17
|
* @license lucide-react v0.577.0 - ISC
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const
|
|
21
|
+
*/const a=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]],h=c("git-pull-request",a);/**
|
|
22
22
|
* @license lucide-react v0.577.0 - ISC
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the ISC license.
|
|
25
25
|
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const
|
|
26
|
+
*/const i=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],d=c("history",i);/**
|
|
27
|
+
* @license lucide-react v0.577.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 y=[["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}],["path",{d:"M7 10v12",key:"1qc93n"}]],k=c("thumbs-up",y);export{n as C,s as F,h as G,d as H,k as T,l as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./index-
|
|
1
|
+
import{r as e}from"./index-Cu-njJ8o.js";function m(s,u=2e3,a=!0){const[c,l]=e.useState(null),[f,o]=e.useState(null),[i,d]=e.useState(!0),r=e.useRef(!0),n=e.useCallback(async()=>{try{const t=await s();r.current&&(l(t),o(null))}catch(t){r.current&&o(t instanceof Error?t.message:"Unknown error")}finally{r.current&&d(!1)}},[s]);return e.useEffect(()=>{if(r.current=!0,!a)return;n();const t=setInterval(n,u);return()=>{r.current=!1,clearInterval(t)}},[n,u,a]),{data:c,error:f,loading:i,refresh:n}}export{m as u};
|
package/web-app/dist/index.html
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
8
8
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
9
9
|
<link href="https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
|
|
10
|
-
<script type="module" crossorigin src="/lab/assets/index-
|
|
11
|
-
<link rel="stylesheet" crossorigin href="/lab/assets/index-
|
|
10
|
+
<script type="module" crossorigin src="/lab/assets/index-Cu-njJ8o.js"></script>
|
|
11
|
+
<link rel="stylesheet" crossorigin href="/lab/assets/index-D98GzaW8.css">
|
|
12
12
|
</head>
|
|
13
13
|
<body class="bg-background text-ink font-sans antialiased">
|
|
14
14
|
<div id="root"></div>
|
package/web-app/server.py
CHANGED
|
@@ -8304,6 +8304,68 @@ async def get_all_deploy_status() -> JSONResponse:
|
|
|
8304
8304
|
except (FileNotFoundError, subprocess.TimeoutExpired, OSError):
|
|
8305
8305
|
return {"connected": True, "user": data.get("user", "unknown"), "warning": "Could not re-verify"}
|
|
8306
8306
|
|
|
8307
|
+
# THE DEFECT this closes: the two coroutines above were defined and then
|
|
8308
|
+
# never awaited. The function body ended here with no gather and no return,
|
|
8309
|
+
# so FastAPI serialized None. A null body is the worst failure shape
|
|
8310
|
+
# available: res.ok is true and the content-type is JSON, so the client
|
|
8311
|
+
# raises nothing, renders every platform as disconnected, and re-polls
|
|
8312
|
+
# every 30s forever with no error to diagnose.
|
|
8313
|
+
#
|
|
8314
|
+
# THREE keys, not two: types/api.ts:232 declares github alongside vercel
|
|
8315
|
+
# and netlify. Returning only the two that had local coroutines would leave
|
|
8316
|
+
# statuses.github undefined in a UI that reads it. get_github_status
|
|
8317
|
+
# (defined below) is the ready-made third.
|
|
8318
|
+
vercel, netlify = await asyncio.gather(_check_vercel(), _check_netlify())
|
|
8319
|
+
try:
|
|
8320
|
+
github_resp = await get_github_status()
|
|
8321
|
+
github = json.loads(bytes(github_resp.body).decode("utf-8"))
|
|
8322
|
+
except Exception:
|
|
8323
|
+
# Never let the third checker take down the two that succeeded. An
|
|
8324
|
+
# honest "unknown" beats a 500 that hides working platforms.
|
|
8325
|
+
github = {"connected": False, "error": "Could not determine GitHub status"}
|
|
8326
|
+
|
|
8327
|
+
return JSONResponse(content={
|
|
8328
|
+
"vercel": vercel,
|
|
8329
|
+
"netlify": netlify,
|
|
8330
|
+
"github": github,
|
|
8331
|
+
})
|
|
8332
|
+
|
|
8333
|
+
|
|
8334
|
+
@app.post("/api/deploy/{platform}/disconnect")
|
|
8335
|
+
async def disconnect_platform(platform: str) -> JSONResponse:
|
|
8336
|
+
"""Remove a stored platform token.
|
|
8337
|
+
|
|
8338
|
+
SECURITY: _token_path interpolates `platform` directly into a filename
|
|
8339
|
+
(f"{platform}.json"), so an unvalidated value here is a file-delete
|
|
8340
|
+
primitive -- "../../something" would escape _TOKENS_DIR. The whitelist is
|
|
8341
|
+
the control, applied BEFORE the path is ever constructed.
|
|
8342
|
+
|
|
8343
|
+
`github` is deliberately refused rather than silently accepted: it holds no
|
|
8344
|
+
token file, so reporting success would tell the user we disconnected
|
|
8345
|
+
something we never touched.
|
|
8346
|
+
"""
|
|
8347
|
+
if platform not in ("vercel", "netlify"):
|
|
8348
|
+
return JSONResponse(
|
|
8349
|
+
status_code=400,
|
|
8350
|
+
content={"error": f"Unknown platform '{platform}'. Expected vercel or netlify."},
|
|
8351
|
+
)
|
|
8352
|
+
|
|
8353
|
+
path = _token_path(platform)
|
|
8354
|
+
existed = path.exists()
|
|
8355
|
+
if existed:
|
|
8356
|
+
try:
|
|
8357
|
+
path.unlink()
|
|
8358
|
+
except OSError as exc:
|
|
8359
|
+
return JSONResponse(
|
|
8360
|
+
status_code=500,
|
|
8361
|
+
content={"error": f"Could not remove the stored {platform} token: {exc}"},
|
|
8362
|
+
)
|
|
8363
|
+
|
|
8364
|
+
# `existed` is reported rather than swallowed so a no-op disconnect is
|
|
8365
|
+
# distinguishable from a real one.
|
|
8366
|
+
return JSONResponse(content={"disconnected": True, "platform": platform, "had_token": existed})
|
|
8367
|
+
|
|
8368
|
+
|
|
8307
8369
|
# ---------------------------------------------------------------------------
|
|
8308
8370
|
# GitHub Actions endpoints (CI/CD panel)
|
|
8309
8371
|
# ---------------------------------------------------------------------------
|
|
@@ -8853,6 +8915,47 @@ def _dashboard_proofs_module():
|
|
|
8853
8915
|
return None
|
|
8854
8916
|
|
|
8855
8917
|
|
|
8918
|
+
# ---------------------------------------------------------------------------
|
|
8919
|
+
# Cost readers, delegated for the same reason as the proof readers above.
|
|
8920
|
+
#
|
|
8921
|
+
# MetricsPage rendered SEVEN hardcoded arrays (cost trend, token split, builds
|
|
8922
|
+
# per day, radar axes/datasets, timeline phases, KPIs) with zero fetch calls --
|
|
8923
|
+
# invented numbers presented as measurement. The dashboard already computes the
|
|
8924
|
+
# real series at /api/cost and /api/cost/timeline, and its implementation is
|
|
8925
|
+
# explicit that "Cost is never fabricated: when nothing was recorded,
|
|
8926
|
+
# cost_recorded is False and totals are honestly null rather than a misleading
|
|
8927
|
+
# $0.00." Delegating keeps that honesty rather than forking it.
|
|
8928
|
+
# ---------------------------------------------------------------------------
|
|
8929
|
+
@app.get("/api/cost")
|
|
8930
|
+
async def webapp_cost() -> Response:
|
|
8931
|
+
"""Current cost totals. Mirrors the dashboard's /api/cost exactly."""
|
|
8932
|
+
dash = _dashboard_proofs_module()
|
|
8933
|
+
if dash is None:
|
|
8934
|
+
# Honest "unmeasured", never a fabricated zero. A partial install
|
|
8935
|
+
# cannot read cost; saying $0.00 would be a lie the UI would render.
|
|
8936
|
+
return JSONResponse(content={"cost_recorded": False, "total_usd": None})
|
|
8937
|
+
try:
|
|
8938
|
+
return JSONResponse(content=await dash.get_cost())
|
|
8939
|
+
except Exception as e:
|
|
8940
|
+
return JSONResponse(status_code=500, content={"error": str(e)})
|
|
8941
|
+
|
|
8942
|
+
|
|
8943
|
+
@app.get("/api/cost/timeline")
|
|
8944
|
+
async def webapp_cost_timeline() -> Response:
|
|
8945
|
+
"""Cost over time. Mirrors the dashboard's /api/cost/timeline exactly."""
|
|
8946
|
+
dash = _dashboard_proofs_module()
|
|
8947
|
+
if dash is None:
|
|
8948
|
+
return JSONResponse(content={
|
|
8949
|
+
"current_run": {"iterations": [], "total_usd": None,
|
|
8950
|
+
"cost_recorded": False},
|
|
8951
|
+
"runs": [],
|
|
8952
|
+
})
|
|
8953
|
+
try:
|
|
8954
|
+
return JSONResponse(content=await dash.get_cost_timeline())
|
|
8955
|
+
except Exception as e:
|
|
8956
|
+
return JSONResponse(status_code=500, content={"error": str(e)})
|
|
8957
|
+
|
|
8958
|
+
|
|
8856
8959
|
@app.get("/api/proofs")
|
|
8857
8960
|
async def webapp_list_proofs() -> Response:
|
|
8858
8961
|
"""List Evidence Receipts. Mirrors the dashboard's /api/proofs exactly."""
|
|
@@ -8911,9 +9014,20 @@ async def webapp_get_proof(run_id: str) -> Response:
|
|
|
8911
9014
|
# ---------------------------------------------------------------------------
|
|
8912
9015
|
|
|
8913
9016
|
@app.get("/{full_path:path}")
|
|
8914
|
-
async def serve_spa(full_path: str)
|
|
9017
|
+
async def serve_spa(full_path: str):
|
|
8915
9018
|
"""Serve the React SPA and static assets from dist/.
|
|
8916
9019
|
|
|
9020
|
+
AN /api/ PATH NEVER REACHES THE SPA. Before this guard, a dead API GET fell
|
|
9021
|
+
through here and returned 200 + text/html. The client (client.ts:45-47)
|
|
9022
|
+
saw a non-JSON content-type and told the user "API endpoint not available.
|
|
9023
|
+
Please restart the server with the latest version." Restarting can never
|
|
9024
|
+
fix a client-side path typo, so the one actionable-looking message the user
|
|
9025
|
+
got was a lie, and it pointed away from the real cause.
|
|
9026
|
+
|
|
9027
|
+
The comment below records that this same catch-all once swallowed 22 API
|
|
9028
|
+
routes in v7.6.0. That fix moved the route; it did not remove the hazard.
|
|
9029
|
+
This returns the hazard to a loud, honest 404.
|
|
9030
|
+
|
|
8917
9031
|
The Vite build is configured with base: '/lab/' (Phase Merge-3), so the
|
|
8918
9032
|
bundled HTML references assets at '/lab/assets/...'. Under the canonical
|
|
8919
9033
|
standalone_app (and dashboard's Merge-4 mount), Starlette's Mount strips
|
|
@@ -8922,6 +9036,12 @@ async def serve_spa(full_path: str) -> FileResponse:
|
|
|
8922
9036
|
retained as defense-in-depth for direct-`app` invocations (e.g. tests or
|
|
8923
9037
|
operators running `uvicorn server:app` instead of `server:standalone_app`).
|
|
8924
9038
|
"""
|
|
9039
|
+
if full_path.startswith("api/") or full_path == "api":
|
|
9040
|
+
return JSONResponse(
|
|
9041
|
+
status_code=404,
|
|
9042
|
+
content={"error": f"No such API endpoint: /{full_path}"},
|
|
9043
|
+
)
|
|
9044
|
+
|
|
8925
9045
|
index = DIST_DIR / "index.html"
|
|
8926
9046
|
if not index.exists():
|
|
8927
9047
|
return JSONResponse(
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{c as X,r as v,j as e,b as Y,A as z,x as U,d as K,m as Z}from"./index-BMmYYws0.js";import{G as W}from"./git-commit-horizontal-DQUBe0oD.js";import{C as J}from"./chevron-left--yqvAfjx.js";import{F as ee}from"./file-code-corner-CH_Qbtjo.js";import{P as te}from"./plus-BpYvoLlZ.js";import{M as se}from"./minus-dhrzKSK5.js";import{E as ne}from"./EvidenceReceiptPanel-CqjsjTOs.js";import{C as L}from"./clock-DKSDFsE6.js";import{D as _}from"./dollar-sign-D0A47egY.js";import{L as re}from"./layers-glXeoUbJ.js";import{T as ae}from"./trending-up-BUhVYJ2T.js";import{T as le}from"./trending-down-Cx1vhE4o.js";/**
|
|
2
|
-
* @license lucide-react v0.577.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 oe=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],B=X("trophy",oe),k={top:20,right:20,bottom:40,left:50};function T(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:t.toFixed(t%1===0?0:2)}function ie({data:t,width:r=400,height:a=240,color:l="#553DE9",live:j}){const[c,m]=v.useState(null),[i,u]=v.useState(!1),h=v.useRef(null);v.useEffect(()=>{const y=setTimeout(()=>u(!0),50);return()=>clearTimeout(y)},[]),v.useEffect(()=>{const y=h.current;if(!y)return;const g=y.getTotalLength();y.style.strokeDasharray=`${g}`,y.style.strokeDashoffset=i?"0":`${g}`},[i,t]);const p=r-k.left-k.right,f=a-k.top-k.bottom,{pathD:n,gradientPath:d,points:x,minVal:s,maxVal:o}=v.useMemo(()=>{if(t.length<2)return{pathD:"",gradientPath:"",points:[],minVal:0,maxVal:0};const y=t.map(C=>C.value),g=Math.min(...y),N=Math.max(...y),M=N-g||1,E=p/(t.length-1),A=t.map((C,S)=>({x:k.left+S*E,y:k.top+f-(C.value-g)/M*f}));let w=`M ${A[0].x},${A[0].y}`;for(let C=1;C<A.length;C++){const S=A[C-1],D=A[C],G=S.x+(D.x-S.x)*.4,Q=D.x-(D.x-S.x)*.4;w+=` C ${G},${S.y} ${Q},${D.y} ${D.x},${D.y}`}const $=w+` L ${A[A.length-1].x},${k.top+f} L ${A[0].x},${k.top+f} Z`;return{pathD:w,gradientPath:$,points:A,minVal:g,maxVal:N}},[t,p,f]);if(t.length<2)return e.jsx("svg",{width:r,height:a,children:e.jsx("text",{x:r/2,y:a/2,textAnchor:"middle",className:"fill-[#939084] text-sm",children:"Not enough data"})});const b=`line-grad-${l.replace("#","")}`;return e.jsxs("svg",{width:r,height:a,viewBox:`0 0 ${r} ${a}`,className:"select-none",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:b,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:l,stopOpacity:.25}),e.jsx("stop",{offset:"100%",stopColor:l,stopOpacity:.02})]})}),e.jsx("text",{x:k.left-8,y:k.top+4,textAnchor:"end",className:"fill-[#939084]",style:{fontSize:10},children:T(o)}),e.jsx("text",{x:k.left-8,y:k.top+f+4,textAnchor:"end",className:"fill-[#939084]",style:{fontSize:10},children:T(s)}),e.jsx("line",{x1:k.left,y1:k.top,x2:k.left+p,y2:k.top,stroke:"#ECEAE3",strokeWidth:.5,className:"dark:stroke-[#2A2A30]"}),e.jsx("line",{x1:k.left,y1:k.top+f,x2:k.left+p,y2:k.top+f,stroke:"#ECEAE3",strokeWidth:.5,className:"dark:stroke-[#2A2A30]"}),e.jsx("line",{x1:k.left,y1:k.top+f/2,x2:k.left+p,y2:k.top+f/2,stroke:"#ECEAE3",strokeWidth:.5,strokeDasharray:"4 4",className:"dark:stroke-[#2A2A30]"}),e.jsx("path",{d,fill:`url(#${b})`,style:{transition:"d 0.4s ease"}}),e.jsx("path",{ref:h,d:n,fill:"none",stroke:l,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",style:{transition:"stroke-dashoffset 1.2s ease-out, d 0.4s ease"}}),t.map((y,g)=>{const N=p/(t.length-1),M=k.left+g*N;return t.length<=6||g%Math.ceil(t.length/6)===0||g===t.length-1?e.jsx("text",{x:M,y:a-8,textAnchor:"middle",className:"fill-[#939084]",style:{fontSize:10},children:y.label},g):null}),x.map((y,g)=>e.jsxs("g",{children:[e.jsx("rect",{x:y.x-p/t.length/2,y:k.top,width:p/t.length,height:f,fill:"transparent",onMouseEnter:()=>m(g),onMouseLeave:()=>m(null),style:{cursor:"pointer"}}),e.jsx("circle",{cx:y.x,cy:y.y,r:c===g?5:3,fill:"white",stroke:l,strokeWidth:2,style:{opacity:c===g?1:0,transition:"opacity 0.15s, r 0.15s"}})]},g)),c!==null&&e.jsxs("g",{children:[e.jsx("line",{x1:x[c].x,y1:k.top,x2:x[c].x,y2:k.top+f,stroke:l,strokeWidth:.5,strokeDasharray:"3 3",opacity:.4}),e.jsx("rect",{x:x[c].x-30,y:x[c].y-28,width:60,height:20,rx:4,fill:"#36342E",className:"dark:fill-[#E8E6E3]"}),e.jsx("text",{x:x[c].x,y:x[c].y-14,textAnchor:"middle",fill:"white",className:"dark:fill-[#1A1A1E]",style:{fontSize:11,fontWeight:600},children:T(t[c].value)})]})]})}function H(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:t.toString()}function ce({segments:t,size:r=200,thickness:a=32,live:l}){var d;const[j,c]=v.useState(null),[m,i]=v.useState(0);v.useEffect(()=>{const x=setTimeout(()=>i(1),50);return()=>clearTimeout(x)},[]);const u=v.useMemo(()=>t.reduce((x,s)=>x+s.value,0),[t]),h=r/2,p=(r-a)/2-4,f=v.useMemo(()=>{if(u===0)return[];let x=-90;return t.map(s=>{const o=s.value/u*360,b=x;x+=o;const y=x,g=b*Math.PI/180,N=y*Math.PI/180,M=h+p*Math.cos(g),E=h+p*Math.sin(g),A=h+p*Math.cos(N),w=h+p*Math.sin(N),$=o>180?1:0,C=`M ${M} ${E} A ${p} ${p} 0 ${$} 1 ${A} ${w}`,S=(s.value/u*100).toFixed(1);return{d:C,percentage:S,startAngle:b,endAngle:y}})},[t,u,h,p]),n=2*Math.PI*p;return e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsxs("svg",{width:r,height:r,viewBox:`0 0 ${r} ${r}`,className:"select-none",children:[e.jsx("circle",{cx:h,cy:h,r:p,fill:"none",stroke:"#ECEAE3",strokeWidth:a,className:"dark:stroke-[#2A2A30]"}),f.map((x,s)=>{const o=t[s],y=o.value/u*360/360*n,g=n-y*m;let N=-90;for(let M=0;M<s;M++)N+=t[M].value/u*360;return e.jsx("circle",{cx:h,cy:h,r:p,fill:"none",stroke:o.color,strokeWidth:j===s?a+6:a,strokeDasharray:`${y} ${n-y}`,strokeDashoffset:g,strokeLinecap:"butt",transform:`rotate(${N} ${h} ${h})`,style:{transition:"stroke-dashoffset 0.8s ease-out, stroke-width 0.15s ease",cursor:"pointer",opacity:j!==null&&j!==s?.5:1},onMouseEnter:()=>c(s),onMouseLeave:()=>c(null)},s)}),e.jsx("text",{x:h,y:h-6,textAnchor:"middle",className:"fill-[#36342E] dark:fill-[#E8E6E3]",style:{fontSize:22,fontWeight:700},children:H(u)}),e.jsx("text",{x:h,y:h+14,textAnchor:"middle",className:"fill-[#939084]",style:{fontSize:11},children:j!==null?`${t[j].label} (${(d=f[j])==null?void 0:d.percentage}%)`:"Total"})]}),e.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-1 justify-center",children:t.map((x,s)=>e.jsxs("div",{className:"flex items-center gap-1.5 text-xs cursor-pointer",onMouseEnter:()=>c(s),onMouseLeave:()=>c(null),style:{opacity:j!==null&&j!==s?.5:1},children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{backgroundColor:x.color}}),e.jsx("span",{className:"text-[#6B6960] dark:text-[#8A8880]",children:x.label}),e.jsx("span",{className:"text-[#36342E] dark:text-[#C5C0B8] font-medium",children:H(x.value)})]},s))})]})}const I={top:16,right:16,bottom:36,left:44};function R(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:t.toFixed(t%1===0?0:1)}function de({data:t,width:r=400,height:a=240,color:l="#553DE9",live:j}){const[c,m]=v.useState(null),[i,u]=v.useState(0);v.useEffect(()=>{const s=setTimeout(()=>u(1),50);return()=>clearTimeout(s)},[]);const h=r-I.left-I.right,p=a-I.top-I.bottom,{maxVal:f,barWidth:n,gap:d}=v.useMemo(()=>{const s=Math.max(...t.map(g=>g.value),1),o=t.length,b=Math.max(4,Math.min(12,h/o*.2)),y=(h-b*(o+1))/o;return{maxVal:s,barWidth:Math.max(y,4),gap:b}},[t,h]),x=[0,.5,1].map(s=>({y:I.top+p*(1-s),label:R(f*s)}));return e.jsxs("svg",{width:r,height:a,viewBox:`0 0 ${r} ${a}`,className:"select-none",children:[x.map((s,o)=>e.jsxs("g",{children:[e.jsx("line",{x1:I.left,y1:s.y,x2:I.left+h,y2:s.y,stroke:"#ECEAE3",strokeWidth:.5,strokeDasharray:o===0?"none":"4 4",className:"dark:stroke-[#2A2A30]"}),e.jsx("text",{x:I.left-6,y:s.y+3,textAnchor:"end",className:"fill-[#939084]",style:{fontSize:10},children:s.label})]},o)),t.map((s,o)=>{const b=s.value/f*p*i,y=I.left+d+o*(n+d),g=I.top+p-b,N=s.color||l,M=c===o;return e.jsxs("g",{children:[e.jsx("rect",{x:y,y:g,width:n,height:b,rx:3,fill:N,opacity:c!==null&&!M?.4:.85,style:{transition:"y 0.6s ease-out, height 0.6s ease-out, opacity 0.15s",cursor:"pointer"},onMouseEnter:()=>m(o),onMouseLeave:()=>m(null)}),M&&e.jsx("rect",{x:y,y:g,width:n,height:b,rx:3,fill:N,opacity:1}),e.jsx("text",{x:y+n/2,y:a-8,textAnchor:"middle",className:"fill-[#939084]",style:{fontSize:t.length>10?8:10},children:s.label}),M&&e.jsxs("g",{children:[e.jsx("rect",{x:y+n/2-24,y:g-24,width:48,height:18,rx:4,fill:"#36342E",className:"dark:fill-[#E8E6E3]"}),e.jsx("text",{x:y+n/2,y:g-11,textAnchor:"middle",fill:"white",className:"dark:fill-[#1A1A1E]",style:{fontSize:11,fontWeight:600},children:R(s.value)})]})]},o)})]})}function xe({value:t,label:r="Score",thresholds:a={warning:60,danger:30},size:l=180,live:j}){const[c,m]=v.useState(0);v.useEffect(()=>{const w=setTimeout(()=>m(Math.min(100,Math.max(0,t))),80);return()=>clearTimeout(w)},[t]);const i=l/2,u=l*.38,h=l*.09,p=180,f=0,n=180,{dangerEnd:d,warningEnd:x}=v.useMemo(()=>{const w=a.danger??30,$=a.warning??60;return{dangerEnd:w/100*n,warningEnd:$/100*n}},[a]),s=w=>{const $=w*Math.PI/180;return{x:i+u*Math.cos($),y:i-u*Math.sin($)}},o=(w,$)=>{const C=s(w),S=s($),D=w-$>180?1:0;return`M ${C.x} ${C.y} A ${u} ${u} 0 ${D} 1 ${S.x} ${S.y}`},b=p-c/100*n,y=s(b),g="#C07A5E",N="#D4A843",M="#1FC5A8",E=v.useMemo(()=>c<(a.danger??30)?g:c<(a.warning??60)?N:M,[c,a]),A=l*.6;return e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsxs("svg",{width:l,height:A,viewBox:`0 0 ${l} ${A}`,className:"select-none",children:[e.jsx("path",{d:o(p,p-d),fill:"none",stroke:g,strokeWidth:h,strokeLinecap:"round",opacity:.3}),e.jsx("path",{d:o(p-d,p-x),fill:"none",stroke:N,strokeWidth:h,strokeLinecap:"round",opacity:.3}),e.jsx("path",{d:o(p-x,f),fill:"none",stroke:M,strokeWidth:h,strokeLinecap:"round",opacity:.3}),c>0&&e.jsx("path",{d:o(p,b),fill:"none",stroke:E,strokeWidth:h,strokeLinecap:"round",style:{transition:"all 0.8s ease-out"}}),e.jsx("line",{x1:i,y1:i,x2:y.x,y2:y.y,stroke:E,strokeWidth:2.5,strokeLinecap:"round",style:{transition:"all 0.8s ease-out"}}),e.jsx("circle",{cx:i,cy:i,r:5,fill:E,style:{transition:"fill 0.3s"}}),e.jsx("circle",{cx:i,cy:i,r:2.5,fill:"white",className:"dark:fill-[#1A1A1E]"}),e.jsx("text",{x:i,y:i+u*.45,textAnchor:"middle",style:{fontSize:24,fontWeight:700,transition:"fill 0.3s"},fill:E,children:Math.round(c)}),e.jsx("text",{x:i-u-8,y:i+4,textAnchor:"middle",className:"fill-[#939084]",style:{fontSize:9},children:"0"}),e.jsx("text",{x:i+u+8,y:i+4,textAnchor:"middle",className:"fill-[#939084]",style:{fontSize:9},children:"100"})]}),e.jsx("span",{className:"text-xs text-[#6B6960] dark:text-[#8A8880] -mt-1",children:r})]})}function me({data:t,width:r=60,height:a=20,color:l="#553DE9",live:j}){const c=v.useMemo(()=>{if(t.length<2)return"";const m=Math.min(...t),u=Math.max(...t)-m||1,h=1,p=r-h*2,f=a-h*2,n=p/(t.length-1);return t.map((d,x)=>{const s=h+x*n,o=h+f-(d-m)/u*f;return`${s},${o}`}).join(" ")},[t,r,a]);return t.length<2?null:e.jsx("svg",{width:r,height:a,viewBox:`0 0 ${r} ${a}`,className:"inline-block","aria-hidden":"true",children:e.jsx("polyline",{points:c,fill:"none",stroke:l,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",style:{transition:"all 0.4s ease"}})})}function V(t,r){const a=parseInt(t.slice(1,3),16),l=parseInt(t.slice(3,5),16),j=parseInt(t.slice(5,7),16),c=.08,m=c+r*(1-c);return`rgba(${a}, ${l}, ${j}, ${m})`}function he({data:t,columns:r=7,rows:a=4,color:l="#553DE9",live:j}){const[c,m]=v.useState(null),i=28,u=3,h=r*a,p=v.useMemo(()=>Math.max(...t.map(s=>s.count),1),[t]),f=r*(i+u)-u+16,n=a*(i+u)-u+16,d=v.useMemo(()=>{const s=[];for(let o=0;o<h;o++){const b=o%r,y=Math.floor(o/r),g=t[o],N=(g==null?void 0:g.count)??0,M=(g==null?void 0:g.date)??"",E=N/p;s.push({x:8+b*(i+u),y:8+y*(i+u),count:N,date:M,intensity:E})}return s},[t,h,r,p]),x=[0,.25,.5,.75,1];return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("svg",{width:f,height:n,viewBox:`0 0 ${f} ${n}`,className:"select-none",children:d.map((s,o)=>e.jsxs("g",{children:[e.jsx("rect",{x:s.x,y:s.y,width:i,height:i,rx:4,fill:s.count===0?"#F2F0EB":V(l,s.intensity),stroke:c===o?l:"transparent",strokeWidth:c===o?1.5:0,style:{transition:"fill 0.3s ease, stroke 0.15s",cursor:"pointer"},className:s.count===0?"dark:fill-[#222228]":"",onMouseEnter:()=>m(o),onMouseLeave:()=>m(null)}),c===o&&e.jsxs("g",{children:[e.jsx("rect",{x:s.x+i/2-40,y:s.y-26,width:80,height:20,rx:4,fill:"#36342E",className:"dark:fill-[#E8E6E3]"}),e.jsx("text",{x:s.x+i/2,y:s.y-13,textAnchor:"middle",fill:"white",className:"dark:fill-[#1A1A1E]",style:{fontSize:10,fontWeight:500},children:s.date?`${s.date}: ${s.count}`:`${s.count} events`})]})]},o))}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-[#939084]",children:[e.jsx("span",{children:"Less"}),x.map((s,o)=>e.jsx("span",{className:"inline-block rounded",style:{width:12,height:12,backgroundColor:s===0?"#F2F0EB":V(l,s)}},o)),e.jsx("span",{children:"More"})]})]})}function ue({axes:t,datasets:r,size:a=260,live:l}){const[j,c]=v.useState(null),m=a/2,i=a*.34,u=a*.44,h=t.length,p=v.useMemo(()=>t.map((x,s)=>{const o=s*2*Math.PI/h-Math.PI/2;return{x:m+i*Math.cos(o),y:m+i*Math.sin(o),labelX:m+u*Math.cos(o),labelY:m+u*Math.sin(o)}}),[t,h,m,i,u]),f=[.25,.5,.75,1],n=v.useMemo(()=>f.map(x=>t.map((o,b)=>{const y=b*2*Math.PI/h-Math.PI/2,g=m+i*x*Math.cos(y),N=m+i*x*Math.sin(y);return`${g},${N}`}).join(" ")),[t,h,m,i]),d=v.useMemo(()=>r.map(x=>x.values.map((o,b)=>{const y=Math.min(Math.max(o,0),100)/100,g=b*2*Math.PI/h-Math.PI/2,N=m+i*y*Math.cos(g),M=m+i*y*Math.sin(g);return`${N},${M}`}).join(" ")),[r,h,m,i]);return e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsxs("svg",{width:a,height:a,viewBox:`0 0 ${a} ${a}`,className:"select-none",children:[n.map((x,s)=>e.jsx("polygon",{points:x,fill:"none",stroke:"#ECEAE3",strokeWidth:.5,className:"dark:stroke-[#2A2A30]"},s)),p.map((x,s)=>e.jsx("line",{x1:m,y1:m,x2:x.x,y2:x.y,stroke:"#ECEAE3",strokeWidth:.5,className:"dark:stroke-[#2A2A30]"},s)),d.map((x,s)=>{const o=r[s],b=j===s,y=j!==null&&j!==s;return e.jsx("polygon",{points:x,fill:o.color,fillOpacity:b?.35:y?.08:.2,stroke:o.color,strokeWidth:b?2.5:1.5,strokeOpacity:y?.3:1,strokeLinejoin:"round",style:{transition:"fill-opacity 0.2s, stroke-width 0.2s, stroke-opacity 0.2s",cursor:"pointer"},onMouseEnter:()=>c(s),onMouseLeave:()=>c(null)},s)}),r.map((x,s)=>{const o=j!==null&&j!==s;return x.values.map((b,y)=>{const g=Math.min(Math.max(b,0),100)/100,N=y*2*Math.PI/h-Math.PI/2,M=m+i*g*Math.cos(N),E=m+i*g*Math.sin(N);return e.jsx("circle",{cx:M,cy:E,r:3,fill:x.color,opacity:o?.3:1,style:{transition:"opacity 0.2s"}},`${s}-${y}`)})}),p.map((x,s)=>{let o="middle";return x.labelX>m+10?o="start":x.labelX<m-10&&(o="end"),e.jsx("text",{x:x.labelX,y:x.labelY+(x.labelY>m?8:-2),textAnchor:o,className:"fill-[#6B6960] dark:fill-[#8A8880]",style:{fontSize:11,fontWeight:500},children:t[s].label},s)})]}),e.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-1 justify-center",children:r.map((x,s)=>e.jsxs("div",{className:"flex items-center gap-1.5 text-xs cursor-pointer",onMouseEnter:()=>c(s),onMouseLeave:()=>c(null),style:{opacity:j!==null&&j!==s?.5:1},children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{backgroundColor:x.color}}),e.jsx("span",{className:"text-[#6B6960] dark:text-[#8A8880]",children:x.label})]},s))})]})}function pe({phases:t,width:r=500,height:a=64,live:l}){const[j,c]=v.useState(null),m=v.useMemo(()=>t.reduce((n,d)=>n+d.duration,0),[t]),i=24,u=24,h=12,p=r-h*2,f=v.useMemo(()=>{if(m===0)return[];let n=h;return t.map((d,x)=>{const s=d.duration/m*p,o=n;return n+=s,{...d,x:o,width:s,index:x}})},[t,m,p,h]);return e.jsxs("svg",{width:r,height:a,viewBox:`0 0 ${r} ${a}`,className:"select-none",children:[e.jsx("rect",{x:h,y:i,width:p,height:u,rx:6,fill:"#F2F0EB",className:"dark:fill-[#222228]"}),f.map((n,d)=>{const x=d===0,s=d===f.length-1,o=j===d;return e.jsxs("g",{children:[e.jsx("rect",{x:n.x,y:i,width:n.width,height:u,rx:x||s?6:0,fill:n.color,opacity:n.status==="pending"?.25:o?1:.75,style:{transition:"opacity 0.15s",cursor:"pointer"},className:n.status==="active"?"phase-active":"",onMouseEnter:()=>c(d),onMouseLeave:()=>c(null)}),n.status==="completed"&&n.width>18&&e.jsx("text",{x:n.x+n.width/2,y:i+u/2+4,textAnchor:"middle",fill:"white",style:{fontSize:12,fontWeight:700},children:"✓"}),n.status==="active"&&n.width>10&&e.jsx("circle",{cx:n.x+n.width/2,cy:i+u/2,r:4,fill:"white",opacity:.9}),n.width>30&&e.jsxs("text",{x:n.x+n.width/2,y:i-6,textAnchor:"middle",className:"fill-[#939084]",style:{fontSize:9},children:[n.duration,"s"]}),n.width>40&&e.jsx("text",{x:n.x+n.width/2,y:i+u+14,textAnchor:"middle",className:"fill-[#6B6960] dark:fill-[#8A8880]",style:{fontSize:10,fontWeight:500},children:n.name}),o&&e.jsxs("g",{children:[e.jsx("rect",{x:n.x+n.width/2-44,y:i-28,width:88,height:20,rx:4,fill:"#36342E",className:"dark:fill-[#E8E6E3]"}),e.jsxs("text",{x:n.x+n.width/2,y:i-14,textAnchor:"middle",fill:"white",className:"dark:fill-[#1A1A1E]",style:{fontSize:10,fontWeight:500},children:[n.name," (",n.duration,"s)"]})]})]},d)})]})}function O({additions:t,deletions:r}){const a=t+r;if(a===0)return null;const l=a>0?t/a*100:0;return e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-0.5",children:[t>0&&e.jsxs("span",{className:"text-[11px] font-mono text-success flex items-center gap-0.5",children:[e.jsx(te,{size:10}),t]}),r>0&&e.jsxs("span",{className:"text-[11px] font-mono text-danger flex items-center gap-0.5",children:[e.jsx(se,{size:10}),r]})]}),e.jsxs("div",{className:"w-16 h-1.5 bg-border rounded-full overflow-hidden flex",children:[e.jsx("div",{className:"h-full bg-success",style:{width:`${l}%`}}),e.jsx("div",{className:"h-full bg-danger",style:{width:`${100-l}%`}})]})]})}function fe({change:t,isSelected:r,onClick:a}){t.files[0];const l=t.files.reduce((c,m)=>c+m.additions,0),j=t.files.reduce((c,m)=>c+m.deletions,0);return e.jsxs("button",{onClick:a,className:`flex-shrink-0 w-40 rounded-card border p-2.5 text-left transition-all cursor-pointer ${r?"border-primary bg-primary/5 shadow-sm":"border-border bg-card hover:border-primary/30 hover:bg-hover/50"}`,children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[e.jsx(W,{size:12,className:r?"text-primary":"text-muted"}),e.jsxs("span",{className:`text-xs font-semibold ${r?"text-primary":"text-ink"}`,children:["Iteration ",t.iteration]})]}),t.description&&e.jsx("p",{className:"text-[11px] text-muted leading-relaxed truncate mb-1.5",children:t.description}),e.jsx(O,{additions:l,deletions:j}),e.jsxs("div",{className:"text-[11px] text-muted mt-1",children:[t.files.length," file",t.files.length!==1?"s":""," changed"]})]})}function je({filePath:t,iterations:r,className:a=""}){var p,f;const[l,j]=v.useState(r.length>0?r.length-1:0),c=v.useMemo(()=>t?r.filter(n=>n.files.some(d=>d.path===t||d.path.endsWith(t))):r,[r,t]),m=c[l],i=l<c.length-1,u=l>0;if(c.length===0)return e.jsxs("div",{className:`card p-4 ${a}`,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(W,{size:14,className:"text-primary"}),e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider",children:"Code Evolution"})]}),e.jsxs("div",{className:"text-center py-6",children:[e.jsx("p",{className:"text-sm text-muted",children:"No iteration history available"}),e.jsx("p",{className:"text-xs text-muted/60 mt-1",children:"Changes will appear here as the AI iterates"})]})]});const h=c.filter(n=>n.files.some(d=>d.action==="modify"&&d.additions+d.deletions>20)).length;return e.jsxs("div",{className:`card overflow-hidden ${a}`,children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(W,{size:14,className:"text-primary"}),e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider",children:"Code Evolution"}),t&&e.jsx("span",{className:"text-[11px] text-muted font-mono truncate max-w-[200px]",children:t.split("/").pop()})]}),h>1&&e.jsxs("span",{className:"text-[11px] text-primary font-medium bg-primary/8 px-2 py-0.5 rounded-pill",children:[h," approaches tried"]})]}),e.jsxs("div",{className:"relative px-4 py-3 bg-hover/30",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>u&&j(l-1),disabled:!u,className:`p-1 rounded-card transition-colors flex-shrink-0 ${u?"hover:bg-hover text-ink":"text-border cursor-not-allowed"}`,children:e.jsx(J,{size:16})}),e.jsx("div",{className:"flex gap-2 overflow-x-auto terminal-scroll flex-1 pb-1",children:c.map((n,d)=>e.jsx(fe,{change:n,isSelected:d===l,onClick:()=>j(d)},n.iteration))}),e.jsx("button",{onClick:()=>i&&j(l+1),disabled:!i,className:`p-1 rounded-card transition-colors flex-shrink-0 ${i?"hover:bg-hover text-ink":"text-border cursor-not-allowed"}`,children:e.jsx(Y,{size:16})})]}),e.jsx("div",{className:"flex items-center justify-center gap-1 mt-2",children:c.map((n,d)=>e.jsx("div",{className:`h-1 rounded-full transition-all ${d===l?"w-4 bg-primary":"w-1.5 bg-border"}`},d))})]}),m&&e.jsxs("div",{className:"px-4 py-3 border-t border-border",children:[m.description&&e.jsx("p",{className:"text-xs text-secondary mb-2",children:m.description}),e.jsx("div",{className:"space-y-1.5",children:m.files.map((n,d)=>e.jsxs("div",{className:"flex items-center justify-between py-1 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(ee,{size:12,className:n.action==="add"?"text-success":n.action==="delete"?"text-danger":"text-info"}),e.jsx("span",{className:"font-mono text-secondary truncate",children:n.path}),e.jsx("span",{className:`text-[11px] font-medium uppercase ${n.action==="add"?"text-success":n.action==="delete"?"text-danger":"text-info"}`,children:n.action})]}),e.jsx(O,{additions:n.additions,deletions:n.deletions})]},`${n.path}-${d}`))}),u&&i&&e.jsxs("div",{className:"flex items-center justify-center gap-1.5 mt-3 text-[11px] text-muted",children:[e.jsxs("span",{children:["Iteration ",(p=c[l-1])==null?void 0:p.iteration]}),e.jsx(z,{size:10}),e.jsxs("span",{className:"font-semibold text-ink",children:["Iteration ",m.iteration]}),e.jsx(z,{size:10}),e.jsxs("span",{children:["Iteration ",(f=c[l+1])==null?void 0:f.iteration]})]})]})]})}function q(){return[{provider:"claude",label:"Claude (Sonnet)",progress:0,phase:"planning",iteration:0,maxIterations:8,cost:0,qualityScore:0,finished:!1,color:"bg-primary"},{provider:"codex",label:"Codex (GPT-4o)",progress:0,phase:"planning",iteration:0,maxIterations:10,cost:0,qualityScore:0,finished:!1,color:"bg-teal"},{provider:"gemini",label:"Gemini Pro",progress:0,phase:"planning",iteration:0,maxIterations:12,cost:0,qualityScore:0,finished:!1,color:"bg-info"}]}const P=["planning","building","testing","reviewing","complete"];function ye(t){return{planning:"Plan",building:"Build",testing:"Test",reviewing:"Review",complete:"Done"}[t]||t}function ge({provider:t,winner:r}){const a=r===t.provider,l=r!==null&&!a&&t.finished;return e.jsxs("div",{className:`p-3 rounded-card border transition-all ${a?"border-success bg-success/5 shadow-sm":l?"border-border bg-hover/30 opacity-60":"border-border bg-card"}`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[a&&e.jsx(B,{size:14,className:"text-success"}),e.jsx("span",{className:`text-xs font-semibold ${a?"text-success":"text-ink"}`,children:t.label})]}),e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-muted",children:[e.jsx("span",{className:"font-mono",children:ye(t.phase)}),e.jsxs("span",{className:"font-mono",children:[t.iteration,"/",t.maxIterations]})]})]}),e.jsxs("div",{className:"relative w-full h-3 bg-border rounded-full overflow-hidden mb-2",children:[e.jsx("div",{className:`h-full rounded-full transition-all duration-500 ease-out ${t.color}`,style:{width:`${t.progress}%`}}),!t.finished&&t.progress>0&&e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent animate-shimmer"})]}),e.jsxs("div",{className:"flex items-center gap-3 text-[11px]",children:[e.jsxs("span",{className:"flex items-center gap-1 text-muted",children:[e.jsx(_,{size:10}),e.jsxs("span",{className:"font-mono",children:["$",t.cost.toFixed(2)]})]}),e.jsxs("span",{className:"flex items-center gap-1 text-muted",children:[e.jsx(U,{size:10}),e.jsxs("span",{className:"font-mono",children:[t.qualityScore,"%"]})]}),t.finishTime&&e.jsxs("span",{className:"flex items-center gap-1 text-muted",children:[e.jsx(L,{size:10}),e.jsxs("span",{className:"font-mono",children:[t.finishTime,"s"]})]}),a&&e.jsxs("span",{className:"flex items-center gap-1 text-success font-medium ml-auto",children:[e.jsx(K,{size:10}),"Winner"]})]})]})}function ve({providers:t}){const r=t.filter(l=>l.finished);if(r.length<2)return null;const a=[...r].sort((l,j)=>Math.abs(l.qualityScore-j.qualityScore)>5?j.qualityScore-l.qualityScore:(l.finishTime||999)-(j.finishTime||999));return e.jsxs("div",{className:"mt-3 bg-hover/30 rounded-card p-3",children:[e.jsx("div",{className:"text-[11px] font-semibold text-muted uppercase tracking-wider mb-2",children:"Comparison"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"text-muted text-left",children:[e.jsx("th",{className:"pb-1.5 font-medium",children:"Provider"}),e.jsx("th",{className:"pb-1.5 font-medium text-right",children:"Speed"}),e.jsx("th",{className:"pb-1.5 font-medium text-right",children:"Quality"}),e.jsx("th",{className:"pb-1.5 font-medium text-right",children:"Cost"}),e.jsx("th",{className:"pb-1.5 font-medium text-right",children:"Value"})]})}),e.jsx("tbody",{children:a.map((l,j)=>{const c=l.qualityScore/Math.max(l.cost,.01);return e.jsxs("tr",{className:j===0?"text-ink font-medium":"text-secondary",children:[e.jsx("td",{className:"py-1",children:l.label}),e.jsxs("td",{className:"py-1 text-right font-mono",children:[l.finishTime||"--","s"]}),e.jsxs("td",{className:"py-1 text-right font-mono",children:[l.qualityScore,"%"]}),e.jsxs("td",{className:"py-1 text-right font-mono",children:["$",l.cost.toFixed(2)]}),e.jsx("td",{className:"py-1 text-right font-mono",children:c.toFixed(0)})]},l.provider)})})]})})]})}function be({active:t,className:r=""}){var p;const[a,l]=v.useState(q),[j,c]=v.useState(null),[m,i]=v.useState(0),u=v.useRef(null);v.useEffect(()=>{if(t)return l(q()),c(null),i(0),u.current=setInterval(()=>{i(f=>f+1),l(f=>{const n=f.map(d=>{if(d.finished)return d;const x=d.provider==="claude"?1.3:d.provider==="codex"?1.1:.9,s=(Math.random()*3+1)*x,o=Math.min(d.progress+s,100),b=Math.min(Math.floor(o/100*P.length),P.length-1),y=P[b],g=Math.min(Math.ceil(o/100*d.maxIterations),d.maxIterations),N=d.provider==="claude"?.12:d.provider==="codex"?.08:.05,M=g*N,E=d.provider==="claude"?92:d.provider==="codex"?88:85,A=Math.floor(Math.random()*6-3),w=Math.min(Math.floor(o/100*(E+A)),E+3),$=o>=100;return{...d,progress:o,phase:$?"complete":y,iteration:g,cost:Number(M.toFixed(2)),qualityScore:w,finished:$,finishTime:$&&!d.finishTime?m+1:d.finishTime}});return n.find(d=>d.finished&&!d.finishTime),n})},1e3),()=>{u.current&&clearInterval(u.current)}},[t]),v.useEffect(()=>{if(j)return;const f=a.find(n=>n.finished);f&&(c(f.provider),setTimeout(()=>{u.current&&clearInterval(u.current)},1e4))},[a,j]);const h=a.every(f=>f.finished);return e.jsxs("div",{className:`card overflow-hidden ${r}`,children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(B,{size:14,className:"text-warning"}),e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider",children:"Provider Race"}),t&&!h&&e.jsx("span",{className:"text-[11px] text-primary font-medium bg-primary/8 px-2 py-0.5 rounded-pill animate-pulse",children:"LIVE"})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted",children:[e.jsx(L,{size:12}),e.jsxs("span",{className:"font-mono",children:[m,"s"]})]})]}),e.jsx("div",{className:"px-4 py-2 bg-hover/30 border-b border-border",children:e.jsx("p",{className:"text-[11px] text-muted",children:t?"Multiple providers building simultaneously. First to finish with quality wins.":"Start a build to see providers race against each other."})}),e.jsx("div",{className:"p-4 space-y-2",children:a.map(f=>e.jsx(ge,{provider:f,winner:j},f.provider))}),h&&e.jsx("div",{className:"px-4 pb-4",children:e.jsx(ve,{providers:a})}),j&&h&&e.jsx("div",{className:"px-4 pb-3 text-center",children:e.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 bg-success/10 border border-success/20 rounded-pill",children:[e.jsx(B,{size:14,className:"text-success"}),e.jsxs("span",{className:"text-sm font-semibold text-success",children:[(p=a.find(f=>f.provider===j))==null?void 0:p.label," wins!"]})]})})]})}const Ne=[{label:"Mon",value:12.5},{label:"Tue",value:18.3},{label:"Wed",value:14.7},{label:"Thu",value:22.1},{label:"Fri",value:19.8},{label:"Sat",value:8.4},{label:"Sun",value:15.6}],ke=[{label:"Input",value:245e3,color:"#553DE9"},{label:"Output",value:128e3,color:"#1FC5A8"},{label:"Cached",value:89e3,color:"#6B8AFD"},{label:"System",value:42e3,color:"#D4A843"}],Me=[{label:"Mon",value:8},{label:"Tue",value:12},{label:"Wed",value:6},{label:"Thu",value:15},{label:"Fri",value:11},{label:"Sat",value:3},{label:"Sun",value:5}],Ee=Array.from({length:28},(t,r)=>({date:`Mar ${r+1}`,count:Math.floor(Math.random()*12)})),Ae=[{label:"Speed"},{label:"Quality"},{label:"Cost"},{label:"Reliability"},{label:"Coverage"}],we=[{label:"Claude",values:[85,92,65,88,78],color:"#553DE9"},{label:"Codex",values:[78,70,80,72,60],color:"#1FC5A8"}],$e=[{name:"Plan",duration:12,color:"#6B8AFD",status:"completed"},{name:"Build",duration:45,color:"#553DE9",status:"completed"},{name:"Test",duration:18,color:"#1FC5A8",status:"active"},{name:"Deploy",duration:8,color:"#D4A843",status:"pending"}],Ce=[{label:"Total Builds",value:142,trend:12.4,sparkline:[8,12,6,15,11,3,5,9,14,7],icon:re,color:"#553DE9"},{label:"Success Rate",value:94.2,suffix:"%",trend:2.1,sparkline:[88,91,90,93,92,95,94,96,93,94],icon:Z,color:"#1FC5A8"},{label:"Avg Build Time",value:3.2,suffix:"min",trend:-8.5,sparkline:[4.1,3.8,3.5,3.9,3.4,3.2,3.6,3.1,3.3,3.2],icon:L,color:"#6B8AFD"},{label:"Total Cost",value:84.3,prefix:"$",trend:15.2,sparkline:[12,18,14,22,19,8,15,10,16,13],icon:_,color:"#D4A843"}],Se={"#553DE9":"text-[#553DE9]","#1FC5A8":"text-[#1FC5A8]","#6B8AFD":"text-[#6B8AFD]","#D4A843":"text-[#D4A843]"};function Ie({label:t,value:r,prefix:a,suffix:l,trend:j,sparkline:c,icon:m,color:i}){const u=j>=0,h=t==="Avg Build Time"?j<0:j>0,p=u?ae:le,f=Se[i]||"text-[#553DE9]";return e.jsxs("div",{className:"card p-4 flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center",style:{backgroundColor:`${i}14`},children:e.jsx(m,{size:16,className:f})}),e.jsx("span",{className:"text-xs text-[#6B6960] dark:text-[#8A8880] font-medium",children:t})]}),e.jsx(me,{data:c,color:i})]}),e.jsxs("div",{className:"flex items-end justify-between",children:[e.jsxs("span",{className:"text-2xl font-bold text-[#36342E] dark:text-[#E8E6E3]",children:[a,typeof r=="number"&&r%1!==0?r.toFixed(1):r,l&&e.jsx("span",{className:"text-sm font-normal text-[#939084] ml-1",children:l})]}),e.jsxs("div",{className:`flex items-center gap-1 text-xs font-medium ${h?"text-[#1FC5A8]":"text-[#C07A5E]"}`,children:[e.jsx(p,{size:12}),e.jsxs("span",{children:[Math.abs(j).toFixed(1),"%"]})]})]})]})}function F({title:t,children:r}){return e.jsxs("div",{className:"card p-5",children:[e.jsx("h3",{className:"text-sm font-semibold text-[#36342E] dark:text-[#E8E6E3] mb-4",children:t}),e.jsx("div",{className:"flex items-center justify-center",children:r})]})}function _e(){const[t,r]=v.useState(380),a=v.useMemo(()=>Math.min(t-40,420),[t]);return e.jsxs("div",{className:"min-h-screen bg-[#FAF9F6] dark:bg-[#0F0F11] p-6",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h1",{className:"text-xl font-bold text-[#36342E] dark:text-[#E8E6E3]",children:"Metrics"}),e.jsx("p",{className:"text-sm text-[#6B6960] dark:text-[#8A8880] mt-1",children:"Build performance, cost tracking, and system health"})]}),e.jsx("div",{className:"mb-6 rounded-card border border-[#ECEAE3] dark:border-[#2A2A2E] bg-white dark:bg-[#18181B] p-4",children:e.jsx(ne,{})}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6",children:Ce.map(l=>e.jsx(Ie,{...l},l.label))}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 mb-6",ref:l=>{l&&new ResizeObserver(c=>{const m=c[0];if(m){const i=window.innerWidth>=1024?2:1;r(Math.floor(m.contentRect.width/i))}}).observe(l)},children:[e.jsx(F,{title:"Cost Trend (7 days)",children:e.jsx(ie,{data:Ne,width:a,height:220,color:"#553DE9"})}),e.jsx(F,{title:"Token Usage",children:e.jsx(ce,{segments:ke,size:190,thickness:28})}),e.jsx(F,{title:"Builds Per Day",children:e.jsx(de,{data:Me,width:a,height:220,color:"#6B8AFD"})}),e.jsx(F,{title:"Quality Score",children:e.jsx(xe,{value:87,label:"Overall Quality",size:200})})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4 mb-6",children:[e.jsx(F,{title:"Agent Activity (28 days)",children:e.jsx(he,{data:Ee,columns:7,rows:4,color:"#553DE9"})}),e.jsx(F,{title:"Provider Comparison",children:e.jsx(ue,{axes:Ae,datasets:we,size:240})}),e.jsx(F,{title:"Current Pipeline",children:e.jsx(pe,{phases:$e,width:Math.min(a,360),height:72})})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-base font-semibold text-[#36342E] dark:text-[#E8E6E3] mb-3",children:"Code Evolution"}),e.jsx(je,{filePath:"",iterations:[{iteration:1,description:"Initial scaffolding",files:[{path:"src/index.ts",additions:120,deletions:0,action:"add"},{path:"package.json",additions:35,deletions:0,action:"add"}]},{iteration:2,description:"Add API routes",files:[{path:"src/routes.ts",additions:85,deletions:0,action:"add"},{path:"src/index.ts",additions:12,deletions:3,action:"modify"}]},{iteration:3,description:"Fix validation and add tests",files:[{path:"src/routes.ts",additions:15,deletions:8,action:"modify"},{path:"tests/routes.test.ts",additions:64,deletions:0,action:"add"}]}]})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-base font-semibold text-[#36342E] dark:text-[#E8E6E3] mb-3",children:"Provider Comparison"}),e.jsx(be,{active:!1})]})]})}export{_e as MetricsPage,_e as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{c as M,r as o,j as e,x as C,y as S,T as D,a0 as K}from"./index-BMmYYws0.js";import{B as h}from"./Button-Dc6-P6pz.js";import{P as L}from"./plus-BpYvoLlZ.js";import{C as g}from"./check-BC9x7oPm.js";import{C as U}from"./copy-BKW4U4Qr.js";import{R as q}from"./refresh-cw-F6koqEgF.js";import{E as B,R as _}from"./rotate-ccw-CQ2W5S8f.js";import{C as $}from"./clock-DKSDFsE6.js";import{T as G}from"./trash-2-CCwouZJJ.js";import{S as W}from"./server-Bj8EX4Z1.js";import{H as Y}from"./hammer-BhJC5DMK.js";import{B as V}from"./bell-BqkTmgL7.js";import{D as H}from"./database-D7ceedlh.js";import{S as Q}from"./shield-alert-CiYuulCU.js";import{S as f}from"./save-DMCYGm06.js";/**
|
|
2
|
-
* @license lucide-react v0.577.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 J=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],I=M("key",J),X=[{id:"key-1",name:"Production CI/CD",prefix:"pk_l",createdAt:new Date(Date.now()-45*864e5).toISOString(),lastUsed:new Date(Date.now()-36e5).toISOString(),scopes:["read","write","deploy"]},{id:"key-2",name:"Staging Environment",prefix:"pk_s",createdAt:new Date(Date.now()-120*864e5).toISOString(),lastUsed:new Date(Date.now()-864e5).toISOString(),scopes:["read","write"]},{id:"key-3",name:"Monitoring Dashboard",prefix:"pk_m",createdAt:new Date(Date.now()-10*864e5).toISOString(),lastUsed:null,scopes:["read"]}],v={read:{label:"Read",description:"View projects, status, and logs",color:"#1FC5A8"},write:{label:"Write",description:"Create and modify projects",color:"#553DE9"},admin:{label:"Admin",description:"Manage users and settings",color:"#F59E0B"},deploy:{label:"Deploy",description:"Trigger deployments",color:"#C45B5B"}};function F(s){return Math.floor((Date.now()-new Date(s).getTime())/864e5)}function w(s){if(!s)return"Never";const l=F(s);return l===0?"Today":l===1?"Yesterday":l<30?`${l}d ago`:l<365?`${Math.floor(l/30)}mo ago`:`${Math.floor(l/365)}y ago`}function Z({onSubmit:s,onCancel:l}){const[r,c]=o.useState(""),[n,x]=o.useState(new Set(["read"])),t=a=>{x(d=>{const m=new Set(d);return m.has(a)?m.delete(a):m.add(a),m})};return e.jsxs("div",{className:"border border-[#553DE9]/20 bg-[#553DE9]/5 dark:bg-[#553DE9]/10 rounded-lg p-4 space-y-4",children:[e.jsx("h4",{className:"text-sm font-semibold text-[#201515] dark:text-[#E8E6E3]",children:"Create New API Key"}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Key Name"}),e.jsx("input",{value:r,onChange:a=>c(a.target.value),placeholder:"e.g. Production CI/CD",className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3] placeholder-[#939084]",autoFocus:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-2",children:"Scopes"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:Object.entries(v).map(([a,d])=>e.jsxs("button",{type:"button",onClick:()=>t(a),className:`flex items-center gap-2 px-3 py-2 rounded-lg border text-sm text-left transition-colors ${n.has(a)?"border-[#553DE9] bg-[#553DE9]/5 dark:bg-[#553DE9]/10":"border-[#ECEAE3] dark:border-[#2A2A30] hover:bg-[#F8F4F0] dark:hover:bg-[#222228]"}`,children:[e.jsx("input",{type:"checkbox",checked:n.has(a),readOnly:!0,className:"rounded border-[#ECEAE3] text-[#553DE9] focus:ring-[#553DE9]"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-[#201515] dark:text-[#E8E6E3]",children:d.label}),e.jsx("div",{className:"text-xs text-[#939084]",children:d.description})]})]},a))})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h,{size:"sm",icon:I,onClick:()=>s(r,Array.from(n)),disabled:!r.trim()||n.size===0,children:"Generate Key"}),e.jsx(h,{size:"sm",variant:"ghost",onClick:l,children:"Cancel"})]})]})}function ee({keyName:s,onConfirm:l,onCancel:r}){return e.jsx("div",{className:"border border-[#C45B5B]/30 bg-[#C45B5B]/5 rounded-lg p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(D,{size:18,className:"text-[#C45B5B] flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("p",{className:"text-sm font-medium text-[#201515] dark:text-[#E8E6E3]",children:['Revoke "',s,'"?']}),e.jsx("p",{className:"text-xs text-[#939084] mt-1",children:"This action cannot be undone. Any applications using this key will immediately lose access."}),e.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[e.jsx(h,{size:"sm",variant:"danger",icon:G,onClick:l,children:"Revoke Key"}),e.jsx(h,{size:"sm",variant:"ghost",onClick:r,children:"Cancel"})]})]})]})})}function te({keys:s,onCreateKey:l,onRevokeKey:r,className:c=""}){const[n,x]=o.useState(s||X),[t,a]=o.useState(!1),[d,m]=o.useState(null),[p,j]=o.useState(!1),[T,N]=o.useState(null),[A,R]=o.useState({}),O=o.useCallback(async(i,u)=>{let E;if(l)E=await l(i,u);else{const y="abcdefghijklmnopqrstuvwxyz0123456789";E=`pk_live_${Array.from({length:32},()=>y[Math.floor(Math.random()*y.length)]).join("")}`}const b={id:`key-${Date.now()}`,name:i,prefix:E.slice(0,4),createdAt:new Date().toISOString(),lastUsed:null,scopes:u};x(y=>[b,...y]),m(E),a(!1)},[l]),z=o.useCallback(async i=>{r&&await r(i),x(u=>u.filter(E=>E.id!==i)),N(null)},[r]),P=o.useCallback(async i=>{try{await navigator.clipboard.writeText(i),j(!0),setTimeout(()=>j(!1),2e3)}catch{const u=document.createElement("textarea");u.value=i,document.body.appendChild(u),u.select(),document.execCommand("copy"),document.body.removeChild(u),j(!0),setTimeout(()=>j(!1),2e3)}},[]);return e.jsxs("div",{className:`space-y-4 ${c}`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(I,{size:18,className:"text-[#553DE9]"}),e.jsx("h3",{className:"text-sm font-semibold text-[#201515] dark:text-[#E8E6E3] uppercase tracking-wider",children:"API Keys"})]}),!t&&!d&&e.jsx(h,{size:"sm",variant:"secondary",icon:L,onClick:()=>a(!0),children:"New Key"})]}),d&&e.jsx("div",{className:"border border-[#1FC5A8]/30 bg-[#1FC5A8]/5 rounded-lg p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(g,{size:18,className:"text-[#1FC5A8] flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-[#201515] dark:text-[#E8E6E3]",children:"API Key Created"}),e.jsx("p",{className:"text-xs text-[#939084] mt-1",children:"Copy this key now. You will not be able to see it again."}),e.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[e.jsx("code",{className:"flex-1 px-3 py-2 text-sm font-mono bg-[#36342E] text-[#1FC5A8] rounded-lg truncate",children:d}),e.jsx(h,{size:"sm",variant:"secondary",icon:p?g:U,onClick:()=>P(d),children:p?"Copied":"Copy"})]}),e.jsx("button",{onClick:()=>m(null),className:"text-xs text-[#553DE9] hover:underline mt-2",children:"I have saved this key"})]})]})}),t&&e.jsx(Z,{onSubmit:O,onCancel:()=>a(!1)}),e.jsx("div",{className:"border border-[#ECEAE3] dark:border-[#2A2A30] rounded-lg overflow-hidden",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#F8F4F0] dark:bg-[#222228]",children:[e.jsx("th",{className:"text-left px-4 py-2.5 text-xs font-medium text-[#6B6960]",children:"Name"}),e.jsx("th",{className:"text-left px-4 py-2.5 text-xs font-medium text-[#6B6960]",children:"Key"}),e.jsx("th",{className:"text-left px-4 py-2.5 text-xs font-medium text-[#6B6960]",children:"Scopes"}),e.jsx("th",{className:"text-left px-4 py-2.5 text-xs font-medium text-[#6B6960]",children:"Created"}),e.jsx("th",{className:"text-left px-4 py-2.5 text-xs font-medium text-[#6B6960]",children:"Last Used"}),e.jsx("th",{className:"text-right px-4 py-2.5 text-xs font-medium text-[#6B6960]",children:"Actions"})]})}),e.jsxs("tbody",{children:[n.map(i=>{const u=F(i.createdAt),E=u>=90;return e.jsxs("tr",{className:"border-t border-[#ECEAE3] dark:border-[#2A2A30] hover:bg-[#F8F4F0] dark:hover:bg-[#222228] transition-colors",children:[e.jsx("td",{className:"px-4 py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(C,{size:14,className:"text-[#553DE9] flex-shrink-0"}),e.jsx("span",{className:"text-[#201515] dark:text-[#E8E6E3] font-medium",children:i.name}),E&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] bg-[#F59E0B]/10 text-[#F59E0B]",title:"This key is over 90 days old. Consider rotating it.",children:[e.jsx(q,{size:10}),u,"d old"]})]})}),e.jsx("td",{className:"px-4 py-3",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs font-mono text-[#939084]",children:A[i.id]?`${i.prefix}****...`:`${i.prefix}****...`}),e.jsx("button",{onClick:()=>R(b=>({...b,[i.id]:!b[i.id]})),className:"text-[#939084] hover:text-[#36342E] dark:hover:text-[#E8E6E3]",title:A[i.id]?"Hide":"Show",children:A[i.id]?e.jsx(B,{size:12}):e.jsx(S,{size:12})})]})}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("div",{className:"flex flex-wrap gap-1",children:i.scopes.map(b=>e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium",style:{backgroundColor:`${v[b].color}15`,color:v[b].color},children:v[b].label},b))})}),e.jsx("td",{className:"px-4 py-3",children:e.jsxs("div",{className:"flex items-center gap-1 text-xs text-[#939084]",children:[e.jsx($,{size:12}),w(i.createdAt)]})}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:"text-xs text-[#939084]",children:w(i.lastUsed)})}),e.jsx("td",{className:"px-4 py-3 text-right",children:T===i.id?e.jsx(ee,{keyName:i.name,onConfirm:()=>z(i.id),onCancel:()=>N(null)}):e.jsx("button",{onClick:()=>N(i.id),className:"text-xs text-[#C45B5B] hover:underline",children:"Revoke"})})]},i.id)}),n.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"px-4 py-8 text-center text-sm text-[#939084]",children:"No API keys yet. Create one to get started."})})]})]})})]})}const se=[{id:"claude",name:"Claude",apiKeySet:!0,model:"claude-opus-4-7",fallbackOrder:1,enabled:!0},{id:"codex",name:"Codex",apiKeySet:!1,model:"gpt-5.3-codex",fallbackOrder:2,enabled:!0},{id:"gemini",name:"Gemini",apiKeySet:!1,model:"gemini-3-pro-medium",fallbackOrder:3,enabled:!1}],ae={maxIterations:25,timeoutMinutes:60,qualityGateThreshold:80,autoReview:!0,parallelAgents:3},re={sessionTimeoutMinutes:30,allowedOrigins:"*",rateLimitPerMinute:100,requireMFA:!1,ipAllowlist:""},ne={emailEnabled:!1,emailAddress:"",browserEnabled:!0,slackEnabled:!1,slackWebhookUrl:"",notifyOnBuildComplete:!0,notifyOnBuildFailure:!0,notifyOnBudgetAlert:!0,notifyOnSecurityEvent:!0},le={logRetentionDays:30,auditRetentionDays:365,sessionRetentionDays:90,autoCleanupEnabled:!0,lastCleanup:new Date(Date.now()-864e5).toISOString()};function ie(){const[s,l]=o.useState(se),[r,c]=o.useState({}),[n,x]=o.useState(!1),t=()=>{x(!0),setTimeout(()=>x(!1),2e3)};return e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-xs text-[#6B6960]",children:"Configure AI provider API keys, model preferences, and fallback chain."}),s.map((a,d)=>e.jsxs("div",{className:"border border-[#ECEAE3] dark:border-[#2A2A30] rounded-lg p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"w-6 h-6 rounded-full bg-[#553DE9]/10 flex items-center justify-center text-xs font-bold text-[#553DE9]",children:a.fallbackOrder}),e.jsx("span",{className:"text-sm font-medium text-[#201515] dark:text-[#E8E6E3]",children:a.name}),a.apiKeySet&&e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium bg-[#1FC5A8]/10 text-[#1FC5A8]",children:"Configured"})]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("span",{className:"text-xs text-[#939084]",children:a.enabled?"Enabled":"Disabled"}),e.jsx("input",{type:"checkbox",checked:a.enabled,onChange:m=>{const p=[...s];p[d]={...p[d],enabled:m.target.checked},l(p)},className:"rounded border-[#ECEAE3] text-[#553DE9] focus:ring-[#553DE9]"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"API Key"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:r[a.id]?"text":"password",value:a.apiKeySet?"sk-****************************":"",placeholder:"Enter API key...",className:"w-full px-3 py-2 pr-10 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3] placeholder-[#939084] font-mono",readOnly:!0}),e.jsx("button",{onClick:()=>c(m=>({...m,[a.id]:!m[a.id]})),className:"absolute right-3 top-1/2 -translate-y-1/2 text-[#939084] hover:text-[#36342E]",children:r[a.id]?e.jsx(B,{size:14}):e.jsx(S,{size:14})})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Model"}),e.jsx("input",{value:a.model,onChange:m=>{const p=[...s];p[d]={...p[d],model:m.target.value},l(p)},className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3] font-mono"})]})]})]},a.id)),e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(h,{size:"sm",icon:n?g:f,onClick:t,children:n?"Saved":"Save Provider Config"})})]})}function de(){const[s,l]=o.useState(ae),[r,c]=o.useState(!1),n=(t,a)=>{l(d=>({...d,[t]:a}))},x=()=>{c(!0),setTimeout(()=>c(!1),2e3)};return e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-xs text-[#6B6960]",children:"Default settings for new builds. Individual projects can override these."}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Max Iterations"}),e.jsx("input",{type:"number",value:s.maxIterations,onChange:t=>n("maxIterations",parseInt(t.target.value)||0),min:1,max:100,className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Timeout (minutes)"}),e.jsx("input",{type:"number",value:s.timeoutMinutes,onChange:t=>n("timeoutMinutes",parseInt(t.target.value)||0),min:5,max:480,className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Quality Gate Threshold (%)"}),e.jsx("input",{type:"number",value:s.qualityGateThreshold,onChange:t=>n("qualityGateThreshold",parseInt(t.target.value)||0),min:0,max:100,className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]"}),e.jsx("div",{className:"mt-1 h-1.5 bg-[#F8F4F0] dark:bg-[#1A1A1E] rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${s.qualityGateThreshold}%`,background:s.qualityGateThreshold>=80?"#1FC5A8":s.qualityGateThreshold>=60?"#F59E0B":"#C45B5B"}})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Parallel Agents"}),e.jsx("input",{type:"number",value:s.parallelAgents,onChange:t=>n("parallelAgents",parseInt(t.target.value)||1),min:1,max:10,className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]"})]})]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:s.autoReview,onChange:t=>n("autoReview",t.target.checked),className:"rounded border-[#ECEAE3] text-[#553DE9] focus:ring-[#553DE9]"}),e.jsx("span",{className:"text-sm text-[#201515] dark:text-[#E8E6E3]",children:"Auto-run code review after each build"})]}),e.jsx(h,{size:"sm",icon:r?g:f,onClick:x,children:r?"Saved":"Save Build Defaults"})]})}function oe(){const[s,l]=o.useState(re),[r,c]=o.useState(!1),n=(t,a)=>{l(d=>({...d,[t]:a}))},x=()=>{c(!0),setTimeout(()=>c(!1),2e3)};return e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-xs text-[#6B6960]",children:"Security settings for session management, rate limiting, and access control."}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Session Timeout (minutes)"}),e.jsx("input",{type:"number",value:s.sessionTimeoutMinutes,onChange:t=>n("sessionTimeoutMinutes",parseInt(t.target.value)||0),min:5,max:1440,className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Rate Limit (requests/minute)"}),e.jsx("input",{type:"number",value:s.rateLimitPerMinute,onChange:t=>n("rateLimitPerMinute",parseInt(t.target.value)||0),min:10,max:1e4,className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Allowed Origins"}),e.jsx("input",{type:"text",value:s.allowedOrigins,onChange:t=>n("allowedOrigins",t.target.value),placeholder:"* or comma-separated origins",className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3] placeholder-[#939084] font-mono"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"IP Allowlist"}),e.jsx("input",{type:"text",value:s.ipAllowlist,onChange:t=>n("ipAllowlist",t.target.value),placeholder:"Leave empty for no restriction",className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3] placeholder-[#939084] font-mono"})]})]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:s.requireMFA,onChange:t=>n("requireMFA",t.target.checked),className:"rounded border-[#ECEAE3] text-[#553DE9] focus:ring-[#553DE9]"}),e.jsx("span",{className:"text-sm text-[#201515] dark:text-[#E8E6E3]",children:"Require MFA for all users"}),!s.requireMFA&&e.jsxs("span",{className:"text-xs text-[#F59E0B] flex items-center gap-1",children:[e.jsx(D,{size:12}),"Not recommended for production"]})]}),e.jsx(h,{size:"sm",icon:r?g:f,onClick:x,children:r?"Saved":"Save Security Settings"})]})}function ce(){const[s,l]=o.useState(ne),[r,c]=o.useState(!1),n=(t,a)=>{l(d=>({...d,[t]:a}))},x=()=>{c(!0),setTimeout(()=>c(!1),2e3)};return e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-xs text-[#6B6960]",children:"Configure how and when you receive notifications about system events."}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h4",{className:"text-xs font-semibold text-[#6B6960] uppercase tracking-wider",children:"Channels"}),e.jsxs("div",{className:"border border-[#ECEAE3] dark:border-[#2A2A30] rounded-lg divide-y divide-[#ECEAE3] dark:divide-[#2A2A30]",children:[e.jsxs("div",{className:"p-3 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[#201515] dark:text-[#E8E6E3]",children:"Browser Notifications"}),e.jsx("p",{className:"text-xs text-[#939084]",children:"Show desktop notifications"})]}),e.jsx("input",{type:"checkbox",checked:s.browserEnabled,onChange:t=>n("browserEnabled",t.target.checked),className:"rounded border-[#ECEAE3] text-[#553DE9] focus:ring-[#553DE9]"})]}),e.jsxs("div",{className:"p-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[#201515] dark:text-[#E8E6E3]",children:"Email Notifications"}),e.jsx("p",{className:"text-xs text-[#939084]",children:"Send email for important events"})]}),e.jsx("input",{type:"checkbox",checked:s.emailEnabled,onChange:t=>n("emailEnabled",t.target.checked),className:"rounded border-[#ECEAE3] text-[#553DE9] focus:ring-[#553DE9]"})]}),s.emailEnabled&&e.jsx("input",{type:"email",value:s.emailAddress,onChange:t=>n("emailAddress",t.target.value),placeholder:"notifications@company.com",className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3] placeholder-[#939084]"})]}),e.jsxs("div",{className:"p-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[#201515] dark:text-[#E8E6E3]",children:"Slack Webhook"}),e.jsx("p",{className:"text-xs text-[#939084]",children:"Post to a Slack channel"})]}),e.jsx("input",{type:"checkbox",checked:s.slackEnabled,onChange:t=>n("slackEnabled",t.target.checked),className:"rounded border-[#ECEAE3] text-[#553DE9] focus:ring-[#553DE9]"})]}),s.slackEnabled&&e.jsx("input",{type:"url",value:s.slackWebhookUrl,onChange:t=>n("slackWebhookUrl",t.target.value),placeholder:"https://hooks.slack.com/services/...",className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3] placeholder-[#939084] font-mono"})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h4",{className:"text-xs font-semibold text-[#6B6960] uppercase tracking-wider",children:"Events"}),e.jsx("div",{className:"border border-[#ECEAE3] dark:border-[#2A2A30] rounded-lg divide-y divide-[#ECEAE3] dark:divide-[#2A2A30]",children:[{key:"notifyOnBuildComplete",label:"Build Complete",desc:"When a build finishes successfully"},{key:"notifyOnBuildFailure",label:"Build Failure",desc:"When a build fails or times out"},{key:"notifyOnBudgetAlert",label:"Budget Alert",desc:"When spending approaches the limit"},{key:"notifyOnSecurityEvent",label:"Security Event",desc:"Login from new device, key rotation, etc."}].map(t=>e.jsxs("div",{className:"p-3 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[#201515] dark:text-[#E8E6E3]",children:t.label}),e.jsx("p",{className:"text-xs text-[#939084]",children:t.desc})]}),e.jsx("input",{type:"checkbox",checked:s[t.key],onChange:a=>n(t.key,a.target.checked),className:"rounded border-[#ECEAE3] text-[#553DE9] focus:ring-[#553DE9]"})]},t.key))})]}),e.jsx(h,{size:"sm",icon:r?g:f,onClick:x,children:r?"Saved":"Save Notifications"})]})}function xe(){const[s,l]=o.useState(le),[r,c]=o.useState(!1),n=(t,a)=>{l(d=>({...d,[t]:a}))},x=()=>{c(!0),setTimeout(()=>c(!1),2e3)};return e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-xs text-[#6B6960]",children:"Configure how long different types of data are retained before automatic cleanup."}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Log Retention (days)"}),e.jsx("input",{type:"number",value:s.logRetentionDays,onChange:t=>n("logRetentionDays",parseInt(t.target.value)||0),min:7,max:365,className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Audit Retention (days)"}),e.jsx("input",{type:"number",value:s.auditRetentionDays,onChange:t=>n("auditRetentionDays",parseInt(t.target.value)||0),min:30,max:3650,className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-[#6B6960] mb-1",children:"Session Retention (days)"}),e.jsx("input",{type:"number",value:s.sessionRetentionDays,onChange:t=>n("sessionRetentionDays",parseInt(t.target.value)||0),min:7,max:365,className:"w-full px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#1A1A1E] text-[#201515] dark:text-[#E8E6E3]"})]})]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:s.autoCleanupEnabled,onChange:t=>n("autoCleanupEnabled",t.target.checked),className:"rounded border-[#ECEAE3] text-[#553DE9] focus:ring-[#553DE9]"}),e.jsx("span",{className:"text-sm text-[#201515] dark:text-[#E8E6E3]",children:"Enable automatic cleanup"})]}),s.lastCleanup&&e.jsxs("p",{className:"text-xs text-[#939084]",children:["Last cleanup: ",new Date(s.lastCleanup).toLocaleString()]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h,{size:"sm",icon:r?g:f,onClick:x,children:r?"Saved":"Save Retention Settings"}),e.jsx(h,{size:"sm",variant:"ghost",icon:_,children:"Run Cleanup Now"})]})]})}const k=[{id:"providers",label:"Providers",icon:W},{id:"builds",label:"Build Defaults",icon:Y},{id:"security",label:"Security",icon:C},{id:"api-keys",label:"API Keys",icon:C},{id:"notifications",label:"Notifications",icon:V},{id:"retention",label:"Data Retention",icon:H}];function me(){return e.jsxs("div",{className:"max-w-[500px] mx-auto px-6 py-20 text-center",children:[e.jsx(Q,{size:48,className:"mx-auto text-[#C45B5B] mb-4"}),e.jsx("h1",{className:"font-heading text-h1 text-[#36342E] dark:text-[#E8E6E3] mb-2",children:"Access Denied"}),e.jsx("p",{className:"text-sm text-[#6B6960]",children:"You do not have permission to access system settings. Contact your organization administrator for access."})]})}function De(){var x,t;const{user:s,isLocalMode:l}=K(),[r,c]=o.useState("providers");return l||(s==null?void 0:s.authenticated)===!0?e.jsxs("div",{className:"max-w-[1000px] mx-auto px-6 py-8",children:[e.jsx("h1",{className:"font-heading text-h1 text-[#36342E] dark:text-[#E8E6E3] mb-6",children:"System Settings"}),e.jsxs("div",{className:"flex gap-6",children:[e.jsx("nav",{className:"w-48 flex-shrink-0 space-y-1",children:k.map(a=>e.jsxs("button",{onClick:()=>c(a.id),className:`w-full flex items-center gap-2 px-3 py-2 text-sm rounded-lg text-left transition-colors ${r===a.id?"bg-[#553DE9]/8 text-[#553DE9] font-medium":"text-[#6B6960] hover:bg-[#F8F4F0] dark:hover:bg-[#222228] hover:text-[#36342E] dark:hover:text-[#E8E6E3]"}`,children:[e.jsx(a.icon,{size:16}),a.label]},a.id))}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"card p-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[((x=k.find(a=>a.id===r))==null?void 0:x.icon)&&(()=>{const a=k.find(d=>d.id===r).icon;return e.jsx(a,{size:18,className:"text-[#553DE9]"})})(),e.jsx("h2",{className:"text-sm font-semibold text-[#201515] dark:text-[#E8E6E3] uppercase tracking-wider",children:(t=k.find(a=>a.id===r))==null?void 0:t.label})]}),r==="providers"&&e.jsx(ie,{}),r==="builds"&&e.jsx(de,{}),r==="security"&&e.jsx(oe,{}),r==="api-keys"&&e.jsx(te,{}),r==="notifications"&&e.jsx(ce,{}),r==="retention"&&e.jsx(xe,{})]})})]})]}):e.jsx(me,{})}export{De as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{c}from"./index-BMmYYws0.js";/**
|
|
2
|
-
* @license lucide-react v0.577.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 e=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],t=c("copy",e);export{t as C};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{c as a}from"./index-BMmYYws0.js";/**
|
|
2
|
-
* @license lucide-react v0.577.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 o=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],c=a("folder-open",o);export{c as F};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{c as o}from"./index-BMmYYws0.js";/**
|
|
2
|
-
* @license lucide-react v0.577.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 c=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],t=o("git-commit-horizontal",c);export{t as G};
|