loki-mode 9.48.1 → 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.
Files changed (83) hide show
  1. package/.github/workflows/loki-issue-to-pr.yml +1 -1
  2. package/SKILL.md +2 -2
  3. package/VERSION +1 -1
  4. package/autonomy/loki +166 -13
  5. package/autonomy/provider-offer.sh +47 -0
  6. package/autonomy/quickstart.sh +306 -9
  7. package/dashboard/__init__.py +1 -1
  8. package/dashboard/static/index.html +7 -1
  9. package/docs/INSTALLATION.md +1 -1
  10. package/docs/KNOWN-ISSUES.md +42 -0
  11. package/loki-ts/dist/loki.js +317 -317
  12. package/mcp/__init__.py +1 -1
  13. package/package.json +1 -1
  14. package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
  15. package/web-app/dist/assets/{AdminPage-PyyVXg4b.js → AdminPage-DpV2vW3y.js} +1 -1
  16. package/web-app/dist/assets/{Avatar-CTUlr_Xf.js → Avatar-BXeMYK1_.js} +1 -1
  17. package/web-app/dist/assets/{Badge-BQeXvmg8.js → Badge-D8WddQk1.js} +1 -1
  18. package/web-app/dist/assets/{Button-Dc6-P6pz.js → Button-CFzTTVeJ.js} +1 -1
  19. package/web-app/dist/assets/{CockpitPage-BspOJ3Fv.js → CockpitPage-D1eQe9QF.js} +4 -4
  20. package/web-app/dist/assets/{ComparePage-CFXIM--Z.js → ComparePage-uX3OPphr.js} +1 -1
  21. package/web-app/dist/assets/{ErrorBoundary-C7vQYDW9.js → ErrorBoundary-wE3oxaG6.js} +1 -1
  22. package/web-app/dist/assets/{EvidenceReceiptPanel-CqjsjTOs.js → EvidenceReceiptPanel-B_Wouz6N.js} +1 -1
  23. package/web-app/dist/assets/{GitHubIssuesPanel-DyuNDMgD.js → GitHubIssuesPanel-DRlEeFuw.js} +1 -1
  24. package/web-app/dist/assets/{GitHubPRsPanel-BtAq20xF.js → GitHubPRsPanel-CCv6_I74.js} +2 -2
  25. package/web-app/dist/assets/{HomePage-BuVFOrO8.js → HomePage-EG-jq8nR.js} +1 -1
  26. package/web-app/dist/assets/{LoginPage-CuhhrxGb.js → LoginPage-CEOnBICH.js} +1 -1
  27. package/web-app/dist/assets/{MagicPage-D2KZPX3F.js → MagicPage-DeWaFdsG.js} +1 -1
  28. package/web-app/dist/assets/MetricsPage-CG8CuSSJ.js +6 -0
  29. package/web-app/dist/assets/{NotFoundPage-CTnnaWlL.js → NotFoundPage-Mz5rOat6.js} +1 -1
  30. package/web-app/dist/assets/{ProjectPage-uJFaoM8-.js → ProjectPage-D2Fh6tVw.js} +8 -8
  31. package/web-app/dist/assets/{ProjectsPage-8lKAOBIW.js → ProjectsPage-B8cRWkWa.js} +2 -2
  32. package/web-app/dist/assets/{SettingsPage-D1BBd5qy.js → SettingsPage-DKpsst6x.js} +1 -1
  33. package/web-app/dist/assets/{ShowcasePage-CmQ0n8iO.js → ShowcasePage-qab065PM.js} +1 -1
  34. package/web-app/dist/assets/SystemSettingsPage-9qmEH2Y6.js +1 -0
  35. package/web-app/dist/assets/{TeamsPage-BS0TtVUa.js → TeamsPage-CW6lvW-0.js} +1 -1
  36. package/web-app/dist/assets/{TemplatesPage-C2zPnnf2.js → TemplatesPage-B-a61T6a.js} +1 -1
  37. package/web-app/dist/assets/{TerminalOutput-Dle1klqq.js → TerminalOutput-CJy13rAn.js} +1 -1
  38. package/web-app/dist/assets/{activity-DQp5U9f9.js → activity-CA4moIvC.js} +1 -1
  39. package/web-app/dist/assets/{bell-BqkTmgL7.js → bell-JyOeobLN.js} +1 -1
  40. package/web-app/dist/assets/{bot-DILhaIGH.js → bot-Cu4UwP5w.js} +1 -1
  41. package/web-app/dist/assets/{check-BC9x7oPm.js → check-Drzd8-9c.js} +1 -1
  42. package/web-app/dist/assets/{chevron-left--yqvAfjx.js → chevron-left-ClvdXm3Y.js} +1 -1
  43. package/web-app/dist/assets/{circle-alert-DOH6PcgZ.js → circle-alert-CstyZfKG.js} +1 -1
  44. package/web-app/dist/assets/{clock-DKSDFsE6.js → clock-Bnz6tlQN.js} +1 -1
  45. package/web-app/dist/assets/{cloud-DRBU3JYs.js → cloud-IPIgE4P3.js} +1 -1
  46. package/web-app/dist/assets/{code-xml-D2LqszR9.js → code-xml-BOZbQiOt.js} +1 -1
  47. package/web-app/dist/assets/{database-D7ceedlh.js → database-CHclPjog.js} +1 -1
  48. package/web-app/dist/assets/{dollar-sign-D0A47egY.js → dollar-sign-D6RFNgdZ.js} +1 -1
  49. package/web-app/dist/assets/{file-code-corner-CH_Qbtjo.js → file-code-corner-CNayCvOY.js} +1 -1
  50. package/web-app/dist/assets/{file-plus-CUNMjHk9.js → file-plus-BmVfFwsX.js} +1 -1
  51. package/web-app/dist/assets/folder-open-ChzGfLRr.js +11 -0
  52. package/web-app/dist/assets/{globe-gZnaGg8N.js → globe-DtXgCG3Z.js} +1 -1
  53. package/web-app/dist/assets/{hammer-BhJC5DMK.js → hammer-DCa0I_7V.js} +1 -1
  54. package/web-app/dist/assets/{index-BMmYYws0.js → index-Cu-njJ8o.js} +3 -3
  55. package/web-app/dist/assets/index-D98GzaW8.css +1 -0
  56. package/web-app/dist/assets/{layers-glXeoUbJ.js → layers-DxIhn7NZ.js} +1 -1
  57. package/web-app/dist/assets/{lightbulb-gXn8H0Lf.js → lightbulb-D7Pzhd06.js} +1 -1
  58. package/web-app/dist/assets/{loader-circle-Do2ke8xm.js → loader-circle-DXgc_u5I.js} +1 -1
  59. package/web-app/dist/assets/{lock-Bgplb1_n.js → lock-qRAVU53b.js} +1 -1
  60. package/web-app/dist/assets/{mail-j4Lo8hfB.js → mail-CHe3KyCw.js} +1 -1
  61. package/web-app/dist/assets/{minus-dhrzKSK5.js → minus-B8p0FoYZ.js} +1 -1
  62. package/web-app/dist/assets/{package-CInWQQ97.js → package-C5LDn8SI.js} +1 -1
  63. package/web-app/dist/assets/{plus-BpYvoLlZ.js → plus-CRd_FHOA.js} +1 -1
  64. package/web-app/dist/assets/{refresh-cw-F6koqEgF.js → refresh-cw-DKoSN8s3.js} +1 -1
  65. package/web-app/dist/assets/{rotate-ccw-CQ2W5S8f.js → rotate-ccw-Nf8zB8G0.js} +1 -1
  66. package/web-app/dist/assets/{save-DMCYGm06.js → save-B8ytQLgW.js} +1 -1
  67. package/web-app/dist/assets/{server-Bj8EX4Z1.js → server-D_VRDkaD.js} +1 -1
  68. package/web-app/dist/assets/{shield-alert-CiYuulCU.js → shield-alert-PsDkSyFD.js} +1 -1
  69. package/web-app/dist/assets/{thumbs-up-BqEh1puP.js → thumbs-up-Da1QQhqo.js} +11 -6
  70. package/web-app/dist/assets/{trash-2-CCwouZJJ.js → trash-2-ChoylpGQ.js} +1 -1
  71. package/web-app/dist/assets/{trending-down-Cx1vhE4o.js → trending-down-CX2fUeho.js} +1 -1
  72. package/web-app/dist/assets/{trending-up-BUhVYJ2T.js → trending-up-CGyYgZH7.js} +1 -1
  73. package/web-app/dist/assets/{upload-D5IsZeFM.js → upload-KkeVyg67.js} +1 -1
  74. package/web-app/dist/assets/{usePolling-CJbfhFcH.js → usePolling-C5f4xrXD.js} +1 -1
  75. package/web-app/dist/assets/{user-BRLhezsD.js → user-WCGccIST.js} +1 -1
  76. package/web-app/dist/index.html +2 -2
  77. package/web-app/server.py +121 -1
  78. package/web-app/dist/assets/MetricsPage-DFEYJl9z.js +0 -6
  79. package/web-app/dist/assets/SystemSettingsPage-CSHaVyuD.js +0 -6
  80. package/web-app/dist/assets/copy-BKW4U4Qr.js +0 -6
  81. package/web-app/dist/assets/folder-open-CQ_SVq94.js +0 -6
  82. package/web-app/dist/assets/git-commit-horizontal-DQUBe0oD.js +0 -6
  83. package/web-app/dist/assets/index-84JUN_aA.css +0 -1
package/mcp/__init__.py CHANGED
@@ -75,4 +75,4 @@ try:
75
75
  except ImportError:
76
76
  __all__ = ['mcp']
77
77
 
78
- __version__ = '9.48.1'
78
+ __version__ = '9.49.2'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "loki-mode",
3
3
  "mcpName": "io.github.asklokesh/loki-mode",
4
- "version": "9.48.1",
4
+ "version": "9.49.2",
5
5
  "description": "Loki Mode by Autonomi. Autonomous spec-to-product system: takes a PRD, GitHub issue, OpenAPI/JSON/YAML, or one-line brief to a deployed app via the RARV-C closure loop with 8 quality gates. Provider-agnostic (Claude Code, OpenAI Codex, Cline, Aider, opencode).",
