@a-company/paradigm 3.34.0 → 3.43.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.
Files changed (117) hide show
  1. package/dist/{accept-orchestration-XXANWJVZ.js → accept-orchestration-ZUWQUHSK.js} +6 -6
  2. package/dist/add-VSPZ6FM4.js +81 -0
  3. package/dist/{aggregate-XHQ6GI3Z.js → aggregate-SV3VGEIL.js} +2 -2
  4. package/dist/assess-UHBDYIK7.js +68 -0
  5. package/dist/{beacon-BTLQMYQL.js → beacon-3SJV4DAP.js} +2 -2
  6. package/dist/calibration-WWHK73WU.js +135 -0
  7. package/dist/{chunk-C5ZE6WEX.js → chunk-2SKXFXIT.js} +91 -1
  8. package/dist/{chunk-S5TDFT5Q.js → chunk-7COU5S2Z.js} +2 -2
  9. package/dist/{chunk-3BAMPB6I.js → chunk-7WEKMZ46.js} +2 -147
  10. package/dist/{chunk-H4TVBJD4.js → chunk-AKIMFN6I.js} +3 -3
  11. package/dist/{chunk-3DYYXGDC.js → chunk-CDMAMDSG.js} +33 -0
  12. package/dist/{chunk-PFLWLC6J.js → chunk-CZEIK3Y2.js} +855 -34
  13. package/dist/chunk-F3BCHPYT.js +143 -0
  14. package/dist/chunk-GT5QGC2H.js +253 -0
  15. package/dist/{chunk-UQNTJ5VB.js → chunk-HIKKOCXY.js} +1 -1
  16. package/dist/{chunk-J26YQVAK.js → chunk-J4E6K5MG.js} +1 -1
  17. package/dist/chunk-L27I3CPZ.js +357 -0
  18. package/dist/{chunk-WOONGZ3C.js → chunk-P7XSBJE3.js} +1 -1
  19. package/dist/{chunk-Z7W7HNRG.js → chunk-QDXI2DHR.js} +1 -1
  20. package/dist/{chunk-BRILIG7Z.js → chunk-QIOCFXDQ.js} +42 -0
  21. package/dist/{chunk-3BGSDKWD.js → chunk-QWA26UNO.js} +7 -7
  22. package/dist/{lore-server-ILPHKWLK.js → chunk-RAB5IKPR.js} +77 -112
  23. package/dist/{chunk-BKMNLROM.js → chunk-RGFANZ4Q.js} +448 -147
  24. package/dist/{chunk-R2SGQ22F.js → chunk-YW5OCVKB.js} +448 -2
  25. package/dist/{chunk-CTF6RHKG.js → chunk-ZGUAAVMA.js} +17 -2
  26. package/dist/{commands-KPT2T2OZ.js → commands-LEPFD7S5.js} +452 -1
  27. package/dist/config-schema-3YNIFJCJ.js +152 -0
  28. package/dist/{constellation-LZ6XIKDT.js → constellation-FAGT45TU.js} +2 -2
  29. package/dist/{context-audit-RI4R2WRH.js → context-audit-557EO6PK.js} +138 -8
  30. package/dist/{cost-4SZM7OUS.js → cost-UD3WPEKZ.js} +1 -1
  31. package/dist/{delete-YTASL4SM.js → delete-RRK4RL6Y.js} +1 -1
  32. package/dist/{diff-T6YJSAAC.js → diff-IP5CIARP.js} +6 -6
  33. package/dist/{dist-AG5JNIZU-HW2FWNTZ.js → dist-5QE2BB2B-X6DYVSUL.js} +59 -5
  34. package/dist/{dist-OH4DBV2O.js → dist-OGTSAZ55.js} +16 -1
  35. package/dist/{dist-IKBGY7FQ.js → dist-RVKYUCRU.js} +3 -1
  36. package/dist/{dist-QSBAGCZT.js → dist-UXWV4OKX.js} +2 -2
  37. package/dist/{dist-RMAIFRTW.js → dist-Y7I3CFY5.js} +5 -3
  38. package/dist/{doctor-INBOLZC7.js → doctor-GKZJU7QG.js} +1 -1
  39. package/dist/{edit-S7NZD7H7.js → edit-4CLNN5JG.js} +1 -1
  40. package/dist/{graph-ERNQQQ7C.js → graph-YYUXI3F7.js} +1 -1
  41. package/dist/graph-server-ZPXRSGCW.js +116 -0
  42. package/dist/{habits-7BORPC2F.js → habits-O37HTUKE.js} +2 -2
  43. package/dist/index.js +200 -86
  44. package/dist/integrity-MK2OP5TA.js +194 -0
  45. package/dist/integrity-checker-J7YXRTBT.js +11 -0
  46. package/dist/{lint-MTRZB5EC.js → lint-HYWGS3JJ.js} +1 -1
  47. package/dist/{list-QTFWN35D.js → list-BTLFHSRC.js} +1 -1
  48. package/dist/list-IUCYPGMK.js +57 -0
  49. package/dist/{lore-loader-S5BXMH27.js → lore-loader-VTEEZDX3.js} +3 -1
  50. package/dist/lore-server-NOOAHKJX.js +118 -0
  51. package/dist/mcp.js +2581 -112
  52. package/dist/{migrate-HRN5TUBQ.js → migrate-FQVGQNXZ.js} +21 -3
  53. package/dist/{migrate-assessments-FPR6C35Z.js → migrate-assessments-JP6Q5KME.js} +1 -1
  54. package/dist/{orchestrate-3SI6ON33.js → orchestrate-A226N6FC.js} +6 -6
  55. package/dist/platform-server-KK4OCRTV.js +891 -0
  56. package/dist/{probe-ABMGCXQG.js → probe-7JK7IDNI.js} +4 -4
  57. package/dist/{providers-YW3FG6DA.js → providers-YNFSL6HK.js} +1 -1
  58. package/dist/quiz-I75NU2QQ.js +99 -0
  59. package/dist/{record-UGN75GTB.js → record-46CLR4OG.js} +11 -2
  60. package/dist/{reindex-YC7LD4MN.js → reindex-NZQRGKPN.js} +3 -2
  61. package/dist/{remember-WR6ZVXLT.js → remember-4EUZKIIB.js} +1 -1
  62. package/dist/{retag-URLJLMSK.js → retag-KC4JVRLE.js} +1 -1
  63. package/dist/{review-725ZKA7U.js → review-Q7M4CRB5.js} +1 -1
  64. package/dist/{ripple-QTXKJCEI.js → ripple-RI3LOT6R.js} +2 -2
  65. package/dist/{sentinel-FUR3QKCJ.js → sentinel-BKYTBT7M.js} +1 -1
  66. package/dist/sentinel-bridge-IZTXYS5M.js +109 -0
  67. package/dist/sentinel-ui/assets/{index-Zh1YM0C9.css → index-CJ1Wx083.css} +1 -1
  68. package/dist/sentinel-ui/assets/index-S1VJ67dT.js +62 -0
  69. package/dist/sentinel-ui/assets/index-S1VJ67dT.js.map +1 -0
  70. package/dist/sentinel-ui/index.html +2 -2
  71. package/dist/sentinel.js +6 -6
  72. package/dist/{serve-DIALBCTU.js → serve-22A4XOIG.js} +1 -1
  73. package/dist/{university-A66BMZ4Z.js → serve-2YJ6D2Y6.js} +9 -8
  74. package/dist/serve-3V2WXLGM.js +33 -0
  75. package/dist/{server-2VICPDUR.js → server-OFEJ2HJP.js} +25 -2
  76. package/dist/{server-OWBK2WFS.js → server-RDLQ3DK7.js} +49 -4
  77. package/dist/{setup-ASR6OMKV.js → setup-M2ZKLKNN.js} +2 -2
  78. package/dist/{shift-7XLSBLDW.js → shift-LNMKFYLR.js} +63 -14
  79. package/dist/{show-GEVVQWWG.js → show-P7GYO43X.js} +1 -1
  80. package/dist/show-PKZMYKRN.js +82 -0
  81. package/dist/{snapshot-QZFD7YBI.js → snapshot-Y3COXK4T.js} +2 -2
  82. package/dist/{spawn-DIY7T4QW.js → spawn-SSXZX45U.js} +2 -2
  83. package/dist/status-KLHALGW4.js +71 -0
  84. package/dist/{summary-R4CSYNNP.js → summary-5NQNOD3F.js} +2 -2
  85. package/dist/{sweep-5POCF2E4.js → sweep-EZU3GU6S.js} +1 -1
  86. package/dist/symphony-ROEKK7VD.js +999 -0
  87. package/dist/{team-VH3HYABB.js → team-HGLJXWQG.js} +7 -7
  88. package/dist/{timeline-RKXNRMKF.js → timeline-ANC7LVDL.js} +1 -1
  89. package/dist/{triage-GJ6GK647.js → triage-POXJ2TIX.js} +2 -2
  90. package/dist/university-content/courses/.purpose +7 -1
  91. package/dist/university-content/courses/para-501.json +166 -0
  92. package/dist/university-content/plsat/.purpose +6 -0
  93. package/dist/university-content/plsat/v3.0.json +323 -1
  94. package/dist/university-content/reference.json +48 -0
  95. package/dist/university-ui/assets/{index-TcsCEBMo.js → index-tfi5xN4Q.js} +2 -2
  96. package/dist/university-ui/assets/{index-TcsCEBMo.js.map → index-tfi5xN4Q.js.map} +1 -1
  97. package/dist/university-ui/index.html +1 -1
  98. package/dist/validate-GD5XWILV.js +134 -0
  99. package/dist/{validate-OUHUBZPO.js → validate-ZVPNN4FL.js} +1 -1
  100. package/dist/{workspace-5RBSALXC.js → workspace-UIUTHZTD.js} +5 -5
  101. package/package.json +4 -2
  102. package/platform-ui/dist/assets/GitSection-C-GQWHcu.css +1 -0
  103. package/platform-ui/dist/assets/GitSection-DvyJBF_-.js +4 -0
  104. package/platform-ui/dist/assets/GraphSection-BiQrXqfs.js +8 -0
  105. package/platform-ui/dist/assets/GraphSection-BlgXTl53.css +1 -0
  106. package/platform-ui/dist/assets/LoreSection-BaH1FaRb.js +1 -0
  107. package/platform-ui/dist/assets/LoreSection-C3EixkjW.css +1 -0
  108. package/platform-ui/dist/assets/SentinelSection-BI-aIYKL.css +1 -0
  109. package/platform-ui/dist/assets/SentinelSection-DemAznjI.js +1 -0
  110. package/platform-ui/dist/assets/index-CfpZFjea.css +1 -0
  111. package/platform-ui/dist/assets/index-DDKhCt-w.js +57 -0
  112. package/platform-ui/dist/index.html +14 -0
  113. package/dist/graph-server-BZ73HTAT.js +0 -251
  114. package/dist/sentinel-ui/assets/index-C_Wstm64.js +0 -62
  115. package/dist/sentinel-ui/assets/index-C_Wstm64.js.map +0 -1
  116. /package/dist/{chunk-VUSCJJ4A.js → chunk-EDOAWN7J.js} +0 -0
  117. /package/dist/{chunk-5SXMV4SP.js → chunk-FS3WTUHY.js} +0 -0
