panopticon-cli 0.4.9 → 0.4.10

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.
@@ -550,7 +550,7 @@ Review and tests have passed. This will:
550
550
  .custom-scrollbar::-webkit-scrollbar-thumb:hover {
551
551
  background: #3b82f6;
552
552
  }
553
- `})]})}async function pz(){const e=await fetch("/api/settings");if(!e.ok)throw new Error("Failed to fetch settings");return e.json()}async function mz(e){const t=await fetch("/api/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.text();throw new Error(n||"Failed to save settings")}}async function gz(){const e=await fetch("/api/settings/optimal-defaults");if(!e.ok)throw new Error("Failed to fetch optimal defaults");return e.json()}async function gb(e,t,n){const r=await fetch("/api/settings/test-api-key",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,apiKey:t,model:n})});if(!r.ok)throw new Error("Failed to test API key");return r.json()}const zf=[{id:"anthropic",name:"Anthropic",icon:"deployed_code",placeholder:"sk-ant-..."},{id:"openai",name:"OpenAI",icon:"auto_awesome",placeholder:"sk-..."},{id:"google",name:"Google",icon:"cloud",placeholder:"AIza..."},{id:"kimi",name:"Kimi (Moonshot)",icon:"token",placeholder:"sk-kimi-..."},{id:"zai",name:"Zhipu (GLM)",icon:"hub",placeholder:"sk-zai-..."}],vb=[{id:"linear",name:"Linear",icon:"view_kanban",envVar:"LINEAR_API_KEY",placeholder:"lin_api_..."},{id:"github",name:"GitHub",icon:"code",envVar:"GITHUB_TOKEN",placeholder:"ghp_..."},{id:"gitlab",name:"GitLab",icon:"commit",envVar:"GITLAB_TOKEN",placeholder:"glpat-..."},{id:"rally",name:"Rally",icon:"flag",envVar:"RALLY_API_KEY",placeholder:"_abc123..."}],vz=[{name:"Issue Agent Phases",icon:"list_alt",agents:[{id:"issue-agent:exploration",name:"Exploration",icon:"search",description:"Codebase discovery"},{id:"issue-agent:planning",name:"Planning",icon:"event_note",description:"Implementation design"},{id:"issue-agent:implementation",name:"Implementation",icon:"code",description:"Write the code"},{id:"issue-agent:testing",name:"Testing",icon:"science",description:"Write & run tests"},{id:"issue-agent:documentation",name:"Documentation",icon:"description",description:"Update docs"},{id:"issue-agent:review-response",name:"Review Response",icon:"reply",description:"Address PR feedback"}]},{name:"Specialist Agents",icon:"psychology",agents:[{id:"specialist-review-agent",name:"Review Agent",icon:"rate_review",description:"Automated code reviews"},{id:"specialist-test-agent",name:"Test Agent",icon:"science",description:"Test generation"},{id:"specialist-merge-agent",name:"Merge Agent",icon:"call_merge",description:"Merge conflict resolution"}]},{name:"Convoy Reviewers",icon:"groups",agents:[{id:"convoy:security-reviewer",name:"Security",icon:"shield",description:"Security analysis"},{id:"convoy:performance-reviewer",name:"Performance",icon:"speed",description:"Performance review"},{id:"convoy:correctness-reviewer",name:"Correctness",icon:"check_circle",description:"Logic validation"},{id:"convoy:synthesis-agent",name:"Synthesis",icon:"merge",description:"Combine reviews"}]},{name:"Subagents",icon:"account_tree",agents:[{id:"subagent:explore",name:"Explore",icon:"explore",description:"Codebase exploration"},{id:"subagent:plan",name:"Plan",icon:"event_note",description:"Task breakdown"},{id:"subagent:bash",name:"Bash",icon:"terminal",description:"CLI commands"},{id:"subagent:general-purpose",name:"General",icon:"psychology",description:"General tasks"}]},{name:"Workflow Agents",icon:"route",agents:[{id:"prd-agent",name:"PRD Agent",icon:"article",description:"Product requirements"},{id:"decomposition-agent",name:"Decomposition",icon:"account_tree",description:"Break down epics"},{id:"triage-agent",name:"Triage",icon:"filter_list",description:"Prioritize issues"},{id:"planning-agent",name:"Planning",icon:"event",description:"Sprint planning & status reviews"}]},{name:"CLI Modes",icon:"terminal",agents:[{id:"cli:interactive",name:"Interactive",icon:"chat",description:"Conversation mode"},{id:"cli:quick-command",name:"Quick Command",icon:"bolt",description:"One-shot queries"}]}],xb="claude-sonnet-4-5";function xz(e){const t=o2(e);return t?t.name:e.includes("claude")?e.includes("opus")?"Opus 4.6":e.includes("haiku")?"Haiku":"Sonnet 4.5":e.includes("gpt")?"GPT-4o":e.includes("gemini")?e.includes("flash")?"Gemini Flash":"Gemini Pro":e.includes("kimi")?e.includes("k2.5")||e.includes("2.5")?"Kimi K2.5":"Kimi K2":e.includes("glm")?"GLM-4":e}function yz(){var L,K;const e=cn(),{data:t,isLoading:n,error:r}=fe({queryKey:["settings"],queryFn:pz}),[i,s]=y.useState(null),[o,l]=y.useState({}),[c,u]=y.useState({}),[d,h]=y.useState(null),[p,f]=y.useState(null),[m,g]=y.useState({}),[w,x]=y.useState(null),[_,v]=y.useState(null),[b,N]=y.useState({});y.useEffect(()=>{t&&!i&&s(t)},[t,i]);const S=Se({mutationFn:mz,onSuccess:()=>{e.invalidateQueries({queryKey:["settings"]})}});if(n)return a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx(Re,{className:"w-8 h-8 text-blue-400 animate-spin"})});if(r||!i)return a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsxs("div",{className:"text-red-400",children:["Error: ",(r==null?void 0:r.message)||"Failed to load settings"]})});const E=JSON.stringify(i)!==JSON.stringify(t),D=k=>{k!=="anthropic"&&s({...i,models:{...i.models,providers:{...i.models.providers,[k]:!i.models.providers[k]}}})},B=(k,U)=>{k!=="anthropic"&&s({...i,api_keys:{...i.api_keys,[k]:U||void 0}})},j=(k,U)=>{s({...i,tracker_keys:{...i.tracker_keys,[k]:U||void 0}})},I=(k,U)=>{s({...i,models:{...i.models,overrides:{...i.models.overrides,[k]:U}}})},P=k=>{const{[k]:U,...T}=i.models.overrides;s({...i,models:{...i.models,overrides:T}})},R=()=>S.mutate(i),A=()=>s(t||null),O=async()=>{try{const k=await gz(),U={models:{providers:{...(i==null?void 0:i.models.providers)||k.models.providers},overrides:{...k.models.overrides},gemini_thinking_level:k.models.gemini_thinking_level},api_keys:{...(i==null?void 0:i.api_keys)||{}},tracker_keys:{...(i==null?void 0:i.tracker_keys)||{}}};s(U)}catch(k){console.error("Failed to fetch optimal defaults:",k),alert("Failed to load optimal defaults: "+k.message)}},F=async k=>{const U=i==null?void 0:i.api_keys[k];if(U){f(k),g({...m,[k]:null});try{const T=await gb(k,U);g({...m,[k]:T})}catch{g({...m,[k]:{success:!1,error:"Test failed",response:null,latencyMs:0}})}finally{f(null)}}},Y=async(k,U)=>{const T=i==null?void 0:i.api_keys[k];if(!T)return;const C=`${k}:${U}`;v(C),N({...b,[C]:null});try{const H=await gb(k,T,U);N({...b,[C]:H})}catch{N({...b,[C]:{success:!1,error:"Test failed",response:null,latencyMs:0}})}finally{v(null)}};return a.jsxs("div",{className:"max-w-[1200px] mx-auto px-6 md:px-10 py-8 pb-32",children:[a.jsx("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-4 mb-8",children:a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("span",{className:"material-symbols-outlined text-blue-400 text-2xl",children:"settings"}),a.jsx("h1",{className:"text-content text-4xl font-black tracking-tight",children:"Settings"})]}),a.jsx("p",{className:"text-content-muted text-base",children:"Configure AI model orchestration and agent permissions."})]})}),a.jsx("section",{className:"mb-10",children:a.jsx("div",{className:"bg-surface-raised border border-divider rounded-xl overflow-hidden",children:a.jsxs("div",{className:"flex flex-col lg:flex-row",children:[a.jsxs("div",{className:"lg:w-2/5 bg-surface p-8 flex flex-col justify-center items-center border-b lg:border-b-0 lg:border-r border-divider relative overflow-hidden",children:[a.jsx("div",{className:"absolute inset-0 opacity-10 pointer-events-none bg-[radial-gradient(circle_at_50%_50%,#3b82f6_0%,transparent_70%)]"}),a.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-6 w-full max-w-xs",children:[a.jsxs("div",{className:"flex items-center justify-between w-full",children:[a.jsx("div",{className:"size-12 rounded-lg bg-surface-emphasis border border-divider-strong flex items-center justify-center shadow-sm",children:a.jsx("span",{className:"material-symbols-outlined text-content-subtle",children:"terminal"})}),a.jsx("div",{className:"flex-1 h-px bg-gradient-to-r from-divider-strong via-blue-500 to-divider-strong mx-2"}),a.jsx("div",{className:"size-12 rounded-lg bg-surface-emphasis border border-divider-strong flex items-center justify-center shadow-sm",children:a.jsx("span",{className:"material-symbols-outlined text-blue-400",children:"account_tree"})}),a.jsx("div",{className:"flex-1 h-px bg-gradient-to-r from-divider via-blue-500 to-divider mx-2"}),a.jsx("div",{className:"size-12 rounded-lg bg-blue-500 flex items-center justify-center shadow-[0_0_20px_rgba(59,130,246,0.4)]",children:a.jsx("span",{className:"material-symbols-outlined text-content",children:"bolt"})})]}),a.jsxs("div",{className:"flex justify-between w-full px-2 text-[10px] uppercase tracking-widest font-bold text-content-muted",children:[a.jsx("span",{children:"Task"}),a.jsx("span",{children:"Capability"}),a.jsx("span",{children:"Model"})]})]})]}),a.jsxs("div",{className:"lg:w-3/5 p-8",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx("span",{className:"px-2 py-0.5 bg-blue-500/10 text-blue-400 text-[10px] font-bold uppercase tracking-wider rounded border border-blue-500/20",children:"Active"}),a.jsx("h3",{className:"text-content text-xl font-bold",children:"Smart Model Selection"})]}),a.jsx("p",{className:"text-content-muted mb-6 leading-relaxed",children:"Panopticon automatically routes tasks to the optimal model based on capabilities, token budget, and latency requirements."}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("span",{className:"material-symbols-outlined text-blue-400 text-sm mt-1",children:"check_circle"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-semibold text-content",children:"Capability Matching"}),a.jsx("p",{className:"text-xs text-content-muted",children:"Best model for each task type"})]})]}),a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("span",{className:"material-symbols-outlined text-blue-400 text-sm mt-1",children:"check_circle"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-semibold text-content",children:"Cost Optimization"}),a.jsx("p",{className:"text-xs text-content-muted",children:"Balance performance vs spend"})]})]})]})]})]})})}),a.jsxs("section",{className:"mb-12",children:[a.jsxs("h2",{className:"text-content text-2xl font-bold mb-6 flex items-center gap-3",children:["Provider Configuration",a.jsx("div",{className:"h-px flex-1 bg-divider-strong"})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:zf.map(k=>{var H,V,X,z,te;const U=k.id==="anthropic",T=U||i.models.providers[k.id],C=i.api_keys[k.id]||"";return a.jsxs("div",{className:`bg-surface-raised border rounded-xl p-5 relative transition-colors shadow-sm ${U?"border-blue-500/50 shadow-lg shadow-blue-500/5":"border-divider hover:border-divider-strong"}`,children:[U&&a.jsx("div",{className:"absolute -top-3 right-4",children:a.jsx("span",{className:"bg-blue-500 text-content text-[10px] font-black px-2 py-0.5 rounded uppercase tracking-tighter",children:"Default"})}),a.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[a.jsx("div",{className:"size-10 rounded-lg bg-surface-emphasis border border-divider flex items-center justify-center",children:a.jsx("span",{className:"material-symbols-outlined text-content-subtle",children:k.icon})}),a.jsx("span",{className:"font-bold text-content",children:k.name}),a.jsx("div",{className:"ml-auto",children:a.jsx("button",{onClick:()=>D(k.id),disabled:U,className:`w-10 h-5 rounded-full relative transition-colors ${T?"bg-blue-500":"bg-surface-emphasis"} ${U?"cursor-not-allowed":"cursor-pointer"}`,children:a.jsx("div",{className:`absolute top-0.5 size-4 bg-white rounded-full transition-all ${T?"right-0.5":"left-0.5"}`})})})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"relative",children:[a.jsx("label",{className:"text-[10px] uppercase font-bold text-content-muted mb-1 block",children:"API Key"}),C.startsWith("$")?a.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/30 rounded-lg px-3 py-2",children:[a.jsxs("div",{className:"flex items-center gap-2 text-amber-400 text-xs",children:[a.jsx("span",{className:"material-symbols-outlined text-[14px]",children:"info"}),a.jsxs("span",{children:["Configured via ",a.jsx("code",{className:"font-mono bg-surface-overlay px-1 rounded",children:C})]})]}),a.jsx("p",{className:"text-[10px] text-amber-400/70 mt-1",children:"Set this environment variable or enter the key directly below"}),a.jsx("input",{type:"text",placeholder:k.placeholder,onChange:ae=>B(k.id,ae.target.value),autoComplete:"off",className:"w-full bg-input-bg border border-divider-strong rounded-lg px-3 py-2 text-xs font-mono mt-2 focus:ring-1 focus:ring-blue-500 focus:border-blue-500 text-content-body"})]}):a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:o[k.id]?"text":"password",value:C,onChange:ae=>B(k.id,ae.target.value),disabled:U,placeholder:k.placeholder,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-lpignore":"true","data-1p-ignore":"true","data-form-type":"other",className:`w-full bg-input-bg border border-divider-strong rounded-lg px-3 py-2 pr-16 text-xs font-mono focus:ring-1 focus:ring-blue-500 focus:border-blue-500 ${U?"cursor-not-allowed text-content-muted":"text-content-body"}`}),!U&&a.jsx("button",{onClick:()=>l({...o,[k.id]:!o[k.id]}),className:"absolute right-8 top-1/2 -translate-y-1/2 text-content-muted hover:text-content-body",children:a.jsx("span",{className:"material-symbols-outlined text-[16px]",children:o[k.id]?"visibility_off":"visibility"})})]})]}),!U&&a.jsxs("div",{className:"flex flex-col gap-2",children:[C&&!C.startsWith("$")&&a.jsxs("button",{onClick:()=>x(k.id),className:"flex items-center justify-center gap-1.5 px-3 py-1.5 bg-blue-500/10 hover:bg-blue-500/20 border border-blue-500/30 rounded-lg text-xs text-blue-400 transition-colors w-full",children:[a.jsx("span",{className:"material-symbols-outlined text-[14px]",children:"view_list"}),"View Models"]}),C&&!C.startsWith("$")&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("button",{onClick:()=>F(k.id),disabled:p===k.id,className:"flex items-center gap-1.5 px-3 py-1.5 bg-surface-emphasis hover:bg-divider-strong border border-divider-strong rounded-lg text-xs text-content-body transition-colors disabled:opacity-50",children:[p===k.id?a.jsx(Re,{className:"w-3 h-3 animate-spin"}):a.jsx("span",{className:"material-symbols-outlined text-[14px]",children:"quiz"}),"Test 2+3"]}),m[k.id]&&a.jsxs("div",{className:`flex items-center gap-1 text-xs ${(H=m[k.id])!=null&&H.success?"text-green-400":"text-red-400"}`,children:[a.jsx("span",{className:"material-symbols-outlined text-[14px]",children:(V=m[k.id])!=null&&V.success?"check_circle":"error"}),(X=m[k.id])!=null&&X.success?`${(z=m[k.id])==null?void 0:z.latencyMs}ms`:(te=m[k.id])==null?void 0:te.error]})]})]})]})]},k.id)})})]}),a.jsxs("section",{className:"mb-12",children:[a.jsxs("h2",{className:"text-content text-2xl font-bold mb-6 flex items-center gap-3",children:["Tracker API Keys",a.jsx("div",{className:"h-px flex-1 bg-divider-strong"})]}),a.jsxs("p",{className:"text-content-muted text-sm mb-6",children:["Configure API keys for your issue trackers. These override environment variables (",vb.map(k=>k.envVar).join(", "),")."]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:vb.map(k=>{var T;const U=((T=i.tracker_keys)==null?void 0:T[k.id])||"";return a.jsxs("div",{className:"bg-surface-raised border border-divider rounded-xl p-5 relative transition-colors shadow-sm hover:border-divider-strong",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[a.jsx("div",{className:"size-10 rounded-lg bg-surface-emphasis border border-divider flex items-center justify-center",children:a.jsx("span",{className:"material-symbols-outlined text-content-subtle",children:k.icon})}),a.jsxs("div",{children:[a.jsx("span",{className:"font-bold text-content",children:k.name}),a.jsx("p",{className:"text-[10px] text-content-muted font-mono",children:k.envVar})]})]}),a.jsx("div",{className:"space-y-3",children:a.jsxs("div",{className:"relative",children:[a.jsx("label",{className:"text-[10px] uppercase font-bold text-content-muted mb-1 block",children:"API Key / Token"}),U.startsWith("$")?a.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/30 rounded-lg px-3 py-2",children:[a.jsxs("div",{className:"flex items-center gap-2 text-amber-400 text-xs",children:[a.jsx("span",{className:"material-symbols-outlined text-[14px]",children:"info"}),a.jsxs("span",{children:["Configured via ",a.jsx("code",{className:"font-mono bg-surface-overlay px-1 rounded",children:U})]})]}),a.jsx("input",{type:"text",placeholder:k.placeholder,onChange:C=>j(k.id,C.target.value),autoComplete:"off",className:"w-full bg-input-bg border border-divider-strong rounded-lg px-3 py-2 text-xs font-mono mt-2 focus:ring-1 focus:ring-blue-500 focus:border-blue-500 text-content-body"})]}):a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:c[k.id]?"text":"password",value:U,onChange:C=>j(k.id,C.target.value),placeholder:k.placeholder,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-lpignore":"true","data-1p-ignore":"true","data-form-type":"other",className:"w-full bg-input-bg border border-divider-strong rounded-lg px-3 py-2 pr-10 text-xs font-mono focus:ring-1 focus:ring-blue-500 focus:border-blue-500 text-content-body"}),a.jsx("button",{onClick:()=>u({...c,[k.id]:!c[k.id]}),className:"absolute right-2 top-1/2 -translate-y-1/2 text-content-muted hover:text-content-body",children:a.jsx("span",{className:"material-symbols-outlined text-[16px]",children:c[k.id]?"visibility_off":"visibility"})})]})]})})]},k.id)})})]}),a.jsxs("section",{className:"mb-12",children:[a.jsxs("h2",{className:"text-content text-2xl font-bold mb-6 flex items-center gap-3",children:["Model Assignments",a.jsx("div",{className:"h-px flex-1 bg-divider-strong"})]}),a.jsx("div",{className:"space-y-8",children:vz.map(k=>a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx("span",{className:"material-symbols-outlined text-content-muted text-lg",children:k.icon}),a.jsx("h3",{className:"text-content-body font-semibold text-sm uppercase tracking-wider",children:k.name}),a.jsx("div",{className:"h-px flex-1 bg-divider"})]}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3",children:k.agents.map(U=>{const T=i.models.overrides[U.id]||xb,C=xz(T),{score:H,matched:V,missing:X}=dz(T,U.id),z=xx[U.id]||[],te=H>=1,ae=H>=.5&&H<1,be=[`${U.name}: ${U.description}`,`Model: ${C}`,`Needs: ${z.map(Ee=>Ii[Ee].name).join(", ")}`,V.length>0?`✓ Has: ${V.map(Ee=>Ii[Ee].name).join(", ")}`:"",X.length>0?`✗ Missing: ${X.map(Ee=>Ii[Ee].name).join(", ")}`:""].filter(Boolean).join(`
553
+ `})]})}async function pz(){const e=await fetch("/api/settings");if(!e.ok)throw new Error("Failed to fetch settings");return e.json()}async function mz(e){const t=await fetch("/api/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.text();throw new Error(n||"Failed to save settings")}}async function gz(){const e=await fetch("/api/settings/optimal-defaults");if(!e.ok)throw new Error("Failed to fetch optimal defaults");return e.json()}async function gb(e,t,n){const r=await fetch("/api/settings/test-api-key",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,apiKey:t,model:n})});if(!r.ok)throw new Error("Failed to test API key");return r.json()}const zf=[{id:"anthropic",name:"Anthropic",icon:"deployed_code",placeholder:"sk-ant-..."},{id:"openai",name:"OpenAI",icon:"auto_awesome",placeholder:"sk-..."},{id:"google",name:"Google",icon:"cloud",placeholder:"AIza..."},{id:"kimi",name:"Kimi (Moonshot)",icon:"token",placeholder:"sk-kimi-..."},{id:"zai",name:"Zhipu (GLM)",icon:"hub",placeholder:"sk-zai-..."}],vb=[{id:"linear",name:"Linear",icon:"view_kanban",envVar:"LINEAR_API_KEY",placeholder:"lin_api_..."},{id:"github",name:"GitHub",icon:"code",envVar:"GITHUB_TOKEN",placeholder:"ghp_..."},{id:"gitlab",name:"GitLab",icon:"commit",envVar:"GITLAB_TOKEN",placeholder:"glpat-..."},{id:"rally",name:"Rally",icon:"flag",envVar:"RALLY_API_KEY",placeholder:"_abc123..."}],vz=[{name:"Issue Agent Phases",icon:"list_alt",agents:[{id:"issue-agent:exploration",name:"Exploration",icon:"search",description:"Codebase discovery"},{id:"issue-agent:planning",name:"Planning",icon:"event_note",description:"Implementation design"},{id:"issue-agent:implementation",name:"Implementation",icon:"code",description:"Write the code"},{id:"issue-agent:testing",name:"Testing",icon:"science",description:"Write & run tests"},{id:"issue-agent:documentation",name:"Documentation",icon:"description",description:"Update docs"},{id:"issue-agent:review-response",name:"Review Response",icon:"reply",description:"Address PR feedback"}]},{name:"Specialist Agents",icon:"psychology",agents:[{id:"specialist-review-agent",name:"Review Agent",icon:"rate_review",description:"Automated code reviews"},{id:"specialist-test-agent",name:"Test Agent",icon:"science",description:"Test generation"},{id:"specialist-merge-agent",name:"Merge Agent",icon:"call_merge",description:"Merge conflict resolution"}]},{name:"Convoy Reviewers",icon:"groups",agents:[{id:"convoy:security-reviewer",name:"Security",icon:"shield",description:"Security analysis"},{id:"convoy:performance-reviewer",name:"Performance",icon:"speed",description:"Performance review"},{id:"convoy:correctness-reviewer",name:"Correctness",icon:"check_circle",description:"Logic validation"},{id:"convoy:synthesis-agent",name:"Synthesis",icon:"merge",description:"Combine reviews"}]},{name:"Subagents",icon:"account_tree",agents:[{id:"subagent:explore",name:"Explore",icon:"explore",description:"Codebase exploration"},{id:"subagent:plan",name:"Plan",icon:"event_note",description:"Task breakdown"},{id:"subagent:bash",name:"Bash",icon:"terminal",description:"CLI commands"},{id:"subagent:general-purpose",name:"General",icon:"psychology",description:"General tasks"}]},{name:"Workflow Agents",icon:"route",agents:[{id:"prd-agent",name:"PRD Agent",icon:"article",description:"Product requirements"},{id:"decomposition-agent",name:"Decomposition",icon:"account_tree",description:"Break down epics"},{id:"triage-agent",name:"Triage",icon:"filter_list",description:"Prioritize issues"},{id:"planning-agent",name:"Planning",icon:"event",description:"Sprint planning & status reviews"}]},{name:"CLI Modes",icon:"terminal",agents:[{id:"cli:interactive",name:"Interactive",icon:"chat",description:"Conversation mode"},{id:"cli:quick-command",name:"Quick Command",icon:"bolt",description:"One-shot queries"}]}],xb="claude-sonnet-4-5";function xz(e){const t=o2(e);return t?t.name:e.includes("claude")?e.includes("opus")?"Opus 4.6":e.includes("haiku")?"Haiku":"Sonnet 4.5":e.includes("gpt")?"GPT-4o":e.includes("gemini")?e.includes("flash")?"Gemini Flash":"Gemini Pro":e.includes("kimi")?e.includes("k2.5")||e.includes("2.5")?"Kimi K2.5":"Kimi K2":e.includes("glm")?"GLM-4":e}function yz(){var L,K;const e=cn(),{data:t,isLoading:n,error:r}=fe({queryKey:["settings"],queryFn:pz}),[i,s]=y.useState(null),[o,l]=y.useState({}),[c,u]=y.useState({}),[d,h]=y.useState(null),[p,f]=y.useState(null),[m,g]=y.useState({}),[w,x]=y.useState(null),[_,v]=y.useState(null),[b,N]=y.useState({});y.useEffect(()=>{t&&!i&&s(t)},[t,i]);const S=Se({mutationFn:mz,onSuccess:()=>{e.invalidateQueries({queryKey:["settings"]}),e.invalidateQueries({queryKey:["tracker-status"]})}});if(n)return a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx(Re,{className:"w-8 h-8 text-blue-400 animate-spin"})});if(r||!i)return a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsxs("div",{className:"text-red-400",children:["Error: ",(r==null?void 0:r.message)||"Failed to load settings"]})});const E=JSON.stringify(i)!==JSON.stringify(t),D=k=>{k!=="anthropic"&&s({...i,models:{...i.models,providers:{...i.models.providers,[k]:!i.models.providers[k]}}})},B=(k,U)=>{k!=="anthropic"&&s({...i,api_keys:{...i.api_keys,[k]:U||void 0}})},j=(k,U)=>{s({...i,tracker_keys:{...i.tracker_keys,[k]:U||void 0}})},I=(k,U)=>{s({...i,models:{...i.models,overrides:{...i.models.overrides,[k]:U}}})},P=k=>{const{[k]:U,...T}=i.models.overrides;s({...i,models:{...i.models,overrides:T}})},R=()=>S.mutate(i),A=()=>s(t||null),O=async()=>{try{const k=await gz(),U={models:{providers:{...(i==null?void 0:i.models.providers)||k.models.providers},overrides:{...k.models.overrides},gemini_thinking_level:k.models.gemini_thinking_level},api_keys:{...(i==null?void 0:i.api_keys)||{}},tracker_keys:{...(i==null?void 0:i.tracker_keys)||{}}};s(U)}catch(k){console.error("Failed to fetch optimal defaults:",k),alert("Failed to load optimal defaults: "+k.message)}},F=async k=>{const U=i==null?void 0:i.api_keys[k];if(U){f(k),g({...m,[k]:null});try{const T=await gb(k,U);g({...m,[k]:T})}catch{g({...m,[k]:{success:!1,error:"Test failed",response:null,latencyMs:0}})}finally{f(null)}}},Y=async(k,U)=>{const T=i==null?void 0:i.api_keys[k];if(!T)return;const C=`${k}:${U}`;v(C),N({...b,[C]:null});try{const H=await gb(k,T,U);N({...b,[C]:H})}catch{N({...b,[C]:{success:!1,error:"Test failed",response:null,latencyMs:0}})}finally{v(null)}};return a.jsxs("div",{className:"max-w-[1200px] mx-auto px-6 md:px-10 py-8 pb-32",children:[a.jsx("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-4 mb-8",children:a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("span",{className:"material-symbols-outlined text-blue-400 text-2xl",children:"settings"}),a.jsx("h1",{className:"text-content text-4xl font-black tracking-tight",children:"Settings"})]}),a.jsx("p",{className:"text-content-muted text-base",children:"Configure AI model orchestration and agent permissions."})]})}),a.jsx("section",{className:"mb-10",children:a.jsx("div",{className:"bg-surface-raised border border-divider rounded-xl overflow-hidden",children:a.jsxs("div",{className:"flex flex-col lg:flex-row",children:[a.jsxs("div",{className:"lg:w-2/5 bg-surface p-8 flex flex-col justify-center items-center border-b lg:border-b-0 lg:border-r border-divider relative overflow-hidden",children:[a.jsx("div",{className:"absolute inset-0 opacity-10 pointer-events-none bg-[radial-gradient(circle_at_50%_50%,#3b82f6_0%,transparent_70%)]"}),a.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-6 w-full max-w-xs",children:[a.jsxs("div",{className:"flex items-center justify-between w-full",children:[a.jsx("div",{className:"size-12 rounded-lg bg-surface-emphasis border border-divider-strong flex items-center justify-center shadow-sm",children:a.jsx("span",{className:"material-symbols-outlined text-content-subtle",children:"terminal"})}),a.jsx("div",{className:"flex-1 h-px bg-gradient-to-r from-divider-strong via-blue-500 to-divider-strong mx-2"}),a.jsx("div",{className:"size-12 rounded-lg bg-surface-emphasis border border-divider-strong flex items-center justify-center shadow-sm",children:a.jsx("span",{className:"material-symbols-outlined text-blue-400",children:"account_tree"})}),a.jsx("div",{className:"flex-1 h-px bg-gradient-to-r from-divider via-blue-500 to-divider mx-2"}),a.jsx("div",{className:"size-12 rounded-lg bg-blue-500 flex items-center justify-center shadow-[0_0_20px_rgba(59,130,246,0.4)]",children:a.jsx("span",{className:"material-symbols-outlined text-content",children:"bolt"})})]}),a.jsxs("div",{className:"flex justify-between w-full px-2 text-[10px] uppercase tracking-widest font-bold text-content-muted",children:[a.jsx("span",{children:"Task"}),a.jsx("span",{children:"Capability"}),a.jsx("span",{children:"Model"})]})]})]}),a.jsxs("div",{className:"lg:w-3/5 p-8",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx("span",{className:"px-2 py-0.5 bg-blue-500/10 text-blue-400 text-[10px] font-bold uppercase tracking-wider rounded border border-blue-500/20",children:"Active"}),a.jsx("h3",{className:"text-content text-xl font-bold",children:"Smart Model Selection"})]}),a.jsx("p",{className:"text-content-muted mb-6 leading-relaxed",children:"Panopticon automatically routes tasks to the optimal model based on capabilities, token budget, and latency requirements."}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("span",{className:"material-symbols-outlined text-blue-400 text-sm mt-1",children:"check_circle"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-semibold text-content",children:"Capability Matching"}),a.jsx("p",{className:"text-xs text-content-muted",children:"Best model for each task type"})]})]}),a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("span",{className:"material-symbols-outlined text-blue-400 text-sm mt-1",children:"check_circle"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-semibold text-content",children:"Cost Optimization"}),a.jsx("p",{className:"text-xs text-content-muted",children:"Balance performance vs spend"})]})]})]})]})]})})}),a.jsxs("section",{className:"mb-12",children:[a.jsxs("h2",{className:"text-content text-2xl font-bold mb-6 flex items-center gap-3",children:["Provider Configuration",a.jsx("div",{className:"h-px flex-1 bg-divider-strong"})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:zf.map(k=>{var H,V,X,z,te;const U=k.id==="anthropic",T=U||i.models.providers[k.id],C=i.api_keys[k.id]||"";return a.jsxs("div",{className:`bg-surface-raised border rounded-xl p-5 relative transition-colors shadow-sm ${U?"border-blue-500/50 shadow-lg shadow-blue-500/5":"border-divider hover:border-divider-strong"}`,children:[U&&a.jsx("div",{className:"absolute -top-3 right-4",children:a.jsx("span",{className:"bg-blue-500 text-content text-[10px] font-black px-2 py-0.5 rounded uppercase tracking-tighter",children:"Default"})}),a.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[a.jsx("div",{className:"size-10 rounded-lg bg-surface-emphasis border border-divider flex items-center justify-center",children:a.jsx("span",{className:"material-symbols-outlined text-content-subtle",children:k.icon})}),a.jsx("span",{className:"font-bold text-content",children:k.name}),a.jsx("div",{className:"ml-auto",children:a.jsx("button",{onClick:()=>D(k.id),disabled:U,className:`w-10 h-5 rounded-full relative transition-colors ${T?"bg-blue-500":"bg-surface-emphasis"} ${U?"cursor-not-allowed":"cursor-pointer"}`,children:a.jsx("div",{className:`absolute top-0.5 size-4 bg-white rounded-full transition-all ${T?"right-0.5":"left-0.5"}`})})})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"relative",children:[a.jsx("label",{className:"text-[10px] uppercase font-bold text-content-muted mb-1 block",children:"API Key"}),C.startsWith("$")?a.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/30 rounded-lg px-3 py-2",children:[a.jsxs("div",{className:"flex items-center gap-2 text-amber-400 text-xs",children:[a.jsx("span",{className:"material-symbols-outlined text-[14px]",children:"info"}),a.jsxs("span",{children:["Configured via ",a.jsx("code",{className:"font-mono bg-surface-overlay px-1 rounded",children:C})]})]}),a.jsx("p",{className:"text-[10px] text-amber-400/70 mt-1",children:"Set this environment variable or enter the key directly below"}),a.jsx("input",{type:"text",placeholder:k.placeholder,onChange:ae=>B(k.id,ae.target.value),autoComplete:"off",className:"w-full bg-input-bg border border-divider-strong rounded-lg px-3 py-2 text-xs font-mono mt-2 focus:ring-1 focus:ring-blue-500 focus:border-blue-500 text-content-body"})]}):a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:o[k.id]?"text":"password",value:C,onChange:ae=>B(k.id,ae.target.value),disabled:U,placeholder:k.placeholder,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-lpignore":"true","data-1p-ignore":"true","data-form-type":"other",className:`w-full bg-input-bg border border-divider-strong rounded-lg px-3 py-2 pr-16 text-xs font-mono focus:ring-1 focus:ring-blue-500 focus:border-blue-500 ${U?"cursor-not-allowed text-content-muted":"text-content-body"}`}),!U&&a.jsx("button",{onClick:()=>l({...o,[k.id]:!o[k.id]}),className:"absolute right-8 top-1/2 -translate-y-1/2 text-content-muted hover:text-content-body",children:a.jsx("span",{className:"material-symbols-outlined text-[16px]",children:o[k.id]?"visibility_off":"visibility"})})]})]}),!U&&a.jsxs("div",{className:"flex flex-col gap-2",children:[C&&!C.startsWith("$")&&a.jsxs("button",{onClick:()=>x(k.id),className:"flex items-center justify-center gap-1.5 px-3 py-1.5 bg-blue-500/10 hover:bg-blue-500/20 border border-blue-500/30 rounded-lg text-xs text-blue-400 transition-colors w-full",children:[a.jsx("span",{className:"material-symbols-outlined text-[14px]",children:"view_list"}),"View Models"]}),C&&!C.startsWith("$")&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("button",{onClick:()=>F(k.id),disabled:p===k.id,className:"flex items-center gap-1.5 px-3 py-1.5 bg-surface-emphasis hover:bg-divider-strong border border-divider-strong rounded-lg text-xs text-content-body transition-colors disabled:opacity-50",children:[p===k.id?a.jsx(Re,{className:"w-3 h-3 animate-spin"}):a.jsx("span",{className:"material-symbols-outlined text-[14px]",children:"quiz"}),"Test 2+3"]}),m[k.id]&&a.jsxs("div",{className:`flex items-center gap-1 text-xs ${(H=m[k.id])!=null&&H.success?"text-green-400":"text-red-400"}`,children:[a.jsx("span",{className:"material-symbols-outlined text-[14px]",children:(V=m[k.id])!=null&&V.success?"check_circle":"error"}),(X=m[k.id])!=null&&X.success?`${(z=m[k.id])==null?void 0:z.latencyMs}ms`:(te=m[k.id])==null?void 0:te.error]})]})]})]})]},k.id)})})]}),a.jsxs("section",{className:"mb-12",children:[a.jsxs("h2",{className:"text-content text-2xl font-bold mb-6 flex items-center gap-3",children:["Tracker API Keys",a.jsx("div",{className:"h-px flex-1 bg-divider-strong"})]}),a.jsxs("p",{className:"text-content-muted text-sm mb-6",children:["Configure API keys for your issue trackers. These override environment variables (",vb.map(k=>k.envVar).join(", "),")."]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:vb.map(k=>{var T;const U=((T=i.tracker_keys)==null?void 0:T[k.id])||"";return a.jsxs("div",{className:"bg-surface-raised border border-divider rounded-xl p-5 relative transition-colors shadow-sm hover:border-divider-strong",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[a.jsx("div",{className:"size-10 rounded-lg bg-surface-emphasis border border-divider flex items-center justify-center",children:a.jsx("span",{className:"material-symbols-outlined text-content-subtle",children:k.icon})}),a.jsxs("div",{children:[a.jsx("span",{className:"font-bold text-content",children:k.name}),a.jsx("p",{className:"text-[10px] text-content-muted font-mono",children:k.envVar})]})]}),a.jsx("div",{className:"space-y-3",children:a.jsxs("div",{className:"relative",children:[a.jsx("label",{className:"text-[10px] uppercase font-bold text-content-muted mb-1 block",children:"API Key / Token"}),U.startsWith("$")?a.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/30 rounded-lg px-3 py-2",children:[a.jsxs("div",{className:"flex items-center gap-2 text-amber-400 text-xs",children:[a.jsx("span",{className:"material-symbols-outlined text-[14px]",children:"info"}),a.jsxs("span",{children:["Configured via ",a.jsx("code",{className:"font-mono bg-surface-overlay px-1 rounded",children:U})]})]}),a.jsx("input",{type:"text",placeholder:k.placeholder,onChange:C=>j(k.id,C.target.value),autoComplete:"off",className:"w-full bg-input-bg border border-divider-strong rounded-lg px-3 py-2 text-xs font-mono mt-2 focus:ring-1 focus:ring-blue-500 focus:border-blue-500 text-content-body"})]}):a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:c[k.id]?"text":"password",value:U,onChange:C=>j(k.id,C.target.value),placeholder:k.placeholder,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-lpignore":"true","data-1p-ignore":"true","data-form-type":"other",className:"w-full bg-input-bg border border-divider-strong rounded-lg px-3 py-2 pr-10 text-xs font-mono focus:ring-1 focus:ring-blue-500 focus:border-blue-500 text-content-body"}),a.jsx("button",{onClick:()=>u({...c,[k.id]:!c[k.id]}),className:"absolute right-2 top-1/2 -translate-y-1/2 text-content-muted hover:text-content-body",children:a.jsx("span",{className:"material-symbols-outlined text-[16px]",children:c[k.id]?"visibility_off":"visibility"})})]})]})})]},k.id)})})]}),a.jsxs("section",{className:"mb-12",children:[a.jsxs("h2",{className:"text-content text-2xl font-bold mb-6 flex items-center gap-3",children:["Model Assignments",a.jsx("div",{className:"h-px flex-1 bg-divider-strong"})]}),a.jsx("div",{className:"space-y-8",children:vz.map(k=>a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx("span",{className:"material-symbols-outlined text-content-muted text-lg",children:k.icon}),a.jsx("h3",{className:"text-content-body font-semibold text-sm uppercase tracking-wider",children:k.name}),a.jsx("div",{className:"h-px flex-1 bg-divider"})]}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3",children:k.agents.map(U=>{const T=i.models.overrides[U.id]||xb,C=xz(T),{score:H,matched:V,missing:X}=dz(T,U.id),z=xx[U.id]||[],te=H>=1,ae=H>=.5&&H<1,be=[`${U.name}: ${U.description}`,`Model: ${C}`,`Needs: ${z.map(Ee=>Ii[Ee].name).join(", ")}`,V.length>0?`✓ Has: ${V.map(Ee=>Ii[Ee].name).join(", ")}`:"",X.length>0?`✗ Missing: ${X.map(Ee=>Ii[Ee].name).join(", ")}`:""].filter(Boolean).join(`
554
554
  `);return a.jsxs("div",{onClick:()=>h(U.id),title:be,className:`p-3 border rounded-lg cursor-pointer transition-all group ${te?"bg-emerald-500/5 border-emerald-500/30 hover:border-emerald-500/50 hover:bg-emerald-500/10":ae?"bg-amber-500/5 border-amber-500/30 hover:border-amber-500/50 hover:bg-amber-500/10":"bg-rose-500/5 border-rose-500/30 hover:border-rose-500/50 hover:bg-rose-500/10"}`,children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("span",{className:`material-symbols-outlined text-sm ${te?"text-emerald-400":ae?"text-amber-400":"text-rose-400"}`,children:U.icon}),a.jsxs("span",{className:`text-[9px] font-bold ${te?"text-emerald-400":ae?"text-amber-400":"text-rose-400"}`,children:[Math.round(H*100),"%"]})]}),a.jsx("p",{className:"text-xs font-semibold text-content truncate",children:U.name}),a.jsx("p",{className:"text-[10px] text-content-muted truncate mb-2",children:C}),a.jsx("div",{className:"flex gap-1 flex-wrap",children:z.slice(0,3).map(Ee=>{const Fe=V.includes(Ee);return a.jsx("span",{title:`${Ii[Ee].name}: ${Fe?"Model has this":"Model missing this"}`,className:`text-[8px] px-1 py-0.5 rounded ${Fe?"bg-emerald-500/20 text-emerald-400":"bg-rose-500/20 text-rose-400"}`,children:Ii[Ee].name},Ee)})})]},U.id)})})]},k.name))})]}),a.jsx("footer",{className:"fixed bottom-0 left-0 right-0 bg-surface backdrop-blur-md border-t border-divider-strong shadow-[0_-2px_10px_rgba(0,0,0,0.05)] px-6 py-4 z-40",children:a.jsxs("div",{className:"max-w-[1200px] mx-auto flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2 text-content-muted text-sm",children:[S.isSuccess&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"material-symbols-outlined text-green-400",children:"check_circle"}),a.jsx("span",{className:"text-green-400",children:"Settings saved!"})]}),S.isError&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"material-symbols-outlined text-red-400",children:"error"}),a.jsx("span",{className:"text-red-400",children:"Error saving settings"})]})]}),a.jsxs("div",{className:"flex gap-4",children:[a.jsxs("button",{onClick:O,className:"px-6 py-2 text-amber-400 hover:text-amber-300 font-semibold text-sm transition-colors flex items-center gap-1.5",title:"Set all model assignments to research-based optimal defaults",children:[a.jsx("span",{className:"material-symbols-outlined text-[16px]",children:"auto_fix_high"}),"Optimal Defaults"]}),a.jsx("button",{onClick:A,disabled:!E,className:"px-6 py-2 text-content-muted hover:text-content font-semibold text-sm transition-colors disabled:opacity-50",children:"Undo Changes"}),a.jsxs("button",{onClick:R,disabled:!E||S.isPending,className:"px-8 py-2 bg-blue-500 hover:bg-blue-400 text-content font-black rounded-lg transition-all shadow-lg shadow-blue-500/20 text-sm disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",children:[S.isPending&&a.jsx(Re,{className:"w-4 h-4 animate-spin"}),"Save Changes"]})]})]})}),d&&a.jsx(fz,{workType:d,currentModel:i.models.overrides[d]||xb,isOverride:!!i.models.overrides[d],enabledProviders:Object.entries(i.models.providers).filter(([k,U])=>U).map(([k])=>k),onApply:k=>I(d,k),onRemove:()=>P(d),onClose:()=>h(null)}),w&&a.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-50 flex items-center justify-center p-4",children:a.jsxs("div",{className:"bg-surface-raised border border-divider-strong rounded-xl shadow-2xl max-w-2xl w-full max-h-[80vh] overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-divider",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"material-symbols-outlined text-blue-400",children:(L=zf.find(k=>k.id===w))==null?void 0:L.icon}),a.jsxs("h3",{className:"text-content text-lg font-bold",children:[(K=zf.find(k=>k.id===w))==null?void 0:K.name," Models"]})]}),a.jsx("button",{onClick:()=>x(null),className:"text-content-muted hover:text-content transition-colors",children:a.jsx(St,{className:"w-5 h-5"})})]}),a.jsx("div",{className:"p-4 overflow-y-auto max-h-[60vh]",children:(()=>{var T;const k=(i==null?void 0:i.api_keys[w])||"",U=k.startsWith("$");return k?U?a.jsxs("div",{className:"text-center py-8",children:[a.jsx("span",{className:"material-symbols-outlined text-4xl text-amber-500 mb-2",children:"warning"}),a.jsx("p",{className:"text-amber-400",children:"API key configured via environment variable"}),a.jsxs("p",{className:"text-content-muted text-sm mt-1",children:[a.jsx("code",{className:"font-mono bg-surface-overlay px-1 rounded",children:k})," is not set"]}),a.jsx("p",{className:"text-content-muted text-xs mt-2",children:"Set the environment variable or enter the key directly in Settings"})]}):a.jsx("div",{className:"space-y-3",children:(((T=vx[w])==null?void 0:T.models)||[]).map(C=>{var z;const H=`${w}:${C.id}`,V=b[H],X=_===H;return a.jsx("div",{className:"bg-surface border border-divider rounded-lg p-4 hover:border-divider-strong transition-colors",children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("span",{className:"material-symbols-outlined text-content-muted text-sm",children:C.icon}),a.jsx("h4",{className:"text-content font-semibold",children:C.name}),C.tier&&a.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${C.tier==="premium"?"bg-purple-500/20 text-purple-400":C.tier==="balanced"?"bg-blue-500/20 text-blue-400":"bg-emerald-500/20 text-emerald-400"}`,children:C.tier})]}),C.description&&a.jsx("p",{className:"text-xs text-content-muted mb-2",children:C.description}),a.jsx("div",{className:"flex flex-wrap gap-1",children:C.capabilities.map(te=>a.jsx("span",{className:"text-[9px] px-1.5 py-0.5 bg-surface-emphasis text-content-subtle rounded border border-divider",children:te},te))})]}),a.jsxs("div",{className:"flex flex-col items-end gap-2",children:[a.jsxs("button",{onClick:()=>Y(w,C.id),disabled:X,className:"flex items-center gap-1.5 px-3 py-1.5 bg-emerald-500/10 hover:bg-emerald-500/20 border border-emerald-500/30 rounded-lg text-xs text-emerald-400 transition-colors disabled:opacity-50 whitespace-nowrap",children:[X?a.jsx(Re,{className:"w-3 h-3 animate-spin"}):a.jsx("span",{className:"material-symbols-outlined text-[14px]",children:"play_arrow"}),"Test 2+3"]}),V&&a.jsxs("div",{className:`flex items-center gap-1 text-xs ${V.success?"text-green-400":"text-red-400"}`,children:[a.jsx("span",{className:"material-symbols-outlined text-[12px]",children:V.success?"check_circle":"error"}),V.success?`${V.latencyMs}ms`:((z=V.error)==null?void 0:z.slice(0,30))||"Failed"]})]})]})},C.id)})}):a.jsxs("div",{className:"text-center py-8",children:[a.jsx("span",{className:"material-symbols-outlined text-4xl text-content-muted mb-2",children:"key_off"}),a.jsx("p",{className:"text-content-muted",children:"Enter an API key to test models"})]})})()}),a.jsx("div",{className:"p-4 border-t border-divider bg-surface",children:a.jsx("p",{className:"text-xs text-content-muted text-center",children:'Test verifies API key and model availability by asking "What is 2+3?"'})})]})})]})}var yb=1,_z=.9,bz=.8,wz=.17,Ff=.1,$f=.999,Sz=.9999,kz=.99,Cz=/[\\\/_+.#"@\[\(\{&]/,Nz=/[\\\/_+.#"@\[\(\{&]/g,Ez=/[\s-]/,a2=/[\s-]/g;function mg(e,t,n,r,i,s,o){if(s===t.length)return i===e.length?yb:kz;var l=`${i},${s}`;if(o[l]!==void 0)return o[l];for(var c=r.charAt(s),u=n.indexOf(c,i),d=0,h,p,f,m;u>=0;)h=mg(e,t,n,r,u+1,s+1,o),h>d&&(u===i?h*=yb:Cz.test(e.charAt(u-1))?(h*=bz,f=e.slice(i,u-1).match(Nz),f&&i>0&&(h*=Math.pow($f,f.length))):Ez.test(e.charAt(u-1))?(h*=_z,m=e.slice(i,u-1).match(a2),m&&i>0&&(h*=Math.pow($f,m.length))):(h*=wz,i>0&&(h*=Math.pow($f,u-i))),e.charAt(u)!==t.charAt(s)&&(h*=Sz)),(h<Ff&&n.charAt(u-1)===r.charAt(s+1)||r.charAt(s+1)===r.charAt(s)&&n.charAt(u-1)!==r.charAt(s))&&(p=mg(e,t,n,r,u+1,s+2,o),p*Ff>h&&(h=p*Ff)),h>d&&(d=h),u=n.indexOf(c,u+1);return o[l]=d,d}function _b(e){return e.toLowerCase().replace(a2," ")}function jz(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,mg(e,t,_b(e),_b(t),0,0,{})}function ls(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function bb(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fs(...e){return t=>{let n=!1;const r=e.map(i=>{const s=bb(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():bb(e[i],null)}}}}function mo(...e){return y.useCallback(fs(...e),e)}function Rz(e,t){const n=y.createContext(t),r=s=>{const{children:o,...l}=s,c=y.useMemo(()=>l,Object.values(l));return a.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function i(s){const o=y.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,i]}function Pz(e,t=[]){let n=[];function r(s,o){const l=y.createContext(o),c=n.length;n=[...n,o];const u=h=>{var x;const{scope:p,children:f,...m}=h,g=((x=p==null?void 0:p[e])==null?void 0:x[c])||l,w=y.useMemo(()=>m,Object.values(m));return a.jsx(g.Provider,{value:w,children:f})};u.displayName=s+"Provider";function d(h,p){var g;const f=((g=p==null?void 0:p[e])==null?void 0:g[c])||l,m=y.useContext(f);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${s}\``)}return[u,d]}const i=()=>{const s=n.map(o=>y.createContext(o));return function(l){const c=(l==null?void 0:l[e])||s;return y.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return i.scopeName=e,[r,Tz(i,...t)]}function Tz(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((l,{useScope:c,scopeName:u})=>{const h=c(s)[`__scope${u}`];return{...l,...h}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var ic=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},Dz=Tg[" useId ".trim().toString()]||(()=>{}),Mz=0;function ai(e){const[t,n]=y.useState(Dz());return ic(()=>{n(r=>r??String(Mz++))},[e]),t?`radix-${t}`:""}var Az=Tg[" useInsertionEffect ".trim().toString()]||ic;function Lz({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,s,o]=Oz({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:i;{const d=y.useRef(e!==void 0);y.useEffect(()=>{const h=d.current;h!==l&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=l},[l,r])}const u=y.useCallback(d=>{var h;if(l){const p=Iz(d)?d(e):d;p!==e&&((h=o.current)==null||h.call(o,p))}else s(d)},[l,e,s,o]);return[c,u]}function Oz({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),i=y.useRef(n),s=y.useRef(t);return Az(()=>{s.current=t},[t]),y.useEffect(()=>{var o;i.current!==n&&((o=s.current)==null||o.call(s,n),i.current=n)},[n,i]),[n,r,s]}function Iz(e){return typeof e=="function"}function Rc(e){const t=Bz(e),n=y.forwardRef((r,i)=>{const{children:s,...o}=r,l=y.Children.toArray(s),c=l.find(Fz);if(c){const u=c.props.children,d=l.map(h=>h===c?y.Children.count(u)>1?y.Children.only(null):y.isValidElement(u)?u.props.children:null:h);return a.jsx(t,{...o,ref:i,children:y.isValidElement(u)?y.cloneElement(u,void 0,d):null})}return a.jsx(t,{...o,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}function Bz(e){const t=y.forwardRef((n,r)=>{const{children:i,...s}=n;if(y.isValidElement(i)){const o=Hz(i),l=$z(s,i.props);return i.type!==y.Fragment&&(l.ref=r?fs(r,o):o),y.cloneElement(i,l)}return y.Children.count(i)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zz=Symbol("radix.slottable");function Fz(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zz}function $z(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...l)=>{const c=s(...l);return i(...l),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function Hz(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Wz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],l2=Wz.reduce((e,t)=>{const n=Rc(`Primitive.${t}`),r=y.forwardRef((i,s)=>{const{asChild:o,...l}=i,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Uz(e,t){e&&er.flushSync(()=>e.dispatchEvent(t))}function sc(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function qz(e,t=globalThis==null?void 0:globalThis.document){const n=sc(e);y.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Kz="DismissableLayer",gg="dismissableLayer.update",Vz="dismissableLayer.pointerDownOutside",Yz="dismissableLayer.focusOutside",wb,c2=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),u2=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:l,...c}=e,u=y.useContext(c2),[d,h]=y.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=y.useState({}),m=mo(t,E=>h(E)),g=Array.from(u.layers),[w]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=g.indexOf(w),_=d?g.indexOf(d):-1,v=u.layersWithOutsidePointerEventsDisabled.size>0,b=_>=x,N=Gz(E=>{const D=E.target,B=[...u.branches].some(j=>j.contains(D));!b||B||(i==null||i(E),o==null||o(E),E.defaultPrevented||l==null||l())},p),S=Jz(E=>{const D=E.target;[...u.branches].some(j=>j.contains(D))||(s==null||s(E),o==null||o(E),E.defaultPrevented||l==null||l())},p);return qz(E=>{_===u.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&l&&(E.preventDefault(),l()))},p),y.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(wb=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Sb(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=wb)}},[d,p,n,u]),y.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Sb())},[d,u]),y.useEffect(()=>{const E=()=>f({});return document.addEventListener(gg,E),()=>document.removeEventListener(gg,E)},[]),a.jsx(l2.div,{...c,ref:m,style:{pointerEvents:v?b?"auto":"none":void 0,...e.style},onFocusCapture:ls(e.onFocusCapture,S.onFocusCapture),onBlurCapture:ls(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:ls(e.onPointerDownCapture,N.onPointerDownCapture)})});u2.displayName=Kz;var Qz="DismissableLayerBranch",Xz=y.forwardRef((e,t)=>{const n=y.useContext(c2),r=y.useRef(null),i=mo(t,r);return y.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),a.jsx(l2.div,{...e,ref:i})});Xz.displayName=Qz;function Gz(e,t=globalThis==null?void 0:globalThis.document){const n=sc(e),r=y.useRef(!1),i=y.useRef(()=>{});return y.useEffect(()=>{const s=l=>{if(l.target&&!r.current){let c=function(){h2(Vz,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Jz(e,t=globalThis==null?void 0:globalThis.document){const n=sc(e),r=y.useRef(!1);return y.useEffect(()=>{const i=s=>{s.target&&!r.current&&h2(Yz,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Sb(){const e=new CustomEvent(gg);document.dispatchEvent(e)}function h2(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Uz(i,s):i.dispatchEvent(s)}var Zz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],eF=Zz.reduce((e,t)=>{const n=Rc(`Primitive.${t}`),r=y.forwardRef((i,s)=>{const{asChild:o,...l}=i,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Hf="focusScope.autoFocusOnMount",Wf="focusScope.autoFocusOnUnmount",kb={bubbles:!1,cancelable:!0},tF="FocusScope",d2=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=e,[l,c]=y.useState(null),u=sc(i),d=sc(s),h=y.useRef(null),p=mo(t,g=>c(g)),f=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let g=function(v){if(f.paused||!l)return;const b=v.target;l.contains(b)?h.current=b:Pi(h.current,{select:!0})},w=function(v){if(f.paused||!l)return;const b=v.relatedTarget;b!==null&&(l.contains(b)||Pi(h.current,{select:!0}))},x=function(v){if(document.activeElement===document.body)for(const N of v)N.removedNodes.length>0&&Pi(l)};document.addEventListener("focusin",g),document.addEventListener("focusout",w);const _=new MutationObserver(x);return l&&_.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",w),_.disconnect()}}},[r,l,f.paused]),y.useEffect(()=>{if(l){Nb.add(f);const g=document.activeElement;if(!l.contains(g)){const x=new CustomEvent(Hf,kb);l.addEventListener(Hf,u),l.dispatchEvent(x),x.defaultPrevented||(nF(aF(f2(l)),{select:!0}),document.activeElement===g&&Pi(l))}return()=>{l.removeEventListener(Hf,u),setTimeout(()=>{const x=new CustomEvent(Wf,kb);l.addEventListener(Wf,d),l.dispatchEvent(x),x.defaultPrevented||Pi(g??document.body,{select:!0}),l.removeEventListener(Wf,d),Nb.remove(f)},0)}}},[l,u,d,f]);const m=y.useCallback(g=>{if(!n&&!r||f.paused)return;const w=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,x=document.activeElement;if(w&&x){const _=g.currentTarget,[v,b]=rF(_);v&&b?!g.shiftKey&&x===b?(g.preventDefault(),n&&Pi(v,{select:!0})):g.shiftKey&&x===v&&(g.preventDefault(),n&&Pi(b,{select:!0})):x===_&&g.preventDefault()}},[n,r,f.paused]);return a.jsx(eF.div,{tabIndex:-1,...o,ref:p,onKeyDown:m})});d2.displayName=tF;function nF(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Pi(r,{select:t}),document.activeElement!==n)return}function rF(e){const t=f2(e),n=Cb(t,e),r=Cb(t.reverse(),e);return[n,r]}function f2(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Cb(e,t){for(const n of e)if(!iF(n,{upTo:t}))return n}function iF(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function sF(e){return e instanceof HTMLInputElement&&"select"in e}function Pi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&sF(e)&&t&&e.select()}}var Nb=oF();function oF(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Eb(e,t),e.unshift(t)},remove(t){var n;e=Eb(e,t),(n=e[0])==null||n.resume()}}}function Eb(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function aF(e){return e.filter(t=>t.tagName!=="A")}var lF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],cF=lF.reduce((e,t)=>{const n=Rc(`Primitive.${t}`),r=y.forwardRef((i,s)=>{const{asChild:o,...l}=i,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),uF="Portal",p2=y.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[i,s]=y.useState(!1);ic(()=>s(!0),[]);const o=n||i&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?c4.createPortal(a.jsx(cF.div,{...r,ref:t}),o):null});p2.displayName=uF;function hF(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var Sd=e=>{const{present:t,children:n}=e,r=dF(t),i=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),s=mo(r.ref,fF(i));return typeof n=="function"||r.isPresent?y.cloneElement(i,{ref:s}):null};Sd.displayName="Presence";function dF(e){const[t,n]=y.useState(),r=y.useRef(null),i=y.useRef(e),s=y.useRef("none"),o=e?"mounted":"unmounted",[l,c]=hF(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const u=fu(r.current);s.current=l==="mounted"?u:"none"},[l]),ic(()=>{const u=r.current,d=i.current;if(d!==e){const p=s.current,f=fu(u);e?c("MOUNT"):f==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&p!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),ic(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,h=f=>{const g=fu(r.current).includes(CSS.escape(f.animationName));if(f.target===t&&g&&(c("ANIMATION_END"),!i.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},p=f=>{f.target===t&&(s.current=fu(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:y.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function fu(e){return(e==null?void 0:e.animationName)||"none"}function fF(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var pF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pc=pF.reduce((e,t)=>{const n=Rc(`Primitive.${t}`),r=y.forwardRef((i,s)=>{const{asChild:o,...l}=i,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Uf=0;function mF(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??jb()),document.body.insertAdjacentElement("beforeend",e[1]??jb()),Uf++,()=>{Uf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Uf--}},[])}function jb(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Lr=function(){return Lr=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Lr.apply(this,arguments)};function m2(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function gF(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Uu="right-scroll-bar-position",qu="width-before-scroll-bar",vF="with-scroll-bars-hidden",xF="--removed-body-scroll-bar-size";function qf(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function yF(e,t){var n=y.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var _F=typeof window<"u"?y.useLayoutEffect:y.useEffect,Rb=new WeakMap;function bF(e,t){var n=yF(null,function(r){return e.forEach(function(i){return qf(i,r)})});return _F(function(){var r=Rb.get(n);if(r){var i=new Set(r),s=new Set(e),o=n.current;i.forEach(function(l){s.has(l)||qf(l,null)}),s.forEach(function(l){i.has(l)||qf(l,o)})}Rb.set(n,e)},[e]),n}function wF(e){return e}function SF(e,t){t===void 0&&(t=wF);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var o=t(s,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(s){for(r=!0;n.length;){var o=n;n=[],o.forEach(s)}n={push:function(l){return s(l)},filter:function(){return n}}},assignMedium:function(s){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(s),o=n}var c=function(){var d=o;o=[],d.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){o.push(d),u()},filter:function(d){return o=o.filter(d),n}}}};return i}function kF(e){e===void 0&&(e={});var t=SF(null);return t.options=Lr({async:!0,ssr:!1},e),t}var g2=function(e){var t=e.sideCar,n=m2(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return y.createElement(r,Lr({},n))};g2.isSideCarExport=!0;function CF(e,t){return e.useMedium(t),g2}var v2=kF(),Kf=function(){},kd=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:Kf,onWheelCapture:Kf,onTouchMoveCapture:Kf}),i=r[0],s=r[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,p=e.sideCar,f=e.noRelative,m=e.noIsolation,g=e.inert,w=e.allowPinchZoom,x=e.as,_=x===void 0?"div":x,v=e.gapMode,b=m2(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=p,S=bF([n,t]),E=Lr(Lr({},b),i);return y.createElement(y.Fragment,null,d&&y.createElement(N,{sideCar:v2,removeScrollBar:u,shards:h,noRelative:f,noIsolation:m,inert:g,setCallbacks:s,allowPinchZoom:!!w,lockRef:n,gapMode:v}),o?y.cloneElement(y.Children.only(l),Lr(Lr({},E),{ref:S})):y.createElement(_,Lr({},E,{className:c,ref:S}),l))});kd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};kd.classNames={fullWidth:qu,zeroRight:Uu};var NF=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function EF(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=NF();return t&&e.setAttribute("nonce",t),e}function jF(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function RF(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var PF=function(){var e=0,t=null;return{add:function(n){e==0&&(t=EF())&&(jF(t,n),RF(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},TF=function(){var e=PF();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},x2=function(){var e=TF(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},DF={left:0,top:0,right:0,gap:0},Vf=function(e){return parseInt(e||"",10)||0},MF=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Vf(n),Vf(r),Vf(i)]},AF=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return DF;var t=MF(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},LF=x2(),Xo="data-scroll-locked",OF=function(e,t,n,r){var i=e.left,s=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
555
555
  .`.concat(vF,` {
556
556
  overflow: hidden `).concat(r,`;
@@ -17,7 +17,7 @@
17
17
  }
18
18
  })();
19
19
  </script>
20
- <script type="module" crossorigin src="/assets/index-BnjdXycj.js"></script>
20
+ <script type="module" crossorigin src="/assets/index-GwTde56u.js"></script>
21
21
  <link rel="stylesheet" crossorigin href="/assets/index-iqMjcW09.css">
22
22
  </head>
23
23
  <body class="bg-surface text-content transition-colors duration-150">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "panopticon-cli",
3
- "version": "0.4.9",
3
+ "version": "0.4.10",
4
4
  "description": "Multi-agent orchestration for AI coding assistants (Claude Code, Codex, Cursor, Gemini CLI)",
5
5
  "keywords": [
6
6
  "ai-agents",