@kabmo-labs/kabmo 0.6.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4996,7 +4996,7 @@ description: ""
4996
4996
  ---
4997
4997
  `),C(!1);else d(e.name),h(e.description),g(e.location),y(e.locationLabel||"User / omp agent"),x(e.instructions),C(e.hidden===!0)},[e,t,l]);let P=()=>{n({name:u.trim()||"unnamed-skill",description:p.trim(),location:f,locationLabel:b,instructions:v,hidden:k}),w(!0),setTimeout(()=>w(!1),2000)},R=v.split(`
4998
4998
  `),I=Math.max(R.length,6);return m("div",{className:"flex-1 flex flex-col h-full scrollbar-overlay-container bg-paper text-ink p-6 md:p-8 space-y-6",children:[m("div",{className:"flex items-start justify-between pb-4 border-b border-ink/10 gap-4",children:[m("div",{children:[m("h2",{className:"text-sm font-bold tracking-tight text-ink",children:t?"New Skill":u}),m("p",{className:"text-xs text-ink/60 mt-0.5",children:t?"Configure a new skill":`Configure skill details and prompt rules · ${b}`})]}),m("div",{className:"flex items-center gap-2",children:[i&&m("button",{type:"button",onClick:i,disabled:o,title:"Re-discover skills in the running agents",className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-ink/20 hover:border-ink/40 text-xs font-medium text-ink hover:bg-ink/5 transition-colors cursor-pointer disabled:opacity-50",children:[m(In,{size:14,className:o?"animate-spin text-ink/70":"text-ink/70"}),m("span",{children:"Reload"})]}),a&&m("button",{type:"button",onClick:a,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-ink/20 hover:border-ink/40 text-xs font-medium text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:[m(Wi,{size:14,className:"text-ink/70"}),m("span",{children:"Browse Catalog"})]})]})]}),L&&m("div",{className:"rounded-lg border border-ink/15 bg-ink/5 px-3 py-2 text-[11px] text-ink/70 leading-relaxed",children:["This skill is provided by ",m("span",{className:"font-mono text-ink/80",children:e?.source})," and is read-only here. Edit ",m("span",{className:"font-mono text-ink/80",children:e?.filePath})," at its source, or install a copy into"," ",m("span",{className:"font-mono text-ink/80",children:"~/.omp/agent/skills"})," to own it."]}),m("div",{className:"space-y-4",children:[m("h3",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:"Basic Information"}),m("div",{children:[m("div",{className:"flex items-center gap-1.5 mb-1.5",children:[m("label",{className:"text-xs font-semibold text-ink/80",children:"Skill Name & Location"}),m("div",{className:"group relative",children:[m(fa,{size:13,className:"text-ink/40 cursor-help"}),m("div",{className:"absolute left-0 top-5 hidden group-hover:block w-64 p-2 rounded-lg bg-ink text-paper text-[11px] shadow-lg z-20 pointer-events-none leading-relaxed",children:["Unique identifier and runtime execution scope for this skill. A project skill is written under"," ",m("span",{className:"font-mono",children:"<workspace>/.omp/skills"}),"."]})]})]}),m("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-2",children:[m("input",{type:"text",value:u,onChange:(A)=>d(A.currentTarget.value),disabled:L,placeholder:"skill-name",className:"flex-1 px-3 py-2 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper focus:outline-none focus:border-ink text-xs font-mono text-ink transition-colors disabled:opacity-60"}),m("div",{className:"flex items-center gap-1.5 px-3 py-2 rounded-lg border border-ink/20 bg-ink/5 text-xs text-ink/80 flex-shrink-0",children:[m(H5,{size:14,className:"text-ink/60"}),m("span",{children:b})]})]}),!L&&m("div",{className:"flex items-center gap-2 mt-2",children:["user","project"].map((A)=>{let M=A==="project"&&s;return m("button",{type:"button",disabled:M,title:M?"Select a workspace folder to write a project skill":void 0,onClick:()=>{g(A),y(A==="user"?"User / omp agent":"Project / .omp/skills")},className:`px-2.5 py-1 rounded-md text-[11px] font-medium transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed ${f===A?"bg-ink text-paper":"border border-ink/20 text-ink/70 hover:bg-ink/5"}`,children:A==="user"?"User scope":"Project scope"},A)})})]}),m("div",{children:[m("div",{className:"flex items-center gap-1.5 mb-1.5",children:[m("label",{className:"text-xs font-semibold text-ink/80",children:["Description ",m("span",{className:"text-error",children:"*"})]}),m("div",{className:"group relative",children:[m(fa,{size:13,className:"text-ink/40 cursor-help"}),m("div",{className:"absolute left-0 top-5 hidden group-hover:block w-64 p-2 rounded-lg bg-ink text-paper text-[11px] shadow-lg z-20 pointer-events-none leading-relaxed",children:"Short description helping autonomous agents decide when to invoke this skill. Required — omp does not load a SKILL.md without one."})]})]}),m("textarea",{rows:3,value:p,onChange:(A)=>h(A.currentTarget.value),disabled:L,placeholder:"Brief description of what this skill does...",className:"w-full px-3 py-2 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper focus:outline-none focus:border-ink text-xs text-ink transition-colors resize-none leading-relaxed disabled:opacity-60"})]}),m("label",{className:"flex items-start gap-2 cursor-pointer select-none",children:[m("input",{type:"checkbox",checked:k,disabled:L,onChange:(A)=>C(A.currentTarget.checked),className:"mt-0.5 accent-ink cursor-pointer"}),m("span",{className:"text-xs text-ink/80 leading-relaxed",children:["Hide from the model's skill listing",m("span",{className:"block text-[11px] text-ink/50",children:["The skill stays runnable via ",m("span",{className:"font-mono",children:["/skill:",u||"name"]}),"; it is only kept out of the automatic skill catalog the model sees."]})]})]})]}),m("div",{className:"space-y-2 pt-2 border-t border-ink/10",children:[m("div",{className:"flex items-center justify-between",children:[m("h3",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:"Instructions"}),m("button",{type:"button",onClick:()=>E(!T),title:T?"Hide Line Numbers":"Show Line Numbers",className:"p-1 rounded-md text-ink/50 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:T?m(fl,{size:15}):m(mp,{size:15})})]}),m("div",{className:"rounded-lg border border-ink/20 hover:border-ink/40 bg-ink/5 overflow-hidden flex flex-col font-mono text-xs focus-within:border-ink transition-colors",children:m("div",{className:"flex",children:[T&&m("div",{className:"w-10 py-3 pr-2 select-none text-right font-mono text-xs text-ink/30 border-r border-ink/10 bg-ink/[0.02] overflow-hidden leading-relaxed",children:Array.from({length:I}).map((A,M)=>m("div",{children:M+1},M))}),m("textarea",{rows:Math.max(I,8),value:v,onChange:(A)=>x(A.currentTarget.value),disabled:L,spellcheck:!1,className:"flex-1 p-3 bg-transparent text-ink font-mono text-xs leading-relaxed resize-none focus:outline-none overflow-y-auto disabled:opacity-60",placeholder:"Type markdown instructions..."})]})})]}),m("div",{className:"pt-4 border-t border-ink/10 flex items-center justify-between",children:[!t&&e&&r&&!L?m("button",{type:"button",onClick:()=>r(e.id),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-lg border border-ink/20 hover:border-error hover:text-error text-ink/70 text-xs font-medium transition-colors cursor-pointer",children:[m(xr,{size:14}),m("span",{children:"Delete Skill"})]}):m("div",{}),!L&&m("button",{type:"button",onClick:P,className:"flex items-center gap-1.5 px-4 py-2 rounded-lg bg-ink text-paper text-xs font-medium hover:bg-ink/90 transition-colors shadow-xs cursor-pointer",children:[_?m(Vt,{size:14}):m(hp,{size:14}),m("span",{children:_?"Saved":t?"Create Skill":"Save Changes"})]})]})]})}var srn=D(()=>{Xe();dt();de()});function lrn({onNavigateToCatalog:e}){let t=ip(),n=_L(),[r,a]=ne(OT),[i,o]=ne(!1),s=n.queryFor(r),l=n.isWorkspace(r),{items:u,selectedId:d,selected:p,isCreatingNew:h,isLoading:f,select:g,startCreate:b,save:y,remove:v}=Y4({endpoint:"/api/settings/skills",query:s,listKey:"skills",bodyKey:"skill",messages:{load:"Failed to load skills from API:",save:"Failed to save skill via API:",delete:"Failed to delete skill via API:"},cacheKey:"command",fallbackToFirst:!1,buildBody:(k)=>({skill:k,...n.scopeBodyFor(r)}),buildDeleteQuery:(k)=>`?id=${encodeURIComponent(k)}&${s.slice(1)}`,buildNew:(k)=>({id:`skill-${Date.now()}`,name:k.name||"new-skill",description:k.description||"",location:k.location||(l?"project":"user"),locationLabel:k.locationLabel||(l?"Project / .omp/skills":"User / omp agent"),instructions:k.instructions||"",hidden:k.hidden===!0,project:"omp"}),buildUpdate:(k,C,_)=>({...C||{id:_||`skill-${Date.now()}`},...k}),isDeleteError:(k)=>Boolean(k?.error)}),x=()=>{o(!0),fetch("/api/settings/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"reload",...n.scopeBodyFor(r)})}).catch((k)=>console.error("Failed to reload plugins:",k)).finally(()=>o(!1))};if(f)return m(ch,{children:"Loading skills…"});return m("div",{className:"flex-1 flex flex-col h-full w-full overflow-hidden bg-paper",children:m(op,{pane:t.pane,onBack:t.back,listLabel:"Skills",list:m(arn,{skills:u,selectedSkillId:d,isCreatingNew:h,onSelectSkill:(k)=>{g(k),t.openDetail()},onAddNewSkill:()=>{b(),t.openDetail()},selectedProject:r,onSelectProject:a,projectOptions:n.options}),detail:m(orn,{skill:p??null,isCreatingNew:h,onSave:y,onDelete:v,onOpenCatalog:e,onReload:x,isReloading:i,projectScopeDisabled:!l,defaultLocation:l?"project":"user"})})})}var crn=D(()=>{Xe();irn();srn();V4();ij();U2();G2();jie();de()});function wL(e){return`${e.id}::${e.scope}`}function urn({plugins:e,marketplaces:t,catalogCount:n,view:r,onSelectView:a,selectedPluginKey:i,onSelectPlugin:o,selectedProject:s,onSelectProject:l,projectOptions:u,isWorkspaceScope:d,busy:p,error:h,onClearError:f,onInstall:g,onRefresh:b}){let[y,v]=ne(""),x=e.filter((k)=>k.enabled).length;return m("div",{className:"w-full md:w-72 md:border-r border-ink/10 h-full flex flex-col bg-paper/50 flex-shrink-0",children:[m(K4,{variant:"compact",selectedProject:s,onChangeProject:l,...u?{options:u}:{},getTriggerLabel:(k,C)=>k.find((_)=>_.id===C||_.value===C)?.label||C}),m("div",{className:"px-3 pt-2.5",children:m("div",{className:"flex items-center gap-1 p-0.5 rounded-lg bg-ink/5 border border-ink/10",children:[{id:"installed",label:"Installed",count:e.length},{id:"marketplaces",label:"Marketplaces",count:t.length}].map((k)=>m("button",{type:"button",onClick:()=>a(k.id),"aria-pressed":r===k.id,className:`flex-1 flex items-center justify-center gap-1 px-2 py-1 rounded-md text-[11px] font-medium transition-colors cursor-pointer ${r===k.id?"bg-paper text-ink shadow-2xs":"text-ink/60 hover:text-ink"}`,children:[m("span",{className:"truncate",children:k.label}),m("span",{className:"font-mono text-[10px] text-ink/50",children:k.count})]},k.id))})}),m("div",{className:"px-3.5 py-2.5 flex items-center justify-between",children:[m("span",{className:"text-xs font-semibold text-ink",children:r==="installed"?`${x}/${e.length} enabled`:`${n} available`}),m("button",{type:"button",onClick:b,title:"Re-read omp's plugin registries",className:"p-1 rounded-md text-ink/60 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:m(In,{size:14,className:p?"animate-spin":void 0})})]}),r==="installed"&&m("form",{className:"px-3 pb-2.5",onSubmit:(k)=>{k.preventDefault();let C=y.trim();if(!C)return;g(C),v("")},children:[m("div",{className:"flex items-center gap-1.5",children:[m("input",{type:"text",value:y,onInput:(k)=>v(k.currentTarget.value),placeholder:"name@marketplace, npm, git, or ./path",spellcheck:!1,className:"flex-1 min-w-0 px-2.5 py-1.5 rounded-lg border border-ink/15 bg-paper focus:outline-none focus:border-ink/40 text-[11px] font-mono text-ink placeholder-ink/40 transition-colors"}),m("button",{type:"submit",disabled:!y.trim()||p!==null,title:d?"Install into this workspace":"Install for all projects",className:"p-1.5 rounded-lg border border-ink/20 text-ink/70 hover:text-ink hover:border-ink/40 transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",children:m(S5,{size:14})})]}),m("p",{className:"mt-1 text-[10px] text-ink/45 leading-snug",children:d?"Installs into this workspace (.omp/plugins)":"Installs for all projects (~/.omp/plugins)"})]}),p&&m("div",{className:"mx-3 mb-2 px-2.5 py-1.5 rounded-lg border border-ink/15 bg-ink/5 text-[11px] text-ink/70 truncate",children:[p,"…"]}),h&&m("div",{className:"mx-3 mb-2 flex items-start gap-1.5 px-2.5 py-1.5 rounded-lg border border-error/30 bg-error/5 text-[11px] text-error leading-snug",children:[m(Kn,{size:13,className:"mt-0.5 flex-shrink-0"}),m("span",{className:"flex-1 break-words",children:h}),m("button",{type:"button",onClick:f,"aria-label":"Dismiss",className:"cursor-pointer",children:m(gn,{size:12})})]}),m("div",{className:"flex-1 scrollbar-overlay-container p-1.5 space-y-0.5",children:r==="marketplaces"?m(tqr,{marketplaces:t}):e.length===0?m("p",{className:"px-2.5 py-6 text-[11px] text-ink/50 leading-relaxed text-center",children:"No plugins installed in this scope. Install one above, or browse a marketplace."}):e.map((k)=>m(nqr,{plugin:k,isSelected:wL(k)===i,onSelect:()=>o(wL(k))},wL(k)))})]})}function tqr({marketplaces:e}){if(e.length===0)return m("p",{className:"px-2.5 py-6 text-[11px] text-ink/50 leading-relaxed text-center",children:"No marketplaces configured. Add one from the marketplace pane."});return m(bt,{children:e.map((t)=>m("div",{className:"px-2.5 py-2 rounded-lg text-xs",children:[m("div",{className:"flex items-center gap-1.5 min-w-0",children:[m(Ik,{size:13,className:"text-ink/50 flex-shrink-0"}),m("span",{className:"truncate font-medium text-ink",children:t.name})]}),m("p",{className:"mt-0.5 pl-5 text-[10px] font-mono text-ink/50 truncate",children:t.sourceUri}),m("p",{className:"pl-5 text-[10px] text-ink/45",children:t.error?m("span",{className:"text-error",children:t.error}):`${t.pluginCount??0} plugins`})]},t.name))})}function nqr({plugin:e,isSelected:t,onSelect:n}){return m("button",{type:"button",onClick:n,className:`w-full text-left px-2.5 py-2 rounded-lg transition-colors cursor-pointer ${t?"bg-ink/10 text-ink shadow-2xs":"text-ink/80 hover:bg-ink/5 hover:text-ink"}`,children:[m("div",{className:"flex items-center justify-between gap-1.5",children:[m("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.kind==="marketplace"?m(Ik,{size:13,className:"text-ink/50 flex-shrink-0"}):m(F5,{size:13,className:"text-ink/50 flex-shrink-0"}),m("span",{className:"truncate text-xs font-medium",children:e.name}),e.enabled&&m(Vt,{size:11,className:"text-success flex-shrink-0"})]}),m("span",{className:"text-[10px] font-mono text-ink/45 flex-shrink-0",children:e.version||"—"})]}),m("div",{className:"flex items-center gap-1.5 mt-0.5 pl-[19px]",children:[m("span",{className:"text-[10px] font-mono uppercase text-ink/50",children:e.scope}),e.shadowedBy&&m("span",{className:"text-[10px] text-ink/45",children:"shadowed"}),e.updateAvailable&&m("span",{className:"text-[10px] px-1 rounded bg-amber-500/15 text-amber-900 border border-amber-500/20",children:e.updateAvailable}),!e.enabled&&m("span",{className:"text-[10px] text-ink/45",children:"disabled"})]})]})}var drn=D(()=>{Xe();dt();aj();de()});function prn({plugin:e,disabled:t,onSave:n,onDelete:r}){return m("section",{className:"space-y-2 pt-2 border-t border-ink/10",children:[m("div",{children:[m("h3",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:"Settings"}),m("p",{className:"text-[11px] text-ink/50 mt-0.5",children:"Stored in omp-plugins.lock.json and read by the plugin at load time."})]}),m("div",{className:"rounded-lg border border-ink/10 divide-y divide-ink/5",children:e.settings.map((a)=>m(rqr,{spec:a,plugin:e,disabled:t,onSave:n,onDelete:r},a.key))})]})}function rqr({spec:e,plugin:t,disabled:n,onSave:r,onDelete:a}){let i=t.settingValues?.[e.key],o=t.secretSet?.includes(e.key)===!0,s=aqr(e,i,o),[l,u]=ne(s),[d,p]=ne(!0);Ae(()=>u(s),[s]);let h=i!==void 0||o,f=l!==s;return m("div",{className:"px-3 py-2",children:[m("div",{className:"flex items-start gap-2",children:[m("button",{type:"button",onClick:()=>p((g)=>!g),"aria-expanded":d,"aria-label":d?`Collapse ${e.key}`:`Expand ${e.key}`,className:"mt-0.5 p-0.5 rounded text-ink/40 hover:text-ink cursor-pointer",children:d?m(Gn,{size:13}):m(yi,{size:13})}),m("div",{className:"flex-1 min-w-0",children:[m("div",{className:"flex items-center gap-1.5",children:[m("span",{className:"text-xs font-medium text-ink font-mono truncate",children:e.key}),m("span",{className:"text-[10px] font-mono text-ink/40",children:e.type}),e.secret&&m($5,{size:11,className:"text-ink/40"}),h&&m(Vt,{size:11,className:"text-success"})]}),e.description&&m("p",{className:"text-[11px] text-ink/60 leading-snug mt-0.5",children:e.description})]})]}),d&&m("div",{className:"mt-2 pl-6 space-y-1.5",children:[m(iqr,{spec:e,value:l,isSecretSet:o,disabled:n,onChange:u}),m("div",{className:"flex items-center gap-2 flex-wrap",children:[m("button",{type:"button",disabled:n||!f,onClick:()=>r(t,e.key,l),className:"px-2.5 py-1 rounded-md bg-ink text-paper text-[11px] font-medium hover:bg-ink/90 transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",children:"Save"}),h&&m("button",{type:"button",disabled:n,onClick:()=>a(t,e.key),title:"Remove the stored value; omp falls back to its default",className:"px-2.5 py-1 rounded-md border border-ink/20 text-[11px] text-ink/70 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer disabled:opacity-40",children:"Clear"}),e.env&&m("span",{className:"text-[10px] font-mono text-ink/40",children:["env: ",e.env]}),e.min!==void 0&&e.max!==void 0&&m("span",{className:"text-[10px] text-ink/40",children:[e.min,"–",e.max]})]}),o&&m("p",{className:"text-[10px] text-ink/45 leading-snug",children:"A value is stored. omp holds it on disk and never returns it, so it can be replaced or cleared but not shown."})]})]})}function aqr(e,t,n){if(e.secret&&n)return"";if(t!==void 0&&t!==null)return String(t);return e.default===void 0?"":String(e.default)}function iqr({spec:e,value:t,isSecretSet:n,disabled:r,onChange:a}){if(e.type==="boolean")return m("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[m("input",{type:"checkbox",checked:t==="true",disabled:r,onChange:(o)=>a(o.currentTarget.checked?"true":"false"),className:"accent-ink cursor-pointer"}),m("span",{className:"text-[11px] text-ink/70",children:t==="true"?"true":"false"})]});if(e.type==="enum"&&e.values?.length)return m("select",{value:t,disabled:r,onChange:(o)=>a(o.currentTarget.value),className:"w-full px-2.5 py-1.5 rounded-lg border border-ink/15 bg-paper focus:outline-none focus:border-ink/40 text-[11px] text-ink transition-colors disabled:opacity-60 cursor-pointer",children:[!e.values.includes(t)&&m("option",{value:t,children:t||"(unset)"}),e.values.map((o)=>m("option",{value:o,children:o},o))]});return m("input",{type:e.type==="number"?"number":e.secret?"password":"text",value:t,disabled:r,spellcheck:!1,placeholder:e.secret&&n?"stored — type a new value to replace":void 0,onInput:(o)=>a(o.currentTarget.value),className:"w-full px-2.5 py-1.5 rounded-lg border border-ink/15 bg-paper focus:outline-none focus:border-ink/40 text-[11px] text-ink transition-colors disabled:opacity-60 font-mono"})}var mrn=D(()=>{Xe();dt();de()});function hrn({plugin:e,busy:t,onToggleEnabled:n,onUpgrade:r,onUninstall:a,onSaveFeatures:i,onSaveSetting:o,onDeleteSetting:s}){let[l,u]=ne(!1);if(Ae(()=>u(!1),[e?.id,e?.scope]),!e)return m("div",{className:"flex-1 flex flex-col h-full items-center justify-center px-8 text-center bg-paper",children:m("p",{className:"text-xs text-ink/50 leading-relaxed max-w-sm",children:["Select a plugin to see its manifest, features and settings. Plugins are installed through"," ",m("span",{className:"font-mono text-ink/70",children:"omp plugin"}),", so omp loads exactly what this panel lists."]})});let d=t!==null,p=e.scope==="project"?"this workspace":"all projects";return m("div",{className:"flex-1 flex flex-col h-full scrollbar-overlay-container bg-paper text-ink p-6 md:p-8 space-y-6",children:[m("div",{className:"flex items-start justify-between gap-4 pb-4 border-b border-ink/10",children:[m("div",{className:"min-w-0",children:[m("h2",{className:"text-sm font-bold tracking-tight text-ink truncate",children:e.name}),m("p",{className:"text-xs text-ink/60 mt-0.5 truncate",children:[e.version||"no version"," · ",e.scope==="project"?"project scope":"user scope",e.marketplace?` · ${e.marketplace}`:""]}),e.description&&m("p",{className:"text-xs text-ink/70 mt-2 leading-relaxed",children:e.description}),e.homepage&&m("a",{href:e.homepage,target:"_blank",rel:"noreferrer noopener",className:"mt-1 inline-flex items-center gap-1 text-[11px] text-ink/60 hover:text-ink underline decoration-ink/30",children:[m(po,{size:11})," ",e.homepage]})]}),m("div",{className:"flex items-center gap-2 flex-shrink-0",children:[m("button",{type:"button",disabled:d,"aria-pressed":e.enabled,onClick:()=>n(e,!e.enabled),className:`px-3 py-1.5 rounded-lg border text-xs font-medium transition-colors cursor-pointer disabled:opacity-50 ${e.enabled?"border-ink/20 text-ink/70 hover:bg-ink/5":"border-ink bg-ink text-paper hover:bg-ink/90"}`,children:e.enabled?"Disable":"Enable"}),e.updateAvailable&&m("button",{type:"button",disabled:d,onClick:()=>r(e),className:"px-3 py-1.5 rounded-lg border border-amber-500/40 text-xs font-medium text-ink hover:bg-amber-500/10 transition-colors cursor-pointer disabled:opacity-50",children:["Upgrade to ",e.updateAvailable]})]})]}),e.shadowedBy==="project"&&m("div",{className:"rounded-lg border border-ink/15 bg-ink/5 px-3 py-2 text-[11px] text-ink/70 leading-relaxed",children:"A project install of this plugin in this workspace takes precedence, so this user copy is not the one loading right now. Disabling or removing it leaves the project copy in place."}),e.installPath&&m("section",{className:"space-y-1",children:[m("h3",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:"Install location"}),m("p",{className:"text-[11px] font-mono text-ink/70 break-all",children:e.installPath})]}),e.features.length>0?m(oqr,{features:e.features,selected:e.enabledFeatures,disabled:d,note:e.featuresNote,onSave:(h)=>i(e,h)}):m("section",{className:"space-y-1",children:[m("h3",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:"Features"}),m("p",{className:"text-[11px] text-ink/50 leading-relaxed",children:"This plugin declares no optional features. It loads its whole content (skills, commands, hooks, MCP servers) whenever it is enabled."})]}),e.settings.length>0&&m(prn,{plugin:e,disabled:d,onSave:o,onDelete:s}),m("div",{className:"pt-4 border-t border-ink/10 flex items-center justify-between gap-3",children:[m("p",{className:"text-[11px] text-ink/50 leading-snug max-w-sm",children:["Uninstalling removes the plugin and its stored settings from ",p,"."]}),l?m("div",{className:"flex items-center gap-2 flex-shrink-0",children:[m("button",{type:"button",disabled:d,onClick:()=>a(e),className:"px-3.5 py-2 rounded-lg border border-error text-error text-xs font-medium hover:bg-error/5 transition-colors cursor-pointer disabled:opacity-50",children:"Confirm remove"}),m("button",{type:"button",onClick:()=>u(!1),className:"px-3 py-2 rounded-lg text-xs text-ink/60 hover:text-ink cursor-pointer",children:"Cancel"})]}):m("button",{type:"button",onClick:()=>u(!0),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-lg border border-ink/20 hover:border-error hover:text-error text-ink/70 text-xs font-medium transition-colors cursor-pointer flex-shrink-0",children:[m(xr,{size:14}),m("span",{children:"Uninstall"})]})]})]})}function oqr({features:e,selected:t,disabled:n,note:r,onSave:a}){let i=t??e.filter((u)=>u.isDefault).map((u)=>u.name),[o,s]=ne(i);Ae(()=>s(i),[t,e]);let l=o.length!==i.length||o.some((u)=>!i.includes(u));return m("section",{className:"space-y-2 pt-2 border-t border-ink/10",children:[m("div",{className:"flex items-center justify-between gap-3",children:[m("div",{children:[m("h3",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:"Features"}),m("p",{className:"text-[11px] text-ink/50 mt-0.5",children:t===null?"Using omp’s defaults (the features marked default).":"Explicit selection stored in omp-plugins.lock.json."})]}),!r&&m("div",{className:"flex items-center gap-2",children:[t!==null&&m("button",{type:"button",disabled:n,onClick:()=>a([]),title:"Clear the explicit selection so omp uses its defaults",className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-ink/20 text-[11px] text-ink/70 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer disabled:opacity-50",children:[m(nu,{size:12})," Defaults"]}),m("button",{type:"button",disabled:n||!l,onClick:()=>a(o),className:"px-3 py-1.5 rounded-lg bg-ink text-paper text-[11px] font-medium hover:bg-ink/90 transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",children:"Save features"})]})]}),r&&m("div",{className:"rounded-lg border border-ink/15 bg-ink/5 px-3 py-2 text-[11px] text-ink/70 leading-relaxed",children:r}),m("div",{className:"rounded-lg border border-ink/10 divide-y divide-ink/5",children:e.map((u)=>m("label",{className:`flex items-start gap-2 px-3 py-2 select-none ${r?"":"cursor-pointer"}`,children:[m("input",{type:"checkbox",checked:o.includes(u.name),disabled:n||Boolean(r),onChange:(d)=>s((p)=>d.currentTarget.checked?[...p,u.name]:p.filter((h)=>h!==u.name)),className:"mt-0.5 accent-ink cursor-pointer disabled:opacity-60"}),m("span",{className:"min-w-0",children:[m("span",{className:"text-xs font-medium text-ink font-mono",children:u.name}),u.isDefault&&m("span",{className:"ml-1.5 text-[10px] text-ink/45",children:"default"}),u.description&&m("span",{className:"block text-[11px] text-ink/60 leading-snug",children:u.description})]})]},u.name))})]})}var frn=D(()=>{Xe();dt();mrn();de()});function grn({marketplaces:e,catalog:t,plugins:n,busy:r,error:a,onClearError:i,workspace:o,run:s}){let[l,u]=ne(""),[d,p]=ne(""),[h,f]=ne(""),[g,b]=ne(null),y=r!==null,v=st(()=>new Set(n.map((k)=>k.id)),[n]),x=st(()=>{let k=d.trim().toLowerCase();return t.filter((C)=>{if(h&&C.marketplace!==h)return!1;if(!k)return!0;return C.name.toLowerCase().includes(k)||C.description.toLowerCase().includes(k)||(C.category??"").toLowerCase().includes(k)})},[t,h,d]);return m("div",{className:"flex-1 flex flex-col h-full scrollbar-overlay-container bg-paper text-ink p-6 md:p-8 space-y-6",children:[m("div",{className:"pb-4 border-b border-ink/10",children:[m("h2",{className:"text-sm font-bold tracking-tight text-ink",children:"Marketplaces"}),m("p",{className:"text-xs text-ink/60 mt-0.5 leading-relaxed",children:["A marketplace is a git repository (or local directory) publishing a catalog at"," ",m("span",{className:"font-mono text-ink/70",children:".omp-plugin/marketplace.json"}),". Adding one clones it and lets its plugins install by ",m("span",{className:"font-mono text-ink/70",children:"name@marketplace"}),"."]})]}),a&&m("div",{className:"flex items-start gap-1.5 px-3 py-2 rounded-lg border border-error/30 bg-error/5 text-[11px] text-error leading-snug",children:[m(Kn,{size:13,className:"mt-0.5 flex-shrink-0"}),m("span",{className:"flex-1 break-words",children:a}),m("button",{type:"button",onClick:i,"aria-label":"Dismiss",className:"cursor-pointer",children:m(gn,{size:12})})]}),m("form",{className:"flex items-center gap-2",onSubmit:(k)=>{k.preventDefault();let C=l.trim();if(!C)return;s(`Adding ${C}`,{type:"add_marketplace",source:C}),u("")},children:[m("input",{type:"text",value:l,onInput:(k)=>u(k.currentTarget.value),placeholder:"owner/repo, https://…, git@…, or ./path",spellcheck:!1,className:"flex-1 min-w-0 px-3 py-2 rounded-lg border border-ink/15 bg-paper focus:outline-none focus:border-ink/40 text-xs font-mono text-ink placeholder-ink/40 transition-colors"}),m("button",{type:"submit",disabled:!l.trim()||y,className:"flex items-center gap-1.5 px-3.5 py-2 rounded-lg bg-ink text-paper text-xs font-medium hover:bg-ink/90 transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",children:[m(kr,{size:14})," Add"]})]}),m("section",{className:"space-y-2",children:[m("h3",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:"Configured"}),e.length===0?m("p",{className:"text-[11px] text-ink/50 leading-relaxed",children:["No marketplaces configured. Add one above — for example"," ",m("span",{className:"font-mono text-ink/70",children:"anthropics/claude-plugins-official"}),", which omp itself documents as the starting catalog."]}):m("div",{className:"rounded-lg border border-ink/10 divide-y divide-ink/5",children:e.map((k)=>m("div",{className:"flex items-center gap-3 px-3 py-2.5",children:[m("div",{className:"min-w-0 flex-1",children:[m("div",{className:"flex items-center gap-1.5",children:[m("span",{className:"text-xs font-medium text-ink truncate",children:k.name}),m("span",{className:"text-[10px] font-mono uppercase text-ink/45",children:k.sourceType})]}),m("p",{className:"text-[11px] font-mono text-ink/50 truncate",children:k.sourceUri}),m("p",{className:"text-[10px] text-ink/45",children:k.error?m("span",{className:"text-error",children:k.error}):`${k.pluginCount??0} plugins · updated ${lqr(k.updatedAt)}`})]}),m("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[m("button",{type:"button",disabled:y,onClick:()=>void s(`Updating ${k.name}`,{type:"update_marketplace",name:k.name}),title:"Re-fetch this catalog",className:"p-1.5 rounded-lg border border-ink/20 text-ink/60 hover:text-ink hover:border-ink/40 transition-colors cursor-pointer disabled:opacity-40",children:m(In,{size:13})}),g===k.name?m(bt,{children:[m("button",{type:"button",disabled:y,onClick:()=>{s(`Removing ${k.name}`,{type:"remove_marketplace",name:k.name}),b(null)},className:"px-2 py-1 rounded-lg border border-error text-error text-[11px] font-medium hover:bg-error/5 transition-colors cursor-pointer disabled:opacity-40",children:"Confirm"}),m("button",{type:"button",onClick:()=>b(null),className:"px-1.5 py-1 rounded-lg text-[11px] text-ink/60 hover:text-ink cursor-pointer",children:"Cancel"})]}):m("button",{type:"button",disabled:y,onClick:()=>b(k.name),title:"Remove this marketplace (installed plugins stay)",className:"p-1.5 rounded-lg border border-ink/20 text-ink/60 hover:border-error hover:text-error transition-colors cursor-pointer disabled:opacity-40",children:m(xr,{size:13})})]})]},k.name))})]}),t.length>0&&m("section",{className:"space-y-2",children:[m("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[m("h3",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:["Available plugins",m("span",{className:"ml-1.5 font-mono text-[10px] text-ink/45",children:[x.length,"/",t.length]})]}),m("div",{className:"flex items-center gap-2",children:[m("select",{value:h,onChange:(k)=>f(k.currentTarget.value),className:"px-2 py-1 rounded-lg border border-ink/15 bg-paper text-[11px] text-ink cursor-pointer focus:outline-none focus:border-ink/40",children:[m("option",{value:"",children:"All marketplaces"}),e.map((k)=>m("option",{value:k.name,children:k.name},k.name))]}),m("div",{className:"relative flex items-center",children:[m(na,{size:12,className:"absolute left-2 text-ink/40 pointer-events-none"}),m("input",{type:"text",value:d,onInput:(k)=>p(k.currentTarget.value),placeholder:"Filter",className:"w-40 pl-6 pr-2 py-1 rounded-lg border border-ink/15 bg-paper text-[11px] text-ink placeholder-ink/40 focus:outline-none focus:border-ink/40"})]})]})]}),m("div",{className:"rounded-lg border border-ink/10 divide-y divide-ink/5 max-h-[420px] overflow-y-auto scrollbar-overlay-container",children:x.length===0?m("p",{className:"px-3 py-6 text-[11px] text-ink/50 text-center",children:"No plugin matches this filter."}):x.map((k)=>m(sqr,{item:k,installed:v.has(`${k.name}@${k.marketplace}`),disabled:y,workspace:o,run:s},`${k.marketplace}::${k.name}`))})]})]})}function sqr({item:e,installed:t,disabled:n,workspace:r,run:a}){let i=`${e.name}@${e.marketplace}`;return m("div",{className:"flex items-start gap-3 px-3 py-2.5",children:[m("div",{className:"min-w-0 flex-1",children:[m("div",{className:"flex items-center gap-1.5",children:[m("span",{className:"text-xs font-medium text-ink font-mono truncate",children:e.name}),e.category&&m("span",{className:"text-[10px] px-1 rounded bg-ink/5 text-ink/50 border border-ink/10",children:e.category}),e.version&&m("span",{className:"text-[10px] font-mono text-ink/45",children:e.version})]}),m("p",{className:"text-[11px] text-ink/60 leading-snug mt-0.5 line-clamp-2",children:e.description}),m("p",{className:"text-[10px] font-mono text-ink/40",children:e.marketplace})]}),t?m("span",{className:"text-[10px] text-ink/45 flex-shrink-0 mt-0.5",children:"installed"}):m("button",{type:"button",disabled:n,onClick:()=>void a(`Installing ${i}`,{type:"install",spec:i,...r?{root:r}:{scope:"user"}}),className:"flex items-center gap-1 px-2.5 py-1 rounded-lg border border-ink/20 text-[11px] text-ink/70 hover:text-ink hover:border-ink/40 transition-colors cursor-pointer flex-shrink-0 disabled:opacity-40",children:[m(ki,{size:12})," Install"]})]})}function lqr(e){if(!e)return"unknown";let t=new Date(e);if(Number.isNaN(t.getTime()))return"unknown";return t.toLocaleDateString()}var brn=D(()=>{Xe();dt();de()});function yrn(e){let[t,n]=ne({plugins:[],marketplaces:[],catalog:[]}),[r,a]=ne(!0),[i,o]=ne(null),[s,l]=ne(null),u=Se(async()=>{try{let f=await(await fetch(`/api/settings/plugins${e}`)).json();if(n({plugins:Array.isArray(f?.plugins)?f.plugins:[],marketplaces:Array.isArray(f?.marketplaces)?f.marketplaces:[],catalog:Array.isArray(f?.catalog)?f.catalog:[]}),f?.error)l(String(f.error))}catch(h){l(h instanceof Error?h.message:String(h))}finally{a(!1)}},[e]);Ae(()=>{a(!0),u().catch(console.error)},[u]);let d=Se(async(h,f)=>{o(h),l(null);try{let g=await fetch(`/api/settings/plugins${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(f)}),b=await g.json();if(!b?.success)return l(typeof b?.error==="string"?b.error:`Request failed (${g.status})`),!1;if(Array.isArray(b.plugins))n({plugins:b.plugins,marketplaces:Array.isArray(b.marketplaces)?b.marketplaces:[],catalog:Array.isArray(b.catalog)?b.catalog:[]});return!0}catch(g){return l(g instanceof Error?g.message:String(g)),!1}finally{o(null)}},[e]),p=Se(()=>l(null),[]);return{...t,isLoading:r,busy:i,error:s,refresh:u,run:d,clearError:p}}function vrn(e,t){if(e.kind!=="marketplace")return{};if(e.scope==="project"&&t)return{scope:"project",root:t};return{scope:"user"}}var xrn=D(()=>{Xe()});function krn(){let e=ip(),t=_L(),[n,r]=ne(OT),[a,i]=ne("installed"),[o,s]=ne(null),l=t.rootFor(n),u=yrn(t.queryFor(n)),d=u.plugins.find((h)=>wL(h)===o)??null;if(u.isLoading)return m(ch,{children:"Loading plugins…"});let p=(h)=>vrn(h,l);return m("div",{className:"flex-1 flex flex-col h-full w-full overflow-hidden bg-paper",children:m(op,{pane:e.pane,onBack:e.back,listLabel:"Plugins",list:m(urn,{plugins:u.plugins,marketplaces:u.marketplaces,catalogCount:u.catalog.length,view:a,onSelectView:(h)=>{i(h),e.openDetail()},selectedPluginKey:o,onSelectPlugin:(h)=>{s(h),e.openDetail()},selectedProject:n,onSelectProject:(h)=>{r(h),s(null)},projectOptions:t.options,isWorkspaceScope:l!==null,busy:u.busy,error:u.error,onClearError:u.clearError,onInstall:(h)=>{u.run(`Installing ${h}`,{type:"install",spec:h,...Uie(l)})},onRefresh:()=>void u.refresh()}),detail:a==="marketplaces"?m(grn,{marketplaces:u.marketplaces,catalog:u.catalog,plugins:u.plugins,busy:u.busy,error:u.error,onClearError:u.clearError,workspace:l,run:u.run}):m(hrn,{plugin:d,busy:u.busy,onToggleEnabled:(h,f)=>{u.run(`${f?"Enabling":"Disabling"} ${h.name}`,{type:"set_enabled",id:h.id,enabled:f,...p(h)})},onUpgrade:(h)=>{u.run(`Upgrading ${h.name}`,{type:"upgrade",id:h.id,...p(h)})},onUninstall:(h)=>{u.run(`Uninstalling ${h.name}`,{type:"uninstall",id:h.id,...p(h)})},onSaveFeatures:(h,f)=>{u.run(`Saving features for ${h.name}`,{type:"set_features",packageName:h.packageName,pluginScope:h.scope,features:f,...Uie(l)})},onSaveSetting:(h,f,g)=>{u.run(`Saving ${f}`,{type:"set_setting",packageName:h.packageName,key:f,value:g,...Uie(l)})},onDeleteSetting:(h,f)=>{u.run(`Clearing ${f}`,{type:"delete_setting",packageName:h.packageName,key:f,...Uie(l)})}})})})}function Uie(e){return e?{root:e}:{scope:"user"}}var _rn=D(()=>{Xe();drn();frn();brn();V4();U2();G2();jie();xrn();de()});function wrn({busy:e,onInstall:t,onClearError:n}){let[r,a]=ne(""),[i,o]=ne(null),s=async(u)=>{u.preventDefault();let d=r.trim();if(!d)return;if(!/^(https?:\/\/\S+|ssh:\/\/\S+|git@[^:/\s]+:\S+|file:\/\/\S+)$/i.test(d)&&!/^[/~]\S*$/.test(d)){o("Expected an https, ssh, git@ or local path.");return}if(o(null),n(),await t(d))a("")},l=i;return m("form",{onSubmit:s,className:"border border-ink/15 rounded p-3 space-y-2",children:[m("div",{className:"flex items-center gap-2",children:[m(ki,{size:14,className:"text-ink/50 flex-shrink-0"}),m("span",{className:"text-xs font-semibold text-ink",children:"Install from a git URL"})]}),m("p",{className:"text-[11px] text-ink/50",children:["A Bun package whose ",m("span",{className:"font-mono",children:"package.json"})," carries a"," ",m("span",{className:"font-mono",children:"kabmo"})," key, or a plain directory with a"," ",m("span",{className:"font-mono",children:"kabmo.json"}),". It is cloned, built, and registered automatically."]}),m("div",{className:"flex items-center gap-2",children:[m("input",{type:"text",value:r,onChange:(u)=>{a(u.currentTarget.value),o(null)},placeholder:"https://github.com/you/my-panel.git",disabled:e,className:"flex-1 bg-paper border border-ink/15 rounded px-2.5 py-1.5 text-xs font-mono text-ink placeholder-ink/35 focus:outline-none focus:border-ink/40 disabled:opacity-50"}),m("button",{type:"submit",disabled:e||!r.trim(),className:"flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded border border-ink/15 hover:bg-ink/5 disabled:opacity-40 disabled:hover:bg-transparent flex-shrink-0",children:[e?m(en,{size:13,className:"animate-spin"}):m(ki,{size:13}),e?"Cloning…":"Install"]})]}),l?m("p",{className:"text-[11px] text-error",children:l}):null]})}function Crn({pluginId:e,disabled:t,onRemove:n}){let[r,a]=ne(!1);if(!r)return m("button",{type:"button",onClick:()=>a(!0),disabled:t,title:`Remove ${e} from disk`,"aria-label":`Remove ${e}`,className:"p-1 rounded text-ink/40 hover:text-error hover:bg-error/10 disabled:opacity-40 flex-shrink-0",children:m(xr,{size:13})});return m("span",{className:"flex items-center gap-1 flex-shrink-0",children:[m("button",{type:"button",onClick:()=>{a(!1),n(e)},className:"px-1.5 py-0.5 text-[10px] rounded bg-error/15 text-error border border-error/30 hover:bg-error/25",children:"Delete files"}),m("button",{type:"button",onClick:()=>a(!1),className:"px-1.5 py-0.5 text-[10px] rounded border border-ink/15 hover:bg-ink/5",children:"Cancel"})]})}var dRe=D(()=>{Xe();dt();de()});function ib({name:e,iconUrl:t,size:n=16,tile:r=!1}){if(t){if(/\.svg$/i.test(t.split("?")[0]))return m("span",{"aria-hidden":"true",className:"inline-block flex-shrink-0",style:{width:n,height:n,backgroundColor:"currentColor",maskImage:`url("${t}")`,maskSize:"contain",maskRepeat:"no-repeat",maskPosition:"center","-webkit-mask-image":`url("${t}")`,"-webkit-mask-size":"contain","-webkit-mask-repeat":"no-repeat","-webkit-mask-position":"center"}});return m("img",{src:t,alt:"","aria-hidden":"true",style:{width:n,height:n},className:"flex-shrink-0 object-contain"})}return m("span",{"aria-hidden":"true",className:`inline-flex flex-shrink-0 items-center justify-center font-semibold lowercase leading-none text-ink/45 ${r?"rounded bg-ink/5":""}`,style:{height:n,minWidth:n,paddingInline:Math.max(1,Math.round(n*0.12)),fontSize:Math.round(n*(r?1.2:0.85))},children:pie(e)})}var CL=D(()=>{mie();de()});function qie({pluginId:e,name:t,readmeUrl:n,onClose:r}){let[a,i]=ne(null),[o,s]=ne(null);return Ae(()=>{let l=!1;return fetch(n,{credentials:"same-origin"}).then(async(u)=>{if(!u.ok){let d=await u.json().catch(()=>null);throw Error(d?.error??`Could not read the README (${u.status})`)}return u.text()}).then((u)=>{if(!l)i(u)},(u)=>{if(!l)s(u instanceof Error?u.message:String(u))}),()=>{l=!0}},[n]),m(Va,{onClose:r,maxWidthClass:"max-w-3xl",header:m("div",{className:"flex items-center gap-2 min-w-0",children:[m(ps,{size:15,className:"text-ink/50 flex-shrink-0"}),m("span",{className:"text-sm font-medium text-ink truncate",children:t}),m("span",{className:"text-[11px] text-ink/45 font-mono truncate",children:e})]}),children:m("div",{className:"px-5 py-4",children:o?m("div",{className:"flex items-start gap-2 text-error",children:[m(pr,{size:14,className:"flex-shrink-0 mt-0.5"}),m("p",{className:"text-xs",children:o})]}):a===null?m("div",{className:"flex items-center gap-2 text-ink/50",children:[m(en,{size:14,className:"animate-spin"}),m("span",{className:"text-xs",children:"Reading README…"})]}):m(vr,{content:a,document:!0,className:"text-xs"})})})}var pRe=D(()=>{Xe();dt();au();Bo();de()});function Srn({entries:e,busy:t,onInstall:n}){let[r,a]=ne(null);if(e.length===0)return null;return m("section",{children:[m("header",{className:"flex items-center gap-2 mb-2",children:[m(Ik,{size:14,className:"text-ink/50 flex-shrink-0"}),m("h3",{className:"text-sm font-medium text-ink",children:"Available from Kabmo"}),m("span",{className:"ml-auto text-[11px] text-ink/50",children:[e.length," plugin",e.length===1?"":"s"]})]}),m("div",{className:"grid gap-3 [grid-template-columns:repeat(auto-fill,minmax(220px,1fr))]",children:e.map((i)=>m("article",{className:"flex flex-col gap-2 border border-ink/10 rounded-lg p-3 bg-paper hover:border-ink/20 transition-colors",children:[m("div",{className:"flex items-start gap-2.5",children:[m(ib,{name:i.name,iconUrl:i.iconUrl}),m("div",{className:"min-w-0 flex-1",children:[m("div",{className:"text-xs font-medium text-ink truncate",title:i.name,children:i.name}),m("div",{className:"text-[11px] text-ink/45 font-mono truncate",title:i.pluginId,children:i.pluginId})]}),m("span",{className:"text-[10px] text-ink/40 font-mono flex-shrink-0",children:["v",i.version]})]}),i.description?m("p",{className:"text-[11px] text-ink/60 leading-relaxed line-clamp-3",children:i.description}):null,m("div",{className:"mt-auto flex items-center gap-1.5",children:[i.readmeUrl?m("button",{type:"button",onClick:()=>a(i),title:`Read ${i.name}'s README`,"aria-label":`Read ${i.name}'s README`,className:"flex items-center gap-1.5 px-2.5 py-1.5 text-[11px] rounded border border-ink/15 hover:bg-ink/5 text-ink/70",children:[m(ps,{size:12}),"README"]}):null,m("button",{type:"button",onClick:()=>void n(i.pluginId),disabled:t!==null,className:"flex-1 flex items-center justify-center gap-1.5 px-2.5 py-1.5 text-[11px] rounded border border-ink/15 hover:bg-ink/5 disabled:opacity-40",children:[t===`install:${i.pluginId}`?m(en,{size:12,className:"animate-spin"}):m(ki,{size:12}),"Install"]})]})]},i.pluginId))}),r?.readmeUrl?m(qie,{pluginId:r.pluginId,name:r.name,readmeUrl:r.readmeUrl,onClose:()=>a(null)}):null]})}var Trn=D(()=>{Xe();dt();CL();pRe();de()});function mRe(e){return e?e.slice(0,7):"?"}function Ern({status:e,origin:t,busy:n,pluginId:r,onUpdate:a}){let i=n===`update_git:${r}`;if(!e)return m("p",{className:"text-[10px] text-ink/40 font-mono truncate",title:t,children:["git · ",t," · not checked"]});if(e.error)return m("p",{className:"text-[10px] text-warning truncate",title:`${t} — ${e.error}`,children:["git · could not reach ",t]});if(!e.updateAvailable)return m("p",{className:"text-[10px] text-ink/40 font-mono truncate",title:`${t} @ ${e.current??"?"}`,children:["git · ",mRe(e.current)," · up to date"]});return m("div",{className:"flex items-center gap-1.5",children:[m("span",{className:"text-[10px] text-ink/50 font-mono truncate",title:`${t}
4999
- ${e.current} → ${e.latest}`,children:[mRe(e.current)," → ",mRe(e.latest)]}),m("button",{type:"button",onClick:()=>void a(r),disabled:n!==null,title:`Update from ${t} — fetches the remote's commit and rebuilds the plugin`,className:"ml-auto flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded border border-ink/25 text-ink hover:bg-ink/5 disabled:opacity-40 flex-shrink-0",children:[i?m(en,{size:11,className:"animate-spin"}):m(S5,{size:11}),"Update"]})]})}var Arn=D(()=>{dt();de()});function Lrn({plugins:e,slots:t,failures:n,iconUrls:r,readmeUrls:a,busy:i,onBuild:o,onRemove:s,onSetEnabled:l,gitStatus:u,onUpdateGit:d}){let[p,h]=ne(null);return m("section",{children:[m("header",{className:"flex items-center gap-2 mb-2",children:[m("h3",{className:"text-sm font-medium text-ink",children:"Installed"}),m("span",{className:"ml-auto text-[11px] text-ink/50",children:[e.length," plugin",e.length===1?"":"s"]})]}),m("div",{className:"grid gap-3 [grid-template-columns:repeat(auto-fill,minmax(240px,1fr))]",children:e.map((f)=>{let g=t.get(f.pluginId),b=n.get(f.pluginId),y=ik(f.pluginId),v=i===`enable:${y}`||i===`disable:${y}`,x=g?cqr.filter((k)=>g.components[k]):[];return m("article",{className:`flex flex-col gap-2 border rounded-lg p-3 transition-colors ${f.enabled?"border-ink/10 bg-paper":"border-ink/10 bg-ink/[0.02]"}`,children:[m("div",{className:"flex items-start gap-2.5",children:[m("div",{className:f.enabled?"":"opacity-50",children:m(ib,{name:f.name,iconUrl:r.get(f.pluginId)})}),m("div",{className:"min-w-0 flex-1",children:[m("div",{className:"text-xs font-medium text-ink truncate",title:f.name,children:f.name}),m("div",{className:"text-[11px] text-ink/45 font-mono truncate",title:f.pluginId,children:f.pluginId})]}),m("button",{type:"button",role:"switch","aria-checked":f.enabled,"aria-label":`${f.enabled?"Disable":"Enable"} ${f.name}`,disabled:i!==null,onClick:()=>void l(y,!f.enabled),title:f.enabled?"Disable — keep the files, remove its buttons":"Enable this plugin",className:`relative w-8 h-4 rounded-full transition-colors flex-shrink-0 mt-0.5 disabled:opacity-40 ${f.enabled?"bg-ink/70":"bg-ink/20"}`,children:v?m(en,{size:9,className:"absolute inset-0 m-auto animate-spin text-canvas"}):m("span",{className:`absolute top-0.5 w-3 h-3 rounded-full bg-canvas transition-all ${f.enabled?"left-[18px]":"left-0.5"}`})})]}),!f.enabled?m("p",{className:"text-[11px] text-ink/45",children:"Disabled — contributes nothing while the switch is off."}):b?m("p",{className:"text-[11px] text-error",children:["Bundle failed to load — ",b]}):!g?m("p",{className:"text-[11px] text-ink/45",children:"Loading bundle…"}):x.length===0?m("p",{className:"text-[11px] text-ink/45",children:"Loaded, but registers no panels."}):m("div",{className:"flex flex-wrap items-center gap-1.5",children:x.map((k)=>m("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-ink/10 text-ink/60",title:g.titles[k]??k,children:k},k))}),m("div",{className:"mt-auto flex items-center gap-1.5 pt-1",children:[f.bundled?m("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-ink/10 text-ink/50",children:"bundled"}):null,!f.built?m("button",{type:"button",onClick:()=>void o(f.pluginId),disabled:i!==null,title:f.reason?`Rebuild — ${f.reason}`:"Rebuild this plugin",className:"flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded border border-warning/40 text-warning hover:bg-warning/10 disabled:opacity-40",children:[i===`build:${f.pluginId}`?m(en,{size:11,className:"animate-spin"}):m(LN,{size:11}),"Rebuild"]}):null,m("span",{className:"ml-auto flex items-center gap-1",children:[a.get(f.pluginId)?m("button",{type:"button",onClick:()=>h(f),title:`Read ${f.name}'s README`,"aria-label":`Read ${f.name}'s README`,className:"p-1 rounded text-ink/40 hover:text-ink hover:bg-ink/5 flex-shrink-0",children:m(ps,{size:13})}):null,m(Crn,{pluginId:f.pluginId,disabled:i!==null,onRemove:s})]})]}),!f.built?m("p",{className:"text-[11px] text-warning",children:["Not built",f.reason?` — ${f.reason}`:"",". The bundle will 404 until it is built."]}):null,f.gitOrigin?m(Ern,{status:u[f.pluginId],origin:f.gitOrigin,busy:i,pluginId:f.pluginId,onUpdate:d}):null]},f.pluginId)})}),p&&a.get(p.pluginId)?m(qie,{pluginId:p.pluginId,name:p.name,readmeUrl:a.get(p.pluginId),onClose:()=>h(null)}):null]})}var cqr;var Rrn=D(()=>{Xe();dt();dRe();CL();pRe();Arn();yb();de();cqr=["rightPanel","panel","headerPanel","settingsSection"]});function Nrn({disabled:e,busy:t,onSetEnabled:n}){let r=new Set(e);return m("section",{children:[m("header",{className:"flex items-center gap-2 mb-2",children:[m("h3",{className:"text-sm font-medium text-ink",children:"Built-in"}),m("span",{className:"ml-auto text-[11px] text-ink/50",children:[F2.length-F2.filter((a)=>r.has(a.id)).length," of"," ",F2.length," on"]})]}),m("p",{className:"text-[11px] text-ink/50 mb-2",children:"The views Kabmo ships. Switch one off to put it away — its code stays in the app, so this is reversible at any time and needs no reinstall."}),m("div",{className:"grid gap-2 [grid-template-columns:repeat(auto-fill,minmax(200px,1fr))]",children:F2.map((a)=>{let i=!r.has(a.id),o=t===`enable:${a.id}`||t===`disable:${a.id}`;return m("div",{className:`flex items-center gap-2.5 border border-ink/10 rounded-lg px-2.5 py-2 transition-colors ${i?"bg-paper":"bg-ink/[0.02]"}`,children:[m("span",{className:i?"text-ink/70 flex-shrink-0":"text-ink/30 flex-shrink-0",children:a.icon}),m("span",{className:"min-w-0 flex-1",children:[m("span",{className:`block text-xs truncate ${i?"text-ink":"text-ink/45"}`,title:a.title,children:a.title}),m("span",{className:"block text-[10px] font-mono text-ink/40 truncate",children:a.id})]}),m("button",{type:"button",role:"switch","aria-checked":i,"aria-label":`${i?"Disable":"Enable"} ${a.title}`,disabled:t!==null,onClick:()=>void n(a.id,!i),title:i?"Switch off — remove its button":"Switch on",className:`relative w-8 h-4 rounded-full transition-colors flex-shrink-0 disabled:opacity-40 ${i?"bg-ink/70":"bg-ink/20"}`,children:o?m(en,{size:9,className:"absolute inset-0 m-auto animate-spin text-canvas"}):m("span",{className:`absolute top-0.5 w-3 h-3 rounded-full bg-canvas transition-all ${i?"left-[18px]":"left-0.5"}`})})]},a.id)})})]})}var Irn=D(()=>{dt();xie();de()});function pqr({name:e,destinations:t,current:n,onMove:r}){if(t.length<2)return null;return m("span",{className:"flex items-center gap-1 flex-shrink-0",children:t.map((a)=>{let i=dqr[a],o=a===n;return m("button",{type:"button",disabled:o,onClick:()=>r(a),title:o?`${e} is on the ${Wie[a]}`:`Move ${e} to the ${Wie[a]}`,"aria-label":o?`${e} is on the ${Wie[a]}`:`Move ${e} to the ${Wie[a]}`,"aria-pressed":o,className:`flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded border flex-shrink-0 transition-colors ${o?"border-ink/30 bg-ink/10 text-ink/50 cursor-default":"border-ink/25 text-ink/80 hover:bg-ink/5 cursor-pointer"}`,children:[m(i,{size:11}),a==="left"?"Left":a==="right"?"Right":"Editor"]},a)})})}function Mrn({dock:e,plugins:t,slots:n}){let r=[];for(let i of t){let o=n.get(i.pluginId);if(!i.enabled||!o)continue;for(let s of["rightPanel","panel"]){if(!o.components[s])continue;let l=bb(i.pluginId,s);r.push({plugin:i,key:l,slot:s,side:Nb(l,e),title:o.titles[s]??i.name})}}let a=t.filter((i)=>i.enabled&&!n.get(i.pluginId)).length;return m("section",{children:[m("header",{className:"flex items-center gap-2 mb-2",children:[m("h3",{className:"text-sm font-medium text-ink",children:"Panel placement"}),m("span",{className:"ml-auto text-[11px] text-ink/50",children:e.enabled?`${e.panels.length} on the rail`:"rail off"})]}),m("p",{className:"text-[11px] text-ink/50 mb-2",children:"The left column always holds the session list. Turn its rail on to add views beside it — a panel placed there gets its own button and its own width, and leaves the right column. Each contributed panel is placed on its own: a plugin that ships two panels gets two rows."}),!e.enabled?m("p",{className:"text-[11px] text-ink/45 mb-2",children:"The rail is off. Placing a panel on the left turns it on, and you can switch it back off here at any time."}):null,m("div",{className:"flex items-center gap-2.5 border border-ink/10 rounded-lg px-2.5 py-2 mb-2",children:[m("span",{className:"min-w-0 flex-1",children:[m("span",{className:"block text-xs text-ink",children:"Show the left activity bar"}),m("span",{className:"block text-[10px] text-ink/40",children:"Off by default. With it off the column shows only its active view."})]}),m("button",{type:"button",role:"switch","aria-checked":e.enabled,"aria-label":e.enabled?"Hide the left activity bar":"Show the left activity bar",onClick:()=>e.setEnabled(!e.enabled),className:`relative w-8 h-4 rounded-full transition-colors flex-shrink-0 ${e.enabled?"bg-ink/70":"bg-ink/20"}`,children:m("span",{className:`absolute top-0.5 w-3 h-3 rounded-full bg-canvas transition-all ${e.enabled?"left-[18px]":"left-0.5"}`})})]}),r.length===0?m("p",{className:"text-[11px] text-ink/45",children:a>0?`Loading ${a} plugin ${a===1?"bundle":"bundles"}…`:"No installed plugin contributes a panel yet. Install one from the store above and it appears here."}):m("div",{className:"grid gap-2 [grid-template-columns:repeat(auto-fill,minmax(240px,1fr))]",children:[m("div",{className:"flex flex-col gap-1.5 border border-ink/10 rounded-lg px-2.5 py-2 bg-ink/[0.02]",children:[m("span",{className:"min-w-0",children:[m("span",{className:"block text-xs text-ink",children:"Sessions"}),m("span",{className:"block text-[10px] text-ink/40",children:"The dock's own view — always here."})]}),m("span",{className:"text-[10px] font-mono text-ink/40 self-start",children:hs})]}),r.map(({plugin:i,key:o,slot:s,side:l,title:u})=>{let d=bq(s);return m("div",{className:"flex flex-col gap-1.5 border border-ink/10 rounded-lg px-2.5 py-2",children:[m("span",{className:"min-w-0",children:[m("span",{className:"block text-xs text-ink",title:`${u} — ${i.name}`,children:[u,m("span",{className:"text-ink/40",children:[" · ",i.name]})]}),m("span",{className:"block text-[10px] text-ink/40",children:[uqr[l],s==="panel"?" · takeover":" · view",l==="left"&&!e.enabled?" · rail off":""]})]}),d.length>1?m(pqr,{name:u,destinations:d,current:l,onMove:(p)=>e.setSide(o,p)}):m("span",{className:"flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded border border-ink/10 text-ink/50 self-start",title:`${u} draws the editor column — its slot has no other destination`,children:[m(zu,{size:11,className:"opacity-40"}),"Fixed"]})]},o)})]}),a>0&&r.length>0?m("p",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-ink/45",children:[m(en,{size:11,className:"animate-spin"}),a," plugin ",a===1?"bundle is":"bundles are"," still loading."]}):null,m("p",{className:"mt-2 flex items-start gap-1.5 text-[11px] text-ink/40",children:[m(Dg,{size:11,className:"mt-0.5 flex-shrink-0 opacity-60"}),m("span",{children:"A takeover draws the editor column whole, so its switch is the editor panel's own rail (Files · your panels). A view rides a rail and gets one button on the column it is placed on."})]})]})}var uqr,Wie,dqr;var Prn=D(()=>{dt();yb();yf();de();uqr={left:"Left dock",right:"Right column",editor:"Editor column"},Wie={left:"left dock",right:"right column",editor:"editor column"},dqr={left:Tb,right:Rk,editor:hf}});function Drn({autoUpdate:e,busy:t,gitCount:n,onSetAutoUpdate:r,onCheckUpdates:a,onRefresh:i}){return m("div",{className:"flex flex-wrap items-center gap-2",children:[m("button",{type:"button",role:"checkbox","aria-checked":e,disabled:t!==null,onClick:()=>void r(!e),title:e?"Stop updating git-installed plugins automatically":"Fetch and apply the remote’s latest commit for every git-installed plugin, hourly",className:"flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded border border-ink/15 hover:bg-ink/5 disabled:opacity-50",children:[e?m(Ck,{size:13}):m(gp,{size:13}),"Auto-update git plugins"]}),m("button",{type:"button",onClick:()=>void a(),disabled:t!==null||n===0,title:n===0?"No git-installed plugins to check":"Ask each git-installed plugin’s remote whether a newer commit exists",className:"flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded border border-ink/15 hover:bg-ink/5 disabled:opacity-50",children:[m(In,{size:13,className:t==="check_updates"?"animate-spin":""}),"Check for updates"]}),m("button",{type:"button",onClick:i,disabled:t!==null,className:"flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded border border-ink/15 hover:bg-ink/5 disabled:opacity-50",title:"Re-read the marketplace from disk",children:[m(In,{size:13}),"Refresh"]}),m("span",{className:"text-[11px] text-ink/45",children:e?"Git plugins are updated from their remote about once an hour, with no confirmation.":"Off — updates are applied only when you press Update."})]})}var $rn=D(()=>{dt();de()});function Orn({blocked:e,busy:t,onForceSync:n}){let r=Object.entries(e);if(r.length===0)return null;return m("div",{className:"space-y-2",children:r.map(([a,i])=>{let o=i.changed.slice(0,mqr),s=i.changed.length-o.length;return m("div",{className:"border border-warning/40 rounded p-3 space-y-1.5",children:[m("div",{className:"flex items-center gap-2 text-warning",children:[m(pr,{size:14,className:"flex-shrink-0"}),m("span",{className:"text-xs",children:[m("span",{className:"font-medium",children:a})," has local changes — its bundled update is paused"]})]}),m("p",{className:"text-[11px] text-ink/60",children:["Kabmo installed this plugin, and ",i.changed.length," of its files no longer match what it wrote. Your files are left as they are."]}),m("ul",{className:"text-[10px] font-mono text-ink/50 space-y-0.5",children:[o.map((l)=>m("li",{className:"truncate",title:l,children:l},l)),s>0?m("li",{children:["… and ",s," more"]}):null]}),m("div",{className:"flex items-center gap-2 pt-0.5",children:[m("button",{type:"button",disabled:t!==null,onClick:()=>void n(a),title:`Replace ${i.changed.length} changed file(s) with the copy Kabmo ships — your edits are lost`,className:"flex items-center gap-1.5 px-2 py-1 text-[11px] rounded border border-warning/50 text-warning hover:bg-warning/10 disabled:opacity-50",children:[t===`force_sync:${a}`?m(en,{size:12,className:"animate-spin"}):m(nu,{size:12}),"Replace my changes with the store's copy"]}),m("span",{className:"text-[11px] text-ink/45",children:"This discards the files listed above."})]})]},a)})})}var mqr=5;var Frn=D(()=>{dt();de()});function hqr({error:e,busy:t,onForget:n}){let r=e.source;return m("div",{className:"border border-error/30 rounded p-3",children:[m("div",{className:"flex items-center gap-2 text-error",children:[m(pr,{size:14,className:"flex-shrink-0"}),m("span",{className:"text-xs",children:"Rejected"})]}),m("div",{className:"mt-1 text-[11px] font-mono text-ink/50 break-all",children:e.dir}),m("div",{className:"mt-1 text-xs text-ink/70",children:e.reason}),r?m("div",{className:"mt-2 flex items-center gap-2",children:[m("button",{type:"button",disabled:t,onClick:()=>void n(r),className:"flex items-center gap-1.5 px-2 py-1 text-[11px] rounded border border-error/40 text-error hover:bg-error/10 disabled:opacity-50",title:`Drop the catalog entry "${r}" — the directory it names is already gone`,children:[m(xr,{size:12}),"Forget this entry"]}),m("span",{className:"text-[11px] text-ink/45",children:"Removes the record from marketplace.json. No files are touched."})]}):null]})}function Brn(){let{panels:e,errors:t,plugins:n,catalog:r,disabledPanels:a,gitStatus:i,autoUpdate:o,syncBlocked:s,ready:l}=Md(),{slots:u,failures:d}=yv(),p=dq(),h=bp(),f=()=>void jje(),g=r.filter((k)=>!k.installed),b=new Map(d.map((k)=>[k.pluginId,k.reason])),y=new Map(e.map((k)=>[k.pluginId,k.iconUrl])),v=new Map(e.map((k)=>[k.pluginId,k.readmeUrl])),x=n.filter((k)=>k.gitOrigin).length;return m("div",{className:"space-y-4",children:[m("div",{className:"flex items-start justify-between gap-3",children:m("p",{className:"text-xs text-ink/60 max-w-xl",children:"Panels bundled with Kabmo, plus the ones you install from a git URL. A plugin is local code Kabmo loads into this page and renders in its own tree, so it looks and behaves like the rest of the app — treat it the way you would a VS Code extension."})}),m(Drn,{autoUpdate:o,busy:p.busy,gitCount:x,onSetAutoUpdate:p.setAutoUpdate,onCheckUpdates:p.checkUpdates,onRefresh:f}),p.error?m("div",{className:"flex items-start gap-1.5 px-3 py-2 rounded-lg border border-error/30 bg-error/5 text-[11px] text-error leading-snug",children:[m(pr,{size:13,className:"mt-0.5 flex-shrink-0"}),m("span",{className:"flex-1 break-words",children:p.error}),m("button",{type:"button",onClick:p.clearError,"aria-label":"Dismiss",className:"cursor-pointer",children:m(gn,{size:12})})]}):null,m(wrn,{busy:p.busy==="install",onInstall:p.install,onClearError:p.clearError}),!l?m("p",{className:"text-xs text-ink/50",children:"Reading…"}):null,m(Nrn,{disabled:a,busy:p.busy,onSetEnabled:p.setEnabled}),m(Mrn,{dock:h,plugins:n,slots:u}),l&&g.length===0&&n.length===0&&t.length===0?m("div",{className:"text-xs text-ink/60 space-y-1.5",children:[m("p",{children:"No panel plugins installed."}),m("p",{className:"font-mono text-[11px] text-ink/45 leading-relaxed",children:["~/.kabmo/marketplace/marketplace.json",m("br",{}),"~/.kabmo/marketplace/plugins/<plugin>/package.json"]})]}):null,m(Srn,{entries:g,busy:p.busy,onInstall:p.installBundled}),m(Orn,{blocked:s,busy:p.busy,onForceSync:p.forceSync}),n.length>0?m(Lrn,{plugins:n,slots:u,failures:b,iconUrls:y,readmeUrls:v,busy:p.busy,onBuild:p.build,onRemove:p.remove,onSetEnabled:p.setEnabled,gitStatus:i,onUpdateGit:p.updateGit}):null,t.map((k)=>m(hqr,{error:k,busy:p.busy!==null,onForget:p.forget},k.dir+k.reason))]})}var zrn=D(()=>{dt();K5();dRe();Trn();Rrn();Irn();Prn();Mk();$rn();Frn();de()});function jrn(){return m("div",{className:"flex-1 min-h-0 overflow-auto p-6 md:p-8",children:m("div",{className:"max-w-3xl",children:m(Brn,{})})})}var Urn=D(()=>{zrn();de()});function qrn({isOpen:e,onClose:t,onAddSource:n}){let[r,a]=ne(""),[i,o]=ne(""),[s,l]=ne(null);if(!e)return null;return m("div",{className:"fixed inset-0 z-50 bg-ink/40 backdrop-blur-[2px] flex items-center justify-center p-4",onClick:t,children:m("div",{className:"bg-paper border border-ink/20 rounded-xl max-w-md w-full p-6 shadow-2xl space-y-4 text-ink animate-in fade-in zoom-in-95 duration-150 max-h-full overflow-y-auto scrollbar-overlay-container",onClick:(d)=>d.stopPropagation(),children:[m("div",{className:"flex items-center justify-between pb-3 border-b border-ink/10",children:[m("div",{className:"flex items-center gap-2",children:[m(xc,{className:"w-4 h-4 text-ink/70"}),m("h2",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:"Add Custom Skill Source"})]}),m("button",{type:"button",onClick:t,className:"p-1 rounded-md text-ink/50 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:m(gn,{className:"w-4 h-4"})})]}),m("p",{className:"text-xs text-ink/70 leading-relaxed",children:"Connect any public or private Git repository containing skill definitions and prompt directives."}),m("form",{onSubmit:(d)=>{d.preventDefault();let p=r.trim().replace(/^https?:\/\/github\.com\//,"").replace(/\/$/,"");if(!p){l("Please provide a valid GitHub repository path (e.g. owner/repo).");return}let h=i.trim()||p.split("/")[1]||p,f={id:`custom-${Date.now()}`,name:h,repo:p,stars:"1.2K",updatedAt:"Just now",skillCount:3,isCustom:!0};n(f),a(""),o(""),l(null),t()},className:"space-y-4",children:[m("div",{children:[m("label",{className:"block text-xs font-semibold text-ink/80 mb-1.5",children:"Source Name"}),m("input",{type:"text",value:i,onChange:(d)=>o(d.currentTarget.value),placeholder:"e.g. Acme Internal Skills",className:"w-full px-3 py-2 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper focus:outline-none focus:border-ink text-xs text-ink transition-colors"})]}),m("div",{children:[m("label",{className:"block text-xs font-semibold text-ink/80 mb-1.5",children:["Git Repository ",m("span",{className:"text-error",children:"*"})]}),m("input",{type:"text",value:r,onChange:(d)=>{a(d.currentTarget.value),l(null)},placeholder:"e.g. owner/skills-repo or https://github.com/...",className:"w-full px-3 py-2 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper focus:outline-none focus:border-ink text-xs font-mono text-ink transition-colors"})]}),s&&m("div",{className:"flex items-center gap-2 text-xs text-error p-2.5 rounded-lg bg-error/10 border border-error/20",children:[m(Kn,{className:"w-4 h-4 flex-shrink-0"}),m("span",{className:"font-medium",children:s})]}),m("div",{className:"pt-3 border-t border-ink/10 flex items-center justify-end gap-2",children:[m("button",{type:"button",onClick:t,className:"px-3.5 py-2 rounded-lg border border-ink/20 hover:border-ink/40 text-xs font-medium text-ink/80 hover:text-ink transition-colors cursor-pointer",children:"Cancel"}),m("button",{type:"submit",className:"flex items-center gap-1.5 px-4 py-2 rounded-lg bg-ink text-paper text-xs font-medium hover:bg-ink/90 transition-colors shadow-xs cursor-pointer",children:[m(kr,{size:14}),m("span",{children:"Add Source"})]})]})]})]})})}var Wrn=D(()=>{Xe();dt();de()});function Grn(){let[e,t]=ne([]),[n,r]=ne([]),[a,i]=ne([]),o=Se(async()=>{let l=await(await fetch("/api/settings/skills")).json();if(l?.catalogSources)t(l.catalogSources);if(l?.catalogSkills)r(l.catalogSkills);if(l?.skills)i(l.skills)},[]);return Ae(()=>{o().catch(console.error)},[o]),{sources:e,catalogSkills:n,userSkills:a,setSources:t,setUserSkills:i,reload:o}}var Hrn=D(()=>{Xe()});function Vrn(){let{sources:e,catalogSkills:t,userSkills:n,setSources:r,setUserSkills:a,reload:i}=Grn(),[o,s]=ne("anthropic"),[l,u]=ne(""),[d,p]=ne(!1),[h,f]=ne(!1),[g,b]=ne(null),y=new Set(n.map((T)=>T?.name).filter(Boolean)),v=(T)=>{b(T),setTimeout(()=>b(null),2500)},x=()=>{p(!0),i().then(()=>v("Catalog index synchronized")).catch(console.error).finally(()=>p(!1))},k=(T)=>{let E=n.find((L)=>L.name===T.name);fetch("/api/settings/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"install_toggle",skill:T,install:!E})}).then((L)=>L.json()).then((L)=>{if(L?.error){v(`Failed: ${L.error}`);return}if(Array.isArray(L?.skills))a(L.skills);z2("command"),v(E?`Uninstalled skill "${T.name}"`:`Installed skill "${T.name}"`)}).catch((L)=>{console.error(L),v(`Failed to ${E?"uninstall":"install"} "${T.name}"`)})},C=(T)=>{let E=[...e,T];r(E),s(T.id),fetch("/api/settings/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({catalogSources:E})}).catch(console.error),v(`Added source "${T.name}"`)},_=t.filter((T)=>{let E=!l.trim()||T.name.toLowerCase().includes(l.toLowerCase())||T.description.toLowerCase().includes(l.toLowerCase())||T.repoTag.toLowerCase().includes(l.toLowerCase());if(l.trim())return E;return T.sourceId===o}),w=e.find((T)=>T.id===o)||e[0]||null;return m("div",{className:"flex-1 flex flex-col h-full w-full scrollbar-overlay-container bg-paper text-ink p-6 md:p-8 space-y-6",children:[m("div",{children:m("p",{className:"text-xs text-ink/70 leading-relaxed",children:"Install ready-made skills from curated repositories, or add your own source."})}),m("div",{className:"relative",children:[m(na,{size:15,className:"absolute left-3 top-2.5 text-ink/40 pointer-events-none"}),m("input",{type:"text",value:l,onChange:(T)=>u(T.currentTarget.value),placeholder:"Search skills across all sources...",className:"w-full pl-9 pr-4 py-2 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper focus:outline-none focus:border-ink text-xs text-ink transition-colors"})]}),m("div",{className:"space-y-3",children:[m("h3",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:"Sources"}),m("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.map((T)=>{let E=o===T.id&&!l.trim();return m("div",{onClick:()=>{s(T.id),u("")},className:`p-3.5 rounded-xl border transition-all cursor-pointer select-none relative ${E?"border-ink bg-ink/5 shadow-xs":"border-ink/20 hover:border-ink/40 bg-paper"}`,children:[m("div",{className:"flex items-center justify-between",children:[m("div",{className:"flex items-center gap-2",children:[m("span",{className:"text-xs font-bold text-ink",children:T.name}),m("span",{className:"text-[10px] text-ink/50 font-mono",children:[T.skillCount," skills"]})]}),m(In,{size:13,className:`text-ink/40 hover:text-ink transition-colors ${d&&E?"animate-spin":""}`})]}),m("div",{className:"mt-1 font-mono text-[11px] text-ink/60 truncate",children:T.repo}),m("div",{className:"mt-2.5 flex items-center gap-3 text-[10px] text-ink/50",children:[m("span",{className:"flex items-center gap-1",children:[m(fv,{size:11,className:"text-ink/50"}),m("span",{children:T.stars})]}),m("span",{children:T.updatedAt})]})]},T.id)}),m("div",{onClick:()=>f(!0),className:"p-3.5 rounded-xl border border-dashed border-ink/25 hover:border-ink/50 bg-paper hover:bg-ink/[0.02] transition-all cursor-pointer flex items-center gap-3 select-none",children:[m("div",{className:"w-8 h-8 rounded-lg border border-ink/20 flex items-center justify-center text-ink/60 flex-shrink-0",children:m(kr,{size:16})}),m("div",{children:[m("div",{className:"text-xs font-bold text-ink",children:"Add your own source"}),m("div",{className:"text-[11px] text-ink/60",children:"Any Git repository with skills"})]})]})]})]}),m("div",{className:"border-t border-ink/10 pt-4",children:[m("div",{className:"flex items-center justify-between pb-3",children:[m("div",{className:"flex items-center gap-2",children:[m("span",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:l.trim()?"Search Results":w?.name?w.name.toUpperCase():"SKILL CATALOG"}),m("span",{className:"text-xs text-ink/50",children:[_.length," skill(s) found"]})]}),m("button",{type:"button",onClick:x,title:"Refresh skills",className:"p-1 rounded-md text-ink/50 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:m(In,{size:14,className:d?"animate-spin":""})})]}),m("div",{className:"space-y-3",children:_.length===0?m("div",{className:"text-center py-10 border border-dashed border-ink/15 rounded-xl",children:m("p",{className:"text-xs text-ink/60",children:"No skills found matching your query."})}):_.map((T)=>{let E=y.has(T.name);return m("div",{className:"p-4 rounded-xl border border-ink/15 hover:border-ink/30 bg-paper transition-all flex flex-col sm:flex-row sm:items-start justify-between gap-3",children:[m("div",{className:"space-y-1.5 flex-1 min-w-0",children:[m("div",{className:"flex items-center gap-2",children:m("span",{className:"text-xs font-bold text-ink tracking-tight font-mono",children:T.name})}),m("p",{className:"text-xs text-ink/75 leading-relaxed line-clamp-2",children:T.description}),m("div",{className:"flex items-center gap-1.5 text-[11px] text-ink/50 font-mono pt-1",children:[m(xc,{size:12,className:"flex-shrink-0"}),m("span",{className:"truncate",children:T.repoTag})]})]}),m("div",{className:"flex items-center gap-2 flex-shrink-0 self-end sm:self-center",children:[T.githubUrl&&m("a",{href:T.githubUrl,target:"_blank",rel:"noreferrer",className:"p-1.5 rounded-lg text-ink/50 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",title:"View repository",children:m(po,{size:14})}),m("button",{type:"button",onClick:()=>k(T),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-all flex items-center gap-1.5 cursor-pointer ${E?"border border-ink/20 text-ink/80 hover:border-error hover:text-error hover:bg-error/5":"bg-ink text-paper hover:bg-ink/90 shadow-xs"}`,children:E?m(bt,{children:[m(Vt,{size:12}),m("span",{children:"Installed"})]}):m(bt,{children:[m(ki,{size:12}),m("span",{children:"install"})]})})]})]},T.id)})})]}),m(qrn,{isOpen:h,onClose:()=>f(!1),onAddSource:C}),g&&m("div",{className:"fixed bottom-6 right-6 z-50 bg-ink text-paper text-xs font-medium px-4 py-2.5 rounded-lg shadow-lg animate-in fade-in slide-in-from-bottom-2 duration-150 flex items-center gap-2",children:[m(Vt,{size:14}),m("span",{children:g})]})]})}var Zrn=D(()=>{Xe();dt();Wrn();DT();Hrn();de()});function Krn({category:e}){return m("div",{className:"space-y-6 text-ink flex flex-col items-center justify-center py-16",children:[m("div",{className:"text-sm font-semibold capitalize",children:[e.replace("-"," ")," Settings"]}),m("div",{className:"text-xs text-ink/60 text-center max-w-sm mt-2",children:"This settings category is currently under construction and will be available soon."})]})}var Yrn=D(()=>{de()});var Jrn;var Xrn=D(()=>{Jrn={source:"@oh-my-pi/pi-coding-agent 10 tabs / 559 settings",tabs:[{id:"appearance",label:"Appearance",groups:["Theme","Composer","Status Line","Images","Display"]},{id:"model",label:"Model",groups:["Prompt","Prewalk","Vision","Thinking","Sampling","Retry & Fallback","Advisor"]},{id:"interaction",label:"Interaction",groups:["Startup & Updates","Git","Input","Magic Keywords","Notifications","Power","Agent","Approvals","Skills","Speech","Collab","Stream"]},{id:"context",label:"Context",groups:["General","Compaction","Experimental","Rules (TTSR)"]},{id:"memory",label:"Memory",groups:["General","Sharpshooter","Auto-Learn","Mnemopi","Hindsight"]},{id:"files",label:"Files",groups:["Editing","Reading","Read Summaries","LSP"]},{id:"shell",label:"Shell",groups:["Bash","Eval & Runtimes"]},{id:"tools",label:"Tools",groups:["Output Limits","Available Tools","Todos","Grep & Browser","Computer","Execution","GitHub","Discovery & MCP","Developer","Extensions","IDA Pro"]},{id:"tasks",label:"Tasks",groups:["Isolation","Subagents","Modes","Commands & Skills"]},{id:"providers",label:"Providers",groups:["Services","Fireworks","Tiny Model","Protocol","Timeouts","Privacy"]}],entries:{modelRoleStorage:{type:"enum",default:"global",values:["global","project"],ui:{tab:"model",group:"Prompt",label:"Model Role Storage",description:"Where model selector role assignments are saved",options:[{value:"global",label:"Global",description:"Save role models in the active profile config (current behavior)"},{value:"project",label:"Per-project",description:"Save project role models in .omp/config.yml; missing project roles use global defaults"}]}},autoResume:{type:"boolean",default:!1,ui:{tab:"interaction",group:"Startup & Updates",label:"Auto Resume",description:"Automatically resume the most recent session in the current directory"}},"git.enabled":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Git",label:"Enable Git Integration",description:"Show git branch, status, and PR information in the TUI and watch repository metadata."}},"theme.dark":{type:"string",default:"titanium",ui:{tab:"appearance",group:"Theme",label:"Dark Theme",description:"Theme used when the terminal has a dark background",options:"runtime"}},"theme.light":{type:"string",default:"light",ui:{tab:"appearance",group:"Theme",label:"Light Theme",description:"Theme used when the terminal has a light background",options:"runtime"}},symbolPreset:{type:"enum",default:"unicode",values:["unicode","nerd","ascii"],ui:{tab:"appearance",group:"Theme",label:"Symbol Preset",description:"Glyph set for icons and symbols (Unicode, Nerd Font, or ASCII)",options:[{value:"unicode",label:"Unicode",description:"Standard symbols (default)"},{value:"nerd",label:"Nerd Font",description:"Requires a Nerd Font, or a Glyph Protocol terminal (icons ship in-band)"},{value:"ascii",label:"ASCII",description:"Maximum compatibility"}]}},colorBlindMode:{type:"boolean",default:!1,ui:{tab:"appearance",group:"Theme",label:"Color-Blind Mode",description:"Use blue instead of green for diff additions"}},"composer.shape":{type:"string",default:"band",ui:{tab:"appearance",group:"Composer",label:"Composer Shape",description:"Visual layout of the input editor and status line",options:"runtime"}},"composer.tokenRate":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Composer",label:"Generation Rate",description:"Show a live generation tok/s readout: on the working row next to the session title, or in the native composer bar right after the thinking level, where the last reading stays between turns. Estimated from streamed deltas and corrected by the provider's billed output count as each message completes."}},"statusLine.preset":{type:"enum",default:"default",values:["default","minimal","compact","full","nerd","ascii","custom"],ui:{tab:"appearance",group:"Status Line",label:"Status Line Preset",description:"Pre-built status line configurations",options:[{value:"default",label:"Default",description:"Model, path, git, context, tokens, cost"},{value:"minimal",label:"Minimal",description:"Path and git only"},{value:"compact",label:"Compact",description:"Model, git, cost, context"},{value:"full",label:"Full",description:"All segments including time"},{value:"nerd",label:"Nerd",description:"Maximum info with Nerd Font icons"},{value:"ascii",label:"ASCII",description:"No special characters"},{value:"custom",label:"Custom",description:"User-defined segments"}]}},"statusLine.separator":{type:"enum",default:"powerline-thin",values:["powerline","powerline-thin","slash","pipe","block","none","ascii"],ui:{tab:"appearance",group:"Status Line",label:"Status Line Separator",description:"Style of separators between segments",options:[{value:"powerline",label:"Powerline",description:"Solid arrows (Nerd Font)"},{value:"powerline-thin",label:"Thin chevron",description:"Thin arrows (Nerd Font)"},{value:"slash",label:"Slash",description:"Forward slashes"},{value:"pipe",label:"Pipe",description:"Vertical pipes"},{value:"block",label:"Block",description:"Solid blocks"},{value:"none",label:"None",description:"Space only"},{value:"ascii",label:"ASCII",description:"Greater-than signs"}]}},"statusLine.contextLine":{type:"enum",default:"embedded",values:["off","percentage","annotated","embedded"],ui:{tab:"appearance",group:"Status Line",label:"Context-Reactive Line",description:"How the line between the left and right segments reflects context usage (box composer only)",options:[{value:"off",label:"Off",description:"Solid accent line, no context feedback"},{value:"percentage",label:"Percentage",description:"Used portion in accent color, remainder dimmed"},{value:"annotated",label:"Annotated",description:"Percentage plus ticks at the speculative and auto-compaction boundaries"},{value:"embedded",label:"Embedded",description:"Annotated line with the context percentage and window embedded in the gauge"}]}},"statusLine.sessionAccent":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Status Line",label:"Session Accent",description:"Use the session name color for the editor border and status line gap"}},"statusLine.transparent":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Status Line",label:"Transparent Status Line",description:"Use the terminal's default background for the status line instead of the theme's `statusLineBg`. Powerline end caps are dropped because they need a contrasting fill to bridge into the surrounding terminal."}},"statusLine.compactThinkingLevel":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Status Line",label:"Compact Thinking Level",description:"Show the thinking level as a single icon on the model name instead of a separate ` · <level>` suffix; in Tern's composer, as the model chip's icon instead of a separate chip (click the icon to cycle it)."}},"statusLine.showHookStatus":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Status Line",label:"Show Hook Status",description:"Display hook status messages below the status line"}},"terminal.showImages":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Images",label:"Show Inline Images",description:"Render images inline in the terminal",condition:"hasImageProtocol"}},"images.autoResize":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Images",label:"Auto-Resize Images",description:"Resize large images to 2000x2000 max for better model compatibility"}},"images.blockImages":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Images",label:"Block Images",description:"Prevent images from being sent to LLM providers"}},"tui.resizeScrollback":{type:"enum",default:"rebuild",values:["append","rebuild","preserve"],ui:{tab:"appearance",group:"Display",label:"Resize Scrollback",description:"How a settled terminal resize refreshes transcript rows retained in terminal scrollback",options:[{value:"append",label:"Append",description:"Replay the transcript at the new width below retained history"},{value:"rebuild",label:"Rebuild",description:"Erase all terminal scrollback, then replay one current-width transcript"},{value:"preserve",label:"Preserve",description:"Repaint only the viewport and keep history wrapped at its old width"}]}},"tui.completeScrollback":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Complete Scrollback",description:"Send transcript rows pushed off screen by a growing HUD or dialog straight to scrollback; when it shrinks, blank rows sit between the transcript and the input until new output fills them"}},"terminal.showProgress":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Native Terminal Progress",description:"Emit OSC 9;4 indeterminate progress while the agent or context maintenance is running (always on in Tern)"}},"terminal.programStatus":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Program Status (OSC 7501)",description:"Report whether the agent is working, waiting on you, done, or failed over OSC 7501, for terminal tab indicators and agent inboxes"}},"tui.textSizing":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Large Headings (Kitty)",description:"Render Markdown H1 headings at 2x scale using Kitty's OSC 66 text-sizing protocol. Only takes effect on Kitty terminals; ignored everywhere else. Off by default."}},"tui.renderMermaid":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Render Mermaid Diagrams",description:"Render Mermaid fenced code blocks as ASCII diagrams"}},"tui.renderSvg":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Render SVG Figures",description:"Invite the agent to draw diagrams and charts as SVG, rendered inline as images on terminals that show graphics"}},"tui.autoGraph":{type:"enum",default:"always",values:["smart","always","off"],ui:{tab:"appearance",group:"Display",label:"Auto-Graph Tables",description:"Draw a chart under numeric tables in the agent's answers, in your theme's colors, on terminals that show graphics",options:[{value:"smart",label:"Smart",description:"The judge model refines each chart: kind, columns, row names and grouping, scales, which way is better, and its title"},{value:"always",label:"Always",description:"Chart every table that reads as numeric, using the built-in best guess"},{value:"off",label:"Off",description:"Leave tables as tables"}]}},"tui.reactions":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Agent Reactions",description:"Invite the agent to react to your message with an emoji badge on its bubble"}},"tui.codexResetFireworks":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Codex Reset Fireworks",description:"Celebrate unscheduled Codex weekly usage resets and newly banked saved resets with a top-third fireworks overlay that remains until Esc"}},"tui.titleState":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Terminal Title Run State",description:"Show the agent run state in the terminal title's separator — an animated spinner while working (a static ':' under WSL), '>' when it's your turn, '!' when the agent is waiting on you"}},"tui.titleSpinner":{type:"enum",default:"braille",values:["braille","pulse","dots","line"],ui:{tab:"appearance",group:"Display",label:"Terminal Title Spinner",description:"Glyph set for the working-state spinner in the terminal title — braille sweep, filling moon, single-dot cycle, or ASCII-safe line",options:[{value:"braille",label:"Braille",description:"Classic ⠋⠙⠹ sweep (default)"},{value:"pulse",label:"Pulse",description:"Moon filling ○◑● then emptying"},{value:"dots",label:"Dots",description:"Single braille dots cycling"},{value:"line",label:"Line",description:"ASCII - \\ | / for fonts without braille coverage"}]}},"tui.hyperlinks":{type:"enum",default:"auto",values:["off","auto","always"],ui:{tab:"appearance",group:"Display",label:"Terminal Hyperlinks",description:"Wrap paths and URLs in OSC 8 hyperlinks for terminal-native click-to-open (auto: detect support; off: never; always: unconditional)"}},"tui.mouse":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Mouse Click-to-Focus",description:"Capture mouse clicks in the main session so live subagent cards and HUD rows focus on click, with a hover highlight on the target. Native text selection becomes Shift+drag and wheel scroll becomes Shift+wheel while on"}},"tui.tight":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Tight Layout",description:"Remove the 1-character horizontal padding from the left and right of the terminal output"}},"display.shimmer":{type:"enum",default:"classic",values:["classic","kitt","disabled"],ui:{tab:"appearance",group:"Display",label:"Shimmer",description:"Animation style for working/loading messages",options:[{value:"classic",label:"Classic",description:"Soft cosine wave sweeping across the text"},{value:"kitt",label:"KITT Scanner",description:"Knight Rider 1982 red light bouncing left-right"},{value:"disabled",label:"Disabled",description:"No animation; static muted text"}]}},"display.pinnedAgents":{type:"enum",default:"collapsed",values:["off","collapsed","full"],ui:{tab:"appearance",group:"Display",label:"Pinned Agents",description:"Pinned live-agent jump list above the editor (off hides it; collapsed shows a few rows with an expander; full lists all)",options:[{value:"off",label:"Off",description:"Hide the pinned jump list"},{value:"collapsed",label:"Collapsed",description:"Show a few rows with an expander"},{value:"full",label:"Full",description:"Always list every live agent"}]}},"display.subagentLivePreview":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Subagent Live Preview",description:"Show each pinned subagent's current (or most recent) tool call beneath its row"}},"display.smoothStreaming":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Smooth Streaming",description:"Reveal assistant text and streamed tool input smoothly while chunks arrive"}},"display.hideToolActivity":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Hide Tool Activity",description:"Hide model-initiated tool calls and results from the transcript"}},"display.showTokenUsage":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Show Token Usage",description:"Show per-turn token usage on assistant messages"}},"display.showTurnTime":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Show Turn Time",description:"Show the total prompt-to-yield time (including tool calls) on assistant message usage rows"}},"display.cacheMissMarker":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Cache Miss Marker",description:"Show a divider after an assistant turn whose request lost (missed) the prompt cache"}},"display.collapseCompacted":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Collapse Compacted History",description:"Collapse pre-compaction history behind the summary divider on the live transcript; disable to keep the full transcript inline with dividers at each compaction point"}},showHardwareCursor:{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Show Hardware Cursor",description:"Show terminal cursor for IME support"}},"tui.imeSafeCursor":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"IME-Safe Prompt Layout",description:"Move the prompt's bottom border to a separate row so macOS IME preedit cannot displace it"}},steeringMode:{type:"enum",default:"one-at-a-time",values:["all","one-at-a-time"],ui:{tab:"interaction",group:"Input",label:"Steering Mode",description:"How to process queued messages while agent is working"}},followUpMode:{type:"enum",default:"one-at-a-time",values:["all","one-at-a-time"],ui:{tab:"interaction",group:"Input",label:"Follow-Up Mode",description:"How to drain follow-up messages after a turn completes"}},interruptMode:{type:"enum",default:"immediate",values:["immediate","wait"],ui:{tab:"interaction",group:"Input",label:"Interrupt Mode",description:"When steering messages interrupt tool execution"}},"tui.vimMode":{type:"boolean",default:!1,ui:{tab:"interaction",group:"Input",label:"Vim Editing Mode",description:"Modal prompt editing. Esc leaves Insert mode; Normal mode has hjkl, 0, $, ^, w, b, e, gg, G, counts, x/D/C, dd/yy, p and u; operators take motions or text objects (diw, ca(, dap); v/V start a Visual selection that y copies and d deletes"}},"tui.vimModeDisplay":{type:"enum",default:"text",values:["text","icon","none"],ui:{tab:"interaction",group:"Input",label:"Vim Mode Indicator",description:"How the current Vim mode appears in the status line",condition:"vimModeEnabled",options:[{value:"text",label:"Text",description:"Full mode name — NORMAL, INSERT, VISUAL, V-LINE, REPLACE"},{value:"icon",label:"Icon",description:"Single compact glyph per mode"},{value:"none",label:"Hidden",description:"Do not show the mode in the status line"}]}},"loop.mode":{type:"enum",default:"prompt",values:["prompt","compact","reset"],ui:{tab:"interaction",group:"Input",label:"Loop Mode",description:"What happens between /loop iterations before re-submitting the prompt",options:[{value:"prompt",label:"Prompt",description:"Re-submit the prompt as a follow-up message (current behavior)"},{value:"compact",label:"Compact",description:"Compact the session context, then re-submit the prompt"},{value:"reset",label:"Reset",description:"Start a new session, then re-submit the prompt"}]}},"loop.conditionTimeoutMs":{type:"number",default:30000,ui:{tab:"interaction",group:"Input",label:"Loop Condition Timeout (ms)",description:"Max wait for a `/loop --while` / `--until` condition command before treating it as broken and stopping the loop. Set to 0 to wait indefinitely",options:[{value:"0",label:"Unlimited"},{value:"10000",label:"10 seconds"},{value:"30000",label:"30 seconds"},{value:"120000",label:"2 minutes"}]}},"composer.recallClearedDrafts":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Input",label:"Recall Cleared Drafts",description:"Keep drafts cleared with Ctrl+C in local Up/Down history until exit; disabling affects future clears"}},doubleEscapeAction:{type:"enum",default:"rewind",values:["rewind","tree","none"],ui:{tab:"interaction",group:"Input",label:"Double-Escape Action",description:"What pressing Esc twice with an empty editor does: open the transcript rewind selector, open the session tree, or nothing"}},"input.bareExitOnEmptySession":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Input",label:"Bare Exit on Empty Session",description:"Submitting exactly `exit`, `quit`, or `q` (any case) before the first message quits instead of prompting the model"}},"input.bareSlashCommands":{type:"boolean",default:!1,ui:{tab:"interaction",group:"Input",label:"Bare Slash Commands",description:"Submitting exactly a command name without the leading `/` (e.g. `model`, `compact`) runs that slash command; once the session has messages, press Enter twice to confirm"}},treeFilterMode:{type:"enum",default:"default",values:["default","no-tools","user-only","labeled-only","all"],ui:{tab:"interaction",group:"Input",label:"Session Tree Filter",description:"Default filter mode when opening the session tree"}},autocompleteMaxVisible:{type:"number",default:10,ui:{tab:"interaction",group:"Input",label:"Autocomplete Items",description:"Max visible items in autocomplete dropdown (3-20)",options:[{value:"3",label:"3 items"},{value:"5",label:"5 items"},{value:"7",label:"7 items"},{value:"10",label:"10 items"},{value:"15",label:"15 items"},{value:"20",label:"20 items"}]}},"spelling.typoDetection":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Input",label:"Typo Detection (macOS)",description:"Mark misspelled prompt words with the active macOS dictionaries",condition:"macOS"}},"spelling.autocomplete":{type:"enum",default:"auto",values:["off","auto","ngram","smollm","apple"],ui:{tab:"interaction",group:"Input",label:"Word Autocomplete",description:"Show predicted word completions as inline hints: Tab accepts with a space, Right without",options:[{value:"off",label:"Off",description:"No word completion"},{value:"auto",label:"Auto",description:"N-gram (nothing to download)"},{value:"ngram",label:"N-gram",description:"Learns your vocabulary from prompt history"},{value:"smollm",label:"SmolLM",description:"Small on-device language model blended with N-gram (downloads weights on first use)"},{value:"apple",label:"Apple",description:"macOS dictionary completions"}]}},"composer.predictions":{type:"boolean",default:!1,ui:{tab:"interaction",group:"Input",label:"Composer Predictions",description:"After a completed turn, ask the active model to predict your next message and show it as ghost text in the empty composer; Tab or Right inserts it without sending. Extra usage: every completed turn sends one more billed request over the whole conversation (counted in /stats)"}},"spelling.autocorrect":{type:"boolean",default:!1,ui:{tab:"interaction",group:"Input",label:"Autocorrect (macOS)",description:"Apply confident macOS spelling corrections after completed words",condition:"macOS"}},emojiAutocomplete:{type:"boolean",default:!0,ui:{tab:"interaction",group:"Input",label:"Emoji Autocomplete",description:"Suggest emojis from `:name:` shortcodes and expand text emoticons like `:D` or `:-)`"}},"paste.largeMenuThreshold":{type:"number",default:100,ui:{tab:"interaction",group:"Input",label:"Large Paste Menu",description:"When a paste reaches this many lines, offer a menu to wrap it in a code block, wrap it in XML tags, or save it to a file. 0 disables the menu (large pastes still collapse to a [Paste] marker).",options:[{value:"0",label:"Off"},{value:"100",label:"100 lines"},{value:"250",label:"250 lines"},{value:"500",label:"500 lines"},{value:"1000",label:"1000 lines"}]}},"startup.quiet":{type:"boolean",default:!1,ui:{tab:"interaction",group:"Startup & Updates",label:"Quiet Startup",description:"Skip welcome screen and startup status messages"}},"startup.showSplash":{type:"boolean",default:!1,ui:{tab:"interaction",group:"Startup & Updates",label:"Show Startup Splash",description:"Show the full animated setup splash on normal interactive startup without rerunning setup. Quiet Startup still suppresses it."}},"startup.setupWizard":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Startup & Updates",label:"Setup Wizard",description:"Show newly added onboarding steps once per setup version"}},"startup.checkUpdate":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Startup & Updates",label:"Check for Updates",description:"Check for omp updates on startup"}},"update.channel":{type:"enum",default:"stable",values:["stable","canary"],ui:{tab:"interaction",group:"Startup & Updates",label:"Update Channel",description:"Update channel used by omp update and the startup update check",options:[{value:"stable",label:"Stable"},{value:"canary",label:"Canary"}]}},"marketplace.autoUpdate":{type:"enum",default:"notify",values:["off","notify","auto"],ui:{tab:"interaction",group:"Startup & Updates",label:"Marketplace Auto-Update",description:"Check for plugin updates on startup",options:[{value:"off",label:"Off",description:"Don't check for plugin updates"},{value:"notify",label:"Notify",description:"Check on startup and notify when updates are available"},{value:"auto",label:"Auto",description:"Check on startup and auto-install updates"}]}},"startup.changelogMode":{type:"enum",default:"summary",values:["summary","expanded","hidden"],ui:{tab:"interaction",group:"Startup & Updates",label:"Startup Changelog",description:"Choose whether update notes start as a summary, full details, or stay hidden",options:[{value:"summary",label:"Summary",description:"Show release and change counts with a /changelog hint"},{value:"expanded",label:"Expanded",description:"Show the recent release notes in full"},{value:"hidden",label:"Hidden",description:"Do not show release notes on startup"}]}},"magicKeywords.enabled":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Magic Keywords",label:"Magic Keywords",description:"Enable hidden notices for standalone ultrathink, orchestrate, workflowz, jevify keywords"}},"magicKeywords.ultrathink":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Magic Keywords",label:"Ultrathink Keyword",description:"Let standalone ultrathink request maximum automatic thinking and append its hidden notice"}},"magicKeywords.orchestrate":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Magic Keywords",label:"Orchestrate Keyword",description:"Let standalone orchestrate append its hidden multi-agent orchestration notice"}},"magicKeywords.workflow":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Magic Keywords",label:"Workflow Keyword",description:"Let standalone workflowz append its hidden eval workflow notice"}},"magicKeywords.jevify":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Magic Keywords",label:"Jevify Keyword",description:"Let standalone jevify append its hidden bulk-judge classification notice"}},"completion.notify":{type:"enum",default:"on",values:["on","off"],ui:{tab:"interaction",group:"Notifications",label:"Completion Notification",description:"Notify when the agent finishes a turn"}},"error.notify":{type:"enum",default:"off",values:["on","off"],ui:{tab:"interaction",group:"Notifications",label:"Error Notification",description:"Notify when the agent stops with an error"}},"ask.timeout":{type:"number",default:0,ui:{tab:"interaction",group:"Notifications",label:"Ask Timeout",description:"Auto-select the recommended ask option after this many seconds (0 disables). Also bounds cfg:// approval prompts; an unanswered approval denies the write instead of auto-selecting",options:[{value:"0",label:"Disabled"},{value:"15",label:"15 seconds"},{value:"30",label:"30 seconds"},{value:"60",label:"60 seconds"},{value:"120",label:"120 seconds"}]}},"ask.notify":{type:"enum",default:"on",values:["on","off"],ui:{tab:"interaction",group:"Notifications",label:"Ask Notification",description:"Notify when the ask tool is waiting for input"}},"recap.enabled":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Notifications",label:"Idle Recap",description:"Generate a brief LLM recap of where things stand after the terminal has been idle"}},"recap.idleSeconds":{type:"number",default:240,ui:{tab:"interaction",group:"Notifications",label:"Idle Recap Delay",description:"Seconds to wait while idle before showing the recap",options:[{value:"60",label:"1 minute"},{value:"120",label:"2 minutes"},{value:"240",label:"4 minutes"},{value:"300",label:"5 minutes"},{value:"600",label:"10 minutes"}]}},"power.sleepPrevention":{type:"enum",default:"idle",values:["off","idle","display","system"],ui:{tab:"interaction",group:"Power",label:"Sleep Prevention",description:"Prevent the system sleeping during active sessions. Each level is cumulative — it adds the flags of all lower levels.",options:[{value:"off",label:"Off",description:"Do not prevent any sleep"},{value:"idle",label:"Prevent Idle Sleep",description:"Keep the system awake while a session is open (macOS `caffeinate -i`)"},{value:"display",label:"Prevent Display Sleep",description:"Also keep the display from idle-sleeping (macOS `caffeinate -i -d`)"},{value:"system",label:"Prevent System Sleep",description:"Also block all system sleep on AC and declare the user active (macOS `caffeinate -i -d -s -u`)"}]}},"prewalk.enabled":{type:"boolean",default:!1,ui:{tab:"model",group:"Prewalk",label:"Enable Prewalk",description:"Start on the active model, then switch to a fast/cheap model (default the 'smol' role) at the first edit/write after the plan nudge's todo list exists — the strong model plans, commits the todos, and starts the implementation before handing off. Overridable per session with --prewalk / --no-prewalk."}},"prewalk.auto":{type:"enum",default:"off",values:["off","suggest","on"],ui:{tab:"model",group:"Prewalk",label:"Auto Prewalk",description:"Ask the native judge resolved through the 'judge' role whether each new top-level user task front-loads its hard reasoning. Needs a native judge; without one nothing is classified. Independent of Enable Prewalk.",options:[{value:"off",label:"Off",description:"Never classify prompts for prewalk"},{value:"suggest",label:"Suggest",description:"Classify each task and report the decision without arming prewalk"},{value:"on",label:"On",description:"For confidently front-loaded tasks, arm a handoff from the active model to the auto target; the next task starts back on the planning model"}]}},"prewalk.autoTarget":{type:"string",default:"@smol",ui:{tab:"model",group:"Prewalk",label:"Auto-prewalk target",description:"Model or role (default '@smol') auto-prewalk hands off to at the first edit/write."}},"providers.maxInFlightRequests":{type:"record",default:{},ui:{tab:"providers",group:"Services",label:"Max In-Flight Requests",description:'Maximum concurrent LLM requests per provider id (for example "openai" or "anthropic"), shared across local OMP processes with this config root. Omitted providers are unlimited.'}},"images.describeForTextModels":{type:"boolean",default:!0,ui:{tab:"model",group:"Vision",label:"Describe Images for Text Models",description:"When an image is attached to a model without vision support, save it under local:// and inject a description from a vision-capable model instead of dropping it"}},defaultThinkingLevel:{type:"enum",default:"high",values:["minimal","low","medium","high","xhigh","max","auto"],ui:{tab:"model",group:"Thinking",label:"Thinking Level",description:"Reasoning depth for thinking-capable models",options:[{value:"auto",label:"auto",description:"Auto-detect per prompt"},{value:"minimal",label:"min",description:"Very brief reasoning (~1k tokens)"},{value:"low",label:"low",description:"Light reasoning (~2k tokens)"},{value:"medium",label:"medium",description:"Moderate reasoning (~8k tokens)"},{value:"high",label:"high",description:"Deep reasoning (~16k tokens)"},{value:"xhigh",label:"xhigh",description:"Extended reasoning (~32k tokens)"},{value:"max",label:"max",description:"Maximum reasoning the model supports"}]}},hideThinkingBlock:{type:"boolean",default:!1,ui:{tab:"model",group:"Thinking",label:"Hide Thinking Blocks",description:"Hide thinking blocks in assistant responses"}},expandThinkingBlocks:{type:"boolean",default:!1,ui:{tab:"model",group:"Thinking",label:"Expand Thinking Blocks",description:"Keep finished thinking blocks expanded instead of collapsing them when the turn ends",condition:"nativeRendering"}},proseOnlyThinking:{type:"boolean",default:!0,ui:{tab:"model",group:"Thinking",label:"Prose Only Thinking",description:"Omit code blocks from thinking summaries and replace them with an ellipsis"}},omitThinking:{type:"boolean",default:!1,ui:{tab:"model",group:"Thinking",label:"Omit Thinking summaries",description:"Instruct upstream providers to completely omit thinking summaries from responses (where supported)"}},externalThinking:{type:"boolean",default:!1,ui:{tab:"model",group:"Thinking",label:"External Thinking",description:"Private scratchpad; not shown to user. Disables supported GPT, Claude, and Gemini reasoning",warning:"At your own risk: providers have flagged this request shape as abuse, up to account-level enforcement"}},"model.loopGuard.enabled":{type:"boolean",default:!0,ui:{tab:"model",group:"Thinking",label:"Loop Guard",description:"Enable automatic stream loop detection for model reasoning and prose"}},"model.loopGuard.checkAssistantContent":{type:"boolean",default:!0,ui:{tab:"model",group:"Thinking",label:"Loop Guard Scan Prose",description:"Apply loop guard to assistant prose messages in addition to thinking logs"}},"model.loopGuard.toolCallReminder":{type:"boolean",default:!0,ui:{tab:"model",group:"Thinking",label:"Loop Guard Tool-Call Reminder",description:"When a Gemini reasoning stream emits many consecutive planning headers without calling a tool, interrupt it and inject a reminder to issue a tool call (requires Loop Guard)"}},"model.toolCallLoopGuard.enabled":{type:"boolean",default:!0,ui:{tab:"model",group:"Thinking",label:"Tool-Call Loop Guard",description:"Detect consecutive identical tool calls across turns and inject a corrective steer"}},"model.toolCallLoopGuard.threshold":{type:"number",default:5,ui:{tab:"model",group:"Thinking",label:"Tool-Call Loop Threshold",description:"Consecutive identical tool calls required before the corrective steer is injected"}},"model.toolCallLoopGuard.exemptTools":{type:"array",default:["wait"],ui:{tab:"model",group:"Thinking",label:"Tool-Call Loop Exempt Tools",description:"Tool names that may repeat consecutively without triggering the cross-turn loop guard"}},inlineToolDescriptors:{type:"enum",default:"auto",values:["auto","on","off"],ui:{tab:"model",group:"Prompt",label:"Inline Tool Descriptors",description:"Render full tool descriptors in the system prompt and strip top-level/nested descriptions from provider tool schemas so descriptor text is sent once. Auto enables this for Gemini models and disables it otherwise",options:[{value:"auto",label:"Auto",description:"Inline descriptors for Gemini models; keep them in tool schemas otherwise"},{value:"on",label:"On",description:"Always inline descriptors in the system prompt"},{value:"off",label:"Off",description:"Keep descriptors in provider tool schemas only"}]}},includeModelInPrompt:{type:"boolean",default:!0,ui:{tab:"model",group:"Prompt",label:"Include Model in Prompt",description:"Surface the active model identifier in the system prompt so the agent knows which model it is"}},includeWorkspaceTree:{type:"boolean",default:!1,ui:{tab:"model",group:"Prompt",label:"Include Workspace Tree",description:"Render the workspace directory tree in the system prompt. WARNING: This can bust prompt caching across sessions when files are modified."}},skillful:{type:"boolean",default:!0,ui:{tab:"model",group:"Prompt",label:"List Skills in Prompt",description:"List available skills in the system prompt; disable to save context and toggle per-session with /skillful"}},personality:{type:"enum",default:"default",values:["default","friendly","pragmatic","none"],ui:{tab:"model",group:"Prompt",label:"Personality",description:"Communication style rendered into the system prompt's personality block",options:[{value:"default",label:"Default",description:"Terse, evidence-first engineer; dense, action-oriented replies"},{value:"friendly",label:"Friendly",description:"Warm, encouraging collaborator focused on momentum and morale"},{value:"pragmatic",label:"Pragmatic",description:"Direct, efficient engineer focused on clarity and rigor"},{value:"none",label:"None",description:"Omit the personality block entirely"}]}},temperature:{type:"number",default:-1,ui:{tab:"model",group:"Sampling",label:"Temperature",description:"Sampling temperature (0 = deterministic, 1 = creative, -1 = provider default)",options:[{value:"-1",label:"Default",description:"Use provider default"},{value:"0",label:"0",description:"Deterministic"},{value:"0.2",label:"0.2",description:"Focused"},{value:"0.5",label:"0.5",description:"Balanced"},{value:"0.7",label:"0.7",description:"Creative"},{value:"1",label:"1",description:"Maximum variety"}]}},topP:{type:"number",default:-1,ui:{tab:"model",group:"Sampling",label:"Top P",description:"Nucleus sampling cutoff (0-1, -1 = provider default)",options:[{value:"-1",label:"Default",description:"Use provider default"},{value:"0.1",label:"0.1",description:"Very focused"},{value:"0.3",label:"0.3",description:"Focused"},{value:"0.5",label:"0.5",description:"Balanced"},{value:"0.9",label:"0.9",description:"Broad"},{value:"1",label:"1",description:"No nucleus filtering"}]}},topK:{type:"number",default:-1,ui:{tab:"model",group:"Sampling",label:"Top K",description:"Sample from top-K tokens (-1 = provider default)",options:[{value:"-1",label:"Default",description:"Use provider default"},{value:"1",label:"1",description:"Greedy top token"},{value:"20",label:"20",description:"Focused"},{value:"40",label:"40",description:"Balanced"},{value:"100",label:"100",description:"Broad"}]}},minP:{type:"number",default:-1,ui:{tab:"model",group:"Sampling",label:"Min P",description:"Minimum probability threshold (0-1, -1 = provider default)",options:[{value:"-1",label:"Default",description:"Use provider default"},{value:"0.01",label:"0.01",description:"Very permissive"},{value:"0.05",label:"0.05",description:"Balanced"},{value:"0.1",label:"0.1",description:"Strict"}]}},presencePenalty:{type:"number",default:-1,ui:{tab:"model",group:"Sampling",label:"Presence Penalty",description:"Penalty for introducing already-present tokens (-1 = provider default)",options:[{value:"-1",label:"Default",description:"Use provider default"},{value:"0",label:"0",description:"No penalty"},{value:"0.5",label:"0.5",description:"Mild novelty"},{value:"1",label:"1",description:"Encourage novelty"},{value:"2",label:"2",description:"Strong novelty"}]}},repetitionPenalty:{type:"number",default:-1,ui:{tab:"model",group:"Sampling",label:"Repetition Penalty",description:"Penalty for repeated tokens (-1 = provider default)",options:[{value:"-1",label:"Default",description:"Use provider default"},{value:"0.8",label:"0.8",description:"Allow repetition"},{value:"1",label:"1",description:"No penalty"},{value:"1.1",label:"1.1",description:"Mild penalty"},{value:"1.2",label:"1.2",description:"Balanced"},{value:"1.5",label:"1.5",description:"Strong penalty"}]}},textVerbosity:{type:"enum",default:"medium",values:["low","medium","high"],ui:{tab:"model",group:"Sampling",label:"Text Verbosity",description:"OpenAI Responses and Codex response verbosity (low, medium, or high)",options:[{value:"low",label:"Low",description:"Prefer concise responses"},{value:"medium",label:"Medium",description:"Balance brevity and detail (default)"},{value:"high",label:"High",description:"Prefer detailed responses"}]}},"tier.openai":{type:"enum",default:"none",values:["none","auto","default","flex","scale","priority","ultrafast"],ui:{tab:"model",group:"Sampling",label:"Service Tier — OpenAI",description:"Processing tier for OpenAI / OpenAI-Codex requests, and OpenAI-family models routed via OpenRouter (none = omit). Sent as `service_tier`.",options:[{value:"none",label:"None",description:"Omit service_tier (standard processing)"},{value:"auto",label:"Auto",description:"Provider default tier selection"},{value:"default",label:"Default",description:"Standard priority processing"},{value:"flex",label:"Flex",description:"Lower cost, higher latency when available"},{value:"scale",label:"Scale",description:"Scale Tier credits when available"},{value:"priority",label:"Priority",description:"Faster, higher cost (premium request)"},{value:"ultrafast",label:"Ultrafast",description:"Lowest-latency serving; OpenAI API preview access, or Codex models that advertise it"}]}},"tier.anthropic":{type:"enum",default:"none",values:["none","priority"],ui:{tab:"model",group:"Sampling",label:"Service Tier — Anthropic",description:'Processing tier for Claude requests. `priority` realizes fast mode (`speed: "fast"`) on supported direct Anthropic models; ignored on Bedrock/Vertex Claude and via OpenRouter.',options:[{value:"none",label:"None",description:"Standard processing"},{value:"priority",label:"Priority",description:'Fast mode (`speed: "fast"`) on supported direct Claude models; ignored on Bedrock/Vertex'}]}},"tier.google":{type:"enum",default:"none",values:["none","flex","priority"],ui:{tab:"model",group:"Sampling",label:"Service Tier — Google",description:"Processing tier for Gemini (Google AI Studio + Vertex) requests, and Google-family models routed via OpenRouter (none = omit). Sent as the top-level `serviceTier` field.",options:[{value:"none",label:"None",description:"Standard processing"},{value:"flex",label:"Flex",description:"Lower cost, higher latency (Gemini API + Vertex)"},{value:"priority",label:"Priority",description:"Faster, higher reliability (Gemini API + Vertex)"}]}},"tier.subagent":{type:"enum",default:"inherit",values:["inherit","none","auto","default","flex","scale","priority","ultrafast"],ui:{tab:"model",group:"Sampling",label:"Service Tier — Subagent",description:"Service Tier for spawned task/eval subagents. Inherit = match the main agent's live per-family tiers (tracks /fast); pick a value to apply it to whichever family the subagent's model belongs to.",options:[{value:"inherit",label:"Inherit",description:"Match the main agent's live per-family tiers"},{value:"none",label:"None",description:"Standard processing"},{value:"auto",label:"Auto",description:"Provider default tier selection (OpenAI family)"},{value:"default",label:"Default",description:"Standard priority processing (OpenAI family)"},{value:"flex",label:"Flex",description:"Flexible capacity tier (OpenAI/Google families)"},{value:"scale",label:"Scale",description:"Scale Tier credits (OpenAI family)"},{value:"priority",label:"Priority",description:"Priority on every supported family of the spawned model"},{value:"ultrafast",label:"Ultrafast",description:"Ultrafast serving (OpenAI family, where available)"}]}},"tier.advisor":{type:"enum",default:"none",values:["inherit","none","auto","default","flex","scale","priority","ultrafast"],ui:{tab:"model",group:"Sampling",label:"Service Tier — Advisor",description:"Service Tier for the advisor model. None = standard processing; Inherit = match the main agent's live per-family tiers; pick a value to apply it to the advisor model's family.",options:[{value:"inherit",label:"Inherit",description:"Match the main agent's live per-family tiers"},{value:"none",label:"None",description:"Standard processing"},{value:"auto",label:"Auto",description:"Provider default tier selection (OpenAI family)"},{value:"default",label:"Default",description:"Standard priority processing (OpenAI family)"},{value:"flex",label:"Flex",description:"Flexible capacity tier (OpenAI/Google families)"},{value:"scale",label:"Scale",description:"Scale Tier credits (OpenAI family)"},{value:"priority",label:"Priority",description:"Priority on every supported family of the spawned model"},{value:"ultrafast",label:"Ultrafast",description:"Ultrafast serving (OpenAI family, where available)"}],condition:"advisorEnabled"}},"retry.maxRetries":{type:"number",default:10,ui:{tab:"model",group:"Retry & Fallback",label:"Retry Attempts",description:"Maximum retry attempts on API errors",options:[{value:"1",label:"1 retry"},{value:"2",label:"2 retries"},{value:"3",label:"3 retries"},{value:"5",label:"5 retries"},{value:"10",label:"10 retries"}]}},"retry.maxDelayMs":{type:"number",default:300000,ui:{tab:"model",group:"Retry & Fallback",label:"Max Retry Delay",description:"Maximum wait between retries, in ms. When the provider asks us to wait longer than this and no credential or model fallback succeeds, the request fails fast instead of sleeping (e.g. 3-hour Anthropic rate-limit windows). 0 disables the ceiling — to let the session auto-resume through provider-stated quota resets."}},"retry.waitForUsageReset":{type:"boolean",default:!1,ui:{tab:"model",group:"Retry & Fallback",label:"Wait For Usage Reset",description:"When a provider reports usage-limit exhaustion with a reset time (5-hour or weekly quota windows on any provider), sleep until the reset instead of failing fast past retry.maxDelayMs. Waits are abortable (Esc) but also hold subagents, so leave off for unattended runs."}},"retry.modelFallback":{type:"boolean",default:!0,ui:{tab:"model",group:"Retry & Fallback",label:"Retry Model Fallback",description:"Allow retry recovery to switch to models in retry.fallbackChains after provider errors. Independent of Auto-Promote Context"}},"retry.fallbackOn":{type:"enum",default:"any",values:["any","usage-limit","except-usage-limit"],ui:{tab:"model",group:"Retry & Fallback",label:"Fallback Trigger",description:"Which failed requests may switch to a configured fallback model",options:[{value:"any",label:"Any error",description:"Every provider error may switch models"},{value:"usage-limit",label:"Usage limits only",description:"Switch only on a usage limit; retry other errors on the same model, then surface them"},{value:"except-usage-limit",label:"All but usage limits",description:"Wait out or surface a usage limit; switch on other errors"}]}},"retry.usageAwareFallback":{type:"boolean",default:!1,ui:{tab:"model",group:"Retry & Fallback",label:"Usage-Aware Fallback",description:"Use reliable coding-plan quota reports to prefer same-provider accounts, then configured fallback models, before a hard usage limit. Ordinary configured API keys are excluded."}},"retry.usageReservePct":{type:"number",default:10,ui:{tab:"model",group:"Retry & Fallback",label:"Reserve Margin",description:"Treat a coding-plan model as near its limit below this remaining percentage. Unknown or unmapped usage keeps the primary model.",condition:"usageAwareFallbackEnabled",options:[{value:"5",label:"5%",description:"Act only when nearly exhausted"},{value:"10",label:"10%",description:"Balanced safety margin"},{value:"15",label:"15%",description:"Conservative"},{value:"20",label:"20%",description:"Early protection"},{value:"25",label:"25%",description:"Very conservative"}]}},"retry.usageReservePolicy":{type:"enum",default:"confirm",values:["confirm","auto","fail-closed"],ui:{tab:"model",group:"Retry & Fallback",label:"Reserve Policy",description:"What to do when every same-provider coding-plan account is inside the reserve margin.",condition:"usageAwareFallbackEnabled",options:[{value:"confirm",label:"Confirm interactively",description:"Keep interactive sessions on the primary until confirmed; background agents auto-fallback"},{value:"auto",label:"Auto-fallback",description:"Always select the next eligible configured fallback"},{value:"fail-closed",label:"Fail closed",description:"Do not spend reserve quota or select a fallback"}]}},"retry.fallbackChains":{type:"record",default:{},ui:{tab:"model",group:"Retry & Fallback",label:"Retry Fallback Chains",description:`JSON object mapping model roles, model selectors ("provider/model-id"), or provider wildcards ("provider/*") to ordered fallback selectors, e.g. {"default":["openai/gpt-4o-mini"],"google-antigravity/*":["google/*","google-vertex/*"]}. Model-oriented keys apply whenever that model/provider is active, regardless of role; a "provider/*" entry keeps the failing model's id and swaps the provider. An id-prefixed wildcard ("openrouter/google/*") re-prefixes the failing model's bare id (google-antigravity/gemini-x -> openrouter/google/gemini-x) and, used as a key, matches only that provider's ids under the prefix. A fallback entry may carry an explicit thinking suffix ("provider/model:low", ":high", ":max", ":off"); a bare entry inherits the failing turn's effort, and "provider/*" entries always inherit.`}},"retry.fallbackRevertPolicy":{type:"enum",default:"cooldown-expiry",values:["cooldown-expiry","never"],ui:{tab:"model",group:"Retry & Fallback",label:"Fallback Revert Policy",description:"When to return to the primary model after a fallback",options:[{value:"cooldown-expiry",label:"Cooldown expiry",description:"Return to the primary model after its suppression window ends"},{value:"never",label:"Never",description:"Stay on the fallback model until manually changed"}]}},"providers.anthropic.serverSideFallback":{type:"boolean",default:!1,ui:{tab:"model",group:"Retry & Fallback",label:"Anthropic Server-Side Fallback (Fable 5)",description:"When a Claude Fable 5 / Mythos 5 request is blocked by Anthropic's safety classifier, retry it on Claude Opus 5 server-side (Anthropic `server-side-fallback-2026-06-01` beta). Opt-in — leaving this off preserves the pre-fallback behavior for every request."}},"providers.ollama-cloud.maxConcurrency":{type:"number",default:3,ui:{tab:"providers",group:"Services",label:"Ollama Cloud Max Concurrency",description:"Maximum concurrent Ollama Cloud subagent runs per process; 0 disables the provider-specific limit"}},"providers.webSearchTimeoutSeconds":{type:"number",default:60,ui:{tab:"providers",group:"Services",label:"Web Search Timeout",description:"Hard timeout for each provider's search transport before web_search advances to the next fallback, in seconds (maximum 300)",options:[{value:"30",label:"30 seconds"},{value:"60",label:"1 minute"},{value:"120",label:"2 minutes"},{value:"180",label:"3 minutes"},{value:"300",label:"5 minutes"}]}},"providers.antigravityEndpoint":{type:"enum",default:"auto",values:["auto","production","sandbox"],ui:{tab:"providers",group:"Services",label:"Antigravity Endpoint Mode",description:"Endpoint routing strategy for google-antigravity providers (chat, search, image, discovery)",options:[{value:"auto",label:"Auto",description:"Try production endpoint, fail over to sandbox on 5xx/429"},{value:"production",label:"Production Only",description:"Force production endpoint only"},{value:"sandbox",label:"Sandbox Only",description:"Force sandbox endpoint only"}]}},"providers.fireworksTier":{type:"enum",default:"standard",values:["standard","priority"],ui:{tab:"providers",group:"Fireworks",label:"Fireworks Tier",description:'Serving path for Fireworks requests. Priority sends `service_tier: "priority"` for higher reliability during peak traffic at a higher price; Standard omits it. Fast (`-fast`) models ignore this — Fast is its own serving path.',options:[{value:"standard",label:"Standard",description:"Default serving path (no service_tier)"},{value:"priority",label:"Priority",description:"Priority serving path: higher reliability, premium per-token pricing"}]}},"providers.tinyModelDevice":{type:"enum",default:"default",values:["default","gpu","cpu","mlx","metal","webgpu","cuda","dml","coreml","auto","wasm","webnn","webnn-gpu","webnn-cpu","webnn-npu"],ui:{tab:"providers",group:"Tiny Model",label:"Tiny Model Device",description:"Inference backend for local tiny models (titles + memory): an ONNX execution provider, or `mlx` to download MLX weights and run them through mlx-lm on Apple silicon. Default uses CPU-only ONNX. The PI_TINY_DEVICE env var overrides this.",options:[{value:"default",label:"Default",description:"CPU-only inference"},{value:"gpu",label:"GPU",description:"Accelerated provider (WebGPU/Metal, CUDA, or DirectML)"},{value:"cpu",label:"CPU",description:"CPU-only inference"},{value:"mlx",label:"MLX",description:"Apple silicon GPU via mlx-lm (Python subprocess; macOS arm64)"},{value:"metal",label:"Metal",description:"Alias for MLX"},{value:"webgpu",label:"WebGPU",description:"WebGPU/Metal backend"},{value:"cuda",label:"CUDA",description:"NVIDIA CUDA (Linux x64)"},{value:"dml",label:"DirectML",description:"DirectML backend (Windows)"},{value:"coreml",label:"CoreML",description:"Apple CoreML (opt-in; can fail to load)"},{value:"auto",label:"Auto",description:"Let ONNX Runtime choose a provider"},{value:"wasm",label:"WASM",description:"WebAssembly backend"},{value:"webnn",label:"WebNN",description:"WebNN backend"},{value:"webnn-gpu",label:"WebNN GPU",description:"WebNN GPU device"},{value:"webnn-cpu",label:"WebNN CPU",description:"WebNN CPU device"},{value:"webnn-npu",label:"WebNN NPU",description:"WebNN NPU device"}]}},"providers.tinyModelDtype":{type:"enum",default:"default",values:["default","q4","q4f16","q8","fp16","fp32","int8","uint8","bnb4","q2","q2f16","q1","q1f16","auto"],ui:{tab:"providers",group:"Tiny Model",label:"Tiny Model Precision",description:"ONNX quantization/precision for local tiny models. Default uses each model's shipped dtype (q4); lower precision is faster, higher is more faithful. Ignored by the MLX backend (its repos are pre-quantized 4-bit). The PI_TINY_DTYPE env var overrides this.",options:[{value:"default",label:"Default",description:"Each model's shipped dtype (currently q4)"},{value:"q4",label:"q4",description:"4-bit weights; smallest and fastest"},{value:"q4f16",label:"q4f16",description:"4-bit weights with fp16 activations"},{value:"q8",label:"q8",description:"8-bit quantization"},{value:"fp16",label:"fp16",description:"16-bit float; higher fidelity, larger"},{value:"fp32",label:"fp32",description:"Full precision; largest and slowest"},{value:"int8",label:"int8",description:"Signed 8-bit integer"},{value:"uint8",label:"uint8",description:"Unsigned 8-bit integer"},{value:"bnb4",label:"bnb4",description:"bitsandbytes 4-bit"},{value:"q2",label:"q2",description:"2-bit weights"},{value:"q2f16",label:"q2f16",description:"2-bit weights with fp16 activations"},{value:"q1",label:"q1",description:"1-bit weights"},{value:"q1f16",label:"q1f16",description:"1-bit weights with fp16 activations"},{value:"auto",label:"Auto",description:"Let transformers.js choose per device"}]}},"providers.autoThinkingMaxEffort":{type:"enum",default:"xhigh",values:["xhigh","max"],ui:{tab:"model",group:"Thinking",label:"Auto Thinking Ceiling",description:"Highest effort the `auto` classifier may resolve. `xhigh` keeps the classifier one tier below the top, so only an explicit `ultrathink` reaches `max`; `max` lets a turn the classifier judges exceptional bill the top tier on models that expose it.",condition:"autoThinkingActive",options:[{value:"xhigh",label:"xhigh",description:"Classifier stops at xhigh (default)"},{value:"max",label:"max",description:"Classifier may resolve max where the model supports it"}]}},"features.unexpectedStopDetection":{type:"enum",default:"mechanical",values:["none","mechanical","smart"],ui:{tab:"interaction",group:"Agent",label:"Unexpected Stops",description:"Automatically recover when the assistant stops without a visible message. Smart also classifies text-only stops with a small model.",options:[{value:"none",label:"None",description:"Disabled"},{value:"mechanical",label:"Mechanical",description:"Retry stops with no visible assistant message; tool calls are excluded (default)"},{value:"smart",label:"Smart",description:"Mechanical + small-model classification of text-only stops"}]}},"providers.kimiApiFormat":{type:"enum",default:"auto",values:["auto","openai","anthropic"],ui:{tab:"providers",group:"Protocol",label:"Kimi API Format",description:"API format for Kimi Code provider (auto follows live model metadata)",options:[{value:"auto",label:"Auto",description:"Use the model's server-declared protocol"},{value:"openai",label:"OpenAI",description:"api.kimi.com"},{value:"anthropic",label:"Anthropic",description:"api.moonshot.ai"}]}},"providers.openaiWebsockets":{type:"enum",default:"auto",values:["auto","off","on"],ui:{tab:"providers",group:"Protocol",label:"OpenAI WebSockets",description:"Websocket policy for OpenAI Codex models (auto uses model defaults, on forces, off disables)",options:[{value:"auto",label:"Auto",description:"Use model/provider default websocket behavior"},{value:"off",label:"Off",description:"Disable websockets for OpenAI Codex models"},{value:"on",label:"On",description:"Force websockets for OpenAI Codex models"}]}},"providers.openaiLiveSteering":{type:"boolean",default:!0,ui:{tab:"providers",group:"Protocol",label:"OpenAI Live Steering",description:"Deliver messages typed while a GPT-6 response streams into that response over the Codex WebSocket, instead of waiting for the next tool boundary"}},"providers.muse-code.storeResponses":{type:"boolean",default:!1,ui:{tab:"providers",group:"Protocol",label:"Muse Code Stored Responses",description:"Store Muse Code results on Meta's servers so a turn whose connection drops is recovered instead of re-run. Stored runs keep prompts and outputs on Meta's side."}},"providers.cacheRetention":{type:"enum",default:"auto",values:["auto","short","long","none"],ui:{tab:"providers",group:"Protocol",label:"Prompt Cache Retention",description:"Prompt-cache retention forwarded to providers that support it (Anthropic, Bedrock, OpenRouter, OpenAI)",options:[{value:"auto",label:"Auto",description:"Provider default — Anthropic OAuth subscriber sessions default to 1h, API keys use 5m; PI_CACHE_RETENTION still applies"},{value:"short",label:"Short (5m)",description:"Cheapest cache writes; pair with cache warming to keep short entries alive while idle"},{value:"long",label:"Long (1h+)",description:"Longer TTL where supported (Anthropic/Bedrock 1h, OpenAI GPT-5.6+ Responses 12h); pricier writes, only warmed during active runs"},{value:"none",label:"Off",description:"Disable prompt caching and cache-affinity routing"}]}},"providers.cacheWarming":{type:"enum",default:"idle",values:["off","streaming","idle"],ui:{tab:"providers",group:"Protocol",label:"Cache Warming",description:"Re-send the last request with a one-token output budget shortly before its prompt-cache entry expires",options:[{value:"off",label:"Off",description:"Disable cache warming"},{value:"streaming",label:"Streaming",description:"Protect expensive prefixes during long tool executions; stops when the agent settles"},{value:"idle",label:"Idle",description:"Also refresh 5-minute entries between runs while the expected savings stay above the cost floor"}]}},"providers.streamFirstEventTimeoutSeconds":{type:"number",default:-1,ui:{tab:"providers",group:"Timeouts",label:"Stream First Event Timeout",description:"Seconds to wait for the first model stream event; -1 uses provider/env defaults, 0 disables the watchdog",options:[{value:"-1",label:"Auto",description:"Use provider defaults and PI_* timeout env vars"},{value:"0",label:"Off",description:"Disable first-event timeout"},{value:"300",label:"5 minutes"},{value:"600",label:"10 minutes"},{value:"1800",label:"30 minutes"}]}},"providers.streamIdleTimeoutSeconds":{type:"number",default:-1,ui:{tab:"providers",group:"Timeouts",label:"Stream Idle Timeout",description:"Seconds a model stream may stay silent between events; -1 uses provider/env defaults, 0 disables the watchdog",options:[{value:"-1",label:"Auto",description:"Use provider defaults and PI_* timeout env vars"},{value:"0",label:"Off",description:"Disable idle timeout"},{value:"300",label:"5 minutes"},{value:"600",label:"10 minutes"},{value:"1800",label:"30 minutes"}]}},"providers.openrouterVariant":{type:"enum",default:"default",values:["default","nitro","floor","online","exacto"],ui:{tab:"providers",group:"Protocol",label:"OpenRouter Routing",description:"Default routing-variant suffix appended to OpenRouter model IDs (overridden when the selector already names a variant)",options:[{value:"default",label:"Default",description:"No suffix; use OpenRouter's default routing"},{value:"nitro",label:":nitro",description:"Prioritize throughput / lowest latency"},{value:"floor",label:":floor",description:"Prioritize cheapest available provider"},{value:"online",label:":online",description:"Enable OpenRouter's web-search plugin"},{value:"exacto",label:":exacto",description:"Cherry-picked high-quality providers (only defined for select models)"}]}},"live.voice":{type:"enum",default:"sol",values:["arbor","breeze","cove","ember","juniper","maple","sol","spruce","vale"],ui:{tab:"providers",group:"Services",label:"Live Voice",description:"Voice used by Codex-backed realtime voice sessions",options:[{value:"arbor",label:"Arbor"},{value:"breeze",label:"Breeze"},{value:"cove",label:"Cove"},{value:"ember",label:"Ember"},{value:"juniper",label:"Juniper"},{value:"maple",label:"Maple"},{value:"sol",label:"Sol"},{value:"spruce",label:"Spruce"},{value:"vale",label:"Vale"}]}},"tts.localVoice":{type:"enum",default:"af_heart",values:["af_heart","af_bella","af_nicole","af_aoede","af_kore","af_sarah","am_michael","am_fenrir","am_puck","bf_emma","bm_george","bm_fable"],ui:{tab:"providers",group:"Services",label:"Local TTS Voice",description:"Kokoro voice used by the local TTS backend (American/British, female/male)",options:[{value:"af_heart",label:"Heart (American female)"},{value:"af_bella",label:"Bella (American female)"},{value:"af_nicole",label:"Nicole (American female)"},{value:"af_aoede",label:"Aoede (American female)"},{value:"af_kore",label:"Kore (American female)"},{value:"af_sarah",label:"Sarah (American female)"},{value:"am_michael",label:"Michael (American male)"},{value:"am_fenrir",label:"Fenrir (American male)"},{value:"am_puck",label:"Puck (American male)"},{value:"bf_emma",label:"Emma (British female)"},{value:"bm_george",label:"George (British male)"},{value:"bm_fable",label:"Fable (British male)"}]}},"tts.localSpeed":{type:"number",default:1,ui:{tab:"providers",group:"Services",label:"Local TTS Speed",description:"Speaking rate of the local TTS backend (tts tool, omp say). 1 = normal; clamped to 0.5–2.5",options:[{value:"0.5",label:"0.5×"},{value:"0.75",label:"0.75×"},{value:"1",label:"1× (normal)"},{value:"1.25",label:"1.25×"},{value:"1.5",label:"1.5×"},{value:"1.75",label:"1.75×"},{value:"2",label:"2×"},{value:"2.5",label:"2.5×"}]}},"speech.enabled":{type:"boolean",default:!1,ui:{tab:"providers",group:"Services",label:"Speech Vocalization",description:"Speak the assistant's output aloud through the speakers as it streams"}},"speech.mode":{type:"enum",default:"assistant",values:["all","assistant","yield"],ui:{tab:"providers",group:"Services",label:"Speech Vocalization Mode",description:"What to speak: all = assistant messages + thinking; assistant = messages only; yield = only the final message at turn end",options:[{value:"all",label:"All (messages + thinking)"},{value:"assistant",label:"Assistant messages"},{value:"yield",label:"Final message only"}]}},"speech.enhanced":{type:"boolean",default:!1,ui:{tab:"providers",group:"Services",label:"Enhanced Speech Rewriting",description:"Rewrite assistant output into natural spoken prose with the tiny/smol model before synthesis (describes code, drops links and markdown). Falls back to mechanical cleanup on failure"}},"speech.voice":{type:"enum",default:"af_heart",values:["af_heart","af_bella","af_nicole","af_aoede","af_kore","af_sarah","am_michael","am_fenrir","am_puck","bf_emma","bm_george","bm_fable"],ui:{tab:"providers",group:"Services",label:"Speech Vocalization Voice",description:"Kokoro voice used when speaking the assistant's output aloud",options:[{value:"af_heart",label:"Heart (American female)"},{value:"af_bella",label:"Bella (American female)"},{value:"af_nicole",label:"Nicole (American female)"},{value:"af_aoede",label:"Aoede (American female)"},{value:"af_kore",label:"Kore (American female)"},{value:"af_sarah",label:"Sarah (American female)"},{value:"am_michael",label:"Michael (American male)"},{value:"am_fenrir",label:"Fenrir (American male)"},{value:"am_puck",label:"Puck (American male)"},{value:"bf_emma",label:"Emma (British female)"},{value:"bm_george",label:"George (British male)"},{value:"bm_fable",label:"Fable (British male)"}]}},"speech.speed":{type:"number",default:1,ui:{tab:"providers",group:"Services",label:"Speech Vocalization Speed",description:"Speaking rate when reading the assistant's output aloud. 1 = normal; clamped to 0.5–2.5",options:[{value:"0.5",label:"0.5×"},{value:"0.75",label:"0.75×"},{value:"1",label:"1× (normal)"},{value:"1.25",label:"1.25×"},{value:"1.5",label:"1.5×"},{value:"1.75",label:"1.75×"},{value:"2",label:"2×"},{value:"2.5",label:"2.5×"}]}},"providers.fetch":{type:"enum",default:"auto",values:["auto","native","trafilatura","lynx","parallel","firecrawl","jina"],ui:{tab:"providers",group:"Services",label:"Fetch Provider",description:"Reader backend priority for the fetch/read URL tool",options:[{value:"auto",label:"Auto",description:"Priority: native > trafilatura > lynx > parallel > firecrawl > jina"},{value:"native",label:"Native",description:"In-process HTML→Markdown converter (always available)"},{value:"trafilatura",label:"Trafilatura",description:"Auto-installs via uv/pip"},{value:"lynx",label:"Lynx",description:"Requires lynx system package"},{value:"parallel",label:"Parallel",description:"Requires PARALLEL_API_KEY"},{value:"firecrawl",label:"Firecrawl",description:"Requires FIRECRAWL_API_KEY"},{value:"jina",label:"Jina",description:"Uses r.jina.ai reader (JINA_API_KEY optional)"}]}},"codexResets.autoRedeem":{type:"enum",default:"unset",values:["unset","yes","no"],ui:{tab:"providers",group:"Services",label:"Codex Auto-Redeem Saved Resets",description:"Spend saved Codex rate-limit resets automatically: restore an account blocked by an exhausted 5h or weekly window when a turn is stuck and no other account can take over, and salvage credits that are about to expire. unset asks before the first spend (with no prompt UI, it spends only a reset expiring within 5 minutes), yes spends without prompting, and no disables both checks.",options:[{value:"unset",label:"Unset",description:"Check eligibility, then ask before spending the first saved reset. With no prompt UI, spend only a reset expiring within 5 minutes."},{value:"yes",label:"Yes",description:"Spend eligible saved resets without prompting."},{value:"no",label:"No",description:"Do not run the saved-reset auto-redeem check."}]}},"codexResets.minBlockedMinutes":{type:"number",default:60,ui:{tab:"providers",group:"Services",label:"Codex Auto-Redeem Min Block",description:"Only auto-redeem when the natural unblock — the latest reset among the exhausted 5h/weekly windows — is at least this many minutes away (don't spend a scarce credit to save a short wait). Raise it (e.g. 360) to ignore 5h-only blocks."}},"codexResets.keepCredits":{type:"number",default:0,ui:{tab:"providers",group:"Services",label:"Codex Auto-Redeem Reserve",description:"Never auto-spend below this many saved resets (0 = the last credit may be spent automatically). Credits about to expire are exempt — a reserved credit that expires preserves nothing."}},"codexResets.salvageHorizonHours":{type:"number",default:12,ui:{tab:"providers",group:"Services",label:"Codex Reset Salvage Horizon",description:"With auto-redeem enabled, spend a saved Codex reset within this many hours of expiry when either chat window has meaningful usage. 0 disables early salvage; credits expiring within 5 minutes are still attempted regardless of usage."}},"claudeResets.autoRedeem":{type:"enum",default:"unset",values:["unset","yes","no"],ui:{tab:"providers",group:"Services",label:"Claude Auto-Redeem Resets",description:"Spend eligible Claude Cedar or Juniper resets automatically. Cedar is spent only for covered limits; Juniper can only recover a sole 5-hour block. unset asks before the first spend (with no prompt UI, it spends only a reset expiring within 5 minutes), yes spends without prompting, and no disables blocked recovery and expiry salvage.",options:[{value:"unset",label:"Unset",description:"Check live eligibility, then ask before spending the first Claude reset. With no prompt UI, spend only a reset expiring within 5 minutes."},{value:"yes",label:"Yes",description:"Spend eligible Claude resets without prompting."},{value:"no",label:"No",description:"Do not run Claude reset auto-redeem checks."}]}},"claudeResets.minBlockedMinutes":{type:"number",default:60,ui:{tab:"providers",group:"Services",label:"Claude Auto-Redeem Min Block",description:"Only auto-redeem when the natural unblock — the latest reset among the exhausted covered windows — is at least this many minutes away. A 5-hour-only reset is never used for a weekly or model-scoped block."}},"claudeResets.keepCredits":{type:"number",default:0,ui:{tab:"providers",group:"Services",label:"Claude Auto-Redeem Reserve",description:"Keep at least this many Claude resets banked (0 allows the last eligible reset to be spent automatically). The reserve applies to early salvage, but not to eligible resets expiring within 5 minutes."}},"claudeResets.salvageHorizonHours":{type:"number",default:12,ui:{tab:"providers",group:"Services",label:"Claude Reset Salvage Horizon",description:"With auto-redeem enabled, use a server-selected Cedar reset within this many hours of expiry when its covered windows have meaningful usage. 0 disables early salvage; eligible Cedar or Juniper resets expiring within 5 minutes are still attempted regardless of usage or reserve. Provider limit requirements still apply."}},"provider.appendOnlyContext":{type:"enum",default:"auto",values:["auto","on","off"],ui:{tab:"providers",group:"Protocol",label:"Append-Only Context",description:"Cache system prompt + tool specs and keep an append-only message log so provider prefix caches (DeepSeek, Xiaomi/SGLang, Anthropic) hit at maximum rate. Auto enables for known prefix-cache providers.",options:[{value:"auto",label:"Auto",description:"Enable for known prefix-cache providers (recommended)"},{value:"on",label:"On",description:"Always enable append-only context"},{value:"off",label:"Off",description:"Disable append-only context"}]}},"telemetry.otlpExportEnabled":{type:"boolean",default:!0,ui:{tab:"providers",group:"Privacy",label:"OTLP Telemetry Export",description:"Allow OMP to export traces, logs, and metrics using OTEL_* endpoints. Changes take effect on the next launch."}},"advisor.enabled":{type:"boolean",default:!1,ui:{tab:"model",group:"Advisor",label:"Enable Advisor",description:"Pair a second model (assigned to the 'advisor' role) that passively reviews each turn and injects notes."}},"advisor.syncBacklog":{type:"enum",default:"off",values:["off","1","3","5","strict"],ui:{tab:"model",group:"Advisor",label:"Advisor Sync Backlog",description:"Pause main agent until advisor backlog falls below threshold. Numeric values cap wait at 30 seconds; strict waits for all scheduled reviews without a wall-clock cap. Off disables catch-up delays. Abort, failure, and disposal release waits.",condition:"advisorEnabled"}},"advisor.immuneTurns":{type:"number",default:3,ui:{tab:"model",group:"Advisor",label:"Advisor Immune Turns",description:"After an advisor concern or blocker interrupts, route further concerns as non-interrupting asides for this many primary turns. Blockers are exempt from the cooldown.",options:[{value:"0",label:"0 steps",description:"No cooldown."},{value:"1",label:"1 step"},{value:"2",label:"2 steps"},{value:"3",label:"3 steps",description:"Default."},{value:"4",label:"4 steps"},{value:"5",label:"5 steps"}],condition:"advisorEnabled"}},"advisor.continueSeverity":{type:"enum",default:"concern",values:["nit","concern","blocker"],ui:{tab:"model",group:"Advisor",label:"Advisor Continue Severity",description:"Minimum severity of an advisor note that wakes the agent after it finished with a final answer. Lower-severity notes stay as a card at the end of the transcript and reach the agent with your next message.",options:[{value:"nit",label:"Nit",description:"Every note continues the run."},{value:"concern",label:"Concern",description:"Concerns and blockers continue the run. Default."},{value:"blocker",label:"Blocker",description:"Only blockers continue the run."}],condition:"advisorEnabled"}},"advisor.reviewMode":{type:"enum",default:"turn",values:["turn","agent-end"],ui:{tab:"model",group:"Advisor",label:"Advisor Review Mode",description:"Default advisor cadence when no WATCHDOG.yml roster is present. turn reviews every primary turn; agent-end reviews only final yields.",options:[{value:"turn",label:"Every turn",description:"Review every primary update (tool-call round)."},{value:"agent-end",label:"Agent end",description:"Review only at final yields (once per run)."}],condition:"advisorEnabled"}},"advisor.reviewInterval":{type:"number",default:1,ui:{tab:"model",group:"Advisor",label:"Advisor Review Interval",description:"Default advisor cadence when no WATCHDOG.yml roster is present: review every Nth eligible primary update. 1 = every update. Skipped updates are sent with the next scheduled review.",options:[{value:"1",label:"Every eligible update",description:"Default."},{value:"2",label:"Every 2nd"},{value:"3",label:"Every 3rd"},{value:"5",label:"Every 5th"},{value:"10",label:"Every 10th"}],condition:"advisorEnabled"}},"advisor.maxNotesPerUpdate":{type:"number",default:4,ui:{tab:"model",group:"Advisor",label:"Advisor Max Notes Per Update",description:"Maximum non-blocker advice notes accepted per advisor prompt update (1–32; UI offers 1–5 quick picks). Blockers are exempt.",options:[{value:"1",label:"1 note",description:"Anti-flood (strict)."},{value:"2",label:"2 notes"},{value:"3",label:"3 notes"},{value:"4",label:"4 notes",description:"Frontier reasoning models. Default."},{value:"5",label:"5 notes"}],condition:"advisorEnabled"}},"advisor.evictStaleResults":{type:"boolean",default:!0,ui:{tab:"model",group:"Advisor",label:"Advisor Evict Stale Results",description:"Before each review, replace the advisor's read/grep/glob output from older reviews with a short placeholder. The latest review is kept.",condition:"advisorEnabled"}},"workspace.additionalDirectories":{type:"array",default:[],ui:{tab:"context",group:"General",label:"Additional Workspace Dirs",description:"Extra workspace directories added to every session as additional roots (multi-root workspace). Managed live via /add-dir and /remove-dir. Paths resolve relative to cwd; absolute paths recommended. The agent is told these roots exist and can read/grep/glob them."}},"contextFiles.extra":{type:"array",default:[],ui:{tab:"context",group:"General",label:"Extra Context Files",editor:"json",description:'Extra instruction filenames loaded beside AGENTS.md. Use a JSON list of names, not paths, e.g. ["AGENTS.local.md"]; [] disables extras. Start a new session to load them.',condition:"contextFilesExtraNotProject"}},"contextPromotion.enabled":{type:"boolean",default:!1,ui:{tab:"context",group:"General",label:"Auto-Promote Context",description:"Promote to the model's contextPromotionTarget on context overflow instead of compacting. Retry fallback switches are controlled by Retry Model Fallback"}},extendedContext:{type:"boolean",default:!1,ui:{tab:"context",group:"General",label:"Extended Context",description:"Use larger context windows where supported; may incur premium pricing. Off keeps default or standard-pricing windows"}},"compaction.enabled":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Auto-Compact",description:"Automatically compact context when it gets too large"}},"compaction.experimentalContextManagement":{type:"boolean",default:!1,ui:{tab:"context",group:"Compaction",label:"Notes-backed context windows (experimental)",description:"Keep persistent notes and searchable raw history across context windows."}},"compaction.midTurnEnabled":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Mid-Turn Compaction",description:"Check thresholds at safe mid-turn tool-loop boundaries before the next provider request; subagents always check, since their whole assignment is one turn"}},"compaction.methodOrder":{type:"array",default:["remote","snapcompact","handoff","shake","soft"],ui:{tab:"context",group:"Compaction",label:"Compaction Method Order",description:"Preferred fallback order for automatic context maintenance; unavailable or failed methods advance to the next choice",options:[{value:"remote",label:"Server compaction",description:"Use provider-native server compaction (OpenAI Responses compact, Anthropic compaction beta, including on Bedrock) when the active route supports it"},{value:"snapcompact",label:"Snapcompact",description:"Archive history onto dense bitmap images the active vision model reads back; no LLM call"},{value:"handoff",label:"Handoff",description:"Generate a handoff document and continue from it as the compaction summary"},{value:"soft",label:"Soft compaction",description:"Summarize in place with a compaction model without using server compaction"},{value:"shake",label:"Shake",description:"Drop recoverable heavy content in place without an LLM call"}],ordered:!0}},"compaction.thresholdPercent":{type:"number",default:-1,ui:{tab:"context",group:"Compaction",label:"Compaction Threshold",description:"Percent threshold for context maintenance; set to Default to use legacy reserve-based behavior",options:[{value:"default",label:"Default",description:"Legacy reserve-based threshold"},{value:"10",label:"10%",description:"Extremely early maintenance"},{value:"20",label:"20%",description:"Very early maintenance"},{value:"30",label:"30%",description:"Early maintenance"},{value:"40",label:"40%",description:"Moderately early maintenance"},{value:"50",label:"50%",description:"Halfway point"},{value:"60",label:"60%",description:"Moderate context usage"},{value:"70",label:"70%",description:"Balanced"},{value:"75",label:"75%",description:"Slightly aggressive"},{value:"80",label:"80%",description:"Typical threshold"},{value:"85",label:"85%",description:"Aggressive context usage"},{value:"90",label:"90%",description:"Very aggressive"},{value:"95",label:"95%",description:"Near context limit"}]}},"compaction.thresholdTokens":{type:"number",default:-1,ui:{tab:"context",group:"Compaction",label:"Compaction Token Limit",description:"Fixed token limit for context maintenance; overrides percentage if set",options:[{value:"default",label:"Default",description:"Use percentage-based threshold"},{value:"25000",label:"25K tokens",description:"1/8 of a 200K window"},{value:"50000",label:"50K tokens",description:"1/4 of a 200K window"},{value:"100000",label:"100K tokens",description:"1/2 of a 200K window"},{value:"150000",label:"150K tokens",description:"3/4 of a 200K window"},{value:"200000",label:"200K tokens",description:"Full standard context window"},{value:"300000",label:"300K tokens",description:"Large context window"},{value:"500000",label:"500K tokens",description:"Very large context window"}]}},"compaction.handoffSaveToDisk":{type:"boolean",default:!1,ui:{tab:"context",group:"Compaction",label:"Save Handoff Docs",description:"Save generated handoff documents to markdown files for the auto-handoff flow"}},"compaction.remoteStreamingV2Enabled":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Remote Compaction V2",description:"Use Responses streaming compaction for compatible remote compaction models"}},"compaction.asyncEnabled":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Async Compaction",description:"Speculatively summarize in the background as context nears the compaction threshold, then splice the ready result in when the threshold is crossed"}},"compaction.idleEnabled":{type:"boolean",default:!1,ui:{tab:"context",group:"Compaction",label:"Idle Compaction",description:"Compact context while idle when token count exceeds threshold"}},"compaction.idleThresholdTokens":{type:"number",default:200000,ui:{tab:"context",group:"Compaction",label:"Idle Compaction Threshold",description:"Token count above which idle compaction triggers",options:[{value:"100000",label:"100K tokens"},{value:"200000",label:"200K tokens"},{value:"300000",label:"300K tokens"},{value:"400000",label:"400K tokens"},{value:"500000",label:"500K tokens"},{value:"600000",label:"600K tokens"},{value:"700000",label:"700K tokens"},{value:"800000",label:"800K tokens"},{value:"900000",label:"900K tokens"}]}},"compaction.idleTimeoutSeconds":{type:"number",default:300,ui:{tab:"context",group:"Compaction",label:"Idle Compaction Delay",description:"Seconds to wait while idle before compacting; with a 1-hour prompt cache, compaction instead runs just before the cache expires",options:[{value:"60",label:"1 minute"},{value:"120",label:"2 minutes"},{value:"300",label:"5 minutes"},{value:"600",label:"10 minutes"},{value:"1800",label:"30 minutes"},{value:"3600",label:"1 hour"}]}},"compaction.supersedeReads":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Supersede Stale Reads",description:"Prune older read results when the same file is read again (cache-aware, runs every turn)"}},"compaction.dropUseless":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Elide Uneventful Results",description:"Prune tool results flagged contextually useless (no matches, timed-out waits) once consumed (cache-aware)"}},"snapcompact.systemPrompt":{type:"enum",default:"none",values:["none","agents-md","all"],ui:{tab:"context",group:"Experimental",label:"Snapcompact System Prompt",description:"Experimental: render selected system prompt text as dense PNG image(s) and attach to the first user message (vision models only). Saves tokens; loses prompt caching for imaged text.",options:[{value:"none",label:"None",description:"Keep the system prompt as text."},{value:"agents-md",label:"AGENTS.md",description:"Only move loaded context-file instructions to images, when that saves tokens."},{value:"all",label:"All",description:"Move the full system prompt to images, when that saves tokens."}]}},"snapcompact.toolResults":{type:"boolean",default:!1,ui:{tab:"context",group:"Experimental",label:"Snapcompact Tool Results",description:"Experimental: render large tool results, the newest one included, as dense PNG image(s) instead of text (vision models only). Saves tokens on accumulated search and command output; read results stay text unless the model is known to edit exactly from images."}},"tools.format":{type:"enum",default:"auto",values:["auto","native","glm","hermes","kimi","xml","anthropic","deepseek","harmony","qwen3","gemini","gemma","minimax"],ui:{tab:"context",group:"Experimental",label:"Tool Calling Mode",description:"Controls how tools are exposed to the model. Auto uses provider-native tool calls unless the selected model is marked as not supporting them, then falls back to the GLM owned dialect. Native forces provider-native tools; the other values force the named owned dialect.",options:[{value:"auto",label:"Auto",description:"Use native tool calls unless the model is known not to support them."},{value:"native",label:"Native",description:"Use provider-native tool calls."},{value:"glm",label:"GLM",description:"Use GLM-style in-band tool calls."},{value:"hermes",label:"Hermes",description:"Use Hermes-style in-band tool calls."},{value:"kimi",label:"Kimi",description:"Use Kimi-style in-band tool calls."},{value:"xml",label:"XML",description:"Use generic XML in-band tool calls."},{value:"anthropic",label:"Anthropic",description:"Use Anthropic-style in-band tool calls."},{value:"deepseek",label:"DeepSeek",description:"Use DeepSeek-style in-band tool calls."},{value:"harmony",label:"Harmony",description:"Use Harmony-style in-band tool calls."},{value:"qwen3",label:"Qwen3",description:"Use the Qwen3 owned dialect."},{value:"gemini",label:"Gemini",description:"Use the Gemini owned dialect."},{value:"gemma",label:"Gemma",description:"Use the Gemma owned dialect."},{value:"minimax",label:"MiniMax",description:"Use the MiniMax owned dialect."}]}},"snapcompact.shape":{type:"enum",default:"auto",values:["auto","8x8r-bw","8x8r-sent","8x8u-bw","8x8u-sent","6x6u-bw","6x6u-sent","5x8-bw","5x8-sent","6x12-dim","8x13-bw","8on16-bw","8on22-bw","11on16-bw","silver16-bw","doc-8on16-bw","doc-8on16-sent","doc-8on16-sent-dim"],ui:{tab:"context",group:"Experimental",label:"Snapcompact Shape",description:"Frame shape snapcompact prints text with (compaction archive and inline imaging). Auto picks a shape tuned for the current model.",options:[{value:"auto",label:"Auto",description:"Picks a shape tuned for the current model, falling back to its provider family."},{value:"8x8r-bw",label:"8x8 repeated, black",description:"unscii square cell, black ink, every line printed twice with the copy on a pale highlight band."},{value:"8x8r-sent",label:"8x8 repeated, sentence hues",description:"Repeated grid with ink cycling six hues at sentence boundaries."},{value:"8x8u-bw",label:"8x8, black",description:"Plain unscii square cell, single-printed lines, black ink."},{value:"8x8u-sent",label:"8x8, sentence hues",description:"Plain unscii square cell with sentence-hue ink."},{value:"6x6u-bw",label:"6x6 dense, black",description:"unscii squeezed to 6x6 — densest readable cell, fewest frames — in black ink."},{value:"6x6u-sent",label:"6x6 dense, sentence hues",description:"Densest cell with sentence-hue ink."},{value:"5x8-bw",label:"5x8 legacy, black",description:"Original X.org 5x8 glyphs on the 2576px frame, black ink."},{value:"5x8-sent",label:"5x8 legacy, sentence hues",description:"The original snapcompact shape (pre-shape-table sessions rendered this)."},{value:"6x12-dim",label:"6x12, dimmed stopwords",description:"X.org 6x12 glyphs, black ink, function words dimmed gray."},{value:"8x13-bw",label:"8x13, black",description:"X.org 8x13 glyphs, black ink."},{value:"8on16-bw",label:"8x13 on 16px pitch, black",description:"8x13 glyphs on an 8x16 cell (extra leading), black ink."},{value:"8on22-bw",label:"8x13 on 22px pitch (leading), black",description:"8x13 glyphs on an 8x22 cell — extra line spacing so rows don't crowd. Default for OpenAI/Google."},{value:"11on16-bw",label:"8x13 on 11px advance (tracking), black",description:"8x13 glyphs on an 11x16 cell — extra letter spacing so characters don't merge. Default for Anthropic."},{value:"silver16-bw",label:"Silver 16, CJK",description:"Embedded Silver TrueType font on a 16px grid for CJK and other non-Latin text."},{value:"doc-8on16-bw",label:"Doc 8on16, black",description:"Two word-wrapped newspaper columns of 8x13 glyphs on a 16px pitch, black ink."},{value:"doc-8on16-sent",label:"Doc 8on16, sentence hues",description:"Two-column doc layout with sentence-hue ink."},{value:"doc-8on16-sent-dim",label:"Doc 8on16, sentence hues + dimmed stopwords",description:"Two-column doc layout, sentence-hue ink, function words dimmed gray."}]}},"branchSummary.enabled":{type:"boolean",default:!1,ui:{tab:"context",group:"General",label:"Branch Summaries",description:"Prompt to summarize when leaving a branch"}},"memory.backend":{type:"enum",default:"off",values:["off","local","hindsight","mnemopi","sharpshooter"],ui:{tab:"memory",group:"General",label:"Memory Backend",description:"Off, local summary pipeline, Mnemopi SQLite, Hindsight remote memory, or Sharpshooter",options:[{value:"off",label:"Off",description:"No memory subsystem runs"},{value:"local",label:"Local",description:"Local rollout summarisation pipeline (memory_summary.md)"},{value:"hindsight",label:"Hindsight",description:"Vectorize Hindsight remote memory service"},{value:"mnemopi",label:"Mnemopi",description:"Local SQLite recall/retain backend with optional embeddings"},{value:"sharpshooter",label:"Sharpshooter",description:"Friction-gated project decision files (architecture/product/style), consolidated in the background"}]}},"sharpshooter.model":{type:"string",ui:{tab:"memory",group:"Sharpshooter",label:"Sharpshooter Model",description:"Model selector for extraction/consolidation, empty = smol role"}},"autolearn.enabled":{type:"boolean",default:!1,ui:{tab:"memory",group:"Auto-Learn",label:"Auto-Learn (experimental)",description:"After the agent stops, nudge it to capture lessons to memory and create/enhance isolated managed skills"}},"autolearn.autoContinue":{type:"boolean",default:!1,ui:{tab:"memory",group:"Auto-Learn",label:"Auto-run capture at stop",description:"When on, auto-run one private capture turn at stop (uses extra tokens). When off, only standing auto-learn guidance remains.",condition:"autolearnActive"}},"mnemopi.dbPath":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi DB Path",description:"Optional SQLite DB path. Defaults to the agent memories directory.",condition:"mnemopiActive"}},"mnemopi.bank":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Bank",description:"Optional shared bank base name. Per-project modes derive project-local banks from it.",condition:"mnemopiActive"}},"mnemopi.scoping":{type:"enum",default:"per-project",values:["global","per-project","per-project-tagged"],ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Scoping",description:"global = one shared bank; per-project = isolated bank per cwd; per-project-tagged = project-local writes plus global recall visibility",options:[{value:"global",label:"Global",description:"One shared Mnemopi bank for every project"},{value:"per-project",label:"Per project",description:"Project-local Mnemopi bank per cwd basename"},{value:"per-project-tagged",label:"Per project (tagged)",description:"Write to a project-local bank but merge project + shared recall results"}],condition:"mnemopiActive"}},"mnemopi.embeddingVariant":{type:"enum",default:"en",values:["en","multilingual"],ui:{tab:"memory",group:"Mnemopi",label:"Embedding variant",description:"Local embedding model family. en = stronger English model; multilingual = cross-language model. Changing this rebuilds existing memory embeddings on next start.",options:[{value:"en",label:"English (bge-base-en-v1.5)",description:"BAAI/bge-base-en-v1.5 (768d), English-only"},{value:"multilingual",label:"Multilingual (multilingual-e5-large)",description:"intfloat/multilingual-e5-large (1024d), cross-language recall"}],condition:"mnemopiActive"}},"mnemopi.autoRecall":{type:"boolean",default:!0,ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Auto Recall",description:"Recall local memories into the first turn of each session",condition:"mnemopiActive"}},"mnemopi.autoRetain":{type:"boolean",default:!0,ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Auto Retain",description:"Retain completed conversation turns into local Mnemopi memory",condition:"mnemopiActive"}},"mnemopi.polyphonicRecall":{type:"boolean",default:!1,ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Polyphonic Recall",description:"Fuse recall with graph, fact, vector and temporal voices so linked memories surface without a keyword match",condition:"mnemopiActive"}},"mnemopi.enhancedRecall":{type:"boolean",default:!1,ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Enhanced Recall",description:"Cache recall results for repeated and similar queries with identical options; any memory write clears it",condition:"mnemopiActive"}},"mnemopi.proactiveLinking":{type:"boolean",default:!1,ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Proactive Linking",description:"Ingest new memories into the episodic graph as they are stored, linking them to related entities and memories",condition:"mnemopiActive"}},"mnemopi.noEmbeddings":{type:"boolean",default:!1,ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Disable Embeddings",description:"Force deterministic FTS-only recall instead of vector embeddings",condition:"mnemopiActive"}},"mnemopi.embeddingModel":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Embedding Model",description:"Advanced: explicit embedding model id that overrides the variant. Leave empty to use mnemopi.embeddingVariant.",condition:"mnemopiActive"}},"mnemopi.embeddingApiUrl":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Embedding API URL",description:"Optional OpenAI-compatible embedding endpoint passed to Mnemopi",condition:"mnemopiActive"}},"mnemopi.embeddingApiKey":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Embedding API Key",description:"Optional embedding API key passed to Mnemopi",condition:"mnemopiActive"}},"mnemopi.llmMode":{type:"enum",default:"smol",values:["none","smol","remote"],ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi LLM Mode",description:"Use no LLM, the online tiny model (the TINY role from /models, else @smol), or a remote OpenAI-compatible endpoint",condition:"mnemopiActive",options:[{value:"none",label:"None",description:"Disable Mnemopi LLM-backed extraction"},{value:"smol",label:"Online (tiny)",description:"Use the online tiny model (the TINY role from /models, else @smol)"},{value:"remote",label:"Remote",description:"Use the Mnemopi remote LLM settings below"}]}},"mnemopi.llmBaseUrl":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi LLM Base URL",description:"Optional OpenAI-compatible LLM endpoint for Mnemopi remote mode",condition:"mnemopiActive"}},"mnemopi.llmApiKey":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi LLM API Key",description:"Optional LLM API key for Mnemopi remote mode",condition:"mnemopiActive"}},"mnemopi.llmModel":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi LLM Model",description:"Optional LLM model name for Mnemopi remote mode",condition:"mnemopiActive"}},"hindsight.apiUrl":{type:"string",default:"http://localhost:8888",ui:{tab:"memory",group:"Hindsight",label:"Hindsight API URL",description:"Hindsight server URL (Cloud or self-hosted)",condition:"hindsightActive"}},"hindsight.apiToken":{type:"string",ui:{tab:"memory",group:"Hindsight",label:"Hindsight API Token",description:"Bearer token for authenticated Hindsight servers",condition:"hindsightActive"}},"hindsight.bankId":{type:"string",ui:{tab:"memory",group:"Hindsight",label:"Hindsight Bank ID",description:"Memory bank identifier (default: project name)",condition:"hindsightActive"}},"hindsight.scoping":{type:"enum",default:"per-project-tagged",values:["global","per-project","per-project-tagged"],ui:{tab:"memory",group:"Hindsight",label:"Hindsight Scoping",description:"global = one shared bank; per-project = isolated bank per cwd; per-project-tagged = shared bank with project tags so global + project memories merge on recall",options:[{value:"global",label:"Global",description:"One shared bank — every project sees the same memories"},{value:"per-project",label:"Per project",description:"Isolated bank per cwd basename — projects cannot see each other's memories"},{value:"per-project-tagged",label:"Per project (tagged)",description:"Shared bank, retains tagged with project:<cwd>. Recall surfaces project + untagged global memories together"}],condition:"hindsightActive"}},"hindsight.autoRecall":{type:"boolean",default:!0,ui:{tab:"memory",group:"Hindsight",label:"Hindsight Auto Recall",description:"Recall memories on the first turn of each session",condition:"hindsightActive"}},"hindsight.autoRetain":{type:"boolean",default:!0,ui:{tab:"memory",group:"Hindsight",label:"Hindsight Auto Retain",description:"Retain transcript every N turns and at session boundaries",condition:"hindsightActive"}},"hindsight.retainMode":{type:"enum",default:"full-session",values:["full-session","last-turn"],ui:{tab:"memory",group:"Hindsight",label:"Hindsight Retain Mode",description:"full-session = upsert one document per session, last-turn = chunked",options:[{value:"full-session",label:"Full session",description:"Upsert one document per session (recommended)"},{value:"last-turn",label:"Last turn",description:"Chunked retention sliced by turn boundaries"}],condition:"hindsightActive"}},"hindsight.mentalModelsEnabled":{type:"boolean",default:!0,ui:{tab:"memory",group:"Hindsight",label:"Hindsight Mental Models",description:"Read curated reflect summaries (mental models) into developer instructions at boot. Loads existing models on the bank — does not write. Pair with hindsight.mentalModelAutoSeed to also auto-create the built-in seed set.",condition:"hindsightActive"}},"hindsight.mentalModelAutoSeed":{type:"boolean",default:!0,ui:{tab:"memory",group:"Hindsight",label:"Hindsight Mental Model Auto-Seed",description:"At session start, create any built-in mental models (project-conventions, project-decisions, user-preferences) that do not yet exist on the bank.",condition:"hindsightActive"}},"ttsr.enabled":{type:"boolean",default:!0,ui:{tab:"context",group:"Rules (TTSR)",label:"TTSR",description:"Interrupt the agent mid-stream when output matches rule patterns (Time-Traveling Stream Rules)"}},"ttsr.judge":{type:"enum",default:"auto",values:["auto","on","off"],ui:{tab:"context",group:"Rules (TTSR)",label:"Judged Rules",description:"Ask the judge model role each `question` rule about completed replies, reasoning, and tool calls; a yes injects the rule as a warning",options:[{value:"auto",label:"Auto",description:"Judge only when the judge role resolves to a native TypeSafe jev model"},{value:"on",label:"On",description:"Always judge, whichever model the judge role resolves to"},{value:"off",label:"Off",description:"Never judge; question rules stay inactive"}]}},"ttsr.contextMode":{type:"enum",default:"discard",values:["discard","keep"],ui:{tab:"context",group:"Rules (TTSR)",label:"TTSR Context Mode",description:"What to do with partial output when TTSR triggers"}},"ttsr.interruptMode":{type:"enum",default:"always",values:["never","prose-only","tool-only","always"],ui:{tab:"context",group:"Rules (TTSR)",label:"TTSR Interrupt Mode",description:"When to interrupt mid-stream vs inject warning after completion",options:[{value:"always",label:"always",description:"Interrupt on prose and tool streams"},{value:"prose-only",label:"prose-only",description:"Interrupt only on reply/thinking matches"},{value:"tool-only",label:"tool-only",description:"Interrupt only on tool-call argument matches"},{value:"never",label:"never",description:"Never interrupt; inject warning after completion"}]}},"ttsr.repeatMode":{type:"enum",default:"once",values:["once","after-gap"],ui:{tab:"context",group:"Rules (TTSR)",label:"TTSR Repeat Mode",description:"How rules can repeat: once per session or after a message gap"}},"ttsr.repeatGap":{type:"number",default:10,ui:{tab:"context",group:"Rules (TTSR)",label:"TTSR Repeat Gap",description:"Messages before a rule can trigger again",options:[{value:"5",label:"5 messages"},{value:"10",label:"10 messages"},{value:"15",label:"15 messages"},{value:"20",label:"20 messages"},{value:"30",label:"30 messages"}]}},"ttsr.builtinRules":{type:"boolean",default:!0,ui:{tab:"context",group:"Rules (TTSR)",label:"Built-in Rules",description:"Load the default rules shipped with the agent (override individually with ttsr.disabledRules)"}},"ttsr.disabledRules":{type:"array",default:[],ui:{tab:"context",group:"Rules (TTSR)",label:"Disabled Rules",description:"Rule names to ignore entirely (applies to bundled defaults and your own rules)"}},"edit.mode":{type:"enum",default:"hashline",values:["apply_patch","hashline","patch","replace","sloppy"],ui:{tab:"files",group:"Editing",label:"Edit Mode",description:"Select the edit tool variant (replace, patch, hashline, or apply_patch)"}},"edit.fuzzyMatch":{type:"boolean",default:!0,ui:{tab:"files",group:"Editing",label:"Fuzzy Match",description:"Accept high-confidence fuzzy matches for whitespace differences"}},"edit.fuzzyThreshold":{type:"number",default:0.95,ui:{tab:"files",group:"Editing",label:"Fuzzy Match Threshold",description:"Similarity threshold (0-1) for accepting fuzzy matches",options:[{value:"0.85",label:"0.85",description:"Lenient"},{value:"0.90",label:"0.90",description:"Moderate"},{value:"0.95",label:"0.95",description:"Default"},{value:"0.98",label:"0.98",description:"Strict"}]}},"edit.streamingAbort":{type:"boolean",default:!1,ui:{tab:"files",group:"Editing",label:"Abort on Failed Preview",description:"Abort streaming edit tool calls when patch preview fails"}},"edit.recoverInlineEdits":{type:"boolean",default:!0,ui:{tab:"files",group:"Editing",label:"Recover Inline Edit Payloads",description:"Execute edit payloads the model emits as plain text by converting them into edit tool calls"}},"edit.blockAutoGenerated":{type:"boolean",default:!0,ui:{tab:"files",group:"Editing",label:"Block Auto-Generated Files",description:"Prevent editing of files that appear to be auto-generated (protoc, sqlc, swagger, etc.)"}},"edit.enforceSeenLines":{type:"boolean",default:!0,ui:{tab:"files",group:"Editing",label:"Enforce Seen-Line Guard",description:"Reject edits anchored on lines a prior read/search never displayed in full"}},"edit.blackbox.enabled":{type:"boolean",default:!1,ui:{tab:"files",group:"Editing",label:"Record Parse Regressions",description:"Append full before/after source when an edit introduces an AST parse failure"}},"edit.autoRepair.enabled":{type:"boolean",default:!1,ui:{tab:"files",group:"Editing",label:"Auto-Repair Parse Regressions",description:"When an edit breaks a file's AST parse, ask the smol model to fix the broken region (validated by re-parse; falls back to a warning)"}},"tools.artifactSpillThreshold":{type:"number",default:50,ui:{tab:"tools",group:"Output Limits",label:"Artifact Spill Threshold (KB)",description:"Tool output above this size is saved as an artifact; tail is kept inline",options:[{value:"1",label:"1 KB",description:"~250 tokens"},{value:"2.5",label:"2.5 KB",description:"~625 tokens"},{value:"5",label:"5 KB",description:"~1.25K tokens"},{value:"10",label:"10 KB",description:"~2.5K tokens"},{value:"20",label:"20 KB",description:"~5K tokens"},{value:"30",label:"30 KB",description:"~7.5K tokens"},{value:"50",label:"50 KB",description:"Default; ~12.5K tokens"},{value:"75",label:"75 KB",description:"~19K tokens"},{value:"100",label:"100 KB",description:"~25K tokens"},{value:"200",label:"200 KB",description:"~50K tokens"},{value:"500",label:"500 KB",description:"~125K tokens"},{value:"1000",label:"1 MB",description:"~250K tokens"}]}},"tools.artifactTailBytes":{type:"number",default:20,ui:{tab:"tools",group:"Output Limits",label:"Artifact Tail Size (KB)",description:"Amount of tail content kept inline when output spills to artifact",options:[{value:"1",label:"1 KB",description:"~250 tokens"},{value:"2.5",label:"2.5 KB",description:"~625 tokens"},{value:"5",label:"5 KB",description:"~1.25K tokens"},{value:"10",label:"10 KB",description:"~2.5K tokens"},{value:"20",label:"20 KB",description:"Default; ~5K tokens"},{value:"50",label:"50 KB",description:"~12.5K tokens"},{value:"100",label:"100 KB",description:"~25K tokens"},{value:"200",label:"200 KB",description:"~50K tokens"}]}},"tools.artifactHeadBytes":{type:"number",default:20,ui:{tab:"tools",group:"Output Limits",label:"Artifact Head Size (KB)",description:"Amount of head content kept inline alongside the tail when output spills to artifact (middle elision). 0 disables — keep tail only.",options:[{value:"0",label:"0 KB",description:"Disabled; tail-only truncation"},{value:"1",label:"1 KB",description:"~250 tokens"},{value:"2.5",label:"2.5 KB",description:"~625 tokens"},{value:"5",label:"5 KB",description:"~1.25K tokens"},{value:"10",label:"10 KB",description:"~2.5K tokens"},{value:"20",label:"20 KB",description:"Default; ~5K tokens"},{value:"50",label:"50 KB",description:"~12.5K tokens"},{value:"100",label:"100 KB",description:"~25K tokens"},{value:"200",label:"200 KB",description:"~50K tokens"}]}},"tools.outputMaxColumns":{type:"number",default:768,ui:{tab:"tools",group:"Output Limits",label:"Output Column Cap",description:"Per-line byte cap for streaming tool outputs (bash, python, js eval) and `read`. Lines wider than this are ellipsis-truncated; remaining bytes up to the next newline are dropped. 0 disables.",options:[{value:"0",label:"Off",description:"No per-line cap"},{value:"256",label:"256",description:"Tight"},{value:"512",label:"512"},{value:"768",label:"768",description:"Default"},{value:"1024",label:"1024"},{value:"2048",label:"2048"},{value:"4096",label:"4096",description:"Loose"}]}},"tools.artifactTailLines":{type:"number",default:500,ui:{tab:"tools",group:"Output Limits",label:"Artifact Tail Lines",description:"Maximum lines of tail content kept inline when output spills to artifact",options:[{value:"50",label:"50 lines",description:"~250 tokens"},{value:"100",label:"100 lines",description:"~500 tokens"},{value:"250",label:"250 lines",description:"~1.25K tokens"},{value:"500",label:"500 lines",description:"Default; ~2.5K tokens"},{value:"1000",label:"1000 lines",description:"~5K tokens"},{value:"2000",label:"2000 lines",description:"~10K tokens"},{value:"5000",label:"5000 lines",description:"~25K tokens"}]}},"tools.artifactMaxBytes":{type:"number",default:16,ui:{tab:"tools",group:"Output Limits",label:"Artifact File Cap (MB)",description:"Maximum size of the artifact file saved for streaming tool output (bash, python, js eval). Larger output keeps its beginning (up to 3 MB) and its most recent remainder, with a truncation notice between them. 0 = unlimited.",options:[{value:"0",label:"Unlimited",description:"Save the complete output"},{value:"4",label:"4 MB"},{value:"16",label:"16 MB",description:"Default"},{value:"64",label:"64 MB"},{value:"256",label:"256 MB"},{value:"1024",label:"1 GB"}]}},readLineNumbers:{type:"boolean",default:!1,ui:{tab:"files",group:"Reading",label:"Line Numbers",description:"Prepend line numbers to read tool output by default"}},"read.defaultLimit":{type:"number",default:300,ui:{tab:"files",group:"Reading",label:"Default Read Limit",description:"Default number of lines returned when agent calls read without a limit",options:[{value:"200",label:"200 lines"},{value:"300",label:"300 lines"},{value:"500",label:"500 lines"},{value:"1000",label:"1000 lines"},{value:"5000",label:"5000 lines"}]}},"read.renderMarkdown":{type:"boolean",default:!1,ui:{tab:"files",group:"Reading",label:"Markdown Previews",description:"Render Markdown read results as formatted terminal Markdown previews instead of raw source"}},"read.summarize.enabled":{type:"boolean",default:!0,ui:{tab:"files",group:"Read Summaries",label:"Read Summaries",description:"Return structural code summaries when read is called without an explicit selector"}},"read.summarize.prose":{type:"boolean",default:!1,ui:{tab:"files",group:"Read Summaries",label:"Prose Summaries",description:"Return structural summaries for Markdown and plain text reads"}},"read.summarize.minBodyLines":{type:"number",default:4,ui:{tab:"files",group:"Read Summaries",label:"Read Summary Body Lines",description:"Minimum multiline body or literal length before read summaries collapse it"}},"read.summarize.minCommentLines":{type:"number",default:6,ui:{tab:"files",group:"Read Summaries",label:"Read Summary Comment Lines",description:"Minimum multiline block comment length before read summaries collapse it"}},"read.summarize.minTotalLines":{type:"number",default:100,ui:{tab:"files",group:"Read Summaries",label:"Read Summary Minimum File Length",description:"Files with fewer total lines are read verbatim instead of structurally summarized"}},"read.summarize.unfoldUntil":{type:"number",default:50,ui:{tab:"files",group:"Read Summaries",label:"Read Summary Unfold Target",description:"BFS-unfold elidable spans until the summary is at least this many visible lines. 0 keeps only the outermost elisions."}},"read.summarize.unfoldLimit":{type:"number",default:100,ui:{tab:"files",group:"Read Summaries",label:"Read Summary Unfold Ceiling",description:"Hard ceiling on summary size while BFS-unfolding. An unfold whose revealed lines would exceed this is skipped (that span stays folded) and unfolding continues with the remaining spans."}},"read.toolResultPreview":{type:"boolean",default:!1,ui:{tab:"files",group:"Reading",label:"Inline Read Previews",description:"Render read tool results inline in the transcript instead of summary rows"}},"tools.approval":{type:"record",default:{},ui:{tab:"interaction",group:"Approvals",label:"Tool Approval Policies",description:"Per-tool approval policies. Set to 'allow' to auto-approve, 'prompt' to require confirmation, or 'deny' to block. Overrides are honored in every approval mode."}},"tools.approvalMode":{type:"enum",default:"yolo",values:["always-ask","always-ask-cached","write","yolo"],ui:{tab:"interaction",group:"Approvals",label:"Tool Approval",description:"Default approval behavior for tool calls. 'Always ask' auto-approves read-only tools only. 'Ask and remember' also asks before file reads, and can remember a file or folder. 'Write' auto-approves read and workspace-write tools. 'Yolo' auto-approves all tiers; user policy may still prompt or block.",options:[{value:"always-ask",label:"Always ask",description:"Auto-approve read-only tools; require confirmation for write and exec tools."},{value:"always-ask-cached",label:"Ask and remember",description:"Ask before reading or writing a file, with answers that remember the file or its folder for this session or every session; require confirmation for exec tools."},{value:"write",label:"Write",description:"Auto-approve read-only and write tools; require confirmation for exec tools such as bash, eval, browser, and task."},{value:"yolo",label:"Yolo",description:"Auto-approve read, write, and exec tools. User policy can still require confirmation or block calls."}]}},"todo.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Todos",description:"Enable the todo tool for task tracking"}},"todo.reminders":{type:"boolean",default:!0,ui:{tab:"tools",group:"Todos",label:"Todo Reminders",description:"Remind the agent to complete todos before stopping"}},"todo.remindersMax":{type:"number",default:3,ui:{tab:"tools",group:"Todos",label:"Todo Reminder Limit",description:"Maximum number of todo reminders before giving up",options:[{value:"1",label:"1 reminder"},{value:"2",label:"2 reminders"},{value:"3",label:"3 reminders"},{value:"5",label:"5 reminders"}]}},"todo.eager":{type:"enum",default:"default",values:["default","preferred","always"],ui:{tab:"tools",group:"Todos",label:"Create Todos Automatically",description:"How strongly to push automatic todo-list creation after the first message",options:[{value:"default",label:"Default",description:"Model decides; no automatic todo list"},{value:"preferred",label:"Preferred",description:"Suggests a todo list on the first message (reminder, not forced)"},{value:"always",label:"Always",description:"Forces a comprehensive todo list on the first message"}]}},"tasks.todoClearDelay":{type:"number",default:60,ui:{tab:"tools",group:"Todos",label:"Todo Auto-Clear Delay",description:"Delay before completed or abandoned todos are removed from the todo widget",options:[{value:"0",label:"Instant"},{value:"60",label:"1 minute",description:"Default"},{value:"300",label:"5 minutes"},{value:"900",label:"15 minutes"},{value:"1800",label:"30 minutes"},{value:"3600",label:"1 hour"},{value:"-1",label:"Never"}]}},"glob.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Glob",description:"Enable the glob tool for glob-based file lookup"}},"grep.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Grep",description:"Enable the grep tool for regex content search"}},"grep.contextBefore":{type:"number",default:1,ui:{tab:"tools",group:"Grep & Browser",label:"Grep Context Before",description:"Lines of context before each grep match",options:[{value:"0",label:"0 lines"},{value:"1",label:"1 line"},{value:"2",label:"2 lines"},{value:"3",label:"3 lines"},{value:"5",label:"5 lines"}]}},"grep.contextAfter":{type:"number",default:3,ui:{tab:"tools",group:"Grep & Browser",label:"Grep Context After",description:"Lines of context after each grep match",options:[{value:"0",label:"0 lines"},{value:"1",label:"1 line"},{value:"2",label:"2 lines"},{value:"3",label:"3 lines"},{value:"5",label:"5 lines"},{value:"10",label:"10 lines"}]}},"astGrep.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"AST Grep",description:"Enable the ast_grep tool for structural AST search"}},"astEdit.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"AST Edit",description:"Enable the ast_edit tool for structural AST rewrites"}},"find.enabled":{type:"enum",default:"auto",values:["auto","on","off"],ui:{tab:"tools",group:"Available Tools",label:"Find (semantic grep)",description:"Enable the find tool: natural-language search for files and line ranges, judged by the judge model role. Auto enables it only when the judge role resolves to a native TypeSafe jev model",options:[{value:"auto",label:"Auto",description:"Enable when the judge role resolves to a native TypeSafe jev model"},{value:"on",label:"On",description:"Always enable, whichever model the judge role resolves to"},{value:"off",label:"Off",description:"Disable the find tool"}]}},"debug.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Debug",description:"Enable the debug tool for DAP-based debugging"}},"launch.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Services",description:"Enable named bash services and proc:// supervision for shared long-running project processes"}},"speechgen.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"Speech Generation",description:"Enable the tts tool for on-device (Kokoro) or xAI Grok Voice speech-file synthesis"}},"generate_image.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"Generate Image",description:"Enable the generate_image tool (text-to-image generation and editing). Exposed as an xd:// device when tools.xdev is on."}},"computer.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"Computer",description:"Enable the scriptable host-desktop eval prelude (screenshots, input, accessibility)"}},"ratchet.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"Ratchet",description:"Enable the ratchet eval/hillclimb prelude; /ratchet turns it on for the current session"}},"archive.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Archive",description:"Enable the read-only archive eval prelude: prompt history, recent projects, past sessions and recaps"}},"computer.display":{type:"string",default:"active",ui:{tab:"tools",group:"Computer",label:"Computer Display",description:"Active window's display (active), all displays (all), or a native display id"}},"computer.maxWidth":{type:"number",default:3840,ui:{tab:"tools",group:"Computer",label:"Computer Screenshot Width",description:"Maximum screenshot width in pixels"}},"computer.maxHeight":{type:"number",default:2400,ui:{tab:"tools",group:"Computer",label:"Computer Screenshot Height",description:"Maximum screenshot height in pixels"}},"computer.backgroundFallback":{type:"enum",default:"takeover",values:["takeover","refuse"],ui:{tab:"tools",group:"Computer",label:"Computer Background Fallback",description:"What window input does when its background route is unavailable: rerun it in takeover and return focus to your app (macOS; elsewhere plain takeover), or refuse, which also keeps the agent from taking the foreground or opening macOS menus itself",options:[{value:"takeover",label:"Takeover",description:"Briefly bring the target forward for that one call, then return focus to your app (on macOS even if you kept typing)"},{value:"refuse",label:"Refuse",description:"Fail the call; nothing takes over, and the agent's own takeover, raise, activating open, desktop input and macOS menus (context menus, popup and menu buttons; they take your keyboard while open) are refused too"}]}},"images.questionTimeoutMs":{type:"number",default:300000,ui:{tab:"tools",group:"Execution",label:"Image Question Timeout",description:"Per-request timeout for the vision-model call behind read's ?q= image questions, in milliseconds. A stalled provider fails fast with a timeout error instead of blocking until manual abort. Set to 0 to disable the timeout.",options:[{value:"0",label:"Disabled"},{value:"60000",label:"1 minute"},{value:"120000",label:"2 minutes"},{value:"180000",label:"3 minutes"},{value:"300000",label:"5 minutes"}]}},"checkpoint.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"Checkpoint/Rewind",description:"Enable the checkpoint and rewind tools for context checkpointing"}},"fetch.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Read URLs",description:"Allow the read tool to fetch and process URLs"}},"vault.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"Obsidian Vault",description:"Enable the vault:// internal URL for reading and editing Obsidian vault content via the Obsidian CLI. When disabled, vault:// resolution is refused and the vault:// entry is omitted from the system prompt."}},"github.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"GitHub CLI",description:"Enable the github tool (op-based dispatch for repository, issue, pull request, diff, search, checkout, push, and Actions watch workflows)"}},"github.cache.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"GitHub",label:"GitHub View Cache",description:"Cache rendered issue/PR view output in ~/.omp/cache/github-cache.db so repeated reads are free"}},"github.cache.softTtlSec":{type:"number",default:300,ui:{tab:"tools",group:"GitHub",label:"GitHub Cache Soft TTL",description:"Within this window, cached issue/PR view rows are returned directly (seconds; default 5 minutes)"}},"github.cache.hardTtlSec":{type:"number",default:604800,ui:{tab:"tools",group:"GitHub",label:"GitHub Cache Hard TTL",description:"Past the soft TTL the cached row is returned and refreshed in the background; past the hard TTL it is dropped (seconds; default 7 days)"}},"web_search.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Web Search",description:"Enable the web_search tool for live web results"}},"security.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"Security",description:"Enable OMP-native security scan planning, execution, and the read-only security:// resource namespace"}},"ask.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Ask",description:"Enable the ask tool for interactive user questions"}},"tools.intentTracing":{type:"boolean",default:!0,ui:{tab:"tools",group:"Execution",label:"Intent Tracing",description:"Ask the agent to describe the intent of each tool call before executing it"}},"tools.abortOnFabricatedResult":{type:"boolean",default:!0,ui:{tab:"tools",group:"Execution",label:"Abort On Fabricated Tool Result",description:"With in-band tool calls, stop the model immediately when it starts hallucinating a tool result mid-turn. Disable to let the model finish generating and discard the fabricated continuation instead."}},"tools.speculativeExecution.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Execution",label:"Experimental Speculative Execution",description:"Enable the discard-safe first slice: validated local reads through direct read calls and nested eval. Network requests, provider completions, and live filesystem writes are not part of this baseline."}},"tools.speculativeExecution.maxInFlight":{type:"number",default:2,ui:{tab:"tools",group:"Execution",label:"Speculative Execution Concurrency",description:"Maximum number of validated local reads allowed to run before normal dispatch.",options:[{value:"1",label:"1 operation"},{value:"2",label:"2 operations"},{value:"3",label:"3 operations"},{value:"4",label:"4 operations"}]}},"tools.maxTimeout":{type:"number",default:0,ui:{tab:"tools",group:"Execution",label:"Max Tool Timeout",description:"Maximum timeout in seconds the agent can set for any tool (0 = no limit)",options:[{value:"0",label:"No limit"},{value:"30",label:"30 seconds"},{value:"60",label:"60 seconds"},{value:"120",label:"120 seconds"},{value:"300",label:"5 minutes"},{value:"600",label:"10 minutes"}]}},"async.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Execution",label:"Async Execution",description:"Enable async bash commands and background task execution"}},"async.widgets":{type:"boolean",default:!0,ui:{tab:"tools",group:"Execution",label:"Live Job Widgets",description:"Draw a live widget for each running background job (charts, bars, status grids derived from its output) in the wait card, the jobs pill and the jobs sheet. The `widget` model role (default: `smol`) writes one spec per job; updates need no further model calls"}},"tools.xdev":{type:"boolean",default:!0,ui:{tab:"tools",group:"Discovery & MCP",label:"xd:// Tools",description:"Mount rarely-used (discoverable) tools under xd:// device URLs driven via read/write instead of shipping their schemas on every request. Sessions whose explicit tool list grants read but omits write mount devices through a device-only write transport (only local:// scratch stays writable besides devices). Disable to expose every enabled tool top-level."}},"tools.xdevDocs":{type:"enum",default:"catalog",values:["inline","builtins","catalog"],ui:{tab:"tools",group:"Discovery & MCP",label:"xd:// Prompt Docs",description:"Choose which mounted-device docs and schemas are inlined in the system prompt. Built-ins keeps core tools inline while MCP and extension tools stay on-demand.",options:[{value:"inline",label:"All Devices",description:"Inline docs and schemas for every mounted device."},{value:"builtins",label:"Built-ins Only",description:"Inline built-in docs; fetch MCP and extension docs on demand."},{value:"catalog",label:"Catalog Only",description:"List every device; fetch all docs on demand."}]}},"tools.xdevInlineDevices":{type:"array",default:[],ui:{tab:"tools",group:"Discovery & MCP",label:"xd:// Inline Devices",description:"When xd:// Prompt Docs is Built-ins Only, inline dynamic devices whose names match these glob patterns (for example mcp__context_mode_*). Catalog Only ignores this setting."}},"dev.autoqa":{type:"boolean",default:!0,ui:{tab:"tools",group:"Developer",label:"Auto QA",description:"Automated tool issue reporting (xd://report_issue). On by default; the first report asks for consent, and denying it disables reporting until re-enabled explicitly"}},"dev.autoqaPush.endpoint":{type:"string",default:"https://qa.omp.sh/v1/grievances",ui:{tab:"tools",group:"Developer",label:"Auto QA Push Endpoint",description:"Full URL receiving Auto QA JSON reports (default https://qa.omp.sh/v1/grievances)"}},"lsp.enabled":{type:"boolean",default:!0,ui:{tab:"files",group:"LSP",label:"LSP",description:"Enable the lsp tool for code intelligence (definitions, references, diagnostics, rename)"}},"lsp.lazy":{type:"boolean",default:!0,ui:{tab:"files",group:"LSP",label:"Lazy LSP Startup",description:"Start language servers on first use (lsp tool or editing a matching file type) instead of at session startup"}},"lsp.shared":{type:"boolean",default:!0,ui:{tab:"files",group:"LSP",label:"Shared Language Servers",description:"Start language servers through the per-project daemon broker. Each connection gets its own server. While another omp instance in the project is running, a released server stays warm and the next connection reuses it instead of cold-starting (falls back to private servers when unavailable)"}},"lsp.formatOnWrite":{type:"boolean",default:!1,ui:{tab:"files",group:"LSP",label:"Format on Write",description:"Automatically format code files using LSP after writing"}},"lsp.diagnosticsOnWrite":{type:"boolean",default:!0,ui:{tab:"files",group:"LSP",label:"Diagnostics on Write",description:"Return LSP diagnostics after writing code files"}},"lsp.diagnosticsOnEdit":{type:"boolean",default:!1,ui:{tab:"files",group:"LSP",label:"Diagnostics on Edit",description:"Return LSP diagnostics after editing code files"}},"lsp.diagnosticsDeduplicate":{type:"boolean",default:!0,ui:{tab:"files",group:"LSP",label:"Deduplicate Diagnostics",description:"Suppress post-edit LSP diagnostics already shown for a file; only surface new or changed ones"}},"lsp.requestTimeout":{type:"number",default:10,ui:{tab:"files",group:"LSP",label:"Request Timeout",description:"Seconds to wait for a language server's diagnostics, hover and other answers when the agent sets no timeout; late post-edit diagnostics wait at least this long. Raise it for servers that are slow on a cold start. The lsp tool's timeout argument can still raise or lower it per call",options:[{value:"10",label:"10 seconds",description:"Default"},{value:"20",label:"20 seconds"},{value:"30",label:"30 seconds"},{value:"60",label:"1 minute"},{value:"120",label:"2 minutes"},{value:"300",label:"5 minutes"}]}},"bash.enabled":{type:"boolean",default:!0,ui:{tab:"shell",group:"Bash",label:"Bash",description:"Enable the bash tool for shell command execution"}},"bash.allowCompoundCommands":{type:"boolean",default:!1,ui:{tab:"shell",group:"Bash",label:"Allow Compound Commands",description:"Evaluate literal && chains per command; unmatched commands use normal bash approval policy and mode"}},"bash.autoBackground.enabled":{type:"boolean",default:!0,ui:{tab:"shell",group:"Bash",label:"Bash Auto-Background",description:"Automatically background long-running bash commands and deliver the result later"}},"bash.gitGuard":{type:"boolean",default:!1,ui:{tab:"shell",group:"Bash",label:"Git Guard",description:"Refuse git commands that discard or move shared work in the bash tool: stash, reset --hard or to another commit, and checkout/switch/restore outside a merge or rebase conflict"}},"bash.patterns":{type:"array",default:[],ui:{tab:"shell",group:"Bash",label:"Bash Approval Patterns",description:"Ordered bash command approval rules. Each item has match and approval fields; only '*' wildcards are supported."}},"bashInterceptor.enabled":{type:"boolean",default:!1,ui:{tab:"shell",group:"Bash",label:"Bash Interceptor",description:"Block shell commands that have dedicated tools"}},"bash.direnv":{type:"enum",default:"auto",values:["auto","off"],ui:{tab:"shell",group:"Bash",label:"direnv Auto-Load",description:"Auto-load a repo's direnv/devenv `.envrc` into the bash session so devenv tools and env vars are present without manual `direnv exec`. Honors direnv's allow list: an `.envrc` you haven't `direnv allow`ed is never executed"}},"bash.direnvLoadTimeoutMs":{type:"number",default:30000,ui:{tab:"shell",group:"Bash",label:"direnv Load Timeout (ms)",description:"Max wait for the first `direnv export` (a cold devenv shell can be slow); on timeout the session runs without the direnv env"}},"shellMinimizer.enabled":{type:"boolean",default:!0,ui:{tab:"shell",group:"Bash",label:"Shell Minimizer",description:"Compress verbose shell output (git, npm, cargo, etc.) before returning it to the agent"}},"shellMinimizer.sourceOutlineLevel":{type:"enum",default:"default",values:["default","aggressive"],ui:{tab:"shell",group:"Bash",label:"Shell Minimizer Source Outline",description:"Source outline mode for cat/read of source files: default or aggressive"}},"eval.py":{type:"boolean",default:!0,ui:{tab:"shell",group:"Eval & Runtimes",label:"Python Eval Backend",description:"Allow the eval tool to dispatch Python cells to the IPython kernel"}},"eval.js":{type:"boolean",default:!0,ui:{tab:"shell",group:"Eval & Runtimes",label:"JavaScript Eval Backend",description:"Allow the eval tool to dispatch JavaScript cells to the in-process runtime"}},"eval.autoProvision":{type:"boolean",default:!0,ui:{tab:"shell",group:"Eval & Runtimes",label:"Eval Environment Provisioning",description:"Automatically create the managed JavaScript eval package environment on first install"}},"eval.tools.enabled":{type:"boolean",default:!0,ui:{tab:"shell",group:"Eval & Runtimes",label:"Eval-Defined Tools",description:"Let eval cells define tools (@tool in Python, tool(fn) in JS) that task, agent(), and workpool() subagents can call"}},"eval.workpool.freshAgents":{type:"boolean",default:!1,ui:{tab:"shell",group:"Eval & Runtimes",label:"Fresh Workpool Agents",description:"Spawn a new subagent for every workpool item instead of reusing workers or batching queued items"}},"eval.autoBackground.enabled":{type:"boolean",default:!1,ui:{tab:"shell",group:"Eval & Runtimes",label:"Eval Auto-Background",description:"Automatically background long-running eval cells and deliver the result later"}},"python.kernelMode":{type:"enum",default:"session",values:["session","per-call"],ui:{tab:"shell",group:"Eval & Runtimes",label:"Python Kernel Mode",description:"Keep the IPython kernel alive across eval calls or start fresh each time"}},"python.interpreter":{type:"string",default:"",ui:{tab:"shell",group:"Eval & Runtimes",label:"Python Interpreter",description:"Optional path to an exact Python executable. When set, automatic Python runtime discovery is skipped."}},"task.isolation.enabled":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Isolation",label:"Allow Isolated Subagents",description:"Allow per-task isolation with `isolated: true`; tasks without it run in the shared checkout"}},"isolation.backend":{type:"enum",default:"auto",values:["auto","apfs","btrfs","zfs","reflink","overlayfs","projfs","block-clone","rcopy"],ui:{tab:"tasks",group:"Isolation",label:"Isolation Backend",description:"Backend used for subagent isolation and worktree cloning",options:[{value:"auto",label:"Auto",description:"Let the PAL pick the best available backend"},{value:"apfs",label:"APFS",description:"macOS clonefile reflink (APFS)"},{value:"btrfs",label:"btrfs",description:"btrfs subvolume snapshot"},{value:"zfs",label:"ZFS",description:"ZFS snapshot + clone"},{value:"reflink",label:"Reflink",description:"Linux FICLONE per-file reflink"},{value:"overlayfs",label:"Overlayfs",description:"Linux kernel overlay (or fuse-overlayfs fallback)"},{value:"projfs",label:"ProjFS",description:"Windows Projected File System"},{value:"block-clone",label:"Block clone",description:"Windows FSCTL_DUPLICATE_EXTENTS_TO_FILE (NTFS/ReFS)"},{value:"rcopy",label:"Recursive copy",description:"git worktree if available, otherwise recursive copy"}]}},"worktree.clone":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Isolation",label:"Clone Checkout into Worktrees",description:"New worktrees from `github pr_checkout` and `git worktree add` in bash start as a copy-on-write clone of the current checkout so ignored build artifacts (node_modules, target) carry over; falls back to a plain checkout when the filesystem cannot clone"}},"worktree.cleanSource":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Isolation",label:"Clean Source Checkout on /wt",description:"When creating a worktree with `/wt`, reset tracked changes and remove untracked files from the original checkout after carrying them over"}},"worktree.onStart":{type:"enum",default:"off",values:["off","ask","create"],ui:{tab:"tasks",group:"Isolation",label:"Worktree on Start",description:"Whether fresh interactive sessions start in a new linked worktree",options:[{value:"off",label:"Off",description:"Start in the current checkout"},{value:"ask",label:"Ask",description:"Ask at session start"},{value:"create",label:"Create",description:"Always start in a new worktree on a `wt/*` branch"}]}},"worktree.onExit":{type:"enum",default:"keep",values:["keep","ask","remove"],ui:{tab:"tasks",group:"Isolation",label:"Worktree on Exit",description:"What to do on exit with worktrees created since omp started (on start or with `/wt`)",options:[{value:"keep",label:"Keep",description:"Leave worktrees in place"},{value:"ask",label:"Ask",description:"Ask on exit"},{value:"remove",label:"Remove",description:"Remove clean worktrees; ask when they have uncommitted changes or new commits. Gitignored files (e.g. `.env`) are deleted too"}]}},"task.isolation.apply":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Isolation",label:"Apply Isolated Changes",description:"Automatically apply successful isolated task changes to the parent checkout; disable to retain patch or branch artifacts"}},"task.isolation.merge":{type:"enum",default:"patch",values:["patch","branch"],ui:{tab:"tasks",group:"Isolation",label:"Isolation Merge Strategy",description:"How isolated task changes are integrated (patch apply or branch merge)",options:[{value:"patch",label:"Patch",description:"Combine diffs and git apply"},{value:"branch",label:"Branch",description:"Commit per task, merge with --no-ff"}]}},"task.isolation.commits":{type:"enum",default:"generic",values:["generic","ai"],ui:{tab:"tasks",group:"Isolation",label:"Isolation Commit Style",description:"Commit message style for nested repo changes (generic or AI-generated)",options:[{value:"generic",label:"Generic",description:"Static commit message"},{value:"ai",label:"AI",description:"AI-generated commit message from diff"}]}},"worktree.base":{type:"string",ui:{tab:"tasks",group:"Isolation",label:"Worktree Base Directory",description:"Base directory for agent-managed worktrees — task-isolation copies, `github` PR checkouts, and `omp worktree` cleanup all live here. Unset uses ~/.omp/wt. Must be an absolute or ~-relative path; relative paths are ignored. The OMP_WORKTREE_DIR env var overrides this."}},"task.eager":{type:"enum",default:"default",values:["default","preferred","always"],ui:{tab:"tasks",group:"Subagents",label:"Prefer Task Delegation",description:"How strongly to push delegating work to subagents",options:[{value:"default",label:"Default",description:"Uses the selected model's policy; some models require an explicit delegation request"},{value:"preferred",label:"Preferred",description:"Adds delegation guidance to the system prompt"},{value:"always",label:"Always",description:"Prompt guidance plus a first-turn delegation reminder"}]}},"task.batch":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Subagents",label:"Batch Task Calls",description:"Switch the task tool to its batch shape: one call carries { context, tasks[] } — one subagent per item, with an optional per-item agent (defaulting to the session spawn-policy agent), per-item isolation, and a required shared context prepended to every assignment. With async.enabled=true, each spawn runs as an independent background agent with the normal idle/parked lifecycle; otherwise the call blocks for merged results. Disable to restore the flat single-spawn schema."}},"task.structured":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Subagents",label:"Structured Task Results",description:"Expose outputSchema/schemaMode on the task tool and return subagent results through the yield tool, validated against caller or agent output schemas. Off: task subagents have no yield tool and return their final message as plain text, except agents whose definition sets structured: true. Eval agent()/workpool spawns always keep structured results."}},"task.speculativeLaunch":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Subagents",label:"Speculative Task Launch",description:"Start each batch subagent as soon as its tasks[] item finishes streaming instead of waiting for the whole task call. Launched agents are aborted if the finished call fails validation, is blocked, or its arguments change. Requires auto-allowed task approval and no extension tool lifecycle handlers."}},"task.enableEffort":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Subagents",label:"Per-Task Effort",description:"Expose the optional effort parameter on task spawns, allowing callers to override each subagent's thinking level"}},"task.maxConcurrency":{type:"number",default:32,ui:{tab:"tasks",group:"Subagents",label:"Max Concurrent Tasks",description:"Maximum number of subagents running concurrently",options:[{value:"0",label:"Unlimited"},{value:"1",label:"1 task"},{value:"2",label:"2 tasks"},{value:"4",label:"4 tasks"},{value:"8",label:"8 tasks"},{value:"16",label:"16 tasks"},{value:"32",label:"32 tasks"},{value:"64",label:"64 tasks"}]}},"task.enableLsp":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Subagents",label:"LSP in Subagents",description:"Allow subagents spawned via the task tool to use the lsp tool. Off by default to keep subagents cheap; enable when LSP-aware delegation is worth the extra tokens."}},"task.maxRecursionDepth":{type:"number",default:2,ui:{tab:"tasks",group:"Subagents",label:"Max Task Recursion",description:"How many levels deep subagents can spawn their own subagents",options:[{value:"-1",label:"Unlimited"},{value:"0",label:"None"},{value:"1",label:"Single"},{value:"2",label:"Double"},{value:"3",label:"Triple"}]}},"task.maxRuntimeMs":{type:"number",default:0,ui:{tab:"tasks",group:"Subagents",label:"Max Subagent Runtime",description:"Hard wall-clock limit per subagent (ms). 0 disables it. Defense-in-depth against provider-side stream hangs that escape the inference-layer watchdog; triggers a normal subagent abort with a 'timed out' reason.",options:[{value:"0",label:"Unlimited",description:"Default"},{value:"300000",label:"5 minutes"},{value:"900000",label:"15 minutes"},{value:"1800000",label:"30 minutes"},{value:"3600000",label:"1 hour"}]}},"task.completionProbe":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Subagents",label:"Subagent Completion Probe",description:"Ask a working subagent, through a cached side request like /btw, to estimate how complete its task is: after 2, 5, 10 and 30 more minutes, then hourly. The estimate shows next to the subagent in wait and task views. Only subagents spawned by the main agent of an interactive session are asked; print, RPC, ACP and SDK runs never probe."}},"task.agentIdleTtlMs":{type:"number",default:420000,ui:{tab:"tasks",group:"Subagents",label:"Agent Idle TTL",description:"How long an idle subagent stays live in memory before being parked to disk (ms). Parked agents are revived automatically when messaged or resumed. 0 keeps idle agents live until exit."}},"task.softRequestBudget":{type:"number",default:200,ui:{tab:"tasks",group:"Subagents",label:"Soft Subagent Request Budget",description:"Soft per-subagent request budget (assistant requests per run). Crossing it injects a wrap-up steering notice (see task.softRequestBudgetNotice); at 1.5x the budget the run is force-stopped and the agent must hand back its partial findings. 0 disables the guard. Bundled scout/sonic agents cap out at a lower built-in budget, so a value below that cap still applies to them. A task.agentSoftRequestBudget entry replaces this budget for the agent it names.",options:[{value:"0",label:"Disabled"},{value:"90",label:"90 requests"},{value:"150",label:"150 requests"},{value:"200",label:"200 requests",description:"Default"}]}},"task.softRequestBudgetNotice":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Subagents",label:"Soft Request Budget Notice",description:"Inject one steering notice when a subagent crosses its soft request budget, asking it to wrap up before the 1.5x forced-yield stop."}},"task.maxEffort":{type:"enum",default:"max",values:["minimal","low","medium","high","xhigh","max"],ui:{tab:"tasks",group:"Subagents",label:"Maximum Per-Spawn Effort",description:"Maximum reasoning effort allowed for the task tool's per-spawn effort hint. Lower values prevent callers from escalating subagents above this ceiling; the default preserves the model's full range.",options:[{value:"minimal",label:"min",description:"Very brief reasoning (~1k tokens)"},{value:"low",label:"low",description:"Light reasoning (~2k tokens)"},{value:"medium",label:"medium",description:"Moderate reasoning (~8k tokens)"},{value:"high",label:"high",description:"Deep reasoning (~16k tokens)"},{value:"xhigh",label:"xhigh",description:"Extended reasoning (~32k tokens)"},{value:"max",label:"max",description:"Maximum reasoning the model supports"}]}},"task.prewalk":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Subagents",label:"Generic Task Prewalk",description:"Arm prewalk for the bundled generic `task` subagent: it starts on its resolved model, plans and begins the implementation, then hands off to the 'smol' role at its first edit/write. Per-agent overrides (task.agentPrewalk, configured from the /agents hub) and user agent `prewalk` frontmatter apply regardless of this toggle."}},"task.showResolvedModelBadge":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Show Resolved Model Badge",description:"Display the actual model ID used by each subagent in the task widget status line"}},"plan.enabled":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Modes",label:"Plan Mode",description:"Enable plan mode for read-only exploration and planning before execution"}},"plan.defaultOnStartup":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Modes",label:"Start in Plan Mode",description:"Automatically enter plan mode at the start of every new session",condition:"planModeEnabled"}},"plan.autosave":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Modes",label:"Autosave Plans",description:"Automatically save approved plans to disk when plan mode completes",condition:"planModeEnabled"}},"plan.autosaveDir":{type:"string",ui:{tab:"tasks",group:"Modes",label:"Autosave Directory",description:"Directory for autosaved plans. Supports ~, absolute, and cwd-relative paths. Empty uses <project>/.omp/plans/.",condition:"planAutosaveEnabled"}},"goal.enabled":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Modes",label:"Goal Mode",description:"Enable per-session goal mode and the hidden goal tool"}},"goal.statusInFooter":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Modes",label:"Goal Status in Footer",description:"Show token budget alongside the goal indicator in the status line"}},"goal.continuationModes":{type:"array",default:["interactive"],ui:{tab:"tasks",group:"Modes",label:"Goal Continuation Modes",description:'Run modes where active goals may auto-continue between turns ("interactive", "rpc")'}},"title.icons":{type:"enum",default:"nf+emoji",values:["nf+emoji","emoji","boring"],ui:{tab:"appearance",group:"Display",label:"Title Icons",description:"Icon and short code that head new generated or /rename session titles",options:[{value:"nf+emoji",label:"Nerd Font + Emoji",description:"Nerd Font glyph where the Nerd Font symbol preset renders it, else the emoji (default)"},{value:"emoji",label:"Emoji",description:"Always the emoji"},{value:"boring",label:"Boring",description:"Plain title: no icon or code"}]}},"title.generator":{type:"enum",default:"fork",values:["fork","tiny"],ui:{tab:"tasks",group:"Modes",label:"Title Generator",description:"What names an untitled session from the user's messages",options:[{value:"fork",label:"Fork",description:"A side turn of the reply on the session's model: reads its prompt cache, adds the card icon (default)"},{value:"tiny",label:"Tiny",description:"The title model role only; plain titles without a card"}]}},"title.refreshOnReplan":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Modes",label:"Refresh Title on Replan",description:"Refresh generated session titles after todo init replans unless the title was set by the user"}},"skills.registryUrl":{type:"string",default:"https://skills.omp.sh",ui:{tab:"interaction",group:"Skills",label:"Skill Registry",description:"Skillshare registry used by `omp skill` to install, search, and publish skills (https://host[:port])"}},"skills.enableSkillCommands":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Commands & Skills",label:"Skill Commands",description:"Register skills as /skill:name commands"}},"commands.enableClaudeUser":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Commands & Skills",label:"Claude User Commands",description:"Load commands from ~/.claude/commands/"}},"commands.enableClaudeProject":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Commands & Skills",label:"Claude Project Commands",description:"Load commands from .claude/commands/"}},"commands.enableOpencodeUser":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Commands & Skills",label:"OpenCode User Commands",description:"Load commands from ~/.config/opencode/commands/"}},"commands.enableOpencodeProject":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Commands & Skills",label:"OpenCode Project Commands",description:"Load commands from .opencode/commands/"}},"extensionHandlers.toolCallTimeoutMs":{type:"number",default:30000,ui:{tab:"tools",group:"Extensions",label:"Tool Call Handler Timeout (ms)",description:"Positive finite active-work timeout for extension tool_call handlers; invalid values use 30000ms, and time awaiting OMP-owned dialogs does not count"}},"exa.enabled":{type:"boolean",default:!0,ui:{tab:"providers",group:"Services",label:"Exa",description:"Enable the Exa web search provider"}},"exa.searchDelayMs":{type:"number",default:1000,ui:{tab:"providers",group:"Services",label:"Exa Search Delay",description:"Minimum delay between Exa web search requests in milliseconds; set 0 to disable pacing"}},"searxng.endpoint":{type:"string",ui:{tab:"providers",group:"Services",label:"SearXNG Endpoint",description:"Base URL of a self-hosted SearXNG instance used for web search"}},"browser.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Browser",description:"Enable the browser eval prelude for scripted Chromium automation (Puppeteer)"}},"browser.cdpUrl":{type:"string",ui:{tab:"tools",group:"Grep & Browser",label:"Browser CDP URL",description:"Default HTTP CDP discovery endpoint (for example http://127.0.0.1:9222) to attach to instead of launching a browser. Explicit app.cdp_url or app.path on the tool call take precedence."}},"browser.relay":{type:"boolean",default:!1,ui:{tab:"tools",group:"Grep & Browser",label:"Browser Relay",description:"Drive your own Chrome tabs through the omp browser relay. Install the extension once (`omp browser-relay install`); the relay server auto-starts when the browser prelude needs it. Takes precedence over Browser CDP URL; set PI_BROWSER_RELAY=0 or PI_BROWSER_RELAY=1 to override."}},"browser.relayUrl":{type:"string",ui:{tab:"tools",group:"Grep & Browser",label:"Browser Relay URL",description:"omp browser relay endpoint (default http://127.0.0.1:9224)."}},"browser.headless":{type:"boolean",default:!0,ui:{tab:"tools",group:"Grep & Browser",label:"Headless Browser",description:"Launch browser in headless mode (disable to show browser UI)"}},"browser.cmux":{type:"boolean",default:!0,ui:{tab:"tools",group:"Grep & Browser",label:"cmux Browser",description:"Use cmux WKWebView surfaces for browser automation when a cmux socket is available. Set PI_BROWSER_CMUX=0 or PI_BROWSER_CMUX=1 to override."}},"browser.tern":{type:"boolean",default:!0,ui:{tab:"tools",group:"Grep & Browser",label:"Tern Browser",description:"Inside a Tern pane, open browser tabs as picture-in-pictures over omp's pane (native web view) instead of headless Chromium; falls back to Chromium when no Tern window can host them. Explicit app options, the relay and Browser CDP URL take precedence; app.tern:false opts one open out. Set PI_BROWSER_TERN=0 or PI_BROWSER_TERN=1 to override."}},"browser.freezeOnTurnEnd":{type:"boolean",default:!0,ui:{tab:"tools",group:"Grep & Browser",label:"Freeze Browser Tabs On Turn End",description:"Freeze OMP-owned headless browser tabs when a turn settles so animated pages stop burning CPU/GPU while idle. Tabs unfreeze automatically on next use; pass persist:true on open to opt a tab out."}},"browser.idleCloseSec":{type:"number",default:1800,ui:{tab:"tools",group:"Grep & Browser",label:"Browser Idle Close Timeout",description:"Close OMP-owned headless browser tabs and Tern browser picture-in-pictures idle longer than this many seconds (0 = never; session dispose still reaps). Never touches relay/CDP/spawned browsers or other sessions' tabs.",options:[{value:"0",label:"Never"},{value:"900",label:"15 minutes"},{value:"1800",label:"30 minutes"},{value:"3600",label:"1 hour"}]}},"browser.screenshotDir":{type:"string",ui:{tab:"tools",group:"Grep & Browser",label:"Screenshot Directory",description:"Directory to save screenshots. If unset, screenshots go to a temp file. Supports ~. Examples: ~/Downloads, ~/Desktop, /sdcard/Download (Android)"}},"ida.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"IDA Pro",description:"Open executables read with `read` in IDA Pro (idalib) and enable the `ida` tool; inert when no IDA install is found"}},"ida.python":{type:"string",default:"",ui:{tab:"tools",group:"IDA Pro",label:"IDA Python",description:"Python interpreter that can import ida_domain and idapro; empty auto-detects"}},"ida.installDir":{type:"string",default:"",ui:{tab:"tools",group:"IDA Pro",label:"IDA Install Dir",description:"Directory containing libidalib, exported as IDADIR; empty auto-detects ($IDADIR, ida-config.json, standard install paths)"}},"ida.maxOpen":{type:"number",default:4,ui:{tab:"tools",group:"IDA Pro",label:"IDA Max Open Databases",description:"Most IDA databases (omp.ida.* daemons in omp ps) open at once per project; opening another saves and closes the least recently used idle one",options:[{value:"2",label:"2"},{value:"4",label:"4"},{value:"8",label:"8"},{value:"16",label:"16"}]}},"ida.idleCloseSec":{type:"number",default:900,ui:{tab:"tools",group:"IDA Pro",label:"IDA Idle Close Timeout",description:"Save and close IDA databases idle longer than this many seconds (0 = never); the exec namespace resets on reopen",options:[{value:"0",label:"Never"},{value:"300",label:"5 minutes"},{value:"900",label:"15 minutes"},{value:"1800",label:"30 minutes"},{value:"3600",label:"1 hour"}]}},"mcp.enableProjectConfig":{type:"boolean",default:!0,ui:{tab:"tools",group:"Discovery & MCP",label:"MCP Project Config",description:"Load .mcp.json/mcp.json from project root"}},"mcp.startupTimeoutMs":{type:"number",default:250,ui:{tab:"tools",group:"Discovery & MCP",label:"MCP Startup Window",description:"Wait this many milliseconds for initial MCP tool discovery; 0 waits until connections settle"}},"mcp.renderMarkdownResults":{type:"boolean",default:!0,ui:{tab:"tools",group:"Discovery & MCP",label:"MCP Markdown Results",description:"Render non-JSON MCP text results as Markdown in the transcript"}},"mcp.notifications":{type:"boolean",default:!1,ui:{tab:"tools",group:"Discovery & MCP",label:"MCP Update Injection",description:"Inject MCP resource updates into the agent conversation"}},"mcp.notificationDebounceMs":{type:"number",default:500,ui:{tab:"tools",group:"Discovery & MCP",label:"MCP Notification Debounce",description:"Debounce window in milliseconds for MCP resource updates before injecting them into the conversation"}},"images.urls.enabled":{type:"boolean",default:!1,ui:{tab:"model",group:"Vision",label:"Serve Images as URLs",description:"Publish outgoing images through the configured backend chain and send URL-fetching providers short URLs instead of inline base64. Falls back to inline automatically when every backend or a provider fetch fails"}},"images.urls.backends":{type:"array",default:["provider-files","tailscale","cloudflared","litterbox"],ui:{tab:"model",group:"Vision",label:"Image URL Backends",description:"Ordered destinations tried when publishing images for provider access",options:[{value:"imgur",label:"Imgur",description:"Uploads require either an Imgur access token or client ID."},{value:"imageshack",label:"ImageShack",description:"The API requires a paid subscription."},{value:"flickr",label:"Flickr",description:"image-host"},{value:"chevereto",label:"Chevereto",description:"self-hosted"},{value:"vgyme",label:"vgy.me",description:"image-host"},{value:"dropbox",label:"Dropbox",description:"cloud-files"},{value:"ftp",label:"FTP / FTPS / SFTP",description:"file-transfer"},{value:"onedrive",label:"OneDrive",description:"cloud-files"},{value:"google-drive",label:"Google Drive",description:"cloud-files"},{value:"puush",label:"puush-compatible endpoint",description:"The public service is defunct; a replacement endpoint is required."},{value:"box",label:"Box",description:"cloud-files"},{value:"amazon-s3",label:"Amazon S3",description:"s3"},{value:"google-cloud-storage",label:"Google Cloud Storage",description:"object-storage"},{value:"azure-storage",label:"Azure Blob Storage",description:"object-storage"},{value:"backblaze-b2",label:"Backblaze B2",description:"Configure either native B2 application keys or S3-compatible access keys."},{value:"owncloud",label:"ownCloud / Nextcloud",description:"webdav"},{value:"mediafire",label:"MediaFire-compatible endpoint",description:"The public API is deprecated; a replacement endpoint is required."},{value:"sendspace",label:"SendSpace-compatible endpoint",description:"The public discovery API is deprecated; a replacement endpoint is required."},{value:"localhostr",label:"Hostr-compatible endpoint",description:"The public service is offline; a replacement endpoint is required."},{value:"lambda",label:"Lambda-compatible endpoint",description:"The public service is offline; a replacement endpoint is required."},{value:"pomf",label:"Pomf",description:"pomf"},{value:"uguu",label:"Uguu",description:"Public uploads expire after approximately three hours."},{value:"seafile",label:"Seafile",description:"cloud-files"},{value:"s-ul",label:"s-ul",description:"file-host"},{value:"lobfile",label:"LobFile-compatible endpoint",description:"The public service is offline; a replacement endpoint is required."},{value:"transfer-sh",label:"transfer.sh-compatible endpoint",description:"The defunct public endpoint is blocked; a self-hosted replacement is required."},{value:"plik",label:"Plik",description:"self-hosted"},{value:"shared-folder",label:"Shared folder",description:"filesystem"},{value:"catbox",label:"Catbox",description:"anonymous-host"},{value:"litterbox",label:"Litterbox",description:"Uploads are temporary."},{value:"0x0",label:"0x0.st",description:"Public uploads expire after a retention window determined by file size."},{value:"tmpfiles",label:"tmpfiles.org",description:"Public uploads are temporary."},{value:"discord",label:"Discord",description:"messaging"},{value:"provider-files",label:"Model provider files",description:"Provider file references are API-local rather than public image URLs."},{value:"direct",label:"Direct public URL",description:"local-serving"},{value:"cloudflared",label:"Cloudflare quick tunnel",description:"tunnel"},{value:"ngrok",label:"ngrok",description:"tunnel"},{value:"tailscale",label:"Tailscale Funnel",description:"tunnel"},{value:"ssh",label:"SSH reverse tunnel",description:"tunnel"},{value:"command",label:"Uploader command",description:"external-command"},{value:"localhost-run",label:"localhost.run",description:"tunnel"},{value:"pinggy",label:"Pinggy",description:"tunnel"},{value:"devtunnel",label:"Microsoft dev tunnel",description:"The devtunnel CLI must be logged in locally."},{value:"zrok",label:"zrok",description:"The local zrok environment must be enabled."},{value:"bore",label:"bore",description:"tunnel"},{value:"named-cloudflared",label:"Named Cloudflare Tunnel",description:"tunnel"},{value:"r2",label:"Cloudflare R2",description:"s3"},{value:"tigris",label:"Tigris",description:"s3"},{value:"minio",label:"MinIO",description:"s3"},{value:"garage",label:"Garage",description:"s3"}],ordered:!0}},"images.urls.command":{type:"string",ui:{tab:"model",group:"Vision",label:"Image Upload Command",description:"Argv template for the command backend; {file} is the image path, {mime}/{ext} optional. The last URL printed on stdout is used (e.g. pasta -b -f {file})"}},"images.urls.publicBaseUrl":{type:"string",ui:{tab:"model",group:"Vision",label:"Image URL Public Base",description:"Externally reachable base URL fronting the blob server (required for ssh, optional for direct)"}},"images.urls.ttlHours":{type:"number",default:72,ui:{tab:"model",group:"Vision",label:"Image URL Lifetime (hours)",description:"Serving window for locally hosted image URLs, measured from the last time a conversation sent them; resuming a conversation re-arms the window at the same link. 0 keeps links alive while the broker runs"}},"images.urls.bindHost":{type:"string",default:"127.0.0.1",ui:{tab:"model",group:"Vision",label:"Image URL Bind Host",description:"Host the blob server binds to; loopback for tunnels, 0.0.0.0 for direct serving"}},"images.urls.sshTarget":{type:"string",ui:{tab:"model",group:"Vision",label:"Image URL SSH Target",description:"user@host destination for the ssh reverse forward"}},"images.urls.sshRemotePort":{type:"number",default:8787,ui:{tab:"model",group:"Vision",label:"Image URL SSH Remote Port",description:"Remote listen port of the ssh reverse forward that your web server proxies to"}},"secrets.enabled":{type:"boolean",default:!1,ui:{tab:"providers",group:"Privacy",label:"Hide Secrets",description:"Obfuscate configured secrets and redact credential-shaped tokens before sending to AI providers"}},"stt.enabled":{type:"boolean",default:!1,ui:{tab:"interaction",group:"Speech",label:"Speech-to-Text",description:"Enable speech-to-text input via microphone"}},"stt.submitTrigger":{type:"enum",default:"never",values:["never","release","release-complete","say-submit"],ui:{tab:"interaction",group:"Speech",label:"Speech-to-Text Submit Trigger",description:"Choose when speech dictation automatically submits: Never, Release (2+ words), Release with complete sentence, or When I Say Submit.",options:[{value:"never",label:"Never",description:"Never automatically submit; insert dictation and remain in editor."},{value:"release",label:"Release",description:"Submit on release if the utterance has 2+ words to avoid accidental sends."},{value:"release-complete",label:"Release with complete sentence",description:"Submit on release if the utterance ends with sentence-terminal punctuation (. ? ! etc.)."},{value:"say-submit",label:"When I Say Submit",description:"Submit if the utterance ends with a word containing 'submit' (strips that word before submitting)."}]}},"collab.relayUrl":{type:"string",default:"wss://my.omp.sh",ui:{tab:"interaction",group:"Collab",label:"Relay URL",description:"Relay used by /collab (wss://host[:port])"}},"collab.webUrl":{type:"string",default:"",ui:{tab:"interaction",group:"Collab",label:"Web UI URL",description:"Browser UI used by /collab links; empty derives from collab.relayUrl; explicit http:// is localhost-only"}},"collab.displayName":{type:"string",default:"",ui:{tab:"interaction",group:"Collab",label:"Display Name",description:"Name shown to other collab participants (default: OS username)"}},"collab.autoStart":{type:"enum",default:"off",values:["off","view","control"],ui:{tab:"interaction",group:"Collab",label:"Auto Start",description:"Host every interactive session via collab.relayUrl as it starts and publish it to the local registry (omp collab list); rooms rotate on session switch",options:[{value:"off",label:"Off",description:"Share only when /collab is run"},{value:"view",label:"View",description:"Auto-host; the registry hands out view-only links (omp collab link --view)"},{value:"control",label:"Control",description:"Auto-host; the registry hands out control links that can prompt the session"}]}},"share.serverUrl":{type:"string",default:"https://my.omp.sh/s",ui:{tab:"interaction",group:"Collab",label:"Share Server",description:"Share viewer/upload base used by /share (encrypted blob upload + viewer; links are <base>/<id>#<key>)"}},"share.store":{type:"enum",default:"blob",values:["blob","gist"],ui:{tab:"interaction",group:"Collab",label:"Share Store",description:"Where /share uploads the encrypted session blob",options:[{value:"blob",label:"Encrypted Blob",description:"Upload to the share server (no GitHub account needed; avoids gist API rate limits)"},{value:"gist",label:"GitHub Gist",description:"Push to a secret gist (needs authenticated gh), falling back to the share server"}]}},"share.redactSecrets":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Collab",label:"Share Secret Redaction",description:"Run the secret obfuscator over /share snapshots before upload (uses the secrets.* config)"}},"stream.serverUrl":{type:"string",default:"https://live.omp.sh",ui:{tab:"interaction",group:"Stream",label:"Stream Server",description:"Live stream server used by `omp stream` (https://host[:port]); viewers watch at <base>/<your Stencil username>"}},"stream.redactPatterns":{type:"array",default:[],ui:{tab:"interaction",group:"Stream",label:"Extra Redaction Patterns",description:"Additional regular expressions redacted from every streamed row, on top of env/secrets.yml values and built-in credential shapes"}}}}});var Qrn;var ean=D(()=>{Qrn={"retry.enabled":{type:"boolean",default:!0,ui:{tab:"model",group:"Retry & Fallback",label:"Retry Enabled",description:"Retry transient provider errors (rate limits, outages, quota walls)."}},"retry.baseDelayMs":{type:"number",default:500,ui:{tab:"model",group:"Retry & Fallback",label:"Retry Base Delay (ms)",description:"Initial backoff before the first retry."}},"thinkingBudgets.minimal":{type:"number",default:1024,ui:{tab:"model",group:"Thinking",label:"Minimal Thinking Budget",description:"Token budget for the minimal thinking level."}},"thinkingBudgets.low":{type:"number",default:2048,ui:{tab:"model",group:"Thinking",label:"Low Thinking Budget",description:"Token budget for the low thinking level."}},"thinkingBudgets.medium":{type:"number",default:8192,ui:{tab:"model",group:"Thinking",label:"Medium Thinking Budget",description:"Token budget for the medium thinking level."}},"thinkingBudgets.high":{type:"number",default:16384,ui:{tab:"model",group:"Thinking",label:"High Thinking Budget",description:"Token budget for the high thinking level."}},"thinkingBudgets.xhigh":{type:"number",default:32768,ui:{tab:"model",group:"Thinking",label:"XHigh Thinking Budget",description:"Token budget for the xhigh thinking level."}},"thinkingBudgets.max":{type:"number",default:32768,ui:{tab:"model",group:"Thinking",label:"Max Thinking Budget",description:"Token budget for the max thinking level."}},"stt.language":{type:"string",default:"en",ui:{tab:"interaction",group:"Speech",label:"Speech-to-Text Language",description:'Source language for dictation (ISO-639-1, e.g. "id", "en"). Sent to the recognizer as a hint; leave it as "en" only if your dictation is English.'}},modelTags:{type:"record",default:{},ui:{tab:"model",group:"Prompt",label:"Model Tags",description:"Custom role/tag metadata; can introduce additional roles. JSON record."}},modelProviderOrder:{type:"array",default:[],ui:{tab:"model",group:"Prompt",label:"Model Provider Order",description:"Preferred provider order when a model id is ambiguous. JSON array."}},cycleOrder:{type:"array",default:["smol","default","slow"],ui:{tab:"model",group:"Prompt",label:"Model Cycle Order",description:"Roles cycled by the model switcher. JSON array."}},enabledModels:{type:"array",default:[],ui:{tab:"model",group:"Prompt",label:"Enabled Models",description:"Allow-list of models; supports path-scoped entries. Empty means all available models. JSON array."}},"task.agentServiceTierOverrides":{type:"record",default:{},ui:{tab:"model",group:"Sampling",label:"Agent Service Tier Overrides",description:"Sparse exact-name service-tier overrides for agents spawned by task/eval dispatch. JSON record."}},"compaction.reserveTokens":{type:"number",ui:{tab:"context",group:"Compaction",label:"Compaction Reserve Tokens",description:"Absolute reserve floor. Unset = larger of 16384 and 15% of the context window."}},"compaction.keepRecentTokens":{type:"number",default:20000,ui:{tab:"context",group:"Compaction",label:"Keep Recent Tokens",description:"Recent tokens always preserved through compaction."}},"compaction.autoContinue":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Auto-Continue",description:"Continue automatically after compaction."}},"autolearn.minToolCalls":{type:"number",default:5,ui:{tab:"memory",group:"Auto-Learn",label:"Min Tool Calls",description:"Only nudge after a turn that used at least this many tools.",condition:"autolearnActive"}},shellPath:{type:"string",ui:{tab:"shell",group:"Bash",label:"Shell Path",description:"Override the shell binary used by bash."}},"bash.autoBackground.thresholdMs":{type:"number",default:60000,ui:{tab:"shell",group:"Bash",label:"Auto-Background Threshold (ms)",description:"Threshold before auto-backgrounding long-running commands."}},"task.agentAdvisor":{type:"record",default:{},ui:{tab:"tasks",group:"Subagents",label:"Agent Advisor Overrides",description:'Per-agent subagent advisor: agent name → "on" / "off" / advisor model pattern. JSON record.'}},enabledProviders:{type:"array",default:[],ui:{tab:"providers",group:"Services",label:"Enabled Providers",description:"Foreign user-level discovery sources to load; supports path-scoped entries. JSON array."}},disabledProviders:{type:"array",default:[],ui:{tab:"providers",group:"Services",label:"Disabled Providers",description:"Disabled model/discovery providers; supports path-scoped entries. JSON array."}}}});function ob(e,t){return e[t]?.value}function tan(e,t){switch(e){case void 0:return!0;case"advisorEnabled":return ob(t,"advisor.enabled")===!0;case"vimModeEnabled":return ob(t,"tui.vimMode")===!0;case"hindsightActive":return ob(t,"memory.backend")==="hindsight";case"mnemopiActive":return ob(t,"memory.backend")==="mnemopi";case"autolearnActive":return ob(t,"autolearn.enabled")===!0;case"autoThinkingActive":return ob(t,"defaultThinkingLevel")==="auto";case"usageAwareFallbackEnabled":return ob(t,"retry.usageAwareFallback")===!0;case"planModeEnabled":return ob(t,"plan.enabled")===!0;case"planAutosaveEnabled":return ob(t,"plan.enabled")===!0&&ob(t,"plan.autosave")===!0;case"unexpectedStopSmart":return ob(t,"features.unexpectedStopDetection")==="smart";case"macOS":case"hasImageProtocol":return!0;default:return!0}}function nan(e){return Object.entries(SL).filter(([,t])=>t.ui.tab===e)}function ran(e,t,n){if(!n)return!0;return e.toLowerCase().includes(n)||t.ui.label.toLowerCase().includes(n)||t.ui.description.toLowerCase().includes(n)}var Gie,SL;var hRe=D(()=>{Xrn();ean();Gie=Jrn,SL={...Gie.entries,...Qrn}});function oan({entryKey:e,entry:t,value:n,initialValue:r,onChangeDirty:a,onCommit:i,saving:o,saveError:s}){let[l,u]=ne(()=>{if(n===void 0||n===null)return"";return Array.isArray(n)||typeof n==="object"?JSON.stringify(n):String(n)}),d=Le(!1),p=Le(r),h=st(()=>Array.isArray(t.ui.options)?t.ui.options:null,[t.ui.options]);Ae(()=>{let x=n===void 0||n===null?"":Array.isArray(n)||typeof n==="object"?JSON.stringify(n):String(n);u(x),d.current=!1},[n]);let f=()=>{let x=p.current,k=x===void 0||x===null?"":Array.isArray(x)||typeof x==="object"?JSON.stringify(x):String(x);u(k),d.current=!1,a(e,!1,()=>{})},g=(x)=>{let k=l;u(typeof x==="string"?x:JSON.stringify(x)),d.current=!1,i(e,x).then((C)=>{if(C)a(e,!1,()=>{});else u(k),a(e,!0,f)}).catch(()=>{u(k),a(e,!0,f)})},b=()=>{if(!d.current)return;if(t.type==="number"){let x=ian(l);if(x===null||x===n){f();return}g(x);return}if(t.type==="string"){let x=l.trim();if(x===n){f();return}g(x);return}if(t.type==="array"){let x=gqr(l);if(x===null||aan(x,n)){f();return}g(x);return}if(t.type==="record"){let x=bqr(l);if(x===null||aan(x,n)){f();return}g(x)}},y=()=>{let x=d.current;if(d.current=!0,!x)a(e,!0,f)};if(t.type==="boolean"){let x=n===!0;return m("button",{type:"button",role:"switch","aria-checked":x,"aria-label":t.ui.label,onClick:()=>{a(e,!1,()=>{}),g(!x)},disabled:o,className:`relative h-5 w-9 shrink-0 rounded-full transition-colors cursor-pointer ${x?"bg-ink":"bg-ink/15"} ${o?"opacity-50":""}`,children:m("span",{className:`absolute top-0.5 h-4 w-4 rounded-full bg-paper shadow-sm transition-all ${x?"left-[18px]":"left-0.5"}`})})}if(t.type==="array"&&t.ui.ordered&&h){let x=Array.isArray(n)?n.filter((_)=>typeof _==="string"):[],k=(_)=>{g(x.includes(_)?x.filter((w)=>w!==_):[...x,_])},C=(_,w)=>{let T=_+w;if(T<0||T>=x.length)return;let E=[...x],[L]=E.splice(_,1);E.splice(T,0,L),g(E)};return m("div",{className:"flex flex-wrap items-center gap-1.5 justify-end max-w-72",children:[x.map((_,w)=>{let T=h.find((E)=>E.value===_);return m("span",{className:"inline-flex items-center gap-1 rounded-md border border-ink/15 bg-ink/[0.03] px-2 py-0.5 text-[10px] text-ink",children:[w>0&&m("button",{type:"button","aria-label":`${T?.label??_} left`,onClick:()=>C(w,-1),className:"text-ink/40 hover:text-ink cursor-pointer",disabled:o,children:"←"}),T?.label??_,w<x.length-1&&m("button",{type:"button","aria-label":`${T?.label??_} right`,onClick:()=>C(w,1),className:"text-ink/40 hover:text-ink cursor-pointer",disabled:o,children:"→"}),m("button",{type:"button","aria-label":`Remove ${T?.label??_}`,onClick:()=>k(_),className:"text-ink/40 hover:text-error cursor-pointer",disabled:o,children:m(gn,{size:10})})]},_)}),x.length===0&&m("span",{className:"text-[10px] text-ink/40",children:"empty"}),m("details",{className:"relative",children:[m("summary",{className:"cursor-pointer rounded-md border border-ink/15 px-2 py-0.5 text-[10px] text-ink/70 hover:text-ink select-none",children:"add…"}),m("div",{className:"absolute right-0 top-full z-10 mt-1 max-h-44 w-48 overflow-auto rounded-md border border-ink/15 bg-paper p-1 shadow-lg",children:[h.filter((_)=>!x.includes(_.value)).map((_)=>m("button",{type:"button",onClick:()=>k(_.value),className:"block w-full rounded px-2 py-1 text-left text-[11px] text-ink/80 hover:bg-ink/5",children:_.label||_.value},_.value)),h.every((_)=>x.includes(_.value))&&m("div",{className:"px-2 py-1 text-[10px] text-ink/40",children:"all selected"})]})]})]})}let v=h??(t.type==="enum"&&t.values?t.values.map((x)=>({value:x,label:x,description:""})):null);if(v){let x=n===void 0||n===null?"":String(n);return m("div",{className:"flex items-center gap-2 shrink-0",children:m("select",{"aria-label":t.ui.label,value:x,onChange:(k)=>{let C=k.currentTarget.value;if(t.type==="number"){let _=ian(C);if(_===null||_===n)return;g(_)}else{if(C===n)return;g(C)}},disabled:o,className:`bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink max-w-56 ${o?"opacity-50":""}`,children:[x===""&&m("option",{value:"",disabled:!0,children:"select…"}),v.map((k)=>m("option",{value:k.value,children:k.label||k.value},k.value))]})})}if(t.type==="array")return m("input",{"aria-label":t.ui.label,type:"text",value:l,onChange:(x)=>{u(x.currentTarget.value),y()},onBlur:b,disabled:o,placeholder:'["anthropic","openai"]',className:`w-48 bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-right font-mono text-[11px] ${o?"opacity-50":""}`});if(t.type==="record")return m("input",{"aria-label":t.ui.label,type:"text",value:l,onChange:(x)=>{u(x.currentTarget.value),y()},onBlur:b,disabled:o,placeholder:'{"bash":"prompt"}',className:`w-48 bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-right font-mono text-[11px] ${o?"opacity-50":""}`});if(t.type==="number")return m("input",{"aria-label":t.ui.label,type:"text",inputMode:"decimal",value:l,onChange:(x)=>{u(x.currentTarget.value),y()},onBlur:b,disabled:o,className:`w-28 bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-right font-mono text-[11px] ${o?"opacity-50":""}`});return m("input",{"aria-label":t.ui.label,type:t.credential?"password":"text",value:l,onChange:(x)=>{u(x.currentTarget.value),y()},onBlur:b,disabled:o,className:`w-48 bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-right font-mono text-[11px] ${o?"opacity-50":""} ${s?"border-error":""}`})}var aan=(e,t)=>JSON.stringify(e)===JSON.stringify(t),ian=(e)=>{let t=e.trim();if(t===""||t==="-"||t==="+")return null;let n=Number(t);return Number.isFinite(n)?n:null},gqr=(e)=>{let t=e.trim();if(t==="")return[];try{let n=JSON.parse(t);return Array.isArray(n)?n:null}catch{return null}},bqr=(e)=>{let t=e.trim();if(t==="")return{};try{let n=JSON.parse(t);return typeof n==="object"&&n!==null&&!Array.isArray(n)?n:null}catch{return null}};var san=D(()=>{Xe();dt();de()});function can({tabs:e,entries:t,activeTabId:n,onSelectTab:r,searchQuery:a,dirtyKeys:i,savingKeys:o,saveErrors:s,onCommit:l,onReset:u,onDirty:d}){let p=e.find((g)=>g.id===n)??e[0],h=st(()=>{let g=a.trim().toLowerCase();if(g)return Object.entries(SL).filter(([b,y])=>ran(b,y,g)).map(([b])=>b).slice(0,80);return nan(p.id).filter(([,b])=>tan(b.ui.condition,t)).map(([b])=>b)},[t,p.id,a]),f=st(()=>{if(!a.trim())return[];let g=[],b=new Map;for(let y of h){let v=SL[y],x=e.find((_)=>_.id===v?.ui.tab),k=`${v?.ui.tab??"?"}\x00${v?.ui.group??""}`,C=b.get(k);if(!C)C={label:v?.ui.group?`${x?.label??v?.ui.tab} · ${v.ui.group}`:x?.label??v?.ui.tab??"Other",keys:[]},b.set(k,C),g.push({id:k,...C});C.keys.push(y)}return g},[h,a,e]);return m("div",{className:"w-full flex flex-col gap-3 text-xs",children:[m("div",{className:"flex items-center gap-1 overflow-x-auto pb-1 scrollbar-overlay-container",children:e.map((g)=>m("button",{type:"button",onClick:()=>r(g.id),className:`shrink-0 rounded-md px-2.5 py-1 text-[11px] font-medium transition-colors cursor-pointer ${g.id===p.id?"bg-ink/10 text-ink":"text-ink/55 hover:bg-ink/5 hover:text-ink"}`,children:g.label},g.id))}),m("div",{className:"w-full rounded-lg border border-ink/10 divide-y divide-ink/5",children:[a.trim()?f.map((g)=>m(lan,{keys:g.keys,entries:t,groupLabel:g.label,dirtyKeys:i,savingKeys:o,saveErrors:s,onCommit:l,onReset:u,onDirty:d},g.id)):p.groups.map((g)=>{let b=h.filter((y)=>SL[y]?.ui.group===g);if(b.length===0)return null;return m(lan,{keys:b,entries:t,groupLabel:g,dirtyKeys:i,savingKeys:o,saveErrors:s,onCommit:l,onReset:u,onDirty:d},g)}),h.length===0&&m("div",{className:"px-3 py-6 text-center text-ink/40",children:a.trim()?"No settings match your search.":"No settings in this tab."})]})]})}function lan({keys:e,entries:t,groupLabel:n,dirtyKeys:r,savingKeys:a,saveErrors:i,onCommit:o,onReset:s,onDirty:l}){return m("div",{children:[m("div",{className:"px-3 py-1.5 bg-ink/[0.02] text-[10px] uppercase tracking-wide text-ink/40 font-medium",children:n}),e.map((u)=>{let d=SL[u];if(!d?.ui)return null;let p=t[u]?.value,h=r.has(u),f=a.has(u),g=i.get(u);return m("div",{className:"flex items-center justify-between gap-3 px-3 py-2",children:[m("div",{className:"min-w-0 flex-1",children:[m("div",{className:"flex items-center gap-1.5",children:[m("span",{className:"font-medium text-ink",children:d.ui.label}),m("span",{className:"font-mono text-[9px] text-ink/30",title:"config key",children:u}),h&&!f&&m("span",{className:"shrink-0 rounded bg-warning/15 px-1 py-px text-[9px] font-semibold text-warning",children:"unsaved"}),f&&m("span",{className:"shrink-0 text-[9px] text-ink/40",children:"saving…"}),g&&!f&&m("span",{className:"shrink-0 rounded bg-error/10 px-1 py-px text-[9px] font-semibold text-error",title:g,children:"save failed"})]}),d.ui.description&&m("div",{className:"text-[10px] text-ink/40 leading-snug",children:d.ui.description}),g&&!f&&m("div",{className:"text-[10px] text-error leading-snug",children:g}),d.ui.warning&&m("div",{className:"text-[10px] text-error/80 leading-snug",children:d.ui.warning})]}),m("div",{className:"flex items-center gap-1.5 shrink-0",children:[m(oan,{entryKey:u,entry:d,value:p,initialValue:p,onChangeDirty:l,onCommit:o,saving:f,saveError:Boolean(g)}),m("button",{type:"button","aria-label":`Reset ${d.ui.label}`,title:"Reset to schema default",onClick:()=>s(u),disabled:f,className:`rounded p-1 text-ink/30 hover:text-ink transition-colors cursor-pointer disabled:opacity-40 ${f?"":"hover:bg-ink/5"}`,children:m(nu,{size:11})}),h&&m(Vt,{size:11,className:"text-ink/30"})]})]},u)})]})}var uan=D(()=>{Xe();dt();hRe();san();de()});function yqr(e,t){let n=oj[e];if(!n)return!1;if(n.kinds.includes(t.kind))return!0;return e==="web"&&t.kind==="chat"&&t.webCapable===!0}function pan(e,t){return t.filter((n)=>yqr(e,n)).sort((n,r)=>n.provider.localeCompare(r.provider)||n.name.localeCompare(r.name))}function fRe(e,t){let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;return n.every((r)=>t[r]===e[r])}function gRe(e,t){return e.find((n)=>fRe(n.roles,t))??null}var oj,dan;var man=D(()=>{oj={default:{label:"Default",section:"chat",kinds:["chat"]},smol:{label:"Fast",section:"chat",kinds:["chat"]},slow:{label:"Thinking",section:"chat",kinds:["chat"]},vision:{label:"Vision",section:"chat",kinds:["chat"]},plan:{label:"Architect",section:"chat",kinds:["chat"]},commit:{label:"Commit",section:"chat",kinds:["chat"]},tiny:{label:"Tiny",section:"chat",kinds:["tiny","chat"]},memory:{label:"Memory",section:"chat",kinds:["tiny","chat"]},task:{label:"Subtask",section:"chat",kinds:["chat"]},advisor:{label:"Advisor",section:"chat",kinds:["chat"]},widget:{label:"Job widgets",section:"chat",kinds:["chat"]},image:{label:"Image generation",section:"kind",kinds:["image"]},web:{label:"Web search",section:"kind",kinds:["search"]},speech:{label:"Speech (TTS)",section:"kind",kinds:["tts"]},dictation:{label:"Dictation (STT)",section:"kind",kinds:["stt"]},judge:{label:"Judge",section:"kind",kinds:["judge","tiny","chat"]}},dan=Object.keys(oj)});function vqr(e){let t=[];for(let n of e){let r=t[t.length-1];if(r&&r.provider===n.provider)r.rows.push(n);else t.push({provider:n.provider,rows:[n]})}return t}function han({role:e,info:t,value:n,candidates:r,disabled:a,onChange:i}){let o=r.some((u)=>u.selector===n),s=vqr(r),l=`${t.label} (${e}) model`;return m("div",{className:"flex items-center justify-between gap-3 px-3 py-2.5",children:[m("div",{className:"min-w-0",children:[m("div",{className:"font-medium text-ink",children:t.label}),m("div",{className:"font-mono text-[9px] text-ink/30",children:e})]}),m("select",{"aria-label":l,title:n||"omp decides this role",value:n,disabled:a,onChange:(u)=>i(e,u.currentTarget.value),className:"w-60 max-w-[60%] bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink font-mono text-[11px] cursor-pointer disabled:opacity-50",children:[m("option",{value:"",children:"— omp default —"}),n&&!o&&m("option",{value:n,children:[n," (not in catalog)"]}),s.map((u)=>m("optgroup",{label:u.provider,children:u.rows.map((d)=>m("option",{value:d.selector,children:d.name},d.selector))},u.provider))]})]})}var fan=D(()=>{de()});function gan({presets:e,selectedPreset:t,inUse:n,busy:r,onApply:a,onSave:i,onUpdate:o,onDelete:s}){let[l,u]=ne(!1),[d,p]=ne(""),[h,f]=ne(!1),g=()=>{let b=d.trim();if(!b)return;i(b),p(""),u(!1)};return m("div",{className:"rounded-lg border border-ink/10 bg-ink/[0.02] px-3 py-2 mb-3",children:[m("div",{className:"flex flex-wrap items-center gap-2",children:[m("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-ink/50",children:"Preset"}),m("select",{"aria-label":"Model role preset",value:t?.id??"",disabled:r||e.length===0,onChange:(b)=>{let y=e.find((v)=>v.id===b.currentTarget.value);if(y)a(y)},className:"bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-[11px] cursor-pointer disabled:opacity-50 min-w-[10rem]",children:[m("option",{value:"",children:e.length===0?"No presets yet":"Custom"}),e.map((b)=>m("option",{value:b.id,children:b.name},b.id))]}),t&&m("span",{className:`inline-flex items-center gap-1 text-[10px] ${n?"text-ink/50":"text-warning"}`,title:n?"The live roles are this preset":"The roles differ from this preset — Update stores them",children:n?m(bt,{children:[m(Vt,{size:11})," in use"]}):"modified"}),m("div",{className:"ml-auto flex items-center gap-1.5",children:[m("button",{type:"button",onClick:()=>u((b)=>!b),disabled:r,title:"Save the current roles as a new preset",className:"flex items-center gap-1 px-2 py-1 rounded-md border border-ink/15 text-ink/70 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer disabled:opacity-50 text-[11px]",children:[m(kr,{size:11})," Save as…"]}),m("button",{type:"button",onClick:o,disabled:r||!t,title:t?`Overwrite “${t.name}” with the current roles`:"Pick a preset first",className:"flex items-center gap-1 px-2 py-1 rounded-md border border-ink/15 text-ink/70 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer disabled:opacity-40 text-[11px]",children:[m(hp,{size:11})," Update"]}),m("button",{type:"button",onClick:()=>f(!0),disabled:r||!t,title:t?`Delete “${t.name}”`:"Pick a preset first",className:"p-1 rounded-md border border-ink/15 text-ink/50 hover:text-error hover:border-error/40 transition-colors cursor-pointer disabled:opacity-40",children:m(xr,{size:12})})]})]}),l&&m("div",{className:"flex items-center gap-2 pt-2",children:[m("input",{"aria-label":"New preset name",type:"text",value:d,autoFocus:!0,onInput:(b)=>p(b.currentTarget.value),onKeyDown:(b)=>{if(b.key==="Enter")g();if(b.key==="Escape")u(!1),p("")},placeholder:"e.g. cheap, thinking, review",className:"flex-1 bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-[11px]"}),m("button",{type:"button",onClick:g,disabled:!d.trim()||r,className:"px-2 py-1 rounded-md border border-ink/15 text-ink/80 hover:bg-ink/5 transition-colors cursor-pointer disabled:opacity-50 text-[11px]",children:"Save"}),m("button",{type:"button",onClick:()=>{u(!1),p("")},className:"px-2 py-1 rounded-md text-ink/50 hover:text-ink cursor-pointer text-[11px]",children:"Cancel"})]}),h&&t&&m("div",{className:"flex items-center gap-2 pt-2 text-[11px] text-ink/70",children:[m("span",{children:["Delete “",t.name,"”? The roles themselves are untouched."]}),m("button",{type:"button",onClick:()=>{f(!1),s()},disabled:r,className:"px-2 py-1 rounded-md border border-error/40 text-error hover:bg-error/10 transition-colors cursor-pointer disabled:opacity-50",children:"Delete"}),m("button",{type:"button",onClick:()=>f(!1),className:"px-2 py-1 rounded-md text-ink/50 hover:text-ink cursor-pointer",children:"Cancel"})]})]})}var ban=D(()=>{Xe();dt();de()});function yan({roles:e,presets:t,candidates:n,candidatesError:r,onSaveRoles:a,onSavePreset:i,onUpdatePreset:o,onDeletePreset:s,savedRole:l,writeError:u,onDismissWriteError:d}){let[p,h]=ne(e),[f,g]=ne(!1),[b,y]=ne(()=>gRe(t,e)?.id??null);Ae(()=>{h(e)},[e]),Ae(()=>{y((L)=>{if(L&&!t.some((P)=>P.id===L))return null;if(L)return L;return gRe(t,p)?.id??null})},[t,p]);let v=st(()=>t.find((L)=>L.id===b)??null,[t,b]),x=st(()=>Boolean(v&&fRe(v.roles,p)),[v,p]),k=Se(async(L)=>{h(L),g(!0);try{await a(L)}finally{g(!1)}},[a]),C=Se((L,P)=>{let R={...p};if(P)R[L]=P;else delete R[L];k(R)},[k,p]),_=Se((L)=>{y(L.id),k({...L.roles})},[k]),w=Se(async(L)=>{g(!0);try{await i(L,p)}finally{g(!1)}},[p,i]),T=Se(async()=>{if(!v)return;g(!0);try{await o({...v,roles:p})}finally{g(!1)}},[v,p,o]),E=Se(async()=>{if(!v)return;g(!0);try{await s(v),y(null)}finally{g(!1)}},[v,s]);return m("div",{className:"pt-2",children:[m("div",{className:"flex items-center justify-between pb-2",children:[m("div",{children:[m("h3",{className:"text-sm font-semibold text-ink",children:"Model Roles"}),m("p",{className:"text-ink/50 mt-0.5",children:"Role → model selectors from config.yml. Pick a preset to switch every role at once."})]}),l&&m("span",{className:"inline-flex items-center gap-1 text-[10px] text-ink/60",children:[m(Vt,{size:11})," saved"]})]}),m(gan,{presets:t,selectedPreset:v,inUse:x,busy:f,onApply:_,onSave:w,onUpdate:T,onDelete:E}),u&&m("div",{className:"flex items-start gap-1.5 pb-2 text-[10px] text-error",children:[m(Kn,{size:11,className:"mt-px flex-shrink-0"}),m("span",{className:"flex-1",children:u}),d&&m("button",{type:"button",onClick:d,className:"text-ink/40 hover:text-ink cursor-pointer","aria-label":"Dismiss role write error",children:"×"})]}),r&&m("div",{className:"flex items-start gap-1.5 pb-2 text-[10px] text-warning",children:[m(Kn,{size:11,className:"mt-px flex-shrink-0"}),m("span",{children:["Model catalog unavailable (",r,"). Stored selectors stay editable; new picks need a working omp install."]})]}),xqr.map((L)=>{let P=dan.filter((R)=>oj[R].section===L.id);return m("div",{className:"mb-3",children:[m("div",{className:"pb-1",children:[m("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-ink/50",children:L.title}),m("div",{className:"text-[10px] text-ink/40 leading-snug",children:L.note})]}),m("div",{className:"rounded-lg border border-ink/10 divide-y divide-ink/5",children:P.map((R)=>m(han,{role:R,info:oj[R],value:p[R]??"",candidates:pan(R,n),disabled:f,onChange:C},R))})]},L.id)})]})}var xqr;var van=D(()=>{Xe();dt();man();fan();ban();de();xqr=[{id:"chat",title:"Chat roles",note:"Each takes a chat model. “omp default” removes the override and omp resolves the role itself."},{id:"kind",title:"Model-kind roles",note:"Each takes a model of that kind only — a chat model here is silently unusable."}]});function xan(e){if(typeof e!=="object"||e===null||!("roles"in e))return null;let t=e.roles;if(typeof t!=="object"||t===null||Array.isArray(t))return null;return Object.fromEntries(Object.entries(t).filter((n)=>typeof n[1]==="string"))}function kan(e){if(typeof e!=="object"||e===null||!("error"in e))return null;return typeof e.error==="string"?e.error:null}function _an(e){let[t,n]=ne({}),[r,a]=ne([]),[i,o]=ne([]),[s,l]=ne(null),[u,d]=ne(null),p=Se(()=>d(null),[]),h=Se((x)=>{let k=xan(x);if(k)n(k);if(typeof x!=="object"||x===null)return;if("presets"in x&&Array.isArray(x.presets))a(x.presets);if("candidates"in x&&Array.isArray(x.candidates))o(x.candidates);if("candidatesError"in x)l(typeof x.candidatesError==="string"?x.candidatesError:null)},[]),f=Se(async(x)=>{let k=t;n(x),d(null);try{let _=await(await fetch("/api/model-roles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({roles:x})})).json(),w=xan(_);if(w)n(w);let T=typeof _==="object"&&_!==null&&"success"in _&&_.success===!0;if(T)e("role-map");else n(k),d(kan(_)??"The role write was refused");return T}catch(C){return console.error("Failed to save model roles:",C),n(k),d(C instanceof Error?C.message:String(C)),!1}},[e,t]),g=Se(async(x,k="")=>{d(null);try{let _=await(await fetch(`/api/model-roles${k}`,x)).json();if(typeof _==="object"&&_!==null&&"presets"in _&&Array.isArray(_.presets))a(_.presets);let w=typeof _==="object"&&_!==null&&"success"in _&&_.success===!0;if(!w)d(kan(_)??"The preset write was refused");return w}catch(C){return console.error("Failed to save model role preset:",C),d(C instanceof Error?C.message:String(C)),!1}},[]),b=Se((x,k)=>g({method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({preset:{name:x,roles:k}})}),[g]),y=Se((x)=>g({method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({preset:{id:x.id,name:x.name,roles:x.roles}})}),[g]),v=Se((x)=>g({method:"DELETE"},`?id=${encodeURIComponent(x.id)}`),[g]);return{roles:t,presets:r,candidates:i,candidatesError:s,writeError:u,clearWriteError:p,applyPayload:h,writeRoles:f,savePreset:b,updatePreset:y,deletePreset:v}}var wan=D(()=>{Xe()});function Can({extensions:e,savedExtension:t,onToggle:n}){if(e.length===0)return null;return m("div",{className:"pt-2",children:[m("div",{className:"flex items-center justify-between pb-2",children:[m("div",{children:[m("h3",{className:"text-sm font-semibold text-ink",children:"Extensions"}),m("p",{className:"text-ink/50 mt-0.5",children:"TS/JS modules loaded from .omp/extensions. Disable writes to config.yml."})]}),t&&m("span",{className:"inline-flex items-center gap-1 text-[10px] text-ink/60",children:[m(Vt,{size:11})," saved"]})]}),m("div",{className:"rounded-lg border border-ink/10 divide-y divide-ink/5",children:e.map((r)=>m("div",{className:"flex items-center justify-between gap-3 px-3 py-2.5",children:[m("div",{className:"min-w-0",children:[m("div",{className:"font-medium text-ink",children:r.name}),m("div",{className:"text-[10px] text-ink/40 truncate font-mono",children:[r.sourceRoot," · ",r.filePath]})]}),m("select",{"aria-label":`${r.name} enabled`,value:r.disabled?"false":"true",onChange:()=>n(r),className:"bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink",children:[m("option",{value:"true",children:"enabled"}),m("option",{value:"false",children:"disabled"})]})]},r.id))})]})}var San=D(()=>{dt();de()});function Tan(e){let[t,n]=ne(null),[r,a]=ne(!1),[i,o]=ne({}),[s,l]=ne([]),[u,d]=ne(!0),[p,h]=ne(Gie.tabs[0]?.id??"model"),[f,g]=ne(""),[b,y]=ne(null),[v,x]=ne(new Set),[k,C]=ne(new Set),[_,w]=ne(new Map),T=Se((N)=>{y(N),setTimeout(()=>y((O)=>O===N?null:O),2000)},[]),E=_an(T),L=Se(()=>{d(!0),Promise.all([fetch("/api/omp/state").then((N)=>N.json()),fetch("/api/settings/omp-config").then((N)=>N.json()),fetch("/api/model-roles").then((N)=>N.json()),fetch("/api/omp/extensions").then((N)=>N.json())]).then(([N,O,B,F])=>{if(N.running&&N.state)n(N.state);if(a(Boolean(N.running)),O.entries)o(O.entries);if(E.applyPayload(B),Array.isArray(F.extensions))l(F.extensions)}).catch((N)=>console.error("Failed to load omp settings:",N)).finally(()=>d(!1))},[E.applyPayload]);Ae(()=>{L()},[L]);let P=(N,O,B,F)=>{if(C((U)=>{let z=new Set(U);return z.delete(N),z}),x((U)=>{let z=new Set(U);return z.delete(N),z}),O){if(w((U)=>{if(!U.has(N))return U;let z=new Map(U);return z.delete(N),z}),B!==void 0)o((U)=>({...U,[N]:{...U[N],value:B}}));T(N)}else w((U)=>new Map(U).set(N,F??"omp rejected the write"))},R=Se(async(N,O)=>{C((B)=>new Set(B).add(N)),x((B)=>{let F=new Set(B);return F.delete(N),F});try{let F=await(await fetch("/api/settings/omp-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:N,value:O})})).json(),U=Boolean(F.success);return P(N,U,F.value,typeof F.error==="string"?F.error:void 0),U}catch(B){return console.error("Failed to save omp config:",B),P(N,!1,void 0,B instanceof Error?B.message:void 0),!1}},[]),I=Se(async(N)=>{C((O)=>new Set(O).add(N));try{let B=await(await fetch("/api/settings/omp-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:N,action:"reset"})})).json(),F=Boolean(B.success);return P(N,F,B.value,typeof B.error==="string"?B.error:void 0),F}catch(O){return console.error("Failed to reset omp config:",O),P(N,!1,void 0,O instanceof Error?O.message:void 0),!1}},[]),A=Se((N,O)=>{x((B)=>{let F=new Set(B);if(O)F.add(N);else F.delete(N);return F})},[]),M=(N)=>{fetch("/api/omp/extensions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:N.id,disabled:!N.disabled})}).then((O)=>O.json()).then((O)=>{if(O.success)l((B)=>B.map((F)=>F.id===N.id?{...F,disabled:!N.disabled}:F)),T(`ext-${N.id}`)}).catch((O)=>console.error("Failed to toggle extension:",O))};if(u)return m("div",{className:"flex items-center justify-center p-8 text-ink/40 text-xs",children:"Loading OMP settings..."});return m("div",{className:"w-full space-y-4 text-ink pb-2 text-xs",children:[m("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 pb-3 border-b border-ink/10",children:[m("div",{children:[m("h2",{className:"text-sm font-semibold text-ink",children:"OMP Engine"}),m("p",{className:"text-ink/50 mt-0.5",children:"Live agent state and the full native config schema from oh-my-pi."})]}),m("div",{className:"flex items-center gap-2",children:[m("div",{className:"relative",children:[m(na,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-ink/40 pointer-events-none"}),m("input",{"aria-label":"Search settings",type:"text",value:f,onChange:(N)=>g(N.currentTarget.value),placeholder:"Search settings…",className:"w-44 bg-paper border border-ink/15 rounded-md pl-6 pr-6 py-1 text-ink placeholder:text-ink/40"}),f&&m("button",{type:"button","aria-label":"Clear search",onClick:()=>g(""),className:"absolute right-1.5 top-1/2 -translate-y-1/2 text-ink/40 hover:text-ink cursor-pointer",children:m(gn,{size:11})})]}),m("button",{type:"button",onClick:L,className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-ink/15 text-ink/70 hover:text-ink hover:bg-ink/5 transition-all cursor-pointer",children:[m(In,{size:12})," Refresh"]})]})]}),m("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2",children:[m("div",{className:"rounded-lg border border-ink/10 bg-ink/[0.03] px-3 py-2",children:[m("div",{className:"text-[10px] uppercase tracking-wide text-ink/40",children:"Engine"}),m("div",{className:"font-semibold text-ink mt-0.5",children:r?"Running":"Idle"})]}),m("div",{className:"rounded-lg border border-ink/10 bg-ink/[0.03] px-3 py-2",children:[m("div",{className:"text-[10px] uppercase tracking-wide text-ink/40",children:"Model"}),m("div",{className:"font-semibold text-ink mt-0.5 truncate",children:t?.model?.id??"—"})]}),m("div",{className:"rounded-lg border border-ink/10 bg-ink/[0.03] px-3 py-2",children:[m("div",{className:"text-[10px] uppercase tracking-wide text-ink/40",children:"Thinking"}),m("div",{className:"font-semibold text-ink mt-0.5",children:t?.thinkingLevel??"—"})]}),m("div",{className:"rounded-lg border border-ink/10 bg-ink/[0.03] px-3 py-2",children:[m("div",{className:"text-[10px] uppercase tracking-wide text-ink/40",children:"Context"}),m("div",{className:"font-semibold text-ink mt-0.5",children:t?.contextUsage?.percent!=null?`${t.contextUsage.percent.toFixed(1)}%`:"—"})]})]}),m("div",{className:"pt-1",children:[m("div",{className:"flex items-center justify-between pb-2",children:[m("div",{children:[m("h3",{className:"text-sm font-semibold text-ink",children:"Config"}),m("p",{className:"text-ink/50 mt-0.5",children:["Schema-driven settings backed by ",m("span",{className:"font-mono",children:"omp config"}),".",f.trim()&&" — matching keys only"]})]}),b&&b!=="role-map"&&!b.startsWith("ext-")&&m("span",{className:"inline-flex items-center gap-1 text-[10px] text-ink/60",children:["saved ",b]})]}),m(can,{tabs:Gie.tabs,entries:i,activeTabId:p,onSelectTab:h,searchQuery:f,dirtyKeys:v,savingKeys:k,saveErrors:_,onCommit:R,onReset:I,onDirty:A})]}),m(yan,{roles:E.roles,presets:E.presets,candidates:E.candidates,candidatesError:E.candidatesError,onSaveRoles:E.writeRoles,onSavePreset:E.savePreset,onUpdatePreset:E.updatePreset,onDeletePreset:E.deletePreset,savedRole:b==="role-map"?"roles":null,writeError:E.writeError,onDismissWriteError:E.clearWriteError}),m(Can,{extensions:s,savedExtension:b?.startsWith("ext-")?b.slice(4):null,onToggle:M})]})}var Ean=D(()=>{Xe();dt();hRe();uan();van();wan();San();de()});function Aan({activeMetrics:e}){return m("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-2.5 items-stretch",children:[m(mo,{value:e.processedTokens,label:"Processed tokens",hint:e.activeRate}),m(mo,{value:e.cachedInput,label:"Cached input",hint:e.cachedPercent}),m(mo,{value:e.uncachedInput,label:"Uncached input",hint:"0 cache writes"}),m(mo,{value:e.outputTokens,label:"Output",hint:e.reasoning}),m(mo,{value:e.cacheSavings,label:"Cache savings",hint:"0.0x the raw token cost",tone:"muted",className:"col-span-2 sm:col-span-1"})]})}var Lan=D(()=>{F6();de()});function Nan({breakdownTab:e,setBreakdownTab:t,activeBreakdownRows:n,activeMetrics:r,cadence:a}){return m("div",{className:"grid grid-cols-1 xl:grid-cols-3 gap-3",children:[m("div",{className:"bg-paper border border-ink/15 rounded-lg p-3.5 shadow-xs xl:col-span-2",children:[m("div",{className:"flex justify-between items-center mb-3",children:[m("span",{className:"font-semibold text-xs text-ink",children:"Breakdown"}),m("div",{className:"flex bg-ink/5 rounded p-0.5",children:[m("button",{onClick:()=>t("model"),className:`px-2 py-0.5 rounded text-[9px] font-bold tracking-wider transition-colors ${e==="model"?"bg-paper shadow-xs text-ink":"text-ink/50 hover:text-ink"}`,children:"MODEL"}),m("button",{onClick:()=>t("day"),className:`px-2 py-0.5 rounded text-[9px] font-bold tracking-wider transition-colors ${e==="day"?"bg-paper shadow-xs text-ink":"text-ink/50 hover:text-ink"}`,children:Ran[a]}),m("button",{onClick:()=>t("project"),className:`px-2 py-0.5 rounded text-[9px] font-bold tracking-wider transition-colors ${e==="project"?"bg-paper shadow-xs text-ink":"text-ink/50 hover:text-ink"}`,children:"PROJECT"})]})]}),m("div",{className:"overflow-x-auto",children:m("table",{className:"w-full text-[11px]",children:[m("thead",{children:m("tr",{className:"text-ink/40 border-b border-ink/10",children:[m("th",{className:"font-medium text-left pb-2 capitalize",children:e==="day"?Ran[a].toLowerCase():e}),m("th",{className:"font-medium text-right pb-2",children:"Cost"}),m("th",{className:"font-medium text-right pb-2",children:"Share"}),m("th",{className:"font-medium text-right pb-2",children:"Tokens"})]})}),m("tbody",{className:"divide-y divide-ink/5",children:n.map((i)=>m("tr",{children:[m("td",{className:"py-2.5 flex items-center gap-2",children:[m("div",{className:`w-1.5 h-1.5 rounded-full ${i.dotColorClass}`}),m("span",{className:"font-semibold text-ink whitespace-nowrap",children:i.name})]}),m("td",{className:"py-2.5 text-right font-bold text-ink",children:i.cost}),m("td",{className:"py-2.5 text-right text-ink/60",children:i.share}),m("td",{className:"py-2.5 text-right text-ink/60",children:i.tokens})]},i.name))})]})}),m("div",{className:"h-1.5 w-full bg-ink/5 rounded-full mt-3 overflow-hidden flex",children:n.map((i,o)=>m("div",{className:`h-full ${o===0?"bg-ink/80":o===1?"bg-ink/45 border-l border-paper":"bg-ink/20 border-l border-paper"}`,style:{width:`${i.sharePercent}%`}},i.name))})]}),m("div",{className:"bg-paper border border-ink/15 rounded-lg p-3.5 shadow-xs xl:col-span-1",children:[m("div",{className:"font-semibold text-xs mb-3 text-ink",children:"Cost quality"}),m("div",{className:"space-y-2 text-[11px]",children:[m("div",{className:"flex justify-between items-center",children:[m("span",{className:"text-ink/60",children:"Provider reported"}),m("span",{className:"font-semibold text-ink",children:"100.0%"})]}),m("div",{className:"flex justify-between items-center",children:[m("span",{className:"text-ink/60",children:"Model priced"}),m("span",{className:"font-semibold text-ink",children:"0.0%"})]}),m("div",{className:"flex justify-between items-center",children:[m("span",{className:"text-ink/60",children:"Unpriced"}),m("span",{className:"font-semibold text-ink",children:"0.0%"})]})]}),m("div",{className:"border-t border-ink/10 mt-3 pt-2.5",children:m("div",{className:"flex justify-between items-center text-[11px]",children:[m("span",{className:"text-ink/60",children:"Cache savings"}),m("span",{className:"font-semibold text-ink",children:r.cacheSavings})]})})]})]})}var Ran;var Ian=D(()=>{de();Ran={daily:"DAY",weekly:"WEEK",monthly:"MONTH"}});function kqr(e,t,n){if(e.length===0)return"";if(e.length===1)return"M0,98 L100,98";let r=n>0?n:1;return e.map((a,i)=>{let o=i/(e.length-1)*100,s=98-t[i]/r*94;return`${i===0?"M":"L"}${o.toFixed(2)},${s.toFixed(2)}`}).join(" ")}function Man({cadence:e,metric:t,series:n}){let r=n.map((p)=>t==="cost"?p.cost:p.tokens),a=r.length>0?Math.max(...r):0,i=kqr(n,r,a),o=t==="cost"?aM(a)||"$0.00":ym(a)??"0",s=t==="cost"?aM(a/2)||"$0.00":ym(a/2)??"0",l=n[0]?.label??"",u=n.length>2?n[Math.floor(n.length/2)]?.label??"":"",d=n.length>1?n[n.length-1]?.label??"":"";if(n.length===0)return m("div",{className:"h-28 flex items-center justify-center text-[11px] text-ink/40",children:"No usage data in this period"});return m("div",{className:"h-28 relative",children:[m("div",{className:"absolute inset-0 flex flex-col justify-between pt-1 pb-4",children:[m("div",{className:"border-t border-ink/5 w-full border-dashed"}),m("div",{className:"border-t border-ink/5 w-full border-dashed"}),m("div",{className:"border-t border-ink/15 w-full"})]}),m("div",{className:"absolute left-0 top-0 bottom-4 flex flex-col justify-between text-[9px] font-mono text-ink/40 w-9",children:[m("span",{children:o}),m("span",{children:s}),m("span",{children:"0"})]}),m("div",{className:"absolute left-10 right-0 bottom-4 top-0 flex items-end",children:m("svg",{className:"w-full h-full",preserveAspectRatio:"none",viewBox:"0 0 100 100",children:m("path",{d:i,fill:"none",stroke:"currentColor",className:"text-ink/60 transition-all duration-300",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),m("div",{className:"absolute left-10 right-0 bottom-0 h-4 flex justify-between text-[9px] text-ink/40 items-end",children:[m("span",{children:l}),u&&m("span",{children:u}),m("span",{children:d})]}),m("span",{className:"sr-only",children:`${e} ${t} trend`})]})}var Pan=D(()=>{de()});function Dan({settings:e,onUpdate:t}){let[n,r]=ne("daily"),[a,i]=ne("30d"),[o,s]=ne(!1),[l,u]=ne("cost"),[d,p]=ne("model"),[h,f]=ne(!1),g=new Date().toISOString().slice(0,10),b=new Date(Date.now()-2592000000).toISOString().slice(0,10),[y,v]=ne(b),[x,k]=ne(g),[C,_]=ne([]),[w,T]=ne(null),[E,L]=ne([]),[P,R]=ne([]),I=Le(null);Pr(I,()=>s(!1));let A=Se(()=>{f(!0);let B=a==="custom"?`&customFrom=${y}&customTo=${x}`:"";fetch(`/api/telemetry/tokens?timeRange=${a}&breakdownTab=${d}&cadence=${n}${B}`).then((F)=>F.json()).then((F)=>{if(F.timeRanges)_(F.timeRanges);if(F.metrics)T(F.metrics);if(F.breakdownRows)L(F.breakdownRows);if(F.chartSeries)R(F.chartSeries)}).catch((F)=>console.error("Failed to load token telemetry:",F)).finally(()=>f(!1))},[a,d,n,y,x]);Ae(()=>{A()},[A]);let M=()=>{A()},N=C.find((B)=>B.id===a)||C[0]||{id:a,label:a,dateRange:"Current Period"},O=a==="custom"?`${y} to ${x}`:N.dateRange;if(!w)return m("div",{className:"flex items-center justify-center p-8 text-ink/40 text-xs",children:"Loading token usage telemetry..."});return m("div",{className:"w-full space-y-4 text-ink pb-2 text-xs",children:[m("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 pb-3 border-b border-ink/10",children:[m("div",{className:"flex items-center gap-2",children:m("span",{className:"text-xs font-semibold text-ink/75",children:O})}),m("div",{className:"flex flex-wrap items-center gap-2",children:[m("div",{className:"flex items-center bg-paper border border-ink/15 rounded-md text-[11px] font-medium overflow-hidden",children:[m("button",{onClick:()=>r("daily"),className:`px-2.5 py-1 transition-colors ${n==="daily"?"bg-ink/10 text-ink font-semibold":"text-ink/65 hover:bg-ink/5 hover:text-ink"}`,children:"Daily"}),m("button",{onClick:()=>r("weekly"),className:`px-2.5 py-1 transition-colors ${n==="weekly"?"bg-ink/10 text-ink font-semibold":"text-ink/65 hover:bg-ink/5 hover:text-ink"}`,children:"Weekly"}),m("button",{onClick:()=>r("monthly"),className:`px-2.5 py-1 transition-colors ${n==="monthly"?"bg-ink/10 text-ink font-semibold":"text-ink/65 hover:bg-ink/5 hover:text-ink"}`,children:"Monthly"})]}),m("div",{className:"relative",ref:I,children:[m("button",{onClick:()=>s(!o),className:"flex items-center gap-1.5 px-2.5 py-1 bg-paper border border-ink/15 rounded-md text-[11px] font-medium hover:bg-ink/5 text-ink/80 transition-colors",children:[m("span",{children:N.label}),m(Gn,{size:12,className:`transition-transform duration-150 ${o?"rotate-180":""}`})]}),o&&m("div",{className:"absolute right-0 top-full mt-1 w-44 bg-paper border border-ink/15 rounded-md shadow-lg z-30 py-1 text-[11px] divide-y divide-ink/5",children:[C.map((B)=>m("button",{onClick:()=>{if(i(B.id),B.id!=="custom")s(!1)},className:`w-full flex items-center justify-between px-3 py-1.5 text-left hover:bg-ink/5 transition-colors ${a===B.id?"font-semibold text-ink bg-ink/5":"text-ink/70"}`,children:[m("span",{children:B.label}),a===B.id&&m(Vt,{size:12,className:"text-ink"})]},B.id)),a==="custom"&&m("div",{className:"px-3 py-2 space-y-2",children:[m("label",{className:"block",children:[m("span",{className:"text-[9px] font-mono uppercase tracking-wider text-ink/40",children:"From"}),m("input",{type:"date",value:y,max:x,onChange:(B)=>v(B.currentTarget.value),className:"mt-0.5 w-full bg-paper border border-ink/15 rounded px-1.5 py-1 text-[11px] text-ink focus:outline-none focus:border-ink/40"})]}),m("label",{className:"block",children:[m("span",{className:"text-[9px] font-mono uppercase tracking-wider text-ink/40",children:"To"}),m("input",{type:"date",value:x,min:y,max:g,onChange:(B)=>k(B.currentTarget.value),className:"mt-0.5 w-full bg-paper border border-ink/15 rounded px-1.5 py-1 text-[11px] text-ink focus:outline-none focus:border-ink/40"})]}),m("button",{onClick:()=>s(!1),className:"w-full bg-ink/10 hover:bg-ink/20 text-ink font-semibold rounded px-2 py-1 transition-colors",children:"Apply"})]})]})]}),m("button",{onClick:M,className:"p-1.5 bg-paper border border-ink/15 rounded-md hover:bg-ink/5 text-ink/80 transition-colors",title:"Refresh Token Telemetry",children:m(In,{size:12,className:h?"animate-spin text-ink":""})})]})]}),m("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3",children:[m("div",{className:"bg-paper border border-ink/15 rounded-lg p-3.5 shadow-xs flex flex-col justify-between",children:[m("div",{children:[m("div",{className:"text-[10px] font-mono font-semibold text-ink/40 tracking-wider uppercase mb-2",children:"USAGECONFIG.RAWTOKENCOST"}),m("div",{className:"flex items-baseline gap-1 mb-0.5",children:[m("span",{className:"text-2xl font-bold tracking-tight text-ink",children:w.rawCost}),m("span",{className:"text-xs font-semibold text-ink/50",children:"*"})]}),m("p",{className:"text-[11px] text-ink/50 mb-4",children:"* if billed at full API rate"})]}),m("div",{children:[m("div",{className:"h-1.5 w-full bg-ink/10 rounded-full mb-2 overflow-hidden flex",children:m("div",{className:"h-full bg-ink/80 rounded-full",style:{width:"100%"}})}),m("div",{className:"flex items-center justify-between text-[11px]",children:[m("div",{className:"flex items-center gap-1.5",children:[m("div",{className:"w-2 h-2 rounded-full bg-ink/80"}),m("span",{className:"font-semibold text-ink",children:"DeepSeek"})]}),m("div",{className:"flex items-center gap-3 text-ink/70",children:[m("span",{className:"font-bold text-ink",children:w.rawCost}),m("span",{children:"100.0% share"}),m("span",{children:w.processedTokens})]})]})]})]}),m("div",{className:"bg-paper border border-ink/15 rounded-lg p-3.5 shadow-xs flex flex-col",children:[m("div",{className:"flex justify-between items-start mb-3",children:[m("div",{className:"flex items-center gap-2",children:[m("span",{className:"font-semibold text-xs text-ink capitalize",children:[n," ",l]}),m("div",{className:"flex items-center gap-1",children:[m("div",{className:"w-1.5 h-1.5 rounded-full bg-ink/80"}),m("span",{className:"text-[11px] text-ink/60",children:"DeepSeek"})]})]}),m("div",{className:"flex bg-ink/5 rounded p-0.5",children:[m("button",{onClick:()=>u("cost"),className:`px-2 py-0.5 rounded text-[9px] font-bold tracking-wider transition-colors ${l==="cost"?"bg-paper shadow-xs text-ink":"text-ink/50 hover:text-ink"}`,children:"COST"}),m("button",{onClick:()=>u("tokens"),className:`px-2 py-0.5 rounded text-[9px] font-bold tracking-wider transition-colors ${l==="tokens"?"bg-paper shadow-xs text-ink":"text-ink/50 hover:text-ink"}`,children:"TOKENS"})]})]}),m(Man,{cadence:n,metric:l,series:P})]})]}),m(Aan,{activeMetrics:w}),m(Nan,{breakdownTab:d,setBreakdownTab:p,activeBreakdownRows:E,activeMetrics:w,cadence:n}),m("div",{className:"text-center text-[10px] text-ink/40 pt-2",children:["Scanned ",w.scannedTranscripts," transcripts (1 outside the window) · ",w.usageRecords," usage records · 0.1s"]})]})}var $an=D(()=>{Xe();dt();Lan();Ian();Pan();to();de()});function _qr({provider:e,selected:t}){return m("span",{className:t?"text-ink/80":"text-ink/60",children:m(qo,{slug:e.id,name:e.name,size:14})})}function Oan({report:e,selectedProviderId:t,onSelectProvider:n}){let r=pL(e);return m("div",{className:"w-full md:w-64 md:border-r border-ink/10 h-full flex flex-col bg-paper/50 flex-shrink-0 select-none",children:[m("div",{className:"px-3.5 py-2.5 border-b border-ink/10 flex items-center justify-between",children:m("span",{className:"text-xs font-semibold text-ink",children:[r.length," provider",r.length===1?"":"s"," with keys"]})}),m("div",{className:"flex-1 scrollbar-overlay-container p-1.5 space-y-3 text-xs",children:r.length===0?m("p",{className:"px-2.5 py-3 text-[11px] text-ink/50 leading-relaxed",children:"No provider credentials detected. Add an API key in Settings → Providers."}):m("div",{children:[m("div",{className:"px-2.5 pt-1.5 pb-1 text-[10px] font-bold text-ink/50 uppercase tracking-wider",children:"Providers"}),m("div",{className:"space-y-0.5",children:r.map((a)=>{let i=a.id===t;return m("button",{type:"button",onClick:()=>n(a.id),className:`w-full text-left px-2.5 py-2 rounded-lg transition-colors cursor-pointer flex flex-col gap-0.5 group ${i?"bg-ink/10 text-ink font-medium shadow-2xs":"text-ink/80 hover:bg-ink/5 hover:text-ink"}`,children:[m("div",{className:"flex items-center justify-between gap-1.5",children:[m("div",{className:"flex items-center gap-1.5 min-w-0",children:[m("div",{className:"relative",children:[m(_qr,{provider:a,selected:i}),m("span",{className:`absolute -top-0.5 -right-0.5 w-1.5 h-1.5 rounded-full ${a.error?"bg-error/60":"bg-ink"}`})]}),m("span",{className:"font-semibold text-xs text-ink truncate",children:a.name})]}),m("span",{className:`text-[10px] font-mono uppercase px-1.5 py-0.5 rounded bg-ink/10 font-medium ${a.error?"text-error":"text-ink/70"}`,children:mL(a)})]}),m("p",{className:"text-[11px] text-ink/60 line-clamp-1 leading-snug pl-5",children:a.hint})]},a.id)})})]})})]})}var Fan=D(()=>{Vz();lf();de()});function Ban(){let e=ip(),{report:t,isLoading:n,error:r,reload:a}=fie(),[i,o]=ne(""),s=t?pL(t):[],l=s.find((u)=>u.id===i)??s[0];if(Ae(()=>{if(l&&l.id!==i)o(l.id)},[l,i]),r&&!t)return m("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 p-8 text-center text-xs",children:[m(Kn,{size:16,className:"text-error"}),m("p",{className:"text-error text-xs",children:r}),m("button",{type:"button",onClick:()=>a(),className:"text-[11px] font-semibold text-ink/70 hover:text-ink underline underline-offset-2",children:"Try again"})]});if(!t)return m("div",{className:"flex h-full w-full items-center justify-center text-ink/40 text-xs",children:"Loading provider usage..."});return m("div",{className:"flex h-full w-full overflow-hidden bg-paper text-xs text-ink",children:m(op,{pane:e.pane,onBack:e.back,listLabel:"Usage",list:m(Oan,{report:t,selectedProviderId:l?.id??"",onSelectProvider:(u)=>{o(u),e.openDetail()}}),detail:m("div",{className:"flex-1 h-full overflow-hidden flex flex-col",children:[m("div",{className:"px-3.5 py-2.5 border-b border-ink/10 flex items-center justify-between gap-3 flex-shrink-0",children:[m("div",{className:"flex items-center gap-2 min-w-0",children:[m("span",{className:"text-xs font-semibold text-ink/75 truncate",children:["Updated ",rb(t.generatedAt)]}),t.isMock&&m("span",{className:"text-[10px] font-mono uppercase tracking-wider bg-ink/5 border border-ink/15 rounded px-1.5 py-0.5 text-ink/60",children:"Mock"})]}),m("button",{type:"button",onClick:()=>a({force:!0}),disabled:n,className:"p-1.5 bg-paper border border-ink/15 rounded-md hover:bg-ink/5 text-ink/80 transition-colors disabled:opacity-50 flex-shrink-0",title:"Refresh usage",children:m(In,{size:12,className:n?"animate-spin text-ink":""})})]}),m("div",{className:"flex-1 overflow-y-auto scrollbar-overlay-container p-3.5 space-y-4",children:[r&&m("p",{className:"text-error text-xs",children:r}),l?m(uie,{summary:l.summary}):m("p",{className:"text-[11px] text-ink/50 leading-relaxed",children:"No provider credentials detected. Add an API key in Settings → Providers and it will appear here."}),m(hie,{})]})]})})})}var zan=D(()=>{Xe();dt();Fan();Vz();jLe();ULe();Ry();qLe();U2();G2();de()});function jan({settings:e,onUpdate:t}){let[n,r]=ne(!1),a=()=>{r(!0),Pie(),setTimeout(()=>r(!1),600)},i=e.chatCompletionSound??e.soundAlerts??!0;return m("div",{className:"w-full space-y-6 text-xs text-ink",children:m("div",{className:"bg-paper border border-ink/15 rounded-lg p-4 shadow-xs space-y-4",children:[m("div",{className:"flex items-start justify-between gap-4",children:[m("div",{className:"flex items-start gap-3",children:[m("div",{className:"w-8 h-8 rounded-md bg-ink/5 border border-ink/10 flex items-center justify-center flex-shrink-0 mt-0.5",children:i?m(N6,{size:16,className:"text-ink"}):m(hI,{size:16,className:"text-ink/40"})}),m("div",{children:[m("div",{className:"text-sm font-semibold text-ink flex items-center gap-2",children:[m("span",{children:"AI Response Completion Sound"}),m("span",{className:"text-[10px] uppercase font-mono px-1.5 py-0.5 rounded bg-ink/10 text-ink/80 font-bold",children:"Audio Chime"})]}),m("p",{className:"text-ink/65 text-[11px] mt-1 leading-relaxed",children:"Play an audible notification chime when the AI completes generating its response, thinking blocks, or diagnostic execution."})]})]}),m("button",{type:"button",role:"switch","aria-checked":i,onClick:()=>{let o=!i;if(t({chatCompletionSound:o,soundAlerts:o}),o)Pie()},className:`relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none ${i?"bg-ink":"bg-ink/20"}`,children:m("span",{"aria-hidden":"true",className:`pointer-events-none inline-block h-5 w-5 transform rounded-full bg-paper shadow ring-0 transition duration-200 ease-in-out ${i?"translate-x-5":"translate-x-0"}`})})]}),m("div",{className:"pt-3 border-t border-ink/10 flex items-center justify-between",children:[m("span",{className:"text-[11px] text-ink/60 flex items-center gap-1.5",children:[m(Wi,{size:13,className:"text-ink/60"}),"Warm harmonic chime synthesized natively via Web Audio"]}),m("button",{type:"button",onClick:a,className:`px-3 py-1.5 rounded-md border border-ink/20 bg-paper hover:bg-ink/5 text-ink font-medium text-[11px] flex items-center gap-1.5 transition-all shadow-xs active:scale-95 ${n?"border-ink bg-ink/10":""}`,children:[m(N6,{size:13,className:n?"animate-bounce text-ink":"text-ink/70"}),m("span",{children:n?"Playing...":"Test Sound"})]})]})]})})}var Uan=D(()=>{Xe();dt();nj();de()});function Cqr({isOpen:e,onClose:t,initialCategory:n="appearance",appSettings:r={},autoOpenAddProvider:a=!1}){let[i,o]=ne(n),[s,l]=ne(a),[u,d]=ne(""),[p,h]=ne(!1),[f,g]=ne(null),[b,y]=ne("success"),v=oae(),{isReloading:x,reload:k}=fen(),{isRestarting:C,restart:_}=ben(),w=(N,O="success")=>{g(N),y(O),setTimeout(()=>g((B)=>B===N?null:B),3000)},[T,E]=ne(()=>Gje(wqr,r));Ae(()=>{if(e)o(n),l(a),h(a),d("")},[e,n,a]),Wo("omp:open-settings",(N)=>{let O=N;if(O.detail?.category)o(O.detail.category);if(O.detail?.autoOpenAdd)l(!0)});let L=(N)=>{E((O)=>{let B=typeof N==="function"?N(O):{...O,...N};if(typeof document<"u"&&B.theme)uae(B.theme);if(typeof window<"u"&&B.editorFont!==O.editorFont)window.dispatchEvent(new CustomEvent(Eie,{detail:B.editorFont}));return v(ien(O,B,N)),B}),w("Setting was saved")},P=async()=>{let N=await k();w(N.message,N.ok?"success":"error")},R=async()=>{let N=await _();w(N.message,N.ok?"success":"error")},I=(N)=>{o(N),h(!0)};if(!e)return null;let A=Rie.find((N)=>N.id===i)||Rie[0],M=()=>{switch(i){case"appearance":return m(Ren,{settings:T,onUpdate:L});case"chats":return m(jen,{settings:T,onUpdate:L});case"projects":return m(ftn,{});case"providers":return m(Lnn,{autoOpenAdd:s,onAddModalClose:()=>l(!1)});case"agents":return m(Dnn,{settings:T,onUpdate:L});case"behavior":return m(znn,{});case"commands":return m(Hnn,{settings:T,onUpdate:L});case"mcp":return m(nrn,{settings:T,onUpdate:L});case"token-usage":return m(Dan,{settings:T,onUpdate:L});case"notifications":return m(jan,{settings:T,onUpdate:L});case"plugins":return m(krn,{});case"panel-plugins":return m(jrn,{});case"skills":return m(lrn,{settings:T,onUpdate:L,onNavigateToCatalog:()=>o("skills-catalog")});case"skills-catalog":return m(Vrn,{});case"omp":return m(Tan,{settings:T,onUpdate:L});case"usage":return m(Ban,{});default:return m(Krn,{category:i})}};return m("div",{className:"fixed inset-0 bg-ink/40 backdrop-blur-[2px] z-50 flex items-center justify-center p-0 md:p-6 animate-in fade-in duration-150",onClick:t,children:m("div",{className:"relative bg-paper border border-ink/15 md:rounded-2xl shadow-2xl w-full h-full md:max-w-4xl lg:max-w-5xl xl:max-w-[1150px] md:h-[782px] md:max-h-[92vh] flex flex-col md:flex-row overflow-hidden text-ink",onClick:(N)=>N.stopPropagation(),children:[m("div",{className:"hidden md:flex w-64 flex-shrink-0 h-full",children:m(KLe,{activeCategory:i,onSelectCategory:(N)=>o(N),searchQuery:u,onSearchChange:d,onReloadOmp:P,isReloading:x,onRestartKabmo:R,isRestarting:C,className:"w-full"})}),m("div",{className:`flex-1 flex-col h-full bg-paper overflow-hidden ${p?"flex":"hidden md:flex"}`,children:[m("div",{className:"px-6 border-b border-ink/10 flex items-center justify-between flex-shrink-0 bg-paper",style:{height:"calc(4rem + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)",paddingLeft:"max(1.5rem, env(safe-area-inset-left, 0px))",paddingRight:"max(1.5rem, env(safe-area-inset-right, 0px))"},children:[m("div",{className:"flex items-center space-x-3 min-w-0",children:[m("button",{type:"button",onClick:()=>h(!1),className:"md:hidden p-1.5 -ml-2 rounded-lg hover:bg-ink/5 active:bg-ink/10 text-ink","aria-label":"Back to categories",children:m(Vy,{size:20})}),m("div",{className:"truncate",children:[m("h3",{className:"font-semibold text-base tracking-tight text-ink leading-tight",children:A.label}),m("p",{className:"text-[11px] text-ink/60 truncate hidden sm:block",children:A.description})]})]}),m("button",{type:"button",onClick:t,className:"p-1.5 rounded-lg text-ink/50 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer","aria-label":"Close settings",children:m(gn,{size:18,strokeWidth:2.2})})]}),m("div",{className:`flex-1 scrollbar-overlay-container w-full ${["projects","providers","agents","behavior","commands","mcp","plugins","skills","skills-catalog","usage","panel-plugins"].includes(i)?"p-0 flex flex-col":"p-6 md:p-8 flex flex-col"}`,style:{paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:m("div",{className:"w-full h-full flex-1 flex flex-col",children:M()})})]}),m("div",{className:`flex-1 flex-col h-full bg-canvas md:hidden ${p?"hidden":"flex"}`,children:[m("div",{className:"px-4 border-b border-ink/10 flex items-center justify-between flex-shrink-0 bg-canvas",style:{height:"calc(3.5rem + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)",paddingLeft:"max(1rem, env(safe-area-inset-left, 0px))",paddingRight:"max(1rem, env(safe-area-inset-right, 0px))"},children:[m("span",{className:"font-bold text-sm tracking-tight text-ink",children:"Settings"}),m("button",{type:"button",onClick:t,className:"p-1.5 rounded-lg text-ink/50 hover:text-ink","aria-label":"Close",children:m(gn,{size:18})})]}),m("div",{className:"flex-1 overflow-hidden",style:{paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:m(KLe,{activeCategory:i,onSelectCategory:I,searchQuery:u,onSearchChange:d,onReloadOmp:P,isReloading:x,onRestartKabmo:R,isRestarting:C,className:"w-full border-r-0"})})]}),f&&m("div",{className:"absolute bottom-6 left-1/2 transform -translate-x-1/2 bg-ink text-canvas px-4 py-2 rounded-lg text-xs font-semibold shadow-lg animate-in fade-in slide-in-from-bottom-2 z-50 flex items-center space-x-2 max-w-[calc(100%-2rem)]",children:[b==="error"?m(Kn,{size:14,className:"text-error shrink-0"}):m(Vt,{size:14,className:"text-success shrink-0"}),m("span",{children:f})]})]})})}var wqr;var qan=D(()=>{Xe();dt();_c();G7e();gen();yen();Y9();Gb();G4();Lie();vg();wen();Nen();Uen();gtn();Rnn();$nn();jnn();Vnn();rrn();crn();_rn();Urn();Zrn();Yrn();Ean();$an();zan();Uan();de();wqr={theme:RC,editorFont:tj,autoSessionTitle:!0,soundAlerts:!0,chatCompletionSound:!0,goalAuditEnabled:!0,goalAuditModel:"",goalDefaultBudget:null,followUpBehavior:"queue",keybindingSend:"Enter",keybindingNewLine:"Shift + Enter",keybindingSteering:"Ctrl / Cmd + Enter"}});function FT({isOpen:e,...t}){if(!e)return null;return m(co,{fallback:null,children:m(Sqr,{isOpen:e,...t})})}var Sqr;var sj=D(()=>{ka();de();Sqr=bi(()=>Promise.resolve().then(() => (qan(),{})).then((e)=>({default:Cqr})))});var Hie;var bRe=D(()=>{Hie={name:"@kabmo-labs/kabmo",version:"0.6.1",description:"Web console and diagnostic workbench for AI coding agents — Elysia + Preact on Bun.",license:"UNLICENSED",author:"Wijanarko Putra Rajeb <wijanarko.rajeb@gmail.com>",type:"module",engines:{bun:">=1.4.0"},publishConfig:{access:"public"},bin:{kabmo:"./src/cli/kabmo.js"},repository:{type:"git",url:"git+https://github.com/kabmo-labs/kabmo.git"},homepage:"https://github.com/kabmo-labs/kabmo#readme",bugs:{url:"https://github.com/kabmo-labs/kabmo/issues"},keywords:["kabmo","coding-agent","agent","console","elysia","preact","bun"],files:["src","extensions","index.html","bunfig.toml","public","tsconfig.json","marketplace","dist/client"],scripts:{dev:"bun run --hot src/server/index.ts --kabmo-server","dev:lan":"HOST=0.0.0.0 bun run --hot src/server/index.ts --kabmo-server",build:"bun run scripts/build-client.ts","omp:schema":"bun run scripts/omp-schema.mjs","omp:schema:check":"bun run scripts/omp-schema.mjs --check",start:"NODE_ENV=production bun run src/server/index.ts --kabmo-server",typecheck:"tsc",clean:"rm -rf dist",lint:"tsc --noEmit",test:"bun test","test:e2e":"playwright test --config tests/e2e/playwright.config.ts","readme:media":"bun run scripts/readme-media.ts","typecheck:e2e":"tsc --noEmit -p tests/e2e","publish:plugins":"bash .github/scripts/publish-plugin-packages.sh packages/kabmo-sdk packages/kabmo-ui"},dependencies:{"@fontsource/fira-code":"^5.3.0","@kabmo-labs/kabmo-sdk":"workspace:*","@kabmo-labs/kabmo-ui":"workspace:*","@shikijs/langs":"^4.4.3","@shikijs/themes":"^4.4.3","@tailwindcss/postcss":"^4.1.14","@xterm/addon-fit":"^0.11.0","@xterm/addon-webgl":"^0.19.0","@xterm/xterm":"^6.0.0",dompurify:"^3.4.15",elysia:"^1.4.30",katex:"^0.18.7","lucide-preact":"^1.47.0",mammoth:"^1.13.0",marked:"^18.0.11","marked-linkify-it":"^4.0.2",mermaid:"^12.0.0",postcss:"^8.5.16",preact:"^10.29.8","read-excel-file":"^9.3.12",remend:"^1.3.1",ripgrep:"^0.3.1",shiki:"^4.4.3",tailwindcss:"^4.1.14",yaml:"^2.9.1"},devDependencies:{"@playwright/test":"^1.64.0","@semantic-release/changelog":"^7.0.0","@semantic-release/commit-analyzer":"^13.0.1","@semantic-release/git":"^11.0.1","@semantic-release/github":"^12.0.10","@semantic-release/npm":"^13.2.0","@semantic-release/release-notes-generator":"^14.1.1","@types/bun":"^1.4.2","@types/node":"^22.14.0","bun-types":"^1.4.2","conventional-changelog-conventionalcommits":"^9.3.1","happy-dom":"^20.14.5","semantic-release":"^25.0.9",typescript:"~5.8.2"},workspaces:["packages/*"]}});function Wan({className:e=""}){return m("svg",{viewBox:"0 0 64 64",className:`inline-block h-[1.1009em] w-auto flex-none [vertical-align:-0.1982em] ${e}`,style:{height:"1.5625cap",verticalAlign:"-0.28125cap",marginRight:"-0.28em"},"aria-hidden":"true",focusable:"false",children:[m("rect",{width:"64",height:"64",rx:"14",style:{fill:"var(--color-brand-tile)"}}),m("g",{fill:"none",strokeWidth:7,strokeLinecap:"round",strokeLinejoin:"round",children:[m("path",{d:"M20 15v34",style:{stroke:"var(--color-brand-cream)"}}),m("path",{d:"M20 32 42 15",style:{stroke:"var(--color-brand)"}}),m("path",{d:"M20 32 42 49",style:{stroke:"var(--color-brand-cream)"}})]})]})}var Gan=D(()=>{de()});function kg({className:e="text-[15px]"}){return m("span",{className:`font-extrabold tracking-tight ${e}`,children:[m(Wan,{}),m("span",{className:"sr-only",children:"K"}),m("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-amber-500 to-orange-600",style:{paddingRight:"0.06em",marginRight:"-0.06em"},children:"ab"}),m("span",{className:"text-ink",style:{marginLeft:"0.02em"},children:"mo"})]})}var BT=D(()=>{Gan();de()});function Han(){return m("div",{className:"flex flex-col items-center gap-4 mt-6 pt-1",children:[m("div",{className:"flex items-center justify-center gap-6",children:[m("a",{href:"https://discord.gg/TWYp6K2jd",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-xs font-medium text-ink/75 hover:text-ink transition-colors",children:[m("svg",{className:"w-4 h-4 fill-current",viewBox:"-1.611 -1.611 27.223 27.223",children:m("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994.021-.041.001-.09-.041-.106a13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.929 1.793 8.18 1.793 12.061 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.894.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.028zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"})}),m("span",{children:"Discord"})]}),m("a",{href:"https://www.instagram.com/kabmo-labs/",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-xs font-medium text-ink/75 hover:text-ink transition-colors",children:[m("svg",{className:"w-4 h-4 fill-current",viewBox:"0 0 24 24",children:m("path",{d:"M7.0301.084c-1.2768.0602-2.1487.264-2.911.5634-.7888.3075-1.4575.72-2.1228 1.3877-.6652.6677-1.075 1.3368-1.3802 2.127-.2954.7638-.4956 1.6365-.552 2.914-.0564 1.2775-.0689 1.6882-.0626 4.947.0062 3.2586.0206 3.6671.0825 4.9473.061 1.2765.264 2.1482.5635 2.9107.308.7889.72 1.4573 1.388 2.1228.6679.6655 1.3365 1.0743 2.1285 1.38.7632.295 1.6361.4961 2.9134.552 1.2773.056 1.6884.069 4.9462.0627 3.2578-.0062 3.668-.0207 4.9478-.0814 1.28-.0607 2.147-.2652 2.9098-.5633.7889-.3086 1.4578-.72 2.1228-1.3881.665-.6682 1.0745-1.3378 1.3795-2.1284.2957-.7632.4966-1.636.552-2.9124.056-1.2809.0692-1.6898.063-4.948-.0063-3.2583-.021-3.6668-.0817-4.9465-.0607-1.2797-.264-2.1487-.5633-2.9117-.3084-.7889-.72-1.4568-1.3876-2.1228C21.2982 1.33 20.628.9208 19.8378.6165 19.074.321 18.2017.1197 16.9244.0645 15.6471.0093 15.236-.005 11.977.0014 8.718.0076 8.31.0215 7.0301.0839m.1402 21.6932c-1.17-.0509-1.8053-.2453-2.2287-.408-.5606-.216-.96-.4771-1.3819-.895-.422-.4178-.6811-.8186-.9-1.378-.1644-.4234-.3624-1.058-.4171-2.228-.0595-1.2645-.072-1.6442-.079-4.848-.007-3.2037.0053-3.583.0607-4.848.05-1.169.2456-1.805.408-2.2282.216-.5613.4762-.96.895-1.3816.4188-.4217.8184-.6814 1.3783-.9003.423-.1651 1.0575-.3614 2.227-.4171 1.2655-.06 1.6447-.072 4.848-.079 3.2033-.007 3.5835.005 4.8495.0608 1.169.0508 1.8053.2445 2.228.408.5608.216.96.4754 1.3816.895.4217.4194.6816.8176.9005 1.3787.1653.4217.3617 1.056.4169 2.2263.0602 1.2655.0739 1.645.0796 4.848.0058 3.203-.0055 3.5834-.061 4.848-.051 1.17-.245 1.8055-.408 2.2294-.216.5604-.4763.96-.8954 1.3814-.419.4215-.8181.6811-1.3783.9-.4224.1649-1.0577.3617-2.2262.4174-1.2656.0595-1.6448.072-4.8493.079-3.2045.007-3.5825-.006-4.848-.0608M16.953 5.5864A1.44 1.44 0 1 0 18.39 4.144a1.44 1.44 0 0 0-1.437 1.4424M5.8385 12.012c.0067 3.4032 2.7706 6.1557 6.173 6.1493 3.4026-.0065 6.157-2.7701 6.1506-6.1733-.0065-3.4032-2.771-6.1565-6.174-6.1498-3.403.0067-6.156 2.771-6.1496 6.1738M8 12.0077a4 4 0 1 1 4.008 3.9921A3.9996 3.9996 0 0 1 8 12.0077"})}),m("span",{children:"Instagram"})]}),m("a",{href:"https://www.threads.com/@kabmo-labs",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-xs font-medium text-ink/75 hover:text-ink transition-colors",children:[m("svg",{className:"w-4 h-4 fill-current",viewBox:"0 0 24 24",children:m("path",{d:"M18.263 11.097c-.03-3.486-1.92-5.586-5.111-5.586-2.13 0-3.922.963-4.863 2.499l2.062 1.438c.535-.843 1.272-1.543 2.628-1.543 1.528 0 2.318.85 2.544 2.431a15 15 0 0 0-2.236-.173c-4.125 0-6.068 1.867-6.068 4.336s1.943 3.99 4.804 3.99c3.139 0 5.013-2.115 5.781-4.735.798.361 1.348 1.204 1.348 2.47 0 3.387-3.907 5.232-7.22 5.232-4.885 0-8.077-3.207-8.077-8.424 0-6.392 4.223-10.487 9.9-10.487 3.808 0 5.69 1.671 6.97 3.914l2.108-1.475C21.44 2.078 18.331 0 13.663 0 6.227 0 1.168 5.277 1.168 12.934c0 7 4.953 11.066 10.856 11.066 4.878 0 9.809-2.846 9.809-7.716 0-2.545-1.46-4.231-3.569-5.187m-6.33 4.855c-1.077 0-2.026-.512-2.026-1.453 0-1.483 1.822-1.934 3.606-1.934.678 0 1.34.045 1.927.173-.422 1.927-1.671 3.215-3.508 3.214Z"})}),m("span",{children:"Threads"})]})]}),m("div",{className:"flex items-center justify-center gap-6",children:m("a",{href:"https://github.com/kabmo-labs/kabmo",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-xs font-medium text-ink/75 hover:text-ink transition-colors",children:[m("svg",{className:"w-4 h-4 fill-current",viewBox:"1.902 1.902 20.196 20.196",children:m("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.53 1.032 1.53 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"})}),m("span",{children:"GitHub"})]})})]})}var Van=D(()=>{de()});function Vie(e,t){let n=(e.pending+t).split(`
4999
+ ${e.current} → ${e.latest}`,children:[mRe(e.current)," → ",mRe(e.latest)]}),m("button",{type:"button",onClick:()=>void a(r),disabled:n!==null,title:`Update from ${t} — fetches the remote's commit and rebuilds the plugin`,className:"ml-auto flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded border border-ink/25 text-ink hover:bg-ink/5 disabled:opacity-40 flex-shrink-0",children:[i?m(en,{size:11,className:"animate-spin"}):m(S5,{size:11}),"Update"]})]})}var Arn=D(()=>{dt();de()});function Lrn({plugins:e,slots:t,failures:n,iconUrls:r,readmeUrls:a,busy:i,onBuild:o,onRemove:s,onSetEnabled:l,gitStatus:u,onUpdateGit:d}){let[p,h]=ne(null);return m("section",{children:[m("header",{className:"flex items-center gap-2 mb-2",children:[m("h3",{className:"text-sm font-medium text-ink",children:"Installed"}),m("span",{className:"ml-auto text-[11px] text-ink/50",children:[e.length," plugin",e.length===1?"":"s"]})]}),m("div",{className:"grid gap-3 [grid-template-columns:repeat(auto-fill,minmax(240px,1fr))]",children:e.map((f)=>{let g=t.get(f.pluginId),b=n.get(f.pluginId),y=ik(f.pluginId),v=i===`enable:${y}`||i===`disable:${y}`,x=g?cqr.filter((k)=>g.components[k]):[];return m("article",{className:`flex flex-col gap-2 border rounded-lg p-3 transition-colors ${f.enabled?"border-ink/10 bg-paper":"border-ink/10 bg-ink/[0.02]"}`,children:[m("div",{className:"flex items-start gap-2.5",children:[m("div",{className:f.enabled?"":"opacity-50",children:m(ib,{name:f.name,iconUrl:r.get(f.pluginId)})}),m("div",{className:"min-w-0 flex-1",children:[m("div",{className:"text-xs font-medium text-ink truncate",title:f.name,children:f.name}),m("div",{className:"text-[11px] text-ink/45 font-mono truncate",title:f.pluginId,children:f.pluginId})]}),m("button",{type:"button",role:"switch","aria-checked":f.enabled,"aria-label":`${f.enabled?"Disable":"Enable"} ${f.name}`,disabled:i!==null,onClick:()=>void l(y,!f.enabled),title:f.enabled?"Disable — keep the files, remove its buttons":"Enable this plugin",className:`relative w-8 h-4 rounded-full transition-colors flex-shrink-0 mt-0.5 disabled:opacity-40 ${f.enabled?"bg-ink/70":"bg-ink/20"}`,children:v?m(en,{size:9,className:"absolute inset-0 m-auto animate-spin text-canvas"}):m("span",{className:`absolute top-0.5 w-3 h-3 rounded-full bg-canvas transition-all ${f.enabled?"left-[18px]":"left-0.5"}`})})]}),!f.enabled?m("p",{className:"text-[11px] text-ink/45",children:"Disabled — contributes nothing while the switch is off."}):b?m("p",{className:"text-[11px] text-error",children:["Bundle failed to load — ",b]}):!g?m("p",{className:"text-[11px] text-ink/45",children:"Loading bundle…"}):x.length===0?m("p",{className:"text-[11px] text-ink/45",children:"Loaded, but registers no panels."}):m("div",{className:"flex flex-wrap items-center gap-1.5",children:x.map((k)=>m("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-ink/10 text-ink/60",title:g.titles[k]??k,children:k},k))}),m("div",{className:"mt-auto flex items-center gap-1.5 pt-1",children:[f.bundled?m("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-ink/10 text-ink/50",children:"bundled"}):null,!f.built?m("button",{type:"button",onClick:()=>void o(f.pluginId),disabled:i!==null,title:f.reason?`Rebuild — ${f.reason}`:"Rebuild this plugin",className:"flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded border border-warning/40 text-warning hover:bg-warning/10 disabled:opacity-40",children:[i===`build:${f.pluginId}`?m(en,{size:11,className:"animate-spin"}):m(LN,{size:11}),"Rebuild"]}):null,m("span",{className:"ml-auto flex items-center gap-1",children:[a.get(f.pluginId)?m("button",{type:"button",onClick:()=>h(f),title:`Read ${f.name}'s README`,"aria-label":`Read ${f.name}'s README`,className:"p-1 rounded text-ink/40 hover:text-ink hover:bg-ink/5 flex-shrink-0",children:m(ps,{size:13})}):null,m(Crn,{pluginId:f.pluginId,disabled:i!==null,onRemove:s})]})]}),!f.built?m("p",{className:"text-[11px] text-warning",children:["Not built",f.reason?` — ${f.reason}`:"",". The bundle will 404 until it is built."]}):null,f.gitOrigin?m(Ern,{status:u[f.pluginId],origin:f.gitOrigin,busy:i,pluginId:f.pluginId,onUpdate:d}):null]},f.pluginId)})}),p&&a.get(p.pluginId)?m(qie,{pluginId:p.pluginId,name:p.name,readmeUrl:a.get(p.pluginId),onClose:()=>h(null)}):null]})}var cqr;var Rrn=D(()=>{Xe();dt();dRe();CL();pRe();Arn();yb();de();cqr=["rightPanel","panel","headerPanel","settingsSection"]});function Nrn({disabled:e,busy:t,onSetEnabled:n}){let r=new Set(e);return m("section",{children:[m("header",{className:"flex items-center gap-2 mb-2",children:[m("h3",{className:"text-sm font-medium text-ink",children:"Built-in"}),m("span",{className:"ml-auto text-[11px] text-ink/50",children:[F2.length-F2.filter((a)=>r.has(a.id)).length," of"," ",F2.length," on"]})]}),m("p",{className:"text-[11px] text-ink/50 mb-2",children:"The views Kabmo ships. Switch one off to put it away — its code stays in the app, so this is reversible at any time and needs no reinstall."}),m("div",{className:"grid gap-2 [grid-template-columns:repeat(auto-fill,minmax(200px,1fr))]",children:F2.map((a)=>{let i=!r.has(a.id),o=t===`enable:${a.id}`||t===`disable:${a.id}`;return m("div",{className:`flex items-center gap-2.5 border border-ink/10 rounded-lg px-2.5 py-2 transition-colors ${i?"bg-paper":"bg-ink/[0.02]"}`,children:[m("span",{className:i?"text-ink/70 flex-shrink-0":"text-ink/30 flex-shrink-0",children:a.icon}),m("span",{className:"min-w-0 flex-1",children:[m("span",{className:`block text-xs truncate ${i?"text-ink":"text-ink/45"}`,title:a.title,children:a.title}),m("span",{className:"block text-[10px] font-mono text-ink/40 truncate",children:a.id})]}),m("button",{type:"button",role:"switch","aria-checked":i,"aria-label":`${i?"Disable":"Enable"} ${a.title}`,disabled:t!==null,onClick:()=>void n(a.id,!i),title:i?"Switch off — remove its button":"Switch on",className:`relative w-8 h-4 rounded-full transition-colors flex-shrink-0 disabled:opacity-40 ${i?"bg-ink/70":"bg-ink/20"}`,children:o?m(en,{size:9,className:"absolute inset-0 m-auto animate-spin text-canvas"}):m("span",{className:`absolute top-0.5 w-3 h-3 rounded-full bg-canvas transition-all ${i?"left-[18px]":"left-0.5"}`})})]},a.id)})})]})}var Irn=D(()=>{dt();xie();de()});function pqr({name:e,destinations:t,current:n,onMove:r}){if(t.length<2)return null;return m("span",{className:"flex items-center gap-1 flex-shrink-0",children:t.map((a)=>{let i=dqr[a],o=a===n;return m("button",{type:"button",disabled:o,onClick:()=>r(a),title:o?`${e} is on the ${Wie[a]}`:`Move ${e} to the ${Wie[a]}`,"aria-label":o?`${e} is on the ${Wie[a]}`:`Move ${e} to the ${Wie[a]}`,"aria-pressed":o,className:`flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded border flex-shrink-0 transition-colors ${o?"border-ink/30 bg-ink/10 text-ink/50 cursor-default":"border-ink/25 text-ink/80 hover:bg-ink/5 cursor-pointer"}`,children:[m(i,{size:11}),a==="left"?"Left":a==="right"?"Right":"Editor"]},a)})})}function Mrn({dock:e,plugins:t,slots:n}){let r=[];for(let i of t){let o=n.get(i.pluginId);if(!i.enabled||!o)continue;for(let s of["rightPanel","panel"]){if(!o.components[s])continue;let l=bb(i.pluginId,s);r.push({plugin:i,key:l,slot:s,side:Nb(l,e),title:o.titles[s]??i.name})}}let a=t.filter((i)=>i.enabled&&!n.get(i.pluginId)).length;return m("section",{children:[m("header",{className:"flex items-center gap-2 mb-2",children:[m("h3",{className:"text-sm font-medium text-ink",children:"Panel placement"}),m("span",{className:"ml-auto text-[11px] text-ink/50",children:e.enabled?`${e.panels.length} on the rail`:"rail off"})]}),m("p",{className:"text-[11px] text-ink/50 mb-2",children:"The left column always holds the session list. Turn its rail on to add views beside it — a panel placed there gets its own button and its own width, and leaves the right column. Each contributed panel is placed on its own: a plugin that ships two panels gets two rows."}),!e.enabled?m("p",{className:"text-[11px] text-ink/45 mb-2",children:"The rail is off. Placing a panel on the left turns it on, and you can switch it back off here at any time."}):null,m("div",{className:"flex items-center gap-2.5 border border-ink/10 rounded-lg px-2.5 py-2 mb-2",children:[m("span",{className:"min-w-0 flex-1",children:[m("span",{className:"block text-xs text-ink",children:"Show the left activity bar"}),m("span",{className:"block text-[10px] text-ink/40",children:"Off by default. With it off the column shows only its active view."})]}),m("button",{type:"button",role:"switch","aria-checked":e.enabled,"aria-label":e.enabled?"Hide the left activity bar":"Show the left activity bar",onClick:()=>e.setEnabled(!e.enabled),className:`relative w-8 h-4 rounded-full transition-colors flex-shrink-0 ${e.enabled?"bg-ink/70":"bg-ink/20"}`,children:m("span",{className:`absolute top-0.5 w-3 h-3 rounded-full bg-canvas transition-all ${e.enabled?"left-[18px]":"left-0.5"}`})})]}),r.length===0?m("p",{className:"text-[11px] text-ink/45",children:a>0?`Loading ${a} plugin ${a===1?"bundle":"bundles"}…`:"No installed plugin contributes a panel yet. Install one from the store above and it appears here."}):m("div",{className:"grid gap-2 [grid-template-columns:repeat(auto-fill,minmax(240px,1fr))]",children:[m("div",{className:"flex flex-col gap-1.5 border border-ink/10 rounded-lg px-2.5 py-2 bg-ink/[0.02]",children:[m("span",{className:"min-w-0",children:[m("span",{className:"block text-xs text-ink",children:"Sessions"}),m("span",{className:"block text-[10px] text-ink/40",children:"The dock's own view — always here."})]}),m("span",{className:"text-[10px] font-mono text-ink/40 self-start",children:hs})]}),r.map(({plugin:i,key:o,slot:s,side:l,title:u})=>{let d=bq(s);return m("div",{className:"flex flex-col gap-1.5 border border-ink/10 rounded-lg px-2.5 py-2",children:[m("span",{className:"min-w-0",children:[m("span",{className:"block text-xs text-ink",title:`${u} — ${i.name}`,children:[u,m("span",{className:"text-ink/40",children:[" · ",i.name]})]}),m("span",{className:"block text-[10px] text-ink/40",children:[uqr[l],s==="panel"?" · takeover":" · view",l==="left"&&!e.enabled?" · rail off":""]})]}),d.length>1?m(pqr,{name:u,destinations:d,current:l,onMove:(p)=>e.setSide(o,p)}):m("span",{className:"flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded border border-ink/10 text-ink/50 self-start",title:`${u} draws the editor column — its slot has no other destination`,children:[m(zu,{size:11,className:"opacity-40"}),"Fixed"]})]},o)})]}),a>0&&r.length>0?m("p",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-ink/45",children:[m(en,{size:11,className:"animate-spin"}),a," plugin ",a===1?"bundle is":"bundles are"," still loading."]}):null,m("p",{className:"mt-2 flex items-start gap-1.5 text-[11px] text-ink/40",children:[m(Dg,{size:11,className:"mt-0.5 flex-shrink-0 opacity-60"}),m("span",{children:"A takeover draws the editor column whole, so its switch is the editor panel's own rail (Files · your panels). A view rides a rail and gets one button on the column it is placed on."})]})]})}var uqr,Wie,dqr;var Prn=D(()=>{dt();yb();yf();de();uqr={left:"Left dock",right:"Right column",editor:"Editor column"},Wie={left:"left dock",right:"right column",editor:"editor column"},dqr={left:Tb,right:Rk,editor:hf}});function Drn({autoUpdate:e,busy:t,gitCount:n,onSetAutoUpdate:r,onCheckUpdates:a,onRefresh:i}){return m("div",{className:"flex flex-wrap items-center gap-2",children:[m("button",{type:"button",role:"checkbox","aria-checked":e,disabled:t!==null,onClick:()=>void r(!e),title:e?"Stop updating git-installed plugins automatically":"Fetch and apply the remote’s latest commit for every git-installed plugin, hourly",className:"flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded border border-ink/15 hover:bg-ink/5 disabled:opacity-50",children:[e?m(Ck,{size:13}):m(gp,{size:13}),"Auto-update git plugins"]}),m("button",{type:"button",onClick:()=>void a(),disabled:t!==null||n===0,title:n===0?"No git-installed plugins to check":"Ask each git-installed plugin’s remote whether a newer commit exists",className:"flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded border border-ink/15 hover:bg-ink/5 disabled:opacity-50",children:[m(In,{size:13,className:t==="check_updates"?"animate-spin":""}),"Check for updates"]}),m("button",{type:"button",onClick:i,disabled:t!==null,className:"flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded border border-ink/15 hover:bg-ink/5 disabled:opacity-50",title:"Re-read the marketplace from disk",children:[m(In,{size:13}),"Refresh"]}),m("span",{className:"text-[11px] text-ink/45",children:e?"Git plugins are updated from their remote about once an hour, with no confirmation.":"Off — updates are applied only when you press Update."})]})}var $rn=D(()=>{dt();de()});function Orn({blocked:e,busy:t,onForceSync:n}){let r=Object.entries(e);if(r.length===0)return null;return m("div",{className:"space-y-2",children:r.map(([a,i])=>{let o=i.changed.slice(0,mqr),s=i.changed.length-o.length;return m("div",{className:"border border-warning/40 rounded p-3 space-y-1.5",children:[m("div",{className:"flex items-center gap-2 text-warning",children:[m(pr,{size:14,className:"flex-shrink-0"}),m("span",{className:"text-xs",children:[m("span",{className:"font-medium",children:a})," has local changes — its bundled update is paused"]})]}),m("p",{className:"text-[11px] text-ink/60",children:["Kabmo installed this plugin, and ",i.changed.length," of its files no longer match what it wrote. Your files are left as they are."]}),m("ul",{className:"text-[10px] font-mono text-ink/50 space-y-0.5",children:[o.map((l)=>m("li",{className:"truncate",title:l,children:l},l)),s>0?m("li",{children:["… and ",s," more"]}):null]}),m("div",{className:"flex items-center gap-2 pt-0.5",children:[m("button",{type:"button",disabled:t!==null,onClick:()=>void n(a),title:`Replace ${i.changed.length} changed file(s) with the copy Kabmo ships — your edits are lost`,className:"flex items-center gap-1.5 px-2 py-1 text-[11px] rounded border border-warning/50 text-warning hover:bg-warning/10 disabled:opacity-50",children:[t===`force_sync:${a}`?m(en,{size:12,className:"animate-spin"}):m(nu,{size:12}),"Replace my changes with the store's copy"]}),m("span",{className:"text-[11px] text-ink/45",children:"This discards the files listed above."})]})]},a)})})}var mqr=5;var Frn=D(()=>{dt();de()});function hqr({error:e,busy:t,onForget:n}){let r=e.source;return m("div",{className:"border border-error/30 rounded p-3",children:[m("div",{className:"flex items-center gap-2 text-error",children:[m(pr,{size:14,className:"flex-shrink-0"}),m("span",{className:"text-xs",children:"Rejected"})]}),m("div",{className:"mt-1 text-[11px] font-mono text-ink/50 break-all",children:e.dir}),m("div",{className:"mt-1 text-xs text-ink/70",children:e.reason}),r?m("div",{className:"mt-2 flex items-center gap-2",children:[m("button",{type:"button",disabled:t,onClick:()=>void n(r),className:"flex items-center gap-1.5 px-2 py-1 text-[11px] rounded border border-error/40 text-error hover:bg-error/10 disabled:opacity-50",title:`Drop the catalog entry "${r}" — the directory it names is already gone`,children:[m(xr,{size:12}),"Forget this entry"]}),m("span",{className:"text-[11px] text-ink/45",children:"Removes the record from marketplace.json. No files are touched."})]}):null]})}function Brn(){let{panels:e,errors:t,plugins:n,catalog:r,disabledPanels:a,gitStatus:i,autoUpdate:o,syncBlocked:s,ready:l}=Md(),{slots:u,failures:d}=yv(),p=dq(),h=bp(),f=()=>void jje(),g=r.filter((k)=>!k.installed),b=new Map(d.map((k)=>[k.pluginId,k.reason])),y=new Map(e.map((k)=>[k.pluginId,k.iconUrl])),v=new Map(e.map((k)=>[k.pluginId,k.readmeUrl])),x=n.filter((k)=>k.gitOrigin).length;return m("div",{className:"space-y-4",children:[m("div",{className:"flex items-start justify-between gap-3",children:m("p",{className:"text-xs text-ink/60 max-w-xl",children:"Panels bundled with Kabmo, plus the ones you install from a git URL. A plugin is local code Kabmo loads into this page and renders in its own tree, so it looks and behaves like the rest of the app — treat it the way you would a VS Code extension."})}),m(Drn,{autoUpdate:o,busy:p.busy,gitCount:x,onSetAutoUpdate:p.setAutoUpdate,onCheckUpdates:p.checkUpdates,onRefresh:f}),p.error?m("div",{className:"flex items-start gap-1.5 px-3 py-2 rounded-lg border border-error/30 bg-error/5 text-[11px] text-error leading-snug",children:[m(pr,{size:13,className:"mt-0.5 flex-shrink-0"}),m("span",{className:"flex-1 break-words",children:p.error}),m("button",{type:"button",onClick:p.clearError,"aria-label":"Dismiss",className:"cursor-pointer",children:m(gn,{size:12})})]}):null,m(wrn,{busy:p.busy==="install",onInstall:p.install,onClearError:p.clearError}),!l?m("p",{className:"text-xs text-ink/50",children:"Reading…"}):null,m(Nrn,{disabled:a,busy:p.busy,onSetEnabled:p.setEnabled}),m(Mrn,{dock:h,plugins:n,slots:u}),l&&g.length===0&&n.length===0&&t.length===0?m("div",{className:"text-xs text-ink/60 space-y-1.5",children:[m("p",{children:"No panel plugins installed."}),m("p",{className:"font-mono text-[11px] text-ink/45 leading-relaxed",children:["~/.kabmo/marketplace/marketplace.json",m("br",{}),"~/.kabmo/marketplace/plugins/<plugin>/package.json"]})]}):null,m(Srn,{entries:g,busy:p.busy,onInstall:p.installBundled}),m(Orn,{blocked:s,busy:p.busy,onForceSync:p.forceSync}),n.length>0?m(Lrn,{plugins:n,slots:u,failures:b,iconUrls:y,readmeUrls:v,busy:p.busy,onBuild:p.build,onRemove:p.remove,onSetEnabled:p.setEnabled,gitStatus:i,onUpdateGit:p.updateGit}):null,t.map((k)=>m(hqr,{error:k,busy:p.busy!==null,onForget:p.forget},k.dir+k.reason))]})}var zrn=D(()=>{dt();K5();dRe();Trn();Rrn();Irn();Prn();Mk();$rn();Frn();de()});function jrn(){return m("div",{className:"flex-1 min-h-0 overflow-auto p-6 md:p-8",children:m("div",{className:"max-w-3xl",children:m(Brn,{})})})}var Urn=D(()=>{zrn();de()});function qrn({isOpen:e,onClose:t,onAddSource:n}){let[r,a]=ne(""),[i,o]=ne(""),[s,l]=ne(null);if(!e)return null;return m("div",{className:"fixed inset-0 z-50 bg-ink/40 backdrop-blur-[2px] flex items-center justify-center p-4",onClick:t,children:m("div",{className:"bg-paper border border-ink/20 rounded-xl max-w-md w-full p-6 shadow-2xl space-y-4 text-ink animate-in fade-in zoom-in-95 duration-150 max-h-full overflow-y-auto scrollbar-overlay-container",onClick:(d)=>d.stopPropagation(),children:[m("div",{className:"flex items-center justify-between pb-3 border-b border-ink/10",children:[m("div",{className:"flex items-center gap-2",children:[m(xc,{className:"w-4 h-4 text-ink/70"}),m("h2",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:"Add Custom Skill Source"})]}),m("button",{type:"button",onClick:t,className:"p-1 rounded-md text-ink/50 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:m(gn,{className:"w-4 h-4"})})]}),m("p",{className:"text-xs text-ink/70 leading-relaxed",children:"Connect any public or private Git repository containing skill definitions and prompt directives."}),m("form",{onSubmit:(d)=>{d.preventDefault();let p=r.trim().replace(/^https?:\/\/github\.com\//,"").replace(/\/$/,"");if(!p){l("Please provide a valid GitHub repository path (e.g. owner/repo).");return}let h=i.trim()||p.split("/")[1]||p,f={id:`custom-${Date.now()}`,name:h,repo:p,stars:"1.2K",updatedAt:"Just now",skillCount:3,isCustom:!0};n(f),a(""),o(""),l(null),t()},className:"space-y-4",children:[m("div",{children:[m("label",{className:"block text-xs font-semibold text-ink/80 mb-1.5",children:"Source Name"}),m("input",{type:"text",value:i,onChange:(d)=>o(d.currentTarget.value),placeholder:"e.g. Acme Internal Skills",className:"w-full px-3 py-2 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper focus:outline-none focus:border-ink text-xs text-ink transition-colors"})]}),m("div",{children:[m("label",{className:"block text-xs font-semibold text-ink/80 mb-1.5",children:["Git Repository ",m("span",{className:"text-error",children:"*"})]}),m("input",{type:"text",value:r,onChange:(d)=>{a(d.currentTarget.value),l(null)},placeholder:"e.g. owner/skills-repo or https://github.com/...",className:"w-full px-3 py-2 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper focus:outline-none focus:border-ink text-xs font-mono text-ink transition-colors"})]}),s&&m("div",{className:"flex items-center gap-2 text-xs text-error p-2.5 rounded-lg bg-error/10 border border-error/20",children:[m(Kn,{className:"w-4 h-4 flex-shrink-0"}),m("span",{className:"font-medium",children:s})]}),m("div",{className:"pt-3 border-t border-ink/10 flex items-center justify-end gap-2",children:[m("button",{type:"button",onClick:t,className:"px-3.5 py-2 rounded-lg border border-ink/20 hover:border-ink/40 text-xs font-medium text-ink/80 hover:text-ink transition-colors cursor-pointer",children:"Cancel"}),m("button",{type:"submit",className:"flex items-center gap-1.5 px-4 py-2 rounded-lg bg-ink text-paper text-xs font-medium hover:bg-ink/90 transition-colors shadow-xs cursor-pointer",children:[m(kr,{size:14}),m("span",{children:"Add Source"})]})]})]})]})})}var Wrn=D(()=>{Xe();dt();de()});function Grn(){let[e,t]=ne([]),[n,r]=ne([]),[a,i]=ne([]),o=Se(async()=>{let l=await(await fetch("/api/settings/skills")).json();if(l?.catalogSources)t(l.catalogSources);if(l?.catalogSkills)r(l.catalogSkills);if(l?.skills)i(l.skills)},[]);return Ae(()=>{o().catch(console.error)},[o]),{sources:e,catalogSkills:n,userSkills:a,setSources:t,setUserSkills:i,reload:o}}var Hrn=D(()=>{Xe()});function Vrn(){let{sources:e,catalogSkills:t,userSkills:n,setSources:r,setUserSkills:a,reload:i}=Grn(),[o,s]=ne("anthropic"),[l,u]=ne(""),[d,p]=ne(!1),[h,f]=ne(!1),[g,b]=ne(null),y=new Set(n.map((T)=>T?.name).filter(Boolean)),v=(T)=>{b(T),setTimeout(()=>b(null),2500)},x=()=>{p(!0),i().then(()=>v("Catalog index synchronized")).catch(console.error).finally(()=>p(!1))},k=(T)=>{let E=n.find((L)=>L.name===T.name);fetch("/api/settings/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"install_toggle",skill:T,install:!E})}).then((L)=>L.json()).then((L)=>{if(L?.error){v(`Failed: ${L.error}`);return}if(Array.isArray(L?.skills))a(L.skills);z2("command"),v(E?`Uninstalled skill "${T.name}"`:`Installed skill "${T.name}"`)}).catch((L)=>{console.error(L),v(`Failed to ${E?"uninstall":"install"} "${T.name}"`)})},C=(T)=>{let E=[...e,T];r(E),s(T.id),fetch("/api/settings/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({catalogSources:E})}).catch(console.error),v(`Added source "${T.name}"`)},_=t.filter((T)=>{let E=!l.trim()||T.name.toLowerCase().includes(l.toLowerCase())||T.description.toLowerCase().includes(l.toLowerCase())||T.repoTag.toLowerCase().includes(l.toLowerCase());if(l.trim())return E;return T.sourceId===o}),w=e.find((T)=>T.id===o)||e[0]||null;return m("div",{className:"flex-1 flex flex-col h-full w-full scrollbar-overlay-container bg-paper text-ink p-6 md:p-8 space-y-6",children:[m("div",{children:m("p",{className:"text-xs text-ink/70 leading-relaxed",children:"Install ready-made skills from curated repositories, or add your own source."})}),m("div",{className:"relative",children:[m(na,{size:15,className:"absolute left-3 top-2.5 text-ink/40 pointer-events-none"}),m("input",{type:"text",value:l,onChange:(T)=>u(T.currentTarget.value),placeholder:"Search skills across all sources...",className:"w-full pl-9 pr-4 py-2 rounded-lg border border-ink/20 hover:border-ink/40 bg-paper focus:outline-none focus:border-ink text-xs text-ink transition-colors"})]}),m("div",{className:"space-y-3",children:[m("h3",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:"Sources"}),m("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.map((T)=>{let E=o===T.id&&!l.trim();return m("div",{onClick:()=>{s(T.id),u("")},className:`p-3.5 rounded-xl border transition-all cursor-pointer select-none relative ${E?"border-ink bg-ink/5 shadow-xs":"border-ink/20 hover:border-ink/40 bg-paper"}`,children:[m("div",{className:"flex items-center justify-between",children:[m("div",{className:"flex items-center gap-2",children:[m("span",{className:"text-xs font-bold text-ink",children:T.name}),m("span",{className:"text-[10px] text-ink/50 font-mono",children:[T.skillCount," skills"]})]}),m(In,{size:13,className:`text-ink/40 hover:text-ink transition-colors ${d&&E?"animate-spin":""}`})]}),m("div",{className:"mt-1 font-mono text-[11px] text-ink/60 truncate",children:T.repo}),m("div",{className:"mt-2.5 flex items-center gap-3 text-[10px] text-ink/50",children:[m("span",{className:"flex items-center gap-1",children:[m(fv,{size:11,className:"text-ink/50"}),m("span",{children:T.stars})]}),m("span",{children:T.updatedAt})]})]},T.id)}),m("div",{onClick:()=>f(!0),className:"p-3.5 rounded-xl border border-dashed border-ink/25 hover:border-ink/50 bg-paper hover:bg-ink/[0.02] transition-all cursor-pointer flex items-center gap-3 select-none",children:[m("div",{className:"w-8 h-8 rounded-lg border border-ink/20 flex items-center justify-center text-ink/60 flex-shrink-0",children:m(kr,{size:16})}),m("div",{children:[m("div",{className:"text-xs font-bold text-ink",children:"Add your own source"}),m("div",{className:"text-[11px] text-ink/60",children:"Any Git repository with skills"})]})]})]})]}),m("div",{className:"border-t border-ink/10 pt-4",children:[m("div",{className:"flex items-center justify-between pb-3",children:[m("div",{className:"flex items-center gap-2",children:[m("span",{className:"text-xs font-bold uppercase tracking-wider text-ink",children:l.trim()?"Search Results":w?.name?w.name.toUpperCase():"SKILL CATALOG"}),m("span",{className:"text-xs text-ink/50",children:[_.length," skill(s) found"]})]}),m("button",{type:"button",onClick:x,title:"Refresh skills",className:"p-1 rounded-md text-ink/50 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",children:m(In,{size:14,className:d?"animate-spin":""})})]}),m("div",{className:"space-y-3",children:_.length===0?m("div",{className:"text-center py-10 border border-dashed border-ink/15 rounded-xl",children:m("p",{className:"text-xs text-ink/60",children:"No skills found matching your query."})}):_.map((T)=>{let E=y.has(T.name);return m("div",{className:"p-4 rounded-xl border border-ink/15 hover:border-ink/30 bg-paper transition-all flex flex-col sm:flex-row sm:items-start justify-between gap-3",children:[m("div",{className:"space-y-1.5 flex-1 min-w-0",children:[m("div",{className:"flex items-center gap-2",children:m("span",{className:"text-xs font-bold text-ink tracking-tight font-mono",children:T.name})}),m("p",{className:"text-xs text-ink/75 leading-relaxed line-clamp-2",children:T.description}),m("div",{className:"flex items-center gap-1.5 text-[11px] text-ink/50 font-mono pt-1",children:[m(xc,{size:12,className:"flex-shrink-0"}),m("span",{className:"truncate",children:T.repoTag})]})]}),m("div",{className:"flex items-center gap-2 flex-shrink-0 self-end sm:self-center",children:[T.githubUrl&&m("a",{href:T.githubUrl,target:"_blank",rel:"noreferrer",className:"p-1.5 rounded-lg text-ink/50 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer",title:"View repository",children:m(po,{size:14})}),m("button",{type:"button",onClick:()=>k(T),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-all flex items-center gap-1.5 cursor-pointer ${E?"border border-ink/20 text-ink/80 hover:border-error hover:text-error hover:bg-error/5":"bg-ink text-paper hover:bg-ink/90 shadow-xs"}`,children:E?m(bt,{children:[m(Vt,{size:12}),m("span",{children:"Installed"})]}):m(bt,{children:[m(ki,{size:12}),m("span",{children:"install"})]})})]})]},T.id)})})]}),m(qrn,{isOpen:h,onClose:()=>f(!1),onAddSource:C}),g&&m("div",{className:"fixed bottom-6 right-6 z-50 bg-ink text-paper text-xs font-medium px-4 py-2.5 rounded-lg shadow-lg animate-in fade-in slide-in-from-bottom-2 duration-150 flex items-center gap-2",children:[m(Vt,{size:14}),m("span",{children:g})]})]})}var Zrn=D(()=>{Xe();dt();Wrn();DT();Hrn();de()});function Krn({category:e}){return m("div",{className:"space-y-6 text-ink flex flex-col items-center justify-center py-16",children:[m("div",{className:"text-sm font-semibold capitalize",children:[e.replace("-"," ")," Settings"]}),m("div",{className:"text-xs text-ink/60 text-center max-w-sm mt-2",children:"This settings category is currently under construction and will be available soon."})]})}var Yrn=D(()=>{de()});var Jrn;var Xrn=D(()=>{Jrn={source:"@oh-my-pi/pi-coding-agent 10 tabs / 559 settings",tabs:[{id:"appearance",label:"Appearance",groups:["Theme","Composer","Status Line","Images","Display"]},{id:"model",label:"Model",groups:["Prompt","Prewalk","Vision","Thinking","Sampling","Retry & Fallback","Advisor"]},{id:"interaction",label:"Interaction",groups:["Startup & Updates","Git","Input","Magic Keywords","Notifications","Power","Agent","Approvals","Skills","Speech","Collab","Stream"]},{id:"context",label:"Context",groups:["General","Compaction","Experimental","Rules (TTSR)"]},{id:"memory",label:"Memory",groups:["General","Sharpshooter","Auto-Learn","Mnemopi","Hindsight"]},{id:"files",label:"Files",groups:["Editing","Reading","Read Summaries","LSP"]},{id:"shell",label:"Shell",groups:["Bash","Eval & Runtimes"]},{id:"tools",label:"Tools",groups:["Output Limits","Available Tools","Todos","Grep & Browser","Computer","Execution","GitHub","Discovery & MCP","Developer","Extensions","IDA Pro"]},{id:"tasks",label:"Tasks",groups:["Isolation","Subagents","Modes","Commands & Skills"]},{id:"providers",label:"Providers",groups:["Services","Fireworks","Tiny Model","Protocol","Timeouts","Privacy"]}],entries:{modelRoleStorage:{type:"enum",default:"global",values:["global","project"],ui:{tab:"model",group:"Prompt",label:"Model Role Storage",description:"Where model selector role assignments are saved",options:[{value:"global",label:"Global",description:"Save role models in the active profile config (current behavior)"},{value:"project",label:"Per-project",description:"Save project role models in .omp/config.yml; missing project roles use global defaults"}]}},autoResume:{type:"boolean",default:!1,ui:{tab:"interaction",group:"Startup & Updates",label:"Auto Resume",description:"Automatically resume the most recent session in the current directory"}},"git.enabled":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Git",label:"Enable Git Integration",description:"Show git branch, status, and PR information in the TUI and watch repository metadata."}},"theme.dark":{type:"string",default:"titanium",ui:{tab:"appearance",group:"Theme",label:"Dark Theme",description:"Theme used when the terminal has a dark background",options:"runtime"}},"theme.light":{type:"string",default:"light",ui:{tab:"appearance",group:"Theme",label:"Light Theme",description:"Theme used when the terminal has a light background",options:"runtime"}},symbolPreset:{type:"enum",default:"unicode",values:["unicode","nerd","ascii"],ui:{tab:"appearance",group:"Theme",label:"Symbol Preset",description:"Glyph set for icons and symbols (Unicode, Nerd Font, or ASCII)",options:[{value:"unicode",label:"Unicode",description:"Standard symbols (default)"},{value:"nerd",label:"Nerd Font",description:"Requires a Nerd Font, or a Glyph Protocol terminal (icons ship in-band)"},{value:"ascii",label:"ASCII",description:"Maximum compatibility"}]}},colorBlindMode:{type:"boolean",default:!1,ui:{tab:"appearance",group:"Theme",label:"Color-Blind Mode",description:"Use blue instead of green for diff additions"}},"composer.shape":{type:"string",default:"band",ui:{tab:"appearance",group:"Composer",label:"Composer Shape",description:"Visual layout of the input editor and status line",options:"runtime"}},"composer.tokenRate":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Composer",label:"Generation Rate",description:"Show a live generation tok/s readout: on the working row next to the session title, or in the native composer bar right after the thinking level, where the last reading stays between turns. Estimated from streamed deltas and corrected by the provider's billed output count as each message completes."}},"statusLine.preset":{type:"enum",default:"default",values:["default","minimal","compact","full","nerd","ascii","custom"],ui:{tab:"appearance",group:"Status Line",label:"Status Line Preset",description:"Pre-built status line configurations",options:[{value:"default",label:"Default",description:"Model, path, git, context, tokens, cost"},{value:"minimal",label:"Minimal",description:"Path and git only"},{value:"compact",label:"Compact",description:"Model, git, cost, context"},{value:"full",label:"Full",description:"All segments including time"},{value:"nerd",label:"Nerd",description:"Maximum info with Nerd Font icons"},{value:"ascii",label:"ASCII",description:"No special characters"},{value:"custom",label:"Custom",description:"User-defined segments"}]}},"statusLine.separator":{type:"enum",default:"powerline-thin",values:["powerline","powerline-thin","slash","pipe","block","none","ascii"],ui:{tab:"appearance",group:"Status Line",label:"Status Line Separator",description:"Style of separators between segments",options:[{value:"powerline",label:"Powerline",description:"Solid arrows (Nerd Font)"},{value:"powerline-thin",label:"Thin chevron",description:"Thin arrows (Nerd Font)"},{value:"slash",label:"Slash",description:"Forward slashes"},{value:"pipe",label:"Pipe",description:"Vertical pipes"},{value:"block",label:"Block",description:"Solid blocks"},{value:"none",label:"None",description:"Space only"},{value:"ascii",label:"ASCII",description:"Greater-than signs"}]}},"statusLine.contextLine":{type:"enum",default:"embedded",values:["off","percentage","annotated","embedded"],ui:{tab:"appearance",group:"Status Line",label:"Context-Reactive Line",description:"How the line between the left and right segments reflects context usage (box composer only)",options:[{value:"off",label:"Off",description:"Solid accent line, no context feedback"},{value:"percentage",label:"Percentage",description:"Used portion in accent color, remainder dimmed"},{value:"annotated",label:"Annotated",description:"Percentage plus ticks at the speculative and auto-compaction boundaries"},{value:"embedded",label:"Embedded",description:"Annotated line with the context percentage and window embedded in the gauge"}]}},"statusLine.sessionAccent":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Status Line",label:"Session Accent",description:"Use the session name color for the editor border and status line gap"}},"statusLine.transparent":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Status Line",label:"Transparent Status Line",description:"Use the terminal's default background for the status line instead of the theme's `statusLineBg`. Powerline end caps are dropped because they need a contrasting fill to bridge into the surrounding terminal."}},"statusLine.compactThinkingLevel":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Status Line",label:"Compact Thinking Level",description:"Show the thinking level as a single icon on the model name instead of a separate ` · <level>` suffix; in Tern's composer, as the model chip's icon instead of a separate chip (click the icon to cycle it)."}},"statusLine.showHookStatus":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Status Line",label:"Show Hook Status",description:"Display hook status messages below the status line"}},"terminal.showImages":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Images",label:"Show Inline Images",description:"Render images inline in the terminal",condition:"hasImageProtocol"}},"images.autoResize":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Images",label:"Auto-Resize Images",description:"Resize large images to 2000x2000 max for better model compatibility"}},"images.blockImages":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Images",label:"Block Images",description:"Prevent images from being sent to LLM providers"}},"tui.resizeScrollback":{type:"enum",default:"rebuild",values:["append","rebuild","preserve"],ui:{tab:"appearance",group:"Display",label:"Resize Scrollback",description:"How a settled terminal resize refreshes transcript rows retained in terminal scrollback",options:[{value:"append",label:"Append",description:"Replay the transcript at the new width below retained history"},{value:"rebuild",label:"Rebuild",description:"Erase all terminal scrollback, then replay one current-width transcript"},{value:"preserve",label:"Preserve",description:"Repaint only the viewport and keep history wrapped at its old width"}]}},"tui.completeScrollback":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Complete Scrollback",description:"Send transcript rows pushed off screen by a growing HUD or dialog straight to scrollback; when it shrinks, blank rows sit between the transcript and the input until new output fills them"}},"terminal.showProgress":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Native Terminal Progress",description:"Emit OSC 9;4 indeterminate progress while the agent or context maintenance is running (always on in Tern)"}},"terminal.programStatus":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Program Status (OSC 7501)",description:"Report whether the agent is working, waiting on you, done, or failed over OSC 7501, for terminal tab indicators and agent inboxes"}},"tui.textSizing":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Large Headings (Kitty)",description:"Render Markdown H1 headings at 2x scale using Kitty's OSC 66 text-sizing protocol. Only takes effect on Kitty terminals; ignored everywhere else. Off by default."}},"tui.renderMermaid":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Render Mermaid Diagrams",description:"Render Mermaid fenced code blocks as ASCII diagrams"}},"tui.renderSvg":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Render SVG Figures",description:"Invite the agent to draw diagrams and charts as SVG, rendered inline as images on terminals that show graphics"}},"tui.autoGraph":{type:"enum",default:"always",values:["smart","always","off"],ui:{tab:"appearance",group:"Display",label:"Auto-Graph Tables",description:"Draw a chart under numeric tables in the agent's answers, in your theme's colors, on terminals that show graphics",options:[{value:"smart",label:"Smart",description:"The judge model refines each chart: kind, columns, row names and grouping, scales, which way is better, and its title"},{value:"always",label:"Always",description:"Chart every table that reads as numeric, using the built-in best guess"},{value:"off",label:"Off",description:"Leave tables as tables"}]}},"tui.reactions":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Agent Reactions",description:"Invite the agent to react to your message with an emoji badge on its bubble"}},"tui.codexResetFireworks":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Codex Reset Fireworks",description:"Celebrate unscheduled Codex weekly usage resets and newly banked saved resets with a top-third fireworks overlay that remains until Esc"}},"tui.titleState":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Terminal Title Run State",description:"Show the agent run state in the terminal title's separator — an animated spinner while working (a static ':' under WSL), '>' when it's your turn, '!' when the agent is waiting on you"}},"tui.titleSpinner":{type:"enum",default:"braille",values:["braille","pulse","dots","line"],ui:{tab:"appearance",group:"Display",label:"Terminal Title Spinner",description:"Glyph set for the working-state spinner in the terminal title — braille sweep, filling moon, single-dot cycle, or ASCII-safe line",options:[{value:"braille",label:"Braille",description:"Classic ⠋⠙⠹ sweep (default)"},{value:"pulse",label:"Pulse",description:"Moon filling ○◑● then emptying"},{value:"dots",label:"Dots",description:"Single braille dots cycling"},{value:"line",label:"Line",description:"ASCII - \\ | / for fonts without braille coverage"}]}},"tui.hyperlinks":{type:"enum",default:"auto",values:["off","auto","always"],ui:{tab:"appearance",group:"Display",label:"Terminal Hyperlinks",description:"Wrap paths and URLs in OSC 8 hyperlinks for terminal-native click-to-open (auto: detect support; off: never; always: unconditional)"}},"tui.mouse":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Mouse Click-to-Focus",description:"Capture mouse clicks in the main session so live subagent cards and HUD rows focus on click, with a hover highlight on the target. Native text selection becomes Shift+drag and wheel scroll becomes Shift+wheel while on"}},"tui.tight":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Tight Layout",description:"Remove the 1-character horizontal padding from the left and right of the terminal output"}},"display.shimmer":{type:"enum",default:"classic",values:["classic","kitt","disabled"],ui:{tab:"appearance",group:"Display",label:"Shimmer",description:"Animation style for working/loading messages",options:[{value:"classic",label:"Classic",description:"Soft cosine wave sweeping across the text"},{value:"kitt",label:"KITT Scanner",description:"Knight Rider 1982 red light bouncing left-right"},{value:"disabled",label:"Disabled",description:"No animation; static muted text"}]}},"display.pinnedAgents":{type:"enum",default:"collapsed",values:["off","collapsed","full"],ui:{tab:"appearance",group:"Display",label:"Pinned Agents",description:"Pinned live-agent jump list above the editor (off hides it; collapsed shows a few rows with an expander; full lists all)",options:[{value:"off",label:"Off",description:"Hide the pinned jump list"},{value:"collapsed",label:"Collapsed",description:"Show a few rows with an expander"},{value:"full",label:"Full",description:"Always list every live agent"}]}},"display.subagentLivePreview":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Subagent Live Preview",description:"Show each pinned subagent's current (or most recent) tool call beneath its row"}},"display.smoothStreaming":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Smooth Streaming",description:"Reveal assistant text and streamed tool input smoothly while chunks arrive"}},"display.hideToolActivity":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Hide Tool Activity",description:"Hide model-initiated tool calls and results from the transcript"}},"display.showTokenUsage":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Show Token Usage",description:"Show per-turn token usage on assistant messages"}},"display.showTurnTime":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Show Turn Time",description:"Show the total prompt-to-yield time (including tool calls) on assistant message usage rows"}},"display.cacheMissMarker":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Cache Miss Marker",description:"Show a divider after an assistant turn whose request lost (missed) the prompt cache"}},"display.collapseCompacted":{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Collapse Compacted History",description:"Collapse pre-compaction history behind the summary divider on the live transcript; disable to keep the full transcript inline with dividers at each compaction point"}},showHardwareCursor:{type:"boolean",default:!0,ui:{tab:"appearance",group:"Display",label:"Show Hardware Cursor",description:"Show terminal cursor for IME support"}},"tui.imeSafeCursor":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"IME-Safe Prompt Layout",description:"Move the prompt's bottom border to a separate row so macOS IME preedit cannot displace it"}},steeringMode:{type:"enum",default:"one-at-a-time",values:["all","one-at-a-time"],ui:{tab:"interaction",group:"Input",label:"Steering Mode",description:"How to process queued messages while agent is working"}},followUpMode:{type:"enum",default:"one-at-a-time",values:["all","one-at-a-time"],ui:{tab:"interaction",group:"Input",label:"Follow-Up Mode",description:"How to drain follow-up messages after a turn completes"}},interruptMode:{type:"enum",default:"immediate",values:["immediate","wait"],ui:{tab:"interaction",group:"Input",label:"Interrupt Mode",description:"When steering messages interrupt tool execution"}},"tui.vimMode":{type:"boolean",default:!1,ui:{tab:"interaction",group:"Input",label:"Vim Editing Mode",description:"Modal prompt editing. Esc leaves Insert mode; Normal mode has hjkl, 0, $, ^, w, b, e, gg, G, counts, x/D/C, dd/yy, p and u; operators take motions or text objects (diw, ca(, dap); v/V start a Visual selection that y copies and d deletes"}},"tui.vimModeDisplay":{type:"enum",default:"text",values:["text","icon","none"],ui:{tab:"interaction",group:"Input",label:"Vim Mode Indicator",description:"How the current Vim mode appears in the status line",condition:"vimModeEnabled",options:[{value:"text",label:"Text",description:"Full mode name — NORMAL, INSERT, VISUAL, V-LINE, REPLACE"},{value:"icon",label:"Icon",description:"Single compact glyph per mode"},{value:"none",label:"Hidden",description:"Do not show the mode in the status line"}]}},"loop.mode":{type:"enum",default:"prompt",values:["prompt","compact","reset"],ui:{tab:"interaction",group:"Input",label:"Loop Mode",description:"What happens between /loop iterations before re-submitting the prompt",options:[{value:"prompt",label:"Prompt",description:"Re-submit the prompt as a follow-up message (current behavior)"},{value:"compact",label:"Compact",description:"Compact the session context, then re-submit the prompt"},{value:"reset",label:"Reset",description:"Start a new session, then re-submit the prompt"}]}},"loop.conditionTimeoutMs":{type:"number",default:30000,ui:{tab:"interaction",group:"Input",label:"Loop Condition Timeout (ms)",description:"Max wait for a `/loop --while` / `--until` condition command before treating it as broken and stopping the loop. Set to 0 to wait indefinitely",options:[{value:"0",label:"Unlimited"},{value:"10000",label:"10 seconds"},{value:"30000",label:"30 seconds"},{value:"120000",label:"2 minutes"}]}},"composer.recallClearedDrafts":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Input",label:"Recall Cleared Drafts",description:"Keep drafts cleared with Ctrl+C in local Up/Down history until exit; disabling affects future clears"}},doubleEscapeAction:{type:"enum",default:"rewind",values:["rewind","tree","none"],ui:{tab:"interaction",group:"Input",label:"Double-Escape Action",description:"What pressing Esc twice with an empty editor does: open the transcript rewind selector, open the session tree, or nothing"}},"input.bareExitOnEmptySession":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Input",label:"Bare Exit on Empty Session",description:"Submitting exactly `exit`, `quit`, or `q` (any case) before the first message quits instead of prompting the model"}},"input.bareSlashCommands":{type:"boolean",default:!1,ui:{tab:"interaction",group:"Input",label:"Bare Slash Commands",description:"Submitting exactly a command name without the leading `/` (e.g. `model`, `compact`) runs that slash command; once the session has messages, press Enter twice to confirm"}},treeFilterMode:{type:"enum",default:"default",values:["default","no-tools","user-only","labeled-only","all"],ui:{tab:"interaction",group:"Input",label:"Session Tree Filter",description:"Default filter mode when opening the session tree"}},autocompleteMaxVisible:{type:"number",default:10,ui:{tab:"interaction",group:"Input",label:"Autocomplete Items",description:"Max visible items in autocomplete dropdown (3-20)",options:[{value:"3",label:"3 items"},{value:"5",label:"5 items"},{value:"7",label:"7 items"},{value:"10",label:"10 items"},{value:"15",label:"15 items"},{value:"20",label:"20 items"}]}},"spelling.typoDetection":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Input",label:"Typo Detection (macOS)",description:"Mark misspelled prompt words with the active macOS dictionaries",condition:"macOS"}},"spelling.autocomplete":{type:"enum",default:"auto",values:["off","auto","ngram","smollm","apple"],ui:{tab:"interaction",group:"Input",label:"Word Autocomplete",description:"Show predicted word completions as inline hints: Tab accepts with a space, Right without",options:[{value:"off",label:"Off",description:"No word completion"},{value:"auto",label:"Auto",description:"N-gram (nothing to download)"},{value:"ngram",label:"N-gram",description:"Learns your vocabulary from prompt history"},{value:"smollm",label:"SmolLM",description:"Small on-device language model blended with N-gram (downloads weights on first use)"},{value:"apple",label:"Apple",description:"macOS dictionary completions"}]}},"composer.predictions":{type:"boolean",default:!1,ui:{tab:"interaction",group:"Input",label:"Composer Predictions",description:"After a completed turn, ask the active model to predict your next message and show it as ghost text in the empty composer; Tab or Right inserts it without sending. Extra usage: every completed turn sends one more billed request over the whole conversation (counted in /stats)"}},"spelling.autocorrect":{type:"boolean",default:!1,ui:{tab:"interaction",group:"Input",label:"Autocorrect (macOS)",description:"Apply confident macOS spelling corrections after completed words",condition:"macOS"}},emojiAutocomplete:{type:"boolean",default:!0,ui:{tab:"interaction",group:"Input",label:"Emoji Autocomplete",description:"Suggest emojis from `:name:` shortcodes and expand text emoticons like `:D` or `:-)`"}},"paste.largeMenuThreshold":{type:"number",default:100,ui:{tab:"interaction",group:"Input",label:"Large Paste Menu",description:"When a paste reaches this many lines, offer a menu to wrap it in a code block, wrap it in XML tags, or save it to a file. 0 disables the menu (large pastes still collapse to a [Paste] marker).",options:[{value:"0",label:"Off"},{value:"100",label:"100 lines"},{value:"250",label:"250 lines"},{value:"500",label:"500 lines"},{value:"1000",label:"1000 lines"}]}},"startup.quiet":{type:"boolean",default:!1,ui:{tab:"interaction",group:"Startup & Updates",label:"Quiet Startup",description:"Skip welcome screen and startup status messages"}},"startup.showSplash":{type:"boolean",default:!1,ui:{tab:"interaction",group:"Startup & Updates",label:"Show Startup Splash",description:"Show the full animated setup splash on normal interactive startup without rerunning setup. Quiet Startup still suppresses it."}},"startup.setupWizard":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Startup & Updates",label:"Setup Wizard",description:"Show newly added onboarding steps once per setup version"}},"startup.checkUpdate":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Startup & Updates",label:"Check for Updates",description:"Check for omp updates on startup"}},"update.channel":{type:"enum",default:"stable",values:["stable","canary"],ui:{tab:"interaction",group:"Startup & Updates",label:"Update Channel",description:"Update channel used by omp update and the startup update check",options:[{value:"stable",label:"Stable"},{value:"canary",label:"Canary"}]}},"marketplace.autoUpdate":{type:"enum",default:"notify",values:["off","notify","auto"],ui:{tab:"interaction",group:"Startup & Updates",label:"Marketplace Auto-Update",description:"Check for plugin updates on startup",options:[{value:"off",label:"Off",description:"Don't check for plugin updates"},{value:"notify",label:"Notify",description:"Check on startup and notify when updates are available"},{value:"auto",label:"Auto",description:"Check on startup and auto-install updates"}]}},"startup.changelogMode":{type:"enum",default:"summary",values:["summary","expanded","hidden"],ui:{tab:"interaction",group:"Startup & Updates",label:"Startup Changelog",description:"Choose whether update notes start as a summary, full details, or stay hidden",options:[{value:"summary",label:"Summary",description:"Show release and change counts with a /changelog hint"},{value:"expanded",label:"Expanded",description:"Show the recent release notes in full"},{value:"hidden",label:"Hidden",description:"Do not show release notes on startup"}]}},"magicKeywords.enabled":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Magic Keywords",label:"Magic Keywords",description:"Enable hidden notices for standalone ultrathink, orchestrate, workflowz, jevify keywords"}},"magicKeywords.ultrathink":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Magic Keywords",label:"Ultrathink Keyword",description:"Let standalone ultrathink request maximum automatic thinking and append its hidden notice"}},"magicKeywords.orchestrate":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Magic Keywords",label:"Orchestrate Keyword",description:"Let standalone orchestrate append its hidden multi-agent orchestration notice"}},"magicKeywords.workflow":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Magic Keywords",label:"Workflow Keyword",description:"Let standalone workflowz append its hidden eval workflow notice"}},"magicKeywords.jevify":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Magic Keywords",label:"Jevify Keyword",description:"Let standalone jevify append its hidden bulk-judge classification notice"}},"completion.notify":{type:"enum",default:"on",values:["on","off"],ui:{tab:"interaction",group:"Notifications",label:"Completion Notification",description:"Notify when the agent finishes a turn"}},"error.notify":{type:"enum",default:"off",values:["on","off"],ui:{tab:"interaction",group:"Notifications",label:"Error Notification",description:"Notify when the agent stops with an error"}},"ask.timeout":{type:"number",default:0,ui:{tab:"interaction",group:"Notifications",label:"Ask Timeout",description:"Auto-select the recommended ask option after this many seconds (0 disables). Also bounds cfg:// approval prompts; an unanswered approval denies the write instead of auto-selecting",options:[{value:"0",label:"Disabled"},{value:"15",label:"15 seconds"},{value:"30",label:"30 seconds"},{value:"60",label:"60 seconds"},{value:"120",label:"120 seconds"}]}},"ask.notify":{type:"enum",default:"on",values:["on","off"],ui:{tab:"interaction",group:"Notifications",label:"Ask Notification",description:"Notify when the ask tool is waiting for input"}},"recap.enabled":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Notifications",label:"Idle Recap",description:"Generate a brief LLM recap of where things stand after the terminal has been idle"}},"recap.idleSeconds":{type:"number",default:240,ui:{tab:"interaction",group:"Notifications",label:"Idle Recap Delay",description:"Seconds to wait while idle before showing the recap",options:[{value:"60",label:"1 minute"},{value:"120",label:"2 minutes"},{value:"240",label:"4 minutes"},{value:"300",label:"5 minutes"},{value:"600",label:"10 minutes"}]}},"power.sleepPrevention":{type:"enum",default:"idle",values:["off","idle","display","system"],ui:{tab:"interaction",group:"Power",label:"Sleep Prevention",description:"Prevent the system sleeping during active sessions. Each level is cumulative — it adds the flags of all lower levels.",options:[{value:"off",label:"Off",description:"Do not prevent any sleep"},{value:"idle",label:"Prevent Idle Sleep",description:"Keep the system awake while a session is open (macOS `caffeinate -i`)"},{value:"display",label:"Prevent Display Sleep",description:"Also keep the display from idle-sleeping (macOS `caffeinate -i -d`)"},{value:"system",label:"Prevent System Sleep",description:"Also block all system sleep on AC and declare the user active (macOS `caffeinate -i -d -s -u`)"}]}},"prewalk.enabled":{type:"boolean",default:!1,ui:{tab:"model",group:"Prewalk",label:"Enable Prewalk",description:"Start on the active model, then switch to a fast/cheap model (default the 'smol' role) at the first edit/write after the plan nudge's todo list exists — the strong model plans, commits the todos, and starts the implementation before handing off. Overridable per session with --prewalk / --no-prewalk."}},"prewalk.auto":{type:"enum",default:"off",values:["off","suggest","on"],ui:{tab:"model",group:"Prewalk",label:"Auto Prewalk",description:"Ask the native judge resolved through the 'judge' role whether each new top-level user task front-loads its hard reasoning. Needs a native judge; without one nothing is classified. Independent of Enable Prewalk.",options:[{value:"off",label:"Off",description:"Never classify prompts for prewalk"},{value:"suggest",label:"Suggest",description:"Classify each task and report the decision without arming prewalk"},{value:"on",label:"On",description:"For confidently front-loaded tasks, arm a handoff from the active model to the auto target; the next task starts back on the planning model"}]}},"prewalk.autoTarget":{type:"string",default:"@smol",ui:{tab:"model",group:"Prewalk",label:"Auto-prewalk target",description:"Model or role (default '@smol') auto-prewalk hands off to at the first edit/write."}},"providers.maxInFlightRequests":{type:"record",default:{},ui:{tab:"providers",group:"Services",label:"Max In-Flight Requests",description:'Maximum concurrent LLM requests per provider id (for example "openai" or "anthropic"), shared across local OMP processes with this config root. Omitted providers are unlimited.'}},"images.describeForTextModels":{type:"boolean",default:!0,ui:{tab:"model",group:"Vision",label:"Describe Images for Text Models",description:"When an image is attached to a model without vision support, save it under local:// and inject a description from a vision-capable model instead of dropping it"}},defaultThinkingLevel:{type:"enum",default:"high",values:["minimal","low","medium","high","xhigh","max","auto"],ui:{tab:"model",group:"Thinking",label:"Thinking Level",description:"Reasoning depth for thinking-capable models",options:[{value:"auto",label:"auto",description:"Auto-detect per prompt"},{value:"minimal",label:"min",description:"Very brief reasoning (~1k tokens)"},{value:"low",label:"low",description:"Light reasoning (~2k tokens)"},{value:"medium",label:"medium",description:"Moderate reasoning (~8k tokens)"},{value:"high",label:"high",description:"Deep reasoning (~16k tokens)"},{value:"xhigh",label:"xhigh",description:"Extended reasoning (~32k tokens)"},{value:"max",label:"max",description:"Maximum reasoning the model supports"}]}},hideThinkingBlock:{type:"boolean",default:!1,ui:{tab:"model",group:"Thinking",label:"Hide Thinking Blocks",description:"Hide thinking blocks in assistant responses"}},expandThinkingBlocks:{type:"boolean",default:!1,ui:{tab:"model",group:"Thinking",label:"Expand Thinking Blocks",description:"Keep finished thinking blocks expanded instead of collapsing them when the turn ends",condition:"nativeRendering"}},proseOnlyThinking:{type:"boolean",default:!0,ui:{tab:"model",group:"Thinking",label:"Prose Only Thinking",description:"Omit code blocks from thinking summaries and replace them with an ellipsis"}},omitThinking:{type:"boolean",default:!1,ui:{tab:"model",group:"Thinking",label:"Omit Thinking summaries",description:"Instruct upstream providers to completely omit thinking summaries from responses (where supported)"}},externalThinking:{type:"boolean",default:!1,ui:{tab:"model",group:"Thinking",label:"External Thinking",description:"Private scratchpad; not shown to user. Disables supported GPT, Claude, and Gemini reasoning",warning:"At your own risk: providers have flagged this request shape as abuse, up to account-level enforcement"}},"model.loopGuard.enabled":{type:"boolean",default:!0,ui:{tab:"model",group:"Thinking",label:"Loop Guard",description:"Enable automatic stream loop detection for model reasoning and prose"}},"model.loopGuard.checkAssistantContent":{type:"boolean",default:!0,ui:{tab:"model",group:"Thinking",label:"Loop Guard Scan Prose",description:"Apply loop guard to assistant prose messages in addition to thinking logs"}},"model.loopGuard.toolCallReminder":{type:"boolean",default:!0,ui:{tab:"model",group:"Thinking",label:"Loop Guard Tool-Call Reminder",description:"When a Gemini reasoning stream emits many consecutive planning headers without calling a tool, interrupt it and inject a reminder to issue a tool call (requires Loop Guard)"}},"model.toolCallLoopGuard.enabled":{type:"boolean",default:!0,ui:{tab:"model",group:"Thinking",label:"Tool-Call Loop Guard",description:"Detect consecutive identical tool calls across turns and inject a corrective steer"}},"model.toolCallLoopGuard.threshold":{type:"number",default:5,ui:{tab:"model",group:"Thinking",label:"Tool-Call Loop Threshold",description:"Consecutive identical tool calls required before the corrective steer is injected"}},"model.toolCallLoopGuard.exemptTools":{type:"array",default:["wait"],ui:{tab:"model",group:"Thinking",label:"Tool-Call Loop Exempt Tools",description:"Tool names that may repeat consecutively without triggering the cross-turn loop guard"}},inlineToolDescriptors:{type:"enum",default:"auto",values:["auto","on","off"],ui:{tab:"model",group:"Prompt",label:"Inline Tool Descriptors",description:"Render full tool descriptors in the system prompt and strip top-level/nested descriptions from provider tool schemas so descriptor text is sent once. Auto enables this for Gemini models and disables it otherwise",options:[{value:"auto",label:"Auto",description:"Inline descriptors for Gemini models; keep them in tool schemas otherwise"},{value:"on",label:"On",description:"Always inline descriptors in the system prompt"},{value:"off",label:"Off",description:"Keep descriptors in provider tool schemas only"}]}},includeModelInPrompt:{type:"boolean",default:!0,ui:{tab:"model",group:"Prompt",label:"Include Model in Prompt",description:"Surface the active model identifier in the system prompt so the agent knows which model it is"}},includeWorkspaceTree:{type:"boolean",default:!1,ui:{tab:"model",group:"Prompt",label:"Include Workspace Tree",description:"Render the workspace directory tree in the system prompt. WARNING: This can bust prompt caching across sessions when files are modified."}},skillful:{type:"boolean",default:!0,ui:{tab:"model",group:"Prompt",label:"List Skills in Prompt",description:"List available skills in the system prompt; disable to save context and toggle per-session with /skillful"}},personality:{type:"enum",default:"default",values:["default","friendly","pragmatic","none"],ui:{tab:"model",group:"Prompt",label:"Personality",description:"Communication style rendered into the system prompt's personality block",options:[{value:"default",label:"Default",description:"Terse, evidence-first engineer; dense, action-oriented replies"},{value:"friendly",label:"Friendly",description:"Warm, encouraging collaborator focused on momentum and morale"},{value:"pragmatic",label:"Pragmatic",description:"Direct, efficient engineer focused on clarity and rigor"},{value:"none",label:"None",description:"Omit the personality block entirely"}]}},temperature:{type:"number",default:-1,ui:{tab:"model",group:"Sampling",label:"Temperature",description:"Sampling temperature (0 = deterministic, 1 = creative, -1 = provider default)",options:[{value:"-1",label:"Default",description:"Use provider default"},{value:"0",label:"0",description:"Deterministic"},{value:"0.2",label:"0.2",description:"Focused"},{value:"0.5",label:"0.5",description:"Balanced"},{value:"0.7",label:"0.7",description:"Creative"},{value:"1",label:"1",description:"Maximum variety"}]}},topP:{type:"number",default:-1,ui:{tab:"model",group:"Sampling",label:"Top P",description:"Nucleus sampling cutoff (0-1, -1 = provider default)",options:[{value:"-1",label:"Default",description:"Use provider default"},{value:"0.1",label:"0.1",description:"Very focused"},{value:"0.3",label:"0.3",description:"Focused"},{value:"0.5",label:"0.5",description:"Balanced"},{value:"0.9",label:"0.9",description:"Broad"},{value:"1",label:"1",description:"No nucleus filtering"}]}},topK:{type:"number",default:-1,ui:{tab:"model",group:"Sampling",label:"Top K",description:"Sample from top-K tokens (-1 = provider default)",options:[{value:"-1",label:"Default",description:"Use provider default"},{value:"1",label:"1",description:"Greedy top token"},{value:"20",label:"20",description:"Focused"},{value:"40",label:"40",description:"Balanced"},{value:"100",label:"100",description:"Broad"}]}},minP:{type:"number",default:-1,ui:{tab:"model",group:"Sampling",label:"Min P",description:"Minimum probability threshold (0-1, -1 = provider default)",options:[{value:"-1",label:"Default",description:"Use provider default"},{value:"0.01",label:"0.01",description:"Very permissive"},{value:"0.05",label:"0.05",description:"Balanced"},{value:"0.1",label:"0.1",description:"Strict"}]}},presencePenalty:{type:"number",default:-1,ui:{tab:"model",group:"Sampling",label:"Presence Penalty",description:"Penalty for introducing already-present tokens (-1 = provider default)",options:[{value:"-1",label:"Default",description:"Use provider default"},{value:"0",label:"0",description:"No penalty"},{value:"0.5",label:"0.5",description:"Mild novelty"},{value:"1",label:"1",description:"Encourage novelty"},{value:"2",label:"2",description:"Strong novelty"}]}},repetitionPenalty:{type:"number",default:-1,ui:{tab:"model",group:"Sampling",label:"Repetition Penalty",description:"Penalty for repeated tokens (-1 = provider default)",options:[{value:"-1",label:"Default",description:"Use provider default"},{value:"0.8",label:"0.8",description:"Allow repetition"},{value:"1",label:"1",description:"No penalty"},{value:"1.1",label:"1.1",description:"Mild penalty"},{value:"1.2",label:"1.2",description:"Balanced"},{value:"1.5",label:"1.5",description:"Strong penalty"}]}},textVerbosity:{type:"enum",default:"medium",values:["low","medium","high"],ui:{tab:"model",group:"Sampling",label:"Text Verbosity",description:"OpenAI Responses and Codex response verbosity (low, medium, or high)",options:[{value:"low",label:"Low",description:"Prefer concise responses"},{value:"medium",label:"Medium",description:"Balance brevity and detail (default)"},{value:"high",label:"High",description:"Prefer detailed responses"}]}},"tier.openai":{type:"enum",default:"none",values:["none","auto","default","flex","scale","priority","ultrafast"],ui:{tab:"model",group:"Sampling",label:"Service Tier — OpenAI",description:"Processing tier for OpenAI / OpenAI-Codex requests, and OpenAI-family models routed via OpenRouter (none = omit). Sent as `service_tier`.",options:[{value:"none",label:"None",description:"Omit service_tier (standard processing)"},{value:"auto",label:"Auto",description:"Provider default tier selection"},{value:"default",label:"Default",description:"Standard priority processing"},{value:"flex",label:"Flex",description:"Lower cost, higher latency when available"},{value:"scale",label:"Scale",description:"Scale Tier credits when available"},{value:"priority",label:"Priority",description:"Faster, higher cost (premium request)"},{value:"ultrafast",label:"Ultrafast",description:"Lowest-latency serving; OpenAI API preview access, or Codex models that advertise it"}]}},"tier.anthropic":{type:"enum",default:"none",values:["none","priority"],ui:{tab:"model",group:"Sampling",label:"Service Tier — Anthropic",description:'Processing tier for Claude requests. `priority` realizes fast mode (`speed: "fast"`) on supported direct Anthropic models; ignored on Bedrock/Vertex Claude and via OpenRouter.',options:[{value:"none",label:"None",description:"Standard processing"},{value:"priority",label:"Priority",description:'Fast mode (`speed: "fast"`) on supported direct Claude models; ignored on Bedrock/Vertex'}]}},"tier.google":{type:"enum",default:"none",values:["none","flex","priority"],ui:{tab:"model",group:"Sampling",label:"Service Tier — Google",description:"Processing tier for Gemini (Google AI Studio + Vertex) requests, and Google-family models routed via OpenRouter (none = omit). Sent as the top-level `serviceTier` field.",options:[{value:"none",label:"None",description:"Standard processing"},{value:"flex",label:"Flex",description:"Lower cost, higher latency (Gemini API + Vertex)"},{value:"priority",label:"Priority",description:"Faster, higher reliability (Gemini API + Vertex)"}]}},"tier.subagent":{type:"enum",default:"inherit",values:["inherit","none","auto","default","flex","scale","priority","ultrafast"],ui:{tab:"model",group:"Sampling",label:"Service Tier — Subagent",description:"Service Tier for spawned task/eval subagents. Inherit = match the main agent's live per-family tiers (tracks /fast); pick a value to apply it to whichever family the subagent's model belongs to.",options:[{value:"inherit",label:"Inherit",description:"Match the main agent's live per-family tiers"},{value:"none",label:"None",description:"Standard processing"},{value:"auto",label:"Auto",description:"Provider default tier selection (OpenAI family)"},{value:"default",label:"Default",description:"Standard priority processing (OpenAI family)"},{value:"flex",label:"Flex",description:"Flexible capacity tier (OpenAI/Google families)"},{value:"scale",label:"Scale",description:"Scale Tier credits (OpenAI family)"},{value:"priority",label:"Priority",description:"Priority on every supported family of the spawned model"},{value:"ultrafast",label:"Ultrafast",description:"Ultrafast serving (OpenAI family, where available)"}]}},"tier.advisor":{type:"enum",default:"none",values:["inherit","none","auto","default","flex","scale","priority","ultrafast"],ui:{tab:"model",group:"Sampling",label:"Service Tier — Advisor",description:"Service Tier for the advisor model. None = standard processing; Inherit = match the main agent's live per-family tiers; pick a value to apply it to the advisor model's family.",options:[{value:"inherit",label:"Inherit",description:"Match the main agent's live per-family tiers"},{value:"none",label:"None",description:"Standard processing"},{value:"auto",label:"Auto",description:"Provider default tier selection (OpenAI family)"},{value:"default",label:"Default",description:"Standard priority processing (OpenAI family)"},{value:"flex",label:"Flex",description:"Flexible capacity tier (OpenAI/Google families)"},{value:"scale",label:"Scale",description:"Scale Tier credits (OpenAI family)"},{value:"priority",label:"Priority",description:"Priority on every supported family of the spawned model"},{value:"ultrafast",label:"Ultrafast",description:"Ultrafast serving (OpenAI family, where available)"}],condition:"advisorEnabled"}},"retry.maxRetries":{type:"number",default:10,ui:{tab:"model",group:"Retry & Fallback",label:"Retry Attempts",description:"Maximum retry attempts on API errors",options:[{value:"1",label:"1 retry"},{value:"2",label:"2 retries"},{value:"3",label:"3 retries"},{value:"5",label:"5 retries"},{value:"10",label:"10 retries"}]}},"retry.maxDelayMs":{type:"number",default:300000,ui:{tab:"model",group:"Retry & Fallback",label:"Max Retry Delay",description:"Maximum wait between retries, in ms. When the provider asks us to wait longer than this and no credential or model fallback succeeds, the request fails fast instead of sleeping (e.g. 3-hour Anthropic rate-limit windows). 0 disables the ceiling — to let the session auto-resume through provider-stated quota resets."}},"retry.waitForUsageReset":{type:"boolean",default:!1,ui:{tab:"model",group:"Retry & Fallback",label:"Wait For Usage Reset",description:"When a provider reports usage-limit exhaustion with a reset time (5-hour or weekly quota windows on any provider), sleep until the reset instead of failing fast past retry.maxDelayMs. Waits are abortable (Esc) but also hold subagents, so leave off for unattended runs."}},"retry.modelFallback":{type:"boolean",default:!0,ui:{tab:"model",group:"Retry & Fallback",label:"Retry Model Fallback",description:"Allow retry recovery to switch to models in retry.fallbackChains after provider errors. Independent of Auto-Promote Context"}},"retry.fallbackOn":{type:"enum",default:"any",values:["any","usage-limit","except-usage-limit"],ui:{tab:"model",group:"Retry & Fallback",label:"Fallback Trigger",description:"Which failed requests may switch to a configured fallback model",options:[{value:"any",label:"Any error",description:"Every provider error may switch models"},{value:"usage-limit",label:"Usage limits only",description:"Switch only on a usage limit; retry other errors on the same model, then surface them"},{value:"except-usage-limit",label:"All but usage limits",description:"Wait out or surface a usage limit; switch on other errors"}]}},"retry.usageAwareFallback":{type:"boolean",default:!1,ui:{tab:"model",group:"Retry & Fallback",label:"Usage-Aware Fallback",description:"Use reliable coding-plan quota reports to prefer same-provider accounts, then configured fallback models, before a hard usage limit. Ordinary configured API keys are excluded."}},"retry.usageReservePct":{type:"number",default:10,ui:{tab:"model",group:"Retry & Fallback",label:"Reserve Margin",description:"Treat a coding-plan model as near its limit below this remaining percentage. Unknown or unmapped usage keeps the primary model.",condition:"usageAwareFallbackEnabled",options:[{value:"5",label:"5%",description:"Act only when nearly exhausted"},{value:"10",label:"10%",description:"Balanced safety margin"},{value:"15",label:"15%",description:"Conservative"},{value:"20",label:"20%",description:"Early protection"},{value:"25",label:"25%",description:"Very conservative"}]}},"retry.usageReservePolicy":{type:"enum",default:"confirm",values:["confirm","auto","fail-closed"],ui:{tab:"model",group:"Retry & Fallback",label:"Reserve Policy",description:"What to do when every same-provider coding-plan account is inside the reserve margin.",condition:"usageAwareFallbackEnabled",options:[{value:"confirm",label:"Confirm interactively",description:"Keep interactive sessions on the primary until confirmed; background agents auto-fallback"},{value:"auto",label:"Auto-fallback",description:"Always select the next eligible configured fallback"},{value:"fail-closed",label:"Fail closed",description:"Do not spend reserve quota or select a fallback"}]}},"retry.fallbackChains":{type:"record",default:{},ui:{tab:"model",group:"Retry & Fallback",label:"Retry Fallback Chains",description:`JSON object mapping model roles, model selectors ("provider/model-id"), or provider wildcards ("provider/*") to ordered fallback selectors, e.g. {"default":["openai/gpt-4o-mini"],"google-antigravity/*":["google/*","google-vertex/*"]}. Model-oriented keys apply whenever that model/provider is active, regardless of role; a "provider/*" entry keeps the failing model's id and swaps the provider. An id-prefixed wildcard ("openrouter/google/*") re-prefixes the failing model's bare id (google-antigravity/gemini-x -> openrouter/google/gemini-x) and, used as a key, matches only that provider's ids under the prefix. A fallback entry may carry an explicit thinking suffix ("provider/model:low", ":high", ":max", ":off"); a bare entry inherits the failing turn's effort, and "provider/*" entries always inherit.`}},"retry.fallbackRevertPolicy":{type:"enum",default:"cooldown-expiry",values:["cooldown-expiry","never"],ui:{tab:"model",group:"Retry & Fallback",label:"Fallback Revert Policy",description:"When to return to the primary model after a fallback",options:[{value:"cooldown-expiry",label:"Cooldown expiry",description:"Return to the primary model after its suppression window ends"},{value:"never",label:"Never",description:"Stay on the fallback model until manually changed"}]}},"providers.anthropic.serverSideFallback":{type:"boolean",default:!1,ui:{tab:"model",group:"Retry & Fallback",label:"Anthropic Server-Side Fallback (Fable 5)",description:"When a Claude Fable 5 / Mythos 5 request is blocked by Anthropic's safety classifier, retry it on Claude Opus 5 server-side (Anthropic `server-side-fallback-2026-06-01` beta). Opt-in — leaving this off preserves the pre-fallback behavior for every request."}},"providers.ollama-cloud.maxConcurrency":{type:"number",default:3,ui:{tab:"providers",group:"Services",label:"Ollama Cloud Max Concurrency",description:"Maximum concurrent Ollama Cloud subagent runs per process; 0 disables the provider-specific limit"}},"providers.webSearchTimeoutSeconds":{type:"number",default:60,ui:{tab:"providers",group:"Services",label:"Web Search Timeout",description:"Hard timeout for each provider's search transport before web_search advances to the next fallback, in seconds (maximum 300)",options:[{value:"30",label:"30 seconds"},{value:"60",label:"1 minute"},{value:"120",label:"2 minutes"},{value:"180",label:"3 minutes"},{value:"300",label:"5 minutes"}]}},"providers.antigravityEndpoint":{type:"enum",default:"auto",values:["auto","production","sandbox"],ui:{tab:"providers",group:"Services",label:"Antigravity Endpoint Mode",description:"Endpoint routing strategy for google-antigravity providers (chat, search, image, discovery)",options:[{value:"auto",label:"Auto",description:"Try production endpoint, fail over to sandbox on 5xx/429"},{value:"production",label:"Production Only",description:"Force production endpoint only"},{value:"sandbox",label:"Sandbox Only",description:"Force sandbox endpoint only"}]}},"providers.fireworksTier":{type:"enum",default:"standard",values:["standard","priority"],ui:{tab:"providers",group:"Fireworks",label:"Fireworks Tier",description:'Serving path for Fireworks requests. Priority sends `service_tier: "priority"` for higher reliability during peak traffic at a higher price; Standard omits it. Fast (`-fast`) models ignore this — Fast is its own serving path.',options:[{value:"standard",label:"Standard",description:"Default serving path (no service_tier)"},{value:"priority",label:"Priority",description:"Priority serving path: higher reliability, premium per-token pricing"}]}},"providers.tinyModelDevice":{type:"enum",default:"default",values:["default","gpu","cpu","mlx","metal","webgpu","cuda","dml","coreml","auto","wasm","webnn","webnn-gpu","webnn-cpu","webnn-npu"],ui:{tab:"providers",group:"Tiny Model",label:"Tiny Model Device",description:"Inference backend for local tiny models (titles + memory): an ONNX execution provider, or `mlx` to download MLX weights and run them through mlx-lm on Apple silicon. Default uses CPU-only ONNX. The PI_TINY_DEVICE env var overrides this.",options:[{value:"default",label:"Default",description:"CPU-only inference"},{value:"gpu",label:"GPU",description:"Accelerated provider (WebGPU/Metal, CUDA, or DirectML)"},{value:"cpu",label:"CPU",description:"CPU-only inference"},{value:"mlx",label:"MLX",description:"Apple silicon GPU via mlx-lm (Python subprocess; macOS arm64)"},{value:"metal",label:"Metal",description:"Alias for MLX"},{value:"webgpu",label:"WebGPU",description:"WebGPU/Metal backend"},{value:"cuda",label:"CUDA",description:"NVIDIA CUDA (Linux x64)"},{value:"dml",label:"DirectML",description:"DirectML backend (Windows)"},{value:"coreml",label:"CoreML",description:"Apple CoreML (opt-in; can fail to load)"},{value:"auto",label:"Auto",description:"Let ONNX Runtime choose a provider"},{value:"wasm",label:"WASM",description:"WebAssembly backend"},{value:"webnn",label:"WebNN",description:"WebNN backend"},{value:"webnn-gpu",label:"WebNN GPU",description:"WebNN GPU device"},{value:"webnn-cpu",label:"WebNN CPU",description:"WebNN CPU device"},{value:"webnn-npu",label:"WebNN NPU",description:"WebNN NPU device"}]}},"providers.tinyModelDtype":{type:"enum",default:"default",values:["default","q4","q4f16","q8","fp16","fp32","int8","uint8","bnb4","q2","q2f16","q1","q1f16","auto"],ui:{tab:"providers",group:"Tiny Model",label:"Tiny Model Precision",description:"ONNX quantization/precision for local tiny models. Default uses each model's shipped dtype (q4); lower precision is faster, higher is more faithful. Ignored by the MLX backend (its repos are pre-quantized 4-bit). The PI_TINY_DTYPE env var overrides this.",options:[{value:"default",label:"Default",description:"Each model's shipped dtype (currently q4)"},{value:"q4",label:"q4",description:"4-bit weights; smallest and fastest"},{value:"q4f16",label:"q4f16",description:"4-bit weights with fp16 activations"},{value:"q8",label:"q8",description:"8-bit quantization"},{value:"fp16",label:"fp16",description:"16-bit float; higher fidelity, larger"},{value:"fp32",label:"fp32",description:"Full precision; largest and slowest"},{value:"int8",label:"int8",description:"Signed 8-bit integer"},{value:"uint8",label:"uint8",description:"Unsigned 8-bit integer"},{value:"bnb4",label:"bnb4",description:"bitsandbytes 4-bit"},{value:"q2",label:"q2",description:"2-bit weights"},{value:"q2f16",label:"q2f16",description:"2-bit weights with fp16 activations"},{value:"q1",label:"q1",description:"1-bit weights"},{value:"q1f16",label:"q1f16",description:"1-bit weights with fp16 activations"},{value:"auto",label:"Auto",description:"Let transformers.js choose per device"}]}},"providers.autoThinkingMaxEffort":{type:"enum",default:"xhigh",values:["xhigh","max"],ui:{tab:"model",group:"Thinking",label:"Auto Thinking Ceiling",description:"Highest effort the `auto` classifier may resolve. `xhigh` keeps the classifier one tier below the top, so only an explicit `ultrathink` reaches `max`; `max` lets a turn the classifier judges exceptional bill the top tier on models that expose it.",condition:"autoThinkingActive",options:[{value:"xhigh",label:"xhigh",description:"Classifier stops at xhigh (default)"},{value:"max",label:"max",description:"Classifier may resolve max where the model supports it"}]}},"features.unexpectedStopDetection":{type:"enum",default:"mechanical",values:["none","mechanical","smart"],ui:{tab:"interaction",group:"Agent",label:"Unexpected Stops",description:"Automatically recover when the assistant stops without a visible message. Smart also classifies text-only stops with a small model.",options:[{value:"none",label:"None",description:"Disabled"},{value:"mechanical",label:"Mechanical",description:"Retry stops with no visible assistant message; tool calls are excluded (default)"},{value:"smart",label:"Smart",description:"Mechanical + small-model classification of text-only stops"}]}},"providers.kimiApiFormat":{type:"enum",default:"auto",values:["auto","openai","anthropic"],ui:{tab:"providers",group:"Protocol",label:"Kimi API Format",description:"API format for Kimi Code provider (auto follows live model metadata)",options:[{value:"auto",label:"Auto",description:"Use the model's server-declared protocol"},{value:"openai",label:"OpenAI",description:"api.kimi.com"},{value:"anthropic",label:"Anthropic",description:"api.moonshot.ai"}]}},"providers.openaiWebsockets":{type:"enum",default:"auto",values:["auto","off","on"],ui:{tab:"providers",group:"Protocol",label:"OpenAI WebSockets",description:"Websocket policy for OpenAI Codex models (auto uses model defaults, on forces, off disables)",options:[{value:"auto",label:"Auto",description:"Use model/provider default websocket behavior"},{value:"off",label:"Off",description:"Disable websockets for OpenAI Codex models"},{value:"on",label:"On",description:"Force websockets for OpenAI Codex models"}]}},"providers.openaiLiveSteering":{type:"boolean",default:!0,ui:{tab:"providers",group:"Protocol",label:"OpenAI Live Steering",description:"Deliver messages typed while a GPT-6 response streams into that response over the Codex WebSocket, instead of waiting for the next tool boundary"}},"providers.muse-code.storeResponses":{type:"boolean",default:!1,ui:{tab:"providers",group:"Protocol",label:"Muse Code Stored Responses",description:"Store Muse Code results on Meta's servers so a turn whose connection drops is recovered instead of re-run. Stored runs keep prompts and outputs on Meta's side."}},"providers.cacheRetention":{type:"enum",default:"auto",values:["auto","short","long","none"],ui:{tab:"providers",group:"Protocol",label:"Prompt Cache Retention",description:"Prompt-cache retention forwarded to providers that support it (Anthropic, Bedrock, OpenRouter, OpenAI)",options:[{value:"auto",label:"Auto",description:"Provider default — Anthropic OAuth subscriber sessions default to 1h, API keys use 5m; PI_CACHE_RETENTION still applies"},{value:"short",label:"Short (5m)",description:"Cheapest cache writes; pair with cache warming to keep short entries alive while idle"},{value:"long",label:"Long (1h+)",description:"Longer TTL where supported (Anthropic/Bedrock 1h, OpenAI GPT-5.6+ Responses 12h); pricier writes, only warmed during active runs"},{value:"none",label:"Off",description:"Disable prompt caching and cache-affinity routing"}]}},"providers.cacheWarming":{type:"enum",default:"idle",values:["off","streaming","idle"],ui:{tab:"providers",group:"Protocol",label:"Cache Warming",description:"Re-send the last request with a one-token output budget shortly before its prompt-cache entry expires",options:[{value:"off",label:"Off",description:"Disable cache warming"},{value:"streaming",label:"Streaming",description:"Protect expensive prefixes during long tool executions; stops when the agent settles"},{value:"idle",label:"Idle",description:"Also refresh 5-minute entries between runs while the expected savings stay above the cost floor"}]}},"providers.streamFirstEventTimeoutSeconds":{type:"number",default:-1,ui:{tab:"providers",group:"Timeouts",label:"Stream First Event Timeout",description:"Seconds to wait for the first model stream event; -1 uses provider/env defaults, 0 disables the watchdog",options:[{value:"-1",label:"Auto",description:"Use provider defaults and PI_* timeout env vars"},{value:"0",label:"Off",description:"Disable first-event timeout"},{value:"300",label:"5 minutes"},{value:"600",label:"10 minutes"},{value:"1800",label:"30 minutes"}]}},"providers.streamIdleTimeoutSeconds":{type:"number",default:-1,ui:{tab:"providers",group:"Timeouts",label:"Stream Idle Timeout",description:"Seconds a model stream may stay silent between events; -1 uses provider/env defaults, 0 disables the watchdog",options:[{value:"-1",label:"Auto",description:"Use provider defaults and PI_* timeout env vars"},{value:"0",label:"Off",description:"Disable idle timeout"},{value:"300",label:"5 minutes"},{value:"600",label:"10 minutes"},{value:"1800",label:"30 minutes"}]}},"providers.openrouterVariant":{type:"enum",default:"default",values:["default","nitro","floor","online","exacto"],ui:{tab:"providers",group:"Protocol",label:"OpenRouter Routing",description:"Default routing-variant suffix appended to OpenRouter model IDs (overridden when the selector already names a variant)",options:[{value:"default",label:"Default",description:"No suffix; use OpenRouter's default routing"},{value:"nitro",label:":nitro",description:"Prioritize throughput / lowest latency"},{value:"floor",label:":floor",description:"Prioritize cheapest available provider"},{value:"online",label:":online",description:"Enable OpenRouter's web-search plugin"},{value:"exacto",label:":exacto",description:"Cherry-picked high-quality providers (only defined for select models)"}]}},"live.voice":{type:"enum",default:"sol",values:["arbor","breeze","cove","ember","juniper","maple","sol","spruce","vale"],ui:{tab:"providers",group:"Services",label:"Live Voice",description:"Voice used by Codex-backed realtime voice sessions",options:[{value:"arbor",label:"Arbor"},{value:"breeze",label:"Breeze"},{value:"cove",label:"Cove"},{value:"ember",label:"Ember"},{value:"juniper",label:"Juniper"},{value:"maple",label:"Maple"},{value:"sol",label:"Sol"},{value:"spruce",label:"Spruce"},{value:"vale",label:"Vale"}]}},"tts.localVoice":{type:"enum",default:"af_heart",values:["af_heart","af_bella","af_nicole","af_aoede","af_kore","af_sarah","am_michael","am_fenrir","am_puck","bf_emma","bm_george","bm_fable"],ui:{tab:"providers",group:"Services",label:"Local TTS Voice",description:"Kokoro voice used by the local TTS backend (American/British, female/male)",options:[{value:"af_heart",label:"Heart (American female)"},{value:"af_bella",label:"Bella (American female)"},{value:"af_nicole",label:"Nicole (American female)"},{value:"af_aoede",label:"Aoede (American female)"},{value:"af_kore",label:"Kore (American female)"},{value:"af_sarah",label:"Sarah (American female)"},{value:"am_michael",label:"Michael (American male)"},{value:"am_fenrir",label:"Fenrir (American male)"},{value:"am_puck",label:"Puck (American male)"},{value:"bf_emma",label:"Emma (British female)"},{value:"bm_george",label:"George (British male)"},{value:"bm_fable",label:"Fable (British male)"}]}},"tts.localSpeed":{type:"number",default:1,ui:{tab:"providers",group:"Services",label:"Local TTS Speed",description:"Speaking rate of the local TTS backend (tts tool, omp say). 1 = normal; clamped to 0.5–2.5",options:[{value:"0.5",label:"0.5×"},{value:"0.75",label:"0.75×"},{value:"1",label:"1× (normal)"},{value:"1.25",label:"1.25×"},{value:"1.5",label:"1.5×"},{value:"1.75",label:"1.75×"},{value:"2",label:"2×"},{value:"2.5",label:"2.5×"}]}},"speech.enabled":{type:"boolean",default:!1,ui:{tab:"providers",group:"Services",label:"Speech Vocalization",description:"Speak the assistant's output aloud through the speakers as it streams"}},"speech.mode":{type:"enum",default:"assistant",values:["all","assistant","yield"],ui:{tab:"providers",group:"Services",label:"Speech Vocalization Mode",description:"What to speak: all = assistant messages + thinking; assistant = messages only; yield = only the final message at turn end",options:[{value:"all",label:"All (messages + thinking)"},{value:"assistant",label:"Assistant messages"},{value:"yield",label:"Final message only"}]}},"speech.enhanced":{type:"boolean",default:!1,ui:{tab:"providers",group:"Services",label:"Enhanced Speech Rewriting",description:"Rewrite assistant output into natural spoken prose with the tiny/smol model before synthesis (describes code, drops links and markdown). Falls back to mechanical cleanup on failure"}},"speech.voice":{type:"enum",default:"af_heart",values:["af_heart","af_bella","af_nicole","af_aoede","af_kore","af_sarah","am_michael","am_fenrir","am_puck","bf_emma","bm_george","bm_fable"],ui:{tab:"providers",group:"Services",label:"Speech Vocalization Voice",description:"Kokoro voice used when speaking the assistant's output aloud",options:[{value:"af_heart",label:"Heart (American female)"},{value:"af_bella",label:"Bella (American female)"},{value:"af_nicole",label:"Nicole (American female)"},{value:"af_aoede",label:"Aoede (American female)"},{value:"af_kore",label:"Kore (American female)"},{value:"af_sarah",label:"Sarah (American female)"},{value:"am_michael",label:"Michael (American male)"},{value:"am_fenrir",label:"Fenrir (American male)"},{value:"am_puck",label:"Puck (American male)"},{value:"bf_emma",label:"Emma (British female)"},{value:"bm_george",label:"George (British male)"},{value:"bm_fable",label:"Fable (British male)"}]}},"speech.speed":{type:"number",default:1,ui:{tab:"providers",group:"Services",label:"Speech Vocalization Speed",description:"Speaking rate when reading the assistant's output aloud. 1 = normal; clamped to 0.5–2.5",options:[{value:"0.5",label:"0.5×"},{value:"0.75",label:"0.75×"},{value:"1",label:"1× (normal)"},{value:"1.25",label:"1.25×"},{value:"1.5",label:"1.5×"},{value:"1.75",label:"1.75×"},{value:"2",label:"2×"},{value:"2.5",label:"2.5×"}]}},"providers.fetch":{type:"enum",default:"auto",values:["auto","native","trafilatura","lynx","parallel","firecrawl","jina"],ui:{tab:"providers",group:"Services",label:"Fetch Provider",description:"Reader backend priority for the fetch/read URL tool",options:[{value:"auto",label:"Auto",description:"Priority: native > trafilatura > lynx > parallel > firecrawl > jina"},{value:"native",label:"Native",description:"In-process HTML→Markdown converter (always available)"},{value:"trafilatura",label:"Trafilatura",description:"Auto-installs via uv/pip"},{value:"lynx",label:"Lynx",description:"Requires lynx system package"},{value:"parallel",label:"Parallel",description:"Requires PARALLEL_API_KEY"},{value:"firecrawl",label:"Firecrawl",description:"Requires FIRECRAWL_API_KEY"},{value:"jina",label:"Jina",description:"Uses r.jina.ai reader (JINA_API_KEY optional)"}]}},"codexResets.autoRedeem":{type:"enum",default:"unset",values:["unset","yes","no"],ui:{tab:"providers",group:"Services",label:"Codex Auto-Redeem Saved Resets",description:"Spend saved Codex rate-limit resets automatically: restore an account blocked by an exhausted 5h or weekly window when a turn is stuck and no other account can take over, and salvage credits that are about to expire. unset asks before the first spend (with no prompt UI, it spends only a reset expiring within 5 minutes), yes spends without prompting, and no disables both checks.",options:[{value:"unset",label:"Unset",description:"Check eligibility, then ask before spending the first saved reset. With no prompt UI, spend only a reset expiring within 5 minutes."},{value:"yes",label:"Yes",description:"Spend eligible saved resets without prompting."},{value:"no",label:"No",description:"Do not run the saved-reset auto-redeem check."}]}},"codexResets.minBlockedMinutes":{type:"number",default:60,ui:{tab:"providers",group:"Services",label:"Codex Auto-Redeem Min Block",description:"Only auto-redeem when the natural unblock — the latest reset among the exhausted 5h/weekly windows — is at least this many minutes away (don't spend a scarce credit to save a short wait). Raise it (e.g. 360) to ignore 5h-only blocks."}},"codexResets.keepCredits":{type:"number",default:0,ui:{tab:"providers",group:"Services",label:"Codex Auto-Redeem Reserve",description:"Never auto-spend below this many saved resets (0 = the last credit may be spent automatically). Credits about to expire are exempt — a reserved credit that expires preserves nothing."}},"codexResets.salvageHorizonHours":{type:"number",default:12,ui:{tab:"providers",group:"Services",label:"Codex Reset Salvage Horizon",description:"With auto-redeem enabled, spend a saved Codex reset within this many hours of expiry when either chat window has meaningful usage. 0 disables early salvage; credits expiring within 5 minutes are still attempted regardless of usage."}},"claudeResets.autoRedeem":{type:"enum",default:"unset",values:["unset","yes","no"],ui:{tab:"providers",group:"Services",label:"Claude Auto-Redeem Resets",description:"Spend eligible Claude Cedar or Juniper resets automatically. Cedar is spent only for covered limits; Juniper can only recover a sole 5-hour block. unset asks before the first spend (with no prompt UI, it spends only a reset expiring within 5 minutes), yes spends without prompting, and no disables blocked recovery and expiry salvage.",options:[{value:"unset",label:"Unset",description:"Check live eligibility, then ask before spending the first Claude reset. With no prompt UI, spend only a reset expiring within 5 minutes."},{value:"yes",label:"Yes",description:"Spend eligible Claude resets without prompting."},{value:"no",label:"No",description:"Do not run Claude reset auto-redeem checks."}]}},"claudeResets.minBlockedMinutes":{type:"number",default:60,ui:{tab:"providers",group:"Services",label:"Claude Auto-Redeem Min Block",description:"Only auto-redeem when the natural unblock — the latest reset among the exhausted covered windows — is at least this many minutes away. A 5-hour-only reset is never used for a weekly or model-scoped block."}},"claudeResets.keepCredits":{type:"number",default:0,ui:{tab:"providers",group:"Services",label:"Claude Auto-Redeem Reserve",description:"Keep at least this many Claude resets banked (0 allows the last eligible reset to be spent automatically). The reserve applies to early salvage, but not to eligible resets expiring within 5 minutes."}},"claudeResets.salvageHorizonHours":{type:"number",default:12,ui:{tab:"providers",group:"Services",label:"Claude Reset Salvage Horizon",description:"With auto-redeem enabled, use a server-selected Cedar reset within this many hours of expiry when its covered windows have meaningful usage. 0 disables early salvage; eligible Cedar or Juniper resets expiring within 5 minutes are still attempted regardless of usage or reserve. Provider limit requirements still apply."}},"provider.appendOnlyContext":{type:"enum",default:"auto",values:["auto","on","off"],ui:{tab:"providers",group:"Protocol",label:"Append-Only Context",description:"Cache system prompt + tool specs and keep an append-only message log so provider prefix caches (DeepSeek, Xiaomi/SGLang, Anthropic) hit at maximum rate. Auto enables for known prefix-cache providers.",options:[{value:"auto",label:"Auto",description:"Enable for known prefix-cache providers (recommended)"},{value:"on",label:"On",description:"Always enable append-only context"},{value:"off",label:"Off",description:"Disable append-only context"}]}},"telemetry.otlpExportEnabled":{type:"boolean",default:!0,ui:{tab:"providers",group:"Privacy",label:"OTLP Telemetry Export",description:"Allow OMP to export traces, logs, and metrics using OTEL_* endpoints. Changes take effect on the next launch."}},"advisor.enabled":{type:"boolean",default:!1,ui:{tab:"model",group:"Advisor",label:"Enable Advisor",description:"Pair a second model (assigned to the 'advisor' role) that passively reviews each turn and injects notes."}},"advisor.syncBacklog":{type:"enum",default:"off",values:["off","1","3","5","strict"],ui:{tab:"model",group:"Advisor",label:"Advisor Sync Backlog",description:"Pause main agent until advisor backlog falls below threshold. Numeric values cap wait at 30 seconds; strict waits for all scheduled reviews without a wall-clock cap. Off disables catch-up delays. Abort, failure, and disposal release waits.",condition:"advisorEnabled"}},"advisor.immuneTurns":{type:"number",default:3,ui:{tab:"model",group:"Advisor",label:"Advisor Immune Turns",description:"After an advisor concern or blocker interrupts, route further concerns as non-interrupting asides for this many primary turns. Blockers are exempt from the cooldown.",options:[{value:"0",label:"0 steps",description:"No cooldown."},{value:"1",label:"1 step"},{value:"2",label:"2 steps"},{value:"3",label:"3 steps",description:"Default."},{value:"4",label:"4 steps"},{value:"5",label:"5 steps"}],condition:"advisorEnabled"}},"advisor.continueSeverity":{type:"enum",default:"concern",values:["nit","concern","blocker"],ui:{tab:"model",group:"Advisor",label:"Advisor Continue Severity",description:"Minimum severity of an advisor note that wakes the agent after it finished with a final answer. Lower-severity notes stay as a card at the end of the transcript and reach the agent with your next message.",options:[{value:"nit",label:"Nit",description:"Every note continues the run."},{value:"concern",label:"Concern",description:"Concerns and blockers continue the run. Default."},{value:"blocker",label:"Blocker",description:"Only blockers continue the run."}],condition:"advisorEnabled"}},"advisor.reviewMode":{type:"enum",default:"turn",values:["turn","agent-end"],ui:{tab:"model",group:"Advisor",label:"Advisor Review Mode",description:"Default advisor cadence when no WATCHDOG.yml roster is present. turn reviews every primary turn; agent-end reviews only final yields.",options:[{value:"turn",label:"Every turn",description:"Review every primary update (tool-call round)."},{value:"agent-end",label:"Agent end",description:"Review only at final yields (once per run)."}],condition:"advisorEnabled"}},"advisor.reviewInterval":{type:"number",default:1,ui:{tab:"model",group:"Advisor",label:"Advisor Review Interval",description:"Default advisor cadence when no WATCHDOG.yml roster is present: review every Nth eligible primary update. 1 = every update. Skipped updates are sent with the next scheduled review.",options:[{value:"1",label:"Every eligible update",description:"Default."},{value:"2",label:"Every 2nd"},{value:"3",label:"Every 3rd"},{value:"5",label:"Every 5th"},{value:"10",label:"Every 10th"}],condition:"advisorEnabled"}},"advisor.maxNotesPerUpdate":{type:"number",default:4,ui:{tab:"model",group:"Advisor",label:"Advisor Max Notes Per Update",description:"Maximum non-blocker advice notes accepted per advisor prompt update (1–32; UI offers 1–5 quick picks). Blockers are exempt.",options:[{value:"1",label:"1 note",description:"Anti-flood (strict)."},{value:"2",label:"2 notes"},{value:"3",label:"3 notes"},{value:"4",label:"4 notes",description:"Frontier reasoning models. Default."},{value:"5",label:"5 notes"}],condition:"advisorEnabled"}},"advisor.evictStaleResults":{type:"boolean",default:!0,ui:{tab:"model",group:"Advisor",label:"Advisor Evict Stale Results",description:"Before each review, replace the advisor's read/grep/glob output from older reviews with a short placeholder. The latest review is kept.",condition:"advisorEnabled"}},"workspace.additionalDirectories":{type:"array",default:[],ui:{tab:"context",group:"General",label:"Additional Workspace Dirs",description:"Extra workspace directories added to every session as additional roots (multi-root workspace). Managed live via /add-dir and /remove-dir. Paths resolve relative to cwd; absolute paths recommended. The agent is told these roots exist and can read/grep/glob them."}},"contextFiles.extra":{type:"array",default:[],ui:{tab:"context",group:"General",label:"Extra Context Files",editor:"json",description:'Extra instruction filenames loaded beside AGENTS.md. Use a JSON list of names, not paths, e.g. ["AGENTS.local.md"]; [] disables extras. Start a new session to load them.',condition:"contextFilesExtraNotProject"}},"contextPromotion.enabled":{type:"boolean",default:!1,ui:{tab:"context",group:"General",label:"Auto-Promote Context",description:"Promote to the model's contextPromotionTarget on context overflow instead of compacting. Retry fallback switches are controlled by Retry Model Fallback"}},extendedContext:{type:"boolean",default:!1,ui:{tab:"context",group:"General",label:"Extended Context",description:"Use larger context windows where supported; may incur premium pricing. Off keeps default or standard-pricing windows"}},"compaction.enabled":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Auto-Compact",description:"Automatically compact context when it gets too large"}},"compaction.experimentalContextManagement":{type:"boolean",default:!1,ui:{tab:"context",group:"Compaction",label:"Notes-backed context windows (experimental)",description:"Keep persistent notes and searchable raw history across context windows."}},"compaction.midTurnEnabled":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Mid-Turn Compaction",description:"Check thresholds at safe mid-turn tool-loop boundaries before the next provider request; subagents always check, since their whole assignment is one turn"}},"compaction.methodOrder":{type:"array",default:["remote","snapcompact","handoff","shake","soft"],ui:{tab:"context",group:"Compaction",label:"Compaction Method Order",description:"Preferred fallback order for automatic context maintenance; unavailable or failed methods advance to the next choice",options:[{value:"remote",label:"Server compaction",description:"Use provider-native server compaction (OpenAI Responses compact, Anthropic compaction beta, including on Bedrock) when the active route supports it"},{value:"snapcompact",label:"Snapcompact",description:"Archive history onto dense bitmap images the active vision model reads back; no LLM call"},{value:"handoff",label:"Handoff",description:"Generate a handoff document and continue from it as the compaction summary"},{value:"soft",label:"Soft compaction",description:"Summarize in place with a compaction model without using server compaction"},{value:"shake",label:"Shake",description:"Drop recoverable heavy content in place without an LLM call"}],ordered:!0}},"compaction.thresholdPercent":{type:"number",default:-1,ui:{tab:"context",group:"Compaction",label:"Compaction Threshold",description:"Percent threshold for context maintenance; set to Default to use legacy reserve-based behavior",options:[{value:"default",label:"Default",description:"Legacy reserve-based threshold"},{value:"10",label:"10%",description:"Extremely early maintenance"},{value:"20",label:"20%",description:"Very early maintenance"},{value:"30",label:"30%",description:"Early maintenance"},{value:"40",label:"40%",description:"Moderately early maintenance"},{value:"50",label:"50%",description:"Halfway point"},{value:"60",label:"60%",description:"Moderate context usage"},{value:"70",label:"70%",description:"Balanced"},{value:"75",label:"75%",description:"Slightly aggressive"},{value:"80",label:"80%",description:"Typical threshold"},{value:"85",label:"85%",description:"Aggressive context usage"},{value:"90",label:"90%",description:"Very aggressive"},{value:"95",label:"95%",description:"Near context limit"}]}},"compaction.thresholdTokens":{type:"number",default:-1,ui:{tab:"context",group:"Compaction",label:"Compaction Token Limit",description:"Fixed token limit for context maintenance; overrides percentage if set",options:[{value:"default",label:"Default",description:"Use percentage-based threshold"},{value:"25000",label:"25K tokens",description:"1/8 of a 200K window"},{value:"50000",label:"50K tokens",description:"1/4 of a 200K window"},{value:"100000",label:"100K tokens",description:"1/2 of a 200K window"},{value:"150000",label:"150K tokens",description:"3/4 of a 200K window"},{value:"200000",label:"200K tokens",description:"Full standard context window"},{value:"300000",label:"300K tokens",description:"Large context window"},{value:"500000",label:"500K tokens",description:"Very large context window"}]}},"compaction.handoffSaveToDisk":{type:"boolean",default:!1,ui:{tab:"context",group:"Compaction",label:"Save Handoff Docs",description:"Save generated handoff documents to markdown files for the auto-handoff flow"}},"compaction.remoteStreamingV2Enabled":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Remote Compaction V2",description:"Use Responses streaming compaction for compatible remote compaction models"}},"compaction.asyncEnabled":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Async Compaction",description:"Speculatively summarize in the background as context nears the compaction threshold, then splice the ready result in when the threshold is crossed"}},"compaction.idleEnabled":{type:"boolean",default:!1,ui:{tab:"context",group:"Compaction",label:"Idle Compaction",description:"Compact context while idle when token count exceeds threshold"}},"compaction.idleThresholdTokens":{type:"number",default:200000,ui:{tab:"context",group:"Compaction",label:"Idle Compaction Threshold",description:"Token count above which idle compaction triggers",options:[{value:"100000",label:"100K tokens"},{value:"200000",label:"200K tokens"},{value:"300000",label:"300K tokens"},{value:"400000",label:"400K tokens"},{value:"500000",label:"500K tokens"},{value:"600000",label:"600K tokens"},{value:"700000",label:"700K tokens"},{value:"800000",label:"800K tokens"},{value:"900000",label:"900K tokens"}]}},"compaction.idleTimeoutSeconds":{type:"number",default:300,ui:{tab:"context",group:"Compaction",label:"Idle Compaction Delay",description:"Seconds to wait while idle before compacting; with a 1-hour prompt cache, compaction instead runs just before the cache expires",options:[{value:"60",label:"1 minute"},{value:"120",label:"2 minutes"},{value:"300",label:"5 minutes"},{value:"600",label:"10 minutes"},{value:"1800",label:"30 minutes"},{value:"3600",label:"1 hour"}]}},"compaction.supersedeReads":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Supersede Stale Reads",description:"Prune older read results when the same file is read again (cache-aware, runs every turn)"}},"compaction.dropUseless":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Elide Uneventful Results",description:"Prune tool results flagged contextually useless (no matches, timed-out waits) once consumed (cache-aware)"}},"snapcompact.systemPrompt":{type:"enum",default:"none",values:["none","agents-md","all"],ui:{tab:"context",group:"Experimental",label:"Snapcompact System Prompt",description:"Experimental: render selected system prompt text as dense PNG image(s) and attach to the first user message (vision models only). Saves tokens; loses prompt caching for imaged text.",options:[{value:"none",label:"None",description:"Keep the system prompt as text."},{value:"agents-md",label:"AGENTS.md",description:"Only move loaded context-file instructions to images, when that saves tokens."},{value:"all",label:"All",description:"Move the full system prompt to images, when that saves tokens."}]}},"snapcompact.toolResults":{type:"boolean",default:!1,ui:{tab:"context",group:"Experimental",label:"Snapcompact Tool Results",description:"Experimental: render large tool results, the newest one included, as dense PNG image(s) instead of text (vision models only). Saves tokens on accumulated search and command output; read results stay text unless the model is known to edit exactly from images."}},"tools.format":{type:"enum",default:"auto",values:["auto","native","glm","hermes","kimi","xml","anthropic","deepseek","harmony","qwen3","gemini","gemma","minimax"],ui:{tab:"context",group:"Experimental",label:"Tool Calling Mode",description:"Controls how tools are exposed to the model. Auto uses provider-native tool calls unless the selected model is marked as not supporting them, then falls back to the GLM owned dialect. Native forces provider-native tools; the other values force the named owned dialect.",options:[{value:"auto",label:"Auto",description:"Use native tool calls unless the model is known not to support them."},{value:"native",label:"Native",description:"Use provider-native tool calls."},{value:"glm",label:"GLM",description:"Use GLM-style in-band tool calls."},{value:"hermes",label:"Hermes",description:"Use Hermes-style in-band tool calls."},{value:"kimi",label:"Kimi",description:"Use Kimi-style in-band tool calls."},{value:"xml",label:"XML",description:"Use generic XML in-band tool calls."},{value:"anthropic",label:"Anthropic",description:"Use Anthropic-style in-band tool calls."},{value:"deepseek",label:"DeepSeek",description:"Use DeepSeek-style in-band tool calls."},{value:"harmony",label:"Harmony",description:"Use Harmony-style in-band tool calls."},{value:"qwen3",label:"Qwen3",description:"Use the Qwen3 owned dialect."},{value:"gemini",label:"Gemini",description:"Use the Gemini owned dialect."},{value:"gemma",label:"Gemma",description:"Use the Gemma owned dialect."},{value:"minimax",label:"MiniMax",description:"Use the MiniMax owned dialect."}]}},"snapcompact.shape":{type:"enum",default:"auto",values:["auto","8x8r-bw","8x8r-sent","8x8u-bw","8x8u-sent","6x6u-bw","6x6u-sent","5x8-bw","5x8-sent","6x12-dim","8x13-bw","8on16-bw","8on22-bw","11on16-bw","silver16-bw","doc-8on16-bw","doc-8on16-sent","doc-8on16-sent-dim"],ui:{tab:"context",group:"Experimental",label:"Snapcompact Shape",description:"Frame shape snapcompact prints text with (compaction archive and inline imaging). Auto picks a shape tuned for the current model.",options:[{value:"auto",label:"Auto",description:"Picks a shape tuned for the current model, falling back to its provider family."},{value:"8x8r-bw",label:"8x8 repeated, black",description:"unscii square cell, black ink, every line printed twice with the copy on a pale highlight band."},{value:"8x8r-sent",label:"8x8 repeated, sentence hues",description:"Repeated grid with ink cycling six hues at sentence boundaries."},{value:"8x8u-bw",label:"8x8, black",description:"Plain unscii square cell, single-printed lines, black ink."},{value:"8x8u-sent",label:"8x8, sentence hues",description:"Plain unscii square cell with sentence-hue ink."},{value:"6x6u-bw",label:"6x6 dense, black",description:"unscii squeezed to 6x6 — densest readable cell, fewest frames — in black ink."},{value:"6x6u-sent",label:"6x6 dense, sentence hues",description:"Densest cell with sentence-hue ink."},{value:"5x8-bw",label:"5x8 legacy, black",description:"Original X.org 5x8 glyphs on the 2576px frame, black ink."},{value:"5x8-sent",label:"5x8 legacy, sentence hues",description:"The original snapcompact shape (pre-shape-table sessions rendered this)."},{value:"6x12-dim",label:"6x12, dimmed stopwords",description:"X.org 6x12 glyphs, black ink, function words dimmed gray."},{value:"8x13-bw",label:"8x13, black",description:"X.org 8x13 glyphs, black ink."},{value:"8on16-bw",label:"8x13 on 16px pitch, black",description:"8x13 glyphs on an 8x16 cell (extra leading), black ink."},{value:"8on22-bw",label:"8x13 on 22px pitch (leading), black",description:"8x13 glyphs on an 8x22 cell — extra line spacing so rows don't crowd. Default for OpenAI/Google."},{value:"11on16-bw",label:"8x13 on 11px advance (tracking), black",description:"8x13 glyphs on an 11x16 cell — extra letter spacing so characters don't merge. Default for Anthropic."},{value:"silver16-bw",label:"Silver 16, CJK",description:"Embedded Silver TrueType font on a 16px grid for CJK and other non-Latin text."},{value:"doc-8on16-bw",label:"Doc 8on16, black",description:"Two word-wrapped newspaper columns of 8x13 glyphs on a 16px pitch, black ink."},{value:"doc-8on16-sent",label:"Doc 8on16, sentence hues",description:"Two-column doc layout with sentence-hue ink."},{value:"doc-8on16-sent-dim",label:"Doc 8on16, sentence hues + dimmed stopwords",description:"Two-column doc layout, sentence-hue ink, function words dimmed gray."}]}},"branchSummary.enabled":{type:"boolean",default:!1,ui:{tab:"context",group:"General",label:"Branch Summaries",description:"Prompt to summarize when leaving a branch"}},"memory.backend":{type:"enum",default:"off",values:["off","local","hindsight","mnemopi","sharpshooter"],ui:{tab:"memory",group:"General",label:"Memory Backend",description:"Off, local summary pipeline, Mnemopi SQLite, Hindsight remote memory, or Sharpshooter",options:[{value:"off",label:"Off",description:"No memory subsystem runs"},{value:"local",label:"Local",description:"Local rollout summarisation pipeline (memory_summary.md)"},{value:"hindsight",label:"Hindsight",description:"Vectorize Hindsight remote memory service"},{value:"mnemopi",label:"Mnemopi",description:"Local SQLite recall/retain backend with optional embeddings"},{value:"sharpshooter",label:"Sharpshooter",description:"Friction-gated project decision files (architecture/product/style), consolidated in the background"}]}},"sharpshooter.model":{type:"string",ui:{tab:"memory",group:"Sharpshooter",label:"Sharpshooter Model",description:"Model selector for extraction/consolidation, empty = smol role"}},"autolearn.enabled":{type:"boolean",default:!1,ui:{tab:"memory",group:"Auto-Learn",label:"Auto-Learn (experimental)",description:"After the agent stops, nudge it to capture lessons to memory and create/enhance isolated managed skills"}},"autolearn.autoContinue":{type:"boolean",default:!1,ui:{tab:"memory",group:"Auto-Learn",label:"Auto-run capture at stop",description:"When on, auto-run one private capture turn at stop (uses extra tokens). When off, only standing auto-learn guidance remains.",condition:"autolearnActive"}},"mnemopi.dbPath":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi DB Path",description:"Optional SQLite DB path. Defaults to the agent memories directory.",condition:"mnemopiActive"}},"mnemopi.bank":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Bank",description:"Optional shared bank base name. Per-project modes derive project-local banks from it.",condition:"mnemopiActive"}},"mnemopi.scoping":{type:"enum",default:"per-project",values:["global","per-project","per-project-tagged"],ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Scoping",description:"global = one shared bank; per-project = isolated bank per cwd; per-project-tagged = project-local writes plus global recall visibility",options:[{value:"global",label:"Global",description:"One shared Mnemopi bank for every project"},{value:"per-project",label:"Per project",description:"Project-local Mnemopi bank per cwd basename"},{value:"per-project-tagged",label:"Per project (tagged)",description:"Write to a project-local bank but merge project + shared recall results"}],condition:"mnemopiActive"}},"mnemopi.embeddingVariant":{type:"enum",default:"en",values:["en","multilingual"],ui:{tab:"memory",group:"Mnemopi",label:"Embedding variant",description:"Local embedding model family. en = stronger English model; multilingual = cross-language model. Changing this rebuilds existing memory embeddings on next start.",options:[{value:"en",label:"English (bge-base-en-v1.5)",description:"BAAI/bge-base-en-v1.5 (768d), English-only"},{value:"multilingual",label:"Multilingual (multilingual-e5-large)",description:"intfloat/multilingual-e5-large (1024d), cross-language recall"}],condition:"mnemopiActive"}},"mnemopi.autoRecall":{type:"boolean",default:!0,ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Auto Recall",description:"Recall local memories into the first turn of each session",condition:"mnemopiActive"}},"mnemopi.autoRetain":{type:"boolean",default:!0,ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Auto Retain",description:"Retain completed conversation turns into local Mnemopi memory",condition:"mnemopiActive"}},"mnemopi.polyphonicRecall":{type:"boolean",default:!1,ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Polyphonic Recall",description:"Fuse recall with graph, fact, vector and temporal voices so linked memories surface without a keyword match",condition:"mnemopiActive"}},"mnemopi.enhancedRecall":{type:"boolean",default:!1,ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Enhanced Recall",description:"Cache recall results for repeated and similar queries with identical options; any memory write clears it",condition:"mnemopiActive"}},"mnemopi.proactiveLinking":{type:"boolean",default:!1,ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Proactive Linking",description:"Ingest new memories into the episodic graph as they are stored, linking them to related entities and memories",condition:"mnemopiActive"}},"mnemopi.noEmbeddings":{type:"boolean",default:!1,ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Disable Embeddings",description:"Force deterministic FTS-only recall instead of vector embeddings",condition:"mnemopiActive"}},"mnemopi.embeddingModel":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Embedding Model",description:"Advanced: explicit embedding model id that overrides the variant. Leave empty to use mnemopi.embeddingVariant.",condition:"mnemopiActive"}},"mnemopi.embeddingApiUrl":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Embedding API URL",description:"Optional OpenAI-compatible embedding endpoint passed to Mnemopi",condition:"mnemopiActive"}},"mnemopi.embeddingApiKey":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi Embedding API Key",description:"Optional embedding API key passed to Mnemopi",condition:"mnemopiActive"}},"mnemopi.llmMode":{type:"enum",default:"smol",values:["none","smol","remote"],ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi LLM Mode",description:"Use no LLM, the online tiny model (the TINY role from /models, else @smol), or a remote OpenAI-compatible endpoint",condition:"mnemopiActive",options:[{value:"none",label:"None",description:"Disable Mnemopi LLM-backed extraction"},{value:"smol",label:"Online (tiny)",description:"Use the online tiny model (the TINY role from /models, else @smol)"},{value:"remote",label:"Remote",description:"Use the Mnemopi remote LLM settings below"}]}},"mnemopi.llmBaseUrl":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi LLM Base URL",description:"Optional OpenAI-compatible LLM endpoint for Mnemopi remote mode",condition:"mnemopiActive"}},"mnemopi.llmApiKey":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi LLM API Key",description:"Optional LLM API key for Mnemopi remote mode",condition:"mnemopiActive"}},"mnemopi.llmModel":{type:"string",ui:{tab:"memory",group:"Mnemopi",label:"Mnemopi LLM Model",description:"Optional LLM model name for Mnemopi remote mode",condition:"mnemopiActive"}},"hindsight.apiUrl":{type:"string",default:"http://localhost:8888",ui:{tab:"memory",group:"Hindsight",label:"Hindsight API URL",description:"Hindsight server URL (Cloud or self-hosted)",condition:"hindsightActive"}},"hindsight.apiToken":{type:"string",ui:{tab:"memory",group:"Hindsight",label:"Hindsight API Token",description:"Bearer token for authenticated Hindsight servers",condition:"hindsightActive"}},"hindsight.bankId":{type:"string",ui:{tab:"memory",group:"Hindsight",label:"Hindsight Bank ID",description:"Memory bank identifier (default: project name)",condition:"hindsightActive"}},"hindsight.scoping":{type:"enum",default:"per-project-tagged",values:["global","per-project","per-project-tagged"],ui:{tab:"memory",group:"Hindsight",label:"Hindsight Scoping",description:"global = one shared bank; per-project = isolated bank per cwd; per-project-tagged = shared bank with project tags so global + project memories merge on recall",options:[{value:"global",label:"Global",description:"One shared bank — every project sees the same memories"},{value:"per-project",label:"Per project",description:"Isolated bank per cwd basename — projects cannot see each other's memories"},{value:"per-project-tagged",label:"Per project (tagged)",description:"Shared bank, retains tagged with project:<cwd>. Recall surfaces project + untagged global memories together"}],condition:"hindsightActive"}},"hindsight.autoRecall":{type:"boolean",default:!0,ui:{tab:"memory",group:"Hindsight",label:"Hindsight Auto Recall",description:"Recall memories on the first turn of each session",condition:"hindsightActive"}},"hindsight.autoRetain":{type:"boolean",default:!0,ui:{tab:"memory",group:"Hindsight",label:"Hindsight Auto Retain",description:"Retain transcript every N turns and at session boundaries",condition:"hindsightActive"}},"hindsight.retainMode":{type:"enum",default:"full-session",values:["full-session","last-turn"],ui:{tab:"memory",group:"Hindsight",label:"Hindsight Retain Mode",description:"full-session = upsert one document per session, last-turn = chunked",options:[{value:"full-session",label:"Full session",description:"Upsert one document per session (recommended)"},{value:"last-turn",label:"Last turn",description:"Chunked retention sliced by turn boundaries"}],condition:"hindsightActive"}},"hindsight.mentalModelsEnabled":{type:"boolean",default:!0,ui:{tab:"memory",group:"Hindsight",label:"Hindsight Mental Models",description:"Read curated reflect summaries (mental models) into developer instructions at boot. Loads existing models on the bank — does not write. Pair with hindsight.mentalModelAutoSeed to also auto-create the built-in seed set.",condition:"hindsightActive"}},"hindsight.mentalModelAutoSeed":{type:"boolean",default:!0,ui:{tab:"memory",group:"Hindsight",label:"Hindsight Mental Model Auto-Seed",description:"At session start, create any built-in mental models (project-conventions, project-decisions, user-preferences) that do not yet exist on the bank.",condition:"hindsightActive"}},"ttsr.enabled":{type:"boolean",default:!0,ui:{tab:"context",group:"Rules (TTSR)",label:"TTSR",description:"Interrupt the agent mid-stream when output matches rule patterns (Time-Traveling Stream Rules)"}},"ttsr.judge":{type:"enum",default:"auto",values:["auto","on","off"],ui:{tab:"context",group:"Rules (TTSR)",label:"Judged Rules",description:"Ask the judge model role each `question` rule about completed replies, reasoning, and tool calls; a yes injects the rule as a warning",options:[{value:"auto",label:"Auto",description:"Judge only when the judge role resolves to a native TypeSafe jev model"},{value:"on",label:"On",description:"Always judge, whichever model the judge role resolves to"},{value:"off",label:"Off",description:"Never judge; question rules stay inactive"}]}},"ttsr.contextMode":{type:"enum",default:"discard",values:["discard","keep"],ui:{tab:"context",group:"Rules (TTSR)",label:"TTSR Context Mode",description:"What to do with partial output when TTSR triggers"}},"ttsr.interruptMode":{type:"enum",default:"always",values:["never","prose-only","tool-only","always"],ui:{tab:"context",group:"Rules (TTSR)",label:"TTSR Interrupt Mode",description:"When to interrupt mid-stream vs inject warning after completion",options:[{value:"always",label:"always",description:"Interrupt on prose and tool streams"},{value:"prose-only",label:"prose-only",description:"Interrupt only on reply/thinking matches"},{value:"tool-only",label:"tool-only",description:"Interrupt only on tool-call argument matches"},{value:"never",label:"never",description:"Never interrupt; inject warning after completion"}]}},"ttsr.repeatMode":{type:"enum",default:"once",values:["once","after-gap"],ui:{tab:"context",group:"Rules (TTSR)",label:"TTSR Repeat Mode",description:"How rules can repeat: once per session or after a message gap"}},"ttsr.repeatGap":{type:"number",default:10,ui:{tab:"context",group:"Rules (TTSR)",label:"TTSR Repeat Gap",description:"Messages before a rule can trigger again",options:[{value:"5",label:"5 messages"},{value:"10",label:"10 messages"},{value:"15",label:"15 messages"},{value:"20",label:"20 messages"},{value:"30",label:"30 messages"}]}},"ttsr.builtinRules":{type:"boolean",default:!0,ui:{tab:"context",group:"Rules (TTSR)",label:"Built-in Rules",description:"Load the default rules shipped with the agent (override individually with ttsr.disabledRules)"}},"ttsr.disabledRules":{type:"array",default:[],ui:{tab:"context",group:"Rules (TTSR)",label:"Disabled Rules",description:"Rule names to ignore entirely (applies to bundled defaults and your own rules)"}},"edit.mode":{type:"enum",default:"hashline",values:["apply_patch","hashline","patch","replace","sloppy"],ui:{tab:"files",group:"Editing",label:"Edit Mode",description:"Select the edit tool variant (replace, patch, hashline, or apply_patch)"}},"edit.fuzzyMatch":{type:"boolean",default:!0,ui:{tab:"files",group:"Editing",label:"Fuzzy Match",description:"Accept high-confidence fuzzy matches for whitespace differences"}},"edit.fuzzyThreshold":{type:"number",default:0.95,ui:{tab:"files",group:"Editing",label:"Fuzzy Match Threshold",description:"Similarity threshold (0-1) for accepting fuzzy matches",options:[{value:"0.85",label:"0.85",description:"Lenient"},{value:"0.90",label:"0.90",description:"Moderate"},{value:"0.95",label:"0.95",description:"Default"},{value:"0.98",label:"0.98",description:"Strict"}]}},"edit.streamingAbort":{type:"boolean",default:!1,ui:{tab:"files",group:"Editing",label:"Abort on Failed Preview",description:"Abort streaming edit tool calls when patch preview fails"}},"edit.recoverInlineEdits":{type:"boolean",default:!0,ui:{tab:"files",group:"Editing",label:"Recover Inline Edit Payloads",description:"Execute edit payloads the model emits as plain text by converting them into edit tool calls"}},"edit.blockAutoGenerated":{type:"boolean",default:!0,ui:{tab:"files",group:"Editing",label:"Block Auto-Generated Files",description:"Prevent editing of files that appear to be auto-generated (protoc, sqlc, swagger, etc.)"}},"edit.enforceSeenLines":{type:"boolean",default:!0,ui:{tab:"files",group:"Editing",label:"Enforce Seen-Line Guard",description:"Reject edits anchored on lines a prior read/search never displayed in full"}},"edit.blackbox.enabled":{type:"boolean",default:!1,ui:{tab:"files",group:"Editing",label:"Record Parse Regressions",description:"Append full before/after source when an edit introduces an AST parse failure"}},"edit.autoRepair.enabled":{type:"boolean",default:!1,ui:{tab:"files",group:"Editing",label:"Auto-Repair Parse Regressions",description:"When an edit breaks a file's AST parse, ask the smol model to fix the broken region (validated by re-parse; falls back to a warning)"}},"tools.artifactSpillThreshold":{type:"number",default:50,ui:{tab:"tools",group:"Output Limits",label:"Artifact Spill Threshold (KB)",description:"Tool output above this size is saved as an artifact; tail is kept inline",options:[{value:"1",label:"1 KB",description:"~250 tokens"},{value:"2.5",label:"2.5 KB",description:"~625 tokens"},{value:"5",label:"5 KB",description:"~1.25K tokens"},{value:"10",label:"10 KB",description:"~2.5K tokens"},{value:"20",label:"20 KB",description:"~5K tokens"},{value:"30",label:"30 KB",description:"~7.5K tokens"},{value:"50",label:"50 KB",description:"Default; ~12.5K tokens"},{value:"75",label:"75 KB",description:"~19K tokens"},{value:"100",label:"100 KB",description:"~25K tokens"},{value:"200",label:"200 KB",description:"~50K tokens"},{value:"500",label:"500 KB",description:"~125K tokens"},{value:"1000",label:"1 MB",description:"~250K tokens"}]}},"tools.artifactTailBytes":{type:"number",default:20,ui:{tab:"tools",group:"Output Limits",label:"Artifact Tail Size (KB)",description:"Amount of tail content kept inline when output spills to artifact",options:[{value:"1",label:"1 KB",description:"~250 tokens"},{value:"2.5",label:"2.5 KB",description:"~625 tokens"},{value:"5",label:"5 KB",description:"~1.25K tokens"},{value:"10",label:"10 KB",description:"~2.5K tokens"},{value:"20",label:"20 KB",description:"Default; ~5K tokens"},{value:"50",label:"50 KB",description:"~12.5K tokens"},{value:"100",label:"100 KB",description:"~25K tokens"},{value:"200",label:"200 KB",description:"~50K tokens"}]}},"tools.artifactHeadBytes":{type:"number",default:20,ui:{tab:"tools",group:"Output Limits",label:"Artifact Head Size (KB)",description:"Amount of head content kept inline alongside the tail when output spills to artifact (middle elision). 0 disables — keep tail only.",options:[{value:"0",label:"0 KB",description:"Disabled; tail-only truncation"},{value:"1",label:"1 KB",description:"~250 tokens"},{value:"2.5",label:"2.5 KB",description:"~625 tokens"},{value:"5",label:"5 KB",description:"~1.25K tokens"},{value:"10",label:"10 KB",description:"~2.5K tokens"},{value:"20",label:"20 KB",description:"Default; ~5K tokens"},{value:"50",label:"50 KB",description:"~12.5K tokens"},{value:"100",label:"100 KB",description:"~25K tokens"},{value:"200",label:"200 KB",description:"~50K tokens"}]}},"tools.outputMaxColumns":{type:"number",default:768,ui:{tab:"tools",group:"Output Limits",label:"Output Column Cap",description:"Per-line byte cap for streaming tool outputs (bash, python, js eval) and `read`. Lines wider than this are ellipsis-truncated; remaining bytes up to the next newline are dropped. 0 disables.",options:[{value:"0",label:"Off",description:"No per-line cap"},{value:"256",label:"256",description:"Tight"},{value:"512",label:"512"},{value:"768",label:"768",description:"Default"},{value:"1024",label:"1024"},{value:"2048",label:"2048"},{value:"4096",label:"4096",description:"Loose"}]}},"tools.artifactTailLines":{type:"number",default:500,ui:{tab:"tools",group:"Output Limits",label:"Artifact Tail Lines",description:"Maximum lines of tail content kept inline when output spills to artifact",options:[{value:"50",label:"50 lines",description:"~250 tokens"},{value:"100",label:"100 lines",description:"~500 tokens"},{value:"250",label:"250 lines",description:"~1.25K tokens"},{value:"500",label:"500 lines",description:"Default; ~2.5K tokens"},{value:"1000",label:"1000 lines",description:"~5K tokens"},{value:"2000",label:"2000 lines",description:"~10K tokens"},{value:"5000",label:"5000 lines",description:"~25K tokens"}]}},"tools.artifactMaxBytes":{type:"number",default:16,ui:{tab:"tools",group:"Output Limits",label:"Artifact File Cap (MB)",description:"Maximum size of the artifact file saved for streaming tool output (bash, python, js eval). Larger output keeps its beginning (up to 3 MB) and its most recent remainder, with a truncation notice between them. 0 = unlimited.",options:[{value:"0",label:"Unlimited",description:"Save the complete output"},{value:"4",label:"4 MB"},{value:"16",label:"16 MB",description:"Default"},{value:"64",label:"64 MB"},{value:"256",label:"256 MB"},{value:"1024",label:"1 GB"}]}},readLineNumbers:{type:"boolean",default:!1,ui:{tab:"files",group:"Reading",label:"Line Numbers",description:"Prepend line numbers to read tool output by default"}},"read.defaultLimit":{type:"number",default:300,ui:{tab:"files",group:"Reading",label:"Default Read Limit",description:"Default number of lines returned when agent calls read without a limit",options:[{value:"200",label:"200 lines"},{value:"300",label:"300 lines"},{value:"500",label:"500 lines"},{value:"1000",label:"1000 lines"},{value:"5000",label:"5000 lines"}]}},"read.renderMarkdown":{type:"boolean",default:!1,ui:{tab:"files",group:"Reading",label:"Markdown Previews",description:"Render Markdown read results as formatted terminal Markdown previews instead of raw source"}},"read.summarize.enabled":{type:"boolean",default:!0,ui:{tab:"files",group:"Read Summaries",label:"Read Summaries",description:"Return structural code summaries when read is called without an explicit selector"}},"read.summarize.prose":{type:"boolean",default:!1,ui:{tab:"files",group:"Read Summaries",label:"Prose Summaries",description:"Return structural summaries for Markdown and plain text reads"}},"read.summarize.minBodyLines":{type:"number",default:4,ui:{tab:"files",group:"Read Summaries",label:"Read Summary Body Lines",description:"Minimum multiline body or literal length before read summaries collapse it"}},"read.summarize.minCommentLines":{type:"number",default:6,ui:{tab:"files",group:"Read Summaries",label:"Read Summary Comment Lines",description:"Minimum multiline block comment length before read summaries collapse it"}},"read.summarize.minTotalLines":{type:"number",default:100,ui:{tab:"files",group:"Read Summaries",label:"Read Summary Minimum File Length",description:"Files with fewer total lines are read verbatim instead of structurally summarized"}},"read.summarize.unfoldUntil":{type:"number",default:50,ui:{tab:"files",group:"Read Summaries",label:"Read Summary Unfold Target",description:"BFS-unfold elidable spans until the summary is at least this many visible lines. 0 keeps only the outermost elisions."}},"read.summarize.unfoldLimit":{type:"number",default:100,ui:{tab:"files",group:"Read Summaries",label:"Read Summary Unfold Ceiling",description:"Hard ceiling on summary size while BFS-unfolding. An unfold whose revealed lines would exceed this is skipped (that span stays folded) and unfolding continues with the remaining spans."}},"read.toolResultPreview":{type:"boolean",default:!1,ui:{tab:"files",group:"Reading",label:"Inline Read Previews",description:"Render read tool results inline in the transcript instead of summary rows"}},"tools.approval":{type:"record",default:{},ui:{tab:"interaction",group:"Approvals",label:"Tool Approval Policies",description:"Per-tool approval policies. Set to 'allow' to auto-approve, 'prompt' to require confirmation, or 'deny' to block. Overrides are honored in every approval mode."}},"tools.approvalMode":{type:"enum",default:"yolo",values:["always-ask","always-ask-cached","write","yolo"],ui:{tab:"interaction",group:"Approvals",label:"Tool Approval",description:"Default approval behavior for tool calls. 'Always ask' auto-approves read-only tools only. 'Ask and remember' also asks before file reads, and can remember a file or folder. 'Write' auto-approves read and workspace-write tools. 'Yolo' auto-approves all tiers; user policy may still prompt or block.",options:[{value:"always-ask",label:"Always ask",description:"Auto-approve read-only tools; require confirmation for write and exec tools."},{value:"always-ask-cached",label:"Ask and remember",description:"Ask before reading or writing a file, with answers that remember the file or its folder for this session or every session; require confirmation for exec tools."},{value:"write",label:"Write",description:"Auto-approve read-only and write tools; require confirmation for exec tools such as bash, eval, browser, and task."},{value:"yolo",label:"Yolo",description:"Auto-approve read, write, and exec tools. User policy can still require confirmation or block calls."}]}},"todo.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Todos",description:"Enable the todo tool for task tracking"}},"todo.reminders":{type:"boolean",default:!0,ui:{tab:"tools",group:"Todos",label:"Todo Reminders",description:"Remind the agent to complete todos before stopping"}},"todo.remindersMax":{type:"number",default:3,ui:{tab:"tools",group:"Todos",label:"Todo Reminder Limit",description:"Maximum number of todo reminders before giving up",options:[{value:"1",label:"1 reminder"},{value:"2",label:"2 reminders"},{value:"3",label:"3 reminders"},{value:"5",label:"5 reminders"}]}},"todo.eager":{type:"enum",default:"default",values:["default","preferred","always"],ui:{tab:"tools",group:"Todos",label:"Create Todos Automatically",description:"How strongly to push automatic todo-list creation after the first message",options:[{value:"default",label:"Default",description:"Model decides; no automatic todo list"},{value:"preferred",label:"Preferred",description:"Suggests a todo list on the first message (reminder, not forced)"},{value:"always",label:"Always",description:"Forces a comprehensive todo list on the first message"}]}},"tasks.todoClearDelay":{type:"number",default:60,ui:{tab:"tools",group:"Todos",label:"Todo Auto-Clear Delay",description:"Delay before completed or abandoned todos are removed from the todo widget",options:[{value:"0",label:"Instant"},{value:"60",label:"1 minute",description:"Default"},{value:"300",label:"5 minutes"},{value:"900",label:"15 minutes"},{value:"1800",label:"30 minutes"},{value:"3600",label:"1 hour"},{value:"-1",label:"Never"}]}},"glob.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Glob",description:"Enable the glob tool for glob-based file lookup"}},"grep.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Grep",description:"Enable the grep tool for regex content search"}},"grep.contextBefore":{type:"number",default:1,ui:{tab:"tools",group:"Grep & Browser",label:"Grep Context Before",description:"Lines of context before each grep match",options:[{value:"0",label:"0 lines"},{value:"1",label:"1 line"},{value:"2",label:"2 lines"},{value:"3",label:"3 lines"},{value:"5",label:"5 lines"}]}},"grep.contextAfter":{type:"number",default:3,ui:{tab:"tools",group:"Grep & Browser",label:"Grep Context After",description:"Lines of context after each grep match",options:[{value:"0",label:"0 lines"},{value:"1",label:"1 line"},{value:"2",label:"2 lines"},{value:"3",label:"3 lines"},{value:"5",label:"5 lines"},{value:"10",label:"10 lines"}]}},"astGrep.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"AST Grep",description:"Enable the ast_grep tool for structural AST search"}},"astEdit.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"AST Edit",description:"Enable the ast_edit tool for structural AST rewrites"}},"find.enabled":{type:"enum",default:"auto",values:["auto","on","off"],ui:{tab:"tools",group:"Available Tools",label:"Find (semantic grep)",description:"Enable the find tool: natural-language search for files and line ranges, judged by the judge model role. Auto enables it only when the judge role resolves to a native TypeSafe jev model",options:[{value:"auto",label:"Auto",description:"Enable when the judge role resolves to a native TypeSafe jev model"},{value:"on",label:"On",description:"Always enable, whichever model the judge role resolves to"},{value:"off",label:"Off",description:"Disable the find tool"}]}},"debug.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Debug",description:"Enable the debug tool for DAP-based debugging"}},"launch.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Services",description:"Enable named bash services and proc:// supervision for shared long-running project processes"}},"speechgen.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"Speech Generation",description:"Enable the tts tool for on-device (Kokoro) or xAI Grok Voice speech-file synthesis"}},"generate_image.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"Generate Image",description:"Enable the generate_image tool (text-to-image generation and editing). Exposed as an xd:// device when tools.xdev is on."}},"computer.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"Computer",description:"Enable the scriptable host-desktop eval prelude (screenshots, input, accessibility)"}},"ratchet.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"Ratchet",description:"Enable the ratchet eval/hillclimb prelude; /ratchet turns it on for the current session"}},"archive.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Archive",description:"Enable the read-only archive eval prelude: prompt history, recent projects, past sessions and recaps"}},"computer.display":{type:"string",default:"active",ui:{tab:"tools",group:"Computer",label:"Computer Display",description:"Active window's display (active), all displays (all), or a native display id"}},"computer.maxWidth":{type:"number",default:3840,ui:{tab:"tools",group:"Computer",label:"Computer Screenshot Width",description:"Maximum screenshot width in pixels"}},"computer.maxHeight":{type:"number",default:2400,ui:{tab:"tools",group:"Computer",label:"Computer Screenshot Height",description:"Maximum screenshot height in pixels"}},"computer.backgroundFallback":{type:"enum",default:"takeover",values:["takeover","refuse"],ui:{tab:"tools",group:"Computer",label:"Computer Background Fallback",description:"What window input does when its background route is unavailable: rerun it in takeover and return focus to your app (macOS; elsewhere plain takeover), or refuse, which also keeps the agent from taking the foreground or opening macOS menus itself",options:[{value:"takeover",label:"Takeover",description:"Briefly bring the target forward for that one call, then return focus to your app (on macOS even if you kept typing)"},{value:"refuse",label:"Refuse",description:"Fail the call; nothing takes over, and the agent's own takeover, raise, activating open, desktop input and macOS menus (context menus, popup and menu buttons; they take your keyboard while open) are refused too"}]}},"images.questionTimeoutMs":{type:"number",default:300000,ui:{tab:"tools",group:"Execution",label:"Image Question Timeout",description:"Per-request timeout for the vision-model call behind read's ?q= image questions, in milliseconds. A stalled provider fails fast with a timeout error instead of blocking until manual abort. Set to 0 to disable the timeout.",options:[{value:"0",label:"Disabled"},{value:"60000",label:"1 minute"},{value:"120000",label:"2 minutes"},{value:"180000",label:"3 minutes"},{value:"300000",label:"5 minutes"}]}},"checkpoint.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"Checkpoint/Rewind",description:"Enable the checkpoint and rewind tools for context checkpointing"}},"fetch.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Read URLs",description:"Allow the read tool to fetch and process URLs"}},"vault.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"Obsidian Vault",description:"Enable the vault:// internal URL for reading and editing Obsidian vault content via the Obsidian CLI. When disabled, vault:// resolution is refused and the vault:// entry is omitted from the system prompt."}},"github.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"GitHub CLI",description:"Enable the github tool (op-based dispatch for repository, issue, pull request, diff, search, checkout, push, and Actions watch workflows)"}},"github.cache.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"GitHub",label:"GitHub View Cache",description:"Cache rendered issue/PR view output in ~/.omp/cache/github-cache.db so repeated reads are free"}},"github.cache.softTtlSec":{type:"number",default:300,ui:{tab:"tools",group:"GitHub",label:"GitHub Cache Soft TTL",description:"Within this window, cached issue/PR view rows are returned directly (seconds; default 5 minutes)"}},"github.cache.hardTtlSec":{type:"number",default:604800,ui:{tab:"tools",group:"GitHub",label:"GitHub Cache Hard TTL",description:"Past the soft TTL the cached row is returned and refreshed in the background; past the hard TTL it is dropped (seconds; default 7 days)"}},"web_search.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Web Search",description:"Enable the web_search tool for live web results"}},"security.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Available Tools",label:"Security",description:"Enable OMP-native security scan planning, execution, and the read-only security:// resource namespace"}},"ask.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Ask",description:"Enable the ask tool for interactive user questions"}},"tools.intentTracing":{type:"boolean",default:!0,ui:{tab:"tools",group:"Execution",label:"Intent Tracing",description:"Ask the agent to describe the intent of each tool call before executing it"}},"tools.abortOnFabricatedResult":{type:"boolean",default:!0,ui:{tab:"tools",group:"Execution",label:"Abort On Fabricated Tool Result",description:"With in-band tool calls, stop the model immediately when it starts hallucinating a tool result mid-turn. Disable to let the model finish generating and discard the fabricated continuation instead."}},"tools.speculativeExecution.enabled":{type:"boolean",default:!1,ui:{tab:"tools",group:"Execution",label:"Experimental Speculative Execution",description:"Enable the discard-safe first slice: validated local reads through direct read calls and nested eval. Network requests, provider completions, and live filesystem writes are not part of this baseline."}},"tools.speculativeExecution.maxInFlight":{type:"number",default:2,ui:{tab:"tools",group:"Execution",label:"Speculative Execution Concurrency",description:"Maximum number of validated local reads allowed to run before normal dispatch.",options:[{value:"1",label:"1 operation"},{value:"2",label:"2 operations"},{value:"3",label:"3 operations"},{value:"4",label:"4 operations"}]}},"tools.maxTimeout":{type:"number",default:0,ui:{tab:"tools",group:"Execution",label:"Max Tool Timeout",description:"Maximum timeout in seconds the agent can set for any tool (0 = no limit)",options:[{value:"0",label:"No limit"},{value:"30",label:"30 seconds"},{value:"60",label:"60 seconds"},{value:"120",label:"120 seconds"},{value:"300",label:"5 minutes"},{value:"600",label:"10 minutes"}]}},"async.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Execution",label:"Async Execution",description:"Enable async bash commands and background task execution"}},"async.widgets":{type:"boolean",default:!0,ui:{tab:"tools",group:"Execution",label:"Live Job Widgets",description:"Draw a live widget for each running background job (charts, bars, status grids derived from its output) in the wait card, the jobs pill and the jobs sheet. The `widget` model role (default: `smol`) writes one spec per job; updates need no further model calls"}},"tools.xdev":{type:"boolean",default:!0,ui:{tab:"tools",group:"Discovery & MCP",label:"xd:// Tools",description:"Mount rarely-used (discoverable) tools under xd:// device URLs driven via read/write instead of shipping their schemas on every request. Sessions whose explicit tool list grants read but omits write mount devices through a device-only write transport (only local:// scratch stays writable besides devices). Disable to expose every enabled tool top-level."}},"tools.xdevDocs":{type:"enum",default:"catalog",values:["inline","builtins","catalog"],ui:{tab:"tools",group:"Discovery & MCP",label:"xd:// Prompt Docs",description:"Choose which mounted-device docs and schemas are inlined in the system prompt. Built-ins keeps core tools inline while MCP and extension tools stay on-demand.",options:[{value:"inline",label:"All Devices",description:"Inline docs and schemas for every mounted device."},{value:"builtins",label:"Built-ins Only",description:"Inline built-in docs; fetch MCP and extension docs on demand."},{value:"catalog",label:"Catalog Only",description:"List every device; fetch all docs on demand."}]}},"tools.xdevInlineDevices":{type:"array",default:[],ui:{tab:"tools",group:"Discovery & MCP",label:"xd:// Inline Devices",description:"When xd:// Prompt Docs is Built-ins Only, inline dynamic devices whose names match these glob patterns (for example mcp__context_mode_*). Catalog Only ignores this setting."}},"dev.autoqa":{type:"boolean",default:!0,ui:{tab:"tools",group:"Developer",label:"Auto QA",description:"Automated tool issue reporting (xd://report_issue). On by default; the first report asks for consent, and denying it disables reporting until re-enabled explicitly"}},"dev.autoqaPush.endpoint":{type:"string",default:"https://qa.omp.sh/v1/grievances",ui:{tab:"tools",group:"Developer",label:"Auto QA Push Endpoint",description:"Full URL receiving Auto QA JSON reports (default https://qa.omp.sh/v1/grievances)"}},"lsp.enabled":{type:"boolean",default:!0,ui:{tab:"files",group:"LSP",label:"LSP",description:"Enable the lsp tool for code intelligence (definitions, references, diagnostics, rename)"}},"lsp.lazy":{type:"boolean",default:!0,ui:{tab:"files",group:"LSP",label:"Lazy LSP Startup",description:"Start language servers on first use (lsp tool or editing a matching file type) instead of at session startup"}},"lsp.shared":{type:"boolean",default:!0,ui:{tab:"files",group:"LSP",label:"Shared Language Servers",description:"Start language servers through the per-project daemon broker. Each connection gets its own server. While another omp instance in the project is running, a released server stays warm and the next connection reuses it instead of cold-starting (falls back to private servers when unavailable)"}},"lsp.formatOnWrite":{type:"boolean",default:!1,ui:{tab:"files",group:"LSP",label:"Format on Write",description:"Automatically format code files using LSP after writing"}},"lsp.diagnosticsOnWrite":{type:"boolean",default:!0,ui:{tab:"files",group:"LSP",label:"Diagnostics on Write",description:"Return LSP diagnostics after writing code files"}},"lsp.diagnosticsOnEdit":{type:"boolean",default:!1,ui:{tab:"files",group:"LSP",label:"Diagnostics on Edit",description:"Return LSP diagnostics after editing code files"}},"lsp.diagnosticsDeduplicate":{type:"boolean",default:!0,ui:{tab:"files",group:"LSP",label:"Deduplicate Diagnostics",description:"Suppress post-edit LSP diagnostics already shown for a file; only surface new or changed ones"}},"lsp.requestTimeout":{type:"number",default:10,ui:{tab:"files",group:"LSP",label:"Request Timeout",description:"Seconds to wait for a language server's diagnostics, hover and other answers when the agent sets no timeout; late post-edit diagnostics wait at least this long. Raise it for servers that are slow on a cold start. The lsp tool's timeout argument can still raise or lower it per call",options:[{value:"10",label:"10 seconds",description:"Default"},{value:"20",label:"20 seconds"},{value:"30",label:"30 seconds"},{value:"60",label:"1 minute"},{value:"120",label:"2 minutes"},{value:"300",label:"5 minutes"}]}},"bash.enabled":{type:"boolean",default:!0,ui:{tab:"shell",group:"Bash",label:"Bash",description:"Enable the bash tool for shell command execution"}},"bash.allowCompoundCommands":{type:"boolean",default:!1,ui:{tab:"shell",group:"Bash",label:"Allow Compound Commands",description:"Evaluate literal && chains per command; unmatched commands use normal bash approval policy and mode"}},"bash.autoBackground.enabled":{type:"boolean",default:!0,ui:{tab:"shell",group:"Bash",label:"Bash Auto-Background",description:"Automatically background long-running bash commands and deliver the result later"}},"bash.gitGuard":{type:"boolean",default:!1,ui:{tab:"shell",group:"Bash",label:"Git Guard",description:"Refuse git commands that discard or move shared work in the bash tool: stash, reset --hard or to another commit, and checkout/switch/restore outside a merge or rebase conflict"}},"bash.patterns":{type:"array",default:[],ui:{tab:"shell",group:"Bash",label:"Bash Approval Patterns",description:"Ordered bash command approval rules. Each item has match and approval fields; only '*' wildcards are supported."}},"bashInterceptor.enabled":{type:"boolean",default:!1,ui:{tab:"shell",group:"Bash",label:"Bash Interceptor",description:"Block shell commands that have dedicated tools"}},"bash.direnv":{type:"enum",default:"auto",values:["auto","off"],ui:{tab:"shell",group:"Bash",label:"direnv Auto-Load",description:"Auto-load a repo's direnv/devenv `.envrc` into the bash session so devenv tools and env vars are present without manual `direnv exec`. Honors direnv's allow list: an `.envrc` you haven't `direnv allow`ed is never executed"}},"bash.direnvLoadTimeoutMs":{type:"number",default:30000,ui:{tab:"shell",group:"Bash",label:"direnv Load Timeout (ms)",description:"Max wait for the first `direnv export` (a cold devenv shell can be slow); on timeout the session runs without the direnv env"}},"shellMinimizer.enabled":{type:"boolean",default:!0,ui:{tab:"shell",group:"Bash",label:"Shell Minimizer",description:"Compress verbose shell output (git, npm, cargo, etc.) before returning it to the agent"}},"shellMinimizer.sourceOutlineLevel":{type:"enum",default:"default",values:["default","aggressive"],ui:{tab:"shell",group:"Bash",label:"Shell Minimizer Source Outline",description:"Source outline mode for cat/read of source files: default or aggressive"}},"eval.py":{type:"boolean",default:!0,ui:{tab:"shell",group:"Eval & Runtimes",label:"Python Eval Backend",description:"Allow the eval tool to dispatch Python cells to the IPython kernel"}},"eval.js":{type:"boolean",default:!0,ui:{tab:"shell",group:"Eval & Runtimes",label:"JavaScript Eval Backend",description:"Allow the eval tool to dispatch JavaScript cells to the in-process runtime"}},"eval.autoProvision":{type:"boolean",default:!0,ui:{tab:"shell",group:"Eval & Runtimes",label:"Eval Environment Provisioning",description:"Automatically create the managed JavaScript eval package environment on first install"}},"eval.tools.enabled":{type:"boolean",default:!0,ui:{tab:"shell",group:"Eval & Runtimes",label:"Eval-Defined Tools",description:"Let eval cells define tools (@tool in Python, tool(fn) in JS) that task, agent(), and workpool() subagents can call"}},"eval.workpool.freshAgents":{type:"boolean",default:!1,ui:{tab:"shell",group:"Eval & Runtimes",label:"Fresh Workpool Agents",description:"Spawn a new subagent for every workpool item instead of reusing workers or batching queued items"}},"eval.autoBackground.enabled":{type:"boolean",default:!1,ui:{tab:"shell",group:"Eval & Runtimes",label:"Eval Auto-Background",description:"Automatically background long-running eval cells and deliver the result later"}},"python.kernelMode":{type:"enum",default:"session",values:["session","per-call"],ui:{tab:"shell",group:"Eval & Runtimes",label:"Python Kernel Mode",description:"Keep the IPython kernel alive across eval calls or start fresh each time"}},"python.interpreter":{type:"string",default:"",ui:{tab:"shell",group:"Eval & Runtimes",label:"Python Interpreter",description:"Optional path to an exact Python executable. When set, automatic Python runtime discovery is skipped."}},"task.isolation.enabled":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Isolation",label:"Allow Isolated Subagents",description:"Allow per-task isolation with `isolated: true`; tasks without it run in the shared checkout"}},"isolation.backend":{type:"enum",default:"auto",values:["auto","apfs","btrfs","zfs","reflink","overlayfs","projfs","block-clone","rcopy"],ui:{tab:"tasks",group:"Isolation",label:"Isolation Backend",description:"Backend used for subagent isolation and worktree cloning",options:[{value:"auto",label:"Auto",description:"Let the PAL pick the best available backend"},{value:"apfs",label:"APFS",description:"macOS clonefile reflink (APFS)"},{value:"btrfs",label:"btrfs",description:"btrfs subvolume snapshot"},{value:"zfs",label:"ZFS",description:"ZFS snapshot + clone"},{value:"reflink",label:"Reflink",description:"Linux FICLONE per-file reflink"},{value:"overlayfs",label:"Overlayfs",description:"Linux kernel overlay (or fuse-overlayfs fallback)"},{value:"projfs",label:"ProjFS",description:"Windows Projected File System"},{value:"block-clone",label:"Block clone",description:"Windows FSCTL_DUPLICATE_EXTENTS_TO_FILE (NTFS/ReFS)"},{value:"rcopy",label:"Recursive copy",description:"git worktree if available, otherwise recursive copy"}]}},"worktree.clone":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Isolation",label:"Clone Checkout into Worktrees",description:"New worktrees from `github pr_checkout` and `git worktree add` in bash start as a copy-on-write clone of the current checkout so ignored build artifacts (node_modules, target) carry over; falls back to a plain checkout when the filesystem cannot clone"}},"worktree.cleanSource":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Isolation",label:"Clean Source Checkout on /wt",description:"When creating a worktree with `/wt`, reset tracked changes and remove untracked files from the original checkout after carrying them over"}},"worktree.onStart":{type:"enum",default:"off",values:["off","ask","create"],ui:{tab:"tasks",group:"Isolation",label:"Worktree on Start",description:"Whether fresh interactive sessions start in a new linked worktree",options:[{value:"off",label:"Off",description:"Start in the current checkout"},{value:"ask",label:"Ask",description:"Ask at session start"},{value:"create",label:"Create",description:"Always start in a new worktree on a `wt/*` branch"}]}},"worktree.onExit":{type:"enum",default:"keep",values:["keep","ask","remove"],ui:{tab:"tasks",group:"Isolation",label:"Worktree on Exit",description:"What to do on exit with worktrees created since omp started (on start or with `/wt`)",options:[{value:"keep",label:"Keep",description:"Leave worktrees in place"},{value:"ask",label:"Ask",description:"Ask on exit"},{value:"remove",label:"Remove",description:"Remove clean worktrees; ask when they have uncommitted changes or new commits. Gitignored files (e.g. `.env`) are deleted too"}]}},"task.isolation.apply":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Isolation",label:"Apply Isolated Changes",description:"Automatically apply successful isolated task changes to the parent checkout; disable to retain patch or branch artifacts"}},"task.isolation.merge":{type:"enum",default:"patch",values:["patch","branch"],ui:{tab:"tasks",group:"Isolation",label:"Isolation Merge Strategy",description:"How isolated task changes are integrated (patch apply or branch merge)",options:[{value:"patch",label:"Patch",description:"Combine diffs and git apply"},{value:"branch",label:"Branch",description:"Commit per task, merge with --no-ff"}]}},"task.isolation.commits":{type:"enum",default:"generic",values:["generic","ai"],ui:{tab:"tasks",group:"Isolation",label:"Isolation Commit Style",description:"Commit message style for nested repo changes (generic or AI-generated)",options:[{value:"generic",label:"Generic",description:"Static commit message"},{value:"ai",label:"AI",description:"AI-generated commit message from diff"}]}},"worktree.base":{type:"string",ui:{tab:"tasks",group:"Isolation",label:"Worktree Base Directory",description:"Base directory for agent-managed worktrees — task-isolation copies, `github` PR checkouts, and `omp worktree` cleanup all live here. Unset uses ~/.omp/wt. Must be an absolute or ~-relative path; relative paths are ignored. The OMP_WORKTREE_DIR env var overrides this."}},"task.eager":{type:"enum",default:"default",values:["default","preferred","always"],ui:{tab:"tasks",group:"Subagents",label:"Prefer Task Delegation",description:"How strongly to push delegating work to subagents",options:[{value:"default",label:"Default",description:"Uses the selected model's policy; some models require an explicit delegation request"},{value:"preferred",label:"Preferred",description:"Adds delegation guidance to the system prompt"},{value:"always",label:"Always",description:"Prompt guidance plus a first-turn delegation reminder"}]}},"task.batch":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Subagents",label:"Batch Task Calls",description:"Switch the task tool to its batch shape: one call carries { context, tasks[] } — one subagent per item, with an optional per-item agent (defaulting to the session spawn-policy agent), per-item isolation, and a required shared context prepended to every assignment. With async.enabled=true, each spawn runs as an independent background agent with the normal idle/parked lifecycle; otherwise the call blocks for merged results. Disable to restore the flat single-spawn schema."}},"task.structured":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Subagents",label:"Structured Task Results",description:"Expose outputSchema/schemaMode on the task tool and return subagent results through the yield tool, validated against caller or agent output schemas. Off: task subagents have no yield tool and return their final message as plain text, except agents whose definition sets structured: true. Eval agent()/workpool spawns always keep structured results."}},"task.speculativeLaunch":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Subagents",label:"Speculative Task Launch",description:"Start each batch subagent as soon as its tasks[] item finishes streaming instead of waiting for the whole task call. Launched agents are aborted if the finished call fails validation, is blocked, or its arguments change. Requires auto-allowed task approval and no extension tool lifecycle handlers."}},"task.enableEffort":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Subagents",label:"Per-Task Effort",description:"Expose the optional effort parameter on task spawns, allowing callers to override each subagent's thinking level"}},"task.maxConcurrency":{type:"number",default:32,ui:{tab:"tasks",group:"Subagents",label:"Max Concurrent Tasks",description:"Maximum number of subagents running concurrently",options:[{value:"0",label:"Unlimited"},{value:"1",label:"1 task"},{value:"2",label:"2 tasks"},{value:"4",label:"4 tasks"},{value:"8",label:"8 tasks"},{value:"16",label:"16 tasks"},{value:"32",label:"32 tasks"},{value:"64",label:"64 tasks"}]}},"task.enableLsp":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Subagents",label:"LSP in Subagents",description:"Allow subagents spawned via the task tool to use the lsp tool. Off by default to keep subagents cheap; enable when LSP-aware delegation is worth the extra tokens."}},"task.maxRecursionDepth":{type:"number",default:2,ui:{tab:"tasks",group:"Subagents",label:"Max Task Recursion",description:"How many levels deep subagents can spawn their own subagents",options:[{value:"-1",label:"Unlimited"},{value:"0",label:"None"},{value:"1",label:"Single"},{value:"2",label:"Double"},{value:"3",label:"Triple"}]}},"task.maxRuntimeMs":{type:"number",default:0,ui:{tab:"tasks",group:"Subagents",label:"Max Subagent Runtime",description:"Hard wall-clock limit per subagent (ms). 0 disables it. Defense-in-depth against provider-side stream hangs that escape the inference-layer watchdog; triggers a normal subagent abort with a 'timed out' reason.",options:[{value:"0",label:"Unlimited",description:"Default"},{value:"300000",label:"5 minutes"},{value:"900000",label:"15 minutes"},{value:"1800000",label:"30 minutes"},{value:"3600000",label:"1 hour"}]}},"task.completionProbe":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Subagents",label:"Subagent Completion Probe",description:"Ask a working subagent, through a cached side request like /btw, to estimate how complete its task is: after 2, 5, 10 and 30 more minutes, then hourly. The estimate shows next to the subagent in wait and task views. Only subagents spawned by the main agent of an interactive session are asked; print, RPC, ACP and SDK runs never probe."}},"task.agentIdleTtlMs":{type:"number",default:420000,ui:{tab:"tasks",group:"Subagents",label:"Agent Idle TTL",description:"How long an idle subagent stays live in memory before being parked to disk (ms). Parked agents are revived automatically when messaged or resumed. 0 keeps idle agents live until exit."}},"task.softRequestBudget":{type:"number",default:200,ui:{tab:"tasks",group:"Subagents",label:"Soft Subagent Request Budget",description:"Soft per-subagent request budget (assistant requests per run). Crossing it injects a wrap-up steering notice (see task.softRequestBudgetNotice); at 1.5x the budget the run is force-stopped and the agent must hand back its partial findings. 0 disables the guard. Bundled scout/sonic agents cap out at a lower built-in budget, so a value below that cap still applies to them. A task.agentSoftRequestBudget entry replaces this budget for the agent it names.",options:[{value:"0",label:"Disabled"},{value:"90",label:"90 requests"},{value:"150",label:"150 requests"},{value:"200",label:"200 requests",description:"Default"}]}},"task.softRequestBudgetNotice":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Subagents",label:"Soft Request Budget Notice",description:"Inject one steering notice when a subagent crosses its soft request budget, asking it to wrap up before the 1.5x forced-yield stop."}},"task.maxEffort":{type:"enum",default:"max",values:["minimal","low","medium","high","xhigh","max"],ui:{tab:"tasks",group:"Subagents",label:"Maximum Per-Spawn Effort",description:"Maximum reasoning effort allowed for the task tool's per-spawn effort hint. Lower values prevent callers from escalating subagents above this ceiling; the default preserves the model's full range.",options:[{value:"minimal",label:"min",description:"Very brief reasoning (~1k tokens)"},{value:"low",label:"low",description:"Light reasoning (~2k tokens)"},{value:"medium",label:"medium",description:"Moderate reasoning (~8k tokens)"},{value:"high",label:"high",description:"Deep reasoning (~16k tokens)"},{value:"xhigh",label:"xhigh",description:"Extended reasoning (~32k tokens)"},{value:"max",label:"max",description:"Maximum reasoning the model supports"}]}},"task.prewalk":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Subagents",label:"Generic Task Prewalk",description:"Arm prewalk for the bundled generic `task` subagent: it starts on its resolved model, plans and begins the implementation, then hands off to the 'smol' role at its first edit/write. Per-agent overrides (task.agentPrewalk, configured from the /agents hub) and user agent `prewalk` frontmatter apply regardless of this toggle."}},"task.showResolvedModelBadge":{type:"boolean",default:!1,ui:{tab:"appearance",group:"Display",label:"Show Resolved Model Badge",description:"Display the actual model ID used by each subagent in the task widget status line"}},"plan.enabled":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Modes",label:"Plan Mode",description:"Enable plan mode for read-only exploration and planning before execution"}},"plan.defaultOnStartup":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Modes",label:"Start in Plan Mode",description:"Automatically enter plan mode at the start of every new session",condition:"planModeEnabled"}},"plan.autosave":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Modes",label:"Autosave Plans",description:"Automatically save approved plans to disk when plan mode completes",condition:"planModeEnabled"}},"plan.autosaveDir":{type:"string",ui:{tab:"tasks",group:"Modes",label:"Autosave Directory",description:"Directory for autosaved plans. Supports ~, absolute, and cwd-relative paths. Empty uses <project>/.omp/plans/.",condition:"planAutosaveEnabled"}},"goal.enabled":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Modes",label:"Goal Mode",description:"Enable per-session goal mode and the hidden goal tool"}},"goal.statusInFooter":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Modes",label:"Goal Status in Footer",description:"Show token budget alongside the goal indicator in the status line"}},"goal.continuationModes":{type:"array",default:["interactive"],ui:{tab:"tasks",group:"Modes",label:"Goal Continuation Modes",description:'Run modes where active goals may auto-continue between turns ("interactive", "rpc")'}},"title.icons":{type:"enum",default:"nf+emoji",values:["nf+emoji","emoji","boring"],ui:{tab:"appearance",group:"Display",label:"Title Icons",description:"Icon and short code that head new generated or /rename session titles",options:[{value:"nf+emoji",label:"Nerd Font + Emoji",description:"Nerd Font glyph where the Nerd Font symbol preset renders it, else the emoji (default)"},{value:"emoji",label:"Emoji",description:"Always the emoji"},{value:"boring",label:"Boring",description:"Plain title: no icon or code"}]}},"title.generator":{type:"enum",default:"fork",values:["fork","tiny"],ui:{tab:"tasks",group:"Modes",label:"Title Generator",description:"What names an untitled session from the user's messages",options:[{value:"fork",label:"Fork",description:"A side turn of the reply on the session's model: reads its prompt cache, adds the card icon (default)"},{value:"tiny",label:"Tiny",description:"The title model role only; plain titles without a card"}]}},"title.refreshOnReplan":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Modes",label:"Refresh Title on Replan",description:"Refresh generated session titles after todo init replans unless the title was set by the user"}},"skills.registryUrl":{type:"string",default:"https://skills.omp.sh",ui:{tab:"interaction",group:"Skills",label:"Skill Registry",description:"Skillshare registry used by `omp skill` to install, search, and publish skills (https://host[:port])"}},"skills.enableSkillCommands":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Commands & Skills",label:"Skill Commands",description:"Register skills as /skill:name commands"}},"commands.enableClaudeUser":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Commands & Skills",label:"Claude User Commands",description:"Load commands from ~/.claude/commands/"}},"commands.enableClaudeProject":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Commands & Skills",label:"Claude Project Commands",description:"Load commands from .claude/commands/"}},"commands.enableOpencodeUser":{type:"boolean",default:!1,ui:{tab:"tasks",group:"Commands & Skills",label:"OpenCode User Commands",description:"Load commands from ~/.config/opencode/commands/"}},"commands.enableOpencodeProject":{type:"boolean",default:!0,ui:{tab:"tasks",group:"Commands & Skills",label:"OpenCode Project Commands",description:"Load commands from .opencode/commands/"}},"extensionHandlers.toolCallTimeoutMs":{type:"number",default:30000,ui:{tab:"tools",group:"Extensions",label:"Tool Call Handler Timeout (ms)",description:"Positive finite active-work timeout for extension tool_call handlers; invalid values use 30000ms, and time awaiting OMP-owned dialogs does not count"}},"exa.enabled":{type:"boolean",default:!0,ui:{tab:"providers",group:"Services",label:"Exa",description:"Enable the Exa web search provider"}},"exa.searchDelayMs":{type:"number",default:1000,ui:{tab:"providers",group:"Services",label:"Exa Search Delay",description:"Minimum delay between Exa web search requests in milliseconds; set 0 to disable pacing"}},"searxng.endpoint":{type:"string",ui:{tab:"providers",group:"Services",label:"SearXNG Endpoint",description:"Base URL of a self-hosted SearXNG instance used for web search"}},"browser.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"Browser",description:"Enable the browser eval prelude for scripted Chromium automation (Puppeteer)"}},"browser.cdpUrl":{type:"string",ui:{tab:"tools",group:"Grep & Browser",label:"Browser CDP URL",description:"Default HTTP CDP discovery endpoint (for example http://127.0.0.1:9222) to attach to instead of launching a browser. Explicit app.cdp_url or app.path on the tool call take precedence."}},"browser.relay":{type:"boolean",default:!1,ui:{tab:"tools",group:"Grep & Browser",label:"Browser Relay",description:"Drive your own Chrome tabs through the omp browser relay. Install the extension once (`omp browser-relay install`); the relay server auto-starts when the browser prelude needs it. Takes precedence over Browser CDP URL; set PI_BROWSER_RELAY=0 or PI_BROWSER_RELAY=1 to override."}},"browser.relayUrl":{type:"string",ui:{tab:"tools",group:"Grep & Browser",label:"Browser Relay URL",description:"omp browser relay endpoint (default http://127.0.0.1:9224)."}},"browser.headless":{type:"boolean",default:!0,ui:{tab:"tools",group:"Grep & Browser",label:"Headless Browser",description:"Launch browser in headless mode (disable to show browser UI)"}},"browser.cmux":{type:"boolean",default:!0,ui:{tab:"tools",group:"Grep & Browser",label:"cmux Browser",description:"Use cmux WKWebView surfaces for browser automation when a cmux socket is available. Set PI_BROWSER_CMUX=0 or PI_BROWSER_CMUX=1 to override."}},"browser.tern":{type:"boolean",default:!0,ui:{tab:"tools",group:"Grep & Browser",label:"Tern Browser",description:"Inside a Tern pane, open browser tabs as picture-in-pictures over omp's pane (native web view) instead of headless Chromium; falls back to Chromium when no Tern window can host them. Explicit app options, the relay and Browser CDP URL take precedence; app.tern:false opts one open out. Set PI_BROWSER_TERN=0 or PI_BROWSER_TERN=1 to override."}},"browser.freezeOnTurnEnd":{type:"boolean",default:!0,ui:{tab:"tools",group:"Grep & Browser",label:"Freeze Browser Tabs On Turn End",description:"Freeze OMP-owned headless browser tabs when a turn settles so animated pages stop burning CPU/GPU while idle. Tabs unfreeze automatically on next use; pass persist:true on open to opt a tab out."}},"browser.idleCloseSec":{type:"number",default:1800,ui:{tab:"tools",group:"Grep & Browser",label:"Browser Idle Close Timeout",description:"Close OMP-owned headless browser tabs and Tern browser picture-in-pictures idle longer than this many seconds (0 = never; session dispose still reaps). Never touches relay/CDP/spawned browsers or other sessions' tabs.",options:[{value:"0",label:"Never"},{value:"900",label:"15 minutes"},{value:"1800",label:"30 minutes"},{value:"3600",label:"1 hour"}]}},"browser.screenshotDir":{type:"string",ui:{tab:"tools",group:"Grep & Browser",label:"Screenshot Directory",description:"Directory to save screenshots. If unset, screenshots go to a temp file. Supports ~. Examples: ~/Downloads, ~/Desktop, /sdcard/Download (Android)"}},"ida.enabled":{type:"boolean",default:!0,ui:{tab:"tools",group:"Available Tools",label:"IDA Pro",description:"Open executables read with `read` in IDA Pro (idalib) and enable the `ida` tool; inert when no IDA install is found"}},"ida.python":{type:"string",default:"",ui:{tab:"tools",group:"IDA Pro",label:"IDA Python",description:"Python interpreter that can import ida_domain and idapro; empty auto-detects"}},"ida.installDir":{type:"string",default:"",ui:{tab:"tools",group:"IDA Pro",label:"IDA Install Dir",description:"Directory containing libidalib, exported as IDADIR; empty auto-detects ($IDADIR, ida-config.json, standard install paths)"}},"ida.maxOpen":{type:"number",default:4,ui:{tab:"tools",group:"IDA Pro",label:"IDA Max Open Databases",description:"Most IDA databases (omp.ida.* daemons in omp ps) open at once per project; opening another saves and closes the least recently used idle one",options:[{value:"2",label:"2"},{value:"4",label:"4"},{value:"8",label:"8"},{value:"16",label:"16"}]}},"ida.idleCloseSec":{type:"number",default:900,ui:{tab:"tools",group:"IDA Pro",label:"IDA Idle Close Timeout",description:"Save and close IDA databases idle longer than this many seconds (0 = never); the exec namespace resets on reopen",options:[{value:"0",label:"Never"},{value:"300",label:"5 minutes"},{value:"900",label:"15 minutes"},{value:"1800",label:"30 minutes"},{value:"3600",label:"1 hour"}]}},"mcp.enableProjectConfig":{type:"boolean",default:!0,ui:{tab:"tools",group:"Discovery & MCP",label:"MCP Project Config",description:"Load .mcp.json/mcp.json from project root"}},"mcp.startupTimeoutMs":{type:"number",default:250,ui:{tab:"tools",group:"Discovery & MCP",label:"MCP Startup Window",description:"Wait this many milliseconds for initial MCP tool discovery; 0 waits until connections settle"}},"mcp.renderMarkdownResults":{type:"boolean",default:!0,ui:{tab:"tools",group:"Discovery & MCP",label:"MCP Markdown Results",description:"Render non-JSON MCP text results as Markdown in the transcript"}},"mcp.notifications":{type:"boolean",default:!1,ui:{tab:"tools",group:"Discovery & MCP",label:"MCP Update Injection",description:"Inject MCP resource updates into the agent conversation"}},"mcp.notificationDebounceMs":{type:"number",default:500,ui:{tab:"tools",group:"Discovery & MCP",label:"MCP Notification Debounce",description:"Debounce window in milliseconds for MCP resource updates before injecting them into the conversation"}},"images.urls.enabled":{type:"boolean",default:!1,ui:{tab:"model",group:"Vision",label:"Serve Images as URLs",description:"Publish outgoing images through the configured backend chain and send URL-fetching providers short URLs instead of inline base64. Falls back to inline automatically when every backend or a provider fetch fails"}},"images.urls.backends":{type:"array",default:["provider-files","tailscale","cloudflared","litterbox"],ui:{tab:"model",group:"Vision",label:"Image URL Backends",description:"Ordered destinations tried when publishing images for provider access",options:[{value:"imgur",label:"Imgur",description:"Uploads require either an Imgur access token or client ID."},{value:"imageshack",label:"ImageShack",description:"The API requires a paid subscription."},{value:"flickr",label:"Flickr",description:"image-host"},{value:"chevereto",label:"Chevereto",description:"self-hosted"},{value:"vgyme",label:"vgy.me",description:"image-host"},{value:"dropbox",label:"Dropbox",description:"cloud-files"},{value:"ftp",label:"FTP / FTPS / SFTP",description:"file-transfer"},{value:"onedrive",label:"OneDrive",description:"cloud-files"},{value:"google-drive",label:"Google Drive",description:"cloud-files"},{value:"puush",label:"puush-compatible endpoint",description:"The public service is defunct; a replacement endpoint is required."},{value:"box",label:"Box",description:"cloud-files"},{value:"amazon-s3",label:"Amazon S3",description:"s3"},{value:"google-cloud-storage",label:"Google Cloud Storage",description:"object-storage"},{value:"azure-storage",label:"Azure Blob Storage",description:"object-storage"},{value:"backblaze-b2",label:"Backblaze B2",description:"Configure either native B2 application keys or S3-compatible access keys."},{value:"owncloud",label:"ownCloud / Nextcloud",description:"webdav"},{value:"mediafire",label:"MediaFire-compatible endpoint",description:"The public API is deprecated; a replacement endpoint is required."},{value:"sendspace",label:"SendSpace-compatible endpoint",description:"The public discovery API is deprecated; a replacement endpoint is required."},{value:"localhostr",label:"Hostr-compatible endpoint",description:"The public service is offline; a replacement endpoint is required."},{value:"lambda",label:"Lambda-compatible endpoint",description:"The public service is offline; a replacement endpoint is required."},{value:"pomf",label:"Pomf",description:"pomf"},{value:"uguu",label:"Uguu",description:"Public uploads expire after approximately three hours."},{value:"seafile",label:"Seafile",description:"cloud-files"},{value:"s-ul",label:"s-ul",description:"file-host"},{value:"lobfile",label:"LobFile-compatible endpoint",description:"The public service is offline; a replacement endpoint is required."},{value:"transfer-sh",label:"transfer.sh-compatible endpoint",description:"The defunct public endpoint is blocked; a self-hosted replacement is required."},{value:"plik",label:"Plik",description:"self-hosted"},{value:"shared-folder",label:"Shared folder",description:"filesystem"},{value:"catbox",label:"Catbox",description:"anonymous-host"},{value:"litterbox",label:"Litterbox",description:"Uploads are temporary."},{value:"0x0",label:"0x0.st",description:"Public uploads expire after a retention window determined by file size."},{value:"tmpfiles",label:"tmpfiles.org",description:"Public uploads are temporary."},{value:"discord",label:"Discord",description:"messaging"},{value:"provider-files",label:"Model provider files",description:"Provider file references are API-local rather than public image URLs."},{value:"direct",label:"Direct public URL",description:"local-serving"},{value:"cloudflared",label:"Cloudflare quick tunnel",description:"tunnel"},{value:"ngrok",label:"ngrok",description:"tunnel"},{value:"tailscale",label:"Tailscale Funnel",description:"tunnel"},{value:"ssh",label:"SSH reverse tunnel",description:"tunnel"},{value:"command",label:"Uploader command",description:"external-command"},{value:"localhost-run",label:"localhost.run",description:"tunnel"},{value:"pinggy",label:"Pinggy",description:"tunnel"},{value:"devtunnel",label:"Microsoft dev tunnel",description:"The devtunnel CLI must be logged in locally."},{value:"zrok",label:"zrok",description:"The local zrok environment must be enabled."},{value:"bore",label:"bore",description:"tunnel"},{value:"named-cloudflared",label:"Named Cloudflare Tunnel",description:"tunnel"},{value:"r2",label:"Cloudflare R2",description:"s3"},{value:"tigris",label:"Tigris",description:"s3"},{value:"minio",label:"MinIO",description:"s3"},{value:"garage",label:"Garage",description:"s3"}],ordered:!0}},"images.urls.command":{type:"string",ui:{tab:"model",group:"Vision",label:"Image Upload Command",description:"Argv template for the command backend; {file} is the image path, {mime}/{ext} optional. The last URL printed on stdout is used (e.g. pasta -b -f {file})"}},"images.urls.publicBaseUrl":{type:"string",ui:{tab:"model",group:"Vision",label:"Image URL Public Base",description:"Externally reachable base URL fronting the blob server (required for ssh, optional for direct)"}},"images.urls.ttlHours":{type:"number",default:72,ui:{tab:"model",group:"Vision",label:"Image URL Lifetime (hours)",description:"Serving window for locally hosted image URLs, measured from the last time a conversation sent them; resuming a conversation re-arms the window at the same link. 0 keeps links alive while the broker runs"}},"images.urls.bindHost":{type:"string",default:"127.0.0.1",ui:{tab:"model",group:"Vision",label:"Image URL Bind Host",description:"Host the blob server binds to; loopback for tunnels, 0.0.0.0 for direct serving"}},"images.urls.sshTarget":{type:"string",ui:{tab:"model",group:"Vision",label:"Image URL SSH Target",description:"user@host destination for the ssh reverse forward"}},"images.urls.sshRemotePort":{type:"number",default:8787,ui:{tab:"model",group:"Vision",label:"Image URL SSH Remote Port",description:"Remote listen port of the ssh reverse forward that your web server proxies to"}},"secrets.enabled":{type:"boolean",default:!1,ui:{tab:"providers",group:"Privacy",label:"Hide Secrets",description:"Obfuscate configured secrets and redact credential-shaped tokens before sending to AI providers"}},"stt.enabled":{type:"boolean",default:!1,ui:{tab:"interaction",group:"Speech",label:"Speech-to-Text",description:"Enable speech-to-text input via microphone"}},"stt.submitTrigger":{type:"enum",default:"never",values:["never","release","release-complete","say-submit"],ui:{tab:"interaction",group:"Speech",label:"Speech-to-Text Submit Trigger",description:"Choose when speech dictation automatically submits: Never, Release (2+ words), Release with complete sentence, or When I Say Submit.",options:[{value:"never",label:"Never",description:"Never automatically submit; insert dictation and remain in editor."},{value:"release",label:"Release",description:"Submit on release if the utterance has 2+ words to avoid accidental sends."},{value:"release-complete",label:"Release with complete sentence",description:"Submit on release if the utterance ends with sentence-terminal punctuation (. ? ! etc.)."},{value:"say-submit",label:"When I Say Submit",description:"Submit if the utterance ends with a word containing 'submit' (strips that word before submitting)."}]}},"collab.relayUrl":{type:"string",default:"wss://my.omp.sh",ui:{tab:"interaction",group:"Collab",label:"Relay URL",description:"Relay used by /collab (wss://host[:port])"}},"collab.webUrl":{type:"string",default:"",ui:{tab:"interaction",group:"Collab",label:"Web UI URL",description:"Browser UI used by /collab links; empty derives from collab.relayUrl; explicit http:// is localhost-only"}},"collab.displayName":{type:"string",default:"",ui:{tab:"interaction",group:"Collab",label:"Display Name",description:"Name shown to other collab participants (default: OS username)"}},"collab.autoStart":{type:"enum",default:"off",values:["off","view","control"],ui:{tab:"interaction",group:"Collab",label:"Auto Start",description:"Host every interactive session via collab.relayUrl as it starts and publish it to the local registry (omp collab list); rooms rotate on session switch",options:[{value:"off",label:"Off",description:"Share only when /collab is run"},{value:"view",label:"View",description:"Auto-host; the registry hands out view-only links (omp collab link --view)"},{value:"control",label:"Control",description:"Auto-host; the registry hands out control links that can prompt the session"}]}},"share.serverUrl":{type:"string",default:"https://my.omp.sh/s",ui:{tab:"interaction",group:"Collab",label:"Share Server",description:"Share viewer/upload base used by /share (encrypted blob upload + viewer; links are <base>/<id>#<key>)"}},"share.store":{type:"enum",default:"blob",values:["blob","gist"],ui:{tab:"interaction",group:"Collab",label:"Share Store",description:"Where /share uploads the encrypted session blob",options:[{value:"blob",label:"Encrypted Blob",description:"Upload to the share server (no GitHub account needed; avoids gist API rate limits)"},{value:"gist",label:"GitHub Gist",description:"Push to a secret gist (needs authenticated gh), falling back to the share server"}]}},"share.redactSecrets":{type:"boolean",default:!0,ui:{tab:"interaction",group:"Collab",label:"Share Secret Redaction",description:"Run the secret obfuscator over /share snapshots before upload (uses the secrets.* config)"}},"stream.serverUrl":{type:"string",default:"https://live.omp.sh",ui:{tab:"interaction",group:"Stream",label:"Stream Server",description:"Live stream server used by `omp stream` (https://host[:port]); viewers watch at <base>/<your Stencil username>"}},"stream.redactPatterns":{type:"array",default:[],ui:{tab:"interaction",group:"Stream",label:"Extra Redaction Patterns",description:"Additional regular expressions redacted from every streamed row, on top of env/secrets.yml values and built-in credential shapes"}}}}});var Qrn;var ean=D(()=>{Qrn={"retry.enabled":{type:"boolean",default:!0,ui:{tab:"model",group:"Retry & Fallback",label:"Retry Enabled",description:"Retry transient provider errors (rate limits, outages, quota walls)."}},"retry.baseDelayMs":{type:"number",default:500,ui:{tab:"model",group:"Retry & Fallback",label:"Retry Base Delay (ms)",description:"Initial backoff before the first retry."}},"thinkingBudgets.minimal":{type:"number",default:1024,ui:{tab:"model",group:"Thinking",label:"Minimal Thinking Budget",description:"Token budget for the minimal thinking level."}},"thinkingBudgets.low":{type:"number",default:2048,ui:{tab:"model",group:"Thinking",label:"Low Thinking Budget",description:"Token budget for the low thinking level."}},"thinkingBudgets.medium":{type:"number",default:8192,ui:{tab:"model",group:"Thinking",label:"Medium Thinking Budget",description:"Token budget for the medium thinking level."}},"thinkingBudgets.high":{type:"number",default:16384,ui:{tab:"model",group:"Thinking",label:"High Thinking Budget",description:"Token budget for the high thinking level."}},"thinkingBudgets.xhigh":{type:"number",default:32768,ui:{tab:"model",group:"Thinking",label:"XHigh Thinking Budget",description:"Token budget for the xhigh thinking level."}},"thinkingBudgets.max":{type:"number",default:32768,ui:{tab:"model",group:"Thinking",label:"Max Thinking Budget",description:"Token budget for the max thinking level."}},"stt.language":{type:"string",default:"en",ui:{tab:"interaction",group:"Speech",label:"Speech-to-Text Language",description:'Source language for dictation (ISO-639-1, e.g. "id", "en"). Sent to the recognizer as a hint; leave it as "en" only if your dictation is English.'}},modelTags:{type:"record",default:{},ui:{tab:"model",group:"Prompt",label:"Model Tags",description:"Custom role/tag metadata; can introduce additional roles. JSON record."}},modelProviderOrder:{type:"array",default:[],ui:{tab:"model",group:"Prompt",label:"Model Provider Order",description:"Preferred provider order when a model id is ambiguous. JSON array."}},cycleOrder:{type:"array",default:["smol","default","slow"],ui:{tab:"model",group:"Prompt",label:"Model Cycle Order",description:"Roles cycled by the model switcher. JSON array."}},enabledModels:{type:"array",default:[],ui:{tab:"model",group:"Prompt",label:"Enabled Models",description:"Allow-list of models; supports path-scoped entries. Empty means all available models. JSON array."}},"task.agentServiceTierOverrides":{type:"record",default:{},ui:{tab:"model",group:"Sampling",label:"Agent Service Tier Overrides",description:"Sparse exact-name service-tier overrides for agents spawned by task/eval dispatch. JSON record."}},"compaction.reserveTokens":{type:"number",ui:{tab:"context",group:"Compaction",label:"Compaction Reserve Tokens",description:"Absolute reserve floor. Unset = larger of 16384 and 15% of the context window."}},"compaction.keepRecentTokens":{type:"number",default:20000,ui:{tab:"context",group:"Compaction",label:"Keep Recent Tokens",description:"Recent tokens always preserved through compaction."}},"compaction.autoContinue":{type:"boolean",default:!0,ui:{tab:"context",group:"Compaction",label:"Auto-Continue",description:"Continue automatically after compaction."}},"autolearn.minToolCalls":{type:"number",default:5,ui:{tab:"memory",group:"Auto-Learn",label:"Min Tool Calls",description:"Only nudge after a turn that used at least this many tools.",condition:"autolearnActive"}},shellPath:{type:"string",ui:{tab:"shell",group:"Bash",label:"Shell Path",description:"Override the shell binary used by bash."}},"bash.autoBackground.thresholdMs":{type:"number",default:60000,ui:{tab:"shell",group:"Bash",label:"Auto-Background Threshold (ms)",description:"Threshold before auto-backgrounding long-running commands."}},"task.agentAdvisor":{type:"record",default:{},ui:{tab:"tasks",group:"Subagents",label:"Agent Advisor Overrides",description:'Per-agent subagent advisor: agent name → "on" / "off" / advisor model pattern. JSON record.'}},enabledProviders:{type:"array",default:[],ui:{tab:"providers",group:"Services",label:"Enabled Providers",description:"Foreign user-level discovery sources to load; supports path-scoped entries. JSON array."}},disabledProviders:{type:"array",default:[],ui:{tab:"providers",group:"Services",label:"Disabled Providers",description:"Disabled model/discovery providers; supports path-scoped entries. JSON array."}}}});function ob(e,t){return e[t]?.value}function tan(e,t){switch(e){case void 0:return!0;case"advisorEnabled":return ob(t,"advisor.enabled")===!0;case"vimModeEnabled":return ob(t,"tui.vimMode")===!0;case"hindsightActive":return ob(t,"memory.backend")==="hindsight";case"mnemopiActive":return ob(t,"memory.backend")==="mnemopi";case"autolearnActive":return ob(t,"autolearn.enabled")===!0;case"autoThinkingActive":return ob(t,"defaultThinkingLevel")==="auto";case"usageAwareFallbackEnabled":return ob(t,"retry.usageAwareFallback")===!0;case"planModeEnabled":return ob(t,"plan.enabled")===!0;case"planAutosaveEnabled":return ob(t,"plan.enabled")===!0&&ob(t,"plan.autosave")===!0;case"unexpectedStopSmart":return ob(t,"features.unexpectedStopDetection")==="smart";case"macOS":case"hasImageProtocol":return!0;default:return!0}}function nan(e){return Object.entries(SL).filter(([,t])=>t.ui.tab===e)}function ran(e,t,n){if(!n)return!0;return e.toLowerCase().includes(n)||t.ui.label.toLowerCase().includes(n)||t.ui.description.toLowerCase().includes(n)}var Gie,SL;var hRe=D(()=>{Xrn();ean();Gie=Jrn,SL={...Gie.entries,...Qrn}});function oan({entryKey:e,entry:t,value:n,initialValue:r,onChangeDirty:a,onCommit:i,saving:o,saveError:s}){let[l,u]=ne(()=>{if(n===void 0||n===null)return"";return Array.isArray(n)||typeof n==="object"?JSON.stringify(n):String(n)}),d=Le(!1),p=Le(r),h=st(()=>Array.isArray(t.ui.options)?t.ui.options:null,[t.ui.options]);Ae(()=>{let x=n===void 0||n===null?"":Array.isArray(n)||typeof n==="object"?JSON.stringify(n):String(n);u(x),d.current=!1},[n]);let f=()=>{let x=p.current,k=x===void 0||x===null?"":Array.isArray(x)||typeof x==="object"?JSON.stringify(x):String(x);u(k),d.current=!1,a(e,!1,()=>{})},g=(x)=>{let k=l;u(typeof x==="string"?x:JSON.stringify(x)),d.current=!1,i(e,x).then((C)=>{if(C)a(e,!1,()=>{});else u(k),a(e,!0,f)}).catch(()=>{u(k),a(e,!0,f)})},b=()=>{if(!d.current)return;if(t.type==="number"){let x=ian(l);if(x===null||x===n){f();return}g(x);return}if(t.type==="string"){let x=l.trim();if(x===n){f();return}g(x);return}if(t.type==="array"){let x=gqr(l);if(x===null||aan(x,n)){f();return}g(x);return}if(t.type==="record"){let x=bqr(l);if(x===null||aan(x,n)){f();return}g(x)}},y=()=>{let x=d.current;if(d.current=!0,!x)a(e,!0,f)};if(t.type==="boolean"){let x=n===!0;return m("button",{type:"button",role:"switch","aria-checked":x,"aria-label":t.ui.label,onClick:()=>{a(e,!1,()=>{}),g(!x)},disabled:o,className:`relative h-5 w-9 shrink-0 rounded-full transition-colors cursor-pointer ${x?"bg-ink":"bg-ink/15"} ${o?"opacity-50":""}`,children:m("span",{className:`absolute top-0.5 h-4 w-4 rounded-full bg-paper shadow-sm transition-all ${x?"left-[18px]":"left-0.5"}`})})}if(t.type==="array"&&t.ui.ordered&&h){let x=Array.isArray(n)?n.filter((_)=>typeof _==="string"):[],k=(_)=>{g(x.includes(_)?x.filter((w)=>w!==_):[...x,_])},C=(_,w)=>{let T=_+w;if(T<0||T>=x.length)return;let E=[...x],[L]=E.splice(_,1);E.splice(T,0,L),g(E)};return m("div",{className:"flex flex-wrap items-center gap-1.5 justify-end max-w-72",children:[x.map((_,w)=>{let T=h.find((E)=>E.value===_);return m("span",{className:"inline-flex items-center gap-1 rounded-md border border-ink/15 bg-ink/[0.03] px-2 py-0.5 text-[10px] text-ink",children:[w>0&&m("button",{type:"button","aria-label":`${T?.label??_} left`,onClick:()=>C(w,-1),className:"text-ink/40 hover:text-ink cursor-pointer",disabled:o,children:"←"}),T?.label??_,w<x.length-1&&m("button",{type:"button","aria-label":`${T?.label??_} right`,onClick:()=>C(w,1),className:"text-ink/40 hover:text-ink cursor-pointer",disabled:o,children:"→"}),m("button",{type:"button","aria-label":`Remove ${T?.label??_}`,onClick:()=>k(_),className:"text-ink/40 hover:text-error cursor-pointer",disabled:o,children:m(gn,{size:10})})]},_)}),x.length===0&&m("span",{className:"text-[10px] text-ink/40",children:"empty"}),m("details",{className:"relative",children:[m("summary",{className:"cursor-pointer rounded-md border border-ink/15 px-2 py-0.5 text-[10px] text-ink/70 hover:text-ink select-none",children:"add…"}),m("div",{className:"absolute right-0 top-full z-10 mt-1 max-h-44 w-48 overflow-auto rounded-md border border-ink/15 bg-paper p-1 shadow-lg",children:[h.filter((_)=>!x.includes(_.value)).map((_)=>m("button",{type:"button",onClick:()=>k(_.value),className:"block w-full rounded px-2 py-1 text-left text-[11px] text-ink/80 hover:bg-ink/5",children:_.label||_.value},_.value)),h.every((_)=>x.includes(_.value))&&m("div",{className:"px-2 py-1 text-[10px] text-ink/40",children:"all selected"})]})]})]})}let v=h??(t.type==="enum"&&t.values?t.values.map((x)=>({value:x,label:x,description:""})):null);if(v){let x=n===void 0||n===null?"":String(n);return m("div",{className:"flex items-center gap-2 shrink-0",children:m("select",{"aria-label":t.ui.label,value:x,onChange:(k)=>{let C=k.currentTarget.value;if(t.type==="number"){let _=ian(C);if(_===null||_===n)return;g(_)}else{if(C===n)return;g(C)}},disabled:o,className:`bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink max-w-56 ${o?"opacity-50":""}`,children:[x===""&&m("option",{value:"",disabled:!0,children:"select…"}),v.map((k)=>m("option",{value:k.value,children:k.label||k.value},k.value))]})})}if(t.type==="array")return m("input",{"aria-label":t.ui.label,type:"text",value:l,onChange:(x)=>{u(x.currentTarget.value),y()},onBlur:b,disabled:o,placeholder:'["anthropic","openai"]',className:`w-48 bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-right font-mono text-[11px] ${o?"opacity-50":""}`});if(t.type==="record")return m("input",{"aria-label":t.ui.label,type:"text",value:l,onChange:(x)=>{u(x.currentTarget.value),y()},onBlur:b,disabled:o,placeholder:'{"bash":"prompt"}',className:`w-48 bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-right font-mono text-[11px] ${o?"opacity-50":""}`});if(t.type==="number")return m("input",{"aria-label":t.ui.label,type:"text",inputMode:"decimal",value:l,onChange:(x)=>{u(x.currentTarget.value),y()},onBlur:b,disabled:o,className:`w-28 bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-right font-mono text-[11px] ${o?"opacity-50":""}`});return m("input",{"aria-label":t.ui.label,type:t.credential?"password":"text",value:l,onChange:(x)=>{u(x.currentTarget.value),y()},onBlur:b,disabled:o,className:`w-48 bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-right font-mono text-[11px] ${o?"opacity-50":""} ${s?"border-error":""}`})}var aan=(e,t)=>JSON.stringify(e)===JSON.stringify(t),ian=(e)=>{let t=e.trim();if(t===""||t==="-"||t==="+")return null;let n=Number(t);return Number.isFinite(n)?n:null},gqr=(e)=>{let t=e.trim();if(t==="")return[];try{let n=JSON.parse(t);return Array.isArray(n)?n:null}catch{return null}},bqr=(e)=>{let t=e.trim();if(t==="")return{};try{let n=JSON.parse(t);return typeof n==="object"&&n!==null&&!Array.isArray(n)?n:null}catch{return null}};var san=D(()=>{Xe();dt();de()});function can({tabs:e,entries:t,activeTabId:n,onSelectTab:r,searchQuery:a,dirtyKeys:i,savingKeys:o,saveErrors:s,onCommit:l,onReset:u,onDirty:d}){let p=e.find((g)=>g.id===n)??e[0],h=st(()=>{let g=a.trim().toLowerCase();if(g)return Object.entries(SL).filter(([b,y])=>ran(b,y,g)).map(([b])=>b).slice(0,80);return nan(p.id).filter(([,b])=>tan(b.ui.condition,t)).map(([b])=>b)},[t,p.id,a]),f=st(()=>{if(!a.trim())return[];let g=[],b=new Map;for(let y of h){let v=SL[y],x=e.find((_)=>_.id===v?.ui.tab),k=`${v?.ui.tab??"?"}\x00${v?.ui.group??""}`,C=b.get(k);if(!C)C={label:v?.ui.group?`${x?.label??v?.ui.tab} · ${v.ui.group}`:x?.label??v?.ui.tab??"Other",keys:[]},b.set(k,C),g.push({id:k,...C});C.keys.push(y)}return g},[h,a,e]);return m("div",{className:"w-full flex flex-col gap-3 text-xs",children:[m("div",{className:"flex items-center gap-1 overflow-x-auto pb-1 scrollbar-overlay-container",children:e.map((g)=>m("button",{type:"button",onClick:()=>r(g.id),className:`shrink-0 rounded-md px-2.5 py-1 text-[11px] font-medium transition-colors cursor-pointer ${g.id===p.id?"bg-ink/10 text-ink":"text-ink/55 hover:bg-ink/5 hover:text-ink"}`,children:g.label},g.id))}),m("div",{className:"w-full rounded-lg border border-ink/10 divide-y divide-ink/5",children:[a.trim()?f.map((g)=>m(lan,{keys:g.keys,entries:t,groupLabel:g.label,dirtyKeys:i,savingKeys:o,saveErrors:s,onCommit:l,onReset:u,onDirty:d},g.id)):p.groups.map((g)=>{let b=h.filter((y)=>SL[y]?.ui.group===g);if(b.length===0)return null;return m(lan,{keys:b,entries:t,groupLabel:g,dirtyKeys:i,savingKeys:o,saveErrors:s,onCommit:l,onReset:u,onDirty:d},g)}),h.length===0&&m("div",{className:"px-3 py-6 text-center text-ink/40",children:a.trim()?"No settings match your search.":"No settings in this tab."})]})]})}function lan({keys:e,entries:t,groupLabel:n,dirtyKeys:r,savingKeys:a,saveErrors:i,onCommit:o,onReset:s,onDirty:l}){return m("div",{children:[m("div",{className:"px-3 py-1.5 bg-ink/[0.02] text-[10px] uppercase tracking-wide text-ink/40 font-medium",children:n}),e.map((u)=>{let d=SL[u];if(!d?.ui)return null;let p=t[u]?.value,h=r.has(u),f=a.has(u),g=i.get(u);return m("div",{className:"flex items-center justify-between gap-3 px-3 py-2",children:[m("div",{className:"min-w-0 flex-1",children:[m("div",{className:"flex items-center gap-1.5",children:[m("span",{className:"font-medium text-ink",children:d.ui.label}),m("span",{className:"font-mono text-[9px] text-ink/30",title:"config key",children:u}),h&&!f&&m("span",{className:"shrink-0 rounded bg-warning/15 px-1 py-px text-[9px] font-semibold text-warning",children:"unsaved"}),f&&m("span",{className:"shrink-0 text-[9px] text-ink/40",children:"saving…"}),g&&!f&&m("span",{className:"shrink-0 rounded bg-error/10 px-1 py-px text-[9px] font-semibold text-error",title:g,children:"save failed"})]}),d.ui.description&&m("div",{className:"text-[10px] text-ink/40 leading-snug",children:d.ui.description}),g&&!f&&m("div",{className:"text-[10px] text-error leading-snug",children:g}),d.ui.warning&&m("div",{className:"text-[10px] text-error/80 leading-snug",children:d.ui.warning})]}),m("div",{className:"flex items-center gap-1.5 shrink-0",children:[m(oan,{entryKey:u,entry:d,value:p,initialValue:p,onChangeDirty:l,onCommit:o,saving:f,saveError:Boolean(g)}),m("button",{type:"button","aria-label":`Reset ${d.ui.label}`,title:"Reset to schema default",onClick:()=>s(u),disabled:f,className:`rounded p-1 text-ink/30 hover:text-ink transition-colors cursor-pointer disabled:opacity-40 ${f?"":"hover:bg-ink/5"}`,children:m(nu,{size:11})}),h&&m(Vt,{size:11,className:"text-ink/30"})]})]},u)})]})}var uan=D(()=>{Xe();dt();hRe();san();de()});function yqr(e,t){let n=oj[e];if(!n)return!1;if(n.kinds.includes(t.kind))return!0;return e==="web"&&t.kind==="chat"&&t.webCapable===!0}function pan(e,t){return t.filter((n)=>yqr(e,n)).sort((n,r)=>n.provider.localeCompare(r.provider)||n.name.localeCompare(r.name))}function fRe(e,t){let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;return n.every((r)=>t[r]===e[r])}function gRe(e,t){return e.find((n)=>fRe(n.roles,t))??null}var oj,dan;var man=D(()=>{oj={default:{label:"Default",section:"chat",kinds:["chat"]},smol:{label:"Fast",section:"chat",kinds:["chat"]},slow:{label:"Thinking",section:"chat",kinds:["chat"]},vision:{label:"Vision",section:"chat",kinds:["chat"]},plan:{label:"Architect",section:"chat",kinds:["chat"]},commit:{label:"Commit",section:"chat",kinds:["chat"]},tiny:{label:"Tiny",section:"chat",kinds:["tiny","chat"]},memory:{label:"Memory",section:"chat",kinds:["tiny","chat"]},task:{label:"Subtask",section:"chat",kinds:["chat"]},advisor:{label:"Advisor",section:"chat",kinds:["chat"]},widget:{label:"Job widgets",section:"chat",kinds:["chat"]},image:{label:"Image generation",section:"kind",kinds:["image"]},web:{label:"Web search",section:"kind",kinds:["search"]},speech:{label:"Speech (TTS)",section:"kind",kinds:["tts"]},dictation:{label:"Dictation (STT)",section:"kind",kinds:["stt"]},judge:{label:"Judge",section:"kind",kinds:["judge","tiny","chat"]}},dan=Object.keys(oj)});function vqr(e){let t=[];for(let n of e){let r=t[t.length-1];if(r&&r.provider===n.provider)r.rows.push(n);else t.push({provider:n.provider,rows:[n]})}return t}function han({role:e,info:t,value:n,candidates:r,disabled:a,onChange:i}){let o=r.some((u)=>u.selector===n),s=vqr(r),l=`${t.label} (${e}) model`;return m("div",{className:"flex items-center justify-between gap-3 px-3 py-2.5",children:[m("div",{className:"min-w-0",children:[m("div",{className:"font-medium text-ink",children:t.label}),m("div",{className:"font-mono text-[9px] text-ink/30",children:e})]}),m("select",{"aria-label":l,title:n||"omp decides this role",value:n,disabled:a,onChange:(u)=>i(e,u.currentTarget.value),className:"w-60 max-w-[60%] bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink font-mono text-[11px] cursor-pointer disabled:opacity-50",children:[m("option",{value:"",children:"— omp default —"}),n&&!o&&m("option",{value:n,children:[n," (not in catalog)"]}),s.map((u)=>m("optgroup",{label:u.provider,children:u.rows.map((d)=>m("option",{value:d.selector,children:d.name},d.selector))},u.provider))]})]})}var fan=D(()=>{de()});function gan({presets:e,selectedPreset:t,inUse:n,busy:r,onApply:a,onSave:i,onUpdate:o,onDelete:s}){let[l,u]=ne(!1),[d,p]=ne(""),[h,f]=ne(!1),g=()=>{let b=d.trim();if(!b)return;i(b),p(""),u(!1)};return m("div",{className:"rounded-lg border border-ink/10 bg-ink/[0.02] px-3 py-2 mb-3",children:[m("div",{className:"flex flex-wrap items-center gap-2",children:[m("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-ink/50",children:"Preset"}),m("select",{"aria-label":"Model role preset",value:t?.id??"",disabled:r||e.length===0,onChange:(b)=>{let y=e.find((v)=>v.id===b.currentTarget.value);if(y)a(y)},className:"bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-[11px] cursor-pointer disabled:opacity-50 min-w-[10rem]",children:[m("option",{value:"",children:e.length===0?"No presets yet":"Custom"}),e.map((b)=>m("option",{value:b.id,children:b.name},b.id))]}),t&&m("span",{className:`inline-flex items-center gap-1 text-[10px] ${n?"text-ink/50":"text-warning"}`,title:n?"The live roles are this preset":"The roles differ from this preset — Update stores them",children:n?m(bt,{children:[m(Vt,{size:11})," in use"]}):"modified"}),m("div",{className:"ml-auto flex items-center gap-1.5",children:[m("button",{type:"button",onClick:()=>u((b)=>!b),disabled:r,title:"Save the current roles as a new preset",className:"flex items-center gap-1 px-2 py-1 rounded-md border border-ink/15 text-ink/70 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer disabled:opacity-50 text-[11px]",children:[m(kr,{size:11})," Save as…"]}),m("button",{type:"button",onClick:o,disabled:r||!t,title:t?`Overwrite “${t.name}” with the current roles`:"Pick a preset first",className:"flex items-center gap-1 px-2 py-1 rounded-md border border-ink/15 text-ink/70 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer disabled:opacity-40 text-[11px]",children:[m(hp,{size:11})," Update"]}),m("button",{type:"button",onClick:()=>f(!0),disabled:r||!t,title:t?`Delete “${t.name}”`:"Pick a preset first",className:"p-1 rounded-md border border-ink/15 text-ink/50 hover:text-error hover:border-error/40 transition-colors cursor-pointer disabled:opacity-40",children:m(xr,{size:12})})]})]}),l&&m("div",{className:"flex items-center gap-2 pt-2",children:[m("input",{"aria-label":"New preset name",type:"text",value:d,autoFocus:!0,onInput:(b)=>p(b.currentTarget.value),onKeyDown:(b)=>{if(b.key==="Enter")g();if(b.key==="Escape")u(!1),p("")},placeholder:"e.g. cheap, thinking, review",className:"flex-1 bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-[11px]"}),m("button",{type:"button",onClick:g,disabled:!d.trim()||r,className:"px-2 py-1 rounded-md border border-ink/15 text-ink/80 hover:bg-ink/5 transition-colors cursor-pointer disabled:opacity-50 text-[11px]",children:"Save"}),m("button",{type:"button",onClick:()=>{u(!1),p("")},className:"px-2 py-1 rounded-md text-ink/50 hover:text-ink cursor-pointer text-[11px]",children:"Cancel"})]}),h&&t&&m("div",{className:"flex items-center gap-2 pt-2 text-[11px] text-ink/70",children:[m("span",{children:["Delete “",t.name,"”? The roles themselves are untouched."]}),m("button",{type:"button",onClick:()=>{f(!1),s()},disabled:r,className:"px-2 py-1 rounded-md border border-error/40 text-error hover:bg-error/10 transition-colors cursor-pointer disabled:opacity-50",children:"Delete"}),m("button",{type:"button",onClick:()=>f(!1),className:"px-2 py-1 rounded-md text-ink/50 hover:text-ink cursor-pointer",children:"Cancel"})]})]})}var ban=D(()=>{Xe();dt();de()});function yan({roles:e,presets:t,candidates:n,candidatesError:r,onSaveRoles:a,onSavePreset:i,onUpdatePreset:o,onDeletePreset:s,savedRole:l,writeError:u,onDismissWriteError:d}){let[p,h]=ne(e),[f,g]=ne(!1),[b,y]=ne(()=>gRe(t,e)?.id??null);Ae(()=>{h(e)},[e]),Ae(()=>{y((L)=>{if(L&&!t.some((P)=>P.id===L))return null;if(L)return L;return gRe(t,p)?.id??null})},[t,p]);let v=st(()=>t.find((L)=>L.id===b)??null,[t,b]),x=st(()=>Boolean(v&&fRe(v.roles,p)),[v,p]),k=Se(async(L)=>{h(L),g(!0);try{await a(L)}finally{g(!1)}},[a]),C=Se((L,P)=>{let R={...p};if(P)R[L]=P;else delete R[L];k(R)},[k,p]),_=Se((L)=>{y(L.id),k({...L.roles})},[k]),w=Se(async(L)=>{g(!0);try{await i(L,p)}finally{g(!1)}},[p,i]),T=Se(async()=>{if(!v)return;g(!0);try{await o({...v,roles:p})}finally{g(!1)}},[v,p,o]),E=Se(async()=>{if(!v)return;g(!0);try{await s(v),y(null)}finally{g(!1)}},[v,s]);return m("div",{className:"pt-2",children:[m("div",{className:"flex items-center justify-between pb-2",children:[m("div",{children:[m("h3",{className:"text-sm font-semibold text-ink",children:"Model Roles"}),m("p",{className:"text-ink/50 mt-0.5",children:"Role → model selectors from config.yml. Pick a preset to switch every role at once."})]}),l&&m("span",{className:"inline-flex items-center gap-1 text-[10px] text-ink/60",children:[m(Vt,{size:11})," saved"]})]}),m(gan,{presets:t,selectedPreset:v,inUse:x,busy:f,onApply:_,onSave:w,onUpdate:T,onDelete:E}),u&&m("div",{className:"flex items-start gap-1.5 pb-2 text-[10px] text-error",children:[m(Kn,{size:11,className:"mt-px flex-shrink-0"}),m("span",{className:"flex-1",children:u}),d&&m("button",{type:"button",onClick:d,className:"text-ink/40 hover:text-ink cursor-pointer","aria-label":"Dismiss role write error",children:"×"})]}),r&&m("div",{className:"flex items-start gap-1.5 pb-2 text-[10px] text-warning",children:[m(Kn,{size:11,className:"mt-px flex-shrink-0"}),m("span",{children:["Model catalog unavailable (",r,"). Stored selectors stay editable; new picks need a working omp install."]})]}),xqr.map((L)=>{let P=dan.filter((R)=>oj[R].section===L.id);return m("div",{className:"mb-3",children:[m("div",{className:"pb-1",children:[m("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-ink/50",children:L.title}),m("div",{className:"text-[10px] text-ink/40 leading-snug",children:L.note})]}),m("div",{className:"rounded-lg border border-ink/10 divide-y divide-ink/5",children:P.map((R)=>m(han,{role:R,info:oj[R],value:p[R]??"",candidates:pan(R,n),disabled:f,onChange:C},R))})]},L.id)})]})}var xqr;var van=D(()=>{Xe();dt();man();fan();ban();de();xqr=[{id:"chat",title:"Chat roles",note:"Each takes a chat model. “omp default” removes the override and omp resolves the role itself."},{id:"kind",title:"Model-kind roles",note:"Each takes a model of that kind only — a chat model here is silently unusable."}]});function xan(e){if(typeof e!=="object"||e===null||!("roles"in e))return null;let t=e.roles;if(typeof t!=="object"||t===null||Array.isArray(t))return null;return Object.fromEntries(Object.entries(t).filter((n)=>typeof n[1]==="string"))}function kan(e){if(typeof e!=="object"||e===null||!("error"in e))return null;return typeof e.error==="string"?e.error:null}function _an(e){let[t,n]=ne({}),[r,a]=ne([]),[i,o]=ne([]),[s,l]=ne(null),[u,d]=ne(null),p=Se(()=>d(null),[]),h=Se((x)=>{let k=xan(x);if(k)n(k);if(typeof x!=="object"||x===null)return;if("presets"in x&&Array.isArray(x.presets))a(x.presets);if("candidates"in x&&Array.isArray(x.candidates))o(x.candidates);if("candidatesError"in x)l(typeof x.candidatesError==="string"?x.candidatesError:null)},[]),f=Se(async(x)=>{let k=t;n(x),d(null);try{let _=await(await fetch("/api/model-roles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({roles:x})})).json(),w=xan(_);if(w)n(w);let T=typeof _==="object"&&_!==null&&"success"in _&&_.success===!0;if(T)e("role-map");else n(k),d(kan(_)??"The role write was refused");return T}catch(C){return console.error("Failed to save model roles:",C),n(k),d(C instanceof Error?C.message:String(C)),!1}},[e,t]),g=Se(async(x,k="")=>{d(null);try{let _=await(await fetch(`/api/model-roles${k}`,x)).json();if(typeof _==="object"&&_!==null&&"presets"in _&&Array.isArray(_.presets))a(_.presets);let w=typeof _==="object"&&_!==null&&"success"in _&&_.success===!0;if(!w)d(kan(_)??"The preset write was refused");return w}catch(C){return console.error("Failed to save model role preset:",C),d(C instanceof Error?C.message:String(C)),!1}},[]),b=Se((x,k)=>g({method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({preset:{name:x,roles:k}})}),[g]),y=Se((x)=>g({method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({preset:{id:x.id,name:x.name,roles:x.roles}})}),[g]),v=Se((x)=>g({method:"DELETE"},`?id=${encodeURIComponent(x.id)}`),[g]);return{roles:t,presets:r,candidates:i,candidatesError:s,writeError:u,clearWriteError:p,applyPayload:h,writeRoles:f,savePreset:b,updatePreset:y,deletePreset:v}}var wan=D(()=>{Xe()});function Can({extensions:e,savedExtension:t,onToggle:n}){if(e.length===0)return null;return m("div",{className:"pt-2",children:[m("div",{className:"flex items-center justify-between pb-2",children:[m("div",{children:[m("h3",{className:"text-sm font-semibold text-ink",children:"Extensions"}),m("p",{className:"text-ink/50 mt-0.5",children:"TS/JS modules loaded from .omp/extensions. Disable writes to config.yml."})]}),t&&m("span",{className:"inline-flex items-center gap-1 text-[10px] text-ink/60",children:[m(Vt,{size:11})," saved"]})]}),m("div",{className:"rounded-lg border border-ink/10 divide-y divide-ink/5",children:e.map((r)=>m("div",{className:"flex items-center justify-between gap-3 px-3 py-2.5",children:[m("div",{className:"min-w-0",children:[m("div",{className:"font-medium text-ink",children:r.name}),m("div",{className:"text-[10px] text-ink/40 truncate font-mono",children:[r.sourceRoot," · ",r.filePath]})]}),m("select",{"aria-label":`${r.name} enabled`,value:r.disabled?"false":"true",onChange:()=>n(r),className:"bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink",children:[m("option",{value:"true",children:"enabled"}),m("option",{value:"false",children:"disabled"})]})]},r.id))})]})}var San=D(()=>{dt();de()});function Tan(e){let[t,n]=ne(null),[r,a]=ne(!1),[i,o]=ne({}),[s,l]=ne([]),[u,d]=ne(!0),[p,h]=ne(Gie.tabs[0]?.id??"model"),[f,g]=ne(""),[b,y]=ne(null),[v,x]=ne(new Set),[k,C]=ne(new Set),[_,w]=ne(new Map),T=Se((N)=>{y(N),setTimeout(()=>y((O)=>O===N?null:O),2000)},[]),E=_an(T),L=Se(()=>{d(!0),Promise.all([fetch("/api/omp/state").then((N)=>N.json()),fetch("/api/settings/omp-config").then((N)=>N.json()),fetch("/api/model-roles").then((N)=>N.json()),fetch("/api/omp/extensions").then((N)=>N.json())]).then(([N,O,B,F])=>{if(N.running&&N.state)n(N.state);if(a(Boolean(N.running)),O.entries)o(O.entries);if(E.applyPayload(B),Array.isArray(F.extensions))l(F.extensions)}).catch((N)=>console.error("Failed to load omp settings:",N)).finally(()=>d(!1))},[E.applyPayload]);Ae(()=>{L()},[L]);let P=(N,O,B,F)=>{if(C((U)=>{let z=new Set(U);return z.delete(N),z}),x((U)=>{let z=new Set(U);return z.delete(N),z}),O){if(w((U)=>{if(!U.has(N))return U;let z=new Map(U);return z.delete(N),z}),B!==void 0)o((U)=>({...U,[N]:{...U[N],value:B}}));T(N)}else w((U)=>new Map(U).set(N,F??"omp rejected the write"))},R=Se(async(N,O)=>{C((B)=>new Set(B).add(N)),x((B)=>{let F=new Set(B);return F.delete(N),F});try{let F=await(await fetch("/api/settings/omp-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:N,value:O})})).json(),U=Boolean(F.success);return P(N,U,F.value,typeof F.error==="string"?F.error:void 0),U}catch(B){return console.error("Failed to save omp config:",B),P(N,!1,void 0,B instanceof Error?B.message:void 0),!1}},[]),I=Se(async(N)=>{C((O)=>new Set(O).add(N));try{let B=await(await fetch("/api/settings/omp-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:N,action:"reset"})})).json(),F=Boolean(B.success);return P(N,F,B.value,typeof B.error==="string"?B.error:void 0),F}catch(O){return console.error("Failed to reset omp config:",O),P(N,!1,void 0,O instanceof Error?O.message:void 0),!1}},[]),A=Se((N,O)=>{x((B)=>{let F=new Set(B);if(O)F.add(N);else F.delete(N);return F})},[]),M=(N)=>{fetch("/api/omp/extensions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:N.id,disabled:!N.disabled})}).then((O)=>O.json()).then((O)=>{if(O.success)l((B)=>B.map((F)=>F.id===N.id?{...F,disabled:!N.disabled}:F)),T(`ext-${N.id}`)}).catch((O)=>console.error("Failed to toggle extension:",O))};if(u)return m("div",{className:"flex items-center justify-center p-8 text-ink/40 text-xs",children:"Loading OMP settings..."});return m("div",{className:"w-full space-y-4 text-ink pb-2 text-xs",children:[m("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 pb-3 border-b border-ink/10",children:[m("div",{children:[m("h2",{className:"text-sm font-semibold text-ink",children:"OMP Engine"}),m("p",{className:"text-ink/50 mt-0.5",children:"Live agent state and the full native config schema from oh-my-pi."})]}),m("div",{className:"flex items-center gap-2",children:[m("div",{className:"relative",children:[m(na,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-ink/40 pointer-events-none"}),m("input",{"aria-label":"Search settings",type:"text",value:f,onChange:(N)=>g(N.currentTarget.value),placeholder:"Search settings…",className:"w-44 bg-paper border border-ink/15 rounded-md pl-6 pr-6 py-1 text-ink placeholder:text-ink/40"}),f&&m("button",{type:"button","aria-label":"Clear search",onClick:()=>g(""),className:"absolute right-1.5 top-1/2 -translate-y-1/2 text-ink/40 hover:text-ink cursor-pointer",children:m(gn,{size:11})})]}),m("button",{type:"button",onClick:L,className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-ink/15 text-ink/70 hover:text-ink hover:bg-ink/5 transition-all cursor-pointer",children:[m(In,{size:12})," Refresh"]})]})]}),m("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2",children:[m("div",{className:"rounded-lg border border-ink/10 bg-ink/[0.03] px-3 py-2",children:[m("div",{className:"text-[10px] uppercase tracking-wide text-ink/40",children:"Engine"}),m("div",{className:"font-semibold text-ink mt-0.5",children:r?"Running":"Idle"})]}),m("div",{className:"rounded-lg border border-ink/10 bg-ink/[0.03] px-3 py-2",children:[m("div",{className:"text-[10px] uppercase tracking-wide text-ink/40",children:"Model"}),m("div",{className:"font-semibold text-ink mt-0.5 truncate",children:t?.model?.id??"—"})]}),m("div",{className:"rounded-lg border border-ink/10 bg-ink/[0.03] px-3 py-2",children:[m("div",{className:"text-[10px] uppercase tracking-wide text-ink/40",children:"Thinking"}),m("div",{className:"font-semibold text-ink mt-0.5",children:t?.thinkingLevel??"—"})]}),m("div",{className:"rounded-lg border border-ink/10 bg-ink/[0.03] px-3 py-2",children:[m("div",{className:"text-[10px] uppercase tracking-wide text-ink/40",children:"Context"}),m("div",{className:"font-semibold text-ink mt-0.5",children:t?.contextUsage?.percent!=null?`${t.contextUsage.percent.toFixed(1)}%`:"—"})]})]}),m("div",{className:"pt-1",children:[m("div",{className:"flex items-center justify-between pb-2",children:[m("div",{children:[m("h3",{className:"text-sm font-semibold text-ink",children:"Config"}),m("p",{className:"text-ink/50 mt-0.5",children:["Schema-driven settings backed by ",m("span",{className:"font-mono",children:"omp config"}),".",f.trim()&&" — matching keys only"]})]}),b&&b!=="role-map"&&!b.startsWith("ext-")&&m("span",{className:"inline-flex items-center gap-1 text-[10px] text-ink/60",children:["saved ",b]})]}),m(can,{tabs:Gie.tabs,entries:i,activeTabId:p,onSelectTab:h,searchQuery:f,dirtyKeys:v,savingKeys:k,saveErrors:_,onCommit:R,onReset:I,onDirty:A})]}),m(yan,{roles:E.roles,presets:E.presets,candidates:E.candidates,candidatesError:E.candidatesError,onSaveRoles:E.writeRoles,onSavePreset:E.savePreset,onUpdatePreset:E.updatePreset,onDeletePreset:E.deletePreset,savedRole:b==="role-map"?"roles":null,writeError:E.writeError,onDismissWriteError:E.clearWriteError}),m(Can,{extensions:s,savedExtension:b?.startsWith("ext-")?b.slice(4):null,onToggle:M})]})}var Ean=D(()=>{Xe();dt();hRe();uan();van();wan();San();de()});function Aan({activeMetrics:e}){return m("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-2.5 items-stretch",children:[m(mo,{value:e.processedTokens,label:"Processed tokens",hint:e.activeRate}),m(mo,{value:e.cachedInput,label:"Cached input",hint:e.cachedPercent}),m(mo,{value:e.uncachedInput,label:"Uncached input",hint:"0 cache writes"}),m(mo,{value:e.outputTokens,label:"Output",hint:e.reasoning}),m(mo,{value:e.cacheSavings,label:"Cache savings",hint:"0.0x the raw token cost",tone:"muted",className:"col-span-2 sm:col-span-1"})]})}var Lan=D(()=>{F6();de()});function Nan({breakdownTab:e,setBreakdownTab:t,activeBreakdownRows:n,activeMetrics:r,cadence:a}){return m("div",{className:"grid grid-cols-1 xl:grid-cols-3 gap-3",children:[m("div",{className:"bg-paper border border-ink/15 rounded-lg p-3.5 shadow-xs xl:col-span-2",children:[m("div",{className:"flex justify-between items-center mb-3",children:[m("span",{className:"font-semibold text-xs text-ink",children:"Breakdown"}),m("div",{className:"flex bg-ink/5 rounded p-0.5",children:[m("button",{onClick:()=>t("model"),className:`px-2 py-0.5 rounded text-[9px] font-bold tracking-wider transition-colors ${e==="model"?"bg-paper shadow-xs text-ink":"text-ink/50 hover:text-ink"}`,children:"MODEL"}),m("button",{onClick:()=>t("day"),className:`px-2 py-0.5 rounded text-[9px] font-bold tracking-wider transition-colors ${e==="day"?"bg-paper shadow-xs text-ink":"text-ink/50 hover:text-ink"}`,children:Ran[a]}),m("button",{onClick:()=>t("project"),className:`px-2 py-0.5 rounded text-[9px] font-bold tracking-wider transition-colors ${e==="project"?"bg-paper shadow-xs text-ink":"text-ink/50 hover:text-ink"}`,children:"PROJECT"})]})]}),m("div",{className:"overflow-x-auto",children:m("table",{className:"w-full text-[11px]",children:[m("thead",{children:m("tr",{className:"text-ink/40 border-b border-ink/10",children:[m("th",{className:"font-medium text-left pb-2 capitalize",children:e==="day"?Ran[a].toLowerCase():e}),m("th",{className:"font-medium text-right pb-2",children:"Cost"}),m("th",{className:"font-medium text-right pb-2",children:"Share"}),m("th",{className:"font-medium text-right pb-2",children:"Tokens"})]})}),m("tbody",{className:"divide-y divide-ink/5",children:n.map((i)=>m("tr",{children:[m("td",{className:"py-2.5 flex items-center gap-2",children:[m("div",{className:`w-1.5 h-1.5 rounded-full ${i.dotColorClass}`}),m("span",{className:"font-semibold text-ink whitespace-nowrap",children:i.name})]}),m("td",{className:"py-2.5 text-right font-bold text-ink",children:i.cost}),m("td",{className:"py-2.5 text-right text-ink/60",children:i.share}),m("td",{className:"py-2.5 text-right text-ink/60",children:i.tokens})]},i.name))})]})}),m("div",{className:"h-1.5 w-full bg-ink/5 rounded-full mt-3 overflow-hidden flex",children:n.map((i,o)=>m("div",{className:`h-full ${o===0?"bg-ink/80":o===1?"bg-ink/45 border-l border-paper":"bg-ink/20 border-l border-paper"}`,style:{width:`${i.sharePercent}%`}},i.name))})]}),m("div",{className:"bg-paper border border-ink/15 rounded-lg p-3.5 shadow-xs xl:col-span-1",children:[m("div",{className:"font-semibold text-xs mb-3 text-ink",children:"Cost quality"}),m("div",{className:"space-y-2 text-[11px]",children:[m("div",{className:"flex justify-between items-center",children:[m("span",{className:"text-ink/60",children:"Provider reported"}),m("span",{className:"font-semibold text-ink",children:"100.0%"})]}),m("div",{className:"flex justify-between items-center",children:[m("span",{className:"text-ink/60",children:"Model priced"}),m("span",{className:"font-semibold text-ink",children:"0.0%"})]}),m("div",{className:"flex justify-between items-center",children:[m("span",{className:"text-ink/60",children:"Unpriced"}),m("span",{className:"font-semibold text-ink",children:"0.0%"})]})]}),m("div",{className:"border-t border-ink/10 mt-3 pt-2.5",children:m("div",{className:"flex justify-between items-center text-[11px]",children:[m("span",{className:"text-ink/60",children:"Cache savings"}),m("span",{className:"font-semibold text-ink",children:r.cacheSavings})]})})]})]})}var Ran;var Ian=D(()=>{de();Ran={daily:"DAY",weekly:"WEEK",monthly:"MONTH"}});function kqr(e,t,n){if(e.length===0)return"";if(e.length===1)return"M0,98 L100,98";let r=n>0?n:1;return e.map((a,i)=>{let o=i/(e.length-1)*100,s=98-t[i]/r*94;return`${i===0?"M":"L"}${o.toFixed(2)},${s.toFixed(2)}`}).join(" ")}function Man({cadence:e,metric:t,series:n}){let r=n.map((p)=>t==="cost"?p.cost:p.tokens),a=r.length>0?Math.max(...r):0,i=kqr(n,r,a),o=t==="cost"?aM(a)||"$0.00":ym(a)??"0",s=t==="cost"?aM(a/2)||"$0.00":ym(a/2)??"0",l=n[0]?.label??"",u=n.length>2?n[Math.floor(n.length/2)]?.label??"":"",d=n.length>1?n[n.length-1]?.label??"":"";if(n.length===0)return m("div",{className:"h-28 flex items-center justify-center text-[11px] text-ink/40",children:"No usage data in this period"});return m("div",{className:"h-28 relative",children:[m("div",{className:"absolute inset-0 flex flex-col justify-between pt-1 pb-4",children:[m("div",{className:"border-t border-ink/5 w-full border-dashed"}),m("div",{className:"border-t border-ink/5 w-full border-dashed"}),m("div",{className:"border-t border-ink/15 w-full"})]}),m("div",{className:"absolute left-0 top-0 bottom-4 flex flex-col justify-between text-[9px] font-mono text-ink/40 w-9",children:[m("span",{children:o}),m("span",{children:s}),m("span",{children:"0"})]}),m("div",{className:"absolute left-10 right-0 bottom-4 top-0 flex items-end",children:m("svg",{className:"w-full h-full",preserveAspectRatio:"none",viewBox:"0 0 100 100",children:m("path",{d:i,fill:"none",stroke:"currentColor",className:"text-ink/60 transition-all duration-300",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),m("div",{className:"absolute left-10 right-0 bottom-0 h-4 flex justify-between text-[9px] text-ink/40 items-end",children:[m("span",{children:l}),u&&m("span",{children:u}),m("span",{children:d})]}),m("span",{className:"sr-only",children:`${e} ${t} trend`})]})}var Pan=D(()=>{de()});function Dan({settings:e,onUpdate:t}){let[n,r]=ne("daily"),[a,i]=ne("30d"),[o,s]=ne(!1),[l,u]=ne("cost"),[d,p]=ne("model"),[h,f]=ne(!1),g=new Date().toISOString().slice(0,10),b=new Date(Date.now()-2592000000).toISOString().slice(0,10),[y,v]=ne(b),[x,k]=ne(g),[C,_]=ne([]),[w,T]=ne(null),[E,L]=ne([]),[P,R]=ne([]),I=Le(null);Pr(I,()=>s(!1));let A=Se(()=>{f(!0);let B=a==="custom"?`&customFrom=${y}&customTo=${x}`:"";fetch(`/api/telemetry/tokens?timeRange=${a}&breakdownTab=${d}&cadence=${n}${B}`).then((F)=>F.json()).then((F)=>{if(F.timeRanges)_(F.timeRanges);if(F.metrics)T(F.metrics);if(F.breakdownRows)L(F.breakdownRows);if(F.chartSeries)R(F.chartSeries)}).catch((F)=>console.error("Failed to load token telemetry:",F)).finally(()=>f(!1))},[a,d,n,y,x]);Ae(()=>{A()},[A]);let M=()=>{A()},N=C.find((B)=>B.id===a)||C[0]||{id:a,label:a,dateRange:"Current Period"},O=a==="custom"?`${y} to ${x}`:N.dateRange;if(!w)return m("div",{className:"flex items-center justify-center p-8 text-ink/40 text-xs",children:"Loading token usage telemetry..."});return m("div",{className:"w-full space-y-4 text-ink pb-2 text-xs",children:[m("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 pb-3 border-b border-ink/10",children:[m("div",{className:"flex items-center gap-2",children:m("span",{className:"text-xs font-semibold text-ink/75",children:O})}),m("div",{className:"flex flex-wrap items-center gap-2",children:[m("div",{className:"flex items-center bg-paper border border-ink/15 rounded-md text-[11px] font-medium overflow-hidden",children:[m("button",{onClick:()=>r("daily"),className:`px-2.5 py-1 transition-colors ${n==="daily"?"bg-ink/10 text-ink font-semibold":"text-ink/65 hover:bg-ink/5 hover:text-ink"}`,children:"Daily"}),m("button",{onClick:()=>r("weekly"),className:`px-2.5 py-1 transition-colors ${n==="weekly"?"bg-ink/10 text-ink font-semibold":"text-ink/65 hover:bg-ink/5 hover:text-ink"}`,children:"Weekly"}),m("button",{onClick:()=>r("monthly"),className:`px-2.5 py-1 transition-colors ${n==="monthly"?"bg-ink/10 text-ink font-semibold":"text-ink/65 hover:bg-ink/5 hover:text-ink"}`,children:"Monthly"})]}),m("div",{className:"relative",ref:I,children:[m("button",{onClick:()=>s(!o),className:"flex items-center gap-1.5 px-2.5 py-1 bg-paper border border-ink/15 rounded-md text-[11px] font-medium hover:bg-ink/5 text-ink/80 transition-colors",children:[m("span",{children:N.label}),m(Gn,{size:12,className:`transition-transform duration-150 ${o?"rotate-180":""}`})]}),o&&m("div",{className:"absolute right-0 top-full mt-1 w-44 bg-paper border border-ink/15 rounded-md shadow-lg z-30 py-1 text-[11px] divide-y divide-ink/5",children:[C.map((B)=>m("button",{onClick:()=>{if(i(B.id),B.id!=="custom")s(!1)},className:`w-full flex items-center justify-between px-3 py-1.5 text-left hover:bg-ink/5 transition-colors ${a===B.id?"font-semibold text-ink bg-ink/5":"text-ink/70"}`,children:[m("span",{children:B.label}),a===B.id&&m(Vt,{size:12,className:"text-ink"})]},B.id)),a==="custom"&&m("div",{className:"px-3 py-2 space-y-2",children:[m("label",{className:"block",children:[m("span",{className:"text-[9px] font-mono uppercase tracking-wider text-ink/40",children:"From"}),m("input",{type:"date",value:y,max:x,onChange:(B)=>v(B.currentTarget.value),className:"mt-0.5 w-full bg-paper border border-ink/15 rounded px-1.5 py-1 text-[11px] text-ink focus:outline-none focus:border-ink/40"})]}),m("label",{className:"block",children:[m("span",{className:"text-[9px] font-mono uppercase tracking-wider text-ink/40",children:"To"}),m("input",{type:"date",value:x,min:y,max:g,onChange:(B)=>k(B.currentTarget.value),className:"mt-0.5 w-full bg-paper border border-ink/15 rounded px-1.5 py-1 text-[11px] text-ink focus:outline-none focus:border-ink/40"})]}),m("button",{onClick:()=>s(!1),className:"w-full bg-ink/10 hover:bg-ink/20 text-ink font-semibold rounded px-2 py-1 transition-colors",children:"Apply"})]})]})]}),m("button",{onClick:M,className:"p-1.5 bg-paper border border-ink/15 rounded-md hover:bg-ink/5 text-ink/80 transition-colors",title:"Refresh Token Telemetry",children:m(In,{size:12,className:h?"animate-spin text-ink":""})})]})]}),m("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3",children:[m("div",{className:"bg-paper border border-ink/15 rounded-lg p-3.5 shadow-xs flex flex-col justify-between",children:[m("div",{children:[m("div",{className:"text-[10px] font-mono font-semibold text-ink/40 tracking-wider uppercase mb-2",children:"USAGECONFIG.RAWTOKENCOST"}),m("div",{className:"flex items-baseline gap-1 mb-0.5",children:[m("span",{className:"text-2xl font-bold tracking-tight text-ink",children:w.rawCost}),m("span",{className:"text-xs font-semibold text-ink/50",children:"*"})]}),m("p",{className:"text-[11px] text-ink/50 mb-4",children:"* if billed at full API rate"})]}),m("div",{children:[m("div",{className:"h-1.5 w-full bg-ink/10 rounded-full mb-2 overflow-hidden flex",children:m("div",{className:"h-full bg-ink/80 rounded-full",style:{width:"100%"}})}),m("div",{className:"flex items-center justify-between text-[11px]",children:[m("div",{className:"flex items-center gap-1.5",children:[m("div",{className:"w-2 h-2 rounded-full bg-ink/80"}),m("span",{className:"font-semibold text-ink",children:"DeepSeek"})]}),m("div",{className:"flex items-center gap-3 text-ink/70",children:[m("span",{className:"font-bold text-ink",children:w.rawCost}),m("span",{children:"100.0% share"}),m("span",{children:w.processedTokens})]})]})]})]}),m("div",{className:"bg-paper border border-ink/15 rounded-lg p-3.5 shadow-xs flex flex-col",children:[m("div",{className:"flex justify-between items-start mb-3",children:[m("div",{className:"flex items-center gap-2",children:[m("span",{className:"font-semibold text-xs text-ink capitalize",children:[n," ",l]}),m("div",{className:"flex items-center gap-1",children:[m("div",{className:"w-1.5 h-1.5 rounded-full bg-ink/80"}),m("span",{className:"text-[11px] text-ink/60",children:"DeepSeek"})]})]}),m("div",{className:"flex bg-ink/5 rounded p-0.5",children:[m("button",{onClick:()=>u("cost"),className:`px-2 py-0.5 rounded text-[9px] font-bold tracking-wider transition-colors ${l==="cost"?"bg-paper shadow-xs text-ink":"text-ink/50 hover:text-ink"}`,children:"COST"}),m("button",{onClick:()=>u("tokens"),className:`px-2 py-0.5 rounded text-[9px] font-bold tracking-wider transition-colors ${l==="tokens"?"bg-paper shadow-xs text-ink":"text-ink/50 hover:text-ink"}`,children:"TOKENS"})]})]}),m(Man,{cadence:n,metric:l,series:P})]})]}),m(Aan,{activeMetrics:w}),m(Nan,{breakdownTab:d,setBreakdownTab:p,activeBreakdownRows:E,activeMetrics:w,cadence:n}),m("div",{className:"text-center text-[10px] text-ink/40 pt-2",children:["Scanned ",w.scannedTranscripts," transcripts (1 outside the window) · ",w.usageRecords," usage records · 0.1s"]})]})}var $an=D(()=>{Xe();dt();Lan();Ian();Pan();to();de()});function _qr({provider:e,selected:t}){return m("span",{className:t?"text-ink/80":"text-ink/60",children:m(qo,{slug:e.id,name:e.name,size:14})})}function Oan({report:e,selectedProviderId:t,onSelectProvider:n}){let r=pL(e);return m("div",{className:"w-full md:w-64 md:border-r border-ink/10 h-full flex flex-col bg-paper/50 flex-shrink-0 select-none",children:[m("div",{className:"px-3.5 py-2.5 border-b border-ink/10 flex items-center justify-between",children:m("span",{className:"text-xs font-semibold text-ink",children:[r.length," provider",r.length===1?"":"s"," with keys"]})}),m("div",{className:"flex-1 scrollbar-overlay-container p-1.5 space-y-3 text-xs",children:r.length===0?m("p",{className:"px-2.5 py-3 text-[11px] text-ink/50 leading-relaxed",children:"No provider credentials detected. Add an API key in Settings → Providers."}):m("div",{children:[m("div",{className:"px-2.5 pt-1.5 pb-1 text-[10px] font-bold text-ink/50 uppercase tracking-wider",children:"Providers"}),m("div",{className:"space-y-0.5",children:r.map((a)=>{let i=a.id===t;return m("button",{type:"button",onClick:()=>n(a.id),className:`w-full text-left px-2.5 py-2 rounded-lg transition-colors cursor-pointer flex flex-col gap-0.5 group ${i?"bg-ink/10 text-ink font-medium shadow-2xs":"text-ink/80 hover:bg-ink/5 hover:text-ink"}`,children:[m("div",{className:"flex items-center justify-between gap-1.5",children:[m("div",{className:"flex items-center gap-1.5 min-w-0",children:[m("div",{className:"relative",children:[m(_qr,{provider:a,selected:i}),m("span",{className:`absolute -top-0.5 -right-0.5 w-1.5 h-1.5 rounded-full ${a.error?"bg-error/60":"bg-ink"}`})]}),m("span",{className:"font-semibold text-xs text-ink truncate",children:a.name})]}),m("span",{className:`text-[10px] font-mono uppercase px-1.5 py-0.5 rounded bg-ink/10 font-medium ${a.error?"text-error":"text-ink/70"}`,children:mL(a)})]}),m("p",{className:"text-[11px] text-ink/60 line-clamp-1 leading-snug pl-5",children:a.hint})]},a.id)})})]})})]})}var Fan=D(()=>{Vz();lf();de()});function Ban(){let e=ip(),{report:t,isLoading:n,error:r,reload:a}=fie(),[i,o]=ne(""),s=t?pL(t):[],l=s.find((u)=>u.id===i)??s[0];if(Ae(()=>{if(l&&l.id!==i)o(l.id)},[l,i]),r&&!t)return m("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 p-8 text-center text-xs",children:[m(Kn,{size:16,className:"text-error"}),m("p",{className:"text-error text-xs",children:r}),m("button",{type:"button",onClick:()=>a(),className:"text-[11px] font-semibold text-ink/70 hover:text-ink underline underline-offset-2",children:"Try again"})]});if(!t)return m("div",{className:"flex h-full w-full items-center justify-center text-ink/40 text-xs",children:"Loading provider usage..."});return m("div",{className:"flex h-full w-full overflow-hidden bg-paper text-xs text-ink",children:m(op,{pane:e.pane,onBack:e.back,listLabel:"Usage",list:m(Oan,{report:t,selectedProviderId:l?.id??"",onSelectProvider:(u)=>{o(u),e.openDetail()}}),detail:m("div",{className:"flex-1 h-full overflow-hidden flex flex-col",children:[m("div",{className:"px-3.5 py-2.5 border-b border-ink/10 flex items-center justify-between gap-3 flex-shrink-0",children:[m("div",{className:"flex items-center gap-2 min-w-0",children:[m("span",{className:"text-xs font-semibold text-ink/75 truncate",children:["Updated ",rb(t.generatedAt)]}),t.isMock&&m("span",{className:"text-[10px] font-mono uppercase tracking-wider bg-ink/5 border border-ink/15 rounded px-1.5 py-0.5 text-ink/60",children:"Mock"})]}),m("button",{type:"button",onClick:()=>a({force:!0}),disabled:n,className:"p-1.5 bg-paper border border-ink/15 rounded-md hover:bg-ink/5 text-ink/80 transition-colors disabled:opacity-50 flex-shrink-0",title:"Refresh usage",children:m(In,{size:12,className:n?"animate-spin text-ink":""})})]}),m("div",{className:"flex-1 overflow-y-auto scrollbar-overlay-container p-3.5 space-y-4",children:[r&&m("p",{className:"text-error text-xs",children:r}),l?m(uie,{summary:l.summary}):m("p",{className:"text-[11px] text-ink/50 leading-relaxed",children:"No provider credentials detected. Add an API key in Settings → Providers and it will appear here."}),m(hie,{})]})]})})})}var zan=D(()=>{Xe();dt();Fan();Vz();jLe();ULe();Ry();qLe();U2();G2();de()});function jan({settings:e,onUpdate:t}){let[n,r]=ne(!1),a=()=>{r(!0),Pie(),setTimeout(()=>r(!1),600)},i=e.chatCompletionSound??e.soundAlerts??!0;return m("div",{className:"w-full space-y-6 text-xs text-ink",children:m("div",{className:"bg-paper border border-ink/15 rounded-lg p-4 shadow-xs space-y-4",children:[m("div",{className:"flex items-start justify-between gap-4",children:[m("div",{className:"flex items-start gap-3",children:[m("div",{className:"w-8 h-8 rounded-md bg-ink/5 border border-ink/10 flex items-center justify-center flex-shrink-0 mt-0.5",children:i?m(N6,{size:16,className:"text-ink"}):m(hI,{size:16,className:"text-ink/40"})}),m("div",{children:[m("div",{className:"text-sm font-semibold text-ink flex items-center gap-2",children:[m("span",{children:"AI Response Completion Sound"}),m("span",{className:"text-[10px] uppercase font-mono px-1.5 py-0.5 rounded bg-ink/10 text-ink/80 font-bold",children:"Audio Chime"})]}),m("p",{className:"text-ink/65 text-[11px] mt-1 leading-relaxed",children:"Play an audible notification chime when the AI completes generating its response, thinking blocks, or diagnostic execution."})]})]}),m("button",{type:"button",role:"switch","aria-checked":i,onClick:()=>{let o=!i;if(t({chatCompletionSound:o,soundAlerts:o}),o)Pie()},className:`relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none ${i?"bg-ink":"bg-ink/20"}`,children:m("span",{"aria-hidden":"true",className:`pointer-events-none inline-block h-5 w-5 transform rounded-full bg-paper shadow ring-0 transition duration-200 ease-in-out ${i?"translate-x-5":"translate-x-0"}`})})]}),m("div",{className:"pt-3 border-t border-ink/10 flex items-center justify-between",children:[m("span",{className:"text-[11px] text-ink/60 flex items-center gap-1.5",children:[m(Wi,{size:13,className:"text-ink/60"}),"Warm harmonic chime synthesized natively via Web Audio"]}),m("button",{type:"button",onClick:a,className:`px-3 py-1.5 rounded-md border border-ink/20 bg-paper hover:bg-ink/5 text-ink font-medium text-[11px] flex items-center gap-1.5 transition-all shadow-xs active:scale-95 ${n?"border-ink bg-ink/10":""}`,children:[m(N6,{size:13,className:n?"animate-bounce text-ink":"text-ink/70"}),m("span",{children:n?"Playing...":"Test Sound"})]})]})]})})}var Uan=D(()=>{Xe();dt();nj();de()});function Cqr({isOpen:e,onClose:t,initialCategory:n="appearance",appSettings:r={},autoOpenAddProvider:a=!1}){let[i,o]=ne(n),[s,l]=ne(a),[u,d]=ne(""),[p,h]=ne(!1),[f,g]=ne(null),[b,y]=ne("success"),v=oae(),{isReloading:x,reload:k}=fen(),{isRestarting:C,restart:_}=ben(),w=(N,O="success")=>{g(N),y(O),setTimeout(()=>g((B)=>B===N?null:B),3000)},[T,E]=ne(()=>Gje(wqr,r));Ae(()=>{if(e)o(n),l(a),h(a),d("")},[e,n,a]),Wo("omp:open-settings",(N)=>{let O=N;if(O.detail?.category)o(O.detail.category);if(O.detail?.autoOpenAdd)l(!0)});let L=(N)=>{E((O)=>{let B=typeof N==="function"?N(O):{...O,...N};if(typeof document<"u"&&B.theme)uae(B.theme);if(typeof window<"u"&&B.editorFont!==O.editorFont)window.dispatchEvent(new CustomEvent(Eie,{detail:B.editorFont}));return v(ien(O,B,N)),B}),w("Setting was saved")},P=async()=>{let N=await k();w(N.message,N.ok?"success":"error")},R=async()=>{let N=await _();w(N.message,N.ok?"success":"error")},I=(N)=>{o(N),h(!0)};if(!e)return null;let A=Rie.find((N)=>N.id===i)||Rie[0],M=()=>{switch(i){case"appearance":return m(Ren,{settings:T,onUpdate:L});case"chats":return m(jen,{settings:T,onUpdate:L});case"projects":return m(ftn,{});case"providers":return m(Lnn,{autoOpenAdd:s,onAddModalClose:()=>l(!1)});case"agents":return m(Dnn,{settings:T,onUpdate:L});case"behavior":return m(znn,{});case"commands":return m(Hnn,{settings:T,onUpdate:L});case"mcp":return m(nrn,{settings:T,onUpdate:L});case"token-usage":return m(Dan,{settings:T,onUpdate:L});case"notifications":return m(jan,{settings:T,onUpdate:L});case"plugins":return m(krn,{});case"panel-plugins":return m(jrn,{});case"skills":return m(lrn,{settings:T,onUpdate:L,onNavigateToCatalog:()=>o("skills-catalog")});case"skills-catalog":return m(Vrn,{});case"omp":return m(Tan,{settings:T,onUpdate:L});case"usage":return m(Ban,{});default:return m(Krn,{category:i})}};return m("div",{className:"fixed inset-0 bg-ink/40 backdrop-blur-[2px] z-50 flex items-center justify-center p-0 md:p-6 animate-in fade-in duration-150",onClick:t,children:m("div",{className:"relative bg-paper border border-ink/15 md:rounded-2xl shadow-2xl w-full h-full md:max-w-4xl lg:max-w-5xl xl:max-w-[1150px] md:h-[782px] md:max-h-[92vh] flex flex-col md:flex-row overflow-hidden text-ink",onClick:(N)=>N.stopPropagation(),children:[m("div",{className:"hidden md:flex w-64 flex-shrink-0 h-full",children:m(KLe,{activeCategory:i,onSelectCategory:(N)=>o(N),searchQuery:u,onSearchChange:d,onReloadOmp:P,isReloading:x,onRestartKabmo:R,isRestarting:C,className:"w-full"})}),m("div",{className:`flex-1 flex-col h-full bg-paper overflow-hidden ${p?"flex":"hidden md:flex"}`,children:[m("div",{className:"px-6 border-b border-ink/10 flex items-center justify-between flex-shrink-0 bg-paper",style:{height:"calc(4rem + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)",paddingLeft:"max(1.5rem, env(safe-area-inset-left, 0px))",paddingRight:"max(1.5rem, env(safe-area-inset-right, 0px))"},children:[m("div",{className:"flex items-center space-x-3 min-w-0",children:[m("button",{type:"button",onClick:()=>h(!1),className:"md:hidden p-1.5 -ml-2 rounded-lg hover:bg-ink/5 active:bg-ink/10 text-ink","aria-label":"Back to categories",children:m(Vy,{size:20})}),m("div",{className:"truncate",children:[m("h3",{className:"font-semibold text-base tracking-tight text-ink leading-tight",children:A.label}),m("p",{className:"text-[11px] text-ink/60 truncate hidden sm:block",children:A.description})]})]}),m("button",{type:"button",onClick:t,className:"p-1.5 rounded-lg text-ink/50 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer","aria-label":"Close settings",children:m(gn,{size:18,strokeWidth:2.2})})]}),m("div",{className:`flex-1 scrollbar-overlay-container w-full ${["projects","providers","agents","behavior","commands","mcp","plugins","skills","skills-catalog","usage","panel-plugins"].includes(i)?"p-0 flex flex-col":"p-6 md:p-8 flex flex-col"}`,style:{paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:m("div",{className:"w-full h-full flex-1 flex flex-col",children:M()})})]}),m("div",{className:`flex-1 flex-col h-full bg-canvas md:hidden ${p?"hidden":"flex"}`,children:[m("div",{className:"px-4 border-b border-ink/10 flex items-center justify-between flex-shrink-0 bg-canvas",style:{height:"calc(3.5rem + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)",paddingLeft:"max(1rem, env(safe-area-inset-left, 0px))",paddingRight:"max(1rem, env(safe-area-inset-right, 0px))"},children:[m("span",{className:"font-bold text-sm tracking-tight text-ink",children:"Settings"}),m("button",{type:"button",onClick:t,className:"p-1.5 rounded-lg text-ink/50 hover:text-ink","aria-label":"Close",children:m(gn,{size:18})})]}),m("div",{className:"flex-1 overflow-hidden",style:{paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:m(KLe,{activeCategory:i,onSelectCategory:I,searchQuery:u,onSearchChange:d,onReloadOmp:P,isReloading:x,onRestartKabmo:R,isRestarting:C,className:"w-full border-r-0"})})]}),f&&m("div",{className:"absolute bottom-6 left-1/2 transform -translate-x-1/2 bg-ink text-canvas px-4 py-2 rounded-lg text-xs font-semibold shadow-lg animate-in fade-in slide-in-from-bottom-2 z-50 flex items-center space-x-2 max-w-[calc(100%-2rem)]",children:[b==="error"?m(Kn,{size:14,className:"text-error shrink-0"}):m(Vt,{size:14,className:"text-success shrink-0"}),m("span",{children:f})]})]})})}var wqr;var qan=D(()=>{Xe();dt();_c();G7e();gen();yen();Y9();Gb();G4();Lie();vg();wen();Nen();Uen();gtn();Rnn();$nn();jnn();Vnn();rrn();crn();_rn();Urn();Zrn();Yrn();Ean();$an();zan();Uan();de();wqr={theme:RC,editorFont:tj,autoSessionTitle:!0,soundAlerts:!0,chatCompletionSound:!0,goalAuditEnabled:!0,goalAuditModel:"",goalDefaultBudget:null,followUpBehavior:"queue",keybindingSend:"Enter",keybindingNewLine:"Shift + Enter",keybindingSteering:"Ctrl / Cmd + Enter"}});function FT({isOpen:e,...t}){if(!e)return null;return m(co,{fallback:null,children:m(Sqr,{isOpen:e,...t})})}var Sqr;var sj=D(()=>{ka();de();Sqr=bi(()=>Promise.resolve().then(() => (qan(),{})).then((e)=>({default:Cqr})))});var Hie;var bRe=D(()=>{Hie={name:"@kabmo-labs/kabmo",version:"0.7.0",description:"Web console and diagnostic workbench for AI coding agents — Elysia + Preact on Bun.",license:"UNLICENSED",author:"Wijanarko Putra Rajeb <wijanarko.rajeb@gmail.com>",type:"module",engines:{bun:">=1.4.0"},publishConfig:{access:"public"},bin:{kabmo:"./src/cli/kabmo.js"},repository:{type:"git",url:"git+https://github.com/kabmo-labs/kabmo.git"},homepage:"https://github.com/kabmo-labs/kabmo#readme",bugs:{url:"https://github.com/kabmo-labs/kabmo/issues"},keywords:["kabmo","coding-agent","agent","console","elysia","preact","bun"],files:["src","extensions","index.html","bunfig.toml","public","tsconfig.json","marketplace","dist/client"],scripts:{dev:"bun run --hot src/server/index.ts --kabmo-server","dev:lan":"HOST=0.0.0.0 bun run --hot src/server/index.ts --kabmo-server",build:"bun run scripts/build-client.ts","omp:schema":"bun run scripts/omp-schema.mjs","omp:schema:check":"bun run scripts/omp-schema.mjs --check",start:"NODE_ENV=production bun run src/server/index.ts --kabmo-server",typecheck:"tsc",clean:"rm -rf dist",lint:"tsc --noEmit",test:"bun test","test:e2e":"playwright test --config tests/e2e/playwright.config.ts","readme:media":"bun run scripts/readme-media.ts","typecheck:e2e":"tsc --noEmit -p tests/e2e","publish:plugins":"bash .github/scripts/publish-plugin-packages.sh packages/kabmo-sdk packages/kabmo-ui"},dependencies:{"@fontsource/fira-code":"^5.3.0","@kabmo-labs/kabmo-sdk":"workspace:*","@kabmo-labs/kabmo-ui":"workspace:*","@shikijs/langs":"^4.4.3","@shikijs/themes":"^4.4.3","@tailwindcss/postcss":"^4.1.14","@xterm/addon-fit":"^0.11.0","@xterm/addon-webgl":"^0.19.0","@xterm/xterm":"^6.0.0",dompurify:"^3.4.15",elysia:"^1.4.30",katex:"^0.18.7","lucide-preact":"^1.47.0",mammoth:"^1.13.0",marked:"^18.0.11","marked-linkify-it":"^4.0.2",mermaid:"^12.0.0",postcss:"^8.5.16",preact:"^10.29.8","read-excel-file":"^9.3.12",remend:"^1.3.1",ripgrep:"^0.3.1",shiki:"^4.4.3",tailwindcss:"^4.1.14",yaml:"^2.9.1"},devDependencies:{"@playwright/test":"^1.64.0","@semantic-release/changelog":"^7.0.0","@semantic-release/commit-analyzer":"^13.0.1","@semantic-release/git":"^11.0.1","@semantic-release/github":"^12.0.10","@semantic-release/npm":"^13.2.0","@semantic-release/release-notes-generator":"^14.1.1","@types/bun":"^1.4.2","@types/node":"^22.14.0","bun-types":"^1.4.2","conventional-changelog-conventionalcommits":"^9.3.1","happy-dom":"^20.14.5","semantic-release":"^25.0.9",typescript:"~5.8.2"},workspaces:["packages/*"]}});function Wan({className:e=""}){return m("svg",{viewBox:"0 0 64 64",className:`inline-block h-[1.1009em] w-auto flex-none [vertical-align:-0.1982em] ${e}`,style:{height:"1.5625cap",verticalAlign:"-0.28125cap",marginRight:"-0.28em"},"aria-hidden":"true",focusable:"false",children:[m("rect",{width:"64",height:"64",rx:"14",style:{fill:"var(--color-brand-tile)"}}),m("g",{fill:"none",strokeWidth:7,strokeLinecap:"round",strokeLinejoin:"round",children:[m("path",{d:"M20 15v34",style:{stroke:"var(--color-brand-cream)"}}),m("path",{d:"M20 32 42 15",style:{stroke:"var(--color-brand)"}}),m("path",{d:"M20 32 42 49",style:{stroke:"var(--color-brand-cream)"}})]})]})}var Gan=D(()=>{de()});function kg({className:e="text-[15px]"}){return m("span",{className:`font-extrabold tracking-tight ${e}`,children:[m(Wan,{}),m("span",{className:"sr-only",children:"K"}),m("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-amber-500 to-orange-600",style:{paddingRight:"0.06em",marginRight:"-0.06em"},children:"ab"}),m("span",{className:"text-ink",style:{marginLeft:"0.02em"},children:"mo"})]})}var BT=D(()=>{Gan();de()});function Han(){return m("div",{className:"flex flex-col items-center gap-4 mt-6 pt-1",children:[m("div",{className:"flex items-center justify-center gap-6",children:[m("a",{href:"https://discord.gg/TWYp6K2jd",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-xs font-medium text-ink/75 hover:text-ink transition-colors",children:[m("svg",{className:"w-4 h-4 fill-current",viewBox:"-1.611 -1.611 27.223 27.223",children:m("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994.021-.041.001-.09-.041-.106a13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.929 1.793 8.18 1.793 12.061 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.894.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.028zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"})}),m("span",{children:"Discord"})]}),m("a",{href:"https://www.instagram.com/kabmo-labs/",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-xs font-medium text-ink/75 hover:text-ink transition-colors",children:[m("svg",{className:"w-4 h-4 fill-current",viewBox:"0 0 24 24",children:m("path",{d:"M7.0301.084c-1.2768.0602-2.1487.264-2.911.5634-.7888.3075-1.4575.72-2.1228 1.3877-.6652.6677-1.075 1.3368-1.3802 2.127-.2954.7638-.4956 1.6365-.552 2.914-.0564 1.2775-.0689 1.6882-.0626 4.947.0062 3.2586.0206 3.6671.0825 4.9473.061 1.2765.264 2.1482.5635 2.9107.308.7889.72 1.4573 1.388 2.1228.6679.6655 1.3365 1.0743 2.1285 1.38.7632.295 1.6361.4961 2.9134.552 1.2773.056 1.6884.069 4.9462.0627 3.2578-.0062 3.668-.0207 4.9478-.0814 1.28-.0607 2.147-.2652 2.9098-.5633.7889-.3086 1.4578-.72 2.1228-1.3881.665-.6682 1.0745-1.3378 1.3795-2.1284.2957-.7632.4966-1.636.552-2.9124.056-1.2809.0692-1.6898.063-4.948-.0063-3.2583-.021-3.6668-.0817-4.9465-.0607-1.2797-.264-2.1487-.5633-2.9117-.3084-.7889-.72-1.4568-1.3876-2.1228C21.2982 1.33 20.628.9208 19.8378.6165 19.074.321 18.2017.1197 16.9244.0645 15.6471.0093 15.236-.005 11.977.0014 8.718.0076 8.31.0215 7.0301.0839m.1402 21.6932c-1.17-.0509-1.8053-.2453-2.2287-.408-.5606-.216-.96-.4771-1.3819-.895-.422-.4178-.6811-.8186-.9-1.378-.1644-.4234-.3624-1.058-.4171-2.228-.0595-1.2645-.072-1.6442-.079-4.848-.007-3.2037.0053-3.583.0607-4.848.05-1.169.2456-1.805.408-2.2282.216-.5613.4762-.96.895-1.3816.4188-.4217.8184-.6814 1.3783-.9003.423-.1651 1.0575-.3614 2.227-.4171 1.2655-.06 1.6447-.072 4.848-.079 3.2033-.007 3.5835.005 4.8495.0608 1.169.0508 1.8053.2445 2.228.408.5608.216.96.4754 1.3816.895.4217.4194.6816.8176.9005 1.3787.1653.4217.3617 1.056.4169 2.2263.0602 1.2655.0739 1.645.0796 4.848.0058 3.203-.0055 3.5834-.061 4.848-.051 1.17-.245 1.8055-.408 2.2294-.216.5604-.4763.96-.8954 1.3814-.419.4215-.8181.6811-1.3783.9-.4224.1649-1.0577.3617-2.2262.4174-1.2656.0595-1.6448.072-4.8493.079-3.2045.007-3.5825-.006-4.848-.0608M16.953 5.5864A1.44 1.44 0 1 0 18.39 4.144a1.44 1.44 0 0 0-1.437 1.4424M5.8385 12.012c.0067 3.4032 2.7706 6.1557 6.173 6.1493 3.4026-.0065 6.157-2.7701 6.1506-6.1733-.0065-3.4032-2.771-6.1565-6.174-6.1498-3.403.0067-6.156 2.771-6.1496 6.1738M8 12.0077a4 4 0 1 1 4.008 3.9921A3.9996 3.9996 0 0 1 8 12.0077"})}),m("span",{children:"Instagram"})]}),m("a",{href:"https://www.threads.com/@kabmo-labs",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-xs font-medium text-ink/75 hover:text-ink transition-colors",children:[m("svg",{className:"w-4 h-4 fill-current",viewBox:"0 0 24 24",children:m("path",{d:"M18.263 11.097c-.03-3.486-1.92-5.586-5.111-5.586-2.13 0-3.922.963-4.863 2.499l2.062 1.438c.535-.843 1.272-1.543 2.628-1.543 1.528 0 2.318.85 2.544 2.431a15 15 0 0 0-2.236-.173c-4.125 0-6.068 1.867-6.068 4.336s1.943 3.99 4.804 3.99c3.139 0 5.013-2.115 5.781-4.735.798.361 1.348 1.204 1.348 2.47 0 3.387-3.907 5.232-7.22 5.232-4.885 0-8.077-3.207-8.077-8.424 0-6.392 4.223-10.487 9.9-10.487 3.808 0 5.69 1.671 6.97 3.914l2.108-1.475C21.44 2.078 18.331 0 13.663 0 6.227 0 1.168 5.277 1.168 12.934c0 7 4.953 11.066 10.856 11.066 4.878 0 9.809-2.846 9.809-7.716 0-2.545-1.46-4.231-3.569-5.187m-6.33 4.855c-1.077 0-2.026-.512-2.026-1.453 0-1.483 1.822-1.934 3.606-1.934.678 0 1.34.045 1.927.173-.422 1.927-1.671 3.215-3.508 3.214Z"})}),m("span",{children:"Threads"})]})]}),m("div",{className:"flex items-center justify-center gap-6",children:m("a",{href:"https://github.com/kabmo-labs/kabmo",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-xs font-medium text-ink/75 hover:text-ink transition-colors",children:[m("svg",{className:"w-4 h-4 fill-current",viewBox:"1.902 1.902 20.196 20.196",children:m("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.53 1.032 1.53 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"})}),m("span",{children:"GitHub"})]})})]})}var Van=D(()=>{de()});function Vie(e,t){let n=(e.pending+t).split(`
5000
5000
  `),r=n.pop()??"";if(n.length===0)return{...e,pending:r};let a=[...e.lines,...n],i=e.truncated,o=a.reduce((l,u)=>l+u.length+1,0),s=0;while(o>20000&&s<a.length-1)o-=(a[s]?.length??0)+1,s+=1;if(s>0)a=a.slice(s),i=!0;return{lines:a,pending:r,truncated:i}}function Zan(e){return(e.pending?[...e.lines,e.pending]:e.lines).join(`
5001
5001
  `)}function Kan({state:e,active:t}){let n=Le(null),r=Zan(e);if(Ae(()=>{let a=n.current;if(a)a.scrollTop=a.scrollHeight},[r]),!r&&!t)return null;return m("div",{className:"mt-2.5",children:[m("div",{className:"mb-1 flex items-center gap-1.5 text-[10px] text-ink/50",children:[t?m(en,{size:11,className:"animate-spin motion-reduce:animate-none"}):m($a,{size:11}),m("span",{children:t?"Updating…":"Update output"}),e.truncated&&m("span",{className:"text-ink/35",children:"· older lines trimmed"})]}),m("pre",{ref:n,className:"max-h-40 overflow-auto rounded-md border border-ink/10 bg-canvas px-2 py-1.5 font-mono text-[10px] leading-4 whitespace-pre-wrap break-words text-ink/70 select-text",children:r||"…"})]})}var Yan=D(()=>{Xe();dt();de()});function Eqr(){let e=Oi(Xan);return typeof e==="string"&&e.trim().length>0?e.trim():null}function Jan(e,t=Eqr()){if(!e)return!1;return e!==t}function Qan(e){Hu(Xan,e)}var Xan="omp_update_popup_version",TL="omp:update-popup",EL="omp:update-request";var AL=D(()=>{_c()});function Aqr({target:e,info:t,applying:n,disabled:r,onApply:a}){let i=e==="kabmo"?"Kabmo":"Oh-My-Pi",o=`v${t.current??"…"} → v${t.latest??"…"}`;return m("div",{className:"flex items-center justify-between gap-3 border-t border-ink/10 py-2.5 first:border-t-0",children:[m("div",{className:"min-w-0",children:[m("p",{className:"text-xs font-medium text-ink",children:i}),m("p",{className:"font-mono text-[10px] text-ink/60",children:t.installed?o:"not detected"})]}),t.installed?m("button",{type:"button",onClick:()=>a(e),disabled:r,className:zT,children:[n?m(en,{size:12,className:"animate-spin motion-reduce:animate-none"}):m(ki,{size:12}),m("span",{children:"Update"})]}):m("span",{className:"shrink-0 text-[10px] text-ink/40",children:"not detected"})]})}function ein({updates:e,onToast:t}){let n=e.info?[{target:"kabmo",info:e.info.kabmo},{target:"omp",info:e.info.omp}].filter(({info:i})=>i.updateAvailable&&i.latest!==null):[],r=async(i)=>{let o=await e.apply(i);if(!t)return;if(!o)return;t(o.message,o.success&&!o.manual?"success":"error")},a=Boolean(e.info&&!e.checking&&!e.error);return m("section",{className:"mt-5 border-y border-ink/10 py-3 text-left","aria-labelledby":"updates-heading",children:[m("div",{className:"flex items-center justify-between gap-3",children:[m("h3",{id:"updates-heading",className:"text-xs font-semibold text-ink",children:"Updates"}),e.info&&m("span",{className:"font-mono text-[9px] text-ink/40",children:"checked"})]}),e.progress&&m(Kan,{state:e.progress,active:e.applying!==null}),m("div",{className:"mt-2.5",children:[e.checking&&m("button",{type:"button",disabled:!0,className:`${zT} w-full justify-center`,children:[m(en,{size:13,className:"animate-spin motion-reduce:animate-none"}),m("span",{children:"Checking…"})]}),e.error&&!e.checking&&m("div",{className:"flex items-start gap-2",children:[m(Kn,{size:14,className:"mt-0.5 shrink-0 text-error"}),m("div",{className:"min-w-0 flex-1",children:[m("p",{className:"text-[11px] leading-4 text-error",children:e.error}),m("button",{type:"button",onClick:()=>void e.check(),className:`${zT} mt-2`,children:[m(In,{size:12}),m("span",{children:"Retry"})]})]})]}),!e.info&&!e.checking&&!e.error&&m("button",{type:"button",onClick:()=>void e.check(),className:`${zT} w-full justify-center`,children:[m(In,{size:13}),m("span",{children:"Check for updates"})]}),a&&n.length===0&&m("div",{className:"flex items-center justify-between gap-3",children:[m("p",{className:"flex items-center gap-1.5 text-[11px] text-success",children:[m(Vt,{size:13}),m("span",{children:"You're up to date"})]}),m("button",{type:"button",onClick:()=>void e.check(),className:zT,children:[m(In,{size:12}),m("span",{children:"Check again"})]})]}),a&&n.length>0&&m("div",{children:[n.map(({target:i,info:o})=>m(Aqr,{target:i,info:o,applying:e.applying===i,disabled:e.applying!==null,onApply:(s)=>void r(s)},i)),e.info?.kabmo.updateAvailable&&m("button",{type:"button",onClick:()=>window.dispatchEvent(new CustomEvent(TL)),disabled:e.applying!==null,className:`${zT} mt-2 w-full justify-center`,children:[m(Wi,{size:12}),m("span",{children:["What's new in ",e.info.kabmo.latest]})]}),m("button",{type:"button",onClick:()=>void e.check(),disabled:e.applying!==null,className:`${zT} mt-2 w-full justify-center`,children:[m(In,{size:12}),m("span",{children:"Check again"})]})]})]})]})}var zT="inline-flex items-center gap-1.5 rounded-md border border-ink/20 px-2.5 py-1.5 text-[11px] font-medium text-ink transition-colors hover:border-ink/40 disabled:cursor-not-allowed disabled:opacity-50";var tin=D(()=>{dt();Yan();AL();de()});function lj({isOpen:e,onClose:t,updates:n,onToast:r}){if(Wo(TL,()=>{if(e)t()}),!e)return null;return Eo(m("div",{className:"fixed inset-0 bg-ink/40 backdrop-blur-[2px] z-50 flex items-center justify-center p-4 animate-in fade-in duration-200",onClick:t,children:m("div",{className:"relative bg-paper border border-ink/15 rounded-2xl shadow-2xl w-full max-w-[340px] p-6 text-center text-ink select-none",onClick:(a)=>a.stopPropagation(),children:[m("button",{onClick:t,className:"absolute top-4 right-4 text-ink/40 hover:text-ink transition-colors p-1 rounded-md","aria-label":"Close",children:m(gn,{size:18,className:"stroke-[2.5]"})}),m("div",{className:"flex justify-center pt-2 pb-1",children:m("img",{src:"/icon.svg",alt:"Kabmo",width:96,height:96,draggable:!1})}),m("h2",{className:"text-xl font-bold tracking-tight mt-3 flex items-center justify-center",children:m(kg,{className:"text-2xl"})}),m("div",{className:"text-xs text-ink/60 space-y-1 mt-1.5 font-mono",children:[m("p",{children:["Kabmo v",Hie.version]}),m("p",{children:["Oh-My-Pi ",n.info?.omp.current??"…"]})]}),m(ein,{updates:n,onToast:r}),m(Han,{}),m("p",{className:"text-[11px] text-ink/50 font-normal mt-8 flex items-center justify-center gap-1.5",children:[m(Ug,{size:12,className:"fill-current text-error shrink-0","aria-hidden":"true"}),"Made with love for the community"]})]})}),document.body)}var yRe=D(()=>{ka();dt();bRe();BT();Van();tin();vg();AL();de()});async function Zie(e){let t=e?`?path=${encodeURIComponent(e)}`:"",n=await fetch(`/api/fs/browse${t}`),r=await n.json();if(!n.ok||r.error)throw Error(r.error||`HTTP ${n.status}`);return r}function nin({initialPath:e,onSelect:t,onClose:n}){let[r,a]=ne(e??""),[i,o]=ne(""),[s,l]=ne([]),[u,d]=ne(null),[p,h]=ne(!0),[f,g]=ne(null),[b,y]=ne(null),v=Le(null),x=Se(async(E)=>{h(!0),g(null);try{let L=await Zie(E);a(L.path??E??""),d(L.parentPath??null),o(L.path??E??""),l(L.directories??[])}catch(L){g(L instanceof Error?L.message:String(L))}finally{h(!1)}},[]);Ae(()=>{x(e)},[e,x]);let k=()=>{if(u)x(u)},C=(E)=>{E.preventDefault();let L=i.trim();if(L)x(L)},_=(E)=>{x(E.path)},w=(E)=>{y(E.path),t(E.path)},T=()=>{if(r)y(r),t(r)};return m("div",{className:"fixed inset-0 bg-ink/30 z-[60] flex items-center justify-center p-4",onClick:n,children:m("div",{className:"bg-paper border border-ink/15 rounded-lg shadow-2xl w-full max-w-lg flex flex-col overflow-hidden",onClick:(E)=>E.stopPropagation(),children:[m("div",{className:"flex items-center justify-between px-4 py-3 border-b border-ink/10",children:[m("h3",{className:"font-semibold text-sm flex items-center space-x-2",children:[m(Id,{size:15,className:"text-ink/70"}),m("span",{children:"Choose Project Folder"})]}),m("button",{type:"button",onClick:n,className:"p-1 rounded hover:bg-ink/10 text-ink/60 hover:text-ink transition-colors","aria-label":"Close picker",children:m(gn,{size:15})})]}),m("div",{className:"px-4 py-2 border-b border-ink/10 bg-canvas/50",children:[m("form",{onSubmit:C,className:"flex items-center space-x-2",children:[m(Bu,{size:14,className:"text-ink/40 flex-shrink-0"}),m("input",{ref:v,type:"text",value:i,onChange:(E)=>o(E.currentTarget.value),placeholder:"~ or /absolute/path",className:"flex-1 bg-transparent outline-none text-xs font-mono text-ink placeholder-ink/30 py-1",spellcheck:!1}),m("button",{type:"submit",className:"px-2 py-1 rounded bg-ink/5 border border-ink/10 text-[11px] font-medium hover:bg-ink/10 transition-colors",children:"Go"})]}),m("div",{className:"flex items-center space-x-1 mt-1 text-[11px] text-ink/40 truncate",children:[m("button",{type:"button",onClick:()=>void x(),className:"hover:text-ink transition-colors flex items-center",children:[m(Bu,{size:11,className:"mr-0.5"})," home"]}),r.split("/").filter(Boolean).map((E,L,P)=>{let R="/"+r.split("/").filter(Boolean).slice(0,L+1).join("/"),I=L===P.length-1;return m("span",{className:"flex items-center space-x-1 min-w-0",children:[m(yi,{size:10,className:"text-ink/20 flex-shrink-0"}),I?m("span",{className:"text-ink/70 truncate",children:E}):m("button",{type:"button",onClick:()=>void x(R),className:"hover:text-ink transition-colors truncate max-w-[120px]",children:E})]},R)})]})]}),m("div",{className:"flex-1 min-h-[240px] max-h-[360px] scrollbar-overlay-container p-2",children:p?m("div",{className:"flex items-center justify-center h-40 text-ink/40",children:m(en,{size:18,className:"animate-spin"})}):f?m("div",{className:"flex flex-col items-center justify-center h-40 text-xs text-red-600 space-y-2 px-4",children:[m("span",{children:f}),m("button",{type:"button",onClick:()=>void x(r||void 0),className:"px-2 py-1 rounded bg-ink/5 border border-ink/10 text-ink/70 hover:bg-ink/10 flex items-center space-x-1",children:[m(In,{size:11})," Retry"]})]}):s.length===0?m("div",{className:"text-center py-16 text-xs text-ink/40",children:"No subfolders"}):s.map((E)=>m("div",{className:`group flex items-center justify-between px-2.5 py-2 rounded cursor-pointer transition-colors ${b===E.path?"bg-ink/10":"hover:bg-ink/5"}`,onDblClick:()=>_(E),children:[m("button",{type:"button",onClick:()=>_(E),className:"flex items-center space-x-2 min-w-0 flex-1 text-left",children:[m($i,{size:15,className:"text-ink/50 flex-shrink-0"}),m("span",{className:"text-xs truncate text-ink/85",children:E.name})]}),m("button",{type:"button",onClick:()=>w(E),className:"touch-shown-flex hidden group-hover:flex px-2 py-0.5 rounded bg-ink text-canvas text-[10px] font-semibold hover:bg-ink/80 transition-colors flex-shrink-0",children:"Choose"})]},E.path))}),m("div",{className:"flex items-center justify-between px-4 py-3 border-t border-ink/10",children:[m("div",{className:"flex items-center space-x-2 min-w-0",children:[m("button",{type:"button",onClick:k,disabled:!u,className:"px-2.5 py-1.5 rounded bg-ink/5 border border-ink/10 text-[11px] font-medium hover:bg-ink/10 disabled:opacity-40 transition-colors flex items-center space-x-1",children:[m("span",{children:"↑"}),m("span",{children:"Up"})]}),m("button",{type:"button",onClick:()=>void x(),className:"px-2.5 py-1.5 rounded bg-ink/5 border border-ink/10 text-[11px] font-medium hover:bg-ink/10 transition-colors",children:"Home"})]}),m("div",{className:"flex items-center space-x-2",children:[m("button",{type:"button",onClick:n,className:"px-3 py-1.5 text-xs font-medium text-ink/60 hover:text-ink transition-colors",children:"Cancel"}),m("button",{type:"button",onClick:T,disabled:!r,className:"px-3.5 py-1.5 text-xs font-medium bg-ink text-canvas rounded hover:bg-ink/90 disabled:opacity-50 transition-colors",children:"Use This Folder"})]})]})]})})}var rin=D(()=>{Xe();dt();de()});function ain({value:e,onInput:t,onSubmit:n,onRefresh:r,onNewFolder:a,loading:i,creating:o,resolved:s}){return m("div",{children:[m("div",{className:"flex items-center space-x-2",children:[m("form",{onSubmit:(u)=>{u.preventDefault(),n()},className:"flex-1 flex items-center bg-paper border border-ink/20 rounded overflow-hidden focus-within:border-ink/50",children:[m("div",{className:"px-2 text-ink/40 bg-ink/5 h-full flex items-center border-r border-ink/10",children:m(Bu,{size:14})}),m("input",{type:"text",value:e,onChange:(u)=>t(u.currentTarget.value),placeholder:"~/projects/my-project",spellcheck:!1,"aria-label":"Project path",className:"w-full px-3 py-2 outline-none text-sm bg-transparent font-mono"})]}),m("button",{type:"button",onClick:r,disabled:i,title:"Refresh folders","aria-label":"Refresh folders","aria-busy":i,className:"px-2.5 py-2 bg-ink/5 border border-ink/10 rounded text-ink/70 hover:bg-ink/10 hover:text-ink disabled:opacity-40 transition-colors flex-shrink-0",children:m(In,{size:13,className:i?"animate-spin":void 0})}),m("button",{type:"button",onClick:a,disabled:o||i||!s,title:"New folder here","aria-label":"New folder here","aria-busy":o,className:"px-2.5 py-2 bg-ink/5 border border-ink/10 rounded text-ink/70 hover:bg-ink/10 hover:text-ink disabled:opacity-40 transition-colors flex-shrink-0",children:o?m(en,{size:13,className:"animate-spin"}):m(jg,{size:13})})]}),s&&s!==e.trim()&&m("p",{className:"mt-1 text-[10px] text-ink/40 font-mono truncate",children:["Listing: ",s]})]})}var iin=D(()=>{dt();de()});function oin({directories:e,loading:t,error:n,onOpen:r,onRetry:a,creating:i,name:o,onNameChange:s,onCreate:l,onCancelCreate:u,createError:d,creatingBusy:p}){return m("div",{className:"border border-ink/15 rounded overflow-hidden",children:[i&&m("form",{onSubmit:(f)=>{if(f.preventDefault(),o.trim())l(o.trim())},className:"flex items-center space-x-1.5 px-2 py-1.5 border-b border-ink/10 bg-ink/5",children:[m($i,{size:13,className:"text-ink/40 flex-shrink-0"}),m("input",{type:"text",value:o,onChange:(f)=>s(f.currentTarget.value),placeholder:"new-folder-name","aria-label":"New folder name",spellcheck:!1,className:"flex-1 bg-paper border border-ink/20 rounded px-2 py-1 outline-none focus:border-ink/50 text-xs"}),m("button",{type:"submit",disabled:p||!o.trim(),className:"px-2 py-1 rounded bg-ink text-canvas text-[11px] font-medium hover:bg-ink/90 disabled:opacity-40 transition-colors",children:p?"Creating…":"Create"}),m("button",{type:"button",onClick:u,"aria-label":"Cancel new folder",className:"p-1 rounded text-ink/40 hover:text-ink hover:bg-ink/10 transition-colors",children:m(gn,{size:12})})]}),i&&d&&m("p",{className:"px-2.5 py-1.5 text-[11px] text-error border-b border-ink/10",children:d}),m("div",{className:"max-h-52 overflow-y-auto scrollbar-overlay-container",children:t?m("div",{className:"flex items-center justify-center py-8 text-ink/40",children:m(en,{size:16,className:"animate-spin"})}):n?m("div",{className:"flex flex-col items-center justify-center py-6 px-3 text-xs text-error space-y-2",children:[m("span",{className:"text-center",children:n}),m("button",{type:"button",onClick:a,className:"px-2 py-1 rounded bg-ink/5 border border-ink/10 text-ink/70 hover:bg-ink/10 flex items-center space-x-1",children:[m(In,{size:11})," ",m("span",{children:"Retry"})]})]}):e.length===0?m("div",{className:"text-center py-8 text-xs text-ink/40",children:"No subfolders"}):e.map((f)=>m("button",{type:"button",onClick:()=>r(f),title:f.path,className:"w-full flex items-center space-x-2 px-2.5 py-1.5 text-left hover:bg-ink/5 transition-colors group",children:[m($i,{size:14,className:"text-ink/50 flex-shrink-0"}),m("span",{className:"text-xs truncate text-ink/85 flex-1",children:f.name}),m(qu,{size:11,className:"text-ink/20 group-hover:text-ink/50 flex-shrink-0 transition-colors"})]},f.path))})]})}var sin=D(()=>{dt();de()});function lin(e){let t=e.trim();if(!t||/\s/.test(t))return!1;if(/^https?:\/\/\S+$/i.test(t))return!0;if(/^ssh:\/\/\S+$/i.test(t))return!0;if(/^git@[^:/\s]+:\S+$/.test(t))return!0;if(/^file:\/\/\S+$/i.test(t))return!0;if(t.startsWith("/")||t.startsWith("~"))return!0;if(/^[a-z]:[\\/]/i.test(t))return!0;if(/^\\\\[^\\]+\\/.test(t))return!0;return!1}function cin(e){let r=e.replace(/^[a-z]:/i,"").replace(/\\/g,"/").replace(/\/+$/,"").split(/[/:]/).filter(Boolean),a=r.length===0?"":r[r.length-1];if(a===""||/^[a-z]+:$/i.test(a)||/^https?:?$/i.test(a))return"";return a.replace(/\.git$/i,"").replace(/[^a-z0-9._-]/gi,"-")}function uin({parent:e,busy:t,onClone:n}){let[r,a]=ne(""),i=r.trim(),o=lin(i),s=o?cin(i):"",l=()=>{if(o&&!t)n(i)};return m("div",{children:[m("label",{className:"block text-xs font-semibold mb-1 text-ink",children:["Clone Git Repository"," ",m("span",{className:"text-ink/40 font-normal",children:"(optional — clones into the path above)"})]}),m("div",{className:"flex items-center space-x-2",children:[m("input",{type:"text",value:r,onChange:(u)=>a(u.currentTarget.value),onKeyDown:(u)=>{if(u.key==="Enter")u.preventDefault(),l()},disabled:t,placeholder:"https://github.com/org/repo.git",spellcheck:!1,"aria-label":"Git repository URL",className:"flex-1 bg-paper border border-ink/20 rounded px-3 py-2 outline-none focus:border-ink/50 text-sm font-mono disabled:opacity-60"}),m("button",{type:"button",onClick:l,disabled:!o||t,title:o?`Clone into ${e}/${s}`:"Enter an https, ssh, git@ or local path","aria-label":"Clone repository",className:"px-3 py-2 bg-ink/5 border border-ink/10 rounded text-xs font-medium hover:bg-ink/10 disabled:opacity-40 transition-colors flex items-center space-x-1.5 flex-shrink-0",children:[t?m(en,{size:13,className:"animate-spin"}):m(EN,{size:13}),m("span",{children:t?"Cloning…":"Clone"})]})]}),o&&s&&!t&&m("p",{className:"mt-1 text-[10px] text-ink/40 font-mono truncate",children:["Creates workspace “",s.toLowerCase(),"” at ",e,"/",s]})]})}var din=D(()=>{Xe();dt();de()});function pin(e){let[t,n]=ne(e??""),[r,a]=ne([]),[i,o]=ne(null),[s,l]=ne(!1),[u,d]=ne(null),p=Le(0),h=Se(async(g)=>{let b=++p.current;l(!0),d(null);try{let y=await Zie(g);if(b!==p.current)return;n(y.path??g??""),o(y.parentPath??null),a(y.directories??[])}catch(y){if(b!==p.current)return;d(y instanceof Error?y.message:String(y)),a([])}finally{if(b===p.current)l(!1)}},[]);Ae(()=>{h(e||void 0)},[h]);let f=Se(()=>h(t||void 0),[h,t]);return{current:t,directories:r,parentPath:i,loading:s,error:u,navigate:h,refresh:f}}var min=D(()=>{Xe()});function cj({isOpen:e,onClose:t,onCreate:n,onClone:r}){if(!e)return null;return m(Lqr,{onClose:t,onCreate:n,onClone:r})}function Lqr({onClose:e,onCreate:t,onClone:n}){let[r,a]=ne("create"),[i,o]=ne(""),[s,l]=ne(""),[u,d]=ne(!1),[p,h]=ne(null),[f,g]=ne(!1),[b,y]=ne(!1),[v,x]=ne(""),[k,C]=ne(null),[_,w]=ne(!1),T=pin(),E=async(R)=>{w(!0),C(null);try{let I=await fetch("/api/folders/mkdir",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({parent:T.current,name:R})}),A=await I.json().catch(()=>({}));if(!I.ok||!A.success)throw Error(A.error||`HTTP ${I.status}`);y(!1),await T.refresh()}catch(I){C(I instanceof Error?I.message:String(I))}finally{w(!1)}},L=async()=>{if(!t)return e();if(!i.trim()&&!s.trim()){h("Enter a name or a project path.");return}d(!0),h(null);try{await t({name:i.trim(),path:s.trim()||void 0}),e()}catch(R){h(R instanceof Error?R.message:String(R)),d(!1)}},P=async(R)=>{if(!n)return e();if(!T.current){h("Enter the folder the repository should be cloned into.");return}d(!0),h(null);try{await n({url:R,parent:T.current,name:i.trim()||void 0}),e()}catch(I){h(I instanceof Error?I.message:String(I)),d(!1)}};return m("div",{className:"fixed inset-0 bg-ink/20 z-50 flex items-center justify-center p-4",children:[m("div",{className:"bg-paper border border-ink/10 rounded-lg shadow-xl w-[30rem] max-w-full max-h-full overflow-y-auto flex flex-col",children:[m("div",{className:"flex justify-between items-center px-4 pt-4 pb-2 border-b border-ink/10",children:[m("h3",{className:"font-semibold text-sm",children:"New Workspace"}),m("button",{type:"button",onClick:e,"aria-label":"Close",className:"p-1 rounded text-ink/60 hover:text-ink hover:bg-ink/10 transition-colors",children:m(gn,{size:14})})]}),m("div",{className:"flex px-4 pt-2 space-x-1",children:["create","clone"].map((R)=>m("button",{type:"button",onClick:()=>{a(R),h(null)},"aria-pressed":r===R,className:`px-3 py-1.5 text-xs font-medium rounded-t transition-colors ${r===R?"text-ink border-b-2 border-ink":"text-ink/50 hover:text-ink"}`,children:R==="create"?"Create":"Clone"},R))}),m("div",{className:"px-4 py-3 space-y-3 text-sm text-ink/80",children:[m("div",{children:[m("label",{className:"block text-xs font-semibold mb-1 text-ink",children:["Workspace Name"," ",m("span",{className:"text-ink/40 font-normal",children:r==="clone"?"(optional — defaults to the repository name)":""})]}),m("input",{type:"text",value:i,onChange:(R)=>o(R.currentTarget.value),placeholder:"e.g. bofis-pro",className:"w-full bg-paper border border-ink/20 rounded px-3 py-2 outline-none focus:border-ink/50 text-sm"})]}),m("div",{children:[m("label",{className:"block text-xs font-semibold mb-1 text-ink",children:[r==="clone"?"Clone Into":"Project Path"," ",m("span",{className:"text-ink/40 font-normal",children:r==="create"?"(optional — binds omp sessions)":""})]}),m(ain,{value:s,onInput:l,onSubmit:()=>void T.navigate(s.trim()||void 0),onRefresh:()=>void T.refresh(),onNewFolder:()=>{x(""),y(!0),C(null)},loading:T.loading,creating:_,resolved:T.current})]}),m(oin,{directories:T.directories,loading:T.loading,error:T.error,onOpen:(R)=>{l(R.path),T.navigate(R.path)},onRetry:()=>void T.refresh(),creating:b,name:v,onNameChange:x,onCreate:(R)=>void E(R),onCancelCreate:()=>{y(!1),x(""),C(null)},createError:k,creatingBusy:_}),m("div",{className:"flex items-center justify-between",children:[m("button",{type:"button",onClick:()=>g(!0),className:"px-3 py-1.5 bg-ink/5 border border-ink/10 rounded text-xs font-medium hover:bg-ink/10 transition-colors flex items-center space-x-1.5",children:[m(Id,{size:13}),m("span",{children:"Browse…"})]}),T.parentPath&&m("button",{type:"button",onClick:()=>void T.navigate(T.parentPath??void 0),className:"text-[11px] text-ink/50 hover:text-ink transition-colors",children:"↑ Up one level"})]}),r==="clone"&&m(uin,{parent:T.current,busy:u,onClone:(R)=>void P(R)}),p&&m("div",{className:"text-xs text-error",children:p})]}),m("div",{className:"px-4 py-3 border-t border-ink/10 flex justify-end space-x-2",children:[m("button",{type:"button",className:"px-3 py-1.5 text-xs font-medium text-ink/60 hover:text-ink transition-colors",onClick:e,disabled:u,children:"Cancel"}),r==="create"&&m("button",{type:"button",className:"px-4 py-1.5 text-xs font-medium bg-ink text-canvas rounded hover:bg-ink/90 transition-colors disabled:opacity-50",onClick:()=>void L(),disabled:u,children:u?"Creating…":"Create Workspace"})]})]}),f&&m(nin,{initialPath:s||void 0,onSelect:(R)=>{if(l(R),g(!1),!i.trim()){let I=R.replace(/[\\/]+$/,"").split(/[\\/]/).pop()||"";if(I)o(I)}T.navigate(R)},onClose:()=>g(!1)})]})}var hin=D(()=>{Xe();dt();rin();iin();sin();din();min();de()});var vRe=D(()=>{sj();yRe();hin()});async function Rqr(e){let t=await e.json().catch(()=>null);if(!e.ok||!t||t.error)return null;return t.tasks??[]}function fin(e){let[t,n]=ne([]),[r,a]=ne(!1),[i,o]=ne(null),s=Se(async()=>{a(!0);try{let b=await Rqr(await fetch("/api/schedule"));if(b)n(b),o(null);else o("Could not load scheduled tasks.")}catch(b){o(b instanceof Error?b.message:String(b))}finally{a(!1)}},[]),l=Li(Cue,{enabled:e});Ae(()=>{if(!l.data)return;n(l.data),a(!1),o(null)},[l.data]);let u=Se(async(b,y)=>{try{let v=await fetch(b,y),x=await v.json().catch(()=>null);if(!v.ok||!x||x.error){let k=x?.error??`HTTP ${v.status}`;return o(k),k}if(x.tasks)n(x.tasks);return o(null),null}catch(v){let x=v instanceof Error?v.message:String(v);return o(x),x}},[]),d=Se(async(b)=>await u("/api/schedule",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)}),[u]),p=Se(async(b,y)=>u(`/api/schedule?id=${encodeURIComponent(b)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(y)}),[u]),h=Se(async(b)=>u(`/api/schedule?id=${encodeURIComponent(b)}`,{method:"DELETE"}),[u]),f=Se(async(b)=>await u(`/api/schedule?id=${encodeURIComponent(b)}&run=now`,{method:"POST"}),[u]),g=Se(async(b)=>{try{let y=await fetch(`/api/schedule/${encodeURIComponent(b)}/runs`),v=await y.json().catch(()=>null);return y.ok?v?.runs??[]:[]}catch{return[]}},[]);return{tasks:t,loading:r,error:i,refresh:s,create:d,patch:p,remove:h,runNow:f,loadRuns:g}}function Kie(){let e=Li(Cue);return st(()=>(e.data??[]).filter((t)=>t.enabled).length,[e.data])}var Yie=D(()=>{Xe();dp();ds()});function bin(e){let t=e.trim().toLowerCase();if(!t)return null;if(/^\d+(\.\d+)?$/.test(t)){let i=Number(t);return i>0?Math.round(i*60000):null}let n=t.match(/(\d+(?:\.\d+)?)\s*([a-z]+)/g);if(!n)return null;if(n.join("").replace(/\s+/g,"").length!==t.replace(/\s+/g,"").length)return null;let a=0;for(let i of n){let o=i.match(/^(\d+(?:\.\d+)?)\s*([a-z]+)$/);if(!o)return null;let s=Nqr[o[2]];if(!s)return null;a+=Number(o[1])*s}return a>0?Math.round(a):null}function Mqr(e,t,n){let r=new Set;for(let a of e.split(",")){let[i,o]=a.split("/"),s=o===void 0?1:Number(o);if(!Number.isInteger(s)||s<1)return null;let l,u;if(i==="*")l=t,u=n;else if(i.includes("-")){let[d,p]=i.split("-");l=Number(d),u=Number(p)}else l=Number(i),u=o===void 0?l:n;if(!Number.isInteger(l)||!Number.isInteger(u))return null;if(l<t||u>n||l>u)return null;for(let d=l;d<=u;d+=s)r.add(d)}return r.size?[...r].sort((a,i)=>a-i):null}function Pqr(e){let t=e.trim().split(/\s+/);if(t.length!==5)return null;let n=t.map((l,u)=>{let[d,p]=Iqr[u];return Mqr(l,d,p)});if(n.some((l)=>l===null))return null;let[r,a,i,o,s]=n;return{minutes:r,hours:a,daysOfMonth:i,months:o,daysOfWeek:[...new Set(s.map((l)=>l===7?0:l))].sort((l,u)=>l-u),domRestricted:t[2].trim()!=="*",dowRestricted:t[4].trim()!=="*"}}function Dqr(e,t){let n=t.getDate(),r=t.getDay(),a=e.daysOfMonth.includes(n),i=e.daysOfWeek.includes(r);if(e.domRestricted&&e.dowRestricted)return a||i;if(e.domRestricted)return a;if(e.dowRestricted)return i;return!0}function gin(e,t){for(let n of e)if(n>=t)return n;return null}function $qr(e,t){let n=new Date(t.getTime());n.setSeconds(0,0),n.setMinutes(n.getMinutes()+1);let r=new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime(),a=new Date(r);a.setFullYear(a.getFullYear()+8);for(let i=new Date(r);i.getTime()<=a.getTime();){if(!e.months.includes(i.getMonth()+1)){i=new Date(i.getFullYear(),i.getMonth()+1,1);continue}if(Dqr(e,i)){let o=i.getTime()===r,s=o?n.getHours():0,l=gin(e.hours,s);if(l!==null){let u=o&&l===n.getHours()?n.getMinutes():0,d=gin(e.minutes,u);if(d!==null)return new Date(i.getFullYear(),i.getMonth(),i.getDate(),l,d,0,0).getTime()}}i=new Date(i.getFullYear(),i.getMonth(),i.getDate()+1)}return null}function yin(e){let t=e.trim();if(!t)return null;if(/^\d+$/.test(t)){let r=Number(t);return r>0?r:null}let n=Date.parse(t);return Number.isNaN(n)?null:n}function vin(e,t,n=Date.now()){if(!t.trim())return{ok:!1,error:"Enter a schedule."};if(e==="once"){let i=yin(t);if(i===null)return{ok:!1,error:"Use an ISO timestamp, e.g. 2026-10-01T09:00."};if(i<=n)return{ok:!1,error:"That time is already in the past."};return{ok:!0,nextRunAt:i}}if(e==="every"){let i=bin(t);if(i===null)return{ok:!1,error:"Use a duration, e.g. 30m, 1h30m, 2 days."};if(i<60000)return{ok:!1,error:"The shortest interval is 1 minute."};return{ok:!0,nextRunAt:n+i}}let r=Pqr(t);if(!r)return{ok:!1,error:"Use 5 fields: minute hour day-of-month month day-of-week."};let a=$qr(r,new Date(n));if(a===null)return{ok:!1,error:"That expression never matches a date."};return{ok:!0,nextRunAt:a}}function xin(e,t){let n=t.trim();if(e==="once"){let r=yin(n);return r===null?n:`Once at ${new Date(r).toLocaleString()}`}if(e==="every"){let r=bin(n);return r===null?n:`Every ${Oqr(r)}`}return`Cron ${n}`}function Oqr(e){let t=Math.round(e/1000),n=Math.floor(t/86400),r=Math.floor(t%86400/3600),a=Math.floor(t%3600/60),i=t%60,o=[];if(n)o.push(`${n}d`);if(r)o.push(`${r}h`);if(a)o.push(`${a}m`);if(i&&!n)o.push(`${i}s`);return o.length?o.join(" "):"0s"}var Nqr,Iqr;var xRe=D(()=>{Nqr={s:1000,sec:1000,secs:1000,second:1000,seconds:1000,m:60000,min:60000,mins:60000,minute:60000,minutes:60000,h:3600000,hr:3600000,hrs:3600000,hour:3600000,hours:3600000,d:86400000,day:86400000,days:86400000,w:604800000,week:604800000,weeks:604800000};Iqr=[[0,59],[0,23],[1,31],[1,12],[0,7]]});function zqr(e){let t=e-Date.now();if(t<=0)return"due now";let n=Math.round(t/60000);if(n<60)return`in ${n}m`;let r=Math.round(n/60);if(r<24)return`in ${r}h`;return`in ${Math.round(r/24)}d`}function _in({folders:e,initial:t,activeSessionId:n,busy:r,onSubmit:a,onCancel:i}){let[o,s]=ne(""),[l,u]=ne(""),[d,p]=ne("every"),[h,f]=ne("1h"),[g,b]=ne(null),[y,v]=ne(!1);Ae(()=>{s(t?.name??""),u(t?.prompt??""),p(t?.kind??"every"),f(t?.spec??"1h"),b(t?.folderId??null),v(Boolean(t?.sessionId))},[t?.id]);let x=vin(d,h),k=Boolean(l.trim())&&x.ok&&!r,C=()=>{if(!k||!x.ok)return;a({name:o.trim(),prompt:l.trim(),kind:d,spec:h.trim(),folderId:g,sessionId:y?t?.sessionId??n:null,model:t?.model??null})};return m("div",{className:"space-y-3 text-xs",children:[m("div",{children:[m("label",{className:"block font-semibold mb-1 text-ink",children:["Name ",m("span",{className:"text-ink/40 font-normal",children:"(optional)"})]}),m("input",{type:"text",value:o,onInput:(_)=>s(_.currentTarget.value),placeholder:"Morning standup digest",className:"w-full bg-paper border border-ink/20 rounded px-2.5 py-1.5 outline-none focus:border-ink/50 text-xs"})]}),m("div",{children:[m("label",{className:"block font-semibold mb-1 text-ink",children:"Prompt"}),m("textarea",{value:l,onInput:(_)=>u(_.currentTarget.value),placeholder:"Describe the task, ask a question, or paste commands…",rows:4,className:"w-full bg-paper border border-ink/20 rounded px-2.5 py-1.5 outline-none focus:border-ink/50 text-xs resize-y min-h-[80px]"})]}),m("div",{className:"flex items-end gap-2",children:[m("div",{className:"w-28 flex-shrink-0",children:[m("label",{className:"block font-semibold mb-1 text-ink",children:"Schedule"}),m("select",{value:d,onChange:(_)=>p(_.currentTarget.value),className:"w-full bg-paper border border-ink/20 rounded px-2 py-1.5 outline-none focus:border-ink/50 text-xs",children:Object.keys(kin).map((_)=>m("option",{value:_,children:kin[_]},_))})]}),m("div",{className:"flex-1",children:[m("label",{className:"block font-semibold mb-1 text-ink",children:"When"}),m("input",{type:"text",value:h,onInput:(_)=>f(_.currentTarget.value),placeholder:Bqr[d],className:`w-full bg-paper border rounded px-2.5 py-1.5 outline-none text-xs font-mono ${x.ok?"border-ink/20 focus:border-ink/50":"border-error/50 focus:border-error"}`})]})]}),m("p",{className:`text-[11px] ${x.ok?"text-ink/50":"text-error"}`,children:x.ok?`Next run ${zqr(x.nextRunAt)} · ${new Date(x.nextRunAt).toLocaleString()}`:x.error}),m("p",{className:"text-[11px] text-ink/40",children:Fqr[d]}),m("div",{className:"grid grid-cols-2 gap-2",children:[m("div",{children:[m("label",{className:"block font-semibold mb-1 text-ink",children:"Run in"}),m("select",{value:g===null?"":String(g),onChange:(_)=>b(_.currentTarget.value?Number(_.currentTarget.value):null),className:"w-full bg-paper border border-ink/20 rounded px-2 py-1.5 outline-none focus:border-ink/50 text-xs",children:[m("option",{value:"",children:"Server default directory"}),e.map((_)=>m("option",{value:_.id,children:_.name},_.id))]})]}),m("div",{className:"flex items-end",children:m("label",{className:`flex items-center gap-2 text-[11px] ${n?"text-ink/70":"text-ink/30"}`,children:[m("input",{type:"checkbox",checked:y,disabled:!n,onChange:(_)=>v(_.currentTarget.checked),className:"accent-ink"}),m("span",{children:"Resume the open session each run"})]})})]}),m("div",{className:"flex justify-end gap-2 pt-1",children:[m("button",{type:"button",onClick:i,disabled:r,className:"px-3 py-1.5 text-xs font-medium text-ink/60 hover:text-ink transition-colors",children:"Cancel"}),m("button",{type:"button",onClick:C,disabled:!k,className:"inline-flex items-center gap-1.5 px-4 py-1.5 text-xs font-medium bg-ink text-canvas rounded hover:bg-ink/90 transition-colors disabled:opacity-40",children:[r&&m(en,{size:12,className:"animate-spin"}),t?"Save changes":"Schedule task"]})]})]})}var kin,Fqr,Bqr;var win=D(()=>{Xe();dt();xRe();de();kin={once:"Once",every:"Every",cron:"Cron"},Fqr={once:"An ISO timestamp, e.g. 2026-10-01T09:00",every:"A duration, e.g. 30m, 1h30m, 2 days",cron:"5 fields: minute hour day-of-month month day-of-week"},Bqr={once:"2026-10-01T09:00",every:"1h30m",cron:"0 9 * * 1-5"}});function jqr(e){return e===null?"—":new Date(e).toLocaleString()}function Uqr(e){if(e.name)return e.name;let t=e.prompt.replace(/\s+/g," ").trim();return t.length>60?`${t.slice(0,57)}…`:t||"(empty prompt)"}function Cin({tasks:e,loading:t,pending:n,onRunNow:r,onToggleEnabled:a,onEdit:i,onDelete:o,loadRuns:s}){let[l,u]=ne(null),[d,p]=ne([]),[h,f]=ne(!1);if(Ae(()=>{if(!l)return;let g=!0;return f(!0),s(l).then((b)=>{if(!g)return;p(b),f(!1)}),()=>{g=!1}},[l,s]),e.length===0)return m("div",{className:"px-3 py-8 text-center text-[11px] text-ink/50 border border-dashed border-ink/15 rounded-lg",children:t?"Loading…":"No scheduled tasks yet. Create one above."});return m("ul",{className:"space-y-2",children:e.map((g)=>{let b=n===g.id,y=l===g.id;return m("li",{className:"border border-ink/10 rounded-lg bg-paper",children:[m("div",{className:"flex items-start gap-2 p-2.5",children:[m("span",{className:"mt-0.5 shrink-0","aria-hidden":"true",children:!g.enabled?m(uv,{size:14,className:"text-ink/40"}):g.lastStatus==="error"?m(Kn,{size:14,className:"text-error"}):g.lastStatus==="success"?m(qr,{size:14,className:"text-ink/60"}):m(Uu,{size:14,className:"text-ink/60"})}),m("div",{className:"min-w-0 flex-1",children:[m("p",{className:"text-xs font-medium text-ink truncate",children:Uqr(g)}),m("p",{className:"text-[11px] text-ink/60 mt-0.5",children:[xin(g.kind,g.spec),m("span",{className:"text-ink/30",children:" · "}),!g.enabled?g.kind==="once"&&g.lastRunAt!==null?"Ran once — no next run":"Paused":`Next ${jqr(g.nextRunAt)}`]}),g.cwd&&m("p",{className:"text-[10.5px] text-ink/40 font-mono truncate mt-0.5",children:g.cwd}),g.sessionId&&m("p",{className:"text-[10.5px] text-ink/40 font-mono truncate mt-0.5",children:["resumes ",g.sessionId.slice(0,8)]}),g.lastStatus==="error"&&g.lastError&&m("p",{className:"text-[10.5px] text-error mt-0.5 break-words",children:g.lastError}),g.runCount>0&&m("p",{className:"text-[10.5px] text-ink/40 mt-0.5",children:["Fired ",g.runCount,"×"]})]}),m("div",{className:"flex items-center gap-1 shrink-0",children:[m("button",{type:"button",title:"Run now","aria-label":"Run now",disabled:b,onClick:()=>r(g.id),className:"p-1.5 rounded hover:bg-ink/5 text-ink/60 hover:text-ink transition-colors disabled:opacity-40",children:b?m(en,{size:13,className:"animate-spin"}):m(qg,{size:13})}),m("button",{type:"button",title:g.enabled?"Pause":"Resume","aria-label":g.enabled?"Pause":"Resume","aria-pressed":g.enabled,disabled:b,onClick:()=>a(g),className:"p-1.5 rounded hover:bg-ink/5 text-ink/60 hover:text-ink transition-colors disabled:opacity-40",children:m(In,{size:13})}),m("button",{type:"button",title:"Edit","aria-label":"Edit",disabled:b,onClick:()=>i(g),className:"p-1.5 rounded hover:bg-ink/5 text-ink/60 hover:text-ink transition-colors disabled:opacity-40",children:m(Wg,{size:13})}),m("button",{type:"button",title:"Delete","aria-label":"Delete",disabled:b,onClick:()=>o(g.id),className:"p-1.5 rounded hover:bg-ink/5 text-ink/60 hover:text-error transition-colors disabled:opacity-40",children:m(xr,{size:13})})]})]}),m("button",{type:"button",onClick:()=>u(y?null:g.id),"aria-expanded":y,className:"w-full text-left px-2.5 py-1.5 border-t border-ink/5 text-[10.5px] text-ink/50 hover:text-ink transition-colors",children:y?"Hide run history":"Run history"}),y&&m("div",{className:"px-2.5 pb-2.5 space-y-1",children:[h&&m("p",{className:"text-[10.5px] text-ink/40",children:"Loading…"}),!h&&d.length===0&&m("p",{className:"text-[10.5px] text-ink/40",children:"This task has not run yet."}),!h&&d.map((v)=>m("div",{className:"flex items-start gap-2 text-[10.5px]",children:[m("span",{className:"w-16 shrink-0 text-ink/50",children:new Date(v.startedAt).toLocaleTimeString()}),m("span",{className:`w-14 shrink-0 font-medium ${v.status==="error"?"text-error":v.status==="running"?"text-ink/60":"text-ink/70"}`,children:v.status}),m("span",{className:"min-w-0 flex-1 text-ink/60 break-words",children:v.detail||"—"})]},v.id))]})]},g.id)})})}var Sin=D(()=>{Xe();dt();xRe();de()});function Tin(){let[e,t]=ne([]);return Ae(()=>{let n=!0;return fetch("/api/settings/projects").then((r)=>r.json()).then((r)=>{if(!n)return;t((r.projects??[]).filter((a)=>typeof a.folderId==="number").map((a)=>({id:a.folderId,name:a.name})))}).catch((r)=>console.error("Failed to load workspace folders:",r)),()=>{n=!1}},[]),e}var Ein=D(()=>{Xe()});function Xie({isOpen:e,onClose:t,activeSessionId:n=null,onToast:r}){let a=fin(e),i=Tin(),[o,s]=ne(null),[l,u]=ne(!1),[d,p]=ne(!1),[h,f]=ne(null);if(Ae(()=>{if(e)return;s(null),u(!1),p(!1),f(null)},[e]),Ae(()=>{let k=(C)=>{if(C.key!=="Escape"||d)return;if(C.preventDefault(),o||l){s(null),u(!1);return}t()};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[t,d,o,l]),!e)return null;let g=async(k)=>{p(!0);let C=o?await a.patch(o.id,k):await a.create(k);if(p(!1),C){r?.(C,"error");return}r?.(o?"Scheduled task updated.":"Scheduled task created.","success"),s(null),u(!1)},b=async(k)=>{f(k.id);let C=await a.patch(k.id,{enabled:!k.enabled});if(f(null),C)r?.(C,"error")},y=async(k)=>{f(k);let C=await a.runNow(k);if(f(null),C){r?.(C,"error");return}r?.("Task dispatched — open the session to watch it run.","success")},v=async(k)=>{f(k);let C=await a.remove(k);if(f(null),C){r?.(C,"error");return}if(o?.id===k)s(null)},x=o!==null||l;return m("div",{className:"fixed inset-0 bg-ink/30 backdrop-blur-[2px] z-50 flex items-center justify-center p-4",onClick:d?void 0:t,role:"dialog","aria-modal":"true","aria-label":"Scheduled tasks",children:m("div",{className:"bg-paper border border-ink/15 rounded-xl shadow-2xl w-[min(94vw,640px)] max-h-[88vh] flex flex-col overflow-hidden text-ink",onClick:(k)=>k.stopPropagation(),children:[m("div",{className:"flex items-center justify-between px-4 py-3 border-b border-ink/10",children:[m("div",{className:"flex items-center gap-2",children:[m($g,{size:15}),m("h3",{className:"font-semibold text-sm",children:"Scheduled Tasks"})]}),m("button",{type:"button",onClick:t,"aria-label":"Close",className:"p-1.5 -m-1.5 rounded text-ink/50 hover:text-ink hover:bg-ink/5 transition-colors",children:m(gn,{size:16})})]}),m("div",{className:"p-4 overflow-y-auto space-y-4",children:[a.error&&!x&&m("p",{className:"text-[11px] text-error border border-error/30 bg-error/5 rounded px-2.5 py-1.5",children:a.error}),x?m(_in,{folders:i,initial:o,activeSessionId:n,busy:d,onSubmit:g,onCancel:()=>{s(null),u(!1)}}):m("button",{type:"button",onClick:()=>u(!0),className:"w-full py-2 rounded-lg border border-dashed border-ink/20 text-xs font-medium text-ink/70 hover:text-ink hover:border-ink/40 transition-colors",children:"+ New scheduled task"}),!x&&m(Cin,{tasks:a.tasks,loading:a.loading,pending:h,onRunNow:y,onToggleEnabled:b,onEdit:(k)=>s({id:k.id,name:k.name,prompt:k.prompt,kind:k.kind,spec:k.spec,folderId:k.folderId,sessionId:k.sessionId,model:k.model}),onDelete:v,loadRuns:a.loadRuns})]})]})})}var kRe=D(()=>{Xe();dt();Yie();win();Sin();Ein();de()});var _Re,Ain;var Lin=D(()=>{_Re=["A-Z","Z-A","LATEST_SESSION","LATEST_ADDED"],Ain={"A-Z":"A-Z","Z-A":"Z-A",LATEST_SESSION:"Latest Session",LATEST_ADDED:"Latest Added"}});function LL({variant:e,sortOption:t,onSortChange:n}){if(e==="mobile")return m(bt,{children:[m("div",{className:"px-2 py-1 text-[10px] uppercase font-bold text-ink/40 font-mono",children:"Sort Workspaces"}),_Re.map((r)=>m("button",{type:"button",onClick:()=>n(r),className:`w-full text-left px-2.5 py-1.5 rounded-lg flex items-center justify-between transition-colors ${t===r?"bg-ink/10 font-semibold text-ink":"hover:bg-ink/5 text-ink/80"}`,children:[m("span",{children:r.replace("_"," ")}),t===r&&m(Vt,{size:13,className:"text-ink"})]},r))]});return m(bt,{children:[m("div",{className:"px-3 py-1 text-[10px] uppercase font-bold text-ink/40 tracking-wider",children:"Sort Workspaces"}),_Re.map((r)=>m("div",{className:`px-3 py-1.5 text-xs cursor-pointer flex items-center justify-between ${t===r?"bg-ink/5 text-ink font-medium":"text-ink/70 hover:bg-ink/5 hover:text-ink"}`,onClick:()=>n(r),children:[m("span",{children:Ain[r]}),t===r&&m("div",{className:"w-1.5 h-1.5 rounded-full bg-ink"})]},r))]})}var Jie=D(()=>{dt();Lin();de()});function Qie({actions:e,sortHidden:t,sortOption:n,onSortChange:r,layout:a="desktop"}){let i=a==="mobile",[o,s]=ne(!1),l=Le(null);Pr(l,()=>s(!1)),Ae(()=>{if(!o)return;let d=(p)=>{if(p.key==="Escape")s(!1)};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[o]);let u=(d)=>{s(!1),d.onSelect()};return m("div",{className:"relative shrink-0",ref:l,children:[m("button",{type:"button",title:"More sidebar actions","aria-label":"More sidebar actions","aria-haspopup":"menu","aria-expanded":o,onClick:()=>s(!o),className:`inline-flex items-center justify-center transition-colors cursor-pointer ${i?"w-9.5 h-9.5 rounded-xl border active:scale-95 shadow-xs":"w-7 h-7 rounded border"} ${o?"border-ink/30 bg-ink/10 text-ink":"border-ink/15 bg-paper text-ink/70 hover:bg-ink/5 hover:text-ink"}`,children:m(uo,{size:i?16:14})}),o&&m("div",{role:"menu",className:`absolute right-0 top-full mt-2 w-52 bg-paper border border-ink/15 shadow-lg z-50 py-1 text-xs ${i?"rounded-xl p-2":"rounded-lg"}`,children:[e.map((d)=>m("button",{type:"button",role:"menuitem",onClick:()=>u(d),"aria-pressed":d.active,className:`w-full text-left flex items-center gap-2 transition-colors ${i?"px-2.5 py-1.5 rounded-lg":"px-3 py-1.5"} ${d.active?"bg-ink/5 text-ink font-medium":"text-ink/75 hover:bg-ink/5 hover:text-ink"}`,children:[m(d.icon,{size:13}),m("span",{children:d.label})]},d.id)),t&&m("div",{className:"mt-1 border-t border-ink/10 pt-1",children:m(LL,{variant:a,sortOption:n,onSortChange:r})})]})]})}var wRe=D(()=>{dt();Xe();to();Jie();de()});function eoe(e){let t=Le(null),[n,r]=ne(0);return ma(()=>{let a=t.current;if(!a)return;let i=()=>r(Math.max(0,a.clientWidth-e));if(i(),typeof ResizeObserver>"u")return;let o=new ResizeObserver(i);return o.observe(a),()=>o.disconnect()},[e]),{ref:t,width:n}}var CRe=D(()=>{Xe()});function Nin(e){let t=toe.length;if(!(e>0))return t;let n=e-112-6-8;if(t*28+(t-1)*6<=n)return t;let a=Math.floor((n-28-8)/34);return Math.max(2,Math.min(t,a))}function Iin(e){let t=noe.length;if(!(e>0))return t;let n=qqr+Wqr,r=Math.floor((e-Gqr)/n);if(r>=t)return t;return Math.max(Hqr,Math.min(t,r-1))}var toe,Rin=8,qqr=38,Wqr=8,Gqr=126,Hqr=1,noe;var SRe=D(()=>{toe=["new-workspace","refresh","search","select","archive","scheduler","sort"];noe=["new-workspace","refresh","archive","sort","scheduler","select"]});function Min({isSearchVisible:e,searchQuery:t,showArchived:n,optionsOpen:r,sortOption:a,onToggleSearch:i,onSearchChange:o,onToggleArchived:s,onHideArchived:l,onToggleOptions:u,onCloseOptions:d,onSortChange:p,onNewSession:h,onNewWorkspace:f,onScheduler:g,scheduledCount:b,onRefresh:y,refreshing:v,onSelectWorkspaces:x,selecting:k}){let{ref:C,width:_}=eoe(Rin),w=Nin(_),T=new Set(toe.slice(0,w)),E=toe.slice(w),L=n?"Hide Archive":"Show Archive",P=b>0?`Scheduled tasks (${b} armed)`:"Scheduled tasks",R=[];if(E.includes("new-workspace"))R.push({id:"new-workspace",label:"New Workspace",icon:jg,onSelect:f});if(E.includes("refresh"))R.push({id:"refresh",label:"Refresh sessions",icon:In,onSelect:y});if(E.includes("search"))R.push({id:"search",label:"Search sessions",icon:na,onSelect:i,active:e});if(E.includes("archive"))R.push({id:"archive",label:L,icon:Rd,onSelect:s,active:n});if(E.includes("select"))R.push({id:"select",label:k?"Cancel selection":"Select workspaces",icon:gf,onSelect:x,active:k});if(E.includes("scheduler"))R.push({id:"scheduler",label:P,icon:$g,onSelect:g});return m("div",{className:"p-3 border-b border-ink/10 flex flex-col space-y-3",children:[m("div",{ref:C,className:"flex items-center justify-between gap-2 px-1 text-ink/60",children:[m("div",{className:"flex flex-1 min-w-0 items-center gap-1.5",children:[m("button",{type:"button",title:"New Session","aria-label":"New Session",onClick:h,className:"flex-1 min-w-[52px] h-7 flex items-center justify-center space-x-1.5 px-2 rounded bg-ink text-canvas text-xs font-semibold hover:bg-ink/90 transition-colors cursor-pointer",children:[m(kr,{size:14,className:"shrink-0"}),m("span",{className:"truncate",children:"New Session"})]}),T.has("new-workspace")&&m("button",{type:"button",title:"New Workspace","aria-label":"New Workspace",onClick:f,className:`${jT} ${UT}`,children:m(jg,{size:14})}),T.has("scheduler")&&m("button",{type:"button",title:P,"aria-label":b>0?`Scheduled tasks, ${b} armed`:"Scheduled tasks",onClick:g,className:`relative ${jT} ${UT}`,children:[m($g,{size:14}),b>0&&m("span",{className:"absolute -top-1 -right-1 min-w-[10px] h-[10px] px-[2px] rounded-full bg-ink text-canvas text-[7px] leading-[10px] text-center font-semibold",children:b>9?"9+":b})]}),T.has("refresh")&&m("button",{type:"button",title:"Refresh sessions",onClick:y,className:`${jT} ${UT}`,"aria-label":"Refresh sessions","aria-busy":v,children:m(In,{size:14,className:v?"animate-spin":""})})]}),m("div",{className:"ml-auto flex items-center gap-1.5 shrink-0",children:[T.has("search")&&m("button",{type:"button",title:e?"Hide search":"Search sessions","aria-label":e?"Hide search":"Search sessions","aria-pressed":e,onClick:i,className:`${jT} ${e?roe:UT}`,children:m(na,{size:14})}),T.has("select")&&m("button",{type:"button",title:k?"Cancel selection":"Select workspaces","aria-label":k?"Cancel selection":"Select workspaces","aria-pressed":k,onClick:x,className:`${jT} ${k?roe:UT}`,children:m(gf,{size:14})}),T.has("archive")&&m("button",{type:"button",title:L,"aria-label":L,"aria-pressed":n,onClick:s,className:`${jT} ${n?roe:UT}`,children:m(Rd,{size:14})}),T.has("sort")&&m("div",{className:"relative",children:[m("button",{type:"button",title:"Sort workspaces","aria-label":"Sort workspaces","aria-haspopup":"menu","aria-expanded":r,onClick:u,className:`${jT} ${r||a!=="A-Z"?roe:UT}`,children:m(T5,{size:14})}),r&&m("div",{className:"absolute right-0 top-full mt-2 w-48 bg-paper border border-ink/15 rounded-lg shadow-lg z-50 py-1",onMouseLeave:d,children:m(LL,{variant:"desktop",sortOption:a,onSortChange:p})})]}),R.length>0&&m(Qie,{actions:R,sortHidden:E.includes("sort"),sortOption:a,onSortChange:p})]})]}),e&&m("div",{className:"pt-1",children:m("input",{type:"text",placeholder:"Search workspaces & sessions...",value:t,onChange:(I)=>o(I.currentTarget.value),autoFocus:!0,className:"w-full bg-ink/5 border border-ink/10 rounded px-2.5 py-1.5 outline-none focus:border-ink/30 text-xs text-ink placeholder-ink/40 transition-colors"})}),n&&m("div",{className:"flex items-center justify-between bg-amber-500/10 border border-amber-500/20 text-amber-900 rounded px-2.5 py-1.5 text-[10px] font-medium",children:[m("div",{className:"flex items-center space-x-1.5",children:[m(Rd,{size:10}),m("span",{children:"Showing Archived"})]}),m("button",{className:"hover:text-amber-950",onClick:l,children:m(gn,{size:10})})]})]})}var jT="shrink-0 w-7 h-7 inline-flex items-center justify-center rounded border transition-colors cursor-pointer",UT="border-ink/15 bg-paper text-ink/70 hover:bg-ink/5 hover:text-ink",roe="border-ink/30 bg-ink/10 text-ink";var Pin=D(()=>{dt();Jie();wRe();CRe();SRe();de()});function aoe(e=5,t=7){let[n,r]=ne(e),a=Se(()=>r((o)=>o+t),[t]),i=Se(()=>r(e),[e]);return{visibleCount:n,showMore:a,showLess:i,canShowLess:n>e}}var TRe=D(()=>{Xe()});function ARe(e,t){if(qT.has(e)===t)return;if(t)qT.add(e);else qT.delete(e);for(let n of[...ERe])n()}function Din(e){return qT.has(e)}function Vqr(e){return ERe.add(e),()=>ERe.delete(e)}function X4(e){let t=e==null?"":String(e),[n,r]=ne(()=>t!==""&&qT.has(t));return Ae(()=>{if(!t){r(!1);return}return r(qT.has(t)),Vqr(()=>r(qT.has(t)))},[t]),n}var qT,ERe;var RL=D(()=>{Xe();qT=new Set,ERe=new Set});function ioe(e,t){let n=Tc();return{handleArchive:(o)=>{let s=o.is_archived!==1;n.submit({archived:String(s)},{method:"POST",action:`/api/sessions/${o.id}/archive`}),e()},handleRename:async(o,s)=>{try{let l=new FormData;if(l.set("name",s),!(await fetch(`/api/sessions/${encodeURIComponent(String(o.id))}/rename`,{method:"POST",body:l})).ok)return}catch{return}q2("session-renamed",{sessionId:String(o.id),title:s}),e()},handleRenameWithAi:async(o)=>{let s=String(o.id);if(Din(s))return;ARe(s,!0);try{let l=await fetch(`/api/sessions/${encodeURIComponent(s)}/rename-with-ai`,{method:"POST"}),u=await l.json().catch(()=>({}));if(!l.ok||!u.name){t?.(u.error||`Could not generate a name (HTTP ${l.status}).`,"error");return}q2("session-renamed",{sessionId:s,title:u.name}),e(),t?.(`Renamed to "${u.name}".`,"success")}catch(l){t?.(l instanceof Error?l.message:String(l),"error")}finally{ARe(s,!1)}}}}var LRe=D(()=>{W2();Db();RL()});function ooe(e,t,n){let[r,a]=ne(!1),i=Tc(),o=Tc(),{handleArchive:s,handleRename:l,handleRenameWithAi:u}=ioe(t,n),d=()=>{if(typeof e.id!=="number")return;i.submit({isPinned:String(!e.isPinned)},{method:"POST",action:`/api/folders/${e.id}/pin`}),t()},p=()=>{if(typeof e.id!=="number")return;o.submit({},{method:"POST",action:`/api/folders/${e.id}/delete`}),a(!1),t()},h=e.project_path?()=>{(async()=>{try{let f=await fetch(`/api/folders/${encodeURIComponent(String(e.id))}/open`,{method:"POST"}),g=await f.json().catch(()=>({}));if(!f.ok)n?.(g.error||`Could not open the folder (HTTP ${f.status})`)}catch(f){n?.(f instanceof Error?f.message:String(f))}})()}:void 0;return{confirmDelete:r,requestDelete:()=>a(!0),cancelDelete:()=>a(!1),handlePin:d,handleOpenFolder:h,handleDelete:p,handleArchive:s,handleRename:l,handleRenameWithAi:u}}var RRe=D(()=>{Xe();Db();LRe()});function NL(){let[e,t]=ne(null),[n,r]=ne(!1),[a,i]=ne(null),[o,s]=Pa(),l=Se((p)=>{i(null),t(p)},[]),u=Se(()=>{i(null),t(null)},[]),d=Se(async()=>{if(!e||n)return;let p=String(e.id);r(!0),i(null);try{let h=await fetch(`/api/sessions/${encodeURIComponent(p)}`,{method:"DELETE"}),f=await h.json().catch(()=>null);if(!h.ok){i(f?.error||`Could not delete the session (HTTP ${h.status}).`);return}if(rq(p),o.get("sessionId")===p)s((g)=>{let b=new URLSearchParams(g);return b.delete("sessionId"),b.delete("subagent"),b},{replace:!0});t(null)}catch(h){i(h instanceof Error?h.message:"Could not reach the server.")}finally{r(!1)}},[e,n,o,s]);return{pending:e,isDeleting:n,error:a,requestDelete:l,cancelDelete:u,confirmDelete:d}}var soe=D(()=>{Xe();vc();Td()});function IL({session:e,isDeleting:t,error:n,onClose:r,onConfirm:a}){if(Ae(()=>{let i=(o)=>{if(o.key!=="Escape"||t)return;o.preventDefault(),r()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[r,t]),!e)return null;return m(Va,{onClose:t?()=>{}:r,zClass:"z-[70]",maxWidthClass:"max-w-[460px]",header:m("div",{className:"flex items-center gap-3 min-w-0",children:[m(xr,{size:16,className:"text-error shrink-0"}),m("div",{className:"min-w-0",children:[m("h2",{className:"text-sm font-semibold text-ink",children:"Delete session?"}),m("p",{className:"text-[11px] text-ink/50 truncate",children:e.title})]})]}),footer:m("div",{className:"flex items-center justify-end gap-2 px-5 py-3.5 border-t border-ink/10",children:[m("button",{type:"button",onClick:r,disabled:t,className:"px-3.5 py-1.5 rounded-md border border-ink/20 text-xs font-medium text-ink hover:bg-ink/5 transition-colors cursor-pointer disabled:opacity-50",children:"Cancel"}),m("button",{type:"button",onClick:a,disabled:t,className:"px-3.5 py-1.5 rounded-md bg-error text-canvas text-xs font-medium hover:opacity-90 transition-opacity cursor-pointer disabled:opacity-50 flex items-center gap-1.5",children:t?m(bt,{children:[m(en,{size:13,className:"animate-spin"}),m("span",{children:"Deleting..."})]}):m(bt,{children:[m(xr,{size:13}),m("span",{children:"Delete session"})]})})]}),children:m("div",{className:"px-5 py-4 space-y-3",children:[m("ul",{className:"text-[11.5px] leading-relaxed text-ink/70 space-y-1.5",children:[m("li",{children:["Its transcript is removed from"," ",m("span",{className:"font-mono text-ink",children:"~/.omp/agent/sessions"})," — the conversation is gone from the sidebar and from oh-my-pi."]}),m("li",{children:"The subagent transcripts and any side questions asked in it are removed with it."}),m("li",{children:"Its queued messages, archive state, and saved panel layout go too."})]}),n?m("div",{className:"flex items-start gap-2 px-3 py-2 rounded-md border border-error/30 bg-error/5 text-[11px] text-ink/75",children:[m(pr,{size:13,className:"mt-0.5 shrink-0 text-error"}),m("span",{children:n})]}):m("div",{className:"flex items-start gap-2 px-3 py-2 rounded-md border border-error/30 bg-error/5 text-[11px] text-ink/75",children:[m(pr,{size:13,className:"mt-0.5 shrink-0 text-error"}),m("span",{children:"This cannot be undone from the UI. Archive it instead to keep the transcript."})]})]})})}var loe=D(()=>{Xe();dt();au();de()});function ML(e,t){let[n,r]=ne(!1),[a,i]=ne(e),o=Le(null),s=Le(!1),l=Le(!1);Ae(()=>{if(n)o.current?.select()},[n]);let u=()=>{s.current=!1,l.current=!1,i(e),r(!0)},d=()=>{if(l.current)return;l.current=!0;let g=a.trim();if(r(!1),!g||g===e)return;t?.(g)},p=()=>{s.current=!0,r(!1)};return{isEditing:n,draft:a,setDraft:i,inputRef:o,startRename:u,commitRename:d,cancelRename:p,handleKeyDown:(g)=>{if(g.key==="Enter")g.preventDefault(),d();else if(g.key==="Escape")g.preventDefault(),p()},handleBlur:()=>{if(s.current){s.current=!1;return}d()}}}var coe=D(()=>{Xe()});function PL(){let[e,t]=ne(null),n=Se((i)=>{i.preventDefault(),i.stopPropagation();let o=i.currentTarget.getBoundingClientRect();t({top:o.top,right:o.right,bottom:o.bottom,left:o.left,align:"end"})},[]),r=Se((i)=>{i.preventDefault(),i.stopPropagation();let{clientX:o,clientY:s}=i;t({top:s,right:o,bottom:s,left:o,align:"start"})},[]),a=Se(()=>t(null),[]);return{anchor:e,openBelow:n,openAtCursor:r,close:a}}function DL({anchor:e,isArchived:t=!1,onRename:n,onRenameWithAi:r,onArchive:a,onDelete:i,onCancelWait:o,onClose:s}){let l=Le(null),[u,d]=ne(null);ma(()=>{let h=l.current;if(!h)return;let{width:f,height:g}=h.getBoundingClientRect(),b=8,y=e.bottom+4,v=y+g+b<=window.innerHeight?y:Math.max(b,e.top-g-4),x=e.align==="end"?e.right-f:e.left;d({top:v,left:Math.max(b,Math.min(x,window.innerWidth-f-b))})},[e]),Ae(()=>{let h=(f)=>{if(f.key!=="Escape")return;f.preventDefault(),s()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[s]);let p=(h)=>()=>{s(),h?.()};return Eo(m("div",{className:"fixed inset-0 z-[70]",onClick:s,onContextMenu:(h)=>{h.preventDefault(),s()},children:m("div",{ref:l,role:"menu","aria-label":"Session actions",style:{top:u?.top??e.bottom+4,left:u?.left??e.left,visibility:u?"visible":"hidden"},className:"fixed z-[70] w-44 bg-paper border border-ink/15 rounded-lg shadow-xl py-1 text-xs text-ink font-sans",onClick:(h)=>h.stopPropagation(),children:[n&&m("button",{type:"button",role:"menuitem",onClick:p(n),className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 flex items-center gap-2 transition-colors cursor-pointer",children:[m(dv,{size:12,className:"text-ink/60"}),m("span",{children:"Rename"})]}),r&&m("button",{type:"button",role:"menuitem",onClick:p(r),className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 flex items-center gap-2 transition-colors cursor-pointer",children:[m(Mg,{size:12,className:"text-ink/60"}),m("span",{children:"Rename with AI"})]}),o&&m("button",{type:"button",role:"menuitem",onClick:p(o),className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 flex items-center gap-2 transition-colors cursor-pointer",children:[m(ms,{size:12,className:"text-ink/60"}),m("span",{children:"Cancel waiting prompt"})]}),a&&m("button",{type:"button",role:"menuitem",onClick:p(a),className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 flex items-center gap-2 transition-colors cursor-pointer",children:[t?m(oN,{size:12,className:"text-ink/60"}):m(Rd,{size:12,className:"text-ink/60"}),m("span",{children:t?"Unarchive":"Archive"})]}),(n||r||a||o)&&i&&m("div",{className:"my-1 border-t border-ink/10"}),i&&m("button",{type:"button",role:"menuitem",onClick:p(i),className:"w-full text-left px-3 py-1.5 hover:bg-error/10 text-error flex items-center gap-2 transition-colors cursor-pointer",children:[m(xr,{size:12,className:"text-error"}),m("span",{children:"Delete"})]})]})}),document.body)}var uoe=D(()=>{Xe();ka();dt();de()});function J4({checked:e,indeterminate:t=!1,label:n,onChange:r,size:a="sm"}){let i=Le(null);return Ae(()=>{if(i.current)i.current.indeterminate=t},[t]),m("input",{ref:i,type:"checkbox",checked:e,"aria-label":n,onChange:r,onClick:(o)=>o.stopPropagation(),className:`shrink-0 accent-ink cursor-pointer rounded border-ink/30 ${a==="md"?"w-3.5 h-3.5":"w-3 h-3"}`})}var uj=D(()=>{Xe();de()});function $in({sessionId:e,title:t,isActive:n=!1,isArchived:r=!1,status:a,awaitingInput:i=!1,timeAgo:o,onClick:s,onArchive:l,onDelete:u,onRename:d,onRenameWithAi:p,expandable:h=!1,isExpanded:f=!1,hasSubagents:g=!1,onToggleExpand:b,waitingFor:y,onCancelWait:v,selectable:x=!1,selected:k=!1,onToggleSelect:C}){let _=X4(e),w=Boolean(h&&g&&b),T=Boolean(y),L=w&&!(i||a==="stream"||T)&&!_,P=Boolean(_||i||a)&&!L,{isEditing:R,draft:I,setDraft:A,inputRef:M,startRename:N,handleKeyDown:O,handleBlur:B}=ML(t,d),F=PL(),U=Boolean(d||l||u||v);return m(bt,{children:[m("div",{"data-testid":"session-item","data-session-id":String(e),"data-selected":x&&k?"true":void 0,onClick:R?void 0:x?C:s,onContextMenu:U&&!R&&!x?F.openAtCursor:void 0,className:`group/item relative flex items-center w-full rounded-lg px-2 py-1.5 cursor-pointer text-xs transition-colors select-none ${x&&k?"bg-ink/10 text-ink ring-1 ring-inset ring-ink/20":n?"bg-ink/10 font-medium text-ink":"text-ink/75 hover:text-ink hover:bg-ink/5"}`,children:[x?m(bt,{children:[m(J4,{checked:k,label:`Select ${t}`,onChange:()=>C?.()}),m("span",{className:"w-2 shrink-0"})]}):m(bt,{children:[m("span",{className:"relative w-4 h-4 shrink-0",children:[w&&b&&m("button",{type:"button",onClick:(z)=>{z.stopPropagation(),b(z)},title:f?"Collapse subagents":"Expand subagents","aria-expanded":f,className:`peer absolute inset-0 flex items-center justify-center rounded cursor-pointer transition-opacity ${L?"text-ink/60 hover:text-ink":"text-ink/40 hover:text-ink pointer-events-none opacity-0 group-hover/item:pointer-events-auto group-hover/item:opacity-100 focus-visible:opacity-100"}`,children:f?m(Gn,{size:13}):m(yi,{size:13})}),P&&m("span",{className:`pointer-events-none absolute inset-0 flex items-center justify-center text-ink/60 transition-opacity ${w?"group-hover/item:opacity-0 peer-focus-visible:opacity-0":""}`,children:_?m("span",{role:"status","aria-label":"Generating a name…",children:m(en,{size:12,className:"animate-spin"})}):i?m(Fs,{size:12,className:"animate-pulse text-ink/80"}):T?m("span",{role:"status","aria-label":`Waiting for ${y?.title??"another session"}`,children:m(ms,{size:12,className:"animate-pulse text-ink/60"})}):a==="stream"?m("span",{role:"status","aria-label":"Running",children:m(en,{size:12,className:"animate-spin"})}):m(Vt,{size:12})})]}),m("span",{className:"w-2 shrink-0"})]}),R?m("input",{ref:M,autoFocus:!0,value:I,onChange:(z)=>A(z.currentTarget.value),onClick:(z)=>z.stopPropagation(),onKeyDown:O,onBlur:B,className:"flex-1 min-w-0 bg-paper border border-ink/25 rounded px-1 py-0.5 text-xs text-ink outline-none focus:border-ink/50"}):m("span",{className:"flex-1 min-w-0 flex flex-col leading-snug",children:[m("span",{className:"truncate",children:t.charAt(0).toUpperCase()+t.slice(1)}),T&&m("span",{className:"truncate text-[10px] text-ink/40 font-normal",children:["waiting for ",y?.title??"another session"]})]}),!R&&o&&m("span",{className:"shrink-0 ml-2 font-mono text-[10px] text-ink/40",children:o}),!R&&U&&!x&&m("button",{type:"button",onClick:F.openBelow,title:"Session actions","aria-label":"Session actions","aria-haspopup":"menu","aria-expanded":F.anchor!==null,className:"shrink-0 ml-1 p-1 text-ink/40 hover:text-ink hover:bg-ink/10 rounded cursor-pointer",children:m(uo,{size:14})})]}),F.anchor&&m(DL,{anchor:F.anchor,isArchived:r,onRename:d?N:void 0,onRenameWithAi:p,onArchive:l,onDelete:u,onCancelWait:v,onClose:F.close})]})}var Oin=D(()=>{dt();coe();RL();uoe();uj();de()});function doe({variant:e,isPinned:t=!1,onOpenFolder:n,onSelectSessions:r,confirmDelete:a,onPin:i,onDelete:o,onRequestDelete:s,onCancelDelete:l}){if(e==="mobile")return a?m(bt,{children:[m("div",{className:"px-3 py-2 text-ink/80 font-medium",children:"Delete workspace?"}),m("button",{type:"button",onClick:o,className:"w-full text-left px-3 py-2 hover:bg-error/10 text-error flex items-center space-x-2",children:[m(xr,{size:13}),m("span",{children:"Yes, delete"})]}),m("button",{type:"button",onClick:l,className:"w-full text-left px-3 py-2 hover:bg-ink/5 text-ink/70",children:"Cancel"})]}):m(bt,{children:[n&&m("button",{type:"button",onClick:n,className:"w-full text-left px-3 py-2 hover:bg-ink/5 text-ink/80 flex items-center space-x-2",children:[m(Id,{size:13}),m("span",{children:"Go to Explorer"})]}),m("button",{type:"button",onClick:i,className:"w-full text-left px-3 py-2 hover:bg-ink/5 text-ink/80 flex items-center space-x-2",children:[t?m(E6,{size:13}):m(Nk,{size:13}),m("span",{children:t?"Unpin Workspace":"Pin Workspace"})]}),r&&m("button",{type:"button",onClick:r,className:"w-full text-left px-3 py-2 hover:bg-ink/5 text-ink/80 flex items-center space-x-2",children:[m(gf,{size:13}),m("span",{children:"Select sessions"})]}),m("button",{type:"button",onClick:s,className:"w-full text-left px-3 py-2 hover:bg-error/10 text-error flex items-center space-x-2",children:[m(xr,{size:13}),m("span",{children:"Delete Workspace"})]})]});return a?m(bt,{children:[m("div",{className:"px-3 py-1.5 text-xs text-ink/80 font-medium",children:"Delete workspace?"}),m("button",{type:"button",onClick:o,className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-error",children:[m(xr,{size:12}),m("span",{children:"Yes, delete"})]}),m("button",{type:"button",onClick:l,className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-ink/70",children:m("span",{children:"Cancel"})})]}):m(bt,{children:[n&&m("button",{type:"button",onClick:n,className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-ink/80",children:[m(Id,{size:12}),m("span",{children:"Go to Explorer"})]}),m("button",{type:"button",onClick:i,className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-ink/80",children:[t?m(E6,{size:12}):m(Nk,{size:12}),m("span",{children:t?"Unpin Workspace":"Pin Workspace"})]}),r&&m("button",{type:"button",onClick:r,className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-ink/80",children:[m(gf,{size:12}),m("span",{children:"Select sessions"})]}),m("button",{type:"button",onClick:s,className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 cursor-pointer flex items-center space-x-2 text-error",children:[m(xr,{size:12}),m("span",{children:"Delete Workspace"})]})]})}var NRe=D(()=>{dt();de()});function poe(e){return Zqr[e||"default"]||$i}var Zqr;var IRe=D(()=>{dt();Zqr={default:$i,code:tu,terminal:$a,rocket:mv,flask:ev,gamepad:nv,briefcase:Hy,home:Bu,globe:Da,leaf:av,shield:Hg,palette:vh,server:gl,smartphone:fp,database:Bg,lightbulb:iv,music:cv,camera:Nd,book:ps,heart:Ug}});function Fin({folder:e,isOpen:t,onToggleFolder:n,checkbox:r,batchActive:a,menuRef:i,showMenu:o,onToggleMenu:s,onNewSession:l,onOpenFolder:u,onSelectSessions:d,confirmDelete:p,onPin:h,onDelete:f,onRequestDelete:g,onCancelDelete:b}){let y=poe(e.icon);return m("div",{className:"group flex items-center justify-between h-7 text-xs font-semibold text-ink px-2 hover:bg-ink/5 rounded-md transition-colors select-none",children:[m("div",{className:"flex-1 h-full flex items-center cursor-pointer min-w-0",onClick:a?void 0:n,children:[r?m(bt,{children:[m(J4,{size:"md",checked:r.checked,indeterminate:r.indeterminate,label:r.label,onChange:r.onChange}),m("span",{className:"w-2 shrink-0"})]}):m(bt,{children:[m("span",{className:"relative w-4 h-4 flex items-center justify-center shrink-0",children:[m("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover:opacity-0 touch-hidden",children:e.customIconUrl?m("img",{src:e.customIconUrl,alt:"",className:"w-[15px] h-[15px] rounded-xs object-contain shrink-0",referrerPolicy:"no-referrer"}):m(y,{size:15,className:"text-ink/75",style:{color:e.accentColor||void 0}})}),m("span",{className:"absolute inset-0 flex items-center justify-center text-ink/60 opacity-0 transition-opacity group-hover:opacity-100 touch-visible",children:t?m(Gn,{size:13}):m(yi,{size:13})})]}),m("span",{className:"w-2 shrink-0"})]}),e.isPinned&&m(Nk,{size:11,className:"text-ink/60 shrink-0 mr-1.5"}),m("span",{className:"truncate text-[13px] font-semibold tracking-tight",children:e.name})]}),!a&&m("div",{className:"flex items-center space-x-0.5 pl-1",children:[m("button",{type:"button",title:"New Session","aria-label":`New session in ${e.name}`,className:"w-5 h-5 flex items-center justify-center text-ink/40 hover:text-ink hover:bg-ink/10 rounded cursor-pointer transition-colors",onClick:(v)=>{v.stopPropagation(),l()},children:m(kr,{size:12})}),m("div",{className:"relative flex items-center",ref:i,children:[m("button",{type:"button",title:`Options for ${e.name}`,"aria-label":`Options for ${e.name}`,className:"w-5 h-5 flex items-center justify-center text-ink/40 hover:text-ink hover:bg-ink/10 rounded cursor-pointer transition-colors",onClick:(v)=>{v.stopPropagation(),s()},children:m(uo,{size:12})}),o&&m("div",{className:"absolute right-0 top-full mt-1 w-44 bg-paper border border-ink/15 rounded-md shadow-lg z-50 py-1 text-xs",children:m(doe,{variant:"desktop",isPinned:e.isPinned,onOpenFolder:u,onSelectSessions:d,confirmDelete:p,onPin:h,onDelete:f,onRequestDelete:g,onCancelDelete:b})})]})]})]})}var Bin=D(()=>{dt();uj();NRe();IRe();de()});function moe({status:e,live:t,size:n=12}){let r={size:n,strokeWidth:2,"aria-hidden":!0};if(e==="completed")return m(qr,{...r,className:"text-success"});if(e==="failed")return m(Kn,{...r,className:"text-error"});if(e==="aborted")return m(pp,{...r,className:"text-ink/40"});if(t===!1)return m(Ky,{...r,className:"text-ink/30"});let a=Math.max(5,Math.round(n/2));return m("span",{"aria-hidden":!0,className:"inline-block shrink-0 animate-pulse rounded-full bg-success",style:{width:a,height:a}})}var MRe=D(()=>{dt();de()});function Kqr(e){return xn(e)&&typeof e.id==="string"&&e.id.length>0&&typeof e.agent==="string"&&e.agent.length>0&&typeof e.status==="string"&&typeof e.index==="number"}async function zin(e){try{let t=await fetch(`/api/sessions/${encodeURIComponent(e)}/subagents`);if(!t.ok)return null;let n=await t.json().catch(()=>null);if(!xn(n))return null;let r=xn(n.data)?n.data:n;if(!Array.isArray(r.subagents))return null;return r.subagents.filter(Kqr)}catch{return null}}function hoe(e){let t={...e,source:"history",lastUpdate:0},n={};if(e.lastIntent!==void 0)n.lastIntent=e.lastIntent;if(e.toolCount!==void 0)n.toolCount=e.toolCount;if(e.requests!==void 0)n.requests=e.requests;if(e.tokens!==void 0)n.tokens=e.tokens;if(e.contextTokens!==void 0)n.contextTokens=e.contextTokens;if(e.contextWindow!==void 0)n.contextWindow=e.contextWindow;if(e.cost!==void 0)n.cost=e.cost;if(e.durationMs!==void 0)n.durationMs=e.durationMs;if(e.resolvedModel!==void 0)n.resolvedModel=e.resolvedModel;if(Object.keys(n).length>0)t.progress=n;return t}var PRe=()=>{};function Uin(e){for(let t of e){let n=t.trim();if(n)return n}return}function qin(e){if(!e)return;let t=e.split(`
5002
5002
  `),n=t.findIndex((r)=>Yqr.test(r.trim()));if(n!==-1){let r=t.slice(n+1),a=r.findIndex((o)=>jin.test(o.trim())),i=Uin(a===-1?r:r.slice(0,a));if(i)return i}return Uin(t.filter((r)=>{let a=r.trim();return!jin.test(a)&&!Xqr.test(a)}))}function Win(e){let t=e.modelRole??e.progress?.modelRole;return t?`${e.id} (${e.agent}:${t})`:`${e.id} (${e.agent})`}function Gin(e){let t=qin(e.task)??qin(e.assignment)??e.description,n=`${e.id} (${e.agent})`;return t?`${n}: ${t}`:n}var jin,Yqr,Xqr;var DRe=D(()=>{jin=/^#{1,6}\s+\S/,Yqr=/^#{1,6}\s+target\s*:?\s*$/i,Xqr=/^complete (the )?assignment\b/i});function To(e){return typeof e==="string"&&e.length>0?e:void 0}function kd(e){return typeof e==="number"&&Number.isFinite(e)?e:void 0}function ORe(e){return e==="bundled"||e==="user"||e==="project"?e:void 0}function Jqr(e){return e==="pending"||e==="running"||e==="completed"||e==="failed"||e==="aborted"?e:void 0}function $Re(e){if(!xn(e))return;let t={},n=kd(e.index);if(n!==void 0)t.index=n;let r=To(e.id);if(r!==void 0)t.id=r;let a=To(e.agent);if(a!==void 0)t.agent=a;let i=ORe(e.agentSource);if(i!==void 0)t.agentSource=i;let o=Jqr(e.status);if(o!==void 0)t.status=o;let s=To(e.task);if(s!==void 0)t.task=s;let l=To(e.assignment);if(l!==void 0)t.assignment=l;let u=To(e.description);if(u!==void 0)t.description=u;let d=To(e.lastIntent);if(d!==void 0)t.lastIntent=d;let p=To(e.currentTool);if(p!==void 0)t.currentTool=p;let h=To(e.currentToolArgs);if(h!==void 0)t.currentToolArgs=h;let f=kd(e.currentToolStartMs);if(f!==void 0)t.currentToolStartMs=f;if(Array.isArray(e.recentTools))t.recentTools=e.recentTools;if(Array.isArray(e.recentOutput))t.recentOutput=e.recentOutput.filter((E)=>typeof E==="string");let g=kd(e.toolCount);if(g!==void 0)t.toolCount=g;let b=kd(e.requests);if(b!==void 0)t.requests=b;let y=kd(e.tokens);if(y!==void 0)t.tokens=y;let v=kd(e.contextTokens);if(v!==void 0)t.contextTokens=v;let x=kd(e.contextWindow);if(x!==void 0)t.contextWindow=x;let k=kd(e.cost);if(k!==void 0)t.cost=k;let C=kd(e.durationMs);if(C!==void 0)t.durationMs=C;if(typeof e.modelOverride==="string"||Array.isArray(e.modelOverride)&&e.modelOverride.every((E)=>typeof E==="string"))t.modelOverride=e.modelOverride;let _=To(e.modelRole);if(_!==void 0)t.modelRole=_;let w=To(e.resolvedModel);if(w!==void 0)t.resolvedModel=w;let T=To(e.resolvedThinkingLevel);if(T!==void 0)t.resolvedThinkingLevel=T;if(typeof e.resolvedModelIsFallback==="boolean")t.resolvedModelIsFallback=e.resolvedModelIsFallback;if(xn(e.retryState)){let E=kd(e.retryState.attempt),L=kd(e.retryState.maxAttempts),P=kd(e.retryState.delayMs),R=To(e.retryState.errorMessage),I=kd(e.retryState.startedAtMs);if(E!==void 0&&L!==void 0&&P!==void 0&&R!==void 0&&I!==void 0)t.retryState={attempt:E,maxAttempts:L,delayMs:P,errorMessage:R,startedAtMs:I}}if(xn(e.retryFailure)){let E=kd(e.retryFailure.attempt),L=To(e.retryFailure.errorMessage);if(E!==void 0&&L!==void 0)t.retryFailure={attempt:E,errorMessage:L}}if(e.inflightTaskDetails!==void 0)t.inflightTaskDetails=e.inflightTaskDetails;if(xn(e.extractedToolData))t.extractedToolData=e.extractedToolData;return Object.keys(t).length>0?t:void 0}function Qqr(e){if(!xn(e))return;let t=To(e.id),n=To(e.agent);if(!t||!n)return;let r;if(e.status==="started"||e.status==="completed"||e.status==="failed"||e.status==="aborted")r=e.status;else if(e.status==="pending"||e.status==="running")r="started";else return;let a={id:t,agent:n,status:r,index:kd(e.index)??-1,source:"live"},i=ORe(e.agentSource);if(i!==void 0)a.agentSource=i;let o=To(e.description);if(o!==void 0)a.description=o;let s=To(e.task);if(s!==void 0)a.task=s;let l=To(e.assignment);if(l!==void 0)a.assignment=l;let u=To(e.sessionFile);if(u!==void 0)a.sessionFile=u;let d=To(e.parentToolCallId);if(d!==void 0)a.parentToolCallId=d;let p=kd(e.lastUpdate)??Date.now();a.lastUpdate=p;let h=$Re(e.progress);if(h!==void 0)a.progress=h;return a}function foe(e){if(!xn(e))return;let t=To(e.id),n=To(e.status);if(!t||!n)return;if(n!=="started"&&n!=="completed"&&n!=="failed"&&n!=="aborted")return;let r={id:t,agent:To(e.agent)??"subagent",status:n,index:kd(e.index)??-1,lastUpdate:Date.now(),source:"live"},a=ORe(e.agentSource);if(a!==void 0)r.agentSource=a;let i=To(e.description);if(i!==void 0)r.description=i;let o=To(e.sessionFile);if(o!==void 0)r.sessionFile=o;let s=To(e.parentToolCallId);if(s!==void 0)r.parentToolCallId=s;if(typeof e.detached==="boolean")r.detached=e.detached;return r}function goe(e){let t=$Re(e);if(!xn(e)||!xn(e.progress))return t;let n=$Re(e.progress);if(!n)return t;return{...n,id:n.id??t?.id,index:n.index??t?.index}}function Vin(e){if(!xn(e))return[];let t=e.subagents;if(!Array.isArray(t))return[];let n=[];for(let r of t){let a=Qqr(r);if(a)n.push(a)}return n}function eWr(e,t){return Hin(e)-Hin(t)||e.index-t.index||e.id.localeCompare(t.id)}function boe(e,t,n){let r=new Map(e.map((a)=>[a.id,a]));for(let a of t){let i=r.get(a.id);if(!i){r.set(a.id,a);continue}let o=i.batchSeq??a.batchSeq;if(n!==void 0&&(i.lastUpdate??0)>=n){if(o!==i.batchSeq)r.set(a.id,{...i,batchSeq:o});continue}if(a.source==="history"&&i.source!=="history"){if(o!==i.batchSeq)r.set(a.id,{...i,batchSeq:o});continue}if(a.source!=="history"&&i.source==="history"){r.set(a.id,{...a,batchSeq:o});continue}r.set(a.id,{...i,...a,batchSeq:o})}return[...r.values()].sort(eWr)}var Hin=(e)=>e.batchSeq??Number.MAX_SAFE_INTEGER;var FRe=()=>{};function WT(e,t){return BRe[e].add(t),()=>BRe[e].delete(t)}function Zin(e,t){for(let n of[...BRe[e]])try{n(t)}catch{}}var BRe;var yoe=D(()=>{BRe={subagent_lifecycle:new Set,subagent_progress:new Set,subagent_event:new Set}});async function voe(e,t){try{let n=await fetch(`/api/sessions/${encodeURIComponent(e)}/subagents/${encodeURIComponent(t)}/cancel`,{method:"POST"});if(!n.ok)return!1;return(await n.json().catch(()=>null))?.data?.cancelled===!0}catch{return!1}}async function Kin(e,t,n){try{return(await fetch(`/api/sessions/${encodeURIComponent(e)}/subagents/${encodeURIComponent(t)}/steer`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:n})})).ok}catch{return!1}}function nWr(e,t){return e.map((n)=>{if(t.id!==void 0){if(n.id!==t.id)return n}else if(t.index===void 0||t.index<0||n.index!==t.index)return n;let r=t.status&&n.status==="started"?tWr[t.status]??n.status:n.status;return{...n,status:r,progress:{...n.progress,...t},lastUpdate:Date.now()}})}function xoe({sessionId:e,isActiveSession:t}){let[n]=Pa(),r=n.get("subagent"),[a,i]=ne([]),[o,s]=ne(!1);Ae(()=>{let u=!1,d=String(e);return i([]),s(!0),zin(d).then((p)=>{if(u||!p)return;let h=p.map(hoe);i((f)=>boe(f,h))}).finally(()=>{if(!u)s(!1)}),()=>{u=!0}},[e]),Ae(()=>{if(!t)return;let u=!1,d=String(e),p=Date.now(),h=(b)=>b.sessionId===d?b.payload:null,f=WT("subagent_lifecycle",(b)=>{let y=foe(h(b));if(y)i((v)=>boe(v,[y]))}),g=WT("subagent_progress",(b)=>{let y=goe(h(b));if(y)i((v)=>nWr(v,y))});return fetch(`/api/agent/${encodeURIComponent(d)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"get_subagents"})}).then((b)=>b.ok?b.json():null).then((b)=>{if(u||!xn(b))return;let y="data"in b?b.data:b;i((v)=>boe(v,Vin(y),p))}).catch(()=>{}),()=>{u=!0,f(),g()}},[t,e]);let l=o?"Loading subagents…":a.length===0?"No subagent activity":null;return m("div",{className:"pl-6 pr-0 space-y-0.5 py-0.5",children:l?m("div",{className:"px-2 py-1 text-xs italic text-ink/40 flex items-center",children:[m("span",{className:"w-4 h-4 shrink-0"}),m("span",{className:"w-2 shrink-0"}),m("span",{className:"flex-1 min-w-0 truncate",children:l})]}):a.map((u)=>{let d=Gin(u),p=u.task??u.assignment??u.description??d,h=u.id===r,f=t&&u.status==="started";return m("div",{className:"flex items-center group/subagent-row",children:[m("button",{type:"button",title:p,onClick:()=>window.dispatchEvent(new CustomEvent("omp:view-subagent",{detail:{sessionId:String(e),subagent:u}})),className:`flex-1 min-w-0 flex items-center text-left text-xs rounded-md px-2 py-1 cursor-pointer transition-colors select-none group/subagent ${h?"bg-ink/10 font-medium text-ink":"text-ink/70 hover:text-ink hover:bg-ink/5"}`,children:[m("span",{className:"w-4 h-4 flex items-center justify-center shrink-0",children:m(moe,{status:u.status,live:f,size:11})}),m("span",{className:"w-2 shrink-0"}),m("span",{className:"flex-1 min-w-0 truncate leading-snug",children:d})]}),f&&m("button",{type:"button",title:"Stop this subagent","aria-label":"Stop this subagent",onClick:()=>void voe(String(e),u.id),className:"touch-visible shrink-0 mr-1 w-5 h-5 flex items-center justify-center rounded text-ink/40 hover:text-error hover:bg-error/5 opacity-0 group-hover/subagent-row:opacity-100 transition-opacity cursor-pointer",children:m(gp,{size:10})})]},u.id)})})}var tWr;var zRe=D(()=>{Xe();dt();vc();MRe();PRe();DRe();FRe();yoe();de();tWr={pending:"started",running:"started",completed:"completed",failed:"failed",aborted:"aborted"}});function Xin(){let e=Oi(Yin);if(!Array.isArray(e))return new Set;return new Set(e.filter((t)=>typeof t==="string"))}function Jin(e){Hu(Yin,[...e].slice(-rWr))}var Yin="omp_sidebar_expanded_sessions",rWr=50;var Qin=D(()=>{_c()});function koe(){let[e]=Pa(),t=e.get("subagent"),n=e.get("sessionId"),[r,a]=ne(()=>new Set);Ae(()=>{let o=Xin();if(o&&o.size>0)a(o)},[]),Ae(()=>{if(!t||!n)return;a((o)=>{if(o.has(n))return o;let s=new Set(o);return s.add(n),s})},[t,n]);let i=Se((o)=>{a((s)=>{let l=new Set(s);if(l.has(o))l.delete(o);else l.add(o);return Jin(l),l})},[]);return{expandedSessionIds:r,toggleSession:i}}var jRe=D(()=>{Xe();vc();Qin()});function _oe(e,t=Date.now()){if(e===null||e===void 0||e==="")return null;let n=typeof e==="number"?e:Date.parse(e);if(Number.isNaN(n))return null;let r=Math.round((t-n)/1000);if(r<45)return"now";let a=Math.round(r/60);if(a<60)return`${a}m`;let i=Math.round(a/60);if(i<24)return`${i}h`;let o=Math.round(i/24);if(o<7)return`${o}d`;let s=Math.round(o/7);if(s<5)return`${s}w`;let l=new Date(n),u=l.getFullYear()===new Date(t).getFullYear(),d=l.getDate(),p=l.toLocaleString("en-US",{month:"short"});return u?`${d} ${p}`:`${d} ${p} ${l.getFullYear()}`}function eon(e,t){return e.includes(t)?e.filter((n)=>n!==t):[...e,t]}function ton(e,t){let n=new Set(e),r=t.filter((a)=>n.has(a)).length;return{count:r,all:t.length>0&&r===t.length,some:r>0&&r<t.length}}function $L(e,t){return e.filter((n)=>t?n.is_archived===1:n.is_archived!==1).map((n)=>String(n.id))}function woe(e,t){let n=new Set(t);return e.filter((r)=>n.has(r))}function non(e,t,{activeSessionId:n,sessionStatus:r={}}){if(e.length<=t)return{rendered:e,hiddenCount:0};let a=[],i=0;for(let o=0;o<e.length;o+=1){let s=e[o],l=String(s.id),d=(n!==null?String(n)===l:s.is_active===1)||r[l]==="stream"||Boolean(s.awaitingInput);if(o<t||d)a.push(s);else i+=1}return{rendered:a,hiddenCount:i}}function ron(e,t){return e.mode==="workspace"||e.mode==="session"&&e.scopeFolderId===t}function aon(e,t){return e.mode==="session"&&e.scopeFolderId===t}function Coe({batch:e,folder:t,sessions:n,showArchived:r,visibleCount:a,activeSessionId:i,sessionStatus:o}){let s=e?ron(e,t.id):!1,l=e?aon(e,t.id):!1,u=l?$L(n,r):s?[String(t.id)]:[],d=e&&s?e.summaryOf(u):null,p=non(n,a,{activeSessionId:i,sessionStatus:o});return{folderCheckbox:s,sessionCheckboxes:l,folderSummary:d,selectableIds:u,toggleFolderSelection:()=>{if(!e)return;if(s&&!l){e.toggle(String(t.id));return}if(!l)return;if(d?.all)e.unselectAllOf(u);else e.selectAllOf(u)},rendered:l?n:p.rendered,hiddenCount:l?0:p.hiddenCount}}var URe=()=>{};function ion({folder:e,activeSessionId:t,onSelectSession:n,onNewSessionForFolder:r,forceExpanded:a=!1,showArchived:i=!1,sessionStatus:o={},onToast:s,batch:l,onStartSessionSelection:u,onCancelWait:d}){let[p,h]=ne(e.isExpanded||!1),[f,g]=ne(!1),{visibleCount:b,showMore:y,showLess:v,canShowLess:x}=aoe(),[k]=Pa(),C=k.get("subagent"),_=k.get("sessionId"),{expandedSessionIds:w,toggleSession:T}=koe();Ae(()=>{if(typeof e.isExpanded==="boolean")h(e.isExpanded)},[e.isExpanded]);let E=Le(null),{refresh:L}=zl(),P=Tc(),{confirmDelete:R,requestDelete:I,cancelDelete:A,handlePin:M,handleDelete:N,handleArchive:O,handleRename:B,handleRenameWithAi:F,handleOpenFolder:U}=ooe(e,L,s),z=NL();Pr(E,()=>{g(!1),A()});let q=e.sessions,W=()=>{let Ve=!p;if(h(Ve),typeof e.id!=="number")return;P.submit({isExpanded:String(Ve)},{method:"POST",action:`/api/folders/${e.id}/toggle`})},H=(Ve)=>{T(Ve)},Y=()=>{M(),g(!1)},X=()=>{N(),g(!1)},ee=U?()=>{U(),g(!1)}:void 0,Z=a||p,ce=(q||[]).filter((Ve)=>i?Ve.is_archived===1:Ve.is_archived!==1),{folderCheckbox:ie,sessionCheckboxes:fe,folderSummary:pe,toggleFolderSelection:ye,rendered:Me,hiddenCount:Te}=Coe({batch:l,folder:e,sessions:ce,showArchived:i,visibleCount:b,activeSessionId:t,sessionStatus:o}),qe=Z||fe,lt=Te>0;return m("div",{className:"space-y-1",children:[m(Fin,{folder:e,isOpen:Z,onToggleFolder:W,checkbox:ie&&pe?{checked:pe.all,indeterminate:pe.some,label:`Select ${e.name}`,onChange:ye}:null,batchActive:Boolean(l),menuRef:E,showMenu:f,onToggleMenu:()=>g(!f),onNewSession:()=>r(e.id),onOpenFolder:ee,onSelectSessions:u?()=>{g(!1),u(e.id)}:void 0,confirmDelete:R,onPin:Y,onDelete:X,onRequestDelete:I,onCancelDelete:A}),qe&&m("div",{className:"space-y-0.5",children:[Me.map((Ve)=>{let Ee=String(Ve.id),je=t!==null?String(t)===Ee:Ve.is_active===1,re=je&&_===Ee&&Boolean(C),ke=t!==null&&Ee===String(t),le=Boolean(Ve.hasSubagents),ue=le&&w.has(Ee);return m("div",{className:"space-y-0.5",children:[m($in,{sessionId:Ve.id,title:Ve.title,isActive:je&&!re,isArchived:Ve.is_archived===1,status:o[Ee],awaitingInput:Boolean(Ve.awaitingInput),timeAgo:_oe(Ve.updated_at??Ve.created_at),onClick:()=>n(Ve.id),onArchive:()=>O(Ve),onDelete:String(Ve.id).startsWith("new-")?void 0:()=>z.requestDelete(Ve),onRename:String(Ve.id).startsWith("new-")?void 0:(K)=>void B(Ve,K),onRenameWithAi:String(Ve.id).startsWith("new-")?void 0:()=>void F(Ve),expandable:le,hasSubagents:le,isExpanded:ue,onToggleExpand:()=>H(Ee),waitingFor:Ve.waitingFor?{title:Ve.waitingFor.title}:void 0,onCancelWait:Ve.waitingFor?()=>d?.(Ve.waitingFor.waitId):void 0,selectable:fe,selected:Boolean(l?.selected.includes(Ee)),onToggleSelect:l?()=>l.toggle(Ee):void 0}),le&&ue&&m(xoe,{sessionId:Ve.id,isActiveSession:ke})]},Ve.id)}),(lt||x)&&!a&&!fe&&m("div",{className:"flex items-center gap-1",children:[lt&&m("button",{type:"button",onClick:y,className:"flex items-center min-w-0 text-xs text-ink/45 hover:text-ink/80 py-1.5 px-2 rounded-lg hover:bg-ink/5 transition-colors cursor-pointer select-none",children:[m("span",{className:"w-4 h-4 shrink-0 flex items-center justify-center",children:m(Gn,{size:12})}),m("span",{className:"w-2 shrink-0"}),m("span",{className:"truncate leading-snug",children:["Show more sessions (",Te,")"]})]}),x&&m("button",{type:"button",onClick:v,className:"ml-auto shrink-0 flex items-center gap-1 text-xs text-ink/45 hover:text-ink/80 py-1.5 px-2 rounded-lg hover:bg-ink/5 transition-colors cursor-pointer select-none",children:[m(ju,{size:12}),m("span",{className:"truncate leading-snug",children:"Show less"})]})]}),ce.length===0&&m("div",{className:"px-3 py-2 text-[11px] text-ink/40 italic",children:i?"No archived sessions.":"No sessions."})]}),m(IL,{session:z.pending,isDeleting:z.isDeleting,error:z.error,onClose:z.cancelDelete,onConfirm:()=>void z.confirmDelete()})]})}var oon=D(()=>{Xe();dt();vc();Db();to();TRe();RRe();soe();loe();Oin();Bin();zRe();jRe();xg();URe();de()});function son({folders:e,activeSessionId:t,searchQuery:n,showArchived:r,sessionStatus:a,onSelectSession:i,onNewSessionForFolder:o,onToast:s,batch:l,onStartSessionSelection:u,onCancelWait:d}){return m("div",{className:"flex-1 scrollbar-overlay-container p-2 space-y-4",children:e.length===0?m("div",{className:"text-center py-8 text-xs text-ink/40",children:n?"No results found.":"No workspaces available."}):e.map((p)=>m(ion,{folder:p,activeSessionId:t,onSelectSession:i,onNewSessionForFolder:o,forceExpanded:!!n,showArchived:r,sessionStatus:a,onToast:s,batch:l,onStartSessionSelection:u,onCancelWait:d},p.id))})}var lon=D(()=>{oon();de()});function con(){return m("div",{className:"flex-1 p-2 space-y-4","aria-hidden":"true",children:aWr.map((e,t)=>m("div",{className:"space-y-1.5",children:[m("div",{className:"flex items-center gap-2 px-1 py-1.5",children:[m("span",{className:"w-3.5 h-3.5 rounded-sm animate-pulse bg-ink/10"}),m("span",{className:"h-3 w-24 rounded animate-pulse bg-ink/10"})]}),Array.from({length:e},(n,r)=>m("div",{className:"flex items-center gap-2 rounded px-2 py-1.5",children:[m("span",{className:"w-4 h-4 rounded-full animate-pulse bg-ink/10"}),m("span",{className:"h-3 rounded animate-pulse bg-ink/10",style:{width:`${58-r%3*12}%`}})]},r))]},t))})}var aWr;var uon=D(()=>{de();aWr=[3,2]});function dj(e,t){if(!e)return;fetch("/api/agent/prewarm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e,...t?{accessMode:t}:{}})}).catch(()=>{})}function pj(e,t,n){let r=n!==void 0?e.find((a)=>String(a.id)===String(n)):e.find((a)=>a.sessions?.some((i)=>String(i.id)===String(t)))??e.find((a)=>Boolean(a.project_path));return r?.project_path||r?.name||null}function iWr(e){if(!e)return Number.NaN;let t=Date.parse(e);return Number.isFinite(t)?t:Number.NaN}function don(e){let t=Number.NEGATIVE_INFINITY;for(let n of e.sessions??[]){let r=iWr(n.updated_at??n.created_at);if(r>t)t=r}return t}function pon(e){let t=Number.NEGATIVE_INFINITY;for(let n of e.sessions??[]){let r=Number(n.id);if(Number.isFinite(r)&&r>t)t=r}return t}function Q4(e){let t=Number(e.id);return Number.isFinite(t)?t:Number.NEGATIVE_INFINITY}function Soe(e,t){if(e===t)return 0;return e>t?-1:1}function mon(e,t){if(e===t)return 0;return e>t?1:-1}function oWr(e,t,n){let r=Boolean(e.isPinned),a=Boolean(t.isPinned);if(r!==a)return r?-1:1;switch(n){case"Z-A":{let i=t.name.localeCompare(e.name);return i!==0?i:mon(Q4(e),Q4(t))}case"LATEST_SESSION":{let i=Soe(don(e),don(t));if(i!==0)return i;let o=Soe(pon(e),pon(t));if(o!==0)return o;let s=Soe(Q4(e),Q4(t));return s!==0?s:e.name.localeCompare(t.name)}case"LATEST_ADDED":{let i=Soe(Q4(e),Q4(t));return i!==0?i:e.name.localeCompare(t.name)}case"A-Z":default:{let i=e.name.localeCompare(t.name);return i!==0?i:mon(Q4(e),Q4(t))}}}function hon(e,t){return[...e].sort((n,r)=>oWr(n,r,t))}function gon(e){return typeof e==="string"&&sWr.includes(e)}var sWr,fon="LATEST_SESSION";var bon=D(()=>{sWr=["A-Z","Z-A","LATEST_SESSION","LATEST_ADDED"]});function mj(e){return String(e).padStart(2,"0")}function lWr(e=new Date){if(Number.isNaN(e.getTime()))return"New Session";return`New Session - ${e.getFullYear()}-${mj(e.getMonth()+1)}-${mj(e.getDate())}T${mj(e.getHours())}:${mj(e.getMinutes())}:${mj(e.getSeconds())}`}function H2(e){return Boolean(e?.startsWith("new-"))}function qRe(e){return e?.startsWith("new-")?Number(e.slice(4)):Number.NaN}function WRe(e){if(!e||e.length<15||e[8]!=="-"||e[13]!=="-"||e[14]!=="7")return Number.NaN;let t=Number.parseInt(e.slice(0,8)+e.slice(9,13),16);return Number.isFinite(t)?t:Number.NaN}function Toe(e){let t=qRe(e),n=Number.isFinite(t)?t:WRe(e);return lWr(Number.isFinite(n)?new Date(n):new Date)}function yon(e){if(!e)return!0;let t=e["chat.draft"];if(typeof t==="string"&&t.trim().length>0)return!0;let n=e["chat.draftAttachments"];return Array.isArray(n)&&n.length>0}var Eoe="chat.draft",Aoe="chat.draftAttachments";function Roe(){for(let e of[...GRe])e()}function von(e){let t=qRe(e);if(Number.isFinite(t))return t;let n=WRe(e);return Number.isFinite(n)?n:Date.now()}function hj(e){let t=_d.get(e.id),n=t?.waiting?.waitId===e.waiting?.waitId&&t?.waiting?.dependsOn===e.waiting?.dependsOn&&t?.waiting?.dependsOnTitle===e.waiting?.dependsOnTitle;if(t&&t.folderId===e.folderId&&t.createdAt===e.createdAt&&t.sentAt===e.sentAt&&n)return;_d.set(e.id,e),Roe()}function Iy(e){let t=Date.now();while(_d.has(`new-${t}`))t+=1;let n=`new-${t}`;hj({id:n,folderId:e,createdAt:t,sentAt:null});let r=[..._d.values()].filter((a)=>a.sentAt===null);for(let a of r.slice(0,Math.max(0,r.length-uWr)))_d.delete(a.id);return n}function xon(e){let t=_d.get(e);if(!t||t.sentAt!==null)return;hj({...t,sentAt:Date.now()})}function Noe(e,t,n){if(!t)return;let r=e?_d.get(e):void 0;if(r&&e)_d.delete(e);if(e)Loe.set(t,e);hj({id:t,folderId:r?.folderId??n??null,createdAt:r?.createdAt??von(t),sentAt:r?.sentAt??Date.now()})}function kon(e,t){if(!e||Loe.get(t)!==e)return!1;return Loe.delete(t),!0}function _on(e,t){return Boolean(e)&&Loe.get(t)===e}function won(e,t,n){if(!e||_d.has(e))return;hj({id:e,folderId:t,createdAt:von(e),sentAt:n?Date.now():null})}function Ioe(e,t){let n=_d.get(e);if(!n)return;let r=t(n);if(r===null){_d.delete(e),Roe();return}hj(r)}function Con(e){if(_d.delete(e))Roe()}function OL(){return[..._d.values()]}function Son(e){let t=e.now??Date.now(),n=e.activeId?String(e.activeId):null,r=!1;for(let[a,i]of[..._d]){if(e.listed.has(a)){_d.delete(a),r=!0;continue}if(e.running.has(a))continue;if(i.waiting)continue;if(i.sentAt!==null){if(t-i.sentAt>cWr)_d.delete(a),r=!0;continue}if(n!==null&&String(a)===n)continue;if(!yon(B$e(a)))_d.delete(a),r=!0}if(r)Roe()}function dWr(e){return GRe.add(e),()=>GRe.delete(e)}function Ton(){let[e,t]=ne(()=>OL());return Ae(()=>(t(OL()),dWr(()=>t(OL()))),[]),e}var cWr=30000,uWr=3,_d,Loe,GRe;var sb=D(()=>{Xe();Td();_d=new Map,Loe=new Map,GRe=new Set});function Moe(e,t){Ioe(e,(n)=>({...n,sentAt:n.sentAt??Date.now(),waiting:t}))}function HRe(e){Ioe(e,(t)=>t.waiting?{...t,waiting:void 0}:t)}function Eon(e){return OL().find((t)=>t.id===e)?.waiting??null}function Aon(e){for(let t of OL())if(t.waiting?.waitId===e)Ioe(t.id,()=>null)}var fj=D(()=>{sb()});function FL(){let e=Li(g$e),[t,n]=ne([]),[r,a]=ne(!1);Ae(()=>{if(Array.isArray(e.data))return;let l=!0;return fetch("/api/waiting").then((u)=>u.ok?u.json():null).then((u)=>{if(!l||!Array.isArray(u?.prompts))return;n(u.prompts),a(!0)}).catch(()=>{}),()=>{l=!1}},[e.data]);let i=Array.isArray(e.data),o=i?e.data:t,s=Se(()=>e.refresh(),[e]);return{prompts:o,loaded:i||r,refresh:s}}async function Lon(e){let t=await fetch("/api/waiting",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await t.json().catch(()=>null);if(!t.ok||!n?.prompt)throw Error(typeof n?.error==="string"?n.error:`HTTP ${t.status}`);return n.prompt}async function Ron(e){let t=await fetch(`/api/waiting?id=${encodeURIComponent(e)}`,{method:"DELETE"});if(t.ok)return{ok:!0};let n=await t.json().catch(()=>null);return{ok:!1,error:typeof n?.error==="string"?n.error:`HTTP ${t.status}`}}var BL=D(()=>{Xe();dp();ds()});function Non(e,t,n){if(t.length===0||e.length===0)return e;let r=new Set;for(let o of e)for(let s of o.sessions??[])r.add(String(s.id));let a=t.filter((o)=>!r.has(String(o.id)));if(a.length===0)return e;let i=e;for(let o of a){let s=pWr(i,o,n);if(!s)continue;let l=new Date(o.createdAt).toISOString(),u={id:o.id,folder_id:s.id,title:n.titleFor?.(String(o.id))??Toe(o.id),created_at:l,updated_at:l,...o.waiting?{waitingFor:{waitId:o.waiting.waitId,sessionId:o.waiting.dependsOn,title:o.waiting.dependsOnTitle}}:{}};i=i.map((d)=>d.id===s.id?{...d,isExpanded:!0,sessions:[u,...d.sessions??[]]}:d)}return i}function pWr(e,t,n){if(t.folderId!==null&&t.folderId!==void 0){let r=e.find((a)=>String(a.id)===String(t.folderId));if(r)return r}if(n.activeId){let r=e.find((a)=>(a.sessions??[]).some((i)=>String(i.id)===String(n.activeId)));if(r)return r}if(n.urlFolderId){let r=e.find((a)=>String(a.id)===String(n.urlFolderId));if(r)return r}return e[0]}var Ion=()=>{};function Poe(e={},t={}){let{expandSearchMatches:n=!1,onSelectSession:r,onAfterSelect:a}=t,{folders:i,initializing:o,refresh:s,refreshNow:l,refreshing:u,isRefreshing:d,markSeen:p,hasSeen:h,streamStatusMap:f,titleHint:g}=zl(),[b,y]=Pa(),v=b.get("sessionId"),x=b.get("folderId"),k=v?Number.isNaN(Number(v))?v:Number(v):null,C=Le(s);C.current=s;let _=Se(()=>C.current(),[]),[w,T]=ne(""),[E,L]=ne(!1),[P,R]=ne(!1),[I,A]=ne(()=>gon(e.omp_sidebar_sort)?e.omp_sidebar_sort:fon),M=Le(null),N=Se((Z)=>{if(M.current)clearTimeout(M.current);M.current=setTimeout(()=>{Hu("omp_sidebar_sort",Z)},mWr)},[]);Ae(()=>()=>{if(M.current)clearTimeout(M.current)},[]);let O=(Z)=>{A(Z),R(!1),N(Z)},B=f;mtn(B,k,_,h);let F=Ton(),{prompts:U,loaded:z}=FL(),q=st(()=>new Set(Object.entries(B).filter(([,Z])=>Z==="stream").map(([Z])=>Z)),[B]);Ae(()=>{if(!v||o)return;if(i.some((Z)=>(Z.sessions??[]).some((ce)=>String(ce.id)===v)))return;won(v,x,B[v]==="stream")},[v,i,o,x,B]),Ae(()=>{if(o||!z)return;for(let Z of F){let ce=String(Z.id),ie=U.find((fe)=>fe.pendingId===ce&&fe.status==="waiting");if(!ie||Z.waiting?.waitId===ie.id)continue;Moe(ce,{waitId:ie.id,dependsOn:ie.dependsOn,dependsOnTitle:ie.dependsOnTitle})}},[F,U,z,o]);let[W,H]=ne(0),Y=F.map((Z)=>String(Z.id)).join(`