@capagents/forgeqe 3.1.1 → 3.1.3
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/HOW_TO_USE.md +5152 -1869
- package/README.md +155 -434
- package/THIRD_PARTY_NOTICES.md +210 -1
- package/dist/docs-site/CREDITS.md +6 -0
- package/dist/docs-site/architecture-map/index.html +1 -1
- package/dist/docs-site/docs/app-theme.css +126 -13
- package/dist/docs-site/docs/architecture/index.html +56 -530
- package/dist/docs-site/docs/architecture-reference/index.html +1781 -0
- package/dist/docs-site/docs/area-api/index.html +491 -0
- package/dist/docs-site/docs/area-automated-tests/index.html +1777 -0
- package/dist/docs-site/docs/area-browser/index.html +472 -0
- package/dist/docs-site/docs/area-data/index.html +595 -0
- package/dist/docs-site/docs/area-desktop/index.html +802 -0
- package/dist/docs-site/docs/area-mobile/index.html +683 -0
- package/dist/docs-site/docs/area-operations/index.html +1243 -0
- package/dist/docs-site/docs/area-pull-requests/index.html +290 -0
- package/dist/docs-site/docs/area-quality/index.html +427 -0
- package/dist/docs-site/docs/area-release/index.html +435 -0
- package/dist/docs-site/docs/area-setup/index.html +1595 -0
- package/dist/docs-site/docs/area-systems/index.html +191 -0
- package/dist/docs-site/docs/area-test-cases/index.html +927 -0
- package/dist/docs-site/docs/containers/index.html +168 -189
- package/dist/docs-site/docs/cost-architecture/index.html +110 -113
- package/dist/docs-site/docs/custom-agents-first-run/index.html +121 -67
- package/dist/docs-site/docs/desktop/index.html +363 -373
- package/dist/docs-site/docs/desktop-ci/index.html +39 -36
- package/dist/docs-site/docs/docs-tabs.js +56 -0
- package/dist/docs-site/docs/evidence/index.html +297 -300
- package/dist/docs-site/docs/feature-test-prompts/index.html +79 -73
- package/dist/docs-site/docs/get-started/index.html +791 -0
- package/dist/docs-site/docs/graphify/index.html +45 -48
- package/dist/docs-site/docs/guardrails/index.html +35 -23
- package/dist/docs-site/docs/index.html +18 -6729
- package/dist/docs-site/docs/mobile/index.html +223 -210
- package/dist/docs-site/docs/model-routing/index.html +84 -65
- package/dist/docs-site/docs/overview/index.html +192 -0
- package/dist/docs-site/docs/product-graph/index.html +60 -62
- package/dist/docs-site/docs/product-knowledge/index.html +24 -17
- package/dist/docs-site/docs/product-views/index.html +57 -60
- package/dist/docs-site/docs/reference/index.html +409 -0
- package/dist/docs-site/docs/search.js +1 -1
- package/dist/docs-site/docs/using/index.html +798 -0
- package/dist/docs-site/docs/web-app/index.html +168 -111
- package/dist/docs-site/security/index.html +930 -0
- package/dist/docs-site/security/security-theme.css +161 -0
- package/dist/docs-site/security/security.js +1465 -0
- package/dist/docs-site/vendor/react-18.3.1.production.min.js +31 -0
- package/dist/docs-site/vendor/react-dom-18.3.1.production.min.js +267 -0
- package/dist/docs-site/vendor/reactflow-11.11.4.umd.js +10 -0
- package/dist/forgeqe.js +1903 -1896
- package/dist/web/THIRD_PARTY_NOTICES.md +0 -136
- package/dist/web/assets/Agent-3pV8Rwap.js +8 -0
- package/dist/web/assets/AgentWork-DAnmH0My.js +2 -0
- package/dist/web/assets/ApiTests-DW4MRFzG.js +10 -0
- package/dist/web/assets/Browse-Bd0ZZfc2.js +1 -0
- package/dist/web/assets/Chat-DnBUm_97.js +3 -0
- package/dist/web/assets/CommandPalette-B1O9aDTk.js +1 -0
- package/dist/web/assets/Compare-1v7_ca7z.js +1 -0
- package/dist/web/assets/Cost-CWrc4McH.js +1 -0
- package/dist/web/assets/Data-rWSiG4Cq.js +6 -0
- package/dist/web/assets/Desktop-3x6EQqos.js +1 -0
- package/dist/web/assets/DesktopReview-cSA10Rm3.js +1 -0
- package/dist/web/assets/Evidence-CKy3o7cw.js +1 -0
- package/dist/web/assets/Explore-CMAxWE_8.js +2 -0
- package/dist/web/assets/Features-haQchkhA.js +1 -0
- package/dist/web/assets/Flags-BaQjYi_t.js +2 -0
- package/dist/web/assets/Flaky-DUuC0qTn.js +1 -0
- package/dist/web/assets/Impact-CP0H8ygo.js +3 -0
- package/dist/web/assets/Jobs-cYxoYd3i.js +5 -0
- package/dist/web/assets/KindPage-DWW8gN5_.js +6 -0
- package/dist/web/assets/Migration-Bsm7WU1d.js +2 -0
- package/dist/web/assets/PageAgent-c95zT2PJ.js +1 -0
- package/dist/web/assets/Product-BQSiR28a.js +7 -0
- package/dist/web/assets/Production-CAv0Vtoy.js +1 -0
- package/dist/web/assets/Quality-aQPaPYQc.js +1 -0
- package/dist/web/assets/Readiness-CkknP87n.js +1 -0
- package/dist/web/assets/Record-09IsC9U-.js +1 -0
- package/dist/web/assets/Regression-BL4MfN47.js +5 -0
- package/dist/web/assets/RelationGraph-Dg4fqt7l.js +1 -0
- package/dist/web/assets/Reports-CMV1l-iS.js +2 -0
- package/dist/web/assets/Response-DTBFBeKB.js +9 -0
- package/dist/web/assets/Responsive-DBRQ9FUO.js +3 -0
- package/dist/web/assets/RunDiff-CMDrnsA3.js +1 -0
- package/dist/web/assets/Runs-Dkeu6_vZ.js +2 -0
- package/dist/web/assets/Settings-KjKm8h-_.js +21 -0
- package/dist/web/assets/Steps-HYHK9psI.js +2 -0
- package/dist/web/assets/TestCases-Cv6-OSv0.js +1 -0
- package/dist/web/assets/TestData-DbEfNlUE.js +2 -0
- package/dist/web/assets/TestDebt-DzHQIU4X.js +1 -0
- package/dist/web/assets/TestManagement-BgRTGHMT.js +1 -0
- package/dist/web/assets/Tosca-DZpHAtnH.js +3 -0
- package/dist/web/assets/WhatsNew-jp0c4WSV.js +1 -0
- package/dist/web/assets/agents-C0Jg2pN8.js +1 -0
- package/dist/web/assets/coverage-BB9BLjGz.js +5 -0
- package/dist/web/assets/dataParts-DEPK4eQE.js +3 -0
- package/dist/web/assets/diff-CcNwLCX6.js +2 -0
- package/dist/web/assets/families-gkpkloLT.js +1 -0
- package/dist/web/assets/filters-C7phIFfd.js +1 -0
- package/dist/web/assets/fold-i73P-EDV.js +1 -0
- package/dist/web/assets/head-BtTqyLlj.js +1 -0
- package/dist/web/assets/highlight-DZI39CzZ.js +4 -0
- package/dist/web/assets/index-ClFOh63x.css +2 -0
- package/dist/web/assets/index-YGWJEkAT.js +64 -0
- package/dist/web/assets/input-C2vQ9O3a.js +1 -0
- package/dist/web/assets/jsx-runtime-LKYXHABd.js +1 -0
- package/dist/web/assets/logos-BmbNTDu2.js +1 -0
- package/dist/web/assets/palette-XFlqvgZl.js +1 -0
- package/dist/web/assets/paletteCommands-DsbD2ASU.js +1 -0
- package/dist/web/assets/parts-DEVx2Sea.js +1 -0
- package/dist/web/assets/productParts-Bi-XjszL.js +1 -0
- package/dist/web/assets/qualityParts-Dbu01g7G.js +1 -0
- package/dist/web/assets/recordTest--Wr40QdN.js +1 -0
- package/dist/web/assets/rolldown-runtime-XKyaHtl9.js +1 -0
- package/dist/web/assets/route-Dg53WdFu.js +1 -0
- package/dist/web/index.html +11 -6
- package/docs/ARCHITECTURE.md +50 -563
- package/docs/ARCHITECTURE_REFERENCE.md +1484 -0
- package/docs/BASAL.md +1 -1
- package/docs/CONTAINERS.md +87 -87
- package/docs/CUSTOM_AGENTS_FIRST_RUN.md +125 -43
- package/docs/DESKTOP-CI.md +18 -3
- package/docs/DESKTOP.md +306 -286
- package/docs/EVIDENCE.md +1 -1
- package/docs/MOBILE.md +107 -75
- package/docs/MODEL_ROUTING.md +48 -15
- package/docs/PRODUCT_KNOWLEDGE.md +2 -0
- package/docs/WEB_APP.md +143 -75
- package/docs/feature-test-prompts.md +29 -16
- package/docs/user-guide.html +5402 -2269
- package/forgeqe.example.yaml +3 -3
- package/guardrails/README.md +22 -2
- package/knowledge/README.md +15 -2
- package/package.json +1 -1
- package/prompts/brain.md +1 -0
- package/prompts/page-differs.md +1 -1
- package/prompts/requests-rule.md +1 -1
- package/prompts/test-reviewer.md +1 -1
- package/prompts/test-rules.md +3 -4
- package/py/forgeqe_engine/recordsession.py +100 -24
- package/skills/web-guidance/LICENSE +202 -0
- package/skills/web-guidance/SKILL.md +76 -0
- package/skills/web-guidance/UPSTREAM +67 -0
- package/skills/web-guidance/references/accessibility/accessibility.md +585 -0
- package/skills/web-guidance/references/accessibility/accessible-error-announcement.md +302 -0
- package/skills/web-guidance/references/accessibility/accessible-generated-content.md +41 -0
- package/skills/web-guidance/references/accessibility/respect-os-text-scale.md +127 -0
- package/skills/web-guidance/references/css/responsive-design.md +16 -0
- package/skills/web-guidance/references/forms/autofill-address-form.md +86 -0
- package/skills/web-guidance/references/forms/autofill-payment-form.md +142 -0
- package/skills/web-guidance/references/forms/autofill-sign-in-form.md +145 -0
- package/skills/web-guidance/references/forms/autofill-sign-up-form.md +155 -0
- package/skills/web-guidance/references/forms/forms.md +415 -0
- package/skills/web-guidance/references/forms/ime-safe-enter-submit.md +115 -0
- package/skills/web-guidance/references/forms/required-field-feedback.md +317 -0
- package/skills/web-guidance/references/forms/select-menu-interaction.md +310 -0
- package/skills/web-guidance/references/forms/slider.md +184 -0
- package/skills/web-guidance/references/forms/sms-otp-form.md +208 -0
- package/skills/web-guidance/references/forms/switch.md +60 -0
- package/skills/web-guidance/references/forms/validate-input-after-interaction.md +406 -0
- package/skills/web-guidance/references/performance/break-up-long-tasks.md +64 -0
- package/skills/web-guidance/references/performance/identify-heavy-scripts.md +69 -0
- package/skills/web-guidance/references/performance/identify-inp-causes.md +105 -0
- package/skills/web-guidance/references/performance/interaction-paint-timing.md +200 -0
- package/skills/web-guidance/references/performance/optimize-image-priority.md +73 -0
- package/skills/web-guidance/references/performance/performance.md +384 -0
- package/skills/web-guidance/references/privacy/privacy.md +247 -0
- package/skills/web-guidance/references/security/passkey-authentication.md +218 -0
- package/skills/web-guidance/references/security/passkey-management.md +310 -0
- package/skills/web-guidance/references/security/passkey-reauthentication.md +142 -0
- package/skills/web-guidance/references/security/passkey-registration.md +186 -0
- package/skills/web-guidance/references/security/passkeys.md +39 -0
- package/skills/web-guidance/references/security/sanitize-untrusted-html.md +105 -0
- package/skills/web-guidance/references/security/secure-external-subresources.md +202 -0
- package/skills/web-guidance/references/security/security.md +390 -0
- package/skills/web-guidance/references/security/trusted-types.md +141 -0
- package/skills/web-guidance/references/security/validate-origins.md +197 -0
- package/skills/web-guidance/references/security/verify-email-ownership.md +235 -0
- package/skills/web-guidance/references/ui-atoms/position-aware-tooltips.md +173 -0
- package/skills/web-guidance/references/ui-atoms/responsive-table.md +122 -0
- package/skills/web-guidance/references/ui-atoms/viewport-aware-dropdowns.md +178 -0
- package/skills/web-guidance/references/ui-behaviors/drag-and-drop.md +108 -0
- package/skills/web-guidance/references/ui-behaviors/light-dismiss-a-dialog.md +89 -0
- package/skills/web-guidance/references/ui-behaviors/motion.md +97 -0
- package/skills/web-guidance/references/ui-behaviors/platform-controls-dismiss-dialog.md +40 -0
- package/skills/web-guidance/references/ui-behaviors/prevent-page-scroll-under-modal-dialog.md +59 -0
- package/skills/web-guidance/references/ui-behaviors/search-hidden-content.md +141 -0
- package/skills/web-guidance/references/ui-behaviors/sortable-table.md +140 -0
- package/skills/web-guidance/references/ui-components/accordion.md +343 -0
- package/skills/web-guidance/references/ui-components/breadcrumbs.md +168 -0
- package/skills/web-guidance/references/ui-components/carousel.md +206 -0
- package/skills/web-guidance/references/ui-components/checkbox.md +144 -0
- package/skills/web-guidance/references/ui-components/dialog.md +218 -0
- package/skills/web-guidance/references/ui-components/hovercard.md +391 -0
- package/skills/web-guidance/references/ui-components/menu.md +415 -0
- package/skills/web-guidance/references/ui-components/navbar.md +281 -0
- package/skills/web-guidance/references/ui-components/navigation-drawer.md +429 -0
- package/skills/web-guidance/references/ui-components/persistent-toast-notifications.md +185 -0
- package/skills/web-guidance/references/ui-components/progress.md +181 -0
- package/skills/web-guidance/references/ui-components/spinner.md +179 -0
- package/skills/web-guidance/references/ui-components/tabs.md +371 -0
- package/skills/web-guidance/references/ui-components/toolbar.md +277 -0
- package/skills/web-guidance/references/user-experience/form-factor-adaptation.md +120 -0
- package/skills/web-guidance/references/user-experience/natural-interactions.md +155 -0
- package/skills/web-guidance/references/visual-design/color.md +43 -0
- package/skills/web-guidance/references/visual-design/dark-mode.md +350 -0
- package/dist/web/assets/AgentWork-DwAI0_Of.js +0 -2
- package/dist/web/assets/ApiTests-C0vFSHmM.js +0 -10
- package/dist/web/assets/Browse-5jfdtRc5.js +0 -2
- package/dist/web/assets/Chat-B3uhI94O.js +0 -3
- package/dist/web/assets/CommandPalette-D2J4nf5y.js +0 -1
- package/dist/web/assets/Compare-CN75w1p9.js +0 -1
- package/dist/web/assets/Cost-QoxyjR95.js +0 -1
- package/dist/web/assets/Data-BAvkcBVt.js +0 -6
- package/dist/web/assets/Desktop-BXdOIalN.js +0 -1
- package/dist/web/assets/DesktopReview-Bl2SrPP0.js +0 -1
- package/dist/web/assets/Evidence-BJ_I52CD.js +0 -1
- package/dist/web/assets/Explore-D9AuyTip.js +0 -2
- package/dist/web/assets/Features-CusGMDR9.js +0 -1
- package/dist/web/assets/Flags-CycGFuUP.js +0 -2
- package/dist/web/assets/Flaky-BcSzJogN.js +0 -1
- package/dist/web/assets/Impact-CJHnyZ21.js +0 -3
- package/dist/web/assets/Jobs-4xcFzEFo.js +0 -5
- package/dist/web/assets/KindPage-BielEIej.js +0 -6
- package/dist/web/assets/Migration-NwanKpJg.js +0 -2
- package/dist/web/assets/PageAgent-CNw4NXva.js +0 -1
- package/dist/web/assets/Product-DS3LJZ4P.js +0 -7
- package/dist/web/assets/Production-D3zsyNIS.js +0 -1
- package/dist/web/assets/Quality-Ctj2YpC4.js +0 -1
- package/dist/web/assets/Readiness-DGcRr_co.js +0 -1
- package/dist/web/assets/Record-Cc-wGe_Y.js +0 -1
- package/dist/web/assets/Regression-DcsbrRa1.js +0 -5
- package/dist/web/assets/Reports-BkCn0-Sf.js +0 -2
- package/dist/web/assets/Response-BP0UwQcW.js +0 -9
- package/dist/web/assets/Responsive-C8U7dumd.js +0 -3
- package/dist/web/assets/RunDiff-BhABuhF_.js +0 -1
- package/dist/web/assets/Runs-OwdWEYBv.js +0 -2
- package/dist/web/assets/Steps-BvzbQyoD.js +0 -2
- package/dist/web/assets/TestCases-CLq_6JA5.js +0 -1
- package/dist/web/assets/TestData-B0oKAhp6.js +0 -2
- package/dist/web/assets/TestDebt-8NLQ5YV_.js +0 -1
- package/dist/web/assets/TestManagement-2LYQ7vsN.js +0 -1
- package/dist/web/assets/Tosca-DfvMpPTG.js +0 -3
- package/dist/web/assets/WhatsNew-BGFNGwqN.js +0 -1
- package/dist/web/assets/families-DYlN5v0i.js +0 -1
- package/dist/web/assets/filters-faaSnoIq.js +0 -1
- package/dist/web/assets/fold-CUjwWAK3.js +0 -1
- package/dist/web/assets/frame-BLPdAXUq.js +0 -13
- package/dist/web/assets/head-CsTxBsO0.js +0 -1
- package/dist/web/assets/index-CxiCvGZq.js +0 -78
- package/dist/web/assets/index-dOIsrzhD.css +0 -2
- package/dist/web/assets/line-icons-CwZWt93L.js +0 -1
- package/dist/web/assets/logos-dGuc1jIM.js +0 -1
- package/dist/web/assets/markdown-BI3F-SJ1.js +0 -10
- package/dist/web/assets/paletteCommands-QJiCuUEr.js +0 -1
- package/dist/web/assets/parts-CdF1f7yS.js +0 -1
- package/dist/web/assets/productParts-hNLD9fN0.js +0 -1
- package/dist/web/assets/qualityParts-CT25lBWU.js +0 -1
- package/dist/web/assets/recordTest-P792aBUt.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Br as e,Et as t,Ln as n,Lr as r,Mn as i,Nr as a,O as o,Pn as s,Pr as c,St as l,Yn as u,_r as d,_t as f,a as p,br as m,ct as h,jn as g,kn as _,nn as v,nt as y,o as b,pt as x,qn as ee,rr as S,tr as te,vt as C,w}from"./line-icons-CwZWt93L.js";import{$t as T,Jt as E,V as D,a as O,c as k,et as A,i as j,kt as M,l as N,o as P,p as F,s as ne,z as I}from"./filters-faaSnoIq.js";import{$ as L,Ht as re,Q as R,Vt as z,X as B,Z as V,et as H,nt as U,ot as W,st as ie,tt as ae}from"./frame-BLPdAXUq.js";import{o as oe,r as se,t as ce}from"./markdown-BI3F-SJ1.js";import{L as le,g as ue,j as de}from"./index-CxiCvGZq.js";import{t as G}from"./fold-CUjwWAK3.js";import{t as K}from"./head-CsTxBsO0.js";import{a as fe,c as pe,d as me,f as he,i as ge,l as _e,n as ve,o as ye,r as q,s as be,t as xe,u as Se}from"./parts-CdF1f7yS.js";import{_ as Ce,a as we,c as Te,d as Ee,i as De,n as Oe,o as J,r as ke,s as Y,t as Ae}from"./logos-dGuc1jIM.js";var X=e(r(),1),Z=T(),je={py:`python`,ts:`typescript`,tsx:`typescript`,js:`javascript`,jsx:`javascript`,mjs:`javascript`,cjs:`javascript`,java:`java`,cs:`csharp`,rb:`ruby`};function Me({path:e}){let t=ke[je[e.split(`.`).pop()?.toLowerCase()||``]||``];return t?(0,Z.jsx)(t,{"aria-hidden":`true`,width:15,height:15,className:`flex-none`}):(0,Z.jsx)(f,{size:15,"aria-hidden":`true`,className:`flex-none text-muted`})}function Ne(e){let t={name:``,path:``,dirs:new Map,files:[]};for(let n of e){let e=n.path.split(`/`),r=t;for(let t of e.slice(0,-1))r.dirs.has(t)||r.dirs.set(t,{name:t,path:r.path?`${r.path}/${t}`:t,dirs:new Map,files:[]}),r=r.dirs.get(t);r.files.push(n)}let n=e=>{for(let[t,r]of[...e.dirs]){let i=n(r);for(;i.files.length===0&&i.dirs.size===1;){let e=[...i.dirs.values()][0];i={...e,name:`${i.name}/${e.name}`}}e.dirs.set(t,i)}return e};return n(t)}function Pe({files:e,selected:n,onSelect:r,label:i}){let a=(0,X.useMemo)(()=>Ne(e),[e]),[s,c]=(0,X.useState)(new Set),u=e=>c(t=>t.has(e)?new Set([...t].filter(t=>t!==e)):new Set([...t,e])),d=(e,i)=>(0,Z.jsxs)(Z.Fragment,{children:[[...e.dirs.values()].sort((e,t)=>e.name.localeCompare(t.name)).map(e=>{let n=!s.has(e.path);return(0,Z.jsxs)(`li`,{role:`treeitem`,"aria-expanded":n,"aria-selected":!1,className:`list-none`,children:[(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>u(e.path),className:`flex h-8 w-full cursor-pointer items-center gap-2 rounded-[6px] border-0 bg-transparent px-2 text-left text-[13px] text-ink hover:bg-surface-strong`,children:[(0,Z.jsx)(o,{size:14,"aria-hidden":`true`,className:D(`flex-none text-muted transition-transform duration-150`,n&&`rotate-90`)}),n?(0,Z.jsx)(t,{size:15,"aria-hidden":`true`,className:`flex-none text-accent-fg`}):(0,Z.jsx)(l,{size:15,"aria-hidden":`true`,className:`flex-none text-accent-fg`}),(0,Z.jsx)(`span`,{className:`truncate`,children:e.name})]}),n&&(0,Z.jsx)(`ul`,{role:`group`,className:`m-0 ml-4 border-l border-line-soft p-0 pl-2`,children:d(e,i+1)})]},e.path)}),[...e.files].sort((e,t)=>e.path.localeCompare(t.path)).map(e=>{let t=n===e.id;return(0,Z.jsx)(`li`,{role:`treeitem`,"aria-selected":t,className:`list-none`,children:(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>r?.(e.id),"data-tip":e.title,className:D(`flex h-8 w-full items-center gap-2 rounded-[6px] border-0 px-2 text-left text-[13px]`,r?`cursor-pointer`:`cursor-default`,t?`bg-accent-soft font-medium text-ink`:`bg-transparent text-ink-2 hover:bg-surface-strong hover:text-ink`),children:[(0,Z.jsx)(`span`,{className:`w-[14px] flex-none`,"aria-hidden":`true`}),(0,Z.jsx)(Me,{path:e.path}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.path.slice(e.path.lastIndexOf(`/`)+1)}),e.tail]})},e.id)})]});return(0,Z.jsx)(`ul`,{role:`tree`,"aria-label":i,className:`m-0 flex flex-col p-0`,children:d(a,0)})}function Fe({title:e,side:t,file:n,lang:r,text:i,missing:a}){let o=(i??``).split(`
|
|
2
|
-
`),s=(0,X.useMemo)(()=>i?oe(i,r):null,[i,r]);return(0,Z.jsxs)(`figure`,{className:`m-0 flex min-h-0 min-w-0 flex-col overflow-hidden rounded-[12px] card border`,children:[(0,Z.jsxs)(`figcaption`,{className:`flex min-h-10 items-center gap-2 border-b border-line-soft pr-1 pl-4`,children:[(0,Z.jsx)(`span`,{className:`text-[13px] font-semibold tracking-[0.04em] text-muted uppercase`,children:t}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[13px] text-ink-2`,"data-tip":n,children:n||e}),i&&(0,Z.jsx)(ce,{text:i,label:`Copy ${n||t}`})]}),i?(0,Z.jsxs)(`div`,{className:`flex min-h-[260px] flex-1 overflow-auto font-mono text-[13px] leading-[1.6]`,children:[(0,Z.jsx)(`pre`,{"aria-hidden":`true`,className:`m-0 min-h-full flex-none self-stretch border-r border-line-soft px-4 py-4 text-right text-muted select-none`,children:o.map((e,t)=>`${t+1}\n`).join(``)}),(0,Z.jsx)(`pre`,{className:`m-0 min-w-0 flex-1 px-4 py-4`,children:(0,Z.jsx)(`code`,{className:`hljs`,children:s})})]}):(0,Z.jsx)(`p`,{className:`m-0 flex min-h-[260px] flex-1 items-center justify-center px-4 text-center text-sm text-muted`,children:a||`Nothing to show.`})]})}function Ie({id:e,plan:t,result:n,initial:r}){let i=new Map((n?.units||[]).map(e=>[e.id,e.status])),a=[...t.units.filter(e=>e.kind!==`setup`).map(e=>({unit:e.id,kind:ve[e.kind],source:e.source,target:e.target,status:i.get(e.id)})),...t.copies.map((e,t)=>({unit:`c${t}`,kind:`Data`,source:e.source,target:e.target,data:!0}))],[o,s]=(0,X.useState)(``),[c,l]=(0,X.useState)(r||a.find(e=>e.kind===`Test`)?.unit||a[0]?.unit||``),[u,d]=(0,X.useState)(null),[f,p]=(0,X.useState)(``);(0,X.useEffect)(()=>{c&&(p(``),M.pair(e,c).then(d,e=>p(e.message)))},[e,c,n?.units.length,n?.endedAt]);let m=a.filter(e=>!o||`${e.source} ${e.target}`.toLowerCase().includes(o.toLowerCase())),h=a.filter(e=>e.status===`migrated`).length,g=a.filter(e=>e.status===`failed`||e.status===`blocked`).length;return(0,Z.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] gap-4 @4xl:h-[calc(var(--screen)-320px)] @4xl:min-h-[540px] @4xl:grid-cols-[240px_minmax(0,1fr)]`,children:[(0,Z.jsxs)(`nav`,{"aria-label":`Files`,className:`flex max-h-[360px] min-h-0 min-w-0 flex-col gap-2 overflow-hidden rounded-[14px] card border p-4 @4xl:max-h-none`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1 px-1`,children:[(0,Z.jsx)(`span`,{className:`text-sm font-semibold`,children:`Files`}),(0,Z.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[h,` migrated · `,g,` failed · `,a.length,` files`]})]}),(0,Z.jsx)(j,{id:`find-a-file`,label:`Find a file`,value:o,onChange:s,className:`max-w-none flex-none`}),(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:m.length?(0,Z.jsx)(Pe,{label:`Files`,selected:c,onSelect:l,files:m.map(e=>({id:e.unit,path:e.target,title:e.source?`from ${e.source}`:void 0,tail:(0,Z.jsx)(`span`,{role:`img`,"aria-label":e.status?be[e.status].label:e.data?`Copied`:`Waiting`,className:D(`size-2 flex-none rounded-full`,e.status===`migrated`?`bg-pass`:e.status===`failed`?`bg-fail`:e.status===`blocked`?`bg-warn`:e.status===`written`?`bg-line-strong`:`bg-line`)})}))}):(0,Z.jsx)(`p`,{className:`m-0 px-2 py-4 text-[13px] text-muted`,children:`No file matches.`})})]}),(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-col gap-4`,children:[f&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:f}),(0,Z.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[minmax(0,1fr)] gap-4 @3xl:grid-cols-2`,children:[(0,Z.jsx)(Fe,{title:`Source`,side:`Source`,file:u?.source?.path,lang:u?.source?.lang||`plaintext`,text:u?.source?.text,missing:u&&!u.source?`This file is made new for the target.`:void 0}),(0,Z.jsx)(Fe,{title:`Target`,side:`Migrated`,file:u?.target.path,lang:u?.target.lang||`plaintext`,text:u?.target.text,missing:u&&!u.target.exists?`Not written yet.`:void 0})]})]})]})}var Le=[`prepare`,`setup`,`migrate`,`validate`,`fix`,`review`];function Re(e){if(e.job?.running)return{label:e.job.kind===`verify`?`Validating`:e.job.kind===`fix`?`Fixing`:`Running`,tone:`running`};let t=e.result;return t?.status===`running`?{label:t.stage===`validate`?`Validating`:t.stage===`fix`?`Fixing`:`Running`,tone:`running`}:t?ge[t.status]:e.job?.last?{label:`Did not start`,tone:`fail`}:e.confirmed?{label:`Confirmed`,tone:`neutral`}:pe[e.plan.feasibility.verdict]}var Q=e=>e.slice(e.lastIndexOf(`/`)+1);function ze({id:e,title:t,targetDir:n,onClose:r}){let[i,a]=(0,X.useState)(``),[o,s]=(0,X.useState)(!1),[c,l]=(0,X.useState)(``),u=async()=>{s(!0),l(``);try{await M.delete(e,i),location.hash=F(`migration`,`migrations`)}catch(e){l(e.message),s(!1)}};return(0,Z.jsx)(z,{open:!0,onClose:r,title:`Delete this migration`,description:`${t}. Removes the plan and its run history from the list. Files already written under ${n} stay.`,footer:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(I,{variant:`ghost`,onClick:r,"data-tip":`Keep it`,children:[(0,Z.jsx)(w,{"aria-hidden":`true`}),`Keep`]}),(0,Z.jsxs)(I,{variant:`danger`,disabled:o||i!==e,onClick:()=>void u(),children:[(0,Z.jsx)(d,{"aria-hidden":`true`}),`Delete`]})]}),children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,Z.jsxs)(`span`,{children:[`Type `,(0,Z.jsx)(`span`,{className:`font-mono`,children:e}),` to confirm`]}),(0,Z.jsx)(O,{value:i,onChange:e=>a(e.target.value),autoComplete:`off`,spellCheck:!1})]}),c?(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:c}):null]})})}function Be({d:e,planView:t}){let n=e.result;if(!n)return(0,Z.jsx)(Z.Fragment,{children:t});let r=new Map(n.units.map(e=>[e.id,e])),i=e.plan.units.filter(e=>e.kind===`test`),a=n.units.filter(e=>e.kind===`test`&&e.status===`migrated`).length,o=e.plan.units.filter(e=>e.kind!==`setup`),s=n.units.filter(e=>e.kind!==`setup`&&(e.status===`migrated`||e.status===`written`)).length,c=n.units.filter(e=>e.status===`failed`||e.status===`blocked`).length,l=e.plan.source.stack,[u,...d]=e.plan.target.id.split(`-`);return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Z.jsxs)(ye,{children:[(0,Z.jsx)(q,{label:`Tests passing`,value:`${a} / ${i.length}`,tone:a===i.length&&i.length?`text-pass`:void 0}),(0,Z.jsx)(q,{label:`Files migrated`,value:`${s} / ${o.length}`}),(0,Z.jsx)(q,{label:`Need attention`,value:c,tone:c?`text-fail`:void 0}),(0,Z.jsx)(q,{label:n.status===`running`?`Running for`:`Took`,value:Se(n.status===`running`?Date.now()-Date.parse(n.startedAt):n.ms)})]}),n.notes&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:n.notes}),(0,Z.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] items-start gap-6 @5xl:grid-cols-[minmax(0,1fr)_320px]`,children:[(0,Z.jsx)(B,{label:`Files`,placeholder:`Find a file`,empty:`No files.`,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{className:L,children:`File`}),(0,Z.jsx)(`th`,{className:L,children:`Status`}),(0,Z.jsx)(`th`,{className:D(L,`hidden @3xl:table-cell`),children:`Note`})]}),children:e.plan.units.map(e=>{let t=r.get(e.id),n=t?be[t.status]:null;return(0,Z.jsxs)(`tr`,{className:ae,children:[(0,Z.jsxs)(`td`,{className:V,children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:e.kind===`setup`?`Project set-up`:Q(e.target)}),(0,Z.jsx)(`span`,{className:`block text-[13px] text-muted`,children:e.source?`from ${Q(e.source)}`:e.target})]}),(0,Z.jsx)(`td`,{className:D(V,`whitespace-nowrap`),children:n?(0,Z.jsx)(k,{tone:n.tone,children:n.label}):(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Waiting`})}),(0,Z.jsx)(`td`,{className:D(V,`hidden text-[13px] text-ink-2 @3xl:table-cell`),children:(0,Z.jsx)(`span`,{className:`line-clamp-2`,children:t?.problems?.[0]||t?.reason||``})})]},e.id)})}),(0,Z.jsxs)(`aside`,{"aria-label":`Details`,className:`flex flex-col gap-4 rounded-[14px] card border p-6 text-sm`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-[13px] font-medium text-muted`,children:`From`}),(0,Z.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[l&&(0,Z.jsx)(Y,{framework:l.framework,language:l.language}),e.plan.source.title]}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-ink-2`,children:[(0,Z.jsx)(J,{kind:e.origin.kind,label:e.origin.label,size:15}),(0,Z.jsxs)(`span`,{className:`truncate`,"data-tip":e.origin.label,children:[me(e.origin.label),e.origin.branch?` · ${e.origin.branch}`:``]})]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-line-soft pt-4`,children:[(0,Z.jsx)(`span`,{className:`text-[13px] font-medium text-muted`,children:`To`}),(0,Z.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,Z.jsx)(Y,{framework:u,language:d.join(`-`)}),e.plan.target.title]}),(0,Z.jsx)(`span`,{className:`font-mono text-[13px] text-ink-2 [overflow-wrap:anywhere]`,children:e.targetPath})]}),(0,Z.jsxs)(`dl`,{className:`m-0 grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 border-t border-line-soft pt-4`,children:[(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Started`}),(0,Z.jsx)(`dd`,{className:`m-0 text-right`,children:he(n.startedAt)}),n.model&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Agent`}),(0,Z.jsx)(`dd`,{className:`m-0 truncate text-right`,"data-tip":n.model,children:n.model})]}),n.reverted.length>0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Put back`}),(0,Z.jsxs)(`dd`,{className:`m-0 text-right`,children:[n.reverted.length,` edits outside the target`]})]})]})]})]})]})}function Ve({d:e,events:t,picked:n,setPicked:r,busy:i,working:o,onFix:s,onCheck:c}){let[l,u]=(0,X.useState)(``),d=(0,X.useRef)(null),f=e.result?.validation?.tests||[],p=f.filter(e=>!e.ok),m=[];for(let t of e.result?.fixes||[])t.auto||m.push({who:`you`,text:t.note?`${t.note}`:`Fix ${Q(t.target)}`,at:t.at,detail:t.note?`for ${Q(t.target)}`:void 0}),m.push({who:`agent`,tone:t.ok?`ok`:`fail`,at:t.at,text:t.ok?`${Q(t.target)} passes now${t.attempts>1?` (${t.attempts} tries)`:``}. ${t.reason||``}`.trim():`I could not make ${Q(t.target)} pass. ${t.problems?.[0]||t.reason||``}`.trim(),detail:t.auto?`after the first check`:void 0});let h=o?t.filter(e=>e.stage===`fix`&&(e.kind===`agent`||e.kind===`ok`||e.kind===`fail`||e.kind===`info`)).slice(-6):[];(0,X.useEffect)(()=>{d.current&&(d.current.scrollTop=d.current.scrollHeight)},[m.length,h.length]);let _=()=>{let e=[...n];e.length&&(s(e,l.trim()),u(``))},v=e=>{let t=new Set(n);t.has(e)?t.delete(e):t.add(e),r(t)};return(0,Z.jsxs)(`section`,{"aria-label":`Mover`,className:`flex h-[560px] min-h-0 min-w-0 flex-col overflow-hidden rounded-[14px] card border @5xl:h-full`,children:[(0,Z.jsxs)(`header`,{className:`flex items-center gap-4 border-b border-line-soft px-4 py-4`,children:[(0,Z.jsx)(re,{agent:`forgeqe-migrate`,px:28,working:o,decorative:!0}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,Z.jsx)(`span`,{className:`text-sm font-semibold`,children:`Mover`}),(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:o?`Working on it…`:p.length?`${p.length} test${p.length===1?``:`s`} to fix`:`Every test passes`})]}),(0,Z.jsxs)(I,{size:`sm`,variant:`ghost`,disabled:i,onClick:c,"data-tip":`Run every migrated test again`,children:[(0,Z.jsx)(g,{"aria-hidden":`true`}),`Run`]})]}),(0,Z.jsxs)(`ol`,{ref:d,"aria-live":`polite`,className:`m-0 flex min-h-0 flex-1 list-none flex-col gap-4 overflow-y-auto bg-surface-muted p-4`,children:[!m.length&&!h.length&&(0,Z.jsxs)(`li`,{className:`flex flex-col gap-2 rounded-[12px] bg-bg p-4 text-[13px] text-ink-2`,children:[(0,Z.jsx)(`span`,{children:`I fix migrated tests that fail. Pick the tests below and tell me what you know, or just send.`}),p.length>0&&(0,Z.jsxs)(`button`,{type:`button`,disabled:i,onClick:()=>s(p.map(e=>e.id),``),"data-tip":`Fix all failing tests`,className:`inline-flex items-center gap-2 self-start rounded-[8px] border-0 bg-surface-strong px-2 py-2 text-[13px] font-medium text-ink hover:bg-line disabled:opacity-50`,children:[(0,Z.jsx)(a,{size:14,"aria-hidden":`true`}),`Fix all`]})]}),m.map((e,t)=>(0,Z.jsxs)(`li`,{className:D(`flex max-w-[92%] flex-col gap-1`,e.who===`you`?`self-end items-end`:`self-start`),children:[(0,Z.jsxs)(`span`,{className:D(`rounded-[12px] px-4 py-2 text-[13px] leading-relaxed [overflow-wrap:anywhere]`,e.who===`you`?`bg-accent text-accent-ink`:e.tone===`fail`?`border border-fail-soft bg-bg text-ink`:`bg-bg text-ink`),children:[e.who===`agent`&&(0,Z.jsx)(`span`,{className:D(`mr-1 font-semibold`,e.tone===`ok`?`text-pass`:`text-fail`),children:e.tone===`ok`?`✓`:`✗`}),e.text]}),(0,Z.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[e.detail?`${e.detail} · `:``,le(e.at)]})]},t)),h.map((e,t)=>(0,Z.jsxs)(`li`,{className:`flex max-w-[92%] items-start gap-2 self-start rounded-[12px] bg-bg px-4 py-2 text-[13px] text-ink-2`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:D(`flex-none`,e.kind===`ok`?`text-pass`:e.kind===`fail`?`text-fail`:`text-muted`),children:e.kind===`ok`?`✓`:e.kind===`fail`?`✗`:`•`}),(0,Z.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e.text})]},`live-${t}`))]}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-line-soft p-4`,children:[f.length>0&&(0,Z.jsx)(`div`,{role:`group`,"aria-label":`Tests to fix`,className:`flex flex-wrap gap-2`,children:f.map(e=>(0,Z.jsxs)(`button`,{type:`button`,"aria-pressed":n.has(e.id),onClick:()=>v(e.id),className:D(`inline-flex min-h-7 items-center gap-2 rounded-full border px-2 text-[13px]`,n.has(e.id)?`border-accent bg-accent-soft text-ink`:`border-line-soft bg-bg text-ink-2 hover:bg-surface-muted`),children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:D(`size-1.5 rounded-full`,e.ok?`bg-pass`:`bg-fail`)}),Q(e.target)]},e.id))}),(0,Z.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,Z.jsx)(ne,{"aria-label":`Message to the agent`,value:l,rows:2,maxLength:2e3,placeholder:n.size?`What should change? (optional)`:`Pick a test above first`,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!i&&n.size&&(e.preventDefault(),_())},className:`min-h-[44px] flex-1 resize-none`}),(0,Z.jsx)(I,{variant:`primary`,size:`icon`,"aria-label":`Send to the agent`,"data-tip":`Send to the agent`,disabled:i||!n.size,onClick:_,children:(0,Z.jsx)(ee,{"aria-hidden":`true`})})]})]})]})}var He=`@5xl:h-[calc(var(--screen)-320px)] @5xl:min-h-[540px]`;function Ue({d:e,events:t,busy:n,working:r,onFix:i,onCheck:o,onCompare:s}){let c=e.result?.validation?.tests||[],l=e.result?.fixes||[],u=c.filter(e=>!e.ok).map(e=>e.id).join(`,`),[d,f]=(0,X.useState)(()=>c.find(e=>!e.ok)?.id||c[0]?.id||``),[p,m]=(0,X.useState)(()=>new Set(c.filter(e=>!e.ok).map(e=>e.id)));(0,X.useEffect)(()=>m(new Set(u?u.split(`,`):[])),[u]);let h=c.find(e=>e.id===d),g=h&&[...l].reverse().find(e=>e.id===h.id);return c.length?(0,Z.jsxs)(`div`,{className:D(`grid grid-cols-[minmax(0,1fr)] gap-6 @5xl:grid-cols-[minmax(0,1fr)_380px]`,He),children:[(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-col gap-4`,children:[(0,Z.jsx)(B,{label:`Migrated tests`,placeholder:`Find a test`,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`th`,{className:L,children:[`Test `,(0,Z.jsxs)(`span`,{className:`font-normal`,children:[`· `,c.filter(e=>e.ok).length,` of `,c.length,` pass`]})]}),(0,Z.jsx)(`th`,{className:L,children:`Result`}),(0,Z.jsx)(`th`,{className:D(L,`hidden @2xl:table-cell`),children:`Kept from the source`}),(0,Z.jsx)(`th`,{className:D(H,`hidden @3xl:table-cell`),children:`Time`})]}),children:c.map(e=>{let t=[...l].reverse().find(t=>t.id===e.id);return(0,Z.jsxs)(`tr`,{onClick:()=>f(e.id),"aria-selected":d===e.id,className:D(`cursor-pointer border-t border-line-soft`,d===e.id?`bg-accent-soft`:`hover:bg-surface-muted`),children:[(0,Z.jsxs)(`td`,{className:V,children:[(0,Z.jsx)(`button`,{type:`button`,onClick:()=>f(e.id),className:`cursor-pointer border-0 bg-transparent p-0 text-left font-medium text-ink`,children:Q(e.target)}),t&&(0,Z.jsx)(`span`,{className:D(`block text-[13px]`,t.ok?`text-pass`:`text-muted`),children:t.ok?`Fixed by the agent`:`The agent could not fix it`})]}),(0,Z.jsx)(`td`,{className:D(V,`whitespace-nowrap`),children:(0,Z.jsx)(k,{tone:e.ok?`pass`:`fail`,children:e.ok?`Passes`:`Fails`})}),(0,Z.jsxs)(`td`,{className:D(V,`hidden text-[13px] whitespace-nowrap text-ink-2 @2xl:table-cell`),children:[(0,Z.jsxs)(`span`,{className:e.after.tests<e.before.tests?`text-fail`:void 0,children:[e.after.tests,`/`,e.before.tests,` tests`]}),` · `,(0,Z.jsxs)(`span`,{className:e.after.assertions<e.before.assertions?`text-warn`:void 0,children:[e.after.assertions,`/`,e.before.assertions,` checks`]})]}),(0,Z.jsx)(`td`,{className:D(R,`hidden text-[13px] text-muted @3xl:table-cell`),children:e.ms?Se(e.ms):`–`})]},e.id)})}),h&&(0,Z.jsxs)(`section`,{"aria-label":`${Q(h.target)} details`,className:`flex min-h-[260px] flex-1 flex-col overflow-hidden rounded-[12px] card border`,children:[(0,Z.jsxs)(`header`,{className:`flex flex-wrap items-center gap-2 border-b border-line-soft px-4 py-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:Q(h.target)}),(0,Z.jsx)(k,{tone:h.ok?`pass`:`fail`,children:h.ok?`Passes`:h.exitCode===null&&h.ms?`Timed out`:`Fails`}),h.source&&(0,Z.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[`from `,Q(h.source)]}),(0,Z.jsx)(`span`,{className:`flex-1`}),(0,Z.jsxs)(I,{size:`sm`,variant:`ghost`,onClick:()=>s(h.id),children:[(0,Z.jsx)(x,{"aria-hidden":`true`}),`Compare`]}),!h.ok&&(0,Z.jsxs)(I,{size:`sm`,disabled:n,onClick:()=>m(new Set([h.id])),children:[(0,Z.jsx)(a,{"aria-hidden":`true`}),`Fix`]})]}),(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-auto bg-surface-muted px-4 py-4`,children:[h.problems.length>0&&(0,Z.jsx)(`p`,{className:`m-0 text-[13px] text-fail`,children:h.problems.join(` `)}),g&&(0,Z.jsxs)(`p`,{className:D(`m-0 text-[13px]`,g.ok?`text-pass`:`text-ink-2`),children:[g.ok?`Fixed by the agent`:`The agent could not fix it`,g.reason?`: ${g.reason}`:`.`]}),h.command&&(0,Z.jsxs)(`code`,{className:`block font-mono text-[13px] text-muted`,children:[`$ `,h.command]}),(0,Z.jsx)(`pre`,{className:`m-0 flex-1 font-mono text-[13px] leading-relaxed whitespace-pre-wrap text-ink-2`,children:h.output||(h.ok?`${h.after.tests} test${h.after.tests===1?``:`s`} passed in ${Se(h.ms)}.`:`No output.`)})]})]})]}),(0,Z.jsx)(Ve,{d:e,events:t,picked:p,setPicked:m,busy:n,working:r,onFix:i,onCheck:o})]}):(0,Z.jsx)(N,{center:!0,className:`py-6`,children:e.result?`The tests are checked once every file is migrated.`:`Start the migration first.`})}var We={ok:{mark:`✓`,cls:`text-pass`},fail:{mark:`✗`,cls:`text-fail`},info:{mark:`•`,cls:`text-muted`},agent:{mark:`•`,cls:`text-accent-fg`},tool:{mark:`·`,cls:`text-muted`}};function Ge({events:e,running:t}){let n=(0,X.useRef)(null);(0,X.useEffect)(()=>{t&&n.current&&(n.current.scrollTop=n.current.scrollHeight)},[e.length,t]);let r=e.filter(e=>e.kind!==`tool`);return(0,Z.jsxs)(`ol`,{ref:n,"aria-live":t?`polite`:void 0,"aria-label":`Activity`,className:`m-0 flex max-h-[60vh] list-none flex-col overflow-y-auto rounded-[12px] card border p-0`,children:[r.map((e,t)=>(0,Z.jsxs)(`li`,{className:`flex gap-4 border-b border-line-soft px-4 py-2 text-[13px] last:border-b-0`,children:[(0,Z.jsx)(`span`,{className:`w-[64px] flex-none text-[13px] text-muted tabular-nums`,children:new Date(e.ts).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}),(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:D(`w-3 flex-none text-center`,We[e.kind].cls),children:We[e.kind].mark}),(0,Z.jsx)(`span`,{className:D(`min-w-0 flex-1 [overflow-wrap:anywhere]`,e.kind===`fail`?`text-fail`:e.kind===`ok`?`text-ink`:`text-ink-2`),children:e.text})]},t)),!r.length&&(0,Z.jsx)(`li`,{className:`px-4 py-8 text-center text-sm text-muted`,children:`Nothing yet.`})]})}function Ke({id:e,plan:t}){let[n,r]=(0,X.useState)(null),[i,a]=(0,X.useState)(``),[o,s]=(0,X.useState)(`overview`),[l,u]=(0,X.useState)(),[f,m]=(0,X.useState)([]),[_,v]=(0,X.useState)(null),[y,x]=(0,X.useState)(!1),[ee,te]=(0,X.useState)(!1),C=(0,X.useRef)(0),w=(0,X.useCallback)(()=>{M.detail(e).then(e=>{r(e),a(``)},e=>a(e.message)),M.events(e,C.current).then(e=>{e.next<C.current?(C.current=0,m([])):(C.current=e.next,e.events.length&&m(t=>[...t,...e.events].slice(-2e3)))},()=>{})},[e]);(0,X.useEffect)(w,[w]);let T=!!(n?.job?.running||n?.result?.status===`running`);(0,X.useEffect)(()=>{if(!T)return;let e=setInterval(w,1500);return()=>clearInterval(e)},[T,w]);let E=async e=>{x(!0),a(``);try{r(await e()),setTimeout(w,800)}catch(e){a(e.message)}finally{x(!1)}};if(!n)return i?(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:i}):(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`});let D=Re(n),O=_e(n.plan,n.result),A=n.result,j=(A?.validation?.tests||[]).filter(e=>!e.ok).length,N=[{id:`overview`,label:`Overview`},{id:`tests`,label:`Tests`,n:A?.validation?`${A.validation.tests.length-j}/${A.validation.tests.length}`:void 0,tone:j?`text-fail`:void 0},{id:`compare`,label:`Compare`},{id:`activity`,label:`Activity`}];return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`a`,{href:F(`migration`,`migrations`),className:`inline-flex items-center gap-2 self-start text-sm`,children:[(0,Z.jsx)(p,{size:16,"aria-hidden":`true`}),`All migrations`]}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4 @3xl:flex-row @3xl:items-start`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,Z.jsxs)(`h2`,{className:`m-0 flex flex-wrap items-center gap-x-2 gap-y-1 text-[20px] leading-snug font-semibold tracking-[-0.01em]`,children:[(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[n.plan.source.stack&&(0,Z.jsx)(Y,{framework:n.plan.source.stack.framework,language:n.plan.source.stack.language,size:22}),n.plan.source.title]}),(0,Z.jsx)(b,{size:18,"aria-hidden":`true`,className:`text-muted`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`to`}),(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,Z.jsx)(Y,{framework:n.plan.target.id.split(`-`)[0],language:n.plan.target.id.split(`-`).slice(1).join(`-`),size:20}),n.plan.target.title]})]}),(0,Z.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-sm text-muted`,children:[(0,Z.jsx)(J,{kind:n.origin.kind,label:n.origin.label,size:15}),(0,Z.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:me(n.origin.label)}),(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,Z.jsxs)(`span`,{children:[`into `,(0,Z.jsx)(`span`,{className:`font-mono text-[13px]`,children:n.plan.target.dir})]})]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(k,{tone:D.tone,children:D.label}),T?(0,Z.jsxs)(I,{variant:`danger`,disabled:y,onClick:()=>void E(()=>M.stop(e)),children:[(0,Z.jsx)(S,{fill:`currentColor`,"aria-hidden":`true`}),`Stop`]}):(0,Z.jsxs)(Z.Fragment,{children:[A?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(I,{variant:`ghost`,onClick:()=>M.report(e).then(e=>v(e.text),()=>v(``)),children:[(0,Z.jsx)(h,{"aria-hidden":`true`}),`Report`]}),(0,Z.jsxs)(I,{disabled:y,onClick:()=>void E(()=>M.verify(e)),"data-tip":`Check again: run every migrated test again`,children:[(0,Z.jsx)(g,{"aria-hidden":`true`}),`Run`]})]}):null,(0,Z.jsxs)(I,{variant:`ghost`,disabled:y,onClick:()=>te(!0),"data-tip":`Remove this plan from the list. Converted tests stay.`,children:[(0,Z.jsx)(d,{"aria-hidden":`true`}),`Delete`]})]})]})]}),ee&&(0,Z.jsx)(ze,{id:e,title:`${n.plan.source.title} → ${n.plan.target.title}`,targetDir:n.plan.target.dir,onClose:()=>te(!1)}),A&&(0,Z.jsxs)(`div`,{className:`flex items-center gap-4 rounded-[12px] card border px-4 py-2 @xl:gap-4 @xl:px-4`,children:[(0,Z.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,Z.jsx)(fe,{ids:Le,states:A.stages})}),T&&(0,Z.jsxs)(`span`,{className:`flex-none text-[13px] font-semibold tabular-nums text-accent-fg`,"aria-label":`${Math.round(O)}% done`,children:[Math.round(O),`%`]})]}),i&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:i}),(0,Z.jsx)(W,{prefix:`mtab`,className:`mb-0`,tabs:N,current:o,onPick:s,label:`Migration`}),(0,Z.jsxs)(`div`,{role:`tabpanel`,id:`mtab-panel-${o}`,"aria-labelledby":`mtab-${o}`,className:`flex min-w-0 flex-col gap-4`,children:[o===`overview`&&(0,Z.jsx)(Be,{d:n,planView:t(n)}),o===`tests`&&(0,Z.jsx)(Ue,{d:n,events:f,busy:y||T,working:T,onFix:(t,n)=>void E(()=>M.fix(e,t,n)),onCheck:()=>void E(()=>M.verify(e)),onCompare:e=>(u(e),s(`compare`))}),o===`compare`&&(0,Z.jsx)(Ie,{id:e,plan:n.plan,result:A,initial:l}),o===`activity`&&(0,Z.jsx)(Ge,{events:f,running:T})]}),(0,Z.jsx)(z,{open:_!==null,onClose:()=>v(null),wide:!0,title:`Report`,description:`migrate.md for ${n.plan.id}`,footer:(0,Z.jsxs)(I,{onClick:()=>v(null),children:[(0,Z.jsx)(c,{"aria-hidden":`true`}),`Close`]}),children:_?(0,Z.jsx)(se,{text:_}):(0,Z.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No report yet.`})})]})}var qe=[{id:`git`,label:`Git`},{id:`folder`,label:`Folder`},{id:`upload`,label:`Upload`},{id:`paste`,label:`Paste`},{id:`project`,label:`This project`},{id:`tosca`,label:`Tosca`}],Je=[`Source`,`Target`,`Instructions`,`Review`],Ye=[`Keep one page object per page, in pages/.`,`Read the base URL from BASE_URL.`,`Keep test names as they are.`],Xe=[`Where the tests are`,`Framework and language`,`Your rules, optional`,`Check and start`];function Ze({at:e,reached:t,onGo:n}){return(0,Z.jsx)(`nav`,{"aria-label":`Steps`,children:(0,Z.jsx)(`ol`,{className:`m-0 flex list-none items-center gap-2 p-0`,children:Je.map((r,i)=>{let a=i<=t,o=i===e,s=i<t&&!o;return(0,Z.jsxs)(`li`,{className:D(`flex items-center gap-2`,i<Je.length-1&&`flex-1`),children:[(0,Z.jsxs)(`button`,{type:`button`,disabled:!a,"aria-current":o?`step`:void 0,onClick:()=>n(i),"aria-label":r,"data-tip":Xe[i],className:D(`inline-flex min-h-8 flex-none items-center gap-2 rounded-[8px] border-0 bg-transparent px-1 text-[13px] whitespace-nowrap`,a&&!o?`cursor-pointer hover:bg-surface-strong`:``),children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:D(`inline-flex size-6 flex-none items-center justify-center rounded-full text-[13px] font-semibold tabular-nums`,s?`bg-pass text-white`:o?`bg-accent text-accent-ink`:`border border-line bg-bg text-muted`),children:s?(0,Z.jsx)(w,{size:13,strokeWidth:3}):i+1}),(0,Z.jsx)(`span`,{className:D(o?`font-medium text-ink`:a?`text-ink-2`:`text-muted`,!o&&`hidden @xl:inline`),children:r})]}),i<Je.length-1&&(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`h-0.5 min-w-4 flex-1 overflow-hidden rounded-full bg-line @xl:min-w-8`,children:(0,Z.jsx)(`span`,{className:D(`block h-full rounded-full bg-pass transition-[width] duration-250 ease-out`,i<t?`w-full`:`w-0`)})})]},r)})})})}function $({id:e,label:t,help:n,children:r}){return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`label`,{htmlFor:e,className:`text-sm font-medium`,children:t}),r,n&&(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:n})]})}function Qe({busy:e,onBack:t,next:n,onNext:r,disabled:i,aside:a}){return(0,Z.jsxs)(`div`,{className:`sticky bottom-0 flex flex-wrap items-center gap-4 border-t border-line-soft bg-bg py-4`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 text-[13px]`,children:a}),t&&(0,Z.jsxs)(I,{variant:`ghost`,disabled:e,onClick:t,children:[(0,Z.jsx)(p,{"aria-hidden":`true`}),`Back`]}),(0,Z.jsx)(I,{variant:`primary`,disabled:e||i,onClick:r,children:n})]})}function $e({d:e}){let t=e.counts,n=[`${t.tests} test file${t.tests===1?``:`s`}`,`${t.support} support file${t.support===1?``:`s`}`,...t.features?[`${t.features} feature file${t.features===1?``:`s`}`]:[],...t.data?[`${t.data} data file${t.data===1?``:`s`}`]:[]];return(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 rounded-[12px] bg-surface-muted px-4 py-4 text-sm`,children:[e.stack?(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-2 font-medium`,children:[(0,Z.jsx)(Y,{framework:e.stack.framework,language:e.stack.language}),e.title]}):(0,Z.jsx)(k,{tone:`warn`,children:`Framework not detected`}),(0,Z.jsx)(`span`,{className:`text-ink-2`,children:n.join(` · `)}),t.skipped>0&&(0,Z.jsxs)(`span`,{className:`text-muted`,children:[`· `,t.skipped,` left out (links, large files)`]})]})}async function et(e,t,n){let r=[],i=0,a=null,o=0,s=async()=>{r.length&&(a=await M.files(e,r),o+=r.length,n(o),r=[],i=0)};for(let e of t){let t=e.webkitRelativePath||``,n=t&&t.split(`/`).slice(1).join(`/`)||e.name,a=new Uint8Array(await e.arrayBuffer()),o=``;for(let e=0;e<a.length;e+=32768)o+=String.fromCharCode(...a.subarray(e,e+32768));let c=btoa(o);i+c.length>8388608&&await s(),r.push({path:n,data:c}),i+=c.length}return await s(),a}var tt=e=>(e.webkitRelativePath||e.name).split(`/`).some(e=>e.startsWith(`.`)||e===`node_modules`);function nt({view:e,kind:n,setKind:r,src:a,setSrc:o,from:l,setFrom:f,stack:p,setStack:m,custom:h,setCustom:g,found:v,setFound:b}){let[x,ee]=(0,X.useState)(``),[S,T]=(0,X.useState)(``),[E,D]=(0,X.useState)(null),[j,N]=(0,X.useState)(``),[L,re]=(0,X.useState)(e.credentials),[R,z]=(0,X.useState)(null),[B,V]=(0,X.useState)(``),[H,U]=(0,X.useState)([{path:``,text:``}]),[W,ae]=(0,X.useState)(``),[oe,se]=(0,X.useState)(``),[ce,le]=(0,X.useState)(``),ue=(0,X.useRef)(null),de=(0,X.useRef)(null);(0,X.useEffect)(()=>{ue.current?.setAttribute(`webkitdirectory`,``)},[n,a]);let G=a?.workspace,K=async(e,t)=>{ae(e),se(``),le(``);try{await t()}catch(e){se(e.message)}finally{ae(``)}},fe=e=>{o(e),f(`.`),b(e.discovery)};(0,X.useEffect)(()=>{if(n!==`project`)return;let e=setTimeout(()=>M.discover(void 0,l||`.`).then(b,()=>b(null)),300);return()=>clearTimeout(e)},[n,l,b]);let pe=e=>{let t=e.filter(e=>!tt(e));if(!t.length)return se(`Nothing to send: every file is hidden or a dependency.`);K(`upload`,async()=>{let n=e[0],r=await M.source({kind:`upload`,label:n?.webkitRelativePath?n.webkitRelativePath.split(`/`)[0]:`${t.length} files`});await et(r.workspace.id,t,e=>le(`Sending ${e} of ${t.length} files…`)),fe(await M.finish(r.workspace.id))})},he=n===`project`||!!G?.ready;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Z.jsx)(ie,{label:`Where the tests come from`,value:n,onChange:e=>{e!==n&&(r(e),o(null),b(null),se(``),f(e===`project`?``:`.`))},options:qe.map(e=>({id:e.id,label:e.label,icon:(0,Z.jsx)(De,{logo:we[e.id].Logo,icon:we[e.id].Icon,size:16})}))}),oe&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:oe}),G?.ready?(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4 rounded-[12px] card border px-4 py-4`,children:[(0,Z.jsx)(J,{kind:G.kind,label:G.label,size:22}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1 text-sm`,children:[(0,Z.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:me(G.label)}),G.branch&&(0,Z.jsxs)(`span`,{className:`text-muted`,children:[` · `,G.branch]}),(0,Z.jsxs)(`span`,{className:`text-muted`,children:[` · `,G.files,` files`]})]}),(0,Z.jsx)(k,{tone:`pass`,children:`Ready`}),(0,Z.jsxs)(I,{variant:`ghost`,size:`sm`,onClick:()=>(o(null),b(null)),children:[(0,Z.jsx)(_,{"aria-hidden":`true`}),`Change`]})]}):n===`git`?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)($,{id:`mig-url`,label:`Repository URL`,help:(0,Z.jsxs)(`span`,{className:`inline-flex flex-wrap items-center gap-x-4 gap-y-1`,children:[`Works with `,Oe.map(e=>(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,Z.jsx)(De,{logo:e.Logo,size:14}),e.name]},e.name)),` and any git server over https or ssh.`]}),children:(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Z.jsxs)(`span`,{className:`relative min-w-0 flex-[1_1_300px]`,children:[(0,Z.jsx)(`span`,{className:`pointer-events-none absolute top-1/2 left-3 -translate-y-1/2`,children:(0,Z.jsx)(De,{logo:Te(x).Logo,size:18})}),(0,Z.jsx)(O,{id:`mig-url`,value:x,spellCheck:!1,maxLength:500,placeholder:`https://github.com/org/ui-tests.git`,onChange:e=>(ee(e.target.value),D(null)),className:`w-full pl-10`})]}),(0,Z.jsxs)(I,{disabled:!!W||!x.trim(),"data-tip":`Test the connection`,onClick:()=>void K(`test`,async()=>{let e=await M.testRepository(x.trim(),j||void 0);D(e.branches),!S&&e.head&&T(e.head),le(`Connected · ${e.branches.length} branch${e.branches.length===1?``:`es`}`)}),children:[(0,Z.jsx)(i,{"aria-hidden":`true`}),W===`test`?`Testing…`:`Test`]})]})}),(0,Z.jsxs)(`div`,{className:`grid gap-4 @xl:grid-cols-2`,children:[(0,Z.jsx)($,{id:`mig-branch`,label:`Branch`,children:E?.length?(0,Z.jsx)(P,{id:`mig-branch`,value:S,onChange:e=>T(e.target.value),children:E.map(e=>(0,Z.jsx)(`option`,{value:e,children:e},e))}):(0,Z.jsx)(O,{id:`mig-branch`,value:S,spellCheck:!1,maxLength:200,placeholder:`Default branch`,onChange:e=>T(e.target.value)})}),(0,Z.jsx)($,{id:`mig-token`,label:`Access token`,help:R?void 0:(0,Z.jsx)(`button`,{type:`button`,onClick:()=>z({name:`REPO_TOKEN`,value:``}),className:`cursor-pointer border-0 bg-transparent p-0 text-[13px] text-accent-fg underline`,children:`Add a token`}),children:(0,Z.jsxs)(P,{id:`mig-token`,value:j,onChange:e=>N(e.target.value),children:[(0,Z.jsx)(`option`,{value:``,children:`None (public, or ssh)`}),L.map(e=>(0,Z.jsx)(`option`,{value:e,children:e},e))]})})]}),R&&(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2 rounded-[12px] bg-surface-muted p-4`,children:[(0,Z.jsx)($,{id:`mig-token-name`,label:`Name`,children:(0,Z.jsx)(O,{id:`mig-token-name`,value:R.name,spellCheck:!1,maxLength:64,onChange:e=>z({...R,name:e.target.value.toUpperCase().replace(/[^A-Z0-9_]/g,`_`)}),className:`w-[180px]`})}),(0,Z.jsx)($,{id:`mig-token-value`,label:`Token`,children:(0,Z.jsx)(O,{id:`mig-token-value`,type:`password`,autoComplete:`off`,value:R.value,onChange:e=>z({...R,value:e.target.value}),className:`w-[260px] max-w-full`})}),(0,Z.jsxs)(I,{disabled:!!W||!R.name||!R.value,onClick:()=>void K(`token`,async()=>{await A.saveSecrets({[R.name]:R.value}),re([...new Set([...L,R.name])].sort()),N(R.name),z(null)}),children:[(0,Z.jsx)(w,{"aria-hidden":`true`}),`Save`]}),(0,Z.jsxs)(I,{variant:`ghost`,onClick:()=>z(null),children:[(0,Z.jsx)(c,{"aria-hidden":`true`}),`Cancel`]}),(0,Z.jsx)(`span`,{className:`w-full text-[13px] text-muted`,children:`Kept in ForgeQE's credential store, never in the URL or on this page.`})]}),(0,Z.jsx)(`div`,{children:(0,Z.jsxs)(I,{variant:`primary`,disabled:!!W||!x.trim(),onClick:()=>void K(`clone`,async()=>fe(await M.source({kind:`git`,url:x.trim(),...S?{branch:S}:{},...j?{tokenVar:j}:{}}))),children:[(0,Z.jsx)(y,{"aria-hidden":`true`}),W===`clone`?`Cloning…`:`Clone`]})})]}):n===`folder`?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)($,{id:`mig-folder`,label:`Folder path`,help:`Copied first; the folder itself is never changed.`,children:(0,Z.jsx)(O,{id:`mig-folder`,value:B,spellCheck:!1,maxLength:1e3,placeholder:`/home/me/projects/shop-ui-tests`,onChange:e=>V(e.target.value)})}),(0,Z.jsx)(`div`,{children:(0,Z.jsxs)(I,{variant:`primary`,disabled:!!W||!B.trim(),onClick:()=>void K(`copy`,async()=>fe(await M.source({kind:`folder`,folder:B.trim()}))),"data-tip":`Use this folder`,children:[(0,Z.jsx)(w,{"aria-hidden":`true`}),W===`copy`?`Copying…`:`Use`]})})]}):n===`upload`?(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-4 rounded-[14px] border border-dashed border-line px-6 py-10 text-center`,children:[(0,Z.jsx)(`p`,{className:`m-0 text-sm text-ink-2`,children:`Choose a folder of tests, or some files.`}),(0,Z.jsx)(`input`,{ref:ue,type:`file`,multiple:!0,hidden:!0,onChange:e=>e.target.files&&pe([...e.target.files])}),(0,Z.jsx)(`input`,{ref:de,type:`file`,multiple:!0,hidden:!0,onChange:e=>e.target.files&&pe([...e.target.files])}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap justify-center gap-2`,children:[(0,Z.jsxs)(I,{variant:`primary`,disabled:!!W,onClick:()=>ue.current?.click(),"data-tip":`Choose a folder`,children:[(0,Z.jsx)(t,{"aria-hidden":`true`}),`Browse`]}),(0,Z.jsxs)(I,{disabled:!!W,onClick:()=>de.current?.click(),"data-tip":`Choose files`,children:[(0,Z.jsx)(C,{"aria-hidden":`true`}),`Files`]})]})]}):n===`tosca`?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4 rounded-[12px] card border px-4 py-4 text-sm`,children:[(0,Z.jsx)(`p`,{className:`m-0`,children:`A Tosca export (.tsu) has steps of its own: its test cases, where they run and their test data. Every Tosca step and check is kept.`}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Z.jsxs)(I,{variant:`primary`,onClick:()=>location.hash=F(`tosca`),"data-tip":`The assistant asks one thing at a time`,children:[(0,Z.jsx)(te,{"aria-hidden":`true`}),`Help me choose`]}),(0,Z.jsxs)(I,{variant:`ghost`,onClick:()=>location.hash=F(`tosca`,`new`),children:[(0,Z.jsx)(u,{"aria-hidden":`true`}),`Set every option yourself`]})]})]}):n===`paste`?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[H.map((e,t)=>(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(O,{"aria-label":`File ${t+1} name`,value:e.path,spellCheck:!1,maxLength:300,placeholder:t?`pages/LoginPage.java`:`tests/LoginTest.java`,onChange:e=>U(H.map((n,r)=>r===t?{...n,path:e.target.value}:n)),className:`max-w-[360px]`}),H.length>1&&(0,Z.jsx)(I,{variant:`icon`,size:`icon`,"aria-label":`Remove file ${t+1}`,"data-tip":`Remove file ${t+1}`,onClick:()=>U(H.filter((e,n)=>n!==t)),children:(0,Z.jsx)(d,{"aria-hidden":`true`})})]}),(0,Z.jsx)(ne,{"aria-label":`File ${t+1} code`,value:e.text,rows:7,spellCheck:!1,placeholder:`Paste the code`,onChange:e=>U(H.map((n,r)=>r===t?{...n,text:e.target.value}:n)),className:`font-mono`})]},t)),(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Z.jsxs)(I,{variant:`ghost`,onClick:()=>U([...H,{path:``,text:``}]),"data-tip":`Add a file`,children:[(0,Z.jsx)(s,{"aria-hidden":`true`}),`Add`]}),(0,Z.jsx)(`span`,{className:`flex-1`}),(0,Z.jsxs)(I,{variant:`primary`,disabled:!!W||H.some(e=>!e.path.trim()||!e.text.trim()),onClick:()=>void K(`paste`,async()=>{let e=await M.source({kind:`paste`});await M.files(e.workspace.id,H.map(e=>({path:e.path.trim(),text:e.text}))),fe(await M.finish(e.workspace.id))}),"data-tip":`Use this code`,children:[(0,Z.jsx)(w,{"aria-hidden":`true`}),W===`paste`?`Adding…`:`Use`]})]})]}):null,ce&&!oe&&(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:ce}),he&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`grid gap-4 @xl:grid-cols-2`,children:[(0,Z.jsx)($,{id:`mig-from`,label:`Tests folder`,children:n===`project`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(O,{id:`mig-from`,list:`mig-folders`,value:l,spellCheck:!1,maxLength:300,placeholder:`Whole project`,onChange:e=>f(e.target.value)}),(0,Z.jsx)(`datalist`,{id:`mig-folders`,children:e.folders.map(e=>(0,Z.jsx)(`option`,{value:e},e))})]}):(0,Z.jsxs)(P,{id:`mig-from`,value:l||`.`,onChange:e=>(f(e.target.value),G&&M.discover(G.id,e.target.value).then(b,()=>{})),children:[(0,Z.jsx)(`option`,{value:`.`,children:`All of it`}),(a?.folders||[]).map(e=>(0,Z.jsx)(`option`,{value:e,children:e},e))]})}),(0,Z.jsx)($,{id:`mig-stack`,label:`Framework`,children:(0,Z.jsxs)(P,{id:`mig-stack`,value:p,onChange:e=>m(e.target.value),children:[(0,Z.jsx)(`option`,{value:``,children:v?.stack?`${v.title} (detected)`:`Detect`}),e.sources.map(e=>(0,Z.jsx)(`option`,{value:e.id,children:e.title},e.id)),(0,Z.jsx)(`option`,{value:`other`,children:`Other (name it)`})]})})]}),p===`other`&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($,{id:`mig-source-name`,label:`Framework name`,help:`Shown in the plan, such as JMeter or Karate.`,children:(0,Z.jsx)(O,{id:`mig-source-name`,value:h.name,maxLength:40,placeholder:`JMeter`,onChange:e=>g({...h,name:e.target.value})})}),(0,Z.jsxs)(`div`,{className:`grid gap-4 @xl:grid-cols-2`,children:[(0,Z.jsx)($,{id:`mig-tests`,label:`Test file types`,help:`Such as *.jmx or *.feature.`,children:(0,Z.jsx)(O,{id:`mig-tests`,value:h.tests,spellCheck:!1,maxLength:120,placeholder:`*.jmx`,onChange:e=>g({...h,tests:e.target.value})})}),(0,Z.jsx)($,{id:`mig-support`,label:`Support file types (optional)`,help:`Code the tests use, such as *.groovy.`,children:(0,Z.jsx)(O,{id:`mig-support`,value:h.support,spellCheck:!1,maxLength:120,placeholder:`None`,onChange:e=>g({...h,support:e.target.value})})})]})]}),v&&(0,Z.jsx)($e,{d:v})]})]})}function rt({on:e,onPick:t,logo:n,title:r,sub:i,label:a}){return(0,Z.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":e,"aria-label":a,onClick:t,className:D(`flex min-h-[72px] min-w-0 cursor-pointer items-center gap-4 rounded-[12px] border px-4 py-4 text-left transition-colors`,e?`border-accent bg-accent-soft ring-1 ring-accent`:`border-line-soft bg-bg hover:border-line hover:bg-surface-muted`),children:[(0,Z.jsx)(`span`,{className:`inline-flex size-9 flex-none items-center justify-center rounded-[10px] bg-surface-muted`,children:n}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,Z.jsx)(`span`,{className:`truncate text-sm font-medium text-ink`,children:r}),i&&(0,Z.jsx)(`span`,{className:`truncate text-[13px] text-muted`,children:i})]})]})}var it={playwright:`Microsoft`,cypress:`JavaScript only`,webdriverio:`WebDriver and BiDi`,selenium:`WebDriver`};function at({view:e,to:t,setTo:n,other:r,setOther:i,into:a,setInto:o,only:c,setOnly:l}){let u=e=>e.split(`-`)[0],d=e=>e.split(`-`).slice(1).join(`-`),f=[...new Map(e.targets.map(e=>[u(e.id),e.framework])).entries()],p=r===null?u(t):``,m=e.targets.filter(e=>u(e.id)===p);return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Z.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2 border-0 p-0`,children:[(0,Z.jsx)(`legend`,{className:`mb-2 text-sm font-medium`,children:`Framework`}),(0,Z.jsxs)(`div`,{role:`radiogroup`,"aria-label":`Framework`,className:`grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2`,children:[f.map(([r,a])=>{let o=Ae[r];return(0,Z.jsx)(rt,{on:p===r,onPick:()=>(i(null),n((e.targets.find(e=>u(e.id)===r&&d(e.id)===d(t))||e.targets.find(e=>u(e.id)===r)).id)),logo:o?(0,Z.jsx)(o,{width:22,height:22,"aria-hidden":`true`}):null,title:a,sub:it[r],label:a},r)}),(0,Z.jsx)(rt,{on:r!==null,onPick:()=>i(r??``),logo:(0,Z.jsx)(s,{size:18,"aria-hidden":`true`,className:`text-ink-2`}),title:`Other`,sub:`Type the framework`,label:`Other framework`})]})]}),r===null?(0,Z.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2 border-0 p-0`,children:[(0,Z.jsx)(`legend`,{className:`mb-2 text-sm font-medium`,children:`Language`}),(0,Z.jsx)(`div`,{role:`radiogroup`,"aria-label":`Language`,className:`grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2`,children:m.map(e=>{let r=ke[d(e.id)];return(0,Z.jsx)(rt,{on:t===e.id,onPick:()=>n(e.id),logo:r?(0,Z.jsx)(r,{width:22,height:22,"aria-hidden":`true`}):null,title:e.language,sub:e.title.includes(`(`)&&e.title.slice(e.title.indexOf(`(`)+1,-1).replace(e.language,``).replace(/^,\s*/,``)||void 0,label:e.language},e.id)})})]}):(0,Z.jsx)($,{id:`mig-other`,label:`Which framework and language?`,help:`ForgeQE checks it against what it can run, and says so before anything starts.`,children:(0,Z.jsx)(O,{id:`mig-other`,value:r,maxLength:120,autoFocus:!0,placeholder:`Playwright with Java, WebdriverIO TypeScript…`,onChange:e=>i(e.target.value)})}),(0,Z.jsxs)(`div`,{className:`grid gap-4 @2xl:grid-cols-2`,children:[(0,Z.jsx)($,{id:`mig-into`,label:`Output folder`,help:`A new folder. Empty: named after the source and the target.`,children:(0,Z.jsx)(O,{id:`mig-into`,value:a,spellCheck:!1,maxLength:300,placeholder:`tests-playwright`,onChange:e=>o(e.target.value)})}),(0,Z.jsx)($,{id:`mig-only`,label:`Only some tests (optional)`,help:`A pattern, such as checkout/** or **/*Login*.`,children:(0,Z.jsx)(O,{id:`mig-only`,value:c,spellCheck:!1,maxLength:200,placeholder:`All tests`,onChange:e=>l(e.target.value)})})]})]})}function ot({view:e,kind:t,src:n,found:r,to:i,other:a,instructions:o}){let s=e.targets.find(e=>e.id===i),c=(e,t)=>(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 border-b border-line-soft py-4 first:pt-0 last:border-b-0 last:pb-0`,children:[(0,Z.jsx)(`span`,{className:`text-[13px] font-medium text-muted`,children:e}),(0,Z.jsx)(`div`,{className:`text-sm`,children:t})]});return(0,Z.jsxs)(`aside`,{"aria-label":`Summary`,className:`flex flex-col rounded-[14px] card border p-6`,children:[c(`Source`,n?.workspace?.ready||t===`project`&&r?(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(J,{kind:n?.workspace?.kind||`project`,label:n?.workspace?.label,size:18}),(0,Z.jsx)(`span`,{className:`truncate font-medium`,children:n?.workspace?me(n.workspace.label):`This project`})]}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`Not picked yet`})),c(`Tests found`,r?.stack?(0,Z.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,Z.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,Z.jsx)(Y,{framework:r.stack.framework,language:r.stack.language}),r.title]}),(0,Z.jsxs)(`span`,{className:`text-[13px] text-ink-2`,children:[r.counts.tests,` test files · `,r.counts.support,` support files`]})]}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`–`})),c(`Target`,a===null?s?(0,Z.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,Z.jsx)(Y,{framework:s.id.split(`-`)[0],language:s.id.split(`-`).slice(1).join(`-`)}),s.title]}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`–`}):(0,Z.jsx)(`span`,{className:a.trim()?`font-medium`:`text-muted`,children:a.trim()||`Type it in`})),c(`Instructions`,o.trim()?(0,Z.jsx)(`span`,{className:`line-clamp-3 text-ink-2`,children:o.trim()}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`None`}))]})}function st({view:e,review:t,onStart:n}){let[r,i]=(0,X.useState)(0),[a,o]=(0,X.useState)(0),[c,l]=(0,X.useState)(`git`),[u,d]=(0,X.useState)(null),[f,p]=(0,X.useState)(`.`),[m,h]=(0,X.useState)(``),[_,y]=(0,X.useState)({name:``,tests:``,support:``}),[x,ee]=(0,X.useState)(null),[S,te]=(0,X.useState)(e.targets[0]?.id||``),[C,w]=(0,X.useState)(null),[T,E]=(0,X.useState)(``),[D,O]=(0,X.useState)(``),[k,A]=(0,X.useState)(``),[j,N]=(0,X.useState)(null),[P,F]=(0,X.useState)(!1),[I,L]=(0,X.useState)(!1),[re,R]=(0,X.useState)(``);(0,X.useEffect)(()=>{N(null),F(!1),o(e=>Math.min(e,2))},[c,u,f,m,_,D,S,C,T,k]);let z=e=>{i(e),o(t=>Math.max(t,e)),R(``)},B=c===`project`||!!u?.workspace?.ready,V=async()=>{L(!0),R(``);try{let e=await M.plan({...c!==`project`&&u?.workspace?{workspace:u.workspace.id}:{},...f.trim()&&f!==`.`?{from:f.trim()}:{},...m?{stack:m}:{},...m===`other`?{sourceName:_.name.trim(),tests:_.tests.trim(),support:_.support.trim()}:{},...C===null?{to:S}:{to:``,toText:C.trim()},...T.trim()?{into:T.trim()}:{},...D.trim()?{only:D.trim()}:{},...k.trim()?{instructions:k.trim()}:{}});N(e),z(3)}catch(e){R(e.message)}finally{L(!1)}},H=j?.plan,U=H?.feasibility.findings.some(e=>e.level===`limit`),W=H?.feasibility.verdict===`blocked`;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Z.jsx)(Ze,{at:r,reached:a,onGo:e=>!I&&(e<3||j)&&i(e)}),(0,Z.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] items-start gap-6 @5xl:grid-cols-[minmax(0,1fr)_280px]`,children:[(0,Z.jsxs)(`section`,{"aria-labelledby":`mig-step`,className:`flex min-w-0 flex-col gap-6`,children:[(0,Z.jsx)(`h2`,{id:`mig-step`,className:`m-0 text-[20px] font-semibold tracking-[-0.01em]`,children:[`Where are the tests?`,`What should they become?`,`Anything the agent should know?`,`Review and start`][r]}),re&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:re}),r===0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(nt,{view:e,kind:c,setKind:l,src:u,setSrc:d,from:f,setFrom:p,stack:m,setStack:h,custom:_,setCustom:y,found:x,setFound:ee}),c!==`tosca`&&(0,Z.jsx)(Qe,{busy:I,next:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(b,{"aria-hidden":`true`}),`Continue`]}),onNext:()=>z(1),disabled:!B||m===`other`&&!_.tests.trim()})]}),r===1&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(at,{view:e,to:S,setTo:te,other:C,setOther:w,into:T,setInto:E,only:D,setOnly:O}),(0,Z.jsx)(Qe,{busy:I,onBack:()=>i(0),next:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(b,{"aria-hidden":`true`}),`Continue`]}),onNext:()=>z(2),disabled:C===null?!S:!C.trim()})]}),r===2&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($,{id:`mig-instructions`,label:`Instructions (optional)`,help:`Style and structure for the new code. Every test and check is kept either way.`,children:(0,Z.jsx)(ne,{id:`mig-instructions`,value:k,rows:6,maxLength:4e3,placeholder:`Page objects go in pages/, one class per page.`,onChange:e=>A(e.target.value)})}),(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:Ye.map(e=>(0,Z.jsxs)(`button`,{type:`button`,disabled:k.includes(e),onClick:()=>A(k.trim()?`${k.trim()}\n${e}`:e),className:`inline-flex min-h-8 cursor-pointer items-center gap-2 rounded-[8px] border-0 bg-surface-strong px-2 text-[13px] text-ink hover:bg-line disabled:cursor-default disabled:opacity-50`,children:[(0,Z.jsx)(s,{size:13,"aria-hidden":`true`}),e]},e))}),(0,Z.jsx)(Qe,{busy:I,onBack:()=>i(1),next:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(v,{"aria-hidden":`true`}),I?`Checking…`:`Check`]}),onNext:()=>void V(),aside:(0,Z.jsx)(`span`,{className:`text-muted`,children:`Nothing is changed yet.`})})]}),r===3&&H&&(0,Z.jsxs)(Z.Fragment,{children:[t(H,P,F),(0,Z.jsx)(Qe,{busy:I,onBack:()=>i(2),next:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(g,{"aria-hidden":`true`}),`Start`]}),disabled:W||U&&!P,onNext:()=>n(j,!!U&&P),aside:(0,Z.jsx)(`span`,{className:`text-muted`,children:W?`Change what is not possible first.`:U&&!P?`Accept the limits to start.`:`Runs in the background.`})})]})]}),(0,Z.jsx)(`div`,{className:`@5xl:sticky @5xl:top-6`,children:(0,Z.jsx)(ot,{view:e,kind:c,src:u,found:x,to:S,other:C,instructions:k})})]})]})}function ct({error:e}){return e?(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:e}):null}function lt({finding:e}){let t=e.hits||[],n=e.files?.length||0;if(!t.length)return n?(0,Z.jsxs)(`span`,{className:`text-muted`,children:[` (`,n,` file`,n===1?``:`s`,`)`]}):null;let r=n-new Set(t.map(e=>e.file)).size;return(0,Z.jsxs)(`details`,{className:`mt-1 text-[13px]`,children:[(0,Z.jsxs)(`summary`,{className:`cursor-pointer text-muted hover:text-ink`,children:[`Found in `,n||t.length,` file`,(n||t.length)===1?``:`s`]}),(0,Z.jsxs)(`ul`,{className:`m-0 mt-2 flex list-none flex-col gap-2 p-0`,children:[t.map(e=>(0,Z.jsxs)(`li`,{className:`min-w-0`,children:[(0,Z.jsxs)(`span`,{className:`font-mono text-[13px] text-ink-2 [overflow-wrap:anywhere]`,children:[e.file,`:`,e.line]}),(0,Z.jsx)(`code`,{className:`mt-1 block overflow-x-auto rounded-[8px] bg-bg px-2 py-1 font-mono text-[13px] whitespace-pre text-ink`,children:e.code})]},`${e.file}:${e.line}`)),r>0&&(0,Z.jsxs)(`li`,{className:`text-muted`,children:[`and `,r,` more file`,r===1?``:`s`]})]})]})}function ut({plan:e,accepted:t,onAccept:n}){let r=e.feasibility.findings.filter(e=>e.level===`blocker`),i=e.feasibility.findings.filter(e=>e.level===`limit`),a=e.units.filter(e=>e.kind===`test`).length,o=e.units.filter(e=>e.kind===`support`).length;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Z.jsxs)(`dl`,{className:`m-0 grid gap-x-6 gap-y-2 rounded-[14px] card border px-6 py-4 text-sm @xl:grid-cols-[auto_1fr]`,children:[(0,Z.jsx)(`dt`,{className:`text-muted`,children:`From`}),(0,Z.jsxs)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:[e.source.title,(0,Z.jsxs)(`span`,{className:`text-muted`,children:[` `,`· `,e.workspace?me(e.workspace.label):`this project`,e.source.dir===`.`?``:`/${e.source.dir}`]})]}),(0,Z.jsx)(`dt`,{className:`text-muted`,children:`To`}),(0,Z.jsxs)(`dd`,{className:`m-0`,children:[e.target.title,(0,Z.jsxs)(`span`,{className:`text-muted`,children:[` · `,e.target.dir]})]}),(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Files`}),(0,Z.jsxs)(`dd`,{className:`m-0`,children:[a,` test`,a===1?``:`s`,`, `,o,` support file`,o===1?``:`s`,e.copies.length?`, ${e.copies.length} data file${e.copies.length===1?``:`s`}`:``]}),e.instructions&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Instructions`}),(0,Z.jsx)(`dd`,{className:`m-0 whitespace-pre-wrap [overflow-wrap:anywhere]`,children:e.instructions})]})]}),r.length>0&&(0,Z.jsxs)(`section`,{"aria-labelledby":`mig-blockers`,className:`flex flex-col gap-2 rounded-[14px] bg-fail-soft px-6 py-4`,children:[(0,Z.jsxs)(`h3`,{id:`mig-blockers`,className:`m-0 flex items-center gap-2 text-sm font-semibold text-fail`,children:[(0,Z.jsx)(m,{size:16,"aria-hidden":`true`}),`Not possible`]}),(0,Z.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-1 pl-6 text-sm text-ink`,children:r.map(e=>(0,Z.jsx)(`li`,{children:e.text},e.code))})]}),i.length>0&&(0,Z.jsxs)(`section`,{"aria-labelledby":`mig-limits`,className:`flex flex-col gap-4 rounded-[14px] bg-warn-soft px-6 py-4`,children:[(0,Z.jsxs)(`h3`,{id:`mig-limits`,className:`m-0 flex items-center gap-2 text-sm font-semibold text-warn`,children:[(0,Z.jsx)(m,{size:16,"aria-hidden":`true`}),`Before you start`]}),(0,Z.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-2 pl-6 text-sm text-ink`,children:i.map(e=>(0,Z.jsxs)(`li`,{children:[e.text,(0,Z.jsx)(lt,{finding:e})]},e.code))}),n&&!r.length&&(0,Z.jsxs)(`label`,{className:`flex min-h-9 cursor-pointer items-center gap-2 text-sm font-medium`,children:[(0,Z.jsx)(de,{checked:!!t,onCheckedChange:n}),`I understand`]})]}),(0,Z.jsxs)(G,{title:`Files, in order (${e.units.length})`,children:[(0,Z.jsx)(`ol`,{className:`m-0 flex list-none flex-col rounded-[12px] card border p-0 text-[13px]`,children:e.units.map(e=>(0,Z.jsxs)(`li`,{className:`flex flex-wrap gap-x-4 border-b border-line-soft px-4 py-2 last:border-b-0`,children:[(0,Z.jsx)(`span`,{className:`w-16 flex-none text-muted`,children:ve[e.kind]}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:[e.source?(0,Z.jsxs)(`span`,{className:`text-muted`,children:[e.source.slice(e.source.lastIndexOf(`/`)+1),` → `]}):null,e.target]})]},e.id))}),e.notMigrated.length>0&&(0,Z.jsxs)(`p`,{className:`m-0 mt-2 text-[13px] text-muted`,children:[`Not migrated: `,e.notMigrated.map(e=>e.rel.slice(e.rel.lastIndexOf(`/`)+1)).join(`, `)]})]})]})}function dt({plan:e,acceptLimits:t,onClose:n,onStarted:r}){let[i,a]=(0,X.useState)(``),[o,s]=(0,X.useState)(!1),[l,u]=(0,X.useState)(``),d=async()=>{s(!0),u(``);try{r((await M.start(e.id,i,t)).detail)}catch(e){u(e.message),s(!1)}};return(0,Z.jsx)(z,{open:!0,onClose:n,title:`Start the migration`,description:`The tests are rewritten in ${e.target.title} into ${e.target.dir}, and ForgeQE runs each one. It runs in the background; your source tests are not changed.`,footer:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(I,{variant:`ghost`,onClick:n,children:[(0,Z.jsx)(c,{"aria-hidden":`true`}),`Cancel`]}),(0,Z.jsxs)(I,{variant:`primary`,disabled:o||i!==e.id,onClick:()=>void d(),"data-tip":`Start the migration`,children:[(0,Z.jsx)(g,{"aria-hidden":`true`}),`Start`]})]}),children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,Z.jsxs)(`span`,{children:[`Type `,(0,Z.jsx)(`span`,{className:`font-mono`,children:e.id}),` to confirm`]}),(0,Z.jsx)(O,{value:i,onChange:e=>a(e.target.value),autoComplete:`off`,spellCheck:!1})]}),(0,Z.jsx)(ct,{error:l})]})})}function ft({d:e,onStarted:t}){let[n,r]=(0,X.useState)(!1),[i,a]=(0,X.useState)(!1),o=e.plan.feasibility.findings.some(e=>e.level===`limit`),s=e.plan.feasibility.verdict===`blocked`,c=!!e.job?.running;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[e.job?.last&&!c&&(0,Z.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail`,children:`The last start did not run. Its job's log on the Jobs page says why.`}),(0,Z.jsx)(ut,{plan:e.plan,accepted:e.confirmed||n,onAccept:e.confirmed?void 0:r}),!s&&!c&&(0,Z.jsx)(`div`,{children:(0,Z.jsxs)(I,{variant:`primary`,disabled:!e.confirmed&&o&&!n,onClick:()=>a(!0),"data-tip":`Start the migration`,children:[(0,Z.jsx)(g,{"aria-hidden":`true`}),`Start`]})}),i&&(0,Z.jsx)(dt,{plan:e.plan,acceptLimits:o&&(e.confirmed||n),onClose:()=>a(!1),onStarted:e=>{a(!1),t(e)}})]})}var pt=e=>({framework:e.split(`-`)[0],language:e.split(`-`).slice(1).join(`-`)});function mt(e,t){return e?.status===`running`?`running`:e?.status===t?`done`:e?`review`:`planned`}function ht(e){return{key:e.id,link:F(`migration`,e.id),title:`${e.source} to ${e.target}`,under:e.to,from:(0,Z.jsx)(Y,{framework:e.stack?.framework,language:e.stack?.language,size:18}),to:pt(e.targetId),source:{mark:(0,Z.jsx)(J,{kind:e.origin.kind,label:e.origin.label,size:15}),text:e.origin.kind===`project`?e.from:me(e.origin.label),tip:e.origin.label},running:e.result?.status===`running`?{pct:Math.min(99,Math.round(e.result.done/Math.max(1,e.files)*95))}:null,pass:e.result?{n:e.result.migrated,of:e.tests}:null,state:e.result?ge[e.result.status]:e.confirmed?{label:`Confirmed`,tone:`neutral`}:pe[e.verdict],filter:mt(e.result,`migrated`),at:e.result?.endedAt||e.result?.at||e.createdAt}}function gt(e){let t=e.file.slice(e.file.lastIndexOf(`/`)+1);return{key:e.id,link:F(`tosca`,e.id),title:`${t} to ${e.target}`,under:`${e.project?`${e.project} · `:``}${e.into}`,from:(0,Z.jsx)(J,{kind:`tosca`,size:18}),to:pt(e.targetId),source:{mark:(0,Z.jsx)(J,{kind:`tosca`,size:15}),text:`Tosca · ${t}`,tip:e.file},running:e.result?.status===`running`?{pct:Math.min(99,Math.round(e.result.done/Math.max(1,e.units||e.tests+1)*95))}:null,pass:e.result?{n:e.result.converted,of:e.tests}:null,state:e.result?Ee[e.result.status]:e.confirmed?{label:`Confirmed`,tone:`neutral`}:Ce[e.verdict],filter:mt(e.result,`converted`),at:e.result?.endedAt||e.result?.at||e.createdAt}}function _t({rows:e}){let[t,n]=(0,X.useState)(`all`),r=t=>t===`all`?e.length:e.filter(e=>e.filter===t).length,i=e.filter(e=>t===`all`||e.filter===t);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(ye,{children:[(0,Z.jsx)(q,{label:`All`,value:r(`all`),onClick:()=>n(`all`),on:t===`all`}),(0,Z.jsx)(q,{label:`Running`,value:r(`running`),onClick:()=>n(`running`),on:t===`running`}),(0,Z.jsx)(q,{label:`Migrated`,value:r(`done`),tone:r(`done`)?`text-pass`:void 0,onClick:()=>n(`done`),on:t===`done`}),(0,Z.jsx)(q,{label:`Needs review`,value:r(`review`),tone:r(`review`)?`text-warn`:void 0,onClick:()=>n(`review`),on:t===`review`})]}),(0,Z.jsx)(B,{label:`Migrations`,placeholder:`Find a migration`,empty:t===`all`?`No migrations.`:`None here.`,resetKey:t,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{className:L,children:`Migration`}),(0,Z.jsx)(`th`,{className:D(L,`hidden @3xl:table-cell`),children:`Source`}),(0,Z.jsx)(`th`,{className:L,children:`Tests`}),(0,Z.jsx)(`th`,{className:L,children:`Status`}),(0,Z.jsx)(`th`,{className:D(L,`hidden @xl:table-cell`),children:`Updated`})]}),children:i.map(e=>(0,Z.jsxs)(`tr`,{onClick:()=>location.hash=e.link,className:U,children:[(0,Z.jsx)(`td`,{className:V,children:(0,Z.jsxs)(`span`,{className:`flex items-center gap-4`,children:[(0,Z.jsxs)(`span`,{className:`hidden flex-none items-center gap-1 @xl:inline-flex`,"aria-hidden":`true`,children:[e.from,(0,Z.jsx)(b,{size:13,className:`text-muted`}),(0,Z.jsx)(Y,{framework:e.to.framework,language:e.to.language,size:18})]}),(0,Z.jsxs)(`span`,{className:`min-w-0`,children:[(0,Z.jsx)(`a`,{href:e.link,onClick:e=>e.stopPropagation(),className:`font-medium text-ink no-underline hover:underline`,children:e.title}),(0,Z.jsx)(`span`,{className:`block text-[13px] text-muted`,children:e.under})]})]})}),(0,Z.jsx)(`td`,{className:D(V,`hidden max-w-[260px] @3xl:table-cell`),children:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2 text-[13px] text-ink-2`,children:[e.source.mark,(0,Z.jsx)(`span`,{className:`truncate`,"data-tip":e.source.tip,children:e.source.text})]})}),(0,Z.jsx)(`td`,{className:D(V,`w-[180px] text-[13px]`),children:e.running?(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(xe,{value:e.running.pct,label:`${e.title}: progress`}),(0,Z.jsxs)(`span`,{className:`w-9 flex-none text-right text-[13px] text-muted tabular-nums`,children:[e.running.pct,`%`]})]}):e.pass?(0,Z.jsxs)(`span`,{className:e.pass.n===e.pass.of?`text-pass`:`text-ink-2`,children:[e.pass.n,` of `,e.pass.of,` pass`]}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`Not started`})}),(0,Z.jsx)(`td`,{className:D(V,`whitespace-nowrap`),children:(0,Z.jsx)(k,{tone:e.state.tone,children:e.state.label})}),(0,Z.jsx)(`td`,{className:D(V,`hidden text-[13px] whitespace-nowrap text-muted @xl:table-cell`),children:le(e.at)})]},e.key))})]})}function vt({sub:e}){let[t,r]=(0,X.useState)(null),[i,a]=(0,X.useState)(null),[o,c]=(0,X.useState)(``),[l,u]=(0,X.useState)(``),[d,f]=(0,X.useState)(null),p=e===`migrations`,m=(0,X.useCallback)(()=>{M.list().then(e=>{r(e),c(``)},e=>c(e.message))},[]),h=(0,X.useCallback)(()=>{E.list().then(e=>{a(e),u(``)},e=>u(e.message))},[]);(0,X.useEffect)(m,[m,e]),(0,X.useEffect)(()=>{p&&h()},[p,h]);let g=t?.plans.some(e=>e.result?.status===`running`)||i?.plans.some(e=>e.result?.status===`running`);(0,X.useEffect)(()=>{if(!g||!p)return;let e=setInterval(()=>{m(),h()},3e3);return()=>clearInterval(e)},[g,p,m,h]);let _=(0,X.useMemo)(()=>[...t?.plans.map(ht)||[],...i?.plans.map(gt)||[]].sort((e,t)=>e.at<t.at?1:e.at>t.at?-1:0),[t,i]),v=e&&/^mig-\d{8}-\d{6}-[0-9a-f]{4}$/.test(e)?e:``,y=()=>location.hash=F(`migration`,`new`),b=!t&&!o&&(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`});return e===`new`?(0,Z.jsxs)(K,{tab:`migrations`,children:[(0,Z.jsx)(ct,{error:o}),b,t&&(0,Z.jsx)(st,{view:t,review:(e,t,n)=>(0,Z.jsx)(ut,{plan:e,accepted:t,onAccept:n}),onStart:(e,t)=>f({d:e,accept:t})}),d&&(0,Z.jsx)(dt,{plan:d.d.plan,acceptLimits:d.accept,onClose:()=>f(null),onStarted:e=>location.hash=F(`migration`,e.plan.id)})]}):v?(0,Z.jsxs)(K,{tab:`migrations`,wide:!0,children:[(0,Z.jsx)(ct,{error:o}),b,t&&(0,Z.jsx)(Ke,{id:v,view:t,plan:e=>(0,Z.jsx)(ft,{d:e,onStarted:()=>location.reload()})},v)]}):p?(0,Z.jsxs)(K,{tab:`migrations`,action:t&&!_.length?void 0:(0,Z.jsxs)(I,{variant:`primary`,disabled:!t,onClick:y,"data-tip":`New migration`,children:[(0,Z.jsx)(s,{"aria-hidden":`true`}),`New`]}),children:[(0,Z.jsx)(ct,{error:o}),(0,Z.jsx)(ct,{error:l&&`Tosca conversions could not be read: ${l}`}),b,t&&(_.length?(0,Z.jsx)(_t,{rows:_}):(0,Z.jsx)(N,{icon:n,title:`No migrations yet`,action:(0,Z.jsxs)(I,{size:`sm`,onClick:y,"data-tip":`New migration`,children:[(0,Z.jsx)(s,{"aria-hidden":`true`}),`New`]}),children:`Bring in tests from git, a folder, uploaded files, pasted code or a Tosca export, and pick the framework they move to. Nothing starts until you confirm.`}))]}):(0,Z.jsx)(K,{tab:ue})}export{vt as Migration};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Br as e,Lr as t,Pn as n}from"./line-icons-CwZWt93L.js";import{$t as r,V as i,g as a,st as o,z as s}from"./filters-faaSnoIq.js";import{Dn as c,Ht as l,On as u,m as d}from"./frame-BLPdAXUq.js";import{$ as f,J as p,Q as ee,X as m,Y as te,Z as ne,_t as re,ct as ie,dt as ae,ft as oe,gt as se,lt as ce,ot as le,st as ue,ut as de}from"./index-CxiCvGZq.js";import{n as fe}from"./Response-BP0UwQcW.js";import{n as h,t as g}from"./poll-CHpac9Fb.js";var _=e(t(),1),pe=e=>e&&/^No model in llms\.json/.test(e)?`No model is set up for the agent yet: add one in Settings, Models (or sign in to GitHub Copilot there), then send this again.`:e;function me(e){let t=()=>{try{return localStorage.getItem(e)}catch{return null}},n=t=>{try{t?localStorage.setItem(e,t):localStorage.removeItem(e)}catch{}},[r,i]=(0,_.useState)(t),[a,s]=(0,_.useState)([]),[c,l]=(0,_.useState)(null);(0,_.useEffect)(()=>{if(!r){s([]),l(null);return}let e=!1,t=0,a=0;return s([]),(async()=>{for(;!e;)try{let n=await o.events(r,t,t>0);if(e||(a=0,l(n.state),n.events.length&&(t=n.events.at(-1).n,s(e=>[...e,...n.events])),(n.state===`closed`||n.state===`failed`)&&!n.events.length))return}catch(t){if(e)return;let r=t.status??0,o=g(++a,r,t.message);if(o.giveUp&&r===404){n(null),i(null);return}if(o.giveUp)return;await h(o.waitMs)}})(),()=>{e=!0}},[r]);let u=(0,_.useMemo)(()=>d(a),[a]),f=u.turns.at(-1),p=c===`closed`||c===`failed`;return{chat:r,thread:u,last:f,busy:c===`busy`||c===`starting`||!!f&&!f.outcome&&!p,ended:p,send:async(e,t,a={})=>{if(r&&!p)await o.send(r,e);else{let{id:r}=await o.start(`${t}\n${e}`,a);n(r),i(r)}},reset:()=>{n(null),i(null)}}}var v=r(),y=e=>e&&e!==`forgeqe`?c.find(t=>t.agent===e)?.crew:void 0;function b({id:e,agent:t=u,question:r,intro:c,underIntro:d,starters:h,placeholder:g,replyPlaceholder:b,note:x,turnNote:S,track:C,onTurnEnd:he,ask:w,askSends:ge=!1,draft:T,above:_e,menu:E,compose:D,onNew:ve,className:ye}){let O=`${e}-agent-box`,{chat:k,thread:A,last:j,busy:M,ended:N,send:be,reset:xe}=me(`forgeqe.${e}.chat`),Se=se(),[P,F]=(0,_.useState)(``),[I,L]=(0,_.useState)(``),[R,z]=(0,_.useState)(!1),B=f(),V=oe(P,F,O,{chat:k&&!N?k:void 0,code:B.tools.code}),H=ce(`${e}-agent`,e=>{F(e),ie(O)}),U=(0,_.useRef)(new Map),[W,G]=(0,_.useState)({}),K=j?.id,q=j?.outcome;(0,_.useEffect)(()=>{K&&q&&(he?.(),C&&C.after().then(e=>{let t=[...e].filter(([e,t])=>U.current.get(e)!==t).map(([e])=>e);t.length&&(G(e=>({...e,[K]:t})),C.onMade?.(t))},()=>{}))},[K,q]);let J=async e=>{if(!B.ready)return;let t=D?D.add(e.trim()):e.trim();if(!(R||!t&&!V.hasFiles)){z(!0),L(``);try{C&&(U.current=await C.now());let e=await V.wrap(t);if(!e.trim())return;let n=S?S():``;await be(k&&!N&&n?`${n}\n${e}`:e,n?`${x()}\n${n}`:x(),B.choice),F(``),V.reset({keep:!0}),D?.clear()}catch(e){L(e.message)}finally{z(!1)}}},Y=e=>{F(e),setTimeout(()=>document.getElementById(O)?.focus(),0)},X=(0,_.useRef)(0);(0,_.useEffect)(()=>{w&&w.n!==X.current&&(X.current=w.n,(w.send??ge)&&!M?J(w.text):Y(w.text))},[w?.n]);let Z=(0,_.useRef)(0);(0,_.useEffect)(()=>{T&&T.n!==Z.current&&(Z.current=T.n,T.ifEmpty&&P.trim()||Y(T.text))},[T?.n]);let Q=!k||!A.turns.length,$=A.turns.flatMap(e=>W[e.id]||[]).at(-1);return(0,v.jsxs)(`div`,{className:i(`mx-auto flex w-full max-w-[880px] flex-auto flex-col gap-6`,ye),children:[Q?(0,v.jsxs)(`div`,{className:`flex flex-col items-center gap-4 pt-2 text-center short:gap-4 short:pt-0`,children:[(0,v.jsx)(l,{agent:t,px:Se?72:112,working:R||M,className:`mb-1`}),(0,v.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,v.jsx)(`h2`,{className:`m-0 text-[20px] font-semibold`,children:r}),(0,v.jsx)(`p`,{className:`m-0 text-[16px] text-muted`,children:c}),y(t)&&(0,v.jsx)(re,{crew:y(t)})]}),d,(0,v.jsx)(`div`,{className:`grid w-full gap-2 text-left sm:grid-cols-2`,children:h.map(e=>(0,v.jsxs)(`button`,{type:`button`,onClick:()=>e.onPick?e.onPick():e.send?void J(e.text):Y(e.text),className:`flex cursor-pointer items-start gap-4 rounded-[12px] card border px-4 py-2 text-left hover:border-line-strong hover:bg-surface-muted`,children:[(0,v.jsx)(a,{icon:e.icon,size:18,className:`mt-1 text-accent-fg`}),(0,v.jsxs)(`span`,{className:`flex flex-col gap-1`,children:[(0,v.jsx)(`span`,{className:`text-[13px] font-medium text-ink`,children:e.title}),(0,v.jsx)(`span`,{className:`text-[13px] text-muted`,children:e.hint})]})]},e.title))})]}):(0,v.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,v.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,v.jsxs)(s,{size:`sm`,variant:`ghost`,onClick:()=>{xe(),V.reset(),G({}),F(``),ve?.()},disabled:M,"data-tip":`Start a new conversation`,children:[(0,v.jsx)(n,{"aria-hidden":`true`}),`New`]})}),A.turns.map(e=>(0,v.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,v.jsx)(ae,{text:e.user,scope:{chat:k||void 0}}),(0,v.jsx)(fe,{turn:e.error?{...e,error:pe(e.error)}:e,live:!N,onAnswer:(e,t)=>void o.answer(k,e,t).catch(e=>L(e.message)),onProceed:(e,t)=>void o.proceed(k,e,t).catch(e=>L(e.message))}),C&&(W[e.id]||[]).map(e=>(0,v.jsx)(`div`,{children:C.card(e,{busy:M,send:e=>void J(e),error:L})},e))]},e.id)),A.fatal&&(0,v.jsx)(`p`,{className:`m-0 text-sm text-fail`,children:A.fatal})]}),(0,v.jsxs)(`div`,{className:`sticky bottom-0 z-10 mt-auto flex flex-col gap-2 bg-gradient-to-t from-bg from-85% to-transparent pt-6 pb-4`,children:[_e?.($,Y),!B.ready&&B.setup&&(0,v.jsx)(ee,{project:B.setup.project}),B.ready&&(0,v.jsx)(ne,{c:B}),(I||V.error)&&(0,v.jsx)(`p`,{className:`m-0 bg-bg text-[13px] text-fail [overflow-wrap:anywhere]`,children:I||V.error}),(0,v.jsx)(de,{id:O,label:`Ask the agent`,value:P,onChange:F,onSend:()=>void J(P),onStop:()=>k&&void o.stop(k),busy:M,disabled:R||H.running||!B.ready,canSend:!!P.trim()||V.hasFiles||!!D?.has,onEdit:V.onEdit,onKey:V.onKeyDown,onFiles:V.onFiles,dropping:V.dropping,drop:V.drop,mentions:V.mentions,combo:V.combo,placeholder:Q?g:b?b($):`Reply, or ask for the next thing…`,top:(0,v.jsxs)(v.Fragment,{children:[V.chips,H.state&&(0,v.jsx)(ue,{state:H.state,onStop:()=>void H.stop(),onUndo:H.undo,onClose:H.close})]}),left:(0,v.jsxs)(v.Fragment,{children:[V.fileInput,(0,v.jsx)(p,{attach:{pick:V.pick},...E?{before:E}:{},...Q?{choice:B}:k?{started:{chat:k,thread:A,ended:N,snap:B.snap,onError:L}}:{}}),(0,v.jsx)(le,{running:H.running,disabled:!P.trim()||R||!B.ready,onClick:()=>void H.start(P)})]}),right:Q?(0,v.jsx)(te,{c:B}):k?(0,v.jsx)(m,{chat:k,thread:A,ended:N,busy:M||R,snap:B.snap,onError:L}):void 0})]})]})}export{b as t};
|