@rigour-labs/cli 2.21.0 → 2.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -41,7 +41,8 @@ Agent writes code → Rigour checks → FAIL? → Fix Packet → Agent retries
41
41
  | **Hygiene** | No TODO/FIXME comments allowed |
42
42
  | **Complexity** | Cyclomatic complexity limits (AST-based) |
43
43
  | **Required Docs** | SPEC.md, ARCH.md, README must exist |
44
- | **Safety Rails** | Protected paths, max files changed |
44
+ | **File Guard** | Protected paths, max files changed |
45
+ | **Security Patterns** | XSS, SQL injection, hardcoded secrets, command injection (enabled by default) |
45
46
  | **Context Alignment** | Prevents drift by anchoring on project patterns |
46
47
 
47
48
  ## 🛠️ Commands
@@ -7,7 +7,8 @@ export async function guideCommand() {
7
7
  console.log(chalk.dim(' 3. Run ') + chalk.cyan('rigour run -- <your-agent-command>') + chalk.dim(' to automate the fix loop.\n'));
8
8
  console.log(chalk.bold('Key Concepts:'));
9
9
  console.log(chalk.yellow(' • Fix Packet v2') + chalk.dim(': Structured diagnostics fed directly into AI agents.'));
10
- console.log(chalk.yellow(' • Safety Rails') + chalk.dim(': Prevents "explosive" refactoring (max files changed).'));
10
+ console.log(chalk.yellow(' • File Guard') + chalk.dim(': Protects critical paths from agent modification (max files changed).'));
11
+ console.log(chalk.yellow(' • Security Patterns') + chalk.dim(': Detects XSS, SQL injection, hardcoded secrets, command injection (enabled by default).'));
11
12
  console.log(chalk.yellow(' • Strategic Guardians') + chalk.dim(': Dependency and Architectural boundary enforcement.\n'));
12
13
  console.log(chalk.bold('Workflow Integration:'));
13
14
  console.log(chalk.green(' • Cursor') + chalk.dim(': Add the MCP server or use the ') + chalk.cyan('.cursor/rules/rigour.mdc') + chalk.dim(' handshake.'));
@@ -65,7 +65,7 @@ export async function runLoop(cwd, agentArgs, options) {
65
65
  const changedThisCycle = afterFiles.filter(f => !beforeFiles.includes(f));
66
66
  const maxFiles = config.gates.safety?.max_files_changed_per_cycle || 10;
67
67
  if (changedThisCycle.length > maxFiles) {
68
- console.log(chalk.red.bold(`\n🛑 SAFETY RAIL ABORT: Agent changed ${changedThisCycle.length} files (max: ${maxFiles}).`));
68
+ console.log(chalk.red.bold(`\n🛑 FILE GUARD ABORT: Agent changed ${changedThisCycle.length} files (max: ${maxFiles}).`));
69
69
  console.log(chalk.red(` This looks like explosive behavior. Check your agent's instructions.`));
70
70
  process.exit(EXIT_FAIL);
71
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rigour-labs/cli",
3
- "version": "2.21.0",
3
+ "version": "2.21.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "rigour": "dist/cli.js"
@@ -28,7 +28,7 @@
28
28
  "inquirer": "9.2.16",
29
29
  "ora": "^8.0.1",
30
30
  "yaml": "^2.8.2",
31
- "@rigour-labs/core": "2.21.0"
31
+ "@rigour-labs/core": "2.21.1"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/fs-extra": "^11.0.4",
@@ -288,4 +288,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
288
288
  `},Pf=j2(P2)(wg),N2={config:C2},E2=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(i){return n.reduceRight(function(s,o){return o(s)},i)}};function Sg(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],Sg(e[n],t[n]))}),kf(kf({},e),t)}var M2={type:"cancelation",msg:"operation is manually canceled"};function na(e){var t=!1,n=new Promise(function(r,i){e.then(function(s){return t?i(M2):r(s)}),e.catch(i)});return n.cancel=function(){return t=!0},n}var A2=["monaco"],D2=w2.create({config:S2,isInitialized:!1,resolve:null,reject:null,monaco:null}),jg=n2(D2,2),wi=jg[0],po=jg[1];function L2(e){var t=N2.config(e),n=t.monaco,r=e2(t,A2);po(function(i){return{config:Sg(i.config,r),monaco:n}})}function R2(){var e=wi(function(t){var n=t.monaco,r=t.isInitialized,i=t.resolve;return{monaco:n,isInitialized:r,resolve:i}});if(!e.isInitialized){if(po({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),na(ra);if(window.monaco&&window.monaco.editor)return kg(window.monaco),e.resolve(window.monaco),na(ra);E2(V2,z2)(O2)}return na(ra)}function V2(e){return document.body.appendChild(e)}function _2(e){var t=document.createElement("script");return e&&(t.src=e),t}function z2(e){var t=wi(function(r){var i=r.config,s=r.reject;return{config:i,reject:s}}),n=_2("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function O2(){var e=wi(function(n){var r=n.config,i=n.resolve,s=n.reject;return{config:r,resolve:i,reject:s}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){var r=n.m||n;kg(r),e.resolve(r)},function(n){e.reject(n)})}function kg(e){wi().monaco||po({monaco:e})}function I2(){return wi(function(e){var t=e.monaco;return t})}var ra=new Promise(function(e,t){return po({resolve:e,reject:t})}),Cg={config:L2,init:R2,__getMonacoInstance:I2},F2={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},ia=F2,B2={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},$2=B2;function U2({children:e}){return ze.createElement("div",{style:$2.container},e)}var W2=U2,H2=W2;function K2({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:s,wrapperProps:o}){return ze.createElement("section",{style:{...ia.wrapper,width:e,height:t},...o},!n&&ze.createElement(H2,null,r),ze.createElement("div",{ref:i,style:{...ia.fullWidth,...!n&&ia.hide},className:s}))}var b2=K2,Tg=k.memo(b2);function G2(e){k.useEffect(e,[])}var Pg=G2;function Q2(e,t,n=!0){let r=k.useRef(!0);k.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var _e=Q2;function Br(){}function $n(e,t,n,r){return q2(e,r)||Y2(e,t,n,r)}function q2(e,t){return e.editor.getModel(Ng(e,t))}function Y2(e,t,n,r){return e.editor.createModel(t,n,r?Ng(e,r):void 0)}function Ng(e,t){return e.Uri.parse(t)}function X2({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:s,modifiedModelPath:o,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:d="Loading...",options:f={},height:h="100%",width:v="100%",className:x,wrapperProps:y={},beforeMount:C=Br,onMount:m=Br}){let[p,g]=k.useState(!1),[S,w]=k.useState(!0),j=k.useRef(null),P=k.useRef(null),N=k.useRef(null),V=k.useRef(m),M=k.useRef(C),W=k.useRef(!1);Pg(()=>{let O=Cg.init();return O.then($=>(P.current=$)&&w(!1)).catch($=>($==null?void 0:$.type)!=="cancelation"&&console.error("Monaco initialization: error:",$)),()=>j.current?Ee():O.cancel()}),_e(()=>{if(j.current&&P.current){let O=j.current.getOriginalEditor(),$=$n(P.current,e||"",r||n||"text",s||"");$!==O.getModel()&&O.setModel($)}},[s],p),_e(()=>{if(j.current&&P.current){let O=j.current.getModifiedEditor(),$=$n(P.current,t||"",i||n||"text",o||"");$!==O.getModel()&&O.setModel($)}},[o],p),_e(()=>{let O=j.current.getModifiedEditor();O.getOption(P.current.editor.EditorOption.readOnly)?O.setValue(t||""):t!==O.getValue()&&(O.executeEdits("",[{range:O.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),O.pushUndoStop())},[t],p),_e(()=>{var O,$;($=(O=j.current)==null?void 0:O.getModel())==null||$.original.setValue(e||"")},[e],p),_e(()=>{let{original:O,modified:$}=j.current.getModel();P.current.editor.setModelLanguage(O,r||n||"text"),P.current.editor.setModelLanguage($,i||n||"text")},[n,r,i],p),_e(()=>{var O;(O=P.current)==null||O.editor.setTheme(c)},[c],p),_e(()=>{var O;(O=j.current)==null||O.updateOptions(f)},[f],p);let me=k.useCallback(()=>{var U;if(!P.current)return;M.current(P.current);let O=$n(P.current,e||"",r||n||"text",s||""),$=$n(P.current,t||"",i||n||"text",o||"");(U=j.current)==null||U.setModel({original:O,modified:$})},[n,t,i,e,r,s,o]),Ne=k.useCallback(()=>{var O;!W.current&&N.current&&(j.current=P.current.editor.createDiffEditor(N.current,{automaticLayout:!0,...f}),me(),(O=P.current)==null||O.editor.setTheme(c),g(!0),W.current=!0)},[f,c,me]);k.useEffect(()=>{p&&V.current(j.current,P.current)},[p]),k.useEffect(()=>{!S&&!p&&Ne()},[S,p,Ne]);function Ee(){var $,U,T,A;let O=($=j.current)==null?void 0:$.getModel();a||((U=O==null?void 0:O.original)==null||U.dispose()),l||((T=O==null?void 0:O.modified)==null||T.dispose()),(A=j.current)==null||A.dispose()}return ze.createElement(Tg,{width:v,height:h,isEditorReady:p,loading:d,_ref:N,className:x,wrapperProps:y})}var Z2=X2,J2=k.memo(Z2);function ej(e){let t=k.useRef();return k.useEffect(()=>{t.current=e},[e]),t.current}var tj=ej,Hi=new Map;function nj({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:s,theme:o="light",line:a,loading:l="Loading...",options:c={},overrideServices:d={},saveViewState:f=!0,keepCurrentModel:h=!1,width:v="100%",height:x="100%",className:y,wrapperProps:C={},beforeMount:m=Br,onMount:p=Br,onChange:g,onValidate:S=Br}){let[w,j]=k.useState(!1),[P,N]=k.useState(!0),V=k.useRef(null),M=k.useRef(null),W=k.useRef(null),me=k.useRef(p),Ne=k.useRef(m),Ee=k.useRef(),O=k.useRef(r),$=tj(s),U=k.useRef(!1),T=k.useRef(!1);Pg(()=>{let L=Cg.init();return L.then(z=>(V.current=z)&&N(!1)).catch(z=>(z==null?void 0:z.type)!=="cancelation"&&console.error("Monaco initialization: error:",z)),()=>M.current?R():L.cancel()}),_e(()=>{var z,se,q,ot;let L=$n(V.current,e||r||"",t||i||"",s||n||"");L!==((z=M.current)==null?void 0:z.getModel())&&(f&&Hi.set($,(se=M.current)==null?void 0:se.saveViewState()),(q=M.current)==null||q.setModel(L),f&&((ot=M.current)==null||ot.restoreViewState(Hi.get(s))))},[s],w),_e(()=>{var L;(L=M.current)==null||L.updateOptions(c)},[c],w),_e(()=>{!M.current||r===void 0||(M.current.getOption(V.current.editor.EditorOption.readOnly)?M.current.setValue(r):r!==M.current.getValue()&&(T.current=!0,M.current.executeEdits("",[{range:M.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),M.current.pushUndoStop(),T.current=!1))},[r],w),_e(()=>{var z,se;let L=(z=M.current)==null?void 0:z.getModel();L&&i&&((se=V.current)==null||se.editor.setModelLanguage(L,i))},[i],w),_e(()=>{var L;a!==void 0&&((L=M.current)==null||L.revealLine(a))},[a],w),_e(()=>{var L;(L=V.current)==null||L.editor.setTheme(o)},[o],w);let A=k.useCallback(()=>{var L;if(!(!W.current||!V.current)&&!U.current){Ne.current(V.current);let z=s||n,se=$n(V.current,r||e||"",t||i||"",z||"");M.current=(L=V.current)==null?void 0:L.editor.create(W.current,{model:se,automaticLayout:!0,...c},d),f&&M.current.restoreViewState(Hi.get(z)),V.current.editor.setTheme(o),a!==void 0&&M.current.revealLine(a),j(!0),U.current=!0}},[e,t,n,r,i,s,c,d,f,o,a]);k.useEffect(()=>{w&&me.current(M.current,V.current)},[w]),k.useEffect(()=>{!P&&!w&&A()},[P,w,A]),O.current=r,k.useEffect(()=>{var L,z;w&&g&&((L=Ee.current)==null||L.dispose(),Ee.current=(z=M.current)==null?void 0:z.onDidChangeModelContent(se=>{T.current||g(M.current.getValue(),se)}))},[w,g]),k.useEffect(()=>{if(w){let L=V.current.editor.onDidChangeMarkers(z=>{var q;let se=(q=M.current.getModel())==null?void 0:q.uri;if(se&&z.find(ot=>ot.path===se.path)){let ot=V.current.editor.getModelMarkers({resource:se});S==null||S(ot)}});return()=>{L==null||L.dispose()}}return()=>{}},[w,S]);function R(){var L,z;(L=Ee.current)==null||L.dispose(),h?f&&Hi.set(s,M.current.saveViewState()):(z=M.current.getModel())==null||z.dispose(),M.current.dispose()}return ze.createElement(Tg,{width:v,height:x,isEditorReady:w,loading:l,_ref:W,className:y,wrapperProps:C})}var rj=nj,ij=k.memo(rj);const sj=e=>{var r;const t=(r=e.split(".").pop())==null?void 0:r.toLowerCase();return{ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",py:"python",rb:"ruby",rs:"rust",go:"go",json:"json",yaml:"yaml",yml:"yaml",md:"markdown",css:"css",scss:"scss",html:"html",xml:"xml",sql:"sql",sh:"shell",bash:"shell",zsh:"shell"}[t||""]||"plaintext"},oj=new Set(["md","mdx","markdown"]);function aj(e){var n;const t=((n=e.split(".").pop())==null?void 0:n.toLowerCase())||"";return oj.has(t)}function lj(e){let t=e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/^### (.+)$/gm,"<h3>$1</h3>").replace(/^## (.+)$/gm,"<h2>$1</h2>").replace(/^# (.+)$/gm,"<h1>$1</h1>").replace(/\*\*\*(.+?)\*\*\*/g,"<strong><em>$1</em></strong>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/`([^`]+)`/g,"<code>$1</code>").replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener">$1</a>').replace(/^---+$/gm,"<hr />").replace(/^&gt; (.+)$/gm,"<blockquote>$1</blockquote>").replace(/^[*-] (.+)$/gm,"<li>$1</li>").replace(/\n\n/g,"</p><p>");return t=t.replace(/(<li>.*<\/li>(\n)?)+/g,n=>`<ul>${n}</ul>`),t=t.replace(/```(\w*)\n([\s\S]*?)```/g,(n,r,i)=>`<pre><code>${i.trim()}</code></pre>`),`<p>${t}</p>`}const uj=({filename:e,originalCode:t,modifiedCode:n,onClose:r,theme:i="dark",violations:s=[]})=>{const o=t!==n,a=sj(e),l=i==="dark"?"vs-dark":"light",c=aj(e)&&!o,d=k.useMemo(()=>c?lj(n):"",[c,n]),f=h=>{if(!s.length||!h)return;const v=window.monaco;if(!v)return;const x=s.filter(y=>y.line).map(y=>({range:new v.Range(y.line,1,y.endLine||y.line,1),options:{isWholeLine:!0,className:"violation-line-highlight",glyphMarginClassName:"violation-glyph",glyphMarginHoverMessage:{value:`**[${y.id}] ${y.title}**
289
289
 
290
290
  ${y.details}`},overviewRuler:{color:"#f87171",position:v.editor.OverviewRulerLane.Full}}}));h.deltaDecorations([],x)};return u.jsx("div",{className:"diff-viewer-overlay",children:u.jsxs("div",{className:"diff-viewer-window",children:[u.jsxs("div",{className:"diff-viewer-header",children:[u.jsxs("div",{className:"title",children:[u.jsx(vt,{size:18}),u.jsx("span",{children:e}),o&&u.jsx("span",{className:"diff-badge",children:"Modified"}),s.length>0&&u.jsxs("span",{className:"diff-badge",style:{background:"rgba(248, 113, 113, 0.12)",color:"#f87171",borderColor:"rgba(248, 113, 113, 0.3)"},children:[s.length," violation",s.length!==1?"s":""]})]}),u.jsx("button",{onClick:r,className:"close-btn",children:u.jsx(fu,{size:20})})]}),c?u.jsx("div",{className:"markdown-viewer",dangerouslySetInnerHTML:{__html:d}}):u.jsx("div",{className:"diff-editor-container",children:o?u.jsx(J2,{height:"100%",language:a,original:t,modified:n,theme:l,options:{renderSideBySide:!0,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:13}}):u.jsx(ij,{height:"100%",language:a,value:n,theme:l,onMount:f,options:{readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:13,lineNumbers:"on",glyphMargin:s.length>0}})})]})})},cj=(e,t)=>{const n=[];e.forEach(i=>{const s=i.split("/");let o=n,a="";s.forEach((l,c)=>{a=a?`${a}/${l}`:l;const d=c<s.length-1;let f=o.find(h=>h.name===l);f||(f={name:l,path:a,isDirectory:d,children:[],isViolated:t.some(h=>h===a||h.startsWith(`${a}/`))},o.push(f)),o=f.children})});const r=i=>{i.sort((s,o)=>s.isDirectory&&!o.isDirectory?-1:!s.isDirectory&&o.isDirectory?1:s.name.localeCompare(o.name)),i.forEach(s=>r(s.children))};return r(n),n},Eg=({node:e,level:t,onSelect:n,activeFile:r})=>{const[i,s]=k.useState(t===0),o=r===e.path,a=l=>{l.stopPropagation(),e.isDirectory?s(!i):n(e.path)};return u.jsxs("div",{className:"tree-node-container",children:[u.jsxs("div",{className:`tree-item ${o?"active":""} ${e.isViolated?"violated":""}`,style:{paddingLeft:`${t*12+8}px`},onClick:a,children:[e.isDirectory?u.jsxs(u.Fragment,{children:[i?u.jsx(a0,{size:14,className:"chevron"}):u.jsx(so,{size:14,className:"chevron"}),i?u.jsx(h0,{size:14,className:"folder-icon"}):u.jsx(oo,{size:14,className:"folder-icon"})]}):u.jsx(vt,{size:14,className:"file-icon"}),u.jsx("span",{className:"node-name",title:e.path,children:e.name}),e.isViolated&&u.jsx(l0,{size:12,className:"violation-icon"})]}),e.isDirectory&&i&&u.jsx("div",{className:"tree-children",children:e.children.map(l=>u.jsx(Eg,{node:l,level:t+1,onSelect:n,activeFile:r},l.path))})]})},Nf=({files:e,onSelect:t,activeFile:n,violatedFiles:r=[]})=>{const i=k.useMemo(()=>cj(e,r),[e,r]);return u.jsxs("div",{className:"file-tree",children:[u.jsxs("div",{className:"tree-header",children:[u.jsx(oo,{size:14}),u.jsx("span",{children:"Project Explorer"})]}),u.jsx("div",{className:"tree-list",children:i.length===0?u.jsx("div",{className:"empty-tree-state",children:"No files found"}):i.map(s=>u.jsx(Eg,{node:s,level:0,onSelect:t,activeFile:n},s.path))})]})},sa=e=>typeof e=="string"?e:JSON.stringify(e,null,2),dj=()=>{const[e,t]=k.useState({memories:{}}),[n,r]=k.useState(null),[i,s]=k.useState(""),[o,a]=k.useState(!0),[l,c]=k.useState(!1),d=async()=>{a(!0);try{const p=await(await fetch("/api/memory")).json();p.memories?t(p):t({memories:p})}catch(m){console.error("Failed to fetch memory:",m)}finally{a(!1)}};k.useEffect(()=>{d()},[]);const f=Object.entries(e.memories||{}),h=f.filter(([m])=>m.toLowerCase().includes(i.toLowerCase())),v=n?e.memories[n]:null,x=m=>{try{return new Date(m).toLocaleString()}catch{return m}},y=()=>{v&&(navigator.clipboard.writeText(sa(v.value)),c(!0),setTimeout(()=>c(!1),2e3))},C=m=>{const p=sa(m);if(p.includes("1)")&&p.includes("2)")){const g=p.split(/(\d+\))/);return u.jsx("div",{className:"formatted-content",children:g.map((S,w)=>{if(/^\d+\)$/.test(S))return u.jsx("div",{className:"section-marker",children:S},w);if(S.trim().startsWith("Priority:")){const[j,P]=S.split("Priority:");return u.jsxs(ze.Fragment,{children:[j.trim()&&u.jsx("div",{className:"section-body",children:j.trim()}),u.jsx("div",{className:"priority-box",children:P.trim()})]},w)}return S.trim()?u.jsx("div",{className:"section-body",children:S.trim()},w):null})})}return u.jsx("pre",{children:p})};return u.jsxs("div",{className:"memory-bank",children:[u.jsxs("div",{className:"memory-header",children:[u.jsxs("div",{className:"memory-title",children:[u.jsx(nd,{size:24}),u.jsx("h2",{children:"Memory Bank"}),u.jsxs("span",{className:"memory-count",children:[f.length," entries"]})]}),u.jsxs("div",{className:"memory-actions",children:[u.jsxs("div",{className:"search-box",children:[u.jsx(du,{size:16}),u.jsx("input",{type:"text",placeholder:"Search memories...",value:i,onChange:m=>s(m.target.value)})]}),u.jsx("button",{className:"refresh-btn",onClick:d,disabled:o,children:u.jsx(Rs,{size:16,className:o?"spinning":""})})]})]}),u.jsxs("div",{className:"memory-content",children:[u.jsx("div",{className:"memory-list",children:o?u.jsx("div",{className:"memory-loading",children:"Loading memories..."}):h.length===0?u.jsxs("div",{className:"memory-empty",children:[u.jsx($p,{size:48}),u.jsx("h3",{children:"No Memories Stored"}),u.jsxs("p",{children:["Use ",u.jsx("code",{children:"store_memory"})," via MCP to persist agent context."]})]}):h.map(([m,p])=>u.jsxs("div",{className:`memory-item ${n===m?"active":""}`,onClick:()=>r(m),children:[u.jsxs("div",{className:"memory-item-header",children:[u.jsx(id,{size:14}),u.jsx("span",{className:"memory-key",children:m}),u.jsx(so,{size:14,className:"chevron"})]}),u.jsxs("div",{className:"memory-item-meta",children:[u.jsx(Ls,{size:12}),u.jsx("span",{children:x(p.timestamp)})]}),u.jsx("div",{className:"memory-item-preview",children:(()=>{const g=sa(p.value);return g.slice(0,100)+(g.length>100?"...":"")})()})]},m))}),u.jsx("div",{className:"memory-detail",children:v?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"detail-header",children:[u.jsx(id,{size:18}),u.jsx("h3",{children:n})]}),u.jsxs("div",{className:"detail-meta",children:[u.jsxs("div",{className:"meta-left",children:[u.jsx(Ls,{size:14}),u.jsxs("span",{children:["Stored: ",x(v.timestamp)]})]}),u.jsxs("button",{className:`copy-btn ${l?"copied":""}`,onClick:y,children:[l?u.jsx(o0,{size:14}):u.jsx(u0,{size:14}),u.jsx("span",{children:l?"Copied":"Copy"})]})]}),u.jsx("div",{className:"detail-content",children:C(v.value)})]}):u.jsxs("div",{className:"detail-placeholder",children:[u.jsx(nd,{size:48}),u.jsx("p",{children:"Select a memory to view its contents"})]})})]})]})},fj=()=>{var w;const[e,t]=k.useState({patterns:[],stats:{totalPatterns:0,totalFiles:0,byType:{}}}),[n,r]=k.useState(null),[i,s]=k.useState(""),[o,a]=k.useState("all"),[l,c]=k.useState(!0),[d,f]=k.useState(!1),[h,v]=k.useState([]),[x,y]=k.useState(!1),C=async()=>{c(!0);try{const P=await(await fetch("/api/index-stats")).json();t(P)}catch(j){console.error("Failed to fetch pattern index:",j)}finally{c(!1)}};k.useEffect(()=>{C()},[]),k.useEffect(()=>{if(!d||i.length<3){v([]);return}const j=setTimeout(async()=>{y(!0);try{const N=await(await fetch(`/api/index-search?q=${encodeURIComponent(i)}`)).json();v(N)}catch(P){console.error("Semantic search failed:",P)}finally{y(!1)}},500);return()=>clearTimeout(j)},[i,d]);const m=d&&i.length>=3?h:e.patterns||[],p=e.stats||{totalPatterns:0,totalFiles:0,byType:{}},g=d&&i.length>=3?m:m.filter(j=>{const P=j.name.toLowerCase().includes(i.toLowerCase())||j.file.toLowerCase().includes(i.toLowerCase()),N=o==="all"||j.type===o;return P&&N}),S=Object.keys(p.byType||{});return u.jsxs("div",{className:"pattern-index",children:[u.jsxs("div",{className:"pattern-header",children:[u.jsxs("div",{className:"pattern-title",children:[u.jsx(rs,{size:24}),u.jsx("h2",{children:"Pattern Index"}),u.jsxs("span",{className:"pattern-count",children:[p.totalPatterns," patterns"]})]}),u.jsxs("div",{className:"pattern-actions",children:[u.jsxs("div",{className:"search-box",children:[u.jsx(du,{size:16}),u.jsx("input",{type:"text",placeholder:"Search patterns...",value:i,onChange:j=>s(j.target.value)})]}),u.jsxs("div",{className:"filter-box",children:[u.jsx(Up,{size:16}),u.jsxs("select",{value:o,onChange:j=>a(j.target.value),children:[u.jsx("option",{value:"all",children:"All Types"}),S.map(j=>u.jsxs("option",{value:j,children:[j," (",p.byType[j],")"]},j))]})]}),u.jsxs("button",{className:`semantic-toggle ${d?"active":""}`,onClick:()=>f(!d),title:"Semantic Search (v2)",children:[u.jsx(rd,{size:16}),u.jsx("span",{children:"AI Search"})]}),u.jsx("button",{className:"refresh-btn",onClick:C,disabled:l,children:u.jsx(Rs,{size:16,className:l?"spinning":""})})]})]}),u.jsxs("div",{className:"pattern-stats",children:[u.jsxs("div",{className:"stat-card",children:[u.jsx(s0,{size:20}),u.jsxs("div",{className:"stat-info",children:[u.jsx("span",{className:"stat-value",children:p.totalPatterns}),u.jsx("span",{className:"stat-label",children:"Total Patterns"})]})]}),u.jsxs("div",{className:"stat-card",children:[u.jsx(vt,{size:20}),u.jsxs("div",{className:"stat-info",children:[u.jsx("span",{className:"stat-value",children:p.totalFiles}),u.jsx("span",{className:"stat-label",children:"Files Indexed"})]})]}),u.jsxs("div",{className:"stat-card",children:[u.jsx(rd,{size:20}),u.jsxs("div",{className:"stat-info",children:[u.jsx("span",{className:"stat-value",children:S.length}),u.jsx("span",{className:"stat-label",children:"Pattern Types"})]})]}),p.indexDurationMs&&u.jsxs("div",{className:"stat-card",children:[u.jsx(Ls,{size:20}),u.jsxs("div",{className:"stat-info",children:[u.jsxs("span",{className:"stat-value",children:[p.indexDurationMs,"ms"]}),u.jsx("span",{className:"stat-label",children:"Index Time"})]})]})]}),u.jsxs("div",{className:"pattern-content",children:[u.jsxs("div",{className:"pattern-list",children:[x&&u.jsxs("div",{className:"searching-indicator",children:[u.jsx(Rs,{size:14,className:"spinning"}),u.jsx("span",{children:"AI is analyzing your query..."})]}),l?u.jsx("div",{className:"pattern-loading",children:"Loading patterns..."}):g.length===0?u.jsxs("div",{className:"pattern-empty",children:[u.jsx(rs,{size:48}),u.jsx("h3",{children:"No Patterns Indexed"}),u.jsxs("p",{children:["Run ",u.jsx("code",{children:"rigour index"})," to scan your codebase."]})]}):g.map(j=>u.jsxs("div",{className:`pattern-item ${(n==null?void 0:n.id)===j.id?"active":""}`,onClick:()=>r(j),children:[j.similarity&&u.jsxs("div",{className:"similarity-badge",children:[(j.similarity*100).toFixed(0),"% Match"]}),u.jsxs("div",{className:"pattern-item-header",children:[u.jsx("span",{className:"pattern-type-badge",children:j.type}),u.jsx("span",{className:"pattern-name",children:j.name}),u.jsx(so,{size:14,className:"chevron"})]}),u.jsxs("div",{className:"pattern-item-file",children:[u.jsx(vt,{size:12}),u.jsxs("span",{children:[j.file,":",j.line]})]}),j.exported&&u.jsx("span",{className:"exported-badge",children:"exported"})]},j.id))]}),u.jsx("div",{className:"pattern-detail",children:n?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"detail-header",children:[u.jsx("span",{className:"pattern-type-badge large",children:n.type}),u.jsx("h3",{children:n.name})]}),u.jsxs("div",{className:"detail-section",children:[u.jsx("h4",{children:"Location"}),u.jsxs("code",{children:[n.file,":",n.line,"-",n.endLine]})]}),n.signature&&u.jsxs("div",{className:"detail-section",children:[u.jsx("h4",{children:"Signature"}),u.jsx("pre",{children:n.signature})]}),n.description&&u.jsxs("div",{className:"detail-section",children:[u.jsx("h4",{children:"Description"}),u.jsx("p",{children:n.description})]}),((w=n.keywords)==null?void 0:w.length)>0&&u.jsxs("div",{className:"detail-section",children:[u.jsx("h4",{children:"Keywords"}),u.jsx("div",{className:"keywords-list",children:n.keywords.map((j,P)=>u.jsx("span",{className:"keyword-tag",children:j},P))})]}),u.jsxs("div",{className:"detail-section",children:[u.jsx("h4",{children:"Usage"}),u.jsxs("p",{children:["Imported in ",u.jsx("strong",{children:n.usageCount})," files"]})]})]}):u.jsxs("div",{className:"detail-placeholder",children:[u.jsx(rs,{size:48}),u.jsx("p",{children:"Select a pattern to view details"})]})})]})]})},hj=()=>{const[e,t]=k.useState(null),[n,r]=k.useState(""),[i,s]=k.useState(!0),[o,a]=k.useState("visual"),l=async()=>{s(!0);try{const h=await(await fetch("/api/config")).text();r(h);const v=c(h);t(v)}catch(f){console.error("Failed to fetch config:",f)}finally{s(!1)}},c=f=>{var h;try{const v=f.split(`
291
- `),x={};let y=null,C=null;for(const m of v){if(m.startsWith("#")||!m.trim())continue;const p=m.search(/\S/),g=m.trim();if(p===0&&g.includes(":")){const[S]=g.split(":");y=S.trim(),C=null;const w=(h=g.split(":")[1])==null?void 0:h.trim();w&&w!=="{}"&&w!=="[]"?x[y]=isNaN(Number(w))?w:Number(w):x[y]={}}else if(p===2&&y&&g.includes(":")){const[S]=g.split(":");C=S.trim();const w=g.split(":").slice(1).join(":").trim();if(w&&w!=="{}"&&w!=="[]"){typeof x[y]!="object"&&(x[y]={});const j=w==="true"?!0:w==="false"?!1:isNaN(Number(w))?w:Number(w);x[y][C]=j}else typeof x[y]!="object"&&(x[y]={}),x[y][C]={}}else if(p===4&&y&&C&&g.includes(":")){const[S]=g.split(":"),w=g.split(":").slice(1).join(":").trim();typeof x[y][C]!="object"&&(x[y][C]={});const j=w==="true"?!0:w==="false"?!1:isNaN(Number(w))?w:Number(w);x[y][C][S.trim()]=j}}return x}catch{return{}}};k.useEffect(()=>{l()},[]);const d=(e==null?void 0:e.gates)||{};return u.jsxs("div",{className:"quality-gates",children:[u.jsxs("div",{className:"gates-header",children:[u.jsxs("div",{className:"gates-title",children:[u.jsx(y0,{size:24}),u.jsx("h2",{children:"Quality Gates"}),(e==null?void 0:e.preset)&&u.jsx("span",{className:"preset-badge",children:e.preset})]}),u.jsxs("div",{className:"gates-actions",children:[u.jsxs("div",{className:"view-toggle",children:[u.jsxs("button",{className:o==="visual"?"active":"",onClick:()=>a("visual"),children:[u.jsx(rs,{size:16})," Visual"]}),u.jsxs("button",{className:o==="raw"?"active":"",onClick:()=>a("raw"),children:[u.jsx(vt,{size:16})," YAML"]})]}),u.jsx("button",{className:"refresh-btn",onClick:l,disabled:i,children:u.jsx(Rs,{size:16,className:i?"spinning":""})})]})]}),i?u.jsx("div",{className:"gates-loading",children:"Loading configuration..."}):o==="raw"?u.jsx("div",{className:"gates-raw",children:u.jsx("pre",{children:n})}):u.jsxs("div",{className:"gates-content",children:[u.jsxs("div",{className:"gate-section",children:[u.jsxs("div",{className:"section-header",children:[u.jsx(vt,{size:18}),u.jsx("h3",{children:"Code Quality"})]}),u.jsxs("div",{className:"gate-grid",children:[u.jsx(je,{label:"Max File Lines",value:d.max_file_lines,icon:u.jsx(vt,{size:16})}),u.jsx(je,{label:"Forbid TODOs",value:d.forbid_todos,icon:d.forbid_todos?u.jsx(ii,{size:16}):u.jsx(tr,{size:16})}),u.jsx(je,{label:"Forbid FIXMEs",value:d.forbid_fixme,icon:d.forbid_fixme?u.jsx(ii,{size:16}):u.jsx(tr,{size:16})})]})]}),d.ast&&u.jsxs("div",{className:"gate-section",children:[u.jsxs("div",{className:"section-header",children:[u.jsx(p0,{size:18}),u.jsx("h3",{children:"AST Limits"})]}),u.jsxs("div",{className:"gate-grid",children:[u.jsx(je,{label:"Complexity",value:d.ast.complexity}),u.jsx(je,{label:"Max Methods",value:d.ast.max_methods}),u.jsx(je,{label:"Max Params",value:d.ast.max_params}),u.jsx(je,{label:"Max Nesting",value:d.ast.max_nesting}),u.jsx(je,{label:"Max Function Lines",value:d.ast.max_function_lines}),u.jsx(je,{label:"Max Inheritance",value:d.ast.max_inheritance_depth})]})]}),d.safety&&u.jsxs("div",{className:"gate-section",children:[u.jsxs("div",{className:"section-header",children:[u.jsx(Wp,{size:18}),u.jsx("h3",{children:"Safety Controls"})]}),u.jsx("div",{className:"gate-grid",children:u.jsx(je,{label:"Max Files/Cycle",value:d.safety.max_files_changed_per_cycle})}),d.safety.protected_paths&&d.safety.protected_paths.length>0&&u.jsxs("div",{className:"protected-paths",children:[u.jsx("h4",{children:"Protected Paths"}),u.jsx("div",{className:"path-list",children:d.safety.protected_paths.map((f,h)=>u.jsx("span",{className:"path-tag",children:f},h))})]})]}),d.required_files&&d.required_files.length>0&&u.jsxs("div",{className:"gate-section",children:[u.jsxs("div",{className:"section-header",children:[u.jsx(xn,{size:18}),u.jsx("h3",{children:"Required Files"})]}),u.jsx("div",{className:"file-list",children:d.required_files.map((f,h)=>u.jsxs("div",{className:"file-item",children:[u.jsx(vt,{size:14}),u.jsx("span",{children:f})]},h))})]}),d.context&&u.jsxs("div",{className:"gate-section",children:[u.jsxs("div",{className:"section-header",children:[u.jsx(j0,{size:18}),u.jsx("h3",{children:"Context Mining"})]}),u.jsxs("div",{className:"gate-grid",children:[u.jsx(je,{label:"Enabled",value:d.context.enabled}),u.jsx(je,{label:"Sensitivity",value:d.context.sensitivity}),u.jsx(je,{label:"Mining Depth",value:d.context.mining_depth})]})]}),d.retry_loop_breaker&&u.jsxs("div",{className:"gate-section",children:[u.jsxs("div",{className:"section-header",children:[u.jsx(Hp,{size:18}),u.jsx("h3",{children:"Retry Loop Breaker"})]}),u.jsxs("div",{className:"gate-grid",children:[u.jsx(je,{label:"Enabled",value:d.retry_loop_breaker.enabled}),u.jsx(je,{label:"Max Retries",value:d.retry_loop_breaker.max_retries})]})]})]})]})},je=({label:e,value:t,icon:n})=>{const r=typeof t=="boolean"?t?"Yes":"No":t??"N/A";return u.jsxs("div",{className:"gate-card",children:[n&&u.jsx("div",{className:"gate-icon",children:n}),u.jsxs("div",{className:"gate-info",children:[u.jsx("span",{className:"gate-value",children:r}),u.jsx("span",{className:"gate-label",children:e})]})]})},pj=({logs:e,onClearLogs:t,onSelectLog:n,selectedLog:r})=>{const[i,s]=k.useState(""),[o,a]=k.useState("all"),[l,c]=k.useState("all"),d=ze.useMemo(()=>{const y={};return e.forEach(C=>{const m=C.requestId||C.id;y[m]?y[m]={...y[m],...C}:y[m]={...C}}),Object.values(y).sort((C,m)=>new Date(m.timestamp).getTime()-new Date(C.timestamp).getTime())},[e]),f=ze.useMemo(()=>{const y=new Set;return d.forEach(C=>C.tool&&y.add(C.tool)),Array.from(y)},[d]),h=ze.useMemo(()=>d.filter(y=>{var g;const C=!i||((g=y.tool)==null?void 0:g.toLowerCase().includes(i.toLowerCase()))||JSON.stringify(y.arguments||{}).toLowerCase().includes(i.toLowerCase()),m=o==="all"||y.status===o,p=l==="all"||y.tool===l;return C&&m&&p}),[d,i,o,l]),v=ze.useMemo(()=>({total:d.length,success:d.filter(y=>y.status==="success").length,error:d.filter(y=>y.status==="error").length,pending:d.filter(y=>!y.status||y.status==="pending").length}),[d]),x=()=>{const y=JSON.stringify(h,null,2),C=new Blob([y],{type:"application/json"}),m=URL.createObjectURL(C),p=document.createElement("a");p.href=m,p.download=`rigour-audit-${new Date().toISOString().split("T")[0]}.json`,p.click()};return u.jsxs("div",{className:"audit-log",children:[u.jsxs("div",{className:"audit-header",children:[u.jsxs("div",{className:"audit-title",children:[u.jsx(Ds,{size:24}),u.jsx("h2",{children:"Audit Trail"}),u.jsxs("span",{className:"log-count",children:[h.length," events"]})]}),u.jsxs("div",{className:"audit-actions",children:[u.jsxs("button",{className:"btn-secondary",onClick:t,children:[u.jsx(x0,{size:16})," Clear"]}),u.jsxs("button",{className:"btn-primary",onClick:x,children:[u.jsx(d0,{size:16})," Export"]})]})]}),u.jsxs("div",{className:"audit-stats",children:[u.jsxs("div",{className:"stat-pill",children:[u.jsx(Ds,{size:14}),u.jsxs("span",{children:[v.total," Total"]})]}),u.jsxs("div",{className:"stat-pill success",children:[u.jsx(tr,{size:14}),u.jsxs("span",{children:[v.success," Success"]})]}),u.jsxs("div",{className:"stat-pill error",children:[u.jsx(ii,{size:14}),u.jsxs("span",{children:[v.error," Failed"]})]}),u.jsxs("div",{className:"stat-pill pending",children:[u.jsx(xn,{size:14}),u.jsxs("span",{children:[v.pending," Pending"]})]})]}),u.jsxs("div",{className:"audit-filters",children:[u.jsxs("div",{className:"search-box",children:[u.jsx(du,{size:16}),u.jsx("input",{type:"text",placeholder:"Search logs...",value:i,onChange:y=>s(y.target.value)})]}),u.jsxs("div",{className:"filter-box",children:[u.jsx(Up,{size:16}),u.jsxs("select",{value:o,onChange:y=>a(y.target.value),children:[u.jsx("option",{value:"all",children:"All Status"}),u.jsx("option",{value:"success",children:"Success"}),u.jsx("option",{value:"error",children:"Error"}),u.jsx("option",{value:"pending",children:"Pending"})]})]}),u.jsxs("div",{className:"filter-box",children:[u.jsx(Vs,{size:16}),u.jsxs("select",{value:l,onChange:y=>c(y.target.value),children:[u.jsx("option",{value:"all",children:"All Tools"}),f.map(y=>u.jsx("option",{value:y,children:y},y))]})]})]}),u.jsxs("div",{className:"audit-content",children:[u.jsx("div",{className:"log-list",children:h.length===0?u.jsxs("div",{className:"empty-state",children:[u.jsx(Vs,{size:48}),u.jsx("h3",{children:"No Interactions Detected"}),u.jsx("p",{children:"Rigour tool calls will appear here in real-time."})]}):h.map(y=>u.jsxs("div",{className:`log-entry ${(r==null?void 0:r.id)===y.id?"active":""} ${y._rigour_report?"has-report":""}`,onClick:()=>n((r==null?void 0:r.id)===y.id?null:y),children:[u.jsxs("div",{className:"log-header",children:[u.jsx("span",{className:`status-dot ${y.status||"pending"}`}),u.jsx("span",{className:"log-tool",children:y.tool}),u.jsxs("span",{className:"log-time",children:[u.jsx(Ls,{size:12}),new Date(y.timestamp).toLocaleTimeString()]}),y._rigour_report&&u.jsxs("span",{className:"report-badge",children:[u.jsx(f0,{size:12})," Report"]}),y.arbitrated&&u.jsx("span",{className:`arbitrated-badge ${y.decision}`,children:y.decision==="approve"?"Approved":"Rejected"}),u.jsx(so,{size:14,className:"chevron"})]}),y.requestId&&u.jsxs("div",{className:"log-request-id",children:["ID: ",y.requestId.slice(0,12),"..."]})]},y.id))}),u.jsx("div",{className:"log-detail",children:r?u.jsx(mj,{log:r,onClose:()=>n(null)}):u.jsxs("div",{className:"detail-placeholder",children:[u.jsx(vt,{size:48}),u.jsx("p",{children:"Select a log entry to view details"})]})})]})]})},mj=({log:e,onClose:t})=>{var s,o,a,l,c,d,f;const n=!!e._rigour_report||["rigour_checkpoint","rigour_agent_register","rigour_handoff"].includes(e.tool),[r,i]=k.useState(n?"report":"args");return u.jsxs("div",{className:"log-detail-view",children:[u.jsxs("div",{className:"detail-header",children:[u.jsxs("div",{className:"detail-info",children:[u.jsxs("span",{className:`status-badge ${e.status||"pending"}`,children:[e.status==="success"?u.jsx(tr,{size:14}):e.status==="error"?u.jsx(ii,{size:14}):u.jsx(xn,{size:14}),e.status||"pending"]}),u.jsx("h3",{children:e.tool})]}),u.jsx("button",{className:"close-btn",onClick:t,children:u.jsx(fu,{size:18})})]}),u.jsxs("div",{className:"detail-meta",children:[u.jsxs("div",{className:"meta-item",children:[u.jsx("span",{className:"meta-label",children:"Timestamp"}),u.jsx("span",{className:"meta-value",children:new Date(e.timestamp).toLocaleString()})]}),e.requestId&&u.jsxs("div",{className:"meta-item",children:[u.jsx("span",{className:"meta-label",children:"Request ID"}),u.jsx("span",{className:"meta-value mono",children:e.requestId})]})]}),n&&u.jsxs("div",{className:"detail-tabs",children:[u.jsx("button",{className:r==="report"?"active":"",onClick:()=>i("report"),children:e._rigour_report?"Verification Report":"Visualized Content"}),u.jsx("button",{className:r==="args"?"active":"",onClick:()=>i("args"),children:"Technical Arguments"})]}),u.jsx("div",{className:"detail-body",children:r==="args"?u.jsxs(u.Fragment,{children:[e.arguments&&u.jsxs("div",{className:"code-section",children:[u.jsx("h4",{children:"Arguments"}),u.jsx("pre",{children:JSON.stringify(e.arguments,null,2)})]}),e.error&&u.jsxs("div",{className:"error-section",children:[u.jsx("h4",{children:"Error"}),u.jsx("div",{className:"error-message",children:e.error})]})]}):u.jsx("div",{className:"verification-view",children:e.tool==="rigour_checkpoint"?u.jsxs("div",{className:"checkpoint-viz",children:[u.jsxs("div",{className:"viz-stats",children:[u.jsxs("div",{className:"viz-stat",children:[u.jsx("span",{className:"label",children:"Progress"}),u.jsxs("span",{className:"value",children:[((s=e.arguments)==null?void 0:s.progressPct)??0,"%"]})]}),u.jsxs("div",{className:"viz-stat",children:[u.jsx("span",{className:"label",children:"Quality"}),u.jsxs("span",{className:"value",style:{color:(((o=e.arguments)==null?void 0:o.qualityScore)??0)>=80?"#34d399":"#f87171"},children:[((a=e.arguments)==null?void 0:a.qualityScore)??0,"%"]})]})]}),u.jsxs("div",{className:"viz-summary",children:[u.jsx("h4",{children:"Summary of Work"}),u.jsx("p",{children:((l=e.arguments)==null?void 0:l.summary)||"No summary provided."})]}),((c=e.arguments)==null?void 0:c.filesChanged)&&e.arguments.filesChanged.length>0&&u.jsxs("div",{className:"viz-files",children:[u.jsx("h4",{children:"Files Changed"}),u.jsx("div",{className:"file-badges",children:e.arguments.filesChanged.map(h=>u.jsx("span",{className:"file-badge",children:h},h))})]})]}):e.tool==="rigour_agent_register"?u.jsxs("div",{className:"agent-viz",children:[u.jsx(Ds,{size:32,className:"viz-icon"}),u.jsx("h3",{children:"Agent Scope Claims"}),u.jsxs("div",{className:"scope-box",children:[u.jsx("h4",{children:"Claimed Scope:"}),u.jsx("div",{className:"scope-list",children:(f=(d=e.arguments)==null?void 0:d.taskScope)==null?void 0:f.map(h=>u.jsx("code",{children:h},h))})]})]}):u.jsxs("div",{className:"code-section",children:[u.jsx("h4",{children:"Rigour Report"}),u.jsx("pre",{children:JSON.stringify(e._rigour_report,null,2)})]})})})]})};function gj({session:e}){if(!e||e.agents.length===0)return u.jsxs("div",{className:"empty-state",children:[u.jsx(el,{size:48}),u.jsx("h3",{children:"No Active Agent Team"}),u.jsxs("p",{children:["When multiple agents register via ",u.jsx("code",{children:"rigour_agent_register"}),", they'll appear here."]}),u.jsxs("div",{className:"hint-box",children:[u.jsx("span",{children:"Supported Models:"}),u.jsxs("div",{className:"model-badges",children:[u.jsx("span",{className:"badge opus",children:"Opus 4.6"}),u.jsx("span",{className:"badge sonnet",children:"Sonnet 4.5"}),u.jsx("span",{className:"badge gpt",children:"GPT-5.3"}),u.jsx("span",{className:"badge codex",children:"Codex"})]})]})]});const t=r=>{switch(r){case"active":return u.jsx($o,{size:10,fill:"#34d399",stroke:"#34d399"});case"idle":return u.jsx($o,{size:10,fill:"#fbbf24",stroke:"#fbbf24"});case"completed":return u.jsx(tr,{size:14,color:"#34d399"});default:return u.jsx($o,{size:10})}},n=(r,i)=>i.some(s=>s.agentId===r.agentId?!1:r.taskScope.some(o=>s.taskScope.some(a=>a===o||o.startsWith(a)||a.startsWith(o))));return u.jsxs("div",{className:"agent-teams",children:[u.jsxs("div",{className:"panel-header",children:[u.jsxs("div",{className:"title",children:[u.jsx(el,{size:18}),u.jsx("span",{children:"Agent Team Session"})]}),u.jsx("div",{className:`session-status ${e.status}`,children:e.status.toUpperCase()})]}),u.jsxs("div",{className:"session-info",children:[u.jsx("span",{className:"session-id",children:e.sessionId}),u.jsxs("span",{className:"agent-count",children:[e.agents.length," agents"]})]}),u.jsx("div",{className:"agents-grid",children:e.agents.map(r=>u.jsxs("div",{className:`agent-card ${r.status} ${n(r,e.agents)?"has-conflict":""}`,children:[u.jsxs("div",{className:"agent-header",children:[u.jsxs("div",{className:"agent-id",children:[t(r.status),u.jsx("span",{children:r.agentId})]}),n(r,e.agents)&&u.jsxs("div",{className:"conflict-badge",children:[u.jsx(xn,{size:12}),u.jsx("span",{children:"Scope Conflict"})]})]}),u.jsxs("div",{className:"task-scope",children:[u.jsx("h4",{children:"Task Scope"}),u.jsx("ul",{children:r.taskScope.map((i,s)=>u.jsxs("li",{children:[u.jsx(oo,{size:12}),u.jsx("code",{children:i})]},s))})]}),u.jsxs("div",{className:"agent-meta",children:[u.jsxs("span",{children:["Registered: ",new Date(r.registeredAt).toLocaleTimeString()]}),r.lastCheckpoint&&u.jsxs("span",{children:["Last checkpoint: ",new Date(r.lastCheckpoint).toLocaleTimeString()]})]})]},r.agentId))})]})}function yj({checkpoints:e}){if(!e||e.length===0)return u.jsxs("div",{className:"empty-state",children:[u.jsx(Ja,{size:48}),u.jsx("h3",{children:"No Checkpoints Yet"}),u.jsxs("p",{children:["Checkpoints will appear here as agents report progress via ",u.jsx("code",{children:"rigour_checkpoint"}),"."]}),u.jsx("div",{className:"hint-box",children:u.jsx("span",{children:"Default interval: 15 minutes"})})]});const t=i=>i>=80?"#34d399":i>=60?"#fbbf24":"#f87171",n=i=>{if(i===0)return null;const s=e[i-1].qualityScore,o=e[i].qualityScore;return o>s+5?u.jsx(S0,{size:14,color:"#34d399"}):o<s-5?u.jsx(w0,{size:14,color:"#f87171"}):null},r=e.some((i,s)=>{if(s<2)return!1;const o=e.slice(Math.max(0,s-2),s),a=o.reduce((l,c)=>l+c.qualityScore,0)/o.length;return i.qualityScore<a-10});return u.jsxs("div",{className:"checkpoint-timeline",children:[u.jsxs("div",{className:"panel-header",children:[u.jsxs("div",{className:"title",children:[u.jsx(Ja,{size:18}),u.jsx("span",{children:"Checkpoint Timeline"})]}),u.jsxs("div",{className:"drift-visualization",children:[u.jsxs("svg",{width:"120",height:"30",viewBox:"0 0 120 30",className:"drift-sparkline",children:[u.jsx("path",{d:`M ${e.map((i,s)=>`${s/(e.length-1||1)*120} ${30-i.qualityScore/100*30}`).join(" L ")}`,fill:"none",stroke:"var(--accent-primary)",strokeWidth:"2",strokeLinecap:"round"}),e.map((i,s)=>u.jsx("circle",{cx:s/(e.length-1||1)*120,cy:30-i.qualityScore/100*30,r:"2",fill:t(i.qualityScore)},s))]}),u.jsx("span",{className:"drift-label",children:"Session Stability"})]}),r&&u.jsxs("div",{className:"drift-alert",children:[u.jsx(xn,{size:14}),u.jsx("span",{children:"Drift Detected"})]})]}),u.jsxs("div",{className:"timeline-container",children:[u.jsx("div",{className:"timeline-line"}),e.map((i,s)=>u.jsxs("div",{className:`checkpoint-entry ${i.warnings.length>0?"has-warnings":""}`,children:[u.jsx("div",{className:"checkpoint-marker",children:u.jsx("div",{className:"marker-dot",style:{backgroundColor:t(i.qualityScore)}})}),u.jsxs("div",{className:"checkpoint-content",children:[u.jsxs("div",{className:"checkpoint-header",children:[u.jsx("span",{className:"checkpoint-id",children:i.checkpointId}),u.jsx("span",{className:"checkpoint-time",children:new Date(i.timestamp).toLocaleTimeString()})]}),u.jsxs("div",{className:"checkpoint-stats",children:[u.jsxs("div",{className:"stat",children:[u.jsx("span",{className:"label",children:"Progress"}),u.jsx("div",{className:"progress-bar",children:u.jsx("div",{className:"progress-fill",style:{width:`${i.progressPct}%`}})}),u.jsxs("span",{className:"value",children:[i.progressPct,"%"]})]}),u.jsxs("div",{className:"stat",children:[u.jsx("span",{className:"label",children:"Quality"}),u.jsxs("span",{className:"value score",style:{color:t(i.qualityScore)},children:[i.qualityScore,"%",n(s)]})]}),u.jsxs("div",{className:"stat",children:[u.jsx("span",{className:"label",children:"Agent"}),u.jsx("span",{className:"value agent-id",children:i.agentId})]})]}),u.jsx("div",{className:"checkpoint-summary",children:u.jsx("p",{children:i.summary})}),i.filesChanged.length>0&&u.jsx("div",{className:"files-changed",children:u.jsxs("span",{className:"count",children:[i.filesChanged.length," files changed"]})}),i.warnings.length>0&&u.jsx("div",{className:"warnings",children:i.warnings.map((o,a)=>u.jsxs("div",{className:"warning-item",children:[u.jsx(xn,{size:12}),u.jsx("span",{children:o})]},a))})]})]},i.checkpointId))]})]})}function vj(){var Ee,O,$,U;const[e,t]=k.useState(()=>localStorage.getItem("rigour-theme")||"dark"),[n,r]=k.useState("memory"),[i,s]=k.useState([]),[o,a]=k.useState(null),[l,c]=k.useState(null),[d,f]=k.useState(!1),[h,v]=k.useState([]),[x,y]=k.useState(null);ze.useEffect(()=>{const T=new EventSource("/api/events");return T.onmessage=A=>{try{const R=JSON.parse(A.data);s(L=>[R,...L].slice(0,100))}catch(R){console.error("Failed to parse event",R)}},fetch("/api/tree").then(A=>A.json()).then(v).catch(A=>console.error("Failed to fetch tree",A)),fetch("/api/info").then(A=>A.json()).then(y).catch(A=>console.error("Failed to fetch info",A)),()=>T.close()},[]),k.useEffect(()=>{document.documentElement.setAttribute("data-theme",e),localStorage.setItem("rigour-theme",e)},[e]);const C=()=>t(T=>T==="dark"?"light":"dark"),[m,p]=k.useState(""),[g,S]=k.useState({}),[w,j]=k.useState({}),[P,N]=k.useState(null),[V,M]=k.useState(null);k.useEffect(()=>{(async()=>{try{const[A,R,L,z,se]=await Promise.all([fetch("/api/config").then(q=>q.ok?q.text():""),fetch("/api/memory").then(q=>q.json()),fetch("/api/index-stats").then(q=>q.json()),fetch("/api/agents").then(q=>q.json()),fetch("/api/checkpoints").then(q=>q.json())]);p(A),S(R),j(L),N(z),M(se)}catch(A){console.error("Failed to fetch meta data",A)}})()},[]);const W=async T=>{try{const A=T.replace(/\s*\(\d+\s*lines\)$/,""),L=await(await fetch(`/api/file?path=${encodeURIComponent(A)}`)).text();a({filename:A,original:L,modified:L})}catch(A){console.error("Failed to fetch file content",A)}},me=async T=>{if(l)try{await fetch("/api/arbitrate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requestId:l.requestId||l.id,decision:T,timestamp:new Date().toISOString()})}),s(A=>A.map(R=>(R.requestId||R.id)===(l.requestId||l.id)?{...R,status:T==="approve"?"success":"error",arbitrated:!0,decision:T}:R)),f(!1),c(null)}catch(A){console.error("Arbitration failed",A)}},Ne=[{id:"audit",label:"Audit Log",icon:Vs},{id:"gates",label:"Quality Gates",icon:Uo},{id:"patterns",label:"Pattern Index",icon:$p},{id:"memory",label:"Memory Bank",icon:c0},{id:"agents",label:"Agent Teams",icon:el},{id:"checkpoints",label:"Checkpoints",icon:Ja}];return u.jsxs("div",{className:"studio",children:[u.jsxs("aside",{className:"sidebar",children:[u.jsxs("div",{className:"brand",children:[u.jsx("div",{className:"logo-icon",children:u.jsx(Uo,{size:18})}),u.jsx("span",{children:"Rigour Studio"}),u.jsxs("div",{className:"version-pill",children:["v",(x==null?void 0:x.version)||"2.13"]})]}),u.jsx("nav",{children:Ne.map(T=>u.jsxs("button",{className:`nav-item ${n===T.id?"active":""}`,onClick:()=>r(T.id),children:[u.jsx(T.icon,{size:18}),u.jsx("span",{children:T.label}),n===T.id&&u.jsx(tn.div,{layoutId:"nav-glow",className:"nav-glow"})]},T.id))}),u.jsxs("div",{className:"sidebar-footer",children:[u.jsxs("div",{className:"trust-indicator",children:[u.jsx(Wp,{size:14}),u.jsx("span",{children:"Local Governance"})]}),u.jsx("button",{className:"footer-item",children:u.jsx(Hp,{size:18})}),u.jsx("button",{className:"footer-item",children:u.jsx(m0,{size:18})})]})]}),u.jsxs("main",{className:"main-content",children:[u.jsxs("header",{children:[u.jsx("div",{className:"header-left",children:x&&u.jsxs("div",{className:"project-identity",children:[u.jsx(oo,{size:14,className:"folder-icon"}),u.jsx("span",{className:"project-name",children:x.name}),u.jsx("span",{className:"project-path",children:x.path})]})}),u.jsxs("div",{className:"header-right",children:[u.jsxs("div",{className:"connection-status",children:[u.jsxs("div",{className:"status-indicator",children:[u.jsx("div",{className:"pulse-emitter"}),u.jsx("span",{children:"LIVE"})]}),u.jsx("div",{className:"v-divider"}),u.jsxs("span",{children:["v",(x==null?void 0:x.version)||"0.0.0"]})]}),u.jsx("button",{className:"theme-toggle",onClick:C,children:e==="dark"?u.jsx(v0,{size:18}):u.jsx(g0,{size:18})})]})]}),u.jsxs("div",{className:"view-container",children:[u.jsxs(N0,{mode:"wait",children:[n==="audit"&&u.jsx(tn.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"full-view",children:u.jsx(pj,{logs:i,onClearLogs:()=>s([]),onSelectLog:T=>{var A,R,L;if(c(T),T!=null&&T._rigour_report||(T==null?void 0:T.type)==="interception_requested"){if(T!=null&&T._rigour_report){const z=(L=(R=(A=T._rigour_report.failures)==null?void 0:A[0])==null?void 0:R.files)==null?void 0:L[0];z?W(z):a(null)}else a(null);f(!0)}else a(null),f(!1)},selectedLog:l})},"audit"),n==="gates"&&u.jsx(tn.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"full-view",children:u.jsx(hj,{})},"gates"),n==="patterns"&&u.jsx(tn.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"full-view",children:u.jsx(fj,{})},"patterns"),n==="memory"&&u.jsx(tn.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"full-view",children:u.jsx(dj,{})},"memory"),n==="agents"&&u.jsx(tn.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"full-view",children:u.jsx(gj,{session:P})},"agents"),n==="checkpoints"&&u.jsx(tn.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"full-view",children:u.jsx(yj,{checkpoints:(V==null?void 0:V.checkpoints)||[]})},"checkpoints")]}),l&&d&&u.jsx("div",{className:"governance-overlay",children:u.jsxs("div",{className:"governance-window",children:[u.jsxs("div",{className:"governance-header",children:[u.jsxs("div",{className:"title",children:[u.jsx(Uo,{size:20}),u.jsxs("span",{children:["Governance Audit: ",l.tool]})]}),u.jsxs("div",{className:"hitl-actions",children:[l.type==="interception_requested"&&u.jsxs(u.Fragment,{children:[u.jsxs("button",{className:"btn-approve",onClick:()=>me("approve"),children:[u.jsx(tr,{size:16})," Approve"]}),u.jsxs("button",{className:"btn-reject",onClick:()=>me("reject"),children:[u.jsx(ii,{size:16})," Reject"]}),u.jsx("div",{className:"divider"})]}),u.jsx("button",{onClick:()=>f(!1),className:"close-btn",children:u.jsx(fu,{size:20})})]})]}),u.jsx("div",{className:"governance-body",children:l.type==="interception_requested"?u.jsxs("div",{className:"interception-view",children:[u.jsxs("div",{className:"interception-card",children:[u.jsx(Vs,{size:48}),u.jsx("h4",{children:"Command Intercepted"}),u.jsx("div",{className:"command-box",children:u.jsx("code",{children:l.command})}),u.jsx("p",{children:"An AI agent is requesting to execute this command. Review the project state below before arbitrating."}),u.jsxs("div",{className:"warning-note",children:[u.jsx(xn,{size:16}),u.jsx("span",{children:"Critical actions should be manually verified."})]})]}),u.jsx(Nf,{files:h.map(T=>T.replace(/\s*\(\d+\s*lines\)$/,"")),onSelect:T=>W(T),activeFile:o==null?void 0:o.filename,violatedFiles:[]})]}):u.jsxs(u.Fragment,{children:[u.jsx(Nf,{files:(((O=(Ee=l._rigour_report)==null?void 0:Ee.failures)==null?void 0:O.flatMap(T=>T.files||[]))||h).map(T=>T.replace(/\s*\(\d+\s*lines\)$/,"")),onSelect:T=>W(T),activeFile:o==null?void 0:o.filename,violatedFiles:(((U=($=l._rigour_report)==null?void 0:$.failures)==null?void 0:U.flatMap(T=>T.files||[]))||[]).map(T=>T.replace(/\s*\(\d+\s*lines\)$/,""))}),u.jsx("div",{className:"diff-view-area",children:o?u.jsx(uj,{filename:o.filename,originalCode:o.original,modifiedCode:o.modified,onClose:()=>a(null),theme:e}):u.jsxs("div",{className:"diff-placeholder",children:[u.jsx(Ds,{size:48}),u.jsx("p",{children:"Select a file to audit the proposed changes"})]})})]})})]})})]})]})]})}oa.createRoot(document.getElementById("root")).render(u.jsx(ze.StrictMode,{children:u.jsx(vj,{})}));
291
+ `),x={};let y=null,C=null;for(const m of v){if(m.startsWith("#")||!m.trim())continue;const p=m.search(/\S/),g=m.trim();if(p===0&&g.includes(":")){const[S]=g.split(":");y=S.trim(),C=null;const w=(h=g.split(":")[1])==null?void 0:h.trim();w&&w!=="{}"&&w!=="[]"?x[y]=isNaN(Number(w))?w:Number(w):x[y]={}}else if(p===2&&y&&g.includes(":")){const[S]=g.split(":");C=S.trim();const w=g.split(":").slice(1).join(":").trim();if(w&&w!=="{}"&&w!=="[]"){typeof x[y]!="object"&&(x[y]={});const j=w==="true"?!0:w==="false"?!1:isNaN(Number(w))?w:Number(w);x[y][C]=j}else typeof x[y]!="object"&&(x[y]={}),x[y][C]={}}else if(p===4&&y&&C&&g.includes(":")){const[S]=g.split(":"),w=g.split(":").slice(1).join(":").trim();typeof x[y][C]!="object"&&(x[y][C]={});const j=w==="true"?!0:w==="false"?!1:isNaN(Number(w))?w:Number(w);x[y][C][S.trim()]=j}}return x}catch{return{}}};k.useEffect(()=>{l()},[]);const d=(e==null?void 0:e.gates)||{};return u.jsxs("div",{className:"quality-gates",children:[u.jsxs("div",{className:"gates-header",children:[u.jsxs("div",{className:"gates-title",children:[u.jsx(y0,{size:24}),u.jsx("h2",{children:"Quality Gates"}),(e==null?void 0:e.preset)&&u.jsx("span",{className:"preset-badge",children:e.preset})]}),u.jsxs("div",{className:"gates-actions",children:[u.jsxs("div",{className:"view-toggle",children:[u.jsxs("button",{className:o==="visual"?"active":"",onClick:()=>a("visual"),children:[u.jsx(rs,{size:16})," Visual"]}),u.jsxs("button",{className:o==="raw"?"active":"",onClick:()=>a("raw"),children:[u.jsx(vt,{size:16})," YAML"]})]}),u.jsx("button",{className:"refresh-btn",onClick:l,disabled:i,children:u.jsx(Rs,{size:16,className:i?"spinning":""})})]})]}),i?u.jsx("div",{className:"gates-loading",children:"Loading configuration..."}):o==="raw"?u.jsx("div",{className:"gates-raw",children:u.jsx("pre",{children:n})}):u.jsxs("div",{className:"gates-content",children:[u.jsxs("div",{className:"gate-section",children:[u.jsxs("div",{className:"section-header",children:[u.jsx(vt,{size:18}),u.jsx("h3",{children:"Code Quality"})]}),u.jsxs("div",{className:"gate-grid",children:[u.jsx(je,{label:"Max File Lines",value:d.max_file_lines,icon:u.jsx(vt,{size:16})}),u.jsx(je,{label:"Forbid TODOs",value:d.forbid_todos,icon:d.forbid_todos?u.jsx(ii,{size:16}):u.jsx(tr,{size:16})}),u.jsx(je,{label:"Forbid FIXMEs",value:d.forbid_fixme,icon:d.forbid_fixme?u.jsx(ii,{size:16}):u.jsx(tr,{size:16})})]})]}),d.ast&&u.jsxs("div",{className:"gate-section",children:[u.jsxs("div",{className:"section-header",children:[u.jsx(p0,{size:18}),u.jsx("h3",{children:"AST Limits"})]}),u.jsxs("div",{className:"gate-grid",children:[u.jsx(je,{label:"Complexity",value:d.ast.complexity}),u.jsx(je,{label:"Max Methods",value:d.ast.max_methods}),u.jsx(je,{label:"Max Params",value:d.ast.max_params}),u.jsx(je,{label:"Max Nesting",value:d.ast.max_nesting}),u.jsx(je,{label:"Max Function Lines",value:d.ast.max_function_lines}),u.jsx(je,{label:"Max Inheritance",value:d.ast.max_inheritance_depth})]})]}),d.safety&&u.jsxs("div",{className:"gate-section",children:[u.jsxs("div",{className:"section-header",children:[u.jsx(Wp,{size:18}),u.jsx("h3",{children:"File Guard"})]}),u.jsx("div",{className:"gate-grid",children:u.jsx(je,{label:"Max Files/Cycle",value:d.safety.max_files_changed_per_cycle})}),d.safety.protected_paths&&d.safety.protected_paths.length>0&&u.jsxs("div",{className:"protected-paths",children:[u.jsx("h4",{children:"Protected Paths"}),u.jsx("div",{className:"path-list",children:d.safety.protected_paths.map((f,h)=>u.jsx("span",{className:"path-tag",children:f},h))})]})]}),d.required_files&&d.required_files.length>0&&u.jsxs("div",{className:"gate-section",children:[u.jsxs("div",{className:"section-header",children:[u.jsx(xn,{size:18}),u.jsx("h3",{children:"Required Files"})]}),u.jsx("div",{className:"file-list",children:d.required_files.map((f,h)=>u.jsxs("div",{className:"file-item",children:[u.jsx(vt,{size:14}),u.jsx("span",{children:f})]},h))})]}),d.context&&u.jsxs("div",{className:"gate-section",children:[u.jsxs("div",{className:"section-header",children:[u.jsx(j0,{size:18}),u.jsx("h3",{children:"Context Mining"})]}),u.jsxs("div",{className:"gate-grid",children:[u.jsx(je,{label:"Enabled",value:d.context.enabled}),u.jsx(je,{label:"Sensitivity",value:d.context.sensitivity}),u.jsx(je,{label:"Mining Depth",value:d.context.mining_depth})]})]}),d.retry_loop_breaker&&u.jsxs("div",{className:"gate-section",children:[u.jsxs("div",{className:"section-header",children:[u.jsx(Hp,{size:18}),u.jsx("h3",{children:"Retry Loop Breaker"})]}),u.jsxs("div",{className:"gate-grid",children:[u.jsx(je,{label:"Enabled",value:d.retry_loop_breaker.enabled}),u.jsx(je,{label:"Max Retries",value:d.retry_loop_breaker.max_retries})]})]})]})]})},je=({label:e,value:t,icon:n})=>{const r=typeof t=="boolean"?t?"Yes":"No":t??"N/A";return u.jsxs("div",{className:"gate-card",children:[n&&u.jsx("div",{className:"gate-icon",children:n}),u.jsxs("div",{className:"gate-info",children:[u.jsx("span",{className:"gate-value",children:r}),u.jsx("span",{className:"gate-label",children:e})]})]})},pj=({logs:e,onClearLogs:t,onSelectLog:n,selectedLog:r})=>{const[i,s]=k.useState(""),[o,a]=k.useState("all"),[l,c]=k.useState("all"),d=ze.useMemo(()=>{const y={};return e.forEach(C=>{const m=C.requestId||C.id;y[m]?y[m]={...y[m],...C}:y[m]={...C}}),Object.values(y).sort((C,m)=>new Date(m.timestamp).getTime()-new Date(C.timestamp).getTime())},[e]),f=ze.useMemo(()=>{const y=new Set;return d.forEach(C=>C.tool&&y.add(C.tool)),Array.from(y)},[d]),h=ze.useMemo(()=>d.filter(y=>{var g;const C=!i||((g=y.tool)==null?void 0:g.toLowerCase().includes(i.toLowerCase()))||JSON.stringify(y.arguments||{}).toLowerCase().includes(i.toLowerCase()),m=o==="all"||y.status===o,p=l==="all"||y.tool===l;return C&&m&&p}),[d,i,o,l]),v=ze.useMemo(()=>({total:d.length,success:d.filter(y=>y.status==="success").length,error:d.filter(y=>y.status==="error").length,pending:d.filter(y=>!y.status||y.status==="pending").length}),[d]),x=()=>{const y=JSON.stringify(h,null,2),C=new Blob([y],{type:"application/json"}),m=URL.createObjectURL(C),p=document.createElement("a");p.href=m,p.download=`rigour-audit-${new Date().toISOString().split("T")[0]}.json`,p.click()};return u.jsxs("div",{className:"audit-log",children:[u.jsxs("div",{className:"audit-header",children:[u.jsxs("div",{className:"audit-title",children:[u.jsx(Ds,{size:24}),u.jsx("h2",{children:"Audit Trail"}),u.jsxs("span",{className:"log-count",children:[h.length," events"]})]}),u.jsxs("div",{className:"audit-actions",children:[u.jsxs("button",{className:"btn-secondary",onClick:t,children:[u.jsx(x0,{size:16})," Clear"]}),u.jsxs("button",{className:"btn-primary",onClick:x,children:[u.jsx(d0,{size:16})," Export"]})]})]}),u.jsxs("div",{className:"audit-stats",children:[u.jsxs("div",{className:"stat-pill",children:[u.jsx(Ds,{size:14}),u.jsxs("span",{children:[v.total," Total"]})]}),u.jsxs("div",{className:"stat-pill success",children:[u.jsx(tr,{size:14}),u.jsxs("span",{children:[v.success," Success"]})]}),u.jsxs("div",{className:"stat-pill error",children:[u.jsx(ii,{size:14}),u.jsxs("span",{children:[v.error," Failed"]})]}),u.jsxs("div",{className:"stat-pill pending",children:[u.jsx(xn,{size:14}),u.jsxs("span",{children:[v.pending," Pending"]})]})]}),u.jsxs("div",{className:"audit-filters",children:[u.jsxs("div",{className:"search-box",children:[u.jsx(du,{size:16}),u.jsx("input",{type:"text",placeholder:"Search logs...",value:i,onChange:y=>s(y.target.value)})]}),u.jsxs("div",{className:"filter-box",children:[u.jsx(Up,{size:16}),u.jsxs("select",{value:o,onChange:y=>a(y.target.value),children:[u.jsx("option",{value:"all",children:"All Status"}),u.jsx("option",{value:"success",children:"Success"}),u.jsx("option",{value:"error",children:"Error"}),u.jsx("option",{value:"pending",children:"Pending"})]})]}),u.jsxs("div",{className:"filter-box",children:[u.jsx(Vs,{size:16}),u.jsxs("select",{value:l,onChange:y=>c(y.target.value),children:[u.jsx("option",{value:"all",children:"All Tools"}),f.map(y=>u.jsx("option",{value:y,children:y},y))]})]})]}),u.jsxs("div",{className:"audit-content",children:[u.jsx("div",{className:"log-list",children:h.length===0?u.jsxs("div",{className:"empty-state",children:[u.jsx(Vs,{size:48}),u.jsx("h3",{children:"No Interactions Detected"}),u.jsx("p",{children:"Rigour tool calls will appear here in real-time."})]}):h.map(y=>u.jsxs("div",{className:`log-entry ${(r==null?void 0:r.id)===y.id?"active":""} ${y._rigour_report?"has-report":""}`,onClick:()=>n((r==null?void 0:r.id)===y.id?null:y),children:[u.jsxs("div",{className:"log-header",children:[u.jsx("span",{className:`status-dot ${y.status||"pending"}`}),u.jsx("span",{className:"log-tool",children:y.tool}),u.jsxs("span",{className:"log-time",children:[u.jsx(Ls,{size:12}),new Date(y.timestamp).toLocaleTimeString()]}),y._rigour_report&&u.jsxs("span",{className:"report-badge",children:[u.jsx(f0,{size:12})," Report"]}),y.arbitrated&&u.jsx("span",{className:`arbitrated-badge ${y.decision}`,children:y.decision==="approve"?"Approved":"Rejected"}),u.jsx(so,{size:14,className:"chevron"})]}),y.requestId&&u.jsxs("div",{className:"log-request-id",children:["ID: ",y.requestId.slice(0,12),"..."]})]},y.id))}),u.jsx("div",{className:"log-detail",children:r?u.jsx(mj,{log:r,onClose:()=>n(null)}):u.jsxs("div",{className:"detail-placeholder",children:[u.jsx(vt,{size:48}),u.jsx("p",{children:"Select a log entry to view details"})]})})]})]})},mj=({log:e,onClose:t})=>{var s,o,a,l,c,d,f;const n=!!e._rigour_report||["rigour_checkpoint","rigour_agent_register","rigour_handoff"].includes(e.tool),[r,i]=k.useState(n?"report":"args");return u.jsxs("div",{className:"log-detail-view",children:[u.jsxs("div",{className:"detail-header",children:[u.jsxs("div",{className:"detail-info",children:[u.jsxs("span",{className:`status-badge ${e.status||"pending"}`,children:[e.status==="success"?u.jsx(tr,{size:14}):e.status==="error"?u.jsx(ii,{size:14}):u.jsx(xn,{size:14}),e.status||"pending"]}),u.jsx("h3",{children:e.tool})]}),u.jsx("button",{className:"close-btn",onClick:t,children:u.jsx(fu,{size:18})})]}),u.jsxs("div",{className:"detail-meta",children:[u.jsxs("div",{className:"meta-item",children:[u.jsx("span",{className:"meta-label",children:"Timestamp"}),u.jsx("span",{className:"meta-value",children:new Date(e.timestamp).toLocaleString()})]}),e.requestId&&u.jsxs("div",{className:"meta-item",children:[u.jsx("span",{className:"meta-label",children:"Request ID"}),u.jsx("span",{className:"meta-value mono",children:e.requestId})]})]}),n&&u.jsxs("div",{className:"detail-tabs",children:[u.jsx("button",{className:r==="report"?"active":"",onClick:()=>i("report"),children:e._rigour_report?"Verification Report":"Visualized Content"}),u.jsx("button",{className:r==="args"?"active":"",onClick:()=>i("args"),children:"Technical Arguments"})]}),u.jsx("div",{className:"detail-body",children:r==="args"?u.jsxs(u.Fragment,{children:[e.arguments&&u.jsxs("div",{className:"code-section",children:[u.jsx("h4",{children:"Arguments"}),u.jsx("pre",{children:JSON.stringify(e.arguments,null,2)})]}),e.error&&u.jsxs("div",{className:"error-section",children:[u.jsx("h4",{children:"Error"}),u.jsx("div",{className:"error-message",children:e.error})]})]}):u.jsx("div",{className:"verification-view",children:e.tool==="rigour_checkpoint"?u.jsxs("div",{className:"checkpoint-viz",children:[u.jsxs("div",{className:"viz-stats",children:[u.jsxs("div",{className:"viz-stat",children:[u.jsx("span",{className:"label",children:"Progress"}),u.jsxs("span",{className:"value",children:[((s=e.arguments)==null?void 0:s.progressPct)??0,"%"]})]}),u.jsxs("div",{className:"viz-stat",children:[u.jsx("span",{className:"label",children:"Quality"}),u.jsxs("span",{className:"value",style:{color:(((o=e.arguments)==null?void 0:o.qualityScore)??0)>=80?"#34d399":"#f87171"},children:[((a=e.arguments)==null?void 0:a.qualityScore)??0,"%"]})]})]}),u.jsxs("div",{className:"viz-summary",children:[u.jsx("h4",{children:"Summary of Work"}),u.jsx("p",{children:((l=e.arguments)==null?void 0:l.summary)||"No summary provided."})]}),((c=e.arguments)==null?void 0:c.filesChanged)&&e.arguments.filesChanged.length>0&&u.jsxs("div",{className:"viz-files",children:[u.jsx("h4",{children:"Files Changed"}),u.jsx("div",{className:"file-badges",children:e.arguments.filesChanged.map(h=>u.jsx("span",{className:"file-badge",children:h},h))})]})]}):e.tool==="rigour_agent_register"?u.jsxs("div",{className:"agent-viz",children:[u.jsx(Ds,{size:32,className:"viz-icon"}),u.jsx("h3",{children:"Agent Scope Claims"}),u.jsxs("div",{className:"scope-box",children:[u.jsx("h4",{children:"Claimed Scope:"}),u.jsx("div",{className:"scope-list",children:(f=(d=e.arguments)==null?void 0:d.taskScope)==null?void 0:f.map(h=>u.jsx("code",{children:h},h))})]})]}):u.jsxs("div",{className:"code-section",children:[u.jsx("h4",{children:"Rigour Report"}),u.jsx("pre",{children:JSON.stringify(e._rigour_report,null,2)})]})})})]})};function gj({session:e}){if(!e||e.agents.length===0)return u.jsxs("div",{className:"empty-state",children:[u.jsx(el,{size:48}),u.jsx("h3",{children:"No Active Agent Team"}),u.jsxs("p",{children:["When multiple agents register via ",u.jsx("code",{children:"rigour_agent_register"}),", they'll appear here."]}),u.jsxs("div",{className:"hint-box",children:[u.jsx("span",{children:"Supported Models:"}),u.jsxs("div",{className:"model-badges",children:[u.jsx("span",{className:"badge opus",children:"Opus 4.6"}),u.jsx("span",{className:"badge sonnet",children:"Sonnet 4.5"}),u.jsx("span",{className:"badge gpt",children:"GPT-5.3"}),u.jsx("span",{className:"badge codex",children:"Codex"})]})]})]});const t=r=>{switch(r){case"active":return u.jsx($o,{size:10,fill:"#34d399",stroke:"#34d399"});case"idle":return u.jsx($o,{size:10,fill:"#fbbf24",stroke:"#fbbf24"});case"completed":return u.jsx(tr,{size:14,color:"#34d399"});default:return u.jsx($o,{size:10})}},n=(r,i)=>i.some(s=>s.agentId===r.agentId?!1:r.taskScope.some(o=>s.taskScope.some(a=>a===o||o.startsWith(a)||a.startsWith(o))));return u.jsxs("div",{className:"agent-teams",children:[u.jsxs("div",{className:"panel-header",children:[u.jsxs("div",{className:"title",children:[u.jsx(el,{size:18}),u.jsx("span",{children:"Agent Team Session"})]}),u.jsx("div",{className:`session-status ${e.status}`,children:e.status.toUpperCase()})]}),u.jsxs("div",{className:"session-info",children:[u.jsx("span",{className:"session-id",children:e.sessionId}),u.jsxs("span",{className:"agent-count",children:[e.agents.length," agents"]})]}),u.jsx("div",{className:"agents-grid",children:e.agents.map(r=>u.jsxs("div",{className:`agent-card ${r.status} ${n(r,e.agents)?"has-conflict":""}`,children:[u.jsxs("div",{className:"agent-header",children:[u.jsxs("div",{className:"agent-id",children:[t(r.status),u.jsx("span",{children:r.agentId})]}),n(r,e.agents)&&u.jsxs("div",{className:"conflict-badge",children:[u.jsx(xn,{size:12}),u.jsx("span",{children:"Scope Conflict"})]})]}),u.jsxs("div",{className:"task-scope",children:[u.jsx("h4",{children:"Task Scope"}),u.jsx("ul",{children:r.taskScope.map((i,s)=>u.jsxs("li",{children:[u.jsx(oo,{size:12}),u.jsx("code",{children:i})]},s))})]}),u.jsxs("div",{className:"agent-meta",children:[u.jsxs("span",{children:["Registered: ",new Date(r.registeredAt).toLocaleTimeString()]}),r.lastCheckpoint&&u.jsxs("span",{children:["Last checkpoint: ",new Date(r.lastCheckpoint).toLocaleTimeString()]})]})]},r.agentId))})]})}function yj({checkpoints:e}){if(!e||e.length===0)return u.jsxs("div",{className:"empty-state",children:[u.jsx(Ja,{size:48}),u.jsx("h3",{children:"No Checkpoints Yet"}),u.jsxs("p",{children:["Checkpoints will appear here as agents report progress via ",u.jsx("code",{children:"rigour_checkpoint"}),"."]}),u.jsx("div",{className:"hint-box",children:u.jsx("span",{children:"Default interval: 15 minutes"})})]});const t=i=>i>=80?"#34d399":i>=60?"#fbbf24":"#f87171",n=i=>{if(i===0)return null;const s=e[i-1].qualityScore,o=e[i].qualityScore;return o>s+5?u.jsx(S0,{size:14,color:"#34d399"}):o<s-5?u.jsx(w0,{size:14,color:"#f87171"}):null},r=e.some((i,s)=>{if(s<2)return!1;const o=e.slice(Math.max(0,s-2),s),a=o.reduce((l,c)=>l+c.qualityScore,0)/o.length;return i.qualityScore<a-10});return u.jsxs("div",{className:"checkpoint-timeline",children:[u.jsxs("div",{className:"panel-header",children:[u.jsxs("div",{className:"title",children:[u.jsx(Ja,{size:18}),u.jsx("span",{children:"Checkpoint Timeline"})]}),u.jsxs("div",{className:"drift-visualization",children:[u.jsxs("svg",{width:"120",height:"30",viewBox:"0 0 120 30",className:"drift-sparkline",children:[u.jsx("path",{d:`M ${e.map((i,s)=>`${s/(e.length-1||1)*120} ${30-i.qualityScore/100*30}`).join(" L ")}`,fill:"none",stroke:"var(--accent-primary)",strokeWidth:"2",strokeLinecap:"round"}),e.map((i,s)=>u.jsx("circle",{cx:s/(e.length-1||1)*120,cy:30-i.qualityScore/100*30,r:"2",fill:t(i.qualityScore)},s))]}),u.jsx("span",{className:"drift-label",children:"Session Stability"})]}),r&&u.jsxs("div",{className:"drift-alert",children:[u.jsx(xn,{size:14}),u.jsx("span",{children:"Drift Detected"})]})]}),u.jsxs("div",{className:"timeline-container",children:[u.jsx("div",{className:"timeline-line"}),e.map((i,s)=>u.jsxs("div",{className:`checkpoint-entry ${i.warnings.length>0?"has-warnings":""}`,children:[u.jsx("div",{className:"checkpoint-marker",children:u.jsx("div",{className:"marker-dot",style:{backgroundColor:t(i.qualityScore)}})}),u.jsxs("div",{className:"checkpoint-content",children:[u.jsxs("div",{className:"checkpoint-header",children:[u.jsx("span",{className:"checkpoint-id",children:i.checkpointId}),u.jsx("span",{className:"checkpoint-time",children:new Date(i.timestamp).toLocaleTimeString()})]}),u.jsxs("div",{className:"checkpoint-stats",children:[u.jsxs("div",{className:"stat",children:[u.jsx("span",{className:"label",children:"Progress"}),u.jsx("div",{className:"progress-bar",children:u.jsx("div",{className:"progress-fill",style:{width:`${i.progressPct}%`}})}),u.jsxs("span",{className:"value",children:[i.progressPct,"%"]})]}),u.jsxs("div",{className:"stat",children:[u.jsx("span",{className:"label",children:"Quality"}),u.jsxs("span",{className:"value score",style:{color:t(i.qualityScore)},children:[i.qualityScore,"%",n(s)]})]}),u.jsxs("div",{className:"stat",children:[u.jsx("span",{className:"label",children:"Agent"}),u.jsx("span",{className:"value agent-id",children:i.agentId})]})]}),u.jsx("div",{className:"checkpoint-summary",children:u.jsx("p",{children:i.summary})}),i.filesChanged.length>0&&u.jsx("div",{className:"files-changed",children:u.jsxs("span",{className:"count",children:[i.filesChanged.length," files changed"]})}),i.warnings.length>0&&u.jsx("div",{className:"warnings",children:i.warnings.map((o,a)=>u.jsxs("div",{className:"warning-item",children:[u.jsx(xn,{size:12}),u.jsx("span",{children:o})]},a))})]})]},i.checkpointId))]})]})}function vj(){var Ee,O,$,U;const[e,t]=k.useState(()=>localStorage.getItem("rigour-theme")||"dark"),[n,r]=k.useState("memory"),[i,s]=k.useState([]),[o,a]=k.useState(null),[l,c]=k.useState(null),[d,f]=k.useState(!1),[h,v]=k.useState([]),[x,y]=k.useState(null);ze.useEffect(()=>{const T=new EventSource("/api/events");return T.onmessage=A=>{try{const R=JSON.parse(A.data);s(L=>[R,...L].slice(0,100))}catch(R){console.error("Failed to parse event",R)}},fetch("/api/tree").then(A=>A.json()).then(v).catch(A=>console.error("Failed to fetch tree",A)),fetch("/api/info").then(A=>A.json()).then(y).catch(A=>console.error("Failed to fetch info",A)),()=>T.close()},[]),k.useEffect(()=>{document.documentElement.setAttribute("data-theme",e),localStorage.setItem("rigour-theme",e)},[e]);const C=()=>t(T=>T==="dark"?"light":"dark"),[m,p]=k.useState(""),[g,S]=k.useState({}),[w,j]=k.useState({}),[P,N]=k.useState(null),[V,M]=k.useState(null);k.useEffect(()=>{(async()=>{try{const[A,R,L,z,se]=await Promise.all([fetch("/api/config").then(q=>q.ok?q.text():""),fetch("/api/memory").then(q=>q.json()),fetch("/api/index-stats").then(q=>q.json()),fetch("/api/agents").then(q=>q.json()),fetch("/api/checkpoints").then(q=>q.json())]);p(A),S(R),j(L),N(z),M(se)}catch(A){console.error("Failed to fetch meta data",A)}})()},[]);const W=async T=>{try{const A=T.replace(/\s*\(\d+\s*lines\)$/,""),L=await(await fetch(`/api/file?path=${encodeURIComponent(A)}`)).text();a({filename:A,original:L,modified:L})}catch(A){console.error("Failed to fetch file content",A)}},me=async T=>{if(l)try{await fetch("/api/arbitrate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requestId:l.requestId||l.id,decision:T,timestamp:new Date().toISOString()})}),s(A=>A.map(R=>(R.requestId||R.id)===(l.requestId||l.id)?{...R,status:T==="approve"?"success":"error",arbitrated:!0,decision:T}:R)),f(!1),c(null)}catch(A){console.error("Arbitration failed",A)}},Ne=[{id:"audit",label:"Audit Log",icon:Vs},{id:"gates",label:"Quality Gates",icon:Uo},{id:"patterns",label:"Pattern Index",icon:$p},{id:"memory",label:"Memory Bank",icon:c0},{id:"agents",label:"Agent Teams",icon:el},{id:"checkpoints",label:"Checkpoints",icon:Ja}];return u.jsxs("div",{className:"studio",children:[u.jsxs("aside",{className:"sidebar",children:[u.jsxs("div",{className:"brand",children:[u.jsx("div",{className:"logo-icon",children:u.jsx(Uo,{size:18})}),u.jsx("span",{children:"Rigour Studio"}),u.jsxs("div",{className:"version-pill",children:["v",(x==null?void 0:x.version)||"2.13"]})]}),u.jsx("nav",{children:Ne.map(T=>u.jsxs("button",{className:`nav-item ${n===T.id?"active":""}`,onClick:()=>r(T.id),children:[u.jsx(T.icon,{size:18}),u.jsx("span",{children:T.label}),n===T.id&&u.jsx(tn.div,{layoutId:"nav-glow",className:"nav-glow"})]},T.id))}),u.jsxs("div",{className:"sidebar-footer",children:[u.jsxs("div",{className:"trust-indicator",children:[u.jsx(Wp,{size:14}),u.jsx("span",{children:"Local Governance"})]}),u.jsx("button",{className:"footer-item",children:u.jsx(Hp,{size:18})}),u.jsx("button",{className:"footer-item",children:u.jsx(m0,{size:18})})]})]}),u.jsxs("main",{className:"main-content",children:[u.jsxs("header",{children:[u.jsx("div",{className:"header-left",children:x&&u.jsxs("div",{className:"project-identity",children:[u.jsx(oo,{size:14,className:"folder-icon"}),u.jsx("span",{className:"project-name",children:x.name}),u.jsx("span",{className:"project-path",children:x.path})]})}),u.jsxs("div",{className:"header-right",children:[u.jsxs("div",{className:"connection-status",children:[u.jsxs("div",{className:"status-indicator",children:[u.jsx("div",{className:"pulse-emitter"}),u.jsx("span",{children:"LIVE"})]}),u.jsx("div",{className:"v-divider"}),u.jsxs("span",{children:["v",(x==null?void 0:x.version)||"0.0.0"]})]}),u.jsx("button",{className:"theme-toggle",onClick:C,children:e==="dark"?u.jsx(v0,{size:18}):u.jsx(g0,{size:18})})]})]}),u.jsxs("div",{className:"view-container",children:[u.jsxs(N0,{mode:"wait",children:[n==="audit"&&u.jsx(tn.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"full-view",children:u.jsx(pj,{logs:i,onClearLogs:()=>s([]),onSelectLog:T=>{var A,R,L;if(c(T),T!=null&&T._rigour_report||(T==null?void 0:T.type)==="interception_requested"){if(T!=null&&T._rigour_report){const z=(L=(R=(A=T._rigour_report.failures)==null?void 0:A[0])==null?void 0:R.files)==null?void 0:L[0];z?W(z):a(null)}else a(null);f(!0)}else a(null),f(!1)},selectedLog:l})},"audit"),n==="gates"&&u.jsx(tn.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"full-view",children:u.jsx(hj,{})},"gates"),n==="patterns"&&u.jsx(tn.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"full-view",children:u.jsx(fj,{})},"patterns"),n==="memory"&&u.jsx(tn.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"full-view",children:u.jsx(dj,{})},"memory"),n==="agents"&&u.jsx(tn.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"full-view",children:u.jsx(gj,{session:P})},"agents"),n==="checkpoints"&&u.jsx(tn.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"full-view",children:u.jsx(yj,{checkpoints:(V==null?void 0:V.checkpoints)||[]})},"checkpoints")]}),l&&d&&u.jsx("div",{className:"governance-overlay",children:u.jsxs("div",{className:"governance-window",children:[u.jsxs("div",{className:"governance-header",children:[u.jsxs("div",{className:"title",children:[u.jsx(Uo,{size:20}),u.jsxs("span",{children:["Governance Audit: ",l.tool]})]}),u.jsxs("div",{className:"hitl-actions",children:[l.type==="interception_requested"&&u.jsxs(u.Fragment,{children:[u.jsxs("button",{className:"btn-approve",onClick:()=>me("approve"),children:[u.jsx(tr,{size:16})," Approve"]}),u.jsxs("button",{className:"btn-reject",onClick:()=>me("reject"),children:[u.jsx(ii,{size:16})," Reject"]}),u.jsx("div",{className:"divider"})]}),u.jsx("button",{onClick:()=>f(!1),className:"close-btn",children:u.jsx(fu,{size:20})})]})]}),u.jsx("div",{className:"governance-body",children:l.type==="interception_requested"?u.jsxs("div",{className:"interception-view",children:[u.jsxs("div",{className:"interception-card",children:[u.jsx(Vs,{size:48}),u.jsx("h4",{children:"Command Intercepted"}),u.jsx("div",{className:"command-box",children:u.jsx("code",{children:l.command})}),u.jsx("p",{children:"An AI agent is requesting to execute this command. Review the project state below before arbitrating."}),u.jsxs("div",{className:"warning-note",children:[u.jsx(xn,{size:16}),u.jsx("span",{children:"Critical actions should be manually verified."})]})]}),u.jsx(Nf,{files:h.map(T=>T.replace(/\s*\(\d+\s*lines\)$/,"")),onSelect:T=>W(T),activeFile:o==null?void 0:o.filename,violatedFiles:[]})]}):u.jsxs(u.Fragment,{children:[u.jsx(Nf,{files:(((O=(Ee=l._rigour_report)==null?void 0:Ee.failures)==null?void 0:O.flatMap(T=>T.files||[]))||h).map(T=>T.replace(/\s*\(\d+\s*lines\)$/,"")),onSelect:T=>W(T),activeFile:o==null?void 0:o.filename,violatedFiles:(((U=($=l._rigour_report)==null?void 0:$.failures)==null?void 0:U.flatMap(T=>T.files||[]))||[]).map(T=>T.replace(/\s*\(\d+\s*lines\)$/,""))}),u.jsx("div",{className:"diff-view-area",children:o?u.jsx(uj,{filename:o.filename,originalCode:o.original,modifiedCode:o.modified,onClose:()=>a(null),theme:e}):u.jsxs("div",{className:"diff-placeholder",children:[u.jsx(Ds,{size:48}),u.jsx("p",{children:"Select a file to audit the proposed changes"})]})})]})})]})})]})]})]})}oa.createRoot(document.getElementById("root")).render(u.jsx(ze.StrictMode,{children:u.jsx(vj,{})}));
@@ -8,7 +8,7 @@
8
8
  <link rel="preconnect" href="https://fonts.googleapis.com">
9
9
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
10
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
11
- <script type="module" crossorigin src="/assets/index-DW8tuJV0.js"></script>
11
+ <script type="module" crossorigin src="/assets/index-Ch-q_mnO.js"></script>
12
12
  <link rel="stylesheet" crossorigin href="/assets/index-B3y-dtOQ.css">
13
13
  </head>
14
14
  <body>