pi-mega-compact 0.15.2 → 0.15.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/extensions/dashboard-client/dist/assets/{AreaChart-D0hDLKC1.js → AreaChart-CMri0vM1.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{AreaChart-D0hDLKC1.js.map → AreaChart-CMri0vM1.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{BarChart-DSbTWZTQ.js → BarChart-BbkxxSkM.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{BarChart-DSbTWZTQ.js.map → BarChart-BbkxxSkM.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{CacheTab-Bgt2Wuar.js → CacheTab-CiHS6tod.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{CacheTab-Bgt2Wuar.js.map → CacheTab-CiHS6tod.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{EventsTab-CBb7O-6M.js → EventsTab-NnD7EpRm.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{EventsTab-CBb7O-6M.js.map → EventsTab-NnD7EpRm.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{HealthTab-BFMHwnlg.js → HealthTab-Dlt7WTh7.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{HealthTab-BFMHwnlg.js.map → HealthTab-Dlt7WTh7.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{MaintenanceTab-DxIQyeh-.js → MaintenanceTab-DgKBZmdD.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{MaintenanceTab-DxIQyeh-.js.map → MaintenanceTab-DgKBZmdD.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{MemoryMapTab-C576-nmM.js → MemoryMapTab-SwTOzuZW.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{MemoryMapTab-C576-nmM.js.map → MemoryMapTab-SwTOzuZW.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{MetricsTab-vk8Nqg7k.js → MetricsTab-CWEgBTx0.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{MetricsTab-vk8Nqg7k.js.map → MetricsTab-CWEgBTx0.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{OverviewTab-BVaddBS4.js → OverviewTab-B0YDSSMH.js} +4 -4
- package/extensions/dashboard-client/dist/assets/{OverviewTab-BVaddBS4.js.map → OverviewTab-B0YDSSMH.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{ReposTab-CLCd-Gfd.js → ReposTab-CMKZ_a4B.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{ReposTab-CLCd-Gfd.js.map → ReposTab-CMKZ_a4B.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{SessionsTab-CV_qDKZB.js → SessionsTab-D2cCDKB3.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{SessionsTab-CV_qDKZB.js.map → SessionsTab-D2cCDKB3.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{SetupTab-BuIwk7LZ.js → SetupTab-HUAG7xDf.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{SetupTab-BuIwk7LZ.js.map → SetupTab-HUAG7xDf.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{TimeSavedCard-BS5-w4mP.js → TimeSavedCard-NFCsyJhB.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{TimeSavedCard-BS5-w4mP.js.map → TimeSavedCard-NFCsyJhB.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{TurnsTab-DhgjZmEQ.js → TurnsTab-BY7_AZaG.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{TurnsTab-DhgjZmEQ.js.map → TurnsTab-BY7_AZaG.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{WikiTab-CmOAaPnM.js → WikiTab-MbmjqKVQ.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{WikiTab-CmOAaPnM.js.map → WikiTab-MbmjqKVQ.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{button-DyV48WDX.js → button-CoVmU9Vr.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{button-DyV48WDX.js.map → button-CoVmU9Vr.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{card-CfCQ36pG.js → card-Cp9Hpdoo.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{card-CfCQ36pG.js.map → card-Cp9Hpdoo.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{generateCategoricalChart-CGlLggNu.js → generateCategoricalChart-CMM8OUO5.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{generateCategoricalChart-CGlLggNu.js.map → generateCategoricalChart-CMM8OUO5.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{index-tPP7N38D.js → index-CRHmWnRi.js} +3 -3
- package/extensions/dashboard-client/dist/assets/{index-tPP7N38D.js.map → index-CRHmWnRi.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{switch-7461qYip.js → switch-jrYrJJYy.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{switch-7461qYip.js.map → switch-jrYrJJYy.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{toggle-CHyUS1MH.js → toggle-DT1AN5wS.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{toggle-CHyUS1MH.js.map → toggle-DT1AN5wS.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{useSSE-CPIU9hax.js → useSSE-rJH_Rx6K.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{useSSE-CPIU9hax.js.map → useSSE-rJH_Rx6K.js.map} +1 -1
- package/extensions/dashboard-client/dist/index.html +1 -1
- package/extensions/dashboard-client/src/tabs/OverviewTab.tsx +20 -11
- package/package.json +1 -1
package/extensions/dashboard-client/dist/assets/{SetupTab-BuIwk7LZ.js → SetupTab-HUAG7xDf.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as n,j as e,h as R,i as $,k as G,p as H,l as q,m as V,C as X,n as Y,o as J,q as K,s as Q,t as Z,v as ee}from"./index-tPP7N38D.js";import{S as te}from"./switch-7461qYip.js";import{T as se}from"./toggle-CHyUS1MH.js";function ne(t){try{return new Date(t*1e3).toLocaleString()}catch{return"—"}}function P({achievements:t}){const m=n.useRef(0),[s,g]=n.useState(null),i=t.reduce((r,c)=>Math.max(r,c.unlocked_at??0),0),u=m.current;n.useEffect(()=>{i>m.current&&(m.current=i)},[i]),n.useEffect(()=>{if(u>0&&i>u){const r=t.filter(c=>c.unlocked_at!=null&&(c.unlocked_at??0)>u);if(r.length>0){const c=r.map(o=>`${o.icon??""} ${o.title}`.trim()).join(", ")+" unlocked!";g(c);const p=setTimeout(()=>g(null),4e3);return()=>clearTimeout(p)}}},[t,i,u]);const x=t.filter(r=>!(r.hidden===1&&r.unlocked_at==null));return e.jsxs("div",{className:"ach-section",children:[s!=null&&e.jsx("div",{className:"ach-toast show",children:s}),e.jsxs("div",{className:"ach-tiles",children:[x.length===0&&e.jsx("span",{className:"repo-none",children:"no achievements yet"}),x.map(r=>{if(r.unlocked_at!=null){const c=u>0&&(r.unlocked_at??0)>u;return e.jsxs("div",{className:`ach-tile unlocked${c?" just-unlocked":""}`,children:[r.icon??""," ",r.title,e.jsxs("span",{className:"ach-detail",children:["unlocked ",ne(r.unlocked_at)]})]},r.id)}return e.jsxs("div",{className:"ach-tile locked",children:["??? ",r.title]},r.id)})]})]})}function A(t){return(Math.round(t*10)/10).toString()+"%"}function D(t){return t!=null?new Date(t).toLocaleString():"—"}function U(t){return t&&typeof t=="object"?t:{}}function ae(t){return t.split("/").pop()||t}function z({title:t,rows:m,badge:s,renderValue:g}){return e.jsxs("div",{className:"lb-card",children:[e.jsxs("h3",{children:[t,s]}),m.length===0?e.jsx("div",{className:"lb-empty",children:"—"}):e.jsx("table",{children:e.jsx("tbody",{children:m.map((i,u)=>e.jsxs("tr",{children:[e.jsx("td",{title:i.repo_root,children:ae(i.repo_root)}),e.jsx("td",{className:"num",children:g(i)})]},`${i.repo_root}-${u}`))})})]})}function re(){const[t,m]=n.useState({}),[s,g]=n.useState(0),[i,u]=n.useState([]),[x,r]=n.useState(!1),[c,p]=n.useState(!0),[o,b]=n.useState(null),a=n.useRef(0),f=n.useCallback(async()=>{try{const[h,v,d,y,N,F]=await Promise.all([R({metric:"cache",limit:25}),R({metric:"dedupe",limit:25}),R({metric:"turns",limit:25}),R({metric:"mega_cache",limit:25}),R({metric:"repos",limit:1}),$()]),B=y.find(_=>_.ts>a.current&&_.value>100);a.current>0&&B&&(b(`oopsie! cache went to ${Math.round(B.value)}% — MEGA CACHE 🥧`),setTimeout(()=>b(null),4e3)),y.length>0&&(a.current=Math.max(...y.map(_=>_.ts))),m({cache:h,dedupe:v,turns:d,mega_cache:y}),g(N[0]?.value??0),u(F)}catch{}finally{p(!1)}},[]);n.useEffect(()=>{let h=!0;const v=async()=>{h&&await f()};v();const d=setInterval(()=>void v(),15e3);return()=>{h=!1,clearInterval(d)}},[f]),n.useEffect(()=>{let h=!0;const v=async()=>{try{const y=await G();h&&(r(!!y.game_mode_on),y.theme&&(document.documentElement.dataset.theme=y.theme))}catch{}};v();const d=setInterval(()=>void v(),15e3);return()=>{h=!1,clearInterval(d)}},[]);const w=t.mega_cache??[];let j=null,E=null;for(const h of w){(j==null||h.value>j)&&(j=h.value);const v=U(h.meta),d=v.firstSeenTs??v.firstSeen??h.ts;(E==null||d<E)&&(E=d)}const L=j!=null&&j>100,S=t.turns??[],k=S.reduce((h,v)=>Math.max(h,v.value),0),I=Math.floor(Math.log2(k+1))+1,M=(t.cache?.length??0)>0||(t.dedupe?.length??0)>0||S.length>0||w.length>0||s>0;return e.jsxs("div",{className:`game-tab${x?" game-mode-on":""}`,children:[o!=null&&e.jsx("div",{className:"mega-cache-toast show",children:o}),L&&e.jsxs("div",{className:"mega-cache-banner",children:["🥧"," MEGA CACHE! peak ",A(j)," — first reached ",D(E)]}),L&&e.jsxs("div",{className:"achievement-tile unlocked",children:["🏆"," Opie's Wild Ride",e.jsxs("span",{className:"ach-detail",children:["best ",A(j)," · first ",D(E)]})]}),e.jsx("h2",{children:"High Scores"}),!M&&!c&&e.jsx("div",{className:"game-empty",children:"No scores yet — run a session with game mode on."}),M&&e.jsxs("div",{className:"game-leaderboards",children:[e.jsx(z,{title:"Cache %",rows:t.cache??[],renderValue:h=>A(h.value)}),e.jsx(z,{title:"Dedupe (collapsed)",rows:t.dedupe??[],renderValue:h=>h.value.toLocaleString()}),e.jsx(z,{title:"Turns",rows:S,badge:S.length>0?e.jsxs("span",{className:"lvl-badge",children:["LVL ",I]}):void 0,renderValue:h=>h.value.toLocaleString()}),e.jsx(z,{title:"MEGA CACHE trophies",rows:w,renderValue:h=>e.jsxs(e.Fragment,{children:[A(h.value),e.jsx("span",{className:"lb-meta",children:D(U(h.meta).firstSeenTs??U(h.meta).firstSeen??h.ts)})]})})]}),s>0&&e.jsx("div",{className:"repos-badge-line",children:e.jsxs("span",{className:"repos-badge",children:[s," repos"]})}),e.jsx("h3",{children:"Achievements"}),e.jsx(P,{achievements:i})]})}function le(){const[t,m]=n.useState([]),[s,g]=n.useState(!0),[i,u]=n.useState(null),x=n.useCallback(async()=>{try{const r=await $();m(r),u(null)}catch(r){u(r instanceof Error?r:new Error(String(r)))}finally{g(!1)}},[]);return n.useEffect(()=>{let r=!0;const c=async()=>{r&&await x()};c();const p=setInterval(()=>void c(),15e3);return()=>{r=!1,clearInterval(p)}},[x]),s&&t.length===0?e.jsx("div",{className:"tab-stub",children:"Loading achievements…"}):i&&t.length===0?e.jsxs("div",{className:"tab-stub",children:["Error: ",i.message]}):e.jsxs("div",{className:"achievements-tab",children:[e.jsx("h2",{children:"Achievements"}),e.jsx(P,{achievements:t})]})}const W=[{id:"transparent",label:"Transparent (accents only)",css:{bg:null,fg:"#c9d1d9",accent:"#3fb950",mega:"#f0883e"},ansi:{bg:null,fg:"39",accent:"32",mega:"33"}},{id:"retro",label:"Retro 8-bit green",css:{bg:"#003300",fg:"#33ff33",accent:"#00ff41",mega:"#39ff14"},ansi:{bg:"40",fg:"92",accent:"92",mega:"1;92"}},{id:"orange-bold",label:"Orange bold",css:{bg:"#1a0f00",fg:"#ff8c00",accent:"#ff6b00",mega:"#ff4500"},ansi:{bg:"48;5;52",fg:"38;5;208",accent:"38;5;208",mega:"1;38;5;202"}},{id:"cyan-neon",label:"Cyan neon",css:{bg:"#001a1a",fg:"#00ffff",accent:"#22d3ee",mega:"#7df9ff"},ansi:{bg:"48;5;23",fg:"38;5;51",accent:"38;5;51",mega:"1;38;5;51"}},{id:"amber-mono",label:"Amber phosphor",css:{bg:"#1a1200",fg:"#ffb000",accent:"#ff8c00",mega:"#ff5500"},ansi:{bg:"48;5;58",fg:"38;5;214",accent:"38;5;214",mega:"1;38;5;208"}},{id:"grayscale",label:"Grayscale minimal",css:{bg:"#161616",fg:"#b0b0b0",accent:"#8b949e",mega:"#e6edf3"},ansi:{bg:"48;5;235",fg:"38;5;249",accent:"38;5;249",mega:"1;38;5;255"}}],O=W.map(t=>t.id),T={gameMode:"Turn game mode on/off (themes the widget + dashboard)",theme:"Visual theme (applies instantly)",tuiMode:"TUI widget display density",tier:"Live pressure band — climbs low→mega as context fills the window.",preset:"The env-resolved base compaction preset (low/medium/high/ultra/mega) that set the token threshold.",pressure:"Live pressure = currentTokens / threshold — % of the model context window (threshold fires at the tier's % of window).",threshold:"Compaction threshold = tierPct × model context window — mega-compact trims BELOW pi's native ~80% auto-compact for any model size.",fastGate:"Fast-gate arming floor — the live trim arms once context passes this % of the window."};function ie(t,m,s){let g=t.toLocaleString();return m!=null&&s>0&&(g+=` (${Math.round(m*100)}% of ${s.toLocaleString()})`),g}function oe(t){return`${Math.round((t||0)*100)}%`}function ce(){const[t,m]=n.useState(null),[s,g]=n.useState(null),[i,u]=n.useState(!1);n.useEffect(()=>{let a=!0;const f=async()=>{try{const j=await q();a&&m(j)}catch{}};f();const w=setInterval(()=>void f(),5e3);return()=>{a=!1,clearInterval(w)}},[]),n.useEffect(()=>{let a=!0;const f=async()=>{try{const j=await G();a&&(g(j),j.theme&&(document.documentElement.dataset.theme=j.theme))}catch{}};f();const w=setInterval(()=>void f(),5e3);return()=>{a=!1,clearInterval(w)}},[]);const x=n.useCallback(async a=>{u(!0);try{const f=await H(a);g(f),f.theme&&(document.documentElement.dataset.theme=f.theme)}catch{}u(!1)},[]),r=s?.game_mode_on??!1,c=s?.theme??"transparent",p=s?.tui_display_mode??"full",o=t?.config,b=t?.context.contextWindow??0;return e.jsxs("div",{className:"config-tab",children:[e.jsxs("section",{className:"config-settings",children:[e.jsx("h3",{children:"Settings"}),e.jsx("div",{className:"settings-row",children:e.jsxs("label",{title:T.gameMode,children:[e.jsx("input",{type:"checkbox",checked:r,onChange:a=>x({game_mode_on:a.currentTarget.checked}),disabled:i}),"Game Mode"]})}),e.jsx("div",{className:"settings-row",children:e.jsxs("label",{title:T.theme,children:["Theme",e.jsx("select",{value:c,onChange:a=>x({theme:a.currentTarget.value}),disabled:i,children:W.map(a=>e.jsx("option",{value:a.id,children:a.label},a.id))}),e.jsx("button",{type:"button",disabled:i,className:"theme-cycle-btn",title:"Cycle to the next theme (P3)",onClick:()=>{const a=O.indexOf(c),f=O[(a<0?0:a+1)%O.length];f&&x({theme:f})},children:"Next theme →"})]})}),e.jsx("div",{className:"settings-row",children:e.jsxs("label",{title:T.tuiMode,children:["TUI Mode",e.jsxs("select",{value:p,onChange:a=>x({tui_display_mode:a.currentTarget.value}),disabled:i,children:[e.jsx("option",{value:"full",children:"Full"}),e.jsx("option",{value:"minimal",children:"Minimal"})]})," ",e.jsx("span",{className:"tui-mode-hint",children:"(affects the in-app TUI widget; not shown here)"})]})})]}),e.jsxs("section",{className:"config-display",children:[e.jsx("h3",{children:"Configuration"}),e.jsxs("div",{className:"config-grid",children:[e.jsxs("div",{className:"config-item",children:[e.jsx("span",{className:"config-label",title:T.tier,children:"Tier"}),e.jsx("span",{className:"config-value",children:t?`${t.tier} (live)`:"—"})]}),e.jsxs("div",{className:"config-item",children:[e.jsx("span",{className:"config-label",title:T.preset,children:"Preset"}),e.jsx("span",{className:"config-value",children:t?.presetTier??"—"})]}),e.jsxs("div",{className:"config-item",children:[e.jsx("span",{className:"config-label",title:T.pressure,children:"Pressure"}),e.jsx("span",{className:"config-value",children:t?oe(t.pressure):"—"})]}),e.jsxs("div",{className:"config-item",children:[e.jsx("span",{className:"config-label",title:T.threshold,children:"Threshold"}),e.jsx("span",{className:"config-value",children:o?ie(o.thresholdTokens,o.tierPct,b):"—"})]}),e.jsxs("div",{className:"config-item",children:[e.jsx("span",{className:"config-label",title:T.fastGate,children:"Fast Gate"}),e.jsx("span",{className:"config-value",children:o?`${o.fastGatePct}%`:"—"})]}),e.jsxs("div",{className:"config-item",children:[e.jsx("span",{className:"config-label",children:"Auto"}),e.jsx("span",{className:"config-value",children:o?o.auto?"enabled":"disabled":"—"})]}),e.jsxs("div",{className:"config-item",children:[e.jsx("span",{className:"config-label",children:"Anchor"}),e.jsx("span",{className:"config-value",children:o?.anchorUserMessages??"—"})]})]})]})]})}const C={section:{background:"#1a1a2e",borderRadius:"8px",padding:"1rem",marginBottom:"1rem",border:"1px solid #2a2a4e"},sectionTitle:{fontSize:"1.1rem",fontWeight:700,marginTop:0,marginBottom:"0.75rem",color:"#e0e0e0",borderBottom:"1px solid #333",paddingBottom:"0.5rem"},label:{fontWeight:600,color:"#a0a0c0",marginRight:"0.5rem"},value:{color:"#e0e0e0"},row:{marginBottom:"0.4rem",fontSize:"0.9rem"}};function de(){const[t,m]=n.useState(null),[s,g]=n.useState(null),i=n.useCallback(()=>{V().then(m).catch(p=>g(p instanceof Error?p.message:String(p)))},[]);n.useEffect(()=>{i()},[i]),n.useEffect(()=>{const p=setInterval(i,3e4);return()=>clearInterval(p)},[i]);const u=t?.status==="ok",x=t?.status==="ok"?"Working":t?.status==="unreachable"?"Unreachable":"Error",r=u?"#4caf50":"#f44336",c=u?"✓":"✗";return e.jsxs("div",{style:C.section,children:[e.jsx("h3",{style:C.sectionTitle,children:"Embedder Health"}),s&&e.jsxs("p",{style:{color:"#f44336",fontSize:"0.85rem"},children:["Error: ",s]}),!t&&!s&&e.jsx("p",{style:{color:"#888",fontSize:"0.85rem"},children:"Probing embedder..."}),t&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:C.row,children:[e.jsxs("span",{style:{...C.label,color:`${r}`},children:[c," ",x,":"]}),e.jsxs("span",{style:C.value,children:[t.dim," dims"]}),t.latencyMs!==void 0&&e.jsxs("span",{style:{color:"#a0a0c0",marginLeft:"0.5rem"},children:["(",t.latencyMs.toFixed(1)," ms)"]})]}),e.jsxs("div",{style:C.row,children:[e.jsx("span",{style:C.label,children:"Endpoint:"}),e.jsx("span",{style:C.value,children:t.url??e.jsx("span",{style:{color:"#888"},children:"built-in (no URL)"})})]}),t.error&&e.jsx("p",{style:{color:"#f44336",fontSize:"0.85rem"},children:t.error})]})]})}function me({title:t,children:m}){const[s,g]=n.useState(!0),i=`settings-${t.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return e.jsxs("section",{className:"overflow-hidden rounded-xl border border-border bg-bg-elevated/40",children:[e.jsxs("button",{type:"button",onClick:()=>g(u=>!u),className:"flex w-full items-center justify-between rounded-t-xl bg-bg-elevated/60 px-4 py-3 text-left text-sm font-semibold text-foreground transition-colors hover:bg-bg-elevated","aria-expanded":s,"aria-controls":i,children:[e.jsx("span",{children:t}),e.jsx(X,{className:Y("h-4 w-4 text-muted-foreground transition-transform",s&&"rotate-180"),"aria-hidden":"true"})]}),s&&e.jsx("div",{id:i,className:"divide-y divide-border px-4 py-1",children:m})]})}const ue="rounded-md border border-border bg-bg-elevated/50 px-2 py-1 text-sm outline-none transition-colors focus:border-primary disabled:cursor-not-allowed disabled:opacity-50";function he(){return e.jsx("span",{className:"ml-2 inline-flex items-center rounded-md border border-warning/40 bg-warning/15 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-warning",title:"Requires an LLM embedder (Ollama/HTTP) to be effective",children:"LLM"})}function ge({setting:t,id:m,llmActive:s,saving:g,onUpdate:i}){const[u,x]=n.useState(null),r=t.requiresLlm&&!s,c=n.useRef(null);n.useEffect(()=>()=>{c.current&&clearTimeout(c.current)},[]);const p=n.useCallback(a=>{i(t.key,a).then(f=>x(f)).catch(f=>x(f instanceof Error?f.message:String(f)))},[i,t.key]),o=n.useCallback(a=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>p(a),500)},[p]),b=g||r;return e.jsxs("div",{className:"py-2.5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center text-sm font-semibold text-foreground",children:[e.jsx("label",{htmlFor:`${m}-input`,className:"cursor-pointer",children:t.label}),t.requiresLlm&&!s&&e.jsx(he,{})]}),e.jsx("div",{className:"mt-0.5 text-xs text-muted-foreground",children:t.description})]}),e.jsx("div",{className:"flex shrink-0 items-center gap-2",children:t.type==="boolean"?e.jsx(te,{id:`${m}-input`,checked:!!t.value,disabled:b||r,onCheckedChange:a=>p(String(a)),"aria-label":t.label}):e.jsxs(e.Fragment,{children:[e.jsx("input",{id:`${m}-input`,type:t.type==="number"?"number":"text",defaultValue:String(t.value??""),min:t.min,max:t.max,disabled:b,onChange:a=>o(a.target.value),className:`${ue} ${t.type==="number"?"w-24":"w-56"}`}),t.unit&&e.jsx("span",{className:"text-xs text-muted-foreground",children:t.unit})]})})]}),u&&e.jsxs("p",{className:"mt-1 text-xs text-danger",children:["Error: ",u]})]})}function fe(){const[t,m]=n.useState(null),[s,g]=n.useState(null),[i,u]=n.useState(!1),[x,r]=n.useState(null),c=n.useCallback(()=>{J().then(m).catch(o=>g(o instanceof Error?o.message:String(o)))},[]);n.useEffect(()=>{c()},[c]);const p=n.useCallback(async(o,b)=>{u(!0);try{const a=await K({key:o,value:b});return r(a.restartRequired?"Saved — restart pi to apply changes.":"Saved."),c(),null}catch(a){return a instanceof Error?a.message:String(a)}finally{u(!1)}},[c]);return e.jsxs("div",{className:"flex flex-col gap-3",children:[s&&e.jsxs("p",{className:"text-sm text-danger",children:["Error: ",s]}),!t&&!s&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading settings..."}),t?.categories.map(o=>e.jsx(me,{title:o.name,children:o.settings.map(b=>e.jsx(ge,{setting:b,id:`${o.name.replace(/[^a-z0-9]+/gi,"-")}-${b.key}`,llmActive:t.llmActive,saving:i,onUpdate:p},b.key))},o.name)),x&&e.jsx("div",{className:"mt-1 rounded-md border border-warning/40 bg-warning/10 p-2 text-xs text-warning",role:"status",children:x})]})}const l={container:{padding:"1rem",maxWidth:"720px",margin:"0 auto",fontFamily:"system-ui, sans-serif",color:"#e0e0e0"},section:{background:"#1a1a2e",borderRadius:"8px",padding:"1rem",marginBottom:"1rem",border:"1px solid #2a2a4e"},sectionTitle:{fontSize:"1.1rem",fontWeight:700,marginTop:0,marginBottom:"0.75rem",color:"#e0e0e0",borderBottom:"1px solid #333",paddingBottom:"0.5rem"},label:{fontWeight:600,color:"#a0a0c0",marginRight:"0.5rem"},value:{color:"#e0e0e0"},row:{marginBottom:"0.4rem",fontSize:"0.9rem"},warning:{background:"#3a2a00",border:"1px solid #665500",borderRadius:"8px",padding:"0.75rem",marginTop:"0.5rem",color:"#ffcc00",fontSize:"0.85rem"},badge:{display:"inline-block",padding:"0.15rem 0.5rem",borderRadius:"4px",fontSize:"0.8rem",fontWeight:600,marginLeft:"0.5rem"},detectRow:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"0.5rem 0",borderBottom:"1px solid #2a2a4e"},button:{background:"#3a5a9f",color:"#fff",border:"none",borderRadius:"6px",padding:"0.5rem 1rem",cursor:"pointer",fontSize:"0.9rem",fontWeight:600}};function xe(){const[t,m]=n.useState(null),[s,g]=n.useState(null),[i,u]=n.useState(null),[x,r]=n.useState(null),[c,p]=n.useState(!1),[o,b]=n.useState(null),[a,f]=n.useState(null),[w,j]=n.useState(null),[E,L]=n.useState(""),S=n.useCallback(()=>{Q().then(m).catch(d=>u(d instanceof Error?d.message:String(d)))},[]),k=n.useCallback((d,y)=>{b(d),j(null),f(null),Z({embedder:d,url:y}).then(N=>{f(N),b(null),S()}).catch(N=>{j(N instanceof Error?N.message:String(N)),b(null)})},[S]),I=n.useCallback(()=>{p(!0),r(null),ee().then(d=>{g(d),p(!1)}).catch(d=>{r(d instanceof Error?d.message:String(d)),p(!1)})},[]);n.useEffect(()=>{S()},[S]),n.useEffect(()=>{const d=setInterval(S,3e4);return()=>clearInterval(d)},[S]);const M=d=>{switch(d){case"trigram":return"TrigramEmbedder (heuristic, default)";case"http":return"HTTP Embedder (BYO localhost)";case"minilm":return"MiniLM (experimental)";default:return"Unknown"}},h=t?.currentEmbedder==="trigram"&&e.jsxs("div",{style:l.warning,children:[e.jsx("strong",{children:"Note:"})," TrigramEmbedder is a heuristic-strength default embedder. It works without any setup but recall quality may be lower than a dedicated embedding backend. If you notice poor recall results, consider installing Ollama and running the"," ",e.jsx("code",{children:"/megasetup"})," command, or set"," ",e.jsx("code",{children:"MEGACOMPACT_EMBEDDING_URL"})," to point at your own localhost embedding server."]}),v=d=>{const y=d?"#1a5a1a":"#3a1a1a",N=d?"#4caf50":"#f44336";return e.jsx("span",{style:{...l.badge,background:y,color:N},children:d?"Detected":"Not found"})};return e.jsxs("div",{style:l.container,children:[e.jsx("h2",{style:{fontSize:"1.3rem",marginTop:0,marginBottom:"1rem"},children:"Embedder Setup"}),e.jsx(de,{}),e.jsxs("div",{style:l.section,children:[e.jsx("h3",{style:l.sectionTitle,children:"Current Embedder Configuration"}),i&&e.jsxs("p",{style:{color:"#f44336",fontSize:"0.85rem"},children:["Error: ",i]}),t&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:l.row,children:[e.jsx("span",{style:l.label,children:"Active Embedder:"}),e.jsx("span",{style:l.value,children:M(t.currentEmbedder)})]}),"configuredEmbedder"in t&&t.configuredEmbedder!==t.currentEmbedder&&e.jsxs("div",{style:l.warning,children:[e.jsx("strong",{children:"Configured but not active:"})," ",M(t.configuredEmbedder)," is configured in .mega-compact.env but not yet loaded."," ",e.jsx("strong",{children:"Restart pi"})," to activate it.",t.configuredUrl&&e.jsxs(e.Fragment,{children:[" (",t.configuredUrl,")"]})]}),"restartRequired"in t&&t.restartRequired&&e.jsxs("div",{style:{...l.row,color:"#ff9800"},children:[e.jsx("span",{style:l.label,children:"Status:"}),e.jsx("span",{style:l.value,children:"Restart required to activate the configured embedder"})]}),e.jsxs("div",{style:l.row,children:[e.jsx("span",{style:l.label,children:"Embedding URL:"}),e.jsx("span",{style:l.value,children:t.embeddingUrl??e.jsx("span",{style:{color:"#888"},children:"not set"})})]}),e.jsxs("div",{style:l.row,children:[e.jsx("span",{style:l.label,children:"Embed Cache:"}),e.jsx("span",{style:l.value,children:t.embedCache??e.jsx("span",{style:{color:"#888"},children:"not set"})})]}),e.jsxs("div",{style:l.row,children:[e.jsx("span",{style:l.label,children:"MiniLM:"}),e.jsx("span",{style:l.value,children:t.minilm?"enabled":"disabled"})]}),h]}),!t&&!i&&e.jsx("p",{style:{color:"#888",fontSize:"0.85rem"},children:"Loading configuration..."})]}),e.jsxs("div",{style:l.section,children:[e.jsx("h3",{style:l.sectionTitle,children:"Local Embedder Detection"}),e.jsx("p",{style:{fontSize:"0.85rem",color:"#a0a0c0",marginTop:0},children:"Detect which local embedding backends are available on this machine. No software is installed — detection only."}),s&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:l.detectRow,children:[e.jsx("span",{children:e.jsx("strong",{children:"Ollama"})}),s.ollama!==null?e.jsxs("span",{children:[v(s.ollama.installed),s.ollama.installed&&e.jsx("span",{style:{fontSize:"0.8rem",color:"#a0a0c0",marginLeft:"0.5rem"},children:s.ollama.running?`server running, ${s.ollama.models.length} model(s)`:"server not running"})]}):e.jsx("span",{style:{color:"#888",fontSize:"0.85rem"},children:"not checked"})]}),e.jsxs("div",{style:l.detectRow,children:[e.jsx("span",{children:e.jsx("strong",{children:"llama.cpp"})}),s.llamaCpp!==null?e.jsxs("span",{children:[v(s.llamaCpp.installed),s.llamaCpp.installed&&s.llamaCpp.detail&&e.jsx("span",{style:{fontSize:"0.8rem",color:"#a0a0c0",marginLeft:"0.5rem"},children:s.llamaCpp.detail})]}):e.jsx("span",{style:{color:"#888",fontSize:"0.85rem"},children:"not checked"})]}),e.jsxs("div",{style:l.detectRow,children:[e.jsx("span",{children:e.jsx("strong",{children:"ONNX Runtime"})}),s.onnx!==null?e.jsxs("span",{children:[v(s.onnx.installed),s.onnx.installed&&s.onnx.detail&&e.jsx("span",{style:{fontSize:"0.8rem",color:"#a0a0c0",marginLeft:"0.5rem"},children:s.onnx.detail})]}):e.jsx("span",{style:{color:"#888",fontSize:"0.85rem"},children:"not checked"})]}),s.error&&e.jsxs("p",{style:{color:"#f44336",fontSize:"0.8rem",marginTop:"0.5rem"},children:["Detection error: ",s.error]})]}),x&&e.jsxs("p",{style:{color:"#f44336",fontSize:"0.85rem"},children:["Error: ",x]}),e.jsxs("div",{style:{marginTop:"1rem"},children:[e.jsx("button",{style:l.button,onClick:I,disabled:c,children:c?"Detecting...":"Run Detection"}),e.jsxs("span",{style:{fontSize:"0.8rem",color:"#888",marginLeft:"0.75rem"},children:["Or run ",e.jsx("code",{children:"/megasetup"})," in the chat for an interactive wizard."]})]}),s&&e.jsxs("div",{style:{marginTop:"1rem",paddingTop:"0.75rem",borderTop:"1px solid #2a2a4e"},children:[e.jsx("div",{style:{fontSize:"0.9rem",fontWeight:600,marginBottom:"0.5rem"},children:"Configure"}),e.jsxs("div",{style:{display:"flex",gap:"0.5rem",flexWrap:"wrap"},children:[e.jsx("button",{style:{...l.button,opacity:s.ollama?.installed?1:.4},onClick:()=>k("ollama"),disabled:!s.ollama?.installed||o!==null,children:o==="ollama"?"Writing...":"Use Ollama"}),e.jsx("button",{style:{...l.button,opacity:s.llamaCpp?.installed?1:.4},onClick:()=>k("llama"),disabled:!s.llamaCpp?.installed||o!==null,children:o==="llama"?"Writing...":"Use llama.cpp"}),e.jsx("button",{style:{...l.button,background:"#444"},onClick:()=>k("trigram"),disabled:o!==null,children:o==="trigram"?"Writing...":"Use Trigram (default)"})]}),a&&e.jsx("div",{style:l.warning,children:a.alreadyActive?"Already active — no restart needed.":`Configured ${a.embedder}. Restart pi to activate (config written to ${a.envPath}).`}),w&&e.jsxs("p",{style:{color:"#f44336",fontSize:"0.85rem",marginTop:"0.5rem"},children:["Configure error: ",w]})]})]}),e.jsxs("div",{style:l.section,children:[e.jsx("h3",{style:l.sectionTitle,children:"Custom Endpoint (remote / third-party)"}),e.jsxs("p",{style:{fontSize:"0.85rem",color:"#a0a0c0",marginTop:0},children:["Point at any OpenAI-compatible embeddings API or hosted endpoint. This opts in to a non-loopback connection (sets"," ",e.jsx("code",{children:"MEGACOMPACT_ALLOW_REMOTE_EMBEDDER=1"}),") — your prompts' embedding requests will be sent to the URL you enter. Default is loopback-only."]}),e.jsxs("div",{style:{display:"flex",gap:"0.5rem",flexWrap:"wrap",alignItems:"center"},children:[e.jsx("input",{type:"url",placeholder:"https://api.example.com/v1/embeddings",value:E,onChange:d=>L(d.target.value),style:{flex:"1 1 300px",background:"#12122a",color:"#e0e0e0",border:"1px solid #2a2a4e",borderRadius:"6px",padding:"0.4rem 0.6rem",fontSize:"0.85rem",fontFamily:"monospace"}}),e.jsx("button",{style:{...l.button,opacity:E?1:.4},onClick:()=>k("custom",E),disabled:!E||o!==null,children:o==="custom"?"Writing...":"Use Custom URL"})]}),e.jsxs("div",{style:l.warning,children:[e.jsx("strong",{children:"Heads up:"})," a remote endpoint receives the text you embed (it does NOT receive your full conversation — only the strings passed to",e.jsx("code",{children:" embed()"})," for recall/dedup). Verify the endpoint's privacy policy before use."]})]}),e.jsxs("div",{style:l.section,children:[e.jsx("h3",{style:l.sectionTitle,children:"How to Upgrade"}),e.jsxs("ul",{style:{fontSize:"0.85rem",lineHeight:1.6,paddingLeft:"1.25rem"},children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Ollama:"})," Install from"," ",e.jsx("a",{href:"https://ollama.com",style:{color:"#6a9fff"},target:"_blank",rel:"noopener noreferrer",children:"ollama.com"}),", then ",e.jsx("code",{children:"ollama pull nomic-embed-text"})," and restart pi. Set ",e.jsx("code",{children:"MEGACOMPACT_EMBEDDING_URL=http://localhost:11434/api/embeddings"}),"."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"llama.cpp:"})," Build or install llama.cpp, run"," ",e.jsx("code",{children:"llama-server"})," with an embedding model, and set the URL accordingly."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"ONNX Runtime:"})," Install"," ",e.jsx("code",{children:"onnxruntime-node"})," in the project root. Not yet integrated — see docs for manual setup."]})]})]}),e.jsxs("div",{style:l.section,children:[e.jsx("h3",{style:l.sectionTitle,children:"Settings"}),e.jsx(fe,{})]})]})}const pe=[{id:"embedder",label:"Embedder"},{id:"config",label:"Config"},{id:"game",label:"Game Mode"},{id:"achievements",label:"Achievements"}];function ye(){const[t,m]=n.useState("embedder");return e.jsxs("div",{className:"mx-auto flex max-w-3xl flex-col gap-4 p-4",children:[e.jsx("nav",{className:"flex gap-2 border-b border-border pb-2","aria-label":"Setup sections",children:pe.map(s=>e.jsx(se,{pressed:t===s.id,onClick:()=>m(s.id),children:s.label},s.id))}),t==="embedder"&&e.jsx(xe,{}),t==="config"&&e.jsx(ce,{}),t==="game"&&e.jsx(re,{}),t==="achievements"&&e.jsx(le,{})]})}export{ye as default};
|
|
2
|
-
//# sourceMappingURL=SetupTab-
|
|
1
|
+
import{r as n,j as e,h as R,i as $,k as G,p as H,l as q,m as V,C as X,n as Y,o as J,q as K,s as Q,t as Z,v as ee}from"./index-CRHmWnRi.js";import{S as te}from"./switch-jrYrJJYy.js";import{T as se}from"./toggle-DT1AN5wS.js";function ne(t){try{return new Date(t*1e3).toLocaleString()}catch{return"—"}}function P({achievements:t}){const m=n.useRef(0),[s,g]=n.useState(null),i=t.reduce((r,c)=>Math.max(r,c.unlocked_at??0),0),u=m.current;n.useEffect(()=>{i>m.current&&(m.current=i)},[i]),n.useEffect(()=>{if(u>0&&i>u){const r=t.filter(c=>c.unlocked_at!=null&&(c.unlocked_at??0)>u);if(r.length>0){const c=r.map(o=>`${o.icon??""} ${o.title}`.trim()).join(", ")+" unlocked!";g(c);const p=setTimeout(()=>g(null),4e3);return()=>clearTimeout(p)}}},[t,i,u]);const x=t.filter(r=>!(r.hidden===1&&r.unlocked_at==null));return e.jsxs("div",{className:"ach-section",children:[s!=null&&e.jsx("div",{className:"ach-toast show",children:s}),e.jsxs("div",{className:"ach-tiles",children:[x.length===0&&e.jsx("span",{className:"repo-none",children:"no achievements yet"}),x.map(r=>{if(r.unlocked_at!=null){const c=u>0&&(r.unlocked_at??0)>u;return e.jsxs("div",{className:`ach-tile unlocked${c?" just-unlocked":""}`,children:[r.icon??""," ",r.title,e.jsxs("span",{className:"ach-detail",children:["unlocked ",ne(r.unlocked_at)]})]},r.id)}return e.jsxs("div",{className:"ach-tile locked",children:["??? ",r.title]},r.id)})]})]})}function A(t){return(Math.round(t*10)/10).toString()+"%"}function D(t){return t!=null?new Date(t).toLocaleString():"—"}function U(t){return t&&typeof t=="object"?t:{}}function ae(t){return t.split("/").pop()||t}function z({title:t,rows:m,badge:s,renderValue:g}){return e.jsxs("div",{className:"lb-card",children:[e.jsxs("h3",{children:[t,s]}),m.length===0?e.jsx("div",{className:"lb-empty",children:"—"}):e.jsx("table",{children:e.jsx("tbody",{children:m.map((i,u)=>e.jsxs("tr",{children:[e.jsx("td",{title:i.repo_root,children:ae(i.repo_root)}),e.jsx("td",{className:"num",children:g(i)})]},`${i.repo_root}-${u}`))})})]})}function re(){const[t,m]=n.useState({}),[s,g]=n.useState(0),[i,u]=n.useState([]),[x,r]=n.useState(!1),[c,p]=n.useState(!0),[o,b]=n.useState(null),a=n.useRef(0),f=n.useCallback(async()=>{try{const[h,v,d,y,N,F]=await Promise.all([R({metric:"cache",limit:25}),R({metric:"dedupe",limit:25}),R({metric:"turns",limit:25}),R({metric:"mega_cache",limit:25}),R({metric:"repos",limit:1}),$()]),B=y.find(_=>_.ts>a.current&&_.value>100);a.current>0&&B&&(b(`oopsie! cache went to ${Math.round(B.value)}% — MEGA CACHE 🥧`),setTimeout(()=>b(null),4e3)),y.length>0&&(a.current=Math.max(...y.map(_=>_.ts))),m({cache:h,dedupe:v,turns:d,mega_cache:y}),g(N[0]?.value??0),u(F)}catch{}finally{p(!1)}},[]);n.useEffect(()=>{let h=!0;const v=async()=>{h&&await f()};v();const d=setInterval(()=>void v(),15e3);return()=>{h=!1,clearInterval(d)}},[f]),n.useEffect(()=>{let h=!0;const v=async()=>{try{const y=await G();h&&(r(!!y.game_mode_on),y.theme&&(document.documentElement.dataset.theme=y.theme))}catch{}};v();const d=setInterval(()=>void v(),15e3);return()=>{h=!1,clearInterval(d)}},[]);const w=t.mega_cache??[];let j=null,E=null;for(const h of w){(j==null||h.value>j)&&(j=h.value);const v=U(h.meta),d=v.firstSeenTs??v.firstSeen??h.ts;(E==null||d<E)&&(E=d)}const L=j!=null&&j>100,S=t.turns??[],k=S.reduce((h,v)=>Math.max(h,v.value),0),I=Math.floor(Math.log2(k+1))+1,M=(t.cache?.length??0)>0||(t.dedupe?.length??0)>0||S.length>0||w.length>0||s>0;return e.jsxs("div",{className:`game-tab${x?" game-mode-on":""}`,children:[o!=null&&e.jsx("div",{className:"mega-cache-toast show",children:o}),L&&e.jsxs("div",{className:"mega-cache-banner",children:["🥧"," MEGA CACHE! peak ",A(j)," — first reached ",D(E)]}),L&&e.jsxs("div",{className:"achievement-tile unlocked",children:["🏆"," Opie's Wild Ride",e.jsxs("span",{className:"ach-detail",children:["best ",A(j)," · first ",D(E)]})]}),e.jsx("h2",{children:"High Scores"}),!M&&!c&&e.jsx("div",{className:"game-empty",children:"No scores yet — run a session with game mode on."}),M&&e.jsxs("div",{className:"game-leaderboards",children:[e.jsx(z,{title:"Cache %",rows:t.cache??[],renderValue:h=>A(h.value)}),e.jsx(z,{title:"Dedupe (collapsed)",rows:t.dedupe??[],renderValue:h=>h.value.toLocaleString()}),e.jsx(z,{title:"Turns",rows:S,badge:S.length>0?e.jsxs("span",{className:"lvl-badge",children:["LVL ",I]}):void 0,renderValue:h=>h.value.toLocaleString()}),e.jsx(z,{title:"MEGA CACHE trophies",rows:w,renderValue:h=>e.jsxs(e.Fragment,{children:[A(h.value),e.jsx("span",{className:"lb-meta",children:D(U(h.meta).firstSeenTs??U(h.meta).firstSeen??h.ts)})]})})]}),s>0&&e.jsx("div",{className:"repos-badge-line",children:e.jsxs("span",{className:"repos-badge",children:[s," repos"]})}),e.jsx("h3",{children:"Achievements"}),e.jsx(P,{achievements:i})]})}function le(){const[t,m]=n.useState([]),[s,g]=n.useState(!0),[i,u]=n.useState(null),x=n.useCallback(async()=>{try{const r=await $();m(r),u(null)}catch(r){u(r instanceof Error?r:new Error(String(r)))}finally{g(!1)}},[]);return n.useEffect(()=>{let r=!0;const c=async()=>{r&&await x()};c();const p=setInterval(()=>void c(),15e3);return()=>{r=!1,clearInterval(p)}},[x]),s&&t.length===0?e.jsx("div",{className:"tab-stub",children:"Loading achievements…"}):i&&t.length===0?e.jsxs("div",{className:"tab-stub",children:["Error: ",i.message]}):e.jsxs("div",{className:"achievements-tab",children:[e.jsx("h2",{children:"Achievements"}),e.jsx(P,{achievements:t})]})}const W=[{id:"transparent",label:"Transparent (accents only)",css:{bg:null,fg:"#c9d1d9",accent:"#3fb950",mega:"#f0883e"},ansi:{bg:null,fg:"39",accent:"32",mega:"33"}},{id:"retro",label:"Retro 8-bit green",css:{bg:"#003300",fg:"#33ff33",accent:"#00ff41",mega:"#39ff14"},ansi:{bg:"40",fg:"92",accent:"92",mega:"1;92"}},{id:"orange-bold",label:"Orange bold",css:{bg:"#1a0f00",fg:"#ff8c00",accent:"#ff6b00",mega:"#ff4500"},ansi:{bg:"48;5;52",fg:"38;5;208",accent:"38;5;208",mega:"1;38;5;202"}},{id:"cyan-neon",label:"Cyan neon",css:{bg:"#001a1a",fg:"#00ffff",accent:"#22d3ee",mega:"#7df9ff"},ansi:{bg:"48;5;23",fg:"38;5;51",accent:"38;5;51",mega:"1;38;5;51"}},{id:"amber-mono",label:"Amber phosphor",css:{bg:"#1a1200",fg:"#ffb000",accent:"#ff8c00",mega:"#ff5500"},ansi:{bg:"48;5;58",fg:"38;5;214",accent:"38;5;214",mega:"1;38;5;208"}},{id:"grayscale",label:"Grayscale minimal",css:{bg:"#161616",fg:"#b0b0b0",accent:"#8b949e",mega:"#e6edf3"},ansi:{bg:"48;5;235",fg:"38;5;249",accent:"38;5;249",mega:"1;38;5;255"}}],O=W.map(t=>t.id),T={gameMode:"Turn game mode on/off (themes the widget + dashboard)",theme:"Visual theme (applies instantly)",tuiMode:"TUI widget display density",tier:"Live pressure band — climbs low→mega as context fills the window.",preset:"The env-resolved base compaction preset (low/medium/high/ultra/mega) that set the token threshold.",pressure:"Live pressure = currentTokens / threshold — % of the model context window (threshold fires at the tier's % of window).",threshold:"Compaction threshold = tierPct × model context window — mega-compact trims BELOW pi's native ~80% auto-compact for any model size.",fastGate:"Fast-gate arming floor — the live trim arms once context passes this % of the window."};function ie(t,m,s){let g=t.toLocaleString();return m!=null&&s>0&&(g+=` (${Math.round(m*100)}% of ${s.toLocaleString()})`),g}function oe(t){return`${Math.round((t||0)*100)}%`}function ce(){const[t,m]=n.useState(null),[s,g]=n.useState(null),[i,u]=n.useState(!1);n.useEffect(()=>{let a=!0;const f=async()=>{try{const j=await q();a&&m(j)}catch{}};f();const w=setInterval(()=>void f(),5e3);return()=>{a=!1,clearInterval(w)}},[]),n.useEffect(()=>{let a=!0;const f=async()=>{try{const j=await G();a&&(g(j),j.theme&&(document.documentElement.dataset.theme=j.theme))}catch{}};f();const w=setInterval(()=>void f(),5e3);return()=>{a=!1,clearInterval(w)}},[]);const x=n.useCallback(async a=>{u(!0);try{const f=await H(a);g(f),f.theme&&(document.documentElement.dataset.theme=f.theme)}catch{}u(!1)},[]),r=s?.game_mode_on??!1,c=s?.theme??"transparent",p=s?.tui_display_mode??"full",o=t?.config,b=t?.context.contextWindow??0;return e.jsxs("div",{className:"config-tab",children:[e.jsxs("section",{className:"config-settings",children:[e.jsx("h3",{children:"Settings"}),e.jsx("div",{className:"settings-row",children:e.jsxs("label",{title:T.gameMode,children:[e.jsx("input",{type:"checkbox",checked:r,onChange:a=>x({game_mode_on:a.currentTarget.checked}),disabled:i}),"Game Mode"]})}),e.jsx("div",{className:"settings-row",children:e.jsxs("label",{title:T.theme,children:["Theme",e.jsx("select",{value:c,onChange:a=>x({theme:a.currentTarget.value}),disabled:i,children:W.map(a=>e.jsx("option",{value:a.id,children:a.label},a.id))}),e.jsx("button",{type:"button",disabled:i,className:"theme-cycle-btn",title:"Cycle to the next theme (P3)",onClick:()=>{const a=O.indexOf(c),f=O[(a<0?0:a+1)%O.length];f&&x({theme:f})},children:"Next theme →"})]})}),e.jsx("div",{className:"settings-row",children:e.jsxs("label",{title:T.tuiMode,children:["TUI Mode",e.jsxs("select",{value:p,onChange:a=>x({tui_display_mode:a.currentTarget.value}),disabled:i,children:[e.jsx("option",{value:"full",children:"Full"}),e.jsx("option",{value:"minimal",children:"Minimal"})]})," ",e.jsx("span",{className:"tui-mode-hint",children:"(affects the in-app TUI widget; not shown here)"})]})})]}),e.jsxs("section",{className:"config-display",children:[e.jsx("h3",{children:"Configuration"}),e.jsxs("div",{className:"config-grid",children:[e.jsxs("div",{className:"config-item",children:[e.jsx("span",{className:"config-label",title:T.tier,children:"Tier"}),e.jsx("span",{className:"config-value",children:t?`${t.tier} (live)`:"—"})]}),e.jsxs("div",{className:"config-item",children:[e.jsx("span",{className:"config-label",title:T.preset,children:"Preset"}),e.jsx("span",{className:"config-value",children:t?.presetTier??"—"})]}),e.jsxs("div",{className:"config-item",children:[e.jsx("span",{className:"config-label",title:T.pressure,children:"Pressure"}),e.jsx("span",{className:"config-value",children:t?oe(t.pressure):"—"})]}),e.jsxs("div",{className:"config-item",children:[e.jsx("span",{className:"config-label",title:T.threshold,children:"Threshold"}),e.jsx("span",{className:"config-value",children:o?ie(o.thresholdTokens,o.tierPct,b):"—"})]}),e.jsxs("div",{className:"config-item",children:[e.jsx("span",{className:"config-label",title:T.fastGate,children:"Fast Gate"}),e.jsx("span",{className:"config-value",children:o?`${o.fastGatePct}%`:"—"})]}),e.jsxs("div",{className:"config-item",children:[e.jsx("span",{className:"config-label",children:"Auto"}),e.jsx("span",{className:"config-value",children:o?o.auto?"enabled":"disabled":"—"})]}),e.jsxs("div",{className:"config-item",children:[e.jsx("span",{className:"config-label",children:"Anchor"}),e.jsx("span",{className:"config-value",children:o?.anchorUserMessages??"—"})]})]})]})]})}const C={section:{background:"#1a1a2e",borderRadius:"8px",padding:"1rem",marginBottom:"1rem",border:"1px solid #2a2a4e"},sectionTitle:{fontSize:"1.1rem",fontWeight:700,marginTop:0,marginBottom:"0.75rem",color:"#e0e0e0",borderBottom:"1px solid #333",paddingBottom:"0.5rem"},label:{fontWeight:600,color:"#a0a0c0",marginRight:"0.5rem"},value:{color:"#e0e0e0"},row:{marginBottom:"0.4rem",fontSize:"0.9rem"}};function de(){const[t,m]=n.useState(null),[s,g]=n.useState(null),i=n.useCallback(()=>{V().then(m).catch(p=>g(p instanceof Error?p.message:String(p)))},[]);n.useEffect(()=>{i()},[i]),n.useEffect(()=>{const p=setInterval(i,3e4);return()=>clearInterval(p)},[i]);const u=t?.status==="ok",x=t?.status==="ok"?"Working":t?.status==="unreachable"?"Unreachable":"Error",r=u?"#4caf50":"#f44336",c=u?"✓":"✗";return e.jsxs("div",{style:C.section,children:[e.jsx("h3",{style:C.sectionTitle,children:"Embedder Health"}),s&&e.jsxs("p",{style:{color:"#f44336",fontSize:"0.85rem"},children:["Error: ",s]}),!t&&!s&&e.jsx("p",{style:{color:"#888",fontSize:"0.85rem"},children:"Probing embedder..."}),t&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:C.row,children:[e.jsxs("span",{style:{...C.label,color:`${r}`},children:[c," ",x,":"]}),e.jsxs("span",{style:C.value,children:[t.dim," dims"]}),t.latencyMs!==void 0&&e.jsxs("span",{style:{color:"#a0a0c0",marginLeft:"0.5rem"},children:["(",t.latencyMs.toFixed(1)," ms)"]})]}),e.jsxs("div",{style:C.row,children:[e.jsx("span",{style:C.label,children:"Endpoint:"}),e.jsx("span",{style:C.value,children:t.url??e.jsx("span",{style:{color:"#888"},children:"built-in (no URL)"})})]}),t.error&&e.jsx("p",{style:{color:"#f44336",fontSize:"0.85rem"},children:t.error})]})]})}function me({title:t,children:m}){const[s,g]=n.useState(!0),i=`settings-${t.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return e.jsxs("section",{className:"overflow-hidden rounded-xl border border-border bg-bg-elevated/40",children:[e.jsxs("button",{type:"button",onClick:()=>g(u=>!u),className:"flex w-full items-center justify-between rounded-t-xl bg-bg-elevated/60 px-4 py-3 text-left text-sm font-semibold text-foreground transition-colors hover:bg-bg-elevated","aria-expanded":s,"aria-controls":i,children:[e.jsx("span",{children:t}),e.jsx(X,{className:Y("h-4 w-4 text-muted-foreground transition-transform",s&&"rotate-180"),"aria-hidden":"true"})]}),s&&e.jsx("div",{id:i,className:"divide-y divide-border px-4 py-1",children:m})]})}const ue="rounded-md border border-border bg-bg-elevated/50 px-2 py-1 text-sm outline-none transition-colors focus:border-primary disabled:cursor-not-allowed disabled:opacity-50";function he(){return e.jsx("span",{className:"ml-2 inline-flex items-center rounded-md border border-warning/40 bg-warning/15 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-warning",title:"Requires an LLM embedder (Ollama/HTTP) to be effective",children:"LLM"})}function ge({setting:t,id:m,llmActive:s,saving:g,onUpdate:i}){const[u,x]=n.useState(null),r=t.requiresLlm&&!s,c=n.useRef(null);n.useEffect(()=>()=>{c.current&&clearTimeout(c.current)},[]);const p=n.useCallback(a=>{i(t.key,a).then(f=>x(f)).catch(f=>x(f instanceof Error?f.message:String(f)))},[i,t.key]),o=n.useCallback(a=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>p(a),500)},[p]),b=g||r;return e.jsxs("div",{className:"py-2.5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center text-sm font-semibold text-foreground",children:[e.jsx("label",{htmlFor:`${m}-input`,className:"cursor-pointer",children:t.label}),t.requiresLlm&&!s&&e.jsx(he,{})]}),e.jsx("div",{className:"mt-0.5 text-xs text-muted-foreground",children:t.description})]}),e.jsx("div",{className:"flex shrink-0 items-center gap-2",children:t.type==="boolean"?e.jsx(te,{id:`${m}-input`,checked:!!t.value,disabled:b||r,onCheckedChange:a=>p(String(a)),"aria-label":t.label}):e.jsxs(e.Fragment,{children:[e.jsx("input",{id:`${m}-input`,type:t.type==="number"?"number":"text",defaultValue:String(t.value??""),min:t.min,max:t.max,disabled:b,onChange:a=>o(a.target.value),className:`${ue} ${t.type==="number"?"w-24":"w-56"}`}),t.unit&&e.jsx("span",{className:"text-xs text-muted-foreground",children:t.unit})]})})]}),u&&e.jsxs("p",{className:"mt-1 text-xs text-danger",children:["Error: ",u]})]})}function fe(){const[t,m]=n.useState(null),[s,g]=n.useState(null),[i,u]=n.useState(!1),[x,r]=n.useState(null),c=n.useCallback(()=>{J().then(m).catch(o=>g(o instanceof Error?o.message:String(o)))},[]);n.useEffect(()=>{c()},[c]);const p=n.useCallback(async(o,b)=>{u(!0);try{const a=await K({key:o,value:b});return r(a.restartRequired?"Saved — restart pi to apply changes.":"Saved."),c(),null}catch(a){return a instanceof Error?a.message:String(a)}finally{u(!1)}},[c]);return e.jsxs("div",{className:"flex flex-col gap-3",children:[s&&e.jsxs("p",{className:"text-sm text-danger",children:["Error: ",s]}),!t&&!s&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading settings..."}),t?.categories.map(o=>e.jsx(me,{title:o.name,children:o.settings.map(b=>e.jsx(ge,{setting:b,id:`${o.name.replace(/[^a-z0-9]+/gi,"-")}-${b.key}`,llmActive:t.llmActive,saving:i,onUpdate:p},b.key))},o.name)),x&&e.jsx("div",{className:"mt-1 rounded-md border border-warning/40 bg-warning/10 p-2 text-xs text-warning",role:"status",children:x})]})}const l={container:{padding:"1rem",maxWidth:"720px",margin:"0 auto",fontFamily:"system-ui, sans-serif",color:"#e0e0e0"},section:{background:"#1a1a2e",borderRadius:"8px",padding:"1rem",marginBottom:"1rem",border:"1px solid #2a2a4e"},sectionTitle:{fontSize:"1.1rem",fontWeight:700,marginTop:0,marginBottom:"0.75rem",color:"#e0e0e0",borderBottom:"1px solid #333",paddingBottom:"0.5rem"},label:{fontWeight:600,color:"#a0a0c0",marginRight:"0.5rem"},value:{color:"#e0e0e0"},row:{marginBottom:"0.4rem",fontSize:"0.9rem"},warning:{background:"#3a2a00",border:"1px solid #665500",borderRadius:"8px",padding:"0.75rem",marginTop:"0.5rem",color:"#ffcc00",fontSize:"0.85rem"},badge:{display:"inline-block",padding:"0.15rem 0.5rem",borderRadius:"4px",fontSize:"0.8rem",fontWeight:600,marginLeft:"0.5rem"},detectRow:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"0.5rem 0",borderBottom:"1px solid #2a2a4e"},button:{background:"#3a5a9f",color:"#fff",border:"none",borderRadius:"6px",padding:"0.5rem 1rem",cursor:"pointer",fontSize:"0.9rem",fontWeight:600}};function xe(){const[t,m]=n.useState(null),[s,g]=n.useState(null),[i,u]=n.useState(null),[x,r]=n.useState(null),[c,p]=n.useState(!1),[o,b]=n.useState(null),[a,f]=n.useState(null),[w,j]=n.useState(null),[E,L]=n.useState(""),S=n.useCallback(()=>{Q().then(m).catch(d=>u(d instanceof Error?d.message:String(d)))},[]),k=n.useCallback((d,y)=>{b(d),j(null),f(null),Z({embedder:d,url:y}).then(N=>{f(N),b(null),S()}).catch(N=>{j(N instanceof Error?N.message:String(N)),b(null)})},[S]),I=n.useCallback(()=>{p(!0),r(null),ee().then(d=>{g(d),p(!1)}).catch(d=>{r(d instanceof Error?d.message:String(d)),p(!1)})},[]);n.useEffect(()=>{S()},[S]),n.useEffect(()=>{const d=setInterval(S,3e4);return()=>clearInterval(d)},[S]);const M=d=>{switch(d){case"trigram":return"TrigramEmbedder (heuristic, default)";case"http":return"HTTP Embedder (BYO localhost)";case"minilm":return"MiniLM (experimental)";default:return"Unknown"}},h=t?.currentEmbedder==="trigram"&&e.jsxs("div",{style:l.warning,children:[e.jsx("strong",{children:"Note:"})," TrigramEmbedder is a heuristic-strength default embedder. It works without any setup but recall quality may be lower than a dedicated embedding backend. If you notice poor recall results, consider installing Ollama and running the"," ",e.jsx("code",{children:"/megasetup"})," command, or set"," ",e.jsx("code",{children:"MEGACOMPACT_EMBEDDING_URL"})," to point at your own localhost embedding server."]}),v=d=>{const y=d?"#1a5a1a":"#3a1a1a",N=d?"#4caf50":"#f44336";return e.jsx("span",{style:{...l.badge,background:y,color:N},children:d?"Detected":"Not found"})};return e.jsxs("div",{style:l.container,children:[e.jsx("h2",{style:{fontSize:"1.3rem",marginTop:0,marginBottom:"1rem"},children:"Embedder Setup"}),e.jsx(de,{}),e.jsxs("div",{style:l.section,children:[e.jsx("h3",{style:l.sectionTitle,children:"Current Embedder Configuration"}),i&&e.jsxs("p",{style:{color:"#f44336",fontSize:"0.85rem"},children:["Error: ",i]}),t&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:l.row,children:[e.jsx("span",{style:l.label,children:"Active Embedder:"}),e.jsx("span",{style:l.value,children:M(t.currentEmbedder)})]}),"configuredEmbedder"in t&&t.configuredEmbedder!==t.currentEmbedder&&e.jsxs("div",{style:l.warning,children:[e.jsx("strong",{children:"Configured but not active:"})," ",M(t.configuredEmbedder)," is configured in .mega-compact.env but not yet loaded."," ",e.jsx("strong",{children:"Restart pi"})," to activate it.",t.configuredUrl&&e.jsxs(e.Fragment,{children:[" (",t.configuredUrl,")"]})]}),"restartRequired"in t&&t.restartRequired&&e.jsxs("div",{style:{...l.row,color:"#ff9800"},children:[e.jsx("span",{style:l.label,children:"Status:"}),e.jsx("span",{style:l.value,children:"Restart required to activate the configured embedder"})]}),e.jsxs("div",{style:l.row,children:[e.jsx("span",{style:l.label,children:"Embedding URL:"}),e.jsx("span",{style:l.value,children:t.embeddingUrl??e.jsx("span",{style:{color:"#888"},children:"not set"})})]}),e.jsxs("div",{style:l.row,children:[e.jsx("span",{style:l.label,children:"Embed Cache:"}),e.jsx("span",{style:l.value,children:t.embedCache??e.jsx("span",{style:{color:"#888"},children:"not set"})})]}),e.jsxs("div",{style:l.row,children:[e.jsx("span",{style:l.label,children:"MiniLM:"}),e.jsx("span",{style:l.value,children:t.minilm?"enabled":"disabled"})]}),h]}),!t&&!i&&e.jsx("p",{style:{color:"#888",fontSize:"0.85rem"},children:"Loading configuration..."})]}),e.jsxs("div",{style:l.section,children:[e.jsx("h3",{style:l.sectionTitle,children:"Local Embedder Detection"}),e.jsx("p",{style:{fontSize:"0.85rem",color:"#a0a0c0",marginTop:0},children:"Detect which local embedding backends are available on this machine. No software is installed — detection only."}),s&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:l.detectRow,children:[e.jsx("span",{children:e.jsx("strong",{children:"Ollama"})}),s.ollama!==null?e.jsxs("span",{children:[v(s.ollama.installed),s.ollama.installed&&e.jsx("span",{style:{fontSize:"0.8rem",color:"#a0a0c0",marginLeft:"0.5rem"},children:s.ollama.running?`server running, ${s.ollama.models.length} model(s)`:"server not running"})]}):e.jsx("span",{style:{color:"#888",fontSize:"0.85rem"},children:"not checked"})]}),e.jsxs("div",{style:l.detectRow,children:[e.jsx("span",{children:e.jsx("strong",{children:"llama.cpp"})}),s.llamaCpp!==null?e.jsxs("span",{children:[v(s.llamaCpp.installed),s.llamaCpp.installed&&s.llamaCpp.detail&&e.jsx("span",{style:{fontSize:"0.8rem",color:"#a0a0c0",marginLeft:"0.5rem"},children:s.llamaCpp.detail})]}):e.jsx("span",{style:{color:"#888",fontSize:"0.85rem"},children:"not checked"})]}),e.jsxs("div",{style:l.detectRow,children:[e.jsx("span",{children:e.jsx("strong",{children:"ONNX Runtime"})}),s.onnx!==null?e.jsxs("span",{children:[v(s.onnx.installed),s.onnx.installed&&s.onnx.detail&&e.jsx("span",{style:{fontSize:"0.8rem",color:"#a0a0c0",marginLeft:"0.5rem"},children:s.onnx.detail})]}):e.jsx("span",{style:{color:"#888",fontSize:"0.85rem"},children:"not checked"})]}),s.error&&e.jsxs("p",{style:{color:"#f44336",fontSize:"0.8rem",marginTop:"0.5rem"},children:["Detection error: ",s.error]})]}),x&&e.jsxs("p",{style:{color:"#f44336",fontSize:"0.85rem"},children:["Error: ",x]}),e.jsxs("div",{style:{marginTop:"1rem"},children:[e.jsx("button",{style:l.button,onClick:I,disabled:c,children:c?"Detecting...":"Run Detection"}),e.jsxs("span",{style:{fontSize:"0.8rem",color:"#888",marginLeft:"0.75rem"},children:["Or run ",e.jsx("code",{children:"/megasetup"})," in the chat for an interactive wizard."]})]}),s&&e.jsxs("div",{style:{marginTop:"1rem",paddingTop:"0.75rem",borderTop:"1px solid #2a2a4e"},children:[e.jsx("div",{style:{fontSize:"0.9rem",fontWeight:600,marginBottom:"0.5rem"},children:"Configure"}),e.jsxs("div",{style:{display:"flex",gap:"0.5rem",flexWrap:"wrap"},children:[e.jsx("button",{style:{...l.button,opacity:s.ollama?.installed?1:.4},onClick:()=>k("ollama"),disabled:!s.ollama?.installed||o!==null,children:o==="ollama"?"Writing...":"Use Ollama"}),e.jsx("button",{style:{...l.button,opacity:s.llamaCpp?.installed?1:.4},onClick:()=>k("llama"),disabled:!s.llamaCpp?.installed||o!==null,children:o==="llama"?"Writing...":"Use llama.cpp"}),e.jsx("button",{style:{...l.button,background:"#444"},onClick:()=>k("trigram"),disabled:o!==null,children:o==="trigram"?"Writing...":"Use Trigram (default)"})]}),a&&e.jsx("div",{style:l.warning,children:a.alreadyActive?"Already active — no restart needed.":`Configured ${a.embedder}. Restart pi to activate (config written to ${a.envPath}).`}),w&&e.jsxs("p",{style:{color:"#f44336",fontSize:"0.85rem",marginTop:"0.5rem"},children:["Configure error: ",w]})]})]}),e.jsxs("div",{style:l.section,children:[e.jsx("h3",{style:l.sectionTitle,children:"Custom Endpoint (remote / third-party)"}),e.jsxs("p",{style:{fontSize:"0.85rem",color:"#a0a0c0",marginTop:0},children:["Point at any OpenAI-compatible embeddings API or hosted endpoint. This opts in to a non-loopback connection (sets"," ",e.jsx("code",{children:"MEGACOMPACT_ALLOW_REMOTE_EMBEDDER=1"}),") — your prompts' embedding requests will be sent to the URL you enter. Default is loopback-only."]}),e.jsxs("div",{style:{display:"flex",gap:"0.5rem",flexWrap:"wrap",alignItems:"center"},children:[e.jsx("input",{type:"url",placeholder:"https://api.example.com/v1/embeddings",value:E,onChange:d=>L(d.target.value),style:{flex:"1 1 300px",background:"#12122a",color:"#e0e0e0",border:"1px solid #2a2a4e",borderRadius:"6px",padding:"0.4rem 0.6rem",fontSize:"0.85rem",fontFamily:"monospace"}}),e.jsx("button",{style:{...l.button,opacity:E?1:.4},onClick:()=>k("custom",E),disabled:!E||o!==null,children:o==="custom"?"Writing...":"Use Custom URL"})]}),e.jsxs("div",{style:l.warning,children:[e.jsx("strong",{children:"Heads up:"})," a remote endpoint receives the text you embed (it does NOT receive your full conversation — only the strings passed to",e.jsx("code",{children:" embed()"})," for recall/dedup). Verify the endpoint's privacy policy before use."]})]}),e.jsxs("div",{style:l.section,children:[e.jsx("h3",{style:l.sectionTitle,children:"How to Upgrade"}),e.jsxs("ul",{style:{fontSize:"0.85rem",lineHeight:1.6,paddingLeft:"1.25rem"},children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Ollama:"})," Install from"," ",e.jsx("a",{href:"https://ollama.com",style:{color:"#6a9fff"},target:"_blank",rel:"noopener noreferrer",children:"ollama.com"}),", then ",e.jsx("code",{children:"ollama pull nomic-embed-text"})," and restart pi. Set ",e.jsx("code",{children:"MEGACOMPACT_EMBEDDING_URL=http://localhost:11434/api/embeddings"}),"."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"llama.cpp:"})," Build or install llama.cpp, run"," ",e.jsx("code",{children:"llama-server"})," with an embedding model, and set the URL accordingly."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"ONNX Runtime:"})," Install"," ",e.jsx("code",{children:"onnxruntime-node"})," in the project root. Not yet integrated — see docs for manual setup."]})]})]}),e.jsxs("div",{style:l.section,children:[e.jsx("h3",{style:l.sectionTitle,children:"Settings"}),e.jsx(fe,{})]})]})}const pe=[{id:"embedder",label:"Embedder"},{id:"config",label:"Config"},{id:"game",label:"Game Mode"},{id:"achievements",label:"Achievements"}];function ye(){const[t,m]=n.useState("embedder");return e.jsxs("div",{className:"mx-auto flex max-w-3xl flex-col gap-4 p-4",children:[e.jsx("nav",{className:"flex gap-2 border-b border-border pb-2","aria-label":"Setup sections",children:pe.map(s=>e.jsx(se,{pressed:t===s.id,onClick:()=>m(s.id),children:s.label},s.id))}),t==="embedder"&&e.jsx(xe,{}),t==="config"&&e.jsx(ce,{}),t==="game"&&e.jsx(re,{}),t==="achievements"&&e.jsx(le,{})]})}export{ye as default};
|
|
2
|
+
//# sourceMappingURL=SetupTab-HUAG7xDf.js.map
|