@runfusion/fusion 0.27.1 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +3418 -864
- package/dist/client/assets/AgentDetailView-DSpIqBOs.css +1 -0
- package/dist/client/assets/{AgentDetailView-shgiiUb4.js → AgentDetailView-V32TpEe1.js} +3 -3
- package/dist/client/assets/{AgentsView-CpwqOVDz.js → AgentsView-CxITZE-U.js} +3 -3
- package/dist/client/assets/ChatView-7WPHyB_7.js +1 -0
- package/dist/client/assets/DevServerView-Diw4hjw0.js +1 -0
- package/dist/client/assets/{DirectoryPicker-C0kmRv0u.js → DirectoryPicker-CWSApoLU.js} +1 -1
- package/dist/client/assets/{DocumentsView-B94U9ijs.js → DocumentsView-1kr0dhsV.js} +1 -1
- package/dist/client/assets/{EvalsView-O_4YWy--.js → EvalsView-cDfXYiK6.js} +1 -1
- package/dist/client/assets/{ExperimentalAgentOnboardingModal-CkEiF85-.js → ExperimentalAgentOnboardingModal-lNSf6UtY.js} +1 -1
- package/dist/client/assets/{InsightsView-D-Qe0tRr.js → InsightsView-D2AjxOnu.js} +1 -1
- package/dist/client/assets/{MemoryView-CoRUmRvb.js → MemoryView-Dq4yjIPI.js} +1 -1
- package/dist/client/assets/{NodesView-DQzXjcLc.js → NodesView-Cpmkze7n.js} +4 -4
- package/dist/client/assets/{PiExtensionsManager-Dn1LmFbq.js → PiExtensionsManager-oi9FHT0y.js} +2 -2
- package/dist/client/assets/PluginManager-C4UoLv4U.css +1 -0
- package/dist/client/assets/PluginManager-o12KG4e8.js +1 -0
- package/dist/client/assets/ResearchView-C7uXon3o.css +1 -0
- package/dist/client/assets/ResearchView-C9bjVB7-.js +1 -0
- package/dist/client/assets/{SettingsModal-Bg1-3JO_.js → SettingsModal-CT01a5Rh.js} +1 -1
- package/dist/client/assets/SettingsModal-Cu93Jjho.js +31 -0
- package/dist/client/assets/{SetupWizardModal-DuzYPbuJ.js → SetupWizardModal-Agi3XNtZ.js} +1 -1
- package/dist/client/assets/{SkillsView-BIFoVNUf.js → SkillsView-DmZfbGLs.js} +1 -1
- package/dist/client/assets/{StashRecoveryView-C52KsV7f.js → StashRecoveryView-BwKJQaUW.js} +1 -1
- package/dist/client/assets/{TodoView-sS_mT0Y7.js → TodoView-uJRg4Cnl.js} +2 -2
- package/dist/client/assets/dashboard-view-C7Snlgow.js +21 -0
- package/dist/client/assets/dashboard-view-DqWnXEbq.css +1 -0
- package/dist/client/assets/{folder-open-B9cwJ-OX.js → folder-open-DU-Ec_iC.js} +1 -1
- package/dist/client/assets/index-CD0_dkME.css +1 -0
- package/dist/client/assets/index-DiewofJh.js +692 -0
- package/dist/client/assets/{star-BDn04UYV.js → star-Qi0GspVN.js} +1 -1
- package/dist/client/assets/{upload-zdPPycKQ.js → upload-Dx_l9Vbu.js} +1 -1
- package/dist/client/assets/{users-CPYZjK2g.js → users-3Qw_TMah.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/client/version.json +1 -1
- package/dist/droid-cli/package.json +1 -1
- package/dist/extension.js +2628 -573
- package/dist/pi-claude-cli/package.json +1 -1
- package/dist/plugins/fusion-plugin-cli-printing-press/package.json +1 -1
- package/dist/plugins/fusion-plugin-cli-printing-press/src/__tests__/registration.test.ts +2 -4
- package/dist/plugins/fusion-plugin-cli-printing-press/src/__tests__/runtime-availability.test.ts +5 -2
- package/dist/plugins/fusion-plugin-cli-printing-press/src/__tests__/workflow-integration.test.ts +7 -4
- package/dist/plugins/fusion-plugin-cursor-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-dependency-graph/package.json +1 -1
- package/dist/plugins/fusion-plugin-droid-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-hermes-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-openclaw-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-paperclip-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-reports/package.json +1 -1
- package/dist/plugins/fusion-plugin-roadmap/package.json +1 -1
- package/dist/plugins/fusion-plugin-whatsapp-chat/package.json +1 -1
- package/package.json +1 -1
- package/skill/fusion/references/engine-tools.md +1 -0
- package/skill/fusion/references/extension-tools.md +3 -1
- package/dist/client/assets/AgentDetailView-B7QRcHJH.css +0 -1
- package/dist/client/assets/ChatView-DyRBOIKL.js +0 -1
- package/dist/client/assets/DevServerView-Cdelj9-m.js +0 -1
- package/dist/client/assets/PluginManager-DtRQXia5.css +0 -1
- package/dist/client/assets/PluginManager-Y0fs-6No.js +0 -1
- package/dist/client/assets/ResearchView-BEI4ZSGs.css +0 -1
- package/dist/client/assets/ResearchView-CjOxKhdS.js +0 -1
- package/dist/client/assets/SettingsModal-DL7tjJQa.js +0 -31
- package/dist/client/assets/dashboard-view-BoTzlP8b.css +0 -1
- package/dist/client/assets/dashboard-view-MB-86hAu.js +0 -21
- package/dist/client/assets/index-BOjPRqEk.js +0 -692
- package/dist/client/assets/index-BmSEq8Rb.css +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.graph-task-node{position:absolute;z-index:1;width:min(100%,var(--graph-task-node-width, calc(var(--space-2xl) * 9)));max-width:var(--graph-task-node-max-width, calc(var(--space-2xl) * 9.5));transition:box-shadow var(--transition-fast),z-index var(--transition-fast),opacity var(--transition-fast),border-color var(--transition-fast);border:var(--btn-border-width) solid transparent;border-radius:var(--radius-sm)}.graph-task-node:hover{box-shadow:var(--shadow-md);z-index:2}.graph-task-node--selected{box-shadow:var(--focus-ring-strong),var(--shadow-md);z-index:2}.graph-task-node--highlighted{box-shadow:0 0 0 var(--btn-border-width) var(--todo),var(--shadow-md);z-index:2}.graph-task-node--dimmed{opacity:.4}.graph-task-node--active{border-color:color-mix(in srgb,var(--in-progress) 50%,transparent);box-shadow:0 0 0 var(--btn-border-width) color-mix(in srgb,var(--in-progress) 45%,transparent),0 0 var(--space-md) color-mix(in srgb,var(--in-progress) 50%,transparent),0 0 var(--space-xl) color-mix(in srgb,var(--in-progress) 20%,transparent);transform:scale(1.01)}.graph-task-node--in-review{border-inline-start:calc(var(--btn-border-width) * 3) solid var(--in-review);border-start-start-radius:var(--radius-md);border-end-start-radius:var(--radius-md)}.graph-task-active-indicator{display:flex;align-items:center;min-height:calc(var(--space-xs) * 5);width:100%;padding-inline:var(--space-sm);background:color-mix(in srgb,var(--in-progress) 85%,transparent);border-radius:var(--radius-sm) var(--radius-sm) 0 0;animation:graph-task-active-pulse calc(var(--transition-normal) * 8) ease-in-out infinite}.graph-task-active-indicator-text{font-family:var(--font-mono);font-size:calc(var(--space-xs) * 2.5);font-weight:600;line-height:1;letter-spacing:.04em;text-transform:uppercase;color:var(--card)}.graph-task-node .card{width:100%;height:100%}.graph-task-node[data-current-step="0"] .card-steps-list .card-step-item:nth-child(1),.graph-task-node[data-current-step="1"] .card-steps-list .card-step-item:nth-child(2),.graph-task-node[data-current-step="2"] .card-steps-list .card-step-item:nth-child(3),.graph-task-node[data-current-step="3"] .card-steps-list .card-step-item:nth-child(4),.graph-task-node[data-current-step="4"] .card-steps-list .card-step-item:nth-child(5),.graph-task-node[data-current-step="5"] .card-steps-list .card-step-item:nth-child(6),.graph-task-node[data-current-step="6"] .card-steps-list .card-step-item:nth-child(7),.graph-task-node[data-current-step="7"] .card-steps-list .card-step-item:nth-child(8),.graph-task-node[data-current-step="8"] .card-steps-list .card-step-item:nth-child(9),.graph-task-node[data-current-step="9"] .card-steps-list .card-step-item:nth-child(10),.graph-task-node[data-current-step="10"] .card-steps-list .card-step-item:nth-child(11),.graph-task-node[data-current-step="11"] .card-steps-list .card-step-item:nth-child(12),.graph-task-node[data-current-step="12"] .card-steps-list .card-step-item:nth-child(13),.graph-task-node[data-current-step="13"] .card-steps-list .card-step-item:nth-child(14),.graph-task-node[data-current-step="14"] .card-steps-list .card-step-item:nth-child(15),.graph-task-node[data-current-step="15"] .card-steps-list .card-step-item:nth-child(16),.graph-task-node[data-current-step="16"] .card-steps-list .card-step-item:nth-child(17),.graph-task-node[data-current-step="17"] .card-steps-list .card-step-item:nth-child(18),.graph-task-node[data-current-step="18"] .card-steps-list .card-step-item:nth-child(19),.graph-task-node[data-current-step="19"] .card-steps-list .card-step-item:nth-child(20){background:color-mix(in srgb,var(--in-progress) 15%,transparent);border-left:calc(var(--btn-border-width) * 2) solid var(--in-progress);padding-left:var(--space-xs);font-weight:500}.graph-task-node[data-current-step="0"] .card-steps-list .card-step-item:nth-child(1) .card-step-dot,.graph-task-node[data-current-step="1"] .card-steps-list .card-step-item:nth-child(2) .card-step-dot,.graph-task-node[data-current-step="2"] .card-steps-list .card-step-item:nth-child(3) .card-step-dot,.graph-task-node[data-current-step="3"] .card-steps-list .card-step-item:nth-child(4) .card-step-dot,.graph-task-node[data-current-step="4"] .card-steps-list .card-step-item:nth-child(5) .card-step-dot,.graph-task-node[data-current-step="5"] .card-steps-list .card-step-item:nth-child(6) .card-step-dot,.graph-task-node[data-current-step="6"] .card-steps-list .card-step-item:nth-child(7) .card-step-dot,.graph-task-node[data-current-step="7"] .card-steps-list .card-step-item:nth-child(8) .card-step-dot,.graph-task-node[data-current-step="8"] .card-steps-list .card-step-item:nth-child(9) .card-step-dot,.graph-task-node[data-current-step="9"] .card-steps-list .card-step-item:nth-child(10) .card-step-dot,.graph-task-node[data-current-step="10"] .card-steps-list .card-step-item:nth-child(11) .card-step-dot,.graph-task-node[data-current-step="11"] .card-steps-list .card-step-item:nth-child(12) .card-step-dot,.graph-task-node[data-current-step="12"] .card-steps-list .card-step-item:nth-child(13) .card-step-dot,.graph-task-node[data-current-step="13"] .card-steps-list .card-step-item:nth-child(14) .card-step-dot,.graph-task-node[data-current-step="14"] .card-steps-list .card-step-item:nth-child(15) .card-step-dot,.graph-task-node[data-current-step="15"] .card-steps-list .card-step-item:nth-child(16) .card-step-dot,.graph-task-node[data-current-step="16"] .card-steps-list .card-step-item:nth-child(17) .card-step-dot,.graph-task-node[data-current-step="17"] .card-steps-list .card-step-item:nth-child(18) .card-step-dot,.graph-task-node[data-current-step="18"] .card-steps-list .card-step-item:nth-child(19) .card-step-dot,.graph-task-node[data-current-step="19"] .card-steps-list .card-step-item:nth-child(20) .card-step-dot{width:var(--space-sm);height:var(--space-sm);animation:graph-task-step-pulse calc(var(--transition-normal) * 10) ease-in-out infinite}@keyframes graph-task-active-pulse{0%,to{background:color-mix(in srgb,var(--in-progress) 85%,transparent)}50%{background:color-mix(in srgb,var(--in-progress) 65%,transparent)}}@keyframes graph-task-step-pulse{0%,to{transform:scale(1);opacity:1}50%{transform:scale(1.2);opacity:.75}}@media(max-width:768px){.graph-task-node{width:min(100%,var(--graph-task-node-mobile-width, calc(var(--space-2xl) * 8)))}.graph-task-node--active{transform:scale(1.005)}.graph-task-active-indicator{min-height:var(--space-xl);padding-inline:var(--space-md)}.graph-task-active-indicator-text{font-size:calc(var(--space-xs) * 2.75)}}.graph-node--highlighted{opacity:1;box-shadow:var(--shadow-glow)}.graph-node--dimmed{opacity:.25;transition:opacity var(--transition-fast)}.graph-edge--highlighted{opacity:1;stroke:var(--todo);stroke-width:var(--space-xs)}.graph-edge--dimmed{opacity:.15;transition:opacity var(--transition-fast)}@media(max-width:768px){.graph-node--dimmed,.graph-edge--dimmed{transition:opacity var(--transition-fast)}}.graph-node--draggable{cursor:grab;touch-action:none}.graph-node--dragging{z-index:3;cursor:grabbing;box-shadow:var(--shadow-lg);transform:scale(1.02);transition:transform var(--transition-fast),box-shadow var(--transition-fast),z-index var(--transition-fast)}.graph-toolbar{position:absolute;right:var(--space-md);bottom:var(--space-md);display:flex;flex-direction:column;gap:var(--space-xs);padding:var(--space-sm);background:var(--surface);border:var(--btn-border-width) solid var(--border);border-radius:var(--radius-md);box-shadow:var(--shadow-md);z-index:10}.graph-toolbar__zoom-label{min-width:3.5ch;color:var(--text-muted);font-family:var(--font-mono);font-size:.75rem;text-align:center}@media(max-width:768px){.graph-toolbar{right:var(--space-sm);bottom:var(--space-sm);padding:var(--space-md)}.graph-toolbar .btn-icon{min-width:calc(var(--space-xs) * 11);min-height:calc(var(--space-xs) * 11)}}.dependency-graph{position:relative;height:100%;padding:var(--space-md)}.dependency-graph__viewport{position:relative;overflow:hidden;height:100%;min-height:calc(var(--space-2xl) * 10);border:var(--btn-border-width) solid var(--border);border-radius:var(--radius-md);background:var(--surface);touch-action:none}.dependency-graph__viewport:focus-visible{box-shadow:var(--focus-ring-strong)}.graph-canvas-transform{position:relative;transform-origin:top left}.graph-canvas-transform--animate{transition:transform var(--transition-normal)}.dependency-graph__nodes-layer{position:relative;z-index:1}.dependency-graph__nodes-layer .graph-task-node{max-width:min(100%,calc(var(--space-2xl) * 9))}.dependency-graph-edges{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible}.dependency-graph__empty{color:var(--text-muted);display:flex;align-items:center;justify-content:center;height:100%}@media(max-width:768px){.dependency-graph{padding:var(--space-sm)}}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import{r as n,j as w}from"./vendor-react-K0fH_qHe.js";import{cj as Ct,ck as St,t as Dt,w as Tt,b7 as It}from"./index-BOjPRqEk.js";import{c as ut}from"./createLucideIcon-BazL2hk5.js";import"./vendor-xterm-DzcZoU0P.js";const xt=4;function Nt({taskId:t,position:o,scale:i,canDrag:d,onPositionChange:u,onDragStateChange:s,onDragEnd:f}){const[h,C]=n.useState(!1),M=n.useRef(null),y=n.useRef(o),S=n.useRef(!1);y.current=o;const c=n.useCallback(a=>{M.current=null,C(!1),a&&(s?.(!1),f?.(),S.current=!0)},[f,s]),l=n.useCallback(a=>{if(!a.isPrimary||!d)return;a.stopPropagation();const D=a.currentTarget;typeof D.setPointerCapture=="function"&&D.setPointerCapture(a.pointerId),M.current={pointerId:a.pointerId,startPointer:{x:a.clientX,y:a.clientY},startPosition:y.current}},[d]),I=n.useCallback(a=>{const D=M.current;if(!D||D.pointerId!==a.pointerId)return;a.stopPropagation();const $=a.clientX-D.startPointer.x,H=a.clientY-D.startPointer.y,_=Math.hypot($,H);if(!h&&_>=xt&&(C(!0),s?.(!0)),_<xt)return;const v=i>0?i:1;u(t,{x:D.startPosition.x+$/v,y:D.startPosition.y+H/v})},[h,s,u,i,t]),x=n.useCallback(a=>{const D=M.current;!D||D.pointerId!==a.pointerId||(a.stopPropagation(),typeof a.currentTarget.hasPointerCapture=="function"&&a.currentTarget.hasPointerCapture(a.pointerId)&&typeof a.currentTarget.releasePointerCapture=="function"&&a.currentTarget.releasePointerCapture(a.pointerId),c(h))},[c,h]),z=n.useCallback(a=>{const D=M.current;!D||D.pointerId!==a.pointerId||(a.stopPropagation(),typeof a.currentTarget.hasPointerCapture=="function"&&a.currentTarget.hasPointerCapture(a.pointerId)&&typeof a.currentTarget.releasePointerCapture=="function"&&a.currentTarget.releasePointerCapture(a.pointerId),c(h))},[c,h]),N=n.useCallback(a=>{S.current&&(S.current=!1,a.preventDefault(),a.stopPropagation())},[]);return n.useMemo(()=>({isDragging:h,onPointerDown:l,onPointerMove:I,onPointerUp:x,onPointerCancel:z,onClickCapture:N}),[h,N,z,l,I,x])}const Rt=new Set(["planning","researching","executing","finalizing","merging","merging-fix"]);function zt(t){return t?t.charAt(0).toUpperCase()+t.slice(1):"Executing"}function jt({style:t,position:o,scale:i,isSelected:d=!1,isHighlighted:u=!1,isDimmed:s=!1,onMouseEnter:f,onMouseLeave:h,onClick:C,onNodePositionChange:M,onNodeDragStateChange:y,onNodeDragEnd:S,...c}){const{task:l,globalPaused:I,taskStuckTimeoutMs:x,lastFetchTimeMs:z,onOpenDetail:N}=c,a=l.status==="failed",D=l.paused===!0,$=Ct(l,x,z),H=l.column==="triage"&&l.status==="awaiting-approval",_=!I&&!a&&!D&&!$&&!H&&(l.column==="in-progress"||Rt.has(l.status)),v=typeof l.currentStep=="number"&&l.currentStep>=0&&Array.isArray(l.steps)&&l.currentStep<l.steps.length,tt=l.column==="in-review",j=Nt({taskId:l.id,position:o,scale:i,canDrag:d,onPositionChange:M,onDragStateChange:y,onDragEnd:S});return w.jsxs("div",{className:`graph-task-node${d?" graph-node--draggable graph-task-node--selected":""}${j.isDragging?" graph-node--dragging":""}${u?" graph-task-node--highlighted graph-node--highlighted":""}${s?" graph-task-node--dimmed graph-node--dimmed":""}${_?" graph-task-node--active":""}${tt?" graph-task-node--in-review":""}`,style:t,draggable:!1,"data-testid":`graph-task-node-${l.id}`,"data-current-step":_&&v?String(l.currentStep):void 0,onMouseEnter:f,onMouseLeave:h,onClick:C,onDoubleClick:G=>{G.defaultPrevented||N(l)},onClickCapture:j.onClickCapture,onPointerDown:j.onPointerDown,onPointerMove:j.onPointerMove,onPointerUp:j.onPointerUp,onPointerCancel:j.onPointerCancel,children:[_?w.jsx("div",{className:"graph-task-active-indicator",children:w.jsx("span",{className:"graph-task-active-indicator-text",children:zt(l.status)})}):null,w.jsx(St,{...c,onOpenDetail:()=>{},disableDrag:!0})]})}/**
|
|
2
|
-
* @license lucide-react v0.542.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const Et=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],Ot=ut("maximize",Et);/**
|
|
7
|
-
* @license lucide-react v0.542.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const Yt=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],_t=ut("rotate-ccw",Yt);/**
|
|
12
|
-
* @license lucide-react v0.542.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const Xt=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],$t=ut("zoom-in",Xt);/**
|
|
17
|
-
* @license lucide-react v0.542.0 - ISC
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the ISC license.
|
|
20
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const Gt=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],At=ut("zoom-out",Gt);function Ht({zoom:t,onZoomIn:o,onZoomOut:i,onFitToGraph:d,onResetView:u}){return w.jsxs("div",{className:"graph-toolbar","data-testid":"graph-toolbar",children:[w.jsx("button",{className:"btn btn-icon",title:"Zoom in (Ctrl+=)","aria-label":"Zoom in",onClick:o,children:w.jsx($t,{size:16})}),w.jsx("button",{className:"btn btn-icon",title:"Zoom out (Ctrl+-)","aria-label":"Zoom out",onClick:i,children:w.jsx(At,{size:16})}),w.jsxs("div",{className:"graph-toolbar__zoom-label","aria-live":"polite",children:[Math.round(t*100),"%"]}),w.jsx("button",{className:"btn btn-icon",title:"Fit to graph (Ctrl+Shift+F)","aria-label":"Fit to graph",onClick:d,children:w.jsx(Ot,{size:16})}),w.jsx("button",{className:"btn btn-icon",title:"Reset view (Ctrl+0)","aria-label":"Reset view",onClick:u,children:w.jsx(_t,{size:16})})]})}const Lt=280,vt=100;function Wt({edges:t,positions:o,nodeWidth:i=Lt,nodeHeight:d=vt,highlightedEdgeIds:u}){const s=!!(u&&u.size>0);return w.jsxs("svg",{className:"dependency-graph-edges","aria-hidden":"true",children:[w.jsx("defs",{children:w.jsx("marker",{id:"dependency-graph-arrowhead",markerWidth:"10",markerHeight:"7",refX:"10",refY:"3.5",orient:"auto",markerUnits:"strokeWidth",children:w.jsx("path",{d:"M 0 0 L 10 3.5 L 0 7 z",fill:"var(--border)"})})}),t.map(f=>{const h=o.get(f.source),C=o.get(f.target);if(!h||!C)return null;const M=`${f.source}->${f.target}`,y=s&&(u?.has(M)??!1),S=h.x+i/2,c=h.y+d,l=C.x+i/2,I=C.y,x=c+(I-c)/2;return w.jsx("path",{"data-testid":"dependency-edge","data-edge-id":M,className:`dependency-graph-edge${y?" graph-edge--highlighted":""}${s&&!y?" graph-edge--dimmed":""}`,d:`M ${S} ${c} C ${S} ${x}, ${l} ${x}, ${l} ${I}`,fill:"none",stroke:y?"var(--todo)":"var(--border)",strokeWidth:y?"var(--space-xs)":"var(--btn-border-width)",opacity:s&&!y?.15:1,markerEnd:"url(#dependency-graph-arrowhead)",style:{transition:"opacity var(--transition-fast), stroke var(--transition-fast), stroke-width var(--transition-fast)"}},M)})]})}const Ft=new Set(["triage","todo","in-progress","in-review"]);function Ut(t){return t.filter(o=>Ft.has(o.column))}const Zt={nodeWidth:280,nodeHeight:100,horizontalGap:40,verticalGap:80};function ft(t,o){const i={...Zt,...o},d=t.nodes.map(c=>c.task.id);if(d.length===0)return new Map;const u=new Map,s=new Map;for(const c of d)s.set(c,0),u.set(c,[]);for(const c of t.edges)!s.has(c.source)||!s.has(c.target)||(u.get(c.target)?.push(c.source),s.set(c.source,(s.get(c.source)??0)+1));const f=d.filter(c=>(s.get(c)??0)===0),h=[];for(;f.length>0;){const c=f.shift();h.push(c);for(const l of u.get(c)??[]){const I=(s.get(l)??0)-1;s.set(l,I),I===0&&f.push(l)}}for(const c of d)h.includes(c)||h.push(c);const C=new Map;for(const c of h){const l=t.edges.filter(x=>x.source===c).map(x=>x.target);let I=0;for(const x of l)I=Math.max(I,(C.get(x)??0)+1);C.set(c,I)}const M=new Map;for(const c of d){const l=C.get(c)??0,I=M.get(l)??[];I.push(c),M.set(l,I)}const y=new Map,S=Array.from(M.keys()).sort((c,l)=>c-l);for(const c of S){const l=M.get(c)??[];l.sort();const x=-(l.length*i.nodeWidth+Math.max(0,l.length-1)*i.horizontalGap)/2;l.forEach((z,N)=>{const a=x+N*(i.nodeWidth+i.horizontalGap),D=c*(i.nodeHeight+i.verticalGap);y.set(z,{x:a,y:D})})}return y}function Bt(t){return n.useMemo(()=>{const o=t.map(u=>({task:u})),i=new Set(t.map(u=>u.id)),d=t.flatMap(u=>(u.dependencies??[]).filter(s=>i.has(s)).map(s=>({source:u.id,target:s})));return{nodes:o,edges:d}},[t])}const st=.1,at=3,kt=40,Vt=200;function U(t,o,i){return Math.min(i,Math.max(o,t))}function Kt(t){if(!(t instanceof HTMLElement))return!1;const o=t.tagName.toLowerCase();return t.isContentEditable||o==="input"||o==="textarea"||o==="select"}function qt(){const[t,o]=n.useState({x:0,y:0}),[i,d]=n.useState(1),[u,s]=n.useState(!1),f=n.useRef(t),h=n.useRef(i),C=n.useRef(null),M=n.useRef(null),y=n.useRef(new Map),S=n.useRef(null),c=n.useRef({minX:0,minY:0,maxX:0,maxY:0});n.useEffect(()=>{f.current=t},[t]),n.useEffect(()=>{h.current=i},[i]),n.useEffect(()=>()=>{C.current!==null&&window.clearTimeout(C.current)},[]);const l=n.useMemo(()=>`translate(${t.x}px, ${t.y}px) scale(${i})`,[t.x,t.y,i]),I=n.useMemo(()=>Math.round(i*100),[i]),x=n.useCallback(r=>{if(!r){C.current!==null&&(window.clearTimeout(C.current),C.current=null),s(!1);return}s(!0),C.current!==null&&window.clearTimeout(C.current),C.current=window.setTimeout(()=>{s(!1),C.current=null},Vt)},[]),z=n.useCallback((r,p,m,k=h.current)=>{const P=c.current;if(P.maxX<=P.minX||P.maxY<=P.minY)return{x:U(r.x,-p,p),y:U(r.y,-m,m)};const O=p-P.maxX*k,b=-P.minX*k,R=m-P.maxY*k,Y=-P.minY*k,J=O>b?(O+b)/2:U(r.x,O,b),B=R>Y?(R+Y)/2:U(r.y,R,Y);return{x:J,y:B}},[]),N=n.useCallback((r,p,m,k)=>{const P=h.current,O=f.current,b=U(r,st,at),R=b/P,Y=z({x:p.x-(p.x-O.x)*R,y:p.y-(p.y-O.y)*R},m,k,b);d(b),o(Y)},[z]),a=n.useCallback((r,p,m,k)=>{x(!1);const P=k??{x:p/2,y:m/2};N(h.current*r,P,p,m)},[x,N]),D=n.useCallback((r,p)=>{if(r&&p){a(1.2,r,p);return}d(m=>U(m+.1,st,at))},[a]),$=n.useCallback((r,p)=>{if(r&&p){a(1/1.2,r,p);return}d(m=>U(m-.1,st,at))},[a]),H=n.useCallback(()=>{x(!0),o({x:0,y:0}),d(1)},[x]),_=n.useCallback((r,p,m,k)=>{if(x(!0),r.size===0){o({x:0,y:0}),d(1);return}const P=k?.nodeWidth??280,O=k?.nodeHeight??100,b=Array.from(r.values()),R=Math.min(...b.map(W=>W.x)),Y=Math.min(...b.map(W=>W.y)),J=Math.max(...b.map(W=>W.x+P)),B=Math.max(...b.map(W=>W.y+O)),V=Math.max(1,J-R),Q=Math.max(1,B-Y),nt=Math.max(1,p-kt*2),lt=Math.max(1,m-kt*2),K=U(Math.min(nt/V,lt/Q),st,at),ot=(p-V*K)/2-R*K,dt=(m-Q*K)/2-Y*K;d(K),o(z({x:ot,y:dt},p,m,K))},[z,x]),v=n.useCallback((r,p)=>{if(y.current.set(r,p),y.current.size===2){const[m,k]=Array.from(y.current.values());S.current={distance:Math.hypot(m.x-k.x,m.y-k.y),zoom:h.current,pan:f.current,midpoint:{x:(m.x+k.x)/2,y:(m.y+k.y)/2}},M.current=null;return}M.current={start:p,panStart:f.current}},[]),tt=n.useCallback((r,p,m,k)=>{if(y.current.has(r)&&y.current.set(r,p),y.current.size===2&&S.current){x(!1);const[b,R]=Array.from(y.current.values()),J=Math.hypot(b.x-R.x,b.y-R.y)/Math.max(1,S.current.distance),B={x:(b.x+R.x)/2,y:(b.y+R.y)/2},V=U(S.current.zoom*J,st,at),Q=V/S.current.zoom,nt=z({x:B.x-(S.current.midpoint.x-S.current.pan.x)*Q,y:B.y-(S.current.midpoint.y-S.current.pan.y)*Q},m,k);d(V),o(nt);return}const P=M.current;if(!P)return;x(!1);const O={x:P.panStart.x+(p.x-P.start.x),y:P.panStart.y+(p.y-P.start.y)};o(z(O,m,k))},[z,x]),j=n.useCallback(r=>{if(y.current.delete(r),y.current.size<2&&(S.current=null),y.current.size===1){const[p]=Array.from(y.current.values());M.current={start:p,panStart:f.current};return}y.current.size===0&&(M.current=null)},[]),G=n.useCallback((r,p,m,k)=>{const P=r<0?1.1:.9;x(!1),N(h.current*P,p,m,k)},[x,N]),it=n.useCallback(r=>{c.current=r},[]),et=n.useCallback((r,p,m,k,P)=>{if(Kt(r.target))return;const O=r.metaKey||r.ctrlKey;if(r.key==="Escape"){r.preventDefault(),H();return}if(O){if(r.key==="="||r.key==="+"){r.preventDefault(),a(1.2,p,m);return}if(r.key==="-"){r.preventDefault(),a(1/1.2,p,m);return}if(r.key==="0"){r.preventDefault(),H();return}(r.key==="f"||r.key==="F")&&r.shiftKey&&(r.preventDefault(),_(k,p,m,P))}},[_,H,a]);return{pan:t,zoom:i,zoomPercent:I,transform:l,transitioning:u,zoomIn:D,zoomOut:$,resetView:H,fitToGraph:_,setAnimate:x,onPointerDown:v,onPointerMove:tt,onPointerUp:j,onWheelZoom:G,handleKeyDown:et,setGraphBounds:it}}function Jt(t){const{upstreamMap:o,downstreamMap:i}=n.useMemo(()=>{const u=new Map,s=new Map;for(const f of t)u.set(f.id,new Set(f.dependencies??[])),s.has(f.id)||s.set(f.id,new Set);for(const f of t)for(const h of f.dependencies??[])s.has(h)||s.set(h,new Set),s.get(h)?.add(f.id);return{upstreamMap:u,downstreamMap:s}},[t]);return{getChain:n.useCallback(u=>{if(!o.has(u)&&!i.has(u))return new Set;const s=new Set([u]),f=(h,C)=>{const M=[h],y=new Set([h]);for(;M.length>0;){const S=M.shift();if(!S)continue;const c=C.get(S);if(c)for(const l of c)y.has(l)||(y.add(l),s.add(l),M.push(l))}};return f(u,o),f(u,i),s},[i,o])}}const ht="fusion-plugin-dependency-graph:positions";function ct(t){if(!t||typeof t!="object")return!1;const o=t;return typeof o.x=="number"&&Number.isFinite(o.x)&&typeof o.y=="number"&&Number.isFinite(o.y)}function Qt(t){const o=Dt(ht,t);if(!o)return{};try{const i=JSON.parse(o);if(!i||typeof i!="object")return{};const d={};for(const[u,s]of Object.entries(i))ct(s)&&(d[u]=s);return d}catch{return{}}}function te(t,o,i){const d={};for(const[u,s]of Object.entries(t))o.has(u)&&ct(s)&&(d[u]=s);Tt(ht,JSON.stringify(d),i)}function ee(t){It(ht,t)}function ne(t,o,i){const d={};for(const[u,s]of Object.entries(t))i.has(u)&&ct(s)&&(d[u]=s);for(const[u,s]of Object.entries(o))i.has(u)&&ct(s)&&(d[u]=s);return d}function oe(t,o){const i={};for(const[d,u]of Object.entries(t))o.has(d)&&(i[d]=u);return i}function re({projectId:t,visibleTaskIds:o}){const[i,d]=n.useState(null);n.useEffect(()=>{d(Qt(t))},[t]);const u=n.useCallback(f=>{te(f,o,t),d(oe(f,o))},[t,o]),s=n.useCallback(()=>{ee(t),d(null)},[t]);return{savedPositions:i,persistPositions:u,clearSavedPositions:s}}const q=280,Z=100,Mt=4;function se({tasks:t,projectId:o,onOpenTaskDetail:i,onOpenDetail:d,addToast:u,globalPaused:s,onUpdateTask:f,onArchiveTask:h,onUnarchiveTask:C,onDeleteTask:M,onRetryTask:y,onOpenDetailWithTab:S,taskStuckTimeoutMs:c,onOpenMission:l,onMoveTask:I,lastFetchTimeMs:x,workflowStepNameLookup:z}){const N=n.useRef(null),a=n.useRef(!1),D=n.useRef(null),$=n.useRef(!1),[H,_]=n.useState(null),[v,tt]=n.useState(null),j=n.useMemo(()=>Ut(t),[t]),G=Bt(j),{getChain:it}=Jt(j),et=H??v,r=n.useMemo(()=>et?it(et):new Set,[et,it]),p=n.useMemo(()=>ft(G,{nodeWidth:q,nodeHeight:Z,horizontalGap:40,verticalGap:80}),[G]),m=n.useMemo(()=>new Set(j.map(e=>e.id)),[j]),{savedPositions:k,persistPositions:P,clearSavedPositions:O}=re({projectId:o,visibleTaskIds:m}),[b,R]=n.useState(p),[Y,J]=n.useState(!1);n.useEffect(()=>{const e={};for(const[T,E]of p.entries())e[T]=E;const g=k?ne(e,k,m):e;R(new Map(Object.entries(g)))},[p,k,m]);const{transform:B,zoom:V,transitioning:Q,zoomIn:nt,zoomOut:lt,resetView:K,fitToGraph:ot,onPointerDown:dt,onPointerMove:W,onPointerUp:mt,onWheelZoom:bt,handleKeyDown:Pt,setGraphBounds:gt}=qt();n.useEffect(()=>{if(a.current||j.length===0)return;if(!!(k&&Object.keys(k).length>0)){a.current=!0;return}const g=N.current;g&&(ot(b,g.clientWidth,g.clientHeight,{nodeWidth:q,nodeHeight:Z}),a.current=!0)},[j.length,ot,b,k]);const A=n.useMemo(()=>{const e=Array.from(b.values());if(e.length===0)return{minX:0,minY:0,maxX:0,maxY:0,width:0,height:0};const g=Math.min(...e.map(X=>X.x)),T=Math.min(...e.map(X=>X.y)),E=Math.max(...e.map(X=>X.x+q)),L=Math.max(...e.map(X=>X.y+Z));return{minX:g,minY:T,maxX:E,maxY:L,width:Math.max(0,E-g),height:Math.max(0,L-T)}},[b]),pt=n.useMemo(()=>{if(b.size===0)return b;const e=new Map;for(const[g,T]of b.entries())e.set(g,{x:T.x-A.minX,y:T.y-A.minY});return e},[A.minX,A.minY,b]);n.useEffect(()=>{gt({minX:0,minY:0,maxX:A.width,maxY:A.height})},[A.height,A.width,gt]);const yt=n.useCallback(()=>{O();const e=ft(G,{nodeWidth:q,nodeHeight:Z,horizontalGap:40,verticalGap:80});R(e)},[O,G]),wt=n.useCallback(()=>{const e={};for(const[g,T]of b.entries())e[g]=T;P(e)},[P,b]);return w.jsxs("section",{className:"dependency-graph","data-testid":"dependency-graph",children:[w.jsx("div",{ref:N,className:"dependency-graph__viewport",onPointerDown:e=>{Y||(D.current={x:e.clientX,y:e.clientY},$.current=!1,dt(e.pointerId,{x:e.clientX,y:e.clientY}))},onPointerMove:e=>{if(Y)return;const g=N.current;if(!g)return;const T=D.current;if(T){const E=Math.abs(e.clientX-T.x),L=Math.abs(e.clientY-T.y);(E>Mt||L>Mt)&&($.current=!0)}W(e.pointerId,{x:e.clientX,y:e.clientY},g.clientWidth,g.clientHeight)},onPointerUp:e=>{Y||mt(e.pointerId),D.current=null},onPointerCancel:e=>{Y||mt(e.pointerId),D.current=null,$.current=!1},onWheel:e=>{e.preventDefault();const g=N.current;if(!g)return;const T=g.getBoundingClientRect();bt(e.deltaY,{x:e.clientX-T.left,y:e.clientY-T.top},g.clientWidth,g.clientHeight)},onKeyDown:e=>{const g=N.current;g&&Pt(e,g.clientWidth,g.clientHeight,pt,{nodeWidth:q,nodeHeight:Z})},tabIndex:0,onClick:()=>{$.current||Y||tt(null)},children:j.length===0?w.jsx("div",{className:"dependency-graph__empty",children:"No active tasks to display in graph view."}):w.jsxs("div",{className:`graph-canvas-transform${Q?" graph-canvas-transform--animate":""}`,style:{transform:B,width:`${A.width}px`,height:`${A.height}px`},children:[w.jsx(Wt,{edges:G.edges,positions:pt,nodeWidth:q,nodeHeight:Z,highlightedEdgeIds:r.size>0?new Set(G.edges.filter(e=>r.has(e.source)&&r.has(e.target)).map(e=>`${e.source}->${e.target}`)):void 0}),w.jsx("div",{className:"dependency-graph__nodes-layer",children:G.nodes.map(e=>{const g=pt.get(e.task.id);return g?w.jsx(jt,{task:e.task,projectId:o,isSelected:v===e.task.id,style:{minHeight:`${Z}px`,left:`${g.x}px`,top:`${g.y}px`},position:g,scale:V,onNodePositionChange:(T,E)=>{R(L=>{const X={x:E.x+A.minX,y:E.y+A.minY},F=L.get(T);if(F&&F.x===X.x&&F.y===X.y)return L;const rt=new Map(L);return rt.set(T,X),rt})},onNodeDragStateChange:J,onNodeDragEnd:wt,isHighlighted:r.size>0&&r.has(e.task.id),isDimmed:r.size>0&&!r.has(e.task.id),onOpenDetail:d??(T=>i?.(T.id)),addToast:u??(()=>{}),globalPaused:s,onUpdateTask:f,onArchiveTask:h,onUnarchiveTask:C,onDeleteTask:M,onRetryTask:y,onOpenDetailWithTab:S,taskStuckTimeoutMs:c,onOpenMission:l,onMoveTask:I,lastFetchTimeMs:x,workflowStepNameLookup:z,onMouseEnter:()=>_(e.task.id),onMouseLeave:()=>_(null),onClick:T=>{T.stopPropagation(),$.current=!1,tt(E=>E===e.task.id?null:e.task.id)}},e.task.id):null})})]})}),w.jsx(Ht,{zoom:V,onZoomIn:()=>{const e=N.current;e&&nt(e.clientWidth,e.clientHeight)},onZoomOut:()=>{const e=N.current;e&<(e.clientWidth,e.clientHeight)},onFitToGraph:()=>{yt();const e=N.current;if(!e)return;const g=ft(G,{nodeWidth:q,nodeHeight:Z,horizontalGap:40,verticalGap:80}),T=new Map,E=Array.from(g.values()),L=E.length>0?Math.min(...E.map(F=>F.x)):0,X=E.length>0?Math.min(...E.map(F=>F.y)):0;for(const[F,rt]of g.entries())T.set(F,{x:rt.x-L,y:rt.y-X});ot(T,e.clientWidth,e.clientHeight,{nodeWidth:q,nodeHeight:Z})},onResetView:()=>{yt(),K()}})]})}function ae(t){return new Map((t??[]).map(o=>[o.id,o.name]))}function de({context:t}){return n.createElement(se,{tasks:t?.tasks??[],projectId:t?.projectId,workflowStepNameLookup:ae(t?.workflowSteps),onOpenDetail:t?.openTaskDetail})}export{se as DependencyGraph,de as DependencyGraphDashboardView,de as default};
|