@runfusion/fusion 0.14.0 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/bin.js +82 -6
  2. package/dist/client/assets/{AgentDetailView-CBFUveyO.js → AgentDetailView-B3KAsP2O.js} +1 -1
  3. package/dist/client/assets/{AgentsView-DPezXQ-U.js → AgentsView-DoXb_amw.js} +3 -3
  4. package/dist/client/assets/{ChatView-5N4-EuhD.js → ChatView-BJ2c7wvd.js} +1 -1
  5. package/dist/client/assets/{DevServerView-Daft4YFc.js → DevServerView-DbgM4tlT.js} +1 -1
  6. package/dist/client/assets/{DirectoryPicker-rew1y6qO.js → DirectoryPicker-DfmtfMiu.js} +1 -1
  7. package/dist/client/assets/{DocumentsView-i72qJzwd.js → DocumentsView-_-Efkx_W.js} +1 -1
  8. package/dist/client/assets/{InsightsView-BL5eZJ0a.js → InsightsView-DUjcfW53.js} +1 -1
  9. package/dist/client/assets/{MemoryView-pl8Cdg_p.js → MemoryView-DxMPBb0q.js} +1 -1
  10. package/dist/client/assets/{NodesView-D6eJ15zc.js → NodesView-BEBTI15s.js} +1 -1
  11. package/dist/client/assets/{PiExtensionsManager-ExInwXWP.js → PiExtensionsManager-BpMYhHH_.js} +1 -1
  12. package/dist/client/assets/PluginManager-CPv7yQd3.js +1 -0
  13. package/dist/client/assets/PluginManager-DA_T0GHn.css +1 -0
  14. package/dist/client/assets/{ResearchView-B_QPUEjB.js → ResearchView-BrFvdyXT.js} +1 -1
  15. package/dist/client/assets/{RoadmapsView-DBNLaEsK.js → RoadmapsView-BDjLrtcj.js} +1 -1
  16. package/dist/client/assets/{SettingsModal-1ET586M3.js → SettingsModal-Cd-QGB0C.js} +3 -3
  17. package/dist/client/assets/{SettingsModal-CL_gWmOj.js → SettingsModal-CxDxiTRy.js} +1 -1
  18. package/dist/client/assets/{SetupWizardModal-CLkY9HFL.js → SetupWizardModal-DFUA4X3z.js} +1 -1
  19. package/dist/client/assets/{SkillMultiselect-B0qi32SQ.js → SkillMultiselect-BUWe5ujb.js} +1 -1
  20. package/dist/client/assets/{SkillsView-umVjRq6o.js → SkillsView-RAkqGX3y.js} +1 -1
  21. package/dist/client/assets/TodoView-Ceb0wrg1.js +6 -0
  22. package/dist/client/assets/{folder-open-nYPrL1W3.js → folder-open-DcM-Vd6r.js} +1 -1
  23. package/dist/client/assets/{index-Bc8nfKeH.js → index-DH3aprf6.js} +6 -6
  24. package/dist/client/assets/{list-checks-sK8xJeH_.js → list-checks-ByGHVQpZ.js} +1 -1
  25. package/dist/client/assets/{star-BRtXbYkB.js → star-DlEYI8GL.js} +1 -1
  26. package/dist/client/assets/{upload-BP60eBwN.js → upload-DKshabz-.js} +1 -1
  27. package/dist/client/assets/{users-qSGAX2Pf.js → users-X6tYPPBV.js} +1 -1
  28. package/dist/client/index.html +1 -1
  29. package/dist/client/version.json +1 -1
  30. package/dist/extension.js +82 -6
  31. package/dist/pi-claude-cli/package.json +1 -1
  32. package/package.json +1 -1
  33. package/dist/client/assets/PluginManager-CYhtxHun.js +0 -1
  34. package/dist/client/assets/PluginManager-jyNkJZSz.css +0 -1
  35. package/dist/client/assets/TodoView-CFifSvrD.js +0 -6
