@runfusion/fusion 0.74.0-beta.3 → 0.74.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/dist/bin.js +4704 -2607
  2. package/dist/child-process-worker.js +3160 -1449
  3. package/dist/client/.vite/manifest.json +265 -265
  4. package/dist/client/assets/AgentDetailView-CH11Ydji.css +1 -0
  5. package/dist/client/assets/AgentDetailView-GYleZQ4I.js +13 -0
  6. package/dist/client/assets/{AgentPermissionPolicyEditor-BBAwprvO.js → AgentPermissionPolicyEditor-pJIXpqOG.js} +1 -1
  7. package/dist/client/assets/AgentsView-C9uiOLPs.js +24 -0
  8. package/dist/client/assets/{ChatView-CRoW2tRJ.js → ChatView-B7_4jt9R.js} +3 -3
  9. package/dist/client/assets/CommandCenter-gGvdPmZx.js +97 -0
  10. package/dist/client/assets/DevServerView-CL7axVX8.js +1 -0
  11. package/dist/client/assets/{DirectoryPicker-B-olNAvT.js → DirectoryPicker-mm9__9xY.js} +1 -1
  12. package/dist/client/assets/{DocumentsView-CG_-pnXU.js → DocumentsView-DKSB8mQI.js} +1 -1
  13. package/dist/client/assets/EvalsView-CtwfGg6y.js +1 -0
  14. package/dist/client/assets/{ExperimentalAgentOnboardingModal-z8m5V5yv.js → ExperimentalAgentOnboardingModal-DGjpLPWm.js} +1 -1
  15. package/dist/client/assets/{GoalsView-Bd-4g949.js → GoalsView-CUtFV16M.js} +1 -1
  16. package/dist/client/assets/{InsightsView-tCgg66wJ.js → InsightsView-Bt4n-gFZ.js} +1 -1
  17. package/dist/client/assets/{MemoryView-Dqgsd_0E.js → MemoryView-0p84QjWE.js} +1 -1
  18. package/dist/client/assets/{PiExtensionsManager-GzGoWgb5.js → PiExtensionsManager-CwnPvrvv.js} +1 -1
  19. package/dist/client/assets/{PluginManager-BWdqEqr9.js → PluginManager-D7scUBUh.js} +1 -1
  20. package/dist/client/assets/{PullRequestView-CQq1G1kY.js → PullRequestView-op1QyrvF.js} +2 -2
  21. package/dist/client/assets/{ReportModal-C-3rBFhw.js → ReportModal-Cixa37L8.js} +1 -1
  22. package/dist/client/assets/ResearchView-48hx_Nnj.js +2 -0
  23. package/dist/client/assets/{SecretsView-C6RP9Rkw.js → SecretsView-CpIDlLXB.js} +1 -1
  24. package/dist/client/assets/SessionTerminal-BlrHptKP.js +2 -0
  25. package/dist/client/assets/{SettingsModal-D3DCvCfP.js → SettingsModal-BN4z8V64.js} +1 -1
  26. package/dist/client/assets/SettingsModal-CYhXaN9Q.js +21 -0
  27. package/dist/client/assets/SettingsModal-DmfMotcd.css +1 -0
  28. package/dist/client/assets/{SettingsTextareaRow-zBVXQbcC.js → SettingsTextareaRow-DbbwaFZB.js} +1 -1
  29. package/dist/client/assets/{SetupWizardModal-C9r1dd-h.js → SetupWizardModal-sX6F_tuR.js} +2 -2
  30. package/dist/client/assets/{SkillsView-DFyUBWd8.js → SkillsView-BNQIeoyG.js} +1 -1
  31. package/dist/client/assets/{TodoView-BC8f952m.js → TodoView-Bu4UuFO2.js} +1 -1
  32. package/dist/client/assets/{WorkflowNodeEditor-UTX757WH.js → WorkflowNodeEditor-BVTqe9-2.js} +3 -3
  33. package/dist/client/assets/{WorkflowNodeEditor-nCx4nqoL.css → WorkflowNodeEditor-sZ96V3Kd.css} +1 -1
  34. package/dist/client/assets/{agent-import-generation-DN0q1xEo.js → agent-import-generation-ChGufJzG.js} +1 -1
  35. package/dist/client/assets/{app-sLOwmHAE.js → app-BYs5Cx-j.js} +1 -1
  36. package/dist/client/assets/{app-niWDkeV8.js → app-CTV8PCYh.js} +1 -1
  37. package/dist/client/assets/{app-BP57l_5h.js → app-CwdZxrJI.js} +1 -1
  38. package/dist/client/assets/{app-D4frL0Ka.js → app-DE-MPJxA.js} +1 -1
  39. package/dist/client/assets/{app-zPyey_fg.js → app-e8c4wb5t.js} +1 -1
  40. package/dist/client/assets/{app-vRWwM-aD.js → app-yKugq_Ld.js} +1 -1
  41. package/dist/client/assets/{architectureDiagram-3BPJPVTR-D-nqJ95-.js → architectureDiagram-3BPJPVTR-Cl5gNo7p.js} +1 -1
  42. package/dist/client/assets/{blockDiagram-GPEHLZMM--OlkXlyS.js → blockDiagram-GPEHLZMM-B3E7DFJJ.js} +1 -1
  43. package/dist/client/assets/{c4Diagram-AAUBKEIU-CH7PaWgs.js → c4Diagram-AAUBKEIU-Bj_ZPoFn.js} +1 -1
  44. package/dist/client/assets/channel-Cm54mhSQ.js +1 -0
  45. package/dist/client/assets/{chunk-2J33WTMH-CpHDwqg2.js → chunk-2J33WTMH-B0P5K-xu.js} +1 -1
  46. package/dist/client/assets/{chunk-4BX2VUAB-BdW4tdnc.js → chunk-4BX2VUAB-CEu45ByZ.js} +1 -1
  47. package/dist/client/assets/{chunk-55IACEB6-b3tBFiuH.js → chunk-55IACEB6-Cr6VuM7S.js} +1 -1
  48. package/dist/client/assets/{chunk-727SXJPM-DifknEtv.js → chunk-727SXJPM-D3Hy6AmL.js} +1 -1
  49. package/dist/client/assets/{chunk-AQP2D5EJ-DHIZNZ4Z.js → chunk-AQP2D5EJ-CuVcS6BO.js} +1 -1
  50. package/dist/client/assets/{chunk-FMBD7UC4-BLRLYW2y.js → chunk-FMBD7UC4-Q_8Erd5R.js} +1 -1
  51. package/dist/client/assets/{chunk-ND2GUHAM-Dh8f06Ld.js → chunk-ND2GUHAM-fUBj411G.js} +1 -1
  52. package/dist/client/assets/{chunk-QZHKN3VN-CpzUiemt.js → chunk-QZHKN3VN-CzAtr8Ei.js} +1 -1
  53. package/dist/client/assets/classDiagram-4FO5ZUOK-BiGEx_wa.js +1 -0
  54. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-BiGEx_wa.js +1 -0
  55. package/dist/client/assets/{cose-bilkent-S5V4N54A-CE2RJ_k0.js → cose-bilkent-S5V4N54A-KF3Fhd8n.js} +1 -1
  56. package/dist/client/assets/{dagre-BM42HDAG-CCs_xlYw.js → dagre-BM42HDAG-DG7Zy0Tp.js} +1 -1
  57. package/dist/client/assets/{dashboard-view-D5qv61fP.js → dashboard-view-7fNoNaKi.js} +1 -1
  58. package/dist/client/assets/{dashboard-view-Z6H-k0uR.js → dashboard-view-BWLS6upM.js} +1 -1
  59. package/dist/client/assets/{dashboard-view-Eg7Jyvnm.js → dashboard-view-Br-VgdfF.js} +1 -1
  60. package/dist/client/assets/{diagram-2AECGRRQ-CF60Q-de.js → diagram-2AECGRRQ-5JY32FOH.js} +1 -1
  61. package/dist/client/assets/{diagram-5GNKFQAL-DDcGMlua.js → diagram-5GNKFQAL-DCAL8s3z.js} +1 -1
  62. package/dist/client/assets/{diagram-KO2AKTUF-YgvJ4DQf.js → diagram-KO2AKTUF-C-Gl3KqY.js} +1 -1
  63. package/dist/client/assets/{diagram-LMA3HP47-Bi-j9nGw.js → diagram-LMA3HP47-56_y6YB_.js} +1 -1
  64. package/dist/client/assets/{diagram-OG6HWLK6-DEmMqnwc.js → diagram-OG6HWLK6-7XM6PUCA.js} +1 -1
  65. package/dist/client/assets/{erDiagram-TEJ5UH35-DwmZwhiW.js → erDiagram-TEJ5UH35-fkpo67d9.js} +1 -1
  66. package/dist/client/assets/{flowDiagram-I6XJVG4X-B5ITa_HJ.js → flowDiagram-I6XJVG4X-CjkKXpvy.js} +1 -1
  67. package/dist/client/assets/{folder-open-BVxA7YtM.js → folder-open-B0zT7pjM.js} +1 -1
  68. package/dist/client/assets/{ganttDiagram-6RSMTGT7-BgAPwh9w.js → ganttDiagram-6RSMTGT7-DCxj33Ce.js} +1 -1
  69. package/dist/client/assets/{gitGraphDiagram-PVQCEYII-DTtGzZFj.js → gitGraphDiagram-PVQCEYII-D0XYFbBv.js} +1 -1
  70. package/dist/client/assets/index-Bp3UBLOz.css +1 -0
  71. package/dist/client/assets/index-Ck-7DP8n.js +2675 -0
  72. package/dist/client/assets/{infoDiagram-5YYISTIA-CkSnTje1.js → infoDiagram-5YYISTIA-ICfcKKPN.js} +1 -1
  73. package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-jn5VNpMh.js → ishikawaDiagram-YF4QCWOH-B5fIfqcH.js} +1 -1
  74. package/dist/client/assets/{journeyDiagram-JHISSGLW-BpaqoXaI.js → journeyDiagram-JHISSGLW-DurQl3Lk.js} +1 -1
  75. package/dist/client/assets/{kanban-definition-UN3LZRKU-CpfjJoBN.js → kanban-definition-UN3LZRKU-Dc-aAsvK.js} +1 -1
  76. package/dist/client/assets/{mermaid.core-DZNGPQzF.js → mermaid.core-ZpeafUdD.js} +4 -4
  77. package/dist/client/assets/{mindmap-definition-RKZ34NQL-BdbX1EJa.js → mindmap-definition-RKZ34NQL-qc5mxYep.js} +1 -1
  78. package/dist/client/assets/{pieDiagram-4H26LBE5-Xn0322tJ.js → pieDiagram-4H26LBE5-BeBCrwxa.js} +1 -1
  79. package/dist/client/assets/{puzzle-CPx1RP2g.js → puzzle-DoN20Wf8.js} +1 -1
  80. package/dist/client/assets/{quadrantDiagram-W4KKPZXB-OOHqqw5y.js → quadrantDiagram-W4KKPZXB-BAOR__9f.js} +1 -1
  81. package/dist/client/assets/{requirementDiagram-4Y6WPE33-Dvj6zvaB.js → requirementDiagram-4Y6WPE33-xztcPYl8.js} +1 -1
  82. package/dist/client/assets/{sankeyDiagram-5OEKKPKP-DEkEqthK.js → sankeyDiagram-5OEKKPKP-BYnQyDFr.js} +1 -1
  83. package/dist/client/assets/{sequenceDiagram-3UESZ5HK-BPc9ncPj.js → sequenceDiagram-3UESZ5HK-2xXQOg29.js} +1 -1
  84. package/dist/client/assets/{shield-alert-baoKRyU6.js → shield-alert-B5s2Ap6u.js} +1 -1
  85. package/dist/client/assets/{standing-instructions-template-CkqsGC1L.js → standing-instructions-template-CWOJ5vao.js} +1 -1
  86. package/dist/client/assets/{stateDiagram-AJRCARHV-DywhjHIx.js → stateDiagram-AJRCARHV-BnpAA816.js} +1 -1
  87. package/dist/client/assets/{stateDiagram-v2-BHNVJYJU-D7t7x4uT.js → stateDiagram-v2-BHNVJYJU-CRCjYzah.js} +1 -1
  88. package/dist/client/assets/{timeline-definition-PNZ67QCA-BH3CKgrg.js → timeline-definition-PNZ67QCA-rjWi6Lwp.js} +1 -1
  89. package/dist/client/assets/{upload-DtIvOGwM.js → upload-BZmWcUph.js} +1 -1
  90. package/dist/client/assets/{users-DcxsxPlj.js → users-cNoQdJGl.js} +1 -1
  91. package/dist/client/assets/{vennDiagram-CIIHVFJN-CCDllBgJ.js → vennDiagram-CIIHVFJN-Dz0AdEKB.js} +1 -1
  92. package/dist/client/assets/{wardley-L42UT6IY-C43hFLXh.js → wardley-L42UT6IY-Boky1mhD.js} +1 -1
  93. package/dist/client/assets/{wardleyDiagram-YWT4CUSO-__f9rI8w.js → wardleyDiagram-YWT4CUSO-C5edajak.js} +1 -1
  94. package/dist/client/assets/{xychartDiagram-2RQKCTM6-DY-fpQ_x.js → xychartDiagram-2RQKCTM6-cVjJqGUH.js} +1 -1
  95. package/dist/client/index.html +2 -2
  96. package/dist/client/sw.js +633 -13
  97. package/dist/client/version.json +1 -1
  98. package/dist/extension.js +3501 -1683
  99. package/package.json +1 -1
  100. package/dist/client/assets/AgentDetailView-CoeSgMXS.css +0 -1
  101. package/dist/client/assets/AgentDetailView-D0J_GDct.js +0 -13
  102. package/dist/client/assets/AgentsView-DTY5DIav.js +0 -24
  103. package/dist/client/assets/CommandCenter-BieyKvKb.js +0 -97
  104. package/dist/client/assets/DevServerView-CLR1LmhK.js +0 -1
  105. package/dist/client/assets/EvalsView-Xp0zCUlr.js +0 -1
  106. package/dist/client/assets/ResearchView-CS1HwDg_.js +0 -2
  107. package/dist/client/assets/SessionTerminal-C9nCSefk.js +0 -2
  108. package/dist/client/assets/SettingsModal-C1oEklYy.css +0 -1
  109. package/dist/client/assets/SettingsModal-D4mjT8hw.js +0 -21
  110. package/dist/client/assets/channel-FJNMzlkv.js +0 -1
  111. package/dist/client/assets/classDiagram-4FO5ZUOK-BOenhjVP.js +0 -1
  112. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-BOenhjVP.js +0 -1
  113. package/dist/client/assets/index-Dv-95s50.css +0 -1
  114. package/dist/client/assets/index-idkERMsE.js +0 -2671
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-xterm-BNq00GSj.js","assets/vendor-react-SZ_qB27O.js","assets/vendor-xterm-LZoznX6r.css","assets/addon-fit-C1WQXRvu.js","assets/addon-unicode11-BVmNDUBM.js","assets/addon-webgl-uLc0RKcC.js"])))=>i.map(i=>d[i]);
2
+ import{J as xe,K as z,N as ce,O as J,Q as de,U as I,W as Ne,Y as Re,p as Pe,_ as je,$ as Y,a0 as Me,a1 as Le,a as De,a2 as K,a3 as Oe,a4 as Ae}from"./index-Ck-7DP8n.js";import{r as n,j as t}from"./vendor-react-SZ_qB27O.js";import"./vendor-xterm-BNq00GSj.js";import{u as ze}from"./vendor-i18n-GF3RlKbq.js";import{S as Be}from"./shield-alert-B5s2Ap6u.js";import"./vendor-codemirror-jBKmHyH0.js";import"./vendor-reactflow-9C3XTE7_.js";const Fe=32*1024,Ie=1e4,Ke=100,We="\x1B",$e=" ",Ue="",Qe="\x1B[A",Ve="\x1B[B",Je="\x1B[C",Ye="\x1B[D",W={ctrl:"Ctrl",escape:"Esc",tab:"Tab",ctrlC:"^C"};function ue(m){if(m.length!==1)return null;const o=m.toUpperCase().charCodeAt(0);return o>=64&&o<=95?String.fromCharCode(o&31):null}function He(){const[m,f]=n.useState(()=>Y());return n.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const o=window.matchMedia(Me),a=window.visualViewport,y=()=>f(Y());return y(),typeof a?.addEventListener=="function"&&a.addEventListener("resize",y),typeof o.addEventListener=="function"?(o.addEventListener("change",y),()=>{o.removeEventListener("change",y),typeof a?.removeEventListener=="function"&&a.removeEventListener("resize",y)}):(o.addListener(y),()=>{o.removeListener(y),typeof a?.removeEventListener=="function"&&a.removeEventListener("resize",y)})},[]),m}function Ge(m,f){if(typeof window>"u")return"";const a=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/cli-sessions/ws?sessionId=${encodeURIComponent(m)}&ticket=${encodeURIComponent(f)}`;return Ae(a)}function qe(){return/Mac|iPhone|iPad|iPod/i.test(navigator.platform)}function Ze(m){if(typeof window<"u"&&typeof window.atob=="function"){const f=window.atob(m),o=new Uint8Array(f.length);for(let a=0;a<f.length;a++)o[a]=f.charCodeAt(a);return new TextDecoder("utf-8").decode(o)}return Buffer.from(m,"base64").toString("utf8")}function lt({sessionId:m,readOnly:f=!1,posture:o,mode:a="live",projectId:y,onConfirmAdvance:E,showConfirmAdvance:$=!1,onOpenAdapterSettings:H}){const{t:r}=ze("app"),C=n.useRef(null),T=n.useRef(null),M=n.useRef(null),g=n.useRef(null),S=n.useRef(null),[G,q]=n.useState(!1),[me,U]=n.useState(!1),[Z,X]=n.useState(!1),x=He(),{keyboardOpen:B,keyboardOverlap:fe}=xe({enabled:x}),pe=n.useRef(null),[_,ee]=n.useState(""),[N,L]=n.useState(!1),[ye,be]=n.useState(()=>z().customShortcuts),[te,ne]=n.useState(null),ie=f||te===!0,D=!f&&te===!1&&a==="live",b=n.useCallback(e=>{if(!e||!D)return;const i=S.current;i?.readyState===WebSocket.OPEN&&i.send(JSON.stringify({type:"input",data:e}))},[D]),R=n.useCallback(e=>{if(N){const i=ue(e);if(L(!1),i){b(i);return}}b(e)},[N,b]),l=n.useCallback(e=>{e.preventDefault()},[]),he=n.useCallback(e=>{e?.preventDefault?.(),_&&b(_),b("\r"),ee("")},[_,b]),we=n.useCallback(e=>{if(N&&e.length>_.length){const i=e.slice(_.length,_.length+1),d=ue(i);if(L(!1),d){b(d);return}}ee(e)},[N,_,b]);n.useEffect(()=>{$&&U(!1)},[$,m]);const O=n.useCallback((e,i)=>{const d=S.current;d?.readyState===WebSocket.OPEN&&d.send(JSON.stringify({type:"resize",cols:e,rows:i}))},[]),se=n.useCallback(()=>{const e=T.current;if(!e)return;const i=z(),d=ce(i.fontFamily);e.options.fontFamily=d,C.current?.style.setProperty("--terminal-glyph-font-family",J(i.fontFamily)),e.options.fontSize=i.fontSize,e.options.cursorStyle=i.cursorStyle,e.options.cursorBlink=i.cursorBlink&&D;try{M.current?.fit?.(),O(e.cols,e.rows)}catch{}de(i.fontSize,d).then(P=>{if(!(!P||T.current!==e||e.options.fontSize!==i.fontSize||e.options.fontFamily!==d)){I(e,d),e.options.fontSize=i.fontSize;try{M.current?.fit?.(),O(e.cols,e.rows),I(e,d),e.refresh(0,Math.max(0,e.rows-1))}catch{}}},()=>{})},[D,O]);n.useEffect(()=>{if(typeof window>"u")return;const e=i=>{i.key===Le&&(se(),be(z().customShortcuts))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[se]),n.useEffect(()=>{if(!m||typeof window>"u")return;let e=!1,i=null,d=null,P=0;ne(null);const Q=O,ve=p=>{if(P+=p,P<Fe)return;const h=S.current;h?.readyState===WebSocket.OPEN&&h.send(JSON.stringify({type:"ack",bytes:P})),P=0};return(async()=>{let p;try{p=await De(`/cli-sessions/${encodeURIComponent(m)}/attach-ticket`,{method:"POST",body:JSON.stringify(y?{projectId:y}:{})})}catch{return}if(e)return;ne(p.readOnly);const h=!f&&!p.readOnly&&a==="live",[{Terminal:Ee},{FitAddon:Ce},{Unicode11Addon:Te}]=await Promise.all([K(()=>import("./vendor-xterm-BNq00GSj.js").then(c=>c.x),__vite__mapDeps([0,1,2])),K(()=>import("./addon-fit-C1WQXRvu.js").then(c=>c.a),__vite__mapDeps([3,1])),K(()=>import("./addon-unicode11-BVmNDUBM.js").then(c=>c.a),__vite__mapDeps([4,1]))]);if(e||!C.current)return;const w=z(),A=ce(w.fontFamily);C.current.style.setProperty("--terminal-glyph-font-family",J(w.fontFamily));const s=new Ee({convertEol:!1,cursorBlink:w.cursorBlink&&h,cursorStyle:w.cursorStyle,disableStdin:!h,scrollback:Ie,fontFamily:A,fontSize:w.fontSize}),j=new Ce;s.loadAddon(j);const ge=new Te;if(s.loadAddon(ge),s.unicode.activeVersion="11",Oe(()=>{s.open(C.current)}),T.current=s,M.current=j,w.renderer==="auto"&&!Y())try{const{WebglAddon:c}=await K(async()=>{const{WebglAddon:u}=await import("./addon-webgl-uLc0RKcC.js").then(k=>k.a);return{WebglAddon:u}},__vite__mapDeps([5,1]));if(!e){const u=new c;u.onContextLoss(()=>{try{u.dispose()}catch{}g.current===u&&(g.current=null)}),s.loadAddon(u),g.current=u}}catch{}try{j.fit()}catch{}(async()=>{if(!(!await de(w.fontSize,A)||e||T.current!==s||M.current!==j||s.options.fontSize!==w.fontSize||s.options.fontFamily!==A))try{I(s,A),s.options.fontSize=w.fontSize,j.fit(),Q(s.cols,s.rows),I(s,A),s.refresh(0,Math.max(0,s.rows-1))}catch{}})(),h&&(s.onData(c=>{const u=S.current;u?.readyState===WebSocket.OPEN&&u.send(JSON.stringify({type:"input",data:c}))}),s.attachCustomKeyEventHandler(c=>{if(c.type!=="keydown"||!(qe()?c.metaKey:c.ctrlKey)||c.altKey||c.shiftKey)return!0;const k=c.key.toLowerCase();if(k==="c"){const v=s.hasSelection()?s.getSelection():"";return v?(navigator.clipboard?.writeText(v).catch(()=>{}),!1):!0}if(k==="v"){const v=navigator.clipboard?.readText;return v&&v.call(navigator.clipboard).then(re=>{if(!re)return;const le=S.current;le?.readyState===WebSocket.OPEN&&le.send(JSON.stringify({type:"input",data:re}))}).catch(()=>{}),!1}return!0})),i=new ResizeObserver(()=>{d&&clearTimeout(d),d=setTimeout(()=>{try{j.fit(),Q(s.cols,s.rows),s.refresh(0,Math.max(0,s.rows-1))}catch{}},Ke)}),i.observe(C.current);const V=new WebSocket(Ge(m,p.ticket));S.current=V,V.onopen=()=>{Q(s.cols,s.rows)},V.onmessage=c=>{let u;try{u=JSON.parse(typeof c.data=="string"?c.data:"")}catch{return}switch(u.type){case"scrollback":case"data":{if(typeof u.data!="string")return;const k=Ze(u.data),v=k.length;s.write(k,()=>ve(v));break}}}})(),()=>{e=!0,d&&clearTimeout(d),i&&i.disconnect();const p=S.current;if(p){p.onopen=null,p.onmessage=null,p.onclose=null,p.onerror=null;try{p.close()}catch{}S.current=null}if(g.current){try{g.current.dispose()}catch{}g.current=null}const h=T.current;if(h){try{h.dispose()}catch{}T.current=null}M.current=null}},[m,f,a,y,O]);const oe=n.useMemo(()=>a==="idle"?r("cliTerminal.replayIdle","Session idle"):a==="ended"?r("cliTerminal.replayEnded","Session ended"):null,[a,r]),Se=n.useCallback(async()=>{if(E){X(!0);try{await E("advance"),U(!0)}finally{X(!1)}}},[E]),_e=n.useCallback(async()=>{E&&await E("not-yet"),U(!0)},[E]),F=!!o?.elevated,ae=o?.elevatedFlags?.join(", "),ke={"--terminal-glyph-font-family":J(z().fontFamily)};return t.jsxs("div",{className:`cli-session-terminal${x?" cli-session-terminal--mobile":""}${x&&B?" cli-session-terminal--keyboard-open":""}`,"data-mode":a,"data-read-only":ie,"data-mobile":x,"data-keyboard-open":x&&B,children:[t.jsxs("header",{className:"cli-session-terminal__header",children:[o&&t.jsxs("div",{className:"cli-session-terminal__posture-wrap",children:[t.jsxs("button",{type:"button",className:`cli-posture-chip${F?" cli-posture-chip--elevated":""}`,"data-elevated":F,"aria-expanded":G,onClick:()=>q(e=>!e),children:[F?t.jsx(Be,{size:13,"aria-hidden":"true"}):t.jsx(Ne,{size:13,"aria-hidden":"true"}),t.jsx("span",{className:"cli-posture-chip__name",children:o.adapterName}),o.mode&&t.jsx("span",{className:"cli-posture-chip__mode",children:o.mode}),F&&ae&&t.jsx("span",{className:"cli-posture-chip__flag",children:ae})]}),G&&t.jsxs("div",{className:"cli-posture-tooltip",role:"tooltip",children:[t.jsx("p",{className:"cli-posture-tooltip__title",children:r("cliTerminal.postureResolved","Resolved posture")}),t.jsxs("ul",{className:"cli-posture-tooltip__list",children:[(o.resolved??[]).map((e,i)=>t.jsx("li",{children:e},i)),(o.resolved??[]).length===0&&t.jsx("li",{children:o.mode??r("cliTerminal.postureBaseline","Baseline")})]}),H&&t.jsxs("button",{type:"button",className:"cli-posture-tooltip__settings",onClick:()=>{q(!1),H()},children:[t.jsx(Re,{size:12,"aria-hidden":"true"}),r("cliTerminal.adapterSettings","Adapter settings")]})]})]}),ie&&t.jsxs("span",{className:"cli-session-terminal__readonly-badge",children:[t.jsx(Pe,{size:12,"aria-hidden":"true"}),r("cliTerminal.readOnly","Read-only")]}),oe&&t.jsx("span",{className:"cli-session-terminal__replay-badge","data-replay-mode":a,children:oe})]}),t.jsx("div",{className:"cli-session-terminal__viewport",ref:C,"data-testid":"cli-terminal-viewport",style:ke}),$&&!me&&t.jsxs("div",{className:"cli-session-terminal__advance-strip",role:"region",children:[t.jsx("span",{className:"cli-session-terminal__advance-copy",children:r("cliTerminal.advancePrompt","This session looks idle — advance to review?")}),t.jsxs("div",{className:"cli-session-terminal__advance-actions",children:[t.jsx("button",{type:"button",className:"cli-session-terminal__advance-btn",disabled:Z,onClick:Se,children:r("cliTerminal.advance","Advance")}),t.jsx("button",{type:"button",className:"cli-session-terminal__advance-btn cli-session-terminal__advance-btn--secondary",disabled:Z,onClick:_e,children:r("cliTerminal.notYet","Not yet")})]})]}),x&&D&&t.jsxs("div",{className:`cli-session-terminal__mobile-bar${B?" cli-session-terminal__mobile-bar--keyboard-open":""}`,"data-testid":"cli-terminal-mobile-bar",style:B?{bottom:`${fe}px`}:void 0,children:[t.jsxs("div",{className:"cli-session-terminal__key-row","data-testid":"cli-terminal-key-bar",children:[t.jsx("button",{type:"button",className:`cli-terminal-key cli-terminal-key--ctrl${N?" cli-terminal-key--active":""}`,"data-testid":"cli-key-ctrl","aria-label":r("cliTerminal.mobileKeyCtrl","Sticky Ctrl modifier"),"aria-pressed":N,onPointerDown:l,onMouseDown:l,onClick:()=>L(e=>!e),children:W.ctrl}),t.jsx("button",{type:"button",className:"cli-terminal-key","data-testid":"cli-key-esc","aria-label":r("cliTerminal.mobileKeyEsc","Send Escape"),onPointerDown:l,onMouseDown:l,onClick:()=>R(We),children:W.escape}),t.jsx("button",{type:"button",className:"cli-terminal-key","data-testid":"cli-key-tab","aria-label":r("cliTerminal.mobileKeyTab","Send Tab"),onPointerDown:l,onMouseDown:l,onClick:()=>R($e),children:W.tab}),t.jsx("button",{type:"button",className:"cli-terminal-key cli-terminal-key--ctrlc","data-testid":"cli-key-ctrl-c","aria-label":r("cliTerminal.mobileKeyCtrlC","Send Ctrl-C"),onPointerDown:l,onMouseDown:l,onClick:()=>{L(!1),b(Ue)},children:W.ctrlC}),t.jsx("button",{type:"button",className:"cli-terminal-key","data-testid":"cli-key-arrow-up","aria-label":r("cliTerminal.mobileKeyArrowUp","Cursor up"),onPointerDown:l,onMouseDown:l,onClick:()=>R(Qe),children:"↑"}),t.jsx("button",{type:"button",className:"cli-terminal-key","data-testid":"cli-key-arrow-down","aria-label":r("cliTerminal.mobileKeyArrowDown","Cursor down"),onPointerDown:l,onMouseDown:l,onClick:()=>R(Ve),children:"↓"}),t.jsx("button",{type:"button",className:"cli-terminal-key","data-testid":"cli-key-arrow-left","aria-label":r("cliTerminal.mobileKeyArrowLeft","Cursor left"),onPointerDown:l,onMouseDown:l,onClick:()=>R(Ye),children:"←"}),t.jsx("button",{type:"button",className:"cli-terminal-key","data-testid":"cli-key-arrow-right","aria-label":r("cliTerminal.mobileKeyArrowRight","Cursor right"),onPointerDown:l,onMouseDown:l,onClick:()=>R(Je),children:"→"}),ye.map(e=>t.jsx("button",{type:"button",className:"cli-terminal-key cli-terminal-key--custom","data-testid":`cli-terminal-custom-shortcut-${e.id}`,title:e.label,"aria-label":e.label,onPointerDown:l,onMouseDown:l,onClick:()=>{L(!1),b(je(e.value))},children:e.label},e.id))]}),t.jsxs("form",{className:"cli-session-terminal__input-row",onSubmit:he,children:[t.jsx("input",{ref:pe,type:"text",className:"cli-session-terminal__mobile-input","data-testid":"cli-terminal-mobile-input",value:_,placeholder:r("cliTerminal.mobileInputPlaceholder","Type to send to the session…"),autoCapitalize:"off",autoCorrect:"off",autoComplete:"off",spellCheck:!1,onChange:e=>we(e.target.value)}),t.jsx("button",{type:"submit",className:"cli-session-terminal__mobile-send","data-testid":"cli-terminal-mobile-send","aria-label":r("cliTerminal.mobileSend","Send"),onPointerDown:l,onMouseDown:l,children:r("cliTerminal.mobileSend","Send")})]})]})]})}export{lt as SessionTerminal};
@@ -1 +1 @@
1
- import{r}from"./vendor-react-SZ_qB27O.js";import{a as n,w as s}from"./index-idkERMsE.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};
1
+ import{r}from"./vendor-react-SZ_qB27O.js";import{a as n,w as s}from"./index-Ck-7DP8n.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};