@runfusion/fusion 0.76.0-beta.1 → 0.76.0-beta.2
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 +503 -213
- package/dist/child-process-worker.js +466 -207
- package/dist/client/.vite/manifest.json +260 -260
- package/dist/client/assets/{AgentDetailView-Cbl1sw6i.js → AgentDetailView-gak4EWTI.js} +1 -1
- package/dist/client/assets/{AgentPermissionPolicyEditor-DD1U5M9p.js → AgentPermissionPolicyEditor-DP1QbZL-.js} +1 -1
- package/dist/client/assets/{AgentsView-BMcCbple.js → AgentsView-DAMRTKzI.js} +3 -3
- package/dist/client/assets/ChatView-iE-2gf5P.js +13 -0
- package/dist/client/assets/{CommandCenter-D7mcD61V.js → CommandCenter-B6RnkLYm.js} +1 -1
- package/dist/client/assets/{DevServerView-DaqCn0p5.js → DevServerView-DcFL_LzK.js} +1 -1
- package/dist/client/assets/{DirectoryPicker-CLdqqqYN.js → DirectoryPicker-CtjqrYoO.js} +1 -1
- package/dist/client/assets/{DocumentsView-BOROVxPm.js → DocumentsView-BkAe2S4H.js} +1 -1
- package/dist/client/assets/{EvalsView-BQMXRUlQ.js → EvalsView-CbGA9dMn.js} +1 -1
- package/dist/client/assets/{ExperimentalAgentOnboardingModal-1GNeCIQT.js → ExperimentalAgentOnboardingModal-CMgO_S8T.js} +1 -1
- package/dist/client/assets/{GoalsView-Cr3c_2GC.js → GoalsView-_3P9J5sf.js} +1 -1
- package/dist/client/assets/{InsightsView-DgVBVQM4.js → InsightsView-DOhO7xH5.js} +1 -1
- package/dist/client/assets/{MemoryView-C0VzzMSw.js → MemoryView-DwJas8vi.js} +1 -1
- package/dist/client/assets/{PiExtensionsManager-D1kkkVtP.js → PiExtensionsManager-B_LiW_e9.js} +1 -1
- package/dist/client/assets/{PluginManager-BW-_Zyo5.js → PluginManager-BkB6WLQc.js} +1 -1
- package/dist/client/assets/{PullRequestView-Cmlo4nWA.js → PullRequestView-DcH5tmYc.js} +1 -1
- package/dist/client/assets/{ReportModal-BWuaroTF.js → ReportModal-BOEbqtqG.js} +1 -1
- package/dist/client/assets/{ResearchView-BmkF_vZU.js → ResearchView-Dp6V42pI.js} +1 -1
- package/dist/client/assets/{SecretsView-DVc8Hky0.js → SecretsView-BCqXHB2L.js} +1 -1
- package/dist/client/assets/{SessionTerminal-DCXrxA57.js → SessionTerminal-CkdoQv4y.js} +1 -1
- package/dist/client/assets/{SettingsModal-DZ32F1c-.js → SettingsModal-D4Fn4GlS.js} +3 -3
- package/dist/client/assets/{SettingsModal-DqwpLnDU.js → SettingsModal-Dc7YG6KB.js} +1 -1
- package/dist/client/assets/{SettingsTextareaRow-B5spAoOY.js → SettingsTextareaRow-WSkBoAOO.js} +1 -1
- package/dist/client/assets/{SetupWizardModal-VTBLyFzr.js → SetupWizardModal-VTrJAsKd.js} +2 -2
- package/dist/client/assets/{SkillsView-CR91ey9d.js → SkillsView-CXeXOxfF.js} +1 -1
- package/dist/client/assets/{WorkflowNodeEditor-BzGh_Fd9.js → WorkflowNodeEditor-DoxLGPRF.js} +1 -1
- package/dist/client/assets/{agent-import-generation-D27NKQsr.js → agent-import-generation-upc0yw-M.js} +1 -1
- package/dist/client/assets/{agentsOrgChartLayout-C2K_M3x3.js → agentsOrgChartLayout-C3iumMrW.js} +1 -1
- package/dist/client/assets/{architectureDiagram-3BPJPVTR-BQy8UcRx.js → architectureDiagram-3BPJPVTR-D6jqc3fJ.js} +1 -1
- package/dist/client/assets/{blockDiagram-GPEHLZMM-CZG1bqFQ.js → blockDiagram-GPEHLZMM-DY3AKuPD.js} +1 -1
- package/dist/client/assets/{c4Diagram-AAUBKEIU-CZmO_kg3.js → c4Diagram-AAUBKEIU-CpD52V4g.js} +1 -1
- package/dist/client/assets/channel-CaxOu15c.js +1 -0
- package/dist/client/assets/{chunk-2J33WTMH-jsad6DTE.js → chunk-2J33WTMH-CPeIHyAX.js} +1 -1
- package/dist/client/assets/{chunk-4BX2VUAB-DX7SuvwP.js → chunk-4BX2VUAB-ivAwI4xM.js} +1 -1
- package/dist/client/assets/{chunk-55IACEB6-De20xFgU.js → chunk-55IACEB6-BtVQ5XaZ.js} +1 -1
- package/dist/client/assets/{chunk-727SXJPM-CNiri9yW.js → chunk-727SXJPM-1eap1vDU.js} +1 -1
- package/dist/client/assets/{chunk-AQP2D5EJ-DvDqG-ax.js → chunk-AQP2D5EJ-B2NB3BW9.js} +1 -1
- package/dist/client/assets/{chunk-FMBD7UC4-DkMdKaUq.js → chunk-FMBD7UC4-Hk_smNYv.js} +1 -1
- package/dist/client/assets/{chunk-ND2GUHAM-Do5BwIrI.js → chunk-ND2GUHAM-BmGCAojk.js} +1 -1
- package/dist/client/assets/{chunk-QZHKN3VN-BnJgt9vl.js → chunk-QZHKN3VN-D0aXZ8CV.js} +1 -1
- package/dist/client/assets/classDiagram-4FO5ZUOK-DXIkGbsl.js +1 -0
- package/dist/client/assets/classDiagram-v2-Q7XG4LA2-DXIkGbsl.js +1 -0
- package/dist/client/assets/{cose-bilkent-S5V4N54A-D-ivAzzF.js → cose-bilkent-S5V4N54A-DAbu_gnF.js} +1 -1
- package/dist/client/assets/{dagre-BM42HDAG-Bpd9L0or.js → dagre-BM42HDAG-BdmLlrDJ.js} +1 -1
- package/dist/client/assets/{dashboard-view-DSvVO6Vr.js → dashboard-view-BoFBSXUn.js} +1 -1
- package/dist/client/assets/{dashboard-view-CgBo8Ctn.js → dashboard-view-CULL1yhL.js} +1 -1
- package/dist/client/assets/{dashboard-view-C-XU9CVv.js → dashboard-view-CxXMDfNY.js} +1 -1
- package/dist/client/assets/{dashboard-view-DbaRE8Ma.js → dashboard-view-PRCWCSLm.js} +1 -1
- package/dist/client/assets/{diagram-2AECGRRQ-B6TT1NWU.js → diagram-2AECGRRQ-PpqLbVUA.js} +1 -1
- package/dist/client/assets/{diagram-5GNKFQAL-DpRS2yRw.js → diagram-5GNKFQAL-9rkGmTwh.js} +1 -1
- package/dist/client/assets/{diagram-KO2AKTUF-BVbZr02C.js → diagram-KO2AKTUF-BT-efOMo.js} +1 -1
- package/dist/client/assets/{diagram-LMA3HP47-DzENbfal.js → diagram-LMA3HP47-w79OWFxg.js} +1 -1
- package/dist/client/assets/{diagram-OG6HWLK6-BIePG5SY.js → diagram-OG6HWLK6-Bye9I5IO.js} +1 -1
- package/dist/client/assets/{erDiagram-TEJ5UH35-CQo3WBwo.js → erDiagram-TEJ5UH35-aodREgDf.js} +1 -1
- package/dist/client/assets/{flowDiagram-I6XJVG4X-Ct2H4jYo.js → flowDiagram-I6XJVG4X-D0DKItY3.js} +1 -1
- package/dist/client/assets/{folder-open-DAh8mpTX.js → folder-open-CqvaMJvx.js} +1 -1
- package/dist/client/assets/{ganttDiagram-6RSMTGT7-DyOLCG4B.js → ganttDiagram-6RSMTGT7-CZVApkvw.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-PVQCEYII-sC28-su3.js → gitGraphDiagram-PVQCEYII-D_ynwJ4p.js} +1 -1
- package/dist/client/assets/index-DWRJyaa3.js +2818 -0
- package/dist/client/assets/{infoDiagram-5YYISTIA-Q81_5aBZ.js → infoDiagram-5YYISTIA-pJG6zxjk.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-Cwkjs0z5.js → ishikawaDiagram-YF4QCWOH-nFZ5laUo.js} +1 -1
- package/dist/client/assets/{journeyDiagram-JHISSGLW-BXcBV1Bc.js → journeyDiagram-JHISSGLW-CWpCaAIe.js} +1 -1
- package/dist/client/assets/{kanban-definition-UN3LZRKU-BI7hW892.js → kanban-definition-UN3LZRKU-ATkPspKa.js} +1 -1
- package/dist/client/assets/{mermaid.core-B8oDA6jj.js → mermaid.core-CDXPNs7a.js} +4 -4
- package/dist/client/assets/{mindmap-definition-RKZ34NQL-COG6_9eD.js → mindmap-definition-RKZ34NQL-BkqS9tpe.js} +1 -1
- package/dist/client/assets/{pieDiagram-4H26LBE5-D11brZ_N.js → pieDiagram-4H26LBE5-DEUyVLs-.js} +1 -1
- package/dist/client/assets/{puzzle-D3_Z_rlW.js → puzzle-DQ0y1-XK.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-W4KKPZXB-jmhDVZcv.js → quadrantDiagram-W4KKPZXB-ESBJNK5c.js} +1 -1
- package/dist/client/assets/{requirementDiagram-4Y6WPE33-BKCUWI1E.js → requirementDiagram-4Y6WPE33-CqPs7zcv.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-5OEKKPKP-HsZdEl2t.js → sankeyDiagram-5OEKKPKP-CkFN0m14.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-3UESZ5HK-CsDf7Fup.js → sequenceDiagram-3UESZ5HK-Dx2nDuMO.js} +1 -1
- package/dist/client/assets/{shield-alert-C16k8wNu.js → shield-alert-BS05s4RM.js} +1 -1
- package/dist/client/assets/{standing-instructions-template-BqAyftqe.js → standing-instructions-template-xprxYNHm.js} +1 -1
- package/dist/client/assets/{stateDiagram-AJRCARHV-fvzWhltB.js → stateDiagram-AJRCARHV-EUPmRFGd.js} +1 -1
- package/dist/client/assets/{stateDiagram-v2-BHNVJYJU-cnt42Sr_.js → stateDiagram-v2-BHNVJYJU-DcQ2mhi5.js} +1 -1
- package/dist/client/assets/{timeline-definition-PNZ67QCA-DsZFCSMb.js → timeline-definition-PNZ67QCA-D4YO_3V-.js} +1 -1
- package/dist/client/assets/{upload-_s5sL5Pq.js → upload-BjyBtxo7.js} +1 -1
- package/dist/client/assets/{users-DH1U5ISc.js → users-D5ogZ7WQ.js} +1 -1
- package/dist/client/assets/{vennDiagram-CIIHVFJN-B3KDWS-e.js → vennDiagram-CIIHVFJN-BT5_XuQL.js} +1 -1
- package/dist/client/assets/{wardley-L42UT6IY-BKs5MtQS.js → wardley-L42UT6IY-X_ZMW457.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-YWT4CUSO-CNsEoXVB.js → wardleyDiagram-YWT4CUSO-GK9nONHU.js} +1 -1
- package/dist/client/assets/{xychartDiagram-2RQKCTM6-kq_gW4QC.js → xychartDiagram-2RQKCTM6-Dw3zXHAq.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/client/version.json +1 -1
- package/dist/droid-cli/package.json +1 -1
- package/dist/extension.js +647 -207
- package/dist/migrations/0057_fn_9004_project_ownership_default_reconciliation.sql +13 -0
- package/dist/migrations/0058_fn_9014_message_archive.sql +13 -0
- package/dist/pi-claude-cli/package.json +5 -5
- package/dist/plugin-sdk/index.js +69 -23
- package/dist/plugins/fusion-plugin-acp-runtime/bundled.js +69 -23
- package/dist/plugins/fusion-plugin-acp-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-claude-runtime/bundled.js +69 -23
- package/dist/plugins/fusion-plugin-claude-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-cli-printing-press/bundled.js +69 -23
- package/dist/plugins/fusion-plugin-cli-printing-press/package.json +1 -1
- package/dist/plugins/fusion-plugin-compound-engineering/bundled.js +69 -23
- package/dist/plugins/fusion-plugin-compound-engineering/package.json +1 -1
- package/dist/plugins/fusion-plugin-cursor-runtime/bundled.js +69 -23
- package/dist/plugins/fusion-plugin-cursor-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-dependency-graph/bundled.js +69 -23
- package/dist/plugins/fusion-plugin-dependency-graph/package.json +1 -1
- package/dist/plugins/fusion-plugin-droid-runtime/bundled.js +71 -25
- package/dist/plugins/fusion-plugin-droid-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-grok-runtime/bundled.js +69 -23
- package/dist/plugins/fusion-plugin-grok-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-hermes-runtime/bundled.js +69 -23
- package/dist/plugins/fusion-plugin-hermes-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-linear-import/bundled.js +69 -23
- package/dist/plugins/fusion-plugin-linear-import/package.json +1 -1
- package/dist/plugins/fusion-plugin-omp-runtime/bundled.js +69 -23
- package/dist/plugins/fusion-plugin-omp-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-openclaw-runtime/bundled.js +69 -23
- package/dist/plugins/fusion-plugin-openclaw-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-paperclip-runtime/bundled.js +69 -23
- package/dist/plugins/fusion-plugin-paperclip-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-quality/bundled.js +69 -23
- package/dist/plugins/fusion-plugin-quality/package.json +1 -1
- package/dist/plugins/fusion-plugin-reports/bundled.js +69 -23
- package/dist/plugins/fusion-plugin-reports/package.json +1 -1
- package/dist/plugins/fusion-plugin-roadmap/bundled.js +69 -23
- package/dist/plugins/fusion-plugin-roadmap/package.json +1 -1
- package/dist/plugins/fusion-plugin-todos/bundled.js +69 -23
- package/dist/plugins/fusion-plugin-todos/package.json +1 -1
- package/dist/plugins/fusion-plugin-whatsapp-chat/bundled.js +69 -23
- package/dist/plugins/fusion-plugin-whatsapp-chat/package.json +1 -1
- package/package.json +3 -3
- package/skill/fusion/SKILL.md +1 -1
- package/skill/fusion/references/extension-tools.md +22 -0
- package/skill/fusion/references/fusion-capabilities.md +2 -0
- package/dist/client/assets/ChatView-DcM-ARpZ.js +0 -13
- package/dist/client/assets/channel-Cwl9FefC.js +0 -1
- package/dist/client/assets/classDiagram-4FO5ZUOK-BZtWCoHC.js +0 -1
- package/dist/client/assets/classDiagram-v2-Q7XG4LA2-BZtWCoHC.js +0 -1
- package/dist/client/assets/index-BlGpMJSZ.js +0 -2818
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r}from"./vendor-react-SZ_qB27O.js";import{a as n,w as s}from"./index-
|
|
1
|
+
import{r}from"./vendor-react-SZ_qB27O.js";import{a as n,w as s}from"./index-DWRJyaa3.js";function x(e){return n(s("/memory/files",e))}function C(e,t){const c=`path=${encodeURIComponent(e)}`;return n(s(`/memory/file?${c}`,t))}function F(e,t,c){return n(s("/memory/file",c),{method:"PUT",body:JSON.stringify({path:e,content:t})})}function J(e,t){return n(s("/memory/compact",t),{method:"POST",body:JSON.stringify(e?{path:e}:{})})}function N(e){return n(s("/memory/dream",e),{method:"POST"})}function W(e){return n(s("/memory/insights",e))}function j(e,t){return n(s("/memory/insights",t),{method:"PUT",body:JSON.stringify({content:e})})}function q(e){return n(s("/memory/extract",e),{method:"POST"})}function D(e){return n(s("/memory/audit",e))}function B(e){return n(s("/memory/backend",e))}function L(e){return n(s("/memory/install-qmd",e),{method:"POST"})}function $(e,t){return n(s("/memory/test",t),{method:"POST",body:JSON.stringify({query:e})})}function Q(e={}){const{projectId:t,pollInterval:c=6e4,autoRefresh:p=!1,enabled:a=!0}=e,[S,y]=r.useState(null),[g,m]=r.useState(a),[M,d]=r.useState(null),[k,v]=r.useState(null),o=r.useRef(null),u=r.useRef(null),l=r.useRef(!0),i=r.useCallback(async()=>{if(!a){m(!1),d(null),y(null);return}o.current&&o.current.abort(),o.current=new AbortController,m(!0),d(null),y(null);try{const f=await B(t);if(!l.current)return;y(f),d(null),v(new Date),m(!1)}catch(f){if(f instanceof Error&&f.name==="AbortError"||!l.current)return;const w=f instanceof Error?f.message:"Failed to fetch memory backend status";d(w),m(!1)}},[a,t]);r.useEffect(()=>(l.current=!0,a?(i(),()=>{l.current=!1}):(o.current&&o.current.abort(),y(null),d(null),m(!1),()=>{l.current=!1})),[a,i]),r.useEffect(()=>{if(!(!a||!p))return u.current=setInterval(()=>{i()},c),()=>{u.current&&(clearInterval(u.current),u.current=null)}},[a,p,c,i]),r.useEffect(()=>()=>{l.current=!1,o.current&&o.current.abort(),u.current&&(clearInterval(u.current),u.current=null)},[]);const I=r.useCallback(()=>i(),[i]),b=g?null:S,R=b?.currentBackend??null,h=b?.capabilities??null,E=b?.availableBackends??[],O=h?.readable??!1,P=h?.writable??!1,T=h?.supportsAtomicWrite??!1;return{status:b,currentBackend:R,capabilities:h,availableBackends:E,isReadable:O,isWritable:P,supportsAtomicWrite:T,loading:g,error:M,lastUpdated:k,refresh:I}}export{x as a,D as b,W as c,j as d,q as e,C as f,N as g,J as h,L as i,F as s,$ as t,Q as u};
|
package/dist/client/assets/{SettingsTextareaRow-B5spAoOY.js → SettingsTextareaRow-WSkBoAOO.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as h,j as e}from"./vendor-react-SZ_qB27O.js";import{u as w}from"./vendor-i18n-Duky4gdQ.js";import{dj as S,b1 as E}from"./index-
|
|
1
|
+
import{r as h,j as e}from"./vendor-react-SZ_qB27O.js";import{u as w}from"./vendor-i18n-Duky4gdQ.js";import{dj as S,b1 as E}from"./index-DWRJyaa3.js";const b="fusion:settings-help-open";function y({children:s,settingKey:l}){const{t:n}=w("app"),[c,o]=h.useState(!1),a=h.useRef(null),p=h.useId(),d=`settings-help-${l??p}`;h.useEffect(()=>{const t=i=>{i.detail!==d&&o(!1)};return document.addEventListener(b,t),()=>document.removeEventListener(b,t)},[d]);const u=()=>{o(t=>{const i=!t;return i&&document.dispatchEvent(new CustomEvent(b,{detail:d})),i})};return h.useEffect(()=>{if(!c)return;const t=r=>{a.current?.contains(r.target)||o(!1)},i=r=>{r.key==="Escape"&&(r.stopPropagation(),o(!1))};return document.addEventListener("pointerdown",t,!0),document.addEventListener("keydown",i,!0),()=>{document.removeEventListener("pointerdown",t,!0),document.removeEventListener("keydown",i,!0)}},[c]),e.jsxs("span",{className:"settings-help","data-open":c?"true":"false",ref:a,children:[e.jsx("button",{type:"button",className:"settings-help-trigger","aria-label":n("settings.help.show","Show help"),"aria-expanded":c,"aria-describedby":d,"data-testid":l?`settings-help-${l}`:void 0,onClick:u,children:e.jsx(S,{size:13,"aria-hidden":!0})}),e.jsx("span",{id:d,role:"note",className:"settings-help-bubble",children:s})]})}const N=h.createContext({highlightedKey:null});function L({highlightedKey:s,children:l}){const n=h.useMemo(()=>({highlightedKey:s}),[s]);return e.jsx(N.Provider,{value:n,children:l})}function k(s){const{highlightedKey:l}=h.useContext(N);return s!==void 0&&s===l}function m({htmlFor:s,label:l,help:n,error:c,scope:o,disabled:a,clearable:p,onClear:d,inlineControl:u,children:t}){const{t:i}=w("app"),r=k(s),g=e.jsxs("div",{className:"settings-field-row-control",children:[t,p&&e.jsx("button",{type:"button",className:"settings-field-row-clear","aria-label":i("settings.clearToDefault","Reset to default"),title:i("settings.clearToDefault","Reset to default"),disabled:a,onClick:d,children:e.jsx(E,{size:13,"aria-hidden":!0})})]}),f=e.jsxs(e.Fragment,{children:[e.jsx("label",{className:"settings-field-row-label",htmlFor:s,children:l}),o&&e.jsx("span",{className:`settings-field-row-scope settings-field-row-scope--${o}`,"data-testid":"settings-field-row-scope",children:o}),n&&e.jsx(y,{settingKey:s,children:n})]});return e.jsxs("div",{className:`settings-field-row${u?" settings-field-row--inline":""}${a?" is-disabled":""}${r?" is-search-match":""}`,"data-settings-key":s,children:[e.jsxs("div",{className:"settings-field-row-head",children:[u&&g,e.jsx("div",{className:"settings-field-row-labelgroup",children:f})]}),!u&&g,c&&e.jsx("p",{className:"settings-field-row-error",role:"alert",children:c})]})}function P({descriptor:s,value:l,onChange:n,error:c,clearable:o}){const{key:a,label:p,help:d,scope:u,disabled:t}=s;return e.jsx(m,{htmlFor:a,label:p,help:d,error:c,scope:u,disabled:t,clearable:o,onClear:()=>n(null),inlineControl:!0,children:e.jsx("label",{className:"settings-toggle",children:e.jsx("input",{id:a,type:"checkbox",checked:l===!0,disabled:t,onChange:i=>n(i.target.checked)})})})}function $({descriptor:s,value:l,onChange:n,error:c,clearable:o}){const{key:a,label:p,help:d,scope:u,disabled:t,options:i}=s;return e.jsx(m,{htmlFor:a,label:p,help:d,error:c,scope:u,disabled:t,clearable:o,onClear:()=>n(null),children:e.jsx("select",{id:a,className:"select settings-select",value:l??"",disabled:t,onChange:r=>n(r.target.value),children:i.map(r=>e.jsx("option",{value:r.value,children:r.label},r.value))})})}function H({descriptor:s,value:l,onChange:n,error:c,clearable:o}){const{key:a,label:p,help:d,scope:u,disabled:t,min:i,max:r,step:g,placeholder:f}=s;return e.jsx(m,{htmlFor:a,label:p,help:d,error:c,scope:u,disabled:t,clearable:o,onClear:()=>n(null),children:e.jsx("input",{id:a,className:"input settings-number",type:"number",value:l??"",min:i,max:r,step:g,placeholder:f,disabled:t,onChange:x=>{const j=x.target.value;if(j==="")return n(null);const v=Number(j);Number.isNaN(v)||n(v)}})})}function I({descriptor:s,value:l,onChange:n,error:c,clearable:o}){const{key:a,label:p,help:d,scope:u,disabled:t,placeholder:i,type:r,autoComplete:g}=s,f=g??(r==="password"?"off":void 0);return e.jsx(m,{htmlFor:a,label:p,help:d,error:c,scope:u,disabled:t,clearable:o,onClear:()=>n(null),children:e.jsx("input",{id:a,className:"input settings-text",type:r??"text",autoComplete:f,value:l??"",placeholder:i,disabled:t,onChange:x=>n(x.target.value)})})}function D({descriptor:s,value:l,onChange:n,error:c,clearable:o}){const{key:a,label:p,help:d,scope:u,disabled:t,placeholder:i}=s;return e.jsx(m,{htmlFor:a,label:p,help:d,error:c,scope:u,disabled:t,clearable:o,onClear:()=>n(null),children:e.jsx("textarea",{id:a,className:"input settings-textarea",value:l??"",placeholder:i,disabled:t,rows:3,onChange:r=>n(r.target.value)})})}export{m as S,I as a,D as b,$ as c,H as d,P as e,y as f,L as g};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ExperimentalAgentOnboardingModal-
|
|
2
|
-
import{ab as de,B as x,ac as R,ad as G,ae as pe,af as ue,ag as me,ah as L,ai as ge,aj as he,ak as xe,al as fe,F as je,X as we,L as M,g as ye,am as W,S as Ne,an as O,ao as be,a3 as ke}from"./index-BlGpMJSZ.js";import{r as o,j as e}from"./vendor-react-SZ_qB27O.js";import{D as Ce}from"./DirectoryPicker-CLdqqqYN.js";import{s as D}from"./projectDetection-G3XuxD2X.js";import{u as ze}from"./vendor-i18n-Duky4gdQ.js";import"./vendor-codemirror-CcrtqoCy.js";import"./vendor-reactflow-BlIeoTu4.js";import"./vendor-xterm-BNq00GSj.js";import"./folder-open-DAh8mpTX.js";function H(c){return c.filter(p=>p.type!=="local")}function ve(c){return H(c).length>0}function S(c){const p=c.replace(/[^a-zA-Z]/g,"").toUpperCase();return p.length>=2&&p.length<=4?p:p.length>4?p.slice(0,4):"FN"}const Pe=o.lazy(()=>ke(()=>import("./ExperimentalAgentOnboardingModal-1GNeCIQT.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])).then(c=>({default:c.ExperimentalAgentOnboardingModal})));function Ue({onProjectRegistered:c,onClose:p,agentOnboardingEnabled:F=!1,includeAgentStep:f=!0}){const{t:s}=ze("app"),{confirmWithChoice:b}=de(),_="https://discord.gg/ksrfuy7WYR",k=o.useMemo(()=>R("ceo")??x[0],[]),[B,Y]=o.useState(!0),[t,n]=o.useState(()=>({step:"manual",manualMode:"existing",manualPath:"",manualCloneUrl:"",manualName:"",manualIsolationMode:"in-process",manualNodeId:"",manualTaskPrefix:"",detectedRepos:[],workspaceMode:!1,isDetectingWorkspace:!1,registeredProject:null,selectedPresetId:k.id,agentDraft:G(k),isCreatingAgent:!1,isRegistering:!1,error:null,agentError:null,agentOutcome:null})),[E,$]=o.useState(!1),[T,C]=o.useState(!1),U=o.useRef(null),{nodes:z,loading:q}=pe(),K=z.find(a=>a.type==="local")?.id,v=o.useCallback(()=>{Y(!1),p?.()},[p]),V=o.useCallback(()=>{if(t.registeredProject){c(t.registeredProject);return}v()},[v,c,t.registeredProject]);o.useEffect(()=>{t.agentError&&U.current?.focus()},[t.agentError]);const j=o.useRef(0),w=o.useRef(!1),Z=o.useCallback(a=>{if(n(i=>{const r={manualPath:a,detectedRepos:[],workspaceMode:!1,error:null};a&&(!i.manualName||i.manualName===D(i.manualPath))&&(r.manualName=D(a));const d=r.manualName??i.manualName;return d&&(!i.manualTaskPrefix||i.manualTaskPrefix===S(D(i.manualPath)))&&(r.manualTaskPrefix=S(d)),{...i,...r}}),t.manualMode==="existing"&&a.trim()&&a.trim()!=="/"){const i=++j.current;n(r=>({...r,isDetectingWorkspace:!0})),ue(a.trim()).then(r=>{i===j.current&&n(d=>({...d,isDetectingWorkspace:!1,detectedRepos:r.repos,workspaceMode:r.isWorkspace}))}).catch(()=>{i===j.current&&n(r=>({...r,isDetectingWorkspace:!1}))})}},[t.manualMode]),P=o.useCallback(a=>{n(i=>({...i,manualMode:a,manualCloneUrl:a==="clone"?i.manualCloneUrl:"",detectedRepos:a==="existing"?i.detectedRepos:[],workspaceMode:a==="existing"?i.workspaceMode:!1,isDetectingWorkspace:!1,error:null})),j.current+=1},[]),X=o.useCallback(async()=>{const a=t.manualPath.trim(),i=t.manualName.trim(),r=t.manualCloneUrl.trim();if(!a||!i||t.manualMode==="clone"&&!r||w.current||t.isRegistering)return;w.current=!0,n(l=>({...l,isRegistering:!0,error:null}));const d=()=>{w.current=!1,n(l=>({...l,isRegistering:!1}))};let m=!1;try{const{gitCli:l}=await me();if(l&&!l.available){if(t.manualMode==="clone"){await b({title:s("setup.gitMissingTitle","Git is not installed"),message:s("setup.gitMissingCloneMessage","Cloning a repository requires Git on the Fusion host, and Git was not found. Install Git, then try again — Fusion picks it up without a restart."),confirmLabel:s("setup.gitMissingOpenDownloads","Open Git downloads"),cancelLabel:s("setup.cancel","Cancel"),alwaysAsk:!0})==="primary"&&L(l.installUrl??"https://git-scm.com/downloads"),d();return}const g=await b({title:s("setup.gitMissingTitle","Git is not installed"),message:s("setup.gitMissingMessage","Git was not found on the Fusion host. Fusion projects normally live in a git repository so agents can branch, commit, and merge work. You can install Git first (Fusion picks it up without a restart), or create the project anyway without a git repository."),confirmLabel:s("setup.gitMissingCreateAnyway","Create anyway without Git"),tertiaryLabel:s("setup.gitMissingOpenDownloads","Open Git downloads"),cancelLabel:s("setup.cancel","Cancel"),alwaysAsk:!0});if(g==="tertiary"){L(l.installUrl??"https://git-scm.com/downloads"),d();return}if(g!=="primary"){d();return}m=!0}}catch{}try{const l={name:i,path:a,isolationMode:t.manualIsolationMode,nodeId:t.manualNodeId||void 0,gitSetupMode:t.manualMode,cloneUrl:t.manualMode==="clone"?r:void 0,workspaceMode:t.manualMode==="existing"?t.workspaceMode:!1,taskPrefix:t.manualTaskPrefix.trim()||void 0,skipGitInit:m||void 0},g=await ge(l);if(!f){n(N=>({...N,isRegistering:!1})),c(g);return}n(N=>({...N,step:"agent",registeredProject:g,isRegistering:!1}))}catch(l){n(g=>({...g,isRegistering:!1,error:l instanceof Error?l.message:"Failed to register project"}))}finally{w.current=!1}},[f,c,t.manualPath,t.manualName,t.manualCloneUrl,t.manualMode,t.manualIsolationMode,t.manualNodeId,t.workspaceMode,t.manualTaskPrefix,b,s]),I=o.useCallback(a=>{const i=R(a);i&&n(r=>({...r,selectedPresetId:i.id,agentDraft:G(i),agentError:null}))},[]),J=o.useCallback((a,i)=>{const r=x.findIndex(g=>g.id===i);if(r<0)return;const d=x.length-1;let m=null;if(a.key==="ArrowDown"||a.key==="ArrowRight"?m=r===d?0:r+1:a.key==="ArrowUp"||a.key==="ArrowLeft"?m=r===0?d:r-1:a.key==="Home"?m=0:a.key==="End"&&(m=d),m===null)return;a.preventDefault();const l=x[m];I(l.id),requestAnimationFrame(()=>{document.querySelector(`[data-agent-preset-id="${l.id}"]`)?.focus()})},[I]),Q=o.useCallback(a=>{n(i=>({...i,selectedPresetId:"",agentDraft:he(a),agentError:null}))},[]),ee=o.useCallback(async()=>{if(!(!t.registeredProject||!t.agentDraft.name.trim())){n(a=>({...a,isCreatingAgent:!0,agentError:null}));try{await xe(fe(t.agentDraft),t.registeredProject.id),n(a=>({...a,step:"complete",isCreatingAgent:!1,agentOutcome:"created"}))}catch(a){if(a instanceof Error&&/already exists/i.test(a.message)){n(i=>({...i,step:"complete",isCreatingAgent:!1,agentOutcome:"created"}));return}n(i=>({...i,isCreatingAgent:!1,agentError:a instanceof Error?a.message:s("setup.firstAgentCreateError","Failed to create agent")}))}}},[t.agentDraft,t.registeredProject,s]),te=o.useCallback(()=>{n(a=>({...a,step:"complete",agentError:null,agentOutcome:"skipped"}))},[]);if(!B)return null;const A=t.manualMode==="existing",h=t.manualMode==="init",u=t.manualMode==="clone",se=u?s("setup.cloneAndRegisterProject","Clone and Register Project"):h?s("setup.initializeAndRegisterProject","Initialize and Register Project"):s("setup.registerProject","Register Project"),ae=t.manualPath.trim().length>0,ie=t.manualName.trim().length>0,ne=t.manualCloneUrl.trim().length>0,re=t.isRegistering||!ae||!ie||u&&!ne,oe=t.selectedPresetId?R(t.selectedPresetId):void 0,y=t.isCreatingAgent,le=t.selectedPresetId||k.id,ce=`modal setup-wizard-modal${t.step==="agent"?" setup-wizard-modal--agent":""}`;return e.jsxs(je,{windowKey:"setup-wizard",modal:!0,title:s("setup.welcomeToFusion","Welcome to Fusion"),ariaLabelledBy:"wizard-title",onClose:()=>{},hideHeader:!0,dragHandleSelector:".setup-wizard-modal .setup-wizard-header",className:"floating-window--setup-wizard",defaultSize:{width:760,height:680},minSize:{width:480,height:360},persistGeometryKey:"floating-window:setup-wizard",suspendGeometryPersistenceOnMobile:!0,suspendGeometryPersistenceOnShortViewport:!0,children:[e.jsxs("div",{className:ce,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":s("setup.brandName","Fusion"),children:[e.jsxs("svg",{className:"setup-wizard-brand-logo",width:28,height:28,viewBox:"0 0 128 128",fill:"none","aria-label":s("setup.brandLogo","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:s("setup.brandName","Fusion")})]}),!f&&t.step==="manual"&&e.jsx("span",{className:"setup-wizard-step-context",children:s("setup.projectStepContext","Step 3 of 5 — Project · Fusion setup")}),e.jsxs("h2",{id:"wizard-title",className:"setup-wizard-title",children:[t.step==="manual"&&(f?s("setup.welcomeToFusion","Welcome to Fusion"):s("setup.titleSetUpProject","Set Up Your Project")),t.step==="agent"&&s("setup.firstAgentTitle","Create your first agent"),t.step==="complete"&&s("setup.setupCompleteTitle","Setup Complete!")]})]}),t.step!=="complete"&&t.step!=="agent"&&e.jsx("button",{className:"modal-close",onClick:v,"aria-label":s("setup.closeWizard","Close wizard"),children:e.jsx(we,{size:20})})]}),e.jsxs("div",{className:"setup-wizard-content",children:[t.step==="manual"&&e.jsxs("div",{className:"setup-wizard-manual",children:[e.jsxs("section",{className:"setup-wizard-repository-section","aria-labelledby":"setup-repository-mode-title",children:[e.jsxs("div",{className:"setup-wizard-section-heading",children:[e.jsx("h3",{id:"setup-repository-mode-title",children:s("setup.repositorySetupTitle","Repository setup")}),e.jsx("p",{children:s("setup.repositorySetupDescription","Choose how Fusion should prepare the project directory before registration.")})]}),e.jsxs("fieldset",{className:"setup-wizard-mode-switch","aria-label":s("setup.projectSetupModeAriaLabel","Project setup mode"),children:[e.jsx("legend",{children:s("setup.setupMode","Setup Mode")}),e.jsxs("label",{className:`setup-wizard-mode-option${A?" selected":""}`,children:[e.jsx("input",{type:"radio",name:"setup-mode",value:"existing","aria-label":s("setup.useExistingDirectory","Use Existing Directory"),checked:A,onChange:()=>P("existing")}),e.jsxs("span",{className:"setup-wizard-mode-option-copy",children:[e.jsx("strong",{children:s("setup.useExistingDirectory","Use Existing Directory")}),e.jsx("span",{children:s("setup.useExistingDirectoryHint","Register a folder that is already a git repository or workspace root.")})]})]}),e.jsxs("label",{className:`setup-wizard-mode-option${h?" selected":""}`,children:[e.jsx("input",{type:"radio",name:"setup-mode",value:"init","aria-label":s("setup.initializeNewRepository","Initialize New Repository"),checked:h,onChange:()=>P("init")}),e.jsxs("span",{className:"setup-wizard-mode-option-copy",children:[e.jsx("strong",{children:s("setup.initializeNewRepository","Initialize New Repository")}),e.jsx("span",{children:s("setup.initializeNewRepositoryHint","Register a selected non-git folder and let Fusion run git init on the server.")})]})]}),e.jsxs("label",{className:`setup-wizard-mode-option${u?" selected":""}`,children:[e.jsx("input",{type:"radio",name:"setup-mode",value:"clone","aria-label":s("setup.cloneGitRepository","Clone Git Repository"),checked:u,onChange:()=>P("clone")}),e.jsxs("span",{className:"setup-wizard-mode-option-copy",children:[e.jsx("strong",{children:s("setup.cloneGitRepository","Clone Git Repository")}),e.jsx("span",{children:s("setup.cloneGitRepositoryHint","Clone a remote repository into an empty or absent destination folder.")})]})]})]})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"project-path",children:u?s("setup.destinationDirectory","Destination Directory"):h?s("setup.newRepositoryDirectory","New Repository Directory"):s("setup.projectDirectory","Project Directory")}),e.jsx(Ce,{value:t.manualPath,onChange:Z,nodeId:t.manualNodeId||void 0,localNodeId:K,selectCreatedDirectory:!0,placeholder:u?s("setup.clonePathPlaceholder","/path/for/new-clone"):h?s("setup.initPathPlaceholder","/path/to/new-project"):s("setup.projectPathPlaceholder","/path/to/your/project")}),e.jsx("p",{className:"form-hint",children:u?s("setup.clonePathHint","Select or type an absolute destination path. Fusion will clone into this directory. The destination must be empty or absent."):h?s("setup.initPathHint","Select or type an absolute path to an empty or non-git folder. Fusion will run git init during registration."):s("setup.projectPathHint","Select or type the absolute path to an existing git repository or workspace root.")})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"project-name",children:s("setup.projectName","Project Name")}),e.jsx("input",{id:"project-name",type:"text",value:t.manualName,onChange:a=>n(i=>({...i,manualName:a.target.value})),placeholder:s("setup.projectNamePlaceholder","my-project")}),e.jsx("p",{className:"form-hint",children:u?s("setup.projectNameHintClone","By default this follows the destination folder name unless you edit it."):h?s("setup.projectNameHintInit","By default this follows the folder name Fusion will initialize unless you edit it."):s("setup.projectNameHintExisting","By default this follows the selected directory name unless you edit it.")})]}),u&&e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"project-clone-url",children:s("setup.repositoryUrl","Repository URL")}),e.jsx("input",{id:"project-clone-url",type:"text",value:t.manualCloneUrl,onChange:a=>n(i=>({...i,manualCloneUrl:a.target.value,error:null})),placeholder:s("setup.repositoryUrlPlaceholder","https://github.com/owner/repo.git")}),e.jsx("p",{className:"form-hint",children:s("setup.cloneGitHint","Fusion will run git clone into the destination directory, then register that cloned folder.")})]}),A&&t.manualPath.trim()&&e.jsxs("div",{className:"form-group",children:[e.jsxs("label",{htmlFor:"workspace-mode",className:"checkbox-label",children:[e.jsx("input",{id:"workspace-mode",type:"checkbox",checked:t.workspaceMode,onChange:a=>n(i=>({...i,workspaceMode:a.target.checked}))}),s("setup.workspaceMode","Workspace mode (multi-repo)")]}),t.isDetectingWorkspace&&e.jsxs("p",{className:"form-hint",children:[e.jsx(M,{size:12,className:"animate-spin setup-wizard-inline-spinner"}),s("setup.detectingWorkspace","Detecting sub-repositories...")]}),!t.isDetectingWorkspace&&t.detectedRepos.length>0&&e.jsxs("p",{className:"form-hint",children:[s("setup.detectedRepos","Found {{count}} repositories:",{count:t.detectedRepos.length})," ",t.detectedRepos.join(", ")]}),!t.isDetectingWorkspace&&t.detectedRepos.length===0&&t.workspaceMode===!1&&t.manualPath.trim()&&e.jsx("p",{className:"form-hint",children:s("setup.noSubReposDetected","No sub-repositories detected. Enable if this is a multi-repo workspace.")})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"task-prefix",children:s("setup.taskPrefix","Task Prefix")}),e.jsx("input",{id:"task-prefix",type:"text",value:t.manualTaskPrefix,onChange:a=>n(i=>({...i,manualTaskPrefix:a.target.value.toUpperCase()})),placeholder:S(t.manualName||"FN"),maxLength:5}),e.jsx("p",{className:"form-hint",children:s("setup.taskPrefixHint",'Used for task IDs (e.g. "{{prefix}}-1"). Derived from project name.',{prefix:t.manualTaskPrefix||"FN"})})]}),e.jsxs("div",{className:"setup-wizard-advanced",children:[e.jsxs("button",{type:"button",className:"setup-wizard-advanced-toggle","aria-expanded":E,onClick:()=>$(a=>!a),children:[e.jsx(ye,{size:16,className:"setup-wizard-advanced-chevron"}),e.jsx("span",{children:s("setup.advancedSettings","Advanced settings")})]}),E&&e.jsxs("div",{className:"setup-wizard-advanced-panel",children:[ve(z)&&e.jsxs("div",{className:"form-group",children:[e.jsxs("div",{className:"project-node-selector",children:[e.jsx("span",{className:"project-node-selector__label",children:s("setup.runtimeNode","Runtime Node")}),e.jsxs("select",{value:t.manualNodeId,onChange:a=>n(i=>({...i,manualNodeId:a.target.value})),disabled:q||t.isRegistering,children:[e.jsx("option",{value:"",children:s("setup.localNode","Local node")}),H(z).map(a=>e.jsxs("option",{value:a.id,children:[a.name," (",a.type,")"]},a.id))]})]}),e.jsx("p",{className:"form-hint",children:s("setup.runtimeNodeHint",`A runtime node is the machine where this project's tasks run. "Local node" is this computer; pick a remote node to run tasks elsewhere.`)})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:s("setup.isolationMode","Isolation Mode")}),e.jsxs("div",{className:"setup-wizard-isolation-options",children:[e.jsxs("label",{className:`setup-wizard-isolation-option${t.manualIsolationMode==="in-process"?" selected":""}`,children:[e.jsx("input",{type:"radio",name:"isolation-mode",value:"in-process",checked:t.manualIsolationMode==="in-process",onChange:()=>n(a=>({...a,manualIsolationMode:"in-process"}))}),e.jsxs("div",{className:"setup-wizard-isolation-option-content",children:[e.jsx("strong",{children:s("setup.inProcess","In-Process")}),e.jsx("span",{children:s("setup.inProcessDesc","Lower overhead, shared memory. Best for most projects.")}),e.jsx("span",{className:"wizard-option-recommended",children:s("setup.recommended","Recommended")})]})]}),e.jsxs("label",{className:`setup-wizard-isolation-option${t.manualIsolationMode==="child-process"?" selected":""}`,children:[e.jsx("input",{type:"radio",name:"isolation-mode",value:"child-process",checked:t.manualIsolationMode==="child-process",onChange:()=>n(a=>({...a,manualIsolationMode:"child-process"}))}),e.jsxs("div",{className:"setup-wizard-isolation-option-content",children:[e.jsx("strong",{children:s("setup.childProcess","Child-Process")}),e.jsx("span",{children:s("setup.childProcessDesc","Isolated execution with crash containment.")})]})]})]})]})]})]}),t.error&&e.jsx("div",{className:"wizard-error",role:"alert",children:t.error})]}),t.step==="agent"&&e.jsxs("div",{className:"setup-wizard-agent-step",children:[e.jsx("p",{className:"setup-wizard-agent-intro",children:s("setup.firstAgentIntro","Agents are optional. Fusion can build tasks without one by starting temporary agents for planning, coding, review, and merge. Create an agent only if you want help coordinating tasks and direction.")}),e.jsxs("div",{className:"setup-wizard-agent-layout",children:[e.jsxs("section",{className:"setup-wizard-agent-presets","aria-labelledby":"setup-first-agent-presets-heading",children:[e.jsx("div",{className:"setup-wizard-agent-section-heading",id:"setup-first-agent-presets-heading",children:s("setup.firstAgentTemplates","Templates")}),e.jsx("div",{className:"setup-wizard-agent-preset-list",role:"radiogroup","aria-label":s("setup.firstAgentTemplates","Templates"),children:x.map(a=>{const i=t.selectedPresetId===a.id;return e.jsxs("button",{type:"button",className:`setup-wizard-agent-preset${i?" selected":""}`,role:"radio","aria-checked":i,"aria-label":i?s("setup.selectedAgentTemplate","{{name}} selected",{name:a.name}):a.name,tabIndex:a.id===le?0:-1,"data-agent-preset-id":a.id,disabled:y,onClick:()=>I(a.id),onKeyDown:r=>J(r,a.id),children:[e.jsx(W,{agent:{id:a.id,icon:a.icon,name:a.name},size:28}),e.jsxs("span",{className:"setup-wizard-agent-preset-copy",children:[e.jsxs("span",{className:"setup-wizard-agent-preset-name",children:[a.name,a.id==="ceo"&&e.jsx("span",{className:"wizard-option-recommended",children:s("setup.recommended","Recommended")})]}),e.jsx("span",{className:"setup-wizard-agent-preset-description",children:a.description})]})]},a.id)})})]}),e.jsxs("section",{className:"setup-wizard-agent-preview","aria-labelledby":"setup-first-agent-preview-heading",children:[e.jsx("div",{className:"setup-wizard-agent-section-heading",id:"setup-first-agent-preview-heading",children:s("setup.firstAgentPreview","Preview")}),e.jsxs("div",{className:"setup-wizard-agent-preview-card",children:[e.jsxs("div",{className:"setup-wizard-agent-preview-title-row",children:[e.jsx(W,{agent:{id:t.selectedPresetId||"draft",icon:t.agentDraft.icon,name:t.agentDraft.name},size:36}),e.jsxs("div",{children:[e.jsx("h3",{children:t.agentDraft.name||s("setup.firstAgentDraftName","Draft agent")}),e.jsx("p",{children:t.agentDraft.title||oe?.title||s("setup.firstAgentCustomDraft","Custom agent draft")})]})]}),e.jsxs("dl",{className:"setup-wizard-agent-preview-list",children:[e.jsxs("div",{children:[e.jsx("dt",{children:s("agents.fieldRole","Role")}),e.jsx("dd",{children:t.agentDraft.role})]}),e.jsxs("div",{children:[e.jsx("dt",{children:s("agents.fieldInstructionsText","Inline Instructions")}),e.jsx("dd",{children:t.agentDraft.instructionsText||s("setup.firstAgentNoInstructions","No inline instructions yet")})]})]}),F&&e.jsxs("button",{type:"button",className:"btn setup-wizard-agent-ai-btn",onClick:()=>C(!0),disabled:y,children:[e.jsx(Ne,{size:16}),e.jsx("span",{children:s("agents.aiInterview","AI Interview")})]})]})]})]}),t.agentError&&e.jsx("div",{className:"wizard-error",role:"alert",tabIndex:-1,ref:U,children:t.agentError})]}),t.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(O,{size:64,className:"success-icon"}),e.jsx("h3",{children:s("setup.allSet","All Set!")}),e.jsx("p",{children:t.agentOutcome==="created"?s("setup.firstAgentCreatedSuccess","Your project is registered and your first agent is ready."):s("setup.projectRegisteredSuccess","Your project has been registered successfully.")}),e.jsx("p",{children:t.agentOutcome==="skipped"?s("setup.firstAgentSkippedHint","You can create agents later from the Agents view."):s("setup.addMoreProjectsHint","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:_,target:"_blank",rel:"noopener noreferrer",children:s("setup.needHelp","Need help?")}),t.step==="manual"&&e.jsx("button",{className:"btn btn-primary",onClick:X,disabled:re,children:t.isRegistering?e.jsxs(e.Fragment,{children:[e.jsx(M,{size:16,className:"animate-spin"}),e.jsx("span",{children:s("setup.registering","Registering...")})]}):e.jsx("span",{children:se})}),t.step==="agent"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{className:"btn",onClick:te,disabled:y,children:s("setup.skipFirstAgent","Skip for now")}),e.jsx("button",{className:"btn btn-primary",onClick:()=>void ee(),disabled:y||!t.agentDraft.name.trim(),"aria-busy":t.isCreatingAgent,children:t.isCreatingAgent?e.jsxs(e.Fragment,{children:[e.jsx(M,{size:16,className:"animate-spin"}),e.jsx("span",{children:s("setup.creatingFirstAgent","Creating agent...")})]}):e.jsx("span",{children:s("setup.createFirstAgent","Create Agent")})})]}),t.step==="complete"&&e.jsxs("button",{className:"btn btn-primary",onClick:V,children:[e.jsx(O,{size:16}),e.jsx("span",{children:s("setup.getStarted","Get Started")})]})]})]}),F&&T&&e.jsx(be,{level:"modal",fallback:e.jsxs("div",{className:"wizard-error setup-wizard-agent-interview-error",role:"alert",children:[e.jsx("span",{children:s("setup.firstAgentInterviewLoadError","AI interview could not load. You can still create an agent from a template or skip this step.")}),e.jsx("button",{type:"button",className:"btn",onClick:()=>C(!1),children:s("setup.firstAgentContinueWithTemplates","Continue with templates")})]}),children:e.jsx(o.Suspense,{fallback:e.jsx("div",{className:"wizard-error setup-wizard-agent-interview-error",role:"status",children:s("setup.firstAgentInterviewLoading","Loading AI Interview...")}),children:e.jsx(Pe,{isOpen:T,onClose:()=>C(!1),onUseDraft:Q,projectId:t.registeredProject?.id,existingAgents:[],mode:"create"})})})]})}export{Ue as SetupWizardModal};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ExperimentalAgentOnboardingModal-CMgO_S8T.js","assets/vendor-react-SZ_qB27O.js","assets/index-DWRJyaa3.js","assets/vendor-i18n-Duky4gdQ.js","assets/vendor-codemirror-CcrtqoCy.js","assets/vendor-reactflow-BlIeoTu4.js","assets/vendor-reactflow-BnuhLJ6X.css","assets/vendor-xterm-BNq00GSj.js","assets/vendor-xterm-LZoznX6r.css","assets/index-BzAldNrK.css","assets/ExperimentalAgentOnboardingModal-3ZEFv8sr.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{ab as de,B as x,ac as R,ad as G,ae as pe,af as ue,ag as me,ah as L,ai as ge,aj as he,ak as xe,al as fe,F as je,X as we,L as M,g as ye,am as W,S as Ne,an as O,ao as be,a3 as ke}from"./index-DWRJyaa3.js";import{r as o,j as e}from"./vendor-react-SZ_qB27O.js";import{D as Ce}from"./DirectoryPicker-CtjqrYoO.js";import{s as D}from"./projectDetection-G3XuxD2X.js";import{u as ze}from"./vendor-i18n-Duky4gdQ.js";import"./vendor-codemirror-CcrtqoCy.js";import"./vendor-reactflow-BlIeoTu4.js";import"./vendor-xterm-BNq00GSj.js";import"./folder-open-CqvaMJvx.js";function H(c){return c.filter(p=>p.type!=="local")}function ve(c){return H(c).length>0}function S(c){const p=c.replace(/[^a-zA-Z]/g,"").toUpperCase();return p.length>=2&&p.length<=4?p:p.length>4?p.slice(0,4):"FN"}const Pe=o.lazy(()=>ke(()=>import("./ExperimentalAgentOnboardingModal-CMgO_S8T.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])).then(c=>({default:c.ExperimentalAgentOnboardingModal})));function Ue({onProjectRegistered:c,onClose:p,agentOnboardingEnabled:F=!1,includeAgentStep:f=!0}){const{t:s}=ze("app"),{confirmWithChoice:b}=de(),_="https://discord.gg/ksrfuy7WYR",k=o.useMemo(()=>R("ceo")??x[0],[]),[B,Y]=o.useState(!0),[t,n]=o.useState(()=>({step:"manual",manualMode:"existing",manualPath:"",manualCloneUrl:"",manualName:"",manualIsolationMode:"in-process",manualNodeId:"",manualTaskPrefix:"",detectedRepos:[],workspaceMode:!1,isDetectingWorkspace:!1,registeredProject:null,selectedPresetId:k.id,agentDraft:G(k),isCreatingAgent:!1,isRegistering:!1,error:null,agentError:null,agentOutcome:null})),[E,$]=o.useState(!1),[T,C]=o.useState(!1),U=o.useRef(null),{nodes:z,loading:q}=pe(),K=z.find(a=>a.type==="local")?.id,v=o.useCallback(()=>{Y(!1),p?.()},[p]),V=o.useCallback(()=>{if(t.registeredProject){c(t.registeredProject);return}v()},[v,c,t.registeredProject]);o.useEffect(()=>{t.agentError&&U.current?.focus()},[t.agentError]);const j=o.useRef(0),w=o.useRef(!1),Z=o.useCallback(a=>{if(n(i=>{const r={manualPath:a,detectedRepos:[],workspaceMode:!1,error:null};a&&(!i.manualName||i.manualName===D(i.manualPath))&&(r.manualName=D(a));const d=r.manualName??i.manualName;return d&&(!i.manualTaskPrefix||i.manualTaskPrefix===S(D(i.manualPath)))&&(r.manualTaskPrefix=S(d)),{...i,...r}}),t.manualMode==="existing"&&a.trim()&&a.trim()!=="/"){const i=++j.current;n(r=>({...r,isDetectingWorkspace:!0})),ue(a.trim()).then(r=>{i===j.current&&n(d=>({...d,isDetectingWorkspace:!1,detectedRepos:r.repos,workspaceMode:r.isWorkspace}))}).catch(()=>{i===j.current&&n(r=>({...r,isDetectingWorkspace:!1}))})}},[t.manualMode]),P=o.useCallback(a=>{n(i=>({...i,manualMode:a,manualCloneUrl:a==="clone"?i.manualCloneUrl:"",detectedRepos:a==="existing"?i.detectedRepos:[],workspaceMode:a==="existing"?i.workspaceMode:!1,isDetectingWorkspace:!1,error:null})),j.current+=1},[]),X=o.useCallback(async()=>{const a=t.manualPath.trim(),i=t.manualName.trim(),r=t.manualCloneUrl.trim();if(!a||!i||t.manualMode==="clone"&&!r||w.current||t.isRegistering)return;w.current=!0,n(l=>({...l,isRegistering:!0,error:null}));const d=()=>{w.current=!1,n(l=>({...l,isRegistering:!1}))};let m=!1;try{const{gitCli:l}=await me();if(l&&!l.available){if(t.manualMode==="clone"){await b({title:s("setup.gitMissingTitle","Git is not installed"),message:s("setup.gitMissingCloneMessage","Cloning a repository requires Git on the Fusion host, and Git was not found. Install Git, then try again — Fusion picks it up without a restart."),confirmLabel:s("setup.gitMissingOpenDownloads","Open Git downloads"),cancelLabel:s("setup.cancel","Cancel"),alwaysAsk:!0})==="primary"&&L(l.installUrl??"https://git-scm.com/downloads"),d();return}const g=await b({title:s("setup.gitMissingTitle","Git is not installed"),message:s("setup.gitMissingMessage","Git was not found on the Fusion host. Fusion projects normally live in a git repository so agents can branch, commit, and merge work. You can install Git first (Fusion picks it up without a restart), or create the project anyway without a git repository."),confirmLabel:s("setup.gitMissingCreateAnyway","Create anyway without Git"),tertiaryLabel:s("setup.gitMissingOpenDownloads","Open Git downloads"),cancelLabel:s("setup.cancel","Cancel"),alwaysAsk:!0});if(g==="tertiary"){L(l.installUrl??"https://git-scm.com/downloads"),d();return}if(g!=="primary"){d();return}m=!0}}catch{}try{const l={name:i,path:a,isolationMode:t.manualIsolationMode,nodeId:t.manualNodeId||void 0,gitSetupMode:t.manualMode,cloneUrl:t.manualMode==="clone"?r:void 0,workspaceMode:t.manualMode==="existing"?t.workspaceMode:!1,taskPrefix:t.manualTaskPrefix.trim()||void 0,skipGitInit:m||void 0},g=await ge(l);if(!f){n(N=>({...N,isRegistering:!1})),c(g);return}n(N=>({...N,step:"agent",registeredProject:g,isRegistering:!1}))}catch(l){n(g=>({...g,isRegistering:!1,error:l instanceof Error?l.message:"Failed to register project"}))}finally{w.current=!1}},[f,c,t.manualPath,t.manualName,t.manualCloneUrl,t.manualMode,t.manualIsolationMode,t.manualNodeId,t.workspaceMode,t.manualTaskPrefix,b,s]),I=o.useCallback(a=>{const i=R(a);i&&n(r=>({...r,selectedPresetId:i.id,agentDraft:G(i),agentError:null}))},[]),J=o.useCallback((a,i)=>{const r=x.findIndex(g=>g.id===i);if(r<0)return;const d=x.length-1;let m=null;if(a.key==="ArrowDown"||a.key==="ArrowRight"?m=r===d?0:r+1:a.key==="ArrowUp"||a.key==="ArrowLeft"?m=r===0?d:r-1:a.key==="Home"?m=0:a.key==="End"&&(m=d),m===null)return;a.preventDefault();const l=x[m];I(l.id),requestAnimationFrame(()=>{document.querySelector(`[data-agent-preset-id="${l.id}"]`)?.focus()})},[I]),Q=o.useCallback(a=>{n(i=>({...i,selectedPresetId:"",agentDraft:he(a),agentError:null}))},[]),ee=o.useCallback(async()=>{if(!(!t.registeredProject||!t.agentDraft.name.trim())){n(a=>({...a,isCreatingAgent:!0,agentError:null}));try{await xe(fe(t.agentDraft),t.registeredProject.id),n(a=>({...a,step:"complete",isCreatingAgent:!1,agentOutcome:"created"}))}catch(a){if(a instanceof Error&&/already exists/i.test(a.message)){n(i=>({...i,step:"complete",isCreatingAgent:!1,agentOutcome:"created"}));return}n(i=>({...i,isCreatingAgent:!1,agentError:a instanceof Error?a.message:s("setup.firstAgentCreateError","Failed to create agent")}))}}},[t.agentDraft,t.registeredProject,s]),te=o.useCallback(()=>{n(a=>({...a,step:"complete",agentError:null,agentOutcome:"skipped"}))},[]);if(!B)return null;const A=t.manualMode==="existing",h=t.manualMode==="init",u=t.manualMode==="clone",se=u?s("setup.cloneAndRegisterProject","Clone and Register Project"):h?s("setup.initializeAndRegisterProject","Initialize and Register Project"):s("setup.registerProject","Register Project"),ae=t.manualPath.trim().length>0,ie=t.manualName.trim().length>0,ne=t.manualCloneUrl.trim().length>0,re=t.isRegistering||!ae||!ie||u&&!ne,oe=t.selectedPresetId?R(t.selectedPresetId):void 0,y=t.isCreatingAgent,le=t.selectedPresetId||k.id,ce=`modal setup-wizard-modal${t.step==="agent"?" setup-wizard-modal--agent":""}`;return e.jsxs(je,{windowKey:"setup-wizard",modal:!0,title:s("setup.welcomeToFusion","Welcome to Fusion"),ariaLabelledBy:"wizard-title",onClose:()=>{},hideHeader:!0,dragHandleSelector:".setup-wizard-modal .setup-wizard-header",className:"floating-window--setup-wizard",defaultSize:{width:760,height:680},minSize:{width:480,height:360},persistGeometryKey:"floating-window:setup-wizard",suspendGeometryPersistenceOnMobile:!0,suspendGeometryPersistenceOnShortViewport:!0,children:[e.jsxs("div",{className:ce,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":s("setup.brandName","Fusion"),children:[e.jsxs("svg",{className:"setup-wizard-brand-logo",width:28,height:28,viewBox:"0 0 128 128",fill:"none","aria-label":s("setup.brandLogo","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:s("setup.brandName","Fusion")})]}),!f&&t.step==="manual"&&e.jsx("span",{className:"setup-wizard-step-context",children:s("setup.projectStepContext","Step 3 of 5 — Project · Fusion setup")}),e.jsxs("h2",{id:"wizard-title",className:"setup-wizard-title",children:[t.step==="manual"&&(f?s("setup.welcomeToFusion","Welcome to Fusion"):s("setup.titleSetUpProject","Set Up Your Project")),t.step==="agent"&&s("setup.firstAgentTitle","Create your first agent"),t.step==="complete"&&s("setup.setupCompleteTitle","Setup Complete!")]})]}),t.step!=="complete"&&t.step!=="agent"&&e.jsx("button",{className:"modal-close",onClick:v,"aria-label":s("setup.closeWizard","Close wizard"),children:e.jsx(we,{size:20})})]}),e.jsxs("div",{className:"setup-wizard-content",children:[t.step==="manual"&&e.jsxs("div",{className:"setup-wizard-manual",children:[e.jsxs("section",{className:"setup-wizard-repository-section","aria-labelledby":"setup-repository-mode-title",children:[e.jsxs("div",{className:"setup-wizard-section-heading",children:[e.jsx("h3",{id:"setup-repository-mode-title",children:s("setup.repositorySetupTitle","Repository setup")}),e.jsx("p",{children:s("setup.repositorySetupDescription","Choose how Fusion should prepare the project directory before registration.")})]}),e.jsxs("fieldset",{className:"setup-wizard-mode-switch","aria-label":s("setup.projectSetupModeAriaLabel","Project setup mode"),children:[e.jsx("legend",{children:s("setup.setupMode","Setup Mode")}),e.jsxs("label",{className:`setup-wizard-mode-option${A?" selected":""}`,children:[e.jsx("input",{type:"radio",name:"setup-mode",value:"existing","aria-label":s("setup.useExistingDirectory","Use Existing Directory"),checked:A,onChange:()=>P("existing")}),e.jsxs("span",{className:"setup-wizard-mode-option-copy",children:[e.jsx("strong",{children:s("setup.useExistingDirectory","Use Existing Directory")}),e.jsx("span",{children:s("setup.useExistingDirectoryHint","Register a folder that is already a git repository or workspace root.")})]})]}),e.jsxs("label",{className:`setup-wizard-mode-option${h?" selected":""}`,children:[e.jsx("input",{type:"radio",name:"setup-mode",value:"init","aria-label":s("setup.initializeNewRepository","Initialize New Repository"),checked:h,onChange:()=>P("init")}),e.jsxs("span",{className:"setup-wizard-mode-option-copy",children:[e.jsx("strong",{children:s("setup.initializeNewRepository","Initialize New Repository")}),e.jsx("span",{children:s("setup.initializeNewRepositoryHint","Register a selected non-git folder and let Fusion run git init on the server.")})]})]}),e.jsxs("label",{className:`setup-wizard-mode-option${u?" selected":""}`,children:[e.jsx("input",{type:"radio",name:"setup-mode",value:"clone","aria-label":s("setup.cloneGitRepository","Clone Git Repository"),checked:u,onChange:()=>P("clone")}),e.jsxs("span",{className:"setup-wizard-mode-option-copy",children:[e.jsx("strong",{children:s("setup.cloneGitRepository","Clone Git Repository")}),e.jsx("span",{children:s("setup.cloneGitRepositoryHint","Clone a remote repository into an empty or absent destination folder.")})]})]})]})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"project-path",children:u?s("setup.destinationDirectory","Destination Directory"):h?s("setup.newRepositoryDirectory","New Repository Directory"):s("setup.projectDirectory","Project Directory")}),e.jsx(Ce,{value:t.manualPath,onChange:Z,nodeId:t.manualNodeId||void 0,localNodeId:K,selectCreatedDirectory:!0,placeholder:u?s("setup.clonePathPlaceholder","/path/for/new-clone"):h?s("setup.initPathPlaceholder","/path/to/new-project"):s("setup.projectPathPlaceholder","/path/to/your/project")}),e.jsx("p",{className:"form-hint",children:u?s("setup.clonePathHint","Select or type an absolute destination path. Fusion will clone into this directory. The destination must be empty or absent."):h?s("setup.initPathHint","Select or type an absolute path to an empty or non-git folder. Fusion will run git init during registration."):s("setup.projectPathHint","Select or type the absolute path to an existing git repository or workspace root.")})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"project-name",children:s("setup.projectName","Project Name")}),e.jsx("input",{id:"project-name",type:"text",value:t.manualName,onChange:a=>n(i=>({...i,manualName:a.target.value})),placeholder:s("setup.projectNamePlaceholder","my-project")}),e.jsx("p",{className:"form-hint",children:u?s("setup.projectNameHintClone","By default this follows the destination folder name unless you edit it."):h?s("setup.projectNameHintInit","By default this follows the folder name Fusion will initialize unless you edit it."):s("setup.projectNameHintExisting","By default this follows the selected directory name unless you edit it.")})]}),u&&e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"project-clone-url",children:s("setup.repositoryUrl","Repository URL")}),e.jsx("input",{id:"project-clone-url",type:"text",value:t.manualCloneUrl,onChange:a=>n(i=>({...i,manualCloneUrl:a.target.value,error:null})),placeholder:s("setup.repositoryUrlPlaceholder","https://github.com/owner/repo.git")}),e.jsx("p",{className:"form-hint",children:s("setup.cloneGitHint","Fusion will run git clone into the destination directory, then register that cloned folder.")})]}),A&&t.manualPath.trim()&&e.jsxs("div",{className:"form-group",children:[e.jsxs("label",{htmlFor:"workspace-mode",className:"checkbox-label",children:[e.jsx("input",{id:"workspace-mode",type:"checkbox",checked:t.workspaceMode,onChange:a=>n(i=>({...i,workspaceMode:a.target.checked}))}),s("setup.workspaceMode","Workspace mode (multi-repo)")]}),t.isDetectingWorkspace&&e.jsxs("p",{className:"form-hint",children:[e.jsx(M,{size:12,className:"animate-spin setup-wizard-inline-spinner"}),s("setup.detectingWorkspace","Detecting sub-repositories...")]}),!t.isDetectingWorkspace&&t.detectedRepos.length>0&&e.jsxs("p",{className:"form-hint",children:[s("setup.detectedRepos","Found {{count}} repositories:",{count:t.detectedRepos.length})," ",t.detectedRepos.join(", ")]}),!t.isDetectingWorkspace&&t.detectedRepos.length===0&&t.workspaceMode===!1&&t.manualPath.trim()&&e.jsx("p",{className:"form-hint",children:s("setup.noSubReposDetected","No sub-repositories detected. Enable if this is a multi-repo workspace.")})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"task-prefix",children:s("setup.taskPrefix","Task Prefix")}),e.jsx("input",{id:"task-prefix",type:"text",value:t.manualTaskPrefix,onChange:a=>n(i=>({...i,manualTaskPrefix:a.target.value.toUpperCase()})),placeholder:S(t.manualName||"FN"),maxLength:5}),e.jsx("p",{className:"form-hint",children:s("setup.taskPrefixHint",'Used for task IDs (e.g. "{{prefix}}-1"). Derived from project name.',{prefix:t.manualTaskPrefix||"FN"})})]}),e.jsxs("div",{className:"setup-wizard-advanced",children:[e.jsxs("button",{type:"button",className:"setup-wizard-advanced-toggle","aria-expanded":E,onClick:()=>$(a=>!a),children:[e.jsx(ye,{size:16,className:"setup-wizard-advanced-chevron"}),e.jsx("span",{children:s("setup.advancedSettings","Advanced settings")})]}),E&&e.jsxs("div",{className:"setup-wizard-advanced-panel",children:[ve(z)&&e.jsxs("div",{className:"form-group",children:[e.jsxs("div",{className:"project-node-selector",children:[e.jsx("span",{className:"project-node-selector__label",children:s("setup.runtimeNode","Runtime Node")}),e.jsxs("select",{value:t.manualNodeId,onChange:a=>n(i=>({...i,manualNodeId:a.target.value})),disabled:q||t.isRegistering,children:[e.jsx("option",{value:"",children:s("setup.localNode","Local node")}),H(z).map(a=>e.jsxs("option",{value:a.id,children:[a.name," (",a.type,")"]},a.id))]})]}),e.jsx("p",{className:"form-hint",children:s("setup.runtimeNodeHint",`A runtime node is the machine where this project's tasks run. "Local node" is this computer; pick a remote node to run tasks elsewhere.`)})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:s("setup.isolationMode","Isolation Mode")}),e.jsxs("div",{className:"setup-wizard-isolation-options",children:[e.jsxs("label",{className:`setup-wizard-isolation-option${t.manualIsolationMode==="in-process"?" selected":""}`,children:[e.jsx("input",{type:"radio",name:"isolation-mode",value:"in-process",checked:t.manualIsolationMode==="in-process",onChange:()=>n(a=>({...a,manualIsolationMode:"in-process"}))}),e.jsxs("div",{className:"setup-wizard-isolation-option-content",children:[e.jsx("strong",{children:s("setup.inProcess","In-Process")}),e.jsx("span",{children:s("setup.inProcessDesc","Lower overhead, shared memory. Best for most projects.")}),e.jsx("span",{className:"wizard-option-recommended",children:s("setup.recommended","Recommended")})]})]}),e.jsxs("label",{className:`setup-wizard-isolation-option${t.manualIsolationMode==="child-process"?" selected":""}`,children:[e.jsx("input",{type:"radio",name:"isolation-mode",value:"child-process",checked:t.manualIsolationMode==="child-process",onChange:()=>n(a=>({...a,manualIsolationMode:"child-process"}))}),e.jsxs("div",{className:"setup-wizard-isolation-option-content",children:[e.jsx("strong",{children:s("setup.childProcess","Child-Process")}),e.jsx("span",{children:s("setup.childProcessDesc","Isolated execution with crash containment.")})]})]})]})]})]})]}),t.error&&e.jsx("div",{className:"wizard-error",role:"alert",children:t.error})]}),t.step==="agent"&&e.jsxs("div",{className:"setup-wizard-agent-step",children:[e.jsx("p",{className:"setup-wizard-agent-intro",children:s("setup.firstAgentIntro","Agents are optional. Fusion can build tasks without one by starting temporary agents for planning, coding, review, and merge. Create an agent only if you want help coordinating tasks and direction.")}),e.jsxs("div",{className:"setup-wizard-agent-layout",children:[e.jsxs("section",{className:"setup-wizard-agent-presets","aria-labelledby":"setup-first-agent-presets-heading",children:[e.jsx("div",{className:"setup-wizard-agent-section-heading",id:"setup-first-agent-presets-heading",children:s("setup.firstAgentTemplates","Templates")}),e.jsx("div",{className:"setup-wizard-agent-preset-list",role:"radiogroup","aria-label":s("setup.firstAgentTemplates","Templates"),children:x.map(a=>{const i=t.selectedPresetId===a.id;return e.jsxs("button",{type:"button",className:`setup-wizard-agent-preset${i?" selected":""}`,role:"radio","aria-checked":i,"aria-label":i?s("setup.selectedAgentTemplate","{{name}} selected",{name:a.name}):a.name,tabIndex:a.id===le?0:-1,"data-agent-preset-id":a.id,disabled:y,onClick:()=>I(a.id),onKeyDown:r=>J(r,a.id),children:[e.jsx(W,{agent:{id:a.id,icon:a.icon,name:a.name},size:28}),e.jsxs("span",{className:"setup-wizard-agent-preset-copy",children:[e.jsxs("span",{className:"setup-wizard-agent-preset-name",children:[a.name,a.id==="ceo"&&e.jsx("span",{className:"wizard-option-recommended",children:s("setup.recommended","Recommended")})]}),e.jsx("span",{className:"setup-wizard-agent-preset-description",children:a.description})]})]},a.id)})})]}),e.jsxs("section",{className:"setup-wizard-agent-preview","aria-labelledby":"setup-first-agent-preview-heading",children:[e.jsx("div",{className:"setup-wizard-agent-section-heading",id:"setup-first-agent-preview-heading",children:s("setup.firstAgentPreview","Preview")}),e.jsxs("div",{className:"setup-wizard-agent-preview-card",children:[e.jsxs("div",{className:"setup-wizard-agent-preview-title-row",children:[e.jsx(W,{agent:{id:t.selectedPresetId||"draft",icon:t.agentDraft.icon,name:t.agentDraft.name},size:36}),e.jsxs("div",{children:[e.jsx("h3",{children:t.agentDraft.name||s("setup.firstAgentDraftName","Draft agent")}),e.jsx("p",{children:t.agentDraft.title||oe?.title||s("setup.firstAgentCustomDraft","Custom agent draft")})]})]}),e.jsxs("dl",{className:"setup-wizard-agent-preview-list",children:[e.jsxs("div",{children:[e.jsx("dt",{children:s("agents.fieldRole","Role")}),e.jsx("dd",{children:t.agentDraft.role})]}),e.jsxs("div",{children:[e.jsx("dt",{children:s("agents.fieldInstructionsText","Inline Instructions")}),e.jsx("dd",{children:t.agentDraft.instructionsText||s("setup.firstAgentNoInstructions","No inline instructions yet")})]})]}),F&&e.jsxs("button",{type:"button",className:"btn setup-wizard-agent-ai-btn",onClick:()=>C(!0),disabled:y,children:[e.jsx(Ne,{size:16}),e.jsx("span",{children:s("agents.aiInterview","AI Interview")})]})]})]})]}),t.agentError&&e.jsx("div",{className:"wizard-error",role:"alert",tabIndex:-1,ref:U,children:t.agentError})]}),t.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(O,{size:64,className:"success-icon"}),e.jsx("h3",{children:s("setup.allSet","All Set!")}),e.jsx("p",{children:t.agentOutcome==="created"?s("setup.firstAgentCreatedSuccess","Your project is registered and your first agent is ready."):s("setup.projectRegisteredSuccess","Your project has been registered successfully.")}),e.jsx("p",{children:t.agentOutcome==="skipped"?s("setup.firstAgentSkippedHint","You can create agents later from the Agents view."):s("setup.addMoreProjectsHint","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:_,target:"_blank",rel:"noopener noreferrer",children:s("setup.needHelp","Need help?")}),t.step==="manual"&&e.jsx("button",{className:"btn btn-primary",onClick:X,disabled:re,children:t.isRegistering?e.jsxs(e.Fragment,{children:[e.jsx(M,{size:16,className:"animate-spin"}),e.jsx("span",{children:s("setup.registering","Registering...")})]}):e.jsx("span",{children:se})}),t.step==="agent"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{className:"btn",onClick:te,disabled:y,children:s("setup.skipFirstAgent","Skip for now")}),e.jsx("button",{className:"btn btn-primary",onClick:()=>void ee(),disabled:y||!t.agentDraft.name.trim(),"aria-busy":t.isCreatingAgent,children:t.isCreatingAgent?e.jsxs(e.Fragment,{children:[e.jsx(M,{size:16,className:"animate-spin"}),e.jsx("span",{children:s("setup.creatingFirstAgent","Creating agent...")})]}):e.jsx("span",{children:s("setup.createFirstAgent","Create Agent")})})]}),t.step==="complete"&&e.jsxs("button",{className:"btn btn-primary",onClick:V,children:[e.jsx(O,{size:16}),e.jsx("span",{children:s("setup.getStarted","Get Started")})]})]})]}),F&&T&&e.jsx(be,{level:"modal",fallback:e.jsxs("div",{className:"wizard-error setup-wizard-agent-interview-error",role:"alert",children:[e.jsx("span",{children:s("setup.firstAgentInterviewLoadError","AI interview could not load. You can still create an agent from a template or skip this step.")}),e.jsx("button",{type:"button",className:"btn",onClick:()=>C(!1),children:s("setup.firstAgentContinueWithTemplates","Continue with templates")})]}),children:e.jsx(o.Suspense,{fallback:e.jsx("div",{className:"wizard-error setup-wizard-agent-interview-error",role:"status",children:s("setup.firstAgentInterviewLoading","Loading AI Interview...")}),children:e.jsx(Pe,{isOpen:T,onClose:()=>C(!1),onUseDraft:Q,projectId:t.registeredProject?.id,existingAgents:[],mode:"create"})})})]})}export{Ue as SetupWizardModal};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,j as s}from"./vendor-react-SZ_qB27O.js";import{f as ms,b as us,t as vs,i as hs,d as gs,e as bs,V as ws,Z as xs,X as H,R as fs,C as js,g as ps,L as A,A as q,h as G,M as J}from"./index-BlGpMJSZ.js";import{u as Ns}from"./vendor-i18n-Duky4gdQ.js";import"./vendor-codemirror-CcrtqoCy.js";import"./vendor-reactflow-BlIeoTu4.js";import"./vendor-xterm-BNq00GSj.js";const Ss=new Set([".md",".markdown",".mdx"]);function Cs(r){const d=r.toLowerCase(),j=d.lastIndexOf(".");return j<0?!1:Ss.has(d.slice(j))}function zs({projectId:r,addToast:d,onClose:j}){const{t:e}=Ns("app"),[k,p]=a.useState([]),[F,T]=a.useState(!0),[Y,V]=a.useState(!1),[I,D]=a.useState(null),[_,ss]=a.useState([]),[g,ls]=a.useState(""),[M,B]=a.useState(null),[c,N]=a.useState(null),[b,S]=a.useState(null),[es,K]=a.useState(!1),[Q,C]=a.useState(null),[y,w]=a.useState(null),[u,v]=a.useState(null),[is,z]=a.useState(!1),[$,h]=a.useState(null),m=a.useRef(null),[P,as]=a.useState(""),O=g.trim()?k.filter(l=>l.name.toLowerCase().includes(g.toLowerCase())||l.relativePath.toLowerCase().includes(g.toLowerCase())):k,x=a.useCallback(async()=>{T(!0);try{const l=await ms(r);p(l)}catch(l){const t=l instanceof Error?l.message:e("skills.loadDiscoveredError","Failed to load discovered skills");d(t,"error")}finally{T(!1)}},[r,d]),f=a.useCallback(async l=>{const t=i=>{if(!i||typeof i!="object")return!1;const n=i;if(typeof n.status=="number"&&n.status>=500)return!0;if(n.details&&typeof n.details=="object"){const L=n.details;if(typeof L.code=="string"&&L.code.startsWith("upstream_"))return!0}const o=i;return typeof o.error=="string"&&typeof o.code=="string"};V(!0),D(null);try{const i=await us(l,20,r);ss(i.entries)}catch(i){if(t(i))D(e("skills.catalogUnavailable","Catalog is temporarily unavailable. Please try again later."));else{const n=i instanceof Error?i.message:e("skills.loadCatalogError","Failed to load catalog");D(n)}}finally{V(!1)}},[r]);a.useEffect(()=>{x(),f("")},[x,f]);const ts=a.useCallback(l=>{ls(l),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{as(l),m.current=null},300)},[]);a.useEffect(()=>()=>{m.current&&(clearTimeout(m.current),m.current=null)},[]),a.useEffect(()=>{f(P)},[P,f]);const ns=a.useCallback(async(l,t)=>{const i=!t;p(n=>n.map(o=>o.id===l?{...o,toggling:!0}:o));try{await vs(l,i,r),p(n=>n.map(o=>o.id===l?{...o,enabled:i,toggling:!1}:o)),d(e(`skills.${i?"enabled":"disabled"}`,i?"Skill enabled":"Skill disabled"),"success")}catch(n){p(L=>L.map(R=>R.id===l?{...R,toggling:!1}:R));const o=n instanceof Error?n.message:e("skills.toggleError","Failed to toggle skill");d(e("skills.toggleFailed","Failed to toggle skill: {{message}}",{message:o}),"error")}},[r,d]),cs=a.useCallback(async l=>{const t=l.repo?.trim();if(!(!t||M===l.id)){B(l.id);try{await hs(t,l.slug||l.name,r),d(e("skills.installSuccess","Installed {{name}}",{name:l.name}),"success"),await x()}catch(i){const n=i instanceof Error?i.message:e("skills.installError","Failed to install skill");d(e("skills.installFailed","Failed to install {{name}}: {{message}}",{name:l.name,message:n}),"error")}finally{B(i=>i===l.id?null:i)}}},[d,M,x,r]),E=a.useCallback(async l=>{K(!0),C(null),S(null),w(null),v(null),h(null);try{const t=await gs(l,r);S(t)}catch(t){const i=t instanceof Error?t.message:e("skills.loadContentError","Failed to load skill content");C(i)}finally{K(!1)}},[r]),U=a.useCallback((l,t)=>{if(!(t&&t.target.closest(".skills-view-item-toggle"))){if(c===l){N(null),S(null),C(null),w(null),v(null),h(null);return}N(l),E(l)}},[c,E]),os=a.useCallback(l=>{c!==l&&N(l),E(l)},[E,c]),W=a.useCallback(async(l,t)=>{w(t),v(null),h(null),z(!0);try{const i=await bs(l,t,r);v(i)}catch(i){const n=i instanceof Error?i.message:e("skills.loadFileError","Failed to load file");h(n)}finally{z(!1)}},[r]),rs=a.useCallback(()=>{w(null),v(null),h(null),z(!1)},[]),X=a.useCallback(()=>{N(null),S(null),C(null),w(null),v(null),h(null)},[]),ds=a.useMemo(()=>k.find(l=>l.id===c)??null,[k,c]),Z=()=>!b||b.files.length===0?null:s.jsxs("div",{className:"skills-view-detail-files","data-testid":"skill-files",children:[s.jsxs("span",{className:"skills-view-detail-files-label",children:[e("skills.filesLabel","Files"),":"]}),b.files.map(l=>{if(l.type==="directory")return s.jsxs("span",{className:"badge badge--sm skills-view-detail-file--dir",children:[l.name,"/"]},l.relativePath);const t=y===l.relativePath;return s.jsx("button",{type:"button","data-testid":"skill-file-item",className:`badge badge--sm skills-view-detail-file${t?" skills-view-detail-file--active":""}`,onClick:()=>c&&void W(c,l.relativePath),"aria-pressed":t,"aria-label":e("skills.viewFile","View {{name}}",{name:l.name}),children:l.name},l.relativePath)})]}),ks=()=>c?es?s.jsxs("div",{className:"skills-view-detail-loading",children:[s.jsx(A,{size:16,className:"spin"}),e("skills.loadingContent","Loading skill content...")]}):Q?s.jsxs("div",{className:"skills-view-detail-error",children:[s.jsx(G,{size:14}),s.jsx("span",{children:Q}),s.jsx("button",{className:"btn btn-sm",onClick:()=>os(c),children:e("common.retry","Retry")})]}):b?y!==null?s.jsxs("div",{className:"skills-view-file-viewer","data-testid":"skill-file-viewer",children:[s.jsxs("div",{className:"skills-view-file-viewer-bar",children:[s.jsxs("button",{type:"button",className:"btn btn-sm skills-view-file-back",onClick:rs,"data-testid":"skill-file-back","aria-label":e("skills.backToSkillMd","Back to SKILL.md"),children:[s.jsx(q,{size:14}),e("skills.backToSkillMd","Back to SKILL.md")]}),s.jsx("span",{className:"skills-view-file-viewer-name",children:y})]}),is?s.jsxs("div",{className:"skills-view-detail-loading",children:[s.jsx(A,{size:16,className:"spin"}),e("skills.loadingFile","Loading file...")]}):$?s.jsxs("div",{className:"skills-view-detail-error",children:[s.jsx(G,{size:14}),s.jsx("span",{children:$}),s.jsx("button",{className:"btn btn-sm",onClick:()=>c&&void W(c,y),children:e("common.retry","Retry")})]}):u&&!u.isText?s.jsx("div",{className:"skills-view-detail-empty",children:e("skills.fileNotPreviewable","This file cannot be previewed.")}):u?Cs(u.relativePath)?s.jsx(J,{content:u.content||e("skills.emptyFile","(Empty file)"),className:"skills-view-detail-markdown",testId:"skills-view-detail-markdown"}):s.jsx("pre",{className:"skills-view-detail-content",children:u.content||e("skills.emptyFile","(Empty file)")}):null,Z()]}):s.jsxs(s.Fragment,{children:[s.jsx(J,{content:b.skillMd||e("skills.noSkillMd","(No SKILL.md found)"),className:"skills-view-detail-markdown",testId:"skills-view-detail-markdown"}),Z()]}):null:s.jsx("div",{className:"skills-view-detail-placeholder","data-testid":"skills-detail-empty",children:e("skills.selectASkill","Select a skill to view its details")});return s.jsxs("div",{className:"skills-view","data-testid":"skills-view","data-selected":c?"true":"false",children:[s.jsx(ws,{icon:xs,title:e("skills.title","Skills"),actions:s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"skills-view-count","aria-label":e("skills.discoveredCount","{{count}} discovered skills",{count:k.length}),children:[k.length," ",e("skills.discovered","discovered")]}),s.jsx("button",{className:"btn-icon skills-view-close touch-target",onClick:j,"aria-label":e("skills.closeView","Close skills view"),children:s.jsx(H,{size:16})}),s.jsxs("button",{className:"btn btn-sm",onClick:()=>void x(),disabled:F,children:[s.jsx(fs,{size:14,className:F?"spin":""}),e("common.refresh","Refresh")]})]})}),s.jsxs("div",{className:"skills-view-body",children:[s.jsx("div",{className:"skills-view__list","data-testid":"skills-list",children:s.jsxs("div",{className:"skills-view-content",children:[s.jsx("div",{className:"skills-view-search",children:s.jsx("input",{type:"text",className:"form-input",placeholder:e("skills.searchPlaceholder","Search skills..."),value:g,onChange:l=>ts(l.target.value),"aria-label":e("skills.searchLabel","Search skills")})}),s.jsxs("section",{className:"skills-view-section","aria-labelledby":"discovered-skills-title",children:[s.jsx("h3",{id:"discovered-skills-title",className:"skills-view-section-title",children:e("skills.discoveredSection","Discovered Skills")}),F?s.jsxs("div",{className:"skills-view-loading",children:[s.jsx("span",{className:"spinner"}),e("skills.loadingDiscovered","Loading discovered skills...")]}):k.length===0?s.jsx("div",{className:"skills-view-empty",children:s.jsx("p",{children:e("skills.noDiscovered","No skills discovered in this project.")})}):O.length===0?s.jsx("div",{className:"skills-view-empty",children:s.jsx("p",{children:e("skills.noMatchingDiscovered","No discovered skills match your search.")})}):s.jsx("div",{className:"skills-view-list",children:O.map(l=>{const t=c===l.id;return s.jsx("div",{children:s.jsxs("div",{className:`skills-view-item${t?" skills-view-item--selected":""}`,onClick:i=>U(l.id,i),role:"button",tabIndex:0,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),U(l.id))},"aria-expanded":t,"aria-label":e("skills.viewDetails","View details for {{name}}",{name:l.name}),children:[s.jsxs("div",{className:"skills-view-item-info",children:[s.jsxs("span",{className:"skills-view-item-name",children:[t?s.jsx(js,{size:14}):s.jsx(ps,{size:14}),s.jsx("span",{className:"skills-view-item-name-text",children:l.name})]}),s.jsx("span",{className:"skills-view-item-path",children:l.relativePath}),s.jsx("span",{className:"skills-view-item-source",children:l.metadata.source})]}),s.jsxs("label",{className:"skills-view-item-toggle",onClick:i=>i.stopPropagation(),children:[s.jsx("input",{type:"checkbox",checked:l.enabled,disabled:l.toggling,onChange:()=>void ns(l.id,l.enabled),"aria-label":e(`skills.${l.enabled?"disable":"enable"}Skill`,l.enabled?"Disable {{name}}":"Enable {{name}}",{name:l.name})}),s.jsx("span",{className:"skills-view-toggle-slider"})]})]})},l.id)})})]}),s.jsxs("section",{className:"skills-view-section","aria-labelledby":"catalog-title",children:[s.jsx("h3",{id:"catalog-title",className:"skills-view-section-title",children:e("skills.catalogSection","Skills Catalog")}),I?s.jsxs("div",{className:"skills-view-error",children:[s.jsx("p",{children:I}),s.jsx("button",{className:"btn btn-sm",onClick:()=>void f(P),children:e("common.tryAgain","Try Again")})]}):Y?s.jsxs("div",{className:"skills-view-loading",children:[s.jsx("span",{className:"spinner"}),e("skills.loadingCatalog","Loading catalog...")]}):_.length===0?s.jsx("div",{className:"skills-view-empty",children:g?s.jsx("p",{children:e("skills.noMatchingSearch","No skills match your search.")}):s.jsx("p",{children:e("skills.noCatalogAvailable","No skills available in the catalog.")})}):s.jsx("div",{className:"skills-view-grid",children:_.map(l=>{const i=!!l.repo?.trim(),n=M===l.id;return s.jsxs("div",{className:"skills-view-card",children:[s.jsxs("div",{className:"skills-view-card-header",children:[s.jsx("h4",{className:"skills-view-card-title",children:l.name}),i?s.jsxs("button",{type:"button",className:"btn btn-sm skills-view-card-install",onClick:()=>void cs(l),disabled:n,"aria-label":e("skills.installSkill","Install {{name}}",{name:l.name}),children:[n?s.jsx(A,{size:14,className:"spin"}):null,n?e("skills.installing","Installing…"):e("skills.install","Install")]}):null]}),l.description&&s.jsx("p",{className:"skills-view-card-description",children:l.description}),l.tags&&l.tags.length>0&&s.jsx("div",{className:"skills-view-card-tags",children:l.tags.map(o=>s.jsx("span",{className:"badge badge--sm",children:o},o))}),l.installs!==void 0&&s.jsx("span",{className:"skills-view-card-installs",children:e("skills.installsCount","{{value}} installs",{value:l.installs.toLocaleString()})})]},l.id)})})]})]})}),s.jsxs("div",{className:"skills-view__detail","data-testid":"skill-detail",children:[s.jsxs("div",{className:"skills-view-detail-header",children:[s.jsx("button",{type:"button",className:"btn btn-sm btn-icon skills-view-detail-back",onClick:X,"aria-label":e("skills.backToList","Back to skills"),title:e("skills.backToList","Back to skills"),"data-testid":"skills-detail-back",children:s.jsx(q,{size:14})}),s.jsx("span",{className:"skills-view-detail-title",children:ds?.name??e("skills.detailTitle","Skill")}),s.jsxs("button",{className:"btn btn-sm skills-view-detail-close",onClick:X,disabled:!c,"aria-label":e("skills.closeDetail","Close skill detail"),children:[s.jsx(H,{size:14}),e("common.close","Close")]})]}),s.jsx("div",{className:"skills-view-detail-body",children:ks()})]})]})]})}export{zs as SkillsView};
|
|
1
|
+
import{r as a,j as s}from"./vendor-react-SZ_qB27O.js";import{f as ms,b as us,t as vs,i as hs,d as gs,e as bs,V as ws,Z as xs,X as H,R as fs,C as js,g as ps,L as A,A as q,h as G,M as J}from"./index-DWRJyaa3.js";import{u as Ns}from"./vendor-i18n-Duky4gdQ.js";import"./vendor-codemirror-CcrtqoCy.js";import"./vendor-reactflow-BlIeoTu4.js";import"./vendor-xterm-BNq00GSj.js";const Ss=new Set([".md",".markdown",".mdx"]);function Cs(r){const d=r.toLowerCase(),j=d.lastIndexOf(".");return j<0?!1:Ss.has(d.slice(j))}function zs({projectId:r,addToast:d,onClose:j}){const{t:e}=Ns("app"),[k,p]=a.useState([]),[F,T]=a.useState(!0),[Y,V]=a.useState(!1),[I,D]=a.useState(null),[_,ss]=a.useState([]),[g,ls]=a.useState(""),[M,B]=a.useState(null),[c,N]=a.useState(null),[b,S]=a.useState(null),[es,K]=a.useState(!1),[Q,C]=a.useState(null),[y,w]=a.useState(null),[u,v]=a.useState(null),[is,z]=a.useState(!1),[$,h]=a.useState(null),m=a.useRef(null),[P,as]=a.useState(""),O=g.trim()?k.filter(l=>l.name.toLowerCase().includes(g.toLowerCase())||l.relativePath.toLowerCase().includes(g.toLowerCase())):k,x=a.useCallback(async()=>{T(!0);try{const l=await ms(r);p(l)}catch(l){const t=l instanceof Error?l.message:e("skills.loadDiscoveredError","Failed to load discovered skills");d(t,"error")}finally{T(!1)}},[r,d]),f=a.useCallback(async l=>{const t=i=>{if(!i||typeof i!="object")return!1;const n=i;if(typeof n.status=="number"&&n.status>=500)return!0;if(n.details&&typeof n.details=="object"){const L=n.details;if(typeof L.code=="string"&&L.code.startsWith("upstream_"))return!0}const o=i;return typeof o.error=="string"&&typeof o.code=="string"};V(!0),D(null);try{const i=await us(l,20,r);ss(i.entries)}catch(i){if(t(i))D(e("skills.catalogUnavailable","Catalog is temporarily unavailable. Please try again later."));else{const n=i instanceof Error?i.message:e("skills.loadCatalogError","Failed to load catalog");D(n)}}finally{V(!1)}},[r]);a.useEffect(()=>{x(),f("")},[x,f]);const ts=a.useCallback(l=>{ls(l),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{as(l),m.current=null},300)},[]);a.useEffect(()=>()=>{m.current&&(clearTimeout(m.current),m.current=null)},[]),a.useEffect(()=>{f(P)},[P,f]);const ns=a.useCallback(async(l,t)=>{const i=!t;p(n=>n.map(o=>o.id===l?{...o,toggling:!0}:o));try{await vs(l,i,r),p(n=>n.map(o=>o.id===l?{...o,enabled:i,toggling:!1}:o)),d(e(`skills.${i?"enabled":"disabled"}`,i?"Skill enabled":"Skill disabled"),"success")}catch(n){p(L=>L.map(R=>R.id===l?{...R,toggling:!1}:R));const o=n instanceof Error?n.message:e("skills.toggleError","Failed to toggle skill");d(e("skills.toggleFailed","Failed to toggle skill: {{message}}",{message:o}),"error")}},[r,d]),cs=a.useCallback(async l=>{const t=l.repo?.trim();if(!(!t||M===l.id)){B(l.id);try{await hs(t,l.slug||l.name,r),d(e("skills.installSuccess","Installed {{name}}",{name:l.name}),"success"),await x()}catch(i){const n=i instanceof Error?i.message:e("skills.installError","Failed to install skill");d(e("skills.installFailed","Failed to install {{name}}: {{message}}",{name:l.name,message:n}),"error")}finally{B(i=>i===l.id?null:i)}}},[d,M,x,r]),E=a.useCallback(async l=>{K(!0),C(null),S(null),w(null),v(null),h(null);try{const t=await gs(l,r);S(t)}catch(t){const i=t instanceof Error?t.message:e("skills.loadContentError","Failed to load skill content");C(i)}finally{K(!1)}},[r]),U=a.useCallback((l,t)=>{if(!(t&&t.target.closest(".skills-view-item-toggle"))){if(c===l){N(null),S(null),C(null),w(null),v(null),h(null);return}N(l),E(l)}},[c,E]),os=a.useCallback(l=>{c!==l&&N(l),E(l)},[E,c]),W=a.useCallback(async(l,t)=>{w(t),v(null),h(null),z(!0);try{const i=await bs(l,t,r);v(i)}catch(i){const n=i instanceof Error?i.message:e("skills.loadFileError","Failed to load file");h(n)}finally{z(!1)}},[r]),rs=a.useCallback(()=>{w(null),v(null),h(null),z(!1)},[]),X=a.useCallback(()=>{N(null),S(null),C(null),w(null),v(null),h(null)},[]),ds=a.useMemo(()=>k.find(l=>l.id===c)??null,[k,c]),Z=()=>!b||b.files.length===0?null:s.jsxs("div",{className:"skills-view-detail-files","data-testid":"skill-files",children:[s.jsxs("span",{className:"skills-view-detail-files-label",children:[e("skills.filesLabel","Files"),":"]}),b.files.map(l=>{if(l.type==="directory")return s.jsxs("span",{className:"badge badge--sm skills-view-detail-file--dir",children:[l.name,"/"]},l.relativePath);const t=y===l.relativePath;return s.jsx("button",{type:"button","data-testid":"skill-file-item",className:`badge badge--sm skills-view-detail-file${t?" skills-view-detail-file--active":""}`,onClick:()=>c&&void W(c,l.relativePath),"aria-pressed":t,"aria-label":e("skills.viewFile","View {{name}}",{name:l.name}),children:l.name},l.relativePath)})]}),ks=()=>c?es?s.jsxs("div",{className:"skills-view-detail-loading",children:[s.jsx(A,{size:16,className:"spin"}),e("skills.loadingContent","Loading skill content...")]}):Q?s.jsxs("div",{className:"skills-view-detail-error",children:[s.jsx(G,{size:14}),s.jsx("span",{children:Q}),s.jsx("button",{className:"btn btn-sm",onClick:()=>os(c),children:e("common.retry","Retry")})]}):b?y!==null?s.jsxs("div",{className:"skills-view-file-viewer","data-testid":"skill-file-viewer",children:[s.jsxs("div",{className:"skills-view-file-viewer-bar",children:[s.jsxs("button",{type:"button",className:"btn btn-sm skills-view-file-back",onClick:rs,"data-testid":"skill-file-back","aria-label":e("skills.backToSkillMd","Back to SKILL.md"),children:[s.jsx(q,{size:14}),e("skills.backToSkillMd","Back to SKILL.md")]}),s.jsx("span",{className:"skills-view-file-viewer-name",children:y})]}),is?s.jsxs("div",{className:"skills-view-detail-loading",children:[s.jsx(A,{size:16,className:"spin"}),e("skills.loadingFile","Loading file...")]}):$?s.jsxs("div",{className:"skills-view-detail-error",children:[s.jsx(G,{size:14}),s.jsx("span",{children:$}),s.jsx("button",{className:"btn btn-sm",onClick:()=>c&&void W(c,y),children:e("common.retry","Retry")})]}):u&&!u.isText?s.jsx("div",{className:"skills-view-detail-empty",children:e("skills.fileNotPreviewable","This file cannot be previewed.")}):u?Cs(u.relativePath)?s.jsx(J,{content:u.content||e("skills.emptyFile","(Empty file)"),className:"skills-view-detail-markdown",testId:"skills-view-detail-markdown"}):s.jsx("pre",{className:"skills-view-detail-content",children:u.content||e("skills.emptyFile","(Empty file)")}):null,Z()]}):s.jsxs(s.Fragment,{children:[s.jsx(J,{content:b.skillMd||e("skills.noSkillMd","(No SKILL.md found)"),className:"skills-view-detail-markdown",testId:"skills-view-detail-markdown"}),Z()]}):null:s.jsx("div",{className:"skills-view-detail-placeholder","data-testid":"skills-detail-empty",children:e("skills.selectASkill","Select a skill to view its details")});return s.jsxs("div",{className:"skills-view","data-testid":"skills-view","data-selected":c?"true":"false",children:[s.jsx(ws,{icon:xs,title:e("skills.title","Skills"),actions:s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"skills-view-count","aria-label":e("skills.discoveredCount","{{count}} discovered skills",{count:k.length}),children:[k.length," ",e("skills.discovered","discovered")]}),s.jsx("button",{className:"btn-icon skills-view-close touch-target",onClick:j,"aria-label":e("skills.closeView","Close skills view"),children:s.jsx(H,{size:16})}),s.jsxs("button",{className:"btn btn-sm",onClick:()=>void x(),disabled:F,children:[s.jsx(fs,{size:14,className:F?"spin":""}),e("common.refresh","Refresh")]})]})}),s.jsxs("div",{className:"skills-view-body",children:[s.jsx("div",{className:"skills-view__list","data-testid":"skills-list",children:s.jsxs("div",{className:"skills-view-content",children:[s.jsx("div",{className:"skills-view-search",children:s.jsx("input",{type:"text",className:"form-input",placeholder:e("skills.searchPlaceholder","Search skills..."),value:g,onChange:l=>ts(l.target.value),"aria-label":e("skills.searchLabel","Search skills")})}),s.jsxs("section",{className:"skills-view-section","aria-labelledby":"discovered-skills-title",children:[s.jsx("h3",{id:"discovered-skills-title",className:"skills-view-section-title",children:e("skills.discoveredSection","Discovered Skills")}),F?s.jsxs("div",{className:"skills-view-loading",children:[s.jsx("span",{className:"spinner"}),e("skills.loadingDiscovered","Loading discovered skills...")]}):k.length===0?s.jsx("div",{className:"skills-view-empty",children:s.jsx("p",{children:e("skills.noDiscovered","No skills discovered in this project.")})}):O.length===0?s.jsx("div",{className:"skills-view-empty",children:s.jsx("p",{children:e("skills.noMatchingDiscovered","No discovered skills match your search.")})}):s.jsx("div",{className:"skills-view-list",children:O.map(l=>{const t=c===l.id;return s.jsx("div",{children:s.jsxs("div",{className:`skills-view-item${t?" skills-view-item--selected":""}`,onClick:i=>U(l.id,i),role:"button",tabIndex:0,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),U(l.id))},"aria-expanded":t,"aria-label":e("skills.viewDetails","View details for {{name}}",{name:l.name}),children:[s.jsxs("div",{className:"skills-view-item-info",children:[s.jsxs("span",{className:"skills-view-item-name",children:[t?s.jsx(js,{size:14}):s.jsx(ps,{size:14}),s.jsx("span",{className:"skills-view-item-name-text",children:l.name})]}),s.jsx("span",{className:"skills-view-item-path",children:l.relativePath}),s.jsx("span",{className:"skills-view-item-source",children:l.metadata.source})]}),s.jsxs("label",{className:"skills-view-item-toggle",onClick:i=>i.stopPropagation(),children:[s.jsx("input",{type:"checkbox",checked:l.enabled,disabled:l.toggling,onChange:()=>void ns(l.id,l.enabled),"aria-label":e(`skills.${l.enabled?"disable":"enable"}Skill`,l.enabled?"Disable {{name}}":"Enable {{name}}",{name:l.name})}),s.jsx("span",{className:"skills-view-toggle-slider"})]})]})},l.id)})})]}),s.jsxs("section",{className:"skills-view-section","aria-labelledby":"catalog-title",children:[s.jsx("h3",{id:"catalog-title",className:"skills-view-section-title",children:e("skills.catalogSection","Skills Catalog")}),I?s.jsxs("div",{className:"skills-view-error",children:[s.jsx("p",{children:I}),s.jsx("button",{className:"btn btn-sm",onClick:()=>void f(P),children:e("common.tryAgain","Try Again")})]}):Y?s.jsxs("div",{className:"skills-view-loading",children:[s.jsx("span",{className:"spinner"}),e("skills.loadingCatalog","Loading catalog...")]}):_.length===0?s.jsx("div",{className:"skills-view-empty",children:g?s.jsx("p",{children:e("skills.noMatchingSearch","No skills match your search.")}):s.jsx("p",{children:e("skills.noCatalogAvailable","No skills available in the catalog.")})}):s.jsx("div",{className:"skills-view-grid",children:_.map(l=>{const i=!!l.repo?.trim(),n=M===l.id;return s.jsxs("div",{className:"skills-view-card",children:[s.jsxs("div",{className:"skills-view-card-header",children:[s.jsx("h4",{className:"skills-view-card-title",children:l.name}),i?s.jsxs("button",{type:"button",className:"btn btn-sm skills-view-card-install",onClick:()=>void cs(l),disabled:n,"aria-label":e("skills.installSkill","Install {{name}}",{name:l.name}),children:[n?s.jsx(A,{size:14,className:"spin"}):null,n?e("skills.installing","Installing…"):e("skills.install","Install")]}):null]}),l.description&&s.jsx("p",{className:"skills-view-card-description",children:l.description}),l.tags&&l.tags.length>0&&s.jsx("div",{className:"skills-view-card-tags",children:l.tags.map(o=>s.jsx("span",{className:"badge badge--sm",children:o},o))}),l.installs!==void 0&&s.jsx("span",{className:"skills-view-card-installs",children:e("skills.installsCount","{{value}} installs",{value:l.installs.toLocaleString()})})]},l.id)})})]})]})}),s.jsxs("div",{className:"skills-view__detail","data-testid":"skill-detail",children:[s.jsxs("div",{className:"skills-view-detail-header",children:[s.jsx("button",{type:"button",className:"btn btn-sm btn-icon skills-view-detail-back",onClick:X,"aria-label":e("skills.backToList","Back to skills"),title:e("skills.backToList","Back to skills"),"data-testid":"skills-detail-back",children:s.jsx(q,{size:14})}),s.jsx("span",{className:"skills-view-detail-title",children:ds?.name??e("skills.detailTitle","Skill")}),s.jsxs("button",{className:"btn btn-sm skills-view-detail-close",onClick:X,disabled:!c,"aria-label":e("skills.closeDetail","Close skill detail"),children:[s.jsx(H,{size:14}),e("common.close","Close")]})]}),s.jsx("div",{className:"skills-view-detail-body",children:ks()})]})]})]})}export{zs as SkillsView};
|
package/dist/client/assets/{WorkflowNodeEditor-BzGh_Fd9.js → WorkflowNodeEditor-DoxLGPRF.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as a,j as e,b as ei}from"./vendor-react-SZ_qB27O.js";import{R as Bn,d as Gn,B as qn,e as ti,C as Vn,P as oi,g as si,f as ni,E as ai,H as it,h as lt,u as Hn,j as ii,k as li,l as ri,m as di,M as ci}from"./vendor-reactflow-BlIeoTu4.js";import{c as ui,ep as pi,eq as Xt,er as qo,es as ke,et as Kn,eu as fi,ev as mi,ew as oo,ex as Et,ey as At,ez as rt,eA as Pt,eB as Ye,eC as Un,eD as Yn,eE as Jn,eF as Xn,eG as Qn,eH as wi,P as je,eI as Zn,dj as Jo,eJ as ea,eK as ta,ce as Xo,eL as oa,eM as Qo,eN as Ft,eO as sa,eP as na,eQ as aa,b2 as ia,bi as Zo,Y as la,b3 as es,eR as hi,c9 as gi,a$ as Te,eS as ki,eT as ra,F as da,X as ts,aI as bi,eU as ca,b$ as le,c6 as Qt,ci as xi,aa as vi,C as Me,x as Se,eV as Ni,bJ as Zt,eW as qs,bD as ua,eX as eo,aJ as ji,g as We,b1 as yi,bN as Vo,v as Ci,eY as Si,eZ as Ii,cf as Vs,e_ as Ei,e$ as Ai,f0 as Pi,dO as Fi,a0 as Hs,ab as Mi,f1 as Ho,f2 as Ri,f3 as Oi,f4 as Li,f5 as Ti,f6 as Di,f7 as zi,bh as $i,f8 as Wi,f9 as _i,fa as Ks,fb as Us,fc as Ys,fd as Js,fe as Xs,ff as Bi,fg as Gi,fh as qi,fi as Vi,fj as Qs,fk as Hi,fl as Zs,fm as en,fn as tn,fo as Ki,fp as Mo,fq as Ui,fr as on,fs as sn,ft as Yi,f as nn,aX as Ji,da as an,fu as Ro,c8 as ln,L as Fe,fv as Je,fw as Oo,fx as Lo,aS as Jt,S as _e,fy as Xi,db as rn,fz as dn,dg as Qi,fA as Zi,fB as el}from"./index-
|
|
1
|
+
import{r as a,j as e,b as ei}from"./vendor-react-SZ_qB27O.js";import{R as Bn,d as Gn,B as qn,e as ti,C as Vn,P as oi,g as si,f as ni,E as ai,H as it,h as lt,u as Hn,j as ii,k as li,l as ri,m as di,M as ci}from"./vendor-reactflow-BlIeoTu4.js";import{c as ui,ep as pi,eq as Xt,er as qo,es as ke,et as Kn,eu as fi,ev as mi,ew as oo,ex as Et,ey as At,ez as rt,eA as Pt,eB as Ye,eC as Un,eD as Yn,eE as Jn,eF as Xn,eG as Qn,eH as wi,P as je,eI as Zn,dj as Jo,eJ as ea,eK as ta,ce as Xo,eL as oa,eM as Qo,eN as Ft,eO as sa,eP as na,eQ as aa,b2 as ia,bi as Zo,Y as la,b3 as es,eR as hi,c9 as gi,a$ as Te,eS as ki,eT as ra,F as da,X as ts,aI as bi,eU as ca,b$ as le,c6 as Qt,ci as xi,aa as vi,C as Me,x as Se,eV as Ni,bJ as Zt,eW as qs,bD as ua,eX as eo,aJ as ji,g as We,b1 as yi,bN as Vo,v as Ci,eY as Si,eZ as Ii,cf as Vs,e_ as Ei,e$ as Ai,f0 as Pi,dO as Fi,a0 as Hs,ab as Mi,f1 as Ho,f2 as Ri,f3 as Oi,f4 as Li,f5 as Ti,f6 as Di,f7 as zi,bh as $i,f8 as Wi,f9 as _i,fa as Ks,fb as Us,fc as Ys,fd as Js,fe as Xs,ff as Bi,fg as Gi,fh as qi,fi as Vi,fj as Qs,fk as Hi,fl as Zs,fm as en,fn as tn,fo as Ki,fp as Mo,fq as Ui,fr as on,fs as sn,ft as Yi,f as nn,aX as Ji,da as an,fu as Ro,c8 as ln,L as Fe,fv as Je,fw as Oo,fx as Lo,aS as Jt,S as _e,fy as Xi,db as rn,fz as dn,dg as Qi,fA as Zi,fB as el}from"./index-DWRJyaa3.js";import{u as be}from"./vendor-i18n-Duky4gdQ.js";import{P as To}from"./puzzle-DQ0y1-XK.js";import{S as tl,a as ol,b as sl,c as cn,d as nl,e as al}from"./SettingsTextareaRow-WSkBoAOO.js";import{U as il}from"./upload-BjyBtxo7.js";import"./vendor-codemirror-CcrtqoCy.js";import"./vendor-xterm-BNq00GSj.js";/**
|
|
2
2
|
* @license lucide-react v1.7.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n,w as o}from"./index-
|
|
1
|
+
import{a as n,w as o}from"./index-DWRJyaa3.js";function c(){return n("/agents/companies")}function i(e,t){return n(o("/agents/generate/start",t),{method:"POST",body:JSON.stringify({role:e})})}function u(e,t){return n(o("/agents/generate/spec",t),{method:"POST",body:JSON.stringify({sessionId:e})})}function g(e,t){return n(o(`/agents/generate/${encodeURIComponent(e)}`,t),{method:"DELETE"})}function p(e){return n(o("/backups",e))}function f(e){return n(o("/backups",e),{method:"POST"})}function m(e,t){const r=o("/settings/export",t),s=`${r}${r.includes("?")?"&":"?"}scope=${encodeURIComponent(e)}`;return n(s)}function d(e,t,r){return n(o("/settings/import",r),{method:"POST",body:JSON.stringify({data:e,scope:t?.scope??"both",merge:t?.merge??!0})})}export{p as a,f as b,g as c,m as e,c as f,u as g,d as i,i as s};
|
package/dist/client/assets/{agentsOrgChartLayout-C2K_M3x3.js → agentsOrgChartLayout-C3iumMrW.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h}from"./index-
|
|
1
|
+
import{a as h}from"./index-DWRJyaa3.js";async function m(t={},r){const e=new URLSearchParams(Object.entries(t).filter(a=>a[1]!==void 0).map(([a,n])=>[a,String(n)]));return h(`/agent-activity${e.size?`?${e}`:""}`,r)}const I="fn-agent-org-chart-layout";function b(t){return t==="auto"||t==="horizontal"||t==="vertical"}const d=768,l={nodeWidth:220,siblingGap:24,rootGap:24,chartPadding:24},u={nodeWidth:160,siblingGap:8,rootGap:8,chartPadding:8};function o(t){return t.children.length===0?1:t.children.reduce((r,e)=>r+o(e),0)}function g(t){return t<=d?u:l}function f(t,r){const e=o(t);return e*r.nodeWidth+Math.max(0,e-1)*r.siblingGap}function O(t,r=Number.POSITIVE_INFINITY){const e=g(r);if(t.length===0)return e.nodeWidth;const n=t.map(i=>f(i,e)).reduce((i,c)=>i+c,0),s=Math.max(0,t.length-1)*e.rootGap;return n+s+e.chartPadding*2}function _(t){const r=t.preference??"auto";if(r!=="auto")return r;const e=Number.isFinite(t.availableWidth)&&t.availableWidth>0?t.availableWidth:0;return e===0||t.tree.length<=1?"horizontal":O(t.tree,e)>e?"vertical":"horizontal"}export{I as O,m as g,b as i,_ as r};
|