6
6
  "keywords": [
7
7
  "agent",
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",
3
3
  "name": "loki-mode",
4
4
  "displayName": "Loki Mode",
5
- "version": "9.48.1",
5
+ "version": "9.49.2",
6
6
  "description": "Autonomous spec-to-product build system with a built-in trust layer (RARV-C closure loop, 8 quality gates, completion council). Ships Loki's spec-hardening, drift-detection, and deterministic PR verification commands plus the Loki MCP server.",
7
7
  "author": {
8
8
  "name": "Autonomi",
@@ -1,4 +1,4 @@
1
- import{c as L,j as e,r as m,w as _,Z as X,n as Q,i as ee,b as R,F as ge,U as z,X as te,L as se,x as je,M as fe,T as G,S as be,m as ae,l as ne,y as ve,E as Ee,a0 as Ne,a2 as re}from"./index-BMmYYws0.js";import{B as w}from"./Button-Dc6-P6pz.js";import{T as ye}from"./trending-up-BUhVYJ2T.js";import{C as I}from"./clock-DKSDFsE6.js";import{A as ke,U as ie}from"./Avatar-CTUlr_Xf.js";import{A as H}from"./activity-DQp5U9f9.js";import{R as le}from"./refresh-cw-F6koqEgF.js";import{G as Ae}from"./globe-gZnaGg8N.js";import{C as we}from"./chevron-left--yqvAfjx.js";import{M as Ce}from"./mail-j4Lo8hfB.js";import{C as ce}from"./check-BC9x7oPm.js";import{D as W}from"./dollar-sign-D0A47egY.js";import{U as Se}from"./user-BRLhezsD.js";import{D as De}from"./database-D7ceedlh.js";import{L as Fe}from"./lock-Bgplb1_n.js";import{H as Me}from"./hammer-BhJC5DMK.js";import{S as Be}from"./shield-alert-CiYuulCU.js";import{S as $e}from"./server-Bj8EX4Z1.js";/**
1
+ import{c as L,j as e,r as m,w as _,Z as X,n as Q,i as ee,b as R,F as ge,U as z,X as te,L as se,x as je,M as fe,T as G,S as be,m as ae,l as ne,y as ve,E as Ee,a0 as Ne,a2 as re}from"./index-Cu-njJ8o.js";import{B as w}from"./Button-CFzTTVeJ.js";import{T as ye}from"./trending-up-CGyYgZH7.js";import{C as I}from"./clock-Bnz6tlQN.js";import{A as ke,U as ie}from"./Avatar-BXeMYK1_.js";import{A as H}from"./activity-CA4moIvC.js";import{R as le}from"./refresh-cw-DKoSN8s3.js";import{G as Ae}from"./globe-DtXgCG3Z.js";import{C as we}from"./chevron-left-ClvdXm3Y.js";import{M as Ce}from"./mail-CHe3KyCw.js";import{C as ce}from"./check-Drzd8-9c.js";import{D as W}from"./dollar-sign-D6RFNgdZ.js";import{U as Se}from"./user-WCGccIST.js";import{D as De}from"./database-CHclPjog.js";import{L as Fe}from"./lock-qRAVU53b.js";import{H as Me}from"./hammer-DCa0I_7V.js";import{S as Be}from"./shield-alert-PsDkSyFD.js";import{S as $e}from"./server-D_VRDkaD.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as h,j as s}from"./index-BMmYYws0.js";/**
1
+ import{c as h,j as s}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.
@@ -1 +1 @@
1
- import{j as e}from"./index-BMmYYws0.js";import{C as r}from"./clock-DKSDFsE6.js";import{C as a}from"./circle-alert-DOH6PcgZ.js";import{C as l}from"./check-BC9x7oPm.js";const i={completed:"bg-[#1FC5A8]/10 text-[#1FC5A8]",running:"bg-[#553DE9]/10 text-[#553DE9]",failed:"bg-[#C45B5B]/10 text-[#C45B5B]",started:"bg-[#D4A03C]/10 text-[#D4A03C]",empty:"bg-[#F8F4F0] text-[#6B6960]",version:"bg-[#553DE9]/10 text-[#553DE9]"};function o({status:t}){switch(t){case"completed":return e.jsx(l,{size:12});case"running":return e.jsxs("span",{className:"relative flex h-2 w-2",children:[e.jsx("span",{className:"animate-ping motion-reduce:animate-none absolute inline-flex h-full w-full rounded-full bg-current opacity-75"}),e.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-current"})]});case"failed":return e.jsx(a,{size:12});case"started":return e.jsx(r,{size:12});default:return null}}function f({status:t,children:n,className:s=""}){return e.jsxs("span",{className:["inline-flex items-center gap-1 rounded-btn px-2.5 py-0.5 text-xs font-semibold",i[t],s].filter(Boolean).join(" "),children:[e.jsx(o,{status:t}),n]})}export{f as B};
1
+ import{j as e}from"./index-Cu-njJ8o.js";import{C as r}from"./clock-Bnz6tlQN.js";import{C as a}from"./circle-alert-CstyZfKG.js";import{C as l}from"./check-Drzd8-9c.js";const i={completed:"bg-[#1FC5A8]/10 text-[#1FC5A8]",running:"bg-[#553DE9]/10 text-[#553DE9]",failed:"bg-[#C45B5B]/10 text-[#C45B5B]",started:"bg-[#D4A03C]/10 text-[#D4A03C]",empty:"bg-[#F8F4F0] text-[#6B6960]",version:"bg-[#553DE9]/10 text-[#553DE9]"};function o({status:t}){switch(t){case"completed":return e.jsx(l,{size:12});case"running":return e.jsxs("span",{className:"relative flex h-2 w-2",children:[e.jsx("span",{className:"animate-ping motion-reduce:animate-none absolute inline-flex h-full w-full rounded-full bg-current opacity-75"}),e.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-current"})]});case"failed":return e.jsx(a,{size:12});case"started":return e.jsx(r,{size:12});default:return null}}function f({status:t,children:n,className:s=""}){return e.jsxs("span",{className:["inline-flex items-center gap-1 rounded-btn px-2.5 py-0.5 text-xs font-semibold",i[t],s].filter(Boolean).join(" "),children:[e.jsx(o,{status:t}),n]})}export{f as B};
@@ -1 +1 @@
1
- import{r as p,j as t}from"./index-BMmYYws0.js";const m={primary:"bg-[#553DE9] text-white hover:bg-[#4432c4] shadow-button rounded-btn",secondary:"border border-[#553DE9] text-[#553DE9] hover:bg-[#E8E4FD] bg-transparent rounded-btn",ghost:"text-[#36342E] hover:bg-[#F8F4F0] rounded-btn",danger:"bg-[#C45B5B]/10 text-[#C45B5B] border border-[#C45B5B]/20 hover:bg-[#C45B5B]/20 rounded-btn"},b={sm:"px-3 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base"},u={sm:14,md:16,lg:18};function h({size:e}){return t.jsxs("svg",{className:"animate-spin",width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})}const B=p.forwardRef(({variant:e="primary",size:o="md",icon:n,iconRight:i,loading:r=!1,disabled:a,className:c="",children:l,...x},d)=>{const s=u[o];return t.jsxs("button",{ref:d,disabled:a||r,className:["inline-flex items-center justify-center gap-2 font-medium transition-colors",m[e],b[o],(a||r)&&"opacity-60 cursor-not-allowed",c].filter(Boolean).join(" "),...x,children:[r?t.jsx(h,{size:s}):n?t.jsx(n,{size:s}):null,l,i&&!r&&t.jsx(i,{size:s})]})});B.displayName="Button";export{B};
1
+ import{r as p,j as t}from"./index-Cu-njJ8o.js";const m={primary:"bg-[#553DE9] text-white hover:bg-[#4432c4] shadow-button rounded-btn",secondary:"border border-[#553DE9] text-[#553DE9] hover:bg-[#E8E4FD] bg-transparent rounded-btn",ghost:"text-[#36342E] hover:bg-[#F8F4F0] rounded-btn",danger:"bg-[#C45B5B]/10 text-[#C45B5B] border border-[#C45B5B]/20 hover:bg-[#C45B5B]/20 rounded-btn"},b={sm:"px-3 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base"},u={sm:14,md:16,lg:18};function h({size:e}){return t.jsxs("svg",{className:"animate-spin",width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})}const B=p.forwardRef(({variant:e="primary",size:o="md",icon:n,iconRight:i,loading:r=!1,disabled:a,className:c="",children:l,...x},d)=>{const s=u[o];return t.jsxs("button",{ref:d,disabled:a||r,className:["inline-flex items-center justify-center gap-2 font-medium transition-colors",m[e],b[o],(a||r)&&"opacity-60 cursor-not-allowed",c].filter(Boolean).join(" "),...x,children:[r?t.jsx(h,{size:s}):n?t.jsx(n,{size:s}):null,l,i&&!r&&t.jsx(i,{size:s})]})});B.displayName="Button";export{B};
@@ -1,4 +1,4 @@
1
- import{c as $,r as i,j as e,G as fe,Q as ge,F as be,i as ke,T as G,Z as ve,a as j,S as ye,V as je,X as Ne,P as ae,k as we,h as Se,m as Ce,Y as Re,N as I,J as Me,K as Te,O as $e,u as Ee}from"./index-BMmYYws0.js";import{P as K,S as Pe,E as Ae}from"./ErrorBoundary-C7vQYDW9.js";import{C as ze,F as Ie,H as _e,G as De,T as Fe}from"./thumbs-up-BqEh1puP.js";import{C as re}from"./check-BC9x7oPm.js";import{C as Le}from"./clock-DKSDFsE6.js";import{D as Oe}from"./dollar-sign-D0A47egY.js";import{M as He}from"./minus-dhrzKSK5.js";import{G as Be}from"./git-commit-horizontal-DQUBe0oD.js";import{U as qe}from"./upload-D5IsZeFM.js";import{L as W}from"./loader-circle-Do2ke8xm.js";/**
1
+ import{c as $,r as i,j as e,G as fe,Q as ge,F as be,i as ke,T as G,Z as ve,a as j,S as ye,V as je,X as Ne,P as ae,k as we,h as Se,m as Ce,Y as Re,N as I,J as Me,K as Te,O as $e,u as Ee}from"./index-Cu-njJ8o.js";import{P as K,S as Pe,E as Ae}from"./ErrorBoundary-wE3oxaG6.js";import{C as ze,F as Ie,H as _e,a as De,G as Fe,T as Le}from"./thumbs-up-Da1QQhqo.js";import{C as re}from"./check-Drzd8-9c.js";import{C as Oe}from"./clock-Bnz6tlQN.js";import{D as He}from"./dollar-sign-D6RFNgdZ.js";import{M as Be}from"./minus-B8p0FoYZ.js";import{U as qe}from"./upload-KkeVyg67.js";import{L as W}from"./loader-circle-DXgc_u5I.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -39,9 +39,9 @@ import{c as $,r as i,j as e,G as fe,Q as ge,F as be,i as ke,T as G,Z as ve,a as
39
39
  * This source code is licensed under the ISC license.
40
40
  * See the LICENSE file in the root directory of this source tree.
41
41
  */const nt=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],V=$("wifi-off",nt);function at(s){const t=new Map;for(const n of s??[]){const a=t.get(n.path);if(!a){t.set(n.path,{path:n.path,status:n.status,staged:n.staged,partiallyStaged:!1});continue}t.set(n.path,{path:n.path,status:a.status==="modified"?n.status:a.status,staged:a.staged||n.staged,partiallyStaged:a.staged!==n.staged})}return Array.from(t.values()).sort((n,a)=>n.path.localeCompare(a.path))}function Q(s){return(s??"").replace(/\/+$/,"")}function rt(s,t){if(!(s!=null&&s.running)||!t)return!1;const n=Q(s.projectDir),a=Q(t.path);return n.length>0&&n===a}function it(s){const t=(s??"").trim();if(!t)return{goal:null,criteria:[]};const n=t.split(`
42
- `);let a=null;for(const l of n){const r=l.trim();if(!r)continue;const d=r.match(/^#{1,3}\s+(.*)$/);if(d){a=d[1].trim();break}if(!r.startsWith("---")){a=r.length>200?`${r.slice(0,200)}...`:r;break}}const o=[];let u=!1;for(const l of n){const r=l.trim(),d=r.match(/^#{1,6}\s+(.*)$/);if(d){u=/acceptance|success criteria|definition of done|requirements/i.test(d[1]);continue}if(!u)continue;const m=r.match(/^[-*]\s+(?:\[[ xX]\]\s*)?(.+)$/);m&&o.push(m[1].trim())}return{goal:a,criteria:o.slice(0,12)}}function ot({detail:s,status:t,git:n,isLive:a}){var d;const{goal:o,criteria:u}=i.useMemo(()=>it(s==null?void 0:s.prd),[s==null?void 0:s.prd]),[l,r]=i.useState(!1);return e.jsxs("header",{"aria-label":"Task",className:"border-b border-border dark:border-dark-border bg-card dark:bg-dark-card px-4 py-4 sm:px-6",children:[e.jsx("div",{className:"flex flex-wrap items-start justify-between gap-3",children:e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-small uppercase tracking-wide text-muted-accessible dark:text-dark-muted",children:"Goal"}),e.jsx("h1",{className:"mt-1 font-heading text-h2 leading-tight text-ink dark:text-dark-ink",children:o??"No spec recorded for this session"}),!o&&e.jsx("p",{className:"mt-1 text-caption text-muted-accessible dark:text-dark-muted",children:"A PRD.md in the project directory would appear here."})]})}),e.jsxs("dl",{className:"mt-3 flex flex-wrap items-center gap-x-5 gap-y-2 text-caption text-muted-accessible dark:text-dark-muted",children:[(n==null?void 0:n.branch)&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(fe,{size:14,"aria-hidden":"true"}),e.jsx("dt",{className:"sr-only",children:"Branch"}),e.jsx("dd",{className:"font-mono",children:n.branch})]}),a&&(t==null?void 0:t.provider)&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(ge,{size:14,"aria-hidden":"true"}),e.jsx("dt",{className:"sr-only",children:"Provider"}),e.jsx("dd",{children:t.provider})]}),(s==null?void 0:s.path)&&e.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[e.jsx(be,{size:14,"aria-hidden":"true"}),e.jsx("dt",{className:"sr-only",children:"Project directory"}),e.jsx("dd",{className:"truncate font-mono",title:s.path,children:s.path})]})]}),e.jsxs("section",{"aria-label":"Acceptance criteria",className:"mt-4",children:[e.jsx("h2",{className:"text-small uppercase tracking-wide text-muted-accessible dark:text-dark-muted",children:"Acceptance criteria"}),u.length>0?e.jsx("ul",{className:"mt-2 space-y-1.5",children:u.map(m=>e.jsxs("li",{className:"flex gap-2 text-caption text-secondary dark:text-dark-ink",children:[e.jsx("span",{"aria-hidden":"true",className:"mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full bg-primary"}),e.jsx("span",{children:m})]},m))}):e.jsx("p",{className:"mt-2 text-caption text-muted-accessible dark:text-dark-muted",children:"None stated in the spec. Nothing here is inferred, so this run has no declared pass condition beyond its quality gates."})]}),((d=s==null?void 0:s.prd)==null?void 0:d.trim())&&e.jsxs("div",{className:"mt-3",children:[e.jsxs("button",{type:"button",onClick:()=>r(m=>!m),"aria-expanded":l,className:"inline-flex items-center gap-1.5 rounded-btn px-2 py-1 text-small text-primary transition-colors hover:bg-primary/5 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",children:[e.jsx(ke,{size:14,"aria-hidden":"true",className:`transition-transform motion-reduce:transition-none ${l?"rotate-180":""}`}),l?"Hide full spec":"Read full spec"]}),l&&e.jsx("pre",{className:"mt-2 max-h-80 overflow-auto rounded-card border border-border bg-hover p-3 font-mono text-xs leading-relaxed text-secondary dark:border-dark-border dark:bg-dark-hover dark:text-dark-ink",children:s.prd})]})]})}const ie=["understanding","planning","editing","testing","review","pr-ready"],Y={"not-started":"Not started",understanding:"Understanding",planning:"Planning",editing:"Editing",testing:"Testing",review:"Review","pr-ready":"PR ready",failed:"Failed",unknown:"Unknown"},X={"not-started":"No run has been recorded for this session.",understanding:"Reading the spec and the existing code.",planning:"Deciding what to change and in what order.",editing:"Writing code.",testing:"Running checks against what it wrote.",review:"Reflecting on the result and reviewing its own changes.","pr-ready":"Work finished. Ready for your review.",failed:"The run ended without completing.",unknown:"The engine reported a phase this view does not recognise."},Z={idle:"not-started",starting:"understanding",BOOTSTRAP:"understanding",REASON:"planning",ACT:"editing",VERIFY:"testing",REFLECT:"review",BUILDING:"editing",COMPLETED:"pr-ready",FAILED:"failed",UNKNOWN:"unknown"};function U(s){const t=(s??"").trim();if(!t)return{display:"not-started",raw:"",recognised:!0};const n=Z[t];if(n)return{display:n,raw:t,recognised:!0};const a=Z[t.toUpperCase()];return a?{display:a,raw:t,recognised:!0}:{display:"unknown",raw:t,recognised:!1}}function lt(s){return ie.indexOf(s)}function dt({state:s,view:t}){return s==="active"?t==="paused"?e.jsx(K,{size:16,"aria-hidden":"true"}):t==="failed"?e.jsx(G,{size:16,"aria-hidden":"true"}):e.jsxs("span",{className:"relative flex h-4 w-4 items-center justify-center",children:[t==="running"&&e.jsx("span",{className:"absolute inline-flex h-4 w-4 animate-ping rounded-full bg-current opacity-40 motion-reduce:hidden"}),e.jsx(ze,{size:16,"aria-hidden":"true",className:"relative"})]}):s==="done"?e.jsx(re,{size:16,"aria-hidden":"true"}):e.jsx(Ge,{size:16,"aria-hidden":"true"})}function ct({phase:s,view:t,isLive:n,iteration:a}){const o=lt(s.display),u=s.display==="failed"||s.display==="pr-ready";function l(r,d){return d===o?"active":s.display==="pr-ready"?"done":n&&d<o?"ahead":!n&&o>=0&&d<o?"done":"ahead"}return e.jsxs("section",{"aria-label":"Phase timeline",className:"p-4 sm:p-5",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[e.jsx("h2",{className:"text-small uppercase tracking-wide text-muted-accessible dark:text-dark-muted",children:"Progress"}),!n&&e.jsx("span",{className:"text-small text-muted-accessible dark:text-dark-muted",children:"Historical"})]}),e.jsx("p",{"aria-live":"polite",className:"sr-only",children:`Phase: ${Y[s.display]}`}),e.jsx("ol",{className:"mt-3 space-y-0.5",children:ie.map((r,d)=>{const m=l(r,d),x=m==="active";return e.jsxs("li",{"aria-current":x?"step":void 0,className:["flex gap-3 rounded-btn px-2 py-2 transition-colors motion-reduce:transition-none",x?"bg-primary/5 dark:bg-primary/10":""].join(" "),children:[e.jsx("span",{className:["mt-0.5 shrink-0",x&&t==="failed"?"text-danger":x?"text-primary":m==="done"?"text-success":"text-muted-accessible dark:text-dark-muted"].join(" "),children:e.jsx(dt,{state:m,view:t})}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:["block text-caption",x?"font-semibold text-ink dark:text-dark-ink":m==="done"?"text-secondary dark:text-dark-ink":"text-muted-accessible dark:text-dark-muted"].join(" "),children:Y[r]}),x&&e.jsx("span",{className:"mt-0.5 block text-small text-muted-accessible dark:text-dark-muted",children:X[r]})]})]},r)})}),s.display==="failed"&&e.jsx("p",{className:"mt-2 rounded-btn bg-danger/10 px-2 py-2 text-caption text-danger",children:X.failed}),!s.recognised&&e.jsxs("p",{className:"mt-2 rounded-btn bg-warning/10 px-2 py-2 text-caption text-ink dark:text-dark-ink",children:["The engine reported phase"," ",e.jsx("code",{className:"font-mono font-semibold",children:s.raw}),", which this view does not recognise. Shown verbatim rather than guessed at."]}),n&&!u&&typeof a=="number"&&a>0&&e.jsxs("p",{className:"mt-3 text-small text-muted-accessible dark:text-dark-muted",children:["Iteration ",a,". Phases repeat each iteration, so this is a cycle, not a countdown."]})]})}function J(s){if(s<60)return`${s}s`;const t=Math.floor(s/60),n=s%60;return t<60?`${t}m ${n}s`:`${Math.floor(t/60)}h ${t%60}m`}function F({icon:s,label:t,value:n,note:a,muted:o}){return e.jsxs("div",{className:"min-w-0",children:[e.jsxs("dt",{className:"flex items-center gap-1.5 text-small uppercase tracking-wide text-muted-accessible dark:text-dark-muted",children:[e.jsx(s,{size:13,"aria-hidden":!0}),t]}),e.jsx("dd",{className:["mt-1 font-mono text-h3 tabular-nums",o?"text-muted-accessible dark:text-dark-muted":"text-ink dark:text-dark-ink"].join(" "),children:n}),a&&e.jsx("p",{className:"mt-0.5 text-small text-muted-accessible dark:text-dark-muted",children:a})]})}function ut({status:s,isLive:t,elapsedSeconds:n,timeToFirstSignal:a}){const o=(s==null?void 0:s.iteration)??0,u=(s==null?void 0:s.cost)??0;return e.jsxs("section",{"aria-label":"Run metrics",className:"p-4 sm:p-5",children:[e.jsx("h2",{className:"text-small uppercase tracking-wide text-muted-accessible dark:text-dark-muted",children:"Metrics"}),e.jsxs("dl",{className:"mt-3 grid grid-cols-2 gap-x-4 gap-y-4 lg:grid-cols-2",children:[e.jsx(F,{icon:Le,label:"Elapsed",value:n!==null?J(n):"--",note:t?void 0:"Only measured while a run is live",muted:n===null}),e.jsx(F,{icon:ve,label:"First signal",value:a!==null?J(a):"--",note:a!==null?"Observed since this view opened":t?"Not yet observed in this view":"Not recorded",muted:a===null}),e.jsx(F,{icon:et,label:"Iteration",value:t&&o>0?String(o):"--",note:t&&o>0?void 0:"Not reported",muted:!t||o<=0}),e.jsx(F,{icon:Oe,label:"Cost",value:u>0?`$${u.toFixed(2)}`:"--",note:u>0?void 0:"Not recorded",muted:u<=0})]})]})}const mt={added:Ye,deleted:We,modified:q,renamed:q,untracked:Ie},xt={added:"text-success",deleted:"text-danger",modified:"text-info",renamed:"text-info",untracked:"text-warning"};function ht({sessionId:s,files:t,clean:n}){const[a,o]=i.useState(null),[u,l]=i.useState(null),[r,d]=i.useState(!1),[m,x]=i.useState(null),[g,w]=i.useState(0),v=i.useRef(null);i.useEffect(()=>{if(!a)return;let h=!1;return d(!0),x(null),l(null),j.getSessionFileContent(s,a).then(b=>!h&&l(b.content)).catch(b=>!h&&x(b instanceof Error?b.message:"Could not read this file")).finally(()=>!h&&d(!1)),()=>{h=!0}},[s,a]);function f(h){var R;if(t.length===0)return;let b=g;if(h.key==="ArrowDown")b=Math.min(g+1,t.length-1);else if(h.key==="ArrowUp")b=Math.max(g-1,0);else if(h.key==="Home")b=0;else if(h.key==="End")b=t.length-1;else if(h.key==="Enter"||h.key===" "){h.preventDefault(),o(t[g].path);return}else return;h.preventDefault(),w(b);const S=(R=v.current)==null?void 0:R.querySelectorAll("li > button")[b];S==null||S.focus()}return n&&t.length===0?e.jsxs("section",{"aria-label":"Changed files",className:"p-4 sm:p-5",children:[e.jsx("h2",{className:"text-small uppercase tracking-wide text-muted-accessible dark:text-dark-muted",children:"Changes"}),e.jsx("p",{className:"mt-3 text-caption text-muted-accessible dark:text-dark-muted",children:"The working tree is clean. Nothing has been changed in this session."})]}):e.jsxs("section",{"aria-label":"Changed files",className:"flex min-h-0 flex-col p-4 sm:p-5",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[e.jsx("h2",{className:"text-small uppercase tracking-wide text-muted-accessible dark:text-dark-muted",children:"Changes"}),e.jsxs("span",{className:"text-small text-muted-accessible dark:text-dark-muted",children:[t.length," ",t.length===1?"file":"files"]})]}),e.jsxs("div",{className:"mt-3 grid min-h-0 flex-1 gap-4 lg:grid-cols-[minmax(0,18rem)_minmax(0,1fr)]",children:[e.jsx("ul",{ref:v,role:"listbox","aria-label":"Changed files",tabIndex:t.length?0:-1,onKeyDown:f,className:"max-h-72 space-y-0.5 overflow-y-auto lg:max-h-none",children:t.map((h,b)=>{const S=mt[h.status]??q,R=a===h.path;return e.jsx("li",{role:"option","aria-selected":R,children:e.jsxs("button",{type:"button",tabIndex:b===g?0:-1,onFocus:()=>w(b),onClick:()=>o(h.path),className:["flex w-full items-center gap-2 rounded-btn px-2 py-1.5 text-left transition-colors motion-reduce:transition-none",R?"bg-primary/10 text-ink dark:text-dark-ink":"text-secondary hover:bg-hover dark:text-dark-ink dark:hover:bg-dark-hover","focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-primary"].join(" "),children:[e.jsx("span",{className:xt[h.status]??"text-muted-accessible",children:e.jsx(S,{size:14})}),e.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",title:h.path,children:h.path}),e.jsx("span",{className:"shrink-0 text-small text-muted-accessible dark:text-dark-muted",children:h.partiallyStaged?"partly staged":h.staged?"staged":""})]})},h.path)})}),e.jsxs("div",{className:"min-w-0 rounded-card border border-border bg-hover dark:border-dark-border dark:bg-dark-hover",children:[!a&&e.jsx("p",{className:"p-4 text-caption text-muted-accessible dark:text-dark-muted",children:"Select a file to read it. This shows the file as it stands now; a line-by-line diff against the previous revision is not served by this API."}),a&&r&&e.jsxs("p",{className:"p-4 text-caption text-muted-accessible dark:text-dark-muted",children:["Loading ",a,"..."]}),a&&m&&e.jsx("p",{className:"p-4 text-caption text-danger",children:m}),a&&u!==null&&e.jsx("pre",{className:"max-h-[28rem] overflow-auto p-3 font-mono text-xs leading-relaxed text-secondary dark:text-dark-ink",children:u})]})]})]})}const ee={pass:{Icon:re,cls:"text-success"},fail:{Icon:Ne,cls:"text-danger"},skip:{Icon:He,cls:"text-muted-accessible"},pending:{Icon:je,cls:"text-warning"}},B={running:!1,returncode:null,output:null,error:null};function pt({sessionId:s,checklist:t}){const[n,a]=i.useState(B),[o,u]=i.useState(B);function l(d,m){const x=d==="tests"?a:u;x({...B,running:!0}),m().then(g=>x({running:!1,returncode:g.returncode,output:g.output,error:null})).catch(g=>x({running:!1,returncode:null,output:null,error:g instanceof Error?g.message:"Failed to run"}))}const r=!!(t&&t.items.length>0);return e.jsxs("section",{"aria-label":"Evidence",className:"p-4 sm:p-5",children:[e.jsxs("h2",{className:"flex items-center gap-1.5 text-small uppercase tracking-wide text-muted-accessible dark:text-dark-muted",children:[e.jsx(ye,{size:13,"aria-hidden":"true"}),"Evidence"]}),e.jsxs("div",{className:"mt-3",children:[e.jsx("h3",{className:"text-caption font-semibold text-ink dark:text-dark-ink",children:"Quality gates"}),r?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"mt-1 text-small text-muted-accessible dark:text-dark-muted",children:[t.passed," passed, ",t.failed," failed,"," ",t.skipped," skipped, ",t.pending," pending"]}),e.jsx("ul",{className:"mt-2 space-y-1",children:t.items.map(d=>{const{Icon:m,cls:x}=ee[d.status]??ee.pending;return e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:`mt-0.5 shrink-0 ${x}`,children:e.jsx(m,{size:14,"aria-hidden":"true"})}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block text-caption text-secondary dark:text-dark-ink",children:d.label}),e.jsx("span",{className:"sr-only",children:d.status}),d.details&&e.jsx("span",{className:"block text-small text-muted-accessible dark:text-dark-muted",children:d.details})]})]},d.id)})})]}):e.jsx("p",{className:"mt-1 text-caption text-muted-accessible dark:text-dark-muted",children:"No gate results recorded. The engine writes these during a run; an empty file is not the same as a clean pass."})]}),e.jsxs("div",{className:"mt-5 space-y-3",children:[e.jsx("h3",{className:"text-caption font-semibold text-ink dark:text-dark-ink",children:"Checks"}),e.jsx(te,{name:"Test suite",state:n,onRun:()=>l("tests",()=>j.testProject(s))}),e.jsx(te,{name:"Code review",state:o,onRun:()=>l("review",()=>j.reviewProject(s))}),e.jsx("p",{className:"text-small text-muted-accessible dark:text-dark-muted",children:"Build, typecheck and lint are not exposed as separate endpoints by this API. They run inside the test and review commands above."})]})]})}function te({name:s,state:t,onRun:n}){const a=t.returncode===null?null:t.returncode===0?{text:"Passed",cls:"text-success"}:{text:`Failed (exit ${t.returncode})`,cls:"text-danger"};return e.jsxs("div",{className:"rounded-card border border-border p-3 dark:border-dark-border",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-caption text-ink dark:text-dark-ink",children:s}),e.jsx("p",{className:`text-small ${(a==null?void 0:a.cls)??"text-muted-accessible dark:text-dark-muted"}`,children:t.running?"Running...":t.error?t.error:(a==null?void 0:a.text)??"Not run"})]}),e.jsxs("button",{type:"button",onClick:n,disabled:t.running,className:"inline-flex items-center gap-1.5 rounded-btn border border-primary/30 px-2.5 py-1 text-small font-semibold text-primary transition-colors hover:bg-primary/5 disabled:cursor-not-allowed disabled:opacity-60 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",children:[e.jsx(ae,{size:12,"aria-hidden":"true"}),t.returncode===null?"Run":"Re-run"]})]}),t.output&&e.jsx("pre",{className:"mt-2 max-h-48 overflow-auto rounded-btn bg-hover p-2 font-mono text-xs text-secondary dark:bg-dark-hover dark:text-dark-ink",children:t.output})]})}function ft(s,t,n){const a=[],o=(t==null?void 0:t.items.filter(r=>r.status==="fail"))??[];o.length>0&&a.push(`${o.length} quality gate(s) failed: ${o.map(r=>r.label).join(", ")}.`),(!t||t.items.length===0)&&a.push("No quality gate results were recorded, so nothing here is verified.");const u=(t==null?void 0:t.items.filter(r=>r.status==="pending"))??[];u.length>0&&a.push(`${u.length} gate(s) still pending.`),s.length>20&&a.push(`${s.length} files changed, which is a large surface to review.`);const l=s.filter(r=>r.status==="untracked").length;return l>0&&a.push(`${l} file(s) are untracked and would not be included in a commit.`),n.length===0&&a.push("No checkpoints were recorded, so there is nothing to roll back to."),a}function gt({sessionId:s,checkpoints:t,changedFiles:n,checklist:a,isLive:o,onRestored:u}){const[l,r]=i.useState(null),[d,m]=i.useState(!1),[x,g]=i.useState(null),w=ft(n,a,t);function v(f){m(!0),g(null),j.restoreCheckpoint(s,f.id).then(h=>{g(`Restored: ${h.description}`),r(null),u()}).catch(h=>g(h instanceof Error?h.message:"Restore failed")).finally(()=>m(!1))}return e.jsxs("section",{"aria-label":"Risk and rollback",className:"p-4 sm:p-5",children:[e.jsxs("h2",{className:"flex items-center gap-1.5 text-small uppercase tracking-wide text-muted-accessible dark:text-dark-muted",children:[e.jsx(G,{size:13,"aria-hidden":"true"}),"Risk"]}),w.length>0?e.jsx("ul",{className:"mt-3 space-y-1.5",children:w.map(f=>e.jsxs("li",{className:"flex gap-2 text-caption text-secondary dark:text-dark-ink",children:[e.jsx("span",{"aria-hidden":"true",className:"mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full bg-warning"}),e.jsx("span",{children:f})]},f))}):e.jsx("p",{className:"mt-3 text-caption text-secondary dark:text-dark-ink",children:"Nothing flagged from what was recorded. That is not a guarantee of correctness, only that no recorded signal was negative."}),e.jsxs("div",{className:"mt-5",children:[e.jsxs("h3",{className:"flex items-center gap-1.5 text-caption font-semibold text-ink dark:text-dark-ink",children:[e.jsx(_e,{size:14,"aria-hidden":"true"}),"Rollback"]}),t.length===0?e.jsx("p",{className:"mt-1 text-caption text-muted-accessible dark:text-dark-muted",children:"No checkpoints recorded for this session, so there is nothing to roll back to."}):e.jsx("ul",{className:"mt-2 space-y-1.5",children:t.map(f=>e.jsxs("li",{className:"flex flex-wrap items-center justify-between gap-2 rounded-card border border-border p-2.5 dark:border-dark-border",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-caption text-ink dark:text-dark-ink",children:f.description}),e.jsxs("p",{className:"text-small text-muted-accessible dark:text-dark-muted",children:[f.timestamp||"no timestamp"," - iteration ",f.iteration," -"," ",f.files_changed," file(s)"]})]}),e.jsxs("button",{type:"button",onClick:()=>r(f),disabled:d||o,title:o?"Cannot roll back while a run is in progress":void 0,className:"inline-flex shrink-0 items-center gap-1.5 rounded-btn border border-danger/30 bg-danger/10 px-2.5 py-1 text-small font-semibold text-danger transition-colors hover:bg-danger/20 disabled:cursor-not-allowed disabled:opacity-60 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-danger",children:[e.jsx(st,{size:12,"aria-hidden":"true"}),"Roll back"]})]},f.id))}),o&&t.length>0&&e.jsx("p",{className:"mt-2 text-small text-muted-accessible dark:text-dark-muted",children:"Rollback is disabled while a run is in progress. Stop the run first."})]}),l&&e.jsxs("div",{role:"alertdialog","aria-modal":"true","aria-labelledby":"rollback-title",className:"mt-3 rounded-card border border-danger/30 bg-danger/5 p-3",children:[e.jsxs("p",{id:"rollback-title",className:"text-caption font-semibold text-ink dark:text-dark-ink",children:['Roll back to "',l.description,'"?']}),e.jsxs("p",{className:"mt-1 text-small text-secondary dark:text-dark-ink",children:["This overwrites files in the project directory with the snapshot taken at iteration ",l.iteration,". Changes made since then and not checkpointed are lost."]}),e.jsxs("div",{className:"mt-3 flex gap-2",children:[e.jsx("button",{type:"button",autoFocus:!0,onClick:()=>v(l),disabled:d,className:"rounded-btn bg-danger px-3 py-1.5 text-small font-semibold text-white transition-colors hover:opacity-90 disabled:opacity-60 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-danger",children:d?"Restoring...":"Yes, roll back"}),e.jsx("button",{type:"button",onClick:()=>r(null),disabled:d,className:"rounded-btn px-3 py-1.5 text-small font-semibold text-secondary transition-colors hover:bg-hover dark:text-dark-ink dark:hover:bg-dark-hover focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",children:"Cancel"})]})]}),x&&e.jsx("p",{role:"status",className:"mt-2 text-caption text-secondary dark:text-dark-ink",children:x})]})}function bt({sessionId:s,isLive:t,status:n,git:a,changedFiles:o,onChanged:u}){const[l,r]=i.useState(null),[d,m]=i.useState(null),[x,g]=i.useState(""),[w,v]=i.useState(null),[f,h]=i.useState(""),b=!!(n!=null&&n.paused),S=o.length>0,R=(a==null?void 0:a.ahead)??0,_=[{key:"pause",label:"Pause",icon:K,disabledReason:t?b?"Already paused":null:"No run in progress for this session",onRun:()=>j.pauseSession().then(c=>c.message??"Paused")},{key:"resume",label:"Resume",icon:ae,disabledReason:t?b?null:"The run is not paused":"No run in progress for this session",onRun:()=>j.resumeSession().then(c=>c.message??"Resumed")},{key:"stop",label:"Stop run",icon:Pe,danger:!0,disabledReason:t?null:"No run in progress for this session",onRun:()=>j.stopSession().then(c=>c.message??"Stopped")},{key:"commit",label:"Commit",icon:Be,disabledReason:S?null:"The working tree is clean",onRun:()=>j.git.commit(s,x.trim()||"Loki: apply changes").then(c=>`Committed ${c.hash.slice(0,7)}`)},{key:"push",label:"Push",icon:qe,disabledReason:R<=0?"Nothing to push: no commits ahead of the remote":null,onRun:()=>j.git.push(s).then(c=>c.message??"Pushed")},{key:"pr",label:"Open pull request",icon:De,disabledReason:!S&&R<=0?"Nothing to open a pull request for":x.trim()?null:"Enter a title first",onRun:()=>j.git.pr(s,x.trim(),"").then(c=>`Opened #${c.number}: ${c.url}`)}];function L(c){!c.onRun||c.disabledReason||(r(c.key),m(null),c.onRun().then(k=>{m(k),u()}).catch(k=>m(k instanceof Error?k.message:`${c.label} failed`)).finally(()=>r(null)))}function A(){const c=f.trim();c&&(r("preview"),v(null),j.previewChanges(s,c).then(k=>v(k.files.length===0?"No files would change.":`${k.files.length} file(s) would change: +${k.total_additions} / -${k.total_deletions}
42
+ `);let a=null;for(const l of n){const r=l.trim();if(!r)continue;const d=r.match(/^#{1,3}\s+(.*)$/);if(d){a=d[1].trim();break}if(!r.startsWith("---")){a=r.length>200?`${r.slice(0,200)}...`:r;break}}const o=[];let u=!1;for(const l of n){const r=l.trim(),d=r.match(/^#{1,6}\s+(.*)$/);if(d){u=/acceptance|success criteria|definition of done|requirements/i.test(d[1]);continue}if(!u)continue;const m=r.match(/^[-*]\s+(?:\[[ xX]\]\s*)?(.+)$/);m&&o.push(m[1].trim())}return{goal:a,criteria:o.slice(0,12)}}function ot({detail:s,status:t,git:n,isLive:a}){var d;const{goal:o,criteria:u}=i.useMemo(()=>it(s==null?void 0:s.prd),[s==null?void 0:s.prd]),[l,r]=i.useState(!1);return e.jsxs("header",{"aria-label":"Task",className:"border-b border-border dark:border-dark-border bg-card dark:bg-dark-card px-4 py-4 sm:px-6",children:[e.jsx("div",{className:"flex flex-wrap items-start justify-between gap-3",children:e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-small uppercase tracking-wide text-muted-accessible dark:text-dark-muted",children:"Goal"}),e.jsx("h1",{className:"mt-1 font-heading text-h2 leading-tight text-ink dark:text-dark-ink",children:o??"No spec recorded for this session"}),!o&&e.jsx("p",{className:"mt-1 text-caption text-muted-accessible dark:text-dark-muted",children:"A PRD.md in the project directory would appear here."})]})}),e.jsxs("dl",{className:"mt-3 flex flex-wrap items-center gap-x-5 gap-y-2 text-caption text-muted-accessible dark:text-dark-muted",children:[(n==null?void 0:n.branch)&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(fe,{size:14,"aria-hidden":"true"}),e.jsx("dt",{className:"sr-only",children:"Branch"}),e.jsx("dd",{className:"font-mono",children:n.branch})]}),a&&(t==null?void 0:t.provider)&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(ge,{size:14,"aria-hidden":"true"}),e.jsx("dt",{className:"sr-only",children:"Provider"}),e.jsx("dd",{children:t.provider})]}),(s==null?void 0:s.path)&&e.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[e.jsx(be,{size:14,"aria-hidden":"true"}),e.jsx("dt",{className:"sr-only",children:"Project directory"}),e.jsx("dd",{className:"truncate font-mono",title:s.path,children:s.path})]})]}),e.jsxs("section",{"aria-label":"Acceptance criteria",className:"mt-4",children:[e.jsx("h2",{className:"text-small uppercase tracking-wide text-muted-accessible dark:text-dark-muted",children:"Acceptance criteria"}),u.length>0?e.jsx("ul",{className:"mt-2 space-y-1.5",children:u.map(m=>e.jsxs("li",{className:"flex gap-2 text-caption text-secondary dark:text-dark-ink",children:[e.jsx("span",{"aria-hidden":"true",className:"mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full bg-primary"}),e.jsx("span",{children:m})]},m))}):e.jsx("p",{className:"mt-2 text-caption text-muted-accessible dark:text-dark-muted",children:"None stated in the spec. Nothing here is inferred, so this run has no declared pass condition beyond its quality gates."})]}),((d=s==null?void 0:s.prd)==null?void 0:d.trim())&&e.jsxs("div",{className:"mt-3",children:[e.jsxs("button",{type:"button",onClick:()=>r(m=>!m),"aria-expanded":l,className:"inline-flex items-center gap-1.5 rounded-btn px-2 py-1 text-small text-primary transition-colors hover:bg-primary/5 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",children:[e.jsx(ke,{size:14,"aria-hidden":"true",className:`transition-transform motion-reduce:transition-none ${l?"rotate-180":""}`}),l?"Hide full spec":"Read full spec"]}),l&&e.jsx("pre",{className:"mt-2 max-h-80 overflow-auto rounded-card border border-border bg-hover p-3 font-mono text-xs leading-relaxed text-secondary dark:border-dark-border dark:bg-dark-hover dark:text-dark-ink",children:s.prd})]})]})}const ie=["understanding","planning","editing","testing","review","pr-ready"],Y={"not-started":"Not started",understanding:"Understanding",planning:"Planning",editing:"Editing",testing:"Testing",review:"Review","pr-ready":"PR ready",failed:"Failed",unknown:"Unknown"},X={"not-started":"No run has been recorded for this session.",understanding:"Reading the spec and the existing code.",planning:"Deciding what to change and in what order.",editing:"Writing code.",testing:"Running checks against what it wrote.",review:"Reflecting on the result and reviewing its own changes.","pr-ready":"Work finished. Ready for your review.",failed:"The run ended without completing.",unknown:"The engine reported a phase this view does not recognise."},Z={idle:"not-started",starting:"understanding",BOOTSTRAP:"understanding",REASON:"planning",ACT:"editing",VERIFY:"testing",REFLECT:"review",BUILDING:"editing",COMPLETED:"pr-ready",FAILED:"failed",UNKNOWN:"unknown"};function U(s){const t=(s??"").trim();if(!t)return{display:"not-started",raw:"",recognised:!0};const n=Z[t];if(n)return{display:n,raw:t,recognised:!0};const a=Z[t.toUpperCase()];return a?{display:a,raw:t,recognised:!0}:{display:"unknown",raw:t,recognised:!1}}function lt(s){return ie.indexOf(s)}function dt({state:s,view:t}){return s==="active"?t==="paused"?e.jsx(K,{size:16,"aria-hidden":"true"}):t==="failed"?e.jsx(G,{size:16,"aria-hidden":"true"}):e.jsxs("span",{className:"relative flex h-4 w-4 items-center justify-center",children:[t==="running"&&e.jsx("span",{className:"absolute inline-flex h-4 w-4 animate-ping rounded-full bg-current opacity-40 motion-reduce:hidden"}),e.jsx(ze,{size:16,"aria-hidden":"true",className:"relative"})]}):s==="done"?e.jsx(re,{size:16,"aria-hidden":"true"}):e.jsx(Ge,{size:16,"aria-hidden":"true"})}function ct({phase:s,view:t,isLive:n,iteration:a}){const o=lt(s.display),u=s.display==="failed"||s.display==="pr-ready";function l(r,d){return d===o?"active":s.display==="pr-ready"?"done":n&&d<o?"ahead":!n&&o>=0&&d<o?"done":"ahead"}return e.jsxs("section",{"aria-label":"Phase timeline",className:"p-4 sm:p-5",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[e.jsx("h2",{className:"text-small uppercase tracking-wide text-muted-accessible dark:text-dark-muted",children:"Progress"}),!n&&e.jsx("span",{className:"text-small text-muted-accessible dark:text-dark-muted",children:"Historical"})]}),e.jsx("p",{"aria-live":"polite",className:"sr-only",children:`Phase: ${Y[s.display]}`}),e.jsx("ol",{className:"mt-3 space-y-0.5",children:ie.map((r,d)=>{const m=l(r,d),x=m==="active";return e.jsxs("li",{"aria-current":x?"step":void 0,className:["flex gap-3 rounded-btn px-2 py-2 transition-colors motion-reduce:transition-none",x?"bg-primary/5 dark:bg-primary/10":""].join(" "),children:[e.jsx("span",{className:["mt-0.5 shrink-0",x&&t==="failed"?"text-danger":x?"text-primary":m==="done"?"text-success":"text-muted-accessible dark:text-dark-muted"].join(" "),children:e.jsx(dt,{state:m,view:t})}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:["block text-caption",x?"font-semibold text-ink dark:text-dark-ink":m==="done"?"text-secondary dark:text-dark-ink":"text-muted-accessible dark:text-dark-muted"].join(" "),children:Y[r]}),x&&e.jsx("span",{className:"mt-0.5 block text-small text-muted-accessible dark:text-dark-muted",children:X[r]})]})]},r)})}),s.display==="failed"&&e.jsx("p",{className:"mt-2 rounded-btn bg-danger/10 px-2 py-2 text-caption text-danger",children:X.failed}),!s.recognised&&e.jsxs("p",{className:"mt-2 rounded-btn bg-warning/10 px-2 py-2 text-caption text-ink dark:text-dark-ink",children:["The engine reported phase"," ",e.jsx("code",{className:"font-mono font-semibold",children:s.raw}),", which this view does not recognise. Shown verbatim rather than guessed at."]}),n&&!u&&typeof a=="number"&&a>0&&e.jsxs("p",{className:"mt-3 text-small text-muted-accessible dark:text-dark-muted",children:["Iteration ",a,". Phases repeat each iteration, so this is a cycle, not a countdown."]})]})}function J(s){if(s<60)return`${s}s`;const t=Math.floor(s/60),n=s%60;return t<60?`${t}m ${n}s`:`${Math.floor(t/60)}h ${t%60}m`}function F({icon:s,label:t,value:n,note:a,muted:o}){return e.jsxs("div",{className:"min-w-0",children:[e.jsxs("dt",{className:"flex items-center gap-1.5 text-small uppercase tracking-wide text-muted-accessible dark:text-dark-muted",children:[e.jsx(s,{size:13,"aria-hidden":!0}),t]}),e.jsx("dd",{className:["mt-1 font-mono text-h3 tabular-nums",o?"text-muted-accessible dark:text-dark-muted":"text-ink dark:text-dark-ink"].join(" "),children:n}),a&&e.jsx("p",{className:"mt-0.5 text-small text-muted-accessible dark:text-dark-muted",children:a})]})}function ut({status:s,isLive:t,elapsedSeconds:n,timeToFirstSignal:a}){const o=(s==null?void 0:s.iteration)??0,u=(s==null?void 0:s.cost)??0;return e.jsxs("section",{"aria-label":"Run metrics",className:"p-4 sm:p-5",children:[e.jsx("h2",{className:"text-small uppercase tracking-wide text-muted-accessible dark:text-dark-muted",children:"Metrics"}),e.jsxs("dl",{className:"mt-3 grid grid-cols-2 gap-x-4 gap-y-4 lg:grid-cols-2",children:[e.jsx(F,{icon:Oe,label:"Elapsed",value:n!==null?J(n):"--",note:t?void 0:"Only measured while a run is live",muted:n===null}),e.jsx(F,{icon:ve,label:"First signal",value:a!==null?J(a):"--",note:a!==null?"Observed since this view opened":t?"Not yet observed in this view":"Not recorded",muted:a===null}),e.jsx(F,{icon:et,label:"Iteration",value:t&&o>0?String(o):"--",note:t&&o>0?void 0:"Not reported",muted:!t||o<=0}),e.jsx(F,{icon:He,label:"Cost",value:u>0?`$${u.toFixed(2)}`:"--",note:u>0?void 0:"Not recorded",muted:u<=0})]})]})}const mt={added:Ye,deleted:We,modified:q,renamed:q,untracked:Ie},xt={added:"text-success",deleted:"text-danger",modified:"text-info",renamed:"text-info",untracked:"text-warning"};function ht({sessionId:s,files:t,clean:n}){const[a,o]=i.useState(null),[u,l]=i.useState(null),[r,d]=i.useState(!1),[m,x]=i.useState(null),[g,w]=i.useState(0),v=i.useRef(null);i.useEffect(()=>{if(!a)return;let h=!1;return d(!0),x(null),l(null),j.getSessionFileContent(s,a).then(b=>!h&&l(b.content)).catch(b=>!h&&x(b instanceof Error?b.message:"Could not read this file")).finally(()=>!h&&d(!1)),()=>{h=!0}},[s,a]);function f(h){var R;if(t.length===0)return;let b=g;if(h.key==="ArrowDown")b=Math.min(g+1,t.length-1);else if(h.key==="ArrowUp")b=Math.max(g-1,0);else if(h.key==="Home")b=0;else if(h.key==="End")b=t.length-1;else if(h.key==="Enter"||h.key===" "){h.preventDefault(),o(t[g].path);return}else return;h.preventDefault(),w(b);const S=(R=v.current)==null?void 0:R.querySelectorAll("li > button")[b];S==null||S.focus()}return n&&t.length===0?e.jsxs("section",{"aria-label":"Changed files",className:"p-4 sm:p-5",children:[e.jsx("h2",{className:"text-small uppercase tracking-wide text-muted-accessible dark:text-dark-muted",children:"Changes"}),e.jsx("p",{className:"mt-3 text-caption text-muted-accessible dark:text-dark-muted",children:"The working tree is clean. Nothing has been changed in this session."})]}):e.jsxs("section",{"aria-label":"Changed files",className:"flex min-h-0 flex-col p-4 sm:p-5",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[e.jsx("h2",{className:"text-small uppercase tracking-wide text-muted-accessible dark:text-dark-muted",children:"Changes"}),e.jsxs("span",{className:"text-small text-muted-accessible dark:text-dark-muted",children:[t.length," ",t.length===1?"file":"files"]})]}),e.jsxs("div",{className:"mt-3 grid min-h-0 flex-1 gap-4 lg:grid-cols-[minmax(0,18rem)_minmax(0,1fr)]",children:[e.jsx("ul",{ref:v,role:"listbox","aria-label":"Changed files",tabIndex:t.length?0:-1,onKeyDown:f,className:"max-h-72 space-y-0.5 overflow-y-auto lg:max-h-none",children:t.map((h,b)=>{const S=mt[h.status]??q,R=a===h.path;return e.jsx("li",{role:"option","aria-selected":R,children:e.jsxs("button",{type:"button",tabIndex:b===g?0:-1,onFocus:()=>w(b),onClick:()=>o(h.path),className:["flex w-full items-center gap-2 rounded-btn px-2 py-1.5 text-left transition-colors motion-reduce:transition-none",R?"bg-primary/10 text-ink dark:text-dark-ink":"text-secondary hover:bg-hover dark:text-dark-ink dark:hover:bg-dark-hover","focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-primary"].join(" "),children:[e.jsx("span",{className:xt[h.status]??"text-muted-accessible",children:e.jsx(S,{size:14})}),e.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",title:h.path,children:h.path}),e.jsx("span",{className:"shrink-0 text-small text-muted-accessible dark:text-dark-muted",children:h.partiallyStaged?"partly staged":h.staged?"staged":""})]})},h.path)})}),e.jsxs("div",{className:"min-w-0 rounded-card border border-border bg-hover dark:border-dark-border dark:bg-dark-hover",children:[!a&&e.jsx("p",{className:"p-4 text-caption text-muted-accessible dark:text-dark-muted",children:"Select a file to read it. This shows the file as it stands now; a line-by-line diff against the previous revision is not served by this API."}),a&&r&&e.jsxs("p",{className:"p-4 text-caption text-muted-accessible dark:text-dark-muted",children:["Loading ",a,"..."]}),a&&m&&e.jsx("p",{className:"p-4 text-caption text-danger",children:m}),a&&u!==null&&e.jsx("pre",{className:"max-h-[28rem] overflow-auto p-3 font-mono text-xs leading-relaxed text-secondary dark:text-dark-ink",children:u})]})]})]})}const ee={pass:{Icon:re,cls:"text-success"},fail:{Icon:Ne,cls:"text-danger"},skip:{Icon:Be,cls:"text-muted-accessible"},pending:{Icon:je,cls:"text-warning"}},B={running:!1,returncode:null,output:null,error:null};function pt({sessionId:s,checklist:t}){const[n,a]=i.useState(B),[o,u]=i.useState(B);function l(d,m){const x=d==="tests"?a:u;x({...B,running:!0}),m().then(g=>x({running:!1,returncode:g.returncode,output:g.output,error:null})).catch(g=>x({running:!1,returncode:null,output:null,error:g instanceof Error?g.message:"Failed to run"}))}const r=!!(t&&t.items.length>0);return e.jsxs("section",{"aria-label":"Evidence",className:"p-4 sm:p-5",children:[e.jsxs("h2",{className:"flex items-center gap-1.5 text-small uppercase tracking-wide text-muted-accessible dark:text-dark-muted",children:[e.jsx(ye,{size:13,"aria-hidden":"true"}),"Evidence"]}),e.jsxs("div",{className:"mt-3",children:[e.jsx("h3",{className:"text-caption font-semibold text-ink dark:text-dark-ink",children:"Quality gates"}),r?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"mt-1 text-small text-muted-accessible dark:text-dark-muted",children:[t.passed," passed, ",t.failed," failed,"," ",t.skipped," skipped, ",t.pending," pending"]}),e.jsx("ul",{className:"mt-2 space-y-1",children:t.items.map(d=>{const{Icon:m,cls:x}=ee[d.status]??ee.pending;return e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:`mt-0.5 shrink-0 ${x}`,children:e.jsx(m,{size:14,"aria-hidden":"true"})}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block text-caption text-secondary dark:text-dark-ink",children:d.label}),e.jsx("span",{className:"sr-only",children:d.status}),d.details&&e.jsx("span",{className:"block text-small text-muted-accessible dark:text-dark-muted",children:d.details})]})]},d.id)})})]}):e.jsx("p",{className:"mt-1 text-caption text-muted-accessible dark:text-dark-muted",children:"No gate results recorded. The engine writes these during a run; an empty file is not the same as a clean pass."})]}),e.jsxs("div",{className:"mt-5 space-y-3",children:[e.jsx("h3",{className:"text-caption font-semibold text-ink dark:text-dark-ink",children:"Checks"}),e.jsx(te,{name:"Test suite",state:n,onRun:()=>l("tests",()=>j.testProject(s))}),e.jsx(te,{name:"Code review",state:o,onRun:()=>l("review",()=>j.reviewProject(s))}),e.jsx("p",{className:"text-small text-muted-accessible dark:text-dark-muted",children:"Build, typecheck and lint are not exposed as separate endpoints by this API. They run inside the test and review commands above."})]})]})}function te({name:s,state:t,onRun:n}){const a=t.returncode===null?null:t.returncode===0?{text:"Passed",cls:"text-success"}:{text:`Failed (exit ${t.returncode})`,cls:"text-danger"};return e.jsxs("div",{className:"rounded-card border border-border p-3 dark:border-dark-border",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-caption text-ink dark:text-dark-ink",children:s}),e.jsx("p",{className:`text-small ${(a==null?void 0:a.cls)??"text-muted-accessible dark:text-dark-muted"}`,children:t.running?"Running...":t.error?t.error:(a==null?void 0:a.text)??"Not run"})]}),e.jsxs("button",{type:"button",onClick:n,disabled:t.running,className:"inline-flex items-center gap-1.5 rounded-btn border border-primary/30 px-2.5 py-1 text-small font-semibold text-primary transition-colors hover:bg-primary/5 disabled:cursor-not-allowed disabled:opacity-60 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",children:[e.jsx(ae,{size:12,"aria-hidden":"true"}),t.returncode===null?"Run":"Re-run"]})]}),t.output&&e.jsx("pre",{className:"mt-2 max-h-48 overflow-auto rounded-btn bg-hover p-2 font-mono text-xs text-secondary dark:bg-dark-hover dark:text-dark-ink",children:t.output})]})}function ft(s,t,n){const a=[],o=(t==null?void 0:t.items.filter(r=>r.status==="fail"))??[];o.length>0&&a.push(`${o.length} quality gate(s) failed: ${o.map(r=>r.label).join(", ")}.`),(!t||t.items.length===0)&&a.push("No quality gate results were recorded, so nothing here is verified.");const u=(t==null?void 0:t.items.filter(r=>r.status==="pending"))??[];u.length>0&&a.push(`${u.length} gate(s) still pending.`),s.length>20&&a.push(`${s.length} files changed, which is a large surface to review.`);const l=s.filter(r=>r.status==="untracked").length;return l>0&&a.push(`${l} file(s) are untracked and would not be included in a commit.`),n.length===0&&a.push("No checkpoints were recorded, so there is nothing to roll back to."),a}function gt({sessionId:s,checkpoints:t,changedFiles:n,checklist:a,isLive:o,onRestored:u}){const[l,r]=i.useState(null),[d,m]=i.useState(!1),[x,g]=i.useState(null),w=ft(n,a,t);function v(f){m(!0),g(null),j.restoreCheckpoint(s,f.id).then(h=>{g(`Restored: ${h.description}`),r(null),u()}).catch(h=>g(h instanceof Error?h.message:"Restore failed")).finally(()=>m(!1))}return e.jsxs("section",{"aria-label":"Risk and rollback",className:"p-4 sm:p-5",children:[e.jsxs("h2",{className:"flex items-center gap-1.5 text-small uppercase tracking-wide text-muted-accessible dark:text-dark-muted",children:[e.jsx(G,{size:13,"aria-hidden":"true"}),"Risk"]}),w.length>0?e.jsx("ul",{className:"mt-3 space-y-1.5",children:w.map(f=>e.jsxs("li",{className:"flex gap-2 text-caption text-secondary dark:text-dark-ink",children:[e.jsx("span",{"aria-hidden":"true",className:"mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full bg-warning"}),e.jsx("span",{children:f})]},f))}):e.jsx("p",{className:"mt-3 text-caption text-secondary dark:text-dark-ink",children:"Nothing flagged from what was recorded. That is not a guarantee of correctness, only that no recorded signal was negative."}),e.jsxs("div",{className:"mt-5",children:[e.jsxs("h3",{className:"flex items-center gap-1.5 text-caption font-semibold text-ink dark:text-dark-ink",children:[e.jsx(_e,{size:14,"aria-hidden":"true"}),"Rollback"]}),t.length===0?e.jsx("p",{className:"mt-1 text-caption text-muted-accessible dark:text-dark-muted",children:"No checkpoints recorded for this session, so there is nothing to roll back to."}):e.jsx("ul",{className:"mt-2 space-y-1.5",children:t.map(f=>e.jsxs("li",{className:"flex flex-wrap items-center justify-between gap-2 rounded-card border border-border p-2.5 dark:border-dark-border",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-caption text-ink dark:text-dark-ink",children:f.description}),e.jsxs("p",{className:"text-small text-muted-accessible dark:text-dark-muted",children:[f.timestamp||"no timestamp"," - iteration ",f.iteration," -"," ",f.files_changed," file(s)"]})]}),e.jsxs("button",{type:"button",onClick:()=>r(f),disabled:d||o,title:o?"Cannot roll back while a run is in progress":void 0,className:"inline-flex shrink-0 items-center gap-1.5 rounded-btn border border-danger/30 bg-danger/10 px-2.5 py-1 text-small font-semibold text-danger transition-colors hover:bg-danger/20 disabled:cursor-not-allowed disabled:opacity-60 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-danger",children:[e.jsx(st,{size:12,"aria-hidden":"true"}),"Roll back"]})]},f.id))}),o&&t.length>0&&e.jsx("p",{className:"mt-2 text-small text-muted-accessible dark:text-dark-muted",children:"Rollback is disabled while a run is in progress. Stop the run first."})]}),l&&e.jsxs("div",{role:"alertdialog","aria-modal":"true","aria-labelledby":"rollback-title",className:"mt-3 rounded-card border border-danger/30 bg-danger/5 p-3",children:[e.jsxs("p",{id:"rollback-title",className:"text-caption font-semibold text-ink dark:text-dark-ink",children:['Roll back to "',l.description,'"?']}),e.jsxs("p",{className:"mt-1 text-small text-secondary dark:text-dark-ink",children:["This overwrites files in the project directory with the snapshot taken at iteration ",l.iteration,". Changes made since then and not checkpointed are lost."]}),e.jsxs("div",{className:"mt-3 flex gap-2",children:[e.jsx("button",{type:"button",autoFocus:!0,onClick:()=>v(l),disabled:d,className:"rounded-btn bg-danger px-3 py-1.5 text-small font-semibold text-white transition-colors hover:opacity-90 disabled:opacity-60 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-danger",children:d?"Restoring...":"Yes, roll back"}),e.jsx("button",{type:"button",onClick:()=>r(null),disabled:d,className:"rounded-btn px-3 py-1.5 text-small font-semibold text-secondary transition-colors hover:bg-hover dark:text-dark-ink dark:hover:bg-dark-hover focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",children:"Cancel"})]})]}),x&&e.jsx("p",{role:"status",className:"mt-2 text-caption text-secondary dark:text-dark-ink",children:x})]})}function bt({sessionId:s,isLive:t,status:n,git:a,changedFiles:o,onChanged:u}){const[l,r]=i.useState(null),[d,m]=i.useState(null),[x,g]=i.useState(""),[w,v]=i.useState(null),[f,h]=i.useState(""),b=!!(n!=null&&n.paused),S=o.length>0,R=(a==null?void 0:a.ahead)??0,_=[{key:"pause",label:"Pause",icon:K,disabledReason:t?b?"Already paused":null:"No run in progress for this session",onRun:()=>j.pauseSession().then(c=>c.message??"Paused")},{key:"resume",label:"Resume",icon:ae,disabledReason:t?b?null:"The run is not paused":"No run in progress for this session",onRun:()=>j.resumeSession().then(c=>c.message??"Resumed")},{key:"stop",label:"Stop run",icon:Pe,danger:!0,disabledReason:t?null:"No run in progress for this session",onRun:()=>j.stopSession().then(c=>c.message??"Stopped")},{key:"commit",label:"Commit",icon:De,disabledReason:S?null:"The working tree is clean",onRun:()=>j.git.commit(s,x.trim()||"Loki: apply changes").then(c=>`Committed ${c.hash.slice(0,7)}`)},{key:"push",label:"Push",icon:qe,disabledReason:R<=0?"Nothing to push: no commits ahead of the remote":null,onRun:()=>j.git.push(s).then(c=>c.message??"Pushed")},{key:"pr",label:"Open pull request",icon:Fe,disabledReason:!S&&R<=0?"Nothing to open a pull request for":x.trim()?null:"Enter a title first",onRun:()=>j.git.pr(s,x.trim(),"").then(c=>`Opened #${c.number}: ${c.url}`)}];function L(c){!c.onRun||c.disabledReason||(r(c.key),m(null),c.onRun().then(k=>{m(k),u()}).catch(k=>m(k instanceof Error?k.message:`${c.label} failed`)).finally(()=>r(null)))}function A(){const c=f.trim();c&&(r("preview"),v(null),j.previewChanges(s,c).then(k=>v(k.files.length===0?"No files would change.":`${k.files.length} file(s) would change: +${k.total_additions} / -${k.total_deletions}
43
43
 
44
44
  ${k.files.map(M=>`${M.action.padEnd(7)} ${M.path} +${M.additions} -${M.deletions}`).join(`
45
- `)}`)).catch(k=>v(k instanceof Error?k.message:"Preview failed")).finally(()=>r(null)))}return e.jsxs("section",{"aria-label":"Actions",className:"p-4 sm:p-5",children:[e.jsx("h2",{className:"text-small uppercase tracking-wide text-muted-accessible dark:text-dark-muted",children:"Actions"}),e.jsxs("label",{className:"mt-3 block",children:[e.jsx("span",{className:"text-small text-muted-accessible dark:text-dark-muted",children:"Commit / pull request title"}),e.jsx("input",{type:"text",value:x,onChange:c=>g(c.target.value),placeholder:"Describe the change",className:"mt-1 w-full rounded-btn border border-border bg-card px-2.5 py-1.5 text-caption text-ink placeholder:text-muted-accessible focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-1px] focus-visible:outline-primary dark:border-dark-border dark:bg-dark-card dark:text-dark-ink"})]}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:_.map(c=>{const k=!!c.disabledReason||l!==null,M=c.icon;return e.jsxs("button",{type:"button",onClick:()=>L(c),disabled:k,"aria-describedby":c.disabledReason?`reason-${c.key}`:void 0,className:["inline-flex items-center gap-1.5 rounded-btn border px-3 py-1.5 text-small font-semibold transition-colors motion-reduce:transition-none",c.danger?"border-danger/30 bg-danger/10 text-danger hover:bg-danger/20":"border-primary/30 text-primary hover:bg-primary/5",k?"cursor-not-allowed opacity-60":"","focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary"].join(" "),children:[e.jsx(M,{size:13}),l===c.key?"Working...":c.label]},c.key)})}),e.jsx("ul",{className:"mt-2 space-y-0.5",children:_.filter(c=>c.disabledReason).map(c=>e.jsxs("li",{id:`reason-${c.key}`,className:"text-small text-muted-accessible dark:text-dark-muted",children:[c.label,": ",c.disabledReason,"."]},c.key))}),d&&e.jsx("p",{role:"status",className:"mt-3 break-words rounded-btn bg-hover px-2.5 py-2 text-caption text-secondary dark:bg-dark-hover dark:text-dark-ink",children:d}),e.jsxs("div",{className:"mt-5 border-t border-border pt-4 dark:border-dark-border",children:[e.jsxs("h3",{className:"flex items-center gap-1.5 text-caption font-semibold text-ink dark:text-dark-ink",children:[e.jsx(Ze,{size:14,"aria-hidden":"true"}),"Request a change"]}),e.jsx("p",{className:"mt-1 text-small text-muted-accessible dark:text-dark-muted",children:"Dry run only. This shows the diff a change would produce; it does not apply anything."}),e.jsx("textarea",{value:f,onChange:c=>h(c.target.value),rows:2,placeholder:"What should be different?",className:"mt-2 w-full rounded-btn border border-border bg-card px-2.5 py-1.5 text-caption text-ink placeholder:text-muted-accessible focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-1px] focus-visible:outline-primary dark:border-dark-border dark:bg-dark-card dark:text-dark-ink"}),e.jsx("button",{type:"button",onClick:A,disabled:!f.trim()||l!==null,className:"mt-2 inline-flex items-center gap-1.5 rounded-btn border border-primary/30 px-3 py-1.5 text-small font-semibold text-primary transition-colors hover:bg-primary/5 disabled:cursor-not-allowed disabled:opacity-60 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",children:l==="preview"?"Previewing...":"Preview change"}),w&&e.jsx("pre",{className:"mt-2 max-h-56 overflow-auto rounded-btn bg-hover p-2 font-mono text-xs text-secondary dark:bg-dark-hover dark:text-dark-ink",children:w})]}),e.jsx("div",{className:"mt-5 border-t border-border pt-4 dark:border-dark-border",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Fe,{size:14,"aria-hidden":"true",className:"mt-0.5 shrink-0 text-muted-accessible dark:text-dark-muted"}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-caption font-semibold text-muted-accessible dark:text-dark-muted",children:"Approve"}),e.jsx("p",{className:"mt-1 text-small text-muted-accessible dark:text-dark-muted",children:"Not available. This API has no endpoint that approves a local run. Approval happens on the pull request once one is open."})]})]})})]})}function kt({logs:s,isLive:t}){const[n,a]=i.useState(!1),[o,u]=i.useState(!0),l=i.useRef(null);return i.useEffect(()=>{!n||!o||!l.current||(l.current.scrollTop=l.current.scrollHeight)},[s,n,o]),e.jsxs("section",{"aria-label":"Agent activity",className:"border-t border-border bg-card dark:border-dark-border dark:bg-dark-card",children:[e.jsx("h2",{children:e.jsxs("button",{type:"button",onClick:()=>a(r=>!r),"aria-expanded":n,"aria-controls":"chatter-body",className:"flex w-full items-center gap-2 px-4 py-2.5 text-left transition-colors hover:bg-hover dark:hover:bg-dark-hover sm:px-6 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-primary",children:[e.jsx(we,{size:14,"aria-hidden":"true",className:"text-muted-accessible dark:text-dark-muted"}),e.jsx("span",{className:"text-small font-semibold uppercase tracking-wide text-muted-accessible dark:text-dark-muted",children:"Agent activity"}),e.jsxs("span",{className:"text-small text-muted-accessible dark:text-dark-muted",children:[s.length," line",s.length===1?"":"s",t?", live":""]}),e.jsx(Se,{size:14,"aria-hidden":"true",className:`ml-auto text-muted-accessible transition-transform motion-reduce:transition-none dark:text-dark-muted ${n?"":"rotate-180"}`})]})}),n&&e.jsxs("div",{id:"chatter-body",children:[e.jsx("div",{className:"flex items-center justify-end px-4 pb-1 sm:px-6",children:e.jsxs("label",{className:"flex items-center gap-1.5 text-small text-muted-accessible dark:text-dark-muted",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:r=>u(r.target.checked),className:"accent-primary"}),"Follow output"]})}),e.jsx("div",{ref:l,onScroll:r=>{const d=r.currentTarget;!(d.scrollHeight-d.scrollTop-d.clientHeight<24)&&o&&u(!1)},className:"max-h-64 overflow-auto bg-hover px-4 py-2 dark:bg-dark-hover sm:px-6",children:s.length===0?e.jsx("p",{className:"py-2 text-caption text-muted-accessible dark:text-dark-muted",children:"No output recorded."}):e.jsx("pre",{className:"whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-secondary dark:text-dark-ink",children:s.join(`
45
+ `)}`)).catch(k=>v(k instanceof Error?k.message:"Preview failed")).finally(()=>r(null)))}return e.jsxs("section",{"aria-label":"Actions",className:"p-4 sm:p-5",children:[e.jsx("h2",{className:"text-small uppercase tracking-wide text-muted-accessible dark:text-dark-muted",children:"Actions"}),e.jsxs("label",{className:"mt-3 block",children:[e.jsx("span",{className:"text-small text-muted-accessible dark:text-dark-muted",children:"Commit / pull request title"}),e.jsx("input",{type:"text",value:x,onChange:c=>g(c.target.value),placeholder:"Describe the change",className:"mt-1 w-full rounded-btn border border-border bg-card px-2.5 py-1.5 text-caption text-ink placeholder:text-muted-accessible focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-1px] focus-visible:outline-primary dark:border-dark-border dark:bg-dark-card dark:text-dark-ink"})]}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:_.map(c=>{const k=!!c.disabledReason||l!==null,M=c.icon;return e.jsxs("button",{type:"button",onClick:()=>L(c),disabled:k,"aria-describedby":c.disabledReason?`reason-${c.key}`:void 0,className:["inline-flex items-center gap-1.5 rounded-btn border px-3 py-1.5 text-small font-semibold transition-colors motion-reduce:transition-none",c.danger?"border-danger/30 bg-danger/10 text-danger hover:bg-danger/20":"border-primary/30 text-primary hover:bg-primary/5",k?"cursor-not-allowed opacity-60":"","focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary"].join(" "),children:[e.jsx(M,{size:13}),l===c.key?"Working...":c.label]},c.key)})}),e.jsx("ul",{className:"mt-2 space-y-0.5",children:_.filter(c=>c.disabledReason).map(c=>e.jsxs("li",{id:`reason-${c.key}`,className:"text-small text-muted-accessible dark:text-dark-muted",children:[c.label,": ",c.disabledReason,"."]},c.key))}),d&&e.jsx("p",{role:"status",className:"mt-3 break-words rounded-btn bg-hover px-2.5 py-2 text-caption text-secondary dark:bg-dark-hover dark:text-dark-ink",children:d}),e.jsxs("div",{className:"mt-5 border-t border-border pt-4 dark:border-dark-border",children:[e.jsxs("h3",{className:"flex items-center gap-1.5 text-caption font-semibold text-ink dark:text-dark-ink",children:[e.jsx(Ze,{size:14,"aria-hidden":"true"}),"Request a change"]}),e.jsx("p",{className:"mt-1 text-small text-muted-accessible dark:text-dark-muted",children:"Dry run only. This shows the diff a change would produce; it does not apply anything."}),e.jsx("textarea",{value:f,onChange:c=>h(c.target.value),rows:2,placeholder:"What should be different?",className:"mt-2 w-full rounded-btn border border-border bg-card px-2.5 py-1.5 text-caption text-ink placeholder:text-muted-accessible focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-1px] focus-visible:outline-primary dark:border-dark-border dark:bg-dark-card dark:text-dark-ink"}),e.jsx("button",{type:"button",onClick:A,disabled:!f.trim()||l!==null,className:"mt-2 inline-flex items-center gap-1.5 rounded-btn border border-primary/30 px-3 py-1.5 text-small font-semibold text-primary transition-colors hover:bg-primary/5 disabled:cursor-not-allowed disabled:opacity-60 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",children:l==="preview"?"Previewing...":"Preview change"}),w&&e.jsx("pre",{className:"mt-2 max-h-56 overflow-auto rounded-btn bg-hover p-2 font-mono text-xs text-secondary dark:bg-dark-hover dark:text-dark-ink",children:w})]}),e.jsx("div",{className:"mt-5 border-t border-border pt-4 dark:border-dark-border",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Le,{size:14,"aria-hidden":"true",className:"mt-0.5 shrink-0 text-muted-accessible dark:text-dark-muted"}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-caption font-semibold text-muted-accessible dark:text-dark-muted",children:"Approve"}),e.jsx("p",{className:"mt-1 text-small text-muted-accessible dark:text-dark-muted",children:"Not available. This API has no endpoint that approves a local run. Approval happens on the pull request once one is open."})]})]})})]})}function kt({logs:s,isLive:t}){const[n,a]=i.useState(!1),[o,u]=i.useState(!0),l=i.useRef(null);return i.useEffect(()=>{!n||!o||!l.current||(l.current.scrollTop=l.current.scrollHeight)},[s,n,o]),e.jsxs("section",{"aria-label":"Agent activity",className:"border-t border-border bg-card dark:border-dark-border dark:bg-dark-card",children:[e.jsx("h2",{children:e.jsxs("button",{type:"button",onClick:()=>a(r=>!r),"aria-expanded":n,"aria-controls":"chatter-body",className:"flex w-full items-center gap-2 px-4 py-2.5 text-left transition-colors hover:bg-hover dark:hover:bg-dark-hover sm:px-6 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-primary",children:[e.jsx(we,{size:14,"aria-hidden":"true",className:"text-muted-accessible dark:text-dark-muted"}),e.jsx("span",{className:"text-small font-semibold uppercase tracking-wide text-muted-accessible dark:text-dark-muted",children:"Agent activity"}),e.jsxs("span",{className:"text-small text-muted-accessible dark:text-dark-muted",children:[s.length," line",s.length===1?"":"s",t?", live":""]}),e.jsx(Se,{size:14,"aria-hidden":"true",className:`ml-auto text-muted-accessible transition-transform motion-reduce:transition-none dark:text-dark-muted ${n?"":"rotate-180"}`})]})}),n&&e.jsxs("div",{id:"chatter-body",children:[e.jsx("div",{className:"flex items-center justify-end px-4 pb-1 sm:px-6",children:e.jsxs("label",{className:"flex items-center gap-1.5 text-small text-muted-accessible dark:text-dark-muted",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:r=>u(r.target.checked),className:"accent-primary"}),"Follow output"]})}),e.jsx("div",{ref:l,onScroll:r=>{const d=r.currentTarget;!(d.scrollHeight-d.scrollTop-d.clientHeight<24)&&o&&u(!1)},className:"max-h-64 overflow-auto bg-hover px-4 py-2 dark:bg-dark-hover sm:px-6",children:s.length===0?e.jsx("p",{className:"py-2 text-caption text-muted-accessible dark:text-dark-muted",children:"No output recorded."}):e.jsx("pre",{className:"whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-secondary dark:text-dark-ink",children:s.join(`
46
46
  `)})})]})]})}const se={neutral:"bg-hover text-secondary dark:bg-dark-hover dark:text-dark-ink",running:"bg-primary/10 text-primary",warning:"bg-warning/10 text-ink dark:text-dark-ink",danger:"bg-danger/10 text-danger",success:"bg-success/10 text-success"};function vt({view:s,status:t,dataAgeMs:n,stale:a}){const o=t==null?void 0:t.exit_code,u=n!==null?Math.round(n/1e3):null,l=(()=>{switch(s){case"running":return{tone:"running",Icon:W,spin:!0,text:"Running",detail:(t==null?void 0:t.current_task)||void 0};case"paused":return{tone:"warning",Icon:K,text:"Paused",detail:"Resume to continue."};case"recovering":return{tone:"warning",Icon:W,spin:!0,text:"Starting up",detail:"The process is alive but has not written any state yet."};case"failed":return{tone:"danger",Icon:G,text:"Run failed",detail:typeof o=="number"?`Process exited with code ${o}.`:void 0};case"completed":return{tone:"success",Icon:Ce,text:"Run finished"};case"disconnected":return{tone:"warning",Icon:V,text:"Disconnected",detail:u!==null?`Showing the last state received ${u}s ago. Reconnecting.`:"Showing the last state received. Reconnecting."};default:return null}})();if(!l)return null;const{Icon:r}=l,d=a&&s!=="disconnected";return e.jsxs(e.Fragment,{children:[e.jsxs("div",{role:"status",className:`flex flex-wrap items-center gap-x-2 gap-y-1 px-4 py-2 sm:px-6 ${se[l.tone]}`,children:[e.jsx(r,{size:14,className:l.spin?"animate-spin motion-reduce:animate-none":void 0}),e.jsx("span",{className:"text-caption font-semibold",children:l.text}),l.detail&&e.jsx("span",{className:"text-caption opacity-80",children:l.detail})]}),d&&e.jsxs("div",{className:`flex flex-wrap items-center gap-x-2 px-4 py-1.5 sm:px-6 ${se.warning}`,children:[e.jsx(V,{size:13,"aria-hidden":"true"}),e.jsxs("span",{className:"text-small",children:["Live updates disconnected",u!==null?`; this is the state from ${u}s ago.`:"."," ","Reconnecting."]})]})]})}function yt({status:s}){const t=(s==null?void 0:s.last_output)??[];return t.length===0?null:e.jsxs("details",{className:"border-b border-border px-4 py-2 dark:border-dark-border sm:px-6",children:[e.jsx("summary",{className:"cursor-pointer text-small font-semibold text-danger",children:"Last output before exit"}),e.jsx("pre",{className:"mt-2 max-h-48 overflow-auto rounded-btn bg-hover p-2 font-mono text-xs text-secondary dark:bg-dark-hover dark:text-dark-ink",children:t.join(`
47
- `)})]})}const jt=U(null);function Nt(s){const[t,n]=i.useState(null),[a,o]=i.useState(null),[u,l]=i.useState(null),[r,d]=i.useState(null),[m,x]=i.useState([]),[g,w]=i.useState([]),[v,f]=i.useState(!0),[h,b]=i.useState(null),[S,R]=i.useState(!0),[_,L]=i.useState(0),[A,c]=i.useState(()=>Date.now()),[k,M]=i.useState(null),z=i.useRef(null),oe=i.useRef(Date.now()),le=i.useCallback(()=>L(p=>p+1),[]);i.useEffect(()=>{if(!s)return;let p=!1;return f(!0),b(null),j.getSessionDetail(s).then(y=>{p||(n(y),w(y.logs??[]))}).catch(y=>{p||b(y instanceof Error?y.message:"Failed to load session")}).finally(()=>{p||f(!1)}),j.getStatus().then(y=>{p||(o(y),z.current=Date.now())}).catch(()=>{}),j.getChecklist().then(y=>!p&&l(y)).catch(()=>{}),j.git.status(s).then(y=>!p&&d(y)).catch(()=>{}),j.getCheckpoints(s).then(y=>!p&&x(y)).catch(()=>{}),()=>{p=!0}},[s,_]),i.useEffect(()=>{const p=new Re,y=p.on("state_update",T=>{var E;const N=T;N!=null&&N.status&&(o(N.status),z.current=Date.now()),(E=N==null?void 0:N.logs)!=null&&E.length&&w(he=>[...he,...N.logs.map(pe=>pe.message)].slice(-500))}),O=p.on("log",T=>{const N=T==null?void 0:T.line;N&&w(E=>[...E,N].slice(-500))}),H=p.on("connected",()=>R(!0)),D=p.on("disconnected",()=>R(!1));return p.connect(),()=>{y(),O(),H(),D(),p.disconnect()}},[]),i.useEffect(()=>{const p=setInterval(()=>c(Date.now()),1e3);return()=>clearInterval(p)},[]);const C=rt(a,t),de=i.useMemo(()=>U(C?a==null?void 0:a.phase:t==null?void 0:t.status),[C,a==null?void 0:a.phase,t==null?void 0:t.status]);i.useEffect(()=>{if(!C||k!==null)return;const p=(a==null?void 0:a.phase)??"";p&&p!=="idle"&&p!=="starting"&&p!=="BOOTSTRAP"&&M(Math.max(0,Math.round((Date.now()-oe.current)/1e3)))},[C,a==null?void 0:a.phase,k]);const ce=i.useMemo(()=>{var D,T,N;if(v)return"loading";if(C){if(a!=null&&a.paused)return"paused";const E=a==null?void 0:a.exit_code;return typeof E=="number"&&E!==0?"failed":(a==null?void 0:a.phase)==="starting"?"recovering":S?"running":"disconnected"}const p=((t==null?void 0:t.status)??"").toLowerCase();if(p==="failed")return"failed";if(p==="completed")return"completed";const y=!!((D=t==null?void 0:t.prd)!=null&&D.trim()),O=(((T=r==null?void 0:r.files)==null?void 0:T.length)??0)>0,H=(((N=t==null?void 0:t.files)==null?void 0:N.length)??0)>0;return!y&&!O&&!H?"empty":"completed"},[v,C,S,a,t,r]),ue=i.useMemo(()=>{if(!C||typeof(a==null?void 0:a.uptime)!="number")return null;const p=z.current?(A-z.current)/1e3:0;return Math.max(0,Math.round(a.uptime+p))},[C,a==null?void 0:a.uptime,A]),me=i.useMemo(()=>!C||z.current===null?null:A-z.current,[C,A]),xe=i.useMemo(()=>at(r==null?void 0:r.files),[r]);return{view:ce,detail:t,status:a,isLive:C,phase:de??jt,checklist:u,changedFiles:xe,git:r,checkpoints:m,logs:g,elapsedSeconds:ue,timeToFirstSignal:k,dataAgeMs:me,stale:C&&!S,error:h,reload:le}}const ne=[{keys:"g then 1",action:"Go to progress",id:"region-progress"},{keys:"g then 2",action:"Go to changes",id:"region-changes"},{keys:"g then 3",action:"Go to evidence",id:"region-evidence"},{keys:"g then 4",action:"Go to actions",id:"region-actions"},{keys:"?",action:"Toggle this list",id:""},{keys:"Esc",action:"Close this list",id:""}],P="rounded-card border border-border bg-card shadow-card dark:border-dark-border dark:bg-dark-card";function wt({sessionId:s,onClose:t}){var r,d;const n=Nt(s),[a,o]=i.useState(!1),u=i.useRef(!1);if(i.useEffect(()=>{function m(x){const g=x.target;if(!(g instanceof HTMLInputElement||g instanceof HTMLTextAreaElement||g!=null&&g.isContentEditable||x.metaKey||x.ctrlKey||x.altKey)){if(x.key==="Escape"){o(!1),u.current=!1;return}if(x.key==="?"){x.preventDefault(),o(v=>!v);return}if(x.key==="g"){u.current=!0;return}if(u.current){u.current=!1;const v=ne.find(f=>f.keys===`g then ${x.key}`);if(v!=null&&v.id){const f=document.getElementById(v.id);f&&(x.preventDefault(),f.scrollIntoView({behavior:"smooth",block:"start"}),f.focus({preventScroll:!0}))}}}}return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[]),n.error)return e.jsx("div",{className:"flex h-full items-center justify-center bg-background p-6 dark:bg-dark-bg",children:e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-caption font-semibold text-danger",children:"Could not load this session"}),e.jsx("p",{className:"mt-1 text-small text-muted-accessible dark:text-dark-muted",children:n.error}),e.jsx("button",{type:"button",onClick:n.reload,className:"mt-4 rounded-btn border border-primary/30 px-4 py-2 text-caption font-semibold text-primary hover:bg-primary/5 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",children:"Try again"})]})});if(n.view==="loading")return e.jsxs("div",{className:"h-full overflow-y-auto bg-background p-4 dark:bg-dark-bg sm:p-6",children:[e.jsx("span",{className:"sr-only",role:"status",children:"Loading the execution cockpit"}),e.jsx(I,{variant:"block",width:"60%",height:"32px"}),e.jsxs("div",{className:"mt-3 flex gap-3",children:[e.jsx(I,{variant:"text",width:"140px",height:"12px"}),e.jsx(I,{variant:"text",width:"180px",height:"12px"})]}),e.jsxs("div",{className:"mt-6 grid gap-4 xl:grid-cols-[minmax(0,22rem)_minmax(0,1fr)]",children:[e.jsx(I,{variant:"block",width:"100%",height:"260px"}),e.jsx(I,{variant:"block",width:"100%",height:"260px"})]})]});const l=n.view==="empty";return e.jsxs("div",{className:"flex h-full flex-col bg-background dark:bg-dark-bg",children:[e.jsxs("nav",{"aria-label":"Cockpit",className:"flex items-center justify-between gap-2 border-b border-border bg-card px-4 py-2 dark:border-dark-border dark:bg-dark-card sm:px-6",children:[e.jsxs("button",{type:"button",onClick:t,className:"inline-flex items-center gap-1.5 rounded-btn px-2 py-1 text-small font-semibold text-secondary transition-colors hover:bg-hover dark:text-dark-ink dark:hover:bg-dark-hover focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",children:[e.jsx(Me,{size:14,"aria-hidden":"true"}),"Back"]}),e.jsxs("button",{type:"button",onClick:()=>o(m=>!m),"aria-expanded":a,className:"inline-flex items-center gap-1.5 rounded-btn px-2 py-1 text-small text-muted-accessible transition-colors hover:bg-hover dark:text-dark-muted dark:hover:bg-dark-hover focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",children:[e.jsx(Te,{size:14,"aria-hidden":"true"}),"Shortcuts"]})]}),a&&e.jsx("div",{className:"border-b border-border bg-hover px-4 py-3 dark:border-dark-border dark:bg-dark-hover sm:px-6",children:e.jsx("dl",{className:"flex flex-wrap gap-x-6 gap-y-1",children:ne.map(m=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("dt",{children:e.jsx("kbd",{className:"rounded-btn border border-border bg-card px-1.5 py-0.5 font-mono text-xs text-ink dark:border-dark-border dark:bg-dark-card dark:text-dark-ink",children:m.keys})}),e.jsx("dd",{className:"text-small text-muted-accessible dark:text-dark-muted",children:m.action})]},m.keys))})}),e.jsx(vt,{view:n.view,status:n.status,dataAgeMs:n.dataAgeMs,stale:n.stale}),n.view==="failed"&&e.jsx(yt,{status:n.status}),e.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[e.jsx(ot,{detail:n.detail,status:n.status,git:n.git,isLive:n.isLive}),l?e.jsx("div",{className:"p-6",children:e.jsxs("div",{className:`${P} p-6 text-center`,children:[e.jsx("h2",{className:"font-heading text-h3 text-ink dark:text-dark-ink",children:"Nothing recorded yet"}),e.jsx("p",{className:"mx-auto mt-2 max-w-md text-caption text-muted-accessible dark:text-dark-muted",children:"This session has no spec, no files and no changes. Once a run starts, its phases, changed files and evidence appear here."})]})}):e.jsxs("main",{className:"grid gap-4 p-4 sm:p-6 xl:grid-cols-[minmax(0,22rem)_minmax(0,1fr)] xl:items-start",children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-1",children:[e.jsx("div",{id:"region-progress",tabIndex:-1,className:P,children:e.jsx(ct,{phase:n.phase,view:n.view,isLive:n.isLive,iteration:(r=n.status)==null?void 0:r.iteration})}),e.jsx("div",{className:P,children:e.jsx(ut,{status:n.status,isLive:n.isLive,elapsedSeconds:n.elapsedSeconds,timeToFirstSignal:n.timeToFirstSignal})}),e.jsx("div",{className:`${P} md:col-span-2 xl:col-span-1`,children:e.jsx(gt,{sessionId:s,checkpoints:n.checkpoints,changedFiles:n.changedFiles,checklist:n.checklist,isLive:n.isLive,onRestored:n.reload})})]}),e.jsxs("div",{className:"grid min-w-0 gap-4",children:[e.jsx("div",{id:"region-changes",tabIndex:-1,className:`${P} min-w-0`,children:e.jsx(ht,{sessionId:s,files:n.changedFiles,clean:((d=n.git)==null?void 0:d.clean)??n.changedFiles.length===0})}),e.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[e.jsx("div",{id:"region-evidence",tabIndex:-1,className:`${P} min-w-0`,children:e.jsx(pt,{sessionId:s,checklist:n.checklist})}),e.jsx("div",{id:"region-actions",tabIndex:-1,className:`${P} min-w-0`,children:e.jsx(bt,{sessionId:s,isLive:n.isLive,status:n.status,git:n.git,changedFiles:n.changedFiles,onChanged:n.reload})})]})]})]})]}),e.jsx(kt,{logs:n.logs,isLive:n.isLive})]})}function It(){const{sessionId:s}=$e(),t=Ee();return s?e.jsx("div",{className:"h-screen bg-background dark:bg-dark-bg",children:e.jsx(Ae,{name:"ExecutionCockpit",children:e.jsx(wt,{sessionId:s,onClose:()=>t(`/project/${s}`)})})}):e.jsx("div",{className:"flex h-screen items-center justify-center bg-background dark:bg-dark-bg",children:e.jsx("p",{className:"text-caption text-danger",children:"No session specified."})})}export{It as default};
47
+ `)})]})}const jt=U(null);function Nt(s){const[t,n]=i.useState(null),[a,o]=i.useState(null),[u,l]=i.useState(null),[r,d]=i.useState(null),[m,x]=i.useState([]),[g,w]=i.useState([]),[v,f]=i.useState(!0),[h,b]=i.useState(null),[S,R]=i.useState(!0),[_,L]=i.useState(0),[A,c]=i.useState(()=>Date.now()),[k,M]=i.useState(null),z=i.useRef(null),oe=i.useRef(Date.now()),le=i.useCallback(()=>L(p=>p+1),[]);i.useEffect(()=>{if(!s)return;let p=!1;return f(!0),b(null),j.getSessionDetail(s).then(y=>{p||(n(y),w(y.logs??[]))}).catch(y=>{p||b(y instanceof Error?y.message:"Failed to load session")}).finally(()=>{p||f(!1)}),j.getStatus().then(y=>{p||(o(y),z.current=Date.now())}).catch(()=>{}),j.getChecklist().then(y=>!p&&l(y)).catch(()=>{}),j.git.status(s).then(y=>!p&&d(y)).catch(()=>{}),j.getCheckpoints(s).then(y=>!p&&x(y)).catch(()=>{}),()=>{p=!0}},[s,_]),i.useEffect(()=>{const p=new Re,y=p.on("state_update",T=>{var E;const N=T;N!=null&&N.status&&(o(N.status),z.current=Date.now()),(E=N==null?void 0:N.logs)!=null&&E.length&&w(he=>[...he,...N.logs.map(pe=>pe.message)].slice(-500))}),O=p.on("log",T=>{const N=T==null?void 0:T.line;N&&w(E=>[...E,N].slice(-500))}),H=p.on("connected",()=>R(!0)),D=p.on("disconnected",()=>R(!1));return p.connect(),()=>{y(),O(),H(),D(),p.disconnect()}},[]),i.useEffect(()=>{const p=setInterval(()=>c(Date.now()),1e3);return()=>clearInterval(p)},[]);const C=rt(a,t),de=i.useMemo(()=>U(C?a==null?void 0:a.phase:t==null?void 0:t.status),[C,a==null?void 0:a.phase,t==null?void 0:t.status]);i.useEffect(()=>{if(!C||k!==null)return;const p=(a==null?void 0:a.phase)??"";p&&p!=="idle"&&p!=="starting"&&p!=="BOOTSTRAP"&&M(Math.max(0,Math.round((Date.now()-oe.current)/1e3)))},[C,a==null?void 0:a.phase,k]);const ce=i.useMemo(()=>{var D,T,N;if(v)return"loading";if(C){if(a!=null&&a.paused)return"paused";const E=a==null?void 0:a.exit_code;return typeof E=="number"&&E!==0?"failed":(a==null?void 0:a.phase)==="starting"?"recovering":S?"running":"disconnected"}const p=((t==null?void 0:t.status)??"").toLowerCase();if(p==="failed")return"failed";if(p==="completed")return"completed";const y=!!((D=t==null?void 0:t.prd)!=null&&D.trim()),O=(((T=r==null?void 0:r.files)==null?void 0:T.length)??0)>0,H=(((N=t==null?void 0:t.files)==null?void 0:N.length)??0)>0;return!y&&!O&&!H?"empty":"completed"},[v,C,S,a,t,r]),ue=i.useMemo(()=>{if(!C||typeof(a==null?void 0:a.uptime)!="number")return null;const p=z.current?(A-z.current)/1e3:0;return Math.max(0,Math.round(a.uptime+p))},[C,a==null?void 0:a.uptime,A]),me=i.useMemo(()=>!C||z.current===null?null:A-z.current,[C,A]),xe=i.useMemo(()=>at(r==null?void 0:r.files),[r]);return{view:ce,detail:t,status:a,isLive:C,phase:de??jt,checklist:u,changedFiles:xe,git:r,checkpoints:m,logs:g,elapsedSeconds:ue,timeToFirstSignal:k,dataAgeMs:me,stale:C&&!S,error:h,reload:le}}const ne=[{keys:"g then 1",action:"Go to progress",id:"region-progress"},{keys:"g then 2",action:"Go to changes",id:"region-changes"},{keys:"g then 3",action:"Go to evidence",id:"region-evidence"},{keys:"g then 4",action:"Go to actions",id:"region-actions"},{keys:"?",action:"Toggle this list",id:""},{keys:"Esc",action:"Close this list",id:""}],P="rounded-card border border-border bg-card shadow-card dark:border-dark-border dark:bg-dark-card";function wt({sessionId:s,onClose:t}){var r,d;const n=Nt(s),[a,o]=i.useState(!1),u=i.useRef(!1);if(i.useEffect(()=>{function m(x){const g=x.target;if(!(g instanceof HTMLInputElement||g instanceof HTMLTextAreaElement||g!=null&&g.isContentEditable||x.metaKey||x.ctrlKey||x.altKey)){if(x.key==="Escape"){o(!1),u.current=!1;return}if(x.key==="?"){x.preventDefault(),o(v=>!v);return}if(x.key==="g"){u.current=!0;return}if(u.current){u.current=!1;const v=ne.find(f=>f.keys===`g then ${x.key}`);if(v!=null&&v.id){const f=document.getElementById(v.id);f&&(x.preventDefault(),f.scrollIntoView({behavior:"smooth",block:"start"}),f.focus({preventScroll:!0}))}}}}return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[]),n.error)return e.jsx("div",{className:"flex h-full items-center justify-center bg-background p-6 dark:bg-dark-bg",children:e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-caption font-semibold text-danger",children:"Could not load this session"}),e.jsx("p",{className:"mt-1 text-small text-muted-accessible dark:text-dark-muted",children:n.error}),e.jsx("button",{type:"button",onClick:n.reload,className:"mt-4 rounded-btn border border-primary/30 px-4 py-2 text-caption font-semibold text-primary hover:bg-primary/5 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",children:"Try again"})]})});if(n.view==="loading")return e.jsxs("div",{className:"h-full overflow-y-auto bg-background p-4 dark:bg-dark-bg sm:p-6",children:[e.jsx("span",{className:"sr-only",role:"status",children:"Loading the execution cockpit"}),e.jsx(I,{variant:"block",width:"60%",height:"32px"}),e.jsxs("div",{className:"mt-3 flex gap-3",children:[e.jsx(I,{variant:"text",width:"140px",height:"12px"}),e.jsx(I,{variant:"text",width:"180px",height:"12px"})]}),e.jsxs("div",{className:"mt-6 grid gap-4 xl:grid-cols-[minmax(0,22rem)_minmax(0,1fr)]",children:[e.jsx(I,{variant:"block",width:"100%",height:"260px"}),e.jsx(I,{variant:"block",width:"100%",height:"260px"})]})]});const l=n.view==="empty";return e.jsxs("div",{className:"flex h-full flex-col bg-background dark:bg-dark-bg",children:[e.jsxs("nav",{"aria-label":"Cockpit",className:"flex items-center justify-between gap-2 border-b border-border bg-card px-4 py-2 dark:border-dark-border dark:bg-dark-card sm:px-6",children:[e.jsxs("button",{type:"button",onClick:t,className:"inline-flex items-center gap-1.5 rounded-btn px-2 py-1 text-small font-semibold text-secondary transition-colors hover:bg-hover dark:text-dark-ink dark:hover:bg-dark-hover focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",children:[e.jsx(Me,{size:14,"aria-hidden":"true"}),"Back"]}),e.jsxs("button",{type:"button",onClick:()=>o(m=>!m),"aria-expanded":a,className:"inline-flex items-center gap-1.5 rounded-btn px-2 py-1 text-small text-muted-accessible transition-colors hover:bg-hover dark:text-dark-muted dark:hover:bg-dark-hover focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",children:[e.jsx(Te,{size:14,"aria-hidden":"true"}),"Shortcuts"]})]}),a&&e.jsx("div",{className:"border-b border-border bg-hover px-4 py-3 dark:border-dark-border dark:bg-dark-hover sm:px-6",children:e.jsx("dl",{className:"flex flex-wrap gap-x-6 gap-y-1",children:ne.map(m=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("dt",{children:e.jsx("kbd",{className:"rounded-btn border border-border bg-card px-1.5 py-0.5 font-mono text-xs text-ink dark:border-dark-border dark:bg-dark-card dark:text-dark-ink",children:m.keys})}),e.jsx("dd",{className:"text-small text-muted-accessible dark:text-dark-muted",children:m.action})]},m.keys))})}),e.jsx(vt,{view:n.view,status:n.status,dataAgeMs:n.dataAgeMs,stale:n.stale}),n.view==="failed"&&e.jsx(yt,{status:n.status}),e.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[e.jsx(ot,{detail:n.detail,status:n.status,git:n.git,isLive:n.isLive}),l?e.jsx("div",{className:"p-6",children:e.jsxs("div",{className:`${P} p-6 text-center`,children:[e.jsx("h2",{className:"font-heading text-h3 text-ink dark:text-dark-ink",children:"Nothing recorded yet"}),e.jsx("p",{className:"mx-auto mt-2 max-w-md text-caption text-muted-accessible dark:text-dark-muted",children:"This session has no spec, no files and no changes. Once a run starts, its phases, changed files and evidence appear here."})]})}):e.jsxs("main",{className:"grid gap-4 p-4 sm:p-6 xl:grid-cols-[minmax(0,22rem)_minmax(0,1fr)] xl:items-start",children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-1",children:[e.jsx("div",{id:"region-progress",tabIndex:-1,className:P,children:e.jsx(ct,{phase:n.phase,view:n.view,isLive:n.isLive,iteration:(r=n.status)==null?void 0:r.iteration})}),e.jsx("div",{className:P,children:e.jsx(ut,{status:n.status,isLive:n.isLive,elapsedSeconds:n.elapsedSeconds,timeToFirstSignal:n.timeToFirstSignal})}),e.jsx("div",{className:`${P} md:col-span-2 xl:col-span-1`,children:e.jsx(gt,{sessionId:s,checkpoints:n.checkpoints,changedFiles:n.changedFiles,checklist:n.checklist,isLive:n.isLive,onRestored:n.reload})})]}),e.jsxs("div",{className:"grid min-w-0 gap-4",children:[e.jsx("div",{id:"region-changes",tabIndex:-1,className:`${P} min-w-0`,children:e.jsx(ht,{sessionId:s,files:n.changedFiles,clean:((d=n.git)==null?void 0:d.clean)??n.changedFiles.length===0})}),e.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[e.jsx("div",{id:"region-evidence",tabIndex:-1,className:`${P} min-w-0`,children:e.jsx(pt,{sessionId:s,checklist:n.checklist})}),e.jsx("div",{id:"region-actions",tabIndex:-1,className:`${P} min-w-0`,children:e.jsx(bt,{sessionId:s,isLive:n.isLive,status:n.status,git:n.git,changedFiles:n.changedFiles,onChanged:n.reload})})]})]})]})]}),e.jsx(kt,{logs:n.logs,isLive:n.isLive})]})}function zt(){const{sessionId:s}=$e(),t=Ee();return s?e.jsx("div",{className:"h-screen bg-background dark:bg-dark-bg",children:e.jsx(Ae,{name:"ExecutionCockpit",children:e.jsx(wt,{sessionId:s,onClose:()=>t(`/project/${s}`)})})}):e.jsx("div",{className:"flex h-screen items-center justify-center bg-background dark:bg-dark-bg",children:e.jsx("p",{className:"text-caption text-danger",children:"No session specified."})})}export{zt as default};
@@ -1 +1 @@
1
- import{r as i,j as e}from"./index-BMmYYws0.js";function p({value:r,prefix:t="",suffix:s=""}){const[n,a]=i.useState(0),o=i.useRef(0);return i.useEffect(()=>{const c=o.current,d=r-c;if(d===0)return;const x=600,h=performance.now();function u(l){const b=l-h,f=Math.min(b/x,1),g=1-Math.pow(1-f,3),j=Math.round(c+d*g);a(j),o.current=j,f<1&&requestAnimationFrame(u)}requestAnimationFrame(u)},[r]),e.jsxs("span",{className:"tabular-nums",children:[t,n.toLocaleString(),s]})}function N(){const[r,t]=i.useState(5),[s,n]=i.useState(30),[a,o]=i.useState(75),x=Math.round(r*s*.4*4.33),h=Math.round(x*a),u=1/0;return e.jsxs("div",{className:"bg-white border border-[#ECEAE3] rounded-xl p-6 shadow-sm",children:[e.jsx("h3",{className:"text-lg font-bold text-[#36342E] mb-1",children:"ROI Calculator"}),e.jsx("p",{className:"text-sm text-[#6B6960] mb-6",children:"Estimate how much your team could save with autonomous development."}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"text-sm font-medium text-[#36342E]",children:"Team size"}),e.jsxs("span",{className:"text-sm font-semibold text-[#553DE9] tabular-nums",children:[r," developers"]})]}),e.jsx("input",{type:"range",min:1,max:50,value:r,onChange:l=>t(Number(l.target.value)),className:"w-full h-2 bg-[#ECEAE3] rounded-full appearance-none cursor-pointer accent-[#553DE9]"}),e.jsxs("div",{className:"flex justify-between text-xs text-[#939084] mt-1",children:[e.jsx("span",{children:"1"}),e.jsx("span",{children:"50"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"text-sm font-medium text-[#36342E]",children:"Hours coding per week"}),e.jsxs("span",{className:"text-sm font-semibold text-[#553DE9] tabular-nums",children:[s,"h"]})]}),e.jsx("input",{type:"range",min:5,max:60,value:s,onChange:l=>n(Number(l.target.value)),className:"w-full h-2 bg-[#ECEAE3] rounded-full appearance-none cursor-pointer accent-[#553DE9]"}),e.jsxs("div",{className:"flex justify-between text-xs text-[#939084] mt-1",children:[e.jsx("span",{children:"5h"}),e.jsx("span",{children:"60h"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"text-sm font-medium text-[#36342E]",children:"Average hourly rate"}),e.jsxs("span",{className:"text-sm font-semibold text-[#553DE9] tabular-nums",children:["$",a,"/hr"]})]}),e.jsx("input",{type:"range",min:25,max:250,step:5,value:a,onChange:l=>o(Number(l.target.value)),className:"w-full h-2 bg-[#ECEAE3] rounded-full appearance-none cursor-pointer accent-[#553DE9]"}),e.jsxs("div",{className:"flex justify-between text-xs text-[#939084] mt-1",children:[e.jsx("span",{children:"$25"}),e.jsx("span",{children:"$250"})]})]})]}),e.jsxs("div",{className:"mt-6 pt-6 border-t border-[#ECEAE3]",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4 text-center",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-2xl font-bold text-[#553DE9]",children:e.jsx(p,{value:x,suffix:"h"})}),e.jsx("div",{className:"text-xs text-[#6B6960] mt-1",children:"Hours saved / month"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-2xl font-bold text-[#1FC5A8]",children:e.jsx(p,{value:h,prefix:"$"})}),e.jsx("div",{className:"text-xs text-[#6B6960] mt-1",children:"Cost saved / month"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-2xl font-bold text-[#36342E]",children:u===1/0?"Free":e.jsx(p,{value:u,suffix:"%"})}),e.jsx("div",{className:"text-xs text-[#6B6960] mt-1",children:"ROI (self-hosted)"})]})]}),e.jsx("div",{className:"mt-4 p-3 rounded-lg bg-[#553DE9]/5 border border-[#553DE9]/10",children:e.jsxs("p",{className:"text-sm text-[#36342E] text-center",children:["With Loki Mode, your team could save"," ",e.jsxs("span",{className:"font-bold text-[#553DE9]",children:[x.toLocaleString()," hours"]})," ","and"," ",e.jsxs("span",{className:"font-bold text-[#1FC5A8]",children:["$",h.toLocaleString()]})," ","per month."]})})]})]})}function y({count:r=5}){return e.jsx("div",{className:"flex gap-0.5",children:Array.from({length:r}).map((t,s)=>e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"#553DE9",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"})},s))})}function w(){return e.jsx("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-[#553DE9]/15",children:e.jsx("path",{d:"M3 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1zm12 0c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z",fill:"currentColor"})})}function k({quote:r,name:t,role:s,company:n,avatar:a,rating:o=5}){const c=t.split(" ").map(d=>d[0]).join("").toUpperCase().slice(0,2);return e.jsxs("div",{className:"bg-white border border-[#ECEAE3] rounded-xl p-6 flex flex-col gap-4 shadow-sm hover:shadow-md transition-shadow",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx(w,{}),e.jsx(y,{count:o})]}),e.jsxs("p",{className:"text-[#36342E] text-sm leading-relaxed flex-1",children:['"',r,'"']}),e.jsxs("div",{className:"flex items-center gap-3 pt-2 border-t border-[#ECEAE3]",children:[a?e.jsx("img",{src:a,alt:"",className:"w-10 h-10 rounded-full object-cover"}):e.jsx("div",{className:"w-10 h-10 rounded-full bg-gradient-to-br from-[#553DE9] to-[#7B6BEF] flex items-center justify-center text-white text-sm font-bold flex-shrink-0",children:c}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-[#36342E]",children:t}),e.jsxs("p",{className:"text-xs text-[#6B6960]",children:[s,", ",n]})]})]})]})}const E=[{quote:"Loki Mode turned a weekend project into a production app in 45 minutes. The RARV cycle caught bugs I would have shipped. Easily 10x faster than writing everything by hand.",name:"Sarah Chen",role:"Full-Stack Developer",company:"Nimbus Labs"},{quote:"The quality gates are what sold me. Three blind reviewers, anti-sycophancy checks, severity blocking -- it catches issues that even our senior engineers miss in code review.",name:"Marcus Rivera",role:"CTO",company:"Forgepoint Systems"},{quote:"As a solo founder, Loki Mode is like having a senior engineering team on demand. I shipped our MVP in a day instead of two weeks. The autonomous iteration is the real game changer.",name:"Priya Sharma",role:"Founder",company:"Seedcraft"},{quote:"Self-hosted, no data leaves our network, and the multi-provider failover means we never hit rate limits. Exactly what our compliance team needed. Enterprise-ready out of the box.",name:"Daniel Okafor",role:"DevOps Lead",company:"Vaultline Security"}],v=[{feature:"Claude (Opus/Sonnet/Haiku)",category:"AI Models",lokiMode:!0,boltNew:!1,replit:!1,lovable:!0},{feature:"GPT-4o / Codex",category:"AI Models",lokiMode:!0,boltNew:!0,replit:!0,lovable:!1},{feature:"Gemini",category:"AI Models",lokiMode:!0,boltNew:!1,replit:!0,lovable:!1},{feature:"5-provider auto-failover",category:"AI Models",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"9 automated quality gates",category:"Quality",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"Blind 3-reviewer code review",category:"Quality",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"Anti-sycophancy checks",category:"Quality",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"Automated test generation",category:"Quality",lokiMode:!0,boltNew:!1,replit:"Partial",lovable:!1},{feature:"Docker container generation",category:"Deployment",lokiMode:!0,boltNew:!1,replit:!0,lovable:!1},{feature:"CI/CD pipeline generation",category:"Deployment",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"One-click cloud deploy",category:"Deployment",lokiMode:"Planned",boltNew:!0,replit:!0,lovable:!0},{feature:"Self-hosted (your keys)",category:"Cost",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"Free tier available",category:"Cost",lokiMode:"Source-available (BUSL-1.1)",boltNew:!0,replit:!0,lovable:!0},{feature:"No vendor lock-in",category:"Cost",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"SSO / OIDC authentication",category:"Enterprise",lokiMode:!0,boltNew:!1,replit:!0,lovable:!1},{feature:"RBAC access control",category:"Enterprise",lokiMode:!0,boltNew:!1,replit:!0,lovable:!1},{feature:"Audit logging",category:"Enterprise",lokiMode:!0,boltNew:!1,replit:!0,lovable:!1},{feature:"Air-gapped deployment",category:"Enterprise",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1}];function C(){return e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",className:"text-[#1FC5A8]",children:e.jsx("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function M(){return e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",className:"text-[#C45B5B]/40",children:e.jsx("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function m({value:r}){return typeof r=="string"?e.jsx("span",{className:"text-xs text-[#6B6960] font-medium",children:r}):r?e.jsx(C,{}):e.jsx(M,{})}const A=[{title:"Full Autonomy",description:"Describe what you want. Loki Mode handles planning, coding, testing, and verification automatically.",icon:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"text-[#553DE9]",children:e.jsx("path",{d:"M13 2L3 14h9l-1 8 10-12h-9l1-8z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},{title:"Production Quality",description:"9 quality gates, blind code review, and anti-sycophancy checks ensure code that actually works.",icon:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"text-[#1FC5A8]",children:e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},{title:"Your Infrastructure",description:"Self-hosted, source-available (BUSL-1.1), no data leaves your network. Use your own API keys across 5 providers.",icon:e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"text-[#2F71E3]",children:[e.jsx("rect",{x:"2",y:"2",width:"20",height:"8",rx:"2",stroke:"currentColor",strokeWidth:"2"}),e.jsx("rect",{x:"2",y:"14",width:"20",height:"8",rx:"2",stroke:"currentColor",strokeWidth:"2"}),e.jsx("circle",{cx:"6",cy:"6",r:"1",fill:"currentColor"}),e.jsx("circle",{cx:"6",cy:"18",r:"1",fill:"currentColor"})]})},{title:"Built for Teams",description:"Enterprise auth, RBAC, audit logs, and parallel workflows for teams of any size.",icon:e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"text-[#E93D82]",children:[e.jsx("path",{d:"M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"9",cy:"7",r:"4",stroke:"currentColor",strokeWidth:"2"}),e.jsx("path",{d:"M23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}];function S(){const r=[...new Set(v.map(t=>t.category))];return e.jsx("div",{className:"min-h-screen bg-[#FAF9F6]",children:e.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-2xl font-bold text-[#36342E]",children:"Compare"}),e.jsx("p",{className:"text-[#6B6960] mt-1",children:"See how Loki Mode stacks up against other AI development platforms."})]}),e.jsx("div",{className:"bg-white border border-[#ECEAE3] rounded-xl overflow-hidden shadow-sm",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[#ECEAE3]",children:[e.jsx("th",{className:"text-left px-4 py-3 font-medium text-[#6B6960] w-[240px]",children:"Feature"}),e.jsx("th",{className:"text-center px-4 py-3 font-bold text-[#553DE9] bg-[#553DE9]/5 w-[130px]",children:"Loki Mode"}),e.jsx("th",{className:"text-center px-4 py-3 font-medium text-[#6B6960] w-[130px]",children:"bolt.new"}),e.jsx("th",{className:"text-center px-4 py-3 font-medium text-[#6B6960] w-[130px]",children:"Replit"}),e.jsx("th",{className:"text-center px-4 py-3 font-medium text-[#6B6960] w-[130px]",children:"Lovable"})]})}),e.jsx("tbody",{children:r.map(t=>e.jsxs(e.Fragment,{children:[e.jsx("tr",{className:"bg-[#FAF9F6]",children:e.jsx("td",{colSpan:5,className:"px-4 py-2 text-xs font-bold text-[#939084] uppercase tracking-wider",children:t})},`cat-${t}`),v.filter(s=>s.category===t).map(s=>e.jsxs("tr",{className:"border-b border-[#ECEAE3] last:border-b-0",children:[e.jsx("td",{className:"px-4 py-2.5 text-[#36342E]",children:s.feature}),e.jsx("td",{className:"px-4 py-2.5 text-center bg-[#553DE9]/5",children:e.jsx("div",{className:"flex justify-center",children:e.jsx(m,{value:s.lokiMode})})}),e.jsx("td",{className:"px-4 py-2.5 text-center",children:e.jsx("div",{className:"flex justify-center",children:e.jsx(m,{value:s.boltNew})})}),e.jsx("td",{className:"px-4 py-2.5 text-center",children:e.jsx("div",{className:"flex justify-center",children:e.jsx(m,{value:s.replit})})}),e.jsx("td",{className:"px-4 py-2.5 text-center",children:e.jsx("div",{className:"flex justify-center",children:e.jsx(m,{value:s.lovable})})})]},s.feature))]}))})]})})}),e.jsxs("div",{className:"mt-12",children:[e.jsx("h2",{className:"text-xl font-bold text-[#36342E] mb-6",children:"Why developers choose Loki Mode"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:A.map(t=>e.jsxs("div",{className:"bg-white border border-[#ECEAE3] rounded-xl p-5 shadow-sm hover:shadow-md transition-shadow",children:[e.jsx("div",{className:"mb-3",children:t.icon}),e.jsx("h3",{className:"text-base font-bold text-[#36342E] mb-1",children:t.title}),e.jsx("p",{className:"text-sm text-[#6B6960]",children:t.description})]},t.title))})]}),e.jsxs("div",{className:"mt-12",children:[e.jsx("h2",{className:"text-xl font-bold text-[#36342E] mb-6",children:"What developers are saying"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:E.map(t=>e.jsx(k,{...t},t.name))})]}),e.jsx("div",{className:"mt-12 max-w-xl mx-auto",children:e.jsx(N,{})})]})})}export{S as default};
1
+ import{r as i,j as e}from"./index-Cu-njJ8o.js";function p({value:r,prefix:t="",suffix:s=""}){const[n,a]=i.useState(0),o=i.useRef(0);return i.useEffect(()=>{const c=o.current,d=r-c;if(d===0)return;const x=600,h=performance.now();function u(l){const b=l-h,f=Math.min(b/x,1),g=1-Math.pow(1-f,3),j=Math.round(c+d*g);a(j),o.current=j,f<1&&requestAnimationFrame(u)}requestAnimationFrame(u)},[r]),e.jsxs("span",{className:"tabular-nums",children:[t,n.toLocaleString(),s]})}function N(){const[r,t]=i.useState(5),[s,n]=i.useState(30),[a,o]=i.useState(75),x=Math.round(r*s*.4*4.33),h=Math.round(x*a),u=1/0;return e.jsxs("div",{className:"bg-white border border-[#ECEAE3] rounded-xl p-6 shadow-sm",children:[e.jsx("h3",{className:"text-lg font-bold text-[#36342E] mb-1",children:"ROI Calculator"}),e.jsx("p",{className:"text-sm text-[#6B6960] mb-6",children:"Estimate how much your team could save with autonomous development."}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"text-sm font-medium text-[#36342E]",children:"Team size"}),e.jsxs("span",{className:"text-sm font-semibold text-[#553DE9] tabular-nums",children:[r," developers"]})]}),e.jsx("input",{type:"range",min:1,max:50,value:r,onChange:l=>t(Number(l.target.value)),className:"w-full h-2 bg-[#ECEAE3] rounded-full appearance-none cursor-pointer accent-[#553DE9]"}),e.jsxs("div",{className:"flex justify-between text-xs text-[#939084] mt-1",children:[e.jsx("span",{children:"1"}),e.jsx("span",{children:"50"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"text-sm font-medium text-[#36342E]",children:"Hours coding per week"}),e.jsxs("span",{className:"text-sm font-semibold text-[#553DE9] tabular-nums",children:[s,"h"]})]}),e.jsx("input",{type:"range",min:5,max:60,value:s,onChange:l=>n(Number(l.target.value)),className:"w-full h-2 bg-[#ECEAE3] rounded-full appearance-none cursor-pointer accent-[#553DE9]"}),e.jsxs("div",{className:"flex justify-between text-xs text-[#939084] mt-1",children:[e.jsx("span",{children:"5h"}),e.jsx("span",{children:"60h"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"text-sm font-medium text-[#36342E]",children:"Average hourly rate"}),e.jsxs("span",{className:"text-sm font-semibold text-[#553DE9] tabular-nums",children:["$",a,"/hr"]})]}),e.jsx("input",{type:"range",min:25,max:250,step:5,value:a,onChange:l=>o(Number(l.target.value)),className:"w-full h-2 bg-[#ECEAE3] rounded-full appearance-none cursor-pointer accent-[#553DE9]"}),e.jsxs("div",{className:"flex justify-between text-xs text-[#939084] mt-1",children:[e.jsx("span",{children:"$25"}),e.jsx("span",{children:"$250"})]})]})]}),e.jsxs("div",{className:"mt-6 pt-6 border-t border-[#ECEAE3]",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4 text-center",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-2xl font-bold text-[#553DE9]",children:e.jsx(p,{value:x,suffix:"h"})}),e.jsx("div",{className:"text-xs text-[#6B6960] mt-1",children:"Hours saved / month"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-2xl font-bold text-[#1FC5A8]",children:e.jsx(p,{value:h,prefix:"$"})}),e.jsx("div",{className:"text-xs text-[#6B6960] mt-1",children:"Cost saved / month"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-2xl font-bold text-[#36342E]",children:u===1/0?"Free":e.jsx(p,{value:u,suffix:"%"})}),e.jsx("div",{className:"text-xs text-[#6B6960] mt-1",children:"ROI (self-hosted)"})]})]}),e.jsx("div",{className:"mt-4 p-3 rounded-lg bg-[#553DE9]/5 border border-[#553DE9]/10",children:e.jsxs("p",{className:"text-sm text-[#36342E] text-center",children:["With Loki Mode, your team could save"," ",e.jsxs("span",{className:"font-bold text-[#553DE9]",children:[x.toLocaleString()," hours"]})," ","and"," ",e.jsxs("span",{className:"font-bold text-[#1FC5A8]",children:["$",h.toLocaleString()]})," ","per month."]})})]})]})}function y({count:r=5}){return e.jsx("div",{className:"flex gap-0.5",children:Array.from({length:r}).map((t,s)=>e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"#553DE9",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"})},s))})}function w(){return e.jsx("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-[#553DE9]/15",children:e.jsx("path",{d:"M3 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1zm12 0c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z",fill:"currentColor"})})}function k({quote:r,name:t,role:s,company:n,avatar:a,rating:o=5}){const c=t.split(" ").map(d=>d[0]).join("").toUpperCase().slice(0,2);return e.jsxs("div",{className:"bg-white border border-[#ECEAE3] rounded-xl p-6 flex flex-col gap-4 shadow-sm hover:shadow-md transition-shadow",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx(w,{}),e.jsx(y,{count:o})]}),e.jsxs("p",{className:"text-[#36342E] text-sm leading-relaxed flex-1",children:['"',r,'"']}),e.jsxs("div",{className:"flex items-center gap-3 pt-2 border-t border-[#ECEAE3]",children:[a?e.jsx("img",{src:a,alt:"",className:"w-10 h-10 rounded-full object-cover"}):e.jsx("div",{className:"w-10 h-10 rounded-full bg-gradient-to-br from-[#553DE9] to-[#7B6BEF] flex items-center justify-center text-white text-sm font-bold flex-shrink-0",children:c}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-[#36342E]",children:t}),e.jsxs("p",{className:"text-xs text-[#6B6960]",children:[s,", ",n]})]})]})]})}const E=[{quote:"Loki Mode turned a weekend project into a production app in 45 minutes. The RARV cycle caught bugs I would have shipped. Easily 10x faster than writing everything by hand.",name:"Sarah Chen",role:"Full-Stack Developer",company:"Nimbus Labs"},{quote:"The quality gates are what sold me. Three blind reviewers, anti-sycophancy checks, severity blocking -- it catches issues that even our senior engineers miss in code review.",name:"Marcus Rivera",role:"CTO",company:"Forgepoint Systems"},{quote:"As a solo founder, Loki Mode is like having a senior engineering team on demand. I shipped our MVP in a day instead of two weeks. The autonomous iteration is the real game changer.",name:"Priya Sharma",role:"Founder",company:"Seedcraft"},{quote:"Self-hosted, no data leaves our network, and the multi-provider failover means we never hit rate limits. Exactly what our compliance team needed. Enterprise-ready out of the box.",name:"Daniel Okafor",role:"DevOps Lead",company:"Vaultline Security"}],v=[{feature:"Claude (Opus/Sonnet/Haiku)",category:"AI Models",lokiMode:!0,boltNew:!1,replit:!1,lovable:!0},{feature:"GPT-4o / Codex",category:"AI Models",lokiMode:!0,boltNew:!0,replit:!0,lovable:!1},{feature:"Gemini",category:"AI Models",lokiMode:!0,boltNew:!1,replit:!0,lovable:!1},{feature:"5-provider auto-failover",category:"AI Models",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"9 automated quality gates",category:"Quality",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"Blind 3-reviewer code review",category:"Quality",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"Anti-sycophancy checks",category:"Quality",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"Automated test generation",category:"Quality",lokiMode:!0,boltNew:!1,replit:"Partial",lovable:!1},{feature:"Docker container generation",category:"Deployment",lokiMode:!0,boltNew:!1,replit:!0,lovable:!1},{feature:"CI/CD pipeline generation",category:"Deployment",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"One-click cloud deploy",category:"Deployment",lokiMode:"Planned",boltNew:!0,replit:!0,lovable:!0},{feature:"Self-hosted (your keys)",category:"Cost",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"Free tier available",category:"Cost",lokiMode:"Source-available (BUSL-1.1)",boltNew:!0,replit:!0,lovable:!0},{feature:"No vendor lock-in",category:"Cost",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1},{feature:"SSO / OIDC authentication",category:"Enterprise",lokiMode:!0,boltNew:!1,replit:!0,lovable:!1},{feature:"RBAC access control",category:"Enterprise",lokiMode:!0,boltNew:!1,replit:!0,lovable:!1},{feature:"Audit logging",category:"Enterprise",lokiMode:!0,boltNew:!1,replit:!0,lovable:!1},{feature:"Air-gapped deployment",category:"Enterprise",lokiMode:!0,boltNew:!1,replit:!1,lovable:!1}];function C(){return e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",className:"text-[#1FC5A8]",children:e.jsx("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function M(){return e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",className:"text-[#C45B5B]/40",children:e.jsx("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function m({value:r}){return typeof r=="string"?e.jsx("span",{className:"text-xs text-[#6B6960] font-medium",children:r}):r?e.jsx(C,{}):e.jsx(M,{})}const A=[{title:"Full Autonomy",description:"Describe what you want. Loki Mode handles planning, coding, testing, and verification automatically.",icon:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"text-[#553DE9]",children:e.jsx("path",{d:"M13 2L3 14h9l-1 8 10-12h-9l1-8z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},{title:"Production Quality",description:"9 quality gates, blind code review, and anti-sycophancy checks ensure code that actually works.",icon:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"text-[#1FC5A8]",children:e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},{title:"Your Infrastructure",description:"Self-hosted, source-available (BUSL-1.1), no data leaves your network. Use your own API keys across 5 providers.",icon:e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"text-[#2F71E3]",children:[e.jsx("rect",{x:"2",y:"2",width:"20",height:"8",rx:"2",stroke:"currentColor",strokeWidth:"2"}),e.jsx("rect",{x:"2",y:"14",width:"20",height:"8",rx:"2",stroke:"currentColor",strokeWidth:"2"}),e.jsx("circle",{cx:"6",cy:"6",r:"1",fill:"currentColor"}),e.jsx("circle",{cx:"6",cy:"18",r:"1",fill:"currentColor"})]})},{title:"Built for Teams",description:"Enterprise auth, RBAC, audit logs, and parallel workflows for teams of any size.",icon:e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"text-[#E93D82]",children:[e.jsx("path",{d:"M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"9",cy:"7",r:"4",stroke:"currentColor",strokeWidth:"2"}),e.jsx("path",{d:"M23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}];function S(){const r=[...new Set(v.map(t=>t.category))];return e.jsx("div",{className:"min-h-screen bg-[#FAF9F6]",children:e.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-2xl font-bold text-[#36342E]",children:"Compare"}),e.jsx("p",{className:"text-[#6B6960] mt-1",children:"See how Loki Mode stacks up against other AI development platforms."})]}),e.jsx("div",{className:"bg-white border border-[#ECEAE3] rounded-xl overflow-hidden shadow-sm",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[#ECEAE3]",children:[e.jsx("th",{className:"text-left px-4 py-3 font-medium text-[#6B6960] w-[240px]",children:"Feature"}),e.jsx("th",{className:"text-center px-4 py-3 font-bold text-[#553DE9] bg-[#553DE9]/5 w-[130px]",children:"Loki Mode"}),e.jsx("th",{className:"text-center px-4 py-3 font-medium text-[#6B6960] w-[130px]",children:"bolt.new"}),e.jsx("th",{className:"text-center px-4 py-3 font-medium text-[#6B6960] w-[130px]",children:"Replit"}),e.jsx("th",{className:"text-center px-4 py-3 font-medium text-[#6B6960] w-[130px]",children:"Lovable"})]})}),e.jsx("tbody",{children:r.map(t=>e.jsxs(e.Fragment,{children:[e.jsx("tr",{className:"bg-[#FAF9F6]",children:e.jsx("td",{colSpan:5,className:"px-4 py-2 text-xs font-bold text-[#939084] uppercase tracking-wider",children:t})},`cat-${t}`),v.filter(s=>s.category===t).map(s=>e.jsxs("tr",{className:"border-b border-[#ECEAE3] last:border-b-0",children:[e.jsx("td",{className:"px-4 py-2.5 text-[#36342E]",children:s.feature}),e.jsx("td",{className:"px-4 py-2.5 text-center bg-[#553DE9]/5",children:e.jsx("div",{className:"flex justify-center",children:e.jsx(m,{value:s.lokiMode})})}),e.jsx("td",{className:"px-4 py-2.5 text-center",children:e.jsx("div",{className:"flex justify-center",children:e.jsx(m,{value:s.boltNew})})}),e.jsx("td",{className:"px-4 py-2.5 text-center",children:e.jsx("div",{className:"flex justify-center",children:e.jsx(m,{value:s.replit})})}),e.jsx("td",{className:"px-4 py-2.5 text-center",children:e.jsx("div",{className:"flex justify-center",children:e.jsx(m,{value:s.lovable})})})]},s.feature))]}))})]})})}),e.jsxs("div",{className:"mt-12",children:[e.jsx("h2",{className:"text-xl font-bold text-[#36342E] mb-6",children:"Why developers choose Loki Mode"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:A.map(t=>e.jsxs("div",{className:"bg-white border border-[#ECEAE3] rounded-xl p-5 shadow-sm hover:shadow-md transition-shadow",children:[e.jsx("div",{className:"mb-3",children:t.icon}),e.jsx("h3",{className:"text-base font-bold text-[#36342E] mb-1",children:t.title}),e.jsx("p",{className:"text-sm text-[#6B6960]",children:t.description})]},t.title))})]}),e.jsxs("div",{className:"mt-12",children:[e.jsx("h2",{className:"text-xl font-bold text-[#36342E] mb-6",children:"What developers are saying"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:E.map(t=>e.jsx(k,{...t},t.name))})]}),e.jsx("div",{className:"mt-12 max-w-xl mx-auto",children:e.jsx(N,{})})]})})}export{S as default};
@@ -1,4 +1,4 @@
1
- import{c as o,r as a,j as e,T as n,i,b as c}from"./index-BMmYYws0.js";/**
1
+ import{c as o,r as a,j as e,T as n,i,b as 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.
@@ -1 +1 @@
1
- import{r as d,a as x,j as e}from"./index-BMmYYws0.js";const j={verified:{badge:"bg-success/10 text-success border-success/20",dot:"bg-success",label:"Verified",proven:"These receipt bytes are unaltered, and they were signed by the holder of the signing key.",notProven:"That the code is correct. A receipt records which checks ran, not that the result is right."},unsigned:{badge:"bg-warning/10 text-warning border-warning/20",dot:"bg-warning",label:"Unsigned",proven:"The receipt is internally consistent with its own integrity hash.",notProven:"Who produced it. An unsigned receipt is forgeable: whoever controls the builder can rewrite the facts and recompute the hash."},unchecked:{badge:"bg-warning/10 text-warning border-warning/20",dot:"bg-warning",label:"Not checked",proven:"The integrity hash matches, so nothing is wrong with the contents.",notProven:"Provenance. A signature is present but was not evaluated here, which is not the same as a bad signature."},tampered:{badge:"bg-danger/10 text-danger border-danger/20",dot:"bg-danger",label:"Tampered",proven:"Nothing. The recorded hash does not match the contents.",notProven:"Anything at all. This receipt was edited after it was written. Do not trust this build."}};function w(t){const n=t==null?void 0:t.verification;return!n||!n.hash?"unsigned":n.attestation||n.gpg_signature?"unchecked":"unsigned"}const b=[{key:"verified",label:"Verified",bar:"bg-success",text:"text-success"},{key:"with_gaps",label:"With gaps",bar:"bg-warning",text:"text-warning"},{key:"not_verified",label:"Not verified",bar:"bg-danger",text:"text-danger"},{key:"unknown",label:"Unknown",bar:"bg-muted/40",text:"text-muted"}];function N({summary:t}){const n=t.total_receipts;return n?e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex h-1.5 rounded-full overflow-hidden bg-muted/10",children:b.map(({key:a,bar:s})=>{const i=t[a];return i?e.jsx("div",{className:s,style:{width:`${i/n*100}%`},title:`${i} ${a}`},a):null})}),e.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs",children:b.map(({key:a,label:s,text:i})=>{const l=t[a];return l?e.jsxs("span",{className:i,children:[e.jsx("span",{className:"font-semibold",children:l})," ",s.toLowerCase()]},a):null})}),e.jsxs("p",{className:"text-muted text-xs",children:["Recorded verdicts across ",n," receipt",n===1?"":"s",", not re-verified here."]})]}):null}function o({label:t,value:n}){return e.jsxs("div",{className:"flex items-baseline gap-2 text-xs",children:[e.jsx("span",{className:"text-muted w-28 flex-shrink-0",children:t}),e.jsx("span",{className:"font-mono truncate",title:n,children:n})]})}function y({proof:t}){var m,p,g,f;const[n,a]=d.useState(!1),[s,i]=d.useState(null),[l,c]=d.useState(null);d.useEffect(()=>{if(!n||s||l)return;let h=!1;return x.getProof(t.run_id).then(u=>{h||i(u)}).catch(u=>{h||c((u==null?void 0:u.message)||"could not load this receipt")}),()=>{h=!0}},[n,t.run_id,s,l]);const r=j[w(s)],v=t.generated_at?new Date(t.generated_at).toLocaleString():"unknown";return e.jsxs("div",{className:`border rounded-card overflow-hidden ${s?r.badge:"border-muted/20"}`,children:[e.jsxs("button",{type:"button",className:"w-full flex items-center gap-3 px-3 py-2.5 text-left",onClick:()=>a(!n),"aria-expanded":n,children:[e.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${s?r.dot:"bg-muted/40"}`}),e.jsx("span",{className:"text-sm font-medium flex-1 truncate",children:t.headline||t.run_id}),t.final_verdict&&e.jsx("span",{className:"text-xs font-mono uppercase tracking-wider flex-shrink-0 text-muted",children:t.final_verdict}),e.jsx("span",{className:"text-muted text-xs flex-shrink-0",children:n?"−":"+"})]}),n&&e.jsxs("div",{className:"px-3 pb-3 space-y-3 border-t border-current/10 pt-3",children:[l&&e.jsxs("p",{className:"text-xs text-danger",children:["Could not load this receipt: ",l]}),!l&&!s&&e.jsx("p",{className:"text-xs text-muted",children:"Loading receipt…"}),s&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(o,{label:"Run",value:s.run_id}),e.jsx(o,{label:"Generated",value:v}),e.jsx(o,{label:"Loki version",value:s.loki_version||"unknown"}),e.jsx(o,{label:"Cost",value:typeof s.cost_usd=="number"?`$${s.cost_usd.toFixed(2)}`:"unknown"}),e.jsx(o,{label:"Files changed",value:typeof s.files_changed=="number"?String(s.files_changed):"unknown"}),((m=s.verification)==null?void 0:m.hash)&&e.jsx(o,{label:"Integrity hash",value:s.verification.hash})]}),e.jsxs("div",{className:`rounded-card border px-3 py-2 ${r.badge}`,children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider mb-1",children:r.label}),e.jsxs("p",{className:"text-xs mb-1",children:[e.jsx("span",{className:"font-semibold",children:"Proven: "}),r.proven]}),e.jsxs("p",{className:"text-xs opacity-80",children:[e.jsx("span",{className:"font-semibold",children:"Not proven: "}),r.notProven]})]}),(((p=s.verification)==null?void 0:p.attestation)||((g=s.verification)==null?void 0:g.gpg_signature))&&e.jsxs("p",{className:"text-xs text-muted",children:["Verify it yourself:"," ",e.jsxs("code",{className:"font-mono",children:["loki proof verify ",s.run_id,(f=s.verification)!=null&&f.attestation?" --jwks <url|file>":""]})]}),t.pr_url&&e.jsx("a",{href:t.pr_url,target:"_blank",rel:"noreferrer noopener",className:"text-xs text-primary underline",children:"View the pull request"})]})]})]})}function _(){const[t,n]=d.useState(null),[a,s]=d.useState(null),[i,l]=d.useState(null);return d.useEffect(()=>{let c=!1;return x.listProofs().then(r=>{c||n(r.proofs||[])}).catch(r=>{c||l((r==null?void 0:r.message)||"could not load receipts")}),x.proofsSummary().then(r=>{c||s(r)}).catch(()=>{}),()=>{c=!0}},[]),e.jsxs("section",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-semibold",children:"Evidence Receipts"}),e.jsx("p",{className:"text-muted text-xs mt-1",children:"What each build actually checked, recorded so you can verify it yourself."})]}),i&&e.jsxs("p",{className:"text-xs text-danger",children:["Could not load receipts: ",i]}),!i&&t===null&&e.jsx("p",{className:"text-xs text-muted",children:"Loading…"}),a&&e.jsx(N,{summary:a}),t!==null&&t.length===0&&e.jsxs("p",{className:"text-xs text-muted",children:["No receipts yet. One is written at the end of each run (set ",e.jsx("code",{className:"font-mono",children:"LOKI_PROOF=0"})," to opt out)."]}),e.jsx("div",{className:"space-y-2",children:t==null?void 0:t.map(c=>e.jsx(y,{proof:c},c.run_id))})]})}export{_ as E};
1
+ import{r as d,a as x,j as e}from"./index-Cu-njJ8o.js";const j={verified:{badge:"bg-success/10 text-success border-success/20",dot:"bg-success",label:"Verified",proven:"These receipt bytes are unaltered, and they were signed by the holder of the signing key.",notProven:"That the code is correct. A receipt records which checks ran, not that the result is right."},unsigned:{badge:"bg-warning/10 text-warning border-warning/20",dot:"bg-warning",label:"Unsigned",proven:"The receipt is internally consistent with its own integrity hash.",notProven:"Who produced it. An unsigned receipt is forgeable: whoever controls the builder can rewrite the facts and recompute the hash."},unchecked:{badge:"bg-warning/10 text-warning border-warning/20",dot:"bg-warning",label:"Not checked",proven:"The integrity hash matches, so nothing is wrong with the contents.",notProven:"Provenance. A signature is present but was not evaluated here, which is not the same as a bad signature."},tampered:{badge:"bg-danger/10 text-danger border-danger/20",dot:"bg-danger",label:"Tampered",proven:"Nothing. The recorded hash does not match the contents.",notProven:"Anything at all. This receipt was edited after it was written. Do not trust this build."}};function w(t){const n=t==null?void 0:t.verification;return!n||!n.hash?"unsigned":n.attestation||n.gpg_signature?"unchecked":"unsigned"}const b=[{key:"verified",label:"Verified",bar:"bg-success",text:"text-success"},{key:"with_gaps",label:"With gaps",bar:"bg-warning",text:"text-warning"},{key:"not_verified",label:"Not verified",bar:"bg-danger",text:"text-danger"},{key:"unknown",label:"Unknown",bar:"bg-muted/40",text:"text-muted"}];function N({summary:t}){const n=t.total_receipts;return n?e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex h-1.5 rounded-full overflow-hidden bg-muted/10",children:b.map(({key:a,bar:s})=>{const i=t[a];return i?e.jsx("div",{className:s,style:{width:`${i/n*100}%`},title:`${i} ${a}`},a):null})}),e.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs",children:b.map(({key:a,label:s,text:i})=>{const l=t[a];return l?e.jsxs("span",{className:i,children:[e.jsx("span",{className:"font-semibold",children:l})," ",s.toLowerCase()]},a):null})}),e.jsxs("p",{className:"text-muted text-xs",children:["Recorded verdicts across ",n," receipt",n===1?"":"s",", not re-verified here."]})]}):null}function o({label:t,value:n}){return e.jsxs("div",{className:"flex items-baseline gap-2 text-xs",children:[e.jsx("span",{className:"text-muted w-28 flex-shrink-0",children:t}),e.jsx("span",{className:"font-mono truncate",title:n,children:n})]})}function y({proof:t}){var m,p,g,f;const[n,a]=d.useState(!1),[s,i]=d.useState(null),[l,c]=d.useState(null);d.useEffect(()=>{if(!n||s||l)return;let h=!1;return x.getProof(t.run_id).then(u=>{h||i(u)}).catch(u=>{h||c((u==null?void 0:u.message)||"could not load this receipt")}),()=>{h=!0}},[n,t.run_id,s,l]);const r=j[w(s)],v=t.generated_at?new Date(t.generated_at).toLocaleString():"unknown";return e.jsxs("div",{className:`border rounded-card overflow-hidden ${s?r.badge:"border-muted/20"}`,children:[e.jsxs("button",{type:"button",className:"w-full flex items-center gap-3 px-3 py-2.5 text-left",onClick:()=>a(!n),"aria-expanded":n,children:[e.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${s?r.dot:"bg-muted/40"}`}),e.jsx("span",{className:"text-sm font-medium flex-1 truncate",children:t.headline||t.run_id}),t.final_verdict&&e.jsx("span",{className:"text-xs font-mono uppercase tracking-wider flex-shrink-0 text-muted",children:t.final_verdict}),e.jsx("span",{className:"text-muted text-xs flex-shrink-0",children:n?"−":"+"})]}),n&&e.jsxs("div",{className:"px-3 pb-3 space-y-3 border-t border-current/10 pt-3",children:[l&&e.jsxs("p",{className:"text-xs text-danger",children:["Could not load this receipt: ",l]}),!l&&!s&&e.jsx("p",{className:"text-xs text-muted",children:"Loading receipt…"}),s&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(o,{label:"Run",value:s.run_id}),e.jsx(o,{label:"Generated",value:v}),e.jsx(o,{label:"Loki version",value:s.loki_version||"unknown"}),e.jsx(o,{label:"Cost",value:typeof s.cost_usd=="number"?`$${s.cost_usd.toFixed(2)}`:"unknown"}),e.jsx(o,{label:"Files changed",value:typeof s.files_changed=="number"?String(s.files_changed):"unknown"}),((m=s.verification)==null?void 0:m.hash)&&e.jsx(o,{label:"Integrity hash",value:s.verification.hash})]}),e.jsxs("div",{className:`rounded-card border px-3 py-2 ${r.badge}`,children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider mb-1",children:r.label}),e.jsxs("p",{className:"text-xs mb-1",children:[e.jsx("span",{className:"font-semibold",children:"Proven: "}),r.proven]}),e.jsxs("p",{className:"text-xs opacity-80",children:[e.jsx("span",{className:"font-semibold",children:"Not proven: "}),r.notProven]})]}),(((p=s.verification)==null?void 0:p.attestation)||((g=s.verification)==null?void 0:g.gpg_signature))&&e.jsxs("p",{className:"text-xs text-muted",children:["Verify it yourself:"," ",e.jsxs("code",{className:"font-mono",children:["loki proof verify ",s.run_id,(f=s.verification)!=null&&f.attestation?" --jwks <url|file>":""]})]}),t.pr_url&&e.jsx("a",{href:t.pr_url,target:"_blank",rel:"noreferrer noopener",className:"text-xs text-primary underline",children:"View the pull request"})]})]})]})}function _(){const[t,n]=d.useState(null),[a,s]=d.useState(null),[i,l]=d.useState(null);return d.useEffect(()=>{let c=!1;return x.listProofs().then(r=>{c||n(r.proofs||[])}).catch(r=>{c||l((r==null?void 0:r.message)||"could not load receipts")}),x.proofsSummary().then(r=>{c||s(r)}).catch(()=>{}),()=>{c=!0}},[]),e.jsxs("section",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-semibold",children:"Evidence Receipts"}),e.jsx("p",{className:"text-muted text-xs mt-1",children:"What each build actually checked, recorded so you can verify it yourself."})]}),i&&e.jsxs("p",{className:"text-xs text-danger",children:["Could not load receipts: ",i]}),!i&&t===null&&e.jsx("p",{className:"text-xs text-muted",children:"Loading…"}),a&&e.jsx(N,{summary:a}),t!==null&&t.length===0&&e.jsxs("p",{className:"text-xs text-muted",children:["No receipts yet. One is written at the end of each run (set ",e.jsx("code",{className:"font-mono",children:"LOKI_PROOF=0"})," to opt out)."]}),e.jsx("div",{className:"space-y-2",children:t==null?void 0:t.map(c=>e.jsx(y,{proof:c},c.run_id))})]})}export{_ as E};
@@ -1,4 +1,4 @@
1
- import{c as M,r as o,a as C,j as e,n as P,J as w,N as f,a5 as B,M as R,m as A,E as H}from"./index-BMmYYws0.js";import{B as v}from"./Button-Dc6-P6pz.js";import{C as k,G as q}from"./thumbs-up-BqEh1puP.js";import{R as F}from"./refresh-cw-F6koqEgF.js";import{C as S}from"./circle-alert-DOH6PcgZ.js";import{U as D}from"./user-BRLhezsD.js";import{R as T}from"./rotate-ccw-CQ2W5S8f.js";import{L as U}from"./loader-circle-Do2ke8xm.js";/**
1
+ import{c as M,r as o,a as C,j as e,n as P,J as w,N as f,a5 as B,M as R,m as A,E as H}from"./index-Cu-njJ8o.js";import{B as v}from"./Button-CFzTTVeJ.js";import{C as k,G as q}from"./thumbs-up-Da1QQhqo.js";import{R as F}from"./refresh-cw-DKoSN8s3.js";import{C as S}from"./circle-alert-CstyZfKG.js";import{U as D}from"./user-WCGccIST.js";import{R as T}from"./rotate-ccw-Nf8zB8G0.js";import{L as U}from"./loader-circle-DXgc_u5I.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.