@runfusion/fusion 0.30.0 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/bin.js +438 -235
  2. package/dist/client/assets/{AgentDetailView-Cu4TgvBn.js → AgentDetailView-Dx7T1-gM.js} +3 -3
  3. package/dist/client/assets/AgentPermissionPolicyEditor-Cbd6SG_T.css +1 -0
  4. package/dist/client/assets/AgentPermissionPolicyEditor-Ia7QkynK.js +6 -0
  5. package/dist/client/assets/{AgentsView-CIH4Acck.js → AgentsView-DBbdPWV-.js} +3 -3
  6. package/dist/client/assets/ChatView-DYpoWnCc.js +1 -0
  7. package/dist/client/assets/{DevServerView-Bd8JZ-3C.js → DevServerView-DotHOFZt.js} +1 -1
  8. package/dist/client/assets/{DirectoryPicker-BOGqZNiq.js → DirectoryPicker-CIj3ZGKv.js} +1 -1
  9. package/dist/client/assets/{DocumentsView-B-ELcw4o.js → DocumentsView-Dt27gDYa.js} +1 -1
  10. package/dist/client/assets/{EvalsView-Ccl9QBYN.js → EvalsView-HfWTc8Uv.js} +1 -1
  11. package/dist/client/assets/{ExperimentalAgentOnboardingModal-BM7EnSvJ.js → ExperimentalAgentOnboardingModal-U7fXDhhN.js} +1 -1
  12. package/dist/client/assets/{InsightsView-DLF49bzu.js → InsightsView-C8bsAlMv.js} +1 -1
  13. package/dist/client/assets/{MemoryView-CE1D9euM.js → MemoryView-D-HLtRrr.js} +1 -1
  14. package/dist/client/assets/{NodesView-Zxusnhxu.js → NodesView-w3ms-XX2.js} +1 -1
  15. package/dist/client/assets/{PiExtensionsManager-BlMmxtLZ.js → PiExtensionsManager-DFAZAfNn.js} +2 -2
  16. package/dist/client/assets/{PluginManager-D4eZ0zA4.js → PluginManager-DN1VG7Qm.js} +1 -1
  17. package/dist/client/assets/ReliabilityView-D0Rtd7pX.css +1 -0
  18. package/dist/client/assets/{ResearchView-C14Zh7c9.js → ResearchView-YoxEFtNB.js} +1 -1
  19. package/dist/client/assets/{SettingsModal-BAx4gt2A.css → SettingsModal-1Y8N6MkL.css} +1 -1
  20. package/dist/client/assets/SettingsModal-B86XhYB1.js +31 -0
  21. package/dist/client/assets/{SettingsModal-DRnZ6eBW.js → SettingsModal-BRRPoxku.js} +1 -1
  22. package/dist/client/assets/{SetupWizardModal-BmmRM3g-.js → SetupWizardModal-B4eA3bpz.js} +1 -1
  23. package/dist/client/assets/{SkillsView-DWVtT2-8.js → SkillsView-DZIfZoF5.js} +1 -1
  24. package/dist/client/assets/{StashRecoveryView-CKkaWzzc.js → StashRecoveryView-mKXYsqam.js} +1 -1
  25. package/dist/client/assets/{TodoView-hbD0NOCY.js → TodoView-C6sLLEQu.js} +1 -1
  26. package/dist/client/assets/dashboard-view-DOY8-BIx.js +21 -0
  27. package/dist/client/assets/{folder-open-BTN2_Wuv.js → folder-open-C_fxRMq1.js} +1 -1
  28. package/dist/client/assets/index-DTFPgu6_.js +695 -0
  29. package/dist/client/assets/index-DdvAZIzj.css +1 -0
  30. package/dist/client/assets/{upload-euJEs_N2.js → upload-xjku_93-.js} +1 -1
  31. package/dist/client/assets/{users-B7miEHCZ.js → users-CbALDtDk.js} +1 -1
  32. package/dist/client/index.html +2 -2
  33. package/dist/client/version.json +1 -1
  34. package/dist/droid-cli/package.json +1 -1
  35. package/dist/extension.js +477 -225
  36. package/dist/pi-claude-cli/package.json +1 -1
  37. package/dist/plugins/fusion-plugin-cli-printing-press/package.json +1 -1
  38. package/dist/plugins/fusion-plugin-cursor-runtime/package.json +1 -1
  39. package/dist/plugins/fusion-plugin-dependency-graph/package.json +1 -1
  40. package/dist/plugins/fusion-plugin-droid-runtime/package.json +1 -1
  41. package/dist/plugins/fusion-plugin-hermes-runtime/package.json +1 -1
  42. package/dist/plugins/fusion-plugin-openclaw-runtime/package.json +1 -1
  43. package/dist/plugins/fusion-plugin-paperclip-runtime/package.json +1 -1
  44. package/dist/plugins/fusion-plugin-reports/package.json +1 -1
  45. package/dist/plugins/fusion-plugin-roadmap/package.json +1 -1
  46. package/dist/plugins/fusion-plugin-whatsapp-chat/package.json +1 -1
  47. package/package.json +1 -1
  48. package/skill/fusion/SKILL.md +1 -1
  49. package/skill/fusion/references/extension-tools.md +11 -0
  50. package/skill/fusion/references/fusion-capabilities.md +1 -0
  51. package/dist/client/assets/AgentPermissionPolicyEditor-Ceg2Dszn.js +0 -6
  52. package/dist/client/assets/AgentPermissionPolicyEditor-CthjqUL_.css +0 -1
  53. package/dist/client/assets/ChatView-DqJoFquZ.js +0 -1
  54. package/dist/client/assets/ReliabilityView-rxA_HgEG.css +0 -1
  55. package/dist/client/assets/SettingsModal-c1QwWno0.js +0 -31
  56. package/dist/client/assets/dashboard-view-VNPB3ca0.js +0 -21
  57. package/dist/client/assets/index-CZFBq256.css +0 -1
  58. package/dist/client/assets/index-DzSLVOnp.js +0 -695
  59. /package/dist/client/assets/{ReliabilityView-KmH60I_5.js → ReliabilityView-DAuqE-zi.js} +0 -0
