herm-tui 1.3.0-dev.10 → 1.3.0-dev.12
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/index.js +5 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -3667,8 +3667,8 @@ Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error
|
|
|
3667
3667
|
`):frame;if(url.searchParams.get("json")==="1")return json({frame:body,match:grep?frame.includes(grep):void 0,lines:frame.split(`
|
|
3668
3668
|
`).length});return new Response(body,{headers:{"Content-Type":"text/plain; charset=utf-8"}})}if(path6==="/logs"){let n=Number(url.searchParams.get("n"))||200;return new Response(bridge.logs(n),{headers:{"Content-Type":"text/plain; charset=utf-8"}})}if(path6==="/perf"){let d2=data();if(!d2)return json({error:"PERF not enabled"},400);return json(d2)}if(path6==="/tabs"){let ms=Number(url.searchParams.get("delay")||"500");for(let i=0;i<=TAB_MAX;i++)bridge.setTab(i),await new Promise((r)=>setTimeout(r,ms));return bridge.setTab(CHAT_TAB),json({cycled:TAB_MAX+1,delay:ms})}if(path6==="/mem"){mem("control:snapshot");let m2=process.memoryUsage();return json({rss:Math.round(m2.rss/1024/1024),heap:Math.round(m2.heapUsed/1024/1024),heapTotal:Math.round(m2.heapTotal/1024/1024),external:Math.round(m2.external/1024/1024)})}return json({error:"not found",routes:["GET /status","GET /tab/:n","POST /send {message}","POST /key {name, ctrl?, shift?, meta?, raw?, safe?}","POST /keys {keys: [{name, ...}], delay?, safe?}","POST /type {text, delay?, safe?}","POST /input {text}","GET /quit","GET /frame ?grep=pat&json=1","GET /logs ?n=200","GET /focus","GET /perf","GET /tabs","GET /mem"]},404)}function start(){if(!enabled2)return;Bun.serve({port:PORT,fetch:handle}),process.stderr.write(`\x1B[90m[control] http://localhost:${PORT}\x1B[0m
|
|
3669
3669
|
`)}var INTERP_RE=/\{!(.+?)\}/g,hasInterp=(s)=>/\{!.+?\}/.test(s);async function interpolate(gw,text){let hits=[...text.matchAll(INTERP_RE)];if(hits.length===0)return text;let outs=await Promise.all(hits.map((m2)=>gw.request("shell.exec",{command:m2[1]}).then((r)=>[r.stdout,r.stderr].filter(Boolean).join(`
|
|
3670
|
-
`).trim()).catch(()=>"(error)"))),out=text;for(let i=hits.length-1;i>=0;i--){let m2=hits[i];out=out.slice(0,m2.index)+outs[i]+out.slice(m2.index+m2[0].length)}return out}var import_react13=__toESM(require_react_production(),1);import{EventEmitter as EventEmitter10}from"events";import{homedir}from"os";import{resolve as resolve5,delimiter}from"path";import{existsSync as existsSync3}from"fs";var LOG_MAX=200,LOG_PREVIEW=240,STARTUP_MS=15000,REQUEST_MS=120000;function hermesAgentRoot(){if(process.env.HERMES_AGENT_ROOT)return process.env.HERMES_AGENT_ROOT;return`${process.env.HOME||homedir()}/.hermes/hermes-agent`}function python(root){let env2=process.env.HERMES_PYTHON?.trim();if(env2)return env2;let venv=process.env.VIRTUAL_ENV?.trim();return[venv&&resolve5(venv,"bin
|
|
3671
|
-
`);buf=parts.pop()||"";for(let line of parts)if(line)cb(line)}if(buf.trim())cb(buf)}catch{}}class GatewayClient extends EventEmitter10{proc=null;id=0;logs=[];pending=new Map;buf=[];exit;ok=!1;timer=null;sub=!1;root(){return hermesAgentRoot()}push(ev){if(ev.type==="gateway.ready"){if(this.ok=!0,this.timer)clearTimeout(this.timer),this.timer=null}if(this.sub)return void this.emit("event",ev);this.buf.push(ev)}log(line){if(this.logs.push(line)>LOG_MAX)this.logs.splice(0,this.logs.length-LOG_MAX)}dispatch(msg){let id=msg.id,p=id?this.pending.get(id):void 0;if(p){if(this.pending.delete(id),msg.error){let err=msg.error;p.reject(Error(typeof err?.message==="string"?err.message:"request failed"))}else p.resolve(msg.result);return}if(msg.method==="event"){let ev=asEvent(msg.params);if(ev)this.push(ev)}}fail(err){for(let p of this.pending.values())p.reject(err);this.pending.clear()}start(){let root=this.root(),bin=python(root),cwd=process.env.HERMES_CWD||process.cwd(),env2={...process.env};if(!env2.TERMINAL_CWD)env2.TERMINAL_CWD=cwd;let pp=env2.PYTHONPATH?.trim();if(env2.PYTHONPATH=pp?`${root}${delimiter}${pp}`:root,this.ok=!1,this.buf=[],this.exit=void 0,this.proc)try{this.proc.kill()}catch{}if(this.timer)clearTimeout(this.timer);this.timer=setTimeout(()=>{if(this.ok)return;this.log(`[startup] timed out (python=${bin}, cwd=${cwd})`),this.push({type:"gateway.start_timeout",payload:{cwd,python:bin}})},STARTUP_MS);let proc=Bun.spawn(["
|
|
3670
|
+
`).trim()).catch(()=>"(error)"))),out=text;for(let i=hits.length-1;i>=0;i--){let m2=hits[i];out=out.slice(0,m2.index)+outs[i]+out.slice(m2.index+m2[0].length)}return out}var import_react13=__toESM(require_react_production(),1);import{EventEmitter as EventEmitter10}from"events";import{homedir}from"os";import{resolve as resolve5,delimiter}from"path";import{existsSync as existsSync3}from"fs";var LOG_MAX=200,LOG_PREVIEW=240,STARTUP_MS=15000,REQUEST_MS=120000;function hermesAgentRoot(){if(process.env.HERMES_AGENT_ROOT)return process.env.HERMES_AGENT_ROOT;return`${process.env.HOME||homedir()}/.hermes/hermes-agent`}function python(root,platform=process.platform){let env2=process.env.HERMES_PYTHON?.trim();if(env2)return env2;let venv=process.env.VIRTUAL_ENV?.trim();return(platform==="win32"?[venv&&resolve5(venv,"Scripts","python.exe"),resolve5(root,"venv","Scripts","python.exe"),resolve5(root,".venv","Scripts","python.exe")]:[venv&&resolve5(venv,"bin","python"),venv&&resolve5(venv,"bin","python3"),resolve5(root,"venv","bin","python"),resolve5(root,"venv","bin","python3"),resolve5(root,".venv","bin","python"),resolve5(root,".venv","bin","python3")]).find((p)=>p&&existsSync3(p))||(platform==="win32"?"python":"python3")}function asEvent(v2){if(v2&&typeof v2==="object"&&!Array.isArray(v2)&&typeof v2.type==="string")return v2;return null}async function lines(stream,cb){let reader=stream.getReader(),decoder2=new TextDecoder,buf="";try{while(!0){let{done,value}=await reader.read();if(done)break;buf+=decoder2.decode(value,{stream:!0});let parts=buf.split(`
|
|
3671
|
+
`);buf=parts.pop()||"";for(let line of parts)if(line)cb(line)}if(buf.trim())cb(buf)}catch{}}class GatewayClient extends EventEmitter10{proc=null;id=0;logs=[];pending=new Map;buf=[];exit;ok=!1;timer=null;sub=!1;root(){return hermesAgentRoot()}push(ev){if(ev.type==="gateway.ready"){if(this.ok=!0,this.timer)clearTimeout(this.timer),this.timer=null}if(this.sub)return void this.emit("event",ev);this.buf.push(ev)}log(line){if(this.logs.push(line)>LOG_MAX)this.logs.splice(0,this.logs.length-LOG_MAX)}dispatch(msg){let id=msg.id,p=id?this.pending.get(id):void 0;if(p){if(this.pending.delete(id),msg.error){let err=msg.error;p.reject(Error(typeof err?.message==="string"?err.message:"request failed"))}else p.resolve(msg.result);return}if(msg.method==="event"){let ev=asEvent(msg.params);if(ev)this.push(ev)}}fail(err){for(let p of this.pending.values())p.reject(err);this.pending.clear()}start(){let root=this.root(),bin=python(root),cwd=process.env.HERMES_CWD||process.cwd(),env2={...process.env};if(!env2.TERMINAL_CWD)env2.TERMINAL_CWD=cwd;let pp=env2.PYTHONPATH?.trim();if(env2.PYTHONPATH=pp?`${root}${delimiter}${pp}`:root,this.ok=!1,this.buf=[],this.exit=void 0,this.proc)try{this.proc.kill()}catch{}if(this.timer)clearTimeout(this.timer);this.timer=setTimeout(()=>{if(this.ok)return;this.log(`[startup] timed out (python=${bin}, cwd=${cwd})`),this.push({type:"gateway.start_timeout",payload:{cwd,python:bin}})},STARTUP_MS);let proc=Bun.spawn([bin,"-u","-m","tui_gateway.entry"],{cwd,env:env2,stdin:"pipe",stdout:"pipe",stderr:"pipe"});if(this.proc=proc,this.proc.stdout)lines(this.proc.stdout,(raw)=>{try{this.dispatch(JSON.parse(raw))}catch{let preview=raw.trim().slice(0,LOG_PREVIEW)||"(empty)";this.log(`[protocol] malformed: ${preview}`),this.push({type:"gateway.protocol_error",payload:{preview}})}});if(this.proc.stderr)lines(this.proc.stderr,(raw)=>{let line=raw.trim();if(!line)return;this.log(line),this.push({type:"gateway.stderr",payload:{line}})});proc.exited.then((code)=>{if(this.proc!==proc)return;if(this.timer)clearTimeout(this.timer),this.timer=null;if(this.fail(Error(`gateway exited${code===null?"":` (${code})`}`)),this.sub)this.emit("exit",code);else this.exit=code})}drain(){if(this.sub)return;this.sub=!0;for(let ev of this.buf.splice(0))this.emit("event",ev);if(this.exit!==void 0){let code=this.exit;this.exit=void 0,this.emit("exit",code)}}tail(n=20){return this.logs.slice(-Math.max(1,n)).join(`
|
|
3672
3672
|
`)}sid="";setSession(sid){this.sid=sid}request(method,params={}){if(!this.proc||this.proc.exitCode!==null)this.start();let stdin=this.proc?.stdin;if(!stdin||typeof stdin==="number")return Promise.reject(Error("gateway not running"));let rid=`r${++this.id}`,writer=stdin,merged=this.sid&¶ms.session_id===void 0?{session_id:this.sid,...params}:params;return new Promise((resolve4,reject)=>{let timeout=setTimeout(()=>{if(this.pending.delete(rid))reject(Error(`timeout: ${method}`))},REQUEST_MS);this.pending.set(rid,{reject:(e)=>{clearTimeout(timeout),reject(e)},resolve:(v2)=>{clearTimeout(timeout),resolve4(v2)}});try{writer.write(JSON.stringify({jsonrpc:"2.0",id:rid,method,params:merged})+`
|
|
3673
3673
|
`)}catch(e){clearTimeout(timeout),this.pending.delete(rid),reject(e instanceof Error?e:Error(String(e)))}})}kill(){this.proc?.kill()}get ready(){return this.ok}}var REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment");function jsxProd(type,config,maybeKey){var key=null;if(maybeKey!==void 0&&(key=""+maybeKey),config.key!==void 0&&(key=""+config.key),"key"in config){maybeKey={};for(var propName in config)propName!=="key"&&(maybeKey[propName]=config[propName])}else maybeKey=config;return config=maybeKey.ref,{$$typeof:REACT_ELEMENT_TYPE,type,key,ref:config!==void 0?config:null,props:maybeKey}}var $Fragment2=REACT_FRAGMENT_TYPE,$jsx=jsxProd,$jsxs=jsxProd;var Gw=import_react13.createContext(null),GatewayProvider=({client,children})=>{let ref=import_react13.useRef(null);if(!ref.current)ref.current=client??new GatewayClient;let[ready,setReady]=import_react13.useState(ref.current.ready);import_react13.useEffect(()=>{let c=ref.current,onEvent=(ev)=>{if(ev.type==="gateway.ready"||ev.type==="session.info")setReady(!0)};return c.on("event",onEvent),c.start(),c.drain(),()=>{c.off("event",onEvent),c.removeAllListeners(),c.kill()}},[]);let restart=import_react13.useCallback(()=>{setReady(!1),ref.current.start()},[]),value=import_react13.useMemo(()=>({client:ref.current,ready,restart}),[ready,restart]);return $jsx(Gw.Provider,{value,children})};function useGateway(){let ctx=import_react13.useContext(Gw);if(!ctx)throw Error("useGateway() must be inside <GatewayProvider>");return ctx.client}function useGatewayEvent(handler){let ctx=import_react13.useContext(Gw);if(!ctx)throw Error("useGatewayEvent() must be inside <GatewayProvider>");let ref=import_react13.useRef(handler);ref.current=handler,import_react13.useEffect(()=>{let c=ctx.client,fn=(ev)=>ref.current(ev);return c.on("event",fn),c.drain(),()=>{c.off("event",fn)}},[ctx.client])}function useGatewayReady(){let ctx=import_react13.useContext(Gw);if(!ctx)throw Error("useGatewayReady() must be inside <GatewayProvider>");return ctx.ready}function useGatewayRestart(){let ctx=import_react13.useContext(Gw);if(!ctx)throw Error("useGatewayRestart() must be inside <GatewayProvider>");return ctx.restart}function text(msg){return msg.parts.filter((p)=>p.type==="text").map((p)=>p.content).join("")}function mid(){return`msg-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}var pn=0;function pid(){return`p${++pn}`}var import_react21=__toESM(require_react_production(),1);var import_react20=__toESM(require_react_production(),1);var import_react17=__toESM(require_react_production(),1);var import_react15=__toESM(require_react_production(),1);function resolveTheme(theme,mode){let defs=theme.defs??{};function resolve4(c,chain=[]){if(c instanceof RGBA)return c;if(typeof c==="string"){if(c==="transparent"||c==="none")return RGBA.fromInts(0,0,0,0);if(c.startsWith("#"))return RGBA.fromHex(c);if(chain.includes(c))throw Error(`Circular color reference: ${[...chain,c].join(" -> ")}`);let next=defs[c]??theme.theme[c];if(next===void 0)throw Error(`Color reference "${c}" not found in defs or theme`);return resolve4(next,[...chain,c])}if(typeof c==="number")return ansiToRgba(c);return resolve4(c[mode],chain)}let resolved=Object.fromEntries(Object.entries(theme.theme).filter(([key])=>key!=="selectedListItemText"&&key!=="backgroundMenu"&&key!=="thinkingOpacity").map(([key,value])=>[key,resolve4(value)])),hasList=theme.theme.selectedListItemText!==void 0;resolved.selectedListItemText=hasList?resolve4(theme.theme.selectedListItemText):resolved.background,resolved.backgroundMenu=theme.theme.backgroundMenu!==void 0?resolve4(theme.theme.backgroundMenu):resolved.backgroundElement;let base={...resolved,_hasSelectedListItemText:hasList,thinkingOpacity:theme.theme.thinkingOpacity??0.6},herm=resolveHermTokens(resolved.accent);return{...base,...herm}}function resolveHermTokens(accent){return{hermAvatar:accent}}function ansiToRgba(code){if(code<16){let colors=["#000000","#800000","#008000","#808000","#000080","#800080","#008080","#c0c0c0","#808080","#ff0000","#00ff00","#ffff00","#0000ff","#ff00ff","#00ffff","#ffffff"];return RGBA.fromHex(colors[code]??"#000000")}if(code<232){let idx2=code-16,val=(x2)=>x2===0?0:x2*40+55;return RGBA.fromInts(val(Math.floor(idx2/36)),val(Math.floor(idx2/6)%6),val(idx2%6))}if(code<256){let gray=(code-232)*10+8;return RGBA.fromInts(gray,gray,gray)}return RGBA.fromInts(0,0,0)}var ares_default={$schema:"https://opencode.ai/theme.json",defs:{aresBgDark:"#2A1212",aresPanelDark:"#351717",aresElemDark:"#3F1B1B",aresTextDark:"#F1E6CF",aresMutedDark:"#6E584B",aresPrimaryDark:"#C7A96B",aresAccentDark:"#DD4A3A",aresSecondaryDark:"#C7A96B",aresBorderDark:"#9F1C1C",aresBorderSubtleDark:"#6E584B",aresBgLight:"#F8F8F8",aresPanelLight:"#EFEFEF",aresElemLight:"#E4E4E4",aresTextLight:"#1A1A1A",aresMutedLight:"#5A5A5A",aresPrimaryLight:"#8D7035",aresAccentLight:"#DD4A3A",aresSecondaryLight:"#8D7035",aresBorderLight:"#D0D0D0",aresBorderSubtleLight:"#E0E0E0",aresOkDark:"#4caf50",aresErrorDark:"#ef5350",aresWarnDark:"#ffa726",aresOkLight:"#4caf50",aresErrorLight:"#ef5350",aresWarnLight:"#A56200"},theme:{primary:{dark:"aresPrimaryDark",light:"aresPrimaryLight"},secondary:{dark:"aresSecondaryDark",light:"aresSecondaryLight"},accent:{dark:"aresAccentDark",light:"aresAccentLight"},error:{dark:"aresErrorDark",light:"aresErrorLight"},warning:{dark:"aresWarnDark",light:"aresWarnLight"},success:{dark:"aresOkDark",light:"aresOkLight"},info:{dark:"aresAccentDark",light:"aresAccentLight"},text:{dark:"aresTextDark",light:"aresTextLight"},textMuted:{dark:"aresMutedDark",light:"aresMutedLight"},background:{dark:"aresBgDark",light:"aresBgLight"},backgroundPanel:{dark:"aresPanelDark",light:"aresPanelLight"},backgroundElement:{dark:"aresElemDark",light:"aresElemLight"},border:{dark:"aresBorderDark",light:"aresBorderLight"},borderActive:{dark:"aresAccentDark",light:"aresAccentLight"},borderSubtle:{dark:"aresBorderSubtleDark",light:"aresBorderSubtleLight"},diffAdded:{dark:"aresOkDark",light:"aresOkLight"},diffRemoved:{dark:"aresErrorDark",light:"aresErrorLight"},diffContext:{dark:"aresMutedDark",light:"aresMutedLight"},diffHunkHeader:{dark:"aresMutedDark",light:"aresMutedLight"},diffHighlightAdded:{dark:"aresOkDark",light:"aresOkLight"},diffHighlightRemoved:{dark:"aresErrorDark",light:"aresErrorLight"},diffAddedBg:{dark:"#302E1D",light:"#DEEDDF"},diffRemovedBg:{dark:"#4D1E1D",light:"#F7DFDF"},diffContextBg:{dark:"aresPanelDark",light:"aresPanelLight"},diffLineNumber:{dark:"aresMutedDark",light:"aresMutedLight"},diffAddedLineNumberBg:{dark:"#2D2218",light:"#EAF2EB"},diffRemovedLineNumberBg:{dark:"#3E1818",light:"#F7EBEB"},markdownText:{dark:"aresTextDark",light:"aresTextLight"},markdownHeading:{dark:"aresPrimaryDark",light:"aresPrimaryLight"},markdownLink:{dark:"aresAccentDark",light:"aresAccentLight"},markdownLinkText:{dark:"aresSecondaryDark",light:"aresSecondaryLight"},markdownCode:{dark:"aresSecondaryDark",light:"aresSecondaryLight"},markdownBlockQuote:{dark:"aresMutedDark",light:"aresMutedLight"},markdownEmph:{dark:"aresAccentDark",light:"aresAccentLight"},markdownStrong:{dark:"aresPrimaryDark",light:"aresPrimaryLight"},markdownHorizontalRule:{dark:"aresBorderDark",light:"aresBorderLight"},markdownListItem:{dark:"aresTextDark",light:"aresTextLight"},markdownListEnumeration:{dark:"aresAccentDark",light:"aresAccentLight"},markdownImage:{dark:"aresAccentDark",light:"aresAccentLight"},markdownImageText:{dark:"aresMutedDark",light:"aresMutedLight"},markdownCodeBlock:{dark:"aresTextDark",light:"aresTextLight"},syntaxComment:{dark:"aresMutedDark",light:"aresMutedLight"},syntaxKeyword:{dark:"aresAccentDark",light:"aresAccentLight"},syntaxFunction:{dark:"aresPrimaryDark",light:"aresPrimaryLight"},syntaxVariable:{dark:"aresTextDark",light:"aresTextLight"},syntaxString:{dark:"aresOkDark",light:"aresOkLight"},syntaxNumber:{dark:"aresAccentDark",light:"aresAccentLight"},syntaxType:{dark:"aresSecondaryDark",light:"aresSecondaryLight"},syntaxOperator:{dark:"aresSecondaryDark",light:"aresSecondaryLight"},syntaxPunctuation:{dark:"aresTextDark",light:"aresTextLight"}}};var aura_default={$schema:"https://opencode.ai/theme.json",defs:{darkBg:"#0f0f0f",darkBgPanel:"#15141b",darkBorder:"#2d2d2d",darkFgMuted:"#6d6d6d",darkFg:"#edecee",purple:"#a277ff",pink:"#f694ff",blue:"#82e2ff",red:"#ff6767",orange:"#ffca85",cyan:"#61ffca",green:"#9dff65"},theme:{primary:"purple",secondary:"pink",accent:"purple",error:"red",warning:"orange",success:"cyan",info:"purple",text:"darkFg",textMuted:"darkFgMuted",background:"darkBg",backgroundPanel:"darkBgPanel",backgroundElement:"darkBgPanel",border:"darkBorder",borderActive:"darkFgMuted",borderSubtle:"darkBorder",diffAdded:"cyan",diffRemoved:"red",diffContext:"darkFgMuted",diffHunkHeader:"darkFgMuted",diffHighlightAdded:"cyan",diffHighlightRemoved:"red",diffAddedBg:"#354933",diffRemovedBg:"#3f191a",diffContextBg:"darkBgPanel",diffLineNumber:"darkBorder",diffAddedLineNumberBg:"#162620",diffRemovedLineNumberBg:"#26161a",markdownText:"darkFg",markdownHeading:"purple",markdownLink:"pink",markdownLinkText:"purple",markdownCode:"cyan",markdownBlockQuote:"darkFgMuted",markdownEmph:"orange",markdownStrong:"purple",markdownHorizontalRule:"darkFgMuted",markdownListItem:"purple",markdownListEnumeration:"purple",markdownImage:"pink",markdownImageText:"purple",markdownCodeBlock:"darkFg",syntaxComment:"darkFgMuted",syntaxKeyword:"pink",syntaxFunction:"purple",syntaxVariable:"purple",syntaxString:"cyan",syntaxNumber:"green",syntaxType:"purple",syntaxOperator:"pink",syntaxPunctuation:"darkFg"}};var ayu_default={$schema:"https://opencode.ai/theme.json",defs:{darkBg:"#0B0E14",darkBgAlt:"#0D1017",darkLine:"#11151C",darkPanel:"#0F131A",darkFg:"#BFBDB6",darkFgMuted:"#565B66",darkGutter:"#6C7380",darkTag:"#39BAE6",darkFunc:"#FFB454",darkEntity:"#59C2FF",darkString:"#AAD94C",darkRegexp:"#95E6CB",darkMarkup:"#F07178",darkKeyword:"#FF8F40",darkSpecial:"#E6B673",darkComment:"#ACB6BF",darkConstant:"#D2A6FF",darkOperator:"#F29668",darkAdded:"#7FD962",darkRemoved:"#F26D78",darkAccent:"#E6B450",darkError:"#D95757",darkIndentActive:"#6C7380"},theme:{primary:"darkEntity",secondary:"darkConstant",accent:"darkAccent",error:"darkError",warning:"darkSpecial",success:"darkAdded",info:"darkTag",text:"darkFg",textMuted:"darkFgMuted",background:"darkBg",backgroundPanel:"darkPanel",backgroundElement:"darkBgAlt",border:"darkGutter",borderActive:"darkIndentActive",borderSubtle:"darkLine",diffAdded:"darkAdded",diffRemoved:"darkRemoved",diffContext:"darkComment",diffHunkHeader:"darkComment",diffHighlightAdded:"darkString",diffHighlightRemoved:"darkMarkup",diffAddedBg:"#20303b",diffRemovedBg:"#37222c",diffContextBg:"darkPanel",diffLineNumber:"darkGutter",diffAddedLineNumberBg:"#1b2b34",diffRemovedLineNumberBg:"#2d1f26",markdownText:"darkFg",markdownHeading:"darkConstant",markdownLink:"darkEntity",markdownLinkText:"darkTag",markdownCode:"darkString",markdownBlockQuote:"darkSpecial",markdownEmph:"darkSpecial",markdownStrong:"darkFunc",markdownHorizontalRule:"darkFgMuted",markdownListItem:"darkEntity",markdownListEnumeration:"darkTag",markdownImage:"darkEntity",markdownImageText:"darkTag",markdownCodeBlock:"darkFg",syntaxComment:"darkComment",syntaxKeyword:"darkKeyword",syntaxFunction:"darkFunc",syntaxVariable:"darkEntity",syntaxString:"darkString",syntaxNumber:"darkConstant",syntaxType:"darkSpecial",syntaxOperator:"darkOperator",syntaxPunctuation:"darkFg"}};var carbonfox_default={$schema:"https://opencode.ai/theme.json",defs:{bg0:"#0d0d0d",bg1:"#161616",bg1a:"#1a1a1a",bg2:"#1e1e1e",bg3:"#262626",bg4:"#303030",fg0:"#ffffff",fg1:"#f2f4f8",fg2:"#a9afbc",fg3:"#7d848f",lbg0:"#ffffff",lbg1:"#f4f4f4",lbg2:"#e8e8e8",lbg3:"#dcdcdc",lfg0:"#000000",lfg1:"#161616",lfg2:"#525252",lfg3:"#6f6f6f",red:"#ee5396",green:"#25be6a",yellow:"#08bdba",blue:"#78a9ff",magenta:"#be95ff",cyan:"#33b1ff",white:"#dfdfe0",orange:"#3ddbd9",pink:"#ff7eb6",blueBright:"#8cb6ff",cyanBright:"#52c7ff",greenBright:"#46c880",redLight:"#9f1853",greenLight:"#198038",yellowLight:"#007d79",blueLight:"#0043ce",magentaLight:"#6929c4",cyanLight:"#0072c3",warning:"#f1c21b",diffGreen:"#50fa7b",diffRed:"#ff6b6b",diffGreenBg:"#0f2418",diffRedBg:"#2a1216"},theme:{primary:{dark:"cyan",light:"blueLight"},secondary:{dark:"blue",light:"blueLight"},accent:{dark:"pink",light:"redLight"},error:{dark:"red",light:"redLight"},warning:{dark:"warning",light:"yellowLight"},success:{dark:"green",light:"greenLight"},info:{dark:"blue",light:"blueLight"},text:{dark:"fg1",light:"lfg1"},textMuted:{dark:"fg3",light:"lfg3"},background:{dark:"bg1",light:"lbg0"},backgroundPanel:{dark:"bg1a",light:"lbg1"},backgroundElement:{dark:"bg2",light:"lbg1"},border:{dark:"bg4",light:"lbg3"},borderActive:{dark:"cyan",light:"blueLight"},borderSubtle:{dark:"bg3",light:"lbg2"},diffAdded:{dark:"diffGreen",light:"greenLight"},diffRemoved:{dark:"diffRed",light:"redLight"},diffContext:{dark:"fg3",light:"lfg3"},diffHunkHeader:{dark:"blue",light:"blueLight"},diffHighlightAdded:{dark:"#7dffaa",light:"greenLight"},diffHighlightRemoved:{dark:"#ff9999",light:"redLight"},diffAddedBg:{dark:"diffGreenBg",light:"#defbe6"},diffRemovedBg:{dark:"diffRedBg",light:"#fff1f1"},diffContextBg:{dark:"bg1",light:"lbg1"},diffLineNumber:{dark:"fg3",light:"lfg3"},diffAddedLineNumberBg:{dark:"diffGreenBg",light:"#defbe6"},diffRemovedLineNumberBg:{dark:"diffRedBg",light:"#fff1f1"},markdownText:{dark:"fg1",light:"lfg1"},markdownHeading:{dark:"blueBright",light:"blueLight"},markdownLink:{dark:"blue",light:"blueLight"},markdownLinkText:{dark:"cyan",light:"cyanLight"},markdownCode:{dark:"green",light:"greenLight"},markdownBlockQuote:{dark:"fg3",light:"lfg3"},markdownEmph:{dark:"magenta",light:"magentaLight"},markdownStrong:{dark:"fg0",light:"lfg0"},markdownHorizontalRule:{dark:"bg4",light:"lbg3"},markdownListItem:{dark:"cyan",light:"cyanLight"},markdownListEnumeration:{dark:"cyan",light:"cyanLight"},markdownImage:{dark:"blue",light:"blueLight"},markdownImageText:{dark:"cyan",light:"cyanLight"},markdownCodeBlock:{dark:"fg2",light:"lfg2"},syntaxComment:{dark:"fg3",light:"lfg3"},syntaxKeyword:{dark:"magenta",light:"magentaLight"},syntaxFunction:{dark:"blueBright",light:"blueLight"},syntaxVariable:{dark:"white",light:"lfg1"},syntaxString:{dark:"green",light:"greenLight"},syntaxNumber:{dark:"orange",light:"yellowLight"},syntaxType:{dark:"yellow",light:"yellowLight"},syntaxOperator:{dark:"fg2",light:"lfg2"},syntaxPunctuation:{dark:"fg2",light:"lfg1"}}};var catppuccin_default={$schema:"https://opencode.ai/theme.json",defs:{lightRosewater:"#dc8a78",lightFlamingo:"#dd7878",lightPink:"#ea76cb",lightMauve:"#8839ef",lightRed:"#d20f39",lightMaroon:"#e64553",lightPeach:"#fe640b",lightYellow:"#df8e1d",lightGreen:"#40a02b",lightTeal:"#179299",lightSky:"#04a5e5",lightSapphire:"#209fb5",lightBlue:"#1e66f5",lightLavender:"#7287fd",lightText:"#4c4f69",lightSubtext1:"#5c5f77",lightSubtext0:"#6c6f85",lightOverlay2:"#7c7f93",lightOverlay1:"#8c8fa1",lightOverlay0:"#9ca0b0",lightSurface2:"#acb0be",lightSurface1:"#bcc0cc",lightSurface0:"#ccd0da",lightBase:"#eff1f5",lightMantle:"#e6e9ef",lightCrust:"#dce0e8",darkRosewater:"#f5e0dc",darkFlamingo:"#f2cdcd",darkPink:"#f5c2e7",darkMauve:"#cba6f7",darkRed:"#f38ba8",darkMaroon:"#eba0ac",darkPeach:"#fab387",darkYellow:"#f9e2af",darkGreen:"#a6e3a1",darkTeal:"#94e2d5",darkSky:"#89dceb",darkSapphire:"#74c7ec",darkBlue:"#89b4fa",darkLavender:"#b4befe",darkText:"#cdd6f4",darkSubtext1:"#bac2de",darkSubtext0:"#a6adc8",darkOverlay2:"#9399b2",darkOverlay1:"#7f849c",darkOverlay0:"#6c7086",darkSurface2:"#585b70",darkSurface1:"#45475a",darkSurface0:"#313244",darkBase:"#1e1e2e",darkMantle:"#181825",darkCrust:"#11111b"},theme:{primary:{dark:"darkBlue",light:"lightBlue"},secondary:{dark:"darkMauve",light:"lightMauve"},accent:{dark:"darkPink",light:"lightPink"},error:{dark:"darkRed",light:"lightRed"},warning:{dark:"darkYellow",light:"lightYellow"},success:{dark:"darkGreen",light:"lightGreen"},info:{dark:"darkTeal",light:"lightTeal"},text:{dark:"darkText",light:"lightText"},textMuted:{dark:"darkOverlay2",light:"lightOverlay2"},background:{dark:"darkBase",light:"lightBase"},backgroundPanel:{dark:"darkMantle",light:"lightMantle"},backgroundElement:{dark:"darkCrust",light:"lightCrust"},border:{dark:"darkSurface0",light:"lightSurface0"},borderActive:{dark:"darkSurface1",light:"lightSurface1"},borderSubtle:{dark:"darkSurface2",light:"lightSurface2"},diffAdded:{dark:"darkGreen",light:"lightGreen"},diffRemoved:{dark:"darkRed",light:"lightRed"},diffContext:{dark:"darkOverlay2",light:"lightOverlay2"},diffHunkHeader:{dark:"darkPeach",light:"lightPeach"},diffHighlightAdded:{dark:"darkGreen",light:"lightGreen"},diffHighlightRemoved:{dark:"darkRed",light:"lightRed"},diffAddedBg:{dark:"#24312b",light:"#d6f0d9"},diffRemovedBg:{dark:"#3c2a32",light:"#f6dfe2"},diffContextBg:{dark:"darkMantle",light:"lightMantle"},diffLineNumber:{dark:"darkSurface1",light:"lightSurface1"},diffAddedLineNumberBg:{dark:"#1e2a25",light:"#c9e3cb"},diffRemovedLineNumberBg:{dark:"#32232a",light:"#e9d3d6"},markdownText:{dark:"darkText",light:"lightText"},markdownHeading:{dark:"darkMauve",light:"lightMauve"},markdownLink:{dark:"darkBlue",light:"lightBlue"},markdownLinkText:{dark:"darkSky",light:"lightSky"},markdownCode:{dark:"darkGreen",light:"lightGreen"},markdownBlockQuote:{dark:"darkYellow",light:"lightYellow"},markdownEmph:{dark:"darkYellow",light:"lightYellow"},markdownStrong:{dark:"darkPeach",light:"lightPeach"},markdownHorizontalRule:{dark:"darkSubtext0",light:"lightSubtext0"},markdownListItem:{dark:"darkBlue",light:"lightBlue"},markdownListEnumeration:{dark:"darkSky",light:"lightSky"},markdownImage:{dark:"darkBlue",light:"lightBlue"},markdownImageText:{dark:"darkSky",light:"lightSky"},markdownCodeBlock:{dark:"darkText",light:"lightText"},syntaxComment:{dark:"darkOverlay2",light:"lightOverlay2"},syntaxKeyword:{dark:"darkMauve",light:"lightMauve"},syntaxFunction:{dark:"darkBlue",light:"lightBlue"},syntaxVariable:{dark:"darkRed",light:"lightRed"},syntaxString:{dark:"darkGreen",light:"lightGreen"},syntaxNumber:{dark:"darkPeach",light:"lightPeach"},syntaxType:{dark:"darkYellow",light:"lightYellow"},syntaxOperator:{dark:"darkSky",light:"lightSky"},syntaxPunctuation:{dark:"darkText",light:"lightText"}}};var catppuccin_frappe_default={$schema:"https://opencode.ai/theme.json",defs:{frappeRosewater:"#f2d5cf",frappeFlamingo:"#eebebe",frappePink:"#f4b8e4",frappeMauve:"#ca9ee6",frappeRed:"#e78284",frappeMaroon:"#ea999c",frappePeach:"#ef9f76",frappeYellow:"#e5c890",frappeGreen:"#a6d189",frappeTeal:"#81c8be",frappeSky:"#99d1db",frappeSapphire:"#85c1dc",frappeBlue:"#8da4e2",frappeLavender:"#babbf1",frappeText:"#c6d0f5",frappeSubtext1:"#b5bfe2",frappeSubtext0:"#a5adce",frappeOverlay2:"#949cb8",frappeOverlay1:"#838ba7",frappeOverlay0:"#737994",frappeSurface2:"#626880",frappeSurface1:"#51576d",frappeSurface0:"#414559",frappeBase:"#303446",frappeMantle:"#292c3c",frappeCrust:"#232634"},theme:{primary:{dark:"frappeBlue",light:"frappeBlue"},secondary:{dark:"frappeMauve",light:"frappeMauve"},accent:{dark:"frappePink",light:"frappePink"},error:{dark:"frappeRed",light:"frappeRed"},warning:{dark:"frappeYellow",light:"frappeYellow"},success:{dark:"frappeGreen",light:"frappeGreen"},info:{dark:"frappeTeal",light:"frappeTeal"},text:{dark:"frappeText",light:"frappeText"},textMuted:{dark:"frappeOverlay2",light:"frappeOverlay2"},background:{dark:"frappeBase",light:"frappeBase"},backgroundPanel:{dark:"frappeMantle",light:"frappeMantle"},backgroundElement:{dark:"frappeCrust",light:"frappeCrust"},border:{dark:"frappeSurface0",light:"frappeSurface0"},borderActive:{dark:"frappeSurface1",light:"frappeSurface1"},borderSubtle:{dark:"frappeSurface2",light:"frappeSurface2"},diffAdded:{dark:"frappeGreen",light:"frappeGreen"},diffRemoved:{dark:"frappeRed",light:"frappeRed"},diffContext:{dark:"frappeOverlay2",light:"frappeOverlay2"},diffHunkHeader:{dark:"frappePeach",light:"frappePeach"},diffHighlightAdded:{dark:"frappeGreen",light:"frappeGreen"},diffHighlightRemoved:{dark:"frappeRed",light:"frappeRed"},diffAddedBg:{dark:"#29342b",light:"#29342b"},diffRemovedBg:{dark:"#3a2a31",light:"#3a2a31"},diffContextBg:{dark:"frappeMantle",light:"frappeMantle"},diffLineNumber:{dark:"frappeSurface1",light:"frappeSurface1"},diffAddedLineNumberBg:{dark:"#223025",light:"#223025"},diffRemovedLineNumberBg:{dark:"#2f242b",light:"#2f242b"},markdownText:{dark:"frappeText",light:"frappeText"},markdownHeading:{dark:"frappeMauve",light:"frappeMauve"},markdownLink:{dark:"frappeBlue",light:"frappeBlue"},markdownLinkText:{dark:"frappeSky",light:"frappeSky"},markdownCode:{dark:"frappeGreen",light:"frappeGreen"},markdownBlockQuote:{dark:"frappeYellow",light:"frappeYellow"},markdownEmph:{dark:"frappeYellow",light:"frappeYellow"},markdownStrong:{dark:"frappePeach",light:"frappePeach"},markdownHorizontalRule:{dark:"frappeSubtext0",light:"frappeSubtext0"},markdownListItem:{dark:"frappeBlue",light:"frappeBlue"},markdownListEnumeration:{dark:"frappeSky",light:"frappeSky"},markdownImage:{dark:"frappeBlue",light:"frappeBlue"},markdownImageText:{dark:"frappeSky",light:"frappeSky"},markdownCodeBlock:{dark:"frappeText",light:"frappeText"},syntaxComment:{dark:"frappeOverlay2",light:"frappeOverlay2"},syntaxKeyword:{dark:"frappeMauve",light:"frappeMauve"},syntaxFunction:{dark:"frappeBlue",light:"frappeBlue"},syntaxVariable:{dark:"frappeRed",light:"frappeRed"},syntaxString:{dark:"frappeGreen",light:"frappeGreen"},syntaxNumber:{dark:"frappePeach",light:"frappePeach"},syntaxType:{dark:"frappeYellow",light:"frappeYellow"},syntaxOperator:{dark:"frappeSky",light:"frappeSky"},syntaxPunctuation:{dark:"frappeText",light:"frappeText"}}};var catppuccin_macchiato_default={$schema:"https://opencode.ai/theme.json",defs:{macRosewater:"#f4dbd6",macFlamingo:"#f0c6c6",macPink:"#f5bde6",macMauve:"#c6a0f6",macRed:"#ed8796",macMaroon:"#ee99a0",macPeach:"#f5a97f",macYellow:"#eed49f",macGreen:"#a6da95",macTeal:"#8bd5ca",macSky:"#91d7e3",macSapphire:"#7dc4e4",macBlue:"#8aadf4",macLavender:"#b7bdf8",macText:"#cad3f5",macSubtext1:"#b8c0e0",macSubtext0:"#a5adcb",macOverlay2:"#939ab7",macOverlay1:"#8087a2",macOverlay0:"#6e738d",macSurface2:"#5b6078",macSurface1:"#494d64",macSurface0:"#363a4f",macBase:"#24273a",macMantle:"#1e2030",macCrust:"#181926"},theme:{primary:{dark:"macBlue",light:"macBlue"},secondary:{dark:"macMauve",light:"macMauve"},accent:{dark:"macPink",light:"macPink"},error:{dark:"macRed",light:"macRed"},warning:{dark:"macYellow",light:"macYellow"},success:{dark:"macGreen",light:"macGreen"},info:{dark:"macTeal",light:"macTeal"},text:{dark:"macText",light:"macText"},textMuted:{dark:"macOverlay2",light:"macOverlay2"},background:{dark:"macBase",light:"macBase"},backgroundPanel:{dark:"macMantle",light:"macMantle"},backgroundElement:{dark:"macCrust",light:"macCrust"},border:{dark:"macSurface0",light:"macSurface0"},borderActive:{dark:"macSurface1",light:"macSurface1"},borderSubtle:{dark:"macSurface2",light:"macSurface2"},diffAdded:{dark:"macGreen",light:"macGreen"},diffRemoved:{dark:"macRed",light:"macRed"},diffContext:{dark:"macOverlay2",light:"macOverlay2"},diffHunkHeader:{dark:"macPeach",light:"macPeach"},diffHighlightAdded:{dark:"macGreen",light:"macGreen"},diffHighlightRemoved:{dark:"macRed",light:"macRed"},diffAddedBg:{dark:"#29342b",light:"#29342b"},diffRemovedBg:{dark:"#3a2a31",light:"#3a2a31"},diffContextBg:{dark:"macMantle",light:"macMantle"},diffLineNumber:{dark:"macSurface1",light:"macSurface1"},diffAddedLineNumberBg:{dark:"#223025",light:"#223025"},diffRemovedLineNumberBg:{dark:"#2f242b",light:"#2f242b"},markdownText:{dark:"macText",light:"macText"},markdownHeading:{dark:"macMauve",light:"macMauve"},markdownLink:{dark:"macBlue",light:"macBlue"},markdownLinkText:{dark:"macSky",light:"macSky"},markdownCode:{dark:"macGreen",light:"macGreen"},markdownBlockQuote:{dark:"macYellow",light:"macYellow"},markdownEmph:{dark:"macYellow",light:"macYellow"},markdownStrong:{dark:"macPeach",light:"macPeach"},markdownHorizontalRule:{dark:"macSubtext0",light:"macSubtext0"},markdownListItem:{dark:"macBlue",light:"macBlue"},markdownListEnumeration:{dark:"macSky",light:"macSky"},markdownImage:{dark:"macBlue",light:"macBlue"},markdownImageText:{dark:"macSky",light:"macSky"},markdownCodeBlock:{dark:"macText",light:"macText"},syntaxComment:{dark:"macOverlay2",light:"macOverlay2"},syntaxKeyword:{dark:"macMauve",light:"macMauve"},syntaxFunction:{dark:"macBlue",light:"macBlue"},syntaxVariable:{dark:"macRed",light:"macRed"},syntaxString:{dark:"macGreen",light:"macGreen"},syntaxNumber:{dark:"macPeach",light:"macPeach"},syntaxType:{dark:"macYellow",light:"macYellow"},syntaxOperator:{dark:"macSky",light:"macSky"},syntaxPunctuation:{dark:"macText",light:"macText"}}};var charizard_default={$schema:"https://opencode.ai/theme.json",defs:{charizardBgDark:"#2B160E",charizardPanelDark:"#371C12",charizardElemDark:"#422216",charizardTextDark:"#FFF0D4",charizardMutedDark:"#7A3511",charizardPrimaryDark:"#FFD39A",charizardAccentDark:"#F29C38",charizardSecondaryDark:"#FFD39A",charizardBorderDark:"#C75B1D",charizardBorderSubtleDark:"#6C4724",charizardBgLight:"#F8F8F8",charizardPanelLight:"#EFEFEF",charizardElemLight:"#E4E4E4",charizardTextLight:"#1A1A1A",charizardMutedLight:"#5A5A5A",charizardPrimaryLight:"#E78200",charizardAccentLight:"#AE630B",charizardSecondaryLight:"#E78200",charizardBorderLight:"#D0D0D0",charizardBorderSubtleLight:"#E0E0E0",charizardOkDark:"#4caf50",charizardErrorDark:"#ef5350",charizardWarnDark:"#ffa726",charizardOkLight:"#4caf50",charizardErrorLight:"#ef5350",charizardWarnLight:"#A56200"},theme:{primary:{dark:"charizardPrimaryDark",light:"charizardPrimaryLight"},secondary:{dark:"charizardSecondaryDark",light:"charizardSecondaryLight"},accent:{dark:"charizardAccentDark",light:"charizardAccentLight"},error:{dark:"charizardErrorDark",light:"charizardErrorLight"},warning:{dark:"charizardWarnDark",light:"charizardWarnLight"},success:{dark:"charizardOkDark",light:"charizardOkLight"},info:{dark:"charizardAccentDark",light:"charizardAccentLight"},text:{dark:"charizardTextDark",light:"charizardTextLight"},textMuted:{dark:"charizardMutedDark",light:"charizardMutedLight"},background:{dark:"charizardBgDark",light:"charizardBgLight"},backgroundPanel:{dark:"charizardPanelDark",light:"charizardPanelLight"},backgroundElement:{dark:"charizardElemDark",light:"charizardElemLight"},border:{dark:"charizardBorderDark",light:"charizardBorderLight"},borderActive:{dark:"charizardAccentDark",light:"charizardAccentLight"},borderSubtle:{dark:"charizardBorderSubtleDark",light:"charizardBorderSubtleLight"},diffAdded:{dark:"charizardOkDark",light:"charizardOkLight"},diffRemoved:{dark:"charizardErrorDark",light:"charizardErrorLight"},diffContext:{dark:"charizardMutedDark",light:"charizardMutedLight"},diffHunkHeader:{dark:"charizardMutedDark",light:"charizardMutedLight"},diffHighlightAdded:{dark:"charizardOkDark",light:"charizardOkLight"},diffHighlightRemoved:{dark:"charizardErrorDark",light:"charizardErrorLight"},diffAddedBg:{dark:"#31321A",light:"#DEEDDF"},diffRemovedBg:{dark:"#4E211A",light:"#F7DFDF"},diffContextBg:{dark:"charizardPanelDark",light:"charizardPanelLight"},diffLineNumber:{dark:"charizardMutedDark",light:"charizardMutedLight"},diffAddedLineNumberBg:{dark:"#2E2515",light:"#EAF2EB"},diffRemovedLineNumberBg:{dark:"#3F1C15",light:"#F7EBEB"},markdownText:{dark:"charizardTextDark",light:"charizardTextLight"},markdownHeading:{dark:"charizardPrimaryDark",light:"charizardPrimaryLight"},markdownLink:{dark:"charizardAccentDark",light:"charizardAccentLight"},markdownLinkText:{dark:"charizardSecondaryDark",light:"charizardSecondaryLight"},markdownCode:{dark:"charizardSecondaryDark",light:"charizardSecondaryLight"},markdownBlockQuote:{dark:"charizardMutedDark",light:"charizardMutedLight"},markdownEmph:{dark:"charizardAccentDark",light:"charizardAccentLight"},markdownStrong:{dark:"charizardPrimaryDark",light:"charizardPrimaryLight"},markdownHorizontalRule:{dark:"charizardBorderDark",light:"charizardBorderLight"},markdownListItem:{dark:"charizardTextDark",light:"charizardTextLight"},markdownListEnumeration:{dark:"charizardAccentDark",light:"charizardAccentLight"},markdownImage:{dark:"charizardAccentDark",light:"charizardAccentLight"},markdownImageText:{dark:"charizardMutedDark",light:"charizardMutedLight"},markdownCodeBlock:{dark:"charizardTextDark",light:"charizardTextLight"},syntaxComment:{dark:"charizardMutedDark",light:"charizardMutedLight"},syntaxKeyword:{dark:"charizardAccentDark",light:"charizardAccentLight"},syntaxFunction:{dark:"charizardPrimaryDark",light:"charizardPrimaryLight"},syntaxVariable:{dark:"charizardTextDark",light:"charizardTextLight"},syntaxString:{dark:"charizardOkDark",light:"charizardOkLight"},syntaxNumber:{dark:"charizardAccentDark",light:"charizardAccentLight"},syntaxType:{dark:"charizardSecondaryDark",light:"charizardSecondaryLight"},syntaxOperator:{dark:"charizardSecondaryDark",light:"charizardSecondaryLight"},syntaxPunctuation:{dark:"charizardTextDark",light:"charizardTextLight"}}};var cobalt2_default={$schema:"https://opencode.ai/theme.json",defs:{background:"#193549",backgroundAlt:"#122738",backgroundPanel:"#1f4662",foreground:"#ffffff",foregroundMuted:"#adb7c9",yellow:"#ffc600",yellowBright:"#ffe14c",orange:"#ff9d00",orangeBright:"#ffb454",mint:"#2affdf",mintBright:"#7efff5",blue:"#0088ff",blueBright:"#5cb7ff",pink:"#ff628c",pinkBright:"#ff86a5",green:"#9eff80",greenBright:"#b9ff9f",purple:"#9a5feb",purpleBright:"#b88cfd",red:"#ff0088",redBright:"#ff5fb3"},theme:{primary:{dark:"blue",light:"#0066cc"},secondary:{dark:"purple",light:"#7c4dff"},accent:{dark:"mint",light:"#00acc1"},error:{dark:"red",light:"#e91e63"},warning:{dark:"yellow",light:"#ff9800"},success:{dark:"green",light:"#4caf50"},info:{dark:"orange",light:"#ff5722"},text:{dark:"foreground",light:"#193549"},textMuted:{dark:"foregroundMuted",light:"#5c6b7d"},background:{dark:"#193549",light:"#ffffff"},backgroundPanel:{dark:"#122738",light:"#f5f7fa"},backgroundElement:{dark:"#1f4662",light:"#e8ecf1"},border:{dark:"#1f4662",light:"#d3dae3"},borderActive:{dark:"blue",light:"#0066cc"},borderSubtle:{dark:"#0e1e2e",light:"#e8ecf1"},diffAdded:{dark:"green",light:"#4caf50"},diffRemoved:{dark:"red",light:"#e91e63"},diffContext:{dark:"foregroundMuted",light:"#5c6b7d"},diffHunkHeader:{dark:"mint",light:"#00acc1"},diffHighlightAdded:{dark:"greenBright",light:"#4caf50"},diffHighlightRemoved:{dark:"redBright",light:"#e91e63"},diffAddedBg:{dark:"#1a3a2a",light:"#e8f5e9"},diffRemovedBg:{dark:"#3a1a2a",light:"#ffebee"},diffContextBg:{dark:"#122738",light:"#f5f7fa"},diffLineNumber:{dark:"#2d5a7b",light:"#b0bec5"},diffAddedLineNumberBg:{dark:"#1a3a2a",light:"#e8f5e9"},diffRemovedLineNumberBg:{dark:"#3a1a2a",light:"#ffebee"},markdownText:{dark:"foreground",light:"#193549"},markdownHeading:{dark:"yellow",light:"#ff9800"},markdownLink:{dark:"blue",light:"#0066cc"},markdownLinkText:{dark:"mint",light:"#00acc1"},markdownCode:{dark:"green",light:"#4caf50"},markdownBlockQuote:{dark:"foregroundMuted",light:"#5c6b7d"},markdownEmph:{dark:"orange",light:"#ff5722"},markdownStrong:{dark:"pink",light:"#e91e63"},markdownHorizontalRule:{dark:"#2d5a7b",light:"#d3dae3"},markdownListItem:{dark:"blue",light:"#0066cc"},markdownListEnumeration:{dark:"mint",light:"#00acc1"},markdownImage:{dark:"blue",light:"#0066cc"},markdownImageText:{dark:"mint",light:"#00acc1"},markdownCodeBlock:{dark:"foreground",light:"#193549"},syntaxComment:{dark:"#0088ff",light:"#5c6b7d"},syntaxKeyword:{dark:"orange",light:"#ff5722"},syntaxFunction:{dark:"yellow",light:"#ff9800"},syntaxVariable:{dark:"foreground",light:"#193549"},syntaxString:{dark:"green",light:"#4caf50"},syntaxNumber:{dark:"pink",light:"#e91e63"},syntaxType:{dark:"mint",light:"#00acc1"},syntaxOperator:{dark:"orange",light:"#ff5722"},syntaxPunctuation:{dark:"foreground",light:"#193549"}}};var cursor_default={$schema:"https://opencode.ai/theme.json",defs:{darkBg:"#181818",darkPanel:"#141414",darkElement:"#262626",darkFg:"#e4e4e4",darkMuted:"#e4e4e45e",darkBorder:"#e4e4e413",darkBorderActive:"#e4e4e426",darkCyan:"#88c0d0",darkBlue:"#81a1c1",darkGreen:"#3fa266",darkGreenBright:"#70b489",darkRed:"#e34671",darkRedBright:"#fc6b83",darkYellow:"#f1b467",darkOrange:"#d2943e",darkPink:"#E394DC",darkPurple:"#AAA0FA",darkTeal:"#82D2CE",darkSyntaxYellow:"#F8C762",darkSyntaxOrange:"#EFB080",darkSyntaxGreen:"#A8CC7C",darkSyntaxBlue:"#87C3FF",lightBg:"#fcfcfc",lightPanel:"#f3f3f3",lightElement:"#ededed",lightFg:"#141414",lightMuted:"#141414ad",lightBorder:"#14141413",lightBorderActive:"#14141426",lightTeal:"#6f9ba6",lightBlue:"#3c7cab",lightBlueDark:"#206595",lightGreen:"#1f8a65",lightGreenBright:"#55a583",lightRed:"#cf2d56",lightRedBright:"#e75e78",lightOrange:"#db704b",lightYellow:"#c08532",lightPurple:"#9e94d5",lightPurpleDark:"#6049b3",lightPink:"#b8448b",lightMagenta:"#b3003f"},theme:{primary:{dark:"darkCyan",light:"lightTeal"},secondary:{dark:"darkBlue",light:"lightBlue"},accent:{dark:"darkCyan",light:"lightTeal"},error:{dark:"darkRed",light:"lightRed"},warning:{dark:"darkYellow",light:"lightOrange"},success:{dark:"darkGreen",light:"lightGreen"},info:{dark:"darkBlue",light:"lightBlue"},text:{dark:"darkFg",light:"lightFg"},textMuted:{dark:"darkMuted",light:"lightMuted"},background:{dark:"darkBg",light:"lightBg"},backgroundPanel:{dark:"darkPanel",light:"lightPanel"},backgroundElement:{dark:"darkElement",light:"lightElement"},border:{dark:"darkBorder",light:"lightBorder"},borderActive:{dark:"darkCyan",light:"lightTeal"},borderSubtle:{dark:"#0f0f0f",light:"#e0e0e0"},diffAdded:{dark:"darkGreen",light:"lightGreen"},diffRemoved:{dark:"darkRed",light:"lightRed"},diffContext:{dark:"darkMuted",light:"lightMuted"},diffHunkHeader:{dark:"darkMuted",light:"lightMuted"},diffHighlightAdded:{dark:"darkGreenBright",light:"lightGreenBright"},diffHighlightRemoved:{dark:"darkRedBright",light:"lightRedBright"},diffAddedBg:{dark:"#3fa26633",light:"#1f8a651f"},diffRemovedBg:{dark:"#b8004933",light:"#cf2d5614"},diffContextBg:{dark:"darkPanel",light:"lightPanel"},diffLineNumber:{dark:"#e4e4e442",light:"#1414147a"},diffAddedLineNumberBg:{dark:"#3fa26633",light:"#1f8a651f"},diffRemovedLineNumberBg:{dark:"#b8004933",light:"#cf2d5614"},markdownText:{dark:"darkFg",light:"lightFg"},markdownHeading:{dark:"darkPurple",light:"lightBlueDark"},markdownLink:{dark:"darkTeal",light:"lightBlueDark"},markdownLinkText:{dark:"darkBlue",light:"lightMuted"},markdownCode:{dark:"darkPink",light:"lightGreen"},markdownBlockQuote:{dark:"darkMuted",light:"lightMuted"},markdownEmph:{dark:"darkTeal",light:"lightFg"},markdownStrong:{dark:"darkSyntaxYellow",light:"lightFg"},markdownHorizontalRule:{dark:"darkMuted",light:"lightMuted"},markdownListItem:{dark:"darkFg",light:"lightFg"},markdownListEnumeration:{dark:"darkCyan",light:"lightMuted"},markdownImage:{dark:"darkCyan",light:"lightBlueDark"},markdownImageText:{dark:"darkBlue",light:"lightMuted"},markdownCodeBlock:{dark:"darkFg",light:"lightFg"},syntaxComment:{dark:"darkMuted",light:"lightMuted"},syntaxKeyword:{dark:"darkTeal",light:"lightMagenta"},syntaxFunction:{dark:"darkSyntaxOrange",light:"lightOrange"},syntaxVariable:{dark:"darkFg",light:"lightFg"},syntaxString:{dark:"darkPink",light:"lightPurple"},syntaxNumber:{dark:"darkSyntaxYellow",light:"lightPink"},syntaxType:{dark:"darkSyntaxOrange",light:"lightBlueDark"},syntaxOperator:{dark:"darkFg",light:"lightFg"},syntaxPunctuation:{dark:"darkFg",light:"lightFg"}}};var daylight_default={$schema:"https://opencode.ai/theme.json",defs:{daylightBgDark:"#101014",daylightPanelDark:"#18181F",daylightElemDark:"#1F1F28",daylightTextDark:"#E6E6E6",daylightMutedDark:"#9A9A9A",daylightPrimaryDark:"#233662",daylightAccentDark:"#597FE9",daylightSecondaryDark:"#18BAAD",daylightBorderDark:"#3C74ED",daylightBorderSubtleDark:"#4F5B6D",daylightBgLight:"#E5EDF8",daylightPanelLight:"#DCE4EE",daylightElemLight:"#D3DAE4",daylightTextLight:"#111827",daylightMutedLight:"#475569",daylightPrimaryLight:"#0F172A",daylightAccentLight:"#1D4ED8",daylightSecondaryLight:"#0F766E",daylightBorderLight:"#2563EB",daylightBorderSubtleLight:"#64748B",daylightOkDark:"#15803D",daylightErrorDark:"#B91C1C",daylightWarnDark:"#B45309",daylightOkLight:"#15803D",daylightErrorLight:"#B91C1C",daylightWarnLight:"#B45309"},theme:{primary:{dark:"daylightPrimaryDark",light:"daylightPrimaryLight"},secondary:{dark:"daylightSecondaryDark",light:"daylightSecondaryLight"},accent:{dark:"daylightAccentDark",light:"daylightAccentLight"},error:{dark:"daylightErrorDark",light:"daylightErrorLight"},warning:{dark:"daylightWarnDark",light:"daylightWarnLight"},success:{dark:"daylightOkDark",light:"daylightOkLight"},info:{dark:"daylightAccentDark",light:"daylightAccentLight"},text:{dark:"daylightTextDark",light:"daylightTextLight"},textMuted:{dark:"daylightMutedDark",light:"daylightMutedLight"},background:{dark:"daylightBgDark",light:"daylightBgLight"},backgroundPanel:{dark:"daylightPanelDark",light:"daylightPanelLight"},backgroundElement:{dark:"daylightElemDark",light:"daylightElemLight"},border:{dark:"daylightBorderDark",light:"daylightBorderLight"},borderActive:{dark:"daylightAccentDark",light:"daylightAccentLight"},borderSubtle:{dark:"daylightBorderSubtleDark",light:"daylightBorderSubtleLight"},diffAdded:{dark:"daylightOkDark",light:"daylightOkLight"},diffRemoved:{dark:"daylightErrorDark",light:"daylightErrorLight"},diffContext:{dark:"daylightMutedDark",light:"daylightMutedLight"},diffHunkHeader:{dark:"daylightMutedDark",light:"daylightMutedLight"},diffHighlightAdded:{dark:"daylightOkDark",light:"daylightOkLight"},diffHighlightRemoved:{dark:"daylightErrorDark",light:"daylightErrorLight"},diffAddedBg:{dark:"#11241B",light:"#C6DDDC"},diffRemovedBg:{dark:"#2E1215",light:"#DECED7"},diffContextBg:{dark:"daylightPanelDark",light:"daylightPanelLight"},diffLineNumber:{dark:"daylightMutedDark",light:"daylightMutedLight"},diffAddedLineNumberBg:{dark:"#101B18",light:"#D4E4E9"},diffRemovedLineNumberBg:{dark:"#211115",light:"#E1DCE6"},markdownText:{dark:"daylightTextDark",light:"daylightTextLight"},markdownHeading:{dark:"daylightPrimaryDark",light:"daylightPrimaryLight"},markdownLink:{dark:"daylightAccentDark",light:"daylightAccentLight"},markdownLinkText:{dark:"daylightSecondaryDark",light:"daylightSecondaryLight"},markdownCode:{dark:"daylightSecondaryDark",light:"daylightSecondaryLight"},markdownBlockQuote:{dark:"daylightMutedDark",light:"daylightMutedLight"},markdownEmph:{dark:"daylightAccentDark",light:"daylightAccentLight"},markdownStrong:{dark:"daylightPrimaryDark",light:"daylightPrimaryLight"},markdownHorizontalRule:{dark:"daylightBorderDark",light:"daylightBorderLight"},markdownListItem:{dark:"daylightTextDark",light:"daylightTextLight"},markdownListEnumeration:{dark:"daylightAccentDark",light:"daylightAccentLight"},markdownImage:{dark:"daylightAccentDark",light:"daylightAccentLight"},markdownImageText:{dark:"daylightMutedDark",light:"daylightMutedLight"},markdownCodeBlock:{dark:"daylightTextDark",light:"daylightTextLight"},syntaxComment:{dark:"daylightMutedDark",light:"daylightMutedLight"},syntaxKeyword:{dark:"daylightAccentDark",light:"daylightAccentLight"},syntaxFunction:{dark:"daylightPrimaryDark",light:"daylightPrimaryLight"},syntaxVariable:{dark:"daylightTextDark",light:"daylightTextLight"},syntaxString:{dark:"daylightOkDark",light:"daylightOkLight"},syntaxNumber:{dark:"daylightAccentDark",light:"daylightAccentLight"},syntaxType:{dark:"daylightSecondaryDark",light:"daylightSecondaryLight"},syntaxOperator:{dark:"daylightSecondaryDark",light:"daylightSecondaryLight"},syntaxPunctuation:{dark:"daylightTextDark",light:"daylightTextLight"}}};var default_default={$schema:"https://opencode.ai/theme.json",defs:{defaultBgDark:"#1a1a2e",defaultPanelDark:"#202038",defaultElemDark:"#252542",defaultTextDark:"#FFF8DC",defaultMutedDark:"#B8860B",defaultPrimaryDark:"#FFD700",defaultAccentDark:"#FFBF00",defaultSecondaryDark:"#DAA520",defaultBorderDark:"#CD7F32",defaultBorderSubtleDark:"#8B8682",defaultBgLight:"#F8F8F8",defaultPanelLight:"#EFEFEF",defaultElemLight:"#E4E4E4",defaultTextLight:"#1A1A1A",defaultMutedLight:"#5A5A5A",defaultPrimaryLight:"#4D4000",defaultAccentLight:"#4D3900",defaultSecondaryLight:"#785B12",defaultBorderLight:"#D0D0D0",defaultBorderSubtleLight:"#E0E0E0",defaultOkDark:"#4caf50",defaultErrorDark:"#ef5350",defaultWarnDark:"#ffa726",defaultOkLight:"#4caf50",defaultErrorLight:"#ef5350",defaultWarnLight:"#A56200"},theme:{primary:{dark:"defaultPrimaryDark",light:"defaultPrimaryLight"},secondary:{dark:"defaultSecondaryDark",light:"defaultSecondaryLight"},accent:{dark:"defaultAccentDark",light:"defaultAccentLight"},error:{dark:"defaultErrorDark",light:"defaultErrorLight"},warning:{dark:"defaultWarnDark",light:"defaultWarnLight"},success:{dark:"defaultOkDark",light:"defaultOkLight"},info:{dark:"defaultAccentDark",light:"defaultAccentLight"},text:{dark:"defaultTextDark",light:"defaultTextLight"},textMuted:{dark:"defaultMutedDark",light:"defaultMutedLight"},background:{dark:"defaultBgDark",light:"defaultBgLight"},backgroundPanel:{dark:"defaultPanelDark",light:"defaultPanelLight"},backgroundElement:{dark:"defaultElemDark",light:"defaultElemLight"},border:{dark:"defaultBorderDark",light:"defaultBorderLight"},borderActive:{dark:"defaultAccentDark",light:"defaultAccentLight"},borderSubtle:{dark:"defaultBorderSubtleDark",light:"defaultBorderSubtleLight"},diffAdded:{dark:"defaultOkDark",light:"defaultOkLight"},diffRemoved:{dark:"defaultErrorDark",light:"defaultErrorLight"},diffContext:{dark:"defaultMutedDark",light:"defaultMutedLight"},diffHunkHeader:{dark:"defaultMutedDark",light:"defaultMutedLight"},diffHighlightAdded:{dark:"defaultOkDark",light:"defaultOkLight"},diffHighlightRemoved:{dark:"defaultErrorDark",light:"defaultErrorLight"},diffAddedBg:{dark:"#233534",light:"#DEEDDF"},diffRemovedBg:{dark:"#402434",light:"#F7DFDF"},diffContextBg:{dark:"defaultPanelDark",light:"defaultPanelLight"},diffLineNumber:{dark:"defaultMutedDark",light:"defaultMutedLight"},diffAddedLineNumberBg:{dark:"#1F2931",light:"#EAF2EB"},diffRemovedLineNumberBg:{dark:"#2F2031",light:"#F7EBEB"},markdownText:{dark:"defaultTextDark",light:"defaultTextLight"},markdownHeading:{dark:"defaultPrimaryDark",light:"defaultPrimaryLight"},markdownLink:{dark:"defaultAccentDark",light:"defaultAccentLight"},markdownLinkText:{dark:"defaultSecondaryDark",light:"defaultSecondaryLight"},markdownCode:{dark:"defaultSecondaryDark",light:"defaultSecondaryLight"},markdownBlockQuote:{dark:"defaultMutedDark",light:"defaultMutedLight"},markdownEmph:{dark:"defaultAccentDark",light:"defaultAccentLight"},markdownStrong:{dark:"defaultPrimaryDark",light:"defaultPrimaryLight"},markdownHorizontalRule:{dark:"defaultBorderDark",light:"defaultBorderLight"},markdownListItem:{dark:"defaultTextDark",light:"defaultTextLight"},markdownListEnumeration:{dark:"defaultAccentDark",light:"defaultAccentLight"},markdownImage:{dark:"defaultAccentDark",light:"defaultAccentLight"},markdownImageText:{dark:"defaultMutedDark",light:"defaultMutedLight"},markdownCodeBlock:{dark:"defaultTextDark",light:"defaultTextLight"},syntaxComment:{dark:"defaultMutedDark",light:"defaultMutedLight"},syntaxKeyword:{dark:"defaultAccentDark",light:"defaultAccentLight"},syntaxFunction:{dark:"defaultPrimaryDark",light:"defaultPrimaryLight"},syntaxVariable:{dark:"defaultTextDark",light:"defaultTextLight"},syntaxString:{dark:"defaultOkDark",light:"defaultOkLight"},syntaxNumber:{dark:"defaultAccentDark",light:"defaultAccentLight"},syntaxType:{dark:"defaultSecondaryDark",light:"defaultSecondaryLight"},syntaxOperator:{dark:"defaultSecondaryDark",light:"defaultSecondaryLight"},syntaxPunctuation:{dark:"defaultTextDark",light:"defaultTextLight"}}};var dracula_default={$schema:"https://opencode.ai/theme.json",defs:{background:"#282a36",currentLine:"#44475a",selection:"#44475a",foreground:"#f8f8f2",comment:"#6272a4",cyan:"#8be9fd",green:"#50fa7b",orange:"#ffb86c",pink:"#ff79c6",purple:"#bd93f9",red:"#ff5555",yellow:"#f1fa8c"},theme:{primary:{dark:"purple",light:"purple"},secondary:{dark:"pink",light:"pink"},accent:{dark:"cyan",light:"cyan"},error:{dark:"red",light:"red"},warning:{dark:"yellow",light:"yellow"},success:{dark:"green",light:"green"},info:{dark:"orange",light:"orange"},text:{dark:"foreground",light:"#282a36"},textMuted:{dark:"comment",light:"#6272a4"},background:{dark:"#282a36",light:"#f8f8f2"},backgroundPanel:{dark:"#21222c",light:"#e8e8e2"},backgroundElement:{dark:"currentLine",light:"#d8d8d2"},border:{dark:"currentLine",light:"#c8c8c2"},borderActive:{dark:"purple",light:"purple"},borderSubtle:{dark:"#191a21",light:"#e0e0e0"},diffAdded:{dark:"green",light:"green"},diffRemoved:{dark:"red",light:"red"},diffContext:{dark:"comment",light:"#6272a4"},diffHunkHeader:{dark:"comment",light:"#6272a4"},diffHighlightAdded:{dark:"green",light:"green"},diffHighlightRemoved:{dark:"red",light:"red"},diffAddedBg:{dark:"#1a3a1a",light:"#e0ffe0"},diffRemovedBg:{dark:"#3a1a1a",light:"#ffe0e0"},diffContextBg:{dark:"#21222c",light:"#e8e8e2"},diffLineNumber:{dark:"currentLine",light:"#c8c8c2"},diffAddedLineNumberBg:{dark:"#1a3a1a",light:"#e0ffe0"},diffRemovedLineNumberBg:{dark:"#3a1a1a",light:"#ffe0e0"},markdownText:{dark:"foreground",light:"#282a36"},markdownHeading:{dark:"purple",light:"purple"},markdownLink:{dark:"cyan",light:"cyan"},markdownLinkText:{dark:"pink",light:"pink"},markdownCode:{dark:"green",light:"green"},markdownBlockQuote:{dark:"comment",light:"#6272a4"},markdownEmph:{dark:"yellow",light:"yellow"},markdownStrong:{dark:"orange",light:"orange"},markdownHorizontalRule:{dark:"comment",light:"#6272a4"},markdownListItem:{dark:"purple",light:"purple"},markdownListEnumeration:{dark:"cyan",light:"cyan"},markdownImage:{dark:"cyan",light:"cyan"},markdownImageText:{dark:"pink",light:"pink"},markdownCodeBlock:{dark:"foreground",light:"#282a36"},syntaxComment:{dark:"comment",light:"#6272a4"},syntaxKeyword:{dark:"pink",light:"pink"},syntaxFunction:{dark:"green",light:"green"},syntaxVariable:{dark:"foreground",light:"#282a36"},syntaxString:{dark:"yellow",light:"yellow"},syntaxNumber:{dark:"purple",light:"purple"},syntaxType:{dark:"cyan",light:"cyan"},syntaxOperator:{dark:"pink",light:"pink"},syntaxPunctuation:{dark:"foreground",light:"#282a36"}}};var everforest_default={$schema:"https://opencode.ai/theme.json",defs:{darkStep1:"#2d353b",darkStep2:"#333c43",darkStep3:"#343f44",darkStep4:"#3d484d",darkStep5:"#475258",darkStep6:"#7a8478",darkStep7:"#859289",darkStep8:"#9da9a0",darkStep9:"#a7c080",darkStep10:"#83c092",darkStep11:"#7a8478",darkStep12:"#d3c6aa",darkRed:"#e67e80",darkOrange:"#e69875",darkGreen:"#a7c080",darkCyan:"#83c092",darkYellow:"#dbbc7f",lightStep1:"#fdf6e3",lightStep2:"#efebd4",lightStep3:"#f4f0d9",lightStep4:"#efebd4",lightStep5:"#e6e2cc",lightStep6:"#a6b0a0",lightStep7:"#939f91",lightStep8:"#829181",lightStep9:"#8da101",lightStep10:"#35a77c",lightStep11:"#a6b0a0",lightStep12:"#5c6a72",lightRed:"#f85552",lightOrange:"#f57d26",lightGreen:"#8da101",lightCyan:"#35a77c",lightYellow:"#dfa000"},theme:{primary:{dark:"darkStep9",light:"lightStep9"},secondary:{dark:"#7fbbb3",light:"#3a94c5"},accent:{dark:"#d699b6",light:"#df69ba"},error:{dark:"darkRed",light:"lightRed"},warning:{dark:"darkOrange",light:"lightOrange"},success:{dark:"darkGreen",light:"lightGreen"},info:{dark:"darkCyan",light:"lightCyan"},text:{dark:"darkStep12",light:"lightStep12"},textMuted:{dark:"darkStep11",light:"lightStep11"},background:{dark:"darkStep1",light:"lightStep1"},backgroundPanel:{dark:"darkStep2",light:"lightStep2"},backgroundElement:{dark:"darkStep3",light:"lightStep3"},border:{dark:"darkStep7",light:"lightStep7"},borderActive:{dark:"darkStep8",light:"lightStep8"},borderSubtle:{dark:"darkStep6",light:"lightStep6"},diffAdded:{dark:"#4fd6be",light:"#1e725c"},diffRemoved:{dark:"#c53b53",light:"#c53b53"},diffContext:{dark:"#828bb8",light:"#7086b5"},diffHunkHeader:{dark:"#828bb8",light:"#7086b5"},diffHighlightAdded:{dark:"#b8db87",light:"#4db380"},diffHighlightRemoved:{dark:"#e26a75",light:"#f52a65"},diffAddedBg:{dark:"#20303b",light:"#d5e5d5"},diffRemovedBg:{dark:"#37222c",light:"#f7d8db"},diffContextBg:{dark:"darkStep2",light:"lightStep2"},diffLineNumber:{dark:"darkStep3",light:"lightStep3"},diffAddedLineNumberBg:{dark:"#1b2b34",light:"#c5d5c5"},diffRemovedLineNumberBg:{dark:"#2d1f26",light:"#e7c8cb"},markdownText:{dark:"darkStep12",light:"lightStep12"},markdownHeading:{dark:"#d699b6",light:"#df69ba"},markdownLink:{dark:"darkStep9",light:"lightStep9"},markdownLinkText:{dark:"darkCyan",light:"lightCyan"},markdownCode:{dark:"darkGreen",light:"lightGreen"},markdownBlockQuote:{dark:"darkYellow",light:"lightYellow"},markdownEmph:{dark:"darkYellow",light:"lightYellow"},markdownStrong:{dark:"darkOrange",light:"lightOrange"},markdownHorizontalRule:{dark:"darkStep11",light:"lightStep11"},markdownListItem:{dark:"darkStep9",light:"lightStep9"},markdownListEnumeration:{dark:"darkCyan",light:"lightCyan"},markdownImage:{dark:"darkStep9",light:"lightStep9"},markdownImageText:{dark:"darkCyan",light:"lightCyan"},markdownCodeBlock:{dark:"darkStep12",light:"lightStep12"},syntaxComment:{dark:"darkStep11",light:"lightStep11"},syntaxKeyword:{dark:"#d699b6",light:"#df69ba"},syntaxFunction:{dark:"darkStep9",light:"lightStep9"},syntaxVariable:{dark:"darkRed",light:"lightRed"},syntaxString:{dark:"darkGreen",light:"lightGreen"},syntaxNumber:{dark:"darkOrange",light:"lightOrange"},syntaxType:{dark:"darkYellow",light:"lightYellow"},syntaxOperator:{dark:"darkCyan",light:"lightCyan"},syntaxPunctuation:{dark:"darkStep12",light:"lightStep12"}}};var flexoki_default={$schema:"https://opencode.ai/theme.json",defs:{black:"#100F0F",base950:"#1C1B1A",base900:"#282726",base850:"#343331",base800:"#403E3C",base700:"#575653",base600:"#6F6E69",base500:"#878580",base300:"#B7B5AC",base200:"#CECDC3",base150:"#DAD8CE",base100:"#E6E4D9",base50:"#F2F0E5",paper:"#FFFCF0",red400:"#D14D41",red600:"#AF3029",orange400:"#DA702C",orange600:"#BC5215",yellow400:"#D0A215",yellow600:"#AD8301",green400:"#879A39",green600:"#66800B",cyan400:"#3AA99F",cyan600:"#24837B",blue400:"#4385BE",blue600:"#205EA6",purple400:"#8B7EC8",purple600:"#5E409D",magenta400:"#CE5D97",magenta600:"#A02F6F"},theme:{primary:{dark:"orange400",light:"blue600"},secondary:{dark:"blue400",light:"purple600"},accent:{dark:"purple400",light:"orange600"},error:{dark:"red400",light:"red600"},warning:{dark:"orange400",light:"orange600"},success:{dark:"green400",light:"green600"},info:{dark:"cyan400",light:"cyan600"},text:{dark:"base200",light:"black"},textMuted:{dark:"base600",light:"base600"},background:{dark:"black",light:"paper"},backgroundPanel:{dark:"base950",light:"base50"},backgroundElement:{dark:"base900",light:"base100"},border:{dark:"base700",light:"base300"},borderActive:{dark:"base600",light:"base500"},borderSubtle:{dark:"base800",light:"base200"},diffAdded:{dark:"green400",light:"green600"},diffRemoved:{dark:"red400",light:"red600"},diffContext:{dark:"base600",light:"base600"},diffHunkHeader:{dark:"blue400",light:"blue600"},diffHighlightAdded:{dark:"green400",light:"green600"},diffHighlightRemoved:{dark:"red400",light:"red600"},diffAddedBg:{dark:"#1A2D1A",light:"#D5E5D5"},diffRemovedBg:{dark:"#2D1A1A",light:"#F7D8DB"},diffContextBg:{dark:"base950",light:"base50"},diffLineNumber:{dark:"base600",light:"base600"},diffAddedLineNumberBg:{dark:"#152515",light:"#C5D5C5"},diffRemovedLineNumberBg:{dark:"#251515",light:"#E7C8CB"},markdownText:{dark:"base200",light:"black"},markdownHeading:{dark:"purple400",light:"purple600"},markdownLink:{dark:"blue400",light:"blue600"},markdownLinkText:{dark:"cyan400",light:"cyan600"},markdownCode:{dark:"cyan400",light:"cyan600"},markdownBlockQuote:{dark:"yellow400",light:"yellow600"},markdownEmph:{dark:"yellow400",light:"yellow600"},markdownStrong:{dark:"orange400",light:"orange600"},markdownHorizontalRule:{dark:"base600",light:"base600"},markdownListItem:{dark:"orange400",light:"orange600"},markdownListEnumeration:{dark:"cyan400",light:"cyan600"},markdownImage:{dark:"magenta400",light:"magenta600"},markdownImageText:{dark:"cyan400",light:"cyan600"},markdownCodeBlock:{dark:"base200",light:"black"},syntaxComment:{dark:"base600",light:"base600"},syntaxKeyword:{dark:"green400",light:"green600"},syntaxFunction:{dark:"orange400",light:"orange600"},syntaxVariable:{dark:"blue400",light:"blue600"},syntaxString:{dark:"cyan400",light:"cyan600"},syntaxNumber:{dark:"purple400",light:"purple600"},syntaxType:{dark:"yellow400",light:"yellow600"},syntaxOperator:{dark:"base300",light:"base600"},syntaxPunctuation:{dark:"base300",light:"base600"}}};var github_default={$schema:"https://opencode.ai/theme.json",defs:{darkBg:"#0d1117",darkBgAlt:"#010409",darkBgPanel:"#161b22",darkFg:"#c9d1d9",darkFgMuted:"#8b949e",darkBlue:"#58a6ff",darkGreen:"#3fb950",darkRed:"#f85149",darkOrange:"#d29922",darkPurple:"#bc8cff",darkPink:"#ff7b72",darkYellow:"#e3b341",darkCyan:"#39c5cf",lightBg:"#ffffff",lightBgAlt:"#f6f8fa",lightBgPanel:"#f0f3f6",lightFg:"#24292f",lightFgMuted:"#57606a",lightBlue:"#0969da",lightGreen:"#1a7f37",lightRed:"#cf222e",lightOrange:"#bc4c00",lightPurple:"#8250df",lightPink:"#bf3989",lightYellow:"#9a6700",lightCyan:"#1b7c83"},theme:{primary:{dark:"darkBlue",light:"lightBlue"},secondary:{dark:"darkPurple",light:"lightPurple"},accent:{dark:"darkCyan",light:"lightCyan"},error:{dark:"darkRed",light:"lightRed"},warning:{dark:"darkYellow",light:"lightYellow"},success:{dark:"darkGreen",light:"lightGreen"},info:{dark:"darkOrange",light:"lightOrange"},text:{dark:"darkFg",light:"lightFg"},textMuted:{dark:"darkFgMuted",light:"lightFgMuted"},background:{dark:"darkBg",light:"lightBg"},backgroundPanel:{dark:"darkBgAlt",light:"lightBgAlt"},backgroundElement:{dark:"darkBgPanel",light:"lightBgPanel"},border:{dark:"#30363d",light:"#d0d7de"},borderActive:{dark:"darkBlue",light:"lightBlue"},borderSubtle:{dark:"#21262d",light:"#d8dee4"},diffAdded:{dark:"darkGreen",light:"lightGreen"},diffRemoved:{dark:"darkRed",light:"lightRed"},diffContext:{dark:"darkFgMuted",light:"lightFgMuted"},diffHunkHeader:{dark:"darkBlue",light:"lightBlue"},diffHighlightAdded:{dark:"#3fb950",light:"#1a7f37"},diffHighlightRemoved:{dark:"#f85149",light:"#cf222e"},diffAddedBg:{dark:"#033a16",light:"#dafbe1"},diffRemovedBg:{dark:"#67060c",light:"#ffebe9"},diffContextBg:{dark:"darkBgAlt",light:"lightBgAlt"},diffLineNumber:{dark:"#484f58",light:"#afb8c1"},diffAddedLineNumberBg:{dark:"#033a16",light:"#dafbe1"},diffRemovedLineNumberBg:{dark:"#67060c",light:"#ffebe9"},markdownText:{dark:"darkFg",light:"lightFg"},markdownHeading:{dark:"darkBlue",light:"lightBlue"},markdownLink:{dark:"darkBlue",light:"lightBlue"},markdownLinkText:{dark:"darkCyan",light:"lightCyan"},markdownCode:{dark:"darkPink",light:"lightPink"},markdownBlockQuote:{dark:"darkFgMuted",light:"lightFgMuted"},markdownEmph:{dark:"darkYellow",light:"lightYellow"},markdownStrong:{dark:"darkOrange",light:"lightOrange"},markdownHorizontalRule:{dark:"#30363d",light:"#d0d7de"},markdownListItem:{dark:"darkBlue",light:"lightBlue"},markdownListEnumeration:{dark:"darkCyan",light:"lightCyan"},markdownImage:{dark:"darkBlue",light:"lightBlue"},markdownImageText:{dark:"darkCyan",light:"lightCyan"},markdownCodeBlock:{dark:"darkFg",light:"lightFg"},syntaxComment:{dark:"darkFgMuted",light:"lightFgMuted"},syntaxKeyword:{dark:"darkPink",light:"lightRed"},syntaxFunction:{dark:"darkPurple",light:"lightPurple"},syntaxVariable:{dark:"darkOrange",light:"lightOrange"},syntaxString:{dark:"darkCyan",light:"lightBlue"},syntaxNumber:{dark:"darkBlue",light:"lightCyan"},syntaxType:{dark:"darkOrange",light:"lightOrange"},syntaxOperator:{dark:"darkPink",light:"lightRed"},syntaxPunctuation:{dark:"darkFg",light:"lightFg"}}};var gruvbox_default={$schema:"https://opencode.ai/theme.json",defs:{darkBg0:"#282828",darkBg1:"#3c3836",darkBg2:"#504945",darkBg3:"#665c54",darkFg0:"#fbf1c7",darkFg1:"#ebdbb2",darkGray:"#928374",darkRed:"#cc241d",darkGreen:"#98971a",darkYellow:"#d79921",darkBlue:"#458588",darkPurple:"#b16286",darkAqua:"#689d6a",darkOrange:"#d65d0e",darkRedBright:"#fb4934",darkGreenBright:"#b8bb26",darkYellowBright:"#fabd2f",darkBlueBright:"#83a598",darkPurpleBright:"#d3869b",darkAquaBright:"#8ec07c",darkOrangeBright:"#fe8019",lightBg0:"#fbf1c7",lightBg1:"#ebdbb2",lightBg2:"#d5c4a1",lightBg3:"#bdae93",lightFg0:"#282828",lightFg1:"#3c3836",lightGray:"#7c6f64",lightRed:"#9d0006",lightGreen:"#79740e",lightYellow:"#b57614",lightBlue:"#076678",lightPurple:"#8f3f71",lightAqua:"#427b58",lightOrange:"#af3a03"},theme:{primary:{dark:"darkBlueBright",light:"lightBlue"},secondary:{dark:"darkPurpleBright",light:"lightPurple"},accent:{dark:"darkAquaBright",light:"lightAqua"},error:{dark:"darkRedBright",light:"lightRed"},warning:{dark:"darkOrangeBright",light:"lightOrange"},success:{dark:"darkGreenBright",light:"lightGreen"},info:{dark:"darkYellowBright",light:"lightYellow"},text:{dark:"darkFg1",light:"lightFg1"},textMuted:{dark:"darkGray",light:"lightGray"},background:{dark:"darkBg0",light:"lightBg0"},backgroundPanel:{dark:"darkBg1",light:"lightBg1"},backgroundElement:{dark:"darkBg2",light:"lightBg2"},border:{dark:"darkBg3",light:"lightBg3"},borderActive:{dark:"darkFg1",light:"lightFg1"},borderSubtle:{dark:"darkBg2",light:"lightBg2"},diffAdded:{dark:"darkGreen",light:"lightGreen"},diffRemoved:{dark:"darkRed",light:"lightRed"},diffContext:{dark:"darkGray",light:"lightGray"},diffHunkHeader:{dark:"darkAqua",light:"lightAqua"},diffHighlightAdded:{dark:"darkGreenBright",light:"lightGreen"},diffHighlightRemoved:{dark:"darkRedBright",light:"lightRed"},diffAddedBg:{dark:"#32302f",light:"#dcd8a4"},diffRemovedBg:{dark:"#322929",light:"#e2c7c3"},diffContextBg:{dark:"darkBg1",light:"lightBg1"},diffLineNumber:{dark:"darkBg3",light:"lightBg3"},diffAddedLineNumberBg:{dark:"#2a2827",light:"#cec99e"},diffRemovedLineNumberBg:{dark:"#2a2222",light:"#d3bdb9"},markdownText:{dark:"darkFg1",light:"lightFg1"},markdownHeading:{dark:"darkBlueBright",light:"lightBlue"},markdownLink:{dark:"darkAquaBright",light:"lightAqua"},markdownLinkText:{dark:"darkGreenBright",light:"lightGreen"},markdownCode:{dark:"darkYellowBright",light:"lightYellow"},markdownBlockQuote:{dark:"darkGray",light:"lightGray"},markdownEmph:{dark:"darkPurpleBright",light:"lightPurple"},markdownStrong:{dark:"darkOrangeBright",light:"lightOrange"},markdownHorizontalRule:{dark:"darkGray",light:"lightGray"},markdownListItem:{dark:"darkBlueBright",light:"lightBlue"},markdownListEnumeration:{dark:"darkAquaBright",light:"lightAqua"},markdownImage:{dark:"darkAquaBright",light:"lightAqua"},markdownImageText:{dark:"darkGreenBright",light:"lightGreen"},markdownCodeBlock:{dark:"darkFg1",light:"lightFg1"},syntaxComment:{dark:"darkGray",light:"lightGray"},syntaxKeyword:{dark:"darkRedBright",light:"lightRed"},syntaxFunction:{dark:"darkGreenBright",light:"lightGreen"},syntaxVariable:{dark:"darkBlueBright",light:"lightBlue"},syntaxString:{dark:"darkYellowBright",light:"lightYellow"},syntaxNumber:{dark:"darkPurpleBright",light:"lightPurple"},syntaxType:{dark:"darkAquaBright",light:"lightAqua"},syntaxOperator:{dark:"darkOrangeBright",light:"lightOrange"},syntaxPunctuation:{dark:"darkFg1",light:"lightFg1"}}};var kanagawa_default={$schema:"https://opencode.ai/theme.json",defs:{sumiInk0:"#1F1F28",sumiInk1:"#2A2A37",sumiInk2:"#363646",sumiInk3:"#54546D",fujiWhite:"#DCD7BA",oldWhite:"#C8C093",fujiGray:"#727169",oniViolet:"#957FB8",crystalBlue:"#7E9CD8",carpYellow:"#C38D9D",sakuraPink:"#D27E99",waveAqua:"#76946A",roninYellow:"#D7A657",dragonRed:"#E82424",lotusGreen:"#98BB6C",waveBlue:"#2D4F67",lightBg:"#F2E9DE",lightPaper:"#EAE4D7",lightText:"#54433A",lightGray:"#9E9389"},theme:{primary:{dark:"crystalBlue",light:"waveBlue"},secondary:{dark:"oniViolet",light:"oniViolet"},accent:{dark:"sakuraPink",light:"sakuraPink"},error:{dark:"dragonRed",light:"dragonRed"},warning:{dark:"roninYellow",light:"roninYellow"},success:{dark:"lotusGreen",light:"lotusGreen"},info:{dark:"waveAqua",light:"waveAqua"},text:{dark:"fujiWhite",light:"lightText"},textMuted:{dark:"fujiGray",light:"lightGray"},background:{dark:"sumiInk0",light:"lightBg"},backgroundPanel:{dark:"sumiInk1",light:"lightPaper"},backgroundElement:{dark:"sumiInk2",light:"#E3DCD2"},border:{dark:"sumiInk3",light:"#D4CBBF"},borderActive:{dark:"carpYellow",light:"carpYellow"},borderSubtle:{dark:"sumiInk2",light:"#DCD4C9"},diffAdded:{dark:"lotusGreen",light:"lotusGreen"},diffRemoved:{dark:"dragonRed",light:"dragonRed"},diffContext:{dark:"fujiGray",light:"lightGray"},diffHunkHeader:{dark:"waveBlue",light:"waveBlue"},diffHighlightAdded:{dark:"#A9D977",light:"#89AF5B"},diffHighlightRemoved:{dark:"#F24A4A",light:"#D61F1F"},diffAddedBg:{dark:"#252E25",light:"#EAF3E4"},diffRemovedBg:{dark:"#362020",light:"#FBE6E6"},diffContextBg:{dark:"sumiInk1",light:"lightPaper"},diffLineNumber:{dark:"sumiInk3",light:"#C7BEB4"},diffAddedLineNumberBg:{dark:"#202820",light:"#DDE8D6"},diffRemovedLineNumberBg:{dark:"#2D1C1C",light:"#F2DADA"},markdownText:{dark:"fujiWhite",light:"lightText"},markdownHeading:{dark:"oniViolet",light:"oniViolet"},markdownLink:{dark:"crystalBlue",light:"waveBlue"},markdownLinkText:{dark:"waveAqua",light:"waveAqua"},markdownCode:{dark:"lotusGreen",light:"lotusGreen"},markdownBlockQuote:{dark:"fujiGray",light:"lightGray"},markdownEmph:{dark:"carpYellow",light:"carpYellow"},markdownStrong:{dark:"roninYellow",light:"roninYellow"},markdownHorizontalRule:{dark:"fujiGray",light:"lightGray"},markdownListItem:{dark:"crystalBlue",light:"waveBlue"},markdownListEnumeration:{dark:"waveAqua",light:"waveAqua"},markdownImage:{dark:"crystalBlue",light:"waveBlue"},markdownImageText:{dark:"waveAqua",light:"waveAqua"},markdownCodeBlock:{dark:"fujiWhite",light:"lightText"},syntaxComment:{dark:"fujiGray",light:"lightGray"},syntaxKeyword:{dark:"oniViolet",light:"oniViolet"},syntaxFunction:{dark:"crystalBlue",light:"waveBlue"},syntaxVariable:{dark:"fujiWhite",light:"lightText"},syntaxString:{dark:"lotusGreen",light:"lotusGreen"},syntaxNumber:{dark:"roninYellow",light:"roninYellow"},syntaxType:{dark:"carpYellow",light:"carpYellow"},syntaxOperator:{dark:"sakuraPink",light:"sakuraPink"},syntaxPunctuation:{dark:"fujiWhite",light:"lightText"}}};var lucent_orng_default={$schema:"https://opencode.ai/theme.json",defs:{darkStep6:"#3c3c3c",darkStep11:"#808080",darkStep12:"#eeeeee",darkSecondary:"#EE7948",darkAccent:"#FFF7F1",darkRed:"#e06c75",darkOrange:"#EC5B2B",darkBlue:"#6ba1e6",darkCyan:"#56b6c2",darkYellow:"#e5c07b",darkPanelBg:"#2a1a1599",lightStep6:"#d4d4d4",lightStep11:"#8a8a8a",lightStep12:"#1a1a1a",lightSecondary:"#EE7948",lightAccent:"#c94d24",lightRed:"#d1383d",lightOrange:"#EC5B2B",lightBlue:"#0062d1",lightCyan:"#318795",lightYellow:"#b0851f",lightPanelBg:"#fff5f099"},theme:{primary:{dark:"darkOrange",light:"lightOrange"},secondary:{dark:"darkSecondary",light:"lightSecondary"},accent:{dark:"darkAccent",light:"lightAccent"},error:{dark:"darkRed",light:"lightRed"},warning:{dark:"darkOrange",light:"lightOrange"},success:{dark:"darkBlue",light:"lightBlue"},info:{dark:"darkCyan",light:"lightCyan"},text:{dark:"darkStep12",light:"lightStep12"},textMuted:{dark:"darkStep11",light:"lightStep11"},selectedListItemText:{dark:"#0a0a0a",light:"#ffffff"},background:{dark:"transparent",light:"transparent"},backgroundPanel:{dark:"transparent",light:"transparent"},backgroundElement:{dark:"transparent",light:"transparent"},backgroundMenu:{dark:"darkPanelBg",light:"lightPanelBg"},border:{dark:"darkOrange",light:"lightOrange"},borderActive:{dark:"darkSecondary",light:"lightAccent"},borderSubtle:{dark:"darkStep6",light:"lightStep6"},diffAdded:{dark:"darkBlue",light:"lightBlue"},diffRemoved:{dark:"#c53b53",light:"#c53b53"},diffContext:{dark:"#828bb8",light:"#7086b5"},diffHunkHeader:{dark:"#828bb8",light:"#7086b5"},diffHighlightAdded:{dark:"darkBlue",light:"lightBlue"},diffHighlightRemoved:{dark:"#e26a75",light:"#f52a65"},diffAddedBg:{dark:"transparent",light:"transparent"},diffRemovedBg:{dark:"transparent",light:"transparent"},diffContextBg:{dark:"transparent",light:"transparent"},diffLineNumber:{dark:"#666666",light:"#999999"},diffAddedLineNumberBg:{dark:"transparent",light:"transparent"},diffRemovedLineNumberBg:{dark:"transparent",light:"transparent"},markdownText:{dark:"darkStep12",light:"lightStep12"},markdownHeading:{dark:"darkOrange",light:"lightOrange"},markdownLink:{dark:"darkOrange",light:"lightOrange"},markdownLinkText:{dark:"darkCyan",light:"lightCyan"},markdownCode:{dark:"darkBlue",light:"lightBlue"},markdownBlockQuote:{dark:"darkAccent",light:"lightYellow"},markdownEmph:{dark:"darkYellow",light:"lightYellow"},markdownStrong:{dark:"darkSecondary",light:"lightOrange"},markdownHorizontalRule:{dark:"darkStep11",light:"lightStep11"},markdownListItem:{dark:"darkOrange",light:"lightOrange"},markdownListEnumeration:{dark:"darkCyan",light:"lightCyan"},markdownImage:{dark:"darkOrange",light:"lightOrange"},markdownImageText:{dark:"darkCyan",light:"lightCyan"},markdownCodeBlock:{dark:"darkStep12",light:"lightStep12"},syntaxComment:{dark:"darkStep11",light:"lightStep11"},syntaxKeyword:{dark:"darkOrange",light:"lightOrange"},syntaxFunction:{dark:"darkSecondary",light:"lightAccent"},syntaxVariable:{dark:"darkRed",light:"lightRed"},syntaxString:{dark:"darkBlue",light:"lightBlue"},syntaxNumber:{dark:"darkAccent",light:"lightOrange"},syntaxType:{dark:"darkYellow",light:"lightYellow"},syntaxOperator:{dark:"darkCyan",light:"lightCyan"},syntaxPunctuation:{dark:"darkStep12",light:"lightStep12"}}};var material_default={$schema:"https://opencode.ai/theme.json",defs:{darkBg:"#263238",darkBgAlt:"#1e272c",darkBgPanel:"#37474f",darkFg:"#eeffff",darkFgMuted:"#546e7a",darkRed:"#f07178",darkPink:"#f78c6c",darkOrange:"#ffcb6b",darkYellow:"#ffcb6b",darkGreen:"#c3e88d",darkCyan:"#89ddff",darkBlue:"#82aaff",darkPurple:"#c792ea",darkViolet:"#bb80b3",lightBg:"#fafafa",lightBgAlt:"#f5f5f5",lightBgPanel:"#e7e7e8",lightFg:"#263238",lightFgMuted:"#90a4ae",lightRed:"#e53935",lightPink:"#ec407a",lightOrange:"#f4511e",lightYellow:"#ffb300",lightGreen:"#91b859",lightCyan:"#39adb5",lightBlue:"#6182b8",lightPurple:"#7c4dff",lightViolet:"#945eb8"},theme:{primary:{dark:"darkBlue",light:"lightBlue"},secondary:{dark:"darkPurple",light:"lightPurple"},accent:{dark:"darkCyan",light:"lightCyan"},error:{dark:"darkRed",light:"lightRed"},warning:{dark:"darkYellow",light:"lightYellow"},success:{dark:"darkGreen",light:"lightGreen"},info:{dark:"darkOrange",light:"lightOrange"},text:{dark:"darkFg",light:"lightFg"},textMuted:{dark:"darkFgMuted",light:"lightFgMuted"},background:{dark:"darkBg",light:"lightBg"},backgroundPanel:{dark:"darkBgAlt",light:"lightBgAlt"},backgroundElement:{dark:"darkBgPanel",light:"lightBgPanel"},border:{dark:"#37474f",light:"#e0e0e0"},borderActive:{dark:"darkBlue",light:"lightBlue"},borderSubtle:{dark:"#1e272c",light:"#eeeeee"},diffAdded:{dark:"darkGreen",light:"lightGreen"},diffRemoved:{dark:"darkRed",light:"lightRed"},diffContext:{dark:"darkFgMuted",light:"lightFgMuted"},diffHunkHeader:{dark:"darkCyan",light:"lightCyan"},diffHighlightAdded:{dark:"darkGreen",light:"lightGreen"},diffHighlightRemoved:{dark:"darkRed",light:"lightRed"},diffAddedBg:{dark:"#2e3c2b",light:"#e8f5e9"},diffRemovedBg:{dark:"#3c2b2b",light:"#ffebee"},diffContextBg:{dark:"darkBgAlt",light:"lightBgAlt"},diffLineNumber:{dark:"#37474f",light:"#cfd8dc"},diffAddedLineNumberBg:{dark:"#2e3c2b",light:"#e8f5e9"},diffRemovedLineNumberBg:{dark:"#3c2b2b",light:"#ffebee"},markdownText:{dark:"darkFg",light:"lightFg"},markdownHeading:{dark:"darkBlue",light:"lightBlue"},markdownLink:{dark:"darkCyan",light:"lightCyan"},markdownLinkText:{dark:"darkPurple",light:"lightPurple"},markdownCode:{dark:"darkGreen",light:"lightGreen"},markdownBlockQuote:{dark:"darkFgMuted",light:"lightFgMuted"},markdownEmph:{dark:"darkYellow",light:"lightYellow"},markdownStrong:{dark:"darkOrange",light:"lightOrange"},markdownHorizontalRule:{dark:"#37474f",light:"#e0e0e0"},markdownListItem:{dark:"darkBlue",light:"lightBlue"},markdownListEnumeration:{dark:"darkCyan",light:"lightCyan"},markdownImage:{dark:"darkCyan",light:"lightCyan"},markdownImageText:{dark:"darkPurple",light:"lightPurple"},markdownCodeBlock:{dark:"darkFg",light:"lightFg"},syntaxComment:{dark:"darkFgMuted",light:"lightFgMuted"},syntaxKeyword:{dark:"darkPurple",light:"lightPurple"},syntaxFunction:{dark:"darkBlue",light:"lightBlue"},syntaxVariable:{dark:"darkFg",light:"lightFg"},syntaxString:{dark:"darkGreen",light:"lightGreen"},syntaxNumber:{dark:"darkOrange",light:"lightOrange"},syntaxType:{dark:"darkYellow",light:"lightYellow"},syntaxOperator:{dark:"darkCyan",light:"lightCyan"},syntaxPunctuation:{dark:"darkFg",light:"lightFg"}}};var matrix_default={$schema:"https://opencode.ai/theme.json",defs:{matrixInk0:"#0a0e0a",matrixInk1:"#0e130d",matrixInk2:"#141c12",matrixInk3:"#1e2a1b",rainGreen:"#2eff6a",rainGreenDim:"#1cc24b",rainGreenHi:"#62ff94",rainCyan:"#00efff",rainTeal:"#24f6d9",rainPurple:"#c770ff",rainOrange:"#ffa83d",alertRed:"#ff4b4b",alertYellow:"#e6ff57",alertBlue:"#30b3ff",rainGray:"#8ca391",lightBg:"#eef3ea",lightPaper:"#e4ebe1",lightInk1:"#dae1d7",lightText:"#203022",lightGray:"#748476"},theme:{primary:{dark:"rainGreen",light:"rainGreenDim"},secondary:{dark:"rainCyan",light:"rainTeal"},accent:{dark:"rainPurple",light:"rainPurple"},error:{dark:"alertRed",light:"alertRed"},warning:{dark:"alertYellow",light:"alertYellow"},success:{dark:"rainGreenHi",light:"rainGreenDim"},info:{dark:"alertBlue",light:"alertBlue"},text:{dark:"rainGreenHi",light:"lightText"},textMuted:{dark:"rainGray",light:"lightGray"},background:{dark:"matrixInk0",light:"lightBg"},backgroundPanel:{dark:"matrixInk1",light:"lightPaper"},backgroundElement:{dark:"matrixInk2",light:"lightInk1"},border:{dark:"matrixInk3",light:"lightGray"},borderActive:{dark:"rainGreen",light:"rainGreenDim"},borderSubtle:{dark:"matrixInk2",light:"lightInk1"},diffAdded:{dark:"rainGreenDim",light:"rainGreenDim"},diffRemoved:{dark:"alertRed",light:"alertRed"},diffContext:{dark:"rainGray",light:"lightGray"},diffHunkHeader:{dark:"alertBlue",light:"alertBlue"},diffHighlightAdded:{dark:"#77ffaf",light:"#5dac7e"},diffHighlightRemoved:{dark:"#ff7171",light:"#d53a3a"},diffAddedBg:{dark:"#132616",light:"#e0efde"},diffRemovedBg:{dark:"#261212",light:"#f9e5e5"},diffContextBg:{dark:"matrixInk1",light:"lightPaper"},diffLineNumber:{dark:"matrixInk3",light:"lightGray"},diffAddedLineNumberBg:{dark:"#0f1b11",light:"#d6e7d2"},diffRemovedLineNumberBg:{dark:"#1b1414",light:"#f2d2d2"},markdownText:{dark:"rainGreenHi",light:"lightText"},markdownHeading:{dark:"rainCyan",light:"rainTeal"},markdownLink:{dark:"alertBlue",light:"alertBlue"},markdownLinkText:{dark:"rainTeal",light:"rainTeal"},markdownCode:{dark:"rainGreenDim",light:"rainGreenDim"},markdownBlockQuote:{dark:"rainGray",light:"lightGray"},markdownEmph:{dark:"rainOrange",light:"rainOrange"},markdownStrong:{dark:"alertYellow",light:"alertYellow"},markdownHorizontalRule:{dark:"rainGray",light:"lightGray"},markdownListItem:{dark:"alertBlue",light:"alertBlue"},markdownListEnumeration:{dark:"rainTeal",light:"rainTeal"},markdownImage:{dark:"alertBlue",light:"alertBlue"},markdownImageText:{dark:"rainTeal",light:"rainTeal"},markdownCodeBlock:{dark:"rainGreenHi",light:"lightText"},syntaxComment:{dark:"rainGray",light:"lightGray"},syntaxKeyword:{dark:"rainPurple",light:"rainPurple"},syntaxFunction:{dark:"alertBlue",light:"alertBlue"},syntaxVariable:{dark:"rainGreenHi",light:"lightText"},syntaxString:{dark:"rainGreenDim",light:"rainGreenDim"},syntaxNumber:{dark:"rainOrange",light:"rainOrange"},syntaxType:{dark:"alertYellow",light:"alertYellow"},syntaxOperator:{dark:"rainTeal",light:"rainTeal"},syntaxPunctuation:{dark:"rainGreenHi",light:"lightText"}}};var mercury_default={$schema:"https://opencode.ai/theme.json",defs:{"purple-800":"#3442a6","purple-700":"#465bd1","purple-600":"#5266eb","purple-400":"#8da4f5","purple-300":"#a7b6f8","red-700":"#b0175f","red-600":"#d03275","red-400":"#fc92b4","green-700":"#036e43","green-600":"#188554","green-400":"#77c599","orange-700":"#a44200","orange-600":"#c45000","orange-400":"#fc9b6f","blue-600":"#007f95","blue-400":"#77becf","neutral-1000":"#10101a","neutral-950":"#171721","neutral-900":"#1e1e2a","neutral-800":"#272735","neutral-700":"#363644","neutral-600":"#535461","neutral-500":"#70707d","neutral-400":"#9d9da8","neutral-300":"#c3c3cc","neutral-200":"#dddde5","neutral-100":"#f4f5f9","neutral-050":"#fbfcfd","neutral-000":"#ffffff","neutral-150":"#ededf3","border-light":"#7073931a","border-light-subtle":"#7073930f","border-dark":"#b4b7c81f","border-dark-subtle":"#b4b7c814","diff-added-light":"#1885541a","diff-removed-light":"#d032751a","diff-added-dark":"#77c59933","diff-removed-dark":"#fc92b433"},theme:{primary:{light:"purple-600",dark:"purple-400"},secondary:{light:"purple-700",dark:"purple-300"},accent:{light:"purple-400",dark:"purple-400"},error:{light:"red-700",dark:"red-400"},warning:{light:"orange-700",dark:"orange-400"},success:{light:"green-700",dark:"green-400"},info:{light:"blue-600",dark:"blue-400"},text:{light:"neutral-700",dark:"neutral-200"},textMuted:{light:"neutral-500",dark:"neutral-400"},background:{light:"neutral-000",dark:"neutral-950"},backgroundPanel:{light:"neutral-050",dark:"neutral-1000"},backgroundElement:{light:"neutral-100",dark:"neutral-800"},border:{light:"border-light",dark:"border-dark"},borderActive:{light:"purple-600",dark:"purple-400"},borderSubtle:{light:"border-light-subtle",dark:"border-dark-subtle"},diffAdded:{light:"green-700",dark:"green-400"},diffRemoved:{light:"red-700",dark:"red-400"},diffContext:{light:"neutral-500",dark:"neutral-400"},diffHunkHeader:{light:"neutral-500",dark:"neutral-400"},diffHighlightAdded:{light:"green-700",dark:"green-400"},diffHighlightRemoved:{light:"red-700",dark:"red-400"},diffAddedBg:{light:"diff-added-light",dark:"diff-added-dark"},diffRemovedBg:{light:"diff-removed-light",dark:"diff-removed-dark"},diffContextBg:{light:"neutral-050",dark:"neutral-900"},diffLineNumber:{light:"neutral-600",dark:"neutral-300"},diffAddedLineNumberBg:{light:"diff-added-light",dark:"diff-added-dark"},diffRemovedLineNumberBg:{light:"diff-removed-light",dark:"diff-removed-dark"},markdownText:{light:"neutral-700",dark:"neutral-200"},markdownHeading:{light:"neutral-900",dark:"neutral-000"},markdownLink:{light:"purple-700",dark:"purple-400"},markdownLinkText:{light:"purple-600",dark:"purple-300"},markdownCode:{light:"green-700",dark:"green-400"},markdownBlockQuote:{light:"neutral-500",dark:"neutral-400"},markdownEmph:{light:"orange-700",dark:"orange-400"},markdownStrong:{light:"neutral-900",dark:"neutral-100"},markdownHorizontalRule:{light:"border-light",dark:"border-dark"},markdownListItem:{light:"neutral-900",dark:"neutral-000"},markdownListEnumeration:{light:"purple-600",dark:"purple-400"},markdownImage:{light:"purple-700",dark:"purple-400"},markdownImageText:{light:"purple-600",dark:"purple-300"},markdownCodeBlock:{light:"neutral-700",dark:"neutral-200"},syntaxComment:{light:"neutral-500",dark:"neutral-400"},syntaxKeyword:{light:"purple-700",dark:"purple-400"},syntaxFunction:{light:"purple-600",dark:"purple-400"},syntaxVariable:{light:"blue-600",dark:"blue-400"},syntaxString:{light:"green-700",dark:"green-400"},syntaxNumber:{light:"orange-700",dark:"orange-400"},syntaxType:{light:"blue-600",dark:"blue-400"},syntaxOperator:{light:"purple-700",dark:"purple-400"},syntaxPunctuation:{light:"neutral-700",dark:"neutral-200"}}};var mono_default={$schema:"https://opencode.ai/theme.json",defs:{monoBgDark:"#1F1F1F",monoPanelDark:"#272727",monoElemDark:"#2E2E2E",monoTextDark:"#c9d1d9",monoMutedDark:"#444444",monoPrimaryDark:"#e6edf3",monoAccentDark:"#aaaaaa",monoSecondaryDark:"#888888",monoBorderDark:"#555555",monoBorderSubtleDark:"#555555",monoBgLight:"#F8F8F8",monoPanelLight:"#EFEFEF",monoElemLight:"#E4E4E4",monoTextLight:"#1A1A1A",monoMutedLight:"#5A5A5A",monoPrimaryLight:"#6D96B9",monoAccentLight:"#727272",monoSecondaryLight:"#505050",monoBorderLight:"#D0D0D0",monoBorderSubtleLight:"#E0E0E0",monoOkDark:"#888888",monoErrorDark:"#cccccc",monoWarnDark:"#999999",monoOkLight:"#888888",monoErrorLight:"#8C8C8C",monoWarnLight:"#999999"},theme:{primary:{dark:"monoPrimaryDark",light:"monoPrimaryLight"},secondary:{dark:"monoSecondaryDark",light:"monoSecondaryLight"},accent:{dark:"monoAccentDark",light:"monoAccentLight"},error:{dark:"monoErrorDark",light:"monoErrorLight"},warning:{dark:"monoWarnDark",light:"monoWarnLight"},success:{dark:"monoOkDark",light:"monoOkLight"},info:{dark:"monoAccentDark",light:"monoAccentLight"},text:{dark:"monoTextDark",light:"monoTextLight"},textMuted:{dark:"monoMutedDark",light:"monoMutedLight"},background:{dark:"monoBgDark",light:"monoBgLight"},backgroundPanel:{dark:"monoPanelDark",light:"monoPanelLight"},backgroundElement:{dark:"monoElemDark",light:"monoElemLight"},border:{dark:"monoBorderDark",light:"monoBorderLight"},borderActive:{dark:"monoAccentDark",light:"monoAccentLight"},borderSubtle:{dark:"monoBorderSubtleDark",light:"monoBorderSubtleLight"},diffAdded:{dark:"monoOkDark",light:"monoOkLight"},diffRemoved:{dark:"monoErrorDark",light:"monoErrorLight"},diffContext:{dark:"monoMutedDark",light:"monoMutedLight"},diffHunkHeader:{dark:"monoMutedDark",light:"monoMutedLight"},diffHighlightAdded:{dark:"monoOkDark",light:"monoOkLight"},diffHighlightRemoved:{dark:"monoErrorDark",light:"monoErrorLight"},diffAddedBg:{dark:"#323232",light:"#E7E7E7"},diffRemovedBg:{dark:"#3E3E3E",light:"#E8E8E8"},diffContextBg:{dark:"monoPanelDark",light:"monoPanelLight"},diffLineNumber:{dark:"monoMutedDark",light:"monoMutedLight"},diffAddedLineNumberBg:{dark:"#2A2A2A",light:"#EFEFEF"},diffRemovedLineNumberBg:{dark:"#303030",light:"#EFEFEF"},markdownText:{dark:"monoTextDark",light:"monoTextLight"},markdownHeading:{dark:"monoPrimaryDark",light:"monoPrimaryLight"},markdownLink:{dark:"monoAccentDark",light:"monoAccentLight"},markdownLinkText:{dark:"monoSecondaryDark",light:"monoSecondaryLight"},markdownCode:{dark:"monoSecondaryDark",light:"monoSecondaryLight"},markdownBlockQuote:{dark:"monoMutedDark",light:"monoMutedLight"},markdownEmph:{dark:"monoAccentDark",light:"monoAccentLight"},markdownStrong:{dark:"monoPrimaryDark",light:"monoPrimaryLight"},markdownHorizontalRule:{dark:"monoBorderDark",light:"monoBorderLight"},markdownListItem:{dark:"monoTextDark",light:"monoTextLight"},markdownListEnumeration:{dark:"monoAccentDark",light:"monoAccentLight"},markdownImage:{dark:"monoAccentDark",light:"monoAccentLight"},markdownImageText:{dark:"monoMutedDark",light:"monoMutedLight"},markdownCodeBlock:{dark:"monoTextDark",light:"monoTextLight"},syntaxComment:{dark:"monoMutedDark",light:"monoMutedLight"},syntaxKeyword:{dark:"monoAccentDark",light:"monoAccentLight"},syntaxFunction:{dark:"monoPrimaryDark",light:"monoPrimaryLight"},syntaxVariable:{dark:"monoTextDark",light:"monoTextLight"},syntaxString:{dark:"monoOkDark",light:"monoOkLight"},syntaxNumber:{dark:"monoAccentDark",light:"monoAccentLight"},syntaxType:{dark:"monoSecondaryDark",light:"monoSecondaryLight"},syntaxOperator:{dark:"monoSecondaryDark",light:"monoSecondaryLight"},syntaxPunctuation:{dark:"monoTextDark",light:"monoTextLight"}}};var monokai_default={$schema:"https://opencode.ai/theme.json",defs:{background:"#272822",backgroundAlt:"#1e1f1c",backgroundPanel:"#3e3d32",foreground:"#f8f8f2",comment:"#75715e",red:"#f92672",orange:"#fd971f",lightOrange:"#e69f66",yellow:"#e6db74",green:"#a6e22e",cyan:"#66d9ef",blue:"#66d9ef",purple:"#ae81ff",pink:"#f92672"},theme:{primary:{dark:"cyan",light:"blue"},secondary:{dark:"purple",light:"purple"},accent:{dark:"green",light:"green"},error:{dark:"red",light:"red"},warning:{dark:"yellow",light:"orange"},success:{dark:"green",light:"green"},info:{dark:"orange",light:"orange"},text:{dark:"foreground",light:"#272822"},textMuted:{dark:"comment",light:"#75715e"},background:{dark:"#272822",light:"#fafafa"},backgroundPanel:{dark:"#1e1f1c",light:"#f0f0f0"},backgroundElement:{dark:"#3e3d32",light:"#e0e0e0"},border:{dark:"#3e3d32",light:"#d0d0d0"},borderActive:{dark:"cyan",light:"blue"},borderSubtle:{dark:"#1e1f1c",light:"#e8e8e8"},diffAdded:{dark:"green",light:"green"},diffRemoved:{dark:"red",light:"red"},diffContext:{dark:"comment",light:"#75715e"},diffHunkHeader:{dark:"comment",light:"#75715e"},diffHighlightAdded:{dark:"green",light:"green"},diffHighlightRemoved:{dark:"red",light:"red"},diffAddedBg:{dark:"#1a3a1a",light:"#e0ffe0"},diffRemovedBg:{dark:"#3a1a1a",light:"#ffe0e0"},diffContextBg:{dark:"#1e1f1c",light:"#f0f0f0"},diffLineNumber:{dark:"#3e3d32",light:"#d0d0d0"},diffAddedLineNumberBg:{dark:"#1a3a1a",light:"#e0ffe0"},diffRemovedLineNumberBg:{dark:"#3a1a1a",light:"#ffe0e0"},markdownText:{dark:"foreground",light:"#272822"},markdownHeading:{dark:"pink",light:"pink"},markdownLink:{dark:"cyan",light:"blue"},markdownLinkText:{dark:"purple",light:"purple"},markdownCode:{dark:"green",light:"green"},markdownBlockQuote:{dark:"comment",light:"#75715e"},markdownEmph:{dark:"yellow",light:"orange"},markdownStrong:{dark:"orange",light:"orange"},markdownHorizontalRule:{dark:"comment",light:"#75715e"},markdownListItem:{dark:"cyan",light:"blue"},markdownListEnumeration:{dark:"purple",light:"purple"},markdownImage:{dark:"cyan",light:"blue"},markdownImageText:{dark:"purple",light:"purple"},markdownCodeBlock:{dark:"foreground",light:"#272822"},syntaxComment:{dark:"comment",light:"#75715e"},syntaxKeyword:{dark:"pink",light:"pink"},syntaxFunction:{dark:"green",light:"green"},syntaxVariable:{dark:"foreground",light:"#272822"},syntaxString:{dark:"yellow",light:"orange"},syntaxNumber:{dark:"purple",light:"purple"},syntaxType:{dark:"cyan",light:"blue"},syntaxOperator:{dark:"pink",light:"pink"},syntaxPunctuation:{dark:"foreground",light:"#272822"}}};var nightowl_default={$schema:"https://opencode.ai/theme.json",defs:{nightOwlBg:"#011627",nightOwlFg:"#d6deeb",nightOwlBlue:"#82AAFF",nightOwlCyan:"#7fdbca",nightOwlGreen:"#c5e478",nightOwlYellow:"#ecc48d",nightOwlOrange:"#F78C6C",nightOwlRed:"#EF5350",nightOwlPink:"#ff5874",nightOwlPurple:"#c792ea",nightOwlMuted:"#5f7e97",nightOwlGray:"#637777",nightOwlLightGray:"#89a4bb",nightOwlPanel:"#0b253a"},theme:{primary:{dark:"nightOwlBlue",light:"nightOwlBlue"},secondary:{dark:"nightOwlCyan",light:"nightOwlCyan"},accent:{dark:"nightOwlPurple",light:"nightOwlPurple"},error:{dark:"nightOwlRed",light:"nightOwlRed"},warning:{dark:"nightOwlYellow",light:"nightOwlYellow"},success:{dark:"nightOwlGreen",light:"nightOwlGreen"},info:{dark:"nightOwlBlue",light:"nightOwlBlue"},text:{dark:"nightOwlFg",light:"nightOwlFg"},textMuted:{dark:"nightOwlMuted",light:"nightOwlMuted"},background:{dark:"nightOwlBg",light:"nightOwlBg"},backgroundPanel:{dark:"nightOwlPanel",light:"nightOwlPanel"},backgroundElement:{dark:"nightOwlPanel",light:"nightOwlPanel"},border:{dark:"nightOwlMuted",light:"nightOwlMuted"},borderActive:{dark:"nightOwlBlue",light:"nightOwlBlue"},borderSubtle:{dark:"nightOwlMuted",light:"nightOwlMuted"},diffAdded:{dark:"nightOwlGreen",light:"nightOwlGreen"},diffRemoved:{dark:"nightOwlRed",light:"nightOwlRed"},diffContext:{dark:"nightOwlMuted",light:"nightOwlMuted"},diffHunkHeader:{dark:"nightOwlMuted",light:"nightOwlMuted"},diffHighlightAdded:{dark:"nightOwlGreen",light:"nightOwlGreen"},diffHighlightRemoved:{dark:"nightOwlRed",light:"nightOwlRed"},diffAddedBg:{dark:"#0a2e1a",light:"#0a2e1a"},diffRemovedBg:{dark:"#2d1b1b",light:"#2d1b1b"},diffContextBg:{dark:"nightOwlPanel",light:"nightOwlPanel"},diffLineNumber:{dark:"nightOwlMuted",light:"nightOwlMuted"},diffAddedLineNumberBg:{dark:"#0a2e1a",light:"#0a2e1a"},diffRemovedLineNumberBg:{dark:"#2d1b1b",light:"#2d1b1b"},markdownText:{dark:"nightOwlFg",light:"nightOwlFg"},markdownHeading:{dark:"nightOwlBlue",light:"nightOwlBlue"},markdownLink:{dark:"nightOwlCyan",light:"nightOwlCyan"},markdownLinkText:{dark:"nightOwlBlue",light:"nightOwlBlue"},markdownCode:{dark:"nightOwlGreen",light:"nightOwlGreen"},markdownBlockQuote:{dark:"nightOwlMuted",light:"nightOwlMuted"},markdownEmph:{dark:"nightOwlPurple",light:"nightOwlPurple"},markdownStrong:{dark:"nightOwlYellow",light:"nightOwlYellow"},markdownHorizontalRule:{dark:"nightOwlMuted",light:"nightOwlMuted"},markdownListItem:{dark:"nightOwlBlue",light:"nightOwlBlue"},markdownListEnumeration:{dark:"nightOwlCyan",light:"nightOwlCyan"},markdownImage:{dark:"nightOwlCyan",light:"nightOwlCyan"},markdownImageText:{dark:"nightOwlBlue",light:"nightOwlBlue"},markdownCodeBlock:{dark:"nightOwlFg",light:"nightOwlFg"},syntaxComment:{dark:"nightOwlGray",light:"nightOwlGray"},syntaxKeyword:{dark:"nightOwlPurple",light:"nightOwlPurple"},syntaxFunction:{dark:"nightOwlBlue",light:"nightOwlBlue"},syntaxVariable:{dark:"nightOwlFg",light:"nightOwlFg"},syntaxString:{dark:"nightOwlYellow",light:"nightOwlYellow"},syntaxNumber:{dark:"nightOwlOrange",light:"nightOwlOrange"},syntaxType:{dark:"nightOwlGreen",light:"nightOwlGreen"},syntaxOperator:{dark:"nightOwlCyan",light:"nightOwlCyan"},syntaxPunctuation:{dark:"nightOwlFg",light:"nightOwlFg"}}};var nord_default={$schema:"https://opencode.ai/theme.json",defs:{nord0:"#2E3440",nord1:"#3B4252",nord2:"#434C5E",nord3:"#4C566A",nord4:"#D8DEE9",nord5:"#E5E9F0",nord6:"#ECEFF4",nord7:"#8FBCBB",nord8:"#88C0D0",nord9:"#81A1C1",nord10:"#5E81AC",nord11:"#BF616A",nord12:"#D08770",nord13:"#EBCB8B",nord14:"#A3BE8C",nord15:"#B48EAD"},theme:{primary:{dark:"nord8",light:"nord10"},secondary:{dark:"nord9",light:"nord9"},accent:{dark:"nord7",light:"nord7"},error:{dark:"nord11",light:"nord11"},warning:{dark:"nord12",light:"nord12"},success:{dark:"nord14",light:"nord14"},info:{dark:"nord8",light:"nord10"},text:{dark:"nord6",light:"nord0"},textMuted:{dark:"#8B95A7",light:"nord1"},background:{dark:"nord0",light:"nord6"},backgroundPanel:{dark:"nord1",light:"nord5"},backgroundElement:{dark:"nord2",light:"nord4"},border:{dark:"nord2",light:"nord3"},borderActive:{dark:"nord3",light:"nord2"},borderSubtle:{dark:"nord2",light:"nord3"},diffAdded:{dark:"nord14",light:"nord14"},diffRemoved:{dark:"nord11",light:"nord11"},diffContext:{dark:"#8B95A7",light:"nord3"},diffHunkHeader:{dark:"#8B95A7",light:"nord3"},diffHighlightAdded:{dark:"nord14",light:"nord14"},diffHighlightRemoved:{dark:"nord11",light:"nord11"},diffAddedBg:{dark:"#3B4252",light:"#E5E9F0"},diffRemovedBg:{dark:"#3B4252",light:"#E5E9F0"},diffContextBg:{dark:"nord1",light:"nord5"},diffLineNumber:{dark:"nord2",light:"nord4"},diffAddedLineNumberBg:{dark:"#3B4252",light:"#E5E9F0"},diffRemovedLineNumberBg:{dark:"#3B4252",light:"#E5E9F0"},markdownText:{dark:"nord4",light:"nord0"},markdownHeading:{dark:"nord8",light:"nord10"},markdownLink:{dark:"nord9",light:"nord9"},markdownLinkText:{dark:"nord7",light:"nord7"},markdownCode:{dark:"nord14",light:"nord14"},markdownBlockQuote:{dark:"#8B95A7",light:"nord3"},markdownEmph:{dark:"nord12",light:"nord12"},markdownStrong:{dark:"nord13",light:"nord13"},markdownHorizontalRule:{dark:"#8B95A7",light:"nord3"},markdownListItem:{dark:"nord8",light:"nord10"},markdownListEnumeration:{dark:"nord7",light:"nord7"},markdownImage:{dark:"nord9",light:"nord9"},markdownImageText:{dark:"nord7",light:"nord7"},markdownCodeBlock:{dark:"nord4",light:"nord0"},syntaxComment:{dark:"#8B95A7",light:"nord3"},syntaxKeyword:{dark:"nord9",light:"nord9"},syntaxFunction:{dark:"nord8",light:"nord8"},syntaxVariable:{dark:"nord7",light:"nord7"},syntaxString:{dark:"nord14",light:"nord14"},syntaxNumber:{dark:"nord15",light:"nord15"},syntaxType:{dark:"nord7",light:"nord7"},syntaxOperator:{dark:"nord9",light:"nord9"},syntaxPunctuation:{dark:"nord4",light:"nord0"}}};var one_dark_default={$schema:"https://opencode.ai/theme.json",defs:{darkBg:"#282c34",darkBgAlt:"#21252b",darkBgPanel:"#353b45",darkFg:"#abb2bf",darkFgMuted:"#5c6370",darkPurple:"#c678dd",darkBlue:"#61afef",darkRed:"#e06c75",darkGreen:"#98c379",darkYellow:"#e5c07b",darkOrange:"#d19a66",darkCyan:"#56b6c2",lightBg:"#fafafa",lightBgAlt:"#f0f0f1",lightBgPanel:"#eaeaeb",lightFg:"#383a42",lightFgMuted:"#a0a1a7",lightPurple:"#a626a4",lightBlue:"#4078f2",lightRed:"#e45649",lightGreen:"#50a14f",lightYellow:"#c18401",lightOrange:"#986801",lightCyan:"#0184bc"},theme:{primary:{dark:"darkBlue",light:"lightBlue"},secondary:{dark:"darkPurple",light:"lightPurple"},accent:{dark:"darkCyan",light:"lightCyan"},error:{dark:"darkRed",light:"lightRed"},warning:{dark:"darkYellow",light:"lightYellow"},success:{dark:"darkGreen",light:"lightGreen"},info:{dark:"darkOrange",light:"lightOrange"},text:{dark:"darkFg",light:"lightFg"},textMuted:{dark:"darkFgMuted",light:"lightFgMuted"},background:{dark:"darkBg",light:"lightBg"},backgroundPanel:{dark:"darkBgAlt",light:"lightBgAlt"},backgroundElement:{dark:"darkBgPanel",light:"lightBgPanel"},border:{dark:"#393f4a",light:"#d1d1d2"},borderActive:{dark:"darkBlue",light:"lightBlue"},borderSubtle:{dark:"#2c313a",light:"#e0e0e1"},diffAdded:{dark:"darkGreen",light:"lightGreen"},diffRemoved:{dark:"darkRed",light:"lightRed"},diffContext:{dark:"darkFgMuted",light:"lightFgMuted"},diffHunkHeader:{dark:"darkCyan",light:"lightCyan"},diffHighlightAdded:{dark:"#aad482",light:"#489447"},diffHighlightRemoved:{dark:"#e8828b",light:"#d65145"},diffAddedBg:{dark:"#2c382b",light:"#eafbe9"},diffRemovedBg:{dark:"#3a2d2f",light:"#fce9e8"},diffContextBg:{dark:"darkBgAlt",light:"lightBgAlt"},diffLineNumber:{dark:"#495162",light:"#c9c9ca"},diffAddedLineNumberBg:{dark:"#283427",light:"#e1f3df"},diffRemovedLineNumberBg:{dark:"#36292b",light:"#f5e2e1"},markdownText:{dark:"darkFg",light:"lightFg"},markdownHeading:{dark:"darkPurple",light:"lightPurple"},markdownLink:{dark:"darkBlue",light:"lightBlue"},markdownLinkText:{dark:"darkCyan",light:"lightCyan"},markdownCode:{dark:"darkGreen",light:"lightGreen"},markdownBlockQuote:{dark:"darkFgMuted",light:"lightFgMuted"},markdownEmph:{dark:"darkYellow",light:"lightYellow"},markdownStrong:{dark:"darkOrange",light:"lightOrange"},markdownHorizontalRule:{dark:"darkFgMuted",light:"lightFgMuted"},markdownListItem:{dark:"darkBlue",light:"lightBlue"},markdownListEnumeration:{dark:"darkCyan",light:"lightCyan"},markdownImage:{dark:"darkBlue",light:"lightBlue"},markdownImageText:{dark:"darkCyan",light:"lightCyan"},markdownCodeBlock:{dark:"darkFg",light:"lightFg"},syntaxComment:{dark:"darkFgMuted",light:"lightFgMuted"},syntaxKeyword:{dark:"darkPurple",light:"lightPurple"},syntaxFunction:{dark:"darkBlue",light:"lightBlue"},syntaxVariable:{dark:"darkRed",light:"lightRed"},syntaxString:{dark:"darkGreen",light:"lightGreen"},syntaxNumber:{dark:"darkOrange",light:"lightOrange"},syntaxType:{dark:"darkYellow",light:"lightYellow"},syntaxOperator:{dark:"darkCyan",light:"lightCyan"},syntaxPunctuation:{dark:"darkFg",light:"lightFg"}}};var opencode_default={$schema:"https://opencode.ai/theme.json",defs:{darkStep1:"#0a0a0a",darkStep2:"#141414",darkStep3:"#1e1e1e",darkStep4:"#282828",darkStep5:"#323232",darkStep6:"#3c3c3c",darkStep7:"#484848",darkStep8:"#606060",darkStep9:"#fab283",darkStep10:"#ffc09f",darkStep11:"#808080",darkStep12:"#eeeeee",darkSecondary:"#5c9cf5",darkAccent:"#9d7cd8",darkRed:"#e06c75",darkOrange:"#f5a742",darkGreen:"#7fd88f",darkCyan:"#56b6c2",darkYellow:"#e5c07b",lightStep1:"#ffffff",lightStep2:"#fafafa",lightStep3:"#f5f5f5",lightStep4:"#ebebeb",lightStep5:"#e1e1e1",lightStep6:"#d4d4d4",lightStep7:"#b8b8b8",lightStep8:"#a0a0a0",lightStep9:"#3b7dd8",lightStep10:"#2968c3",lightStep11:"#8a8a8a",lightStep12:"#1a1a1a",lightSecondary:"#7b5bb6",lightAccent:"#d68c27",lightRed:"#d1383d",lightOrange:"#d68c27",lightGreen:"#3d9a57",lightCyan:"#318795",lightYellow:"#b0851f"},theme:{primary:{dark:"darkStep9",light:"lightStep9"},secondary:{dark:"darkSecondary",light:"lightSecondary"},accent:{dark:"darkAccent",light:"lightAccent"},error:{dark:"darkRed",light:"lightRed"},warning:{dark:"darkOrange",light:"lightOrange"},success:{dark:"darkGreen",light:"lightGreen"},info:{dark:"darkCyan",light:"lightCyan"},text:{dark:"darkStep12",light:"lightStep12"},textMuted:{dark:"darkStep11",light:"lightStep11"},background:{dark:"darkStep1",light:"lightStep1"},backgroundPanel:{dark:"darkStep2",light:"lightStep2"},backgroundElement:{dark:"darkStep3",light:"lightStep3"},border:{dark:"darkStep7",light:"lightStep7"},borderActive:{dark:"darkStep8",light:"lightStep8"},borderSubtle:{dark:"darkStep6",light:"lightStep6"},diffAdded:{dark:"#4fd6be",light:"#1e725c"},diffRemoved:{dark:"#c53b53",light:"#c53b53"},diffContext:{dark:"#828bb8",light:"#7086b5"},diffHunkHeader:{dark:"#828bb8",light:"#7086b5"},diffHighlightAdded:{dark:"#b8db87",light:"#4db380"},diffHighlightRemoved:{dark:"#e26a75",light:"#f52a65"},diffAddedBg:{dark:"#20303b",light:"#d5e5d5"},diffRemovedBg:{dark:"#37222c",light:"#f7d8db"},diffContextBg:{dark:"darkStep2",light:"lightStep2"},diffLineNumber:{dark:"darkStep3",light:"lightStep3"},diffAddedLineNumberBg:{dark:"#1b2b34",light:"#c5d5c5"},diffRemovedLineNumberBg:{dark:"#2d1f26",light:"#e7c8cb"},markdownText:{dark:"darkStep12",light:"lightStep12"},markdownHeading:{dark:"darkAccent",light:"lightAccent"},markdownLink:{dark:"darkStep9",light:"lightStep9"},markdownLinkText:{dark:"darkCyan",light:"lightCyan"},markdownCode:{dark:"darkGreen",light:"lightGreen"},markdownBlockQuote:{dark:"darkYellow",light:"lightYellow"},markdownEmph:{dark:"darkYellow",light:"lightYellow"},markdownStrong:{dark:"darkOrange",light:"lightOrange"},markdownHorizontalRule:{dark:"darkStep11",light:"lightStep11"},markdownListItem:{dark:"darkStep9",light:"lightStep9"},markdownListEnumeration:{dark:"darkCyan",light:"lightCyan"},markdownImage:{dark:"darkStep9",light:"lightStep9"},markdownImageText:{dark:"darkCyan",light:"lightCyan"},markdownCodeBlock:{dark:"darkStep12",light:"lightStep12"},syntaxComment:{dark:"darkStep11",light:"lightStep11"},syntaxKeyword:{dark:"darkAccent",light:"lightAccent"},syntaxFunction:{dark:"darkStep9",light:"lightStep9"},syntaxVariable:{dark:"darkRed",light:"lightRed"},syntaxString:{dark:"darkGreen",light:"lightGreen"},syntaxNumber:{dark:"darkOrange",light:"lightOrange"},syntaxType:{dark:"darkYellow",light:"lightYellow"},syntaxOperator:{dark:"darkCyan",light:"lightCyan"},syntaxPunctuation:{dark:"darkStep12",light:"lightStep12"}}};var orng_default={$schema:"https://opencode.ai/theme.json",defs:{darkStep1:"#0a0a0a",darkStep2:"#141414",darkStep3:"#1e1e1e",darkStep4:"#282828",darkStep5:"#323232",darkStep6:"#3c3c3c",darkStep7:"#484848",darkStep8:"#606060",darkStep9:"#EC5B2B",darkStep10:"#EE7948",darkStep11:"#808080",darkStep12:"#eeeeee",darkSecondary:"#EE7948",darkAccent:"#FFF7F1",darkRed:"#e06c75",darkOrange:"#EC5B2B",darkBlue:"#6ba1e6",darkCyan:"#56b6c2",darkYellow:"#e5c07b",lightStep1:"#ffffff",lightStep2:"#FFF7F1",lightStep3:"#f5f0eb",lightStep4:"#ebebeb",lightStep5:"#e1e1e1",lightStep6:"#d4d4d4",lightStep7:"#b8b8b8",lightStep8:"#a0a0a0",lightStep9:"#EC5B2B",lightStep10:"#c94d24",lightStep11:"#8a8a8a",lightStep12:"#1a1a1a",lightSecondary:"#EE7948",lightAccent:"#c94d24",lightRed:"#d1383d",lightOrange:"#EC5B2B",lightBlue:"#0062d1",lightCyan:"#318795",lightYellow:"#b0851f"},theme:{primary:{dark:"darkStep9",light:"lightStep9"},secondary:{dark:"darkSecondary",light:"lightSecondary"},accent:{dark:"darkAccent",light:"lightAccent"},error:{dark:"darkRed",light:"lightRed"},warning:{dark:"darkOrange",light:"lightOrange"},success:{dark:"darkBlue",light:"lightBlue"},info:{dark:"darkCyan",light:"lightCyan"},text:{dark:"darkStep12",light:"lightStep12"},textMuted:{dark:"darkStep11",light:"lightStep11"},selectedListItemText:{dark:"#0a0a0a",light:"#ffffff"},background:{dark:"darkStep1",light:"lightStep1"},backgroundPanel:{dark:"darkStep2",light:"lightStep2"},backgroundElement:{dark:"darkStep3",light:"lightStep3"},border:{dark:"#EC5B2B",light:"#EC5B2B"},borderActive:{dark:"#EE7948",light:"#c94d24"},borderSubtle:{dark:"darkStep6",light:"lightStep6"},diffAdded:{dark:"#6ba1e6",light:"#0062d1"},diffRemoved:{dark:"#c53b53",light:"#c53b53"},diffContext:{dark:"#828bb8",light:"#7086b5"},diffHunkHeader:{dark:"#828bb8",light:"#7086b5"},diffHighlightAdded:{dark:"#6ba1e6",light:"#0062d1"},diffHighlightRemoved:{dark:"#e26a75",light:"#f52a65"},diffAddedBg:{dark:"#1a2a3d",light:"#e0edfa"},diffRemovedBg:{dark:"#37222c",light:"#f7d8db"},diffContextBg:{dark:"darkStep2",light:"lightStep2"},diffLineNumber:{dark:"darkStep3",light:"lightStep3"},diffAddedLineNumberBg:{dark:"#162535",light:"#d0e5f5"},diffRemovedLineNumberBg:{dark:"#2d1f26",light:"#e7c8cb"},markdownText:{dark:"darkStep12",light:"lightStep12"},markdownHeading:{dark:"#EC5B2B",light:"#EC5B2B"},markdownLink:{dark:"darkStep9",light:"lightStep9"},markdownLinkText:{dark:"darkCyan",light:"lightCyan"},markdownCode:{dark:"darkBlue",light:"lightBlue"},markdownBlockQuote:{dark:"#FFF7F1",light:"lightYellow"},markdownEmph:{dark:"darkYellow",light:"lightYellow"},markdownStrong:{dark:"#EE7948",light:"#EC5B2B"},markdownHorizontalRule:{dark:"darkStep11",light:"lightStep11"},markdownListItem:{dark:"darkStep9",light:"lightStep9"},markdownListEnumeration:{dark:"darkCyan",light:"lightCyan"},markdownImage:{dark:"darkStep9",light:"lightStep9"},markdownImageText:{dark:"darkCyan",light:"lightCyan"},markdownCodeBlock:{dark:"darkStep12",light:"lightStep12"},syntaxComment:{dark:"darkStep11",light:"lightStep11"},syntaxKeyword:{dark:"#EC5B2B",light:"#EC5B2B"},syntaxFunction:{dark:"#EE7948",light:"#c94d24"},syntaxVariable:{dark:"darkRed",light:"lightRed"},syntaxString:{dark:"darkBlue",light:"lightBlue"},syntaxNumber:{dark:"#FFF7F1",light:"#EC5B2B"},syntaxType:{dark:"darkYellow",light:"lightYellow"},syntaxOperator:{dark:"darkCyan",light:"lightCyan"},syntaxPunctuation:{dark:"darkStep12",light:"lightStep12"}}};var osaka_jade_default={$schema:"https://opencode.ai/theme.json",defs:{darkBg0:"#111c18",darkBg1:"#1a2520",darkBg2:"#23372B",darkBg3:"#3d4a44",darkFg0:"#C1C497",darkFg1:"#9aa88a",darkGray:"#53685B",darkRed:"#FF5345",darkGreen:"#549e6a",darkYellow:"#459451",darkBlue:"#509475",darkMagenta:"#D2689C",darkCyan:"#2DD5B7",darkWhite:"#F6F5DD",darkRedBright:"#db9f9c",darkGreenBright:"#63b07a",darkYellowBright:"#E5C736",darkBlueBright:"#ACD4CF",darkMagentaBright:"#75bbb3",darkCyanBright:"#8CD3CB",lightBg0:"#F6F5DD",lightBg1:"#E8E7CC",lightBg2:"#D5D4B8",lightBg3:"#A8A78C",lightFg0:"#111c18",lightFg1:"#1a2520",lightGray:"#53685B",lightRed:"#c7392d",lightGreen:"#3d7a52",lightYellow:"#b5a020",lightBlue:"#3d7560",lightMagenta:"#a8527a",lightCyan:"#1faa90"},theme:{primary:{dark:"darkCyan",light:"lightCyan"},secondary:{dark:"darkMagenta",light:"lightMagenta"},accent:{dark:"darkGreen",light:"lightGreen"},error:{dark:"darkRed",light:"lightRed"},warning:{dark:"darkYellowBright",light:"lightYellow"},success:{dark:"darkGreen",light:"lightGreen"},info:{dark:"darkCyan",light:"lightCyan"},text:{dark:"darkFg0",light:"lightFg0"},textMuted:{dark:"darkGray",light:"lightGray"},background:{dark:"darkBg0",light:"lightBg0"},backgroundPanel:{dark:"darkBg1",light:"lightBg1"},backgroundElement:{dark:"darkBg2",light:"lightBg2"},border:{dark:"darkBg3",light:"lightBg3"},borderActive:{dark:"darkCyan",light:"lightCyan"},borderSubtle:{dark:"darkBg2",light:"lightBg2"},diffAdded:{dark:"darkGreen",light:"lightGreen"},diffRemoved:{dark:"darkRed",light:"lightRed"},diffContext:{dark:"darkGray",light:"lightGray"},diffHunkHeader:{dark:"darkCyan",light:"lightCyan"},diffHighlightAdded:{dark:"darkGreenBright",light:"lightGreen"},diffHighlightRemoved:{dark:"darkRedBright",light:"lightRed"},diffAddedBg:{dark:"#15241c",light:"#e0eee5"},diffRemovedBg:{dark:"#241515",light:"#eee0e0"},diffContextBg:{dark:"darkBg1",light:"lightBg1"},diffLineNumber:{dark:"darkBg3",light:"lightBg3"},diffAddedLineNumberBg:{dark:"#121f18",light:"#d5e5da"},diffRemovedLineNumberBg:{dark:"#1f1212",light:"#e5d5d5"},markdownText:{dark:"darkFg0",light:"lightFg0"},markdownHeading:{dark:"darkCyan",light:"lightCyan"},markdownLink:{dark:"darkCyanBright",light:"lightCyan"},markdownLinkText:{dark:"darkGreen",light:"lightGreen"},markdownCode:{dark:"darkGreenBright",light:"lightGreen"},markdownBlockQuote:{dark:"darkGray",light:"lightGray"},markdownEmph:{dark:"darkMagenta",light:"lightMagenta"},markdownStrong:{dark:"darkFg0",light:"lightFg0"},markdownHorizontalRule:{dark:"darkGray",light:"lightGray"},markdownListItem:{dark:"darkCyan",light:"lightCyan"},markdownListEnumeration:{dark:"darkCyanBright",light:"lightCyan"},markdownImage:{dark:"darkCyanBright",light:"lightCyan"},markdownImageText:{dark:"darkGreen",light:"lightGreen"},markdownCodeBlock:{dark:"darkFg0",light:"lightFg0"},syntaxComment:{dark:"darkGray",light:"lightGray"},syntaxKeyword:{dark:"darkCyan",light:"lightCyan"},syntaxFunction:{dark:"darkBlue",light:"lightBlue"},syntaxVariable:{dark:"darkFg0",light:"lightFg0"},syntaxString:{dark:"darkGreenBright",light:"lightGreen"},syntaxNumber:{dark:"darkMagenta",light:"lightMagenta"},syntaxType:{dark:"darkGreen",light:"lightGreen"},syntaxOperator:{dark:"darkYellow",light:"lightYellow"},syntaxPunctuation:{dark:"darkFg0",light:"lightFg0"}}};var palenight_default={$schema:"https://opencode.ai/theme.json",defs:{background:"#292d3e",backgroundAlt:"#1e2132",backgroundPanel:"#32364a",foreground:"#a6accd",foregroundBright:"#bfc7d5",comment:"#676e95",red:"#f07178",orange:"#f78c6c",yellow:"#ffcb6b",green:"#c3e88d",cyan:"#89ddff",blue:"#82aaff",purple:"#c792ea",magenta:"#ff5370",pink:"#f07178"},theme:{primary:{dark:"blue",light:"#4976eb"},secondary:{dark:"purple",light:"#a854f2"},accent:{dark:"cyan",light:"#00acc1"},error:{dark:"red",light:"#e53935"},warning:{dark:"yellow",light:"#ffb300"},success:{dark:"green",light:"#91b859"},info:{dark:"orange",light:"#f4511e"},text:{dark:"foreground",light:"#292d3e"},textMuted:{dark:"comment",light:"#8796b0"},background:{dark:"#292d3e",light:"#fafafa"},backgroundPanel:{dark:"#1e2132",light:"#f5f5f5"},backgroundElement:{dark:"#32364a",light:"#e7e7e8"},border:{dark:"#32364a",light:"#e0e0e0"},borderActive:{dark:"blue",light:"#4976eb"},borderSubtle:{dark:"#1e2132",light:"#eeeeee"},diffAdded:{dark:"green",light:"#91b859"},diffRemoved:{dark:"red",light:"#e53935"},diffContext:{dark:"comment",light:"#8796b0"},diffHunkHeader:{dark:"cyan",light:"#00acc1"},diffHighlightAdded:{dark:"green",light:"#91b859"},diffHighlightRemoved:{dark:"red",light:"#e53935"},diffAddedBg:{dark:"#2e3c2b",light:"#e8f5e9"},diffRemovedBg:{dark:"#3c2b2b",light:"#ffebee"},diffContextBg:{dark:"#1e2132",light:"#f5f5f5"},diffLineNumber:{dark:"#444760",light:"#cfd8dc"},diffAddedLineNumberBg:{dark:"#2e3c2b",light:"#e8f5e9"},diffRemovedLineNumberBg:{dark:"#3c2b2b",light:"#ffebee"},markdownText:{dark:"foreground",light:"#292d3e"},markdownHeading:{dark:"purple",light:"#a854f2"},markdownLink:{dark:"blue",light:"#4976eb"},markdownLinkText:{dark:"cyan",light:"#00acc1"},markdownCode:{dark:"green",light:"#91b859"},markdownBlockQuote:{dark:"comment",light:"#8796b0"},markdownEmph:{dark:"yellow",light:"#ffb300"},markdownStrong:{dark:"orange",light:"#f4511e"},markdownHorizontalRule:{dark:"comment",light:"#8796b0"},markdownListItem:{dark:"blue",light:"#4976eb"},markdownListEnumeration:{dark:"cyan",light:"#00acc1"},markdownImage:{dark:"blue",light:"#4976eb"},markdownImageText:{dark:"cyan",light:"#00acc1"},markdownCodeBlock:{dark:"foreground",light:"#292d3e"},syntaxComment:{dark:"comment",light:"#8796b0"},syntaxKeyword:{dark:"purple",light:"#a854f2"},syntaxFunction:{dark:"blue",light:"#4976eb"},syntaxVariable:{dark:"foreground",light:"#292d3e"},syntaxString:{dark:"green",light:"#91b859"},syntaxNumber:{dark:"orange",light:"#f4511e"},syntaxType:{dark:"yellow",light:"#ffb300"},syntaxOperator:{dark:"cyan",light:"#00acc1"},syntaxPunctuation:{dark:"foreground",light:"#292d3e"}}};var poseidon_default={$schema:"https://opencode.ai/theme.json",defs:{poseidonBgDark:"#0F2440",poseidonPanelDark:"#122B4C",poseidonElemDark:"#153259",poseidonTextDark:"#EAF7FF",poseidonMutedDark:"#496884",poseidonPrimaryDark:"#A9DFFF",poseidonAccentDark:"#5DB8F5",poseidonSecondaryDark:"#A9DFFF",poseidonBorderDark:"#2A6FB9",poseidonBorderSubtleDark:"#496884",poseidonBgLight:"#F8F8F8",poseidonPanelLight:"#EFEFEF",poseidonElemLight:"#E4E4E4",poseidonTextLight:"#1A1A1A",poseidonMutedLight:"#5A5A5A",poseidonPrimaryLight:"#009AF5",poseidonAccentLight:"#0D85D5",poseidonSecondaryLight:"#009AF5",poseidonBorderLight:"#D0D0D0",poseidonBorderSubtleLight:"#E0E0E0",poseidonOkDark:"#4caf50",poseidonErrorDark:"#ef5350",poseidonWarnDark:"#ffa726",poseidonOkLight:"#4caf50",poseidonErrorLight:"#ef5350",poseidonWarnLight:"#A56200"},theme:{primary:{dark:"poseidonPrimaryDark",light:"poseidonPrimaryLight"},secondary:{dark:"poseidonSecondaryDark",light:"poseidonSecondaryLight"},accent:{dark:"poseidonAccentDark",light:"poseidonAccentLight"},error:{dark:"poseidonErrorDark",light:"poseidonErrorLight"},warning:{dark:"poseidonWarnDark",light:"poseidonWarnLight"},success:{dark:"poseidonOkDark",light:"poseidonOkLight"},info:{dark:"poseidonAccentDark",light:"poseidonAccentLight"},text:{dark:"poseidonTextDark",light:"poseidonTextLight"},textMuted:{dark:"poseidonMutedDark",light:"poseidonMutedLight"},background:{dark:"poseidonBgDark",light:"poseidonBgLight"},backgroundPanel:{dark:"poseidonPanelDark",light:"poseidonPanelLight"},backgroundElement:{dark:"poseidonElemDark",light:"poseidonElemLight"},border:{dark:"poseidonBorderDark",light:"poseidonBorderLight"},borderActive:{dark:"poseidonAccentDark",light:"poseidonAccentLight"},borderSubtle:{dark:"poseidonBorderSubtleDark",light:"poseidonBorderSubtleLight"},diffAdded:{dark:"poseidonOkDark",light:"poseidonOkLight"},diffRemoved:{dark:"poseidonErrorDark",light:"poseidonErrorLight"},diffContext:{dark:"poseidonMutedDark",light:"poseidonMutedLight"},diffHunkHeader:{dark:"poseidonMutedDark",light:"poseidonMutedLight"},diffHighlightAdded:{dark:"poseidonOkDark",light:"poseidonOkLight"},diffHighlightRemoved:{dark:"poseidonErrorDark",light:"poseidonErrorLight"},diffAddedBg:{dark:"#1A3D43",light:"#DEEDDF"},diffRemovedBg:{dark:"#372C43",light:"#F7DFDF"},diffContextBg:{dark:"poseidonPanelDark",light:"poseidonPanelLight"},diffLineNumber:{dark:"poseidonMutedDark",light:"poseidonMutedLight"},diffAddedLineNumberBg:{dark:"#153242",light:"#EAF2EB"},diffRemovedLineNumberBg:{dark:"#252942",light:"#F7EBEB"},markdownText:{dark:"poseidonTextDark",light:"poseidonTextLight"},markdownHeading:{dark:"poseidonPrimaryDark",light:"poseidonPrimaryLight"},markdownLink:{dark:"poseidonAccentDark",light:"poseidonAccentLight"},markdownLinkText:{dark:"poseidonSecondaryDark",light:"poseidonSecondaryLight"},markdownCode:{dark:"poseidonSecondaryDark",light:"poseidonSecondaryLight"},markdownBlockQuote:{dark:"poseidonMutedDark",light:"poseidonMutedLight"},markdownEmph:{dark:"poseidonAccentDark",light:"poseidonAccentLight"},markdownStrong:{dark:"poseidonPrimaryDark",light:"poseidonPrimaryLight"},markdownHorizontalRule:{dark:"poseidonBorderDark",light:"poseidonBorderLight"},markdownListItem:{dark:"poseidonTextDark",light:"poseidonTextLight"},markdownListEnumeration:{dark:"poseidonAccentDark",light:"poseidonAccentLight"},markdownImage:{dark:"poseidonAccentDark",light:"poseidonAccentLight"},markdownImageText:{dark:"poseidonMutedDark",light:"poseidonMutedLight"},markdownCodeBlock:{dark:"poseidonTextDark",light:"poseidonTextLight"},syntaxComment:{dark:"poseidonMutedDark",light:"poseidonMutedLight"},syntaxKeyword:{dark:"poseidonAccentDark",light:"poseidonAccentLight"},syntaxFunction:{dark:"poseidonPrimaryDark",light:"poseidonPrimaryLight"},syntaxVariable:{dark:"poseidonTextDark",light:"poseidonTextLight"},syntaxString:{dark:"poseidonOkDark",light:"poseidonOkLight"},syntaxNumber:{dark:"poseidonAccentDark",light:"poseidonAccentLight"},syntaxType:{dark:"poseidonSecondaryDark",light:"poseidonSecondaryLight"},syntaxOperator:{dark:"poseidonSecondaryDark",light:"poseidonSecondaryLight"},syntaxPunctuation:{dark:"poseidonTextDark",light:"poseidonTextLight"}}};var rosepine_default={$schema:"https://opencode.ai/theme.json",defs:{base:"#191724",surface:"#1f1d2e",overlay:"#26233a",muted:"#6e6a86",subtle:"#908caa",text:"#e0def4",love:"#eb6f92",gold:"#f6c177",rose:"#ebbcba",pine:"#31748f",foam:"#9ccfd8",iris:"#c4a7e7",highlightLow:"#21202e",highlightMed:"#403d52",highlightHigh:"#524f67",moonBase:"#232136",moonSurface:"#2a273f",moonOverlay:"#393552",moonMuted:"#6e6a86",moonSubtle:"#908caa",moonText:"#e0def4",dawnBase:"#faf4ed",dawnSurface:"#fffaf3",dawnOverlay:"#f2e9e1",dawnMuted:"#9893a5",dawnSubtle:"#797593",dawnText:"#575279"},theme:{primary:{dark:"foam",light:"pine"},secondary:{dark:"iris",light:"#907aa9"},accent:{dark:"rose",light:"#d7827e"},error:{dark:"love",light:"#b4637a"},warning:{dark:"gold",light:"#ea9d34"},success:{dark:"pine",light:"#286983"},info:{dark:"foam",light:"#56949f"},text:{dark:"#e0def4",light:"#575279"},textMuted:{dark:"muted",light:"dawnMuted"},background:{dark:"base",light:"dawnBase"},backgroundPanel:{dark:"surface",light:"dawnSurface"},backgroundElement:{dark:"overlay",light:"dawnOverlay"},border:{dark:"highlightMed",light:"#dfdad9"},borderActive:{dark:"foam",light:"pine"},borderSubtle:{dark:"highlightLow",light:"#f4ede8"},diffAdded:{dark:"pine",light:"#286983"},diffRemoved:{dark:"love",light:"#b4637a"},diffContext:{dark:"muted",light:"dawnMuted"},diffHunkHeader:{dark:"iris",light:"#907aa9"},diffHighlightAdded:{dark:"pine",light:"#286983"},diffHighlightRemoved:{dark:"love",light:"#b4637a"},diffAddedBg:{dark:"#1f2d3a",light:"#e5f2f3"},diffRemovedBg:{dark:"#3a1f2d",light:"#fce5e8"},diffContextBg:{dark:"surface",light:"dawnSurface"},diffLineNumber:{dark:"muted",light:"dawnMuted"},diffAddedLineNumberBg:{dark:"#1f2d3a",light:"#e5f2f3"},diffRemovedLineNumberBg:{dark:"#3a1f2d",light:"#fce5e8"},markdownText:{dark:"#e0def4",light:"#575279"},markdownHeading:{dark:"iris",light:"#907aa9"},markdownLink:{dark:"foam",light:"pine"},markdownLinkText:{dark:"rose",light:"#d7827e"},markdownCode:{dark:"pine",light:"#286983"},markdownBlockQuote:{dark:"muted",light:"dawnMuted"},markdownEmph:{dark:"gold",light:"#ea9d34"},markdownStrong:{dark:"love",light:"#b4637a"},markdownHorizontalRule:{dark:"highlightMed",light:"#dfdad9"},markdownListItem:{dark:"foam",light:"pine"},markdownListEnumeration:{dark:"rose",light:"#d7827e"},markdownImage:{dark:"foam",light:"pine"},markdownImageText:{dark:"rose",light:"#d7827e"},markdownCodeBlock:{dark:"#e0def4",light:"#575279"},syntaxComment:{dark:"muted",light:"dawnMuted"},syntaxKeyword:{dark:"pine",light:"#286983"},syntaxFunction:{dark:"rose",light:"#d7827e"},syntaxVariable:{dark:"#e0def4",light:"#575279"},syntaxString:{dark:"gold",light:"#ea9d34"},syntaxNumber:{dark:"iris",light:"#907aa9"},syntaxType:{dark:"foam",light:"#56949f"},syntaxOperator:{dark:"subtle",light:"dawnSubtle"},syntaxPunctuation:{dark:"subtle",light:"dawnSubtle"}}};var sisyphus_default={$schema:"https://opencode.ai/theme.json",defs:{sisyphusBgDark:"#202020",sisyphusPanelDark:"#282828",sisyphusElemDark:"#2F2F2F",sisyphusTextDark:"#D3D3D3",sisyphusMutedDark:"#4A4A4A",sisyphusPrimaryDark:"#F5F5F5",sisyphusAccentDark:"#E7E7E7",sisyphusSecondaryDark:"#D3D3D3",sisyphusBorderDark:"#B7B7B7",sisyphusBorderSubtleDark:"#656565",sisyphusBgLight:"#F8F8F8",sisyphusPanelLight:"#EFEFEF",sisyphusElemLight:"#E4E4E4",sisyphusTextLight:"#1A1A1A",sisyphusMutedLight:"#5A5A5A",sisyphusPrimaryLight:"#9C9C9C",sisyphusAccentLight:"#8E8E8E",sisyphusSecondaryLight:"#7A7A7A",sisyphusBorderLight:"#D0D0D0",sisyphusBorderSubtleLight:"#E0E0E0",sisyphusOkDark:"#919191",sisyphusErrorDark:"#E7E7E7",sisyphusWarnDark:"#B7B7B7",sisyphusOkLight:"#919191",sisyphusErrorLight:"#A7A7A7",sisyphusWarnLight:"#777777"},theme:{primary:{dark:"sisyphusPrimaryDark",light:"sisyphusPrimaryLight"},secondary:{dark:"sisyphusSecondaryDark",light:"sisyphusSecondaryLight"},accent:{dark:"sisyphusAccentDark",light:"sisyphusAccentLight"},error:{dark:"sisyphusErrorDark",light:"sisyphusErrorLight"},warning:{dark:"sisyphusWarnDark",light:"sisyphusWarnLight"},success:{dark:"sisyphusOkDark",light:"sisyphusOkLight"},info:{dark:"sisyphusAccentDark",light:"sisyphusAccentLight"},text:{dark:"sisyphusTextDark",light:"sisyphusTextLight"},textMuted:{dark:"sisyphusMutedDark",light:"sisyphusMutedLight"},background:{dark:"sisyphusBgDark",light:"sisyphusBgLight"},backgroundPanel:{dark:"sisyphusPanelDark",light:"sisyphusPanelLight"},backgroundElement:{dark:"sisyphusElemDark",light:"sisyphusElemLight"},border:{dark:"sisyphusBorderDark",light:"sisyphusBorderLight"},borderActive:{dark:"sisyphusAccentDark",light:"sisyphusAccentLight"},borderSubtle:{dark:"sisyphusBorderSubtleDark",light:"sisyphusBorderSubtleLight"},diffAdded:{dark:"sisyphusOkDark",light:"sisyphusOkLight"},diffRemoved:{dark:"sisyphusErrorDark",light:"sisyphusErrorLight"},diffContext:{dark:"sisyphusMutedDark",light:"sisyphusMutedLight"},diffHunkHeader:{dark:"sisyphusMutedDark",light:"sisyphusMutedLight"},diffHighlightAdded:{dark:"sisyphusOkDark",light:"sisyphusOkLight"},diffHighlightRemoved:{dark:"sisyphusErrorDark",light:"sisyphusErrorLight"},diffAddedBg:{dark:"#343434",light:"#E9E9E9"},diffRemovedBg:{dark:"#444444",light:"#ECECEC"},diffContextBg:{dark:"sisyphusPanelDark",light:"sisyphusPanelLight"},diffLineNumber:{dark:"sisyphusMutedDark",light:"sisyphusMutedLight"},diffAddedLineNumberBg:{dark:"#2B2B2B",light:"#F0F0F0"},diffRemovedLineNumberBg:{dark:"#343434",light:"#F2F2F2"},markdownText:{dark:"sisyphusTextDark",light:"sisyphusTextLight"},markdownHeading:{dark:"sisyphusPrimaryDark",light:"sisyphusPrimaryLight"},markdownLink:{dark:"sisyphusAccentDark",light:"sisyphusAccentLight"},markdownLinkText:{dark:"sisyphusSecondaryDark",light:"sisyphusSecondaryLight"},markdownCode:{dark:"sisyphusSecondaryDark",light:"sisyphusSecondaryLight"},markdownBlockQuote:{dark:"sisyphusMutedDark",light:"sisyphusMutedLight"},markdownEmph:{dark:"sisyphusAccentDark",light:"sisyphusAccentLight"},markdownStrong:{dark:"sisyphusPrimaryDark",light:"sisyphusPrimaryLight"},markdownHorizontalRule:{dark:"sisyphusBorderDark",light:"sisyphusBorderLight"},markdownListItem:{dark:"sisyphusTextDark",light:"sisyphusTextLight"},markdownListEnumeration:{dark:"sisyphusAccentDark",light:"sisyphusAccentLight"},markdownImage:{dark:"sisyphusAccentDark",light:"sisyphusAccentLight"},markdownImageText:{dark:"sisyphusMutedDark",light:"sisyphusMutedLight"},markdownCodeBlock:{dark:"sisyphusTextDark",light:"sisyphusTextLight"},syntaxComment:{dark:"sisyphusMutedDark",light:"sisyphusMutedLight"},syntaxKeyword:{dark:"sisyphusAccentDark",light:"sisyphusAccentLight"},syntaxFunction:{dark:"sisyphusPrimaryDark",light:"sisyphusPrimaryLight"},syntaxVariable:{dark:"sisyphusTextDark",light:"sisyphusTextLight"},syntaxString:{dark:"sisyphusOkDark",light:"sisyphusOkLight"},syntaxNumber:{dark:"sisyphusAccentDark",light:"sisyphusAccentLight"},syntaxType:{dark:"sisyphusSecondaryDark",light:"sisyphusSecondaryLight"},syntaxOperator:{dark:"sisyphusSecondaryDark",light:"sisyphusSecondaryLight"},syntaxPunctuation:{dark:"sisyphusTextDark",light:"sisyphusTextLight"}}};var slate_default={$schema:"https://opencode.ai/theme.json",defs:{slateBgDark:"#151C2F",slatePanelDark:"#1A223A",slateElemDark:"#1E2944",slateTextDark:"#c9d1d9",slateMutedDark:"#4b5563",slatePrimaryDark:"#7eb8f6",slateAccentDark:"#8EA8FF",slateSecondaryDark:"#8EA8FF",slateBorderDark:"#4169e1",slateBorderSubtleDark:"#4b5563",slateBgLight:"#F8F8F8",slatePanelLight:"#EFEFEF",slateElemLight:"#E4E4E4",slateTextLight:"#1A1A1A",slateMutedLight:"#5A5A5A",slatePrimaryLight:"#157EEF",slateAccentLight:"#1E52FF",slateSecondaryLight:"#1E52FF",slateBorderLight:"#D0D0D0",slateBorderSubtleLight:"#E0E0E0",slateOkDark:"#63D0A6",slateErrorDark:"#F7A072",slateWarnDark:"#e6a855",slateOkLight:"#2A8A65",slateErrorLight:"#DD550D",slateWarnLight:"#A36818"},theme:{primary:{dark:"slatePrimaryDark",light:"slatePrimaryLight"},secondary:{dark:"slateSecondaryDark",light:"slateSecondaryLight"},accent:{dark:"slateAccentDark",light:"slateAccentLight"},error:{dark:"slateErrorDark",light:"slateErrorLight"},warning:{dark:"slateWarnDark",light:"slateWarnLight"},success:{dark:"slateOkDark",light:"slateOkLight"},info:{dark:"slateAccentDark",light:"slateAccentLight"},text:{dark:"slateTextDark",light:"slateTextLight"},textMuted:{dark:"slateMutedDark",light:"slateMutedLight"},background:{dark:"slateBgDark",light:"slateBgLight"},backgroundPanel:{dark:"slatePanelDark",light:"slatePanelLight"},backgroundElement:{dark:"slateElemDark",light:"slateElemLight"},border:{dark:"slateBorderDark",light:"slateBorderLight"},borderActive:{dark:"slateAccentDark",light:"slateAccentLight"},borderSubtle:{dark:"slateBorderSubtleDark",light:"slateBorderSubtleLight"},diffAdded:{dark:"slateOkDark",light:"slateOkLight"},diffRemoved:{dark:"slateErrorDark",light:"slateErrorLight"},diffContext:{dark:"slateMutedDark",light:"slateMutedLight"},diffHunkHeader:{dark:"slateMutedDark",light:"slateMutedLight"},diffHighlightAdded:{dark:"slateOkDark",light:"slateOkLight"},diffHighlightRemoved:{dark:"slateErrorDark",light:"slateErrorLight"},diffAddedBg:{dark:"#233C44",light:"#D9E8E2"},diffRemovedBg:{dark:"#3E343B",light:"#F4E0D5"},diffContextBg:{dark:"slatePanelDark",light:"slatePanelLight"},diffLineNumber:{dark:"slateMutedDark",light:"slateMutedLight"},diffAddedLineNumberBg:{dark:"#1D2E3B",light:"#E8EFEC"},diffRemovedLineNumberBg:{dark:"#2C2936",light:"#F6EBE5"},markdownText:{dark:"slateTextDark",light:"slateTextLight"},markdownHeading:{dark:"slatePrimaryDark",light:"slatePrimaryLight"},markdownLink:{dark:"slateAccentDark",light:"slateAccentLight"},markdownLinkText:{dark:"slateSecondaryDark",light:"slateSecondaryLight"},markdownCode:{dark:"slateSecondaryDark",light:"slateSecondaryLight"},markdownBlockQuote:{dark:"slateMutedDark",light:"slateMutedLight"},markdownEmph:{dark:"slateAccentDark",light:"slateAccentLight"},markdownStrong:{dark:"slatePrimaryDark",light:"slatePrimaryLight"},markdownHorizontalRule:{dark:"slateBorderDark",light:"slateBorderLight"},markdownListItem:{dark:"slateTextDark",light:"slateTextLight"},markdownListEnumeration:{dark:"slateAccentDark",light:"slateAccentLight"},markdownImage:{dark:"slateAccentDark",light:"slateAccentLight"},markdownImageText:{dark:"slateMutedDark",light:"slateMutedLight"},markdownCodeBlock:{dark:"slateTextDark",light:"slateTextLight"},syntaxComment:{dark:"slateMutedDark",light:"slateMutedLight"},syntaxKeyword:{dark:"slateAccentDark",light:"slateAccentLight"},syntaxFunction:{dark:"slatePrimaryDark",light:"slatePrimaryLight"},syntaxVariable:{dark:"slateTextDark",light:"slateTextLight"},syntaxString:{dark:"slateOkDark",light:"slateOkLight"},syntaxNumber:{dark:"slateAccentDark",light:"slateAccentLight"},syntaxType:{dark:"slateSecondaryDark",light:"slateSecondaryLight"},syntaxOperator:{dark:"slateSecondaryDark",light:"slateSecondaryLight"},syntaxPunctuation:{dark:"slateTextDark",light:"slateTextLight"}}};var solarized_default={$schema:"https://opencode.ai/theme.json",defs:{base03:"#002b36",base02:"#073642",base01:"#586e75",base00:"#657b83",base0:"#839496",base1:"#93a1a1",base2:"#eee8d5",base3:"#fdf6e3",yellow:"#b58900",orange:"#cb4b16",red:"#dc322f",magenta:"#d33682",violet:"#6c71c4",blue:"#268bd2",cyan:"#2aa198",green:"#859900"},theme:{primary:{dark:"blue",light:"blue"},secondary:{dark:"violet",light:"violet"},accent:{dark:"cyan",light:"cyan"},error:{dark:"red",light:"red"},warning:{dark:"yellow",light:"yellow"},success:{dark:"green",light:"green"},info:{dark:"orange",light:"orange"},text:{dark:"base0",light:"base00"},textMuted:{dark:"base01",light:"base1"},background:{dark:"base03",light:"base3"},backgroundPanel:{dark:"base02",light:"base2"},backgroundElement:{dark:"#073642",light:"#eee8d5"},border:{dark:"base02",light:"base2"},borderActive:{dark:"base01",light:"base1"},borderSubtle:{dark:"#073642",light:"#eee8d5"},diffAdded:{dark:"green",light:"green"},diffRemoved:{dark:"red",light:"red"},diffContext:{dark:"base01",light:"base1"},diffHunkHeader:{dark:"base01",light:"base1"},diffHighlightAdded:{dark:"green",light:"green"},diffHighlightRemoved:{dark:"red",light:"red"},diffAddedBg:{dark:"#073642",light:"#eee8d5"},diffRemovedBg:{dark:"#073642",light:"#eee8d5"},diffContextBg:{dark:"base02",light:"base2"},diffLineNumber:{dark:"base01",light:"base1"},diffAddedLineNumberBg:{dark:"#073642",light:"#eee8d5"},diffRemovedLineNumberBg:{dark:"#073642",light:"#eee8d5"},markdownText:{dark:"base0",light:"base00"},markdownHeading:{dark:"blue",light:"blue"},markdownLink:{dark:"cyan",light:"cyan"},markdownLinkText:{dark:"violet",light:"violet"},markdownCode:{dark:"green",light:"green"},markdownBlockQuote:{dark:"base01",light:"base1"},markdownEmph:{dark:"yellow",light:"yellow"},markdownStrong:{dark:"orange",light:"orange"},markdownHorizontalRule:{dark:"base01",light:"base1"},markdownListItem:{dark:"blue",light:"blue"},markdownListEnumeration:{dark:"cyan",light:"cyan"},markdownImage:{dark:"cyan",light:"cyan"},markdownImageText:{dark:"violet",light:"violet"},markdownCodeBlock:{dark:"base0",light:"base00"},syntaxComment:{dark:"base01",light:"base1"},syntaxKeyword:{dark:"green",light:"green"},syntaxFunction:{dark:"blue",light:"blue"},syntaxVariable:{dark:"cyan",light:"cyan"},syntaxString:{dark:"cyan",light:"cyan"},syntaxNumber:{dark:"magenta",light:"magenta"},syntaxType:{dark:"yellow",light:"yellow"},syntaxOperator:{dark:"green",light:"green"},syntaxPunctuation:{dark:"base0",light:"base00"}}};var synthwave84_default={$schema:"https://opencode.ai/theme.json",defs:{background:"#262335",backgroundAlt:"#1e1a29",backgroundPanel:"#2a2139",foreground:"#ffffff",foregroundMuted:"#848bbd",pink:"#ff7edb",pinkBright:"#ff92df",cyan:"#36f9f6",cyanBright:"#72f1f8",yellow:"#fede5d",yellowBright:"#fff95d",orange:"#ff8b39",orangeBright:"#ff9f43",purple:"#b084eb",purpleBright:"#c792ea",red:"#fe4450",redBright:"#ff5e5b",green:"#72f1b8",greenBright:"#97f1d8"},theme:{primary:{dark:"cyan",light:"#00bcd4"},secondary:{dark:"pink",light:"#e91e63"},accent:{dark:"purple",light:"#9c27b0"},error:{dark:"red",light:"#f44336"},warning:{dark:"yellow",light:"#ff9800"},success:{dark:"green",light:"#4caf50"},info:{dark:"orange",light:"#ff5722"},text:{dark:"foreground",light:"#262335"},textMuted:{dark:"foregroundMuted",light:"#5c5c8a"},background:{dark:"#262335",light:"#fafafa"},backgroundPanel:{dark:"#1e1a29",light:"#f5f5f5"},backgroundElement:{dark:"#2a2139",light:"#eeeeee"},border:{dark:"#495495",light:"#e0e0e0"},borderActive:{dark:"cyan",light:"#00bcd4"},borderSubtle:{dark:"#241b2f",light:"#f0f0f0"},diffAdded:{dark:"green",light:"#4caf50"},diffRemoved:{dark:"red",light:"#f44336"},diffContext:{dark:"foregroundMuted",light:"#5c5c8a"},diffHunkHeader:{dark:"purple",light:"#9c27b0"},diffHighlightAdded:{dark:"greenBright",light:"#4caf50"},diffHighlightRemoved:{dark:"redBright",light:"#f44336"},diffAddedBg:{dark:"#1a3a2a",light:"#e8f5e9"},diffRemovedBg:{dark:"#3a1a2a",light:"#ffebee"},diffContextBg:{dark:"#1e1a29",light:"#f5f5f5"},diffLineNumber:{dark:"#495495",light:"#b0b0b0"},diffAddedLineNumberBg:{dark:"#1a3a2a",light:"#e8f5e9"},diffRemovedLineNumberBg:{dark:"#3a1a2a",light:"#ffebee"},markdownText:{dark:"foreground",light:"#262335"},markdownHeading:{dark:"pink",light:"#e91e63"},markdownLink:{dark:"cyan",light:"#00bcd4"},markdownLinkText:{dark:"purple",light:"#9c27b0"},markdownCode:{dark:"green",light:"#4caf50"},markdownBlockQuote:{dark:"foregroundMuted",light:"#5c5c8a"},markdownEmph:{dark:"yellow",light:"#ff9800"},markdownStrong:{dark:"orange",light:"#ff5722"},markdownHorizontalRule:{dark:"#495495",light:"#e0e0e0"},markdownListItem:{dark:"cyan",light:"#00bcd4"},markdownListEnumeration:{dark:"purple",light:"#9c27b0"},markdownImage:{dark:"cyan",light:"#00bcd4"},markdownImageText:{dark:"purple",light:"#9c27b0"},markdownCodeBlock:{dark:"foreground",light:"#262335"},syntaxComment:{dark:"foregroundMuted",light:"#5c5c8a"},syntaxKeyword:{dark:"pink",light:"#e91e63"},syntaxFunction:{dark:"orange",light:"#ff5722"},syntaxVariable:{dark:"foreground",light:"#262335"},syntaxString:{dark:"yellow",light:"#ff9800"},syntaxNumber:{dark:"purple",light:"#9c27b0"},syntaxType:{dark:"cyan",light:"#00bcd4"},syntaxOperator:{dark:"pink",light:"#e91e63"},syntaxPunctuation:{dark:"foreground",light:"#262335"}}};var tokyonight_default={$schema:"https://opencode.ai/theme.json",defs:{darkStep1:"#1a1b26",darkStep2:"#1e2030",darkStep3:"#222436",darkStep4:"#292e42",darkStep5:"#3b4261",darkStep6:"#545c7e",darkStep7:"#737aa2",darkStep8:"#9099b2",darkStep9:"#82aaff",darkStep10:"#89b4fa",darkStep11:"#828bb8",darkStep12:"#c8d3f5",darkRed:"#ff757f",darkOrange:"#ff966c",darkYellow:"#ffc777",darkGreen:"#c3e88d",darkCyan:"#86e1fc",darkPurple:"#c099ff",lightStep1:"#e1e2e7",lightStep2:"#d5d6db",lightStep3:"#c8c9ce",lightStep4:"#b9bac1",lightStep5:"#a8aecb",lightStep6:"#9699a8",lightStep7:"#737a8c",lightStep8:"#5a607d",lightStep9:"#2e7de9",lightStep10:"#1a6ce7",lightStep11:"#8990a3",lightStep12:"#3760bf",lightRed:"#f52a65",lightOrange:"#b15c00",lightYellow:"#8c6c3e",lightGreen:"#587539",lightCyan:"#007197",lightPurple:"#9854f1"},theme:{primary:{dark:"darkStep9",light:"lightStep9"},secondary:{dark:"darkPurple",light:"lightPurple"},accent:{dark:"darkOrange",light:"lightOrange"},error:{dark:"darkRed",light:"lightRed"},warning:{dark:"darkOrange",light:"lightOrange"},success:{dark:"darkGreen",light:"lightGreen"},info:{dark:"darkStep9",light:"lightStep9"},text:{dark:"darkStep12",light:"lightStep12"},textMuted:{dark:"darkStep11",light:"lightStep11"},background:{dark:"darkStep1",light:"lightStep1"},backgroundPanel:{dark:"darkStep2",light:"lightStep2"},backgroundElement:{dark:"darkStep3",light:"lightStep3"},border:{dark:"darkStep7",light:"lightStep7"},borderActive:{dark:"darkStep8",light:"lightStep8"},borderSubtle:{dark:"darkStep6",light:"lightStep6"},diffAdded:{dark:"#4fd6be",light:"#1e725c"},diffRemoved:{dark:"#c53b53",light:"#c53b53"},diffContext:{dark:"#828bb8",light:"#7086b5"},diffHunkHeader:{dark:"#828bb8",light:"#7086b5"},diffHighlightAdded:{dark:"#b8db87",light:"#4db380"},diffHighlightRemoved:{dark:"#e26a75",light:"#f52a65"},diffAddedBg:{dark:"#20303b",light:"#d5e5d5"},diffRemovedBg:{dark:"#37222c",light:"#f7d8db"},diffContextBg:{dark:"darkStep2",light:"lightStep2"},diffLineNumber:{dark:"darkStep3",light:"lightStep3"},diffAddedLineNumberBg:{dark:"#1b2b34",light:"#c5d5c5"},diffRemovedLineNumberBg:{dark:"#2d1f26",light:"#e7c8cb"},markdownText:{dark:"darkStep12",light:"lightStep12"},markdownHeading:{dark:"darkPurple",light:"lightPurple"},markdownLink:{dark:"darkStep9",light:"lightStep9"},markdownLinkText:{dark:"darkCyan",light:"lightCyan"},markdownCode:{dark:"darkGreen",light:"lightGreen"},markdownBlockQuote:{dark:"darkYellow",light:"lightYellow"},markdownEmph:{dark:"darkYellow",light:"lightYellow"},markdownStrong:{dark:"darkOrange",light:"lightOrange"},markdownHorizontalRule:{dark:"darkStep11",light:"lightStep11"},markdownListItem:{dark:"darkStep9",light:"lightStep9"},markdownListEnumeration:{dark:"darkCyan",light:"lightCyan"},markdownImage:{dark:"darkStep9",light:"lightStep9"},markdownImageText:{dark:"darkCyan",light:"lightCyan"},markdownCodeBlock:{dark:"darkStep12",light:"lightStep12"},syntaxComment:{dark:"darkStep11",light:"lightStep11"},syntaxKeyword:{dark:"darkPurple",light:"lightPurple"},syntaxFunction:{dark:"darkStep9",light:"lightStep9"},syntaxVariable:{dark:"darkRed",light:"lightRed"},syntaxString:{dark:"darkGreen",light:"lightGreen"},syntaxNumber:{dark:"darkOrange",light:"lightOrange"},syntaxType:{dark:"darkYellow",light:"lightYellow"},syntaxOperator:{dark:"darkCyan",light:"lightCyan"},syntaxPunctuation:{dark:"darkStep12",light:"lightStep12"}}};var vercel_default={$schema:"https://opencode.ai/theme.json",defs:{background100:"#0A0A0A",background200:"#000000",gray100:"#1A1A1A",gray200:"#1F1F1F",gray300:"#292929",gray400:"#2E2E2E",gray500:"#454545",gray600:"#878787",gray700:"#8F8F8F",gray900:"#A1A1A1",gray1000:"#EDEDED",blue600:"#0099FF",blue700:"#0070F3",blue900:"#52A8FF",blue1000:"#EBF8FF",red700:"#E5484D",red900:"#FF6166",red1000:"#FDECED",amber700:"#FFB224",amber900:"#F2A700",amber1000:"#FDF4DC",green700:"#46A758",green900:"#63C46D",green1000:"#E6F9E9",teal700:"#12A594",teal900:"#0AC7AC",purple700:"#8E4EC6",purple900:"#BF7AF0",pink700:"#E93D82",pink900:"#F75590",highlightPink:"#FF0080",highlightPurple:"#F81CE5",cyan:"#50E3C2",lightBackground:"#FFFFFF",lightGray100:"#FAFAFA",lightGray200:"#EAEAEA",lightGray600:"#666666",lightGray1000:"#171717"},theme:{primary:{dark:"blue700",light:"blue700"},secondary:{dark:"blue900",light:"#0062D1"},accent:{dark:"purple700",light:"purple700"},error:{dark:"red700",light:"#DC3545"},warning:{dark:"amber700",light:"#FF9500"},success:{dark:"green700",light:"#388E3C"},info:{dark:"blue900",light:"blue700"},text:{dark:"gray1000",light:"lightGray1000"},textMuted:{dark:"gray600",light:"lightGray600"},background:{dark:"background200",light:"lightBackground"},backgroundPanel:{dark:"gray100",light:"lightGray100"},backgroundElement:{dark:"gray300",light:"lightGray200"},border:{dark:"gray200",light:"lightGray200"},borderActive:{dark:"gray500",light:"#999999"},borderSubtle:{dark:"gray100",light:"#EAEAEA"},diffAdded:{dark:"green900",light:"green700"},diffRemoved:{dark:"red900",light:"red700"},diffContext:{dark:"gray600",light:"lightGray600"},diffHunkHeader:{dark:"gray600",light:"lightGray600"},diffHighlightAdded:{dark:"green900",light:"green700"},diffHighlightRemoved:{dark:"red900",light:"red700"},diffAddedBg:{dark:"#0B1D0F",light:"#E6F9E9"},diffRemovedBg:{dark:"#2A1314",light:"#FDECED"},diffContextBg:{dark:"background200",light:"lightBackground"},diffLineNumber:{dark:"gray600",light:"lightGray600"},diffAddedLineNumberBg:{dark:"#0F2613",light:"#D6F5D6"},diffRemovedLineNumberBg:{dark:"#3C1618",light:"#FFE5E5"},markdownText:{dark:"gray1000",light:"lightGray1000"},markdownHeading:{dark:"purple900",light:"purple700"},markdownLink:{dark:"blue900",light:"blue700"},markdownLinkText:{dark:"teal900",light:"teal700"},markdownCode:{dark:"green900",light:"green700"},markdownBlockQuote:{dark:"gray600",light:"lightGray600"},markdownEmph:{dark:"amber900",light:"amber700"},markdownStrong:{dark:"pink900",light:"pink700"},markdownHorizontalRule:{dark:"gray500",light:"#999999"},markdownListItem:{dark:"gray1000",light:"lightGray1000"},markdownListEnumeration:{dark:"blue900",light:"blue700"},markdownImage:{dark:"teal900",light:"teal700"},markdownImageText:{dark:"cyan",light:"teal700"},markdownCodeBlock:{dark:"gray1000",light:"lightGray1000"},syntaxComment:{dark:"gray600",light:"#888888"},syntaxKeyword:{dark:"pink900",light:"pink700"},syntaxFunction:{dark:"purple900",light:"purple700"},syntaxVariable:{dark:"blue900",light:"blue700"},syntaxString:{dark:"green900",light:"green700"},syntaxNumber:{dark:"amber900",light:"amber700"},syntaxType:{dark:"teal900",light:"teal700"},syntaxOperator:{dark:"pink900",light:"pink700"},syntaxPunctuation:{dark:"gray1000",light:"lightGray1000"}}};var vesper_default={$schema:"https://opencode.ai/theme.json",defs:{vesperBg:"#101010",vesperFg:"#FFF",vesperComment:"#8b8b8b",vesperKeyword:"#A0A0A0",vesperFunction:"#FFC799",vesperString:"#99FFE4",vesperNumber:"#FFC799",vesperError:"#FF8080",vesperWarning:"#FFC799",vesperSuccess:"#99FFE4",vesperMuted:"#A0A0A0"},theme:{primary:{dark:"#FFC799",light:"#FFC799"},secondary:{dark:"#99FFE4",light:"#99FFE4"},accent:{dark:"#FFC799",light:"#FFC799"},error:{dark:"vesperError",light:"vesperError"},warning:{dark:"vesperWarning",light:"vesperWarning"},success:{dark:"vesperSuccess",light:"vesperSuccess"},info:{dark:"#FFC799",light:"#FFC799"},text:{dark:"vesperFg",light:"vesperBg"},textMuted:{dark:"vesperMuted",light:"vesperMuted"},background:{dark:"vesperBg",light:"#FFF"},backgroundPanel:{dark:"vesperBg",light:"#F0F0F0"},backgroundElement:{dark:"vesperBg",light:"#E0E0E0"},border:{dark:"#282828",light:"#D0D0D0"},borderActive:{dark:"#FFC799",light:"#FFC799"},borderSubtle:{dark:"#1C1C1C",light:"#E8E8E8"},diffAdded:{dark:"vesperSuccess",light:"vesperSuccess"},diffRemoved:{dark:"vesperError",light:"vesperError"},diffContext:{dark:"vesperMuted",light:"vesperMuted"},diffHunkHeader:{dark:"vesperMuted",light:"vesperMuted"},diffHighlightAdded:{dark:"vesperSuccess",light:"vesperSuccess"},diffHighlightRemoved:{dark:"vesperError",light:"vesperError"},diffAddedBg:{dark:"#0d2818",light:"#e8f5e8"},diffRemovedBg:{dark:"#281a1a",light:"#f5e8e8"},diffContextBg:{dark:"vesperBg",light:"#F8F8F8"},diffLineNumber:{dark:"#505050",light:"#808080"},diffAddedLineNumberBg:{dark:"#0d2818",light:"#e8f5e8"},diffRemovedLineNumberBg:{dark:"#281a1a",light:"#f5e8e8"},markdownText:{dark:"vesperFg",light:"vesperBg"},markdownHeading:{dark:"#FFC799",light:"#FFC799"},markdownLink:{dark:"#FFC799",light:"#FFC799"},markdownLinkText:{dark:"vesperMuted",light:"vesperMuted"},markdownCode:{dark:"vesperMuted",light:"vesperMuted"},markdownBlockQuote:{dark:"vesperFg",light:"vesperBg"},markdownEmph:{dark:"vesperFg",light:"vesperBg"},markdownStrong:{dark:"vesperFg",light:"vesperBg"},markdownHorizontalRule:{dark:"#65737E",light:"#65737E"},markdownListItem:{dark:"vesperFg",light:"vesperBg"},markdownListEnumeration:{dark:"vesperFg",light:"vesperBg"},markdownImage:{dark:"#FFC799",light:"#FFC799"},markdownImageText:{dark:"vesperMuted",light:"vesperMuted"},markdownCodeBlock:{dark:"vesperFg",light:"vesperBg"},syntaxComment:{dark:"vesperComment",light:"vesperComment"},syntaxKeyword:{dark:"vesperKeyword",light:"vesperKeyword"},syntaxFunction:{dark:"vesperFunction",light:"vesperFunction"},syntaxVariable:{dark:"vesperFg",light:"vesperBg"},syntaxString:{dark:"vesperString",light:"vesperString"},syntaxNumber:{dark:"vesperNumber",light:"vesperNumber"},syntaxType:{dark:"vesperFunction",light:"vesperFunction"},syntaxOperator:{dark:"vesperKeyword",light:"vesperKeyword"},syntaxPunctuation:{dark:"vesperFg",light:"vesperBg"}}};var warm_lightmode_default={$schema:"https://opencode.ai/theme.json",defs:{warmlightmodeBgDark:"#101014",warmlightmodePanelDark:"#18181F",warmlightmodeElemDark:"#1F1F28",warmlightmodeTextDark:"#E6E6E6",warmlightmodeMutedDark:"#9A9A9A",warmlightmodePrimaryDark:"#9D681D",warmlightmodeAccentDark:"#CE661C",warmlightmodeSecondaryDark:"#9D681D",warmlightmodeBorderDark:"#A17A17",warmlightmodeBorderSubtleDark:"#806949",warmlightmodeBgLight:"#F5F0E8",warmlightmodePanelLight:"#EBE6DF",warmlightmodeElemLight:"#E1DDD5",warmlightmodeTextLight:"#2C1810",warmlightmodeMutedLight:"#8B7355",warmlightmodePrimaryLight:"#5C3D11",warmlightmodeAccentLight:"#8B4513",warmlightmodeSecondaryLight:"#5C3D11",warmlightmodeBorderLight:"#8B6914",warmlightmodeBorderSubtleLight:"#A0845C",warmlightmodeOkDark:"#2E7D32",warmlightmodeErrorDark:"#C62828",warmlightmodeWarnDark:"#E65100",warmlightmodeOkLight:"#2E7D32",warmlightmodeErrorLight:"#C62828",warmlightmodeWarnLight:"#E65100"},theme:{primary:{dark:"warmlightmodePrimaryDark",light:"warmlightmodePrimaryLight"},secondary:{dark:"warmlightmodeSecondaryDark",light:"warmlightmodeSecondaryLight"},accent:{dark:"warmlightmodeAccentDark",light:"warmlightmodeAccentLight"},error:{dark:"warmlightmodeErrorDark",light:"warmlightmodeErrorLight"},warning:{dark:"warmlightmodeWarnDark",light:"warmlightmodeWarnLight"},success:{dark:"warmlightmodeOkDark",light:"warmlightmodeOkLight"},info:{dark:"warmlightmodeAccentDark",light:"warmlightmodeAccentLight"},text:{dark:"warmlightmodeTextDark",light:"warmlightmodeTextLight"},textMuted:{dark:"warmlightmodeMutedDark",light:"warmlightmodeMutedLight"},background:{dark:"warmlightmodeBgDark",light:"warmlightmodeBgLight"},backgroundPanel:{dark:"warmlightmodePanelDark",light:"warmlightmodePanelLight"},backgroundElement:{dark:"warmlightmodeElemDark",light:"warmlightmodeElemLight"},border:{dark:"warmlightmodeBorderDark",light:"warmlightmodeBorderLight"},borderActive:{dark:"warmlightmodeAccentDark",light:"warmlightmodeAccentLight"},borderSubtle:{dark:"warmlightmodeBorderSubtleDark",light:"warmlightmodeBorderSubtleLight"},diffAdded:{dark:"warmlightmodeOkDark",light:"warmlightmodeOkLight"},diffRemoved:{dark:"warmlightmodeErrorDark",light:"warmlightmodeErrorLight"},diffContext:{dark:"warmlightmodeMutedDark",light:"warmlightmodeMutedLight"},diffHunkHeader:{dark:"warmlightmodeMutedDark",light:"warmlightmodeMutedLight"},diffHighlightAdded:{dark:"warmlightmodeOkDark",light:"warmlightmodeOkLight"},diffHighlightRemoved:{dark:"warmlightmodeErrorDark",light:"warmlightmodeErrorLight"},diffAddedBg:{dark:"#152419",light:"#D7DFCD"},diffRemovedBg:{dark:"#311418",light:"#EED2CB"},diffContextBg:{dark:"warmlightmodePanelDark",light:"warmlightmodePanelLight"},diffLineNumber:{dark:"warmlightmodeMutedDark",light:"warmlightmodeMutedLight"},diffAddedLineNumberBg:{dark:"#131B17",light:"#E5E7D9"},diffRemovedLineNumberBg:{dark:"#221216",light:"#F1E0D9"},markdownText:{dark:"warmlightmodeTextDark",light:"warmlightmodeTextLight"},markdownHeading:{dark:"warmlightmodePrimaryDark",light:"warmlightmodePrimaryLight"},markdownLink:{dark:"warmlightmodeAccentDark",light:"warmlightmodeAccentLight"},markdownLinkText:{dark:"warmlightmodeSecondaryDark",light:"warmlightmodeSecondaryLight"},markdownCode:{dark:"warmlightmodeSecondaryDark",light:"warmlightmodeSecondaryLight"},markdownBlockQuote:{dark:"warmlightmodeMutedDark",light:"warmlightmodeMutedLight"},markdownEmph:{dark:"warmlightmodeAccentDark",light:"warmlightmodeAccentLight"},markdownStrong:{dark:"warmlightmodePrimaryDark",light:"warmlightmodePrimaryLight"},markdownHorizontalRule:{dark:"warmlightmodeBorderDark",light:"warmlightmodeBorderLight"},markdownListItem:{dark:"warmlightmodeTextDark",light:"warmlightmodeTextLight"},markdownListEnumeration:{dark:"warmlightmodeAccentDark",light:"warmlightmodeAccentLight"},markdownImage:{dark:"warmlightmodeAccentDark",light:"warmlightmodeAccentLight"},markdownImageText:{dark:"warmlightmodeMutedDark",light:"warmlightmodeMutedLight"},markdownCodeBlock:{dark:"warmlightmodeTextDark",light:"warmlightmodeTextLight"},syntaxComment:{dark:"warmlightmodeMutedDark",light:"warmlightmodeMutedLight"},syntaxKeyword:{dark:"warmlightmodeAccentDark",light:"warmlightmodeAccentLight"},syntaxFunction:{dark:"warmlightmodePrimaryDark",light:"warmlightmodePrimaryLight"},syntaxVariable:{dark:"warmlightmodeTextDark",light:"warmlightmodeTextLight"},syntaxString:{dark:"warmlightmodeOkDark",light:"warmlightmodeOkLight"},syntaxNumber:{dark:"warmlightmodeAccentDark",light:"warmlightmodeAccentLight"},syntaxType:{dark:"warmlightmodeSecondaryDark",light:"warmlightmodeSecondaryLight"},syntaxOperator:{dark:"warmlightmodeSecondaryDark",light:"warmlightmodeSecondaryLight"},syntaxPunctuation:{dark:"warmlightmodeTextDark",light:"warmlightmodeTextLight"}}};var zenburn_default={$schema:"https://opencode.ai/theme.json",defs:{bg:"#3f3f3f",bgAlt:"#4f4f4f",bgPanel:"#5f5f5f",fg:"#dcdccc",fgMuted:"#9f9f9f",red:"#cc9393",redBright:"#dca3a3",green:"#7f9f7f",greenBright:"#8fb28f",yellow:"#f0dfaf",yellowDim:"#e0cf9f",blue:"#8cd0d3",blueDim:"#7cb8bb",magenta:"#dc8cc3",cyan:"#93e0e3",orange:"#dfaf8f"},theme:{primary:{dark:"blue",light:"#5f7f8f"},secondary:{dark:"magenta",light:"#8f5f8f"},accent:{dark:"cyan",light:"#5f8f8f"},error:{dark:"red",light:"#8f5f5f"},warning:{dark:"yellow",light:"#8f8f5f"},success:{dark:"green",light:"#5f8f5f"},info:{dark:"orange",light:"#8f7f5f"},text:{dark:"fg",light:"#3f3f3f"},textMuted:{dark:"fgMuted",light:"#6f6f6f"},background:{dark:"bg",light:"#ffffef"},backgroundPanel:{dark:"bgAlt",light:"#f5f5e5"},backgroundElement:{dark:"bgPanel",light:"#ebebdb"},border:{dark:"#5f5f5f",light:"#d0d0c0"},borderActive:{dark:"blue",light:"#5f7f8f"},borderSubtle:{dark:"#4f4f4f",light:"#e0e0d0"},diffAdded:{dark:"green",light:"#5f8f5f"},diffRemoved:{dark:"red",light:"#8f5f5f"},diffContext:{dark:"fgMuted",light:"#6f6f6f"},diffHunkHeader:{dark:"cyan",light:"#5f8f8f"},diffHighlightAdded:{dark:"greenBright",light:"#5f8f5f"},diffHighlightRemoved:{dark:"redBright",light:"#8f5f5f"},diffAddedBg:{dark:"#4f5f4f",light:"#efffef"},diffRemovedBg:{dark:"#5f4f4f",light:"#ffefef"},diffContextBg:{dark:"bgAlt",light:"#f5f5e5"},diffLineNumber:{dark:"#6f6f6f",light:"#b0b0a0"},diffAddedLineNumberBg:{dark:"#4f5f4f",light:"#efffef"},diffRemovedLineNumberBg:{dark:"#5f4f4f",light:"#ffefef"},markdownText:{dark:"fg",light:"#3f3f3f"},markdownHeading:{dark:"yellow",light:"#8f8f5f"},markdownLink:{dark:"blue",light:"#5f7f8f"},markdownLinkText:{dark:"cyan",light:"#5f8f8f"},markdownCode:{dark:"green",light:"#5f8f5f"},markdownBlockQuote:{dark:"fgMuted",light:"#6f6f6f"},markdownEmph:{dark:"yellowDim",light:"#8f8f5f"},markdownStrong:{dark:"orange",light:"#8f7f5f"},markdownHorizontalRule:{dark:"fgMuted",light:"#6f6f6f"},markdownListItem:{dark:"blue",light:"#5f7f8f"},markdownListEnumeration:{dark:"cyan",light:"#5f8f8f"},markdownImage:{dark:"blue",light:"#5f7f8f"},markdownImageText:{dark:"cyan",light:"#5f8f8f"},markdownCodeBlock:{dark:"fg",light:"#3f3f3f"},syntaxComment:{dark:"#7f9f7f",light:"#5f7f5f"},syntaxKeyword:{dark:"yellow",light:"#8f8f5f"},syntaxFunction:{dark:"blue",light:"#5f7f8f"},syntaxVariable:{dark:"fg",light:"#3f3f3f"},syntaxString:{dark:"red",light:"#8f5f5f"},syntaxNumber:{dark:"greenBright",light:"#5f8f5f"},syntaxType:{dark:"cyan",light:"#5f8f8f"},syntaxOperator:{dark:"yellow",light:"#8f8f5f"},syntaxPunctuation:{dark:"fg",light:"#3f3f3f"}}};var DEFAULT_THEMES={ares:ares_default,aura:aura_default,ayu:ayu_default,carbonfox:carbonfox_default,catppuccin:catppuccin_default,"catppuccin-frappe":catppuccin_frappe_default,"catppuccin-macchiato":catppuccin_macchiato_default,charizard:charizard_default,cobalt2:cobalt2_default,cursor:cursor_default,daylight:daylight_default,default:default_default,dracula:dracula_default,everforest:everforest_default,flexoki:flexoki_default,github:github_default,gruvbox:gruvbox_default,kanagawa:kanagawa_default,"lucent-orng":lucent_orng_default,material:material_default,matrix:matrix_default,mercury:mercury_default,mono:mono_default,monokai:monokai_default,nightowl:nightowl_default,nord:nord_default,"one-dark":one_dark_default,opencode:opencode_default,orng:orng_default,"osaka-jade":osaka_jade_default,palenight:palenight_default,poseidon:poseidon_default,rosepine:rosepine_default,sisyphus:sisyphus_default,slate:slate_default,solarized:solarized_default,synthwave84:synthwave84_default,tokyonight:tokyonight_default,vercel:vercel_default,vesper:vesper_default,"warm-lightmode":warm_lightmode_default,zenburn:zenburn_default},DEFAULT_THEME="tokyonight";function syntax(theme){return SyntaxStyle.fromTheme(rules(theme))}function rules(theme){return[{scope:["default"],style:{foreground:theme.text}},{scope:["comment","comment.documentation"],style:{foreground:theme.syntaxComment,italic:!0}},{scope:["string","symbol"],style:{foreground:theme.syntaxString}},{scope:["number","boolean"],style:{foreground:theme.syntaxNumber}},{scope:["keyword"],style:{foreground:theme.syntaxKeyword,italic:!0}},{scope:["keyword.return","keyword.conditional","keyword.repeat"],style:{foreground:theme.syntaxKeyword,italic:!0}},{scope:["keyword.type"],style:{foreground:theme.syntaxType,bold:!0}},{scope:["keyword.function","function.method"],style:{foreground:theme.syntaxFunction}},{scope:["function","function.call"],style:{foreground:theme.syntaxFunction}},{scope:["variable","variable.parameter"],style:{foreground:theme.syntaxVariable}},{scope:["type"],style:{foreground:theme.syntaxType}},{scope:["operator"],style:{foreground:theme.syntaxOperator}},{scope:["punctuation","punctuation.bracket","punctuation.delimiter"],style:{foreground:theme.syntaxPunctuation}},{scope:["markup.heading"],style:{foreground:theme.markdownHeading,bold:!0}},{scope:["markup.strong"],style:{foreground:theme.markdownStrong,bold:!0}},{scope:["markup.italic"],style:{foreground:theme.markdownEmph,italic:!0}},{scope:["markup.link"],style:{foreground:theme.markdownLink,underline:!0}},{scope:["markup.raw"],style:{foreground:theme.markdownCode}},{scope:["markup.list"],style:{foreground:theme.markdownListItem}}]}var import_react14=__toESM(require_react_production(),1);import{join as join5}from"path";import{existsSync as existsSync6,mkdirSync as mkdirSync2,readFileSync,writeFileSync as writeFileSync2}from"fs";import{homedir as homedir2}from"os";import{join as join4}from"path";import{existsSync as existsSync5,mkdirSync,readdirSync,renameSync}from"fs";var HOME=()=>process.env.HOME||homedir2(),HERMES_HOME=()=>process.env.HERMES_HOME||join4(HOME(),".hermes"),migrated=!1;function configDir(){let dir=process.env.HERM_CONFIG_DIR||join4(HERMES_HOME(),"herm");if(!migrated)migrated=!0,maybeMigrateLegacy(dir);return dir}function maybeMigrateLegacy(target){if(process.env.HERM_CONFIG_DIR)return;let legacy=join4(HOME(),".config","herm");if(!existsSync5(legacy)||legacy===target)return;try{if(existsSync5(target)&&readdirSync(target).length>0)return;mkdirSync(target,{recursive:!0});for(let name of readdirSync(legacy)){let src=join4(legacy,name),dst=join4(target,name);if(existsSync5(dst))continue;try{renameSync(src,dst)}catch{}}}catch{}}var DEFAULTS={mouse:!0,targetFps:30};function configFile(){return join5(configDir(),"tui.json")}var cached=null;function reload(){cached=null;for(let l of listeners)l()}function load(){if(cached)return cached;let CONFIG_FILE=configFile();try{if(!existsSync6(CONFIG_FILE)){let prefs2={...DEFAULTS};return cached=prefs2,prefs2}let raw=JSON.parse(readFileSync(CONFIG_FILE,"utf-8")),prefs={...DEFAULTS,...raw};return cached=prefs,prefs}catch{let prefs={...DEFAULTS};return cached=prefs,prefs}}function save(partial){let current=load();if(partial)Object.assign(current,partial);cached=current;try{let CONFIG_DIR=configDir();if(!existsSync6(CONFIG_DIR))mkdirSync2(CONFIG_DIR,{recursive:!0});let json2=JSON.stringify(current,null,2)+`
|
|
3674
3674
|
`;writeFileSync2(configFile(),json2,"utf-8")}catch(err){if(process.env.PERF)console.error("[preferences] failed to save:",err)}}function get(key){return load()[key]}function set(key,value){save({[key]:value});for(let l of listeners)l()}var listeners=new Set;function subscribe(l){return listeners.add(l),()=>listeners.delete(l)}function usePref(key){return import_react14.useSyncExternalStore(subscribe,()=>load()[key])}var Ctx=import_react15.createContext(null),ThemeProvider=({children,initial,mode:initialMode="dark"})=>{let active=usePref("theme")??initial??DEFAULT_THEME,[mode]=import_react15.useState(initialMode),[themes]=import_react15.useState(DEFAULT_THEMES),resolved=import_react15.useMemo(()=>{let json2=themes[active]??themes[DEFAULT_THEME];try{return resolveTheme(json2,mode)}catch{return resolveTheme(themes[DEFAULT_THEME],mode)}},[active,mode,themes]),names=import_react15.useMemo(()=>Object.keys(themes).sort(),[themes]),set2=import_react15.useCallback((name)=>{if(!themes[name])return!1;return set("theme",name),!0},[themes]),has=import_react15.useCallback((name)=>themes[name]!==void 0,[themes]),syntaxStyle=import_react15.useMemo(()=>syntax(resolved),[resolved]),value=import_react15.useMemo(()=>({theme:resolved,syntaxStyle,name:active,mode,set:set2,names,has}),[resolved,syntaxStyle,active,mode,set2,names,has]);return $jsx(Ctx.Provider,{value,children})},useTheme=()=>{let ctx=import_react15.useContext(Ctx);if(!ctx)throw Error("useTheme() must be used inside <ThemeProvider>");return ctx};var import_react16=__toESM(require_react_production(),1);var FRAMES=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],MS=80,subs=new Set,tick=0,timer=null;function sub(fn){if(subs.add(fn),!timer)timer=setInterval(()=>{tick=(tick+1)%FRAMES.length;for(let s of subs)s(tick)},MS);return()=>{if(subs.delete(fn),subs.size===0&&timer)clearInterval(timer),timer=null}}function useFrame(active){let[n,set2]=import_react16.useState(tick);return import_react16.useEffect(()=>active?sub(set2):void 0,[active]),n}var Spinner=import_react16.memo((props)=>{let theme=useTheme().theme,color=props.color??theme.textMuted,on=get("animations")!==!1,n=useFrame(on);return $jsxs("text",{children:[$jsx("span",{fg:color,children:on?FRAMES[n]:"\u22EF"}),props.label?$jsxs("span",{fg:color,children:[" ",props.label]}):null]})});function useSpinnerGlyph(active=!0){let on=get("animations")!==!1&&active,n=useFrame(on);return on?FRAMES[n]:"\u22EF"}var SPEC={terminal:{icon:"$",verb:"",pending:"Writing command\u2026"},process:{icon:"\u229A",verb:"Process",pending:"Managing process\u2026"},execute_code:{icon:"\xBB",verb:"Exec",pending:"Writing script\u2026"},read_file:{icon:"\u2192",verb:"Read",pending:"Reading file\u2026"},write_file:{icon:"\u2190",verb:"Write",pending:"Preparing write\u2026"},patch:{icon:"\u2190",verb:"Edit",pending:"Preparing edit\u2026"},search_files:{icon:"\u2731",verb:"Search",pending:"Searching\u2026"},web_search:{icon:"\u25C8",verb:"Web",pending:"Searching web\u2026"},web_extract:{icon:"%",verb:"Fetch",pending:"Fetching page\u2026"},session_search:{icon:"\u21BA",verb:"Recall",pending:"Searching memory\u2026"},browser_navigate:{icon:"%",verb:"Navigate",pending:"Navigating\u2026"},browser_click:{icon:"\xB7",verb:"Click",pending:"Clicking\u2026"},browser_type:{icon:"\u2328",verb:"Type",pending:"Typing\u2026"},browser_snapshot:{icon:"\u2399",verb:"Snapshot",pending:"Capturing\u2026"},browser_vision:{icon:"\u25C9",verb:"Vision",pending:"Looking\u2026"},vision_analyze:{icon:"\u25C9",verb:"Vision",pending:"Analyzing image\u2026"},todo:{icon:"\u2630",verb:"Todo",pending:"Updating todos\u2026"},memory:{icon:"\u2691",verb:"Memory",pending:"Updating memory\u2026"},clarify:{icon:"?",verb:"Ask",pending:"Asking\u2026"},skill_view:{icon:"\u25C6",verb:"Skill",pending:"Loading skill\u2026"},skills_list:{icon:"\u25C6",verb:"Skills",pending:"Listing skills\u2026"},skill_manage:{icon:"\u25C6",verb:"Skill",pending:"Managing skill\u2026"},delegate_task:{icon:"\u2299",verb:"Delegate",pending:"Spawning agent\u2026"},cronjob:{icon:"\u25F7",verb:"Cron",pending:"Managing cron\u2026"},text_to_speech:{icon:"\u266A",verb:"TTS",pending:"Synthesizing\u2026"},image_generate:{icon:"\u2726",verb:"Image",pending:"Generating image\u2026"}},GENERIC={icon:"\u2699",verb:"",pending:"Running\u2026"};function spec(name){if(name.startsWith("subagent"))return{icon:"\u2299",verb:"Subagent",pending:"Running\u2026"};if(name.startsWith("mcp__")||name.startsWith("mcp:"))return{icon:"\u25C7",verb:"MCP",pending:"Calling\u2026"};return SPEC[name]??GENERIC}function ms(d2){if(d2==null)return"";if(d2<1000)return`${Math.round(d2)}ms`;if(d2<60000)return`${(d2/1000).toFixed(1)}s`;return`${Math.floor(d2/60000)}m${Math.round(d2%60000/1000)}s`}var InlineTool=import_react17.memo((p)=>{let theme=useTheme().theme,[hover,setHover]=import_react17.useState(!1),s=spec(p.part.name),running=p.part.status==="running",failed=p.part.status==="error",spin=useSpinnerGlyph(running),fg2=failed?theme.error:hover&&p.onClick?theme.text:running?theme.text:theme.textMuted;return $jsxs("box",{flexDirection:"column",paddingLeft:3,onMouseOver:p.onClick?()=>setHover(!0):void 0,onMouseOut:p.onClick?()=>setHover(!1):void 0,onMouseDown:p.onClick,children:[$jsx("box",{height:1,children:$jsxs("text",{children:[$jsxs("span",{fg:running?theme.warning:p.iconColor??fg2,children:[running?spin:s.icon," "]}),p.complete??!0?$jsx("span",{fg:fg2,children:p.children}):$jsxs("span",{fg:fg2,children:["~ ",s.pending]}),p.part.duration!=null?$jsxs("span",{fg:theme.textMuted,children:[" ",ms(p.part.duration)]}):null]})}),failed&&p.part.result?$jsx("box",{minHeight:1,paddingLeft:2,children:$jsx("text",{fg:theme.error,wrapMode:"word",children:p.part.result})}):null]})});var import_react18=__toESM(require_react_production(),1);var ANSI2=/\x1b\[[0-9;?]*[A-Za-z]/g;function isDiff(s){if(!s)return!1;return/^--- a\//m.test(s)||/^@@ /m.test(s)||/^diff --git /m.test(s)}var CAP=80,WORD_CAP=40,tokens=(s)=>s.split(/(\s+)/).filter((t2)=>t2.length>0);function wordDiff(a,b2){let ta=tokens(a),tb=tokens(b2),p=0;while(p<ta.length&&p<tb.length&&ta[p]===tb[p])p++;let s=0;while(s<ta.length-p&&s<tb.length-p&&ta[ta.length-1-s]===tb[tb.length-1-s])s++;let seg=(t2)=>{let mid2=t2.slice(p,t2.length-s).join(""),out=[];if(p)out.push({text:t2.slice(0,p).join(""),hi:!1});if(mid2)out.push({text:mid2,hi:!0});if(s)out.push({text:t2.slice(t2.length-s).join(""),hi:!1});return out};return[seg(ta),seg(tb)]}function intraline(rows){let marks=rows.map(()=>null);if(rows.length>WORD_CAP)return marks;let del=(l)=>l.startsWith("-")&&!l.startsWith("---"),add=(l)=>l.startsWith("+")&&!l.startsWith("+++"),i=0;while(i<rows.length){if(!del(rows[i])){i++;continue}let j2=i;while(j2<rows.length&&del(rows[j2]))j2++;let k2=j2;while(k2<rows.length&&add(rows[k2]))k2++;let n=Math.min(j2-i,k2-j2);for(let d2=0;d2<n;d2++){let[rm,ad]=wordDiff(rows[i+d2].slice(1),rows[j2+d2].slice(1));marks[i+d2]=rm,marks[j2+d2]=ad}i=k2}return marks}var DiffBlock=import_react18.memo(({text:text2})=>{let theme=useTheme().theme,all=text2.replace(ANSI2,"").replace(/\n$/,"").split(`
|
|
@@ -4084,7 +4084,7 @@ tell application "System Events" to get value of property list item "CFBundleNam
|
|
|
4084
4084
|
`+tail;else buf.push(tail)}return flush2(),out}var MediaChip=import_react33.memo((props)=>{let theme=useTheme().theme,[hover,setHover]=import_react33.useState(!1),kind=classify(props.path),badge={img:theme.accent,audio:theme.warning,video:theme.info,url:theme.primary,file:theme.secondary}[kind],click=props.onMouseDown??((e)=>{e.stopPropagation(),openFile(props.path)});return $jsx("box",{flexDirection:"row",height:1,onMouseDown:click,onMouseOver:()=>setHover(!0),onMouseOut:()=>setHover(!1),children:$jsxs("text",{children:[$jsxs("span",{bg:badge,fg:theme.background,children:[" ",kind," "]}),$jsxs("span",{bg:theme.backgroundElement,fg:theme.text,attributes:hover?TextAttributes.UNDERLINE:TextAttributes.NONE,children:[" ",basename4(props.path)," "]})]})})});var import_react35=__toESM(require_react_production(),1);var import_react34=__toESM(require_react_production(),1);var Ctx3=import_react34.createContext(null),DEFAULT_DURATION=3000,ToastProvider=({children})=>{let[items,setItems]=import_react34.useState([]),counter=import_react34.useRef(0),timers=import_react34.useRef(new Map);import_react34.useEffect(()=>()=>{for(let t2 of timers.current.values())clearTimeout(t2)},[]);let show=import_react34.useCallback((opts)=>{let id=++counter.current;setItems((prev)=>[...prev,{...opts,id}]);let dur2=opts.duration??DEFAULT_DURATION;timers.current.set(id,setTimeout(()=>{timers.current.delete(id),setItems((prev)=>prev.filter((t2)=>t2.id!==id))},dur2))},[]),error=import_react34.useCallback((err)=>{show({variant:"error",title:"Error",message:err.message})},[show]),value=import_react34.useMemo(()=>({show,error}),[show,error]);return $jsxs(Ctx3.Provider,{value,children:[children,items.length>0?$jsx(ToastOverlay,{items}):null]})},ToastOverlay=({items})=>{let theme=useTheme().theme,color=(variant)=>{switch(variant){case"error":return theme.error;case"warning":return theme.warning;case"success":return theme.success;default:return theme.info}};return $jsx("box",{position:"absolute",top:2,right:2,flexDirection:"column",gap:1,zIndex:200,maxWidth:60,children:items.map((item)=>$jsxs("box",{backgroundColor:theme.backgroundPanel,border:["left"],borderStyle:"single",borderColor:color(item.variant),paddingLeft:1,paddingRight:1,flexDirection:"column",children:[item.title?$jsx("text",{fg:theme.text,children:$jsx("strong",{children:item.title})}):null,$jsx("text",{fg:theme.textMuted,wrapMode:"word",children:item.message}),item.action?$jsx("box",{height:1,marginTop:0,onMouseDown:item.action.run,children:$jsx("text",{fg:color(item.variant),children:$jsx("u",{children:item.action.label})})}):null]},item.id))})},useToast=()=>{let ctx=import_react34.useContext(Ctx3);if(!ctx)throw Error("useToast() must be inside <ToastProvider>");return ctx};var FILETYPE={ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",py:"python",rb:"ruby",rs:"rust",sh:"bash",shell:"bash",yml:"yaml",md:"markdown"},CodeBlock=import_react35.memo((props)=>{let{theme,syntaxStyle}=useTheme(),toast=useToast(),[hover,setHover]=import_react35.useState(!1),ft=props.lang?FILETYPE[props.lang.toLowerCase()]??props.lang.toLowerCase():void 0,lines2=props.code.split(`
|
|
4085
4085
|
`).length,onCopy=()=>{copy(props.code),toast.show({variant:"success",message:`Copied ${lines2} line${lines2===1?"":"s"}`})};return $jsxs("box",{flexDirection:"column",marginTop:1,border:["left"],borderColor:theme.border,customBorderChars:LEFT_BAR,backgroundColor:theme.backgroundPanel,paddingLeft:1,children:[$jsxs("box",{flexDirection:"row",height:1,backgroundColor:theme.backgroundElement,onMouseDown:onCopy,onMouseOver:()=>setHover(!0),onMouseOut:()=>setHover(!1),children:[$jsx("box",{flexGrow:1,paddingLeft:1,children:$jsx("text",{fg:theme.textMuted,children:props.lang||"text"})}),$jsx("box",{paddingRight:1,children:$jsx("text",{fg:hover?theme.accent:theme.textMuted,children:hover?"\u29C9 copy":`${lines2} ln`})})]}),$jsx("box",{paddingX:1,paddingY:ft?0:1,children:ft?$jsx("code",{content:props.code,filetype:ft,syntaxStyle,fg:theme.text,wrapMode:"none",streaming:props.streaming}):$jsx("text",{fg:theme.text,children:props.code})})]})});var import_react36=__toESM(require_react_production(),1);function digit(name){let n=parseInt(name,10);return Number.isFinite(n)?n:null}var Frame=(p)=>{let theme=useTheme().theme;return $jsx("box",{flexDirection:"column",border:["left"],borderColor:p.tint,customBorderChars:LEFT_BAR,backgroundColor:theme.backgroundPanel,marginBottom:1,children:p.children})},Pill=(p)=>{let theme=useTheme().theme;return $jsx("box",{height:1,paddingX:1,backgroundColor:p.on?theme.primary:void 0,onMouseDown:p.onPick,children:$jsxs("text",{children:[$jsxs("span",{fg:p.on?theme.background:theme.textMuted,children:[p.hot," "]}),$jsx("span",{fg:p.on?theme.background:theme.text,children:p.label})]})})},CHOICES=["once","session","always","deny"],LABELS={once:"Allow once",session:"Allow this session",always:"Always allow",deny:"Deny"},Approval=import_react36.forwardRef((p,ref)=>{let theme=useTheme().theme,gw=useGateway(),[sel,setSel]=import_react36.useState(0),done=import_react36.useRef(!1),send=(c)=>{if(done.current)return;done.current=!0,gw.request("approval.respond",{choice:c}).catch(()=>{}),p.onAnswer(LABELS[c],c!=="deny")};return import_react36.useImperativeHandle(ref,()=>({masked:!1,feed:(key2)=>{if(key2.name==="left"||key2.name==="h")return setSel((s)=>(s+CHOICES.length-1)%CHOICES.length),!0;if(key2.name==="right"||key2.name==="l")return setSel((s)=>(s+1)%CHOICES.length),!0;if(key2.name==="return")return send(CHOICES[sel]),!0;if(key2.name==="escape")return send("deny"),!0;let n=digit(key2.name);if(n!==null&&n>=1&&n<=CHOICES.length)return send(CHOICES[n-1]),!0;return!1}}),[sel]),$jsxs(Frame,{tint:theme.warning,children:[$jsxs("box",{flexDirection:"column",gap:1,paddingLeft:1,paddingRight:2,paddingY:1,children:[$jsxs("box",{flexDirection:"row",gap:1,height:1,children:[$jsx("text",{fg:theme.warning,children:"\u25B3"}),$jsx("text",{fg:theme.text,children:"Permission required"})]}),$jsxs("box",{flexDirection:"row",gap:1,paddingLeft:2,minHeight:1,children:[$jsx("text",{fg:theme.textMuted,children:"#"}),$jsx("text",{fg:theme.text,wrapMode:"word",children:p.req.description||"Shell command"})]}),$jsx("box",{paddingLeft:2,minHeight:1,children:$jsxs("text",{fg:theme.text,wrapMode:"word",children:["$ ",p.req.command]})})]}),$jsxs("box",{flexDirection:"row",gap:2,flexShrink:0,paddingX:2,paddingY:1,backgroundColor:theme.backgroundElement,children:[CHOICES.map((c,i)=>$jsx(Pill,{on:sel===i,hot:String(i+1),label:LABELS[c],onPick:()=>send(c)},c)),$jsx("box",{flexGrow:1}),$jsx("box",{height:1,children:$jsx("text",{fg:theme.textMuted,children:"\u2190/\u2192 \xB7 enter \xB7 esc deny"})})]})]})}),Clarify=import_react36.forwardRef((p,ref)=>{let theme=useTheme().theme,gw=useGateway(),choices=p.req.choices??[],[sel,setSel]=import_react36.useState(0),[typing,setTyping]=import_react36.useState(choices.length===0),[custom,setCustom]=import_react36.useState(""),done=import_react36.useRef(!1),send=(answer)=>{if(done.current)return;done.current=!0,gw.request("clarify.respond",{request_id:p.req.request_id,answer}).catch(()=>{}),p.onAnswer(answer||"(cancelled)",answer!=="")};import_react36.useImperativeHandle(ref,()=>({masked:typing,feed:(key2)=>{if(typing){if(key2.name==="escape"){if(choices.length)return setTyping(!1),!0;return send(""),!0}return!1}if(key2.name==="escape")return send(""),!0;if(key2.name==="up")return setSel((s)=>Math.max(0,s-1)),!0;if(key2.name==="down")return setSel((s)=>Math.min(choices.length,s+1)),!0;if(key2.name==="return"){if(sel===choices.length)return setTyping(!0),!0;let c=choices[sel];if(c)send(c);return!0}let n=digit(key2.name);if(n!==null&&n>=1&&n<=choices.length)return send(choices[n-1]),!0;return!1}}),[typing,sel,choices]);let head=$jsx("box",{minHeight:1,children:$jsxs("text",{wrapMode:"word",children:[$jsx("span",{fg:theme.accent,children:$jsx("strong",{children:"ask "})}),$jsx("span",{fg:theme.text,children:$jsx("strong",{children:p.req.question})})]})});return $jsx(Frame,{tint:theme.accent,children:$jsxs("box",{flexDirection:"column",paddingLeft:1,paddingRight:2,paddingY:1,children:[head,$jsx("box",{height:1}),typing?$jsxs($Fragment2,{children:[$jsxs("box",{flexDirection:"row",height:1,children:[$jsx("text",{fg:theme.textMuted,children:"> "}),$jsx("input",{value:custom,onInput:setCustom,onSubmit:()=>send(custom),focused:!0,flexGrow:1,textColor:theme.text,backgroundColor:theme.backgroundElement,focusedBackgroundColor:theme.backgroundElement})]}),$jsxs("text",{fg:theme.textMuted,children:["Enter send \xB7 Esc ",choices.length?"back":"cancel"]})]}):$jsxs($Fragment2,{children:[[...choices,"Other (type your answer)"].map((c,i)=>$jsx("box",{height:1,onMouseDown:()=>i===choices.length?setTyping(!0):send(choices[i]),children:$jsxs("text",{fg:sel===i?theme.text:theme.textMuted,children:[sel===i?"\u25B8 ":" ",i+1,". ",c]})},i)),$jsx("box",{height:1}),$jsxs("text",{fg:theme.textMuted,children:["\u2191/\u2193 \xB7 Enter \xB7 1-",choices.length," \xB7 Esc cancel"]})]})]})})}),Masked=import_react36.forwardRef((p,ref)=>{let theme=useTheme().theme,[value,setValue]=import_react36.useState(""),done=import_react36.useRef(!1),go=(v2)=>{if(done.current)return;done.current=!0,p.onSubmit(v2),p.onAnswer(v2?"(provided)":"(cancelled)",v2!=="")};return import_react36.useImperativeHandle(ref,()=>({masked:!0,feed:(key2)=>{if(key2.name==="escape")return go(""),!0;return!1}}),[]),$jsx(Frame,{tint:theme.warning,children:$jsxs("box",{flexDirection:"column",paddingLeft:1,paddingRight:2,paddingY:1,children:[$jsx("text",{fg:theme.warning,children:$jsx("strong",{children:p.title})}),$jsx("text",{fg:theme.text,children:p.note}),$jsx("box",{height:1}),$jsxs("box",{flexDirection:"row",height:1,position:"relative",children:[$jsx("text",{fg:theme.textMuted,children:"> "}),$jsx("input",{value,onInput:setValue,onSubmit:()=>go(value),focused:!0,flexGrow:1,textColor:theme.backgroundElement,cursorColor:theme.accent,backgroundColor:theme.backgroundElement,focusedBackgroundColor:theme.backgroundElement}),$jsx("box",{position:"absolute",left:2,top:0,height:1,children:$jsx("text",{fg:theme.text,bg:theme.backgroundElement,children:"\u2022".repeat(value.length)})})]}),$jsx("text",{fg:theme.textMuted,children:"Enter submit \xB7 Esc cancel"})]})})}),Outcome=import_react36.memo(({part})=>{let theme=useTheme().theme,a=part.answered,glyph=a.ok?"\u2713":"\u2717",fg2=a.ok?theme.success:theme.error,what=part.variant==="approval"?a.label:part.variant==="clarify"?`chose: ${a.label}`:part.variant==="sudo"?`sudo ${a.label}`:`${part.req.env_var??"secret"} ${a.label}`;return $jsx("box",{height:1,paddingLeft:3,marginBottom:1,children:$jsxs("text",{children:[$jsxs("span",{fg:fg2,children:[glyph," "]}),$jsx("span",{fg:theme.textMuted,children:what})]})})}),PromptCard=import_react36.memo(import_react36.forwardRef((p,ref)=>{let gw=useGateway();if(p.part.answered)return $jsx(Outcome,{part:p.part});let answer=(label,ok)=>p.onAnswer(p.part.id,label,ok),req=p.part.req;if(req.variant==="approval")return $jsx(Approval,{ref,req,onAnswer:answer});if(req.variant==="clarify")return $jsx(Clarify,{ref,req,onAnswer:answer});if(req.variant==="sudo")return $jsx(Masked,{ref,title:"\uD83D\uDD12 Sudo required",note:"Enter your password to elevate privileges.",onSubmit:(v2)=>void gw.request("sudo.respond",{request_id:req.request_id,password:v2}).catch(()=>{}),onAnswer:answer});return $jsx(Masked,{ref,title:`\uD83D\uDD11 Secret: ${req.env_var}`,note:req.prompt,onSubmit:(v2)=>void gw.request("secret.respond",{request_id:req.request_id,value:v2}).catch(()=>{}),onAnswer:answer})}));function pending(messages){for(let i=messages.length-1;i>=0;i--){let m2=messages[i];if(m2.role!=="assistant")continue;for(let j2=m2.parts.length-1;j2>=0;j2--){let part=m2.parts[j2];if(part.type==="prompt"&&!part.answered)return part}}return null}var import_react37=__toESM(require_react_production(),1);import{spawnSync}from"child_process";import{existsSync as existsSync7,statSync}from"fs";function parseChafaLine(line){let out=[],fg2=null,bg2=null,reverse2=!1,i=0,N2=line.length;while(i<N2){if(line.charCodeAt(i)===27&&line.charCodeAt(i+1)===91){let end=line.indexOf("m",i+2);if(end<0){i=N2;break}let params=line.slice(i+2,end).split(";").map((x2)=>parseInt(x2,10)||0),p=0;while(p<params.length){let n=params[p];if(n===0){fg2=null,bg2=null,reverse2=!1,p++;continue}if(n===7){reverse2=!0,p++;continue}if(n===27){reverse2=!1,p++;continue}if(n===38&¶ms[p+1]===2){fg2={r:params[p+2]|0,g:params[p+3]|0,b:params[p+4]|0},p+=5;continue}if(n===48&¶ms[p+1]===2){bg2={r:params[p+2]|0,g:params[p+3]|0,b:params[p+4]|0},p+=5;continue}if(n===39){fg2=null,p++;continue}if(n===49){bg2=null,p++;continue}p++}i=end+1;continue}let cp=line.codePointAt(i),ch=String.fromCodePoint(cp);i+=ch.length;let efg=reverse2?bg2:fg2,ebg=reverse2?fg2:bg2;out.push({ch,fg:efg,bg:ebg})}return out}function parseChafa(text2){return text2.split(`
|
|
4086
4086
|
`).filter((s)=>s.length>0).map(parseChafaLine)}function hex(c){if(!c)return;return`#${c.r.toString(16).padStart(2,"0")}${c.g.toString(16).padStart(2,"0")}${c.b.toString(16).padStart(2,"0")}`}var CHAFA_PATHS=["/usr/sbin/chafa","/usr/bin/chafa","/usr/local/bin/chafa","/opt/homebrew/bin/chafa","/home/linuxbrew/.linuxbrew/bin/chafa"],cachedBin=void 0;function chafaBin(){if(cachedBin!==void 0)return cachedBin;for(let p of CHAFA_PATHS)if(existsSync7(p))return cachedBin=p,p;return cachedBin=null,null}function resolveImage(path7){let full=path7.startsWith("~")?(process.env.HOME??"")+path7.slice(1):path7;return existsSync7(full)?full:null}var CACHE=new Map,CACHE_CAP=50;function cacheGet(k2){let v2=CACHE.get(k2);if(!v2)return;return CACHE.delete(k2),CACHE.set(k2,v2),v2}function cachePut(k2,v2){if(CACHE.size>=CACHE_CAP)CACHE.delete(CACHE.keys().next().value);CACHE.set(k2,v2)}function renderChafa(path7,width,height){let bin=chafaBin();if(!bin)return{err:"chafa not installed"};let full=resolveImage(path7);if(!full)return{err:`not found: ${path7}`};let mtime=0;try{mtime=statSync(full).mtimeMs|0}catch{}let h2=height??Math.max(6,Math.round(width/3)),key2=`${full}:${mtime}:${width}x${h2}`,cached2=cacheGet(key2);if(cached2)return{rows:cached2};let r=spawnSync(bin,[`--size=${width}x${h2}`,"--format=symbols","--symbols=block","--colors=full",full],{encoding:"utf8",timeout:5000});if(r.error)return{err:r.error.message};if(r.status!==0)return{err:(r.stderr||`chafa exit ${r.status}`).trim()};let rows2=parseChafa(r.stdout);return cachePut(key2,rows2),{rows:rows2}}var basename5=(p)=>p.split(/[/\\]/).pop()||p,ChafaImage=import_react37.memo(({path:path7,width})=>{let theme=useTheme().theme,[collapsed,setCollapsed]=import_react37.useState(!1),w2=Math.max(20,Math.min(80,width??60)),hasChafa=chafaBin()!==null,result=import_react37.useMemo(()=>hasChafa?renderChafa(path7,w2):{err:"chafa not installed"},[path7,w2,hasChafa]);if(!hasChafa||"err"in result)return $jsx(MediaChip,{path:path7});if(collapsed)return $jsx(MediaChip,{path:path7,onMouseDown:(e)=>{e.stopPropagation(),setCollapsed(!1)}});return $jsxs("box",{flexDirection:"column",marginTop:1,children:[$jsx("box",{flexDirection:"column",onMouseDown:(e)=>{e.stopPropagation(),setCollapsed(!0)},children:result.rows.map((row,i)=>$jsx("text",{children:row.map((c,j2)=>$jsx("span",{fg:hex(c.fg),bg:hex(c.bg),children:c.ch},j2))},i))}),$jsx("box",{height:1,onMouseDown:(e)=>{e.stopPropagation(),openFile(path7)},children:$jsxs("text",{children:[$jsx("span",{fg:theme.textMuted,children:" "}),$jsx("span",{fg:theme.accent,children:"\u25C9 "}),$jsx("span",{fg:theme.text,children:basename5(path7)}),$jsx("span",{fg:theme.textMuted,children:" click image to collapse \xB7 click name to open"})]})})]})});var import_react38=__toESM(require_react_production(),1);var SKINS=["default","ares","mono","slate","daylight","warm-lightmode","poseidon","sisyphus","charizard"],DEFAULT={agentName:"Hermes"},Ctx4=import_react38.createContext(DEFAULT);function deriveSkin(skin){let name=skin?.branding?.agent_name?.trim();return{skin:skin??void 0,agentName:name||"Hermes"}}var SkinProvider=import_react38.memo(({value,children})=>$jsx(Ctx4.Provider,{value,children}));function useSkin(){return import_react38.useContext(Ctx4)}var SYMBOLS={"\\alpha":"\u03B1","\\beta":"\u03B2","\\gamma":"\u03B3","\\delta":"\u03B4","\\epsilon":"\u03B5","\\varepsilon":"\u03B5","\\zeta":"\u03B6","\\eta":"\u03B7","\\theta":"\u03B8","\\vartheta":"\u03D1","\\iota":"\u03B9","\\kappa":"\u03BA","\\lambda":"\u03BB","\\mu":"\u03BC","\\nu":"\u03BD","\\xi":"\u03BE","\\pi":"\u03C0","\\varpi":"\u03D6","\\rho":"\u03C1","\\varrho":"\u03F1","\\sigma":"\u03C3","\\varsigma":"\u03C2","\\tau":"\u03C4","\\upsilon":"\u03C5","\\phi":"\u03C6","\\varphi":"\u03C6","\\chi":"\u03C7","\\psi":"\u03C8","\\omega":"\u03C9","\\Gamma":"\u0393","\\Delta":"\u0394","\\Theta":"\u0398","\\Lambda":"\u039B","\\Xi":"\u039E","\\Pi":"\u03A0","\\Sigma":"\u03A3","\\Upsilon":"\u03A5","\\Phi":"\u03A6","\\Psi":"\u03A8","\\Omega":"\u03A9","\\sum":"\u2211","\\prod":"\u220F","\\coprod":"\u2210","\\int":"\u222B","\\iint":"\u222C","\\iiint":"\u222D","\\oint":"\u222E","\\bigcup":"\u22C3","\\bigcap":"\u22C2","\\bigvee":"\u22C1","\\bigwedge":"\u22C0","\\bigoplus":"\u2A01","\\bigotimes":"\u2A02","\\partial":"\u2202","\\nabla":"\u2207","\\sqrt":"\u221A","\\emptyset":"\u2205","\\varnothing":"\u2205","\\infty":"\u221E","\\in":"\u2208","\\notin":"\u2209","\\ni":"\u220B","\\subset":"\u2282","\\supset":"\u2283","\\subseteq":"\u2286","\\supseteq":"\u2287","\\subsetneq":"\u228A","\\supsetneq":"\u228B","\\cup":"\u222A","\\cap":"\u2229","\\setminus":"\u2216","\\complement":"\u2201","\\forall":"\u2200","\\exists":"\u2203","\\nexists":"\u2204","\\land":"\u2227","\\lor":"\u2228","\\lnot":"\xAC","\\neg":"\xAC","\\therefore":"\u2234","\\because":"\u2235","\\le":"\u2264","\\leq":"\u2264","\\ge":"\u2265","\\geq":"\u2265","\\ne":"\u2260","\\neq":"\u2260","\\ll":"\u226A","\\gg":"\u226B","\\approx":"\u2248","\\equiv":"\u2261","\\cong":"\u2245","\\sim":"\u223C","\\simeq":"\u2243","\\propto":"\u221D","\\perp":"\u22A5","\\parallel":"\u2225","\\models":"\u22A8","\\vdash":"\u22A2","\\mid":"\u2223","\\nmid":"\u2224","\\divides":"\u2223","\\blacksquare":"\u25A0","\\square":"\u25A1","\\Box":"\u25A1","\\qed":"\u220E","\\bigstar":"\u2605","\\bmod":"mod","\\mod":"mod","\\langle":"\u27E8","\\rangle":"\u27E9","\\lceil":"\u2308","\\rceil":"\u2309","\\lfloor":"\u230A","\\rfloor":"\u230B","\\|":"\u2016","\\to":"\u2192","\\rightarrow":"\u2192","\\leftarrow":"\u2190","\\leftrightarrow":"\u2194","\\Rightarrow":"\u21D2","\\Leftarrow":"\u21D0","\\Leftrightarrow":"\u21D4","\\implies":"\u27F9","\\impliedby":"\u27F8","\\iff":"\u27FA","\\mapsto":"\u21A6","\\hookrightarrow":"\u21AA","\\hookleftarrow":"\u21A9","\\uparrow":"\u2191","\\downarrow":"\u2193","\\updownarrow":"\u2195","\\cdot":"\u22C5","\\cdots":"\u22EF","\\ldots":"\u2026","\\dots":"\u2026","\\dotsb":"\u2026","\\dotsc":"\u2026","\\vdots":"\u22EE","\\ddots":"\u22F1","\\times":"\xD7","\\div":"\xF7","\\pm":"\xB1","\\mp":"\u2213","\\circ":"\u2218","\\bullet":"\u2022","\\star":"\u22C6","\\ast":"\u2217","\\oplus":"\u2295","\\ominus":"\u2296","\\otimes":"\u2297","\\odot":"\u2299","\\diamond":"\u22C4","\\angle":"\u2220","\\triangle":"\u25B3","\\,":" ","\\;":" ","\\:":" ","\\!":"","\\ ":" ","\\quad":" ","\\qquad":" ","\\sin":"sin","\\cos":"cos","\\tan":"tan","\\cot":"cot","\\sec":"sec","\\csc":"csc","\\arcsin":"arcsin","\\arccos":"arccos","\\arctan":"arctan","\\sinh":"sinh","\\cosh":"cosh","\\tanh":"tanh","\\log":"log","\\ln":"ln","\\exp":"exp","\\det":"det","\\dim":"dim","\\ker":"ker","\\lim":"lim","\\liminf":"liminf","\\limsup":"limsup","\\sup":"sup","\\inf":"inf","\\max":"max","\\min":"min","\\arg":"arg","\\gcd":"gcd","\\&":"&","\\%":"%","\\$":"$","\\#":"#","\\_":"_","\\{":"{","\\}":"}"},BB={A:"\uD835\uDD38",B:"\uD835\uDD39",C:"\u2102",D:"\uD835\uDD3B",E:"\uD835\uDD3C",F:"\uD835\uDD3D",G:"\uD835\uDD3E",H:"\u210D",I:"\uD835\uDD40",J:"\uD835\uDD41",K:"\uD835\uDD42",L:"\uD835\uDD43",M:"\uD835\uDD44",N:"\u2115",O:"\uD835\uDD46",P:"\u2119",Q:"\u211A",R:"\u211D",S:"\uD835\uDD4A",T:"\uD835\uDD4B",U:"\uD835\uDD4C",V:"\uD835\uDD4D",W:"\uD835\uDD4E",X:"\uD835\uDD4F",Y:"\uD835\uDD50",Z:"\u2124"},CAL={A:"\uD835\uDC9C",B:"\u212C",C:"\uD835\uDC9E",D:"\uD835\uDC9F",E:"\u2130",F:"\u2131",G:"\uD835\uDCA2",H:"\u210B",I:"\u2110",J:"\uD835\uDCA5",K:"\uD835\uDCA6",L:"\u2112",M:"\u2133",N:"\uD835\uDCA9",O:"\uD835\uDCAA",P:"\uD835\uDCAB",Q:"\uD835\uDCAC",R:"\u211B",S:"\uD835\uDCAE",T:"\uD835\uDCAF",U:"\uD835\uDCB0",V:"\uD835\uDCB1",W:"\uD835\uDCB2",X:"\uD835\uDCB3",Y:"\uD835\uDCB4",Z:"\uD835\uDCB5"},FRAK={A:"\uD835\uDD04",B:"\uD835\uDD05",C:"\u212D",D:"\uD835\uDD07",E:"\uD835\uDD08",F:"\uD835\uDD09",G:"\uD835\uDD0A",H:"\u210C",I:"\u2111",J:"\uD835\uDD0D",K:"\uD835\uDD0E",L:"\uD835\uDD0F",M:"\uD835\uDD10",N:"\uD835\uDD11",O:"\uD835\uDD12",P:"\uD835\uDD13",Q:"\uD835\uDD14",R:"\u211C",S:"\uD835\uDD16",T:"\uD835\uDD17",U:"\uD835\uDD18",V:"\uD835\uDD19",W:"\uD835\uDD1A",X:"\uD835\uDD1B",Y:"\uD835\uDD1C",Z:"\u2128"},SUPERSCRIPT={"0":"\u2070","1":"\xB9","2":"\xB2","3":"\xB3","4":"\u2074","5":"\u2075","6":"\u2076","7":"\u2077","8":"\u2078","9":"\u2079","+":"\u207A","-":"\u207B","=":"\u207C","(":"\u207D",")":"\u207E",a:"\u1D43",b:"\u1D47",c:"\u1D9C",d:"\u1D48",e:"\u1D49",f:"\u1DA0",g:"\u1D4D",h:"\u02B0",i:"\u2071",j:"\u02B2",k:"\u1D4F",l:"\u02E1",m:"\u1D50",n:"\u207F",o:"\u1D52",p:"\u1D56",r:"\u02B3",s:"\u02E2",t:"\u1D57",u:"\u1D58",v:"\u1D5B",w:"\u02B7",x:"\u02E3",y:"\u02B8",z:"\u1DBB"},SUBSCRIPT={"0":"\u2080","1":"\u2081","2":"\u2082","3":"\u2083","4":"\u2084","5":"\u2085","6":"\u2086","7":"\u2087","8":"\u2088","9":"\u2089","+":"\u208A","-":"\u208B","=":"\u208C","(":"\u208D",")":"\u208E",a:"\u2090",e:"\u2091",h:"\u2095",i:"\u1D62",j:"\u2C7C",k:"\u2096",l:"\u2097",m:"\u2098",n:"\u2099",o:"\u2092",p:"\u209A",r:"\u1D63",s:"\u209B",t:"\u209C",u:"\u1D64",v:"\u1D65",x:"\u2093"};var escapeRe=(s)=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),splitByEnding=(keys)=>{let letter=[],punct=[];for(let k2 of keys)if(/[A-Za-z]$/.test(k2))letter.push(k2);else punct.push(k2);return{letter,punct}},buildAlt=(cmds)=>cmds.sort((a,b2)=>b2.length-a.length).map(escapeRe).join("|"),{letter:LETTER_CMDS,punct:PUNCT_CMDS}=splitByEnding(Object.keys(SYMBOLS)),SYMBOL_LETTER_RE=new RegExp("(?:"+buildAlt(LETTER_CMDS)+")(?![A-Za-z])","g"),SYMBOL_PUNCT_RE=new RegExp("(?:"+buildAlt(PUNCT_CMDS)+")","g"),convertScript=(input,table,sigil)=>{let out="",allMapped=!0;for(let ch of input){let mapped=table[ch];if(!mapped){allMapped=!1;break}out+=mapped}if(allMapped)return out;let trimmed=input.trim();if([...trimmed].length===1)return`${sigil}${trimmed}`;return`${sigil}(${trimmed})`},readBraced=(s,start2)=>{if(s[start2]!=="{")return null;let depth=1,i=start2+1;while(i<s.length&&depth>0){let c=s[i];if(c==="\\"&&i+1<s.length){i+=2;continue}if(c==="{")depth++;else if(c==="}")depth--;if(depth>0)i++}if(depth!==0)return null;return{content:s.slice(start2+1,i),end:i+1}},replaceBracedCommand=(input,command,render)=>{let cmdLen=command.length,out="",i=0;while(i<input.length){let idx2=input.indexOf(command,i);if(idx2<0)return out+=input.slice(i),out;let after=input[idx2+cmdLen];if(after&&/[A-Za-z]/.test(after)){out+=input.slice(i,idx2+cmdLen),i=idx2+cmdLen;continue}out+=input.slice(i,idx2);let p=idx2+cmdLen;while(input[p]===" "||input[p]==="\t")p++;let arg=readBraced(input,p);if(!arg){out+=input.slice(idx2,p+1),i=p+1;continue}out+=render(replaceBracedCommand(arg.content,command,render)),i=arg.end}return out},replaceFracs=(input)=>{let out="",i=0;while(i<input.length){let idx2=input.indexOf("\\frac",i);if(idx2<0)return out+=input.slice(i),out;let after=input[idx2+5];if(after&&/[A-Za-z]/.test(after)){out+=input.slice(i,idx2+5),i=idx2+5;continue}out+=input.slice(i,idx2);let p=idx2+5;while(input[p]===" "||input[p]==="\t")p++;let num2=readBraced(input,p);if(!num2){out+=input.slice(idx2,p+1),i=p+1;continue}p=num2.end;while(input[p]===" "||input[p]==="\t")p++;let den=readBraced(input,p);if(!den){out+=input.slice(idx2,p+1),i=p+1;continue}out+=`${wrapForFrac(replaceFracs(num2.content))}/${wrapForFrac(replaceFracs(den.content))}`,i=den.end}return out},wrapForFrac=(expr)=>{let trimmed=expr.trim();if(!trimmed)return trimmed;if(/^\(.*\)$/.test(trimmed))return trimmed;if(/[+\-/*]|\s/.test(trimmed))return`(${trimmed})`;return trimmed};function texToUnicode(input){let s=input;return s=s.replace(/\\mathbb\s*\{([A-Za-z])\}/g,(raw,c)=>BB[c]??raw),s=s.replace(/\\mathcal\s*\{([A-Za-z])\}/g,(raw,c)=>CAL[c]??raw),s=s.replace(/\\mathfrak\s*\{([A-Za-z])\}/g,(raw,c)=>FRAK[c]??raw),s=s.replace(/\\mathbf\s*\{([^{}]+)\}/g,(_2,c)=>c),s=s.replace(/\\mathit\s*\{([^{}]+)\}/g,(_2,c)=>c),s=s.replace(/\\mathrm\s*\{([^{}]+)\}/g,(_2,c)=>c),s=s.replace(/\\text\s*\{([^{}]+)\}/g,(_2,c)=>c),s=s.replace(/\\operatorname\s*\{([^{}]+)\}/g,(_2,c)=>c),s=s.replace(/\\overline\s*\{([^{}]+)\}/g,(_2,c)=>`${c}\u0305`),s=s.replace(/\\hat\s*\{([^{}]+)\}/g,(_2,c)=>`${c}\u0302`),s=s.replace(/\\bar\s*\{([^{}]+)\}/g,(_2,c)=>`${c}\u0304`),s=s.replace(/\\tilde\s*\{([^{}]+)\}/g,(_2,c)=>`${c}\u0303`),s=s.replace(/\\vec\s*\{([^{}]+)\}/g,(_2,c)=>`${c}\u20D7`),s=s.replace(/\\dot\s*\{([^{}]+)\}/g,(_2,c)=>`${c}\u0307`),s=s.replace(/\\ddot\s*\{([^{}]+)\}/g,(_2,c)=>`${c}\u0308`),s=replaceFracs(s),s=replaceBracedCommand(s,"\\boxed",(body)=>`**${body.trim()}**`),s=replaceBracedCommand(s,"\\fbox",(body)=>`**${body.trim()}**`),s=s.replace(/\\xrightarrow\s*\{([^{}]*)\}/g,(_2,label)=>`\u2500${label.trim()}\u2192`),s=s.replace(/\\xleftarrow\s*\{([^{}]*)\}/g,(_2,label)=>`\u2190${label.trim()}\u2500`),s=s.replace(/\\Longrightarrow/g,"\u27F9"),s=s.replace(/\\Longleftarrow/g,"\u27F8"),s=s.replace(/\\Longleftrightarrow/g,"\u27FA"),s=s.replace(/\s*\\pmod\s*\{([^{}]*)\}/g,(_2,p)=>` (mod ${p.trim()})`),s=s.replace(/\s*\\pod\s*\{([^{}]*)\}/g,(_2,p)=>` (${p.trim()})`),s=s.replace(/\s*\\tag\s*\{([^{}]*)\}/g,(_2,n)=>` (${n.trim()})`),s=s.replace(/\\(?:Bigg|bigg|Big|big)[lrm]?(?![A-Za-z])/g,""),s=s.replace(/\\(?:scriptscriptstyle|displaystyle|scriptstyle|textstyle|nolimits|limits)(?![A-Za-z])\s*/g,""),s=s.replace(/\\left(?![A-Za-z])\.?/g,""),s=s.replace(/\\right(?![A-Za-z])\.?/g,""),s=s.replace(SYMBOL_PUNCT_RE,(m2)=>SYMBOLS[m2]??m2),s=s.replace(SYMBOL_LETTER_RE,(m2)=>SYMBOLS[m2]??m2),s=s.replace(/\^\s*\{([^{}]+)\}/g,(_2,body)=>convertScript(body,SUPERSCRIPT,"^")),s=s.replace(/\^([A-Za-z0-9+\-=])/g,(raw,ch)=>SUPERSCRIPT[ch]??raw),s=s.replace(/_\s*\{([^{}]+)\}/g,(_2,body)=>convertScript(body,SUBSCRIPT,"_")),s=s.replace(/_([A-Za-z0-9+\-=])/g,(raw,ch)=>SUBSCRIPT[ch]??raw),s}var CODE_SPAN_RE=/(`{1,2})[^`\n]+?\1/g,MATH_SPAN_RE=new RegExp([String.raw`\$\$([^$]+?)\$\$`,String.raw`\\\[([\s\S]+?)\\\]`,String.raw`\\\(([^\n]+?)\\\)`,String.raw`(?<!\$)\$([^\s$](?:[^$\n]*?[^\s$])?)\$(?!\$)`].join("|"),"g");function mathify(md){if(!/[$\\]/.test(md))return md;let out="",i=0;CODE_SPAN_RE.lastIndex=0;for(let m2 of md.matchAll(CODE_SPAN_RE))out+=md.slice(i,m2.index).replace(MATH_SPAN_RE,(_2,a,b2,c,d2)=>texToUnicode(a??b2??c??d2)),out+=m2[0],i=m2.index+m2[0].length;return out+=md.slice(i).replace(MATH_SPAN_RE,(_2,a,b2,c,d2)=>texToUnicode(a??b2??c??d2)),out}function duration(ms2){if(ms2<1000)return`${ms2}ms`;let s=ms2/1000;if(s<60)return`${s.toFixed(1)}s`;return`${Math.floor(s/60)}m${Math.floor(s%60)}s`}function tokens2(n){if(n<1000)return String(n);if(n<1e6)return`${(n/1000).toFixed(1)}k`;return`${(n/1e6).toFixed(2)}M`}function extract(msg){return msg.parts.filter((p)=>p.type==="text").map((p)=>p.content).join("")}var trunc2=(s,max)=>s.length<=max?s:s.slice(0,max-1)+"\u2026",InlineDiff=import_react39.memo(({tool})=>{let theme=useTheme().theme,[open2,setOpen]=import_react39.useState(!1),diff=tool.diff??(isDiff(tool.result)?tool.result:void 0);if(!diff)return null;let lines2=diff.split(`
|
|
4087
|
-
`),add=lines2.filter((l)=>/^\+(?!\+\+)/.test(l)).length,del=lines2.filter((l)=>/^-(?!--)/.test(l)).length;return $jsxs("box",{flexDirection:"column",marginTop:1,onMouseDown:(e)=>{e.stopPropagation(),setOpen((o)=>!o)},children:[$jsx("box",{height:1,children:$jsxs("text",{children:[$jsx("span",{fg:theme.textMuted,children:open2?"\u25BE ":"\u25B8 "}),$jsx("span",{fg:theme.text,children:trunc2(tool.preview??tool.name,50)}),$jsx("span",{fg:theme.textMuted,children:" "}),$jsxs("span",{fg:theme.success,children:["+",add]}),$jsx("span",{fg:theme.textMuted,children:" / "}),$jsxs("span",{fg:theme.error,children:["-",del]})]})}),open2?$jsx("box",{marginTop:1,children:$jsx(DiffBlock,{text:diff})}):null]})});function useClick(fn){let at=import_react39.useRef(null);return{onMouseDown:(e)=>{at.current={x:e.x,y:e.y}},onMouseUp:(e)=>{let a=at.current;if(at.current=null,fn&&a&&a.x===e.x&&a.y===e.y)fn()}}}var Gutter2=import_react39.memo(({color,glyph="\u2502",side="left",children})=>{let bar=$jsx("box",{width:2,flexShrink:0,border:[side],borderColor:color,customBorderChars:{topLeft:glyph,bottomLeft:glyph,vertical:glyph,topRight:glyph,bottomRight:glyph,horizontal:"",topT:"",bottomT:"",leftT:"",rightT:"",cross:""}});return $jsxs("box",{flexDirection:"row",children:[side==="left"?bar:null,$jsx("box",{flexDirection:"column",flexGrow:1,flexShrink:1,children}),side==="right"?bar:null]})}),MessageItem=import_react39.memo(({message,streaming,prompt,onRewind,onPick})=>{if(message.role==="system")return $jsx(SystemMessage,{message});if(message.role==="user")return $jsx(UserMessage,{message,onRewind});return $jsx(AssistantMessage,{message,streaming,prompt,onPick})}),SystemMessage=import_react39.memo(({message})=>{let theme=useTheme().theme;return $jsx("box",{marginBottom:1,children:$jsx(Gutter2,{color:theme.textMuted,glyph:"\xB7",children:$jsx("box",{minHeight:1,children:$jsx("text",{fg:theme.textMuted,wrapMode:"word",children:extract(message)})})})})}),UserMessage=import_react39.memo(({message,onRewind})=>{let theme=useTheme().theme,[hover,setHover]=import_react39.useState(!1),click=useClick(onRewind&&(()=>onRewind(message))),segs=import_react39.useMemo(()=>message.parts.map((p)=>p.type==="text"&&p.content?splitContent(p.content):null),[message.parts]);return $jsx("box",{flexDirection:"column",marginBottom:1,backgroundColor:hover?theme.backgroundElement:void 0,onMouseOver:()=>setHover(!0),onMouseOut:()=>setHover(!1),...click,children:$jsx(Gutter2,{color:theme.primary,side:"left",children:$jsx("box",{minHeight:1,flexDirection:"column",children:message.parts.map((p,i)=>{let seg=segs[i];if(!seg)return null;let k2=p.key??i;return seg.map((s,j2)=>{if("media"in s)return classify(s.media)==="img"?$jsx("box",{children:$jsx(ChafaImage,{path:s.media})},`${k2}-m${j2}`):$jsx("box",{marginTop:1,children:$jsx(MediaChip,{path:s.media})},`${k2}-m${j2}`);if("code"in s)return $jsx(CodeBlock,{code:s.code,lang:s.lang},`${k2}-c${j2}`);return $jsx("text",{fg:theme.text,wrapMode:"word",children:s.md},`${k2}-${j2}`)})})})})})}),AssistantMessage=import_react39.memo(({message,streaming,prompt,onPick})=>{let ctx=useTheme(),theme=ctx.theme,{agentName}=useSkin(),[hover,setHover]=import_react39.useState(!1),click=useClick(onPick&&(()=>onPick(message))),err=!!message.error,trail2=message.parts.filter((p)=>p.type==="tool"||p.type==="prompt"),diffs=trail2.filter((p)=>p.type==="tool"&&(!!p.diff||isDiff(p.result))),segs=import_react39.useMemo(()=>message.parts.map((p)=>p.type==="text"&&p.content?splitContent(p.content):null),[message.parts]),header=[agentName,message.usage?`${tokens2(message.usage.input)}\u2192${tokens2(message.usage.output)} tok`:null,message.duration?duration(message.duration):null].filter(Boolean).join(" \xB7 "),part=(p,i)=>{if(p.type==="prompt")return $jsx("box",{marginTop:1,onMouseDown:(e)=>e.stopPropagation(),children:$jsx(PromptCard,{part:p,ref:!p.answered?prompt?.ref:void 0,onAnswer:prompt?.onAnswer??(()=>{})})},`pr-${p.id}`);let seg=segs[i];if(!seg)return null;let k2=p.key??i,last=streaming&&p.streaming;return seg.map((s,j2)=>{let tail=last&&j2===seg.length-1;if("media"in s)return classify(s.media)==="img"?$jsx("box",{children:$jsx(ChafaImage,{path:s.media})},`${k2}-m${j2}`):$jsx("box",{marginTop:1,children:$jsx(MediaChip,{path:s.media})},`${k2}-m${j2}`);if("code"in s)return $jsx(CodeBlock,{code:s.code,lang:s.lang,streaming:tail},`${k2}-c${j2}`);return $jsx("box",{children:$jsx("markdown",{content:mathify(s.md),fg:theme.markdownText,syntaxStyle:ctx.syntaxStyle,streaming:tail})},`${k2}-${j2}`)})};return $jsx("box",{flexDirection:"column",marginBottom:1,backgroundColor:hover?theme.backgroundElement:void 0,onMouseOver:()=>setHover(!0),onMouseOut:()=>setHover(!1),...click,children:$jsxs(Gutter2,{color:err?theme.error:theme.accent,side:"right",children:[$jsxs("box",{height:1,flexDirection:"row",children:[$jsx("box",{flexGrow:1,children:$jsx("text",{fg:theme.textMuted,children:header})}),trail2.length?$jsx("box",{children:$jsx("text",{fg:theme.textMuted,children:trunc2(trail2.map((p)=>p.type==="tool"?p.name:"?").join(" \xB7 "),40)})}):null]}),message.parts.map(part),diffs.map((t2)=>$jsx(InlineDiff,{tool:t2},t2.id||t2.name)),err?$jsx(ErrorBlock,{text:message.error}):null]})})});var import_react40=__toESM(require_react_production(),1);var VERBS=["Thinking\u2026","Considering\u2026","Working\u2026","Pondering\u2026"],TypingIndicator=import_react40.memo((props)=>{let theme=useTheme().theme,[i,setI]=import_react40.useState(0);return import_react40.useEffect(()=>{if(props.label)return;let id=setInterval(()=>setI((n)=>(n+1)%VERBS.length),2200);return()=>clearInterval(id)},[props.label]),$jsx("box",{height:1,paddingLeft:1,children:$jsx(Spinner,{color:theme.info,label:props.label??VERBS[i]})})});var MessageList=import_react41.memo(({messages,streaming,prompt,onRewind,onPick})=>{let theme=useTheme().theme,style=import_react41.useMemo(()=>({viewportOptions:{backgroundColor:theme.background},scrollbarOptions:{trackOptions:{foregroundColor:theme.borderSubtle,backgroundColor:theme.background}}}),[theme]);if(messages.length===0)return $jsx("box",{flexGrow:1});let last=messages[messages.length-1],lastStreaming=streaming&&last?.role==="assistant",firstUser=messages.findIndex((m2)=>m2.role==="user");return $jsx("scrollbox",{flexGrow:1,scrollY:!0,stickyScroll:!0,stickyStart:"bottom",style,children:$jsxs("box",{flexDirection:"column",paddingBottom:1,children:[messages.map((msg,i)=>$jsxs("box",{flexDirection:"column",children:[msg.role==="user"&&i>firstUser?$jsx("box",{height:1,children:$jsx("text",{fg:theme.borderSubtle,children:"\u2500\u2500\u2500"})}):null,$jsx(MessageItem,{message:msg,streaming:lastStreaming&&i===messages.length-1,prompt,onRewind,onPick})]},msg.id)),streaming&&last?.role!=="assistant"&&$jsx(TypingIndicator,{})]})})});var Chat=import_react42.memo(({messages,streaming,prompt,cloud,cloudH,pick,onResize,onPick,onClose,onRewind})=>{let theme=useTheme().theme;return $jsxs("box",{flexGrow:1,flexDirection:"column",position:"relative",backgroundColor:theme.background,children:[$jsx(MessageList,{messages,streaming,prompt,onRewind,onPick}),cloud?$jsx("box",{position:"absolute",top:0,left:0,right:0,zIndex:1,children:$jsx(ThoughtCloud,{height:cloudH,messages,pick,onResize,onClose})}):null]})});var import_react60=__toESM(require_react_production(),1);var import_react52=__toESM(require_react_production(),1);init_sessions_db();import{existsSync as existsSync8}from"fs";import{homedir as homedir4}from"os";import{join as join7}from"path";var INLINE=process.env.HERM_IO_INLINE==="1",HOME2=()=>process.env.HERMES_HOME||join7(homedir4(),".hermes"),entry=()=>{let js=join7(import.meta.dirname,"db.worker.js");return new URL(existsSync8(js)?"./db.worker.js":"./db.worker.ts",import.meta.url)},state={w:null,seq:0,pending:new Map,inline:null},spawn=()=>{if(state.w)return state.w;let w2=new Worker(entry());return w2.onmessage=(e)=>{let r=e.data;state.pending.get(r.id)?.(r),state.pending.delete(r.id)},w2.onerror=(ev)=>{let err=`io worker: ${ev.message}`;for(let res of state.pending.values())res({id:-1,ok:!1,err});state.pending.clear()},state.w=w2},call=(fn,args)=>{if(INLINE)return state.inline??=Promise.resolve().then(() => (init_fns(),exports_fns)).then((m2)=>m2.FNS),state.inline.then((f)=>f[fn](...args));return new Promise((resolve4,reject)=>{let id=++state.seq;state.pending.set(id,(r)=>r.ok?resolve4(r.v):reject(Error(r.err))),spawn().postMessage({id,home:HOME2(),fn,args})})},io=new Proxy({},{get:(_2,fn)=>(...args)=>call(fn,args)}),warm=()=>{if(!INLINE)call("roots",[0])};var import_react43=__toESM(require_react_production(),1);var Ctx5=import_react43.createContext(null),BACKDROP=RGBA.fromInts(0,0,0,150),DialogProvider=({children:children2})=>{let[stack,setStack]=import_react43.useState([]),gate=import_react43.useRef(!1),replace=import_react43.useCallback((element,onClose,opts)=>{gate.current=!0,setStack([{element,onClose,ownCancel:opts?.ownCancel}])},[]),clear=import_react43.useCallback(()=>{gate.current=!1,setStack((prev)=>{let top2=prev[prev.length-1];if(top2?.onClose)top2.onClose();return[]})},[]),open2=import_react43.useCallback(()=>gate.current,[]),keys=useKeys();useKeyboard((key2)=>{if(stack.length===0)return;if(stack[stack.length-1]?.ownCancel)return;if(keys.match("dialog.cancel",key2))clear()});let value=import_react43.useMemo(()=>({replace,clear,stack,open:open2}),[replace,clear,stack,open2]),top=stack.length>0?stack[stack.length-1]:void 0;return $jsxs(Ctx5.Provider,{value,children:[children2,top?$jsx(Overlay,{entry:top,onClose:clear}):null]})},Overlay=({entry:entry2,onClose})=>{let dims=useTerminalDimensions(),theme=useTheme().theme;return $jsx("box",{position:"absolute",left:0,top:0,width:dims.width,height:dims.height,zIndex:100,backgroundColor:BACKDROP,justifyContent:"center",alignItems:"center",onMouseDown:onClose,children:$jsx("box",{backgroundColor:theme.backgroundPanel,borderStyle:"single",border:!0,borderColor:theme.border,padding:1,flexDirection:"column",onMouseDown:(e)=>{e.stopPropagation()},children:entry2.element})})},useDialog=()=>{let ctx=import_react43.useContext(Ctx5);if(!ctx)throw Error("useDialog() must be inside <DialogProvider>");return ctx};var TabShell=(props)=>{let theme=useTheme().theme;return $jsxs("box",{flexDirection:"column",flexGrow:props.grow??1,flexBasis:0,minWidth:0,border:!0,borderColor:props.focus?theme.primary:theme.border,backgroundColor:theme.backgroundPanel,padding:1,children:[$jsx("box",{height:1,overflow:"hidden",children:$jsx("text",{fg:theme.primary,wrapMode:"none",children:$jsx("strong",{children:props.title})})}),props.error?$jsx("box",{height:1,children:$jsx("text",{fg:theme.error,children:`\u26A0 ${props.error}`})}):null,$jsx("box",{height:1}),$jsx("box",{flexDirection:"column",flexGrow:1,minWidth:0,children:props.children})]})};var import_react45=__toESM(require_react_production(),1);var HintBar=import_react45.memo((props)=>{let theme=useTheme().theme,text2=props.pairs?props.pairs.map((p)=>`[${p[0]}] ${p[1]}`).join(" ")+(props.suffix?` \xB7 ${props.suffix}`:""):props.raw??"";return $jsx("box",{height:1,flexShrink:0,paddingX:1,overflow:"hidden",children:$jsx("text",{fg:theme.textMuted,wrapMode:"none",children:text2})})});var KV=(props)=>{let theme=useTheme().theme;return $jsxs("box",{minHeight:1,flexDirection:"row",children:[$jsx("box",{width:13,flexShrink:0,children:$jsx("text",{fg:theme.textMuted,children:props.label})}),$jsx("box",{flexGrow:1,minWidth:0,height:props.wrap?void 0:1,overflow:props.wrap?void 0:"hidden",children:$jsx("text",{wrapMode:props.wrap?"word":void 0,fg:props.fg??theme.text,children:props.value})})]})},KVBlock=(props)=>props.rows.map(([k2,v2,fg2])=>v2===void 0?null:$jsx(KV,{label:k2,value:v2,fg:fg2},k2));var import_react46=__toESM(require_react_production(),1);var VBAR_W=1,VBAR={visible:!0},Col=(p)=>{let theme=useTheme().theme,fg2=p.fg??theme.text;return $jsx("box",{width:p.w,flexGrow:p.grow?1:0,flexShrink:p.grow?1:0,minWidth:p.grow?p.min??12:p.w,height:1,overflow:"hidden",flexDirection:"row",justifyContent:p.right?"flex-end":"flex-start",children:$jsx("text",{children:p.bold?$jsx("span",{fg:fg2,children:$jsx("strong",{children:p.children})}):$jsx("span",{fg:fg2,children:p.children})})})},Hdr=(p)=>$jsx("box",{flexDirection:"row",height:1,paddingRight:VBAR_W,children:p.children}),Marquee=(p)=>{let theme=useTheme().theme,fg2=p.fg??theme.text,text2=p.children,box=import_react46.useRef(null),node=import_react46.useRef(null),animate=get("animations")!==!1&&p.active,[wraps,setWraps]=import_react46.useState(!1);import_react46.useEffect(()=>{let tn=node.current;if(!tn)return;let w2=box.current?.width??0;if(setWraps(text2.length>w2),!animate){tn.scrollX=0;return}let id,period=text2.length+GAP.length,hold=setTimeout(()=>{id=setInterval(()=>{let cur=box.current?.width??0;if(text2.length<=cur){tn.scrollX=0;return}tn.scrollX=(tn.scrollX+1)%period},p.speed??180)},p.hold??600);return()=>{if(clearTimeout(hold),id)clearInterval(id);if(node.current)node.current.scrollX=0}},[animate,text2,p.speed,p.hold]);let body=wraps?text2+GAP+text2:text2;return $jsx("box",{ref:box,width:p.w,flexGrow:p.grow?1:0,flexShrink:p.grow?1:0,minWidth:p.grow?p.min??12:p.w,height:1,overflow:"hidden",children:$jsx("text",{ref:node,wrapMode:"none",children:p.bold?$jsx("span",{fg:fg2,children:$jsx("strong",{children:body})}):$jsx("span",{fg:fg2,children:body})})})},GAP=" ";var import_react47=__toESM(require_react_production(),1);var Ticker=(p)=>{let ref=import_react47.useRef(null),animate=get("animations")!==!1&&p.active,speed=p.speed??180,hold=p.hold??600,endHold=p.endHold??3000;return import_react47.useEffect(()=>{let node=ref.current;if(!node)return;if(!animate){node.scrollX=0;return}let dir=1,tick2,wait,step=()=>{let max=node.maxScrollX;if(max<=0)return;if(node.scrollX=Math.max(0,Math.min(max,node.scrollX+dir)),!(dir>0?node.scrollX>=max:node.scrollX<=0))return;if(tick2)clearInterval(tick2),tick2=void 0;dir=-dir,wait=setTimeout(()=>{tick2=setInterval(step,speed)},endHold)};return wait=setTimeout(()=>{tick2=setInterval(step,speed)},hold),()=>{if(wait)clearTimeout(wait);if(tick2)clearInterval(tick2);if(ref.current)ref.current.scrollX=0}},[animate,speed,hold,endHold]),$jsx("box",{flexGrow:1,flexShrink:1,minWidth:0,height:1,overflow:"hidden",children:$jsx("text",{ref,wrapMode:"none",fg:p.fg,children:p.children})})},RX=/(`[^`]+`)|(\*\*[^*]+\*\*)|(__[^_]+__)|((?<![\w*])\*[^*\s][^*]*\*(?![\w*]))|((?<!\w)_[^_\s][^_]*_(?!\w))/g,inline=(s)=>{let out=[],last=0;for(let m2 of s.matchAll(RX)){let at=m2.index??0;if(at>last)out.push({t:s.slice(last,at)});let hit=m2[0];if(hit.startsWith("`"))out.push({t:hit.slice(1,-1),c:!0});else if(hit.startsWith("**")||hit.startsWith("__"))out.push({t:hit.slice(2,-2),b:!0});else out.push({t:hit.slice(1,-1),i:!0});last=at+hit.length}if(last<s.length)out.push({t:s.slice(last)});return out.map((seg)=>seg.c?seg:{...seg,t:seg.t.replace(/^#{1,6}\s+/,"")})};var Confirm=(props)=>{let theme=useTheme().theme,keys=useKeys();return useKeyboard((key2)=>{if(keys.match("dialog.confirm",key2)||keys.match("dialog.accept",key2))return props.onConfirm();if(keys.match("dialog.deny",key2)||keys.match("dialog.cancel",key2))return props.onCancel()}),$jsxs("box",{flexDirection:"column",width:54,children:[$jsx("box",{height:1,children:$jsx("text",{fg:props.danger?theme.warning:theme.primary,children:$jsx("strong",{children:props.title})})}),$jsx("box",{height:1}),$jsx("box",{minHeight:1,children:$jsx("text",{wrapMode:"word",children:props.body})}),$jsx("box",{height:1}),$jsx("box",{height:1,children:$jsx("text",{fg:theme.textMuted,children:`[${keys.print("dialog.confirm")}/${keys.print("dialog.accept")}] ${props.yes??"confirm"} [${keys.print("dialog.deny")}] ${props.no??"cancel"}`})})]})};function openConfirm(dialog,opts){return new Promise((resolve4)=>{dialog.replace($jsx(Confirm,{...opts,onConfirm:()=>{dialog.clear(),resolve4(!0)},onCancel:()=>{dialog.clear(),resolve4(!1)}}))})}var import_react49=__toESM(require_react_production(),1);var TextPrompt=(props)=>{let theme=useTheme().theme,[value,setValue]=import_react49.useState(props.initial??"");return useKeyboard((key2)=>{if(key2.name==="escape")return props.onCancel()}),$jsxs("box",{flexDirection:"column",width:60,children:[$jsx("box",{height:1,children:$jsx("text",{fg:theme.primary,children:$jsx("strong",{children:props.title})})}),$jsx("box",{height:1}),props.label?$jsx("box",{height:1,children:$jsx("text",{fg:theme.textMuted,children:props.label})}):null,$jsxs("box",{height:1,flexDirection:"row",overflow:"hidden",children:[$jsx("box",{flexShrink:0,children:$jsx("text",{fg:theme.accent,children:"\u2503 "})}),$jsx("box",{flexGrow:1,minWidth:0,height:1,overflow:"hidden",children:$jsx("input",{value,onInput:setValue,onSubmit:()=>{let v2=value.trim();if(v2)props.onSubmit(v2)},focused:!0,textColor:theme.text,backgroundColor:theme.backgroundElement,focusedBackgroundColor:theme.backgroundElement})})]}),$jsx("box",{height:1}),$jsx("box",{height:1,children:$jsx("text",{fg:theme.textMuted,children:value.trim()?"Enter confirm \xB7 Esc cancel \xB7 Ctrl+U clear":"Esc cancel"})})]})};function openTextPrompt(dialog,opts){return new Promise((resolve4)=>{dialog.replace($jsx(TextPrompt,{title:opts.title,label:opts.label,initial:opts.initial,onSubmit:(v2)=>{dialog.clear(),resolve4(v2)},onCancel:()=>{dialog.clear(),resolve4(null)}}))})}var h12=()=>get("timeFormat")==="12h",abs=()=>get("timeStyle")==="absolute",trunc4=(s,max)=>s.length<=max?s:s.slice(0,max-1)+"\u2026",fmt=(n)=>n>=1e6?`${(n/1e6).toFixed(2)}M`:n>=1000?`${(n/1000).toFixed(1)}k`:String(n),cost=(c)=>c==null?"\u2014":`$${c.toFixed(2)}`,clock=(d2)=>d2.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:h12()}),stamp=(ts)=>{let d2=new Date(ts*1000);return d2.toDateString()===new Date().toDateString()?clock(d2):d2.toLocaleDateString(void 0,{month:"short",day:"numeric"})},rel=(ts)=>{let s=Math.floor(Date.now()/1000-ts);if(s<60)return"just now";if(s<3600)return`${Math.floor(s/60)}m ago`;if(s<86400)return`${Math.floor(s/3600)}h ago`;return`${Math.floor(s/86400)}d ago`},ago=(ts)=>abs()?stamp(ts):rel(ts),until=(ts)=>{if(abs())return ts<=Date.now()/1000?"due":stamp(ts);let s=Math.floor(ts-Date.now()/1000);if(s<=0)return"due";if(s<60)return`in ${s}s`;if(s<3600)return`in ${Math.floor(s/60)}m`;if(s<86400)return`in ${Math.floor(s/3600)}h`;return`in ${Math.floor(s/86400)}d`},when=(ts)=>{let d2=new Date(ts*1000);return`${d2.toLocaleDateString()} ${clock(d2)}`},span=(start2,end)=>{let s=Math.round(end-start2);if(s<0)return"\u2014";if(s>=3600)return`${Math.floor(s/3600)}h ${Math.floor(s%3600/60)}m`;if(s>=60)return`${Math.floor(s/60)}m`;return`${s}s`},dur2=(s)=>s>=3600?`${Math.floor(s/3600)}h${Math.floor(s%3600/60)}m`:s>=60?`${Math.floor(s/60)}m${Math.floor(s%60)}s`:`${Math.floor(s)}s`;var import_react51=__toESM(require_react_production(),1);import{watch as watch2,existsSync as existsSync9,statSync as statSync2}from"fs";import{dirname as dirname4,basename as basename6}from"path";import{readdir as readdir2,stat}from"fs/promises";import{openSync as openSync2,readSync as readSync2,closeSync as closeSync2,readdirSync as readdirSync3,readFileSync as readFileSync2}from"fs";import{homedir as homedir5}from"os";var composer=require_composer(),Document=require_Document(),Schema=require_Schema(),errors=require_errors(),Alias=require_Alias(),identity=require_identity(),Pair=require_Pair(),Scalar=require_Scalar(),YAMLMap=require_YAMLMap(),YAMLSeq=require_YAMLSeq(),cst=require_cst(),lexer=require_lexer(),lineCounter=require_line_counter(),parser=require_parser(),publicApi=require_public_api(),visit=require_visit();var $Composer=composer.Composer,$Document=Document.Document,$Schema=Schema.Schema,$YAMLError=errors.YAMLError,$YAMLParseError=errors.YAMLParseError,$YAMLWarning=errors.YAMLWarning,$Alias=Alias.Alias,$isAlias=identity.isAlias,$isCollection=identity.isCollection,$isDocument=identity.isDocument,$isMap=identity.isMap,$isNode=identity.isNode,$isPair=identity.isPair,$isScalar=identity.isScalar,$isSeq=identity.isSeq,$Pair=Pair.Pair,$Scalar=Scalar.Scalar,$YAMLMap=YAMLMap.YAMLMap,$YAMLSeq=YAMLSeq.YAMLSeq;var $Lexer=lexer.Lexer,$LineCounter=lineCounter.LineCounter,$Parser=parser.Parser,$parse=publicApi.parse,$parseAllDocuments=publicApi.parseAllDocuments,$parseDocument=publicApi.parseDocument,$stringify=publicApi.stringify,$visit=visit.visit,$visitAsync=visit.visitAsync;init_sessions_db();var HOME3=process.env.HOME||homedir5(),home={path:process.env.HERMES_HOME||`${HOME3}/.hermes`},setHome2=(h2)=>{home.path=h2},hermesPath=(relative2)=>`${home.path}/${relative2}`,managedSystem=async()=>{let env2=(process.env.HERMES_MANAGED??"").trim();if(env2){let norm=env2.toLowerCase();if(norm==="1"||norm==="true"||norm==="yes"||norm==="on")return"NixOS";return{homebrew:"Homebrew",nix:"NixOS",nixos:"NixOS"}[norm]??env2}return await Bun.file(hermesPath(".managed")).exists()?"NixOS":null},makeSource=(relative2,label)=>({file:hermesPath(relative2),relative:relative2,label:label??relative2.split("/").pop()??relative2});function readSkillFrontmatter(source){try{let fd=openSync2(source.file,"r"),buf=Buffer.alloc(2048),n=readSync2(fd,buf,0,2048,0);closeSync2(fd);let head=buf.toString("utf-8",0,n);if(!head.startsWith("---"))return{description:"",tags:[]};let end=head.indexOf(`
|
|
4087
|
+
`),add=lines2.filter((l)=>/^\+(?!\+\+)/.test(l)).length,del=lines2.filter((l)=>/^-(?!--)/.test(l)).length;return $jsxs("box",{flexDirection:"column",marginTop:1,onMouseDown:(e)=>{e.stopPropagation(),setOpen((o)=>!o)},children:[$jsx("box",{height:1,children:$jsxs("text",{children:[$jsx("span",{fg:theme.textMuted,children:open2?"\u25BE ":"\u25B8 "}),$jsx("span",{fg:theme.text,children:trunc2(tool.preview??tool.name,50)}),$jsx("span",{fg:theme.textMuted,children:" "}),$jsxs("span",{fg:theme.success,children:["+",add]}),$jsx("span",{fg:theme.textMuted,children:" / "}),$jsxs("span",{fg:theme.error,children:["-",del]})]})}),open2?$jsx("box",{marginTop:1,children:$jsx(DiffBlock,{text:diff})}):null]})});function useClick(fn){let at=import_react39.useRef(null);return{onMouseDown:(e)=>{at.current={x:e.x,y:e.y}},onMouseUp:(e)=>{let a=at.current;if(at.current=null,fn&&a&&a.x===e.x&&a.y===e.y)fn()}}}var Gutter2=import_react39.memo(({color,glyph="\u2502",side="left",children})=>{let bar=$jsx("box",{width:2,flexShrink:0,border:[side],borderColor:color,customBorderChars:{topLeft:glyph,bottomLeft:glyph,vertical:glyph,topRight:glyph,bottomRight:glyph,horizontal:"",topT:"",bottomT:"",leftT:"",rightT:"",cross:""}});return $jsxs("box",{flexDirection:"row",children:[side==="left"?bar:null,$jsx("box",{flexDirection:"column",flexGrow:1,flexShrink:1,children}),side==="right"?bar:null]})}),MessageItem=import_react39.memo(({message,streaming,prompt,onRewind,onPick})=>{if(message.role==="system")return $jsx(SystemMessage,{message});if(message.role==="user")return $jsx(UserMessage,{message,onRewind});return $jsx(AssistantMessage,{message,streaming,prompt,onPick})}),SystemMessage=import_react39.memo(({message})=>{let theme=useTheme().theme;return $jsx("box",{marginBottom:1,children:$jsx(Gutter2,{color:theme.textMuted,glyph:"\xB7",children:$jsx("box",{minHeight:1,children:$jsx("text",{fg:theme.textMuted,wrapMode:"word",children:extract(message)})})})})}),UserMessage=import_react39.memo(({message,onRewind})=>{let theme=useTheme().theme,[hover,setHover]=import_react39.useState(!1),click=useClick(onRewind&&(()=>onRewind(message))),segs=import_react39.useMemo(()=>message.parts.map((p)=>p.type==="text"&&p.content?splitContent(p.content):null),[message.parts]);return $jsx("box",{flexDirection:"column",marginBottom:1,backgroundColor:hover?theme.backgroundElement:void 0,onMouseOver:()=>setHover(!0),onMouseOut:()=>setHover(!1),...click,children:$jsx(Gutter2,{color:theme.primary,side:"left",children:$jsx("box",{minHeight:1,flexDirection:"column",children:message.parts.map((p,i)=>{let seg=segs[i];if(!seg)return null;let k2=p.key??i;return seg.map((s,j2)=>{if("media"in s)return classify(s.media)==="img"?$jsx("box",{children:$jsx(ChafaImage,{path:s.media})},`${k2}-m${j2}`):$jsx("box",{marginTop:1,children:$jsx(MediaChip,{path:s.media})},`${k2}-m${j2}`);if("code"in s)return $jsx(CodeBlock,{code:s.code,lang:s.lang},`${k2}-c${j2}`);return $jsx("text",{fg:theme.text,wrapMode:"word",children:s.md},`${k2}-${j2}`)})})})})})}),AssistantMessage=import_react39.memo(({message,streaming,prompt,onPick})=>{let ctx=useTheme(),theme=ctx.theme,{agentName}=useSkin(),[hover,setHover]=import_react39.useState(!1),click=useClick(onPick&&(()=>onPick(message))),err=!!message.error,trail2=message.parts.filter((p)=>p.type==="tool"||p.type==="prompt"),diffs=trail2.filter((p)=>p.type==="tool"&&(!!p.diff||isDiff(p.result))),segs=import_react39.useMemo(()=>message.parts.map((p)=>p.type==="text"&&p.content?splitContent(p.content):null),[message.parts]),header=[agentName,message.usage?`${tokens2(message.usage.input)}\u2192${tokens2(message.usage.output)} tok`:null,message.duration?duration(message.duration):null].filter(Boolean).join(" \xB7 "),part=(p,i)=>{if(p.type==="prompt")return $jsx("box",{marginTop:1,onMouseDown:(e)=>e.stopPropagation(),children:$jsx(PromptCard,{part:p,ref:!p.answered?prompt?.ref:void 0,onAnswer:prompt?.onAnswer??(()=>{})})},`pr-${p.id}`);let seg=segs[i];if(!seg)return null;let k2=p.key??i,last=streaming&&p.streaming;return seg.map((s,j2)=>{let tail=last&&j2===seg.length-1;if("media"in s)return classify(s.media)==="img"?$jsx("box",{children:$jsx(ChafaImage,{path:s.media})},`${k2}-m${j2}`):$jsx("box",{marginTop:1,children:$jsx(MediaChip,{path:s.media})},`${k2}-m${j2}`);if("code"in s)return $jsx(CodeBlock,{code:s.code,lang:s.lang,streaming:tail},`${k2}-c${j2}`);return $jsx("box",{children:$jsx("markdown",{content:mathify(s.md),fg:theme.markdownText,syntaxStyle:ctx.syntaxStyle,streaming:tail})},`${k2}-${j2}`)})};return $jsx("box",{flexDirection:"column",marginBottom:1,backgroundColor:hover?theme.backgroundElement:void 0,onMouseOver:()=>setHover(!0),onMouseOut:()=>setHover(!1),...click,children:$jsxs(Gutter2,{color:err?theme.error:theme.accent,side:"right",children:[$jsxs("box",{height:1,flexDirection:"row",children:[$jsx("box",{flexGrow:1,children:$jsx("text",{fg:theme.textMuted,children:header})}),trail2.length?$jsx("box",{children:$jsx("text",{fg:theme.textMuted,children:trunc2(trail2.map((p)=>p.type==="tool"?p.name:"?").join(" \xB7 "),40)})}):null]}),message.parts.map(part),diffs.map((t2)=>$jsx(InlineDiff,{tool:t2},t2.id||t2.name)),err?$jsx(ErrorBlock,{text:message.error}):null]})})});var import_react40=__toESM(require_react_production(),1);var VERBS=["Thinking\u2026","Considering\u2026","Working\u2026","Pondering\u2026"],TypingIndicator=import_react40.memo((props)=>{let theme=useTheme().theme,[i,setI]=import_react40.useState(0);return import_react40.useEffect(()=>{if(props.label)return;let id=setInterval(()=>setI((n)=>(n+1)%VERBS.length),2200);return()=>clearInterval(id)},[props.label]),$jsx("box",{height:1,paddingLeft:1,children:$jsx(Spinner,{color:theme.info,label:props.label??VERBS[i]})})});var MessageList=import_react41.memo(({messages,streaming,prompt,onRewind,onPick})=>{let theme=useTheme().theme,style=import_react41.useMemo(()=>({viewportOptions:{backgroundColor:theme.background},scrollbarOptions:{trackOptions:{foregroundColor:theme.borderSubtle,backgroundColor:theme.background}}}),[theme]);if(messages.length===0)return $jsx("box",{flexGrow:1});let last=messages[messages.length-1],lastStreaming=streaming&&last?.role==="assistant",firstUser=messages.findIndex((m2)=>m2.role==="user");return $jsx("scrollbox",{flexGrow:1,scrollY:!0,stickyScroll:!0,stickyStart:"bottom",style,children:$jsxs("box",{flexDirection:"column",paddingBottom:1,children:[messages.map((msg,i)=>$jsxs("box",{flexDirection:"column",children:[msg.role==="user"&&i>firstUser?$jsx("box",{height:1,children:$jsx("text",{fg:theme.borderSubtle,children:"\u2500\u2500\u2500"})}):null,$jsx(MessageItem,{message:msg,streaming:lastStreaming&&i===messages.length-1,prompt,onRewind,onPick})]},msg.id)),streaming&&last?.role!=="assistant"&&$jsx(TypingIndicator,{})]})})});var Chat=import_react42.memo(({messages,streaming,prompt,cloud,cloudH,pick,onResize,onPick,onClose,onRewind})=>{let theme=useTheme().theme;return $jsxs("box",{flexGrow:1,flexDirection:"column",position:"relative",backgroundColor:theme.background,children:[$jsx(MessageList,{messages,streaming,prompt,onRewind,onPick}),cloud?$jsx("box",{position:"absolute",top:0,left:0,right:0,zIndex:1,children:$jsx(ThoughtCloud,{height:cloudH,messages,pick,onResize,onClose})}):null]})});var import_react60=__toESM(require_react_production(),1);var import_react52=__toESM(require_react_production(),1);init_sessions_db();import{existsSync as existsSync8}from"fs";import{homedir as homedir4}from"os";import{join as join7}from"path";var INLINE=process.env.HERM_IO_INLINE==="1",HOME2=()=>process.env.HERMES_HOME||join7(homedir4(),".hermes"),entry=()=>{let js=join7(import.meta.dirname,"db.worker.js");return new URL(existsSync8(js)?"./db.worker.js":"./db.worker.ts",import.meta.url)},state={w:null,seq:0,pending:new Map,inline:null},spawn=()=>{if(state.w)return state.w;let w2=new Worker(entry());return w2.onmessage=(e)=>{let r=e.data;state.pending.get(r.id)?.(r),state.pending.delete(r.id)},w2.onerror=(ev)=>{let err=`io worker: ${ev.message}`;for(let res of state.pending.values())res({id:-1,ok:!1,err});state.pending.clear()},state.w=w2},call=(fn,args)=>{if(INLINE)return state.inline??=Promise.resolve().then(() => (init_fns(),exports_fns)).then((m2)=>m2.FNS),state.inline.then((f)=>f[fn](...args));return new Promise((resolve4,reject)=>{let id=++state.seq;state.pending.set(id,(r)=>r.ok?resolve4(r.v):reject(Error(r.err))),spawn().postMessage({id,home:HOME2(),fn,args})})},io=new Proxy({},{get:(_2,fn)=>(...args)=>call(fn,args)}),warm=()=>{if(!INLINE)call("roots",[0])};var import_react43=__toESM(require_react_production(),1);var Ctx5=import_react43.createContext(null),BACKDROP=RGBA.fromInts(0,0,0,150),DialogProvider=({children:children2})=>{let[stack,setStack]=import_react43.useState([]),gate=import_react43.useRef(!1),replace=import_react43.useCallback((element,onClose,opts)=>{gate.current=!0,setStack([{element,onClose,ownCancel:opts?.ownCancel}])},[]),clear=import_react43.useCallback(()=>{gate.current=!1,setStack((prev)=>{let top2=prev[prev.length-1];if(top2?.onClose)top2.onClose();return[]})},[]),open2=import_react43.useCallback(()=>gate.current,[]),keys=useKeys();useKeyboard((key2)=>{if(stack.length===0)return;if(stack[stack.length-1]?.ownCancel)return;if(keys.match("dialog.cancel",key2))clear()});let value=import_react43.useMemo(()=>({replace,clear,stack,open:open2}),[replace,clear,stack,open2]),top=stack.length>0?stack[stack.length-1]:void 0;return $jsxs(Ctx5.Provider,{value,children:[children2,top?$jsx(Overlay,{entry:top,onClose:clear}):null]})},Overlay=({entry:entry2,onClose})=>{let dims=useTerminalDimensions(),theme=useTheme().theme;return $jsx("box",{position:"absolute",left:0,top:0,width:dims.width,height:dims.height,zIndex:100,backgroundColor:BACKDROP,justifyContent:"center",alignItems:"center",onMouseDown:onClose,children:$jsx("box",{backgroundColor:theme.backgroundPanel,borderStyle:"single",border:!0,borderColor:theme.border,padding:1,flexDirection:"column",onMouseDown:(e)=>{e.stopPropagation()},children:entry2.element})})},useDialog=()=>{let ctx=import_react43.useContext(Ctx5);if(!ctx)throw Error("useDialog() must be inside <DialogProvider>");return ctx};var TabShell=(props)=>{let theme=useTheme().theme;return $jsxs("box",{flexDirection:"column",flexGrow:props.grow??1,flexBasis:0,minWidth:0,border:!0,borderColor:props.focus?theme.primary:theme.border,backgroundColor:theme.backgroundPanel,padding:1,children:[$jsx("box",{height:1,overflow:"hidden",children:$jsx("text",{fg:theme.primary,wrapMode:"none",children:$jsx("strong",{children:props.title})})}),props.error?$jsx("box",{height:1,children:$jsx("text",{fg:theme.error,children:`\u26A0 ${props.error}`})}):null,$jsx("box",{height:1}),$jsx("box",{flexDirection:"column",flexGrow:1,minWidth:0,children:props.children})]})};var import_react45=__toESM(require_react_production(),1);var HintBar=import_react45.memo((props)=>{let theme=useTheme().theme,text2=props.pairs?props.pairs.map((p)=>`[${p[0]}] ${p[1]}`).join(" ")+(props.suffix?` \xB7 ${props.suffix}`:""):props.raw??"";return $jsx("box",{height:1,flexShrink:0,paddingX:1,overflow:"hidden",children:$jsx("text",{fg:theme.textMuted,wrapMode:"none",children:text2})})});var KV=(props)=>{let theme=useTheme().theme;return $jsxs("box",{minHeight:1,flexDirection:"row",children:[$jsx("box",{width:13,flexShrink:0,children:$jsx("text",{fg:theme.textMuted,children:props.label})}),$jsx("box",{flexGrow:1,minWidth:0,height:props.wrap?void 0:1,overflow:props.wrap?void 0:"hidden",children:$jsx("text",{wrapMode:props.wrap?"word":void 0,fg:props.fg??theme.text,children:props.value})})]})},KVBlock=(props)=>props.rows.map(([k2,v2,fg2])=>v2===void 0?null:$jsx(KV,{label:k2,value:v2,fg:fg2},k2));var import_react46=__toESM(require_react_production(),1);var VBAR_W=1,VBAR={visible:!0},Col=(p)=>{let theme=useTheme().theme,fg2=p.fg??theme.text;return $jsx("box",{width:p.w,flexGrow:p.grow?1:0,flexShrink:p.grow?1:0,minWidth:p.grow?p.min??12:p.w,height:1,overflow:"hidden",onMouseDown:p.onClick,flexDirection:"row",justifyContent:p.right?"flex-end":"flex-start",children:$jsx("text",{children:p.bold?$jsx("span",{fg:fg2,children:$jsx("strong",{children:p.children})}):$jsx("span",{fg:fg2,children:p.children})})})},Hdr=(p)=>$jsx("box",{flexDirection:"row",height:1,paddingRight:VBAR_W,children:p.children}),Marquee=(p)=>{let theme=useTheme().theme,fg2=p.fg??theme.text,text2=p.children,box=import_react46.useRef(null),node=import_react46.useRef(null),animate=get("animations")!==!1&&p.active,[wraps,setWraps]=import_react46.useState(!1);import_react46.useEffect(()=>{let tn=node.current;if(!tn)return;let w2=box.current?.width??0;if(setWraps(text2.length>w2),!animate){tn.scrollX=0;return}let id,period=text2.length+GAP.length,hold=setTimeout(()=>{id=setInterval(()=>{let cur=box.current?.width??0;if(text2.length<=cur){tn.scrollX=0;return}tn.scrollX=(tn.scrollX+1)%period},p.speed??180)},p.hold??600);return()=>{if(clearTimeout(hold),id)clearInterval(id);if(node.current)node.current.scrollX=0}},[animate,text2,p.speed,p.hold]);let body=wraps?text2+GAP+text2:text2;return $jsx("box",{ref:box,width:p.w,flexGrow:p.grow?1:0,flexShrink:p.grow?1:0,minWidth:p.grow?p.min??12:p.w,height:1,overflow:"hidden",children:$jsx("text",{ref:node,wrapMode:"none",children:p.bold?$jsx("span",{fg:fg2,children:$jsx("strong",{children:body})}):$jsx("span",{fg:fg2,children:body})})})},GAP=" ";var import_react47=__toESM(require_react_production(),1);var Ticker=(p)=>{let ref=import_react47.useRef(null),animate=get("animations")!==!1&&p.active,speed=p.speed??180,hold=p.hold??600,endHold=p.endHold??3000;return import_react47.useEffect(()=>{let node=ref.current;if(!node)return;if(!animate){node.scrollX=0;return}let dir=1,tick2,wait,step=()=>{let max=node.maxScrollX;if(max<=0)return;if(node.scrollX=Math.max(0,Math.min(max,node.scrollX+dir)),!(dir>0?node.scrollX>=max:node.scrollX<=0))return;if(tick2)clearInterval(tick2),tick2=void 0;dir=-dir,wait=setTimeout(()=>{tick2=setInterval(step,speed)},endHold)};return wait=setTimeout(()=>{tick2=setInterval(step,speed)},hold),()=>{if(wait)clearTimeout(wait);if(tick2)clearInterval(tick2);if(ref.current)ref.current.scrollX=0}},[animate,speed,hold,endHold]),$jsx("box",{flexGrow:1,flexShrink:1,minWidth:0,height:1,overflow:"hidden",children:$jsx("text",{ref,wrapMode:"none",fg:p.fg,children:p.children})})},RX=/(`[^`]+`)|(\*\*[^*]+\*\*)|(__[^_]+__)|((?<![\w*])\*[^*\s][^*]*\*(?![\w*]))|((?<!\w)_[^_\s][^_]*_(?!\w))/g,inline=(s)=>{let out=[],last=0;for(let m2 of s.matchAll(RX)){let at=m2.index??0;if(at>last)out.push({t:s.slice(last,at)});let hit=m2[0];if(hit.startsWith("`"))out.push({t:hit.slice(1,-1),c:!0});else if(hit.startsWith("**")||hit.startsWith("__"))out.push({t:hit.slice(2,-2),b:!0});else out.push({t:hit.slice(1,-1),i:!0});last=at+hit.length}if(last<s.length)out.push({t:s.slice(last)});return out.map((seg)=>seg.c?seg:{...seg,t:seg.t.replace(/^#{1,6}\s+/,"")})};var Confirm=(props)=>{let theme=useTheme().theme,keys=useKeys();return useKeyboard((key2)=>{if(keys.match("dialog.confirm",key2)||keys.match("dialog.accept",key2))return props.onConfirm();if(keys.match("dialog.deny",key2)||keys.match("dialog.cancel",key2))return props.onCancel()}),$jsxs("box",{flexDirection:"column",width:54,children:[$jsx("box",{height:1,children:$jsx("text",{fg:props.danger?theme.warning:theme.primary,children:$jsx("strong",{children:props.title})})}),$jsx("box",{height:1}),$jsx("box",{minHeight:1,children:$jsx("text",{wrapMode:"word",children:props.body})}),$jsx("box",{height:1}),$jsx("box",{height:1,children:$jsx("text",{fg:theme.textMuted,children:`[${keys.print("dialog.confirm")}/${keys.print("dialog.accept")}] ${props.yes??"confirm"} [${keys.print("dialog.deny")}] ${props.no??"cancel"}`})})]})};function openConfirm(dialog,opts){return new Promise((resolve4)=>{dialog.replace($jsx(Confirm,{...opts,onConfirm:()=>{dialog.clear(),resolve4(!0)},onCancel:()=>{dialog.clear(),resolve4(!1)}}))})}var import_react49=__toESM(require_react_production(),1);var TextPrompt=(props)=>{let theme=useTheme().theme,[value,setValue]=import_react49.useState(props.initial??"");return useKeyboard((key2)=>{if(key2.name==="escape")return props.onCancel()}),$jsxs("box",{flexDirection:"column",width:60,children:[$jsx("box",{height:1,children:$jsx("text",{fg:theme.primary,children:$jsx("strong",{children:props.title})})}),$jsx("box",{height:1}),props.label?$jsx("box",{height:1,children:$jsx("text",{fg:theme.textMuted,children:props.label})}):null,$jsxs("box",{height:1,flexDirection:"row",overflow:"hidden",children:[$jsx("box",{flexShrink:0,children:$jsx("text",{fg:theme.accent,children:"\u2503 "})}),$jsx("box",{flexGrow:1,minWidth:0,height:1,overflow:"hidden",children:$jsx("input",{value,onInput:setValue,onSubmit:()=>{let v2=value.trim();if(v2)props.onSubmit(v2)},focused:!0,textColor:theme.text,backgroundColor:theme.backgroundElement,focusedBackgroundColor:theme.backgroundElement})})]}),$jsx("box",{height:1}),$jsx("box",{height:1,children:$jsx("text",{fg:theme.textMuted,children:value.trim()?"Enter confirm \xB7 Esc cancel \xB7 Ctrl+U clear":"Esc cancel"})})]})};function openTextPrompt(dialog,opts){return new Promise((resolve4)=>{dialog.replace($jsx(TextPrompt,{title:opts.title,label:opts.label,initial:opts.initial,onSubmit:(v2)=>{dialog.clear(),resolve4(v2)},onCancel:()=>{dialog.clear(),resolve4(null)}}))})}var h12=()=>get("timeFormat")==="12h",abs=()=>get("timeStyle")==="absolute",trunc4=(s,max)=>s.length<=max?s:s.slice(0,max-1)+"\u2026",fmt=(n)=>n>=1e6?`${(n/1e6).toFixed(2)}M`:n>=1000?`${(n/1000).toFixed(1)}k`:String(n),cost=(c)=>c==null?"\u2014":`$${c.toFixed(2)}`,clock=(d2)=>d2.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:h12()}),stamp=(ts)=>{let d2=new Date(ts*1000);return d2.toDateString()===new Date().toDateString()?clock(d2):d2.toLocaleDateString(void 0,{month:"short",day:"numeric"})},rel=(ts)=>{let s=Math.floor(Date.now()/1000-ts);if(s<60)return"just now";if(s<3600)return`${Math.floor(s/60)}m ago`;if(s<86400)return`${Math.floor(s/3600)}h ago`;return`${Math.floor(s/86400)}d ago`},ago=(ts)=>abs()?stamp(ts):rel(ts),until=(ts)=>{if(abs())return ts<=Date.now()/1000?"due":stamp(ts);let s=Math.floor(ts-Date.now()/1000);if(s<=0)return"due";if(s<60)return`in ${s}s`;if(s<3600)return`in ${Math.floor(s/60)}m`;if(s<86400)return`in ${Math.floor(s/3600)}h`;return`in ${Math.floor(s/86400)}d`},when=(ts)=>{let d2=new Date(ts*1000);return`${d2.toLocaleDateString()} ${clock(d2)}`},span=(start2,end)=>{let s=Math.round(end-start2);if(s<0)return"\u2014";if(s>=3600)return`${Math.floor(s/3600)}h ${Math.floor(s%3600/60)}m`;if(s>=60)return`${Math.floor(s/60)}m`;return`${s}s`},dur2=(s)=>s>=3600?`${Math.floor(s/3600)}h${Math.floor(s%3600/60)}m`:s>=60?`${Math.floor(s/60)}m${Math.floor(s%60)}s`:`${Math.floor(s)}s`;var import_react51=__toESM(require_react_production(),1);import{watch as watch2,existsSync as existsSync9,statSync as statSync2}from"fs";import{dirname as dirname4,basename as basename6}from"path";import{readdir as readdir2,stat}from"fs/promises";import{openSync as openSync2,readSync as readSync2,closeSync as closeSync2,readdirSync as readdirSync3,readFileSync as readFileSync2}from"fs";import{homedir as homedir5}from"os";var composer=require_composer(),Document=require_Document(),Schema=require_Schema(),errors=require_errors(),Alias=require_Alias(),identity=require_identity(),Pair=require_Pair(),Scalar=require_Scalar(),YAMLMap=require_YAMLMap(),YAMLSeq=require_YAMLSeq(),cst=require_cst(),lexer=require_lexer(),lineCounter=require_line_counter(),parser=require_parser(),publicApi=require_public_api(),visit=require_visit();var $Composer=composer.Composer,$Document=Document.Document,$Schema=Schema.Schema,$YAMLError=errors.YAMLError,$YAMLParseError=errors.YAMLParseError,$YAMLWarning=errors.YAMLWarning,$Alias=Alias.Alias,$isAlias=identity.isAlias,$isCollection=identity.isCollection,$isDocument=identity.isDocument,$isMap=identity.isMap,$isNode=identity.isNode,$isPair=identity.isPair,$isScalar=identity.isScalar,$isSeq=identity.isSeq,$Pair=Pair.Pair,$Scalar=Scalar.Scalar,$YAMLMap=YAMLMap.YAMLMap,$YAMLSeq=YAMLSeq.YAMLSeq;var $Lexer=lexer.Lexer,$LineCounter=lineCounter.LineCounter,$Parser=parser.Parser,$parse=publicApi.parse,$parseAllDocuments=publicApi.parseAllDocuments,$parseDocument=publicApi.parseDocument,$stringify=publicApi.stringify,$visit=visit.visit,$visitAsync=visit.visitAsync;init_sessions_db();var HOME3=process.env.HOME||homedir5(),home={path:process.env.HERMES_HOME||`${HOME3}/.hermes`},setHome2=(h2)=>{home.path=h2},hermesPath=(relative2)=>`${home.path}/${relative2}`,managedSystem=async()=>{let env2=(process.env.HERMES_MANAGED??"").trim();if(env2){let norm=env2.toLowerCase();if(norm==="1"||norm==="true"||norm==="yes"||norm==="on")return"NixOS";return{homebrew:"Homebrew",nix:"NixOS",nixos:"NixOS"}[norm]??env2}return await Bun.file(hermesPath(".managed")).exists()?"NixOS":null},makeSource=(relative2,label)=>({file:hermesPath(relative2),relative:relative2,label:label??relative2.split("/").pop()??relative2});function readSkillFrontmatter(source){try{let fd=openSync2(source.file,"r"),buf=Buffer.alloc(2048),n=readSync2(fd,buf,0,2048,0);closeSync2(fd);let head=buf.toString("utf-8",0,n);if(!head.startsWith("---"))return{description:"",tags:[]};let end=head.indexOf(`
|
|
4088
4088
|
---`,3);if(end<0)return{description:"",tags:[]};let fm=$parse(head.slice(3,end)),tags=Array.isArray(fm.tags)?fm.tags.map(String):[];return{description:String(fm.description??""),tags}}catch{return{description:"",tags:[]}}}async function readSkillUsage(){try{let f=Bun.file(hermesPath("skills/.usage.json"));if(!await f.exists())return{};let raw=await f.json(),out={};for(let[k2,v2]of Object.entries(raw??{}))out[k2]={use_count:Number(v2.use_count??0),view_count:Number(v2.view_count??0),patch_count:Number(v2.patch_count??0),last_used_at:v2.last_used_at??null,last_viewed_at:v2.last_viewed_at??null,last_patched_at:v2.last_patched_at??null,created_at:v2.created_at??null,archived_at:v2.archived_at??null,state:v2.state??"active",pinned:Boolean(v2.pinned)};return out}catch{return{}}}async function readCuratorState(){try{let f=Bun.file(hermesPath("skills/.curator_state"));if(!await f.exists())return null;let raw=await f.json();return{last_run_at:raw.last_run_at??null,last_run_duration_seconds:raw.last_run_duration_seconds??null,last_run_summary:raw.last_run_summary??null,paused:Boolean(raw.paused),run_count:Number(raw.run_count??0)}}catch{return null}}async function readLatestCuratorReport(){try{let base2=hermesPath("logs/curator"),entries=readdirSync3(base2,{withFileTypes:!0}).filter((e)=>e.isDirectory());if(entries.length===0)return null;entries.sort((a,b2)=>b2.name.localeCompare(a.name));let runId=entries[0].name,rel2=`logs/curator/${runId}/REPORT.md`,source=makeSource(rel2),body=await Bun.file(source.file).text();return{source,content:body.trim(),runId}}catch{return null}}function listCuratorRuns(){try{let base2=hermesPath("logs/curator");return readdirSync3(base2,{withFileTypes:!0}).filter((e)=>e.isDirectory()).sort((a,b2)=>b2.name.localeCompare(a.name)).flatMap((e)=>{try{let fd=openSync2(`${base2}/${e.name}/run.json`,"r"),buf=Buffer.alloc(8192),n=readSync2(fd,buf);closeSync2(fd);let j2=JSON.parse(buf.toString("utf8",0,n)),c=j2.counts??{};return[{id:e.name,at:Date.parse(j2.started_at??"")/1000||0,archived:c.archived_this_run??0,consolidated:c.consolidated_this_run??0,added:c.added_this_run??0,before:c.before??0,after:c.after??0}]}catch{return[]}})}catch{return[]}}async function readCuratorReport(id){try{return(await Bun.file(hermesPath(`logs/curator/${id}/REPORT.md`)).text()).trim()}catch{return""}}function indexCuratorLineage(){let out=new Map,push2=(name,ev)=>{let a=out.get(name)??[];a.push(ev),out.set(name,a)};try{let base2=hermesPath("logs/curator");for(let e of readdirSync3(base2,{withFileTypes:!0})){if(!e.isDirectory())continue;try{let j2=JSON.parse(readFileSync2(`${base2}/${e.name}/run.json`,"utf8")),at=Date.parse(j2.started_at??"")/1000||0,run=e.name,into=new Map;for(let c of j2.consolidated??[])push2(c.name,{kind:"merged",run,at,into:c.into,reason:c.reason}),into.set(c.into,[...into.get(c.into)??[],c.name]);for(let[tgt,srcs]of into)push2(tgt,{kind:"absorbed",run,at,sources:srcs});for(let t2 of j2.state_transitions??[])push2(t2.name,{kind:"transition",run,at,from:t2.from,to:t2.to});for(let p of j2.pruned??[])push2(p.name,{kind:"pruned",run,at,reason:p.reason});for(let n of j2.added??[])push2(n,{kind:"added",run,at})}catch{}}}catch{}for(let a of out.values())a.sort((x2,y2)=>y2.at-x2.at);return out}function readChangelog(){try{let source=makeSource("herm/changelog.md"),fd=openSync2(source.file,"r"),buf=Buffer.alloc(4096),n=readSync2(fd,buf);closeSync2(fd);let body=buf.toString("utf8",0,n).trim(),line=body.split(`
|
|
4089
4089
|
`).find((l)=>/^[-*\u00B7]/.test(l.trim()));return{source,headline:line?.replace(/^[-*\u00B7]\s*/,"").trim()??"",body}}catch{return null}}async function readConfig(){try{let text2=await Bun.file(hermesPath("config.yaml")).text(),raw=$parse(text2);return{source:makeSource("config.yaml","config.yaml"),model:{default:raw?.model?.default??"unknown",provider:raw?.model?.provider??"auto",base_url:raw?.model?.base_url??""},agent:{max_turns:raw?.agent?.max_turns??60,reasoning_effort:raw?.agent?.reasoning_effort??"medium"},compression:{enabled:raw?.compression?.enabled??!0,threshold:raw?.compression?.threshold??0.5,target_ratio:raw?.compression?.target_ratio??0.2,protect_last_n:raw?.compression?.protect_last_n??20,summary_model:raw?.compression?.summary_model??""},memory:{memory_enabled:raw?.memory?.memory_enabled??!0,user_profile_enabled:raw?.memory?.user_profile_enabled??!0,memory_char_limit:raw?.memory?.memory_char_limit??2200,user_char_limit:raw?.memory?.user_char_limit??1375,provider:raw?.memory?.provider??"",nudge_interval:raw?.memory?.nudge_interval??10,flush_min_turns:raw?.memory?.flush_min_turns??6},display:{personality:raw?.display?.personality??"default",skin:raw?.display?.skin??"default",show_cost:raw?.display?.show_cost??!1},curator:{enabled:raw?.curator?.enabled??!0,interval_hours:raw?.curator?.interval_hours??168,stale_after_days:raw?.curator?.stale_after_days??30,archive_after_days:raw?.curator?.archive_after_days??90},approvals:{destructive_slash_confirm:raw?.approvals?.destructive_slash_confirm??!0},gateway:{platforms:{api_server:raw?.gateway?.platforms?.api_server??void 0}}}}catch{return null}}async function readMemoryFile(filename,charLimit){try{let relative2=`memories/${filename}`,content=await Bun.file(hermesPath(relative2)).text(),entryCount=content.split("\xA7").filter((s)=>s.trim()).length;return{source:makeSource(relative2,filename),content,charCount:content.length,charLimit,usagePercent:charLimit>0?Math.round(content.length/charLimit*100):0,entryCount}}catch{return null}}async function readLiveSessions(){try{let text2=await Bun.file(hermesPath("sessions/sessions.json")).text();return JSON.parse(text2)}catch{return{}}}var MEMORY_CFG_FILES={mem0:["mem0.json"],honcho:["honcho.json"],hindsight:["hindsight/config.json"],supermemory:["supermemory.json"],holographic:["holographic.db"]};function discoverMemoryProviders(){let names=new Set(["builtin"]);try{for(let e of readdirSync3(hermesPath("hermes-agent/plugins/memory"),{withFileTypes:!0}))if(e.isDirectory()&&!e.name.startsWith("_"))names.add(e.name)}catch{}return[...names]}async function readMemoryProviders(activeProvider){let out=[];for(let name of discoverMemoryProviders()){if(name==="builtin"){out.push({name,active:!0,config:{}});continue}let cfg={};for(let f of MEMORY_CFG_FILES[name]??[])try{let file=Bun.file(hermesPath(f));if(f.endsWith(".json")){let raw=await file.json();for(let[k2,v2]of Object.entries(raw))if(typeof v2==="string"||typeof v2==="number"||typeof v2==="boolean"){let lower=k2.toLowerCase();if(lower.includes("key")||lower.includes("token")||lower.includes("secret"))cfg[k2]=typeof v2==="string"?`${v2.slice(0,4)}...`:v2;else cfg[k2]=v2}}else{let st=await file.stat();if(st)cfg.db_size=`${Math.round(st.size/1024)}KB`}}catch{}out.push({name,active:name===activeProvider,config:cfg})}return out}async function readSoul(){try{let text2=await Bun.file(hermesPath("SOUL.md")).text();return{source:makeSource("SOUL.md"),charCount:text2.length,tokenEstimate:count2(text2),content:text2}}catch{return null}}async function readToolsFromLatestSession(){try{let glob=new Bun.Glob("session_*.json"),latestPath="",latestTime=0;for await(let path7 of glob.scan({cwd:hermesPath("sessions")})){let stat2=await Bun.file(hermesPath(`sessions/${path7}`)).stat();if(stat2&&stat2.mtimeMs>latestTime)latestTime=stat2.mtimeMs,latestPath=path7}if(!latestPath)return null;let relative2=`sessions/${latestPath}`,tools=((await Bun.file(hermesPath(relative2)).json()).tools||[]).map((t2)=>({name:t2?.function?.name??"unknown",descriptionLength:(t2?.function?.description??"").length,paramsLength:JSON.stringify(t2?.function?.parameters??{}).length}));return{source:makeSource(relative2,latestPath),tools}}catch{return null}}async function readCronOutput(jobId,tailLines=40){let dir=hermesPath(`cron/output/${jobId}`),entries;try{entries=await readdir2(dir)}catch{return null}let md=entries.filter((f)=>f.endsWith(".md")).sort().reverse();if(md.length===0)return null;let path7=`${dir}/${md[0]}`,full=await Bun.file(path7).text(),lines2=full.trimEnd().split(`
|
|
4090
4090
|
`),text2=lines2.length>tailLines?`\u2026(${lines2.length-tailLines} earlier lines)
|
|
@@ -4094,11 +4094,11 @@ tell application "System Events" to get value of property list item "CFBundleNam
|
|
|
4094
4094
|
`),found=!1,updated=lines2.map((line)=>{if(line.startsWith(`${key2}=`))return found=!0,`${key2}=${value}`;return line});if(!found)updated.push(`${key2}=${value}`);await Bun.write(ENV_PATH,updated.join(`
|
|
4095
4095
|
`))}async function removeEnvVar(key2){let text2="";try{text2=await Bun.file(ENV_PATH).text()}catch{return}let lines2=text2.split(`
|
|
4096
4096
|
`).filter((l)=>!l.startsWith(`${key2}=`));await Bun.write(ENV_PATH,lines2.join(`
|
|
4097
|
-
`))}var ENV_CATALOG=[{category:"LLM Providers",keys:["ANTHROPIC_API_KEY","OPENAI_API_KEY","GOOGLE_API_KEY","DEEPSEEK_API_KEY","OPENROUTER_API_KEY","GROQ_API_KEY","MISTRAL_API_KEY","XAI_API_KEY","TOGETHER_API_KEY","FIREWORKS_API_KEY","NOUS_API_KEY"]},{category:"Tool API Keys",keys:["FIRECRAWL_API_KEY","BROWSERBASE_API_KEY","BROWSERBASE_PROJECT_ID","TAVILY_API_KEY","EXA_API_KEY","ELEVENLABS_API_KEY"]},{category:"Messaging",keys:["TELEGRAM_BOT_TOKEN","DISCORD_BOT_TOKEN","SLACK_BOT_TOKEN","SLACK_APP_TOKEN"]},{category:"Agent",keys:["API_SERVER_KEY","MEM0_API_KEY"]}];var SLICES={config:{read:()=>readConfig(),watch:()=>[hermesPath("config.yaml")]},memory:{read:(d2)=>readMemoryFile("MEMORY.md",d2.config?.memory?.memory_char_limit??2200),deps:["config"],watch:()=>[hermesPath("memories/MEMORY.md")]},userProfile:{read:(d2)=>readMemoryFile("USER.md",d2.config?.memory?.user_char_limit??1375),deps:["config"],watch:()=>[hermesPath("memories/USER.md")]},memoryProviders:{read:(d2)=>readMemoryProviders(d2.config?.memory?.provider??""),deps:["config"]},memoryActivity:{read:()=>io.memoryActivity()},env:{read:()=>readEnvFile(),watch:()=>[hermesPath(".env")]},soul:{read:()=>readSoul(),watch:()=>[hermesPath("SOUL.md")]},liveSessions:{read:()=>readLiveSessions(),watch:()=>[hermesPath("sessions/sessions.json")]},recentSessions:{read:()=>io.roots(30)},systemPrompt:{read:()=>io.systemPrompt().then((r)=>r&&{source:makeSource("state.db"),sessionId:r.id,text:r.text,totalChars:r.text.length,tokenEstimate:count2(r.text)}).catch(()=>null)},toolsInfo:{read:()=>readToolsFromLatestSession(),watch:()=>[hermesPath("sessions")]},skillUsage:{read:()=>readSkillUsage(),watch:()=>[hermesPath("skills/.usage.json")]},curatorState:{read:()=>readCuratorState(),watch:()=>[hermesPath("skills/.curator_state")]}},DEPENDENTS=(()=>{let m2=new Map;for(let[k2,s]of Object.entries(SLICES))for(let d2 of s.deps??[]){let arr=m2.get(d2)??[];arr.push(k2),m2.set(d2,arr)}return m2})(),DEBOUNCE_MS=50;class HomeStore{data={};subs=new Map;inflight=new Map;watchers=new Map;debounce=new Map;get(k2){return this.data[k2]}subscribe(k2,cb){let set2=this.subs.get(k2);if(!set2)this.subs.set(k2,set2=new Set);return set2.add(cb),()=>set2.delete(cb)}ensure(k2){if(k2 in this.data)return Promise.resolve(this.data[k2]);let hit=this.inflight.get(k2);if(hit)return hit;let slice=SLICES[k2],p=(async()=>{let deps={};for(let d2 of slice.deps??[])deps[d2]=await this.ensure(d2);let v2=await slice.read(deps);return this.data[k2]=v2,this.startWatch(k2,slice.watch),this.notify(k2),v2})().finally(()=>this.inflight.delete(k2));return this.inflight.set(k2,p),p}invalidate(k2){if(!(k2 in this.data)&&!this.inflight.has(k2))return;if(delete this.data[k2],this.subs.get(k2)?.size)this.ensure(k2);for(let dep of DEPENDENTS.get(k2)??[])this.invalidate(dep)}close(){for(let ws of this.watchers.values())for(let w2 of ws)w2.close();for(let t2 of this.debounce.values())clearTimeout(t2);this.watchers.clear(),this.debounce.clear(),this.subs.clear(),this.inflight.clear(),this.data={}}reset(){for(let ws of this.watchers.values())for(let w2 of ws)w2.close();for(let t2 of this.debounce.values())clearTimeout(t2);this.watchers.clear(),this.debounce.clear(),this.inflight.clear(),this.data={};for(let k2 of this.subs.keys())if(this.subs.get(k2)?.size)this.ensure(k2)}notify(k2){let set2=this.subs.get(k2);if(set2)for(let cb of set2)cb()}startWatch(k2,watchFn){if(!watchFn||this.watchers.has(k2))return;let paths=watchFn(),ws=[],fire=()=>{let prev=this.debounce.get(k2);if(prev)clearTimeout(prev);this.debounce.set(k2,setTimeout(()=>this.invalidate(k2),DEBOUNCE_MS))};for(let p of paths){let dir=dirname4(p),name=basename6(p);try{if(existsSync9(p)&&statSync2(p).isDirectory())dir=p,name=null}catch{continue}if(!existsSync9(dir))continue;try{ws.push(watch2(dir,{persistent:!1},(_ev,f)=>{if(name===null||f===name)fire()}))}catch{}}this.watchers.set(k2,ws)}}var home2=new HomeStore;function useHome(k2){let v2=import_react51.useSyncExternalStore((cb)=>home2.subscribe(k2,cb),()=>home2.get(k2));return import_react51.useEffect(()=>{home2.ensure(k2)},[k2]),v2}var badge=(src)=>({cli:"CLI",tui:"TUI",api_server:"API",discord:"Discord",telegram:"Telegram",slack:"Slack",whatsapp:"WhatsApp",signal:"Signal"})[src]??src,line=(s)=>(s??"").replace(/\s+/g," ").trim(),fold=(msgs)=>{let turns=[],tools=0;for(let m2 of msgs){if(m2.role==="tool"){tools++;continue}if(m2.role!=="user"&&m2.role!=="assistant")continue;let text2=line(m2.content);if(!text2)continue;turns.push({role:m2.role,text:text2})}return{turns,tools}},PeekRow=import_react52.memo((props)=>{let theme=useTheme().theme,[hot,setHot]=import_react52.useState(!1),left=props.row.role==="user",color=left?theme.primary:theme.accent,fg2=left?theme.text:theme.markdownText,bar=(side)=>$jsx("box",{width:2,flexShrink:0,height:1,border:[side],borderColor:color,customBorderChars:SIDE_PIPE});return $jsxs("box",{height:1,flexDirection:"row",backgroundColor:hot?theme.backgroundElement:void 0,onMouseOver:()=>setHot(!0),onMouseOut:()=>setHot(!1),children:[left?bar("left"):null,$jsx(Ticker,{active:hot,speed:35,hold:150,fg:fg2,children:inline(props.row.text).map((s,i)=>s.c?$jsx("span",{fg:theme.warning,children:s.t},i):s.b?$jsx("span",{fg:fg2,children:$jsx("strong",{children:s.t})},i):s.i?$jsx("span",{fg:fg2,children:$jsx("u",{children:s.t})},i):$jsx("span",{fg:fg2,children:s.t},i))}),left?null:bar("right")]})}),Peek=import_react52.memo((props)=>{let theme=useTheme().theme,[data2,setData]=import_react52.useState(null),sb=import_react52.useRef(null);if(import_react52.useEffect(()=>{Promise.resolve(props.peek(props.sid,60)).then((m2)=>setData(fold(m2)))},[props.sid,props.peek]),import_react52.useEffect(()=>{if(data2&&sb.current)sb.current.scrollTop=sb.current.scrollHeight},[data2]),data2===null)return null;if(data2.turns.length===0&&data2.tools===0)return $jsx("box",{height:1,children:$jsx("text",{fg:theme.textMuted,children:"(no local transcript)"})});let more=Math.max(0,props.total-60);return $jsxs("box",{flexDirection:"column",flexGrow:1,minHeight:5,border:!0,borderStyle:"single",borderColor:theme.border,title:` Transcript${more>0?` \xB7 ${more} earlier`:""} `,titleAlignment:"left",children:[$jsx("scrollbox",{ref:sb,scrollY:!0,flexGrow:1,minHeight:3,children:$jsx("box",{flexDirection:"column",width:"100%",children:data2.turns.map((r,i)=>$jsx(PeekRow,{row:r},i))})}),$jsx("box",{height:1,children:$jsx("text",{fg:theme.textMuted,children:`${data2.turns.length} turn${data2.turns.length===1?"":"s"} \xB7 ${data2.tools} tool call${data2.tools===1?"":"s"}`})})]})}),Detail=import_react52.memo((props)=>{let theme=useTheme().theme,r=props.row,d2=r.detail,lastActive=d2?.last_active??d2?.ended_at??null,subs2=d2?.subagent_count??0,[info,setInfo]=import_react52.useState({});import_react52.useEffect(()=>{Promise.resolve(props.lineage(r.id)).then(setInfo)},[r.id,props.lineage]);let hasLineage=info.continuesFrom||info.compressedTo||subs2>0,go=(sid)=>()=>props.onSwitch?.(sid);return $jsx(TabShell,{title:"Session Detail",grow:2,children:$jsxs("box",{flexDirection:"column",width:"100%",flexGrow:1,overflow:"hidden",children:[$jsxs("box",{flexDirection:"column",flexShrink:0,children:[$jsx("box",{minHeight:1,children:$jsx("text",{wrapMode:"word",children:$jsx("span",{fg:theme.accent,children:$jsx("strong",{children:r.title||"Untitled"})})})}),$jsx("box",{height:1}),$jsx(KVBlock,{rows:[["ID",r.id],["Source",badge(r.source??"")],["Model",d2?.model??"\u2014"],["Started",when(r.started_at)],["Last active",lastActive?`${when(lastActive)} (${ago(lastActive)})`:"\u2014"],["Duration",lastActive?span(r.started_at,lastActive):"\u2014"],["Ended",d2?.ended_at?`${when(d2.ended_at)} \xB7 ${d2.end_reason??"\u2014"}`:void 0]]}),$jsx("box",{height:1}),$jsx(KVBlock,{rows:[["Messages",String(r.message_count)],["Tool calls",d2?String(d2.tool_call_count):void 0],["Input",d2?`${fmt(d2.input_tokens)} tok`:void 0],["Output",d2?`${fmt(d2.output_tokens)} tok`:void 0],["Cache",d2?`${fmt(d2.cache_read_tokens)} r / ${fmt(d2.cache_write_tokens)} w`:void 0],["Reasoning",d2?`${fmt(d2.reasoning_tokens)} tok`:void 0],["Cost",d2?cost(d2.estimated_cost_usd):void 0,theme.success]]}),hasLineage?$jsxs($Fragment2,{children:[$jsx("box",{height:1}),$jsx("box",{minHeight:1,children:$jsx("text",{fg:theme.textMuted,children:"Lineage"})}),info.continuesFrom?$jsx("box",{height:1,onMouseDown:go(info.continuesFrom.id),children:$jsxs("text",{children:[$jsx("span",{fg:theme.textMuted,children:" \u2190 continues from "}),$jsx("span",{fg:theme.accent,children:info.continuesFrom.title||info.continuesFrom.id})]})}):null,info.compressedTo?$jsx("box",{height:1,onMouseDown:go(info.compressedTo.id),children:$jsxs("text",{children:[$jsx("span",{fg:theme.textMuted,children:" \u2192 compressed to "}),$jsx("span",{fg:theme.accent,children:info.compressedTo.title||info.compressedTo.id})]})}):null,subs2>0?$jsx("box",{height:1,children:$jsxs("text",{children:[$jsx("span",{fg:theme.textMuted,children:" \u2387 spawned "}),$jsx("span",{fg:theme.text,children:String(subs2)}),$jsx("span",{fg:theme.textMuted,children:` subagent${subs2===1?"":"s"}`})]})}):null]}):null,!d2?$jsxs($Fragment2,{children:[$jsx("box",{height:1}),$jsx("box",{height:1,children:$jsx("text",{fg:theme.textMuted,children:"(no local detail \u2014 state.db mismatch)"})})]}):null,$jsx("box",{height:1})]}),$jsx(Peek,{sid:r.id,total:r.message_count,peek:props.peek})]})})}),SearchDetail=import_react52.memo((props)=>{let theme=useTheme().theme,r=props.result,parts2=[],rest=r.snippet;while(rest.length){let start2=rest.indexOf(">>>");if(start2<0){parts2.push({text:rest,hi:!1});break}if(start2>0)parts2.push({text:rest.slice(0,start2),hi:!1});let end=rest.indexOf("<<<",start2+3);if(end<0){parts2.push({text:rest.slice(start2+3),hi:!0});break}parts2.push({text:rest.slice(start2+3,end),hi:!0}),rest=rest.slice(end+3)}return $jsx(TabShell,{title:"Search Match",grow:2,children:$jsx("scrollbox",{scrollY:!0,flexGrow:1,children:$jsxs("box",{flexDirection:"column",width:"100%",children:[$jsx("box",{minHeight:1,children:$jsx("text",{wrapMode:"word",children:$jsx("span",{fg:theme.accent,children:$jsx("strong",{children:r.title??"Untitled"})})})}),$jsx("box",{height:1}),$jsx(KVBlock,{rows:[["Source",badge(r.source)],["Model",r.model??"\u2014"],["Time",when(r.started_at)]]}),$jsx("box",{height:1}),$jsx("box",{height:1,children:$jsx("text",{fg:theme.textMuted,children:"Snippet"})}),$jsx("box",{minHeight:1,children:$jsx("text",{wrapMode:"word",children:parts2.map((p,i)=>p.hi?$jsx("span",{fg:theme.accent,children:$jsx("strong",{children:p.text})},i):$jsx("span",{fg:theme.text,children:p.text},i))})})]})})})}),HeaderRow=import_react52.memo(()=>{let fg2=useTheme().theme.textMuted;return $jsxs(Hdr,{children:[$jsx(Col,{w:2,fg:fg2,children:" "}),$jsx(Col,{grow:!0,fg:fg2,bold:!0,children:"Title"}),$jsx(Col,{w:9,fg:fg2,bold:!0,children:"Source"}),$jsx(Col,{w:8,fg:fg2,bold:!0,children:"Start"}),$jsx(Col,{w:10,fg:fg2,bold:!0,right:!0,children:"Active"}),$jsx(Col,{w:7,fg:fg2,bold:!0,right:!0,children:"Msgs"}),$jsx("box",{width:3})]})}),Item=import_react52.memo((props)=>{let theme=useTheme().theme,{row:r,idx:i}=props,[x2,setX]=import_react52.useState(!1),active=r.detail?.last_active??r.detail?.ended_at??null,leader=props.indent?"\u2514\u2500":props.selected?"\u25B8 ":" ",muted=props.indent&&!props.selected?theme.textMuted:void 0;return $jsxs("box",{id:props.id,flexDirection:"row",height:1,backgroundColor:props.selected?theme.backgroundElement:void 0,onMouseDown:()=>props.onActivate(i),onMouseMove:()=>props.onHover(i),children:[$jsx(Col,{w:2,fg:props.selected?theme.primary:muted??theme.text,children:leader}),$jsx(Marquee,{grow:!0,active:props.selected,fg:props.selected?theme.accent:muted??theme.text,bold:props.selected,children:r.title||"Untitled"}),$jsx(Col,{w:9,fg:muted??theme.info,children:badge(r.source??"")}),$jsx(Col,{w:8,fg:theme.textMuted,children:stamp(r.started_at)}),$jsx(Col,{w:10,fg:theme.textMuted,right:!0,children:active?ago(active):"\u2014"}),$jsx(Col,{w:7,fg:theme.textMuted,right:!0,children:String(r.message_count)}),props.indent?$jsx("box",{width:3}):$jsx("box",{width:3,onMouseDown:(e)=>{e.stopPropagation(),props.onDelete(i)},onMouseOver:()=>setX(!0),onMouseOut:()=>setX(!1),children:$jsx("text",{children:$jsx("span",{fg:x2?theme.error:theme.textMuted,children:" \u2715"})})})]})}),SearchHeaderRow=import_react52.memo(()=>{let fg2=useTheme().theme.textMuted;return $jsxs(Hdr,{children:[$jsx(Col,{w:2,fg:fg2,children:" "}),$jsx(Col,{grow:!0,fg:fg2,bold:!0,children:"Title"}),$jsx(Col,{w:9,fg:fg2,bold:!0,children:"Source"}),$jsx(Col,{w:10,fg:fg2,bold:!0,children:"When"}),$jsx(Col,{w:20,fg:fg2,bold:!0,children:"Model"})]})}),SearchItem=import_react52.memo((props)=>{let theme=useTheme().theme,{result:r,idx:i}=props;return $jsxs("box",{id:props.id,flexDirection:"row",height:1,backgroundColor:props.selected?theme.backgroundElement:void 0,onMouseDown:()=>props.onActivate(i),onMouseMove:()=>props.onHover(i),children:[$jsx(Col,{w:2,fg:props.selected?theme.primary:theme.text,children:props.selected?"\u25B8 ":" "}),$jsx(Col,{grow:!0,fg:props.selected?theme.accent:theme.text,bold:props.selected,children:r.title??"Untitled"}),$jsx(Col,{w:9,fg:theme.info,children:badge(r.source)}),$jsx(Col,{w:10,fg:theme.textMuted,children:ago(r.started_at)}),$jsx(Col,{w:20,fg:theme.textMuted,children:r.model??"\u2014"})]})}),last={rows:[],kids:new Map},Sessions=import_react52.memo((props)=>{let theme=useTheme().theme,gw=useGateway(),dialog=useDialog(),toast=useToast(),dims=useTerminalDimensions(),cached2=props.io==null,io2={list:props.io?.list??io.roots,search:props.io?.search??io.search,subagents:props.io?.subagents??io.children,lineage:props.io?.lineage??io.lineage,peek:props.io?.peek??io.peek,remove:props.io?.remove??remove,rename:props.io?.rename??rename},[rows2,setRows]=import_react52.useState(cached2?last.rows:[]),[warn,setWarn]=import_react52.useState(""),[pending2,setPending]=import_react52.useState(rows2.length===0),[anchor,setAnchor]=import_react52.useState(null),[searching,setSearching]=import_react52.useState(!1),[query,setQuery]=import_react52.useState(""),[results,setResults]=import_react52.useState([]),[searchSel,setSearchSel]=import_react52.useState(0),[kids,setKids]=import_react52.useState(cached2?last.kids:new Map),debounce=import_react52.useRef(null),vscroll=import_react52.useRef(null),anchored=anchor&&rows2.find((r)=>r.id===anchor.id),owner=anchor?.indent?rows2.find((r)=>kids.get(r.id)?.some((c)=>c.id===anchor.id)):(anchored?.detail?.subagent_count??0)>0?anchored:void 0,visible=rows2.flatMap((r,i)=>r.id===owner?.id?[{row:r,indent:!1,parentIdx:i},...(kids.get(r.id)??[]).map((c)=>({row:c,indent:!0,parentIdx:i}))]:[{row:r,indent:!1,parentIdx:i}]),sel=anchor?Math.max(0,visible.findIndex((v2)=>v2.row.id===anchor.id&&v2.indent===anchor.indent)):0,live=import_react52.useRef({rows:rows2,visible,anchor,results,searching,onSwitch:props.onSwitch,currentId:props.currentId});live.current={rows:rows2,visible,anchor,results,searching,onSwitch:props.onSwitch,currentId:props.currentId};let setSel=import_react52.useCallback((arg)=>{let cur=live.current,prev=cur.visible.findIndex((v3)=>v3.row.id===cur.anchor?.id&&v3.indent===cur.anchor.indent),n=typeof arg==="function"?arg(Math.max(0,prev)):arg,v2=cur.visible[Math.max(0,Math.min(cur.visible.length-1,n))];if(v2)setAnchor({id:v2.row.id,indent:v2.indent})},[]),LIMIT=2000,toRow2=(d2)=>({id:d2.id,title:d2.title??"",preview:d2.lastMessage??"",message_count:d2.message_count,started_at:d2.started_at,source:d2.sessionSource,detail:d2}),load3=import_react52.useCallback(async()=>{setPending(!0);let rpc=gw.request("session.list",{limit:LIMIT}).then((r2)=>({ok:!0,v:r2})).catch((e)=>({ok:!1,e})),disk=await Promise.resolve(io2.list(LIMIT)).catch(()=>[]),local=new Map(disk.map((r2)=>[r2.id,r2])),diskRows=disk.filter((d2)=>d2.message_count>0).map(toRow2);if(setRows(diskRows),cached2)last.rows=diskRows;let fillKids=async(list)=>{let ps=list.filter((r2)=>(r2.detail?.subagent_count??0)>0),cs=await Promise.all(ps.map((r2)=>io2.subagents(r2.id))),m2=new Map(ps.map((r2,i)=>[r2.id,cs[i].map(toRow2)]));if(setKids(m2),cached2)last.kids=m2};fillKids(diskRows);let r=await rpc;if(r.ok&&r.v.sessions?.length){let seen=new Set(diskRows.map((s)=>s.id)),merged=[...diskRows,...r.v.sessions.filter((s)=>(s.message_count??0)>0&&!seen.has(s.id)).map((s)=>({...s,detail:local.get(s.id)}))].sort((a,b2)=>b2.started_at-a.started_at);if(setRows(merged),cached2)last.rows=merged;fillKids(merged)}setPending(!1),setWarn(!r.ok?local.size?`gateway session.list failed (${r.e.message}) \u2014 listing state.db directly; rows may not resume`:r.e.message:"")},[gw]);import_react52.useEffect(()=>{load3()},[load3]),import_react52.useEffect(()=>{if(!anchor&&rows2.length)setAnchor({id:rows2[0].id,indent:!1})},[rows2,anchor]),import_react52.useEffect(()=>{if(!searching||!query.trim()){setResults([]);return}return debounce.current=setTimeout(()=>{Promise.resolve(io2.search(query,30)).then((r)=>{setResults(r),setSearchSel(0)})},150),()=>{if(debounce.current)clearTimeout(debounce.current)}},[query,searching]);let rowHover=import_react52.useCallback((i)=>{live.current.searching?setSearchSel(i):setSel(i)},[setSel]),rowActivate=import_react52.useCallback((i)=>{let l=live.current;l.searching?setSearchSel(i):setSel(i);let hit=l.searching?l.results[i]:l.visible[i]?.row,id=l.searching?hit?.session_id:hit?.id;if(!id||!l.onSwitch)return;if(id===l.currentId)return l.onSwitch(id);let title=hit?.title||"Untitled",n=l.searching?void 0:hit.message_count;openConfirm(dialog,{title:"Load session?",body:`${trunc4(title,60)}${n!=null?` \xB7 ${n} msg${n===1?"":"s"}`:""}
|
|
4097
|
+
`))}var ENV_CATALOG=[{category:"LLM Providers",keys:["ANTHROPIC_API_KEY","OPENAI_API_KEY","GOOGLE_API_KEY","DEEPSEEK_API_KEY","OPENROUTER_API_KEY","GROQ_API_KEY","MISTRAL_API_KEY","XAI_API_KEY","TOGETHER_API_KEY","FIREWORKS_API_KEY","NOUS_API_KEY"]},{category:"Tool API Keys",keys:["FIRECRAWL_API_KEY","BROWSERBASE_API_KEY","BROWSERBASE_PROJECT_ID","TAVILY_API_KEY","EXA_API_KEY","ELEVENLABS_API_KEY"]},{category:"Messaging",keys:["TELEGRAM_BOT_TOKEN","DISCORD_BOT_TOKEN","SLACK_BOT_TOKEN","SLACK_APP_TOKEN"]},{category:"Agent",keys:["API_SERVER_KEY","MEM0_API_KEY"]}];var SLICES={config:{read:()=>readConfig(),watch:()=>[hermesPath("config.yaml")]},memory:{read:(d2)=>readMemoryFile("MEMORY.md",d2.config?.memory?.memory_char_limit??2200),deps:["config"],watch:()=>[hermesPath("memories/MEMORY.md")]},userProfile:{read:(d2)=>readMemoryFile("USER.md",d2.config?.memory?.user_char_limit??1375),deps:["config"],watch:()=>[hermesPath("memories/USER.md")]},memoryProviders:{read:(d2)=>readMemoryProviders(d2.config?.memory?.provider??""),deps:["config"]},memoryActivity:{read:()=>io.memoryActivity()},env:{read:()=>readEnvFile(),watch:()=>[hermesPath(".env")]},soul:{read:()=>readSoul(),watch:()=>[hermesPath("SOUL.md")]},liveSessions:{read:()=>readLiveSessions(),watch:()=>[hermesPath("sessions/sessions.json")]},recentSessions:{read:()=>io.roots(30)},systemPrompt:{read:()=>io.systemPrompt().then((r)=>r&&{source:makeSource("state.db"),sessionId:r.id,text:r.text,totalChars:r.text.length,tokenEstimate:count2(r.text)}).catch(()=>null)},toolsInfo:{read:()=>readToolsFromLatestSession(),watch:()=>[hermesPath("sessions")]},skillUsage:{read:()=>readSkillUsage(),watch:()=>[hermesPath("skills/.usage.json")]},curatorState:{read:()=>readCuratorState(),watch:()=>[hermesPath("skills/.curator_state")]}},DEPENDENTS=(()=>{let m2=new Map;for(let[k2,s]of Object.entries(SLICES))for(let d2 of s.deps??[]){let arr=m2.get(d2)??[];arr.push(k2),m2.set(d2,arr)}return m2})(),DEBOUNCE_MS=50;class HomeStore{data={};subs=new Map;inflight=new Map;watchers=new Map;debounce=new Map;get(k2){return this.data[k2]}subscribe(k2,cb){let set2=this.subs.get(k2);if(!set2)this.subs.set(k2,set2=new Set);return set2.add(cb),()=>set2.delete(cb)}ensure(k2){if(k2 in this.data)return Promise.resolve(this.data[k2]);let hit=this.inflight.get(k2);if(hit)return hit;let slice=SLICES[k2],p=(async()=>{let deps={};for(let d2 of slice.deps??[])deps[d2]=await this.ensure(d2);let v2=await slice.read(deps);return this.data[k2]=v2,this.startWatch(k2,slice.watch),this.notify(k2),v2})().finally(()=>this.inflight.delete(k2));return this.inflight.set(k2,p),p}invalidate(k2){if(!(k2 in this.data)&&!this.inflight.has(k2))return;if(delete this.data[k2],this.subs.get(k2)?.size)this.ensure(k2);for(let dep of DEPENDENTS.get(k2)??[])this.invalidate(dep)}close(){for(let ws of this.watchers.values())for(let w2 of ws)w2.close();for(let t2 of this.debounce.values())clearTimeout(t2);this.watchers.clear(),this.debounce.clear(),this.subs.clear(),this.inflight.clear(),this.data={}}reset(){for(let ws of this.watchers.values())for(let w2 of ws)w2.close();for(let t2 of this.debounce.values())clearTimeout(t2);this.watchers.clear(),this.debounce.clear(),this.inflight.clear(),this.data={};for(let k2 of this.subs.keys())if(this.subs.get(k2)?.size)this.ensure(k2)}notify(k2){let set2=this.subs.get(k2);if(set2)for(let cb of set2)cb()}startWatch(k2,watchFn){if(!watchFn||this.watchers.has(k2))return;let paths=watchFn(),ws=[],fire=()=>{let prev=this.debounce.get(k2);if(prev)clearTimeout(prev);this.debounce.set(k2,setTimeout(()=>this.invalidate(k2),DEBOUNCE_MS))};for(let p of paths){let dir=dirname4(p),name=basename6(p);try{if(existsSync9(p)&&statSync2(p).isDirectory())dir=p,name=null}catch{continue}if(!existsSync9(dir))continue;try{ws.push(watch2(dir,{persistent:!1},(_ev,f)=>{if(name===null||f===name)fire()}))}catch{}}this.watchers.set(k2,ws)}}var home2=new HomeStore;function useHome(k2){let v2=import_react51.useSyncExternalStore((cb)=>home2.subscribe(k2,cb),()=>home2.get(k2));return import_react51.useEffect(()=>{home2.ensure(k2)},[k2]),v2}var cmp=(s)=>{let k2=(r)=>s==="started"?r.started_at:r.detail?.last_active??r.started_at;return(a,b2)=>k2(b2)-k2(a)},badge=(src)=>({cli:"CLI",tui:"TUI",api_server:"API",discord:"Discord",telegram:"Telegram",slack:"Slack",whatsapp:"WhatsApp",signal:"Signal"})[src]??src,line=(s)=>(s??"").replace(/\s+/g," ").trim(),fold=(msgs)=>{let turns=[],tools=0;for(let m2 of msgs){if(m2.role==="tool"){tools++;continue}if(m2.role!=="user"&&m2.role!=="assistant")continue;let text2=line(m2.content);if(!text2)continue;turns.push({role:m2.role,text:text2})}return{turns,tools}},PeekRow=import_react52.memo((props)=>{let theme=useTheme().theme,[hot,setHot]=import_react52.useState(!1),left=props.row.role==="user",color=left?theme.primary:theme.accent,fg2=left?theme.text:theme.markdownText,bar=(side)=>$jsx("box",{width:2,flexShrink:0,height:1,border:[side],borderColor:color,customBorderChars:SIDE_PIPE});return $jsxs("box",{height:1,flexDirection:"row",backgroundColor:hot?theme.backgroundElement:void 0,onMouseOver:()=>setHot(!0),onMouseOut:()=>setHot(!1),children:[left?bar("left"):null,$jsx(Ticker,{active:hot,speed:35,hold:150,fg:fg2,children:inline(props.row.text).map((s,i)=>s.c?$jsx("span",{fg:theme.warning,children:s.t},i):s.b?$jsx("span",{fg:fg2,children:$jsx("strong",{children:s.t})},i):s.i?$jsx("span",{fg:fg2,children:$jsx("u",{children:s.t})},i):$jsx("span",{fg:fg2,children:s.t},i))}),left?null:bar("right")]})}),Peek=import_react52.memo((props)=>{let theme=useTheme().theme,[data2,setData]=import_react52.useState(null),sb=import_react52.useRef(null);if(import_react52.useEffect(()=>{Promise.resolve(props.peek(props.sid,60)).then((m2)=>setData(fold(m2)))},[props.sid,props.peek]),import_react52.useEffect(()=>{if(data2&&sb.current)sb.current.scrollTop=sb.current.scrollHeight},[data2]),data2===null)return null;if(data2.turns.length===0&&data2.tools===0)return $jsx("box",{height:1,children:$jsx("text",{fg:theme.textMuted,children:"(no local transcript)"})});let more=Math.max(0,props.total-60);return $jsxs("box",{flexDirection:"column",flexGrow:1,minHeight:5,border:!0,borderStyle:"single",borderColor:theme.border,title:` Transcript${more>0?` \xB7 ${more} earlier`:""} `,titleAlignment:"left",children:[$jsx("scrollbox",{ref:sb,scrollY:!0,flexGrow:1,minHeight:3,children:$jsx("box",{flexDirection:"column",width:"100%",children:data2.turns.map((r,i)=>$jsx(PeekRow,{row:r},i))})}),$jsx("box",{height:1,children:$jsx("text",{fg:theme.textMuted,children:`${data2.turns.length} turn${data2.turns.length===1?"":"s"} \xB7 ${data2.tools} tool call${data2.tools===1?"":"s"}`})})]})}),Detail=import_react52.memo((props)=>{let theme=useTheme().theme,r=props.row,d2=r.detail,lastActive=d2?.last_active??d2?.ended_at??null,subs2=d2?.subagent_count??0,[info,setInfo]=import_react52.useState({});import_react52.useEffect(()=>{Promise.resolve(props.lineage(r.id)).then(setInfo)},[r.id,props.lineage]);let hasLineage=info.continuesFrom||info.compressedTo||subs2>0,go=(sid)=>()=>props.onSwitch?.(sid);return $jsx(TabShell,{title:"Session Detail",grow:2,children:$jsxs("box",{flexDirection:"column",width:"100%",flexGrow:1,overflow:"hidden",children:[$jsxs("box",{flexDirection:"column",flexShrink:0,children:[$jsx("box",{minHeight:1,children:$jsx("text",{wrapMode:"word",children:$jsx("span",{fg:theme.accent,children:$jsx("strong",{children:r.title||"Untitled"})})})}),$jsx("box",{height:1}),$jsx(KVBlock,{rows:[["ID",r.id],["Source",badge(r.source??"")],["Model",d2?.model??"\u2014"],["Started",when(r.started_at)],["Last active",lastActive?`${when(lastActive)} (${ago(lastActive)})`:"\u2014"],["Duration",lastActive?span(r.started_at,lastActive):"\u2014"],["Ended",d2?.ended_at?`${when(d2.ended_at)} \xB7 ${d2.end_reason??"\u2014"}`:void 0]]}),$jsx("box",{height:1}),$jsx(KVBlock,{rows:[["Messages",String(r.message_count)],["Tool calls",d2?String(d2.tool_call_count):void 0],["Input",d2?`${fmt(d2.input_tokens)} tok`:void 0],["Output",d2?`${fmt(d2.output_tokens)} tok`:void 0],["Cache",d2?`${fmt(d2.cache_read_tokens)} r / ${fmt(d2.cache_write_tokens)} w`:void 0],["Reasoning",d2?`${fmt(d2.reasoning_tokens)} tok`:void 0],["Cost",d2?cost(d2.estimated_cost_usd):void 0,theme.success]]}),hasLineage?$jsxs($Fragment2,{children:[$jsx("box",{height:1}),$jsx("box",{minHeight:1,children:$jsx("text",{fg:theme.textMuted,children:"Lineage"})}),info.continuesFrom?$jsx("box",{height:1,onMouseDown:go(info.continuesFrom.id),children:$jsxs("text",{children:[$jsx("span",{fg:theme.textMuted,children:" \u2190 continues from "}),$jsx("span",{fg:theme.accent,children:info.continuesFrom.title||info.continuesFrom.id})]})}):null,info.compressedTo?$jsx("box",{height:1,onMouseDown:go(info.compressedTo.id),children:$jsxs("text",{children:[$jsx("span",{fg:theme.textMuted,children:" \u2192 compressed to "}),$jsx("span",{fg:theme.accent,children:info.compressedTo.title||info.compressedTo.id})]})}):null,subs2>0?$jsx("box",{height:1,children:$jsxs("text",{children:[$jsx("span",{fg:theme.textMuted,children:" \u2387 spawned "}),$jsx("span",{fg:theme.text,children:String(subs2)}),$jsx("span",{fg:theme.textMuted,children:` subagent${subs2===1?"":"s"}`})]})}):null]}):null,!d2?$jsxs($Fragment2,{children:[$jsx("box",{height:1}),$jsx("box",{height:1,children:$jsx("text",{fg:theme.textMuted,children:"(no local detail \u2014 state.db mismatch)"})})]}):null,$jsx("box",{height:1})]}),$jsx(Peek,{sid:r.id,total:r.message_count,peek:props.peek})]})})}),SearchDetail=import_react52.memo((props)=>{let theme=useTheme().theme,r=props.result,parts2=[],rest=r.snippet;while(rest.length){let start2=rest.indexOf(">>>");if(start2<0){parts2.push({text:rest,hi:!1});break}if(start2>0)parts2.push({text:rest.slice(0,start2),hi:!1});let end=rest.indexOf("<<<",start2+3);if(end<0){parts2.push({text:rest.slice(start2+3),hi:!0});break}parts2.push({text:rest.slice(start2+3,end),hi:!0}),rest=rest.slice(end+3)}return $jsx(TabShell,{title:"Search Match",grow:2,children:$jsx("scrollbox",{scrollY:!0,flexGrow:1,children:$jsxs("box",{flexDirection:"column",width:"100%",children:[$jsx("box",{minHeight:1,children:$jsx("text",{wrapMode:"word",children:$jsx("span",{fg:theme.accent,children:$jsx("strong",{children:r.title??"Untitled"})})})}),$jsx("box",{height:1}),$jsx(KVBlock,{rows:[["Source",badge(r.source)],["Model",r.model??"\u2014"],["Time",when(r.started_at)]]}),$jsx("box",{height:1}),$jsx("box",{height:1,children:$jsx("text",{fg:theme.textMuted,children:"Snippet"})}),$jsx("box",{minHeight:1,children:$jsx("text",{wrapMode:"word",children:parts2.map((p,i)=>p.hi?$jsx("span",{fg:theme.accent,children:$jsx("strong",{children:p.text})},i):$jsx("span",{fg:theme.text,children:p.text},i))})})]})})})}),HeaderRow=import_react52.memo((props)=>{let theme=useTheme().theme,fg2=theme.textMuted,on=theme.accent,by=props.sort;return $jsxs(Hdr,{children:[$jsx(Col,{w:2,fg:fg2,children:" "}),$jsx(Col,{grow:!0,fg:fg2,bold:!0,children:"Title"}),$jsx(Col,{w:9,fg:fg2,bold:!0,children:"Source"}),$jsx(Col,{w:8,fg:by==="started"?on:fg2,bold:!0,onClick:()=>props.onSort("started"),children:by==="started"?"Start \u25BE":"Start"}),$jsx(Col,{w:10,fg:by==="active"?on:fg2,bold:!0,right:!0,onClick:()=>props.onSort("active"),children:by==="active"?"Active \u25BE":"Active"}),$jsx(Col,{w:7,fg:fg2,bold:!0,right:!0,children:"Msgs"}),$jsx("box",{width:3})]})}),Item=import_react52.memo((props)=>{let theme=useTheme().theme,{row:r,idx:i}=props,[x2,setX]=import_react52.useState(!1),active=r.detail?.last_active??r.detail?.ended_at??null,leader=props.indent?"\u2514\u2500":props.selected?"\u25B8 ":" ",muted=props.indent&&!props.selected?theme.textMuted:void 0;return $jsxs("box",{id:props.id,flexDirection:"row",height:1,backgroundColor:props.selected?theme.backgroundElement:void 0,onMouseDown:()=>props.onActivate(i),onMouseMove:()=>props.onHover(i),children:[$jsx(Col,{w:2,fg:props.selected?theme.primary:muted??theme.text,children:leader}),$jsx(Marquee,{grow:!0,active:props.selected,fg:props.selected?theme.accent:muted??theme.text,bold:props.selected,children:r.title||"Untitled"}),$jsx(Col,{w:9,fg:muted??theme.info,children:badge(r.source??"")}),$jsx(Col,{w:8,fg:theme.textMuted,children:stamp(r.started_at)}),$jsx(Col,{w:10,fg:theme.textMuted,right:!0,children:active?ago(active):"\u2014"}),$jsx(Col,{w:7,fg:theme.textMuted,right:!0,children:String(r.message_count)}),props.indent?$jsx("box",{width:3}):$jsx("box",{width:3,onMouseDown:(e)=>{e.stopPropagation(),props.onDelete(i)},onMouseOver:()=>setX(!0),onMouseOut:()=>setX(!1),children:$jsx("text",{children:$jsx("span",{fg:x2?theme.error:theme.textMuted,children:" \u2715"})})})]})}),SearchHeaderRow=import_react52.memo(()=>{let fg2=useTheme().theme.textMuted;return $jsxs(Hdr,{children:[$jsx(Col,{w:2,fg:fg2,children:" "}),$jsx(Col,{grow:!0,fg:fg2,bold:!0,children:"Title"}),$jsx(Col,{w:9,fg:fg2,bold:!0,children:"Source"}),$jsx(Col,{w:10,fg:fg2,bold:!0,children:"When"}),$jsx(Col,{w:20,fg:fg2,bold:!0,children:"Model"})]})}),SearchItem=import_react52.memo((props)=>{let theme=useTheme().theme,{result:r,idx:i}=props;return $jsxs("box",{id:props.id,flexDirection:"row",height:1,backgroundColor:props.selected?theme.backgroundElement:void 0,onMouseDown:()=>props.onActivate(i),onMouseMove:()=>props.onHover(i),children:[$jsx(Col,{w:2,fg:props.selected?theme.primary:theme.text,children:props.selected?"\u25B8 ":" "}),$jsx(Col,{grow:!0,fg:props.selected?theme.accent:theme.text,bold:props.selected,children:r.title??"Untitled"}),$jsx(Col,{w:9,fg:theme.info,children:badge(r.source)}),$jsx(Col,{w:10,fg:theme.textMuted,children:ago(r.started_at)}),$jsx(Col,{w:20,fg:theme.textMuted,children:r.model??"\u2014"})]})}),last={rows:[],kids:new Map},Sessions=import_react52.memo((props)=>{let theme=useTheme().theme,gw=useGateway(),dialog=useDialog(),toast=useToast(),dims=useTerminalDimensions(),cached2=props.io==null,io2={list:props.io?.list??io.roots,search:props.io?.search??io.search,subagents:props.io?.subagents??io.children,lineage:props.io?.lineage??io.lineage,peek:props.io?.peek??io.peek,remove:props.io?.remove??remove,rename:props.io?.rename??rename},[rows2,setRows]=import_react52.useState(cached2?last.rows:[]),[warn,setWarn]=import_react52.useState(""),[pending2,setPending]=import_react52.useState(rows2.length===0),sort=usePref("sessions")?.sort??"active",setSort=import_react52.useCallback((s)=>set("sessions",{sort:s}),[]),sorted=import_react52.useMemo(()=>[...rows2].sort(cmp(sort)),[rows2,sort]),[anchor,setAnchor]=import_react52.useState(null),[searching,setSearching]=import_react52.useState(!1),[query,setQuery]=import_react52.useState(""),[results,setResults]=import_react52.useState([]),[searchSel,setSearchSel]=import_react52.useState(0),[kids,setKids]=import_react52.useState(cached2?last.kids:new Map),debounce=import_react52.useRef(null),vscroll=import_react52.useRef(null),anchored=anchor&&sorted.find((r)=>r.id===anchor.id),owner=anchor?.indent?sorted.find((r)=>kids.get(r.id)?.some((c)=>c.id===anchor.id)):(anchored?.detail?.subagent_count??0)>0?anchored:void 0,visible=sorted.flatMap((r,i)=>r.id===owner?.id?[{row:r,indent:!1,parentIdx:i},...(kids.get(r.id)??[]).map((c)=>({row:c,indent:!0,parentIdx:i}))]:[{row:r,indent:!1,parentIdx:i}]),sel=anchor?Math.max(0,visible.findIndex((v2)=>v2.row.id===anchor.id&&v2.indent===anchor.indent)):0,live=import_react52.useRef({rows:rows2,visible,anchor,results,searching,onSwitch:props.onSwitch,currentId:props.currentId});live.current={rows:rows2,visible,anchor,results,searching,onSwitch:props.onSwitch,currentId:props.currentId};let setSel=import_react52.useCallback((arg)=>{let cur=live.current,prev=cur.visible.findIndex((v3)=>v3.row.id===cur.anchor?.id&&v3.indent===cur.anchor.indent),n=typeof arg==="function"?arg(Math.max(0,prev)):arg,v2=cur.visible[Math.max(0,Math.min(cur.visible.length-1,n))];if(v2)setAnchor({id:v2.row.id,indent:v2.indent})},[]),LIMIT=2000,toRow2=(d2)=>({id:d2.id,title:d2.title??"",preview:d2.lastMessage??"",message_count:d2.message_count,started_at:d2.started_at,source:d2.sessionSource,detail:d2}),load3=import_react52.useCallback(async()=>{setPending(!0);let rpc=gw.request("session.list",{limit:LIMIT}).then((r2)=>({ok:!0,v:r2})).catch((e)=>({ok:!1,e})),disk=await Promise.resolve(io2.list(LIMIT)).catch(()=>[]),local=new Map(disk.map((r2)=>[r2.id,r2])),diskRows=disk.filter((d2)=>d2.message_count>0).map(toRow2);if(setRows(diskRows),cached2)last.rows=diskRows;let fillKids=async(list)=>{let ps=list.filter((r2)=>(r2.detail?.subagent_count??0)>0),cs=await Promise.all(ps.map((r2)=>io2.subagents(r2.id))),m2=new Map(ps.map((r2,i)=>[r2.id,cs[i].map(toRow2)]));if(setKids(m2),cached2)last.kids=m2};fillKids(diskRows);let r=await rpc;if(r.ok&&r.v.sessions?.length){let seen=new Set(diskRows.map((s)=>s.id)),merged=[...diskRows,...r.v.sessions.filter((s)=>(s.message_count??0)>0&&!seen.has(s.id)).map((s)=>({...s,detail:local.get(s.id)}))];if(setRows(merged),cached2)last.rows=merged;fillKids(merged)}setPending(!1),setWarn(!r.ok?local.size?`gateway session.list failed (${r.e.message}) \u2014 listing state.db directly; rows may not resume`:r.e.message:"")},[gw]);import_react52.useEffect(()=>{load3()},[load3]),import_react52.useEffect(()=>{if(!anchor&&sorted.length)setAnchor({id:sorted[0].id,indent:!1})},[sorted,anchor]),import_react52.useEffect(()=>{if(!searching||!query.trim()){setResults([]);return}return debounce.current=setTimeout(()=>{Promise.resolve(io2.search(query,30)).then((r)=>{setResults(r),setSearchSel(0)})},150),()=>{if(debounce.current)clearTimeout(debounce.current)}},[query,searching]);let rowHover=import_react52.useCallback((i)=>{live.current.searching?setSearchSel(i):setSel(i)},[setSel]),rowActivate=import_react52.useCallback((i)=>{let l=live.current;l.searching?setSearchSel(i):setSel(i);let hit=l.searching?l.results[i]:l.visible[i]?.row,id=l.searching?hit?.session_id:hit?.id;if(!id||!l.onSwitch)return;if(id===l.currentId)return l.onSwitch(id);let title=hit?.title||"Untitled",n=l.searching?void 0:hit.message_count;openConfirm(dialog,{title:"Load session?",body:`${trunc4(title,60)}${n!=null?` \xB7 ${n} msg${n===1?"":"s"}`:""}
|
|
4098
4098
|
|
|
4099
4099
|
Current chat will be replaced.`,yes:"load"}).then((ok)=>{if(ok)l.onSwitch?.(id)})},[dialog]),rowDelete=import_react52.useCallback((i)=>{let v2=live.current.visible[i];if(v2&&!v2.indent)confirmDeleteRef.current(v2.row)},[]),lineageSwitch=import_react52.useCallback((sid)=>{let l=live.current;if(!l.onSwitch)return;if(sid===l.currentId)return l.onSwitch(sid);openConfirm(dialog,{title:"Load session?",body:`Switch to ${trunc4(sid,24)}?
|
|
4100
4100
|
|
|
4101
|
-
Current chat will be replaced.`,yes:"load"}).then((ok)=>{if(ok)l.onSwitch?.(sid)})},[dialog]),confirmDeleteRef=import_react52.useRef(()=>{}),confirmDelete=import_react52.useCallback((r)=>{openConfirm(dialog,{title:"Delete Session?",body:trunc4(r.title||"Untitled",46),yes:"Delete",danger:!0}).then(async(ok)=>{if(!ok)return;if(!await gw.request("session.delete",{session_id:r.id}).then(()=>!0).catch((e)=>{if(/active session/i.test(e.message))return toast.show({variant:"error",message:"Can't delete the active session"}),!1;return io2.remove(r.id)}))return;home2.invalidate("recentSessions"),toast.show({variant:"success",message:"Session deleted"}),load3()})},[gw,dialog,toast,load3]);confirmDeleteRef.current=confirmDelete;let rename2=import_react52.useCallback(async()=>{let v2=live.current.visible[sel];if(!v2||v2.indent)return;let r=v2.row,title=await openTextPrompt(dialog,{title:`Rename: ${trunc4(r.title||"Untitled",42)}`,label:"Title",initial:r.title||""});if(title===null)return;Promise.resolve().then(()=>{if(!io2.rename(r.id,title))throw Error("not found");home2.invalidate("recentSessions"),setRows((prev)=>prev.map((row)=>row.id===r.id?{...row,title}:row)),toast.show({variant:"success",message:"Renamed"})}).catch((e)=>toast.show({variant:"error",message:`Rename failed: ${e.message}`}))},[dialog,toast,sel]),count3=searching?results.length:visible.length,rowId=(i)=>{if(searching)return`sess-s-${results[i]?.session_id??i}`;let v2=visible[i];return v2?`sess-${v2.indent?"c":"p"}-${v2.row.id}`:`sess-empty-${i}`},keys=useKeys();useKeyboard((key2)=>{if(!props.focused||dialog.open())return;if(searching){if(key2.name==="escape"){setSearching(!1),setQuery(""),setResults([]),setSearchSel(0);return}if(key2.name==="backspace")return setQuery((p)=>p.slice(0,-1));if(key2.name==="return")return rowActivate(searchSel);if(key2.name==="up")return setSearchSel((p)=>Math.max(0,p-1));if(key2.name==="down")return setSearchSel((p)=>Math.min(count3-1,p+1));if(key2.raw&&key2.raw.length===1&&key2.raw>=" ")return setQuery((p)=>p+key2.raw);return}if(handleListKey(keys,key2,{count:count3,setSel,page:Math.max(1,(vscroll.current?.viewport.height??10)-1),scrollTo:(n)=>vscroll.current?.scrollChildIntoView(rowId(n)),onActivate:()=>rowActivate(sel),onRefresh:()=>{load3(),toast.show({variant:"info",message:"Reloaded",duration:1000})},onDelete:()=>{let v2=visible[sel];if(v2&&!v2.indent)confirmDelete(v2.row)},onSearch:()=>{setSearching(!0),setQuery(""),setResults([]),setSearchSel(0)}}))return;if(keys.match("sessions.rename",key2))return void rename2();if(keys.match("sessions.prev",key2)||keys.match("sessions.next",key2)){let v2=visible[sel];if(!v2)return;Promise.resolve(io2.lineage(v2.row.id)).then((ln)=>{let target=keys.match("sessions.prev",key2)?ln.continuesFrom?.id:ln.compressedTo?.id;if(target)lineageSwitch(target)});return}});let empty=searching?results.length===0&&query.length>0:rows2.length===0,showDetailPanel=dims.width>=120;return $jsxs("box",{flexDirection:"column",flexGrow:1,minWidth:0,children:[$jsxs("box",{flexDirection:"row",flexGrow:1,children:[$jsxs(TabShell,{title:searching?`Search Results (${results.length})`:`Sessions (${rows2.length}${pending2?"\u2026":""})`,error:warn||null,grow:3,children:[searching?$jsx("box",{height:1,marginBottom:1,children:$jsxs("text",{children:[$jsx("span",{fg:theme.accent,children:"/ "}),$jsx("span",{fg:theme.text,children:query}),$jsx("span",{fg:theme.accent,children:"\u2588"})]})}):null,empty?$jsx("box",{flexGrow:1,padding:2,children:pending2&&!searching?$jsx(Spinner,{color:theme.textMuted,label:"loading sessions\u2026"}):$jsx("text",{fg:theme.textMuted,children:searching?"No matching sessions found":"No sessions found"})},"empty"):$jsxs("box",{flexDirection:"column",flexGrow:1,minWidth:0,children:[searching?$jsx(SearchHeaderRow,{}):$jsx(HeaderRow,{}),$jsx("box",{height:1}),$jsx("scrollbox",{ref:vscroll,scrollY:!0,viewportCulling:!0,flexGrow:1,verticalScrollbarOptions:VBAR,children:searching?results.map((r,i)=>$jsx(SearchItem,{id:rowId(i),idx:i,result:r,selected:i===searchSel,onActivate:rowActivate,onHover:rowHover},r.session_id)):visible.map((v2,i)=>$jsx(Item,{id:rowId(i),idx:i,row:v2.row,selected:i===sel,indent:v2.indent,onActivate:rowActivate,onHover:rowHover,onDelete:rowDelete},`${v2.row.id}-${v2.indent?"c":"p"}`))})]},"table")]}),showDetailPanel&&searching&&results[searchSel]?$jsx(SearchDetail,{result:results[searchSel]}):showDetailPanel&&!searching&&visible[sel]?.row?$jsx(Detail,{row:visible[sel].row,lineage:io2.lineage,peek:io2.peek,onSwitch:lineageSwitch}):null]}),$jsx(HintBar,{pairs:searching?[["\u2191\u2193","navigate"],["Enter/click","switch"],["Esc","cancel"]]:[["\u2191\u2193","navigate"],["\u2190\u2192","lineage"],[`${keys.print("list.activate")}/click`,"switch"],[keys.print("list.search"),"search"],[keys.print("sessions.rename"),"rename"],[keys.print("list.delete"),"delete"],[keys.print("list.refresh"),"refresh"]]})]})});var import_react55=__toESM(require_react_production(),1);var GRID=256,CPT=4,MEMORY_IDS=new Set(["soul","memory","user","mem0"]),SYSTEM_PROMPT_IDS=new Set(["project","meta","other"]);function parse4(text2){if(!text2)return[];let sections=[],used=Array(text2.length).fill(!1),mark2=(start3,end,id,label,source)=>{let slice=text2.slice(start3,end);if(slice.trim().length===0)return;for(let i=start3;i<end;i++)used[i]=!0;sections.push({id,label,chars:slice.length,tokens:count2(slice),text:slice,source})},bar1=text2.indexOf("\u2550\u2550\u2550\u2550\u2550\u2550");if(bar1>0)mark2(0,bar1,"soul","SOUL.md",makeSource("SOUL.md"));let memH=text2.indexOf("MEMORY (your personal notes)");if(memH>=0){let s=text2.lastIndexOf("\u2550\u2550\u2550\u2550\u2550\u2550",memH),after=text2.indexOf(`
|
|
4101
|
+
Current chat will be replaced.`,yes:"load"}).then((ok)=>{if(ok)l.onSwitch?.(sid)})},[dialog]),confirmDeleteRef=import_react52.useRef(()=>{}),confirmDelete=import_react52.useCallback((r)=>{openConfirm(dialog,{title:"Delete Session?",body:trunc4(r.title||"Untitled",46),yes:"Delete",danger:!0}).then(async(ok)=>{if(!ok)return;if(!await gw.request("session.delete",{session_id:r.id}).then(()=>!0).catch((e)=>{if(/active session/i.test(e.message))return toast.show({variant:"error",message:"Can't delete the active session"}),!1;return io2.remove(r.id)}))return;home2.invalidate("recentSessions"),toast.show({variant:"success",message:"Session deleted"}),load3()})},[gw,dialog,toast,load3]);confirmDeleteRef.current=confirmDelete;let rename2=import_react52.useCallback(async()=>{let v2=live.current.visible[sel];if(!v2||v2.indent)return;let r=v2.row,title=await openTextPrompt(dialog,{title:`Rename: ${trunc4(r.title||"Untitled",42)}`,label:"Title",initial:r.title||""});if(title===null)return;Promise.resolve().then(()=>{if(!io2.rename(r.id,title))throw Error("not found");home2.invalidate("recentSessions"),setRows((prev)=>prev.map((row)=>row.id===r.id?{...row,title}:row)),toast.show({variant:"success",message:"Renamed"})}).catch((e)=>toast.show({variant:"error",message:`Rename failed: ${e.message}`}))},[dialog,toast,sel]),count3=searching?results.length:visible.length,rowId=(i)=>{if(searching)return`sess-s-${results[i]?.session_id??i}`;let v2=visible[i];return v2?`sess-${v2.indent?"c":"p"}-${v2.row.id}`:`sess-empty-${i}`},keys=useKeys();useKeyboard((key2)=>{if(!props.focused||dialog.open())return;if(searching){if(key2.name==="escape"){setSearching(!1),setQuery(""),setResults([]),setSearchSel(0);return}if(key2.name==="backspace")return setQuery((p)=>p.slice(0,-1));if(key2.name==="return")return rowActivate(searchSel);if(key2.name==="up")return setSearchSel((p)=>Math.max(0,p-1));if(key2.name==="down")return setSearchSel((p)=>Math.min(count3-1,p+1));if(key2.raw&&key2.raw.length===1&&key2.raw>=" ")return setQuery((p)=>p+key2.raw);return}if(handleListKey(keys,key2,{count:count3,setSel,page:Math.max(1,(vscroll.current?.viewport.height??10)-1),scrollTo:(n)=>vscroll.current?.scrollChildIntoView(rowId(n)),onActivate:()=>rowActivate(sel),onToggle:()=>setSort(sort==="active"?"started":"active"),onRefresh:()=>{load3(),toast.show({variant:"info",message:"Reloaded",duration:1000})},onDelete:()=>{let v2=visible[sel];if(v2&&!v2.indent)confirmDelete(v2.row)},onSearch:()=>{setSearching(!0),setQuery(""),setResults([]),setSearchSel(0)}}))return;if(keys.match("sessions.rename",key2))return void rename2();if(keys.match("sessions.prev",key2)||keys.match("sessions.next",key2)){let v2=visible[sel];if(!v2)return;Promise.resolve(io2.lineage(v2.row.id)).then((ln)=>{let target=keys.match("sessions.prev",key2)?ln.continuesFrom?.id:ln.compressedTo?.id;if(target)lineageSwitch(target)});return}});let empty=searching?results.length===0&&query.length>0:rows2.length===0,showDetailPanel=dims.width>=120;return $jsxs("box",{flexDirection:"column",flexGrow:1,minWidth:0,children:[$jsxs("box",{flexDirection:"row",flexGrow:1,children:[$jsxs(TabShell,{title:searching?`Search Results (${results.length})`:`Sessions (${rows2.length}${pending2?"\u2026":""})`,error:warn||null,grow:3,children:[searching?$jsx("box",{height:1,marginBottom:1,children:$jsxs("text",{children:[$jsx("span",{fg:theme.accent,children:"/ "}),$jsx("span",{fg:theme.text,children:query}),$jsx("span",{fg:theme.accent,children:"\u2588"})]})}):null,empty?$jsx("box",{flexGrow:1,padding:2,children:pending2&&!searching?$jsx(Spinner,{color:theme.textMuted,label:"loading sessions\u2026"}):$jsx("text",{fg:theme.textMuted,children:searching?"No matching sessions found":"No sessions found"})},"empty"):$jsxs("box",{flexDirection:"column",flexGrow:1,minWidth:0,children:[searching?$jsx(SearchHeaderRow,{}):$jsx(HeaderRow,{sort,onSort:setSort}),$jsx("box",{height:1}),$jsx("scrollbox",{ref:vscroll,scrollY:!0,viewportCulling:!0,flexGrow:1,verticalScrollbarOptions:VBAR,children:searching?results.map((r,i)=>$jsx(SearchItem,{id:rowId(i),idx:i,result:r,selected:i===searchSel,onActivate:rowActivate,onHover:rowHover},r.session_id)):visible.map((v2,i)=>$jsx(Item,{id:rowId(i),idx:i,row:v2.row,selected:i===sel,indent:v2.indent,onActivate:rowActivate,onHover:rowHover,onDelete:rowDelete},`${v2.row.id}-${v2.indent?"c":"p"}`))})]},"table")]}),showDetailPanel&&searching&&results[searchSel]?$jsx(SearchDetail,{result:results[searchSel]}):showDetailPanel&&!searching&&visible[sel]?.row?$jsx(Detail,{row:visible[sel].row,lineage:io2.lineage,peek:io2.peek,onSwitch:lineageSwitch}):null]}),$jsx(HintBar,{pairs:searching?[["\u2191\u2193","navigate"],["Enter/click","switch"],["Esc","cancel"]]:[["\u2191\u2193","navigate"],["\u2190\u2192","lineage"],[`${keys.print("list.activate")}/click`,"switch"],[keys.print("list.search"),"search"],[keys.print("list.toggle"),`sort: ${sort}`],[keys.print("sessions.rename"),"rename"],[keys.print("list.delete"),"delete"],[keys.print("list.refresh"),"refresh"]]})]})});var import_react55=__toESM(require_react_production(),1);var GRID=256,CPT=4,MEMORY_IDS=new Set(["soul","memory","user","mem0"]),SYSTEM_PROMPT_IDS=new Set(["project","meta","other"]);function parse4(text2){if(!text2)return[];let sections=[],used=Array(text2.length).fill(!1),mark2=(start3,end,id,label,source)=>{let slice=text2.slice(start3,end);if(slice.trim().length===0)return;for(let i=start3;i<end;i++)used[i]=!0;sections.push({id,label,chars:slice.length,tokens:count2(slice),text:slice,source})},bar1=text2.indexOf("\u2550\u2550\u2550\u2550\u2550\u2550");if(bar1>0)mark2(0,bar1,"soul","SOUL.md",makeSource("SOUL.md"));let memH=text2.indexOf("MEMORY (your personal notes)");if(memH>=0){let s=text2.lastIndexOf("\u2550\u2550\u2550\u2550\u2550\u2550",memH),after=text2.indexOf(`
|
|
4102
4102
|
`,text2.indexOf("\u2550\u2550\u2550\u2550\u2550\u2550",memH+1)),next=text2.indexOf("\u2550\u2550\u2550\u2550\u2550\u2550",after>0?after:memH+40),e=next>0?text2.lastIndexOf(`
|
|
4103
4103
|
`,next)+1:text2.length;if(s>=0)mark2(s,e,"memory","Memory Notes",makeSource("memories/MEMORY.md","MEMORY.md"))}let userH=text2.indexOf("USER PROFILE (who the user is)");if(userH>=0){let s=text2.lastIndexOf("\u2550\u2550\u2550\u2550\u2550\u2550",userH),after=text2.indexOf(`
|
|
4104
4104
|
`,text2.indexOf("\u2550\u2550\u2550\u2550\u2550\u2550",userH+1)),next=text2.slice(after>0?after:userH+40).search(/\n#\s/),e=next>=0?(after>0?after:userH+40)+next+1:text2.length;if(s>=0)mark2(s,e,"user","User Profile",makeSource("memories/USER.md","USER.md"))}let m0=text2.indexOf("# Mem0 Memory");if(m0>=0){let next=text2.slice(m0+1).search(/\n##?\s/);mark2(m0,next>=0?m0+1+next+1:text2.length,"mem0","Mem0 Memory")}let skH=text2.indexOf("## Skills (mandatory)"),skE=text2.indexOf("</available_skills>");if(skH>=0&&skE>=0){let end=text2.indexOf(`
|