loki-mode 9.75.0 → 9.77.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/SKILL.md +2 -2
- package/VERSION +1 -1
- package/autonomy/completion-council.sh +24 -6
- package/autonomy/lib/proof-check.sh +43 -8
- package/autonomy/lib/voter-agents.sh +42 -5
- package/autonomy/loki +3 -0
- package/autonomy/prd-checklist.sh +77 -16
- package/autonomy/run.sh +40 -4
- package/dashboard/__init__.py +1 -1
- package/docs/INSTALLATION.md +1 -1
- package/docs/v10/ARCHITECT-CUTS.md +359 -322
- package/docs/v10/BOARD.md +59 -39
- package/docs/v10/GUARDS.md +32 -21
- package/docs/v10/METRICS.md +4 -0
- package/loki-ts/dist/loki.js +341 -338
- package/mcp/__init__.py +1 -1
- package/package.json +1 -1
- package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
- package/web-app/dist/assets/{AdminPage-CMGkmNnt.js → AdminPage-_YAgQxgp.js} +1 -1
- package/web-app/dist/assets/{Avatar-9mn8sJ-2.js → Avatar-Bxbdwgz5.js} +1 -1
- package/web-app/dist/assets/{Badge-mSFLvvRX.js → Badge-DFOiCwzh.js} +1 -1
- package/web-app/dist/assets/{Button-B1v4CSkD.js → Button-84KGqMJR.js} +1 -1
- package/web-app/dist/assets/CockpitPage-Ck8i3mNd.js +47 -0
- package/web-app/dist/assets/{ComparePage-C1BXuolM.js → ComparePage-BpIdW5x8.js} +1 -1
- package/web-app/dist/assets/{ErrorBoundary-C2sJyBhb.js → ErrorBoundary-Dcwg_4nU.js} +1 -1
- package/web-app/dist/assets/{EvidenceReceiptPanel-a1irlBPD.js → EvidenceReceiptPanel-6II8hA4-.js} +1 -1
- package/web-app/dist/assets/{GitHubIssuesPanel-zM-WRxYB.js → GitHubIssuesPanel-CCpJxUo5.js} +1 -1
- package/web-app/dist/assets/{GitHubPRsPanel-DvRa5Rxq.js → GitHubPRsPanel-BN7KtPRB.js} +1 -1
- package/web-app/dist/assets/{HomePage-CNwRexp5.js → HomePage-Dmh8Ompu.js} +2 -2
- package/web-app/dist/assets/{LoginPage-HKogNiEX.js → LoginPage-e_wvWykS.js} +1 -1
- package/web-app/dist/assets/{MagicPage-u1mvdkUd.js → MagicPage-SkEbXneS.js} +1 -1
- package/web-app/dist/assets/{MetricsPage-CThdMJb5.js → MetricsPage-Jr2E8O4h.js} +1 -1
- package/web-app/dist/assets/{NotFoundPage-B1v3lELS.js → NotFoundPage-Bo-xIGHn.js} +1 -1
- package/web-app/dist/assets/{ProjectPage-hDvSsdLF.js → ProjectPage--lRlzM8G.js} +3 -3
- package/web-app/dist/assets/{ProjectsPage-CRAegSM6.js → ProjectsPage-CG_L0UkM.js} +1 -1
- package/web-app/dist/assets/{SettingsPage-Dt90bFxo.js → SettingsPage-DdZ4UAJM.js} +1 -1
- package/web-app/dist/assets/{ShowcasePage-C5a9l8u_.js → ShowcasePage-CnV468WN.js} +1 -1
- package/web-app/dist/assets/{SystemSettingsPage-DtqsDXbx.js → SystemSettingsPage-CyvaTJ_t.js} +1 -1
- package/web-app/dist/assets/{TeamsPage-CooeoWxR.js → TeamsPage-g5hHDx0X.js} +1 -1
- package/web-app/dist/assets/{TemplatesPage-CJhTxWrw.js → TemplatesPage-CRcRm9ED.js} +1 -1
- package/web-app/dist/assets/{TerminalOutput-DvjfbDxb.js → TerminalOutput-BDBfTY9s.js} +1 -1
- package/web-app/dist/assets/{activity-DK6KBQKA.js → activity-CpH9qoQP.js} +1 -1
- package/web-app/dist/assets/{bell-Cd8tQpN6.js → bell-BtlnNdD8.js} +1 -1
- package/web-app/dist/assets/{bot-Y30w8rML.js → bot-BAH-qJ4B.js} +1 -1
- package/web-app/dist/assets/{check-B5eUl1j9.js → check-D7ydqeHo.js} +1 -1
- package/web-app/dist/assets/{chevron-left-qyvpFqze.js → chevron-left-CJ48kXi_.js} +1 -1
- package/web-app/dist/assets/{circle-alert-DXtjVPDB.js → circle-alert-C3m8Jdum.js} +1 -1
- package/web-app/dist/assets/{clock-dqQis2Q6.js → clock-CpVxJ_xL.js} +1 -1
- package/web-app/dist/assets/{cloud-CzTURYO9.js → cloud-C5RpwJJ2.js} +1 -1
- package/web-app/dist/assets/{code-xml-DLbw1HTk.js → code-xml-D8Ch_l6l.js} +1 -1
- package/web-app/dist/assets/{database-BIj38v85.js → database-Dc-r_JaX.js} +1 -1
- package/web-app/dist/assets/{dollar-sign-9bVcHIkD.js → dollar-sign-CXOSNCEc.js} +1 -1
- package/web-app/dist/assets/{file-code-corner-D57x6xD1.js → file-code-corner-il9KkndN.js} +1 -1
- package/web-app/dist/assets/{file-plus-BXOrz3T5.js → file-plus-CduheFSQ.js} +1 -1
- package/web-app/dist/assets/{globe-Cnq8h4Gt.js → globe-C_H2CJ0N.js} +1 -1
- package/web-app/dist/assets/{hammer-iiLGlF28.js → hammer-Dd0DZNve.js} +1 -1
- package/web-app/dist/assets/{index-uGGZ1Ij3.js → index-CnURGAFT.js} +2 -2
- package/web-app/dist/assets/{layers-gcGxxNEN.js → layers-CofXpCI5.js} +1 -1
- package/web-app/dist/assets/{loader-circle-B4Ad11xq.js → loader-circle-Z2PHP1vi.js} +1 -1
- package/web-app/dist/assets/{lock-DvQNG5RI.js → lock-BKZcBfqE.js} +1 -1
- package/web-app/dist/assets/{package-BtQBNbq2.js → package-VeINyJLx.js} +1 -1
- package/web-app/dist/assets/{plus-DKLiMXBZ.js → plus-BdRdn_Ne.js} +1 -1
- package/web-app/dist/assets/{refresh-cw-B4Gu8e2m.js → refresh-cw-SQlfufGR.js} +1 -1
- package/web-app/dist/assets/{rotate-ccw-DATSPLYS.js → rotate-ccw-z7xY1hor.js} +1 -1
- package/web-app/dist/assets/{scroll-text-GA8EtlY4.js → scroll-text-D9DLjkO9.js} +1 -1
- package/web-app/dist/assets/{server-DT_3kM4V.js → server-VlEVEIp_.js} +1 -1
- package/web-app/dist/assets/{shield-alert-BEaqZEhO.js → shield-alert-D0ulDTaf.js} +1 -1
- package/web-app/dist/assets/{thumbs-up-DVvA-Fas.js → thumbs-up-7_JKRnvS.js} +1 -1
- package/web-app/dist/assets/{trash-2-BCyT5A9N.js → trash-2-DmRmNre3.js} +1 -1
- package/web-app/dist/assets/{trending-down-BLcNt39o.js → trending-down-DZwkFd-S.js} +1 -1
- package/web-app/dist/assets/{trending-up-BqfBp13A.js → trending-up-4ql9Pr4t.js} +1 -1
- package/web-app/dist/assets/{upload-BxH0rjQU.js → upload-D2KPx9Uo.js} +1 -1
- package/web-app/dist/assets/{usePolling-CokbBZIQ.js → usePolling-D6alWGU5.js} +1 -1
- package/web-app/dist/assets/{user-C_u9mNZM.js → user-Bo3EjryF.js} +1 -1
- package/web-app/dist/index.html +1 -1
- package/web-app/dist/assets/CockpitPage-BW0hYuzC.js +0 -47
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as M,r,j as e,U as w,X as $,h as D,y as H,a as A,x as q,p as K,g as O,M as X,R as Y,l as G,a1 as J,a2 as Q}from"./index-
|
|
1
|
+
import{c as M,r,j as e,U as w,X as $,h as D,y as H,a as A,x as q,p as K,g as O,M as X,R as Y,l as G,a1 as J,a2 as Q}from"./index-CnURGAFT.js";import{B as k}from"./Button-84KGqMJR.js";import{U as I,M as W,A as S}from"./Avatar-Bxbdwgz5.js";import{L as Z}from"./lock-BKZcBfqE.js";import{A as b}from"./activity-CpH9qoQP.js";import{U as ee}from"./user-Bo3EjryF.js";import{C as R}from"./clock-CpVxJ_xL.js";import{F as te}from"./file-code-corner-il9KkndN.js";import{F as se}from"./file-plus-CduheFSQ.js";import{H as ae}from"./hammer-Dd0DZNve.js";import{P as re}from"./plus-BdRdn_Ne.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 F,r as n,j as e,p as M,w as B,R as D,u as O,a as G,X as z,y as Y,F as C,v as Q,J as H,A as q,m as I,i as V}from"./index-
|
|
1
|
+
import{c as F,r as n,j as e,p as M,w as B,R as D,u as O,a as G,X as z,y as Y,F as C,v as Q,J as H,A as q,m as I,i as V}from"./index-CnURGAFT.js";import{B as N}from"./Button-84KGqMJR.js";import{u as J}from"./usePolling-D6alWGU5.js";import{C as K}from"./chevron-left-CJ48kXi_.js";import{C as T}from"./clock-CpVxJ_xL.js";import{L as X}from"./layers-CofXpCI5.js";import{C as S}from"./check-D7ydqeHo.js";import{P}from"./package-VeINyJLx.js";import{G as Z}from"./globe-C_H2CJ0N.js";import{S as ee}from"./server-VlEVEIp_.js";import{B as te}from"./bot-BAH-qJ4B.js";import{D as se}from"./database-Dc-r_JaX.js";import{P as ie}from"./plus-BdRdn_Ne.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 j,r as i,j as e}from"./index-
|
|
1
|
+
import{c as j,r as i,j as e}from"./index-CnURGAFT.js";import{L as w}from"./lock-BKZcBfqE.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
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomePage-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomePage-Dmh8Ompu.js","assets/usePolling-D6alWGU5.js","assets/ErrorBoundary-Dcwg_4nU.js","assets/TerminalOutput-BDBfTY9s.js","assets/lock-BKZcBfqE.js","assets/EvidenceReceiptPanel-6II8hA4-.js","assets/Badge-DFOiCwzh.js","assets/clock-CpVxJ_xL.js","assets/circle-alert-C3m8Jdum.js","assets/check-D7ydqeHo.js","assets/package-VeINyJLx.js","assets/cloud-C5RpwJJ2.js","assets/code-xml-D8Ch_l6l.js","assets/hammer-Dd0DZNve.js","assets/layers-CofXpCI5.js","assets/bell-BtlnNdD8.js","assets/file-code-corner-il9KkndN.js","assets/ProjectPage--lRlzM8G.js","assets/Button-84KGqMJR.js","assets/file-plus-CduheFSQ.js","assets/activity-CpH9qoQP.js","assets/scroll-text-D9DLjkO9.js","assets/bot-BAH-qJ4B.js","assets/loader-circle-Z2PHP1vi.js","assets/dollar-sign-CXOSNCEc.js","assets/refresh-cw-SQlfufGR.js","assets/globe-C_H2CJ0N.js","assets/trash-2-DmRmNre3.js","assets/thumbs-up-7_JKRnvS.js","assets/upload-D2KPx9Uo.js","assets/plus-BdRdn_Ne.js","assets/rotate-ccw-z7xY1hor.js","assets/trending-up-4ql9Pr4t.js","assets/trending-down-DZwkFd-S.js","assets/server-VlEVEIp_.js","assets/ProjectPage-9CEnUXvW.css","assets/CockpitPage-Ck8i3mNd.js","assets/ProjectsPage-CG_L0UkM.js","assets/TemplatesPage-CRcRm9ED.js","assets/chevron-left-CJ48kXi_.js","assets/database-Dc-r_JaX.js","assets/SettingsPage-DdZ4UAJM.js","assets/TeamsPage-g5hHDx0X.js","assets/Avatar-Bxbdwgz5.js","assets/user-Bo3EjryF.js","assets/AdminPage-_YAgQxgp.js","assets/shield-alert-D0ulDTaf.js","assets/SystemSettingsPage-CyvaTJ_t.js","assets/MetricsPage-Jr2E8O4h.js","assets/MagicPage-SkEbXneS.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var P0=Object.defineProperty;var ep=(i,c,r)=>c in i?P0(i,c,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[c]=r;var Ln=(i,c,r)=>ep(i,typeof c!="symbol"?c+"":c,r);(function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))o(d);new MutationObserver(d=>{for(const m of d)if(m.type==="childList")for(const p of m.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&o(p)}).observe(document,{childList:!0,subtree:!0});function r(d){const m={};return d.integrity&&(m.integrity=d.integrity),d.referrerPolicy&&(m.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?m.credentials="include":d.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function o(d){if(d.ep)return;d.ep=!0;const m=r(d);fetch(d.href,m)}})();function tp(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Ls={exports:{}},Bn={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.js
|
|
@@ -432,4 +432,4 @@ Reason, Act, Reflect, Verify -- the AI's thinking process. It plans what to do (
|
|
|
432
432
|
from { opacity: 0; transform: translateX(100%); }
|
|
433
433
|
to { opacity: 1; transform: translateX(0); }
|
|
434
434
|
}
|
|
435
|
-
`}),h.jsx("span",{className:`flex-shrink-0 mt-0.5 ${p.icon}`,children:h.jsx(p.IconComponent,{size:18})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("p",{className:"text-sm font-medium text-[#201515] dark:text-[#E8E6E3]",children:o}),d&&h.jsx("p",{className:"text-xs text-[#6B6960] dark:text-[#8A8880] mt-0.5",children:d})]}),h.jsx("button",{onClick:x,className:"flex-shrink-0 text-[#939084] hover:text-[#36342E] dark:hover:text-[#E8E6E3] transition-colors","aria-label":"Dismiss notification",children:h.jsx(ea,{size:14})})]})}function m2({notifications:i,onDismiss:c}){return i.length===0?null:h.jsx("div",{className:"fixed top-4 right-4 z-[9999] flex flex-col gap-2 pointer-events-none","aria-live":"polite",children:i.map(r=>h.jsx(h2,{notification:r,onDismiss:c},r.id))})}const Am=v.createContext({notify:()=>"",dismiss:()=>{},dismissAll:()=>{}});let y2=0;function p2({children:i}){const[c,r]=v.useState([]),o=v.useCallback(E=>{const x=`notif-${++y2}-${Date.now()}`,y={...E,id:x};if(r(z=>[...z,y]),document.hidden&&"Notification"in window)if(Notification.permission==="granted")try{new Notification(E.title,{body:E.message||""})}catch{}else Notification.permission!=="denied"&&Notification.requestPermission().then(z=>{if(z==="granted")try{new Notification(E.title,{body:E.message||""})}catch{}});return x},[]),d=v.useCallback(E=>{r(x=>x.filter(y=>y.id!==E))},[]),m=v.useCallback(()=>{r([])},[]),p=v.useMemo(()=>({notify:o,dismiss:d,dismissAll:m}),[o,d,m]);return h.jsxs(Am.Provider,{value:p,children:[i,h.jsx(m2,{notifications:c,onDismiss:d})]})}function L2(){return v.useContext(Am)}function Fs({children:i}){const{user:c,loading:r,isLocalMode:o}=_m();return r?h.jsx("div",{className:"h-screen bg-[#FAF9F6] flex items-center justify-center text-[#6B6960] text-sm",children:"Loading..."}):o?h.jsx(h.Fragment,{children:i}):c?h.jsx(h.Fragment,{children:i}):h.jsx(o1,{to:"/login",replace:!0})}function pi({variant:i="text",width:c,height:r,className:o=""}){const d="animate-pulse bg-[#ECEAE3]/60 rounded";if(i==="circle"){const m=c||"2rem";return h.jsx("div",{className:`${d} rounded-full flex-shrink-0 ${o}`,style:{width:m,height:m}})}return i==="block"?h.jsx("div",{className:`${d} rounded-btn ${o}`,style:{width:c||"100%",height:r||"4rem"}}):h.jsx("div",{className:`${d} rounded-btn ${o}`,style:{width:c||"100%",height:r||"0.75rem"}})}function B2(){return h.jsx("div",{className:"p-4 space-y-3",children:[...Array(12)].map((i,c)=>h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(pi,{variant:"text",width:"1.5rem",height:"10px",className:"flex-shrink-0 opacity-40"}),h.jsx(pi,{variant:"text",width:`${20+Math.random()*60}%`,height:"10px"})]},c))})}typeof window<"u"&&window.addEventListener("beforeunload",i=>{delete i.returnValue});const v2=v.lazy(()=>tt(()=>import("./HomePage-
|
|
435
|
+
`}),h.jsx("span",{className:`flex-shrink-0 mt-0.5 ${p.icon}`,children:h.jsx(p.IconComponent,{size:18})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("p",{className:"text-sm font-medium text-[#201515] dark:text-[#E8E6E3]",children:o}),d&&h.jsx("p",{className:"text-xs text-[#6B6960] dark:text-[#8A8880] mt-0.5",children:d})]}),h.jsx("button",{onClick:x,className:"flex-shrink-0 text-[#939084] hover:text-[#36342E] dark:hover:text-[#E8E6E3] transition-colors","aria-label":"Dismiss notification",children:h.jsx(ea,{size:14})})]})}function m2({notifications:i,onDismiss:c}){return i.length===0?null:h.jsx("div",{className:"fixed top-4 right-4 z-[9999] flex flex-col gap-2 pointer-events-none","aria-live":"polite",children:i.map(r=>h.jsx(h2,{notification:r,onDismiss:c},r.id))})}const Am=v.createContext({notify:()=>"",dismiss:()=>{},dismissAll:()=>{}});let y2=0;function p2({children:i}){const[c,r]=v.useState([]),o=v.useCallback(E=>{const x=`notif-${++y2}-${Date.now()}`,y={...E,id:x};if(r(z=>[...z,y]),document.hidden&&"Notification"in window)if(Notification.permission==="granted")try{new Notification(E.title,{body:E.message||""})}catch{}else Notification.permission!=="denied"&&Notification.requestPermission().then(z=>{if(z==="granted")try{new Notification(E.title,{body:E.message||""})}catch{}});return x},[]),d=v.useCallback(E=>{r(x=>x.filter(y=>y.id!==E))},[]),m=v.useCallback(()=>{r([])},[]),p=v.useMemo(()=>({notify:o,dismiss:d,dismissAll:m}),[o,d,m]);return h.jsxs(Am.Provider,{value:p,children:[i,h.jsx(m2,{notifications:c,onDismiss:d})]})}function L2(){return v.useContext(Am)}function Fs({children:i}){const{user:c,loading:r,isLocalMode:o}=_m();return r?h.jsx("div",{className:"h-screen bg-[#FAF9F6] flex items-center justify-center text-[#6B6960] text-sm",children:"Loading..."}):o?h.jsx(h.Fragment,{children:i}):c?h.jsx(h.Fragment,{children:i}):h.jsx(o1,{to:"/login",replace:!0})}function pi({variant:i="text",width:c,height:r,className:o=""}){const d="animate-pulse bg-[#ECEAE3]/60 rounded";if(i==="circle"){const m=c||"2rem";return h.jsx("div",{className:`${d} rounded-full flex-shrink-0 ${o}`,style:{width:m,height:m}})}return i==="block"?h.jsx("div",{className:`${d} rounded-btn ${o}`,style:{width:c||"100%",height:r||"4rem"}}):h.jsx("div",{className:`${d} rounded-btn ${o}`,style:{width:c||"100%",height:r||"0.75rem"}})}function B2(){return h.jsx("div",{className:"p-4 space-y-3",children:[...Array(12)].map((i,c)=>h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(pi,{variant:"text",width:"1.5rem",height:"10px",className:"flex-shrink-0 opacity-40"}),h.jsx(pi,{variant:"text",width:`${20+Math.random()*60}%`,height:"10px"})]},c))})}typeof window<"u"&&window.addEventListener("beforeunload",i=>{delete i.returnValue});const v2=v.lazy(()=>tt(()=>import("./HomePage-Dmh8Ompu.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))),g2=v.lazy(()=>tt(()=>import("./ProjectPage--lRlzM8G.js").then(i=>i.P),__vite__mapDeps([17,2,18,3,4,10,16,19,7,20,21,22,9,23,13,24,25,8,26,27,28,29,30,31,12,32,14,33,34,35]))),b2=v.lazy(()=>tt(()=>import("./CockpitPage-Ck8i3mNd.js"),__vite__mapDeps([36,2,28,9,7,24,29,23]))),x2=v.lazy(()=>tt(()=>import("./ProjectsPage-CG_L0UkM.js"),__vite__mapDeps([37,18,6,7,8,9,1,25,30,27]))),S2=v.lazy(()=>tt(()=>import("./TemplatesPage-CRcRm9ED.js"),__vite__mapDeps([38,18,1,39,7,14,9,10,26,34,22,40,30]))),E2=v.lazy(()=>tt(()=>import("./SettingsPage-DdZ4UAJM.js"),__vite__mapDeps([41,31,13,11,23,9,8]))),_2=v.lazy(()=>tt(()=>import("./LoginPage-e_wvWykS.js"),[])),T2=v.lazy(()=>tt(()=>import("./TeamsPage-g5hHDx0X.js"),__vite__mapDeps([42,18,43,4,20,44,7,16,19,13,30]))),z2=v.lazy(()=>tt(()=>import("./AdminPage-_YAgQxgp.js"),__vite__mapDeps([45,18,32,7,43,20,25,26,39,9,24,44,40,4,21,46]))),N2=v.lazy(()=>tt(()=>import("./SystemSettingsPage-CyvaTJ_t.js"),__vite__mapDeps([47,34,13,15,40,46]))),C2=v.lazy(()=>tt(()=>import("./MetricsPage-Jr2E8O4h.js"),__vite__mapDeps([48,5,24,14,32,33]))),j2=v.lazy(()=>tt(()=>import("./ShowcasePage-CnV468WN.js"),[])),A2=v.lazy(()=>tt(()=>import("./MagicPage-SkEbXneS.js"),__vite__mapDeps([49,29,8,23,12]))),R2=v.lazy(()=>tt(()=>import("./ComparePage-BpIdW5x8.js"),[])),O2=v.lazy(()=>tt(()=>import("./NotFoundPage-Bo-xIGHn.js"),[]));function et(){return h.jsxs("div",{className:"h-screen bg-[#FAF9F6] flex flex-col items-center justify-center gap-3",children:[h.jsx(pi,{variant:"block",width:"200px",height:"24px"}),h.jsx(pi,{variant:"text",width:"140px",height:"12px",className:"opacity-50"})]})}function M2(){return h.jsx(Dg,{children:h.jsx(p2,{children:h.jsxs(d1,{children:[h.jsx(Ke,{path:"/login",element:h.jsx(v.Suspense,{fallback:h.jsx(et,{}),children:h.jsx(_2,{})})}),h.jsx(Ke,{path:"/project/:sessionId/cockpit",element:h.jsx(Fs,{children:h.jsx(v.Suspense,{fallback:h.jsx(et,{}),children:h.jsx(b2,{})})})}),h.jsx(Ke,{path:"/project/:sessionId",element:h.jsx(Fs,{children:h.jsx(v.Suspense,{fallback:h.jsx(et,{}),children:h.jsx(g2,{})})})}),h.jsxs(Ke,{element:h.jsx(Fs,{children:h.jsx(f2,{})}),children:[h.jsx(Ke,{path:"/",element:h.jsx(v.Suspense,{fallback:h.jsx(et,{}),children:h.jsx(v2,{})})}),h.jsx(Ke,{path:"/projects",element:h.jsx(v.Suspense,{fallback:h.jsx(et,{}),children:h.jsx(x2,{})})}),h.jsx(Ke,{path:"/templates",element:h.jsx(v.Suspense,{fallback:h.jsx(et,{}),children:h.jsx(S2,{})})}),h.jsx(Ke,{path:"/settings",element:h.jsx(v.Suspense,{fallback:h.jsx(et,{}),children:h.jsx(E2,{})})}),h.jsx(Ke,{path:"/teams",element:h.jsx(v.Suspense,{fallback:h.jsx(et,{}),children:h.jsx(T2,{})})}),h.jsx(Ke,{path:"/metrics",element:h.jsx(v.Suspense,{fallback:h.jsx(et,{}),children:h.jsx(C2,{})})}),h.jsx(Ke,{path:"/showcase",element:h.jsx(v.Suspense,{fallback:h.jsx(et,{}),children:h.jsx(j2,{})})}),h.jsx(Ke,{path:"/magic",element:h.jsx(v.Suspense,{fallback:h.jsx(et,{}),children:h.jsx(A2,{})})}),h.jsx(Ke,{path:"/compare",element:h.jsx(v.Suspense,{fallback:h.jsx(et,{}),children:h.jsx(R2,{})})}),h.jsx(Ke,{path:"/admin",element:h.jsx(v.Suspense,{fallback:h.jsx(et,{}),children:h.jsx(z2,{})})}),h.jsx(Ke,{path:"/admin/settings",element:h.jsx(v.Suspense,{fallback:h.jsx(et,{}),children:h.jsx(N2,{})})}),h.jsx(Ke,{path:"*",element:h.jsx(v.Suspense,{fallback:h.jsx(et,{}),children:h.jsx(O2,{})})})]})]})})})}const D2="/lab/".replace(/\/$/,"")||"/";fp.createRoot(document.getElementById("root")).render(h.jsx(v.StrictMode,{children:h.jsx(H1,{basename:D2,children:h.jsx(M2,{})})}));export{Kv as $,dm as A,hm as B,ym as C,Wv as D,bv as E,vm as F,Cv as G,B2 as H,Dv as I,fm as J,gm as K,so as L,oo as M,pi as N,H2 as O,bm as P,vv as Q,ro as R,ug as S,gg as T,xg as U,Og as V,w2 as W,ea as X,yv as Y,Ag as Z,tt as _,Ba as a,_m as a0,L2 as a1,_v as a2,sm as a3,Ov as a4,Tg as a5,dg as b,W as c,r2 as d,k2 as e,Ng as f,mm as g,nv as h,pg as i,h as j,hv as k,rv as l,lg as m,Kg as n,Jg as o,wh as p,sv as q,v as r,og as s,Xv as t,ao as u,fo as v,lv as w,cg as x,pm as y,xm as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./index-
|
|
1
|
+
import{r as e}from"./index-CnURGAFT.js";function m(s,u=2e3,a=!0){const[c,l]=e.useState(null),[f,o]=e.useState(null),[i,d]=e.useState(!0),r=e.useRef(!0),n=e.useCallback(async()=>{try{const t=await s();r.current&&(l(t),o(null))}catch(t){r.current&&o(t instanceof Error?t.message:"Unknown error")}finally{r.current&&d(!1)}},[s]);return e.useEffect(()=>{if(r.current=!0,!a)return;n();const t=setInterval(n,u);return()=>{r.current=!1,clearInterval(t)}},[n,u,a]),{data:c,error:f,loading:i,refresh:n}}export{m as u};
|
package/web-app/dist/index.html
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
8
8
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
9
9
|
<link href="https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
|
|
10
|
-
<script type="module" crossorigin src="/lab/assets/index-
|
|
10
|
+
<script type="module" crossorigin src="/lab/assets/index-CnURGAFT.js"></script>
|
|
11
11
|
<link rel="stylesheet" crossorigin href="/lab/assets/index-Cx7e1d6w.css">
|
|
12
12
|
</head>
|
|
13
13
|
<body class="bg-background text-ink font-sans antialiased">
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import{c as $,r as l,j as e,G as ye,Q as je,F as Ne,h as we,T as q,Z as Se,a as w,V as Ce,S as Re,Y as Ee,X as Me,P as ne,i as $e,g as Te,C as Pe,l as Ae,N as I,J as ze,K as Ie,O as Le,u as _e}from"./index-uGGZ1Ij3.js";import{P as G,S as De,E as Fe}from"./ErrorBoundary-C2sJyBhb.js";import{C as Oe,F as He,M as Be,H as qe,a as Ge,G as Ue,T as Ke}from"./thumbs-up-DVvA-Fas.js";import{C as ae}from"./check-B5eUl1j9.js";import{C as We}from"./clock-dqQis2Q6.js";import{D as Ve}from"./dollar-sign-9bVcHIkD.js";import{U as Qe}from"./upload-BxH0rjQU.js";import{L as U}from"./loader-circle-B4Ad11xq.js";/**
|
|
2
|
-
* @license lucide-react v0.577.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const Ye=[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]],Xe=$("circle-dashed",Ye);/**
|
|
7
|
-
* @license lucide-react v0.577.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const Ze=[["path",{d:"M20 14V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12",key:"l9p8hp"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],Je=$("file-minus-corner",Ze);/**
|
|
12
|
-
* @license lucide-react v0.577.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const et=[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]],H=$("file-pen",et);/**
|
|
17
|
-
* @license lucide-react v0.577.0 - ISC
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the ISC license.
|
|
20
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const tt=[["path",{d:"M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35",key:"17jvcc"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M14 19h6",key:"bvotb8"}],["path",{d:"M17 16v6",key:"18yu1i"}]],st=$("file-plus-corner",tt);/**
|
|
22
|
-
* @license lucide-react v0.577.0 - ISC
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the ISC license.
|
|
25
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const nt=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M10 15h4",key:"192ueg"}],["path",{d:"M10 9h4",key:"u4k05v"}],["path",{d:"M12 7v4",key:"xawao1"}]],at=$("message-square-diff",nt);/**
|
|
27
|
-
* @license lucide-react v0.577.0 - ISC
|
|
28
|
-
*
|
|
29
|
-
* This source code is licensed under the ISC license.
|
|
30
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const rt=[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]],it=$("repeat",rt);/**
|
|
32
|
-
* @license lucide-react v0.577.0 - ISC
|
|
33
|
-
*
|
|
34
|
-
* This source code is licensed under the ISC license.
|
|
35
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const ot=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],lt=$("undo-2",ot);/**
|
|
37
|
-
* @license lucide-react v0.577.0 - ISC
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the ISC license.
|
|
40
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const dt=[["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"}]],K=$("wifi-off",dt);function ct(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 W(s){return(s??"").replace(/\/+$/,"")}function ut(s,t){if(!(s!=null&&s.running)||!t)return!1;const n=W(s.projectDir),a=W(t.path);return n.length>0&&n===a}function mt(s){const t=(s??"").trim();if(!t)return{goal:null,criteria:[]};const n=t.split(`
|
|
42
|
-
`);let a=null;for(const c of n){const i=c.trim();if(!i)continue;const o=i.match(/^#{1,3}\s+(.*)$/);if(o){a=o[1].trim();break}if(!i.startsWith("---")){a=i.length>200?`${i.slice(0,200)}...`:i;break}}const r=[];let u=!1;for(const c of n){const i=c.trim(),o=i.match(/^#{1,6}\s+(.*)$/);if(o){u=/acceptance|success criteria|definition of done|requirements/i.test(o[1]);continue}if(!u)continue;const m=i.match(/^[-*]\s+(?:\[[ xX]\]\s*)?(.+)$/);m&&r.push(m[1].trim())}return{goal:a,criteria:r.slice(0,12)}}function xt({detail:s,status:t,git:n,isLive:a}){var o;const{goal:r,criteria:u}=l.useMemo(()=>mt(s==null?void 0:s.prd),[s==null?void 0:s.prd]),[c,i]=l.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:r??"No spec recorded for this session"}),!r&&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(ye,{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(je,{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(Ne,{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."})]}),((o=s==null?void 0:s.prd)==null?void 0:o.trim())&&e.jsxs("div",{className:"mt-3",children:[e.jsxs("button",{type:"button",onClick:()=>i(m=>!m),"aria-expanded":c,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(we,{size:14,"aria-hidden":"true",className:`transition-transform motion-reduce:transition-none ${c?"rotate-180":""}`}),c?"Hide full spec":"Read full spec"]}),c&&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 re=["understanding","planning","editing","testing","review","pr-ready"],V={"not-started":"Not started",understanding:"Understanding",planning:"Planning",editing:"Editing",testing:"Testing",review:"Review","pr-ready":"PR ready",failed:"Failed",unknown:"Unknown"},Q={"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."},Y={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 B(s){const t=(s??"").trim();if(!t)return{display:"not-started",raw:"",recognised:!0};const n=Y[t];if(n)return{display:n,raw:t,recognised:!0};const a=Y[t.toUpperCase()];return a?{display:a,raw:t,recognised:!0}:{display:"unknown",raw:t,recognised:!1}}function ht(s){return re.indexOf(s)}function pt({state:s,view:t}){return s==="active"?t==="paused"?e.jsx(G,{size:16,"aria-hidden":"true"}):t==="failed"?e.jsx(q,{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(Oe,{size:16,"aria-hidden":"true",className:"relative"})]}):s==="done"?e.jsx(ae,{size:16,"aria-hidden":"true"}):e.jsx(Xe,{size:16,"aria-hidden":"true"})}function ft({phase:s,view:t,isLive:n,iteration:a}){const r=ht(s.display),u=s.display==="failed"||s.display==="pr-ready";function c(i,o){return o===r?"active":s.display==="pr-ready"?"done":n&&o<r?"ahead":!n&&r>=0&&o<r?"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: ${V[s.display]}`}),e.jsx("ol",{className:"mt-3 space-y-0.5",children:re.map((i,o)=>{const m=c(i,o),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(pt,{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:V[i]}),x&&e.jsx("span",{className:"mt-0.5 block text-small text-muted-accessible dark:text-dark-muted",children:Q[i]})]})]},i)})}),s.display==="failed"&&e.jsx("p",{className:"mt-2 rounded-btn bg-danger/10 px-2 py-2 text-caption text-danger",children:Q.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 X(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 D({icon:s,label:t,value:n,note:a,muted:r}){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",r?"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 gt({status:s,isLive:t,elapsedSeconds:n,timeToFirstSignal:a}){const r=(s==null?void 0:s.iteration)??0,u=typeof(s==null?void 0:s.cost)=="number"&&s.cost>0?s.cost:null;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(D,{icon:We,label:"Elapsed",value:n!==null?X(n):"--",note:t?void 0:"Only measured while a run is live",muted:n===null}),e.jsx(D,{icon:Se,label:"First signal",value:a!==null?X(a):"--",note:a!==null?"Observed since this view opened":t?"Not yet observed in this view":"Not recorded",muted:a===null}),e.jsx(D,{icon:it,label:"Iteration",value:t&&r>0?String(r):"--",note:t&&r>0?void 0:"Not reported",muted:!t||r<=0}),e.jsx(D,{icon:Ve,label:"Cost",value:u!==null?`$${u.toFixed(2)}`:"--",note:u!==null?void 0:"Not recorded",muted:u===null})]})]})}const kt=B(null);function bt(s,t){return t?s:null}function vt(s,t){var u,c;const n=((s==null?void 0:s.status)??"").toLowerCase();if(n==="failed")return"failed";if(n==="paused")return"paused";if(n==="completed")return"completed";if(n==="unknown")return"unknown";const a=!!((u=s==null?void 0:s.prd)!=null&&u.trim()),r=(((c=s==null?void 0:s.files)==null?void 0:c.length)??0)>0;return!a&&!t&&!r?"empty":"unknown"}async function Z(s,t,n){try{return{data:await s,error:null}}catch(a){return{data:t,error:a instanceof Error?a.message:n}}}function yt(s,t,n){return s>0?null:n?"error":t?"clean":null}function jt(s){const[t,n]=l.useState(null),[a,r]=l.useState(null),[u,c]=l.useState(null),[i,o]=l.useState(null),[m,x]=l.useState(null),[f,S]=l.useState([]),[b,N]=l.useState(null),[j,v]=l.useState([]),[h,k]=l.useState(!0),[E,d]=l.useState(null),[g,M]=l.useState(!0),[ie,oe]=l.useState(0),[L,le]=l.useState(()=>Date.now()),[F,de]=l.useState(null),P=l.useRef(null),ce=l.useRef(Date.now()),ue=l.useCallback(()=>oe(p=>p+1),[]);l.useEffect(()=>{if(!s)return;let p=!1;return k(!0),d(null),w.getSessionDetail(s).then(y=>{p||(n(y),v(y.logs??[]))}).catch(y=>{p||d(y instanceof Error?y.message:"Failed to load session")}).finally(()=>{p||k(!1)}),w.getStatus().then(y=>{p||(r(y),P.current=Date.now())}).catch(()=>{}),w.getChecklist().then(y=>!p&&c(y)).catch(()=>{}),Z(w.git.status(s),null,"Could not load working tree status").then(({data:y,error:A})=>{p||(o(y),x(A))}),Z(w.getCheckpoints(s),[],"Could not load checkpoints").then(({data:y,error:A})=>{p||(S(y),N(A))}),()=>{p=!0}},[s,ie]),l.useEffect(()=>{const p=new Ce,y=p.on("state_update",z=>{var _;const R=z;R!=null&&R.status&&(r(R.status),P.current=Date.now()),(_=R==null?void 0:R.logs)!=null&&_.length&&v(be=>[...be,...R.logs.map(ve=>ve.message)].slice(-500))}),A=p.on("log",z=>{const R=z==null?void 0:z.line;R&&v(_=>[..._,R].slice(-500))}),ge=p.on("connected",()=>M(!0)),ke=p.on("disconnected",()=>M(!1));return p.connect(),()=>{y(),A(),ge(),ke(),p.disconnect()}},[]),l.useEffect(()=>{const p=setInterval(()=>le(Date.now()),1e3);return()=>clearInterval(p)},[]);const C=ut(a,t),me=l.useMemo(()=>B(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]);l.useEffect(()=>{if(!C||F!==null)return;const p=(a==null?void 0:a.phase)??"";p&&p!=="idle"&&p!=="starting"&&p!=="BOOTSTRAP"&&de(Math.max(0,Math.round((Date.now()-ce.current)/1e3)))},[C,a==null?void 0:a.phase,F]);const xe=l.useMemo(()=>{var p;if(h)return"loading";if(C){if(a!=null&&a.paused)return"paused";const y=a==null?void 0:a.exit_code;return typeof y=="number"&&y!==0?"failed":(a==null?void 0:a.phase)==="starting"?"recovering":g?"running":"disconnected"}return vt(t,(((p=i==null?void 0:i.files)==null?void 0:p.length)??0)>0)},[h,C,g,a,t,i]),he=l.useMemo(()=>{if(!C||typeof(a==null?void 0:a.uptime)!="number")return null;const p=P.current?(L-P.current)/1e3:0;return Math.max(0,Math.round(a.uptime+p))},[C,a==null?void 0:a.uptime,L]),pe=l.useMemo(()=>!C||P.current===null?null:L-P.current,[C,L]),fe=l.useMemo(()=>ct(i==null?void 0:i.files),[i]);return{view:xe,detail:t,status:a,isLive:C,phase:me??kt,checklist:bt(u,C),changedFiles:fe,git:i,gitError:m,checkpoints:f,checkpointsError:b,logs:j,elapsedSeconds:he,timeToFirstSignal:F,dataAgeMs:pe,stale:C&&!g,error:E,reload:ue}}const Nt={added:st,deleted:Je,modified:H,renamed:H,untracked:He},wt={added:"text-success",deleted:"text-danger",modified:"text-info",renamed:"text-info",untracked:"text-warning"};function St({sessionId:s,files:t,clean:n,gitError:a}){const[r,u]=l.useState(null),[c,i]=l.useState(null),[o,m]=l.useState(!1),[x,f]=l.useState(null),[S,b]=l.useState(0),N=l.useRef(null);l.useEffect(()=>{if(!r)return;let h=!1;return m(!0),f(null),i(null),w.getSessionFileContent(s,r).then(k=>!h&&i(k.content)).catch(k=>!h&&f(k instanceof Error?k.message:"Could not read this file")).finally(()=>!h&&m(!1)),()=>{h=!0}},[s,r]);function j(h){var d;if(t.length===0)return;let k=S;if(h.key==="ArrowDown")k=Math.min(S+1,t.length-1);else if(h.key==="ArrowUp")k=Math.max(S-1,0);else if(h.key==="Home")k=0;else if(h.key==="End")k=t.length-1;else if(h.key==="Enter"||h.key===" "){h.preventDefault(),u(t[S].path);return}else return;h.preventDefault(),b(k);const E=(d=N.current)==null?void 0:d.querySelectorAll("li > button")[k];E==null||E.focus()}const v=yt(t.length,n,a);return v?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"}),v==="error"?e.jsxs("p",{className:"mt-3 text-caption text-danger",children:["Could not load working tree status: ",a]}):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:N,role:"listbox","aria-label":"Changed files",tabIndex:t.length?0:-1,onKeyDown:j,className:"max-h-72 space-y-0.5 overflow-y-auto lg:max-h-none",children:t.map((h,k)=>{const E=Nt[h.status]??H,d=r===h.path;return e.jsx("li",{role:"option","aria-selected":d,children:e.jsxs("button",{type:"button",tabIndex:k===S?0:-1,onFocus:()=>b(k),onClick:()=>u(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",d?"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:wt[h.status]??"text-muted-accessible",children:e.jsx(E,{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:[!r&&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."}),r&&o&&e.jsxs("p",{className:"p-4 text-caption text-muted-accessible dark:text-dark-muted",children:["Loading ",r,"..."]}),r&&x&&e.jsx("p",{className:"p-4 text-caption text-danger",children:x}),r&&c!==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:c})]})]})]})}const J={pass:{Icon:ae,cls:"text-success"},fail:{Icon:Me,cls:"text-danger"},skip:{Icon:Be,cls:"text-muted-accessible"},pending:{Icon:Ee,cls:"text-warning"}},O={running:!1,returncode:null,output:null,error:null};function Ct({sessionId:s,checklist:t}){const[n,a]=l.useState(O),[r,u]=l.useState(O);function c(o,m){const x=o==="tests"?a:u;x({...O,running:!0}),m().then(f=>x({running:!1,returncode:f.returncode,output:f.output,error:null})).catch(f=>x({running:!1,returncode:null,output:null,error:f instanceof Error?f.message:"Failed to run"}))}const i=!!(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(Re,{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"}),i?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(o=>{const{Icon:m,cls:x}=J[o.status]??J.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:o.label}),e.jsx("span",{className:"sr-only",children:o.status}),o.details&&e.jsx("span",{className:"block text-small text-muted-accessible dark:text-dark-muted",children:o.details})]})]},o.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(ee,{name:"Generate tests (loki test)",state:n,describe:o=>o===0?{text:"Exit 0: test files were generated. No tests were run.",cls:"text-ink dark:text-dark-ink"}:{text:`Exit ${o}: no test files generated, or the command could not run. See the output.`,cls:"text-danger"},onRun:()=>c("tests",()=>w.testProject(s))}),e.jsx(ee,{name:"Code review (loki review)",state:r,describe:(o,m)=>o!==0?{text:`Exit ${o}: findings reported, or the command could not run. See the output.`,cls:"text-danger"}:/No changes to review/i.test(m??"")?{text:"Exit 0: nothing was reviewed (no changes found).",cls:"text-muted-accessible dark:text-dark-muted"}:{text:"Exit 0: no high or critical findings reported.",cls:"text-success"},onRun:()=>c("review",()=>w.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."})]})]})}function ee({name:s,state:t,describe:n,onRun:a}){const r=t.returncode===null?null:n(t.returncode,t.output);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 ${(r==null?void 0:r.cls)??"text-muted-accessible dark:text-dark-muted"}`,children:t.running?"Running...":t.error?t.error:(r==null?void 0:r.text)??"Not run"})]}),e.jsxs("button",{type:"button",onClick:a,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(ne,{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 Rt(s,t,n,a){const r=[],u=(t==null?void 0:t.items.filter(o=>o.status==="fail"))??[];u.length>0&&r.push(`${u.length} quality gate(s) failed: ${u.map(o=>o.label).join(", ")}.`),(!t||t.items.length===0)&&r.push("No quality gate results were recorded, so nothing here is verified.");const c=(t==null?void 0:t.items.filter(o=>o.status==="pending"))??[];c.length>0&&r.push(`${c.length} gate(s) still pending.`),s.length>20&&r.push(`${s.length} files changed, which is a large surface to review.`);const i=s.filter(o=>o.status==="untracked").length;return i>0&&r.push(`${i} file(s) are untracked and would not be included in a commit.`),a?r.push(`Could not load checkpoints: ${a}`):n.length===0&&r.push("No checkpoints were recorded, so there is nothing to roll back to."),r}function Et({sessionId:s,checkpoints:t,checkpointsError:n,changedFiles:a,checklist:r,isLive:u,onRestored:c}){const[i,o]=l.useState(null),[m,x]=l.useState(!1),[f,S]=l.useState(null),b=Rt(a,r,t,n);function N(j){x(!0),S(null),w.restoreCheckpoint(s,j.id).then(v=>{S(`Restored: ${v.description}`),o(null),c()}).catch(v=>S(v instanceof Error?v.message:"Restore failed")).finally(()=>x(!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(q,{size:13,"aria-hidden":"true"}),"Risk"]}),b.length>0?e.jsx("ul",{className:"mt-3 space-y-1.5",children:b.map(j=>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:j})]},j))}):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(qe,{size:14,"aria-hidden":"true"}),"Rollback"]}),n&&t.length===0?e.jsxs("p",{className:"mt-1 text-caption text-danger",children:["Could not load checkpoints: ",n]}):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(j=>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:j.description}),e.jsxs("p",{className:"text-small text-muted-accessible dark:text-dark-muted",children:[j.timestamp||"no timestamp"," - iteration ",j.iteration??"--"," -"," ",j.files_changed??"--"," file(s)"]})]}),e.jsxs("button",{type:"button",onClick:()=>o(j),disabled:m||u,title:u?"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(lt,{size:12,"aria-hidden":"true"}),"Roll back"]})]},j.id))}),u&&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."})]}),i&&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 "',i.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 ",i.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:()=>N(i),disabled:m,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:m?"Restoring...":"Yes, roll back"}),e.jsx("button",{type:"button",onClick:()=>o(null),disabled:m,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"})]})]}),f&&e.jsx("p",{role:"status",className:"mt-2 text-caption text-secondary dark:text-dark-ink",children:f})]})}function Mt({isLive:s,status:t,git:n,changedFiles:a,prTitle:r}){const u=t===null?"Run status not loaded":null,c=s?null:"No run in progress for this session",i=n===null?"Working tree status not loaded":null,o=!!(t!=null&&t.paused),m=a.length>0,x=(n==null?void 0:n.ahead)??0;return{pause:u??c??(o?"Already paused":null),resume:u??c??(o?null:"The run is not paused"),stop:u??c,commit:i??(m?null:"The working tree is clean"),push:i??(x<=0?"Nothing to push: no commits ahead of the remote":null),pr:i??(!m&&x<=0?"Nothing to open a pull request for":r.trim()?null:"Enter a title first")}}function $t({sessionId:s,isLive:t,status:n,git:a,changedFiles:r,onChanged:u}){const[c,i]=l.useState(null),[o,m]=l.useState(null),[x,f]=l.useState(""),[S,b]=l.useState(null),[N,j]=l.useState(""),v=Mt({isLive:t,status:n,git:a,changedFiles:r,prTitle:x}),h=[{key:"pause",label:"Pause",icon:G,disabledReason:v.pause,onRun:()=>w.pauseSession().then(d=>d.message??"Paused")},{key:"resume",label:"Resume",icon:ne,disabledReason:v.resume,onRun:()=>w.resumeSession().then(d=>d.message??"Resumed")},{key:"stop",label:"Stop run",icon:De,danger:!0,disabledReason:v.stop,onRun:()=>w.stopSession().then(d=>d.message??"Stopped")},{key:"commit",label:"Commit",icon:Ge,disabledReason:v.commit,onRun:()=>w.git.commit(s,x.trim()||"Loki: apply changes").then(d=>`Committed ${d.hash.slice(0,7)}`)},{key:"push",label:"Push",icon:Qe,disabledReason:v.push,onRun:()=>w.git.push(s).then(d=>d.message??"Pushed")},{key:"pr",label:"Open pull request",icon:Ue,disabledReason:v.pr,onRun:()=>w.git.pr(s,x.trim(),"").then(d=>`Opened #${d.number}: ${d.url}`)}];function k(d){!d.onRun||d.disabledReason||(i(d.key),m(null),d.onRun().then(g=>{m(g),u()}).catch(g=>m(g instanceof Error?g.message:`${d.label} failed`)).finally(()=>i(null)))}function E(){const d=N.trim();d&&(i("preview"),b(null),w.previewChanges(s,d).then(g=>b(g.files.length===0?"No files would change.":`${g.files.length} file(s) would change: +${g.total_additions} / -${g.total_deletions}
|
|
43
|
-
|
|
44
|
-
${g.files.map(M=>`${M.action.padEnd(7)} ${M.path} +${M.additions} -${M.deletions}`).join(`
|
|
45
|
-
`)}`)).catch(g=>b(g instanceof Error?g.message:"Preview failed")).finally(()=>i(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:d=>f(d.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:h.map(d=>{const g=!!d.disabledReason||c!==null,M=d.icon;return e.jsxs("button",{type:"button",onClick:()=>k(d),disabled:g,"aria-describedby":d.disabledReason?`reason-${d.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",d.danger?"border-danger/30 bg-danger/10 text-danger hover:bg-danger/20":"border-primary/30 text-primary hover:bg-primary/5",g?"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}),c===d.key?"Working...":d.label]},d.key)})}),e.jsx("ul",{className:"mt-2 space-y-0.5",children:h.filter(d=>d.disabledReason).map(d=>e.jsxs("li",{id:`reason-${d.key}`,className:"text-small text-muted-accessible dark:text-dark-muted",children:[d.label,": ",d.disabledReason,"."]},d.key))}),o&&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:o}),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(at,{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:N,onChange:d=>j(d.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:E,disabled:!N.trim()||c!==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:c==="preview"?"Previewing...":"Preview change"}),S&&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:S})]}),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(Ke,{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 Tt({logs:s,isLive:t}){const[n,a]=l.useState(!1),[r,u]=l.useState(!0),c=l.useRef(null);return l.useEffect(()=>{!n||!r||!c.current||(c.current.scrollTop=c.current.scrollHeight)},[s,n,r]),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(i=>!i),"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($e,{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(Te,{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:r,onChange:i=>u(i.target.checked),className:"accent-primary"}),"Follow output"]})}),e.jsx("div",{ref:c,onScroll:i=>{const o=i.currentTarget;!(o.scrollHeight-o.scrollTop-o.clientHeight<24)&&r&&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
|
-
`)})})]})]})}const te={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 Pt({view:s,status:t,dataAgeMs:n,stale:a}){const r=t==null?void 0:t.exit_code,u=n!==null?Math.round(n/1e3):null,c=(()=>{switch(s){case"running":return{tone:"running",Icon:U,spin:!0,text:"Running",detail:(t==null?void 0:t.current_task)||void 0};case"paused":return{tone:"warning",Icon:G,text:"Paused",detail:"Resume to continue."};case"recovering":return{tone:"warning",Icon:U,spin:!0,text:"Starting up",detail:"The process is alive but has not written any state yet."};case"failed":return{tone:"danger",Icon:q,text:"Run failed",detail:typeof r=="number"?`Process exited with code ${r}.`:void 0};case"completed":return{tone:"success",Icon:Ae,text:"Run finished"};case"unknown":return{tone:"neutral",Icon:Pe,text:"Status unknown",detail:"No clean-exit marker was found for this session."};case"disconnected":return{tone:"warning",Icon:K,text:"Disconnected",detail:u!==null?`Showing the last state received ${u}s ago. Reconnecting.`:"Showing the last state received. Reconnecting."};default:return null}})();if(!c)return null;const{Icon:i}=c,o=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 ${te[c.tone]}`,children:[e.jsx(i,{size:14,className:c.spin?"animate-spin motion-reduce:animate-none":void 0}),e.jsx("span",{className:"text-caption font-semibold",children:c.text}),c.detail&&e.jsx("span",{className:"text-caption opacity-80",children:c.detail})]}),o&&e.jsxs("div",{className:`flex flex-wrap items-center gap-x-2 px-4 py-1.5 sm:px-6 ${te.warning}`,children:[e.jsx(K,{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 At({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 se=[{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:""}],T="rounded-card border border-border bg-card shadow-card dark:border-dark-border dark:bg-dark-card";function zt({sessionId:s,onClose:t}){var i,o;const n=jt(s),[a,r]=l.useState(!1),u=l.useRef(!1);if(l.useEffect(()=>{function m(x){const f=x.target;if(!(f instanceof HTMLInputElement||f instanceof HTMLTextAreaElement||f!=null&&f.isContentEditable||x.metaKey||x.ctrlKey||x.altKey)){if(x.key==="Escape"){r(!1),u.current=!1;return}if(x.key==="?"){x.preventDefault(),r(b=>!b);return}if(x.key==="g"){u.current=!0;return}if(u.current){u.current=!1;const b=se.find(N=>N.keys===`g then ${x.key}`);if(b!=null&&b.id){const N=document.getElementById(b.id);N&&(x.preventDefault(),N.scrollIntoView({behavior:"smooth",block:"start"}),N.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 c=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(ze,{size:14,"aria-hidden":"true"}),"Back"]}),e.jsxs("button",{type:"button",onClick:()=>r(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(Ie,{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:se.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(Pt,{view:n.view,status:n.status,dataAgeMs:n.dataAgeMs,stale:n.stale}),n.view==="failed"&&e.jsx(At,{status:n.status}),e.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[e.jsx(xt,{detail:n.detail,status:n.status,git:n.git,isLive:n.isLive}),c?e.jsx("div",{className:"p-6",children:e.jsxs("div",{className:`${T} 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:T,children:e.jsx(ft,{phase:n.phase,view:n.view,isLive:n.isLive,iteration:((i=n.status)==null?void 0:i.iteration)??void 0})}),e.jsx("div",{className:T,children:e.jsx(gt,{status:n.status,isLive:n.isLive,elapsedSeconds:n.elapsedSeconds,timeToFirstSignal:n.timeToFirstSignal})}),e.jsx("div",{className:`${T} md:col-span-2 xl:col-span-1`,children:e.jsx(Et,{sessionId:s,checkpoints:n.checkpoints,checkpointsError:n.checkpointsError,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:`${T} min-w-0`,children:e.jsx(St,{sessionId:s,files:n.changedFiles,clean:((o=n.git)==null?void 0:o.clean)??n.changedFiles.length===0,gitError:n.gitError})}),e.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[e.jsx("div",{id:"region-evidence",tabIndex:-1,className:`${T} min-w-0`,children:e.jsx(Ct,{sessionId:s,checklist:n.checklist})}),e.jsx("div",{id:"region-actions",tabIndex:-1,className:`${T} min-w-0`,children:e.jsx($t,{sessionId:s,isLive:n.isLive,status:n.status,git:n.git,changedFiles:n.changedFiles,onChanged:n.reload})})]})]})]})]}),e.jsx(Tt,{logs:n.logs,isLive:n.isLive})]})}function qt(){const{sessionId:s}=Le(),t=_e();return s?e.jsx("div",{className:"h-screen bg-background dark:bg-dark-bg",children:e.jsx(Fe,{name:"ExecutionCockpit",children:e.jsx(zt,{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{qt as default};
|