@@ -0,0 +1 @@
1
+ import{c as A,j as e,r as p,R as y}from"./index-DDKhCt-w.js";function k(){try{const t=localStorage.getItem("paradigm-lore-theme");if(t==="light"||t==="dark")return t}catch{}return"dark"}function T(){try{const t=localStorage.getItem("paradigm-lore-left-authors");if(t)return JSON.parse(t)}catch{}return[]}const c=A((t,r)=>({entries:[],filter:{},view:"timeline",selectedEntryId:null,symbols:[],authors:[],selectedSymbol:null,selectedAuthor:null,sessions:[],selectedSessionId:null,loading:!1,projectName:"",theme:k(),leftAuthors:T(),setView:s=>t({view:s}),setFilter:s=>{t(n=>({filter:{...n.filter,...s}})),r().fetchEntries()},clearFilters:()=>{t({filter:{}}),r().fetchEntries()},selectEntry:s=>t({selectedEntryId:s}),selectSymbol:s=>t({selectedSymbol:s}),selectAuthor:s=>t({selectedAuthor:s}),toggleTheme:()=>{const s=r().theme==="dark"?"light":"dark";document.documentElement.setAttribute("data-theme",s);try{localStorage.setItem("paradigm-lore-theme",s)}catch{}t({theme:s})},toggleLeftAuthor:s=>{const n=r().leftAuthors,a=n.includes(s)?n.filter(i=>i!==s):[...n,s];try{localStorage.setItem("paradigm-lore-left-authors",JSON.stringify(a))}catch{}t({leftAuthors:a})},selectSession:async s=>{if(t({selectedSessionId:s}),s)try{const a=await(await fetch(`/api/sessions/${encodeURIComponent(s)}`)).json();t(i=>({sessions:i.sessions.map(x=>x.id===s?{...x,entries:a.entries}:x)}))}catch{}},fetchEntries:async()=>{var s;t({loading:!0});try{const n=r().filter,a=new URLSearchParams;n.author&&a.set("author",n.author),n.hasAgent!==void 0?a.set("hasAgent",String(n.hasAgent)):n.authorType&&a.set("authorType",n.authorType),n.symbol&&a.set("symbol",n.symbol),n.type&&a.set("type",n.type),n.dateFrom&&a.set("from",n.dateFrom),n.dateTo&&a.set("to",n.dateTo),n.tag&&a.set("tag",n.tag),(s=n.tags)!=null&&s.length&&a.set("tags",n.tags.join(",")),n.hasReview!==void 0&&a.set("hasReview",String(n.hasReview)),n.hasBody!==void 0&&a.set("hasBody",String(n.hasBody)),a.set("limit","200");let d=(await(await fetch(`/api/lore?${a}`)).json()).entries||[];if(n.search){const h=n.search.toLowerCase();d=d.filter(u=>{var m;return u.title.toLowerCase().includes(h)||u.summary.toLowerCase().includes(h)||((m=u.symbols_touched)==null?void 0:m.some(j=>j.toLowerCase().includes(h)))})}t({entries:d,loading:!1})}catch{t({loading:!1})}},fetchSymbols:async()=>{try{const n=await(await fetch("/api/lore/symbols")).json();t({symbols:n.symbols||[]})}catch{}},fetchAuthors:async()=>{try{const n=await(await fetch("/api/lore/authors")).json();t({authors:n.authors||[]})}catch{}},fetchSessions:async()=>{try{const n=await(await fetch("/api/sessions")).json();t({sessions:n.sessions||[]})}catch{}},fetchAll:async()=>{try{const n=await(await fetch("/api/info")).json();t({projectName:n.project||""})}catch{}await Promise.all([r().fetchEntries(),r().fetchSymbols(),r().fetchAuthors(),r().fetchSessions()])}})),C=[{mode:"timeline",label:"Timeline"},{mode:"session",label:"Sessions"},{mode:"symbol",label:"Symbol"},{mode:"author",label:"Author"}];function F(){const t=c(a=>a.view),r=c(a=>a.setView),s=c(a=>a.theme),n=c(a=>a.toggleTheme);return e.jsxs("div",{className:"view-switcher-row",children:[e.jsx("div",{className:"view-switcher",children:C.map(a=>e.jsx("button",{className:`view-tab ${t===a.mode?"active":""}`,onClick:()=>r(a.mode),children:a.label},a.mode))}),e.jsx("button",{className:"theme-toggle",onClick:n,title:s==="dark"?"Switch to light mode":"Switch to dark mode",children:s==="dark"?"☀️":"🌙"})]})}const L=["","agent-session","human-note","decision","review","incident","milestone","retro","insight"],R=[{value:void 0,label:"All"},{value:!1,label:"Human Only"},{value:!0,label:"AI-Assisted"}];function E(){const t=c(l=>l.filter),r=c(l=>l.setFilter),s=c(l=>l.clearFilters),n=c(l=>l.authors),a=c(l=>l.symbols),[i,x]=p.useState(""),[d,h]=p.useState(!1),u=p.useRef(null),m=p.useRef(null),[j,v]=p.useState([]),b=Object.values(t).some(l=>l!==void 0&&l!==""&&(Array.isArray(l)?l.length>0:!0)),o=i?a.filter(l=>l.symbol.toLowerCase().includes(i.toLowerCase())).slice(0,10):a.slice(0,10);return p.useEffect(()=>{fetch("/api/lore/tags").then(l=>l.json()).then(l=>v(l.tags||[])).catch(()=>{})},[]),p.useEffect(()=>{function l(S){m.current&&!m.current.contains(S.target)&&u.current&&!u.current.contains(S.target)&&h(!1)}return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[]),e.jsxs("div",{className:"filter-bar",children:[e.jsx("div",{className:"author-type-toggle",children:R.map(l=>e.jsx("button",{className:`author-type-pill ${t.hasAgent===l.value?"active":""} ${l.value===void 0?"all":l.value?"agent":"human"}`,onClick:()=>r({hasAgent:l.value}),children:l.label},l.label))}),e.jsxs("select",{value:t.author||"",onChange:l=>r({author:l.target.value||void 0}),children:[e.jsx("option",{value:"",children:"All authors"}),n.map(l=>e.jsxs("option",{value:l.id,children:[l.hasAgent?"🤖":"👤"," ",l.id]},l.id))]}),e.jsxs("select",{value:t.type||"",onChange:l=>r({type:l.target.value||void 0}),children:[e.jsx("option",{value:"",children:"All types"}),L.filter(Boolean).map(l=>e.jsx("option",{value:l,children:l},l))]}),j.length>0&&e.jsxs("select",{value:t.tag||"",onChange:l=>r({tag:l.target.value||void 0}),children:[e.jsx("option",{value:"",children:"All tags"}),j.map(l=>e.jsxs("option",{value:l.tag,children:[l.tag," (",l.count,")"]},l.tag))]}),e.jsxs("div",{className:"symbol-autocomplete-wrapper",children:[e.jsx("input",{ref:u,type:"text",placeholder:t.symbol?`Symbol: ${t.symbol}`:"Filter by symbol...",value:i,onChange:l=>{x(l.target.value),h(!0)},onFocus:()=>h(!0),style:{width:160}}),t.symbol&&e.jsx("button",{className:"symbol-clear",onClick:()=>{r({symbol:void 0}),x("")},children:"x"}),d&&o.length>0&&e.jsx("div",{className:"symbol-dropdown",ref:m,children:o.map(l=>e.jsxs("div",{className:`symbol-dropdown-item ${t.symbol===l.symbol?"active":""}`,onClick:()=>{r({symbol:l.symbol}),x(""),h(!1)},children:[e.jsx("span",{className:"symbol-dropdown-name",children:l.symbol}),e.jsx("span",{className:"symbol-dropdown-count",children:l.count})]},l.symbol))})]}),e.jsx("input",{type:"text",placeholder:"Search...",value:t.search||"",onChange:l=>r({search:l.target.value||void 0}),style:{width:140}}),e.jsx("input",{type:"date",value:t.dateFrom||"",onChange:l=>r({dateFrom:l.target.value||void 0}),title:"From date"}),e.jsx("input",{type:"date",value:t.dateTo||"",onChange:l=>r({dateTo:l.target.value||void 0}),title:"To date"}),e.jsx("button",{className:`filter-preset ${t.hasReview===!1?"active":""}`,onClick:()=>r({hasReview:t.hasReview===!1?void 0:!1}),children:"Needs Review"}),b&&e.jsx("button",{className:"filter-clear",onClick:s,children:"Clear filters"})]})}const $={"#":"component","^":"gate",$:"flow","!":"signal","~":"aspect"};function g({symbol:t}){const r=t.charAt(0),s=$[r]||"component";return e.jsx("span",{className:`symbol-tag ${s}`,children:t})}function _({status:t}){if(!t)return null;const r={pass:{icon:"✓",className:"pass"},fail:{icon:"✗",className:"fail"},partial:{icon:"⚠",className:"partial"},untested:{icon:"·",className:""}},s=r[t]||r.untested;return e.jsxs("span",{className:`lore-card-verify ${s.className}`,children:[s.icon," ",t]})}function w({rating:t}){return e.jsxs("span",{className:"review-stars",children:["★".repeat(t),"☆".repeat(5-t)]})}function z(){var a,i,x,d,h,u,m,j,v,b;const t=c(o=>o.selectedEntryId),r=c(o=>o.selectEntry),[s,n]=p.useState(null);return p.useEffect(()=>{if(!t){n(null);return}fetch(`/api/lore/${t}`).then(o=>o.json()).then(n).catch(()=>n(null))},[t]),!t||!s?null:e.jsxs("div",{className:"detail-overlay",children:[e.jsx("div",{className:"detail-backdrop",onClick:()=>r(null)}),e.jsxs("div",{className:"detail-panel",children:[e.jsxs("div",{className:"detail-header",children:[e.jsxs("div",{children:[e.jsx("div",{className:"lore-card-title",style:{fontSize:16},children:s.title}),e.jsxs("div",{style:{display:"flex",gap:8,marginTop:4,alignItems:"center"},children:[e.jsx("span",{className:`lore-card-type ${s.type}`,children:s.type}),e.jsx("span",{style:{color:"var(--text-muted)",fontSize:12},children:s.id})]})]}),e.jsx("button",{className:"detail-close",onClick:()=>r(null),children:"✕"})]}),e.jsxs("div",{className:"detail-body",children:[e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Details"}),e.jsxs("dl",{className:"detail-meta",children:[e.jsx("dt",{children:"Author"}),e.jsxs("dd",{children:["👤"," ",typeof s.author=="string"?s.author:"unknown"]}),s.agent&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"AI Agent"}),e.jsxs("dd",{children:["🤖"," ",s.agent.model,s.agent.provider?` (${s.agent.provider})`:""]})]}),e.jsx("dt",{children:"Time"}),e.jsx("dd",{children:new Date(s.timestamp).toLocaleString()}),s.duration_minutes&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Duration"}),e.jsxs("dd",{children:[s.duration_minutes," minutes"]})]}),s.commit&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Commit"}),e.jsx("dd",{style:{fontFamily:"monospace",fontSize:12},children:s.commit})]})]})]}),e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Summary"}),e.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)"},children:s.summary})]}),s.body&&e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Body"}),e.jsx("pre",{style:{fontSize:12,color:"var(--text-secondary)",whiteSpace:"pre-wrap",wordBreak:"break-word",background:"var(--bg-primary)",padding:12,borderRadius:6,border:"1px solid var(--border)",maxHeight:300,overflowY:"auto"},children:s.body})]}),(a=s.linked_lore)!=null&&a.length||(i=s.linked_tasks)!=null&&i.length||(x=s.linked_commits)!=null&&x.length?e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Linked"}),e.jsxs("dl",{className:"detail-meta",children:[s.linked_lore&&s.linked_lore.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Lore"}),e.jsx("dd",{children:s.linked_lore.map(o=>e.jsx("span",{onClick:()=>r(o),style:{cursor:"pointer",color:"var(--color-component)",textDecoration:"underline",marginRight:8,fontSize:12},children:o},o))})]}),s.linked_tasks&&s.linked_tasks.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Tasks"}),e.jsx("dd",{children:s.linked_tasks.map(o=>e.jsx("span",{style:{fontFamily:"monospace",fontSize:12,marginRight:8},children:o},o))})]}),s.linked_commits&&s.linked_commits.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Commits"}),e.jsx("dd",{children:s.linked_commits.map(o=>e.jsx("span",{style:{fontFamily:"monospace",fontSize:12,marginRight:8},children:o.slice(0,8)},o))})]})]})]}):null,((d=s.symbols_touched)==null?void 0:d.length)>0&&e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Symbols Touched"}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:s.symbols_touched.map(o=>e.jsx(g,{symbol:o},o))})]}),s.symbols_created&&s.symbols_created.length>0&&e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Symbols Created"}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:s.symbols_created.map(o=>e.jsx(g,{symbol:o},o))})]}),(h=s.files_created)!=null&&h.length||(u=s.files_modified)!=null&&u.length?e.jsxs("div",{className:"detail-section",children:[e.jsxs("h3",{children:["Files (",(((m=s.files_created)==null?void 0:m.length)||0)+(((j=s.files_modified)==null?void 0:j.length)||0),")"]}),e.jsxs("ul",{className:"detail-files",children:[(v=s.files_created)==null?void 0:v.map(o=>e.jsxs("li",{style:{color:"#34d399"},children:["+ ",o]},o)),(b=s.files_modified)==null?void 0:b.map(o=>e.jsxs("li",{style:{color:"#fbbf24"},children:["~ ",o]},o))]}),s.lines_added||s.lines_removed?e.jsxs("p",{style:{fontSize:12,color:"var(--text-muted)",marginTop:4},children:[e.jsxs("span",{style:{color:"#34d399"},children:["+",s.lines_added||0]})," ",e.jsxs("span",{style:{color:"#f87171"},children:["-",s.lines_removed||0]})," lines"]}):null]}):null,s.decisions&&s.decisions.length>0&&e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Decisions"}),s.decisions.map(o=>e.jsxs("div",{className:"detail-decision",children:[e.jsx("div",{className:"decision-text",children:o.decision}),e.jsx("div",{className:"decision-rationale",children:o.rationale})]},o.id))]}),s.errors_encountered&&s.errors_encountered.length>0&&e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Errors Encountered"}),s.errors_encountered.map((o,l)=>e.jsxs("div",{className:"detail-error",children:[e.jsx("div",{style:{color:"var(--color-incident)",fontSize:13},children:o.description}),e.jsxs("div",{style:{color:"var(--text-secondary)",fontSize:12,marginTop:2},children:["→"," ",o.resolution,o.time_to_fix?` (${o.time_to_fix})`:""]})]},l))]}),s.learnings&&s.learnings.length>0&&e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Learnings"}),s.learnings.map((o,l)=>e.jsx("div",{className:"detail-learning",children:o},l))]}),s.verification&&e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Verification"}),e.jsx(_,{status:s.verification.status}),s.verification.details&&e.jsx("dl",{className:"detail-meta",style:{marginTop:8},children:Object.entries(s.verification.details).map(([o,l])=>e.jsxs(y.Fragment,{children:[e.jsx("dt",{children:o}),e.jsx("dd",{style:{color:l==="pass"?"#34d399":"#f87171"},children:l})]},o))})]}),(s.confidence!=null||s.assessment)&&e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Confidence & Assessment"}),e.jsxs("dl",{className:"detail-meta",children:[s.confidence!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Confidence"}),e.jsx("dd",{children:e.jsxs("span",{style:{padding:"2px 8px",background:"rgba(139, 92, 246, 0.15)",border:"1px solid rgba(139, 92, 246, 0.3)",borderRadius:10,fontSize:12,color:"#8b5cf6"},children:[(s.confidence*100).toFixed(0),"%"]})})]}),s.assessment&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Verdict"}),e.jsx("dd",{children:e.jsx("span",{style:{padding:"2px 8px",background:s.assessment.verdict==="correct"?"rgba(52, 211, 153, 0.15)":s.assessment.verdict==="partial"?"rgba(251, 191, 36, 0.15)":"rgba(248, 113, 113, 0.15)",border:`1px solid ${s.assessment.verdict==="correct"?"rgba(52, 211, 153, 0.3)":s.assessment.verdict==="partial"?"rgba(251, 191, 36, 0.3)":"rgba(248, 113, 113, 0.3)"}`,borderRadius:10,fontSize:12,color:s.assessment.verdict==="correct"?"#34d399":s.assessment.verdict==="partial"?"#fbbf24":"#f87171"},children:s.assessment.verdict})}),e.jsx("dt",{children:"Assessed by"}),e.jsx("dd",{children:s.assessment.assessed_by}),e.jsx("dt",{children:"Assessed at"}),e.jsx("dd",{children:new Date(s.assessment.assessed_at).toLocaleString()}),s.assessment.notes&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Notes"}),e.jsx("dd",{children:s.assessment.notes})]})]}),s.assessment_delta!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Delta"}),e.jsxs("dd",{style:{color:Math.abs(s.assessment_delta)<=.1?"#34d399":Math.abs(s.assessment_delta)<=.3?"#fbbf24":"#f87171"},children:[s.assessment_delta>0?"+":"",s.assessment_delta.toFixed(2)," ",e.jsxs("span",{style:{fontSize:11,color:"var(--text-muted)"},children:["(",s.assessment_delta>.1?"under-confident":s.assessment_delta<-.1?"over-confident":"well-calibrated",")"]})]})]})]})]}),s.review?e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Review"}),e.jsxs("dl",{className:"detail-meta",children:[e.jsx("dt",{children:"Reviewer"}),e.jsx("dd",{children:s.review.reviewer}),e.jsx("dt",{children:"Completeness"}),e.jsx("dd",{children:e.jsx(w,{rating:s.review.completeness})}),e.jsx("dt",{children:"Quality"}),e.jsx("dd",{children:e.jsx(w,{rating:s.review.quality})}),s.review.notes&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Notes"}),e.jsx("dd",{children:s.review.notes})]})]})]}):e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Review"}),e.jsxs("p",{style:{color:"var(--text-muted)",fontSize:13},children:["No review yet. Run ",e.jsxs("code",{style:{background:"var(--bg-card)",padding:"2px 4px",borderRadius:3},children:["paradigm lore review ",s.id]})]})]}),s.git_context&&e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Git Context"}),e.jsxs("dl",{className:"detail-meta",children:[e.jsx("dt",{children:"Commit"}),e.jsx("dd",{style:{fontFamily:"monospace",fontSize:12},children:s.git_context.ref.slice(0,8)}),e.jsx("dt",{children:"Branch"}),e.jsx("dd",{children:s.git_context.branch}),e.jsx("dt",{children:"Working tree"}),e.jsx("dd",{children:s.git_context.dirty?"Dirty (uncommitted changes)":"Clean"})]})]}),s.meta&&Object.keys(s.meta).length>0&&e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Metadata"}),e.jsx("dl",{className:"detail-meta",children:Object.entries(s.meta).map(([o,l])=>e.jsxs(y.Fragment,{children:[e.jsx("dt",{children:o}),e.jsx("dd",{children:typeof l=="object"?JSON.stringify(l):String(l)})]},o))})]}),s.tags&&s.tags.length>0&&e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Tags"}),e.jsx("div",{style:{display:"flex",gap:4,flexWrap:"wrap"},children:s.tags.map(o=>{const l=o.startsWith("arc:");return e.jsxs("span",{style:{padding:"2px 8px",background:l?"var(--color-flow-bg, rgba(96, 165, 250, 0.15))":"var(--bg-primary)",border:`1px solid ${l?"var(--color-flow, #60a5fa)":"var(--border)"}`,borderRadius:12,fontSize:11,color:l?"var(--color-flow, #60a5fa)":"var(--text-secondary)"},children:[l?"↻ ":"",o]},o)})})]})]})]})]})}function D(t){return new Date(t).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})}function N({entry:t,side:r="right"}){var x,d,h,u;const s=c(m=>m.selectEntry),n=t.agent!=null,a=(((x=t.files_created)==null?void 0:x.length)||0)+(((d=t.files_modified)==null?void 0:d.length)||0),i=(t.lines_added||0)+(t.lines_removed||0);return e.jsx("div",{className:`lore-card-row ${r} ${n?"agent":"human"}`,children:e.jsxs("div",{className:"lore-card",onClick:()=>s(t.id),children:[e.jsxs("div",{className:"lore-card-header",children:[e.jsx("div",{className:"lore-card-author",children:e.jsxs("span",{className:`author-badge ${n?"agent":"human"}`,children:[n?"🤖":"👤"," ",typeof t.author=="string"?t.author:"unknown"]})}),e.jsx("span",{className:`lore-card-type ${t.type||"agent-session"}`,children:t.type||"agent-session"})]}),e.jsx("div",{className:"lore-card-title",children:t.title}),e.jsx("div",{className:"lore-card-summary",children:t.summary}),t.body&&e.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:4,fontStyle:"italic",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[t.body.slice(0,100),t.body.length>100?"...":""]}),((h=t.symbols_touched)==null?void 0:h.length)>0&&e.jsxs("div",{className:"lore-card-symbols",children:[t.symbols_touched.slice(0,5).map(m=>e.jsx(g,{symbol:m},m)),t.symbols_touched.length>5&&e.jsxs("span",{className:"symbol-tag component",children:["+",t.symbols_touched.length-5]})]}),Array.isArray(t.tags)&&t.tags.some(m=>m.startsWith("arc:"))&&e.jsx("div",{style:{display:"flex",gap:4,marginTop:4,flexWrap:"wrap"},children:t.tags.filter(m=>m.startsWith("arc:")).map(m=>e.jsxs("span",{style:{padding:"1px 6px",background:"rgba(96, 165, 250, 0.15)",border:"1px solid rgba(96, 165, 250, 0.3)",borderRadius:10,fontSize:10,color:"#60a5fa"},children:["↻"," ",m]},m))}),e.jsxs("div",{className:"lore-card-footer",children:[e.jsxs("div",{className:"lore-card-stats",children:[a>0&&e.jsxs("span",{children:[a," files"]}),i>0&&e.jsxs("span",{children:[i," loc"]}),t.duration_minutes&&e.jsxs("span",{children:[t.duration_minutes,"m"]}),e.jsx(_,{status:(u=t.verification)==null?void 0:u.status}),t.confidence!=null&&e.jsxs("span",{style:{padding:"1px 5px",background:"rgba(139, 92, 246, 0.15)",border:"1px solid rgba(139, 92, 246, 0.3)",borderRadius:8,fontSize:10,color:"#8b5cf6"},children:[(t.confidence*100).toFixed(0),"%"]}),t.assessment&&e.jsx("span",{style:{padding:"1px 5px",background:t.assessment.verdict==="correct"?"rgba(52, 211, 153, 0.15)":t.assessment.verdict==="partial"?"rgba(251, 191, 36, 0.15)":"rgba(248, 113, 113, 0.15)",border:`1px solid ${t.assessment.verdict==="correct"?"rgba(52, 211, 153, 0.3)":t.assessment.verdict==="partial"?"rgba(251, 191, 36, 0.3)":"rgba(248, 113, 113, 0.3)"}`,borderRadius:8,fontSize:10,color:t.assessment.verdict==="correct"?"#34d399":t.assessment.verdict==="partial"?"#fbbf24":"#f87171"},children:t.assessment.verdict})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[t.review&&e.jsx(w,{rating:t.review.quality}),e.jsx("span",{children:D(t.timestamp)})]})]})]})})}function I({date:t,humanCount:r,agentCount:s}){const a=new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"});return e.jsxs("div",{className:"date-separator",children:[e.jsx("span",{className:"date-count human",children:r}),e.jsx("span",{className:"date-badge",children:a}),e.jsx("span",{className:"date-count agent",children:s})]})}function B(){const t=c(d=>d.entries),r=c(d=>d.authors),s=c(d=>d.leftAuthors),n=c(d=>d.toggleLeftAuthor);if(t.length===0)return e.jsxs("div",{className:"empty-state",children:[e.jsx("h2",{children:"No lore entries yet"}),e.jsxs("p",{children:["Record your first entry with ",e.jsx("code",{children:"paradigm lore record"})," or via the MCP tool ",e.jsx("code",{children:"paradigm_lore_record"}),"."]})]});const a=s.length>0,i=new Map;for(const d of t){const h=d.timestamp.slice(0,10);i.has(h)||i.set(h,[]),i.get(h).push(d)}const x=d=>s.includes(d);return e.jsxs("div",{className:`thread-view ${a?"":"single-column"}`,children:[a&&e.jsx("div",{className:"timeline-spine"}),e.jsx("div",{className:"timeline-column-labels",children:a?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"column-label-group left",children:s.map(d=>e.jsxs("button",{className:"column-author-pill active",onClick:()=>n(d),title:"Remove from left column",children:[d," ×"]},d))}),e.jsx("div",{className:"column-label-group right",children:e.jsx("span",{className:"column-label-text",children:"EVERYONE ELSE"})})]}):e.jsxs("div",{className:"column-author-selector",children:[e.jsx("span",{className:"column-label-text",children:"Pick an author for the left column:"}),r.map(d=>e.jsx("button",{className:"column-author-pill",onClick:()=>n(d.id),children:d.id},d.id))]})}),Array.from(i.entries()).map(([d,h])=>{const u=h.filter(j=>x(j.author)).length,m=h.filter(j=>!x(j.author)).length;return e.jsxs(y.Fragment,{children:[e.jsx(I,{date:d,humanCount:u,agentCount:m}),h.map(j=>e.jsx(N,{entry:j,side:a&&x(j.author)?"left":"right"},j.id))]},d)})]})}function O(){const t=c(i=>i.symbols),r=c(i=>i.entries),s=c(i=>i.selectedSymbol),n=c(i=>i.selectSymbol),a=c(i=>i.setFilter);return p.useEffect(()=>{a(s?{symbol:s}:{symbol:void 0})},[s]),e.jsxs("div",{className:"sidebar-view",children:[e.jsxs("div",{className:"sidebar",children:[e.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--border)",fontSize:11,color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.05em"},children:["Symbols (",t.length,")"]}),t.map(i=>e.jsxs("div",{className:`sidebar-item ${s===i.symbol?"active":""}`,onClick:()=>n(s===i.symbol?null:i.symbol),children:[e.jsx("span",{className:"sidebar-item-name",children:e.jsx(g,{symbol:i.symbol})}),e.jsx("span",{className:"sidebar-item-count",children:i.count})]},i.symbol)),t.length===0&&e.jsx("div",{style:{padding:20,color:"var(--text-muted)",textAlign:"center",fontSize:13},children:"No symbols found"})]}),e.jsx("div",{className:"sidebar-content",children:s?e.jsxs(e.Fragment,{children:[e.jsxs("h2",{style:{fontSize:16,marginBottom:16},children:[e.jsx(g,{symbol:s})," entries"]}),r.length===0?e.jsx("div",{style:{color:"var(--text-muted)"},children:"No entries for this symbol"}):r.map(i=>e.jsx("div",{style:{marginBottom:12},children:e.jsx(N,{entry:i})},i.id))]}):e.jsxs("div",{className:"empty-state",children:[e.jsx("h2",{children:"Select a symbol"}),e.jsx("p",{children:"Choose a symbol from the sidebar to view its history."})]})})]})}function V(){const t=c(i=>i.authors),r=c(i=>i.entries),s=c(i=>i.selectedAuthor),n=c(i=>i.selectAuthor),a=c(i=>i.setFilter);return p.useEffect(()=>{a(s?{author:s}:{author:void 0})},[s]),e.jsxs("div",{className:"sidebar-view",children:[e.jsxs("div",{className:"sidebar",children:[e.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--border)",fontSize:11,color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.05em"},children:["Authors (",t.length,")"]}),t.map(i=>e.jsxs("div",{className:`sidebar-item ${s===i.id?"active":""}`,onClick:()=>n(s===i.id?null:i.id),children:[e.jsxs("div",{children:[e.jsxs("span",{className:"sidebar-item-name",children:[i.hasAgent?"🤖":"👤"," ",i.id]}),e.jsxs("div",{style:{fontSize:10,color:"var(--text-muted)",marginTop:2},children:["Last active: ",new Date(i.lastActive).toLocaleDateString()]})]}),e.jsx("span",{className:"sidebar-item-count",children:i.count})]},i.id)),t.length===0&&e.jsx("div",{style:{padding:20,color:"var(--text-muted)",textAlign:"center",fontSize:13},children:"No authors found"})]}),e.jsx("div",{className:"sidebar-content",children:s?e.jsxs(e.Fragment,{children:[e.jsxs("h2",{style:{fontSize:16,marginBottom:16},children:[s,"'s entries"]}),r.length===0?e.jsx("div",{style:{color:"var(--text-muted)"},children:"No entries for this author"}):r.map(i=>e.jsx("div",{style:{marginBottom:12},children:e.jsx(N,{entry:i})},i.id))]}):e.jsxs("div",{className:"empty-state",children:[e.jsx("h2",{children:"Select an author"}),e.jsx("p",{children:"Choose an author from the sidebar to view their work."})]})})]})}function f(t){return new Date(t).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})}function M(t,r){const s=new Date(r).getTime()-new Date(t).getTime(),n=Math.round(s/6e4);if(n<60)return`${n}m`;const a=Math.floor(n/60),i=n%60;return i>0?`${a}h ${i}m`:`${a}h`}function W({session:t,active:r,onClick:s}){var a;const n=t.author.hasAgent;return e.jsxs("div",{className:`sidebar-item session-sidebar-item ${r?"active":""}`,onClick:s,children:[e.jsxs("div",{className:"session-sidebar-info",children:[e.jsxs("span",{className:`session-author-badge ${n?"agent":"human"}`,children:[n?"🤖":"👤"," ",t.author.name]}),e.jsxs("div",{className:"session-sidebar-meta",children:[f(t.startTime),t.startTime!==t.endTime&&` - ${f(t.endTime)}`]})]}),e.jsxs("div",{className:"session-sidebar-stats",children:[e.jsxs("span",{className:"sidebar-item-count",children:[t.entryCount," entries"]}),((a=t.symbolsTouched)==null?void 0:a.length)>0&&e.jsxs("span",{className:"sidebar-item-count",children:[t.symbolsTouched.length," symbols"]})]})]})}function P({session:t}){var n;const r=M(t.startTime,t.endTime),s=new Date(t.date).toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"});return e.jsxs("div",{className:"session-detail",children:[e.jsxs("div",{className:"session-detail-header",children:[e.jsx("h2",{children:e.jsxs("span",{className:`session-author-badge ${t.author.hasAgent?"agent":"human"}`,children:[t.author.hasAgent?"🤖":"👤"," ",t.author.name]})}),e.jsxs("div",{className:"session-detail-meta",children:[e.jsx("span",{children:s}),e.jsxs("span",{children:[f(t.startTime)," - ",f(t.endTime)]}),e.jsx("span",{children:r}),e.jsxs("span",{children:[t.entryCount," entries"]})]})]}),((n=t.symbolsTouched)==null?void 0:n.length)>0&&e.jsxs("div",{className:"session-detail-section",children:[e.jsx("h3",{children:"Symbols Touched"}),e.jsx("div",{className:"session-symbols",children:t.symbolsTouched.map(a=>e.jsx(g,{symbol:a},a))})]}),t.breadcrumbs&&t.breadcrumbs.length>0&&e.jsxs("div",{className:"session-detail-section",children:[e.jsx("h3",{children:"Session Breadcrumbs"}),e.jsx("div",{className:"breadcrumb-list",children:t.breadcrumbs.map((a,i)=>e.jsxs("div",{className:"breadcrumb-item",children:[a.phase&&e.jsx("span",{className:"breadcrumb-phase",children:a.phase}),a.context&&e.jsx("span",{className:"breadcrumb-context",children:a.context}),a.timestamp&&e.jsx("span",{className:"breadcrumb-time",children:f(a.timestamp)}),a.decisions&&a.decisions.length>0&&e.jsx("div",{className:"breadcrumb-decisions",children:a.decisions.map((x,d)=>e.jsx("span",{className:"breadcrumb-decision",children:x},d))})]},i))})]}),e.jsxs("div",{className:"session-detail-section",children:[e.jsx("h3",{children:"Lore Entries"}),t.entries?t.entries.map(a=>e.jsx("div",{style:{marginBottom:12},children:e.jsx(N,{entry:a})},a.id)):e.jsx("div",{style:{color:"var(--text-muted)",fontSize:13},children:"Loading entries..."})]})]})}function U(){const t=c(i=>i.sessions),r=c(i=>i.selectedSessionId),s=c(i=>i.selectSession),n=t.find(i=>i.id===r),a=new Map;for(const i of t)a.has(i.date)||a.set(i.date,[]),a.get(i.date).push(i);return e.jsxs("div",{className:"sidebar-view",children:[e.jsxs("div",{className:"sidebar",children:[e.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--border)",fontSize:11,color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.05em"},children:["Sessions (",t.length,")"]}),t.length===0?e.jsx("div",{style:{padding:20,color:"var(--text-muted)",textAlign:"center",fontSize:13},children:"No sessions found"}):Array.from(a.entries()).map(([i,x])=>{const d=new Date(i).toLocaleDateString("en-US",{month:"short",day:"numeric"});return e.jsxs(y.Fragment,{children:[e.jsx("div",{className:"session-date-header",children:d}),x.map(h=>e.jsx(W,{session:h,active:r===h.id,onClick:()=>s(r===h.id?null:h.id)},h.id))]},i)})]}),e.jsx("div",{className:"sidebar-content",children:n?e.jsx(P,{session:n}):e.jsxs("div",{className:"empty-state",children:[e.jsx("h2",{children:"Select a session"}),e.jsx("p",{children:"Choose a session from the sidebar to view its details, entries, and breadcrumbs."})]})})]})}function q(){const t=c(i=>i.view),r=c(i=>i.entries),s=c(i=>i.projectName),n=c(i=>i.authors),a=c(i=>i.fetchAll);return p.useEffect(()=>{a()},[]),e.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:[e.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--p-border)"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:t==="timeline"?8:0},children:[e.jsxs("div",{children:[e.jsx("span",{style:{fontSize:16,fontWeight:600},children:"Lore"}),e.jsxs("span",{style:{fontSize:12,color:"var(--p-text-muted)",marginLeft:10},children:[s||"project"," · ",r.length," entries · ",n.length," authors"]})]}),e.jsx(F,{})]}),t==="timeline"&&e.jsx(E,{})]}),e.jsxs("main",{style:{flex:1,overflow:"auto",paddingBottom:32},children:[t==="timeline"&&e.jsx(B,{}),t==="session"&&e.jsx(U,{}),t==="symbol"&&e.jsx(O,{}),t==="author"&&e.jsx(V,{})]}),e.jsx(z,{})]})}export{q as default};
@@ -0,0 +1 @@
1
+ :root{--bg-primary: #0a0a0f;--bg-secondary: #111118;--bg-card: #16161e;--bg-hover: #1e1e2a;--bg-panel: #12121a;--text-primary: #e2e8f0;--text-secondary: #94a3b8;--text-muted: #64748b;--border: #1e293b;--border-hover: #334155;--color-component: #7dd3fc;--color-gate: #86efac;--color-flow: #fbbf24;--color-signal: #fde047;--color-aspect: #a78bfa;--color-agent-session: #818cf8;--color-human-note: #34d399;--color-decision: #fbbf24;--color-review: #c084fc;--color-incident: #f87171;--color-milestone: #60a5fa;--spine-color: #1e293b;--spine-width: 2px}[data-theme=light]{--bg-primary: #f8f9fa;--bg-secondary: #ffffff;--bg-card: #ffffff;--bg-hover: #f1f3f5;--bg-panel: #ffffff;--text-primary: #1a1a2e;--text-secondary: #495057;--text-muted: #868e96;--border: #dee2e6;--border-hover: #adb5bd;--color-component: #0c8599;--color-gate: #2b8a3e;--color-flow: #e67700;--color-signal: #c2255c;--color-aspect: #6741d9;--color-agent-session: #5c7cfa;--color-human-note: #20c997;--color-decision: #e67700;--color-review: #9775fa;--color-incident: #fa5252;--color-milestone: #339af0;--spine-color: #dee2e6}*{margin:0;padding:0;box-sizing:border-box}body{background:var(--bg-primary);color:var(--text-primary);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Inter,sans-serif;font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased}#root{min-height:100vh;display:flex;flex-direction:column}::-webkit-scrollbar{width:6px}::-webkit-scrollbar-track{background:var(--bg-primary)}::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}::-webkit-scrollbar-thumb:hover{background:var(--border-hover)}.header{position:sticky;top:0;z-index:100;background:var(--bg-secondary);border-bottom:1px solid var(--border);padding:12px 24px}.header-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.header-title{display:flex;align-items:center;gap:12px}.header-title h1{font-size:18px;font-weight:600;letter-spacing:-.01em}.header-title .project-name{color:var(--text-secondary);font-size:13px}.header-stats{color:var(--text-muted);font-size:12px}.view-switcher-row{display:flex;align-items:center;gap:8px}.view-switcher{display:flex;gap:2px;background:var(--bg-primary);border-radius:6px;padding:2px}.theme-toggle{width:32px;height:32px;border:1px solid var(--border);background:var(--bg-primary);border-radius:6px;cursor:pointer;font-size:14px;display:flex;align-items:center;justify-content:center;transition:all .15s}.theme-toggle:hover{border-color:var(--border-hover);background:var(--bg-hover)}.view-tab{padding:6px 16px;border:none;background:none;color:var(--text-secondary);font-size:13px;cursor:pointer;border-radius:4px;transition:all .15s}.view-tab:hover{color:var(--text-primary);background:var(--bg-hover)}.view-tab.active{color:var(--text-primary);background:var(--bg-card)}.filter-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.filter-bar select,.filter-bar input{background:var(--bg-primary);border:1px solid var(--border);color:var(--text-primary);padding:5px 10px;border-radius:4px;font-size:12px;outline:none}.filter-bar select:focus,.filter-bar input:focus{border-color:var(--color-component)}.filter-preset{padding:4px 10px;border:1px solid var(--border);background:none;color:var(--text-secondary);border-radius:12px;font-size:11px;cursor:pointer;transition:all .15s}.filter-preset:hover{border-color:var(--border-hover);color:var(--text-primary)}.filter-preset.active{background:var(--bg-card);color:var(--text-primary);border-color:var(--color-component)}.filter-clear{padding:4px 10px;border:none;background:none;color:var(--text-muted);font-size:11px;cursor:pointer}.filter-clear:hover{color:var(--color-incident)}.thread-view{position:relative;max-width:900px;margin:0 auto;padding:24px 16px}.thread-view.single-column{max-width:600px}.timeline-spine{position:absolute;left:50%;top:0;bottom:0;width:var(--spine-width);background:var(--spine-color);transform:translate(-50%)}.timeline-column-labels{position:sticky;top:90px;z-index:10;display:flex;justify-content:space-between;align-items:center;padding:0 4px;margin-bottom:8px}.column-label-group{display:flex;align-items:center;gap:4px}.column-label-group.left,.column-label-group.right{max-width:48%}.column-label-text{font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.1em;color:var(--text-muted);padding:3px 10px;border-radius:3px;background:var(--bg-secondary);white-space:nowrap}.column-author-selector{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.column-author-pill{padding:3px 10px;border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-secondary);border-radius:12px;font-size:11px;cursor:pointer;transition:all .15s}.column-author-pill:hover{border-color:var(--border-hover);color:var(--text-primary)}.column-author-pill.active{background:#818cf826;border-color:var(--color-agent-session);color:var(--color-agent-session)}.date-separator{position:relative;z-index:3;display:flex;align-items:center;justify-content:center;margin:24px 0 16px;gap:8px}.date-badge{background:var(--bg-secondary);color:var(--text-secondary);font-size:11px;font-weight:600;padding:4px 14px;border-radius:12px;border:1px solid var(--border);letter-spacing:.02em;white-space:nowrap}.date-count{font-size:10px;font-weight:500;padding:2px 6px;border-radius:8px;min-width:20px;text-align:center}.date-count.human{color:var(--color-human-note);background:#34d3991a}.date-count.agent{color:var(--color-agent-session);background:#818cf81a}.lore-card-row{display:flex;align-items:flex-start;margin-bottom:16px;position:relative}.lore-card-row.left{justify-content:flex-start;padding-right:52%}.lore-card-row.right{justify-content:flex-end;padding-left:52%}.single-column .lore-card-row.right{justify-content:flex-start;padding-left:0}.lore-card-row:before{content:"";position:absolute;left:50%;top:16px;width:8px;height:8px;border-radius:50%;background:var(--spine-color);border:2px solid var(--bg-primary);transform:translate(-50%);z-index:2}.single-column .lore-card-row:before{display:none}.lore-card-row.human:before{background:var(--color-human-note)}.lore-card-row.agent:before{background:var(--color-agent-session)}.lore-card-row.left:after,.lore-card-row.right:after{content:"";position:absolute;top:19px;height:1px}.single-column .lore-card-row:after{display:none}.lore-card-row.left:after{left:calc(48% + 8px);right:50%;background:var(--color-human-note);opacity:.4}.lore-card-row.left.agent:after{background:var(--color-agent-session)}.lore-card-row.right:after{left:50%;right:calc(48% + 8px);background:var(--color-agent-session);opacity:.4}.lore-card-row.right.human:after{background:var(--color-human-note)}.lore-card{background:var(--bg-card);border:1px solid var(--border);border-radius:8px;padding:12px 16px;cursor:pointer;transition:all .15s;width:100%}.lore-card:hover{border-color:var(--border-hover);background:var(--bg-hover)}.lore-card-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}.lore-card-author{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--text-secondary)}.author-badge{display:inline-flex;align-items:center;gap:4px;padding:1px 6px;border-radius:4px;font-size:11px;font-weight:500}.author-badge.human{background:#34d3991a;color:var(--color-human-note)}[data-theme=light] .author-badge.human{background:#20c9971f}.author-badge.agent{background:#818cf81a;color:var(--color-agent-session)}[data-theme=light] .author-badge.agent{background:#5c7cfa1f}.lore-card-type{font-size:10px;text-transform:uppercase;letter-spacing:.05em;padding:2px 6px;border-radius:3px}.lore-card-type.agent-session{background:#818cf826;color:var(--color-agent-session)}.lore-card-type.human-note{background:#34d39926;color:var(--color-human-note)}.lore-card-type.decision{background:#fbbf2426;color:var(--color-decision)}.lore-card-type.review{background:#c084fc26;color:var(--color-review)}.lore-card-type.incident{background:#f8717126;color:var(--color-incident)}.lore-card-type.milestone{background:#60a5fa26;color:var(--color-milestone)}.lore-card-title{font-size:14px;font-weight:500;margin-bottom:4px;color:var(--text-primary)}.lore-card-summary{font-size:12px;color:var(--text-secondary);margin-bottom:8px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.lore-card-symbols{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:6px}.lore-card-footer{display:flex;align-items:center;justify-content:space-between;font-size:11px;color:var(--text-muted)}.lore-card-stats{display:flex;gap:8px}.lore-card-verify{display:inline-flex;align-items:center;gap:3px}.lore-card-verify.pass{color:#34d399}.lore-card-verify.fail{color:#f87171}.lore-card-verify.partial{color:#fbbf24}.review-stars{color:#fbbf24;letter-spacing:1px}.symbol-tag{display:inline-flex;align-items:center;padding:1px 6px;border-radius:3px;font-size:11px;font-family:SF Mono,Fira Code,monospace}.symbol-tag.component{background:#7dd3fc1f;color:var(--color-component)}.symbol-tag.gate{background:#86efac1f;color:var(--color-gate)}.symbol-tag.flow{background:#fbbf241f;color:var(--color-flow)}.symbol-tag.signal{background:#fde0471f;color:var(--color-signal)}.symbol-tag.aspect{background:#a78bfa1f;color:var(--color-aspect)}.detail-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:200;display:flex;justify-content:flex-end}.detail-backdrop{position:absolute;top:0;right:0;bottom:0;left:0;background:#0006}[data-theme=light] .detail-backdrop{background:#0003}.detail-panel{position:relative;width:520px;max-width:90vw;background:var(--bg-panel);border-left:1px solid var(--border);overflow-y:auto;animation:slideIn .2s ease-out}@keyframes slideIn{0%{transform:translate(100%)}to{transform:translate(0)}}.detail-header{position:sticky;top:0;background:var(--bg-panel);border-bottom:1px solid var(--border);padding:16px 20px;display:flex;align-items:flex-start;justify-content:space-between;z-index:1}.detail-close{background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:18px;padding:4px}.detail-close:hover{color:var(--text-primary)}.detail-body{padding:20px}.detail-section{margin-bottom:20px}.detail-section h3{font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted);margin-bottom:8px}.detail-meta{display:grid;grid-template-columns:auto 1fr;gap:4px 12px;font-size:13px}.detail-meta dt{color:var(--text-muted)}.detail-meta dd{color:var(--text-primary)}.detail-files{font-size:12px;font-family:SF Mono,Fira Code,monospace}.detail-files li{list-style:none;padding:2px 0;color:var(--text-secondary)}.detail-decision{border-left:2px solid var(--color-decision);padding-left:12px;margin-bottom:8px}.detail-decision .decision-text{font-size:13px;color:var(--text-primary)}.detail-decision .decision-rationale{font-size:12px;color:var(--text-secondary);margin-top:2px}.detail-error{border-left:2px solid var(--color-incident);padding-left:12px;margin-bottom:8px}.detail-learning{padding-left:12px;margin-bottom:4px;font-size:13px;color:var(--text-secondary)}.detail-learning:before{content:"•";color:var(--color-component);margin-right:8px}.sidebar-view{display:flex;height:calc(100vh - 100px)}.sidebar{width:260px;border-right:1px solid var(--border);overflow-y:auto;flex-shrink:0}.sidebar-item{display:flex;align-items:center;justify-content:space-between;padding:10px 16px;cursor:pointer;border-bottom:1px solid var(--border);transition:background .1s}.sidebar-item:hover{background:var(--bg-hover)}.sidebar-item.active{background:var(--bg-card);border-left:2px solid var(--color-component)}.sidebar-item-name{font-size:13px;font-family:SF Mono,Fira Code,monospace}.sidebar-item-count{font-size:11px;color:var(--text-muted);background:var(--bg-primary);padding:1px 6px;border-radius:8px}.sidebar-content{flex:1;overflow-y:auto;padding:16px}.status-bar{position:fixed;bottom:0;left:0;right:0;background:var(--bg-secondary);border-top:1px solid var(--border);padding:4px 24px;font-size:11px;color:var(--text-muted);display:flex;justify-content:space-between;z-index:50}.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:80px 20px;color:var(--text-muted);text-align:center}.empty-state h2{font-size:16px;color:var(--text-secondary);margin-bottom:8px}.empty-state p{font-size:13px;max-width:400px}.empty-state code{background:var(--bg-card);padding:2px 6px;border-radius:3px;font-size:12px}.author-type-toggle{display:flex;gap:2px;background:var(--bg-primary);border-radius:6px;padding:2px}.author-type-pill{padding:4px 10px;border:none;background:none;color:var(--text-secondary);font-size:11px;cursor:pointer;border-radius:4px;transition:all .15s}.author-type-pill:hover{color:var(--text-primary);background:var(--bg-hover)}.author-type-pill.active{color:var(--text-primary);background:var(--bg-card)}.author-type-pill.active.human{color:var(--color-human-note)}.author-type-pill.active.agent{color:var(--color-agent-session)}.symbol-autocomplete-wrapper{position:relative}.symbol-clear{position:absolute;right:6px;top:50%;transform:translateY(-50%);background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:11px;padding:2px 4px}.symbol-clear:hover{color:var(--color-incident)}.symbol-dropdown{position:absolute;top:100%;left:0;right:0;background:var(--bg-card);border:1px solid var(--border);border-radius:4px;max-height:200px;overflow-y:auto;z-index:100;margin-top:2px}.symbol-dropdown-item{display:flex;align-items:center;justify-content:space-between;padding:6px 10px;cursor:pointer;font-size:12px;transition:background .1s}.symbol-dropdown-item:hover,.symbol-dropdown-item.active{background:var(--bg-hover)}.symbol-dropdown-name{font-family:SF Mono,Fira Code,monospace;color:var(--color-component)}.symbol-dropdown-count{font-size:10px;color:var(--text-muted);background:var(--bg-primary);padding:1px 5px;border-radius:6px}.session-date-header{padding:6px 16px;font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--text-muted);background:var(--bg-primary);border-bottom:1px solid var(--border)}.session-sidebar-item{flex-direction:column;align-items:flex-start;gap:4px}.session-sidebar-info{display:flex;align-items:center;justify-content:space-between;width:100%}.session-author-badge{display:inline-flex;align-items:center;gap:4px;font-size:12px;font-weight:500}.session-author-badge.human{color:var(--color-human-note)}.session-author-badge.agent{color:var(--color-agent-session)}.session-sidebar-meta{font-size:10px;color:var(--text-muted)}.session-sidebar-stats{display:flex;gap:6px}.session-detail{max-width:700px}.session-detail-header{margin-bottom:20px}.session-detail-header h2{font-size:16px;margin-bottom:8px}.session-detail-meta{display:flex;flex-wrap:wrap;gap:12px;font-size:12px;color:var(--text-secondary)}.session-detail-section{margin-bottom:20px}.session-detail-section h3{font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted);margin-bottom:8px}.session-symbols{display:flex;flex-wrap:wrap;gap:4px}.breadcrumb-list{display:flex;flex-direction:column;gap:8px}.breadcrumb-item{display:flex;align-items:flex-start;gap:8px;padding:8px 12px;background:var(--bg-card);border-radius:6px;border-left:2px solid var(--color-flow);font-size:12px}.breadcrumb-phase{font-weight:600;color:var(--color-flow);text-transform:uppercase;font-size:10px;letter-spacing:.05em;padding:1px 6px;background:#fbbf241a;border-radius:3px;flex-shrink:0}.breadcrumb-context{color:var(--text-secondary);flex:1}.breadcrumb-time{color:var(--text-muted);font-size:10px;flex-shrink:0}.breadcrumb-decisions{display:flex;flex-wrap:wrap;gap:4px;margin-top:4px}.breadcrumb-decision{font-size:10px;color:var(--text-muted);padding:1px 6px;background:var(--bg-primary);border-radius:3px}
@@ -0,0 +1 @@
1
+ .sentinel-section{display:flex;flex-direction:column;height:100%;overflow:hidden;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.sentinel-tabs{display:flex;gap:0;padding:0 16px;border-bottom:1px solid var(--p-border);background:var(--p-bg-secondary);flex-shrink:0}.sentinel-tab{padding:10px 16px;border:none;background:none;color:var(--p-text-secondary);font-size:13px;font-weight:500;cursor:pointer;border-bottom:2px solid transparent;transition:all .15s ease}.sentinel-tab:hover{color:var(--p-text-primary);background:var(--p-bg-hover)}.sentinel-tab.active{color:var(--p-accent-blue);border-bottom-color:var(--p-accent-blue)}.sentinel-tab-content{flex:1;overflow:hidden;display:flex;flex-direction:column}.sentinel-section .s-loading-state,.sentinel-section .s-error-state{display:flex;align-items:center;justify-content:center;flex:1;background:var(--p-bg-primary)}.sentinel-section .s-loading-content,.sentinel-section .s-error-content{text-align:center;color:var(--p-text-primary)}.sentinel-section .s-loading-spinner{width:40px;height:40px;border:3px solid var(--p-border);border-top-color:var(--p-accent-blue);border-radius:50%;animation:sentinel-spin 1s linear infinite;margin:0 auto 1rem}@keyframes sentinel-spin{to{transform:rotate(360deg)}}.sentinel-section .s-error-content h2{color:var(--p-accent-red);margin-bottom:.5rem}.sentinel-section .s-error-content p{margin-bottom:.5rem;opacity:.8}.sentinel-section .s-error-content button{padding:.5rem 1.5rem;background:var(--p-accent-blue);color:#fff;border:none;border-radius:var(--p-radius);cursor:pointer;font-size:.9rem}.sentinel-section .logs-view{display:flex;flex-direction:column;height:100%;overflow:hidden;font-family:SF Mono,Fira Code,monospace;font-size:13px}.sentinel-section .logs-toolbar{display:flex;align-items:center;justify-content:space-between;padding:8px 16px;border-bottom:1px solid var(--p-border);background:var(--p-bg-secondary);gap:12px;flex-shrink:0}.sentinel-section .logs-filters{display:flex;gap:8px;align-items:center;flex:1}.sentinel-section .logs-select{padding:4px 8px;border:1px solid var(--p-border);border-radius:var(--p-radius);background:var(--p-bg-tertiary);color:var(--p-text-primary);font-size:12px}.sentinel-section .logs-search{padding:4px 10px;border:1px solid var(--p-border);border-radius:var(--p-radius);background:var(--p-bg-tertiary);color:var(--p-text-primary);font-size:12px;flex:1;max-width:300px}.sentinel-section .logs-actions{display:flex;gap:8px;align-items:center}.sentinel-section .logs-count{color:var(--p-text-muted);font-size:12px}.sentinel-section .logs-expand-btn,.sentinel-section .logs-live-btn,.sentinel-section .logs-scroll-btn,.sentinel-section .logs-clear-btn{padding:4px 10px;border:1px solid var(--p-border);border-radius:var(--p-radius);background:var(--p-bg-tertiary);color:var(--p-text-secondary);font-size:12px;cursor:pointer;display:flex;align-items:center;gap:4px;transition:all var(--p-transition)}.sentinel-section .logs-live-btn.active{border-color:var(--p-accent-green);color:var(--p-accent-green)}.sentinel-section .logs-scroll-btn.active,.sentinel-section .logs-expand-btn.active{border-color:var(--p-accent-blue);color:var(--p-accent-blue)}.sentinel-section .live-dot{width:6px;height:6px;border-radius:50%;background:var(--p-text-muted)}.sentinel-section .live-dot.live{background:var(--p-accent-green);animation:sentinel-pulse-dot 2s infinite}@keyframes sentinel-pulse-dot{0%,to{opacity:1}50%{opacity:.4}}.sentinel-section .logs-table{flex:1;display:flex;flex-direction:column;overflow:hidden}.sentinel-section .logs-header{display:grid;grid-template-columns:var(--log-cols, 180px 50px 160px 100px 1fr);gap:8px;padding:6px 16px;border-bottom:1px solid var(--p-border);background:var(--p-bg-secondary);font-size:11px;font-weight:600;color:var(--p-text-muted);text-transform:uppercase;letter-spacing:.5px;flex-shrink:0}.sentinel-section .logs-body{flex:1;overflow-y:auto;background:var(--p-bg-primary)}.sentinel-section .logs-empty{padding:40px;text-align:center;color:var(--p-text-muted)}.sentinel-section .logs-empty code{background:var(--p-bg-tertiary);padding:2px 6px;border-radius:4px;font-size:12px}.sentinel-section .log-row{display:grid;grid-template-columns:var(--log-cols, 180px 50px 160px 100px 1fr);gap:8px;padding:4px 16px;border-bottom:1px solid rgba(255,255,255,.03);cursor:pointer;transition:background var(--p-transition);align-items:baseline}.sentinel-section .log-row:hover{background:var(--p-bg-secondary)}.sentinel-section .log-row--error{background:#f851490f}.sentinel-section .log-row--error:hover{background:#f851491a}.sentinel-section .log-row--warn{background:#d299220a}.sentinel-section .log-time{color:var(--p-text-muted);white-space:nowrap}.sentinel-section .log-level{font-weight:600;font-size:11px}.sentinel-section .log-symbol{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sentinel-section .log-service{color:var(--p-text-secondary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sentinel-section .log-message{color:var(--p-text-primary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sentinel-section .log-duration{margin-left:8px;color:var(--p-text-muted);font-size:11px;opacity:.7}.sentinel-section .log-row--expanded{background:#58a6ff08}.sentinel-section .log-row--expanded .log-message,.sentinel-section .log-row--expanded .log-symbol,.sentinel-section .log-row--expanded .log-service{white-space:normal;word-break:break-word;overflow:visible}.sentinel-section .log-data{grid-column:1 / -1;margin-top:6px;padding:8px 12px;background:var(--p-bg-tertiary);border-radius:var(--p-radius);overflow-x:auto}.sentinel-section .log-data pre{margin:0;font-size:11px;color:var(--p-text-secondary);white-space:pre-wrap;word-break:break-all}.sentinel-section .incidents-view{display:flex;flex-direction:column;flex:1;background:var(--p-bg-primary)}.sentinel-section .incidents-filters{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;background:var(--p-bg-secondary);border-bottom:1px solid var(--p-border)}.sentinel-section .filter-group{display:flex;align-items:center;gap:8px}.sentinel-section .filter-group label{font-size:12px;color:var(--p-text-secondary)}.sentinel-section .filter-group select{padding:6px 12px;background:var(--p-bg-tertiary);border:1px solid var(--p-border);border-radius:var(--p-radius);color:var(--p-text-primary);font-size:13px}.sentinel-section .filter-stats{font-size:12px;color:var(--p-text-muted)}.sentinel-section .incidents-content{flex:1;display:flex;overflow:hidden}.sentinel-section .incidents-list{flex:1;overflow-y:auto;padding:16px}.sentinel-section .incidents-empty{text-align:center;padding:48px 24px;color:var(--p-text-secondary)}.sentinel-section .incidents-empty .hint{font-size:12px;color:var(--p-text-muted);margin-top:8px}.sentinel-section .incident-card{padding:16px;background:var(--p-bg-secondary);border:1px solid var(--p-border);border-radius:8px;margin-bottom:12px;cursor:pointer;transition:all var(--p-transition)}.sentinel-section .incident-card:hover{border-color:var(--p-accent-blue)}.sentinel-section .incident-card.selected{border-color:var(--p-accent-blue);box-shadow:0 0 16px #58a6ff26}.sentinel-section .incident-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.sentinel-section .incident-id{font-family:SF Mono,monospace;font-size:12px;font-weight:600;color:var(--p-text-primary)}.sentinel-section .incident-status{font-size:11px;font-weight:600;text-transform:uppercase}.sentinel-section .incident-error{font-size:13px;color:var(--p-text-primary);margin-bottom:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sentinel-section .incident-meta{display:flex;gap:12px;font-size:11px;color:var(--p-text-muted)}.sentinel-section .incident-symbols{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.sentinel-section .symbol-tag{font-family:SF Mono,monospace;font-size:11px;padding:2px 6px;border-radius:4px;background:#ffffff0d}.sentinel-section .symbol-tag.component{color:var(--p-symbol-component)}.sentinel-section .symbol-tag.flow{color:var(--p-symbol-flow)}.sentinel-section .symbol-tag.gate{color:var(--p-symbol-gate)}.sentinel-section .symbol-tag.signal{color:var(--p-symbol-signal)}.sentinel-section .incident-patterns{margin-top:8px}.sentinel-section .pattern-match{font-size:11px;color:var(--p-accent-blue)}.sentinel-section .incident-detail{width:400px;background:var(--p-bg-secondary);border-left:1px solid var(--p-border);display:flex;flex-direction:column;overflow:hidden}.sentinel-section .detail-header{display:flex;align-items:center;justify-content:space-between;padding:16px;border-bottom:1px solid var(--p-border)}.sentinel-section .detail-header h2{font-size:16px;font-weight:600;font-family:SF Mono,monospace}.sentinel-section .detail-close{background:none;border:none;font-size:24px;color:var(--p-text-muted);cursor:pointer;padding:4px}.sentinel-section .detail-close:hover{color:var(--p-text-primary)}.sentinel-section .detail-content{flex:1;overflow-y:auto;padding:16px}.sentinel-section .detail-section{margin-bottom:24px}.sentinel-section .detail-section h3{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--p-text-muted);margin-bottom:12px}.sentinel-section .error-message{font-family:SF Mono,monospace;font-size:13px;color:var(--p-accent-red);background:#f851491a;padding:12px;border-radius:var(--p-radius);word-break:break-word}.sentinel-section .error-type{font-size:12px;color:var(--p-text-secondary);margin-top:8px}.sentinel-section .detail-field{display:flex;align-items:center;justify-content:space-between;padding:8px 0;border-bottom:1px solid var(--p-border)}.sentinel-section .detail-field label{font-size:12px;color:var(--p-text-secondary)}.sentinel-section .detail-field span{font-size:13px;color:var(--p-text-primary)}.sentinel-section .status-badge{font-size:11px;padding:4px 8px;border-radius:4px;color:#fff;font-weight:600;text-transform:uppercase}.sentinel-section .symbols-list{display:flex;flex-direction:column;gap:8px}.sentinel-section .symbol-item{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background:var(--p-bg-tertiary);border-radius:var(--p-radius)}.sentinel-section .symbol-item label{font-size:11px;text-transform:uppercase;color:var(--p-text-muted)}.sentinel-section .symbol-value{font-family:SF Mono,monospace;font-size:13px}.sentinel-section .symbol-value.component{color:var(--p-symbol-component)}.sentinel-section .symbol-value.flow{color:var(--p-symbol-flow)}.sentinel-section .symbol-value.gate{color:var(--p-symbol-gate)}.sentinel-section .symbol-value.signal{color:var(--p-symbol-signal)}.sentinel-section .patterns-list{display:flex;flex-direction:column;gap:8px}.sentinel-section .pattern-item{padding:12px;background:var(--p-bg-tertiary);border-radius:var(--p-radius)}.sentinel-section .pattern-name{font-weight:500;color:var(--p-text-primary);margin-bottom:4px}.sentinel-section .pattern-confidence{font-size:12px;color:var(--p-accent-blue)}.sentinel-section .detail-actions{padding-top:16px;border-top:1px solid var(--p-border)}.sentinel-section .action-btn{padding:8px 16px;border:none;border-radius:var(--p-radius);background:var(--p-accent-blue);color:#fff;font-size:13px;font-weight:600;cursor:pointer;transition:all var(--p-transition)}.sentinel-section .action-btn:hover{opacity:.9}.sentinel-section .action-btn:disabled{opacity:.4;cursor:not-allowed}.sentinel-section .action-btn.resolve{background:var(--p-accent-green)}.sentinel-section .action-btn.cancel{background:transparent;color:var(--p-text-secondary);border:1px solid var(--p-border)}.sentinel-section .flows-view{display:flex;flex-direction:column;height:100%;overflow:hidden}.sentinel-section .flows-toolbar{display:flex;align-items:center;justify-content:space-between;padding:8px 16px;border-bottom:1px solid var(--p-border);background:var(--p-bg-secondary);flex-shrink:0}.sentinel-section .flows-toolbar-left{display:flex;gap:12px;align-items:center}.sentinel-section .flows-count{color:var(--p-text-muted);font-size:13px}.sentinel-section .flows-content{display:flex;flex:1;overflow:hidden}.sentinel-section .flows-list{width:320px;overflow-y:auto;border-right:1px solid var(--p-border);background:var(--p-bg-secondary);flex-shrink:0}.sentinel-section .flows-detail{flex:1;overflow-y:auto;padding:24px;background:var(--p-bg-primary)}.sentinel-section .flows-empty,.sentinel-section .flows-empty-detail{padding:40px;text-align:center;color:var(--p-text-muted)}.sentinel-section .flows-empty code{background:var(--p-bg-tertiary);padding:2px 6px;border-radius:4px;font-size:12px}.sentinel-section .flow-card{padding:12px 16px;border-bottom:1px solid rgba(255,255,255,.04);cursor:pointer;transition:background var(--p-transition)}.sentinel-section .flow-card:hover{background:var(--p-bg-hover)}.sentinel-section .flow-card.selected{background:var(--p-bg-hover);border-left:3px solid var(--p-symbol-flow)}.sentinel-section .flow-card-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}.sentinel-section .flow-card-id{color:var(--p-symbol-flow);font-family:SF Mono,monospace;font-size:13px;font-weight:600}.sentinel-section .flow-card-trigger{font-size:11px;color:var(--p-text-muted);font-family:SF Mono,monospace}.sentinel-section .flow-card-name{font-size:13px;color:var(--p-text-secondary);margin-bottom:8px}.sentinel-section .flow-card-steps{display:flex;gap:2px;align-items:center}.sentinel-section .flow-step-mini{display:flex;align-items:center;gap:2px}.sentinel-section .flow-arrow{color:var(--p-text-muted);font-size:10px}.sentinel-section .flow-step-dot{width:8px;height:8px;border-radius:50%;transition:all var(--p-transition)}.sentinel-section .flow-step-dot.active{transform:scale(1.5)}.sentinel-section .flow-step-dot.pulse{animation:sentinel-pulse-dot 1s infinite}.sentinel-section .flow-diagram h3{margin:0 0 4px;font-size:18px;color:var(--p-text-primary)}.sentinel-section .flow-trigger-label{color:var(--p-text-muted);font-size:13px;margin-bottom:24px}.sentinel-section .flow-trigger-label code{background:var(--p-bg-tertiary);padding:2px 6px;border-radius:4px;font-family:SF Mono,monospace}.sentinel-section .flow-steps{display:flex;flex-direction:column;gap:0}.sentinel-section .flow-step-container{display:flex;flex-direction:column;align-items:flex-start}.sentinel-section .flow-connector{display:flex;justify-content:center;padding:0 0 0 36px}.sentinel-section .flow-line{width:2px;height:24px;background:var(--p-text-muted);opacity:.3;transition:all var(--p-transition)}.sentinel-section .flow-line.active{background:var(--p-accent-blue);opacity:1}.sentinel-section .flow-step-node{display:flex;align-items:center;gap:10px;padding:10px 16px;border:2px solid var(--p-border);border-radius:10px;background:var(--p-bg-secondary);transition:all var(--p-transition);min-width:200px}.sentinel-section .flow-step-node.active{box-shadow:0 0 16px #58a6ff40;transform:scale(1.02)}.sentinel-section .flow-step-icon{width:24px;height:24px;display:flex;align-items:center;justify-content:center;font-family:SF Mono,monospace;font-weight:700;font-size:14px;color:var(--p-text-muted)}.sentinel-section .flow-step-symbol{font-family:SF Mono,monospace;font-weight:600;font-size:13px;color:var(--p-text-primary)}.sentinel-section .flow-step-type{font-size:11px;color:var(--p-text-muted);text-transform:uppercase}.sentinel-section .flow-step-live{font-size:11px;color:var(--p-accent-green);margin-left:auto}.sentinel-section .flow-composer{max-width:560px}.sentinel-section .flow-composer h3{margin:0 0 16px;font-size:18px;color:var(--p-text-primary)}.sentinel-section .composer-field{margin-bottom:16px}.sentinel-section .composer-field label{display:block;font-size:12px;font-weight:600;color:var(--p-text-secondary);margin-bottom:4px}.sentinel-section .composer-field input{width:100%;padding:8px 12px;border:1px solid var(--p-border);border-radius:8px;background:var(--p-bg-tertiary);color:var(--p-text-primary);font-size:14px}.sentinel-section .composer-steps{margin-bottom:20px}.sentinel-section .composer-steps label{display:block;font-size:12px;font-weight:600;color:var(--p-text-secondary);margin-bottom:8px}.sentinel-section .composer-step{display:flex;gap:8px;margin-bottom:8px;align-items:center}.sentinel-section .composer-step select{padding:6px 8px;border:1px solid var(--p-border);border-radius:var(--p-radius);background:var(--p-bg-tertiary);color:var(--p-text-primary);font-size:12px}.sentinel-section .composer-step select:first-child{width:110px}.sentinel-section .composer-step select:nth-child(2){flex:1}.sentinel-section .composer-remove{width:28px;height:28px;border:1px solid var(--p-border);border-radius:var(--p-radius);background:transparent;color:var(--p-text-muted);cursor:pointer;font-size:16px;display:flex;align-items:center;justify-content:center}.sentinel-section .composer-remove:hover{color:var(--p-accent-red);border-color:var(--p-accent-red)}.sentinel-section .composer-add-buttons{display:flex;gap:8px;margin-top:8px}.sentinel-section .composer-add-buttons button{padding:4px 12px;border:1px dashed var(--p-border);border-radius:var(--p-radius);background:transparent;color:var(--p-text-muted);font-size:12px;cursor:pointer;transition:all var(--p-transition)}.sentinel-section .composer-add-buttons button:hover{border-color:var(--p-accent-blue);color:var(--p-accent-blue)}.sentinel-section .composer-actions{display:flex;gap:8px}.sentinel-section .events-view{display:flex;flex-direction:column;height:100%;overflow:hidden}.sentinel-section .events-toolbar{display:flex;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid var(--p-border);flex-shrink:0}.sentinel-section .events-schema-select{background:var(--p-bg-tertiary);border:1px solid var(--p-border);border-radius:var(--p-radius);padding:6px 12px;color:var(--p-text-primary);font-size:13px;min-width:200px}.sentinel-section .events-category-filters{display:flex;gap:6px;flex-wrap:wrap}.sentinel-section .events-category-chip{padding:3px 10px;border:1px solid var(--p-border);border-radius:12px;background:transparent;color:var(--p-text-secondary);font-size:12px;cursor:pointer;transition:all .15s}.sentinel-section .events-category-chip:hover{opacity:.8}.sentinel-section .events-category-chip.active{background:var(--p-accent-blue);border-color:var(--p-accent-blue);color:#fff}.sentinel-section .events-scope-nav{padding:8px 16px;border-bottom:1px solid var(--p-border);flex-shrink:0;display:flex;align-items:center;gap:12px}.sentinel-section .events-scope-label{font-size:12px;font-weight:600;color:var(--p-text-muted);text-transform:uppercase;letter-spacing:.05em;white-space:nowrap}.sentinel-section .events-scope-list{display:flex;gap:4px;overflow-x:auto;scrollbar-width:thin}.sentinel-section .events-scope-chip{display:flex;align-items:center;gap:4px;padding:3px 8px;border:1px solid var(--p-border);border-radius:4px;background:transparent;color:var(--p-text-secondary);font-size:12px;font-family:SF Mono,monospace;cursor:pointer;white-space:nowrap;transition:all .15s}.sentinel-section .events-scope-chip:hover{border-color:var(--p-accent-blue)}.sentinel-section .events-scope-chip.active{background:var(--p-accent-blue);border-color:var(--p-accent-blue);color:#fff}.sentinel-section .events-scope-chip .scope-count{font-size:10px;opacity:.7}.sentinel-section .events-table{flex:1;overflow:auto;font-family:SF Mono,monospace;font-size:12px;line-height:1.5}.sentinel-section .events-table-header{display:grid;grid-template-columns:var(--evt-cols, 180px 50px 200px 100px 1fr);gap:8px;padding:6px 16px;font-weight:600;color:var(--p-text-muted);font-size:11px;text-transform:uppercase;letter-spacing:.05em;border-bottom:1px solid var(--p-border);position:sticky;top:0;background:var(--p-bg-secondary);z-index:1}.sentinel-section .events-table-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:4px 16px;border-bottom:1px solid var(--p-border);flex-shrink:0}.sentinel-section .events-count{color:var(--p-text-muted);font-size:12px}.sentinel-section .events-expand-btn{padding:2px 8px;border:1px solid var(--p-border);border-radius:var(--p-radius);background:var(--p-bg-tertiary);color:var(--p-text-secondary);font-size:11px;cursor:pointer;transition:all var(--p-transition)}.sentinel-section .events-expand-btn.active{border-color:var(--p-accent-blue);color:var(--p-accent-blue)}.sentinel-section .events-table-body{padding-bottom:32px}.sentinel-section .event-row{display:grid;grid-template-columns:var(--evt-cols, 180px 50px 200px 100px 1fr);gap:8px;padding:4px 16px;cursor:pointer;border-bottom:1px solid transparent;transition:background-color .1s}.sentinel-section .event-row:hover{background:#58a6ff0d}.sentinel-section .event-row--error{background:#f851490d}.sentinel-section .event-row--warn{background:#d2992208}.sentinel-section .event-row--expanded{background:#58a6ff08}.sentinel-section .event-row--expanded .event-type,.sentinel-section .event-row--expanded .event-service{white-space:normal;word-break:break-word;overflow:visible}.sentinel-section .event-time{color:var(--p-text-muted);white-space:nowrap}.sentinel-section .event-severity{font-weight:600;font-size:11px}.sentinel-section .event-category-badge{font-weight:500;font-size:10px;margin-right:2px}.sentinel-section .event-type{color:var(--p-text-primary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sentinel-section .event-service{color:var(--p-text-muted);overflow:hidden;text-overflow:ellipsis}.sentinel-section .event-scope{color:var(--p-accent-blue);font-weight:500}.sentinel-section .event-depth{color:var(--p-text-muted);font-size:11px}.sentinel-section .event-data{grid-column:1 / -1;padding:8px 12px;margin-top:4px;background:var(--p-bg-tertiary);border-radius:4px;font-size:11px;overflow-x:auto}.sentinel-section .event-data pre{margin:0;color:var(--p-text-secondary)}.sentinel-section .logs-header>span,.sentinel-section .events-table-header>span{position:relative}.sentinel-section .col-resize-handle{position:absolute;right:-4px;top:0;bottom:0;width:8px;cursor:col-resize;z-index:2}.sentinel-section .col-resize-handle:hover{background:var(--p-accent-blue);opacity:.3;border-radius:2px}.sentinel-section .context-menu{position:fixed;z-index:1000;background:var(--p-bg-secondary);border:1px solid var(--p-border);border-radius:8px;box-shadow:0 8px 24px #0000004d;padding:4px 0;min-width:200px}.sentinel-section .context-menu button{display:block;width:100%;text-align:left;padding:6px 12px;border:none;background:none;color:var(--p-text-primary);font-size:12px;cursor:pointer;white-space:nowrap}.sentinel-section .context-menu button:hover{background:var(--p-bg-hover)}.sentinel-section .exclusion-bar{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:6px 16px;border-bottom:1px solid var(--p-border);background:var(--p-bg-tertiary)}.sentinel-section .exclusion-chip{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:12px;background:#f851491a;color:var(--p-accent-red);font-size:11px;white-space:nowrap;max-width:280px;overflow:hidden;text-overflow:ellipsis}.sentinel-section .exclusion-chip button{border:none;background:none;color:inherit;font-size:14px;cursor:pointer;padding:0;line-height:1;opacity:.7}.sentinel-section .exclusion-chip button:hover{opacity:1}.sentinel-section .exclusion-clear{border:none;background:none;color:var(--p-text-muted);font-size:11px;cursor:pointer;text-decoration:underline;padding:0}.sentinel-section .exclusion-clear:hover{color:var(--p-text-primary)}.sentinel-section .events-empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:48px 24px;color:var(--p-text-muted);text-align:center}.sentinel-section .events-empty-state .hint{font-size:13px;margin-top:8px}.sentinel-section .events-empty-state code{background:var(--p-bg-tertiary);padding:2px 6px;border-radius:4px;font-size:12px}.sentinel-section .events-loading{padding:24px;text-align:center;color:var(--p-text-muted)}.sentinel-section .hint{font-size:.85rem;opacity:.6}
@@ -0,0 +1 @@
1
+ import{c as _,r,j as e}from"./index-DDKhCt-w.js";const Q=_((t,n)=>({logs:[],services:[],flowEvents:[],isLoading:!1,error:null,isLive:!1,levelFilter:"all",serviceFilter:null,symbolFilter:null,searchQuery:"",excludedSymbols:new Set,excludedSymbolTypes:new Set,excludedMessages:new Set,excludedServices:new Set,loadLogs:async()=>{t({isLoading:!0,error:null});try{const s=new URLSearchParams,l=n();l.levelFilter!=="all"&&s.set("level",l.levelFilter),l.serviceFilter&&s.set("service",l.serviceFilter),l.symbolFilter&&s.set("symbol",l.symbolFilter),l.searchQuery&&s.set("search",l.searchQuery),s.set("limit","200");const a=await fetch(`/api/sentinel/logs?${s}`);if(!a.ok)throw new Error(`API error: ${a.status}`);const i=await a.json();t({logs:i.logs||[],isLoading:!1})}catch(s){t({isLoading:!1,error:s instanceof Error?s.message:"Failed to load logs",logs:[]})}},loadServices:async()=>{try{const s=await fetch("/api/sentinel/services");if(!s.ok)return;const l=await s.json();t({services:l.services||[]})}catch{}},handleWsMessage:s=>{if(s.type==="sentinel:log"&&s.entry&&t(l=>({logs:[s.entry,...l.logs].slice(0,500)})),s.type==="sentinel:flow_event"){const l={type:"flow_event",flowId:s.flowId,nodeSymbol:s.nodeSymbol,event:s.event,timestamp:s.timestamp,service:s.service};t(a=>({flowEvents:[l,...a.flowEvents].slice(0,200)}))}},setIsLive:s=>t({isLive:s}),setLevelFilter:s=>t({levelFilter:s}),setServiceFilter:s=>t({serviceFilter:s}),setSymbolFilter:s=>t({symbolFilter:s}),setSearchQuery:s=>t({searchQuery:s}),clearLogs:()=>t({logs:[],flowEvents:[]}),toggleExcludedSymbol:s=>{const l=new Set(n().excludedSymbols);l.has(s)?l.delete(s):l.add(s),t({excludedSymbols:l})},toggleExcludedSymbolType:s=>{const l=new Set(n().excludedSymbolTypes);l.has(s)?l.delete(s):l.add(s),t({excludedSymbolTypes:l})},toggleExcludedMessage:s=>{const l=new Set(n().excludedMessages);l.has(s)?l.delete(s):l.add(s),t({excludedMessages:l})},toggleExcludedService:s=>{const l=new Set(n().excludedServices);l.has(s)?l.delete(s):l.add(s),t({excludedServices:l})},clearAllExclusions:()=>t({excludedSymbols:new Set,excludedSymbolTypes:new Set,excludedMessages:new Set,excludedServices:new Set}),getFilteredLogs:()=>{const s=n();let l=s.logs;if(s.levelFilter!=="all"&&(l=l.filter(a=>a.level===s.levelFilter)),s.serviceFilter&&(l=l.filter(a=>a.service===s.serviceFilter)),s.symbolFilter&&(l=l.filter(a=>a.symbol.includes(s.symbolFilter))),s.searchQuery){const a=s.searchQuery.toLowerCase();l=l.filter(i=>i.message.toLowerCase().includes(a)||i.symbol.toLowerCase().includes(a))}return s.excludedSymbols.size>0&&(l=l.filter(a=>!s.excludedSymbols.has(a.symbol))),s.excludedSymbolTypes.size>0&&(l=l.filter(a=>!s.excludedSymbolTypes.has(a.symbolType))),s.excludedMessages.size>0&&(l=l.filter(a=>!s.excludedMessages.has(a.message))),s.excludedServices.size>0&&(l=l.filter(a=>!s.excludedServices.has(a.service))),l}})),R=_((t,n)=>({events:[],scopes:[],selectedScope:null,excludedTypes:new Set,excludedServices:new Set,categoryFilter:null,loading:!1,error:null,total:0,fetchEvents:async(s,l={})=>{t({loading:!0,error:null});try{const a=new URLSearchParams({schemaId:s,...l}),i=await fetch(`/api/sentinel/events?${a}`);if(!i.ok)throw new Error(`Failed to fetch events: ${i.status}`);const d=await i.json();t({events:d.events||[],total:d.total||0,loading:!1})}catch(a){t({error:a instanceof Error?a.message:"Failed to fetch events",loading:!1})}},fetchScopes:async s=>{try{const l=await fetch(`/api/sentinel/events/scopes?schemaId=${encodeURIComponent(s)}`);if(!l.ok)throw new Error(`Failed to fetch scopes: ${l.status}`);const a=await l.json();t({scopes:a.scopes||[]})}catch(l){t({error:l instanceof Error?l.message:"Failed to fetch scopes"})}},fetchScopeEvents:async(s,l)=>{t({loading:!0,error:null,selectedScope:l});try{const a=await fetch(`/api/sentinel/events/scope/${encodeURIComponent(l)}?schemaId=${encodeURIComponent(s)}`);if(!a.ok)throw new Error(`Failed to fetch scope events: ${a.status}`);const i=await a.json();t({events:i.events||[],total:i.count||0,loading:!1})}catch(a){t({error:a instanceof Error?a.message:"Failed to fetch scope events",loading:!1})}},selectScope:s=>t({selectedScope:s}),toggleExcludedType:s=>{const l=new Set(n().excludedTypes);l.has(s)?l.delete(s):l.add(s),t({excludedTypes:l})},toggleExcludedService:s=>{const l=new Set(n().excludedServices);l.has(s)?l.delete(s):l.add(s),t({excludedServices:l})},clearAllExclusions:()=>t({excludedTypes:new Set,excludedServices:new Set}),setCategoryFilter:s=>t({categoryFilter:s}),handleWsMessage:s=>{s.type==="sentinel:event"&&s.event&&t(l=>({events:[s.event,...l.events].slice(0,500),total:l.total+1}))}}));function te(){r.useEffect(()=>{function t(n){const s=n.detail;s!=null&&s.type&&((s.type==="sentinel:log"||s.type==="sentinel:flow_event")&&Q.getState().handleWsMessage(s),s.type==="sentinel:event"&&R.getState().handleWsMessage(s))}return window.addEventListener("sentinel-ws",t),()=>window.removeEventListener("sentinel-ws",t)},[])}function ne(t){const[n,s]=r.useState(t),l=r.useRef(null),a=r.useCallback((d,f)=>{f.preventDefault(),l.current={idx:d,startX:f.clientX,startW:n[d]};const p=j=>{const g=l.current;if(!g)return;const x=Math.max(40,g.startW+(j.clientX-g.startX));s(c=>{const v=[...c];return v[g.idx]=x,v})},u=()=>{l.current=null,window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",u)};window.addEventListener("mousemove",p),window.addEventListener("mouseup",u)},[n]);return{gridTemplate:n.map(d=>`${d}px`).join(" ")+" 1fr",onMouseDown:a}}function z({idx:t,onMouseDown:n}){return e.jsx("span",{className:"col-resize-handle",onMouseDown:s=>n(t,s)})}const ae={debug:"#94a3b8",info:"#3b82f6",warn:"#f59e0b",error:"#ef4444"},Y={component:"var(--p-symbol-component)",gate:"var(--p-symbol-gate)",signal:"var(--p-symbol-signal)",flow:"var(--p-symbol-flow)",aspect:"var(--p-symbol-aspect)",raw:"var(--p-text-muted)"};function ie(t){const n=new Date(t),s=(l,a=2)=>String(l).padStart(a,"0");return`${n.getFullYear()}-${s(n.getMonth()+1)}-${s(n.getDate())} ${s(n.getHours())}:${s(n.getMinutes())}:${s(n.getSeconds())}`}function ce({entry:t,isExpanded:n,onToggle:s,onContextMenu:l}){const a=Y[t.symbolType]||Y.raw;return e.jsxs("div",{className:`log-row log-row--${t.level}${n?" log-row--expanded":""}`,onClick:s,onContextMenu:l,children:[e.jsx("span",{className:"log-time",children:ie(t.timestamp)}),e.jsx("span",{className:"log-level",style:{color:ae[t.level]},children:t.level.toUpperCase().padEnd(5)}),e.jsx("span",{className:"log-symbol",style:{color:a},children:t.symbol}),e.jsx("span",{className:"log-service",children:t.service}),e.jsxs("span",{className:"log-message",children:[t.message,t.durationMs!==void 0&&e.jsxs("span",{className:"log-duration",children:[t.durationMs.toFixed(1),"ms"]})]}),n&&t.data&&e.jsx("div",{className:"log-data",onClick:i=>i.stopPropagation(),children:e.jsx("pre",{children:JSON.stringify(t.data,null,2)})})]})}function oe(){const{isLoading:t,error:n,isLive:s,services:l,levelFilter:a,serviceFilter:i,searchQuery:d,excludedSymbols:f,excludedSymbolTypes:p,excludedMessages:u,excludedServices:j,loadLogs:g,loadServices:x,setIsLive:c,setLevelFilter:v,setServiceFilter:m,setSearchQuery:y,getFilteredLogs:N,clearLogs:T,toggleExcludedSymbol:w,toggleExcludedSymbolType:k,toggleExcludedMessage:b,toggleExcludedService:F,clearAllExclusions:h}=Q(),S=N(),L=r.useRef(null),[C,V]=r.useState(new Set),[M,U]=r.useState(!1),[I,q]=r.useState(!0),[E,$]=r.useState(null),{gridTemplate:K,onMouseDown:D}=ne([180,50,160,100]),Z=f.size>0||p.size>0||u.size>0||j.size>0,ee=r.useCallback((o,A)=>{o.preventDefault(),$({x:o.clientX,y:o.clientY,entry:A})},[]);r.useEffect(()=>{if(!E)return;const o=()=>$(null);return window.addEventListener("click",o),()=>window.removeEventListener("click",o)},[E]);const se=o=>{V(A=>{const O=new Set(A);return O.has(o)?(O.delete(o),U(!1)):O.add(o),O})},le=()=>{M?(V(new Set),U(!1)):U(!0)};return r.useEffect(()=>(g(),x(),c(!0),()=>c(!1)),[]),r.useEffect(()=>{I&&L.current&&L.current.scrollIntoView({behavior:"smooth"})},[S.length,I]),t&&S.length===0?e.jsx("div",{className:"logs-view s-loading-state",children:e.jsxs("div",{className:"s-loading-content",children:[e.jsx("div",{className:"s-loading-spinner"}),e.jsx("p",{children:"Loading logs..."})]})}):n&&S.length===0?e.jsx("div",{className:"logs-view s-error-state",children:e.jsxs("div",{className:"s-error-content",children:[e.jsx("h2",{children:"Failed to load logs"}),e.jsx("p",{children:n}),e.jsx("button",{onClick:()=>g(),children:"Retry"})]})}):e.jsxs("div",{className:"logs-view",children:[e.jsxs("div",{className:"logs-toolbar",children:[e.jsxs("div",{className:"logs-filters",children:[e.jsxs("select",{value:a,onChange:o=>v(o.target.value),className:"logs-select",children:[e.jsx("option",{value:"all",children:"All Levels"}),e.jsx("option",{value:"debug",children:"Debug"}),e.jsx("option",{value:"info",children:"Info"}),e.jsx("option",{value:"warn",children:"Warn"}),e.jsx("option",{value:"error",children:"Error"})]}),e.jsxs("select",{value:i||"",onChange:o=>m(o.target.value||null),className:"logs-select",children:[e.jsx("option",{value:"",children:"All Services"}),l.map(o=>e.jsx("option",{value:o.name,children:o.name},o.name))]}),e.jsx("input",{type:"text",placeholder:"Search logs...",value:d,onChange:o=>y(o.target.value),className:"logs-search"})]}),e.jsxs("div",{className:"logs-actions",children:[e.jsxs("span",{className:"logs-count",children:[S.length," entries"]}),e.jsx("button",{className:`logs-expand-btn ${M?"active":""}`,onClick:le,title:M?"Collapse all payloads":"Expand all payloads",children:M?"Collapse All":"Expand All"}),e.jsxs("button",{className:`logs-live-btn ${s?"active":""}`,onClick:()=>c(!s),title:s?"Streaming live":"Click to connect",children:[e.jsx("span",{className:`live-dot ${s?"live":""}`}),s?"Live":"Paused"]}),e.jsx("button",{className:`logs-scroll-btn ${I?"active":""}`,onClick:()=>q(!I),title:"Auto-scroll to new logs",children:I?"Auto":"Manual"}),e.jsx("button",{className:"logs-clear-btn",onClick:T,title:"Clear log buffer",children:"Clear"})]})]}),Z&&e.jsxs("div",{className:"exclusion-bar",children:[[...f].map(o=>e.jsxs("span",{className:"exclusion-chip",children:["symbol: ",o," ",e.jsx("button",{onClick:()=>w(o),children:"×"})]},`sym-${o}`)),[...p].map(o=>e.jsxs("span",{className:"exclusion-chip",children:["type: ",o," ",e.jsx("button",{onClick:()=>k(o),children:"×"})]},`type-${o}`)),[...u].map(o=>e.jsxs("span",{className:"exclusion-chip",children:["msg: ",o.length>40?o.slice(0,40)+"...":o," ",e.jsx("button",{onClick:()=>b(o),children:"×"})]},`msg-${o}`)),[...j].map(o=>e.jsxs("span",{className:"exclusion-chip",children:["service: ",o," ",e.jsx("button",{onClick:()=>F(o),children:"×"})]},`svc-${o}`)),e.jsx("button",{className:"exclusion-clear",onClick:h,children:"Clear all"})]}),E&&e.jsxs("div",{className:"context-menu",style:{top:E.y,left:E.x},onClick:o=>o.stopPropagation(),children:[e.jsxs("button",{onClick:()=>{w(E.entry.symbol),$(null)},children:['Exclude symbol "',E.entry.symbol,'"']}),e.jsxs("button",{onClick:()=>{k(E.entry.symbolType),$(null)},children:['Exclude type "',E.entry.symbolType,'"']}),e.jsx("button",{onClick:()=>{b(E.entry.message),$(null)},children:"Exclude this message"}),e.jsxs("button",{onClick:()=>{F(E.entry.service),$(null)},children:['Exclude service "',E.entry.service,'"']})]}),e.jsxs("div",{className:"logs-table",style:{"--log-cols":K},children:[e.jsxs("div",{className:"logs-header",children:[e.jsxs("span",{className:"log-time",children:["Time",e.jsx(z,{idx:0,onMouseDown:D})]}),e.jsxs("span",{className:"log-level",children:["Level",e.jsx(z,{idx:1,onMouseDown:D})]}),e.jsxs("span",{className:"log-symbol",children:["Symbol",e.jsx(z,{idx:2,onMouseDown:D})]}),e.jsxs("span",{className:"log-service",children:["Service",e.jsx(z,{idx:3,onMouseDown:D})]}),e.jsx("span",{className:"log-message",children:"Message"})]}),e.jsxs("div",{className:"logs-body",children:[e.jsx("div",{ref:L}),S.length===0?e.jsxs("div",{className:"logs-empty",children:[e.jsx("p",{children:"No logs yet."}),e.jsxs("p",{className:"hint",children:["POST structured logs to ",e.jsx("code",{children:"/api/sentinel/logs"})," or connect an app with the Sentinel client SDK."]})]}):S.map(o=>e.jsx(ce,{entry:o,isExpanded:M||C.has(o.id),onToggle:()=>se(o.id),onContextMenu:A=>ee(A,o)},o.id))]})]})]})}const re=_((t,n)=>({incidents:[],patterns:[],selectedIncidentId:null,isLoading:!1,error:null,statusFilter:"all",environmentFilter:null,symbolFilter:null,loadIncidents:async()=>{t({isLoading:!0,error:null});try{const s=await fetch("/api/sentinel/incidents");if(!s.ok)throw new Error(`API error: ${s.status}`);const l=await s.json();t({incidents:l.incidents||[],isLoading:!1})}catch(s){t({isLoading:!1,error:s instanceof Error?s.message:"Failed to load incidents",incidents:[]})}},loadPatterns:async()=>{try{const s=await fetch("/api/sentinel/patterns");if(!s.ok)throw new Error(`API error: ${s.status}`);const l=await s.json();t({patterns:l.patterns||[]})}catch{}},selectIncident:s=>t({selectedIncidentId:s}),setStatusFilter:s=>t({statusFilter:s}),setEnvironmentFilter:s=>t({environmentFilter:s}),setSymbolFilter:s=>t({symbolFilter:s}),resolveIncident:async s=>{try{const l=await fetch(`/api/sentinel/incidents/${s}/resolve`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!l.ok)throw new Error(`API error: ${l.status}`);await n().loadIncidents()}catch(l){throw l}},getFilteredIncidents:()=>{const s=n();let l=s.incidents;return s.statusFilter!=="all"&&(l=l.filter(a=>a.status===s.statusFilter)),s.environmentFilter&&(l=l.filter(a=>a.environment===s.environmentFilter)),s.symbolFilter&&(l=l.filter(a=>{const i=a.symbols;return i.feature===s.symbolFilter||i.component===s.symbolFilter||i.flow===s.symbolFilter||i.gate===s.symbolFilter||i.signal===s.symbolFilter})),l},getSelectedIncident:()=>{const s=n();return s.incidents.find(l=>l.id===s.selectedIncidentId)}})),H={open:"#ef4444",investigating:"#f59e0b",resolved:"#22c55e","wont-fix":"#6b7280"},B={open:"Open",investigating:"Investigating",resolved:"Resolved","wont-fix":"Won't Fix"};function de(){const{isLoading:t,error:n,statusFilter:s,selectedIncidentId:l,loadIncidents:a,loadPatterns:i,selectIncident:d,setStatusFilter:f,getFilteredIncidents:p,getSelectedIncident:u,resolveIncident:j}=re(),g=p(),x=u();return r.useEffect(()=>{a(),i()},[]),t?e.jsx("div",{className:"incidents-view s-loading-state",children:e.jsxs("div",{className:"s-loading-content",children:[e.jsx("div",{className:"s-loading-spinner"}),e.jsx("p",{children:"Loading incidents..."})]})}):n?e.jsx("div",{className:"incidents-view s-error-state",children:e.jsxs("div",{className:"s-error-content",children:[e.jsx("h2",{children:"Failed to load incidents"}),e.jsx("p",{children:n}),e.jsx("button",{onClick:()=>a(),children:"Retry"})]})}):e.jsxs("div",{className:"incidents-view",children:[e.jsxs("div",{className:"incidents-filters",children:[e.jsxs("div",{className:"filter-group",children:[e.jsx("label",{children:"Status:"}),e.jsxs("select",{value:s,onChange:c=>f(c.target.value),children:[e.jsx("option",{value:"all",children:"All"}),e.jsx("option",{value:"open",children:"Open"}),e.jsx("option",{value:"investigating",children:"Investigating"}),e.jsx("option",{value:"resolved",children:"Resolved"}),e.jsx("option",{value:"wont-fix",children:"Won't Fix"})]})]}),e.jsxs("div",{className:"filter-stats",children:[g.length," incident",g.length!==1?"s":""]})]}),e.jsxs("div",{className:"incidents-content",children:[e.jsx("div",{className:"incidents-list",children:g.length===0?e.jsxs("div",{className:"incidents-empty",children:[e.jsx("p",{children:"No incidents found."}),e.jsx("p",{className:"hint",children:"Incidents are recorded when errors occur in your application."})]}):g.map(c=>e.jsxs("div",{className:`incident-card ${l===c.id?"selected":""}`,onClick:()=>d(c.id),children:[e.jsxs("div",{className:"incident-header",children:[e.jsx("span",{className:"incident-id",children:c.id}),e.jsx("span",{className:"incident-status",style:{color:H[c.status]},children:B[c.status]})]}),e.jsx("div",{className:"incident-error",children:c.error.message}),e.jsxs("div",{className:"incident-meta",children:[e.jsx("span",{className:"incident-env",children:c.environment}),e.jsx("span",{className:"incident-time",children:new Date(c.timestamp).toLocaleString()})]}),c.symbols&&Object.keys(c.symbols).length>0&&e.jsxs("div",{className:"incident-symbols",children:[c.symbols.component&&e.jsxs("span",{className:"symbol-tag component",children:["#",c.symbols.component]}),c.symbols.flow&&e.jsxs("span",{className:"symbol-tag flow",children:["$",c.symbols.flow]}),c.symbols.gate&&e.jsxs("span",{className:"symbol-tag gate",children:["^",c.symbols.gate]}),c.symbols.signal&&e.jsxs("span",{className:"symbol-tag signal",children:["!",c.symbols.signal]})]}),c.patternMatches&&c.patternMatches.length>0&&e.jsx("div",{className:"incident-patterns",children:e.jsxs("span",{className:"pattern-match",children:["Matched: ",c.patternMatches[0].patternName,"(",Math.round(c.patternMatches[0].confidence),"%)"]})})]},c.id))}),x&&e.jsxs("div",{className:"incident-detail",children:[e.jsxs("div",{className:"detail-header",children:[e.jsx("h2",{children:x.id}),e.jsx("button",{className:"detail-close",onClick:()=>d(null),children:"×"})]}),e.jsxs("div",{className:"detail-content",children:[e.jsxs("section",{className:"detail-section",children:[e.jsx("h3",{children:"Error"}),e.jsx("div",{className:"error-message",children:x.error.message}),x.error.type&&e.jsxs("div",{className:"error-type",children:["Type: ",x.error.type]})]}),e.jsxs("section",{className:"detail-section",children:[e.jsx("h3",{children:"Context"}),e.jsxs("div",{className:"detail-field",children:[e.jsx("label",{children:"Status"}),e.jsx("span",{className:"status-badge",style:{backgroundColor:H[x.status]},children:B[x.status]})]}),e.jsxs("div",{className:"detail-field",children:[e.jsx("label",{children:"Environment"}),e.jsx("span",{children:x.environment})]}),e.jsxs("div",{className:"detail-field",children:[e.jsx("label",{children:"Timestamp"}),e.jsx("span",{children:new Date(x.timestamp).toLocaleString()})]})]}),x.symbols&&Object.keys(x.symbols).length>0&&e.jsxs("section",{className:"detail-section",children:[e.jsx("h3",{children:"Symbols"}),e.jsx("div",{className:"symbols-list",children:Object.entries(x.symbols).map(([c,v])=>v&&e.jsxs("div",{className:"symbol-item",children:[e.jsx("label",{children:c}),e.jsx("span",{className:`symbol-value ${c}`,children:v})]},c))})]}),x.patternMatches&&x.patternMatches.length>0&&e.jsxs("section",{className:"detail-section",children:[e.jsx("h3",{children:"Pattern Matches"}),e.jsx("div",{className:"patterns-list",children:x.patternMatches.map(c=>e.jsxs("div",{className:"pattern-item",children:[e.jsx("div",{className:"pattern-name",children:c.patternName}),e.jsxs("div",{className:"pattern-confidence",children:[Math.round(c.confidence),"% confidence"]})]},c.patternId))})]}),x.status==="open"&&e.jsx("section",{className:"detail-actions",children:e.jsx("button",{className:"action-btn resolve",onClick:()=>j(x.id),children:"Mark Resolved"})})]})]})]})]})}const X=_((t,n)=>({schemas:[],selectedSchemaId:null,loading:!1,error:null,fetchSchemas:async()=>{t({loading:!0,error:null});try{const s=await fetch("/api/sentinel/schemas");if(!s.ok)throw new Error(`Failed to fetch schemas: ${s.status}`);const a=(await s.json()).schemas||[];t({schemas:a,loading:!1}),!n().selectedSchemaId&&a.length>0&&t({selectedSchemaId:a[0].id})}catch(s){t({error:s instanceof Error?s.message:"Failed to fetch schemas",loading:!1})}},selectSchema:s=>t({selectedSchemaId:s}),getSelectedSchema:()=>{const s=n();return s.schemas.find(l=>l.id===s.selectedSchemaId)}}));function ue(t){const[n,s]=r.useState(t),l=r.useRef(null),a=r.useCallback((d,f)=>{f.preventDefault(),l.current={idx:d,startX:f.clientX,startW:n[d]};const p=j=>{const g=l.current;if(!g)return;const x=Math.max(40,g.startW+(j.clientX-g.startX));s(c=>{const v=[...c];return v[g.idx]=x,v})},u=()=>{l.current=null,window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",u)};window.addEventListener("mousemove",p),window.addEventListener("mouseup",u)},[n]);return{gridTemplate:n.map(d=>`${d}px`).join(" ")+" 1fr",onMouseDown:a}}function P({idx:t,onMouseDown:n}){return e.jsx("span",{className:"col-resize-handle",onMouseDown:s=>n(t,s)})}const me={debug:"#94a3b8",info:"#3b82f6",warn:"#f59e0b",error:"#ef4444"},he={logs:"#3b82f6",metrics:"#22c55e",traces:"#a855f7",incidents:"#ef4444",rules:"#f59e0b",state:"#06b6d4",cascade:"#ec4899",lifecycle:"#84cc16"};function pe(t){const n=new Date(t),s=(l,a=2)=>String(l).padStart(a,"0");return`${n.getFullYear()}-${s(n.getMonth()+1)}-${s(n.getDate())} ${s(n.getHours())}:${s(n.getMinutes())}:${s(n.getSeconds())}`}function W(t,n){var l;const s=(l=n==null?void 0:n.visualization)==null?void 0:l.categoryColors;return s&&s[t]?s[t]:he[t]||"var(--p-text-muted)"}function xe(){const{schemas:t,selectedSchemaId:n,selectSchema:s,fetchSchemas:l,loading:a}=X();return r.useEffect(()=>{l()},[]),a?e.jsx("div",{className:"events-loading",children:"Loading schemas..."}):t.length===0?e.jsxs("div",{className:"events-empty-state",children:[e.jsx("p",{children:"No event schemas registered."}),e.jsxs("p",{className:"hint",children:["Applications register schemas via ",e.jsx("code",{children:"POST /api/sentinel/schemas"}),"."]})]}):e.jsx("select",{className:"events-schema-select",value:n||"",onChange:i=>s(i.target.value||null),children:t.map(i=>e.jsxs("option",{value:i.id,children:[i.name," (v",i.version,")"]},i.id))})}function ve({schema:t}){const{scopes:n,selectedScope:s,fetchScopes:l,fetchScopeEvents:a,selectScope:i,fetchEvents:d}=R();r.useEffect(()=>{l(t.id)},[t.id]);const f=p=>{s===p?(i(null),d(t.id)):a(t.id,p)};return n.length===0?null:e.jsxs("div",{className:"events-scope-nav",children:[e.jsxs("div",{className:"events-scope-label",children:[t.scope.label,"s"]}),e.jsx("div",{className:"events-scope-list",children:n.slice(0,50).map(p=>e.jsxs("button",{className:`events-scope-chip ${s===p.scopeValue?"active":""}`,onClick:()=>f(p.scopeValue),title:`${p.eventCount} events`,children:[e.jsx("span",{className:"scope-value",children:t.scope.type==="number"?`#${p.scopeValue}`:p.scopeValue}),e.jsx("span",{className:"scope-count",children:p.eventCount})]},p.scopeValue))})]})}function ge({schema:t}){var p;const{events:n,categoryFilter:s,setCategoryFilter:l,excludedTypes:a,toggleExcludedType:i}=R(),d=[...new Set(n.map(u=>u.category))],f=((p=t.visualization)==null?void 0:p.defaultExcluded)||[];return r.useEffect(()=>{for(const u of f)a.has(u)||i(u)},[t.id]),e.jsxs("div",{className:"events-category-filters",children:[e.jsx("button",{className:`events-category-chip ${s?"":"active"}`,onClick:()=>l(null),children:"All"}),d.map(u=>e.jsx("button",{className:`events-category-chip ${s===u?"active":""}`,onClick:()=>l(s===u?null:u),style:{borderColor:W(u,t),color:s===u?"#fff":W(u,t),backgroundColor:s===u?W(u,t):"transparent"},children:u},u))]})}function fe({event:t,schema:n,isExpanded:s,onToggle:l,onContextMenu:a}){const i=W(t.category,n);return e.jsxs("div",{className:`event-row event-row--${t.severity||"info"}${s?" event-row--expanded":""}`,onClick:l,onContextMenu:a,children:[e.jsx("span",{className:"event-time",children:pe(t.timestamp)}),e.jsx("span",{className:"event-severity",style:{color:me[t.severity||"info"]},children:(t.severity||"info").toUpperCase().padEnd(5)}),e.jsxs("span",{className:"event-type",children:[t.category&&t.category!=="unknown"&&e.jsxs("span",{className:"event-category-badge",style:{color:i},children:["[",t.category,"]"]})," ",t.eventType]}),e.jsx("span",{className:"event-service",children:t.service}),t.scopeValue&&e.jsx("span",{className:"event-scope",children:t.scopeValue}),t.depth!=null&&t.depth>0&&e.jsx("span",{className:"event-depth",style:{paddingLeft:`${t.depth*12}px`},children:" ".repeat(t.depth)}),s&&t.data&&e.jsx("div",{className:"event-data",onClick:d=>d.stopPropagation(),children:e.jsx("pre",{children:JSON.stringify(t.data,null,2)})})]})}function je({schema:t}){const{events:n,excludedTypes:s,excludedServices:l,categoryFilter:a,loading:i,toggleExcludedType:d,toggleExcludedService:f,clearAllExclusions:p}=R(),[u,j]=r.useState(new Set),[g,x]=r.useState(!1),c=r.useRef(null),{gridTemplate:v,onMouseDown:m}=ue([180,50,200,100]),y=h=>{j(S=>{const L=new Set(S);return L.has(h)?(L.delete(h),x(!1)):L.add(h),L})},N=n.filter(h=>!(s.has(h.eventType)||l.has(h.service)||a&&h.category!==a)),T=s.size>0||l.size>0,[w,k]=r.useState(null),b=r.useCallback((h,S)=>{h.preventDefault(),k({x:h.clientX,y:h.clientY,event:S})},[]);r.useEffect(()=>{if(!w)return;const h=()=>k(null);return window.addEventListener("click",h),()=>window.removeEventListener("click",h)},[w]);const F=()=>{g?(j(new Set),x(!1)):x(!0)};return i?e.jsx("div",{className:"events-loading",children:"Loading events..."}):N.length===0?e.jsxs("div",{className:"events-empty-state",children:[e.jsx("p",{children:"No events to display."}),e.jsx("p",{className:"hint",children:"Events will appear here when applications send them to Sentinel."})]}):e.jsxs("div",{className:"events-table",ref:c,style:{"--evt-cols":v},children:[e.jsxs("div",{className:"events-table-actions",children:[e.jsxs("span",{className:"events-count",children:[N.length," events"]}),e.jsx("button",{className:`events-expand-btn ${g?"active":""}`,onClick:F,title:g?"Collapse all payloads":"Expand all payloads",children:g?"Collapse All":"Expand All"})]}),T&&e.jsxs("div",{className:"exclusion-bar",children:[[...s].map(h=>e.jsxs("span",{className:"exclusion-chip",children:["type: ",h," ",e.jsx("button",{onClick:()=>d(h),children:"×"})]},`type-${h}`)),[...l].map(h=>e.jsxs("span",{className:"exclusion-chip",children:["service: ",h," ",e.jsx("button",{onClick:()=>f(h),children:"×"})]},`svc-${h}`)),e.jsx("button",{className:"exclusion-clear",onClick:p,children:"Clear all"})]}),w&&e.jsxs("div",{className:"context-menu",style:{top:w.y,left:w.x},onClick:h=>h.stopPropagation(),children:[e.jsxs("button",{onClick:()=>{d(w.event.eventType),k(null)},children:['Exclude type "',w.event.eventType,'"']}),e.jsxs("button",{onClick:()=>{f(w.event.service),k(null)},children:['Exclude service "',w.event.service,'"']})]}),e.jsxs("div",{className:"events-table-header",children:[e.jsxs("span",{className:"event-time",children:["Time",e.jsx(P,{idx:0,onMouseDown:m})]}),e.jsxs("span",{className:"event-severity",children:["Level",e.jsx(P,{idx:1,onMouseDown:m})]}),e.jsxs("span",{className:"event-type",children:["Type",e.jsx(P,{idx:2,onMouseDown:m})]}),e.jsxs("span",{className:"event-service",children:["Service",e.jsx(P,{idx:3,onMouseDown:m})]}),e.jsx("span",{className:"event-scope",children:"Scope"})]}),e.jsx("div",{className:"events-table-body",children:N.map(h=>e.jsx(fe,{event:h,schema:t,isExpanded:g||u.has(h.id),onToggle:()=>y(h.id),onContextMenu:S=>b(S,h)},h.id))})]})}function ye(){const{selectedSchemaId:t}=X(),n=X(l=>l.getSelectedSchema()),{fetchEvents:s}=R();return r.useEffect(()=>{t&&s(t)},[t]),e.jsxs("div",{className:"events-view",children:[e.jsxs("div",{className:"events-toolbar",children:[e.jsx(xe,{}),n&&e.jsx(ge,{schema:n})]}),n&&e.jsx(ve,{schema:n}),n?e.jsx(je,{schema:n}):e.jsx("div",{className:"events-empty-state",children:e.jsx("p",{children:"Select a schema to view events."})})]})}const G={gate:"var(--p-symbol-gate)",action:"var(--p-symbol-component)",signal:"var(--p-symbol-signal)"},be={gate:"^",action:"#",signal:"!"};function J(t,n){const s=Date.now();return n.some(l=>l.nodeSymbol===t&&s-new Date(l.timestamp).getTime()<5e3)}function we({flow:t,flowEvents:n,isSelected:s,onSelect:l}){return e.jsxs("div",{className:`flow-card ${s?"selected":""}`,onClick:l,children:[e.jsxs("div",{className:"flow-card-header",children:[e.jsx("span",{className:"flow-card-id",children:t.id}),t.trigger&&e.jsx("span",{className:"flow-card-trigger",children:t.trigger})]}),e.jsx("div",{className:"flow-card-name",children:t.name}),e.jsx("div",{className:"flow-card-steps",children:t.steps.map((a,i)=>{const d=J(a.symbol,n);return e.jsxs("div",{className:"flow-step-mini",children:[i>0&&e.jsx("span",{className:"flow-arrow",children:"→"}),e.jsx("span",{className:`flow-step-dot ${d?"active pulse":""}`,style:{backgroundColor:d?G[a.type]:"var(--p-text-muted)"},title:`${a.symbol} (${a.type})`})]},i)})})]})}function Se({flow:t,flowEvents:n}){return e.jsxs("div",{className:"flow-diagram",children:[e.jsx("h3",{children:t.name}),t.trigger&&e.jsxs("div",{className:"flow-trigger-label",children:["Trigger: ",e.jsx("code",{children:t.trigger})]}),e.jsx("div",{className:"flow-steps",children:t.steps.map((s,l)=>{const a=J(s.symbol,n),i=n.find(d=>d.nodeSymbol===s.symbol);return e.jsxs("div",{className:"flow-step-container",children:[l>0&&e.jsx("div",{className:"flow-connector",children:e.jsx("div",{className:`flow-line ${a?"active":""}`})}),e.jsxs("div",{className:`flow-step-node ${a?"active":""}`,style:{borderColor:G[s.type]},children:[e.jsx("span",{className:"flow-step-icon",children:be[s.type]}),e.jsx("span",{className:"flow-step-symbol",children:s.symbol}),e.jsx("span",{className:"flow-step-type",children:s.type}),a&&i&&e.jsxs("span",{className:"flow-step-live",children:[i.service," · ",new Date(i.timestamp).toLocaleTimeString()]})]})]},l)})})]})}function Ne({symbols:t,onSave:n,onCancel:s}){const[l,a]=r.useState(""),[i,d]=r.useState(""),[f,p]=r.useState([]),u=r.useCallback(v=>{p(m=>[...m,{type:v,symbol:""}])},[]),j=r.useCallback((v,m,y)=>{p(N=>N.map((T,w)=>w===v?{...T,[m]:y}:T))},[]),g=r.useCallback(v=>{p(m=>m.filter((y,N)=>N!==v))},[]),x=()=>{if(!l||f.length===0)return;const v=`$${l.toLowerCase().replace(/\s+/g,"-")}`;n({id:v,name:l,trigger:i||void 0,steps:f})},c=v=>v==="gate"?t.filter(m=>m.type==="gate"):v==="signal"?t.filter(m=>m.type==="signal"):t.filter(m=>m.type==="component");return e.jsxs("div",{className:"flow-composer",children:[e.jsx("h3",{children:"New Flow"}),e.jsxs("div",{className:"composer-field",children:[e.jsx("label",{children:"Flow Name"}),e.jsx("input",{type:"text",placeholder:"e.g. Checkout Flow",value:l,onChange:v=>a(v.target.value)})]}),e.jsxs("div",{className:"composer-field",children:[e.jsx("label",{children:"Trigger (optional)"}),e.jsx("input",{type:"text",placeholder:"e.g. POST /api/checkout",value:i,onChange:v=>d(v.target.value)})]}),e.jsxs("div",{className:"composer-steps",children:[e.jsx("label",{children:"Steps"}),f.map((v,m)=>e.jsxs("div",{className:"composer-step",children:[e.jsxs("select",{value:v.type,onChange:y=>j(m,"type",y.target.value),children:[e.jsx("option",{value:"gate",children:"Gate (^)"}),e.jsx("option",{value:"action",children:"Action (#)"}),e.jsx("option",{value:"signal",children:"Signal (!)"})]}),e.jsxs("select",{value:v.symbol,onChange:y=>j(m,"symbol",y.target.value),children:[e.jsx("option",{value:"",children:"Select symbol..."}),c(v.type).map(y=>e.jsx("option",{value:y.symbol,children:y.symbol},y.symbol))]}),e.jsx("button",{className:"composer-remove",onClick:()=>g(m),children:"×"})]},m)),e.jsxs("div",{className:"composer-add-buttons",children:[e.jsx("button",{onClick:()=>u("gate"),children:"+ Gate"}),e.jsx("button",{onClick:()=>u("action"),children:"+ Action"}),e.jsx("button",{onClick:()=>u("signal"),children:"+ Signal"})]})]}),e.jsxs("div",{className:"composer-actions",children:[e.jsx("button",{className:"action-btn",onClick:x,disabled:!l||f.length===0,children:"Save Flow"}),e.jsx("button",{className:"action-btn cancel",onClick:s,children:"Cancel"})]})]})}function Ce(){const{flowEvents:t,isLive:n,setIsLive:s}=Q(),[l,a]=r.useState([]),[i,d]=r.useState([]),[f,p]=r.useState(null),[u,j]=r.useState(!1),[g,x]=r.useState(!0),c=l.find(m=>m.id===f);r.useEffect(()=>{async function m(){try{const y=await fetch("/api/sentinel/symbols");if(!y.ok){x(!1);return}const N=await y.json(),T=(N.symbols||[]).map(b=>({symbol:b.symbol,type:b.type}));d(T);const k=(N.symbols||[]).filter(b=>b.type==="flow").map(b=>{var h,S,L;const F=[];if((h=b.data)!=null&&h.steps&&Array.isArray(b.data.steps))for(const C of b.data.steps)F.push({type:C.type||"action",symbol:C.symbol||"",label:C.label});if(F.length===0&&b.references)for(const C of b.references)C.startsWith("^")?F.push({type:"gate",symbol:C}):C.startsWith("!")?F.push({type:"signal",symbol:C}):C.startsWith("#")&&F.push({type:"action",symbol:C});return{id:b.symbol,name:((S=b.data)==null?void 0:S.name)||b.symbol.replace("$",""),trigger:(L=b.data)==null?void 0:L.trigger,steps:F}});a(k),x(!1)}catch{x(!1)}}m()},[]),r.useEffect(()=>(s(!0),()=>s(!1)),[]);const v=m=>{a(y=>[...y,m]),j(!1),p(m.id)};return g?e.jsx("div",{className:"flows-view s-loading-state",children:e.jsxs("div",{className:"s-loading-content",children:[e.jsx("div",{className:"s-loading-spinner"}),e.jsx("p",{children:"Loading flows..."})]})}):e.jsxs("div",{className:"flows-view",children:[e.jsxs("div",{className:"flows-toolbar",children:[e.jsxs("div",{className:"flows-toolbar-left",children:[e.jsxs("span",{className:"flows-count",children:[l.length," flow",l.length!==1?"s":""]}),e.jsxs("button",{className:`logs-live-btn ${n?"active":""}`,onClick:()=>s(!n),children:[e.jsx("span",{className:`live-dot ${n?"live":""}`}),n?"Live":"Paused"]})]}),e.jsx("div",{className:"flows-toolbar-right",children:e.jsx("button",{className:"action-btn",onClick:()=>{j(!0),p(null)},children:"+ New Flow"})})]}),e.jsxs("div",{className:"flows-content",children:[e.jsx("div",{className:"flows-list",children:l.length===0&&!u?e.jsxs("div",{className:"flows-empty",children:[e.jsx("p",{children:"No flows defined."}),e.jsxs("p",{className:"hint",children:["Define flows in ",e.jsx("code",{children:".purpose"})," files or use the composer to create one."]})]}):l.map(m=>e.jsx(we,{flow:m,flowEvents:t,isSelected:f===m.id,onSelect:()=>{p(m.id),j(!1)}},m.id))}),e.jsx("div",{className:"flows-detail",children:u?e.jsx(Ne,{symbols:i,onSave:v,onCancel:()=>j(!1)}):c?e.jsx(Se,{flow:c,flowEvents:t}):e.jsx("div",{className:"flows-empty-detail",children:e.jsx("p",{children:"Select a flow to visualize or create a new one."})})})]})]})}const Ee=[{id:"logs",label:"Logs"},{id:"incidents",label:"Incidents"},{id:"events",label:"Events"},{id:"flows",label:"Flows"}];function Le(){const[t,n]=r.useState("logs");return te(),e.jsxs("div",{className:"sentinel-section",children:[e.jsx("div",{className:"sentinel-tabs",children:Ee.map(s=>e.jsx("button",{className:`sentinel-tab ${t===s.id?"active":""}`,onClick:()=>n(s.id),children:s.label},s.id))}),e.jsxs("div",{className:"sentinel-tab-content",children:[t==="logs"&&e.jsx(oe,{}),t==="incidents"&&e.jsx(de,{}),t==="events"&&e.jsx(ye,{}),t==="flows"&&e.jsx(Ce,{})]})]})}export{Le as default};
@@ -0,0 +1 @@
1
+ .overview{padding:24px;max-width:1060px}.overview__title{font-size:20px;font-weight:600;margin-bottom:20px}.overview__cards{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:24px}@media (max-width: 768px){.overview__cards{grid-template-columns:repeat(2,1fr)}}.stat-card{background:var(--p-bg-secondary);border:1px solid var(--p-border);border-radius:var(--p-radius);padding:16px;transition:border-color var(--p-transition)}.stat-card--clickable{cursor:pointer}.stat-card--clickable:hover{border-color:var(--p-border-active)}.stat-card__value{font-size:24px;font-weight:700;color:var(--p-text-primary)}.stat-card__label{font-size:12px;color:var(--p-text-secondary);margin-top:4px}.stat-card__detail{font-size:11px;color:var(--p-text-muted);margin-top:2px}.overview__section-title{font-size:13px;font-weight:600;color:var(--p-text-secondary);text-transform:uppercase;letter-spacing:.5px;margin-bottom:12px;padding-bottom:8px;border-bottom:1px solid var(--p-border)}.overview__health{display:flex;flex-direction:column;gap:12px;margin-bottom:24px}.health-bar{display:flex;flex-direction:column;gap:4px}.health-bar__header{display:flex;justify-content:space-between;align-items:center}.health-bar__label{font-size:12px;color:var(--p-text-secondary)}.health-bar__value{font-size:12px;color:var(--p-text-muted);font-variant-numeric:tabular-nums}.health-bar__track{height:6px;background:var(--p-bg-tertiary);border-radius:3px;overflow:hidden}.health-bar__fill{height:100%;border-radius:3px;transition:width .4s ease}.overview__activity{margin-top:24px}.activity-feed{display:flex;flex-direction:column;gap:1px;max-height:400px;overflow-y:auto}.activity-feed__empty{color:var(--p-text-muted);font-size:13px;padding:16px 0}.activity-feed__item{display:flex;align-items:flex-start;gap:8px;padding:8px 4px;border-bottom:1px solid var(--p-bg-tertiary)}.activity-feed__item:last-child{border-bottom:none}.activity-feed__icon{flex-shrink:0;width:18px;text-align:center;font-size:12px;line-height:20px}.activity-feed__icon--commit{color:var(--p-accent-blue)}.activity-feed__icon--lore{color:var(--p-accent-purple)}.activity-feed__content{flex:1;min-width:0;display:flex;flex-wrap:wrap;gap:6px;align-items:baseline}.activity-feed__summary{font-size:13px;color:var(--p-text-primary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.activity-feed__symbol{font-size:11px;color:var(--p-accent-blue);background:var(--p-bg-tertiary);padding:1px 6px;border-radius:10px;white-space:nowrap}.activity-feed__time{flex-shrink:0;font-size:11px;color:var(--p-text-muted);font-variant-numeric:tabular-nums;line-height:20px}.agent-toast-container{position:fixed;bottom:16px;right:16px;z-index:1000;display:flex;flex-direction:column;gap:8px;max-width:360px}.agent-toast{display:flex;align-items:center;gap:8px;padding:10px 14px;background:var(--p-bg-secondary);border:1px solid var(--p-border);border-left:3px solid var(--p-symbol-component);border-radius:6px;color:var(--p-text-primary);font-size:13px;animation:agent-toast-in .3s ease;box-shadow:0 4px 12px #0000004d}.agent-toast__icon{font-size:16px;flex-shrink:0}.agent-toast__message{flex:1;line-height:1.4}.agent-toast__dismiss{background:none;border:none;color:var(--p-text-muted);cursor:pointer;font-size:16px;padding:0 2px;flex-shrink:0}.agent-toast__dismiss:hover{color:var(--p-text-primary)}@keyframes agent-toast-in{0%{opacity:0;transform:translate(20px)}to{opacity:1;transform:translate(0)}}.agent-callout-overlay{position:fixed;top:60px;right:16px;z-index:999;display:flex;flex-direction:column;gap:8px;max-width:280px}.agent-callout{padding:10px 14px;background:var(--p-bg-secondary);border:1px solid var(--p-border);border-left:3px solid var(--p-symbol-component);border-radius:6px;font-size:12px;color:var(--p-text-primary);animation:agent-callout-in .3s ease}.agent-callout__symbol{font-size:11px;color:var(--p-symbol-component);font-family:monospace;margin-bottom:4px}.agent-callout__message{line-height:1.4}@keyframes agent-callout-in{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.agent-nav-prompt{position:fixed;top:12px;left:50%;transform:translate(-50%);z-index:1001;display:flex;align-items:center;gap:10px;padding:10px 16px;background:var(--p-bg-secondary);border:1px solid var(--p-border);border-radius:8px;box-shadow:0 4px 16px #0006;animation:agent-nav-prompt-in .3s ease}.agent-nav-prompt__icon{font-size:18px}.agent-nav-prompt__text{font-size:13px;color:var(--p-text-primary)}.agent-nav-prompt__accept,.agent-nav-prompt__dismiss{padding:4px 12px;border-radius:4px;border:1px solid var(--p-border);font-size:12px;cursor:pointer}.agent-nav-prompt__accept{background:var(--p-symbol-component);color:#fff;border-color:var(--p-symbol-component)}.agent-nav-prompt__accept:hover{opacity:.9}.agent-nav-prompt__dismiss{background:transparent;color:var(--p-text-muted)}.agent-nav-prompt__dismiss:hover{color:var(--p-text-primary)}@keyframes agent-nav-prompt-in{0%{opacity:0;transform:translate(-50%) translateY(-10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.agent-presence{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--p-text-muted)}.agent-presence__dot{width:8px;height:8px;border-radius:50%;display:inline-block;animation:agent-presence-pulse 2s infinite}@keyframes agent-presence-pulse{0%,to{opacity:1}50%{opacity:.5}}.agent-mute-btn{background:none;border:1px solid var(--p-border);border-radius:4px;padding:2px 8px;font-size:12px;cursor:pointer;color:var(--p-text-muted);display:flex;align-items:center;gap:4px}.agent-mute-btn:hover{color:var(--p-text-primary);border-color:var(--p-text-muted)}.agent-mute-btn--muted{color:var(--p-symbol-gate);border-color:var(--p-symbol-gate)}.agent-highlight-pulse{animation:agent-highlight-glow 1.5s ease-in-out infinite}@keyframes agent-highlight-glow{0%,to{box-shadow:0 0 4px var(--agent-highlight-color, #58a6ff)}50%{box-shadow:0 0 16px var(--agent-highlight-color, #58a6ff),0 0 24px var(--agent-highlight-color, #58a6ff)}}.agent-selected{outline:2px dashed var(--agent-color, #58a6ff);outline-offset:2px}:root,[data-theme=dark]{--p-bg-primary: #0d1117;--p-bg-secondary: #161b22;--p-bg-tertiary: #21262d;--p-bg-hover: #30363d;--p-text-primary: #e6edf3;--p-text-secondary: #8b949e;--p-text-muted: #484f58;--p-border: #30363d;--p-border-active: #58a6ff;--p-accent-blue: #58a6ff;--p-accent-green: #3fb950;--p-accent-red: #f85149;--p-accent-orange: #d29922;--p-accent-purple: #bc8cff;--p-symbol-component: #58a6ff;--p-symbol-flow: #3fb950;--p-symbol-gate: #f85149;--p-symbol-signal: #d29922;--p-symbol-aspect: #bc8cff;--p-sidebar-width: 56px;--p-header-height: 44px;--p-radius: 6px;--p-transition: .15s ease}[data-theme=light]{--p-bg-primary: #ffffff;--p-bg-secondary: #f6f8fa;--p-bg-tertiary: #eaeef2;--p-bg-hover: #d0d7de;--p-text-primary: #1f2328;--p-text-secondary: #656d76;--p-text-muted: #8b949e;--p-border: #d0d7de;--p-border-active: #0969da;--p-accent-blue: #0969da;--p-accent-green: #1a7f37;--p-accent-red: #cf222e;--p-accent-orange: #9a6700;--p-accent-purple: #8250df}*{margin:0;padding:0;box-sizing:border-box}html,body,#root{height:100%;width:100%;overflow:hidden}body{background:var(--p-bg-primary);color:var(--p-text-primary);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif;font-size:14px;line-height:1.5}.shell{display:flex;height:100%;width:100%}.sidebar{width:var(--p-sidebar-width);min-width:var(--p-sidebar-width);background:var(--p-bg-secondary);border-right:1px solid var(--p-border);display:flex;flex-direction:column;padding:8px 0;gap:2px;z-index:10}.sidebar__nav{flex:1;display:flex;flex-direction:column;gap:2px;padding:0 6px}.sidebar__bottom{padding:8px 6px 0;border-top:1px solid var(--p-border)}.sidebar__item{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:8px 4px;border-radius:var(--p-radius);cursor:pointer;color:var(--p-text-muted);text-decoration:none;transition:background var(--p-transition),color var(--p-transition);border:none;background:none;font-size:10px;font-family:inherit;width:100%}.sidebar__item:hover{background:var(--p-bg-hover);color:var(--p-text-secondary)}.sidebar__item--active{background:var(--p-bg-tertiary);color:var(--p-accent-blue)}.sidebar__item-icon{font-size:18px;line-height:1}.sidebar__item-label{font-size:9px;text-transform:uppercase;letter-spacing:.5px}.main{flex:1;display:flex;flex-direction:column;min-width:0;overflow:hidden}.header{height:var(--p-header-height);min-height:var(--p-header-height);background:var(--p-bg-secondary);border-bottom:1px solid var(--p-border);display:flex;align-items:center;justify-content:space-between;padding:0 16px;gap:12px}.header__left{display:flex;align-items:center;gap:10px}.header__title{font-size:13px;font-weight:600;color:var(--p-text-primary)}.header__project{font-size:12px;color:var(--p-text-secondary);background:var(--p-bg-tertiary);padding:2px 8px;border-radius:12px}.header__right{display:flex;align-items:center;gap:8px}.header__btn{background:none;border:none;color:var(--p-text-muted);cursor:pointer;padding:4px 8px;border-radius:var(--p-radius);font-size:14px;transition:background var(--p-transition),color var(--p-transition)}.header__btn:hover{background:var(--p-bg-hover);color:var(--p-text-primary)}.content{flex:1;overflow:auto}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--p-bg-hover);border-radius:4px}::-webkit-scrollbar-thumb:hover{background:var(--p-text-muted)}