@@ -1 +1 @@
1
- import{r as g,j as e}from"./vendor-react-K0fH_qHe.js";import{v as ye,er as je,es as Y,s as Ne,X as Z,au as Se,aS as ve,J as T,a_ as ee,Y as se,R as we,et as Ce,aq as Ie,eu as $e,ev as Pe,cz as Re,ew as Ee,ex as ke,ey as Be,ez as Ae,eA as te,cw as Le,eB as Fe}from"./index-DzSLVOnp.js";import{D as De}from"./DirectoryPicker-BOGqZNiq.js";import"./vendor-xterm-DzcZoU0P.js";import"./vendor-codemirror-jBKmHyH0.js";import"./folder-open-BTN2_Wuv.js";const le="fusion-plugin-agent-browser",ne={enabled:{type:"boolean",label:"Enable Agent Browser",group:"General"},installChannel:{type:"enum",label:"Install Channel",enumValues:["stable","beta","nightly"],defaultValue:"stable",group:"General"},commandTimeoutMs:{type:"number",label:"Command Timeout (ms)",defaultValue:12e4,group:"General"},headlessMode:{type:"boolean",label:"Headless Mode",defaultValue:!0,group:"Browser"},allowedDomains:{type:"array",label:"Allowed Domains",itemType:"string",group:"Browser"},promptExecutorSystem:{type:"string",label:"Executor System Prompt",multiline:!0,group:"Prompt Contributions"},promptExecutorTask:{type:"string",label:"Executor Task Prompt",multiline:!0,group:"Prompt Contributions"},promptTriage:{type:"string",label:"Triage Prompt",multiline:!0,group:"Prompt Contributions"},promptReviewer:{type:"string",label:"Reviewer Prompt",multiline:!0,group:"Prompt Contributions"},promptHeartbeat:{type:"string",label:"Heartbeat Prompt",multiline:!0,group:"Prompt Contributions"},skillExposure:{type:"enum",label:"Skill Exposure",enumValues:["none","selected","all"],defaultValue:"selected",group:"Skills"}},ae=[{id:"fusion-plugin-hermes-runtime",name:"Hermes Runtime",description:"Runtime provider for Hermes CLI-backed execution.",category:"runtime",path:"./plugins/fusion-plugin-hermes-runtime",experimental:!0},{id:"fusion-plugin-paperclip-runtime",name:"Paperclip Runtime",description:"Runtime provider for Paperclip agent connections.",category:"runtime",path:"./plugins/fusion-plugin-paperclip-runtime"},{id:"fusion-plugin-openclaw-runtime",name:"OpenClaw Runtime",description:"Runtime provider for OpenClaw execution.",category:"runtime",path:"./plugins/fusion-plugin-openclaw-runtime",experimental:!0},{id:"fusion-plugin-droid-runtime",name:"Droid Runtime",description:"Runtime provider for Droid CLI execution.",category:"runtime",path:"./plugins/fusion-plugin-droid-runtime",experimental:!0},{id:"fusion-plugin-dependency-graph",name:"Dependency Graph",description:"Dashboard plugin for task dependency graph visualization.",category:"integration",path:"./plugins/fusion-plugin-dependency-graph"},{id:"fusion-plugin-reports",name:"Reports",description:"View report history, compare runs side-by-side, and export standalone HTML summaries.",category:"integration",path:"./plugins/fusion-plugin-reports"},{id:"fusion-plugin-whatsapp-chat",name:"WhatsApp Chat",description:"Pairs to WhatsApp Web (multi-device) with QR or pairing code, then bridges direct chats to a Fusion agent.",category:"integration",path:"./plugins/fusion-plugin-whatsapp-chat"},{id:"fusion-plugin-cli-printing-press",name:"CLI Printing Press",description:"Guided wizard for drafting external service CLI definitions.",category:"integration",path:"./plugins/fusion-plugin-cli-printing-press"},{id:le,name:"Agent Browser",description:"Built-in integration metadata. Package install support lands in FN-3101.",category:"integration",hasSetup:!0}],I={started:"var(--color-success)",loaded:"var(--color-warning)",error:"var(--color-error)",stopped:"var(--color-muted)",installed:"var(--color-info)"};function ze(i){const c=i.settingsSchema,h=c&&Object.keys(c).length>0;return i.id!==le?h?c:void 0:h?{...ne,...c}:ne}function Oe(i){const c=new Map,h=[];for(const[x,f]of Object.entries(i))if(f.group){const N=c.get(f.group)??[];N.push([x,f]),c.set(f.group,N)}else h.push([x,f]);return{grouped:c,ungrouped:h}}function ie(i,c="plugin-error-text"){return i.state!=="error"||!i.error?null:e.jsx("p",{className:c,title:i.error,children:i.error})}function We({addToast:i,projectId:c}){const[h,x]=g.useState([]),[f,N]=g.useState(!0),[re,$]=g.useState(!1),[w,P]=g.useState(""),[B,A]=g.useState(!1),[L,F]=g.useState(!1),[S,D]=g.useState(null),[r,R]=g.useState(null),[p,b]=g.useState({}),[ce,z]=g.useState(!1),[O,G]=g.useState(null),[oe,E]=g.useState({}),[ue,U]=g.useState(null),[C,q]=g.useState(null),{confirm:de}=ye(),m=g.useCallback(async()=>{try{N(!0);const s=await je(c);x(s)}catch(s){i(`Failed to load plugins: ${s instanceof Error?s.message:String(s)}`,"error")}finally{N(!1)}},[c,i]);g.useEffect(()=>{m()},[m]),g.useEffect(()=>{const s=ae.filter(o=>o.hasSetup&&h.some(l=>l.id===o.id));if(s.length===0)return;let n=!1;return Promise.all(s.map(async o=>{try{const l=await Y(o.id,c);if(n)return;E(u=>({...u,[o.id]:l}))}catch{if(n)return;E(l=>({...l,[o.id]:{hasSetup:!0,setupCheckDeferred:!0,deferredReason:"plugin-not-started",pluginState:"installed"}}))}})),()=>{n=!0}},[h,c]);const pe=g.useRef([]);pe.current=h,g.useEffect(()=>{const s=c?`?projectId=${encodeURIComponent(c)}`:"",n=o=>{try{const l=JSON.parse(o.data);if(l.scope==="project"&&(l.projectId??c)!==c)return;switch(l.transition){case"installing":case"enabled":case"disabled":case"settings-updated":x(u=>{const a=u.findIndex(t=>t.id===l.pluginId);if(a>=0){const t=[...u];return t[a]={...t[a],enabled:l.enabled,state:l.state,settings:l.settings,error:l.error},t}else return m(),u});break;case"state-changed":x(u=>{const a=u.findIndex(t=>t.id===l.pluginId);if(a>=0){const t=[...u];return t[a]={...t[a],state:l.state,error:l.error},t}return u});break;case"uninstalled":x(u=>u.filter(a=>a.id!==l.pluginId));break;case"error":x(u=>{const a=u.findIndex(t=>t.id===l.pluginId);if(a>=0){const t=[...u];return t[a]={...t[a],state:l.state,error:l.error},t}return u});break}}catch{}};return Ne(`/api/events${s}`,{events:{"plugin:lifecycle":n},onReconnect:()=>{m()}})},[c,m]);const _=async()=>{if(!w.trim()){i("Please enter a plugin path","error");return}try{A(!0),await te({path:w,...L?{aiScanOnLoad:!0}:{}},c),i("Plugin installed globally","success"),$(!1),P(""),F(!1),await m()}catch(s){i(`Failed to install plugin: ${s instanceof Error?s.message:String(s)}`,"error")}finally{A(!1)}},ge=async s=>{if(!s.path){i(`${s.name} is built in and does not have an installable package yet`,"warning");return}try{G(s.id),await te({path:s.path},c),i(`${s.name} installed globally`,"success"),await m()}catch(n){i(`Failed to install ${s.name}: ${n instanceof Error?n.message:String(n)}`,"error")}finally{G(null)}},M=async s=>{try{q(s.id);const n=await Fe(s.id,c);if(!n.success){i(`Failed to install ${s.name} setup: ${n.error??"unknown error"}`,"error");return}i(`${s.name} setup installed`,"success"),U(s.id);const o=await Y(s.id,c);E(l=>({...l,[s.id]:o}))}catch(n){i(`Failed to install ${s.name} setup: ${n instanceof Error?n.message:String(n)}`,"error")}finally{q(null),U(null)}},V=async s=>{try{const n=await Be(s.id,c);if(n.state==="error"){i(`Failed to enable ${s.name}: ${n.error??"Unknown error"}`,"error"),await m();return}i(`${s.name} enabled for this project`,"success"),await m()}catch(n){i(`Failed to enable plugin: ${n instanceof Error?n.message:String(n)}`,"error")}},H=async s=>{try{await ke(s.id,c),i(`${s.name} disabled for this project`,"success"),await m()}catch(n){i(`Failed to disable plugin: ${n instanceof Error?n.message:String(n)}`,"error")}},W=async s=>{try{D(s.id),await Ee(s.id,c),i(`${s.name} reloaded`,"success"),await m()}catch(n){i(`Failed to reload plugin: ${n instanceof Error?n.message:String(n)}`,"error")}finally{D(null)}},J=async s=>{if(await de({title:"Uninstall Plugin Globally",message:`Are you sure you want to uninstall "${s.name}" globally (all projects)?`,danger:!0}))try{await Ae(s.id,c),i(`${s.name} uninstalled globally`,"success"),await m(),R(null)}catch(o){i(`Failed to uninstall plugin: ${o instanceof Error?o.message:String(o)}`,"error")}},me=async(s,n)=>{try{await $e(s.id,{aiScanOnLoad:n},c),i(`AI scan on load ${n?"enabled":"disabled"}`,"success"),await m()}catch(o){i(`Failed to update plugin: ${o instanceof Error?o.message:String(o)}`,"error")}},he=async s=>{try{await Pe(s.id,c),i(`${s.name} rescanned`,"success"),await m()}catch(n){i(`Failed to rescan plugin: ${n instanceof Error?n.message:String(n)}`,"error")}},k=async s=>{R(s);try{z(!0);const n=await Le(s.id,c);b(n)}catch{b({})}finally{z(!1)}},be=async()=>{if(r)try{await Re(r.id,p,c),i("Settings saved","success")}catch(s){i(`Failed to save settings: ${s instanceof Error?s.message:String(s)}`,"error")}};if(r)return e.jsxs("div",{className:"plugin-manager-detail","data-testid":"plugin-manager-detail",children:[e.jsxs("div",{className:"plugin-manager-detail-header",children:[e.jsx("button",{className:"btn-icon",onClick:()=>R(null),"aria-label":"Back to plugin list",children:e.jsx(Z,{size:16})}),e.jsxs("div",{className:"plugin-detail-title",children:[e.jsxs("div",{className:"plugin-detail-title-copy",children:[e.jsx("h4",{className:"plugin-detail-name",children:r.name}),ie(r,"plugin-error-text plugin-error-text--detail")]}),e.jsx("span",{className:"plugin-state-badge",style:{color:I[r.state]||I.installed},children:r.state})]})]}),e.jsxs("div",{className:"plugin-detail-content",children:[e.jsxs("div",{className:"plugin-detail-card",children:[r.description&&e.jsx("p",{className:"plugin-description",children:r.description}),r.author&&e.jsxs("p",{className:"plugin-detail-meta-row",children:[e.jsx("span",{className:"text-muted",children:"Author:"}),r.author]}),r.homepage&&e.jsxs("p",{className:"plugin-detail-meta-row plugin-homepage",children:[e.jsx("span",{className:"text-muted",children:"Homepage:"}),e.jsxs("a",{href:r.homepage,target:"_blank",rel:"noopener noreferrer",children:[r.homepage,e.jsx(Se,{size:12})]})]}),e.jsxs("p",{className:"plugin-detail-meta-row",children:[e.jsx("span",{className:"text-muted",children:"Version:"}),r.version]})]}),e.jsxs("div",{className:"plugin-detail-card",children:[e.jsx("h5",{className:"plugin-detail-section-heading",children:"Security Scan"}),e.jsxs("div",{className:"plugin-security-row",children:[e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:!!r.aiScanOnLoad,onChange:s=>void me(r,s.target.checked)}),"Enable AI scan before load/reload"]}),e.jsxs("button",{className:"btn btn-secondary btn-sm",onClick:()=>void he(r),children:[e.jsx(ve,{size:14})," Rescan and Reload"]})]}),e.jsx("p",{className:"text-muted",children:"Turning this on only updates configuration. Use Rescan and Reload to run it now."}),r.lastSecurityScan?e.jsxs("div",{className:"plugin-security-results",children:[e.jsxs("div",{className:"plugin-security-header",children:[e.jsx("span",{className:`plugin-state-badge plugin-security-badge plugin-security-badge--${r.lastSecurityScan.verdict}`,children:r.lastSecurityScan.verdict}),e.jsx("span",{className:"text-muted",children:r.lastSecurityScan.scannedAt})]}),e.jsx("p",{className:"plugin-security-summary",children:r.lastSecurityScan.summary}),e.jsxs("details",{children:[e.jsxs("summary",{children:["Findings (",r.lastSecurityScan.findings.length,")"]}),e.jsx("ul",{className:"plugin-security-findings",children:r.lastSecurityScan.findings.map((s,n)=>e.jsxs("li",{children:[e.jsx("strong",{children:s.severity})," ",s.category," — ",s.file,": ",s.reason]},`${s.file}-${n}`))})]})]}):e.jsx("p",{className:"text-muted",children:"No security scan has been run yet."})]}),e.jsxs("div",{className:"plugin-detail-card",children:[e.jsx("h5",{className:"plugin-detail-section-heading",children:"Settings"}),ce?e.jsx("p",{className:"text-muted",children:"Loading..."}):(()=>{const s=ze(r);return s&&Object.keys(s).length>0?e.jsxs("div",{className:"plugin-settings-form",children:[(()=>{const{grouped:n,ungrouped:o}=Oe(s),l=[];o.length>0&&l.push({title:null,entries:o});for(const[u,a]of n.entries())l.push({title:u,entries:a});return l.map(u=>e.jsxs("div",{className:u.title?"plugin-settings-group":void 0,children:[u.title&&e.jsx("h6",{className:"plugin-settings-group-heading",children:u.title}),u.entries.map(([a,t])=>{const y=`setting-${a}-help`;return e.jsxs("div",{className:"form-group",children:[e.jsxs("label",{htmlFor:`setting-${a}`,children:[t.label||a,t.required&&" *"]}),t.type==="string"&&!t.multiline&&e.jsx("input",{className:"input",type:"text",id:`setting-${a}`,value:p[a]??"",onChange:d=>b({...p,[a]:d.target.value}),placeholder:t.description,"aria-describedby":t.description&&!t.required?y:void 0}),t.type==="string"&&t.multiline&&e.jsx("textarea",{className:"input",id:`setting-${a}`,rows:4,value:p[a]??"",onChange:d=>b({...p,[a]:d.target.value}),placeholder:t.description,"aria-describedby":t.description&&!t.required?y:void 0}),t.type==="password"&&e.jsx("input",{className:"input",type:"password",id:`setting-${a}`,value:p[a]??"",onChange:d=>b({...p,[a]:d.target.value}),placeholder:t.description,"aria-describedby":t.description&&!t.required?y:void 0}),t.type==="number"&&e.jsx("input",{className:"input",type:"number",id:`setting-${a}`,value:p[a]??"",onChange:d=>b({...p,[a]:Number(d.target.value)}),"aria-describedby":t.description&&!t.required?y:void 0}),t.type==="boolean"&&e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:p[a]??!1,onChange:d=>b({...p,[a]:d.target.checked})}),t.description]}),t.type==="enum"&&e.jsxs("select",{className:"select",id:`setting-${a}`,value:p[a]??"",onChange:d=>b({...p,[a]:d.target.value}),"aria-describedby":t.description&&!t.required?y:void 0,children:[e.jsx("option",{value:"",children:"Select..."}),t.enumValues?.map(d=>e.jsx("option",{value:d,children:d},d))]}),t.type==="array"&&e.jsxs("div",{className:"plugin-settings-array",children:[p[a]?.map((d,j)=>e.jsxs("div",{className:"plugin-settings-array-item",children:[e.jsx("input",{className:"input",type:t.itemType==="number"?"number":"text",value:d??"",onChange:Q=>{const v=Q.target.value,X=[...p[a]||[]];X[j]=t.itemType==="number"?Number(v):v,b({...p,[a]:X})}}),e.jsx("button",{className:"btn-icon",onClick:()=>{const v=[...p[a]||[]];v.splice(j,1),b({...p,[a]:v})},"aria-label":"Remove item",children:e.jsx(Z,{size:14})})]},j)),e.jsxs("button",{className:"btn btn-secondary",onClick:()=>{const d=p[a]||[],j=t.itemType==="number"?0:"";b({...p,[a]:[...d,j]})},children:[e.jsx(T,{size:14})," Add Item"]})]}),t.description&&!t.required&&!t.multiline&&e.jsx("span",{id:y,className:"form-help",children:t.description})]},a)})]},u.title??"ungrouped"))})(),e.jsx("button",{className:"btn btn-primary",onClick:be,children:"Save Settings"})]}):e.jsx("p",{className:"text-muted",children:"No configurable settings."})})()]}),e.jsxs("div",{className:"plugin-detail-actions",children:[r.state==="started"&&e.jsxs("button",{className:"btn btn-secondary",onClick:()=>W(r),disabled:S===r.id,children:[e.jsx(ee,{size:14,className:S===r.id?"spin":""}),S===r.id?"Reloading...":"Reload"]}),r.enabled?e.jsx("button",{className:"btn btn-secondary",onClick:()=>H(r),children:"Disable in Project"}):e.jsx("button",{className:"btn btn-primary",onClick:()=>V(r),children:"Enable in Project"}),e.jsxs("button",{className:"btn btn-danger",onClick:()=>J(r),children:[e.jsx(se,{size:14})," Uninstall Globally"]})]})]})]});const xe=new Map(h.map(s=>[s.id,s])),K=h,fe=()=>e.jsxs("section",{className:"plugin-builtins-section","aria-label":"Built-in Plugins",children:[e.jsxs("div",{className:"plugin-builtins-header",children:[e.jsx("h4",{className:"plugin-builtins-heading",children:"Built-in Plugins"}),e.jsx("p",{className:"plugin-builtins-description",children:"Built-in plugin catalog for runtimes and integrations."})]}),e.jsx("div",{className:"plugin-builtins-list","aria-label":"Built-in plugin recommendations",children:ae.map(s=>{const n=xe.get(s.id),o=!!n,l=oe[s.id],u=!!(l&&"setupCheckDeferred"in l&&l.setupCheckDeferred),a=l&&"status"in l?l.status:void 0,t=o&&s.hasSetup&&l?.hasSetup&&!u&&n?.state==="started"&&(a==="not-installed"||a==="error"),y=o&&l?.hasSetup&&a==="installed",d=ue===s.id,j=!s.path;return e.jsxs("div",{className:"plugin-builtins-item",children:[e.jsxs("div",{className:"plugin-builtins-meta",children:[e.jsx("span",{className:"plugin-builtins-name",children:s.name}),s.experimental&&e.jsx("span",{className:"plugin-builtins-runtime-badge",children:"Experimental"}),e.jsx("span",{className:"plugin-builtins-runtime-badge",children:s.category}),e.jsx("span",{className:`plugin-builtins-status ${o?"plugin-builtins-status--installed":"plugin-builtins-status--available"}`,children:o?"Installed":j?"Built in":"Not installed"}),t&&e.jsx("span",{className:"plugin-builtins-setup-status plugin-builtins-setup-status--warning",children:"Setup required"}),y&&e.jsx("span",{className:"plugin-builtins-setup-status plugin-builtins-setup-status--ready",children:"Setup ready"}),d&&e.jsx("span",{className:"plugin-builtins-setup-status plugin-builtins-setup-status--pending",children:"Checking setup..."}),u&&e.jsx("span",{className:"plugin-builtins-setup-status plugin-builtins-setup-status--deferred",children:"Start plugin to check setup"}),e.jsx("span",{className:"plugin-builtins-description-text",children:s.description})]}),j?o&&t?e.jsx("button",{className:"btn btn-primary btn-sm",onClick:()=>void M(s),disabled:C===s.id||d,children:C===s.id?"Setting up...":"Install Setup"}):o&&n?e.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>void k(n),children:"Manage"}):e.jsx("span",{className:"plugin-builtins-metadata-only",children:"Built-in metadata only"}):e.jsx("button",{className:`btn ${o&&!t?"btn-secondary":"btn-primary"} btn-sm`,onClick:()=>{if(!o){ge(s);return}if(t){M(s);return}n&&k(n)},disabled:O===s.id||C===s.id||d,children:o?t?C===s.id?"Setting up...":"Install Setup":"Manage":O===s.id?"Installing...":`Install ${s.name}`})]},s.id)})})]});return e.jsxs("div",{className:"plugin-manager","data-testid":"plugin-manager",children:[e.jsxs("div",{className:"plugin-manager-header",children:[e.jsx("span",{className:"plugin-manager-header-title",children:"Installed Plugins"}),e.jsxs("div",{className:"plugin-manager-actions",children:[e.jsxs("button",{className:"btn btn-sm",onClick:m,title:"Refresh","aria-label":"Refresh plugin list",children:[e.jsx(we,{size:14,className:f?"spin":""}),"Refresh"]}),e.jsxs("button",{className:"btn btn-primary btn-sm",onClick:()=>$(!0),children:[e.jsx(T,{size:14})," Install"]})]})]}),re&&e.jsxs("div",{className:"plugin-install-form",children:[e.jsxs("p",{className:"plugin-install-hint",children:["Browse to a plugin package root (contains ",e.jsx("code",{children:"manifest.json"}),") or a built ",e.jsx("code",{children:"dist"})," directory."]}),e.jsx(De,{value:w,onChange:P,placeholder:"Absolute path to plugin directory or dist folder",onInputKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),_())}}),e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:L,onChange:s=>F(s.target.checked)}),"Enable AI security scan on load"]}),e.jsxs("div",{className:"plugin-install-actions",children:[e.jsx("button",{className:"btn btn-primary",onClick:_,disabled:B||!w.trim(),children:B?"Installing...":"Install Plugin Globally"}),e.jsx("button",{className:"btn btn-secondary",onClick:()=>{$(!1),P("")},children:"Cancel"})]})]}),f?e.jsx("div",{className:"settings-empty-state",children:"Loading plugins..."}):e.jsxs(e.Fragment,{children:[K.length===0?e.jsxs("div",{className:"settings-empty-state",children:[e.jsx(Ce,{size:32,className:"text-muted"}),e.jsx("p",{children:"No plugins installed."}),e.jsx("p",{className:"text-muted",children:"Install a plugin to get started, or use the built-in catalog below."})]}):e.jsx("div",{className:"plugin-list",children:K.map(s=>e.jsxs("div",{className:"plugin-item",children:[e.jsx("div",{className:"plugin-info",children:e.jsxs("div",{className:"plugin-copy",children:[e.jsxs("div",{className:"plugin-copy-header",children:[e.jsx("span",{className:"plugin-name",children:s.name}),e.jsxs("span",{className:"plugin-version text-muted",children:["v",s.version]}),e.jsx("span",{className:"plugin-state-badge",style:{color:I[s.state]||I.installed},children:s.state})]}),ie(s)]})}),e.jsxs("div",{className:"plugin-actions",children:[s.state==="started"&&e.jsx("button",{className:"btn-icon",onClick:()=>W(s),disabled:S===s.id,title:"Reload",children:e.jsx(ee,{size:14,className:S===s.id?"spin":""})}),e.jsxs("label",{className:"toggle-switch",children:[e.jsx("input",{type:"checkbox",checked:s.enabled,onChange:()=>s.enabled?H(s):V(s),"aria-label":`${s.enabled?"Disable":"Enable"} ${s.name}`}),e.jsx("span",{className:"toggle-slider"})]}),e.jsx("button",{className:"btn-icon",onClick:()=>k(s),title:"Settings",children:e.jsx(Ie,{size:14})}),e.jsx("button",{className:"btn-icon",onClick:()=>J(s),title:"Uninstall globally",children:e.jsx(se,{size:14})})]})]},s.id))}),fe()]})]})}export{ne as AGENT_BROWSER_SETTINGS_SCHEMA,le as BUILTIN_AGENT_BROWSER_PLUGIN_ID,We as PluginManager,I as STATE_COLORS};
1
+ import{r as g,j as e}from"./vendor-react-K0fH_qHe.js";import{v as ye,eu as je,ev as Y,s as Ne,X as Z,au as Se,aS as ve,J as T,a_ as ee,Y as se,R as we,ew as Ce,aq as Ie,ex as $e,ey as Pe,cz as Re,ez as Ee,eA as ke,eB as Be,eC as Ae,eD as te,cw as Le,eE as De}from"./index-DTFPgu6_.js";import{D as Fe}from"./DirectoryPicker-CIj3ZGKv.js";import"./vendor-xterm-DzcZoU0P.js";import"./vendor-codemirror-jBKmHyH0.js";import"./folder-open-C_fxRMq1.js";const le="fusion-plugin-agent-browser",ne={enabled:{type:"boolean",label:"Enable Agent Browser",group:"General"},installChannel:{type:"enum",label:"Install Channel",enumValues:["stable","beta","nightly"],defaultValue:"stable",group:"General"},commandTimeoutMs:{type:"number",label:"Command Timeout (ms)",defaultValue:12e4,group:"General"},headlessMode:{type:"boolean",label:"Headless Mode",defaultValue:!0,group:"Browser"},allowedDomains:{type:"array",label:"Allowed Domains",itemType:"string",group:"Browser"},promptExecutorSystem:{type:"string",label:"Executor System Prompt",multiline:!0,group:"Prompt Contributions"},promptExecutorTask:{type:"string",label:"Executor Task Prompt",multiline:!0,group:"Prompt Contributions"},promptTriage:{type:"string",label:"Triage Prompt",multiline:!0,group:"Prompt Contributions"},promptReviewer:{type:"string",label:"Reviewer Prompt",multiline:!0,group:"Prompt Contributions"},promptHeartbeat:{type:"string",label:"Heartbeat Prompt",multiline:!0,group:"Prompt Contributions"},skillExposure:{type:"enum",label:"Skill Exposure",enumValues:["none","selected","all"],defaultValue:"selected",group:"Skills"}},ae=[{id:"fusion-plugin-hermes-runtime",name:"Hermes Runtime",description:"Runtime provider for Hermes CLI-backed execution.",category:"runtime",path:"./plugins/fusion-plugin-hermes-runtime",experimental:!0},{id:"fusion-plugin-paperclip-runtime",name:"Paperclip Runtime",description:"Runtime provider for Paperclip agent connections.",category:"runtime",path:"./plugins/fusion-plugin-paperclip-runtime"},{id:"fusion-plugin-openclaw-runtime",name:"OpenClaw Runtime",description:"Runtime provider for OpenClaw execution.",category:"runtime",path:"./plugins/fusion-plugin-openclaw-runtime",experimental:!0},{id:"fusion-plugin-droid-runtime",name:"Droid Runtime",description:"Runtime provider for Droid CLI execution.",category:"runtime",path:"./plugins/fusion-plugin-droid-runtime",experimental:!0},{id:"fusion-plugin-dependency-graph",name:"Dependency Graph",description:"Dashboard plugin for task dependency graph visualization.",category:"integration",path:"./plugins/fusion-plugin-dependency-graph"},{id:"fusion-plugin-reports",name:"Reports",description:"View report history, compare runs side-by-side, and export standalone HTML summaries.",category:"integration",path:"./plugins/fusion-plugin-reports"},{id:"fusion-plugin-whatsapp-chat",name:"WhatsApp Chat",description:"Pairs to WhatsApp Web (multi-device) with QR or pairing code, then bridges direct chats to a Fusion agent.",category:"integration",path:"./plugins/fusion-plugin-whatsapp-chat"},{id:"fusion-plugin-cli-printing-press",name:"CLI Printing Press",description:"Guided wizard for drafting external service CLI definitions.",category:"integration",path:"./plugins/fusion-plugin-cli-printing-press"},{id:le,name:"Agent Browser",description:"Built-in integration metadata. Package install support lands in FN-3101.",category:"integration",hasSetup:!0}],I={started:"var(--color-success)",loaded:"var(--color-warning)",error:"var(--color-error)",stopped:"var(--color-muted)",installed:"var(--color-info)"};function ze(i){const c=i.settingsSchema,h=c&&Object.keys(c).length>0;return i.id!==le?h?c:void 0:h?{...ne,...c}:ne}function Oe(i){const c=new Map,h=[];for(const[x,f]of Object.entries(i))if(f.group){const N=c.get(f.group)??[];N.push([x,f]),c.set(f.group,N)}else h.push([x,f]);return{grouped:c,ungrouped:h}}function ie(i,c="plugin-error-text"){return i.state!=="error"||!i.error?null:e.jsx("p",{className:c,title:i.error,children:i.error})}function We({addToast:i,projectId:c}){const[h,x]=g.useState([]),[f,N]=g.useState(!0),[re,$]=g.useState(!1),[w,P]=g.useState(""),[B,A]=g.useState(!1),[L,D]=g.useState(!1),[S,F]=g.useState(null),[r,R]=g.useState(null),[p,b]=g.useState({}),[ce,z]=g.useState(!1),[O,G]=g.useState(null),[oe,E]=g.useState({}),[ue,U]=g.useState(null),[C,q]=g.useState(null),{confirm:de}=ye(),m=g.useCallback(async()=>{try{N(!0);const s=await je(c);x(s)}catch(s){i(`Failed to load plugins: ${s instanceof Error?s.message:String(s)}`,"error")}finally{N(!1)}},[c,i]);g.useEffect(()=>{m()},[m]),g.useEffect(()=>{const s=ae.filter(o=>o.hasSetup&&h.some(l=>l.id===o.id));if(s.length===0)return;let n=!1;return Promise.all(s.map(async o=>{try{const l=await Y(o.id,c);if(n)return;E(u=>({...u,[o.id]:l}))}catch{if(n)return;E(l=>({...l,[o.id]:{hasSetup:!0,setupCheckDeferred:!0,deferredReason:"plugin-not-started",pluginState:"installed"}}))}})),()=>{n=!0}},[h,c]);const pe=g.useRef([]);pe.current=h,g.useEffect(()=>{const s=c?`?projectId=${encodeURIComponent(c)}`:"",n=o=>{try{const l=JSON.parse(o.data);if(l.scope==="project"&&(l.projectId??c)!==c)return;switch(l.transition){case"installing":case"enabled":case"disabled":case"settings-updated":x(u=>{const a=u.findIndex(t=>t.id===l.pluginId);if(a>=0){const t=[...u];return t[a]={...t[a],enabled:l.enabled,state:l.state,settings:l.settings,error:l.error},t}else return m(),u});break;case"state-changed":x(u=>{const a=u.findIndex(t=>t.id===l.pluginId);if(a>=0){const t=[...u];return t[a]={...t[a],state:l.state,error:l.error},t}return u});break;case"uninstalled":x(u=>u.filter(a=>a.id!==l.pluginId));break;case"error":x(u=>{const a=u.findIndex(t=>t.id===l.pluginId);if(a>=0){const t=[...u];return t[a]={...t[a],state:l.state,error:l.error},t}return u});break}}catch{}};return Ne(`/api/events${s}`,{events:{"plugin:lifecycle":n},onReconnect:()=>{m()}})},[c,m]);const _=async()=>{if(!w.trim()){i("Please enter a plugin path","error");return}try{A(!0),await te({path:w,...L?{aiScanOnLoad:!0}:{}},c),i("Plugin installed globally","success"),$(!1),P(""),D(!1),await m()}catch(s){i(`Failed to install plugin: ${s instanceof Error?s.message:String(s)}`,"error")}finally{A(!1)}},ge=async s=>{if(!s.path){i(`${s.name} is built in and does not have an installable package yet`,"warning");return}try{G(s.id),await te({path:s.path},c),i(`${s.name} installed globally`,"success"),await m()}catch(n){i(`Failed to install ${s.name}: ${n instanceof Error?n.message:String(n)}`,"error")}finally{G(null)}},M=async s=>{try{q(s.id);const n=await De(s.id,c);if(!n.success){i(`Failed to install ${s.name} setup: ${n.error??"unknown error"}`,"error");return}i(`${s.name} setup installed`,"success"),U(s.id);const o=await Y(s.id,c);E(l=>({...l,[s.id]:o}))}catch(n){i(`Failed to install ${s.name} setup: ${n instanceof Error?n.message:String(n)}`,"error")}finally{q(null),U(null)}},V=async s=>{try{const n=await Be(s.id,c);if(n.state==="error"){i(`Failed to enable ${s.name}: ${n.error??"Unknown error"}`,"error"),await m();return}i(`${s.name} enabled for this project`,"success"),await m()}catch(n){i(`Failed to enable plugin: ${n instanceof Error?n.message:String(n)}`,"error")}},H=async s=>{try{await ke(s.id,c),i(`${s.name} disabled for this project`,"success"),await m()}catch(n){i(`Failed to disable plugin: ${n instanceof Error?n.message:String(n)}`,"error")}},W=async s=>{try{F(s.id),await Ee(s.id,c),i(`${s.name} reloaded`,"success"),await m()}catch(n){i(`Failed to reload plugin: ${n instanceof Error?n.message:String(n)}`,"error")}finally{F(null)}},J=async s=>{if(await de({title:"Uninstall Plugin Globally",message:`Are you sure you want to uninstall "${s.name}" globally (all projects)?`,danger:!0}))try{await Ae(s.id,c),i(`${s.name} uninstalled globally`,"success"),await m(),R(null)}catch(o){i(`Failed to uninstall plugin: ${o instanceof Error?o.message:String(o)}`,"error")}},me=async(s,n)=>{try{await $e(s.id,{aiScanOnLoad:n},c),i(`AI scan on load ${n?"enabled":"disabled"}`,"success"),await m()}catch(o){i(`Failed to update plugin: ${o instanceof Error?o.message:String(o)}`,"error")}},he=async s=>{try{await Pe(s.id,c),i(`${s.name} rescanned`,"success"),await m()}catch(n){i(`Failed to rescan plugin: ${n instanceof Error?n.message:String(n)}`,"error")}},k=async s=>{R(s);try{z(!0);const n=await Le(s.id,c);b(n)}catch{b({})}finally{z(!1)}},be=async()=>{if(r)try{await Re(r.id,p,c),i("Settings saved","success")}catch(s){i(`Failed to save settings: ${s instanceof Error?s.message:String(s)}`,"error")}};if(r)return e.jsxs("div",{className:"plugin-manager-detail","data-testid":"plugin-manager-detail",children:[e.jsxs("div",{className:"plugin-manager-detail-header",children:[e.jsx("button",{className:"btn-icon",onClick:()=>R(null),"aria-label":"Back to plugin list",children:e.jsx(Z,{size:16})}),e.jsxs("div",{className:"plugin-detail-title",children:[e.jsxs("div",{className:"plugin-detail-title-copy",children:[e.jsx("h4",{className:"plugin-detail-name",children:r.name}),ie(r,"plugin-error-text plugin-error-text--detail")]}),e.jsx("span",{className:"plugin-state-badge",style:{color:I[r.state]||I.installed},children:r.state})]})]}),e.jsxs("div",{className:"plugin-detail-content",children:[e.jsxs("div",{className:"plugin-detail-card",children:[r.description&&e.jsx("p",{className:"plugin-description",children:r.description}),r.author&&e.jsxs("p",{className:"plugin-detail-meta-row",children:[e.jsx("span",{className:"text-muted",children:"Author:"}),r.author]}),r.homepage&&e.jsxs("p",{className:"plugin-detail-meta-row plugin-homepage",children:[e.jsx("span",{className:"text-muted",children:"Homepage:"}),e.jsxs("a",{href:r.homepage,target:"_blank",rel:"noopener noreferrer",children:[r.homepage,e.jsx(Se,{size:12})]})]}),e.jsxs("p",{className:"plugin-detail-meta-row",children:[e.jsx("span",{className:"text-muted",children:"Version:"}),r.version]})]}),e.jsxs("div",{className:"plugin-detail-card",children:[e.jsx("h5",{className:"plugin-detail-section-heading",children:"Security Scan"}),e.jsxs("div",{className:"plugin-security-row",children:[e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:!!r.aiScanOnLoad,onChange:s=>void me(r,s.target.checked)}),"Enable AI scan before load/reload"]}),e.jsxs("button",{className:"btn btn-secondary btn-sm",onClick:()=>void he(r),children:[e.jsx(ve,{size:14})," Rescan and Reload"]})]}),e.jsx("p",{className:"text-muted",children:"Turning this on only updates configuration. Use Rescan and Reload to run it now."}),r.lastSecurityScan?e.jsxs("div",{className:"plugin-security-results",children:[e.jsxs("div",{className:"plugin-security-header",children:[e.jsx("span",{className:`plugin-state-badge plugin-security-badge plugin-security-badge--${r.lastSecurityScan.verdict}`,children:r.lastSecurityScan.verdict}),e.jsx("span",{className:"text-muted",children:r.lastSecurityScan.scannedAt})]}),e.jsx("p",{className:"plugin-security-summary",children:r.lastSecurityScan.summary}),e.jsxs("details",{children:[e.jsxs("summary",{children:["Findings (",r.lastSecurityScan.findings.length,")"]}),e.jsx("ul",{className:"plugin-security-findings",children:r.lastSecurityScan.findings.map((s,n)=>e.jsxs("li",{children:[e.jsx("strong",{children:s.severity})," ",s.category," — ",s.file,": ",s.reason]},`${s.file}-${n}`))})]})]}):e.jsx("p",{className:"text-muted",children:"No security scan has been run yet."})]}),e.jsxs("div",{className:"plugin-detail-card",children:[e.jsx("h5",{className:"plugin-detail-section-heading",children:"Settings"}),ce?e.jsx("p",{className:"text-muted",children:"Loading..."}):(()=>{const s=ze(r);return s&&Object.keys(s).length>0?e.jsxs("div",{className:"plugin-settings-form",children:[(()=>{const{grouped:n,ungrouped:o}=Oe(s),l=[];o.length>0&&l.push({title:null,entries:o});for(const[u,a]of n.entries())l.push({title:u,entries:a});return l.map(u=>e.jsxs("div",{className:u.title?"plugin-settings-group":void 0,children:[u.title&&e.jsx("h6",{className:"plugin-settings-group-heading",children:u.title}),u.entries.map(([a,t])=>{const y=`setting-${a}-help`;return e.jsxs("div",{className:"form-group",children:[e.jsxs("label",{htmlFor:`setting-${a}`,children:[t.label||a,t.required&&" *"]}),t.type==="string"&&!t.multiline&&e.jsx("input",{className:"input",type:"text",id:`setting-${a}`,value:p[a]??"",onChange:d=>b({...p,[a]:d.target.value}),placeholder:t.description,"aria-describedby":t.description&&!t.required?y:void 0}),t.type==="string"&&t.multiline&&e.jsx("textarea",{className:"input",id:`setting-${a}`,rows:4,value:p[a]??"",onChange:d=>b({...p,[a]:d.target.value}),placeholder:t.description,"aria-describedby":t.description&&!t.required?y:void 0}),t.type==="password"&&e.jsx("input",{className:"input",type:"password",id:`setting-${a}`,value:p[a]??"",onChange:d=>b({...p,[a]:d.target.value}),placeholder:t.description,"aria-describedby":t.description&&!t.required?y:void 0}),t.type==="number"&&e.jsx("input",{className:"input",type:"number",id:`setting-${a}`,value:p[a]??"",onChange:d=>b({...p,[a]:Number(d.target.value)}),"aria-describedby":t.description&&!t.required?y:void 0}),t.type==="boolean"&&e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:p[a]??!1,onChange:d=>b({...p,[a]:d.target.checked})}),t.description]}),t.type==="enum"&&e.jsxs("select",{className:"select",id:`setting-${a}`,value:p[a]??"",onChange:d=>b({...p,[a]:d.target.value}),"aria-describedby":t.description&&!t.required?y:void 0,children:[e.jsx("option",{value:"",children:"Select..."}),t.enumValues?.map(d=>e.jsx("option",{value:d,children:d},d))]}),t.type==="array"&&e.jsxs("div",{className:"plugin-settings-array",children:[p[a]?.map((d,j)=>e.jsxs("div",{className:"plugin-settings-array-item",children:[e.jsx("input",{className:"input",type:t.itemType==="number"?"number":"text",value:d??"",onChange:Q=>{const v=Q.target.value,X=[...p[a]||[]];X[j]=t.itemType==="number"?Number(v):v,b({...p,[a]:X})}}),e.jsx("button",{className:"btn-icon",onClick:()=>{const v=[...p[a]||[]];v.splice(j,1),b({...p,[a]:v})},"aria-label":"Remove item",children:e.jsx(Z,{size:14})})]},j)),e.jsxs("button",{className:"btn btn-secondary",onClick:()=>{const d=p[a]||[],j=t.itemType==="number"?0:"";b({...p,[a]:[...d,j]})},children:[e.jsx(T,{size:14})," Add Item"]})]}),t.description&&!t.required&&!t.multiline&&e.jsx("span",{id:y,className:"form-help",children:t.description})]},a)})]},u.title??"ungrouped"))})(),e.jsx("button",{className:"btn btn-primary",onClick:be,children:"Save Settings"})]}):e.jsx("p",{className:"text-muted",children:"No configurable settings."})})()]}),e.jsxs("div",{className:"plugin-detail-actions",children:[r.state==="started"&&e.jsxs("button",{className:"btn btn-secondary",onClick:()=>W(r),disabled:S===r.id,children:[e.jsx(ee,{size:14,className:S===r.id?"spin":""}),S===r.id?"Reloading...":"Reload"]}),r.enabled?e.jsx("button",{className:"btn btn-secondary",onClick:()=>H(r),children:"Disable in Project"}):e.jsx("button",{className:"btn btn-primary",onClick:()=>V(r),children:"Enable in Project"}),e.jsxs("button",{className:"btn btn-danger",onClick:()=>J(r),children:[e.jsx(se,{size:14})," Uninstall Globally"]})]})]})]});const xe=new Map(h.map(s=>[s.id,s])),K=h,fe=()=>e.jsxs("section",{className:"plugin-builtins-section","aria-label":"Built-in Plugins",children:[e.jsxs("div",{className:"plugin-builtins-header",children:[e.jsx("h4",{className:"plugin-builtins-heading",children:"Built-in Plugins"}),e.jsx("p",{className:"plugin-builtins-description",children:"Built-in plugin catalog for runtimes and integrations."})]}),e.jsx("div",{className:"plugin-builtins-list","aria-label":"Built-in plugin recommendations",children:ae.map(s=>{const n=xe.get(s.id),o=!!n,l=oe[s.id],u=!!(l&&"setupCheckDeferred"in l&&l.setupCheckDeferred),a=l&&"status"in l?l.status:void 0,t=o&&s.hasSetup&&l?.hasSetup&&!u&&n?.state==="started"&&(a==="not-installed"||a==="error"),y=o&&l?.hasSetup&&a==="installed",d=ue===s.id,j=!s.path;return e.jsxs("div",{className:"plugin-builtins-item",children:[e.jsxs("div",{className:"plugin-builtins-meta",children:[e.jsx("span",{className:"plugin-builtins-name",children:s.name}),s.experimental&&e.jsx("span",{className:"plugin-builtins-runtime-badge",children:"Experimental"}),e.jsx("span",{className:"plugin-builtins-runtime-badge",children:s.category}),e.jsx("span",{className:`plugin-builtins-status ${o?"plugin-builtins-status--installed":"plugin-builtins-status--available"}`,children:o?"Installed":j?"Built in":"Not installed"}),t&&e.jsx("span",{className:"plugin-builtins-setup-status plugin-builtins-setup-status--warning",children:"Setup required"}),y&&e.jsx("span",{className:"plugin-builtins-setup-status plugin-builtins-setup-status--ready",children:"Setup ready"}),d&&e.jsx("span",{className:"plugin-builtins-setup-status plugin-builtins-setup-status--pending",children:"Checking setup..."}),u&&e.jsx("span",{className:"plugin-builtins-setup-status plugin-builtins-setup-status--deferred",children:"Start plugin to check setup"}),e.jsx("span",{className:"plugin-builtins-description-text",children:s.description})]}),j?o&&t?e.jsx("button",{className:"btn btn-primary btn-sm",onClick:()=>void M(s),disabled:C===s.id||d,children:C===s.id?"Setting up...":"Install Setup"}):o&&n?e.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>void k(n),children:"Manage"}):e.jsx("span",{className:"plugin-builtins-metadata-only",children:"Built-in metadata only"}):e.jsx("button",{className:`btn ${o&&!t?"btn-secondary":"btn-primary"} btn-sm`,onClick:()=>{if(!o){ge(s);return}if(t){M(s);return}n&&k(n)},disabled:O===s.id||C===s.id||d,children:o?t?C===s.id?"Setting up...":"Install Setup":"Manage":O===s.id?"Installing...":`Install ${s.name}`})]},s.id)})})]});return e.jsxs("div",{className:"plugin-manager","data-testid":"plugin-manager",children:[e.jsxs("div",{className:"plugin-manager-header",children:[e.jsx("span",{className:"plugin-manager-header-title",children:"Installed Plugins"}),e.jsxs("div",{className:"plugin-manager-actions",children:[e.jsxs("button",{className:"btn btn-sm",onClick:m,title:"Refresh","aria-label":"Refresh plugin list",children:[e.jsx(we,{size:14,className:f?"spin":""}),"Refresh"]}),e.jsxs("button",{className:"btn btn-primary btn-sm",onClick:()=>$(!0),children:[e.jsx(T,{size:14})," Install"]})]})]}),re&&e.jsxs("div",{className:"plugin-install-form",children:[e.jsxs("p",{className:"plugin-install-hint",children:["Browse to a plugin package root (contains ",e.jsx("code",{children:"manifest.json"}),") or a built ",e.jsx("code",{children:"dist"})," directory."]}),e.jsx(Fe,{value:w,onChange:P,placeholder:"Absolute path to plugin directory or dist folder",onInputKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),_())}}),e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:L,onChange:s=>D(s.target.checked)}),"Enable AI security scan on load"]}),e.jsxs("div",{className:"plugin-install-actions",children:[e.jsx("button",{className:"btn btn-primary",onClick:_,disabled:B||!w.trim(),children:B?"Installing...":"Install Plugin Globally"}),e.jsx("button",{className:"btn btn-secondary",onClick:()=>{$(!1),P("")},children:"Cancel"})]})]}),f?e.jsx("div",{className:"settings-empty-state",children:"Loading plugins..."}):e.jsxs(e.Fragment,{children:[K.length===0?e.jsxs("div",{className:"settings-empty-state",children:[e.jsx(Ce,{size:32,className:"text-muted"}),e.jsx("p",{children:"No plugins installed."}),e.jsx("p",{className:"text-muted",children:"Install a plugin to get started, or use the built-in catalog below."})]}):e.jsx("div",{className:"plugin-list",children:K.map(s=>e.jsxs("div",{className:"plugin-item",children:[e.jsx("div",{className:"plugin-info",children:e.jsxs("div",{className:"plugin-copy",children:[e.jsxs("div",{className:"plugin-copy-header",children:[e.jsx("span",{className:"plugin-name",children:s.name}),e.jsxs("span",{className:"plugin-version text-muted",children:["v",s.version]}),e.jsx("span",{className:"plugin-state-badge",style:{color:I[s.state]||I.installed},children:s.state})]}),ie(s)]})}),e.jsxs("div",{className:"plugin-actions",children:[s.state==="started"&&e.jsx("button",{className:"btn-icon",onClick:()=>W(s),disabled:S===s.id,title:"Reload",children:e.jsx(ee,{size:14,className:S===s.id?"spin":""})}),e.jsxs("label",{className:"toggle-switch",children:[e.jsx("input",{type:"checkbox",checked:s.enabled,onChange:()=>s.enabled?H(s):V(s),"aria-label":`${s.enabled?"Disable":"Enable"} ${s.name}`}),e.jsx("span",{className:"toggle-slider"})]}),e.jsx("button",{className:"btn-icon",onClick:()=>k(s),title:"Settings",children:e.jsx(Ie,{size:14})}),e.jsx("button",{className:"btn-icon",onClick:()=>J(s),title:"Uninstall globally",children:e.jsx(se,{size:14})})]})]},s.id))}),fe()]})]})}export{ne as AGENT_BROWSER_SETTINGS_SCHEMA,le as BUILTIN_AGENT_BROWSER_PLUGIN_ID,We as PluginManager,I as STATE_COLORS};
@@ -0,0 +1 @@
1
+ .reliability-view{display:flex;flex-direction:column;gap:var(--space-lg);height:100%;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch}.reliability-card{padding:var(--space-lg);border:var(--border-width-thin, .0625rem) solid var(--border);border-radius:var(--radius-md);background:var(--card)}.reliability-headline-card{display:flex;flex-direction:column;gap:var(--space-sm)}.reliability-headline{font-size:var(--font-size-2xl, 1.75rem);font-weight:700}.reliability-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--space-lg)}.reliability-table{width:100%;border-collapse:collapse;margin-top:var(--space-sm)}.reliability-table th,.reliability-table td{text-align:left;padding:var(--space-xs) var(--space-sm);border-bottom:var(--border-width-thin, .0625rem) solid var(--border)}.reliability-stat-row{display:flex;justify-content:space-between;align-items:center;padding:var(--space-xs) 0}.reliability-muted{color:var(--text-muted)}.reliability-histogram{list-style:none;margin:var(--space-sm) 0 0;padding:0;display:flex;flex-direction:column;gap:var(--space-sm)}.reliability-histogram li{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,6fr) minmax(0,1fr);align-items:center;gap:var(--space-sm)}.reliability-histogram-bar-wrap{width:100%;border-radius:var(--radius-pill);background:color-mix(in srgb,var(--color-info) 15%,transparent);overflow:hidden}.reliability-histogram-bar{height:var(--space-md);background:var(--color-info)}@media(max-width:768px){.reliability-view{padding-bottom:calc(var(--space-lg) + var(--mobile-nav-height) + env(safe-area-inset-bottom,0px) + var(--standalone-bottom-gap))}.reliability-grid{grid-template-columns:minmax(0,1fr)}}
@@ -1 +1 @@
1
- import{r as i,j as e}from"./vendor-react-K0fH_qHe.js";import{ax as ce,ay as le,s as oe,az as de,aA as ue,aB as he,aC as me,aD as be,aE as fe,ai as ve,u as xe,aF as pe,x as ye,aG as je,L as ge,S as _e}from"./index-DzSLVOnp.js";import"./vendor-xterm-DzcZoU0P.js";import"./vendor-codemirror-jBKmHyH0.js";const Re="builtin",H={pageFetch:!0,github:!1,localDocs:!0,llmSynthesis:!0};function X(n){const t=n?.researchGlobalDefaults,c=n?.researchSettings;return{enabled:c?.enabled??n?.researchEnabled??n?.researchGlobalEnabled??!0,searchProvider:c?.searchProvider??t?.searchProvider??n?.researchGlobalWebSearchProvider??Re,synthesisProvider:c?.synthesisProvider??t?.synthesisProvider,synthesisModelId:c?.synthesisModelId??t?.synthesisModelId,enabledSources:{webSearch:!0,pageFetch:c?.enabledSources?.pageFetch??t?.enabledSources?.pageFetch??H.pageFetch,github:c?.enabledSources?.github??t?.enabledSources?.github??H.github,localDocs:c?.enabledSources?.localDocs??t?.enabledSources?.localDocs??H.localDocs,llmSynthesis:c?.enabledSources?.llmSynthesis??t?.enabledSources?.llmSynthesis??H.llmSynthesis},limits:{maxConcurrentRuns:c?.limits?.maxConcurrentRuns??n?.researchMaxConcurrentRuns??n?.researchGlobalMaxConcurrentRuns??3,maxSourcesPerRun:c?.limits?.maxSourcesPerRun??t?.maxSourcesPerRun??n?.researchMaxSourcesPerRun??n?.researchGlobalMaxSourcesPerRun??20,maxDurationMs:c?.limits?.maxDurationMs??n?.researchDefaultTimeout??n?.researchGlobalDefaultTimeout??3e5,requestTimeoutMs:c?.limits?.requestTimeoutMs??n?.researchGlobalFetchTimeoutMs??3e4},defaultExportFormat:t?.defaultExportFormat??"markdown"}}const Se=300,we=4e3,Ne=["queued","running","cancelling","retry_waiting"];function Z(n,t){if(n instanceof ve){const c=n;return{message:n.message,status:n.status,code:c.researchCode??"INTERNAL_ERROR",setupHint:c.setupHint,retryable:c.retryable}}return n instanceof Error?{message:n.message,code:"INTERNAL_ERROR"}:{message:t,code:"INTERNAL_ERROR"}}function ke(n){if(!n)return{cancelable:!1,retryable:!1,isTransitioning:!1,blockingReason:"No run selected"};const t=Ne.includes(n.status),c=n.status==="queued"||n.status==="running",f=n.lifecycle?.retryable,h=n.status==="failed"||n.status==="timed_out",a=!!(h&&f);let p;return!c&&t?p="Run is already transitioning":!c&&n.status==="completed"?p="Completed runs cannot be cancelled":!c&&n.status==="cancelled"?p="Run is already cancelled":!c&&n.status==="retry_exhausted"?p="Retry attempts exhausted":!c&&n.status==="failed"?p="Failed runs cannot be cancelled":!c&&n.status==="timed_out"&&(p="Timed out runs cannot be cancelled"),!a&&h&&f===!1&&(p=n.lifecycle?.errorCode==="RETRY_EXHAUSTED"?"Retry attempts exhausted":"Run is not retryable"),{cancelable:c,retryable:a,isTransitioning:t,blockingReason:p}}function Ee(n){const t=n?.projectId,[c,f]=i.useState([]),[h,a]=i.useState(null),[p,_]=i.useState(null),[j,N]=i.useState({available:!0}),[E,T]=i.useState(!0),[L,P]=i.useState(null),[F,g]=i.useState(null),[R,D]=i.useState(""),C=i.useRef(0),k=i.useRef(0),S=i.useRef(t);i.useEffect(()=>{S.current!==t&&(S.current=t,k.current++)},[t]);const v=i.useCallback(async(l=R)=>{const r=++C.current,o=t;P(null),g(null);try{const y=await ce({q:l||void 0,limit:100},o);if(r!==C.current||o!==t)return;f(y.runs),N(y.availability),h&&!y.runs.some(b=>b.id===h)&&(a(null),_(null))}catch(y){if(r!==C.current||o!==t)return;const b=Z(y,"Failed to load research runs");P(b.message),g(b)}finally{r===C.current&&T(!1)}},[t,R,h]),x=i.useCallback(async l=>{const r=await le(l,t);return _(r.run),N(r.availability),r.run},[t]);return i.useEffect(()=>{T(!0);const l=window.setTimeout(()=>{v(R)},Se);return()=>window.clearTimeout(l)},[v,R]),i.useEffect(()=>{if(!h){_(null);return}x(h)},[x,h]),i.useEffect(()=>{const l=k.current,r=()=>k.current!==l,o=t?`?projectId=${encodeURIComponent(t)}`:"";let y=!0;const b=()=>{!y||r()||(v(),h&&x(h))},M=oe(`/api/events${o}`,{events:{"research:run:created":b,"research:run:updated":b,"research:run:completed":b,"research:run:failed":b,"research:run:cancelled":b},onReconnect:b}),O=window.setInterval(b,we);return()=>{y=!1,M(),window.clearInterval(O)}},[t,v,h,x]),{runs:c,selectedRun:p,selectedRunId:h,setSelectedRunId:a,availability:j,loading:E,error:L,searchQuery:R,setSearchQuery:D,refresh:v,createRun:l=>fe(l,t),cancelRun:async l=>{try{g(null);const r=await be(l,t);return h===l&&_(r.run),await v(),r}catch(r){const o=Z(r,"Failed to cancel run");throw g(o),o}},retryRun:async l=>{try{g(null);const r=await me(l,t);return h===l&&_(r.run),await v(),r}catch(r){const o=Z(r,"Failed to retry run");throw g(o),o}},exportRun:(l,r)=>he(l,r,t),createTaskFromRun:(l,r,o,y,b,M)=>ue(l,{title:r,findingId:o,description:y,priority:b,attachExport:M},t),attachRunToTask:(l,r,o,y)=>de(l,{taskId:r,findingId:o,attachExport:y},t),uiError:F,runActionState:ke(p),statusCounts:c.reduce((l,r)=>(l[r.status]+=1,l),{queued:0,running:0,cancelling:0,retry_waiting:0,completed:0,failed:0,cancelled:0,timed_out:0,retry_exhausted:0})}}function Ce({open:n,mode:t,run:c,finding:f,projectId:h,onClose:a,onConfirm:p}){xe(n);const[_,j]=i.useState(!1),[N,E]=i.useState(""),[T,L]=i.useState(""),[P,F]=i.useState("normal"),[g,R]=i.useState(""),[D,C]=i.useState([]),[k,S]=i.useState(!1),[v,x]=i.useState(!1),l=i.useMemo(()=>{const r=(f.content??"").split(/(?<=[.!?])\s+/)[0]??"";return`${f.heading||"Research finding"} — ${r}`.trim()},[f.content,f.heading]);return i.useEffect(()=>{n&&(j(!1),E(`Research: ${f.heading||c.title}`),L(l),F("normal"),R(""),t==="enrich"&&(S(!0),pe(50,0,h).then(r=>C(r.filter(o=>o.column!=="archived"))).finally(()=>S(!1))))},[n,t,h,f.heading,l,c.title]),n?e.jsx("div",{className:"modal-overlay open",role:"presentation",onClick:a,children:e.jsxs("div",{className:"modal modal-lg research-task-action-modal",role:"dialog","aria-modal":"true",onClick:r=>r.stopPropagation(),children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("h3",{children:t==="create"?"Create task from finding":"Enrich existing task"}),e.jsx("button",{className:"modal-close",type:"button","aria-label":"Close",onClick:a,children:"×"})]}),e.jsxs("div",{className:"research-task-action-modal__body",children:[e.jsxs("div",{className:"card research-task-action-modal__preview",children:[e.jsxs("p",{children:[e.jsx("strong",{children:"Run:"})," ",c.id]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Finding:"})," ",f.id,f.heading?` — ${f.heading}`:""]}),e.jsx("p",{children:l||"No preview available."})]}),t==="create"?e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"research-task-action-modal__field",children:["Title",e.jsx("input",{className:"input",value:N,onChange:r=>E(r.target.value)})]}),e.jsxs("label",{className:"research-task-action-modal__field",children:["Description",e.jsx("textarea",{className:"input research-task-action-modal__textarea",value:T,onChange:r=>L(r.target.value)})]}),e.jsxs("label",{className:"research-task-action-modal__field",children:["Priority",e.jsxs("select",{className:"select",value:P,onChange:r=>F(r.target.value),children:[e.jsx("option",{value:"low",children:"Low"}),e.jsx("option",{value:"normal",children:"Normal"}),e.jsx("option",{value:"high",children:"High"}),e.jsx("option",{value:"urgent",children:"Urgent"})]})]})]}):e.jsxs("label",{className:"research-task-action-modal__field",children:["Target task",e.jsx("input",{className:"input",list:"research-task-action-task-list",value:g,placeholder:k?"Loading tasks…":"Enter task ID",onChange:r=>R(r.target.value)}),e.jsx("datalist",{id:"research-task-action-task-list",children:D.map(r=>e.jsx("option",{value:r.id,children:r.title},r.id))})]}),e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:_,onChange:r=>j(r.target.checked)}),e.jsx("span",{children:"Attach markdown export artifact"})]})]}),e.jsxs("div",{className:"modal-actions",children:[e.jsx("button",{className:"btn",type:"button",onClick:a,children:"Cancel"}),e.jsx("button",{className:"btn btn-primary",type:"button",disabled:v||t==="enrich"&&!g,onClick:()=>{x(!0),p({taskId:t==="enrich"?g:void 0,title:t==="create"?N.trim():void 0,description:t==="create"?T.trim():void 0,priority:t==="create"?P:void 0,attachExport:_}).finally(()=>x(!1))},children:t==="create"?"Create Task":"Enrich Task"})]})]})}):null}const Te=["web-search","page-fetch","github","local-docs","llm-synthesis"],Pe={"web-search":"webSearch","page-fetch":"pageFetch",github:"github","local-docs":"localDocs","llm-synthesis":"llmSynthesis"},Ae={"web-search":"Web Search","page-fetch":"Page Fetch",github:"GitHub","local-docs":"Local Docs","llm-synthesis":"LLM Synthesis"};function qe({projectId:n,addToast:t,onOpenSettings:c,readinessVersion:f=0}){const{runs:h,selectedRun:a,selectedRunId:p,setSelectedRunId:_,availability:j,loading:N,error:E,searchQuery:T,setSearchQuery:L,createRun:P,cancelRun:F,retryRun:g,exportRun:R,createTaskFromRun:D,attachRunToTask:C,statusCounts:k,refresh:S,uiError:v,runActionState:x}=Ee({projectId:n}),[l,r]=i.useState(""),[o,y]=i.useState(()=>X(void 0)),[b,M]=i.useState([]),[O,V]=i.useState(!1),[ee,se]=i.useState([]),[A,U]=i.useState(null),[I,$]=i.useState(null),z=j.supportedProviders??Te,B=o.searchProvider,Q=s=>s==="web-search"?!0:o.enabledSources[Pe[s]];i.useEffect(()=>{const s=z.filter(d=>Q(d));se(d=>{const m=d.filter(u=>s.includes(u));return m.length>0?m:s})},[o.enabledSources,z]),i.useEffect(()=>{let s=!1;return Promise.all([ye(n),je().catch(()=>({providers:[]}))]).then(([d,m])=>{s||(y(X(d)),M(m.providers.filter(u=>u.type==="api_key").map(u=>({id:u.id,authenticated:u.authenticated}))))}).catch(()=>{s||y(X(void 0))}),()=>{s=!0}},[n,f]);const ae=i.useMemo(()=>a?a.status:"No run selected",[a]),ne=i.useMemo(()=>a?a.status==="queued"||a.status==="retry_waiting"?"status-dot status-dot--pending":a.status==="running"?"status-dot status-dot--connecting":a.status==="completed"?"status-dot status-dot--online":a.status==="failed"||a.status==="cancelled"?"status-dot status-dot--error":"status-dot":"status-dot",[a]),K=j.supportedExportFormats??["markdown","json","html"],W=i.useMemo(()=>new Map(b.map(s=>[s.id,s.authenticated])),[b]),Y=i.useMemo(()=>{const s=new Set;return o.enabledSources.webSearch&&B&&s.add(B),o.enabledSources.llmSynthesis&&o.synthesisProvider&&s.add(o.synthesisProvider),[...s].filter(d=>W.has(d))},[o.enabledSources.llmSynthesis,o.enabledSources.webSearch,o.synthesisProvider,B,W]).find(s=>W.get(s)!==!0),q=i.useMemo(()=>j.available?o.enabled?Y?{reason:`Missing API key for ${Y}.`,details:"Add provider credentials in Authentication settings.",settingsSection:"authentication"}:null:{reason:"Research is disabled for this project.",details:"Enable project research settings to create runs.",settingsSection:"research-project"}:{reason:j.reason??"Research is unavailable for this project.",details:j.setupInstructions,settingsSection:"research-project"},[j.available,j.reason,j.setupInstructions,o.enabled,Y]),G=async(s,d,m)=>{U(s);try{await d(),t?.(m,"success"),await S()}catch(u){t?.(u instanceof Error?u.message:"Action failed","error")}finally{U(null)}},J=async s=>{if(a){U(`export-${s}`);try{const d=await R(a.id,s),m=new Blob([d.content],{type:"text/plain;charset=utf-8"}),u=URL.createObjectURL(m),w=document.createElement("a");w.href=u,w.download=d.filename,document.body.appendChild(w),w.click(),w.remove(),URL.revokeObjectURL(u),t?.(`Exported ${d.filename}`,"success")}catch(d){t?.(d instanceof Error?d.message:"Export failed","error")}finally{U(null)}}},ie=async()=>{if(l.trim()){V(!0);try{const s=ee.filter(m=>Q(m));if(s.length===0){V(!1),t?.("No enabled research sources are available for this project.","error");return}const d=await P({query:l.trim(),providers:s});_(d.run.id),r(""),t?.("Research run created","success"),await S()}catch(s){t?.(s instanceof Error?s.message:"Failed to create run","error")}finally{V(!1)}}};return e.jsxs("section",{className:"research-view","aria-label":"Research view",children:[e.jsxs("header",{className:"research-view__header",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"research-view__title",children:"Research"}),e.jsx("p",{className:"research-view__subtitle",children:"Cited search and synthesis runs: gather sources, fetch content, and synthesize findings."})]}),e.jsx("div",{className:"research-view__header-actions",children:e.jsx("button",{className:"btn",type:"button",onClick:()=>void S(),children:"Refresh"})})]}),q?e.jsxs("div",{className:"research-view__state research-view__state--error card","data-testid":"research-state-unavailable",children:[e.jsx("p",{children:q.reason}),q.details&&e.jsx("p",{children:q.details}),e.jsxs("p",{children:["Current defaults: provider ",o.searchProvider??"(not set)",", max sources ",o.limits.maxSourcesPerRun]}),e.jsxs("div",{className:"research-view__actions",children:[e.jsx("button",{className:"btn",type:"button",onClick:()=>void S(),children:"Refresh"}),e.jsx("button",{className:"btn btn-primary",type:"button",onClick:()=>c?.(q.settingsSection),children:"Open Settings"})]})]}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:"research-view__layout",children:[e.jsx("aside",{className:"research-view__sidebar card",children:e.jsxs("div",{className:"research-view__sidebar-content",children:[e.jsxs("div",{className:"research-view__form",children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"research-query",children:"Query"}),e.jsx("textarea",{id:"research-query",className:"input research-view__textarea",value:l,onChange:s=>r(s.target.value)})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:"Providers"}),e.jsx("div",{className:"research-view__providers",children:z.map(s=>{const d=Q(s),m=s==="web-search";return e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:m||ee.includes(s),disabled:m||!d,onChange:()=>{m||!d||se(u=>u.includes(s)?u.filter(w=>w!==s):[...u,s])}}),e.jsxs("span",{children:[Ae[s]??s,m?e.jsx("span",{className:"research-view__provider-lock",children:"Always on"}):null]})]},s)})})]}),e.jsxs("button",{className:"btn btn-primary",type:"button",disabled:!l.trim()||O,onClick:()=>void ie(),children:[O?e.jsx(ge,{className:"animate-spin",size:14}):null,"Create Run"]})]}),e.jsxs("div",{className:"research-view__history-header form-group",children:[e.jsx("label",{htmlFor:"research-run-search",children:"Search"}),e.jsxs("div",{className:"research-view__history-search-row",children:[e.jsx(_e,{size:14}),e.jsx("input",{id:"research-run-search",className:"input",placeholder:"Search runs",value:T,onChange:s=>L(s.target.value)})]})]}),e.jsx("div",{className:"research-view__history","data-testid":"research-state-running",children:h.map(s=>e.jsxs("button",{type:"button",className:`research-view__history-item card${p===s.id?" research-view__history-item--active":""}`,onClick:()=>_(s.id),children:[e.jsx("span",{className:"card-id",children:s.id}),e.jsx("span",{children:s.title})]},s.id))})]})}),e.jsxs("div",{className:"research-view__reader card",children:[N&&e.jsx("p",{"data-testid":"research-state-loading",children:"Loading research runs…"}),!N&&E&&e.jsx("p",{"data-testid":"research-state-error",children:E}),!N&&!E&&h.length===0&&e.jsx("p",{"data-testid":"research-state-empty",children:"No research runs yet"}),e.jsxs("div",{className:"research-view__reader-content",children:[a&&e.jsxs("div",{className:"research-view__run-detail",children:[e.jsxs("div",{className:"research-view__status-row",children:[e.jsx("span",{className:ne}),e.jsx("strong",{children:ae})]}),e.jsx("h3",{className:"research-view__run-title",children:a.title}),e.jsx("p",{className:"research-view__run-query",children:a.query}),e.jsx("p",{className:"research-view__run-summary","data-testid":"research-state-results",children:a.results?.summary??"No summary yet."}),e.jsxs("div",{className:"research-view__actions",children:[e.jsx("button",{className:"btn",type:"button",title:x.cancelable?void 0:x.blockingReason,disabled:A==="cancel"||A==="retry"||!x.cancelable,onClick:()=>void G("cancel",()=>F(a.id),"Run cancelled"),children:"Cancel"}),e.jsx("button",{className:"btn",type:"button",title:x.retryable?void 0:x.blockingReason,disabled:A==="cancel"||A==="retry"||!x.retryable,onClick:()=>void G("retry",()=>g(a.id),"Run retried"),children:"Retry"}),K.includes("markdown")&&e.jsx("button",{className:"btn",type:"button",disabled:A==="export-markdown",onClick:()=>void J("markdown"),children:"Export MD"}),K.includes("json")&&e.jsx("button",{className:"btn",type:"button",disabled:A==="export-json",onClick:()=>void J("json"),children:"Export JSON"}),K.includes("html")&&e.jsx("button",{className:"btn",type:"button",disabled:A==="export-html",onClick:()=>void J("html"),children:"Export HTML"})]}),a.error&&e.jsx("p",{className:"research-view__error",children:a.error}),v&&e.jsxs("div",{className:"form-error",role:"alert",children:[e.jsx("p",{children:v.message}),v.setupHint&&e.jsx("p",{children:v.setupHint}),v.code==="MISSING_CREDENTIALS"&&e.jsx("button",{className:"btn btn-sm",type:"button",onClick:()=>c?.("authentication"),children:"Open Authentication Settings"}),v.code==="FEATURE_DISABLED"&&e.jsx("button",{className:"btn btn-sm",type:"button",onClick:()=>c?.("research-project"),children:"Open Research Settings"})]}),x.blockingReason&&e.jsx("p",{className:"research-view__run-query",children:x.blockingReason}),Array.isArray(a.results?.findings)&&a.results.findings.length>0&&e.jsx("div",{className:"research-view__findings",children:a.results.findings.map((s,d)=>{const u=s.id?.trim()||`finding-${d+1}`;return e.jsxs("article",{className:"research-view__finding card",children:[e.jsx("h4",{children:s.heading}),e.jsx("p",{children:s.content}),e.jsxs("div",{className:"research-view__actions research-view__finding-actions",children:[e.jsx("button",{className:"btn btn-primary btn-sm",type:"button",onClick:()=>$({mode:"create",findingId:u}),children:"Create Task"}),e.jsx("button",{className:"btn btn-sm",type:"button",onClick:()=>$({mode:"enrich",findingId:u}),children:"Enrich Task"})]})]},u)})}),Array.isArray(a.results?.citations)&&a.results.citations.length>0&&e.jsx("ul",{className:"research-view__citations",children:a.results.citations.map(s=>e.jsx("li",{children:e.jsx("a",{href:s,target:"_blank",rel:"noreferrer",children:s})},s))}),a.events.length>0&&e.jsxs("details",{children:[e.jsx("summary",{children:"Run history"}),e.jsx("ul",{className:"research-view__events",children:a.events.map(s=>e.jsx("li",{children:s.message},s.id))})]})]}),!a&&h.length>0&&e.jsx("p",{children:"Select a run to view details."}),e.jsxs("div",{className:"research-view__stats",children:[e.jsxs("div",{className:"research-view__stat-card",children:[e.jsx("div",{className:"research-view__stat-label",children:"Running"}),e.jsx("div",{className:"research-view__stat-value",children:k.running})]}),e.jsxs("div",{className:"research-view__stat-card",children:[e.jsx("div",{className:"research-view__stat-label",children:"Completed"}),e.jsx("div",{className:"research-view__stat-value",children:k.completed})]}),e.jsxs("div",{className:"research-view__stat-card",children:[e.jsx("div",{className:"research-view__stat-label",children:"Failed"}),e.jsx("div",{className:"research-view__stat-value",children:k.failed})]})]})]})]})]})}),a&&I&&(()=>{const s=a.results?.findings?.findIndex((m,u)=>(m.id?.trim()||`finding-${u+1}`)===I.findingId)??-1,d=s>=0?a.results.findings[s]:null;return d?e.jsx(Ce,{open:!0,mode:I.mode,run:a,finding:{id:I.findingId,heading:d.heading,content:d.content},projectId:n,onClose:()=>$(null),onConfirm:async({taskId:m,title:u,description:w,priority:te,attachExport:re})=>{I.mode==="create"?await G("create-task",()=>D(a.id,u,I.findingId,w,te,re),"Task created from research"):m&&await G("attach-task",()=>C(a.id,m,I.findingId,re),"Task enriched from research"),$(null)}}):null})()]})}export{qe as ResearchView};
1
+ import{r as i,j as e}from"./vendor-react-K0fH_qHe.js";import{ax as ce,ay as le,s as oe,az as de,aA as ue,aB as he,aC as me,aD as be,aE as fe,ai as ve,u as xe,aF as pe,x as ye,aG as je,L as ge,S as _e}from"./index-DTFPgu6_.js";import"./vendor-xterm-DzcZoU0P.js";import"./vendor-codemirror-jBKmHyH0.js";const Re="builtin",H={pageFetch:!0,github:!1,localDocs:!0,llmSynthesis:!0};function X(n){const t=n?.researchGlobalDefaults,c=n?.researchSettings;return{enabled:c?.enabled??n?.researchEnabled??n?.researchGlobalEnabled??!0,searchProvider:c?.searchProvider??t?.searchProvider??n?.researchGlobalWebSearchProvider??Re,synthesisProvider:c?.synthesisProvider??t?.synthesisProvider,synthesisModelId:c?.synthesisModelId??t?.synthesisModelId,enabledSources:{webSearch:!0,pageFetch:c?.enabledSources?.pageFetch??t?.enabledSources?.pageFetch??H.pageFetch,github:c?.enabledSources?.github??t?.enabledSources?.github??H.github,localDocs:c?.enabledSources?.localDocs??t?.enabledSources?.localDocs??H.localDocs,llmSynthesis:c?.enabledSources?.llmSynthesis??t?.enabledSources?.llmSynthesis??H.llmSynthesis},limits:{maxConcurrentRuns:c?.limits?.maxConcurrentRuns??n?.researchMaxConcurrentRuns??n?.researchGlobalMaxConcurrentRuns??3,maxSourcesPerRun:c?.limits?.maxSourcesPerRun??t?.maxSourcesPerRun??n?.researchMaxSourcesPerRun??n?.researchGlobalMaxSourcesPerRun??20,maxDurationMs:c?.limits?.maxDurationMs??n?.researchDefaultTimeout??n?.researchGlobalDefaultTimeout??3e5,requestTimeoutMs:c?.limits?.requestTimeoutMs??n?.researchGlobalFetchTimeoutMs??3e4},defaultExportFormat:t?.defaultExportFormat??"markdown"}}const Se=300,we=4e3,Ne=["queued","running","cancelling","retry_waiting"];function Z(n,t){if(n instanceof ve){const c=n;return{message:n.message,status:n.status,code:c.researchCode??"INTERNAL_ERROR",setupHint:c.setupHint,retryable:c.retryable}}return n instanceof Error?{message:n.message,code:"INTERNAL_ERROR"}:{message:t,code:"INTERNAL_ERROR"}}function ke(n){if(!n)return{cancelable:!1,retryable:!1,isTransitioning:!1,blockingReason:"No run selected"};const t=Ne.includes(n.status),c=n.status==="queued"||n.status==="running",f=n.lifecycle?.retryable,h=n.status==="failed"||n.status==="timed_out",a=!!(h&&f);let p;return!c&&t?p="Run is already transitioning":!c&&n.status==="completed"?p="Completed runs cannot be cancelled":!c&&n.status==="cancelled"?p="Run is already cancelled":!c&&n.status==="retry_exhausted"?p="Retry attempts exhausted":!c&&n.status==="failed"?p="Failed runs cannot be cancelled":!c&&n.status==="timed_out"&&(p="Timed out runs cannot be cancelled"),!a&&h&&f===!1&&(p=n.lifecycle?.errorCode==="RETRY_EXHAUSTED"?"Retry attempts exhausted":"Run is not retryable"),{cancelable:c,retryable:a,isTransitioning:t,blockingReason:p}}function Ee(n){const t=n?.projectId,[c,f]=i.useState([]),[h,a]=i.useState(null),[p,_]=i.useState(null),[j,N]=i.useState({available:!0}),[E,T]=i.useState(!0),[L,P]=i.useState(null),[F,g]=i.useState(null),[R,D]=i.useState(""),C=i.useRef(0),k=i.useRef(0),S=i.useRef(t);i.useEffect(()=>{S.current!==t&&(S.current=t,k.current++)},[t]);const v=i.useCallback(async(l=R)=>{const r=++C.current,o=t;P(null),g(null);try{const y=await ce({q:l||void 0,limit:100},o);if(r!==C.current||o!==t)return;f(y.runs),N(y.availability),h&&!y.runs.some(b=>b.id===h)&&(a(null),_(null))}catch(y){if(r!==C.current||o!==t)return;const b=Z(y,"Failed to load research runs");P(b.message),g(b)}finally{r===C.current&&T(!1)}},[t,R,h]),x=i.useCallback(async l=>{const r=await le(l,t);return _(r.run),N(r.availability),r.run},[t]);return i.useEffect(()=>{T(!0);const l=window.setTimeout(()=>{v(R)},Se);return()=>window.clearTimeout(l)},[v,R]),i.useEffect(()=>{if(!h){_(null);return}x(h)},[x,h]),i.useEffect(()=>{const l=k.current,r=()=>k.current!==l,o=t?`?projectId=${encodeURIComponent(t)}`:"";let y=!0;const b=()=>{!y||r()||(v(),h&&x(h))},M=oe(`/api/events${o}`,{events:{"research:run:created":b,"research:run:updated":b,"research:run:completed":b,"research:run:failed":b,"research:run:cancelled":b},onReconnect:b}),O=window.setInterval(b,we);return()=>{y=!1,M(),window.clearInterval(O)}},[t,v,h,x]),{runs:c,selectedRun:p,selectedRunId:h,setSelectedRunId:a,availability:j,loading:E,error:L,searchQuery:R,setSearchQuery:D,refresh:v,createRun:l=>fe(l,t),cancelRun:async l=>{try{g(null);const r=await be(l,t);return h===l&&_(r.run),await v(),r}catch(r){const o=Z(r,"Failed to cancel run");throw g(o),o}},retryRun:async l=>{try{g(null);const r=await me(l,t);return h===l&&_(r.run),await v(),r}catch(r){const o=Z(r,"Failed to retry run");throw g(o),o}},exportRun:(l,r)=>he(l,r,t),createTaskFromRun:(l,r,o,y,b,M)=>ue(l,{title:r,findingId:o,description:y,priority:b,attachExport:M},t),attachRunToTask:(l,r,o,y)=>de(l,{taskId:r,findingId:o,attachExport:y},t),uiError:F,runActionState:ke(p),statusCounts:c.reduce((l,r)=>(l[r.status]+=1,l),{queued:0,running:0,cancelling:0,retry_waiting:0,completed:0,failed:0,cancelled:0,timed_out:0,retry_exhausted:0})}}function Ce({open:n,mode:t,run:c,finding:f,projectId:h,onClose:a,onConfirm:p}){xe(n);const[_,j]=i.useState(!1),[N,E]=i.useState(""),[T,L]=i.useState(""),[P,F]=i.useState("normal"),[g,R]=i.useState(""),[D,C]=i.useState([]),[k,S]=i.useState(!1),[v,x]=i.useState(!1),l=i.useMemo(()=>{const r=(f.content??"").split(/(?<=[.!?])\s+/)[0]??"";return`${f.heading||"Research finding"} — ${r}`.trim()},[f.content,f.heading]);return i.useEffect(()=>{n&&(j(!1),E(`Research: ${f.heading||c.title}`),L(l),F("normal"),R(""),t==="enrich"&&(S(!0),pe(50,0,h).then(r=>C(r.filter(o=>o.column!=="archived"))).finally(()=>S(!1))))},[n,t,h,f.heading,l,c.title]),n?e.jsx("div",{className:"modal-overlay open",role:"presentation",onClick:a,children:e.jsxs("div",{className:"modal modal-lg research-task-action-modal",role:"dialog","aria-modal":"true",onClick:r=>r.stopPropagation(),children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("h3",{children:t==="create"?"Create task from finding":"Enrich existing task"}),e.jsx("button",{className:"modal-close",type:"button","aria-label":"Close",onClick:a,children:"×"})]}),e.jsxs("div",{className:"research-task-action-modal__body",children:[e.jsxs("div",{className:"card research-task-action-modal__preview",children:[e.jsxs("p",{children:[e.jsx("strong",{children:"Run:"})," ",c.id]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Finding:"})," ",f.id,f.heading?` — ${f.heading}`:""]}),e.jsx("p",{children:l||"No preview available."})]}),t==="create"?e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"research-task-action-modal__field",children:["Title",e.jsx("input",{className:"input",value:N,onChange:r=>E(r.target.value)})]}),e.jsxs("label",{className:"research-task-action-modal__field",children:["Description",e.jsx("textarea",{className:"input research-task-action-modal__textarea",value:T,onChange:r=>L(r.target.value)})]}),e.jsxs("label",{className:"research-task-action-modal__field",children:["Priority",e.jsxs("select",{className:"select",value:P,onChange:r=>F(r.target.value),children:[e.jsx("option",{value:"low",children:"Low"}),e.jsx("option",{value:"normal",children:"Normal"}),e.jsx("option",{value:"high",children:"High"}),e.jsx("option",{value:"urgent",children:"Urgent"})]})]})]}):e.jsxs("label",{className:"research-task-action-modal__field",children:["Target task",e.jsx("input",{className:"input",list:"research-task-action-task-list",value:g,placeholder:k?"Loading tasks…":"Enter task ID",onChange:r=>R(r.target.value)}),e.jsx("datalist",{id:"research-task-action-task-list",children:D.map(r=>e.jsx("option",{value:r.id,children:r.title},r.id))})]}),e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:_,onChange:r=>j(r.target.checked)}),e.jsx("span",{children:"Attach markdown export artifact"})]})]}),e.jsxs("div",{className:"modal-actions",children:[e.jsx("button",{className:"btn",type:"button",onClick:a,children:"Cancel"}),e.jsx("button",{className:"btn btn-primary",type:"button",disabled:v||t==="enrich"&&!g,onClick:()=>{x(!0),p({taskId:t==="enrich"?g:void 0,title:t==="create"?N.trim():void 0,description:t==="create"?T.trim():void 0,priority:t==="create"?P:void 0,attachExport:_}).finally(()=>x(!1))},children:t==="create"?"Create Task":"Enrich Task"})]})]})}):null}const Te=["web-search","page-fetch","github","local-docs","llm-synthesis"],Pe={"web-search":"webSearch","page-fetch":"pageFetch",github:"github","local-docs":"localDocs","llm-synthesis":"llmSynthesis"},Ae={"web-search":"Web Search","page-fetch":"Page Fetch",github:"GitHub","local-docs":"Local Docs","llm-synthesis":"LLM Synthesis"};function qe({projectId:n,addToast:t,onOpenSettings:c,readinessVersion:f=0}){const{runs:h,selectedRun:a,selectedRunId:p,setSelectedRunId:_,availability:j,loading:N,error:E,searchQuery:T,setSearchQuery:L,createRun:P,cancelRun:F,retryRun:g,exportRun:R,createTaskFromRun:D,attachRunToTask:C,statusCounts:k,refresh:S,uiError:v,runActionState:x}=Ee({projectId:n}),[l,r]=i.useState(""),[o,y]=i.useState(()=>X(void 0)),[b,M]=i.useState([]),[O,V]=i.useState(!1),[ee,se]=i.useState([]),[A,U]=i.useState(null),[I,$]=i.useState(null),z=j.supportedProviders??Te,B=o.searchProvider,Q=s=>s==="web-search"?!0:o.enabledSources[Pe[s]];i.useEffect(()=>{const s=z.filter(d=>Q(d));se(d=>{const m=d.filter(u=>s.includes(u));return m.length>0?m:s})},[o.enabledSources,z]),i.useEffect(()=>{let s=!1;return Promise.all([ye(n),je().catch(()=>({providers:[]}))]).then(([d,m])=>{s||(y(X(d)),M(m.providers.filter(u=>u.type==="api_key").map(u=>({id:u.id,authenticated:u.authenticated}))))}).catch(()=>{s||y(X(void 0))}),()=>{s=!0}},[n,f]);const ae=i.useMemo(()=>a?a.status:"No run selected",[a]),ne=i.useMemo(()=>a?a.status==="queued"||a.status==="retry_waiting"?"status-dot status-dot--pending":a.status==="running"?"status-dot status-dot--connecting":a.status==="completed"?"status-dot status-dot--online":a.status==="failed"||a.status==="cancelled"?"status-dot status-dot--error":"status-dot":"status-dot",[a]),K=j.supportedExportFormats??["markdown","json","html"],W=i.useMemo(()=>new Map(b.map(s=>[s.id,s.authenticated])),[b]),Y=i.useMemo(()=>{const s=new Set;return o.enabledSources.webSearch&&B&&s.add(B),o.enabledSources.llmSynthesis&&o.synthesisProvider&&s.add(o.synthesisProvider),[...s].filter(d=>W.has(d))},[o.enabledSources.llmSynthesis,o.enabledSources.webSearch,o.synthesisProvider,B,W]).find(s=>W.get(s)!==!0),q=i.useMemo(()=>j.available?o.enabled?Y?{reason:`Missing API key for ${Y}.`,details:"Add provider credentials in Authentication settings.",settingsSection:"authentication"}:null:{reason:"Research is disabled for this project.",details:"Enable project research settings to create runs.",settingsSection:"research-project"}:{reason:j.reason??"Research is unavailable for this project.",details:j.setupInstructions,settingsSection:"research-project"},[j.available,j.reason,j.setupInstructions,o.enabled,Y]),G=async(s,d,m)=>{U(s);try{await d(),t?.(m,"success"),await S()}catch(u){t?.(u instanceof Error?u.message:"Action failed","error")}finally{U(null)}},J=async s=>{if(a){U(`export-${s}`);try{const d=await R(a.id,s),m=new Blob([d.content],{type:"text/plain;charset=utf-8"}),u=URL.createObjectURL(m),w=document.createElement("a");w.href=u,w.download=d.filename,document.body.appendChild(w),w.click(),w.remove(),URL.revokeObjectURL(u),t?.(`Exported ${d.filename}`,"success")}catch(d){t?.(d instanceof Error?d.message:"Export failed","error")}finally{U(null)}}},ie=async()=>{if(l.trim()){V(!0);try{const s=ee.filter(m=>Q(m));if(s.length===0){V(!1),t?.("No enabled research sources are available for this project.","error");return}const d=await P({query:l.trim(),providers:s});_(d.run.id),r(""),t?.("Research run created","success"),await S()}catch(s){t?.(s instanceof Error?s.message:"Failed to create run","error")}finally{V(!1)}}};return e.jsxs("section",{className:"research-view","aria-label":"Research view",children:[e.jsxs("header",{className:"research-view__header",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"research-view__title",children:"Research"}),e.jsx("p",{className:"research-view__subtitle",children:"Cited search and synthesis runs: gather sources, fetch content, and synthesize findings."})]}),e.jsx("div",{className:"research-view__header-actions",children:e.jsx("button",{className:"btn",type:"button",onClick:()=>void S(),children:"Refresh"})})]}),q?e.jsxs("div",{className:"research-view__state research-view__state--error card","data-testid":"research-state-unavailable",children:[e.jsx("p",{children:q.reason}),q.details&&e.jsx("p",{children:q.details}),e.jsxs("p",{children:["Current defaults: provider ",o.searchProvider??"(not set)",", max sources ",o.limits.maxSourcesPerRun]}),e.jsxs("div",{className:"research-view__actions",children:[e.jsx("button",{className:"btn",type:"button",onClick:()=>void S(),children:"Refresh"}),e.jsx("button",{className:"btn btn-primary",type:"button",onClick:()=>c?.(q.settingsSection),children:"Open Settings"})]})]}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:"research-view__layout",children:[e.jsx("aside",{className:"research-view__sidebar card",children:e.jsxs("div",{className:"research-view__sidebar-content",children:[e.jsxs("div",{className:"research-view__form",children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"research-query",children:"Query"}),e.jsx("textarea",{id:"research-query",className:"input research-view__textarea",value:l,onChange:s=>r(s.target.value)})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:"Providers"}),e.jsx("div",{className:"research-view__providers",children:z.map(s=>{const d=Q(s),m=s==="web-search";return e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:m||ee.includes(s),disabled:m||!d,onChange:()=>{m||!d||se(u=>u.includes(s)?u.filter(w=>w!==s):[...u,s])}}),e.jsxs("span",{children:[Ae[s]??s,m?e.jsx("span",{className:"research-view__provider-lock",children:"Always on"}):null]})]},s)})})]}),e.jsxs("button",{className:"btn btn-primary",type:"button",disabled:!l.trim()||O,onClick:()=>void ie(),children:[O?e.jsx(ge,{className:"animate-spin",size:14}):null,"Create Run"]})]}),e.jsxs("div",{className:"research-view__history-header form-group",children:[e.jsx("label",{htmlFor:"research-run-search",children:"Search"}),e.jsxs("div",{className:"research-view__history-search-row",children:[e.jsx(_e,{size:14}),e.jsx("input",{id:"research-run-search",className:"input",placeholder:"Search runs",value:T,onChange:s=>L(s.target.value)})]})]}),e.jsx("div",{className:"research-view__history","data-testid":"research-state-running",children:h.map(s=>e.jsxs("button",{type:"button",className:`research-view__history-item card${p===s.id?" research-view__history-item--active":""}`,onClick:()=>_(s.id),children:[e.jsx("span",{className:"card-id",children:s.id}),e.jsx("span",{children:s.title})]},s.id))})]})}),e.jsxs("div",{className:"research-view__reader card",children:[N&&e.jsx("p",{"data-testid":"research-state-loading",children:"Loading research runs…"}),!N&&E&&e.jsx("p",{"data-testid":"research-state-error",children:E}),!N&&!E&&h.length===0&&e.jsx("p",{"data-testid":"research-state-empty",children:"No research runs yet"}),e.jsxs("div",{className:"research-view__reader-content",children:[a&&e.jsxs("div",{className:"research-view__run-detail",children:[e.jsxs("div",{className:"research-view__status-row",children:[e.jsx("span",{className:ne}),e.jsx("strong",{children:ae})]}),e.jsx("h3",{className:"research-view__run-title",children:a.title}),e.jsx("p",{className:"research-view__run-query",children:a.query}),e.jsx("p",{className:"research-view__run-summary","data-testid":"research-state-results",children:a.results?.summary??"No summary yet."}),e.jsxs("div",{className:"research-view__actions",children:[e.jsx("button",{className:"btn",type:"button",title:x.cancelable?void 0:x.blockingReason,disabled:A==="cancel"||A==="retry"||!x.cancelable,onClick:()=>void G("cancel",()=>F(a.id),"Run cancelled"),children:"Cancel"}),e.jsx("button",{className:"btn",type:"button",title:x.retryable?void 0:x.blockingReason,disabled:A==="cancel"||A==="retry"||!x.retryable,onClick:()=>void G("retry",()=>g(a.id),"Run retried"),children:"Retry"}),K.includes("markdown")&&e.jsx("button",{className:"btn",type:"button",disabled:A==="export-markdown",onClick:()=>void J("markdown"),children:"Export MD"}),K.includes("json")&&e.jsx("button",{className:"btn",type:"button",disabled:A==="export-json",onClick:()=>void J("json"),children:"Export JSON"}),K.includes("html")&&e.jsx("button",{className:"btn",type:"button",disabled:A==="export-html",onClick:()=>void J("html"),children:"Export HTML"})]}),a.error&&e.jsx("p",{className:"research-view__error",children:a.error}),v&&e.jsxs("div",{className:"form-error",role:"alert",children:[e.jsx("p",{children:v.message}),v.setupHint&&e.jsx("p",{children:v.setupHint}),v.code==="MISSING_CREDENTIALS"&&e.jsx("button",{className:"btn btn-sm",type:"button",onClick:()=>c?.("authentication"),children:"Open Authentication Settings"}),v.code==="FEATURE_DISABLED"&&e.jsx("button",{className:"btn btn-sm",type:"button",onClick:()=>c?.("research-project"),children:"Open Research Settings"})]}),x.blockingReason&&e.jsx("p",{className:"research-view__run-query",children:x.blockingReason}),Array.isArray(a.results?.findings)&&a.results.findings.length>0&&e.jsx("div",{className:"research-view__findings",children:a.results.findings.map((s,d)=>{const u=s.id?.trim()||`finding-${d+1}`;return e.jsxs("article",{className:"research-view__finding card",children:[e.jsx("h4",{children:s.heading}),e.jsx("p",{children:s.content}),e.jsxs("div",{className:"research-view__actions research-view__finding-actions",children:[e.jsx("button",{className:"btn btn-primary btn-sm",type:"button",onClick:()=>$({mode:"create",findingId:u}),children:"Create Task"}),e.jsx("button",{className:"btn btn-sm",type:"button",onClick:()=>$({mode:"enrich",findingId:u}),children:"Enrich Task"})]})]},u)})}),Array.isArray(a.results?.citations)&&a.results.citations.length>0&&e.jsx("ul",{className:"research-view__citations",children:a.results.citations.map(s=>e.jsx("li",{children:e.jsx("a",{href:s,target:"_blank",rel:"noreferrer",children:s})},s))}),a.events.length>0&&e.jsxs("details",{children:[e.jsx("summary",{children:"Run history"}),e.jsx("ul",{className:"research-view__events",children:a.events.map(s=>e.jsx("li",{children:s.message},s.id))})]})]}),!a&&h.length>0&&e.jsx("p",{children:"Select a run to view details."}),e.jsxs("div",{className:"research-view__stats",children:[e.jsxs("div",{className:"research-view__stat-card",children:[e.jsx("div",{className:"research-view__stat-label",children:"Running"}),e.jsx("div",{className:"research-view__stat-value",children:k.running})]}),e.jsxs("div",{className:"research-view__stat-card",children:[e.jsx("div",{className:"research-view__stat-label",children:"Completed"}),e.jsx("div",{className:"research-view__stat-value",children:k.completed})]}),e.jsxs("div",{className:"research-view__stat-card",children:[e.jsx("div",{className:"research-view__stat-label",children:"Failed"}),e.jsx("div",{className:"research-view__stat-value",children:k.failed})]})]})]})]})]})}),a&&I&&(()=>{const s=a.results?.findings?.findIndex((m,u)=>(m.id?.trim()||`finding-${u+1}`)===I.findingId)??-1,d=s>=0?a.results.findings[s]:null;return d?e.jsx(Ce,{open:!0,mode:I.mode,run:a,finding:{id:I.findingId,heading:d.heading,content:d.content},projectId:n,onClose:()=>$(null),onConfirm:async({taskId:m,title:u,description:w,priority:te,attachExport:re})=>{I.mode==="create"?await G("create-task",()=>D(a.id,u,I.findingId,w,te,re),"Task created from research"):m&&await G("attach-task",()=>C(a.id,m,I.findingId,re),"Task enriched from research"),$(null)}}):null})()]})}export{qe as ResearchView};
@@ -1 +1 @@
1
- .theme-selector{padding:0 20px 20px}.theme-mode-toggle{display:flex;align-items:center;gap:var(--space-sm);background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:var(--space-xs);margin-bottom:20px}.theme-mode-btn{display:flex;align-items:center;justify-content:center;gap:6px;padding:var(--space-sm) var(--space-lg);background:none;border:none;border-radius:var(--radius-sm);color:var(--text-muted);font-size:13px;font-weight:500;cursor:pointer;transition:all var(--transition-fast);flex:1}.theme-mode-btn:hover{color:var(--text);background:var(--card-hover)}.theme-mode-btn.active,.theme-mode-btn.active:hover{background:var(--todo);color:var(--bg)}.theme-mode-btn:focus-visible{outline:none;border-color:var(--todo);box-shadow:var(--focus-ring-strong)}.theme-section-title{font-size:12px;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px;margin-bottom:var(--space-md)}.theme-font-size-toggle{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--space-sm);margin-bottom:var(--space-lg)}.theme-font-size-btn{align-items:center;background:var(--card);border:1px solid var(--border);border-radius:var(--radius-sm);color:var(--text-muted);cursor:pointer;display:inline-flex;font-size:13px;font-weight:500;justify-content:center;min-height:calc(var(--space-2xl) + var(--space-sm));padding:var(--space-sm) var(--space-md);transition:all var(--transition-fast)}.theme-font-size-btn:hover{border-color:var(--todo);color:var(--text)}.theme-font-size-btn.active{background:color-mix(in srgb,var(--todo) 14%,transparent);border-color:var(--todo);color:var(--text)}.theme-font-size-btn:focus-visible{outline:none;border-color:var(--todo);box-shadow:var(--focus-ring-strong)}.theme-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:var(--space-md)}@media(max-width:768px){.theme-grid{grid-template-columns:repeat(2,1fr)}}.theme-option{display:flex;flex-direction:column;align-items:center;gap:var(--space-sm);padding:var(--space-md);background:var(--card);border:2px solid var(--border);border-radius:var(--radius);cursor:pointer;transition:all var(--transition-fast)}.theme-option:hover{border-color:var(--todo);background:var(--card-hover)}.theme-option.active{border-color:var(--todo);background:color-mix(in srgb,var(--todo) 14%,transparent)}.theme-option:focus-visible{outline:none;border-color:var(--todo);box-shadow:var(--focus-ring-strong)}.theme-option-swatch{width:calc(var(--space-2xl) + var(--space-lg));height:calc(var(--space-2xl) + var(--space-lg));border-radius:var(--radius);border:2px solid var(--border);display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));overflow:hidden}.theme-option-swatch-sample{display:block;min-height:0}.theme-option-swatch-sample-1{background:var(--swatch-sample-1)}.theme-option-swatch-sample-2{background:var(--swatch-sample-2)}.theme-option-swatch-sample-3{background:var(--swatch-sample-3)}.theme-option-swatch-sample-4{background:var(--swatch-sample-4)}.theme-option-label{font-size:12px;font-weight:500;color:var(--text);text-align:center}.theme-swatch-default{--swatch-sample-1: #0d1117;--swatch-sample-2: #161b22;--swatch-sample-3: #58a6ff;--swatch-sample-4: #79c0ff}.theme-swatch-ocean{--swatch-sample-1: #0a1929;--swatch-sample-2: #132f4c;--swatch-sample-3: #4fc3f7;--swatch-sample-4: #00bcd4}.theme-swatch-forest{--swatch-sample-1: #0d2818;--swatch-sample-2: #1a472a;--swatch-sample-3: #4caf50;--swatch-sample-4: #2e7d32}.theme-swatch-sunset{--swatch-sample-1: #2d1f1f;--swatch-sample-2: #4a2c2c;--swatch-sample-3: #ff8a65;--swatch-sample-4: #ff7043}.theme-swatch-zen{--swatch-sample-1: #0c0c0c;--swatch-sample-2: #111111;--swatch-sample-3: #6b7b8c;--swatch-sample-4: #7a8590}.theme-swatch-berry{--swatch-sample-1: #1a0b2e;--swatch-sample-2: #2d1b4e;--swatch-sample-3: #c084fc;--swatch-sample-4: #ec4899}.theme-swatch-monochrome{--swatch-sample-1: #0d0d0d;--swatch-sample-2: #1a1a1a;--swatch-sample-3: #a3a3a3;--swatch-sample-4: #d4d4d4}.theme-swatch-slate{--swatch-sample-1: #1e293b;--swatch-sample-2: #334155;--swatch-sample-3: #60a5fa;--swatch-sample-4: #22d3ee}.theme-swatch-ash{--swatch-sample-1: #292524;--swatch-sample-2: #44403c;--swatch-sample-3: #a8a29e;--swatch-sample-4: #d6d3d1}.theme-swatch-graphite{--swatch-sample-1: #18181b;--swatch-sample-2: #27272a;--swatch-sample-3: #94a3b8;--swatch-sample-4: #cbd5e1}.theme-swatch-ember{--swatch-sample-1: #18181b;--swatch-sample-2: #27272a;--swatch-sample-3: #f97316;--swatch-sample-4: #ef4444}.theme-swatch-rust{--swatch-sample-1: #0f0b09;--swatch-sample-2: #1a1410;--swatch-sample-3: #e06830;--swatch-sample-4: #e88040}.theme-swatch-copper{--swatch-sample-1: #0e0c0a;--swatch-sample-2: #181410;--swatch-sample-3: #e89545;--swatch-sample-4: #f0a858}.theme-swatch-foundry{--swatch-sample-1: #0c0806;--swatch-sample-2: #15100c;--swatch-sample-3: #ffab20;--swatch-sample-4: #ffc040}.theme-swatch-carbon{--swatch-sample-1: #0a0b0d;--swatch-sample-2: #111318;--swatch-sample-3: #6a9acf;--swatch-sample-4: #7ab0e0}.theme-swatch-sandstone{--swatch-sample-1: #1a1712;--swatch-sample-2: #241f18;--swatch-sample-3: #d4a06a;--swatch-sample-4: #e0b080}.theme-swatch-lagoon{--swatch-sample-1: #0a1214;--swatch-sample-2: #101c1f;--swatch-sample-3: #50d8c0;--swatch-sample-4: #60e8d0}.theme-swatch-frost{--swatch-sample-1: #0c0e14;--swatch-sample-2: #121520;--swatch-sample-3: #8ac8f8;--swatch-sample-4: #9ad8ff}.theme-swatch-lavender{--swatch-sample-1: #14101a;--swatch-sample-2: #1c1624;--swatch-sample-3: #c8a0e8;--swatch-sample-4: #d8b0f0}.theme-swatch-neon-bloom{--swatch-sample-1: #120a18;--swatch-sample-2: #1a1024;--swatch-sample-3: #f080d0;--swatch-sample-4: #ff90e0}.theme-swatch-sepia{--swatch-sample-1: #161210;--swatch-sample-2: #201a16;--swatch-sample-3: #d8b878;--swatch-sample-4: #e8c888}.theme-swatch-silver{--swatch-sample-1: #27272a;--swatch-sample-2: #3f3f46;--swatch-sample-3: #94a3b8;--swatch-sample-4: #e2e8f0}.theme-swatch-high-contrast{--swatch-sample-1: #000000;--swatch-sample-2: #0a0a0a;--swatch-sample-3: #00ffff;--swatch-sample-4: #ffff00}.theme-swatch-industrial{--swatch-sample-1: #0c0c0c;--swatch-sample-2: #141414;--swatch-sample-3: #ff6b00;--swatch-sample-4: #ff8c00}.theme-swatch-solarized{--swatch-sample-1: #002b36;--swatch-sample-2: #073642;--swatch-sample-3: #268bd2;--swatch-sample-4: #2aa198}.theme-swatch-factory{--swatch-sample-1: #0a0a0a;--swatch-sample-2: #111111;--swatch-sample-3: #f59e0b;--swatch-sample-4: #06b6d4}.theme-swatch-ayu{--swatch-sample-1: #0f1419;--swatch-sample-2: #131d27;--swatch-sample-3: #39bae6;--swatch-sample-4: #ffb454}.theme-swatch-one-dark{--swatch-sample-1: #282c34;--swatch-sample-2: #21252b;--swatch-sample-3: #61afef;--swatch-sample-4: #00e5ff}.theme-swatch-nord{--swatch-sample-1: #2e3440;--swatch-sample-2: #3b4252;--swatch-sample-3: #88c0d0;--swatch-sample-4: #81a1c1}.theme-swatch-dracula{--swatch-sample-1: #282a36;--swatch-sample-2: #21222c;--swatch-sample-3: #8be9fd;--swatch-sample-4: #00e5ff}.theme-swatch-gruvbox{--swatch-sample-1: #282828;--swatch-sample-2: #1d2021;--swatch-sample-3: #83a598;--swatch-sample-4: #d3869b}.theme-swatch-tokyo-night{--swatch-sample-1: #1a1b26;--swatch-sample-2: #16161e;--swatch-sample-3: #7aa2f7;--swatch-sample-4: #00e5ff}.theme-swatch-catppuccin-mocha{--swatch-sample-1: #1e1e2e;--swatch-sample-2: #181825;--swatch-sample-3: #89b4fa;--swatch-sample-4: #89dceb}.theme-swatch-github-dark{--swatch-sample-1: #0d1117;--swatch-sample-2: #010409;--swatch-sample-3: #58a6ff;--swatch-sample-4: #79c0ff}.theme-swatch-everforest{--swatch-sample-1: #2d353b;--swatch-sample-2: #272e33;--swatch-sample-3: #7fbbb3;--swatch-sample-4: #e0c8a8}.theme-swatch-rose-pine{--swatch-sample-1: #191724;--swatch-sample-2: #1f1d2e;--swatch-sample-3: #c4a7e7;--swatch-sample-4: #ebbcba}.theme-swatch-kanagawa{--swatch-sample-1: #1f1f28;--swatch-sample-2: #16161d;--swatch-sample-3: #7e9cd8;--swatch-sample-4: #7e9cd8}.theme-swatch-night-owl{--swatch-sample-1: #011627;--swatch-sample-2: #01111d;--swatch-sample-3: #82aaff;--swatch-sample-4: #addb67}.theme-swatch-palenight{--swatch-sample-1: #292d3e;--swatch-sample-2: #1e2235;--swatch-sample-3: #82aaff;--swatch-sample-4: #ffcb6b}.theme-swatch-monokai-pro{--swatch-sample-1: #2d2a2e;--swatch-sample-2: #252229;--swatch-sample-3: #78dce8;--swatch-sample-4: #ff6188}.theme-swatch-slime{--swatch-sample-1: #0a0e09;--swatch-sample-2: #0f150d;--swatch-sample-3: #8aff40;--swatch-sample-4: #40e8a0}.theme-swatch-brutalist{--swatch-sample-1: #101010;--swatch-sample-2: #171717;--swatch-sample-3: #ff6a00;--swatch-sample-4: #ffd100}.theme-swatch-neon-city{--swatch-sample-1: #0d0d15;--swatch-sample-2: #121326;--swatch-sample-3: #ff2d95;--swatch-sample-4: #00f0ff}.theme-swatch-parchment{--swatch-sample-1: #1b1712;--swatch-sample-2: #252019;--swatch-sample-3: #d08a4b;--swatch-sample-4: #be6e3c}.theme-swatch-terminal{--swatch-sample-1: #0a0a0a;--swatch-sample-2: #0f120d;--swatch-sample-3: #33ff00;--swatch-sample-4: #8fff38}.theme-swatch-glass{--swatch-sample-1: #13111f;--swatch-sample-2: color-mix(in srgb, #221b34 78%, transparent);--swatch-sample-3: #c86bff;--swatch-sample-4: #ff7aa8}.theme-swatch-horizon{--swatch-sample-1: #1c1e26;--swatch-sample-2: #16161c;--swatch-sample-3: #e59371;--swatch-sample-4: #f08c42}.theme-swatch-vitesse{--swatch-sample-1: #121817;--swatch-sample-2: #0d1210;--swatch-sample-3: #4c9a91;--swatch-sample-4: #dca561}.theme-swatch-outrun{--swatch-sample-1: #0a0a14;--swatch-sample-2: #0d0d1a;--swatch-sample-3: #ff2d95;--swatch-sample-4: #b537f2}.theme-swatch-snazzy{--swatch-sample-1: #282a36;--swatch-sample-2: #1e1f29;--swatch-sample-3: #ff5c57;--swatch-sample-4: #5af78e}.theme-swatch-porple{--swatch-sample-1: #292d3e;--swatch-sample-2: #1e2030;--swatch-sample-3: #c792ea;--swatch-sample-4: #82aaff}.theme-swatch-espresso{--swatch-sample-1: #2c1f1a;--swatch-sample-2: #231813;--swatch-sample-3: #d4a574;--swatch-sample-4: #c17d56}.theme-swatch-mars{--swatch-sample-1: #1a1210;--swatch-sample-2: #140e0c;--swatch-sample-3: #c1440e;--swatch-sample-4: #e77d3d}.theme-swatch-poimandres{--swatch-sample-1: #1a1b26;--swatch-sample-2: #14151f;--swatch-sample-3: #89ddff;--swatch-sample-4: #5de4c7}[data-theme=light] .theme-swatch-factory{--swatch-sample-1: #f5f5f5;--swatch-sample-2: #ffffff;--swatch-sample-3: #d97706;--swatch-sample-4: #0891b2}[data-theme=light] .theme-swatch-ayu{--swatch-sample-1: #fafafa;--swatch-sample-2: #f3f3f3;--swatch-sample-3: #007acc;--swatch-sample-4: #ff8f40}[data-theme=light] .theme-swatch-zen{--swatch-sample-1: #f5f5f5;--swatch-sample-2: #fafafa;--swatch-sample-3: #5a6a7a;--swatch-sample-4: #6a757f}[data-theme=light] .theme-swatch-nord{--swatch-sample-1: #eceff4;--swatch-sample-2: #e5e9f0;--swatch-sample-3: #5e81ac;--swatch-sample-4: #5e81ac}[data-theme=light] .theme-swatch-dracula{--swatch-sample-1: #f8f8f2;--swatch-sample-2: #efeefa;--swatch-sample-3: #0097a7;--swatch-sample-4: #00bcd4}[data-theme=light] .theme-swatch-gruvbox{--swatch-sample-1: #fbf1c7;--swatch-sample-2: #f2e5bc;--swatch-sample-3: #076678;--swatch-sample-4: #8f3f71}[data-theme=light] .theme-swatch-tokyo-night{--swatch-sample-1: #e1e2e7;--swatch-sample-2: #d5d6db;--swatch-sample-3: #3b5ea5;--swatch-sample-4: #00bcd4}[data-theme=light] .theme-swatch-catppuccin-mocha{--swatch-sample-1: #eff1f5;--swatch-sample-2: #e6e9ef;--swatch-sample-3: #1e66f5;--swatch-sample-4: #04a5e5}[data-theme=light] .theme-swatch-github-dark{--swatch-sample-1: #ffffff;--swatch-sample-2: #f6f8fa;--swatch-sample-3: #0969da;--swatch-sample-4: #0969da}[data-theme=light] .theme-swatch-everforest{--swatch-sample-1: #fdf6e3;--swatch-sample-2: #f4f0d9;--swatch-sample-3: #3a94a5;--swatch-sample-4: #83a08a}[data-theme=light] .theme-swatch-rose-pine{--swatch-sample-1: #faf4ed;--swatch-sample-2: #fffaf3;--swatch-sample-3: #907aa9;--swatch-sample-4: #b4637a}[data-theme=light] .theme-swatch-kanagawa{--swatch-sample-1: #edeadd;--swatch-sample-2: #e1ddd4;--swatch-sample-3: #4e76b5;--swatch-sample-4: #4e76b5}[data-theme=light] .theme-swatch-one-dark{--swatch-sample-1: #fafafa;--swatch-sample-2: #f0f0f0;--swatch-sample-3: #4078f2;--swatch-sample-4: #0184bc}[data-theme=light] .theme-swatch-night-owl{--swatch-sample-1: #f6f7f9;--swatch-sample-2: #eef0f4;--swatch-sample-3: #2563eb;--swatch-sample-4: #5a9e2f}[data-theme=light] .theme-swatch-palenight{--swatch-sample-1: #f5f7fa;--swatch-sample-2: #ebeef5;--swatch-sample-3: #3b6fcf;--swatch-sample-4: #c49020}[data-theme=light] .theme-swatch-monokai-pro{--swatch-sample-1: #faf8f5;--swatch-sample-2: #f0ece5;--swatch-sample-3: #2d8fa0;--swatch-sample-4: #c4405e}[data-theme=light] .theme-swatch-slime{--swatch-sample-1: #f2f7ea;--swatch-sample-2: #e6efda;--swatch-sample-3: #3d8f10;--swatch-sample-4: #1a8a6a}[data-theme=light] .theme-swatch-brutalist{--swatch-sample-1: #ece9e4;--swatch-sample-2: #f7f4ef;--swatch-sample-3: #d9480f;--swatch-sample-4: #b8860b}[data-theme=light] .theme-swatch-neon-city{--swatch-sample-1: #f7f5ff;--swatch-sample-2: #f1edff;--swatch-sample-3: #cc166e;--swatch-sample-4: #008e9b}[data-theme=light] .theme-swatch-parchment{--swatch-sample-1: #f5f0e8;--swatch-sample-2: #efe7dc;--swatch-sample-3: #a8562f;--swatch-sample-4: #8f4e2a}[data-theme=light] .theme-swatch-terminal{--swatch-sample-1: #e7f5dd;--swatch-sample-2: #deefd2;--swatch-sample-3: #2d6b14;--swatch-sample-4: #4c8f25}[data-theme=light] .theme-swatch-glass{--swatch-sample-1: #eceaf5;--swatch-sample-2: color-mix(in srgb, #ffffff 75%, transparent);--swatch-sample-3: #9d40cf;--swatch-sample-4: #c74b7a}[data-theme=light] .theme-swatch-slate{--swatch-sample-1: #f1f5f9;--swatch-sample-2: #e2e8f0;--swatch-sample-3: #3b5ea5;--swatch-sample-4: #4f7090}[data-theme=light] .theme-swatch-ash{--swatch-sample-1: #fafaf9;--swatch-sample-2: #f5f5f4;--swatch-sample-3: #5a6a7a;--swatch-sample-4: #768694}[data-theme=light] .theme-swatch-graphite{--swatch-sample-1: #fafafa;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #6f7f90;--swatch-sample-4: #8a99aa}[data-theme=light] .theme-swatch-ember{--swatch-sample-1: #fafafa;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #d9480f;--swatch-sample-4: #e8646a}[data-theme=light] .theme-swatch-rust{--swatch-sample-1: #f5efe8;--swatch-sample-2: #ebe3d8;--swatch-sample-3: #a04020;--swatch-sample-4: #b85828}[data-theme=light] .theme-swatch-copper{--swatch-sample-1: #f3ede6;--swatch-sample-2: #e8e0d6;--swatch-sample-3: #905820;--swatch-sample-4: #a87030}[data-theme=light] .theme-swatch-foundry{--swatch-sample-1: #f5f0e6;--swatch-sample-2: #ebe4d6;--swatch-sample-3: #c07808;--swatch-sample-4: #d08a10}[data-theme=light] .theme-swatch-carbon{--swatch-sample-1: #eef0f4;--swatch-sample-2: #e2e6ec;--swatch-sample-3: #3a6090;--swatch-sample-4: #4878a0}[data-theme=light] .theme-swatch-sandstone{--swatch-sample-1: #f5f0e8;--swatch-sample-2: #ebe4d8;--swatch-sample-3: #a07040;--swatch-sample-4: #b08050}[data-theme=light] .theme-swatch-lagoon{--swatch-sample-1: #eef5f3;--swatch-sample-2: #e0ebe8;--swatch-sample-3: #208070;--swatch-sample-4: #289080}[data-theme=light] .theme-swatch-frost{--swatch-sample-1: #f0f4f8;--swatch-sample-2: #e4eaf0;--swatch-sample-3: #3078a8;--swatch-sample-4: #4088b8}[data-theme=light] .theme-swatch-lavender{--swatch-sample-1: #f4f0f8;--swatch-sample-2: #e8e2f0;--swatch-sample-3: #8060a0;--swatch-sample-4: #9070b0}[data-theme=light] .theme-swatch-neon-bloom{--swatch-sample-1: #f8f0f8;--swatch-sample-2: #f0e4f0;--swatch-sample-3: #a03090;--swatch-sample-4: #b040a0}[data-theme=light] .theme-swatch-sepia{--swatch-sample-1: #f5f0e4;--swatch-sample-2: #ece4d4;--swatch-sample-3: #907040;--swatch-sample-4: #a08050}[data-theme=light] .theme-swatch-silver{--swatch-sample-1: #fafafa;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #6b7280;--swatch-sample-4: #9ca3af}[data-theme=light] .theme-swatch-horizon{--swatch-sample-1: #fdf0ed;--swatch-sample-2: #f9cec0;--swatch-sample-3: #e8646a;--swatch-sample-4: #f08c42}[data-theme=light] .theme-swatch-vitesse{--swatch-sample-1: #f8f5f0;--swatch-sample-2: #efe9e0;--swatch-sample-3: #3a8578;--swatch-sample-4: #c08040}[data-theme=light] .theme-swatch-outrun{--swatch-sample-1: #f0f0f5;--swatch-sample-2: #e8e8ef;--swatch-sample-3: #d02080;--swatch-sample-4: #9030c8}[data-theme=light] .theme-swatch-snazzy{--swatch-sample-1: #fafafa;--swatch-sample-2: #f0f0f2;--swatch-sample-3: #d04040;--swatch-sample-4: #30a050}[data-theme=light] .theme-swatch-porple{--swatch-sample-1: #f5f3f7;--swatch-sample-2: #eae7ef;--swatch-sample-3: #9060d8;--swatch-sample-4: #4080c8}[data-theme=light] .theme-swatch-espresso{--swatch-sample-1: #f5ece4;--swatch-sample-2: #ebe1d6;--swatch-sample-3: #a07050;--swatch-sample-4: #906040}[data-theme=light] .theme-swatch-mars{--swatch-sample-1: #f5ece6;--swatch-sample-2: #ebe0d4;--swatch-sample-3: #a03010;--swatch-sample-4: #c06030}[data-theme=light] .theme-swatch-poimandres{--swatch-sample-1: #f0f0f5;--swatch-sample-2: #e6e6ee;--swatch-sample-3: #4090c0;--swatch-sample-4: #30a090}.theme-reset-btn{display:flex;align-items:center;justify-content:center;gap:var(--space-sm);margin-top:20px;padding:10px 16px;background:var(--card);border:1px solid var(--border);border-radius:var(--radius);color:var(--text-muted);font-size:13px;font-weight:500;cursor:pointer;transition:all var(--transition-fast);width:100%}.theme-reset-btn:hover{background:var(--card-hover);color:var(--text);border-color:var(--text-muted)}.theme-reset-btn:focus-visible{outline:none;border-color:var(--todo);box-shadow:var(--focus-ring-strong)}.theme-current-preview{display:flex;align-items:center;gap:var(--space-md);padding:var(--space-md) var(--space-lg);background:var(--card);border:1px solid var(--border);border-radius:var(--radius);margin-bottom:20px}.theme-preview-icon{display:flex;align-items:center;justify-content:center;width:40px;height:40px;background:var(--surface);border-radius:var(--radius);color:var(--todo)}.theme-preview-info{flex:1}.theme-preview-label{font-size:12px;color:var(--text-muted);margin-bottom:2px}.theme-preview-value{font-size:14px;font-weight:600;color:var(--text);text-transform:capitalize}@media(max-width:768px){.model-combobox-dropdown{max-height:50vh;width:min(360px,calc(100vw - 32px))}.model-combobox-search{font-size:16px}.model-combobox-option{min-height:36px}.theme-selector{padding:0 14px 14px}.theme-font-size-toggle{grid-template-columns:1fr}}.cli-binary-panel{display:flex;flex-direction:column;gap:12px;padding:0 var(--space-xl);margin-top:var(--space-lg);border:0;background:transparent}.cli-binary-header{display:flex;align-items:center;justify-content:space-between;gap:12px}.cli-binary-header .settings-section-heading{margin:0}.cli-binary-pill{display:inline-flex;align-items:center;padding:2px 10px;border-radius:999px;font-size:11px;font-weight:600;letter-spacing:.02em;text-transform:uppercase}.cli-binary-pill--ok{background:color-mix(in srgb,var(--color-success) 18%,transparent);color:var(--color-success);border:1px solid color-mix(in srgb,var(--color-success) 40%,transparent)}.cli-binary-pill--warn{background:color-mix(in srgb,var(--color-warning) 18%,transparent);color:var(--color-warning);border:1px solid color-mix(in srgb,var(--color-warning) 40%,transparent)}.cli-binary-pill--err{background:color-mix(in srgb,var(--color-error) 18%,transparent);color:var(--color-error);border:1px solid color-mix(in srgb,var(--color-error) 40%,transparent)}.cli-binary-help{color:var(--text-muted);line-height:1.4}.cli-binary-help code{background:color-mix(in srgb,var(--text) 6%,transparent);padding:1px 6px;border-radius:4px;font-size:.92em}.cli-binary-status-line{margin:0;color:var(--text-muted)}.cli-binary-status-line code{background:color-mix(in srgb,var(--text) 6%,transparent);padding:1px 6px;border-radius:4px}.cli-binary-detail{display:flex;flex-direction:column;gap:12px}.cli-binary-info-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px;font-size:13px}.cli-binary-info-list li{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.cli-binary-info-list span{color:var(--text-muted);min-width:64px}.cli-binary-info-list code{background:color-mix(in srgb,var(--text) 6%,transparent);padding:1px 6px;border-radius:4px;word-break:break-all}.cli-binary-expected{color:var(--text-muted);font-size:12px}.cli-binary-actions{display:flex;gap:8px;flex-wrap:wrap}.cli-binary-install-btn,.cli-binary-refresh-btn,.cli-binary-copy-btn{cursor:pointer;border-radius:6px;padding:6px 12px;font-size:13px;border:1px solid transparent;transition:background .15s ease,border-color .15s ease}.cli-binary-install-btn{background:var(--accent, #3b82f6);color:var(--accent-text)}.cli-binary-install-btn:hover:not(:disabled){background:var(--accent-hover, #2563eb)}.cli-binary-install-btn:disabled,.cli-binary-refresh-btn:disabled{opacity:.55;cursor:not-allowed}.cli-binary-refresh-btn,.cli-binary-copy-btn{background:color-mix(in srgb,var(--text) 4%,transparent);color:var(--text);border-color:color-mix(in srgb,var(--text) 12%,transparent)}.cli-binary-refresh-btn:hover:not(:disabled),.cli-binary-copy-btn:hover{background:color-mix(in srgb,var(--text) 8%,transparent)}.cli-binary-commands{display:flex;flex-direction:column;gap:6px}.cli-binary-commands label{font-size:12px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.04em}.cli-binary-command-row{display:flex;align-items:center;gap:8px;background:color-mix(in srgb,var(--bg) 25%,transparent);border:1px solid color-mix(in srgb,var(--text) 6%,transparent);border-radius:6px;padding:6px 8px 6px 12px}.cli-binary-command-row code{flex:1;font-family:var(--font-mono, ui-monospace, "SFMono-Regular", monospace);font-size:12.5px;color:var(--text-primary, #e6edf3);white-space:nowrap;overflow-x:auto}.cli-binary-install-log{border-top:1px solid color-mix(in srgb,var(--text) 6%,transparent);padding-top:10px;font-size:12.5px}.cli-binary-install-log summary{cursor:pointer;color:var(--text-muted)}.cli-binary-install-output{margin:6px 0 0;padding:8px 10px;background:color-mix(in srgb,var(--bg) 35%,transparent);border-radius:4px;max-height:220px;overflow:auto;white-space:pre-wrap;font-size:12px;line-height:1.4}.cli-binary-install-output--err{color:var(--color-error)}.cli-binary-permissions-hint{margin:6px 0;padding:8px 10px;background:color-mix(in srgb,var(--color-error) 10%,transparent);border-left:3px solid color-mix(in srgb,var(--color-error) 55%,transparent);border-radius:0 var(--radius-sm) var(--radius-sm) 0;color:var(--color-error);font-size:12.5px;line-height:1.5}.prompt-manager{display:flex;flex-direction:column;gap:var(--space-md);padding:0 var(--space-xl);margin-top:var(--space-md)}.prompt-manager-tabs{display:flex;gap:var(--space-xs);border-bottom:1px solid var(--border);padding-bottom:var(--space-sm)}.prompt-manager-tab{display:inline-flex;align-items:center;gap:var(--space-xs);padding:var(--space-sm) var(--space-md);background:none;border:1px solid transparent;border-radius:var(--radius-md);color:var(--text-muted);font-size:13px;cursor:pointer;transition:all var(--transition-fast)}.prompt-manager-tab:hover{color:var(--text);background:var(--surface)}.prompt-manager-tab:focus-visible{outline:none;box-shadow:var(--focus-ring-strong);border-color:var(--todo)}.prompt-manager-tab.active{color:var(--text);background:var(--surface);border-color:var(--border)}.prompt-manager-content{min-height:200px}.prompt-manager-templates-tab,.prompt-manager-assignments-tab,.prompt-manager-overrides-tab{display:flex;flex-direction:column;gap:var(--space-lg)}.prompt-template-section{display:flex;flex-direction:column;gap:var(--space-md)}.prompt-template-section-title{font-size:14px;font-weight:600;color:var(--text);margin:0}.prompt-template-section-desc{font-size:12px;color:var(--text-muted);margin:0}.prompt-template-list{display:flex;flex-direction:column;gap:var(--space-md)}.prompt-template-card{padding:var(--space-md);background:var(--card);border:1px solid var(--border);border-radius:var(--radius-md);transition:border-color var(--transition-fast)}.prompt-template-card:hover{border-color:var(--text-dim)}.prompt-template-card-header{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--space-md);margin-bottom:var(--space-sm)}.prompt-template-card-info{display:flex;align-items:center;flex-wrap:wrap;gap:var(--space-sm)}.prompt-template-card-name{font-weight:600;color:var(--text);font-size:14px}.prompt-template-badge-built-in,.prompt-template-badge-custom,.prompt-template-badge-override{display:inline-flex;align-items:center;padding:calc(var(--space-xs) * .5) calc(var(--space-xs) * 1.5);font-size:10px;font-weight:500;border-radius:var(--radius-sm);text-transform:uppercase;letter-spacing:.02em}.prompt-template-badge-built-in{background:var(--surface);color:var(--text-muted);border:1px solid var(--border)}.prompt-template-badge-custom{background:color-mix(in srgb,var(--color-info) 15%,transparent);color:var(--color-info)}.prompt-template-badge-override{background:color-mix(in srgb,var(--color-warning) 15%,transparent);color:var(--color-warning)}.prompt-template-badge-role{display:inline-flex;align-items:center;padding:calc(var(--space-xs) * .5) calc(var(--space-xs) * 1.5);font-size:10px;font-weight:500;border-radius:var(--radius-sm)}.prompt-template-badge-built-in,.prompt-template-badge-role,.prompt-role-badge{--prompt-role-color: var(--color-muted)}.prompt-role-tone--executor{--prompt-role-color: var(--todo)}.prompt-role-tone--triage{--prompt-role-color: var(--triage)}.prompt-role-tone--reviewer{--prompt-role-color: var(--in-review)}.prompt-role-tone--merger{--prompt-role-color: var(--done)}.prompt-role-tone--scheduler{--prompt-role-color: var(--color-info)}.prompt-role-tone--engineer{--prompt-role-color: var(--color-warning)}.prompt-role-tone--custom{--prompt-role-color: var(--color-muted)}.prompt-template-badge-role,.prompt-role-badge{background:color-mix(in srgb,var(--prompt-role-color) 15%,transparent);color:var(--prompt-role-color)}.prompt-template-badge-built-in.prompt-role-tone--executor,.prompt-template-badge-built-in.prompt-role-tone--triage,.prompt-template-badge-built-in.prompt-role-tone--reviewer,.prompt-template-badge-built-in.prompt-role-tone--merger,.prompt-template-badge-built-in.prompt-role-tone--scheduler,.prompt-template-badge-built-in.prompt-role-tone--engineer,.prompt-template-badge-built-in.prompt-role-tone--custom{border-color:var(--prompt-role-color)}.prompt-template-card-actions{display:flex;gap:var(--space-xs)}.prompt-template-card-actions .btn-icon{padding:var(--space-xs)}.prompt-template-card-description{font-size:12px;color:var(--text-muted);margin:0 0 var(--space-sm) 0;line-height:1.4}.prompt-template-card-preview{background:var(--surface);border-radius:var(--radius-sm);padding:var(--space-sm);overflow:hidden}.prompt-template-card-preview code{font-size:calc(var(--space-sm) + var(--space-xs) * .75);color:var(--text-muted);font-family:var(--font-mono);white-space:pre-wrap;word-break:break-word;display:block;max-height:120px;overflow-y:auto}.prompt-template-empty{padding:var(--space-lg);text-align:center;color:var(--text-muted);font-size:13px;background:var(--surface);border:1px dashed var(--border);border-radius:var(--radius-md)}.prompt-template-add-btn{align-self:flex-start;margin-top:var(--space-sm)}.prompt-template-editor{padding:var(--space-lg);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);margin-bottom:var(--space-lg)}.prompt-template-editor-title{font-size:14px;font-weight:600;color:var(--text);margin:0 0 var(--space-md) 0}.prompt-template-editor-fields{display:flex;flex-direction:column;gap:var(--space-md)}.prompt-template-field{display:flex;flex-direction:column;gap:var(--space-xs)}.prompt-template-field label{font-size:12px;font-weight:500;color:var(--text-muted)}.prompt-template-field input,.prompt-template-field select,.prompt-template-prompt-textarea{padding:var(--space-sm) var(--space-md);background:var(--bg);border:1px solid var(--border);border-radius:var(--radius-md);color:var(--text);font-size:13px;transition:border-color var(--transition-fast)}.prompt-template-field input:focus,.prompt-template-field select:focus,.prompt-template-prompt-textarea:focus{outline:none;border-color:var(--todo)}.prompt-template-prompt-textarea{font-family:var(--font-mono);font-size:12px;line-height:1.5;resize:vertical;min-height:120px}.prompt-template-error{padding:var(--space-sm);background:color-mix(in srgb,var(--color-error) 10%,transparent);border:1px solid var(--color-error);border-radius:var(--radius-sm);color:var(--color-error);font-size:12px}.prompt-template-editor-actions{display:flex;gap:var(--space-sm);justify-content:flex-end;margin-top:var(--space-sm)}.prompt-template-delete-confirm{padding:var(--space-md);background:color-mix(in srgb,var(--color-error) 10%,transparent);border:1px solid var(--color-error);border-radius:var(--radius-md);display:flex;flex-direction:column;gap:var(--space-sm)}.prompt-template-delete-confirm p{margin:0;font-size:13px;color:var(--text)}.prompt-template-delete-actions{display:flex;gap:var(--space-sm)}.prompt-assignments-desc{font-size:12px;color:var(--text-muted);margin:0}.prompt-role-assignment-list{display:flex;flex-direction:column;gap:var(--space-md)}.prompt-role-assignment-row{display:flex;align-items:center;justify-content:space-between;gap:var(--space-lg);padding:var(--space-md);background:var(--card);border:1px solid var(--border);border-radius:var(--radius-md)}.prompt-role-assignment-label{display:flex;align-items:center;gap:var(--space-md)}.prompt-role-badge{display:inline-flex;align-items:center;padding:var(--space-xs) var(--space-sm);font-size:12px;font-weight:600;border-radius:var(--radius-sm)}.prompt-role-assignment-status{font-size:12px;color:var(--text-muted)}.prompt-role-select{min-width:200px;padding:var(--space-sm) var(--space-md);background:var(--bg);border:1px solid var(--border);border-radius:var(--radius-md);color:var(--text);font-size:13px;cursor:pointer}.prompt-role-select:focus{outline:none;border-color:var(--todo)}.prompt-role-select:focus-visible{outline:none;border-color:var(--todo);box-shadow:var(--focus-ring-strong)}.prompt-assignments-note{margin-top:var(--space-md);padding:var(--space-md);background:var(--surface);border-radius:var(--radius-md);font-size:12px;color:var(--text-muted);line-height:1.5}.prompt-assignments-note strong{color:var(--text)}.prompt-overrides-desc{font-size:12px;color:var(--text-muted);margin:0}.prompt-overrides-list{display:flex;flex-direction:column;gap:var(--space-md)}.prompt-override-item{background:var(--card);border:1px solid var(--border);border-radius:var(--radius-md);overflow:hidden}.prompt-override-header{display:flex;align-items:center;justify-content:space-between;padding:var(--space-md);cursor:pointer;transition:background var(--transition-fast)}.prompt-override-header:hover{background:var(--card-hover)}.prompt-override-info{display:flex;align-items:center;flex-wrap:wrap;gap:var(--space-sm);flex:1;min-width:0;border:none;background:none;color:inherit;padding:0;text-align:left;font:inherit;cursor:pointer;border-radius:var(--radius-sm)}.prompt-override-info:focus-visible{outline:none;box-shadow:var(--focus-ring-strong)}.prompt-override-name{font-weight:600;color:var(--text);font-size:13px}.prompt-override-key{font-size:11px;font-family:var(--font-mono);color:var(--text-muted);padding:calc(var(--space-xs) * .5) var(--space-xs);background:var(--surface);border-radius:var(--radius-sm)}.prompt-override-badge{display:inline-flex;align-items:center;padding:calc(var(--space-xs) * .5) calc(var(--space-xs) * 1.5);font-size:10px;font-weight:500;background:color-mix(in srgb,var(--color-warning) 15%,transparent);color:var(--color-warning);border-radius:var(--radius-sm)}.prompt-override-expand-btn{display:flex;align-items:center;justify-content:center;width:var(--space-xl);height:var(--space-xl);background:none;border:none;color:var(--text-muted);cursor:pointer;border-radius:var(--radius-sm);transition:color var(--transition-fast),background var(--transition-fast)}.prompt-override-expand-btn:hover{color:var(--text);background:var(--surface)}.prompt-override-expand-btn:focus-visible{outline:none;box-shadow:var(--focus-ring-strong);color:var(--text);background:var(--surface)}.prompt-override-description{font-size:12px;color:var(--text-muted);margin:0;padding:0 var(--space-md) var(--space-md);line-height:1.4}.prompt-override-editor{padding:var(--space-md);border-top:1px solid var(--border);background:var(--surface);display:flex;flex-direction:column;gap:var(--space-sm)}.prompt-override-textarea{padding:var(--space-sm) var(--space-md);background:var(--bg);border:1px solid var(--border);border-radius:var(--radius-md);color:var(--text);font-size:12px;font-family:var(--font-mono);line-height:1.5;resize:vertical;min-height:calc(var(--space-xl) * 3 + var(--space-sm));transition:border-color var(--transition-fast)}.prompt-override-textarea:focus{outline:none;border-color:var(--todo)}.prompt-override-footer{display:flex;align-items:center;gap:var(--space-md)}.prompt-override-hint{font-size:calc(var(--space-sm) + var(--space-xs) * .75);color:var(--text-muted)}.prompt-override-header-actions{display:flex;align-items:center;gap:var(--space-xs)}.prompt-override-fullscreen-btn{display:flex;align-items:center;justify-content:center;width:var(--space-xl);height:var(--space-xl);background:none;border:none;color:var(--text-muted);cursor:pointer;border-radius:var(--radius-sm);transition:color var(--transition-fast),background var(--transition-fast)}.prompt-override-fullscreen-btn:hover{color:var(--text);background:var(--surface)}.prompt-override-fullscreen-btn:focus-visible{outline:none;box-shadow:var(--focus-ring-strong);color:var(--text);background:var(--surface)}.prompt-override-fullscreen{position:fixed;inset:0;z-index:10000;background:var(--surface);padding:max(var(--space-lg),env(safe-area-inset-top,0px)) max(var(--space-lg),env(safe-area-inset-right,0px)) max(var(--space-lg),env(safe-area-inset-bottom,0px)) max(var(--space-lg),env(safe-area-inset-left,0px));display:flex;flex-direction:column}.prompt-override-fullscreen-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--space-md);flex-shrink:0}.prompt-override-fullscreen-title{font-size:13px;font-weight:600;color:var(--text);display:flex;align-items:center;gap:var(--space-sm)}.prompt-override-fullscreen-close{display:flex;align-items:center;justify-content:center;gap:var(--space-xs);padding:var(--space-xs) var(--space-sm);background:none;border:1px solid var(--border);border-radius:var(--radius-md);color:var(--text-muted);cursor:pointer;font-size:12px;transition:all var(--transition-fast)}.prompt-override-fullscreen-close:hover{color:var(--text);border-color:var(--text-muted)}.prompt-override-fullscreen-close:focus-visible{outline:none;box-shadow:var(--focus-ring-strong)}.prompt-override-fullscreen textarea{flex:1;min-height:unset;resize:none;border-radius:var(--radius-md);font-size:14px;line-height:1.6}.prompt-template-fullscreen-pre{flex:1;font-family:var(--font-mono);font-size:13px;line-height:1.6;color:var(--text);white-space:pre-wrap;word-break:break-word;overflow-y:auto;padding:var(--space-md);background:var(--bg);border-radius:var(--radius-md);border:1px solid var(--border);margin:0}.prompt-override-fullscreen .prompt-override-footer{flex-shrink:0;padding-top:var(--space-sm)}.prompt-template-prompt-label-row{display:flex;align-items:center;gap:var(--space-sm);margin-bottom:var(--space-xs)}.prompt-template-prompt-label-row label{display:block}.prompt-template-fullscreen-btn{vertical-align:middle}.prompt-template-prompt-label-row .prompt-template-fullscreen-btn{margin-left:var(--space-xs)}@media(max-width:768px){.prompt-manager{padding:0 var(--space-lg)}.prompt-manager-tabs{flex-wrap:wrap}.prompt-manager-tab{flex:1;justify-content:center;min-width:calc(50% - var(--space-xs))}.prompt-role-assignment-row{flex-direction:column;align-items:stretch;gap:var(--space-sm)}.prompt-role-select{width:100%}.prompt-template-editor-actions{flex-direction:column}.prompt-template-editor-actions .btn{width:100%}.prompt-override-fullscreen{padding:max(var(--space-md),env(safe-area-inset-top,0px)) max(var(--space-md),env(safe-area-inset-right,0px)) max(var(--space-md),env(safe-area-inset-bottom,0px)) max(var(--space-md),env(safe-area-inset-left,0px))}.prompt-override-fullscreen textarea{font-size:16px}.prompt-override-expand-btn,.prompt-override-fullscreen-btn{width:calc(var(--space-lg) * 2 + var(--space-xs));height:calc(var(--space-lg) * 2 + var(--space-xs))}}@keyframes custom-provider-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.custom-providers-section .onboarding-disclosure-content{margin-top:var(--space-sm);display:flex;flex-direction:column;gap:var(--space-sm)}.custom-provider-list{display:flex;flex-direction:column;gap:var(--space-sm)}.custom-provider-item{display:flex;align-items:center;justify-content:space-between;padding:var(--space-sm) var(--space-md);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);transition:border-color var(--transition-fast),box-shadow var(--transition-fast)}.custom-provider-item:hover{border-color:var(--text-dim)}.custom-provider-item-info{display:flex;flex-direction:column;gap:var(--space-xs);min-width:0}.custom-provider-item-name{font-weight:600;color:var(--text)}.custom-provider-item-meta{color:var(--text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.custom-provider-item-actions{display:flex;gap:var(--space-xs);flex-shrink:0}.custom-provider-badge{display:inline-flex;align-items:center;padding:var(--space-xs);border-radius:var(--radius-pill);background:color-mix(in srgb,var(--color-info) 15%,transparent);color:var(--color-info)}.custom-provider-empty{color:var(--text-muted);padding:var(--space-sm) 0}.custom-provider-add-btn{margin-top:var(--space-sm)}.custom-provider-form{padding:var(--space-md);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);margin-top:var(--space-sm)}.custom-provider-form-row{margin-bottom:var(--space-sm)}.custom-provider-form-actions{display:flex;gap:var(--space-sm);margin-top:var(--space-md)}.custom-provider-form-error{display:flex;align-items:center;gap:var(--space-xs);color:var(--color-error);margin-top:var(--space-xs);background:color-mix(in srgb,var(--color-error) 10%,transparent);padding:var(--space-xs) var(--space-sm);border-radius:var(--radius-sm)}.custom-provider-item-edit-form{margin-top:var(--space-xs)}.spin{animation:custom-provider-spin calc(var(--transition-slow) * 4) linear infinite}@media(max-width:768px){.custom-provider-item{flex-direction:column;align-items:flex-start;gap:var(--space-xs)}.custom-provider-item-meta{max-width:100%}.custom-provider-form{padding:var(--space-sm)}.custom-provider-item-actions{align-self:flex-end;margin-top:var(--space-xs)}}
1
+ .theme-selector{padding:0 20px 20px}.theme-mode-toggle{display:flex;align-items:center;gap:var(--space-sm);background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:var(--space-xs);margin-bottom:20px}.theme-mode-btn{display:flex;align-items:center;justify-content:center;gap:6px;padding:var(--space-sm) var(--space-lg);background:none;border:none;border-radius:var(--radius-sm);color:var(--text-muted);font-size:13px;font-weight:500;cursor:pointer;transition:all var(--transition-fast);flex:1}.theme-mode-btn:hover{color:var(--text);background:var(--card-hover)}.theme-mode-btn.active,.theme-mode-btn.active:hover{background:var(--todo);color:var(--bg)}.theme-mode-btn:focus-visible{outline:none;border-color:var(--todo);box-shadow:var(--focus-ring-strong)}.theme-section-title{font-size:12px;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px;margin-bottom:var(--space-md)}.theme-font-size-toggle{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--space-sm);margin-bottom:var(--space-lg)}.theme-font-size-btn{align-items:center;background:var(--card);border:1px solid var(--border);border-radius:var(--radius-sm);color:var(--text-muted);cursor:pointer;display:inline-flex;font-size:13px;font-weight:500;justify-content:center;min-height:calc(var(--space-2xl) + var(--space-sm));padding:var(--space-sm) var(--space-md);transition:all var(--transition-fast)}.theme-font-size-btn:hover{border-color:var(--todo);color:var(--text)}.theme-font-size-btn.active{background:color-mix(in srgb,var(--todo) 14%,transparent);border-color:var(--todo);color:var(--text)}.theme-font-size-btn:focus-visible{outline:none;border-color:var(--todo);box-shadow:var(--focus-ring-strong)}.theme-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:var(--space-md)}@media(max-width:768px){.theme-grid{grid-template-columns:repeat(2,1fr)}}.theme-option{display:flex;flex-direction:column;align-items:center;gap:var(--space-sm);padding:var(--space-md);background:var(--card);border:2px solid var(--border);border-radius:var(--radius);cursor:pointer;transition:all var(--transition-fast)}.theme-option:hover{border-color:var(--todo);background:var(--card-hover)}.theme-option.active{border-color:var(--todo);background:color-mix(in srgb,var(--todo) 14%,transparent)}.theme-option:focus-visible{outline:none;border-color:var(--todo);box-shadow:var(--focus-ring-strong)}.theme-option-swatch{width:calc(var(--space-2xl) + var(--space-lg));height:calc(var(--space-2xl) + var(--space-lg));border-radius:var(--radius);border:2px solid var(--border);display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));overflow:hidden}.theme-option-swatch-sample{display:block;min-height:0}.theme-option-swatch-sample-1{background:var(--swatch-sample-1)}.theme-option-swatch-sample-2{background:var(--swatch-sample-2)}.theme-option-swatch-sample-3{background:var(--swatch-sample-3)}.theme-option-swatch-sample-4{background:var(--swatch-sample-4)}.theme-option-label{font-size:12px;font-weight:500;color:var(--text);text-align:center}.theme-swatch-default{--swatch-sample-1: #0d1117;--swatch-sample-2: #161b22;--swatch-sample-3: #58a6ff;--swatch-sample-4: #79c0ff}.theme-swatch-ocean{--swatch-sample-1: #0a1929;--swatch-sample-2: #132f4c;--swatch-sample-3: #4fc3f7;--swatch-sample-4: #00bcd4}.theme-swatch-forest{--swatch-sample-1: #0d2818;--swatch-sample-2: #1a472a;--swatch-sample-3: #4caf50;--swatch-sample-4: #2e7d32}.theme-swatch-sunset{--swatch-sample-1: #2d1f1f;--swatch-sample-2: #4a2c2c;--swatch-sample-3: #ff8a65;--swatch-sample-4: #ff7043}.theme-swatch-zen{--swatch-sample-1: #0c0c0c;--swatch-sample-2: #111111;--swatch-sample-3: #6b7b8c;--swatch-sample-4: #7a8590}.theme-swatch-berry{--swatch-sample-1: #1a0b2e;--swatch-sample-2: #2d1b4e;--swatch-sample-3: #c084fc;--swatch-sample-4: #ec4899}.theme-swatch-monochrome{--swatch-sample-1: #0d0d0d;--swatch-sample-2: #1a1a1a;--swatch-sample-3: #a3a3a3;--swatch-sample-4: #d4d4d4}.theme-swatch-slate{--swatch-sample-1: #1e293b;--swatch-sample-2: #334155;--swatch-sample-3: #60a5fa;--swatch-sample-4: #22d3ee}.theme-swatch-ash{--swatch-sample-1: #292524;--swatch-sample-2: #44403c;--swatch-sample-3: #a8a29e;--swatch-sample-4: #d6d3d1}.theme-swatch-graphite{--swatch-sample-1: #18181b;--swatch-sample-2: #27272a;--swatch-sample-3: #94a3b8;--swatch-sample-4: #cbd5e1}.theme-swatch-ember{--swatch-sample-1: #18181b;--swatch-sample-2: #27272a;--swatch-sample-3: #f97316;--swatch-sample-4: #ef4444}.theme-swatch-rust{--swatch-sample-1: #0f0b09;--swatch-sample-2: #1a1410;--swatch-sample-3: #e06830;--swatch-sample-4: #e88040}.theme-swatch-copper{--swatch-sample-1: #0e0c0a;--swatch-sample-2: #181410;--swatch-sample-3: #e89545;--swatch-sample-4: #f0a858}.theme-swatch-foundry{--swatch-sample-1: #0c0806;--swatch-sample-2: #15100c;--swatch-sample-3: #ffab20;--swatch-sample-4: #ffc040}.theme-swatch-carbon{--swatch-sample-1: #0a0b0d;--swatch-sample-2: #111318;--swatch-sample-3: #6a9acf;--swatch-sample-4: #7ab0e0}.theme-swatch-sandstone{--swatch-sample-1: #1a1712;--swatch-sample-2: #241f18;--swatch-sample-3: #d4a06a;--swatch-sample-4: #e0b080}.theme-swatch-lagoon{--swatch-sample-1: #0a1214;--swatch-sample-2: #101c1f;--swatch-sample-3: #50d8c0;--swatch-sample-4: #60e8d0}.theme-swatch-frost{--swatch-sample-1: #0c0e14;--swatch-sample-2: #121520;--swatch-sample-3: #8ac8f8;--swatch-sample-4: #9ad8ff}.theme-swatch-lavender{--swatch-sample-1: #14101a;--swatch-sample-2: #1c1624;--swatch-sample-3: #c8a0e8;--swatch-sample-4: #d8b0f0}.theme-swatch-neon-bloom{--swatch-sample-1: #120a18;--swatch-sample-2: #1a1024;--swatch-sample-3: #f080d0;--swatch-sample-4: #ff90e0}.theme-swatch-sepia{--swatch-sample-1: #161210;--swatch-sample-2: #201a16;--swatch-sample-3: #d8b878;--swatch-sample-4: #e8c888}.theme-swatch-silver{--swatch-sample-1: #27272a;--swatch-sample-2: #3f3f46;--swatch-sample-3: #94a3b8;--swatch-sample-4: #e2e8f0}.theme-swatch-high-contrast{--swatch-sample-1: #000000;--swatch-sample-2: #0a0a0a;--swatch-sample-3: #00ffff;--swatch-sample-4: #ffff00}.theme-swatch-industrial{--swatch-sample-1: #0c0c0c;--swatch-sample-2: #141414;--swatch-sample-3: #ff6b00;--swatch-sample-4: #ff8c00}.theme-swatch-solarized{--swatch-sample-1: #002b36;--swatch-sample-2: #073642;--swatch-sample-3: #268bd2;--swatch-sample-4: #2aa198}.theme-swatch-factory{--swatch-sample-1: #0a0a0a;--swatch-sample-2: #111111;--swatch-sample-3: #f59e0b;--swatch-sample-4: #06b6d4}.theme-swatch-ayu{--swatch-sample-1: #0f1419;--swatch-sample-2: #131d27;--swatch-sample-3: #39bae6;--swatch-sample-4: #ffb454}.theme-swatch-one-dark{--swatch-sample-1: #282c34;--swatch-sample-2: #21252b;--swatch-sample-3: #61afef;--swatch-sample-4: #00e5ff}.theme-swatch-nord{--swatch-sample-1: #2e3440;--swatch-sample-2: #3b4252;--swatch-sample-3: #88c0d0;--swatch-sample-4: #81a1c1}.theme-swatch-dracula{--swatch-sample-1: #282a36;--swatch-sample-2: #21222c;--swatch-sample-3: #8be9fd;--swatch-sample-4: #00e5ff}.theme-swatch-gruvbox{--swatch-sample-1: #282828;--swatch-sample-2: #1d2021;--swatch-sample-3: #83a598;--swatch-sample-4: #d3869b}.theme-swatch-tokyo-night{--swatch-sample-1: #1a1b26;--swatch-sample-2: #16161e;--swatch-sample-3: #7aa2f7;--swatch-sample-4: #00e5ff}.theme-swatch-catppuccin-mocha{--swatch-sample-1: #1e1e2e;--swatch-sample-2: #181825;--swatch-sample-3: #89b4fa;--swatch-sample-4: #89dceb}.theme-swatch-github-dark{--swatch-sample-1: #0d1117;--swatch-sample-2: #010409;--swatch-sample-3: #58a6ff;--swatch-sample-4: #79c0ff}.theme-swatch-everforest{--swatch-sample-1: #2d353b;--swatch-sample-2: #272e33;--swatch-sample-3: #7fbbb3;--swatch-sample-4: #e0c8a8}.theme-swatch-rose-pine{--swatch-sample-1: #191724;--swatch-sample-2: #1f1d2e;--swatch-sample-3: #c4a7e7;--swatch-sample-4: #ebbcba}.theme-swatch-kanagawa{--swatch-sample-1: #1f1f28;--swatch-sample-2: #16161d;--swatch-sample-3: #7e9cd8;--swatch-sample-4: #7e9cd8}.theme-swatch-night-owl{--swatch-sample-1: #011627;--swatch-sample-2: #01111d;--swatch-sample-3: #82aaff;--swatch-sample-4: #addb67}.theme-swatch-palenight{--swatch-sample-1: #292d3e;--swatch-sample-2: #1e2235;--swatch-sample-3: #82aaff;--swatch-sample-4: #ffcb6b}.theme-swatch-monokai-pro{--swatch-sample-1: #2d2a2e;--swatch-sample-2: #252229;--swatch-sample-3: #78dce8;--swatch-sample-4: #ff6188}.theme-swatch-slime{--swatch-sample-1: #0a0e09;--swatch-sample-2: #0f150d;--swatch-sample-3: #8aff40;--swatch-sample-4: #40e8a0}.theme-swatch-brutalist{--swatch-sample-1: #101010;--swatch-sample-2: #171717;--swatch-sample-3: #ff6a00;--swatch-sample-4: #ffd100}.theme-swatch-neon-city{--swatch-sample-1: #0d0d15;--swatch-sample-2: #121326;--swatch-sample-3: #ff2d95;--swatch-sample-4: #00f0ff}.theme-swatch-parchment{--swatch-sample-1: #1b1712;--swatch-sample-2: #252019;--swatch-sample-3: #d08a4b;--swatch-sample-4: #be6e3c}.theme-swatch-terminal{--swatch-sample-1: #0a0a0a;--swatch-sample-2: #0f120d;--swatch-sample-3: #33ff00;--swatch-sample-4: #8fff38}.theme-swatch-glass{--swatch-sample-1: #13111f;--swatch-sample-2: color-mix(in srgb, #221b34 78%, transparent);--swatch-sample-3: #c86bff;--swatch-sample-4: #ff7aa8}.theme-swatch-horizon{--swatch-sample-1: #1c1e26;--swatch-sample-2: #16161c;--swatch-sample-3: #e59371;--swatch-sample-4: #f08c42}.theme-swatch-vitesse{--swatch-sample-1: #121817;--swatch-sample-2: #0d1210;--swatch-sample-3: #4c9a91;--swatch-sample-4: #dca561}.theme-swatch-outrun{--swatch-sample-1: #0a0a14;--swatch-sample-2: #0d0d1a;--swatch-sample-3: #ff2d95;--swatch-sample-4: #b537f2}.theme-swatch-snazzy{--swatch-sample-1: #282a36;--swatch-sample-2: #1e1f29;--swatch-sample-3: #ff5c57;--swatch-sample-4: #5af78e}.theme-swatch-porple{--swatch-sample-1: #292d3e;--swatch-sample-2: #1e2030;--swatch-sample-3: #c792ea;--swatch-sample-4: #82aaff}.theme-swatch-espresso{--swatch-sample-1: #2c1f1a;--swatch-sample-2: #231813;--swatch-sample-3: #d4a574;--swatch-sample-4: #c17d56}.theme-swatch-mars{--swatch-sample-1: #1a1210;--swatch-sample-2: #140e0c;--swatch-sample-3: #c1440e;--swatch-sample-4: #e77d3d}.theme-swatch-poimandres{--swatch-sample-1: #1a1b26;--swatch-sample-2: #14151f;--swatch-sample-3: #89ddff;--swatch-sample-4: #5de4c7}[data-theme=light] .theme-swatch-factory{--swatch-sample-1: #f5f5f5;--swatch-sample-2: #ffffff;--swatch-sample-3: #d97706;--swatch-sample-4: #0891b2}[data-theme=light] .theme-swatch-ayu{--swatch-sample-1: #fafafa;--swatch-sample-2: #f3f3f3;--swatch-sample-3: #007acc;--swatch-sample-4: #ff8f40}[data-theme=light] .theme-swatch-zen{--swatch-sample-1: #f5f5f5;--swatch-sample-2: #fafafa;--swatch-sample-3: #5a6a7a;--swatch-sample-4: #6a757f}[data-theme=light] .theme-swatch-nord{--swatch-sample-1: #eceff4;--swatch-sample-2: #e5e9f0;--swatch-sample-3: #5e81ac;--swatch-sample-4: #5e81ac}[data-theme=light] .theme-swatch-dracula{--swatch-sample-1: #f8f8f2;--swatch-sample-2: #efeefa;--swatch-sample-3: #0097a7;--swatch-sample-4: #00bcd4}[data-theme=light] .theme-swatch-gruvbox{--swatch-sample-1: #fbf1c7;--swatch-sample-2: #f2e5bc;--swatch-sample-3: #076678;--swatch-sample-4: #8f3f71}[data-theme=light] .theme-swatch-tokyo-night{--swatch-sample-1: #e1e2e7;--swatch-sample-2: #d5d6db;--swatch-sample-3: #3b5ea5;--swatch-sample-4: #00bcd4}[data-theme=light] .theme-swatch-catppuccin-mocha{--swatch-sample-1: #eff1f5;--swatch-sample-2: #e6e9ef;--swatch-sample-3: #1e66f5;--swatch-sample-4: #04a5e5}[data-theme=light] .theme-swatch-github-dark{--swatch-sample-1: #ffffff;--swatch-sample-2: #f6f8fa;--swatch-sample-3: #0969da;--swatch-sample-4: #0969da}[data-theme=light] .theme-swatch-everforest{--swatch-sample-1: #fdf6e3;--swatch-sample-2: #f4f0d9;--swatch-sample-3: #3a94a5;--swatch-sample-4: #83a08a}[data-theme=light] .theme-swatch-rose-pine{--swatch-sample-1: #faf4ed;--swatch-sample-2: #fffaf3;--swatch-sample-3: #907aa9;--swatch-sample-4: #b4637a}[data-theme=light] .theme-swatch-kanagawa{--swatch-sample-1: #edeadd;--swatch-sample-2: #e1ddd4;--swatch-sample-3: #4e76b5;--swatch-sample-4: #4e76b5}[data-theme=light] .theme-swatch-one-dark{--swatch-sample-1: #fafafa;--swatch-sample-2: #f0f0f0;--swatch-sample-3: #4078f2;--swatch-sample-4: #0184bc}[data-theme=light] .theme-swatch-night-owl{--swatch-sample-1: #f6f7f9;--swatch-sample-2: #eef0f4;--swatch-sample-3: #2563eb;--swatch-sample-4: #5a9e2f}[data-theme=light] .theme-swatch-palenight{--swatch-sample-1: #f5f7fa;--swatch-sample-2: #ebeef5;--swatch-sample-3: #3b6fcf;--swatch-sample-4: #c49020}[data-theme=light] .theme-swatch-monokai-pro{--swatch-sample-1: #faf8f5;--swatch-sample-2: #f0ece5;--swatch-sample-3: #2d8fa0;--swatch-sample-4: #c4405e}[data-theme=light] .theme-swatch-slime{--swatch-sample-1: #f2f7ea;--swatch-sample-2: #e6efda;--swatch-sample-3: #3d8f10;--swatch-sample-4: #1a8a6a}[data-theme=light] .theme-swatch-brutalist{--swatch-sample-1: #ece9e4;--swatch-sample-2: #f7f4ef;--swatch-sample-3: #d9480f;--swatch-sample-4: #b8860b}[data-theme=light] .theme-swatch-neon-city{--swatch-sample-1: #f7f5ff;--swatch-sample-2: #f1edff;--swatch-sample-3: #cc166e;--swatch-sample-4: #008e9b}[data-theme=light] .theme-swatch-parchment{--swatch-sample-1: #f5f0e8;--swatch-sample-2: #efe7dc;--swatch-sample-3: #a8562f;--swatch-sample-4: #8f4e2a}[data-theme=light] .theme-swatch-terminal{--swatch-sample-1: #e7f5dd;--swatch-sample-2: #deefd2;--swatch-sample-3: #2d6b14;--swatch-sample-4: #4c8f25}[data-theme=light] .theme-swatch-glass{--swatch-sample-1: #eceaf5;--swatch-sample-2: color-mix(in srgb, #ffffff 75%, transparent);--swatch-sample-3: #9d40cf;--swatch-sample-4: #c74b7a}[data-theme=light] .theme-swatch-slate{--swatch-sample-1: #f1f5f9;--swatch-sample-2: #e2e8f0;--swatch-sample-3: #3b5ea5;--swatch-sample-4: #4f7090}[data-theme=light] .theme-swatch-ash{--swatch-sample-1: #fafaf9;--swatch-sample-2: #f5f5f4;--swatch-sample-3: #5a6a7a;--swatch-sample-4: #768694}[data-theme=light] .theme-swatch-graphite{--swatch-sample-1: #fafafa;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #6f7f90;--swatch-sample-4: #8a99aa}[data-theme=light] .theme-swatch-ember{--swatch-sample-1: #fafafa;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #d9480f;--swatch-sample-4: #e8646a}[data-theme=light] .theme-swatch-rust{--swatch-sample-1: #f5efe8;--swatch-sample-2: #ebe3d8;--swatch-sample-3: #a04020;--swatch-sample-4: #b85828}[data-theme=light] .theme-swatch-copper{--swatch-sample-1: #f3ede6;--swatch-sample-2: #e8e0d6;--swatch-sample-3: #905820;--swatch-sample-4: #a87030}[data-theme=light] .theme-swatch-foundry{--swatch-sample-1: #f5f0e6;--swatch-sample-2: #ebe4d6;--swatch-sample-3: #c07808;--swatch-sample-4: #d08a10}[data-theme=light] .theme-swatch-carbon{--swatch-sample-1: #eef0f4;--swatch-sample-2: #e2e6ec;--swatch-sample-3: #3a6090;--swatch-sample-4: #4878a0}[data-theme=light] .theme-swatch-sandstone{--swatch-sample-1: #f5f0e8;--swatch-sample-2: #ebe4d8;--swatch-sample-3: #a07040;--swatch-sample-4: #b08050}[data-theme=light] .theme-swatch-lagoon{--swatch-sample-1: #eef5f3;--swatch-sample-2: #e0ebe8;--swatch-sample-3: #208070;--swatch-sample-4: #289080}[data-theme=light] .theme-swatch-frost{--swatch-sample-1: #f0f4f8;--swatch-sample-2: #e4eaf0;--swatch-sample-3: #3078a8;--swatch-sample-4: #4088b8}[data-theme=light] .theme-swatch-lavender{--swatch-sample-1: #f4f0f8;--swatch-sample-2: #e8e2f0;--swatch-sample-3: #8060a0;--swatch-sample-4: #9070b0}[data-theme=light] .theme-swatch-neon-bloom{--swatch-sample-1: #f8f0f8;--swatch-sample-2: #f0e4f0;--swatch-sample-3: #a03090;--swatch-sample-4: #b040a0}[data-theme=light] .theme-swatch-sepia{--swatch-sample-1: #f5f0e4;--swatch-sample-2: #ece4d4;--swatch-sample-3: #907040;--swatch-sample-4: #a08050}[data-theme=light] .theme-swatch-silver{--swatch-sample-1: #fafafa;--swatch-sample-2: #f4f4f5;--swatch-sample-3: #6b7280;--swatch-sample-4: #9ca3af}[data-theme=light] .theme-swatch-horizon{--swatch-sample-1: #fdf0ed;--swatch-sample-2: #f9cec0;--swatch-sample-3: #e8646a;--swatch-sample-4: #f08c42}[data-theme=light] .theme-swatch-vitesse{--swatch-sample-1: #f8f5f0;--swatch-sample-2: #efe9e0;--swatch-sample-3: #3a8578;--swatch-sample-4: #c08040}[data-theme=light] .theme-swatch-outrun{--swatch-sample-1: #f0f0f5;--swatch-sample-2: #e8e8ef;--swatch-sample-3: #d02080;--swatch-sample-4: #9030c8}[data-theme=light] .theme-swatch-snazzy{--swatch-sample-1: #fafafa;--swatch-sample-2: #f0f0f2;--swatch-sample-3: #d04040;--swatch-sample-4: #30a050}[data-theme=light] .theme-swatch-porple{--swatch-sample-1: #f5f3f7;--swatch-sample-2: #eae7ef;--swatch-sample-3: #9060d8;--swatch-sample-4: #4080c8}[data-theme=light] .theme-swatch-espresso{--swatch-sample-1: #f5ece4;--swatch-sample-2: #ebe1d6;--swatch-sample-3: #a07050;--swatch-sample-4: #906040}[data-theme=light] .theme-swatch-mars{--swatch-sample-1: #f5ece6;--swatch-sample-2: #ebe0d4;--swatch-sample-3: #a03010;--swatch-sample-4: #c06030}[data-theme=light] .theme-swatch-poimandres{--swatch-sample-1: #f0f0f5;--swatch-sample-2: #e6e6ee;--swatch-sample-3: #4090c0;--swatch-sample-4: #30a090}.theme-reset-btn{display:flex;align-items:center;justify-content:center;gap:var(--space-sm);margin-top:20px;padding:10px 16px;background:var(--card);border:1px solid var(--border);border-radius:var(--radius);color:var(--text-muted);font-size:13px;font-weight:500;cursor:pointer;transition:all var(--transition-fast);width:100%}.theme-reset-btn:hover{background:var(--card-hover);color:var(--text);border-color:var(--text-muted)}.theme-reset-btn:focus-visible{outline:none;border-color:var(--todo);box-shadow:var(--focus-ring-strong)}.theme-current-preview{display:flex;align-items:center;gap:var(--space-md);padding:var(--space-md) var(--space-lg);background:var(--card);border:1px solid var(--border);border-radius:var(--radius);margin-bottom:20px}.theme-preview-icon{display:flex;align-items:center;justify-content:center;width:40px;height:40px;background:var(--surface);border-radius:var(--radius);color:var(--todo)}.theme-preview-info{flex:1}.theme-preview-label{font-size:12px;color:var(--text-muted);margin-bottom:2px}.theme-preview-value{font-size:14px;font-weight:600;color:var(--text);text-transform:capitalize}@media(max-width:768px){.model-combobox-dropdown{max-height:50vh;width:min(360px,calc(100vw - 32px))}.model-combobox-search{font-size:16px}.model-combobox-option{min-height:36px}.theme-selector{padding:0 14px 14px}.theme-font-size-toggle{grid-template-columns:1fr}}.cli-binary-panel{display:flex;flex-direction:column;gap:12px;padding:0 var(--space-xl);margin-top:var(--space-lg);border:0;background:transparent}.cli-binary-header{display:flex;align-items:center;justify-content:space-between;gap:12px}.cli-binary-header .settings-section-heading{margin:0}.cli-binary-pill{display:inline-flex;align-items:center;padding:2px 10px;border-radius:999px;font-size:11px;font-weight:600;letter-spacing:.02em;text-transform:uppercase}.cli-binary-pill--ok{background:color-mix(in srgb,var(--color-success) 18%,transparent);color:var(--color-success);border:1px solid color-mix(in srgb,var(--color-success) 40%,transparent)}.cli-binary-pill--warn{background:color-mix(in srgb,var(--color-warning) 18%,transparent);color:var(--color-warning);border:1px solid color-mix(in srgb,var(--color-warning) 40%,transparent)}.cli-binary-pill--err{background:color-mix(in srgb,var(--color-error) 18%,transparent);color:var(--color-error);border:1px solid color-mix(in srgb,var(--color-error) 40%,transparent)}.cli-binary-help{color:var(--text-muted);line-height:1.4}.cli-binary-help code{background:color-mix(in srgb,var(--text) 6%,transparent);padding:1px 6px;border-radius:4px;font-size:.92em}.cli-binary-status-line{margin:0;color:var(--text-muted)}.cli-binary-status-line code{background:color-mix(in srgb,var(--text) 6%,transparent);padding:1px 6px;border-radius:4px}.cli-binary-detail{display:flex;flex-direction:column;gap:12px}.cli-binary-info-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px;font-size:13px}.cli-binary-info-list li{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.cli-binary-info-list span{color:var(--text-muted);min-width:64px}.cli-binary-info-list code{background:color-mix(in srgb,var(--text) 6%,transparent);padding:1px 6px;border-radius:4px;word-break:break-all}.cli-binary-expected{color:var(--text-muted);font-size:12px}.cli-binary-actions{display:flex;gap:8px;flex-wrap:wrap}.cli-binary-install-btn,.cli-binary-refresh-btn,.cli-binary-copy-btn{cursor:pointer;border-radius:6px;padding:6px 12px;font-size:13px;border:1px solid transparent;transition:background .15s ease,border-color .15s ease}.cli-binary-install-btn{background:var(--accent, #3b82f6);color:var(--accent-text)}.cli-binary-install-btn:hover:not(:disabled){background:var(--accent-hover, #2563eb)}.cli-binary-install-btn:disabled,.cli-binary-refresh-btn:disabled{opacity:.55;cursor:not-allowed}.cli-binary-refresh-btn,.cli-binary-copy-btn{background:color-mix(in srgb,var(--text) 4%,transparent);color:var(--text);border-color:color-mix(in srgb,var(--text) 12%,transparent)}.cli-binary-refresh-btn:hover:not(:disabled),.cli-binary-copy-btn:hover{background:color-mix(in srgb,var(--text) 8%,transparent)}.cli-binary-commands{display:flex;flex-direction:column;gap:6px}.cli-binary-commands label{font-size:12px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.04em}.cli-binary-command-row{display:flex;align-items:center;gap:8px;background:color-mix(in srgb,var(--bg) 25%,transparent);border:1px solid color-mix(in srgb,var(--text) 6%,transparent);border-radius:6px;padding:6px 8px 6px 12px}.cli-binary-command-row code{flex:1;font-family:var(--font-mono, ui-monospace, "SFMono-Regular", monospace);font-size:12.5px;color:var(--text-primary, #e6edf3);white-space:nowrap;overflow-x:auto}.cli-binary-install-log{border-top:1px solid color-mix(in srgb,var(--text) 6%,transparent);padding-top:10px;font-size:12.5px}.cli-binary-install-log summary{cursor:pointer;color:var(--text-muted)}.cli-binary-install-output{margin:6px 0 0;padding:8px 10px;background:color-mix(in srgb,var(--bg) 35%,transparent);border-radius:4px;max-height:220px;overflow:auto;white-space:pre-wrap;font-size:12px;line-height:1.4}.cli-binary-install-output--err{color:var(--color-error)}.cli-binary-permissions-hint{margin:6px 0;padding:8px 10px;background:color-mix(in srgb,var(--color-error) 10%,transparent);border-left:3px solid color-mix(in srgb,var(--color-error) 55%,transparent);border-radius:0 var(--radius-sm) var(--radius-sm) 0;color:var(--color-error);font-size:12.5px;line-height:1.5}.prompt-manager{display:flex;flex-direction:column;gap:var(--space-md);padding:0 var(--space-xl);margin-top:var(--space-md)}.prompt-manager-tabs{display:flex;gap:var(--space-xs);border-bottom:1px solid var(--border);padding-bottom:var(--space-sm)}.prompt-manager-tab{display:inline-flex;align-items:center;gap:var(--space-xs);padding:var(--space-sm) var(--space-md);background:none;border:1px solid transparent;border-radius:var(--radius-md);color:var(--text-muted);font-size:13px;cursor:pointer;transition:all var(--transition-fast)}.prompt-manager-tab:hover{color:var(--text);background:var(--surface)}.prompt-manager-tab:focus-visible{outline:none;box-shadow:var(--focus-ring-strong);border-color:var(--todo)}.prompt-manager-tab.active{color:var(--text);background:var(--surface);border-color:var(--border)}.prompt-manager-content{min-height:200px}.prompt-manager-templates-tab,.prompt-manager-assignments-tab,.prompt-manager-overrides-tab{display:flex;flex-direction:column;gap:var(--space-lg)}.prompt-template-section{display:flex;flex-direction:column;gap:var(--space-md)}.prompt-template-section-title{font-size:14px;font-weight:600;color:var(--text);margin:0}.prompt-template-section-desc{font-size:12px;color:var(--text-muted);margin:0}.prompt-template-list{display:flex;flex-direction:column;gap:var(--space-md)}.prompt-template-card{padding:var(--space-md);background:var(--card);border:1px solid var(--border);border-radius:var(--radius-md);transition:border-color var(--transition-fast)}.prompt-template-card:hover{border-color:var(--text-dim)}.prompt-template-card-header{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--space-md);margin-bottom:var(--space-sm)}.prompt-template-card-info{display:flex;align-items:center;flex-wrap:wrap;gap:var(--space-sm)}.prompt-template-card-name{font-weight:600;color:var(--text);font-size:14px}.prompt-template-badge-built-in,.prompt-template-badge-custom,.prompt-template-badge-override{display:inline-flex;align-items:center;padding:calc(var(--space-xs) * .5) calc(var(--space-xs) * 1.5);font-size:10px;font-weight:500;border-radius:var(--radius-sm);text-transform:uppercase;letter-spacing:.02em}.prompt-template-badge-built-in{background:var(--surface);color:var(--text-muted);border:1px solid var(--border)}.prompt-template-badge-custom{background:color-mix(in srgb,var(--color-info) 15%,transparent);color:var(--color-info)}.prompt-template-badge-override{background:color-mix(in srgb,var(--color-warning) 15%,transparent);color:var(--color-warning)}.prompt-template-badge-role{display:inline-flex;align-items:center;padding:calc(var(--space-xs) * .5) calc(var(--space-xs) * 1.5);font-size:10px;font-weight:500;border-radius:var(--radius-sm)}.prompt-template-badge-built-in,.prompt-template-badge-role,.prompt-role-badge{--prompt-role-color: var(--color-muted)}.prompt-role-tone--executor{--prompt-role-color: var(--todo)}.prompt-role-tone--triage{--prompt-role-color: var(--triage)}.prompt-role-tone--reviewer{--prompt-role-color: var(--in-review)}.prompt-role-tone--merger{--prompt-role-color: var(--done)}.prompt-role-tone--scheduler{--prompt-role-color: var(--color-info)}.prompt-role-tone--engineer{--prompt-role-color: var(--color-warning)}.prompt-role-tone--custom{--prompt-role-color: var(--color-muted)}.prompt-template-badge-role,.prompt-role-badge{background:color-mix(in srgb,var(--prompt-role-color) 15%,transparent);color:var(--prompt-role-color)}.prompt-template-badge-built-in.prompt-role-tone--executor,.prompt-template-badge-built-in.prompt-role-tone--triage,.prompt-template-badge-built-in.prompt-role-tone--reviewer,.prompt-template-badge-built-in.prompt-role-tone--merger,.prompt-template-badge-built-in.prompt-role-tone--scheduler,.prompt-template-badge-built-in.prompt-role-tone--engineer,.prompt-template-badge-built-in.prompt-role-tone--custom{border-color:var(--prompt-role-color)}.prompt-template-card-actions{display:flex;gap:var(--space-xs)}.prompt-template-card-actions .btn-icon{padding:var(--space-xs)}.prompt-template-card-description{font-size:12px;color:var(--text-muted);margin:0 0 var(--space-sm) 0;line-height:1.4}.prompt-template-card-preview{background:var(--surface);border-radius:var(--radius-sm);padding:var(--space-sm);overflow:hidden}.prompt-template-card-preview code{font-size:calc(var(--space-sm) + var(--space-xs) * .75);color:var(--text-muted);font-family:var(--font-mono);white-space:pre-wrap;word-break:break-word;display:block;max-height:120px;overflow-y:auto}.prompt-template-empty{padding:var(--space-lg);text-align:center;color:var(--text-muted);font-size:13px;background:var(--surface);border:1px dashed var(--border);border-radius:var(--radius-md)}.prompt-template-add-btn{align-self:flex-start;margin-top:var(--space-sm)}.prompt-template-editor{padding:var(--space-lg);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);margin-bottom:var(--space-lg)}.prompt-template-editor-title{font-size:14px;font-weight:600;color:var(--text);margin:0 0 var(--space-md) 0}.prompt-template-editor-fields{display:flex;flex-direction:column;gap:var(--space-md)}.prompt-template-field{display:flex;flex-direction:column;gap:var(--space-xs)}.prompt-template-field label{font-size:12px;font-weight:500;color:var(--text-muted)}.prompt-template-field input,.prompt-template-field select,.prompt-template-prompt-textarea{padding:var(--space-sm) var(--space-md);background:var(--bg);border:1px solid var(--border);border-radius:var(--radius-md);color:var(--text);font-size:13px;transition:border-color var(--transition-fast)}.prompt-template-field input:focus,.prompt-template-field select:focus,.prompt-template-prompt-textarea:focus{outline:none;border-color:var(--todo)}.prompt-template-prompt-textarea{font-family:var(--font-mono);font-size:12px;line-height:1.5;resize:vertical;min-height:120px}.prompt-template-error{padding:var(--space-sm);background:color-mix(in srgb,var(--color-error) 10%,transparent);border:1px solid var(--color-error);border-radius:var(--radius-sm);color:var(--color-error);font-size:12px}.prompt-template-editor-actions{display:flex;gap:var(--space-sm);justify-content:flex-end;margin-top:var(--space-sm)}.prompt-template-delete-confirm{padding:var(--space-md);background:color-mix(in srgb,var(--color-error) 10%,transparent);border:1px solid var(--color-error);border-radius:var(--radius-md);display:flex;flex-direction:column;gap:var(--space-sm)}.prompt-template-delete-confirm p{margin:0;font-size:13px;color:var(--text)}.prompt-template-delete-actions{display:flex;gap:var(--space-sm)}.prompt-assignments-desc{font-size:12px;color:var(--text-muted);margin:0}.prompt-role-assignment-list{display:flex;flex-direction:column;gap:var(--space-md)}.prompt-role-assignment-row{display:flex;align-items:center;justify-content:space-between;gap:var(--space-lg);padding:var(--space-md);background:var(--card);border:1px solid var(--border);border-radius:var(--radius-md)}.prompt-role-assignment-label{display:flex;align-items:center;gap:var(--space-md)}.prompt-role-badge{display:inline-flex;align-items:center;padding:var(--space-xs) var(--space-sm);font-size:12px;font-weight:600;border-radius:var(--radius-sm)}.prompt-role-assignment-status{font-size:12px;color:var(--text-muted)}.prompt-role-select{min-width:200px;padding:var(--space-sm) var(--space-md);background:var(--bg);border:1px solid var(--border);border-radius:var(--radius-md);color:var(--text);font-size:13px;cursor:pointer}.prompt-role-select:focus{outline:none;border-color:var(--todo)}.prompt-role-select:focus-visible{outline:none;border-color:var(--todo);box-shadow:var(--focus-ring-strong)}.prompt-assignments-note{margin-top:var(--space-md);padding:var(--space-md);background:var(--surface);border-radius:var(--radius-md);font-size:12px;color:var(--text-muted);line-height:1.5}.prompt-assignments-note strong{color:var(--text)}.prompt-overrides-desc{font-size:12px;color:var(--text-muted);margin:0}.prompt-overrides-list{display:flex;flex-direction:column;gap:var(--space-md)}.prompt-override-item{background:var(--card);border:1px solid var(--border);border-radius:var(--radius-md);overflow:hidden}.prompt-override-header{display:flex;align-items:center;justify-content:space-between;padding:var(--space-md);cursor:pointer;transition:background var(--transition-fast)}.prompt-override-header:hover{background:var(--card-hover)}.prompt-override-info{display:flex;align-items:center;flex-wrap:wrap;gap:var(--space-sm);flex:1;min-width:0;border:none;background:none;color:inherit;padding:0;text-align:left;font:inherit;cursor:pointer;border-radius:var(--radius-sm)}.prompt-override-info:focus-visible{outline:none;box-shadow:var(--focus-ring-strong)}.prompt-override-name{font-weight:600;color:var(--text);font-size:13px}.prompt-override-key{font-size:11px;font-family:var(--font-mono);color:var(--text-muted);padding:calc(var(--space-xs) * .5) var(--space-xs);background:var(--surface);border-radius:var(--radius-sm)}.prompt-override-badge{display:inline-flex;align-items:center;padding:calc(var(--space-xs) * .5) calc(var(--space-xs) * 1.5);font-size:10px;font-weight:500;background:color-mix(in srgb,var(--color-warning) 15%,transparent);color:var(--color-warning);border-radius:var(--radius-sm)}.prompt-override-expand-btn{display:flex;align-items:center;justify-content:center;width:var(--space-xl);height:var(--space-xl);background:none;border:none;color:var(--text-muted);cursor:pointer;border-radius:var(--radius-sm);transition:color var(--transition-fast),background var(--transition-fast)}.prompt-override-expand-btn:hover{color:var(--text);background:var(--surface)}.prompt-override-expand-btn:focus-visible{outline:none;box-shadow:var(--focus-ring-strong);color:var(--text);background:var(--surface)}.prompt-override-description{font-size:12px;color:var(--text-muted);margin:0;padding:0 var(--space-md) var(--space-md);line-height:1.4}.prompt-override-editor{padding:var(--space-md);border-top:1px solid var(--border);background:var(--surface);display:flex;flex-direction:column;gap:var(--space-sm)}.prompt-override-textarea{padding:var(--space-sm) var(--space-md);background:var(--bg);border:1px solid var(--border);border-radius:var(--radius-md);color:var(--text);font-size:12px;font-family:var(--font-mono);line-height:1.5;resize:vertical;min-height:calc(var(--space-xl) * 3 + var(--space-sm));transition:border-color var(--transition-fast)}.prompt-override-textarea:focus{outline:none;border-color:var(--todo)}.prompt-override-footer{display:flex;align-items:center;gap:var(--space-md)}.prompt-override-hint{font-size:calc(var(--space-sm) + var(--space-xs) * .75);color:var(--text-muted)}.prompt-override-header-actions{display:flex;align-items:center;gap:var(--space-xs)}.prompt-override-fullscreen-btn{display:flex;align-items:center;justify-content:center;width:var(--space-xl);height:var(--space-xl);background:none;border:none;color:var(--text-muted);cursor:pointer;border-radius:var(--radius-sm);transition:color var(--transition-fast),background var(--transition-fast)}.prompt-override-fullscreen-btn:hover{color:var(--text);background:var(--surface)}.prompt-override-fullscreen-btn:focus-visible{outline:none;box-shadow:var(--focus-ring-strong);color:var(--text);background:var(--surface)}.prompt-override-fullscreen{position:fixed;inset:0;z-index:10000;background:var(--surface);padding:max(var(--space-lg),env(safe-area-inset-top,0px)) max(var(--space-lg),env(safe-area-inset-right,0px)) max(var(--space-lg),env(safe-area-inset-bottom,0px)) max(var(--space-lg),env(safe-area-inset-left,0px));display:flex;flex-direction:column}.prompt-override-fullscreen-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--space-md);flex-shrink:0}.prompt-override-fullscreen-title{font-size:13px;font-weight:600;color:var(--text);display:flex;align-items:center;gap:var(--space-sm)}.prompt-override-fullscreen-close{display:flex;align-items:center;justify-content:center;gap:var(--space-xs);padding:var(--space-xs) var(--space-sm);background:none;border:1px solid var(--border);border-radius:var(--radius-md);color:var(--text-muted);cursor:pointer;font-size:12px;transition:all var(--transition-fast)}.prompt-override-fullscreen-close:hover{color:var(--text);border-color:var(--text-muted)}.prompt-override-fullscreen-close:focus-visible{outline:none;box-shadow:var(--focus-ring-strong)}.prompt-override-fullscreen textarea{flex:1;min-height:unset;resize:none;border-radius:var(--radius-md);font-size:14px;line-height:1.6}.prompt-template-fullscreen-pre{flex:1;font-family:var(--font-mono);font-size:13px;line-height:1.6;color:var(--text);white-space:pre-wrap;word-break:break-word;overflow-y:auto;padding:var(--space-md);background:var(--bg);border-radius:var(--radius-md);border:1px solid var(--border);margin:0}.prompt-override-fullscreen .prompt-override-footer{flex-shrink:0;padding-top:var(--space-sm)}.prompt-template-prompt-label-row{display:flex;align-items:center;gap:var(--space-sm);margin-bottom:var(--space-xs)}.prompt-template-prompt-label-row label{display:block}.prompt-template-fullscreen-btn{vertical-align:middle}.prompt-template-prompt-label-row .prompt-template-fullscreen-btn{margin-left:var(--space-xs)}@media(max-width:768px){.prompt-manager{padding:0 var(--space-lg)}.prompt-manager-tabs{flex-wrap:wrap}.prompt-manager-tab{flex:1;justify-content:center;min-width:calc(50% - var(--space-xs))}.prompt-role-assignment-row{flex-direction:column;align-items:stretch;gap:var(--space-sm)}.prompt-role-select{width:100%}.prompt-template-editor-actions{flex-direction:column}.prompt-template-editor-actions .btn{width:100%}.prompt-override-fullscreen{padding:max(var(--space-md),env(safe-area-inset-top,0px)) max(var(--space-md),env(safe-area-inset-right,0px)) max(var(--space-md),env(safe-area-inset-bottom,0px)) max(var(--space-md),env(safe-area-inset-left,0px))}.prompt-override-fullscreen textarea{font-size:16px}.prompt-override-expand-btn,.prompt-override-fullscreen-btn{width:calc(var(--space-lg) * 2 + var(--space-xs));height:calc(var(--space-lg) * 2 + var(--space-xs))}}@keyframes custom-provider-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.custom-providers-section .onboarding-disclosure-content{margin-top:var(--space-sm);display:flex;flex-direction:column;gap:var(--space-sm)}.custom-provider-list{display:flex;flex-direction:column;gap:var(--space-sm)}.custom-provider-item{display:flex;align-items:center;justify-content:space-between;padding:var(--space-sm) var(--space-md);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);transition:border-color var(--transition-fast),box-shadow var(--transition-fast)}.custom-provider-item:hover{border-color:var(--text-dim)}.custom-provider-item-info{display:flex;flex-direction:column;gap:var(--space-xs);min-width:0}.custom-provider-item-name{font-weight:600;color:var(--text)}.custom-provider-item-meta{color:var(--text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.custom-provider-item-actions{display:flex;gap:var(--space-xs);flex-shrink:0}.custom-provider-badge{display:inline-flex;align-items:center;padding:var(--space-xs);border-radius:var(--radius-pill);background:color-mix(in srgb,var(--color-info) 15%,transparent);color:var(--color-info)}.custom-provider-empty{color:var(--text-muted);padding:var(--space-sm) 0}.custom-provider-add-btn{margin-top:var(--space-sm)}.custom-provider-form{padding:var(--space-md);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);margin-top:var(--space-sm)}.custom-provider-form-row{margin-bottom:var(--space-sm)}.custom-provider-form-actions{display:flex;gap:var(--space-sm);margin-top:var(--space-md)}.custom-provider-form-error{display:flex;align-items:center;gap:var(--space-xs);color:var(--color-error);margin-top:var(--space-xs);background:color-mix(in srgb,var(--color-error) 10%,transparent);padding:var(--space-xs) var(--space-sm);border-radius:var(--radius-sm)}.custom-provider-item-edit-form{margin-top:var(--space-xs)}.spin{animation:custom-provider-spin calc(var(--transition-slow) * 4) linear infinite}@media(max-width:768px){.custom-provider-item{flex-direction:column;align-items:flex-start;gap:var(--space-xs)}.custom-provider-item-meta{max-width:100%}.custom-provider-form{padding:var(--space-sm)}.custom-provider-item-actions{align-self:flex-end;margin-top:var(--space-xs)}}.agent-provisioning-policy-editor{display:flex;flex-direction:column;gap:var(--space-sm);padding:var(--space-lg);border:1px solid var(--border);border-radius:var(--radius-lg)}.agent-provisioning-policy-help{color:var(--text-muted);font-size:.75rem;margin:0}.agent-provisioning-policy-help code{font-family:var(--font-mono)}.agent-provisioning-policy-textarea{min-height:calc(var(--space-2xl) + var(--space-xl));resize:vertical}@media(max-width:768px){.agent-provisioning-policy-editor{padding:var(--space-md)}}