@runfusion/fusion 0.28.0 → 0.29.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.
- package/dist/bin.js +3126 -1051
- package/dist/client/assets/AgentDetailView-CWyOv8HJ.js +18 -0
- package/dist/client/assets/{AgentDetailView-DSpIqBOs.css → AgentDetailView-ChIKbcEi.css} +1 -1
- package/dist/client/assets/AgentsView-BI_CESkd.css +1 -0
- package/dist/client/assets/AgentsView-DljrBNE1.js +34 -0
- package/dist/client/assets/ChatView-BklDUi5_.js +1 -0
- package/dist/client/assets/{DevServerView-Diw4hjw0.js → DevServerView-BqcI1wXr.js} +1 -1
- package/dist/client/assets/{DirectoryPicker-CWSApoLU.js → DirectoryPicker-Bb3TIWEa.js} +1 -1
- package/dist/client/assets/{DocumentsView-1kr0dhsV.js → DocumentsView-BhrdTTh3.js} +1 -1
- package/dist/client/assets/{EvalsView-cDfXYiK6.js → EvalsView-DrFp2cLg.js} +1 -1
- package/dist/client/assets/{ExperimentalAgentOnboardingModal-lNSf6UtY.js → ExperimentalAgentOnboardingModal-AsmRLMxm.js} +1 -1
- package/dist/client/assets/ExperimentalAgentOnboardingModal-BNpveCEk.css +1 -0
- package/dist/client/assets/{InsightsView-D2AjxOnu.js → InsightsView-j7J_vUME.js} +1 -1
- package/dist/client/assets/{MemoryView-Dq4yjIPI.js → MemoryView-QWiqVDuQ.js} +2 -2
- package/dist/client/assets/{NodesView-Cpmkze7n.js → NodesView-Cr4CXr7b.js} +1 -1
- package/dist/client/assets/{PiExtensionsManager-oi9FHT0y.js → PiExtensionsManager-CPZ-82Wl.js} +2 -2
- package/dist/client/assets/PluginManager-BJQXdUmV.css +1 -0
- package/dist/client/assets/{PluginManager-o12KG4e8.js → PluginManager-DShC4UiM.js} +1 -1
- package/dist/client/assets/{ResearchView-C9bjVB7-.js → ResearchView-B5wYC1KE.js} +1 -1
- package/dist/client/assets/{SettingsModal-CT01a5Rh.js → SettingsModal-8l8vfXns.js} +1 -1
- package/dist/client/assets/SettingsModal-BAx4gt2A.css +1 -0
- package/dist/client/assets/SettingsModal-CYetgxZj.js +31 -0
- package/dist/client/assets/SettingsModal-ChnabMhF.css +1 -0
- package/dist/client/assets/{SetupWizardModal-Agi3XNtZ.js → SetupWizardModal-_IK6hTA7.js} +1 -1
- package/dist/client/assets/SkillsView-CUbSBeZ2.css +1 -0
- package/dist/client/assets/{SkillsView-DmZfbGLs.js → SkillsView-Dilmj1nh.js} +1 -1
- package/dist/client/assets/{StashRecoveryView-BwKJQaUW.js → StashRecoveryView-BtL9aAn3.js} +1 -1
- package/dist/client/assets/{TodoView-uJRg4Cnl.js → TodoView-rSn0aPsb.js} +1 -1
- package/dist/client/assets/{dashboard-view-C7Snlgow.js → dashboard-view-C_G8JVU7.js} +1 -1
- package/dist/client/assets/{folder-open-DU-Ec_iC.js → folder-open-Bq_TweLR.js} +1 -1
- package/dist/client/assets/index-DjfAYMGG.css +1 -0
- package/dist/client/assets/index-tbwUVj8p.js +696 -0
- package/dist/client/assets/{star-Qi0GspVN.js → star-Dn0V0Cnq.js} +1 -1
- package/dist/client/assets/{upload-Dx_l9Vbu.js → upload-D1y22Www.js} +1 -1
- package/dist/client/assets/{users-3Qw_TMah.js → users-UQdBpweI.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/client/version.json +1 -1
- package/dist/droid-cli/package.json +1 -1
- package/dist/extension.js +2499 -656
- package/dist/pi-claude-cli/package.json +1 -1
- package/dist/plugins/fusion-plugin-cli-printing-press/package.json +1 -1
- package/dist/plugins/fusion-plugin-cli-printing-press/src/__tests__/registration.test.ts +20 -3
- package/dist/plugins/fusion-plugin-cli-printing-press/src/__tests__/workflow-integration.test.ts +103 -8
- package/dist/plugins/fusion-plugin-cli-printing-press/src/index.ts +4 -0
- package/dist/plugins/fusion-plugin-cli-printing-press/src/workflow-steps.ts +14 -0
- package/dist/plugins/fusion-plugin-cursor-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-dependency-graph/package.json +1 -1
- package/dist/plugins/fusion-plugin-droid-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-hermes-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-openclaw-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-paperclip-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-reports/package.json +1 -1
- package/dist/plugins/fusion-plugin-roadmap/package.json +1 -1
- package/dist/plugins/fusion-plugin-whatsapp-chat/package.json +1 -1
- package/package.json +1 -1
- package/skill/fusion/references/extension-tools.md +5 -5
- package/skill/fusion/references/fusion-capabilities.md +5 -5
- package/dist/client/assets/AgentDetailView-V32TpEe1.js +0 -18
- package/dist/client/assets/AgentsView-B3ADnF0D.css +0 -1
- package/dist/client/assets/AgentsView-CxITZE-U.js +0 -34
- package/dist/client/assets/ChatView-7WPHyB_7.js +0 -1
- package/dist/client/assets/ExperimentalAgentOnboardingModal-B-APN_lM.css +0 -1
- package/dist/client/assets/PluginManager-C4UoLv4U.css +0 -1
- package/dist/client/assets/SettingsModal-Ci0_sqbU.css +0 -1
- package/dist/client/assets/SettingsModal-Cu93Jjho.js +0 -31
- package/dist/client/assets/SettingsModal-DWKgRxBA.css +0 -1
- package/dist/client/assets/SkillsView-Cytf009Z.css +0 -1
- package/dist/client/assets/index-CD0_dkME.css +0 -1
- package/dist/client/assets/index-DiewofJh.js +0 -692
package/dist/client/assets/{PiExtensionsManager-oi9FHT0y.js → PiExtensionsManager-CPZ-82Wl.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{r as l,j as e}from"./vendor-react-K0fH_qHe.js";import{c as J,
|
|
1
|
+
import{r as l,j as e}from"./vendor-react-K0fH_qHe.js";import{c as J,eA as Q,eB as V,eC as Y,R as $,ep as y,I as Z,a as T,b as ee,W as se,eD as L,cI as D,F as I,eE as ae,eF as te,eG as A,X as ie}from"./index-tbwUVj8p.js";import"./vendor-xterm-DzcZoU0P.js";/**
|
|
2
2
|
* @license lucide-react v1.7.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const ne=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],
|
|
6
|
+
*/const ne=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],G=J("palette",ne);function le(t){return t.replace(/-/g,"-")}function ce(t){return{"fusion-global":"Fusion Global","pi-global":"Pi Global","fusion-project":"Fusion Project","pi-project":"Pi Project",package:"Package"}[t]??t}function re(t){return t.startsWith("npm:")?"npm":t.startsWith("git:")?"git":"local"}function oe(t){return t.replace(/^(npm:|git:)/,"")}function pe({addToast:t,projectId:x}){const[c,W]=l.useState(null),[f,P]=l.useState(!0),[N,E]=l.useState(!1),[S,w]=l.useState(!1),[h,F]=l.useState(""),[B,M]=l.useState(new Set),[p,O]=l.useState([]),[b,C]=l.useState(!0),[_,R]=l.useState(!1),r=l.useCallback(async()=>{try{P(!0);const s=await Q();W(s)}catch(s){t(`Failed to load Pi settings: ${s instanceof Error?s.message:String(s)}`,"error")}finally{P(!1)}},[t]),m=l.useCallback(async()=>{try{C(!0);const s=await V(x);O(s.extensions)}catch(s){t(`Failed to load extensions: ${s instanceof Error?s.message:String(s)}`,"error")}finally{C(!1)}},[t,x]),q=l.useCallback(async s=>{try{R(!0);const i=s.enabled?[...p.filter(a=>a.enabled&&a.id!==s.id).map(a=>a.id),s.id]:p.filter(a=>a.enabled&&a.id!==s.id).map(a=>a.id);await Y(i,x),await m(),t(s.enabled?"Extension disabled":"Extension enabled","success")}catch(i){t(`Failed to update extension: ${i instanceof Error?i.message:String(i)}`,"error")}finally{R(!1)}},[p,x,m,t]);l.useEffect(()=>{r()},[r]),l.useEffect(()=>{m()},[m]);const K=s=>{M(i=>{const a=new Set(i);return a.has(s)?a.delete(s):a.add(s),a})},z=async()=>{if(!h.trim()){t("Please enter a package source","error");return}try{E(!0),await ae(h.trim()),t("Package installed successfully","success"),F(""),await r()}catch(s){t(`Failed to install package: ${s instanceof Error?s.message:String(s)}`,"error")}finally{E(!1)}},U=async()=>{try{w(!0),await te(x),await Promise.all([r(),m()]),t("Fusion skill reinstalled successfully","success")}catch(s){t(`Failed to reinstall Fusion skill: ${s instanceof Error?s.message:String(s)}`,"error")}finally{w(!1)}},X=async s=>{if(!c)return;const i=c.packages.filter(a=>(typeof a=="string"?a:a.source)!==s);try{await A({packages:i}),t("Package removed","success"),await r()}catch(a){t(`Failed to remove package: ${a instanceof Error?a.message:String(a)}`,"error")}},H=async(s,i)=>{if(!c)return;const a=c[s].filter(n=>n!==i);try{await A({[s]:a}),t(`${s.slice(0,-1)} removed`,"success"),await r()}catch(n){t(`Failed to update settings: ${n instanceof Error?n.message:String(n)}`,"error")}},u=(s,i,a)=>!c||c[a].length===0?null:e.jsxs("div",{className:"pi-ext-section",children:[e.jsxs("div",{className:"pi-ext-section-header",children:[e.jsx(i,{size:14}),e.jsx("span",{children:s}),e.jsx("span",{className:"pi-ext-count",children:c[a].length})]}),e.jsx("div",{className:"pi-ext-resource-list",children:c[a].map((n,g)=>e.jsxs("span",{className:"pi-ext-resource-tag",children:[e.jsx("span",{className:"pi-ext-resource-path",children:n}),e.jsx("button",{className:"btn-icon touch-target pi-ext-resource-remove",onClick:()=>H(a,n),title:`Remove ${n}`,"aria-label":`Remove ${n}`,children:e.jsx(ie,{})})]},g))})]});return e.jsxs("div",{className:"pi-ext-manager",children:[e.jsxs("div",{className:"pi-ext-manager-header",children:[e.jsx("h4",{className:"pi-ext-manager-title",children:"Pi Extensions"}),e.jsx("div",{className:"pi-ext-manager-actions",children:e.jsx("button",{className:"btn-icon",onClick:r,title:"Refresh",disabled:f,children:e.jsx($,{size:16,className:f?"spin":""})})})]}),f?e.jsx("div",{className:"loading-state",children:"Loading Pi settings…"}):c?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"pi-ext-add-form",children:[e.jsxs("div",{className:"pi-ext-add-form-row",children:[e.jsx("input",{type:"text",className:"input",placeholder:"npm:pi-extension-name or git:https://github.com/...",value:h,onChange:s=>F(s.target.value),onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),z())},disabled:N}),e.jsxs("button",{className:"btn btn-primary",onClick:z,disabled:N||!h.trim(),children:[e.jsx(Z,{size:14}),N?"Installing…":"Add"]})]}),e.jsx("div",{className:"pi-ext-add-form-row",children:e.jsx("button",{className:"btn",onClick:U,disabled:S,children:S?"Reinstalling Fusion…":"Reinstall Fusion skill"})})]}),c.packages.length>0?e.jsx("div",{className:"pi-ext-package-list",children:c.packages.map((s,i)=>{const a=typeof s=="string"?s:s.source,n=re(a),g=oe(a),j=typeof s=="object"&&s!==null,v=j&&(s.extensions?.length??0)>0||(s.skills?.length??0)>0||(s.prompts?.length??0)>0||(s.themes?.length??0)>0,k=B.has(i);return e.jsxs("div",{className:"pi-ext-package-card",children:[e.jsxs("div",{className:"pi-ext-package-header",children:[j&&v?e.jsx("button",{className:"pi-ext-expand-btn",onClick:()=>K(i),"aria-expanded":k,children:k?e.jsx(T,{size:14}):e.jsx(ee,{size:14})}):e.jsx("span",{className:"pi-ext-expand-placeholder"}),e.jsx("span",{className:`pi-ext-source-badge pi-ext-source-badge--${n}`,children:n}),e.jsx("span",{className:"pi-ext-package-source",children:g}),e.jsxs("div",{className:"pi-ext-package-actions",children:[j&&v&&e.jsxs("span",{className:"pi-ext-filter-hint",children:[s.extensions?.length??0," ext,"," ",s.skills?.length??0," skill,"," ",s.prompts?.length??0," prompt,"," ",s.themes?.length??0," theme"]}),e.jsx("button",{className:"btn-icon touch-target pi-ext-remove-btn",onClick:()=>X(a),title:"Remove package","aria-label":`Remove package ${g}`,children:e.jsx(se,{size:14})})]})]}),j&&v&&k&&e.jsxs("div",{className:"pi-ext-filter-list",children:[s.extensions?.length?e.jsxs("div",{className:"pi-ext-filter-section",children:[e.jsx(L,{size:12}),e.jsx("span",{className:"pi-ext-filter-label",children:"Extensions:"}),s.extensions.map((o,d)=>e.jsx("span",{className:"pi-ext-filter-tag",children:o},d))]}):null,s.skills?.length?e.jsxs("div",{className:"pi-ext-filter-section",children:[e.jsx(D,{size:12}),e.jsx("span",{className:"pi-ext-filter-label",children:"Skills:"}),s.skills.map((o,d)=>e.jsx("span",{className:"pi-ext-filter-tag",children:o},d))]}):null,s.prompts?.length?e.jsxs("div",{className:"pi-ext-filter-section",children:[e.jsx(I,{size:12}),e.jsx("span",{className:"pi-ext-filter-label",children:"Prompts:"}),s.prompts.map((o,d)=>e.jsx("span",{className:"pi-ext-filter-tag",children:o},d))]}):null,s.themes?.length?e.jsxs("div",{className:"pi-ext-filter-section",children:[e.jsx(G,{size:12}),e.jsx("span",{className:"pi-ext-filter-label",children:"Themes:"}),s.themes.map((o,d)=>e.jsx("span",{className:"pi-ext-filter-tag",children:o},d))]}):null]})]},i)})}):e.jsxs("div",{className:"empty-state",children:[e.jsx(y,{size:32,className:"text-muted"}),e.jsx("p",{children:"No packages configured."}),e.jsx("p",{className:"text-muted",children:"Add a package source above to get started."})]}),e.jsxs("div",{className:"pi-ext-top-level",children:[u("Extensions",L,"extensions"),u("Skills",D,"skills"),u("Prompts",I,"prompts"),u("Themes",G,"themes")]})]}):e.jsxs("div",{className:"empty-state",children:[e.jsx(y,{size:32,className:"text-muted"}),e.jsx("p",{children:"Failed to load Pi settings."})]}),e.jsxs("div",{className:"pi-ext-discovered-section",children:[e.jsxs("div",{className:"pi-ext-discovered-header",children:[e.jsx("h4",{children:"Discovered Extensions"}),e.jsx("button",{className:"btn-icon",onClick:m,disabled:b,title:"Refresh extensions",children:e.jsx($,{className:b?"spin":""})})]}),e.jsx("p",{className:"pi-ext-description",children:"Installed extensions resolved from packages and configured paths."}),b?e.jsx("div",{className:"loading-state",children:"Loading extensions…"}):p.length===0?e.jsxs("div",{className:"empty-state",children:[e.jsx(y,{size:32,className:"text-muted"}),e.jsx("p",{children:"No extensions discovered."})]}):e.jsx("div",{className:"pi-ext-list",children:p.map(s=>e.jsxs("div",{className:"pi-ext-item",children:[e.jsxs("div",{className:"pi-ext-item-content",children:[e.jsxs("div",{className:"pi-ext-info",children:[e.jsx("span",{className:"pi-ext-name",children:s.name}),e.jsx("span",{className:`pi-ext-source-badge pi-ext-source-badge--${le(s.source)}`,children:ce(s.source)})]}),e.jsx("span",{className:"pi-ext-path",children:s.path})]}),e.jsx("div",{className:"pi-ext-actions",children:e.jsxs("label",{className:"toggle-switch",children:[e.jsx("input",{type:"checkbox",checked:s.enabled,onChange:()=>void q(s),disabled:_,"aria-label":`Toggle ${s.name}`}),e.jsx("span",{className:"toggle-slider"})]})})]},s.id))})]})]})}export{pe as PiExtensionsManager};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.plugin-manager,.plugin-manager-detail{display:flex;flex-direction:column;gap:var(--space-lg);padding-inline:var(--space-xl);padding-block:var(--space-md)}.plugin-manager-header{display:flex;align-items:center;justify-content:space-between;padding-bottom:var(--space-sm);border-bottom:var(--btn-border-width) solid var(--border);gap:var(--space-sm)}.plugin-manager-header-title{font-size:var(--font-size-sm, .85rem);font-weight:600;color:var(--text);flex:1}.plugin-manager-actions{display:flex;gap:var(--space-sm);align-items:center}.plugin-install-form{display:flex;flex-direction:column;gap:var(--space-sm);padding:var(--space-lg);border:var(--btn-border-width) solid var(--border);border-radius:var(--radius-md);background:var(--surface)}.plugin-install-hint{margin:0;font-size:var(--font-size-sm, .85rem);color:var(--text-muted);line-height:1.45}.plugin-install-hint code{padding:var(--btn-border-width) var(--space-xs);border-radius:var(--radius-sm);background:color-mix(in srgb,var(--text-muted) 12%,transparent);font-size:.85em}.plugin-install-actions{display:flex;gap:var(--space-sm);justify-content:flex-end}.plugin-list{display:flex;flex-direction:column;gap:var(--space-sm)}.plugin-item{display:flex;align-items:center;justify-content:space-between;padding:var(--space-md) var(--space-lg);background:var(--surface);border:var(--btn-border-width) solid var(--border);border-radius:var(--radius-md);transition:border-color var(--transition-fast)}.plugin-item:hover{border-color:var(--text-dim)}.plugin-info{display:flex;align-items:center;gap:var(--space-sm);min-width:0;flex:1}.plugin-copy{display:flex;flex-direction:column;gap:var(--space-xs);min-width:0}.plugin-copy-header{display:flex;align-items:center;gap:var(--space-sm);min-width:0;flex-wrap:wrap}.plugin-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.plugin-version{font-size:var(--font-size-sm, .85rem)}.plugin-state-badge{display:inline-flex;align-items:center;padding:var(--space-xs) var(--space-sm);border-radius:var(--radius-pill);font-size:var(--font-size-3xs, .7rem);font-weight:600;text-transform:uppercase;letter-spacing:.04em;background:color-mix(in srgb,currentColor 12%,transparent)}.plugin-actions{display:flex;align-items:center;gap:var(--space-xs);flex-shrink:0}.plugin-manager-detail-header,.plugin-detail-title{display:flex;align-items:center;gap:var(--space-md);flex-wrap:wrap}.plugin-detail-title-copy{display:flex;flex-direction:column;gap:var(--space-xs);min-width:0}.plugin-detail-name{margin:0}.plugin-error-text{margin:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--font-size-xs, .8rem);font-family:var(--font-mono);color:var(--color-error);background:color-mix(in srgb,var(--color-error) 10%,transparent);border-radius:var(--radius-sm);padding:var(--space-xs) var(--space-sm)}.plugin-error-text--detail{max-width:min(100%,32rem);overflow:visible;text-overflow:clip;white-space:normal;overflow-wrap:anywhere}.plugin-detail-content{display:flex;flex-direction:column;gap:var(--space-lg)}.plugin-detail-card{background:var(--surface);border:var(--btn-border-width) solid var(--border);border-radius:var(--radius-md);padding:var(--space-lg);display:flex;flex-direction:column;gap:var(--space-md)}.plugin-description{font-size:var(--font-size-md, .95rem);color:var(--text-muted);line-height:1.5}.plugin-detail-meta-row{display:flex;align-items:center;gap:var(--space-xs);font-size:var(--font-size-base, .9rem);color:var(--text-muted)}.plugin-homepage{flex-wrap:wrap;align-items:flex-start}.plugin-homepage a{display:inline-flex;align-items:center;gap:var(--space-xs);color:var(--color-info);font-size:var(--font-size-sm, .85rem);flex-wrap:wrap;overflow-wrap:anywhere}.plugin-detail-section-heading{margin:0;padding:0;border:0;font-size:var(--font-size-md, .95rem)}.plugin-settings-form{display:flex;flex-direction:column;gap:var(--space-lg);margin-top:var(--space-xs)}.plugin-settings-form .form-group{padding:0;margin:0}.plugin-settings-group{display:flex;flex-direction:column;gap:var(--space-md)}.plugin-settings-group-heading{margin:0;font-size:var(--font-size-xs, .8rem);font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--text-muted)}.plugin-settings-array{display:flex;flex-direction:column;gap:var(--space-sm)}.plugin-settings-array-item{display:flex;align-items:center;gap:var(--space-sm)}.plugin-settings-array-item input{flex:1}.plugin-security-row{display:flex;align-items:center;justify-content:space-between;gap:var(--space-sm);flex-wrap:wrap}.plugin-security-results{display:flex;flex-direction:column;gap:var(--space-sm)}.plugin-security-header{display:flex;gap:var(--space-sm);align-items:center}.plugin-security-summary{margin:0}.plugin-security-badge{font-weight:700}.plugin-security-badge--warning,.plugin-security-badge--unavailable{color:var(--color-warning)}.plugin-security-badge--blocked,.plugin-security-badge--error{color:var(--color-error)}.plugin-security-findings{margin:0;padding-inline-start:var(--space-lg);display:flex;flex-direction:column;gap:var(--space-xs)}.plugin-detail-actions{display:flex;gap:var(--space-sm);padding-top:var(--space-md);border-top:var(--btn-border-width) solid var(--border);justify-content:flex-end}.plugin-manager .empty-state,.plugin-manager .loading-state,.plugin-manager .settings-empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--space-sm);padding:var(--space-2xl);text-align:center;color:var(--text-muted)}.plugin-builtins-section{display:flex;flex-direction:column;gap:var(--space-sm)}.plugin-builtins-header{display:flex;flex-direction:column;gap:var(--space-xs)}.plugin-builtins-heading{margin:0;font-size:var(--font-size-md, .95rem)}.plugin-builtins-description{margin:0;font-size:var(--font-size-sm, .85rem);color:var(--text-muted)}.plugin-builtins-list{width:100%;display:flex;flex-direction:column;gap:var(--space-sm);margin-top:var(--space-sm)}.plugin-builtins-item{display:flex;align-items:center;justify-content:space-between;gap:var(--space-sm);padding:var(--space-sm) var(--space-md);border:var(--btn-border-width) solid var(--border);border-radius:var(--radius-md);background:var(--surface)}.plugin-builtins-meta{display:flex;align-items:center;gap:var(--space-sm);row-gap:var(--space-xs);flex-wrap:wrap;min-width:0}.plugin-builtins-name{color:var(--text);font-size:var(--font-size-base, .9rem);font-weight:500}.plugin-builtins-runtime-badge{display:inline-flex;align-items:center;padding:var(--btn-border-width) var(--space-xs);border-radius:var(--radius-pill);background:var(--status-in-review-bg);color:var(--in-review);font-size:var(--font-size-2xs, .75rem);font-weight:600;text-transform:uppercase}.plugin-builtins-status{display:inline-flex;align-items:center;padding:var(--btn-border-width) var(--space-xs);border-radius:var(--radius-pill);font-size:var(--font-size-2xs, .75rem);font-weight:600;text-transform:uppercase}.plugin-builtins-status--installed{background:var(--status-done-bg);color:var(--done)}.plugin-builtins-status--available{background:var(--status-todo-bg);color:var(--todo)}.plugin-builtins-setup-status{display:inline-flex;align-items:center;padding:var(--btn-border-width) var(--space-xs);border-radius:var(--radius-pill);font-size:var(--font-size-2xs, .75rem);font-weight:600;text-transform:uppercase}.plugin-builtins-setup-status--warning{background:var(--status-in-review-bg);color:var(--color-warning)}.plugin-builtins-setup-status--ready{background:var(--status-done-bg);color:var(--color-success)}.plugin-builtins-setup-status--pending{background:var(--status-todo-bg);color:var(--color-warning)}.plugin-builtins-setup-status--deferred{background:var(--status-archived-bg);color:var(--text-muted)}.plugin-builtins-description-text{flex:1 1 100%;color:var(--text-muted);font-size:var(--font-size-sm, .85rem)}.plugin-builtins-metadata-only{color:var(--text-muted);font-size:var(--font-size-xs, .8rem);font-weight:600;text-transform:uppercase}.plugin-bundled-runtime-list{width:100%;display:flex;flex-direction:column;gap:var(--space-sm);margin-top:var(--space-sm)}.plugin-bundled-runtime-item{display:flex;align-items:center;justify-content:space-between;gap:var(--space-sm);padding:var(--space-sm) var(--space-md);border:var(--btn-border-width) solid var(--border);border-radius:var(--radius-md);background:var(--surface)}.plugin-bundled-runtime-meta{display:flex;align-items:center;gap:var(--space-sm);row-gap:var(--space-xs);flex-wrap:wrap;min-width:0}.plugin-bundled-runtime-name{color:var(--text);font-size:var(--font-size-base, .9rem);font-weight:500}.plugin-bundled-runtime-badge{display:inline-flex;align-items:center;padding:var(--btn-border-width) var(--space-xs);border-radius:var(--radius-pill);background:var(--status-in-review-bg);color:var(--in-review);font-size:var(--font-size-2xs, .75rem);font-weight:600;text-transform:uppercase}.plugin-bundled-runtime-section{display:flex;flex-direction:column;gap:var(--space-sm)}.plugin-bundled-runtime-header{display:flex;flex-direction:column;gap:var(--space-xs)}.plugin-bundled-runtime-heading{margin:0;font-size:var(--font-size-md, .95rem)}.plugin-bundled-runtime-description{margin:0;font-size:var(--font-size-sm, .85rem);color:var(--text-muted)}.plugin-bundled-runtime-status{display:inline-flex;align-items:center;padding:var(--btn-border-width) var(--space-xs);border-radius:var(--radius-pill);font-size:var(--font-size-2xs, .75rem);font-weight:600;text-transform:uppercase}@media(min-width:769px){.plugin-builtins-status,.plugin-bundled-runtime-status{margin-left:auto}}.plugin-bundled-runtime-status--installed{background:var(--status-done-bg);color:var(--done)}.plugin-bundled-runtime-status--available{background:var(--status-todo-bg);color:var(--todo)}@media(max-width:768px){.plugin-manager,.plugin-manager-detail{padding-inline:var(--space-sm)}.plugin-manager-detail-header{gap:var(--space-sm)}.plugin-detail-title{gap:var(--space-xs)}.plugin-detail-card{padding:var(--space-md);gap:var(--space-sm)}.plugin-list{gap:var(--space-xs)}.plugin-item{padding:var(--space-md);flex-direction:column;align-items:stretch;gap:var(--space-sm)}.plugin-info{width:100%;flex-wrap:wrap;row-gap:var(--space-xs)}.plugin-name{flex:1 1 100%;white-space:normal}.plugin-actions{width:100%;justify-content:flex-end;flex-wrap:wrap;gap:var(--space-sm)}.plugin-actions .btn-icon,.plugin-actions .toggle-switch{min-width:36px;min-height:36px}.plugin-actions .toggle-switch{display:inline-flex;align-items:center;justify-content:center}.plugin-security-row{align-items:flex-start}.plugin-detail-actions{flex-wrap:wrap;justify-content:flex-start}.plugin-detail-actions button{flex:1 1 auto;min-height:36px}.plugin-builtins-item,.plugin-bundled-runtime-item{flex-direction:column;align-items:stretch}.plugin-builtins-item .btn,.plugin-bundled-runtime-item .btn{min-height:36px}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as g,j as e}from"./vendor-react-K0fH_qHe.js";import{v as ye,el as je,em as Z,s as Ne,X as Y,at as Se,aR as ve,I as T,aZ as ee,W as se,R as we,en as Ce,ap as Ie,eo as $e,ep as Pe,cx as Re,eq as Ee,er as ke,es as Be,et as Le,eu as te,cu as Ae,ev as Fe}from"./index-DiewofJh.js";import{D as De}from"./DirectoryPicker-CWSApoLU.js";import"./vendor-xterm-DzcZoU0P.js";import"./folder-open-DU-Ec_iC.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 He({addToast:i,projectId:c}){const[h,x]=g.useState([]),[f,N]=g.useState(!0),[re,$]=g.useState(!1),[w,P]=g.useState(""),[B,L]=g.useState(!1),[A,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 Z(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 M=async()=>{if(!w.trim()){i("Please enter a plugin path","error");return}try{L(!0),await te({path:w,...A?{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{L(!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)}},V=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 Z(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)}},_=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 Le(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 Ae(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(Y,{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(Y,{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:()=>_(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 V(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){V(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(),M())}}),e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:A,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:M,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):_(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,He as PluginManager,I as STATE_COLORS};
|
|
1
|
+
import{r as g,j as e}from"./vendor-react-K0fH_qHe.js";import{v as ye,en as je,eo as Z,s as Ne,X as Y,at as Se,aR as ve,I as T,aZ as ee,W as se,R as we,ep as Ce,ap as Ie,eq as $e,er as Pe,cy as Re,es as Ee,et as ke,eu as Be,ev as Le,ew as te,cv as Ae,ex as Fe}from"./index-tbwUVj8p.js";import{D as De}from"./DirectoryPicker-Bb3TIWEa.js";import"./vendor-xterm-DzcZoU0P.js";import"./folder-open-Bq_TweLR.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 He({addToast:i,projectId:c}){const[h,x]=g.useState([]),[f,N]=g.useState(!0),[re,$]=g.useState(!1),[w,P]=g.useState(""),[B,L]=g.useState(!1),[A,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 Z(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 M=async()=>{if(!w.trim()){i("Please enter a plugin path","error");return}try{L(!0),await te({path:w,...A?{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{L(!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)}},V=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 Z(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)}},_=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 Le(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 Ae(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(Y,{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(Y,{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:()=>_(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 V(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){V(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(),M())}}),e.jsxs("label",{className:"checkbox-label",children:[e.jsx("input",{type:"checkbox",checked:A,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:M,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):_(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,He as PluginManager,I as STATE_COLORS};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,j as e}from"./vendor-react-K0fH_qHe.js";import{aw as ie,ax as le,s as oe,ay as de,az as ue,aA as he,aB as me,aC as be,aD as fe,ah as ve,u as xe,aE as pe,x as ye,aF as ge,L as je,S as Re}from"./index-DiewofJh.js";import"./vendor-xterm-DzcZoU0P.js";const _e="builtin",G={pageFetch:!0,github:!1,localDocs:!0,llmSynthesis:!0};function X(n){const t=n?.researchGlobalDefaults,i=n?.researchSettings;return{enabled:i?.enabled??n?.researchEnabled??n?.researchGlobalEnabled??!0,searchProvider:i?.searchProvider??t?.searchProvider??n?.researchGlobalWebSearchProvider??_e,synthesisProvider:i?.synthesisProvider??t?.synthesisProvider,synthesisModelId:i?.synthesisModelId??t?.synthesisModelId,enabledSources:{webSearch:!0,pageFetch:i?.enabledSources?.pageFetch??t?.enabledSources?.pageFetch??G.pageFetch,github:i?.enabledSources?.github??t?.enabledSources?.github??G.github,localDocs:i?.enabledSources?.localDocs??t?.enabledSources?.localDocs??G.localDocs,llmSynthesis:i?.enabledSources?.llmSynthesis??t?.enabledSources?.llmSynthesis??G.llmSynthesis},limits:{maxConcurrentRuns:i?.limits?.maxConcurrentRuns??n?.researchMaxConcurrentRuns??n?.researchGlobalMaxConcurrentRuns??3,maxSourcesPerRun:i?.limits?.maxSourcesPerRun??t?.maxSourcesPerRun??n?.researchMaxSourcesPerRun??n?.researchGlobalMaxSourcesPerRun??20,maxDurationMs:i?.limits?.maxDurationMs??n?.researchDefaultTimeout??n?.researchGlobalDefaultTimeout??3e5,requestTimeoutMs:i?.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 i=n;return{message:n.message,status:n.status,code:i.researchCode??"INTERNAL_ERROR",setupHint:i.setupHint,retryable:i.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),i=n.status==="queued"||n.status==="running",f=n.lifecycle?.retryable,h=n.status==="failed"||n.status==="timed_out",a=!!(h&&f);let p;return!i&&t?p="Run is already transitioning":!i&&n.status==="completed"?p="Completed runs cannot be cancelled":!i&&n.status==="cancelled"?p="Run is already cancelled":!i&&n.status==="retry_exhausted"?p="Retry attempts exhausted":!i&&n.status==="failed"?p="Failed runs cannot be cancelled":!i&&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:i,retryable:a,isTransitioning:t,blockingReason:p}}function Ee(n){const t=n?.projectId,[i,f]=c.useState([]),[h,a]=c.useState(null),[p,R]=c.useState(null),[g,N]=c.useState({available:!0}),[E,T]=c.useState(!0),[L,P]=c.useState(null),[F,j]=c.useState(null),[_,D]=c.useState(""),C=c.useRef(0),k=c.useRef(0),S=c.useRef(t);c.useEffect(()=>{S.current!==t&&(S.current=t,k.current++)},[t]);const v=c.useCallback(async(l=_)=>{const r=++C.current,o=t;P(null),j(null);try{const y=await ie({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),R(null))}catch(y){if(r!==C.current||o!==t)return;const b=Z(y,"Failed to load research runs");P(b.message),j(b)}finally{r===C.current&&T(!1)}},[t,_,h]),x=c.useCallback(async l=>{const r=await le(l,t);return R(r.run),N(r.availability),r.run},[t]);return c.useEffect(()=>{T(!0);const l=window.setTimeout(()=>{v(_)},Se);return()=>window.clearTimeout(l)},[v,_]),c.useEffect(()=>{if(!h){R(null);return}x(h)},[x,h]),c.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:i,selectedRun:p,selectedRunId:h,setSelectedRunId:a,availability:g,loading:E,error:L,searchQuery:_,setSearchQuery:D,refresh:v,createRun:l=>fe(l,t),cancelRun:async l=>{try{j(null);const r=await be(l,t);return h===l&&R(r.run),await v(),r}catch(r){const o=Z(r,"Failed to cancel run");throw j(o),o}},retryRun:async l=>{try{j(null);const r=await me(l,t);return h===l&&R(r.run),await v(),r}catch(r){const o=Z(r,"Failed to retry run");throw j(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:i.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:i,finding:f,projectId:h,onClose:a,onConfirm:p}){xe(n);const[R,g]=c.useState(!1),[N,E]=c.useState(""),[T,L]=c.useState(""),[P,F]=c.useState("normal"),[j,_]=c.useState(""),[D,C]=c.useState([]),[k,S]=c.useState(!1),[v,x]=c.useState(!1),l=c.useMemo(()=>{const r=(f.content??"").split(/(?<=[.!?])\s+/)[0]??"";return`${f.heading||"Research finding"} — ${r}`.trim()},[f.content,f.heading]);return c.useEffect(()=>{n&&(g(!1),E(`Research: ${f.heading||i.title}`),L(l),F("normal"),_(""),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,i.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:"})," ",i.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:j,placeholder:k?"Loading tasks…":"Enter task ID",onChange: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:R,onChange:r=>g(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"&&!j,onClick:()=>{x(!0),p({taskId:t==="enrich"?j:void 0,title:t==="create"?N.trim():void 0,description:t==="create"?T.trim():void 0,priority:t==="create"?P:void 0,attachExport:R}).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 Me({projectId:n,addToast:t,onOpenSettings:i,readinessVersion:f=0}){const{runs:h,selectedRun:a,selectedRunId:p,setSelectedRunId:R,availability:g,loading:N,error:E,searchQuery:T,setSearchQuery:L,createRun:P,cancelRun:F,retryRun:j,exportRun:_,createTaskFromRun:D,attachRunToTask:C,statusCounts:k,refresh:S,uiError:v,runActionState:x}=Ee({projectId:n}),[l,r]=c.useState(""),[o,y]=c.useState(()=>X(void 0)),[b,M]=c.useState([]),[O,V]=c.useState(!1),[ee,se]=c.useState([]),[A,U]=c.useState(null),[I,$]=c.useState(null),B=g.supportedProviders??Te,z=o.searchProvider,Q=s=>s==="web-search"?!0:o.enabledSources[Pe[s]];c.useEffect(()=>{const s=B.filter(d=>Q(d));se(d=>{const m=d.filter(u=>s.includes(u));return m.length>0?m:s})},[o.enabledSources,B]),c.useEffect(()=>{let s=!1;return Promise.all([ye(n),ge().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=c.useMemo(()=>a?a.status:"No run selected",[a]),ne=c.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=g.supportedExportFormats??["markdown","json","html"],W=c.useMemo(()=>new Map(b.map(s=>[s.id,s.authenticated])),[b]),Y=c.useMemo(()=>{const s=new Set;return o.enabledSources.webSearch&&z&&s.add(z),o.enabledSources.llmSynthesis&&o.synthesisProvider&&s.add(o.synthesisProvider),[...s].filter(d=>W.has(d))},[o.enabledSources.llmSynthesis,o.enabledSources.webSearch,o.synthesisProvider,z,W]).find(s=>W.get(s)!==!0),q=c.useMemo(()=>g.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:g.reason??"Research is unavailable for this project.",details:g.setupInstructions,settingsSection:"research-project"},[g.available,g.reason,g.setupInstructions,o.enabled,Y]),H=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 _(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)}}},ce=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});R(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:"Create and track research runs with cited findings."})]}),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:()=>i?.(q.settingsSection),children:"Open Settings"})]})]}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:"research-view__layout",children:[e.jsxs("aside",{className:"research-view__sidebar card",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:B.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 ce(),children:[O?e.jsx(je,{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(Re,{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:()=>R(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 H("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 H("retry",()=>j(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:()=>i?.("authentication"),children:"Open Authentication Settings"}),v.code==="FEATURE_DISABLED"&&e.jsx("button",{className:"btn btn-sm",type:"button",onClick:()=>i?.("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 H("create-task",()=>D(a.id,u,I.findingId,w,te,re),"Task created from research"):m&&await H("attach-task",()=>C(a.id,m,I.findingId,re),"Task enriched from research"),$(null)}}):null})()]})}export{Me as ResearchView};
|
|
1
|
+
import{r as c,j as e}from"./vendor-react-K0fH_qHe.js";import{aw as ie,ax as le,s as oe,ay as de,az as ue,aA as he,aB as me,aC as be,aD as fe,ah as ve,u as xe,aE as pe,x as ye,aF as ge,L as je,S as Re}from"./index-tbwUVj8p.js";import"./vendor-xterm-DzcZoU0P.js";const _e="builtin",G={pageFetch:!0,github:!1,localDocs:!0,llmSynthesis:!0};function X(n){const t=n?.researchGlobalDefaults,i=n?.researchSettings;return{enabled:i?.enabled??n?.researchEnabled??n?.researchGlobalEnabled??!0,searchProvider:i?.searchProvider??t?.searchProvider??n?.researchGlobalWebSearchProvider??_e,synthesisProvider:i?.synthesisProvider??t?.synthesisProvider,synthesisModelId:i?.synthesisModelId??t?.synthesisModelId,enabledSources:{webSearch:!0,pageFetch:i?.enabledSources?.pageFetch??t?.enabledSources?.pageFetch??G.pageFetch,github:i?.enabledSources?.github??t?.enabledSources?.github??G.github,localDocs:i?.enabledSources?.localDocs??t?.enabledSources?.localDocs??G.localDocs,llmSynthesis:i?.enabledSources?.llmSynthesis??t?.enabledSources?.llmSynthesis??G.llmSynthesis},limits:{maxConcurrentRuns:i?.limits?.maxConcurrentRuns??n?.researchMaxConcurrentRuns??n?.researchGlobalMaxConcurrentRuns??3,maxSourcesPerRun:i?.limits?.maxSourcesPerRun??t?.maxSourcesPerRun??n?.researchMaxSourcesPerRun??n?.researchGlobalMaxSourcesPerRun??20,maxDurationMs:i?.limits?.maxDurationMs??n?.researchDefaultTimeout??n?.researchGlobalDefaultTimeout??3e5,requestTimeoutMs:i?.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 i=n;return{message:n.message,status:n.status,code:i.researchCode??"INTERNAL_ERROR",setupHint:i.setupHint,retryable:i.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),i=n.status==="queued"||n.status==="running",f=n.lifecycle?.retryable,h=n.status==="failed"||n.status==="timed_out",a=!!(h&&f);let p;return!i&&t?p="Run is already transitioning":!i&&n.status==="completed"?p="Completed runs cannot be cancelled":!i&&n.status==="cancelled"?p="Run is already cancelled":!i&&n.status==="retry_exhausted"?p="Retry attempts exhausted":!i&&n.status==="failed"?p="Failed runs cannot be cancelled":!i&&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:i,retryable:a,isTransitioning:t,blockingReason:p}}function Ee(n){const t=n?.projectId,[i,f]=c.useState([]),[h,a]=c.useState(null),[p,R]=c.useState(null),[g,N]=c.useState({available:!0}),[E,T]=c.useState(!0),[L,P]=c.useState(null),[F,j]=c.useState(null),[_,D]=c.useState(""),C=c.useRef(0),k=c.useRef(0),S=c.useRef(t);c.useEffect(()=>{S.current!==t&&(S.current=t,k.current++)},[t]);const v=c.useCallback(async(l=_)=>{const r=++C.current,o=t;P(null),j(null);try{const y=await ie({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),R(null))}catch(y){if(r!==C.current||o!==t)return;const b=Z(y,"Failed to load research runs");P(b.message),j(b)}finally{r===C.current&&T(!1)}},[t,_,h]),x=c.useCallback(async l=>{const r=await le(l,t);return R(r.run),N(r.availability),r.run},[t]);return c.useEffect(()=>{T(!0);const l=window.setTimeout(()=>{v(_)},Se);return()=>window.clearTimeout(l)},[v,_]),c.useEffect(()=>{if(!h){R(null);return}x(h)},[x,h]),c.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:i,selectedRun:p,selectedRunId:h,setSelectedRunId:a,availability:g,loading:E,error:L,searchQuery:_,setSearchQuery:D,refresh:v,createRun:l=>fe(l,t),cancelRun:async l=>{try{j(null);const r=await be(l,t);return h===l&&R(r.run),await v(),r}catch(r){const o=Z(r,"Failed to cancel run");throw j(o),o}},retryRun:async l=>{try{j(null);const r=await me(l,t);return h===l&&R(r.run),await v(),r}catch(r){const o=Z(r,"Failed to retry run");throw j(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:i.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:i,finding:f,projectId:h,onClose:a,onConfirm:p}){xe(n);const[R,g]=c.useState(!1),[N,E]=c.useState(""),[T,L]=c.useState(""),[P,F]=c.useState("normal"),[j,_]=c.useState(""),[D,C]=c.useState([]),[k,S]=c.useState(!1),[v,x]=c.useState(!1),l=c.useMemo(()=>{const r=(f.content??"").split(/(?<=[.!?])\s+/)[0]??"";return`${f.heading||"Research finding"} — ${r}`.trim()},[f.content,f.heading]);return c.useEffect(()=>{n&&(g(!1),E(`Research: ${f.heading||i.title}`),L(l),F("normal"),_(""),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,i.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:"})," ",i.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:j,placeholder:k?"Loading tasks…":"Enter task ID",onChange: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:R,onChange:r=>g(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"&&!j,onClick:()=>{x(!0),p({taskId:t==="enrich"?j:void 0,title:t==="create"?N.trim():void 0,description:t==="create"?T.trim():void 0,priority:t==="create"?P:void 0,attachExport:R}).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 Me({projectId:n,addToast:t,onOpenSettings:i,readinessVersion:f=0}){const{runs:h,selectedRun:a,selectedRunId:p,setSelectedRunId:R,availability:g,loading:N,error:E,searchQuery:T,setSearchQuery:L,createRun:P,cancelRun:F,retryRun:j,exportRun:_,createTaskFromRun:D,attachRunToTask:C,statusCounts:k,refresh:S,uiError:v,runActionState:x}=Ee({projectId:n}),[l,r]=c.useState(""),[o,y]=c.useState(()=>X(void 0)),[b,M]=c.useState([]),[O,V]=c.useState(!1),[ee,se]=c.useState([]),[A,U]=c.useState(null),[I,$]=c.useState(null),z=g.supportedProviders??Te,B=o.searchProvider,Q=s=>s==="web-search"?!0:o.enabledSources[Pe[s]];c.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]),c.useEffect(()=>{let s=!1;return Promise.all([ye(n),ge().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=c.useMemo(()=>a?a.status:"No run selected",[a]),ne=c.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=g.supportedExportFormats??["markdown","json","html"],W=c.useMemo(()=>new Map(b.map(s=>[s.id,s.authenticated])),[b]),Y=c.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=c.useMemo(()=>g.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:g.reason??"Research is unavailable for this project.",details:g.setupInstructions,settingsSection:"research-project"},[g.available,g.reason,g.setupInstructions,o.enabled,Y]),H=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 _(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)}}},ce=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});R(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("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:()=>i?.(q.settingsSection),children:"Open Settings"})]})]}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:"research-view__layout",children:[e.jsxs("aside",{className:"research-view__sidebar card",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 ce(),children:[O?e.jsx(je,{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(Re,{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:()=>R(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 H("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 H("retry",()=>j(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:()=>i?.("authentication"),children:"Open Authentication Settings"}),v.code==="FEATURE_DISABLED"&&e.jsx("button",{className:"btn btn-sm",type:"button",onClick:()=>i?.("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 H("create-task",()=>D(a.id,u,I.findingId,w,te,re),"Task created from research"):m&&await H("attach-task",()=>C(a.id,m,I.findingId,re),"Task enriched from research"),$(null)}}):null})()]})}export{Me as ResearchView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./vendor-react-K0fH_qHe.js";import{
|
|
1
|
+
import{r as e}from"./vendor-react-K0fH_qHe.js";import{dF as C}from"./index-tbwUVj8p.js";function F(k={}){const{projectId:d,pollInterval:b=6e4,autoRefresh:p=!1,enabled:t=!0}=k,[S,o]=e.useState(null),[m,l]=e.useState(t),[E,c]=e.useState(null),[R,v]=e.useState(null),r=e.useRef(null),n=e.useRef(null),a=e.useRef(!0),s=e.useCallback(async()=>{if(!t){l(!1),c(null),o(null);return}r.current&&r.current.abort(),r.current=new AbortController,l(!0),c(null),o(null);try{const u=await C(d);if(!a.current)return;o(u),c(null),v(new Date),l(!1)}catch(u){if(u instanceof Error&&u.name==="AbortError"||!a.current)return;const A=u instanceof Error?u.message:"Failed to fetch memory backend status";c(A),l(!1)}},[t,d]);e.useEffect(()=>(a.current=!0,t?(s(),()=>{a.current=!1}):(r.current&&r.current.abort(),o(null),c(null),l(!1),()=>{a.current=!1})),[t,s]),e.useEffect(()=>{if(!(!t||!p))return n.current=setInterval(()=>{s()},b),()=>{n.current&&(clearInterval(n.current),n.current=null)}},[t,p,b,s]),e.useEffect(()=>()=>{a.current=!1,r.current&&r.current.abort(),n.current&&(clearInterval(n.current),n.current=null)},[]);const h=e.useCallback(()=>s(),[s]),f=m?null:S,B=f?.currentBackend??null,i=f?.capabilities??null,y=f?.availableBackends??[],I=i?.readable??!1,g=i?.writable??!1,w=i?.supportsAtomicWrite??!1;return{status:f,currentBackend:B,capabilities:i,availableBackends:y,isReadable:I,isWritable:g,supportsAtomicWrite:w,loading:m,error:E,lastUpdated:R,refresh:h}}export{F as u};
|
|
@@ -0,0 +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)}}
|