@@ -1 +1 @@
1
- import{r as e}from"./vendor-react-K0fH_qHe.js";import{di as C}from"./index-Bc8nfKeH.js";function L(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{L as u};
1
+ import{r as e}from"./vendor-react-K0fH_qHe.js";import{di as C}from"./index-DH3aprf6.js";function L(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{L as u};
@@ -1 +1 @@
1
- import{r as l,j as e}from"./vendor-react-K0fH_qHe.js";import{c8 as B,aJ as E,c9 as L,ca as $,cb as _,X as W,N as G,C as b,L as O}from"./index-Bc8nfKeH.js";import{D as Y}from"./DirectoryPicker-rew1y6qO.js";import"./vendor-xterm-DzcZoU0P.js";import"./folder-open-nYPrL1W3.js";function f(c){const r=c.split(/[/\\]/).filter(h=>h.length>0);return(r[r.length-1]||"My Project").replace(/[^a-zA-Z0-9-_]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")||"My Project"}function K({onProjectRegistered:c,onClose:r}){const j="https://github.com/runfusion/fusion/discussions",[h,C]=l.useState(!0),[s,n]=l.useState({step:"manual",manualMode:"existing",manualPath:"",manualCloneUrl:"",manualName:"",manualIsolationMode:"in-process",manualNodeId:"",isRegistering:!1,error:null}),[x,k]=l.useState(!1),[u,g]=l.useState(""),[m,y]=l.useState(()=>B()),{nodes:N,loading:z}=E(),M=N.find(a=>a.type==="local")?.id,w=l.useCallback(()=>{C(!1),r?.()},[r]),I=l.useCallback(a=>{n(t=>{const d={manualPath:a};return a&&(!t.manualName||t.manualName===f(t.manualPath))&&(d.manualName=f(a)),{...t,...d}})},[]),P=l.useCallback(async()=>{const a=s.manualPath.trim(),t=s.manualName.trim(),d=s.manualCloneUrl.trim();if(!(!a||!t)&&!(s.manualMode==="clone"&&!d)){n(i=>({...i,isRegistering:!0,error:null}));try{const i={name:t,path:a,isolationMode:s.manualIsolationMode,nodeId:s.manualNodeId||void 0,cloneUrl:s.manualMode==="clone"?d:void 0},p=await L(i);c(p),n(D=>({...D,step:"complete",isRegistering:!1}))}catch(i){n(p=>({...p,isRegistering:!1,error:i instanceof Error?i.message:"Failed to register project"}))}}},[s.manualPath,s.manualName,s.manualCloneUrl,s.manualMode,s.manualIsolationMode,s.manualNodeId,c]),S=l.useCallback(()=>{const a=u.trim();a&&($(a),window.location.reload())},[u]),R=l.useCallback(()=>{_(),y(void 0),g(""),window.location.reload()},[]);if(!h)return null;const v=s.manualMode==="existing",o=s.manualMode==="clone",A=s.manualPath.trim().length>0,U=s.manualName.trim().length>0,F=s.manualCloneUrl.trim().length>0,T=s.isRegistering||!A||!U||o&&!F;return e.jsx("div",{className:"modal-overlay open setup-wizard-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"wizard-title",children:e.jsxs("div",{className:"modal setup-wizard-modal",children:[e.jsxs("div",{className:"setup-wizard-header",children:[e.jsxs("div",{className:"setup-wizard-heading",children:[e.jsxs("div",{className:"setup-wizard-brand","aria-label":"Fusion",children:[e.jsxs("svg",{className:"setup-wizard-brand-logo",width:28,height:28,viewBox:"0 0 128 128",fill:"none","aria-label":"Fusion logo",role:"img",children:[e.jsx("circle",{cx:"64",cy:"64",r:"52",stroke:"currentColor",strokeWidth:"8"}),e.jsx("path",{d:"M26 101C44 82 62 64 82 45C90 37 98 30 104 24C96 35 89 47 81 60C70 79 57 95 43 108C38 112 32 108 26 101Z",fill:"currentColor"})]}),e.jsx("span",{className:"setup-wizard-brand-name",children:"Fusion"})]}),e.jsxs("h2",{id:"wizard-title",className:"setup-wizard-title",children:[s.step==="manual"&&"Welcome to Fusion",s.step==="complete"&&"Setup Complete!"]})]}),s.step!=="complete"&&e.jsx("button",{className:"modal-close",onClick:w,"aria-label":"Close wizard",children:e.jsx(W,{size:20})})]}),e.jsxs("div",{className:"setup-wizard-content",children:[s.step==="manual"&&e.jsxs("div",{className:"setup-wizard-manual",children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"project-name",children:"Project Name"}),e.jsx("input",{id:"project-name",type:"text",value:s.manualName,onChange:a=>n(t=>({...t,manualName:a.target.value})),placeholder:"my-project"}),e.jsx("p",{className:"form-hint",children:o?"By default this follows the destination folder name unless you edit it.":"By default this follows the selected directory name unless you edit it."})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"project-path",children:o?"Destination Directory":"Project Directory"}),e.jsx(Y,{value:s.manualPath,onChange:I,nodeId:s.manualNodeId||void 0,localNodeId:M,placeholder:o?"/path/for/new-clone":"/path/to/your/project"}),e.jsx("p",{className:"form-hint",children:o?"Select or type an absolute destination path. Fusion will clone into this directory.":"Select or type the absolute path to your project"})]}),e.jsxs("div",{className:"setup-wizard-advanced",children:[e.jsxs("button",{type:"button",className:"setup-wizard-advanced-toggle","aria-expanded":x,onClick:()=>k(a=>!a),children:[e.jsx(G,{size:16,className:"setup-wizard-advanced-chevron"}),e.jsx("span",{children:"Advanced settings"})]}),x&&e.jsxs("div",{className:"setup-wizard-advanced-panel",children:[e.jsxs("fieldset",{className:"setup-wizard-mode-switch","aria-label":"Project setup mode",children:[e.jsx("legend",{children:"Setup Mode"}),e.jsxs("label",{className:`setup-wizard-mode-option${v?" selected":""}`,children:[e.jsx("input",{type:"radio",name:"setup-mode",value:"existing",checked:v,onChange:()=>n(a=>({...a,manualMode:"existing",error:null}))}),e.jsx("span",{children:"Use Existing Directory"})]}),e.jsxs("label",{className:`setup-wizard-mode-option${o?" selected":""}`,children:[e.jsx("input",{type:"radio",name:"setup-mode",value:"clone",checked:o,onChange:()=>n(a=>({...a,manualMode:"clone",error:null}))}),e.jsx("span",{children:"Clone Git Repository"})]})]}),o&&e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"project-clone-url",children:"Repository URL"}),e.jsx("input",{id:"project-clone-url",type:"text",value:s.manualCloneUrl,onChange:a=>n(t=>({...t,manualCloneUrl:a.target.value})),placeholder:"https://github.com/owner/repo.git"}),e.jsx("p",{className:"form-hint",children:"Fusion will run git clone into the destination directory, then register that cloned folder."})]}),e.jsx("div",{className:"form-group",children:e.jsxs("div",{className:"project-node-selector",children:[e.jsx("span",{className:"project-node-selector__label",children:"Runtime Node"}),e.jsxs("select",{value:s.manualNodeId,onChange:a=>n(t=>({...t,manualNodeId:a.target.value})),disabled:z||s.isRegistering,children:[e.jsx("option",{value:"",children:"Local node"}),N.map(a=>e.jsxs("option",{value:a.id,children:[a.name," (",a.type,")"]},a.id))]})]})}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:"Isolation Mode"}),e.jsxs("div",{className:"setup-wizard-isolation-options",children:[e.jsxs("label",{className:`setup-wizard-isolation-option${s.manualIsolationMode==="in-process"?" selected":""}`,children:[e.jsx("input",{type:"radio",name:"isolation-mode",value:"in-process",checked:s.manualIsolationMode==="in-process",onChange:()=>n(a=>({...a,manualIsolationMode:"in-process"}))}),e.jsxs("div",{className:"setup-wizard-isolation-option-content",children:[e.jsx("strong",{children:"In-Process"}),e.jsx("span",{children:"Lower overhead, shared memory. Best for most projects."}),e.jsx("span",{className:"wizard-option-recommended",children:"Recommended"})]})]}),e.jsxs("label",{className:`setup-wizard-isolation-option${s.manualIsolationMode==="child-process"?" selected":""}`,children:[e.jsx("input",{type:"radio",name:"isolation-mode",value:"child-process",checked:s.manualIsolationMode==="child-process",onChange:()=>n(a=>({...a,manualIsolationMode:"child-process"}))}),e.jsxs("div",{className:"setup-wizard-isolation-option-content",children:[e.jsx("strong",{children:"Child-Process"}),e.jsx("span",{children:"Isolated execution with crash containment."})]})]})]})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"setup-auth-token",children:"Browser Auth Token"}),e.jsxs("div",{className:"setup-wizard-auth-token",children:[e.jsx("input",{id:"setup-auth-token",type:"password",value:u,onChange:a=>g(a.target.value),placeholder:m?"Enter a new token to replace the stored one":"Paste the auth token for this browser",autoComplete:"off",spellCheck:!1}),e.jsxs("div",{className:"setup-wizard-auth-token-actions",children:[e.jsx("button",{type:"button",className:"btn",onClick:S,disabled:u.trim().length===0,children:m?"Update token":"Set token"}),m&&e.jsx("button",{type:"button",className:"btn",onClick:R,children:"Reset token"})]})]}),e.jsx("p",{className:"form-hint",children:m?"A token is already stored in this browser. Updating or resetting it will reload the page.":"Store a token in this browser for authenticated dashboard requests, then reload the page."})]})]})]}),s.error&&e.jsx("div",{className:"wizard-error",role:"alert",children:s.error})]}),s.step==="complete"&&e.jsxs("div",{className:"setup-wizard-complete",children:[e.jsxs("div",{className:"setup-wizard-success-streak","aria-hidden":"true",children:[e.jsx("div",{className:"setup-wizard-success-streak-core"}),e.jsx("div",{className:"setup-wizard-success-streak-glow"})]}),e.jsx(b,{size:64,className:"success-icon"}),e.jsx("h3",{children:"All Set!"}),e.jsx("p",{children:"Your project has been registered successfully."}),e.jsx("p",{children:"You can add more projects anytime from the project overview."})]})]}),e.jsxs("div",{className:"setup-wizard-footer",children:[e.jsx("a",{className:"btn setup-wizard-help-link",href:j,target:"_blank",rel:"noreferrer",children:"Need help?"}),s.step==="manual"&&e.jsx("button",{className:"btn btn-primary",onClick:P,disabled:T,children:s.isRegistering?e.jsxs(e.Fragment,{children:[e.jsx(O,{size:16,className:"animate-spin"}),e.jsx("span",{children:"Registering..."})]}):e.jsx("span",{children:"Register Project"})}),s.step==="complete"&&e.jsxs("button",{className:"btn btn-primary",onClick:w,children:[e.jsx(b,{size:16}),e.jsx("span",{children:"Get Started"})]})]})]})})}export{K as SetupWizardModal};
1
+ import{r as l,j as e}from"./vendor-react-K0fH_qHe.js";import{c8 as B,aJ as E,c9 as L,ca as $,cb as _,X as W,N as G,C as b,L as O}from"./index-DH3aprf6.js";import{D as Y}from"./DirectoryPicker-DfmtfMiu.js";import"./vendor-xterm-DzcZoU0P.js";import"./folder-open-DcM-Vd6r.js";function f(c){const r=c.split(/[/\\]/).filter(h=>h.length>0);return(r[r.length-1]||"My Project").replace(/[^a-zA-Z0-9-_]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")||"My Project"}function K({onProjectRegistered:c,onClose:r}){const j="https://github.com/runfusion/fusion/discussions",[h,C]=l.useState(!0),[s,n]=l.useState({step:"manual",manualMode:"existing",manualPath:"",manualCloneUrl:"",manualName:"",manualIsolationMode:"in-process",manualNodeId:"",isRegistering:!1,error:null}),[x,k]=l.useState(!1),[u,g]=l.useState(""),[m,y]=l.useState(()=>B()),{nodes:N,loading:z}=E(),M=N.find(a=>a.type==="local")?.id,w=l.useCallback(()=>{C(!1),r?.()},[r]),I=l.useCallback(a=>{n(t=>{const d={manualPath:a};return a&&(!t.manualName||t.manualName===f(t.manualPath))&&(d.manualName=f(a)),{...t,...d}})},[]),P=l.useCallback(async()=>{const a=s.manualPath.trim(),t=s.manualName.trim(),d=s.manualCloneUrl.trim();if(!(!a||!t)&&!(s.manualMode==="clone"&&!d)){n(i=>({...i,isRegistering:!0,error:null}));try{const i={name:t,path:a,isolationMode:s.manualIsolationMode,nodeId:s.manualNodeId||void 0,cloneUrl:s.manualMode==="clone"?d:void 0},p=await L(i);c(p),n(D=>({...D,step:"complete",isRegistering:!1}))}catch(i){n(p=>({...p,isRegistering:!1,error:i instanceof Error?i.message:"Failed to register project"}))}}},[s.manualPath,s.manualName,s.manualCloneUrl,s.manualMode,s.manualIsolationMode,s.manualNodeId,c]),S=l.useCallback(()=>{const a=u.trim();a&&($(a),window.location.reload())},[u]),R=l.useCallback(()=>{_(),y(void 0),g(""),window.location.reload()},[]);if(!h)return null;const v=s.manualMode==="existing",o=s.manualMode==="clone",A=s.manualPath.trim().length>0,U=s.manualName.trim().length>0,F=s.manualCloneUrl.trim().length>0,T=s.isRegistering||!A||!U||o&&!F;return e.jsx("div",{className:"modal-overlay open setup-wizard-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"wizard-title",children:e.jsxs("div",{className:"modal setup-wizard-modal",children:[e.jsxs("div",{className:"setup-wizard-header",children:[e.jsxs("div",{className:"setup-wizard-heading",children:[e.jsxs("div",{className:"setup-wizard-brand","aria-label":"Fusion",children:[e.jsxs("svg",{className:"setup-wizard-brand-logo",width:28,height:28,viewBox:"0 0 128 128",fill:"none","aria-label":"Fusion logo",role:"img",children:[e.jsx("circle",{cx:"64",cy:"64",r:"52",stroke:"currentColor",strokeWidth:"8"}),e.jsx("path",{d:"M26 101C44 82 62 64 82 45C90 37 98 30 104 24C96 35 89 47 81 60C70 79 57 95 43 108C38 112 32 108 26 101Z",fill:"currentColor"})]}),e.jsx("span",{className:"setup-wizard-brand-name",children:"Fusion"})]}),e.jsxs("h2",{id:"wizard-title",className:"setup-wizard-title",children:[s.step==="manual"&&"Welcome to Fusion",s.step==="complete"&&"Setup Complete!"]})]}),s.step!=="complete"&&e.jsx("button",{className:"modal-close",onClick:w,"aria-label":"Close wizard",children:e.jsx(W,{size:20})})]}),e.jsxs("div",{className:"setup-wizard-content",children:[s.step==="manual"&&e.jsxs("div",{className:"setup-wizard-manual",children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"project-name",children:"Project Name"}),e.jsx("input",{id:"project-name",type:"text",value:s.manualName,onChange:a=>n(t=>({...t,manualName:a.target.value})),placeholder:"my-project"}),e.jsx("p",{className:"form-hint",children:o?"By default this follows the destination folder name unless you edit it.":"By default this follows the selected directory name unless you edit it."})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"project-path",children:o?"Destination Directory":"Project Directory"}),e.jsx(Y,{value:s.manualPath,onChange:I,nodeId:s.manualNodeId||void 0,localNodeId:M,placeholder:o?"/path/for/new-clone":"/path/to/your/project"}),e.jsx("p",{className:"form-hint",children:o?"Select or type an absolute destination path. Fusion will clone into this directory.":"Select or type the absolute path to your project"})]}),e.jsxs("div",{className:"setup-wizard-advanced",children:[e.jsxs("button",{type:"button",className:"setup-wizard-advanced-toggle","aria-expanded":x,onClick:()=>k(a=>!a),children:[e.jsx(G,{size:16,className:"setup-wizard-advanced-chevron"}),e.jsx("span",{children:"Advanced settings"})]}),x&&e.jsxs("div",{className:"setup-wizard-advanced-panel",children:[e.jsxs("fieldset",{className:"setup-wizard-mode-switch","aria-label":"Project setup mode",children:[e.jsx("legend",{children:"Setup Mode"}),e.jsxs("label",{className:`setup-wizard-mode-option${v?" selected":""}`,children:[e.jsx("input",{type:"radio",name:"setup-mode",value:"existing",checked:v,onChange:()=>n(a=>({...a,manualMode:"existing",error:null}))}),e.jsx("span",{children:"Use Existing Directory"})]}),e.jsxs("label",{className:`setup-wizard-mode-option${o?" selected":""}`,children:[e.jsx("input",{type:"radio",name:"setup-mode",value:"clone",checked:o,onChange:()=>n(a=>({...a,manualMode:"clone",error:null}))}),e.jsx("span",{children:"Clone Git Repository"})]})]}),o&&e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"project-clone-url",children:"Repository URL"}),e.jsx("input",{id:"project-clone-url",type:"text",value:s.manualCloneUrl,onChange:a=>n(t=>({...t,manualCloneUrl:a.target.value})),placeholder:"https://github.com/owner/repo.git"}),e.jsx("p",{className:"form-hint",children:"Fusion will run git clone into the destination directory, then register that cloned folder."})]}),e.jsx("div",{className:"form-group",children:e.jsxs("div",{className:"project-node-selector",children:[e.jsx("span",{className:"project-node-selector__label",children:"Runtime Node"}),e.jsxs("select",{value:s.manualNodeId,onChange:a=>n(t=>({...t,manualNodeId:a.target.value})),disabled:z||s.isRegistering,children:[e.jsx("option",{value:"",children:"Local node"}),N.map(a=>e.jsxs("option",{value:a.id,children:[a.name," (",a.type,")"]},a.id))]})]})}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:"Isolation Mode"}),e.jsxs("div",{className:"setup-wizard-isolation-options",children:[e.jsxs("label",{className:`setup-wizard-isolation-option${s.manualIsolationMode==="in-process"?" selected":""}`,children:[e.jsx("input",{type:"radio",name:"isolation-mode",value:"in-process",checked:s.manualIsolationMode==="in-process",onChange:()=>n(a=>({...a,manualIsolationMode:"in-process"}))}),e.jsxs("div",{className:"setup-wizard-isolation-option-content",children:[e.jsx("strong",{children:"In-Process"}),e.jsx("span",{children:"Lower overhead, shared memory. Best for most projects."}),e.jsx("span",{className:"wizard-option-recommended",children:"Recommended"})]})]}),e.jsxs("label",{className:`setup-wizard-isolation-option${s.manualIsolationMode==="child-process"?" selected":""}`,children:[e.jsx("input",{type:"radio",name:"isolation-mode",value:"child-process",checked:s.manualIsolationMode==="child-process",onChange:()=>n(a=>({...a,manualIsolationMode:"child-process"}))}),e.jsxs("div",{className:"setup-wizard-isolation-option-content",children:[e.jsx("strong",{children:"Child-Process"}),e.jsx("span",{children:"Isolated execution with crash containment."})]})]})]})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"setup-auth-token",children:"Browser Auth Token"}),e.jsxs("div",{className:"setup-wizard-auth-token",children:[e.jsx("input",{id:"setup-auth-token",type:"password",value:u,onChange:a=>g(a.target.value),placeholder:m?"Enter a new token to replace the stored one":"Paste the auth token for this browser",autoComplete:"off",spellCheck:!1}),e.jsxs("div",{className:"setup-wizard-auth-token-actions",children:[e.jsx("button",{type:"button",className:"btn",onClick:S,disabled:u.trim().length===0,children:m?"Update token":"Set token"}),m&&e.jsx("button",{type:"button",className:"btn",onClick:R,children:"Reset token"})]})]}),e.jsx("p",{className:"form-hint",children:m?"A token is already stored in this browser. Updating or resetting it will reload the page.":"Store a token in this browser for authenticated dashboard requests, then reload the page."})]})]})]}),s.error&&e.jsx("div",{className:"wizard-error",role:"alert",children:s.error})]}),s.step==="complete"&&e.jsxs("div",{className:"setup-wizard-complete",children:[e.jsxs("div",{className:"setup-wizard-success-streak","aria-hidden":"true",children:[e.jsx("div",{className:"setup-wizard-success-streak-core"}),e.jsx("div",{className:"setup-wizard-success-streak-glow"})]}),e.jsx(b,{size:64,className:"success-icon"}),e.jsx("h3",{children:"All Set!"}),e.jsx("p",{children:"Your project has been registered successfully."}),e.jsx("p",{children:"You can add more projects anytime from the project overview."})]})]}),e.jsxs("div",{className:"setup-wizard-footer",children:[e.jsx("a",{className:"btn setup-wizard-help-link",href:j,target:"_blank",rel:"noreferrer",children:"Need help?"}),s.step==="manual"&&e.jsx("button",{className:"btn btn-primary",onClick:P,disabled:T,children:s.isRegistering?e.jsxs(e.Fragment,{children:[e.jsx(O,{size:16,className:"animate-spin"}),e.jsx("span",{children:"Registering..."})]}):e.jsx("span",{children:"Register Project"})}),s.step==="complete"&&e.jsxs("button",{className:"btn btn-primary",onClick:w,children:[e.jsx(b,{size:16}),e.jsx("span",{children:"Get Started"})]})]})]})})}export{K as SetupWizardModal};
@@ -1 +1 @@
1
- import{r as a,j as e}from"./vendor-react-K0fH_qHe.js";import{aW as g}from"./index-Bc8nfKeH.js";function S({value:s,onChange:c,projectId:n,disabled:d=!1,id:t,label:r="Skills"}){const[o,m]=a.useState([]),[p,h]=a.useState(!0);a.useEffect(()=>{let l=!1;return h(!0),g(n).then(i=>{l||m(i)}).catch(()=>{l||m([])}).finally(()=>{l||h(!1)}),()=>{l=!0}},[n]);const f=l=>{s.includes(l)||c([...s,l])},x=l=>{c(s.filter(i=>i!==l))},k=l=>o.find(j=>j.id===l)?.name??l,u=o.filter(l=>!s.includes(l.id));return e.jsxs("div",{className:"skill-multiselect","data-testid":"skill-multiselect",children:[r&&e.jsx("label",{htmlFor:t?`${t}-select`:void 0,className:"skill-multiselect-label",children:r}),s.length>0&&e.jsx("div",{className:"skill-multiselect-chips","data-testid":"skill-chips",children:s.map(l=>e.jsxs("span",{className:"skill-chip","data-testid":`skill-chip-${l}`,children:[e.jsx("span",{className:"skill-chip-name",children:k(l)}),e.jsx("button",{type:"button",className:"skill-chip-remove",onClick:()=>x(l),disabled:d,"aria-label":`Remove ${k(l)}`,"data-testid":`remove-skill-${l}`,children:"×"})]},l))}),e.jsx("div",{className:"skill-multiselect-add",children:p?e.jsx("span",{className:"skill-multiselect-loading","data-testid":"skills-loading",children:"Loading skills…"}):u.length===0?e.jsx("span",{className:"skill-multiselect-empty","data-testid":"skills-empty",children:s.length===0?"No skills discovered":"All skills selected"}):e.jsxs("select",{id:t?`${t}-select`:void 0,className:"select skill-multiselect-dropdown",value:"",onChange:l=>{l.target.value&&(f(l.target.value),l.target.value="")},disabled:d,"data-testid":"skill-dropdown",children:[e.jsx("option",{value:"",children:"Add a skill…"}),u.map(l=>e.jsx("option",{value:l.id,children:l.name},l.id))]})})]})}export{S};
1
+ import{r as a,j as e}from"./vendor-react-K0fH_qHe.js";import{aW as g}from"./index-DH3aprf6.js";function S({value:s,onChange:c,projectId:n,disabled:d=!1,id:t,label:r="Skills"}){const[o,m]=a.useState([]),[p,h]=a.useState(!0);a.useEffect(()=>{let l=!1;return h(!0),g(n).then(i=>{l||m(i)}).catch(()=>{l||m([])}).finally(()=>{l||h(!1)}),()=>{l=!0}},[n]);const f=l=>{s.includes(l)||c([...s,l])},x=l=>{c(s.filter(i=>i!==l))},k=l=>o.find(j=>j.id===l)?.name??l,u=o.filter(l=>!s.includes(l.id));return e.jsxs("div",{className:"skill-multiselect","data-testid":"skill-multiselect",children:[r&&e.jsx("label",{htmlFor:t?`${t}-select`:void 0,className:"skill-multiselect-label",children:r}),s.length>0&&e.jsx("div",{className:"skill-multiselect-chips","data-testid":"skill-chips",children:s.map(l=>e.jsxs("span",{className:"skill-chip","data-testid":`skill-chip-${l}`,children:[e.jsx("span",{className:"skill-chip-name",children:k(l)}),e.jsx("button",{type:"button",className:"skill-chip-remove",onClick:()=>x(l),disabled:d,"aria-label":`Remove ${k(l)}`,"data-testid":`remove-skill-${l}`,children:"×"})]},l))}),e.jsx("div",{className:"skill-multiselect-add",children:p?e.jsx("span",{className:"skill-multiselect-loading","data-testid":"skills-loading",children:"Loading skills…"}):u.length===0?e.jsx("span",{className:"skill-multiselect-empty","data-testid":"skills-empty",children:s.length===0?"No skills discovered":"All skills selected"}):e.jsxs("select",{id:t?`${t}-select`:void 0,className:"select skill-multiselect-dropdown",value:"",onChange:l=>{l.target.value&&(f(l.target.value),l.target.value="")},disabled:d,"data-testid":"skill-dropdown",children:[e.jsx("option",{value:"",children:"Add a skill…"}),u.map(l=>e.jsx("option",{value:l.id,children:l.name},l.id))]})})]})}export{S};
@@ -1 +1 @@
1
- import{r as i,j as e}from"./vendor-react-K0fH_qHe.js";import{aW as X,bo as _,bp as B,bq as G,b3 as H,X as P,R as J,W as O,N as Y,L as Z,ak as I}from"./index-Bc8nfKeH.js";import"./vendor-xterm-DzcZoU0P.js";function ie({projectId:c,addToast:o,onClose:Q}){const[d,v]=i.useState([]),[f,y]=i.useState(!0),[W,E]=i.useState(!1),[L,p]=i.useState(null),[D,A]=i.useState([]),[h,K]=i.useState(""),[m,g]=i.useState(null),[k,x]=i.useState(null),[V,R]=i.useState(!1),[z,j]=i.useState(null),r=i.useRef(null),[N,q]=i.useState(""),F=h.trim()?d.filter(s=>s.name.toLowerCase().includes(h.toLowerCase())||s.relativePath.toLowerCase().includes(h.toLowerCase())):d,C=i.useCallback(async()=>{y(!0);try{const s=await X(c);v(s)}catch(s){const a=s instanceof Error?s.message:"Failed to load discovered skills";o(a,"error")}finally{y(!1)}},[c,o]),u=i.useCallback(async s=>{const a=l=>{if(!l||typeof l!="object")return!1;const t=l;if(typeof t.status=="number"&&t.status>=500)return!0;if(t.details&&typeof t.details=="object"){const w=t.details;if(typeof w.code=="string"&&w.code.startsWith("upstream_"))return!0}const n=l;return typeof n.error=="string"&&typeof n.code=="string"};E(!0),p(null);try{const l=await _(s,20,c);A(l.entries)}catch(l){if(a(l))p("Catalog is temporarily unavailable. Please try again later.");else{const t=l instanceof Error?l.message:"Failed to load catalog";p(t)}}finally{E(!1)}},[c]);i.useEffect(()=>{C(),u("")},[C,u]);const M=i.useCallback(s=>{K(s),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{q(s),r.current=null},300)},[]);i.useEffect(()=>()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]),i.useEffect(()=>{u(N)},[N,u]);const T=i.useCallback(async(s,a)=>{const l=!a;v(t=>t.map(n=>n.id===s?{...n,toggling:!0}:n));try{await B(s,l,c),v(t=>t.map(n=>n.id===s?{...n,enabled:l,toggling:!1}:n)),o(`Skill ${l?"enabled":"disabled"}`,"success")}catch(t){v(w=>w.map(S=>S.id===s?{...S,toggling:!1}:S));const n=t instanceof Error?t.message:"Failed to toggle skill";o(`Failed to toggle skill: ${n}`,"error")}},[c,o]),b=i.useCallback(async s=>{R(!0),j(null),x(null);try{const a=await G(s,c);x(a)}catch(a){const l=a instanceof Error?a.message:"Failed to load skill content";j(l)}finally{R(!1)}},[c]),$=i.useCallback((s,a)=>{if(!(a&&a.target.closest(".skills-view-item-toggle"))){if(m===s){g(null),x(null),j(null);return}g(s),b(s)}},[m,b]),U=i.useCallback(s=>{m!==s&&g(s),b(s)},[b,m]);return e.jsxs("div",{className:"skills-view","data-testid":"skills-view",children:[e.jsxs("div",{className:"skills-view-header",children:[e.jsxs("div",{className:"skills-view-title",children:[e.jsxs("h2",{children:[e.jsx(H,{size:20}),"Skills"]}),e.jsxs("span",{className:"skills-view-count","aria-label":`${d.length} discovered skills`,children:[d.length," discovered"]})]}),e.jsxs("div",{className:"skills-view-actions",children:[e.jsx("button",{className:"btn-icon skills-view-close touch-target",onClick:Q,"aria-label":"Close skills view",children:e.jsx(P,{size:16})}),e.jsxs("button",{className:"btn btn-sm touch-target",onClick:()=>void C(),disabled:f,children:[e.jsx(J,{size:14,className:f?"spin":""}),"Refresh"]})]})]}),e.jsxs("div",{className:"skills-view-content",children:[e.jsx("div",{className:"skills-view-search",children:e.jsx("input",{type:"text",className:"form-input",placeholder:"Search skills...",value:h,onChange:s=>M(s.target.value),"aria-label":"Search skills"})}),e.jsxs("section",{className:"skills-view-section","aria-labelledby":"discovered-skills-title",children:[e.jsx("h3",{id:"discovered-skills-title",className:"skills-view-section-title",children:"Discovered Skills"}),f?e.jsxs("div",{className:"skills-view-loading",children:[e.jsx("span",{className:"spinner"}),"Loading discovered skills..."]}):d.length===0?e.jsx("div",{className:"skills-view-empty",children:e.jsx("p",{children:"No skills discovered in this project."})}):F.length===0?e.jsx("div",{className:"skills-view-empty",children:e.jsx("p",{children:"No discovered skills match your search."})}):e.jsx("div",{className:"skills-view-list",children:F.map(s=>{const a=m===s.id;return e.jsxs("div",{children:[e.jsxs("div",{className:`skills-view-item${a?" skills-view-item--selected":""}`,onClick:l=>$(s.id,l),role:"button",tabIndex:0,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),$(s.id))},"aria-expanded":a,"aria-label":`View details for ${s.name}`,children:[e.jsxs("div",{className:"skills-view-item-info",children:[e.jsxs("span",{className:"skills-view-item-name",children:[a?e.jsx(O,{size:14}):e.jsx(Y,{size:14}),s.name]}),e.jsx("span",{className:"skills-view-item-path",children:s.relativePath}),e.jsx("span",{className:"skills-view-item-source",children:s.metadata.source})]}),e.jsxs("label",{className:"skills-view-item-toggle",onClick:l=>l.stopPropagation(),children:[e.jsx("input",{type:"checkbox",checked:s.enabled,disabled:s.toggling,onChange:()=>void T(s.id,s.enabled),"aria-label":`${s.enabled?"Disable":"Enable"} ${s.name}`}),e.jsx("span",{className:"skills-view-toggle-slider"})]})]}),a&&e.jsxs("div",{className:"skills-view-detail","data-testid":"skill-detail",children:[e.jsxs("div",{className:"skills-view-detail-header",children:[e.jsx("span",{className:"skills-view-detail-title",children:s.name}),e.jsxs("button",{className:"btn btn-sm skills-view-detail-close",onClick:()=>{g(null),x(null),j(null)},"aria-label":"Close skill detail",children:[e.jsx(P,{size:14}),"Close"]})]}),V?e.jsxs("div",{className:"skills-view-detail-loading",children:[e.jsx(Z,{size:16,className:"spin"}),"Loading skill content..."]}):z?e.jsxs("div",{className:"skills-view-detail-error",children:[e.jsx(I,{size:14}),e.jsx("span",{children:z}),e.jsx("button",{className:"btn btn-sm",onClick:()=>U(s.id),children:"Retry"})]}):k?e.jsxs(e.Fragment,{children:[e.jsx("pre",{className:"skills-view-detail-content",children:k.skillMd||"(No SKILL.md found)"}),k.files.length>0&&e.jsxs("div",{className:"skills-view-detail-files",children:[e.jsx("span",{className:"skills-view-detail-files-label",children:"Files:"}),k.files.map(l=>e.jsxs("span",{className:"badge badge--sm",children:[l.name,l.type==="directory"&&"/"]},l.relativePath))]})]}):null]})]},s.id)})})]}),e.jsxs("section",{className:"skills-view-section","aria-labelledby":"catalog-title",children:[e.jsx("h3",{id:"catalog-title",className:"skills-view-section-title",children:"Skills Catalog"}),L?e.jsxs("div",{className:"skills-view-error",children:[e.jsx("p",{children:L}),e.jsx("button",{className:"btn btn-sm",onClick:()=>void u(N),children:"Try Again"})]}):W?e.jsxs("div",{className:"skills-view-loading",children:[e.jsx("span",{className:"spinner"}),"Loading catalog..."]}):D.length===0?e.jsx("div",{className:"skills-view-empty",children:h?e.jsx("p",{children:"No skills match your search."}):e.jsx("p",{children:"No skills available in the catalog."})}):e.jsx("div",{className:"skills-view-grid",children:D.map(s=>e.jsxs("div",{className:"skills-view-card",children:[e.jsx("h4",{className:"skills-view-card-title",children:s.name}),s.description&&e.jsx("p",{className:"skills-view-card-description",children:s.description}),s.tags&&s.tags.length>0&&e.jsx("div",{className:"skills-view-card-tags",children:s.tags.map(a=>e.jsx("span",{className:"badge badge--sm",children:a},a))}),s.installs!==void 0&&e.jsxs("span",{className:"skills-view-card-installs",children:[s.installs.toLocaleString()," installs"]})]},s.id))})]})]})]})}export{ie as SkillsView};
1
+ import{r as i,j as e}from"./vendor-react-K0fH_qHe.js";import{aW as X,bo as _,bp as B,bq as G,b3 as H,X as P,R as J,W as O,N as Y,L as Z,ak as I}from"./index-DH3aprf6.js";import"./vendor-xterm-DzcZoU0P.js";function ie({projectId:c,addToast:o,onClose:Q}){const[d,v]=i.useState([]),[f,y]=i.useState(!0),[W,E]=i.useState(!1),[L,p]=i.useState(null),[D,A]=i.useState([]),[h,K]=i.useState(""),[m,g]=i.useState(null),[k,x]=i.useState(null),[V,R]=i.useState(!1),[z,j]=i.useState(null),r=i.useRef(null),[N,q]=i.useState(""),F=h.trim()?d.filter(s=>s.name.toLowerCase().includes(h.toLowerCase())||s.relativePath.toLowerCase().includes(h.toLowerCase())):d,C=i.useCallback(async()=>{y(!0);try{const s=await X(c);v(s)}catch(s){const a=s instanceof Error?s.message:"Failed to load discovered skills";o(a,"error")}finally{y(!1)}},[c,o]),u=i.useCallback(async s=>{const a=l=>{if(!l||typeof l!="object")return!1;const t=l;if(typeof t.status=="number"&&t.status>=500)return!0;if(t.details&&typeof t.details=="object"){const w=t.details;if(typeof w.code=="string"&&w.code.startsWith("upstream_"))return!0}const n=l;return typeof n.error=="string"&&typeof n.code=="string"};E(!0),p(null);try{const l=await _(s,20,c);A(l.entries)}catch(l){if(a(l))p("Catalog is temporarily unavailable. Please try again later.");else{const t=l instanceof Error?l.message:"Failed to load catalog";p(t)}}finally{E(!1)}},[c]);i.useEffect(()=>{C(),u("")},[C,u]);const M=i.useCallback(s=>{K(s),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{q(s),r.current=null},300)},[]);i.useEffect(()=>()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]),i.useEffect(()=>{u(N)},[N,u]);const T=i.useCallback(async(s,a)=>{const l=!a;v(t=>t.map(n=>n.id===s?{...n,toggling:!0}:n));try{await B(s,l,c),v(t=>t.map(n=>n.id===s?{...n,enabled:l,toggling:!1}:n)),o(`Skill ${l?"enabled":"disabled"}`,"success")}catch(t){v(w=>w.map(S=>S.id===s?{...S,toggling:!1}:S));const n=t instanceof Error?t.message:"Failed to toggle skill";o(`Failed to toggle skill: ${n}`,"error")}},[c,o]),b=i.useCallback(async s=>{R(!0),j(null),x(null);try{const a=await G(s,c);x(a)}catch(a){const l=a instanceof Error?a.message:"Failed to load skill content";j(l)}finally{R(!1)}},[c]),$=i.useCallback((s,a)=>{if(!(a&&a.target.closest(".skills-view-item-toggle"))){if(m===s){g(null),x(null),j(null);return}g(s),b(s)}},[m,b]),U=i.useCallback(s=>{m!==s&&g(s),b(s)},[b,m]);return e.jsxs("div",{className:"skills-view","data-testid":"skills-view",children:[e.jsxs("div",{className:"skills-view-header",children:[e.jsxs("div",{className:"skills-view-title",children:[e.jsxs("h2",{children:[e.jsx(H,{size:20}),"Skills"]}),e.jsxs("span",{className:"skills-view-count","aria-label":`${d.length} discovered skills`,children:[d.length," discovered"]})]}),e.jsxs("div",{className:"skills-view-actions",children:[e.jsx("button",{className:"btn-icon skills-view-close touch-target",onClick:Q,"aria-label":"Close skills view",children:e.jsx(P,{size:16})}),e.jsxs("button",{className:"btn btn-sm touch-target",onClick:()=>void C(),disabled:f,children:[e.jsx(J,{size:14,className:f?"spin":""}),"Refresh"]})]})]}),e.jsxs("div",{className:"skills-view-content",children:[e.jsx("div",{className:"skills-view-search",children:e.jsx("input",{type:"text",className:"form-input",placeholder:"Search skills...",value:h,onChange:s=>M(s.target.value),"aria-label":"Search skills"})}),e.jsxs("section",{className:"skills-view-section","aria-labelledby":"discovered-skills-title",children:[e.jsx("h3",{id:"discovered-skills-title",className:"skills-view-section-title",children:"Discovered Skills"}),f?e.jsxs("div",{className:"skills-view-loading",children:[e.jsx("span",{className:"spinner"}),"Loading discovered skills..."]}):d.length===0?e.jsx("div",{className:"skills-view-empty",children:e.jsx("p",{children:"No skills discovered in this project."})}):F.length===0?e.jsx("div",{className:"skills-view-empty",children:e.jsx("p",{children:"No discovered skills match your search."})}):e.jsx("div",{className:"skills-view-list",children:F.map(s=>{const a=m===s.id;return e.jsxs("div",{children:[e.jsxs("div",{className:`skills-view-item${a?" skills-view-item--selected":""}`,onClick:l=>$(s.id,l),role:"button",tabIndex:0,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),$(s.id))},"aria-expanded":a,"aria-label":`View details for ${s.name}`,children:[e.jsxs("div",{className:"skills-view-item-info",children:[e.jsxs("span",{className:"skills-view-item-name",children:[a?e.jsx(O,{size:14}):e.jsx(Y,{size:14}),s.name]}),e.jsx("span",{className:"skills-view-item-path",children:s.relativePath}),e.jsx("span",{className:"skills-view-item-source",children:s.metadata.source})]}),e.jsxs("label",{className:"skills-view-item-toggle",onClick:l=>l.stopPropagation(),children:[e.jsx("input",{type:"checkbox",checked:s.enabled,disabled:s.toggling,onChange:()=>void T(s.id,s.enabled),"aria-label":`${s.enabled?"Disable":"Enable"} ${s.name}`}),e.jsx("span",{className:"skills-view-toggle-slider"})]})]}),a&&e.jsxs("div",{className:"skills-view-detail","data-testid":"skill-detail",children:[e.jsxs("div",{className:"skills-view-detail-header",children:[e.jsx("span",{className:"skills-view-detail-title",children:s.name}),e.jsxs("button",{className:"btn btn-sm skills-view-detail-close",onClick:()=>{g(null),x(null),j(null)},"aria-label":"Close skill detail",children:[e.jsx(P,{size:14}),"Close"]})]}),V?e.jsxs("div",{className:"skills-view-detail-loading",children:[e.jsx(Z,{size:16,className:"spin"}),"Loading skill content..."]}):z?e.jsxs("div",{className:"skills-view-detail-error",children:[e.jsx(I,{size:14}),e.jsx("span",{children:z}),e.jsx("button",{className:"btn btn-sm",onClick:()=>U(s.id),children:"Retry"})]}):k?e.jsxs(e.Fragment,{children:[e.jsx("pre",{className:"skills-view-detail-content",children:k.skillMd||"(No SKILL.md found)"}),k.files.length>0&&e.jsxs("div",{className:"skills-view-detail-files",children:[e.jsx("span",{className:"skills-view-detail-files-label",children:"Files:"}),k.files.map(l=>e.jsxs("span",{className:"badge badge--sm",children:[l.name,l.type==="directory"&&"/"]},l.relativePath))]})]}):null]})]},s.id)})})]}),e.jsxs("section",{className:"skills-view-section","aria-labelledby":"catalog-title",children:[e.jsx("h3",{id:"catalog-title",className:"skills-view-section-title",children:"Skills Catalog"}),L?e.jsxs("div",{className:"skills-view-error",children:[e.jsx("p",{children:L}),e.jsx("button",{className:"btn btn-sm",onClick:()=>void u(N),children:"Try Again"})]}):W?e.jsxs("div",{className:"skills-view-loading",children:[e.jsx("span",{className:"spinner"}),"Loading catalog..."]}):D.length===0?e.jsx("div",{className:"skills-view-empty",children:h?e.jsx("p",{children:"No skills match your search."}):e.jsx("p",{children:"No skills available in the catalog."})}):e.jsx("div",{className:"skills-view-grid",children:D.map(s=>e.jsxs("div",{className:"skills-view-card",children:[e.jsx("h4",{className:"skills-view-card-title",children:s.name}),s.description&&e.jsx("p",{className:"skills-view-card-description",children:s.description}),s.tags&&s.tags.length>0&&e.jsx("div",{className:"skills-view-card-tags",children:s.tags.map(a=>e.jsx("span",{className:"badge badge--sm",children:a},a))}),s.installs!==void 0&&e.jsxs("span",{className:"skills-view-card-installs",children:[s.installs.toLocaleString()," installs"]})]},s.id))})]})]})]})}export{ie as SkillsView};
@@ -0,0 +1,6 @@
1
+ import{r as d,j as e}from"./vendor-react-K0fH_qHe.js";import{c as kt,b$ as wt,c0 as Ct,c1 as St,c2 as At,c3 as $t,c4 as Et,c5 as Dt,c6 as Ft,w as Tt,i as Mt,z as q,c7 as lt,L as Ot,J as Rt,bl as G,X as Q,aH as ut,V as mt,ad as Pt,W as Ut,am as _t,B as bt}from"./index-DH3aprf6.js";import{L as pt}from"./list-checks-ByGHVQpZ.js";import"./vendor-xterm-DzcZoU0P.js";/**
2
+ * @license lucide-react v1.7.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Kt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],Bt=kt("circle-plus",Kt);function Vt(L){const{items:l,...f}=L;return f}function ht(L){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`${L}-${crypto.randomUUID()}`:`${L}-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function zt(L={}){const{projectId:l,addToast:f}=L,[k,N]=d.useState([]),[y,I]=d.useState([]),[K,w]=d.useState(!0),[z,v]=d.useState(null),[$,E]=d.useState(null),[j,h]=d.useState([]),C=d.useRef($);C.current=$,d.useEffect(()=>{let n=!1;async function i(){w(!0),v(null);try{const u=await Ft(l);if(n)return;h(u),N(u.map(Vt));const c=C.current&&u.some(r=>r.id===C.current)?C.current:u[0]?.id??null;E(c),I(c?u.find(r=>r.id===c)?.items??[]:[])}catch(u){if(n)return;h([]),N([]),I([]),E(null),v(u instanceof Error?u.message:"Failed to load todo lists")}finally{n||w(!1)}}return i(),()=>{n=!0}},[l]),d.useEffect(()=>{if(!$){I([]);return}const n=j.find(i=>i.id===$);I(n?.items??[])},[j,$]);const H=d.useCallback(async n=>{const i=k,u=j,c=new Date().toISOString(),r={id:ht("temp-list"),projectId:l??"",title:n,createdAt:c,updatedAt:c};v(null),N(s=>[...s,r]),h(s=>[...s,{...r,items:[]}]);try{const s=await wt(n,l);N(o=>o.map(a=>a.id===r.id?s:a)),h(o=>o.map(a=>a.id===r.id?{...s,items:[]}:a)),C.current||E(s.id)}catch(s){N(i),h(u),v(s instanceof Error?s.message:"Failed to create list"),f?.("Failed to create todo list","error")}},[f,j,k,l]),J=d.useCallback(async(n,i)=>{const u=k,c=j;v(null),N(r=>r.map(s=>s.id===n?{...s,title:i}:s)),h(r=>r.map(s=>s.id===n?{...s,title:i}:s));try{const r=await Ct(n,i,l);N(s=>s.map(o=>o.id===n?r:o)),h(s=>s.map(o=>o.id===n?{...r,items:o.items}:o))}catch(r){N(u),h(c),v(r instanceof Error?r.message:"Failed to rename list"),f?.("Failed to rename todo list","error")}},[f,j,k,l]),M=d.useCallback(async n=>{const i=k,u=j,c=C.current,r=c===n?k.find(s=>s.id!==n)?.id??null:c;v(null),N(s=>s.filter(o=>o.id!==n)),h(s=>s.filter(o=>o.id!==n)),c===n&&E(r);try{await St(n,l)}catch(s){N(i),h(u),E(c),v(s instanceof Error?s.message:"Failed to delete list"),f?.("Failed to delete todo list","error")}},[f,j,k,l]),S=d.useCallback(async n=>{const i=C.current;if(!i)return;const u=y,c=j,r=new Date().toISOString(),s=y.reduce((a,m)=>Math.max(a,m.sortOrder),-1),o={id:ht("temp-item"),listId:i,text:n,completed:!1,completedAt:null,createdAt:r,updatedAt:r,sortOrder:s+1};v(null),I(a=>[...a,o]),h(a=>a.map(m=>m.id===i?{...m,items:[...m.items,o]}:m));try{const a=await At(i,n,l);I(m=>m.map(x=>x.id===o.id?a:x)),h(m=>m.map(x=>x.id===i?{...x,items:x.items.map(F=>F.id===o.id?a:F)}:x))}catch(a){I(u),h(c),v(a instanceof Error?a.message:"Failed to create item"),f?.("Failed to create todo item","error")}},[f,y,j,l]),T=d.useCallback(async(n,i)=>{const u=y.find(a=>a.id===n);if(!u)return;const c=y,r=j,s=i.completed??u.completed,o={...u,...i,completed:s,completedAt:s?u.completedAt??new Date().toISOString():null,updatedAt:new Date().toISOString()};v(null),I(a=>a.map(m=>m.id===n?o:m)),h(a=>a.map(m=>m.id===o.listId?{...m,items:m.items.map(x=>x.id===n?o:x)}:m));try{const a=await $t(n,i,l);I(m=>m.map(x=>x.id===n?a:x)),h(m=>m.map(x=>x.id===a.listId?{...x,items:x.items.map(F=>F.id===n?a:F)}:x))}catch(a){I(c),h(r),v(a instanceof Error?a.message:"Failed to update item"),f?.("Failed to update todo item","error")}},[f,y,j,l]),A=d.useCallback(async n=>{const i=y.find(u=>u.id===n);i&&await T(n,{completed:!i.completed})},[y,T]),O=d.useCallback(async n=>{const i=y,u=j;v(null),I(c=>c.filter(r=>r.id!==n)),h(c=>c.map(r=>({...r,items:r.items.filter(s=>s.id!==n)})));try{await Et(n,l)}catch(c){I(i),h(u),v(c instanceof Error?c.message:"Failed to delete item"),f?.("Failed to delete todo item","error")}},[f,y,j,l]),D=d.useCallback(async n=>{const i=C.current;if(!i)return;const u=y,c=j,r=new Map(y.map(o=>[o.id,o])),s=n.map((o,a)=>{const m=r.get(o);return m?{...m,sortOrder:a}:null}).filter(o=>o!==null);v(null),I(s),h(o=>o.map(a=>a.id===i?{...a,items:s}:a));try{await Dt(i,n,l)}catch(o){I(u),h(c),v(o instanceof Error?o.message:"Failed to reorder items"),f?.("Failed to reorder todo items","error")}},[f,y,j,l]);return{lists:k,items:y,loading:K,error:z,selectedListId:$,setSelectedListId:E,createList:H,renameList:J,deleteList:M,createItem:S,updateItem:T,toggleItem:A,deleteItem:O,reorderItems:D}}function Ht(L){return[...L].sort((l,f)=>l.sortOrder-f.sortOrder)}function Gt({projectId:L,addToast:l,onPlanningMode:f,onTaskCreated:k}){const{lists:N,items:y,loading:I,error:K,selectedListId:w,setSelectedListId:z,createList:v,renameList:$,deleteList:E,createItem:j,updateItem:h,toggleItem:C,deleteItem:H,reorderItems:J}=zt({projectId:L,addToast:(t,p)=>{if(p==="success"||p==="error"||p==="info"||p===void 0){l(t,p);return}l(t,"info")}}),[M,S]=d.useState(null),[T,A]=d.useState(""),[O,D]=d.useState(null),[n,i]=d.useState(""),[u,c]=d.useState(""),[r,s]=d.useState(!1),[o,a]=d.useState(""),[m,x]=d.useState([]),[F,Y]=d.useState(!1),[W,R]=d.useState(!1),[Z,P]=d.useState(null),X=d.useRef(null),{confirm:ft}=Tt(),tt=d.useMemo(()=>N.find(t=>t.id===w)??null,[N,w]),B=d.useMemo(()=>Ht(y.filter(t=>t.listId===w)),[y,w]);function et(){S(null),A(""),c(""),s(!1)}function V(){D(null),i(""),a("")}function xt(t){et(),V(),z(t)}const gt=d.useCallback(async()=>{Y(!0);try{const t=await Mt(void 0,L);x(t),R(!0)}catch(t){l(`Failed to load agents: ${q(t)}`,"error"),R(!1),P(null)}finally{Y(!1)}},[L,l]);d.useEffect(()=>{S(null),A(""),c(""),s(!1),D(null),i(""),a(""),R(!1),P(null)},[w]),d.useEffect(()=>{if(!W)return;const t=p=>{X.current&&!X.current.contains(p.target)&&(R(!1),P(null))};return document.addEventListener("mousedown",t),()=>{document.removeEventListener("mousedown",t)}},[W]);function vt(t){V(),S(t.id),A(t.title),s(!1)}async function st(){if(!M)return;const t=T.trim();if(!t){S(null),A("");return}await $(M,t),S(null),A("")}function nt(){S(null),A("")}function at(t){et(),D(t.id),i(t.text)}async function it(){if(!O)return;const t=n.trim();if(!t){D(null),i("");return}await h(O,{text:t}),D(null),i("")}function ot(){D(null),i("")}async function dt(){const t=u.trim();t&&(await v(t),c(""),s(!1))}async function rt(){if(!w)return;const t=o.trim();t&&(await j(t),a(""))}async function jt(t){await ft({title:"Delete List",message:"Delete this list and all its items?",danger:!0})&&await E(t)}async function yt(t){await H(t)}async function ct(t,p){const g=B.map(_=>_.id),b=g.findIndex(_=>_===t);if(b<0)return;const U=p==="up"?b-1:b+1;U<0||U>=g.length||([g[b],g[U]]=[g[U],g[b]],await J(g))}const Lt=d.useCallback(async t=>{try{const p={description:t.text,column:"triage",source:{sourceType:"dashboard_ui"}},g=await lt(p,L);k?.(g),l(`Created ${g.id} from todo`,"success")}catch(p){l(`Failed to create task: ${q(p)}`,"error")}},[L,l,k]),It=d.useCallback(async(t,p)=>{try{const g={description:t.text,column:"triage",assignedAgentId:p,source:{sourceType:"dashboard_ui"}},b=await lt(g,L);k?.(b);const _=m.find(Nt=>Nt.id===p)?.name??p;l(`Created ${b.id} and assigned to ${_}`,"success"),R(!1),P(null)}catch(g){l(`Failed to create and assign task: ${q(g)}`,"error")}},[L,l,m,k]);return I?e.jsx("div",{className:"todo-view",children:e.jsxs("div",{className:"todo-loading",children:[e.jsx(Ot,{className:"todo-loading-icon","aria-hidden":"true"}),e.jsx("p",{children:"Loading todos..."})]})}):e.jsxs("div",{className:"todo-view",children:[e.jsx("div",{className:"todo-view-header",children:e.jsxs("div",{children:[e.jsx("h2",{children:"Todos"}),e.jsx("p",{className:"todo-view-description",children:"Manage reusable todo lists for your project."})]})}),e.jsxs("div",{className:"todo-view-layout",children:[e.jsxs("aside",{className:"todo-view-sidebar","aria-label":"Todo lists sidebar",children:[e.jsxs("div",{className:"todo-sidebar-header",children:[e.jsx("h3",{className:"todo-sidebar-title",children:"Lists"}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-add-list-btn",onClick:()=>{V(),s(!0),S(null)},"aria-label":"Add list","data-testid":"add-list-button",children:e.jsx(Rt,{})})]}),r&&e.jsxs("div",{className:"todo-list-item",children:[e.jsx("input",{className:"input todo-inline-edit-input",placeholder:"New list title",value:u,onChange:t=>c(t.target.value),onKeyDown:t=>{t.key==="Enter"&&dt(),t.key==="Escape"&&(c(""),s(!1))},autoFocus:!0,"data-testid":"new-list-input"}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:()=>{dt()},"aria-label":"Save list",children:e.jsx(G,{})}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:()=>{c(""),s(!1)},"aria-label":"Cancel list",children:e.jsx(Q,{})})]}),N.length===0&&!r?e.jsxs("div",{className:"todo-empty-state",children:[e.jsx(pt,{"aria-hidden":"true"}),e.jsx("p",{children:"No todo lists yet. Create one to get started."}),e.jsx("button",{type:"button",className:"btn btn-sm",onClick:()=>{V(),s(!0)},children:"Create List"})]}):e.jsx("div",{className:"todo-list-items",role:"list","aria-label":"Todo lists",children:N.map(t=>{const p=t.id===w,g=t.id===M;return e.jsx("div",{className:`todo-list-item${p?" todo-list-item--active":""}`,role:"listitem",children:g?e.jsxs(e.Fragment,{children:[e.jsx("input",{className:"input todo-inline-edit-input",value:T,onChange:b=>A(b.target.value),onKeyDown:b=>{b.key==="Enter"&&st(),b.key==="Escape"&&nt()},autoFocus:!0,"data-testid":`rename-list-input-${t.id}`}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:()=>{st()},"aria-label":"Save list rename",children:e.jsx(G,{})}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:nt,"aria-label":"Cancel list rename",children:e.jsx(Q,{})})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"todo-list-select-btn",onClick:()=>xt(t.id),"aria-label":`Select list ${t.title}`,"aria-current":p?"true":void 0,"data-testid":`todo-list-${t.id}`,children:e.jsx("span",{className:"todo-list-item-name",children:t.title})}),e.jsxs("div",{className:"todo-list-item-actions",children:[e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:()=>{vt(t)},"aria-label":`Rename ${t.title}`,"data-testid":`rename-list-button-${t.id}`,children:e.jsx(ut,{})}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon btn-danger todo-icon-btn",onClick:()=>{jt(t.id)},"aria-label":`Delete ${t.title}`,"data-testid":`delete-list-button-${t.id}`,children:e.jsx(mt,{})})]})]})},t.id)})})]}),e.jsxs("section",{className:"todo-view-main","aria-label":"Todo items",children:[K&&e.jsxs("div",{className:"todo-error-banner",role:"alert",children:[e.jsx("span",{className:"todo-error-message",children:K}),e.jsx("button",{type:"button",className:"btn btn-sm",onClick:()=>window.location.reload(),children:"Retry"})]}),tt?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"todo-items-header",children:e.jsx("h3",{children:tt.title})}),e.jsxs("div",{className:"todo-add-item-row",children:[e.jsx("input",{className:"input",placeholder:"Add a todo item",value:o,onChange:t=>a(t.target.value),onKeyDown:t=>{t.key==="Enter"&&rt(),t.key==="Escape"&&a("")},"data-testid":"new-item-input"}),e.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>{rt()},children:"Add"})]}),B.length===0?e.jsx("div",{className:"todo-empty-state",children:e.jsx("p",{children:"No items in this list. Add one above."})}):e.jsx("div",{className:"todo-items-list",children:B.map((t,p)=>{const g=t.id===O;return e.jsxs("div",{className:"todo-item","data-testid":`todo-item-${t.id}`,children:[e.jsxs("div",{className:"todo-item-main-row",children:[e.jsx("input",{type:"checkbox",checked:t.completed,onChange:()=>{C(t.id)},className:"todo-item-checkbox","aria-label":`Toggle ${t.text}`,"data-testid":`toggle-item-${t.id}`}),g?e.jsx("input",{className:"input todo-inline-edit-input",value:n,onChange:b=>i(b.target.value),onKeyDown:b=>{b.key==="Enter"&&it(),b.key==="Escape"&&ot()},autoFocus:!0,"data-testid":`edit-item-input-${t.id}`}):e.jsx("button",{type:"button",className:`todo-item-text${t.completed?" todo-item-text--completed":""}`,onClick:()=>at(t),children:t.text})]}),e.jsx("div",{className:"todo-item-actions","data-testid":`todo-item-actions-${t.id}`,children:g?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:()=>{it()},"aria-label":"Save item edit",children:e.jsx(G,{})}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:ot,"aria-label":"Cancel item edit",children:e.jsx(Q,{})})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"todo-item-reorder-btns",children:[e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-item-reorder-btn",onClick:()=>{ct(t.id,"up")},disabled:p===0,"aria-label":`Move ${t.text} up`,"data-testid":`move-up-${t.id}`,children:e.jsx(Pt,{})}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-item-reorder-btn",onClick:()=>{ct(t.id,"down")},disabled:p===B.length-1,"aria-label":`Move ${t.text} down`,"data-testid":`move-down-${t.id}`,children:e.jsx(Ut,{})})]}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:()=>{f?.(t.text)},"aria-label":`Start planning from ${t.text}`,"data-testid":`planning-from-${t.id}`,children:e.jsx(_t,{})}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:()=>{Lt(t)},"aria-label":`Create task from ${t.text}`,"data-testid":`create-task-from-${t.id}`,children:e.jsx(Bt,{})}),e.jsxs("div",{className:"todo-agent-picker-trigger",ref:Z===t.id?X:void 0,children:[e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:()=>{P(t.id),gt()},"aria-label":`Assign ${t.text} to agent`,"data-testid":`assign-agent-for-${t.id}`,children:e.jsx(bt,{})}),W&&Z===t.id&&e.jsx("div",{className:"todo-agent-picker-dropdown",onMouseDown:b=>{b.preventDefault()},children:F?e.jsx("div",{className:"todo-agent-picker-loading",children:"Loading agents..."}):m.filter(b=>b.state!=="terminated").length>0?m.filter(b=>b.state!=="terminated").map(b=>e.jsxs("button",{type:"button",className:"todo-agent-picker-item",onClick:()=>{It(t,b.id)},children:[e.jsx(bt,{}),e.jsx("span",{children:b.name}),e.jsx("span",{className:"todo-agent-picker-role",children:b.role})]},b.id)):e.jsx("div",{className:"todo-agent-picker-empty",children:"No agents available"})})]}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon todo-icon-btn",onClick:()=>at(t),"aria-label":`Edit ${t.text}`,"data-testid":`edit-item-${t.id}`,children:e.jsx(ut,{})}),e.jsx("button",{type:"button",className:"btn btn-sm btn-icon btn-danger todo-icon-btn",onClick:()=>{yt(t.id)},"aria-label":`Delete ${t.text}`,"data-testid":`delete-item-${t.id}`,children:e.jsx(mt,{})})]})})]},t.id)})})]}):e.jsxs("div",{className:"todo-empty-state",children:[e.jsx(pt,{"aria-hidden":"true"}),e.jsx("p",{children:"Select a list from the sidebar"})]})]})]})]})}export{Gt as TodoView};
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-Bc8nfKeH.js";/**
1
+ import{c as a}from"./index-DH3aprf6.js";/**
2
2
  * @license lucide-react v1.7.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.