@testmuai/kane-cli 0.9.0 → 0.10.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ChatSurface-VPD5G67Q.js +2 -0
- package/dist/ChromeProfilePicker-CRKQEFYD.js +2 -0
- package/dist/CliFeedbackPrompt-M7BMWLKK.js +2 -0
- package/dist/CliUploadProgress-OP7DXMC2.js +2 -0
- package/dist/ConfigView-XI74BCCH.js +2 -0
- package/dist/EvidenceViewOffer-HAAK6DS5.js +2 -0
- package/dist/FolderPicker-W5S6RFCP.js +2 -0
- package/dist/InfoBox-OWUEHV2D.js +2 -0
- package/dist/LinksBox-PNSESNCU.js +2 -0
- package/dist/ProfilesView-PYDZZHKO.js +2 -0
- package/dist/ProjectPicker-BGFCUGT5.js +2 -0
- package/dist/SaveSessionPrompt-SUJE54GS.js +2 -0
- package/dist/ScrollbackTap-4SPXGFMU.js +2 -0
- package/dist/SingleShotApp-4TDXZEUA.js +2 -0
- package/dist/SummaryBox-FALOODAQ.js +2 -0
- package/dist/TestMdRunView-4GPRWHEU.js +2 -0
- package/dist/TestrunEvidenceTable-OBVQJ6IO.js +2 -0
- package/dist/WhoamiView-6WXGRANY.js +2 -0
- package/dist/{agent-parse-2MLJOJTH.js → agent-parse-CAS45UKA.js} +1 -1
- package/dist/app-client-U2YYF65L.js +2 -0
- package/dist/app-download-RXVZB6MM.js +2 -0
- package/dist/assurance-job-C3TXZGLL.js +7 -0
- package/dist/auth-7Z54TMQQ.js +2 -0
- package/dist/{binary-LVHXED3O.js → binary-DJCDMGPX.js} +1 -1
- package/dist/bind-XVO4CQYV.js +2 -0
- package/dist/bootstrap-TY5RANJ7.js +2 -0
- package/dist/bridge-T6QMYKED.js +2 -0
- package/dist/build-5ZN47FAT.js +2 -0
- package/dist/catalog-RRQF4TCA.js +2 -0
- package/dist/{changelog-N5AZHXOS.js → changelog-GBEVIUFJ.js} +1 -1
- package/dist/chat-committer-ZCSRJEUB.js +2 -0
- package/dist/chat-controller-XINCDH6Z.js +2 -0
- package/dist/child-G2GCW73X.js +2 -0
- package/dist/chunk-22PIMG52.js +2 -0
- package/dist/chunk-252FWF2G.js +19 -0
- package/dist/{chunk-UWXDURAB.js → chunk-2IZRPMZN.js} +1 -1
- package/dist/{chunk-X2A6CC6B.js → chunk-2NFS4KE4.js} +1 -1
- package/dist/{chunk-ZXY4P76I.js → chunk-2OOFURWD.js} +1 -1
- package/dist/chunk-2OSFI33O.js +97 -0
- package/dist/{chunk-CSNJPD2J.js → chunk-2S3W2JT3.js} +3 -3
- package/dist/chunk-2SWSVJUP.js +12 -0
- package/dist/chunk-2TVPA3LL.js +2 -0
- package/dist/{chunk-FMUV6UCX.js → chunk-2XW33VOK.js} +1 -1
- package/dist/chunk-33DWJV67.js +235 -0
- package/dist/chunk-34R7BNZ2.js +2 -0
- package/dist/chunk-35ECWCCK.js +2 -0
- package/dist/chunk-3BSYOCSW.js +3 -0
- package/dist/chunk-3G2LSTK5.js +2 -0
- package/dist/chunk-3GXN6VF6.js +2 -0
- package/dist/chunk-3JLEDSG5.js +4 -0
- package/dist/chunk-3QICDXY5.js +5 -0
- package/dist/chunk-3UVSAAES.js +10 -0
- package/dist/chunk-42PALMW2.js +4 -0
- package/dist/chunk-432ZOE42.js +21 -0
- package/dist/chunk-44B6THYK.js +2 -0
- package/dist/chunk-47WQBG5I.js +6 -0
- package/dist/{chunk-DOOI2JBD.js → chunk-4D5PC6QE.js} +1 -1
- package/dist/chunk-4I7YN6YY.js +3 -0
- package/dist/chunk-4IEQNX7F.js +2 -0
- package/dist/{chunk-KXEE6VCA.js → chunk-4LPX2OLV.js} +1 -1
- package/dist/chunk-4LTHDJ3D.js +2 -0
- package/dist/chunk-4QTH7VYE.js +2 -0
- package/dist/chunk-54XA5MZH.js +2 -0
- package/dist/chunk-57MDWTON.js +2 -0
- package/dist/{chunk-CNUCP6DK.js → chunk-5BUIIFLC.js} +1 -1
- package/dist/{chunk-AKE2CTV6.js → chunk-5D7ENQTQ.js} +1 -1
- package/dist/chunk-63EKRZKI.js +2 -0
- package/dist/{chunk-EHN5HTUD.js → chunk-65VANXOF.js} +51 -51
- package/dist/chunk-672CQECV.js +47 -0
- package/dist/chunk-6LIC2R22.js +3 -0
- package/dist/chunk-6NFOH4AC.js +4 -0
- package/dist/chunk-6NWT2TEJ.js +2 -0
- package/dist/chunk-6PIIUAZF.js +3 -0
- package/dist/{chunk-4CYBXJIA.js → chunk-6U7ID777.js} +1 -1
- package/dist/chunk-6UVIY56J.js +2 -0
- package/dist/chunk-72KYMWQ5.js +2 -0
- package/dist/chunk-72RC7JSA.js +21 -0
- package/dist/chunk-74W4AOT2.js +2 -0
- package/dist/chunk-77ZZQJLX.js +2 -0
- package/dist/chunk-7DFBOVUB.js +2 -0
- package/dist/chunk-7EXDYXXD.js +2 -0
- package/dist/chunk-7HO4NX5W.js +1 -0
- package/dist/chunk-7KX2BHKG.js +2 -0
- package/dist/chunk-7LKCWO2R.js +11 -0
- package/dist/{chunk-ULGZPRKU.js → chunk-7NCJMWFX.js} +1 -1
- package/dist/{chunk-EBLXHOE3.js → chunk-7RPKHKA3.js} +1 -1
- package/dist/chunk-7RWP4Y3H.js +2 -0
- package/dist/chunk-7V4BQSSV.js +2 -0
- package/dist/chunk-7XBNMOH4.js +6 -0
- package/dist/chunk-A6TJOZ24.js +2 -0
- package/dist/chunk-AA674WLL.js +2 -0
- package/dist/chunk-AIXJYMSP.js +9 -0
- package/dist/chunk-AJQZ3ST5.js +8 -0
- package/dist/chunk-AQ2OG2EF.js +2 -0
- package/dist/chunk-AUJSC7PU.js +4 -0
- package/dist/chunk-AVI5H4UM.js +13 -0
- package/dist/chunk-AZLNLHUA.js +4 -0
- package/dist/chunk-B2HXPGIZ.js +26 -0
- package/dist/{chunk-HGFWIBVF.js → chunk-B7ZX5HEN.js} +5 -5
- package/dist/{chunk-WRSIKZ2V.js → chunk-BJJUKB5K.js} +1 -1
- package/dist/{chunk-66MOZKD2.js → chunk-BSRSXYDZ.js} +1 -1
- package/dist/{chunk-4BZOG6PE.js → chunk-BVO4C5F2.js} +1 -1
- package/dist/chunk-BWXLZS5O.js +2 -0
- package/dist/chunk-BY65QAAN.js +4 -0
- package/dist/chunk-BZVNI44O.js +6 -0
- package/dist/chunk-C5Z7MQE6.js +2 -0
- package/dist/chunk-C6HI6Y3S.js +2 -0
- package/dist/chunk-CB4ARIHR.js +2 -0
- package/dist/{chunk-C25M2J5Q.js → chunk-CPBBYNL7.js} +1 -1
- package/dist/{chunk-75MMTNPB.js → chunk-D4FFXCX6.js} +2 -2
- package/dist/chunk-D756UWY2.js +6 -0
- package/dist/chunk-DBMW3VUN.js +4 -0
- package/dist/chunk-DD5TULWQ.js +34 -0
- package/dist/{chunk-Q5RDCSYM.js → chunk-DDJNYQBH.js} +1 -1
- package/dist/{chunk-6HU5M2DS.js → chunk-DHQ4SQWA.js} +1 -1
- package/dist/chunk-DNGOT65K.js +3 -0
- package/dist/chunk-DPGOAFKF.js +2 -0
- package/dist/chunk-DREQ3RAA.js +2 -0
- package/dist/chunk-DTUPEKEO.js +2 -0
- package/dist/chunk-E6KSRQXL.js +8 -0
- package/dist/chunk-EF47KRUK.js +2 -0
- package/dist/chunk-ENL4XTQ2.js +2 -0
- package/dist/chunk-EXFDIVNI.js +9 -0
- package/dist/chunk-EZN7CF45.js +4 -0
- package/dist/chunk-F3U6T4YD.js +22 -0
- package/dist/{chunk-DHJSM5DT.js → chunk-FCD3NYOM.js} +1 -1
- package/dist/chunk-FFL55I2M.js +2 -0
- package/dist/chunk-FIP5L6LV.js +9 -0
- package/dist/chunk-FOJHSG5M.js +6 -0
- package/dist/chunk-FSYOTRMC.js +2 -0
- package/dist/chunk-GFLB2SHW.js +2 -0
- package/dist/chunk-GMTHZUZ3.js +2 -0
- package/dist/chunk-GRURFGBP.js +2 -0
- package/dist/chunk-GZFLJORM.js +2 -0
- package/dist/{chunk-EOA6YPES.js → chunk-H3HHSTEK.js} +4 -4
- package/dist/chunk-HAW5WEKT.js +13 -0
- package/dist/chunk-HFJSP4KD.js +2 -0
- package/dist/chunk-HHW6MRU3.js +6 -0
- package/dist/chunk-HIUAUZNL.js +2 -0
- package/dist/chunk-HJLMH7ZM.js +2 -0
- package/dist/{chunk-5GUD3CIH.js → chunk-HQ2E2XCU.js} +1 -1
- package/dist/{chunk-K3IQEL7R.js → chunk-I2KOGINW.js} +1 -1
- package/dist/chunk-I2MC6VVX.js +2 -0
- package/dist/chunk-I5NSJBOZ.js +2 -0
- package/dist/chunk-I6OQISK4.js +2 -0
- package/dist/chunk-IBBD36FQ.js +2 -0
- package/dist/{chunk-GCISXCDU.js → chunk-IINZZ4BZ.js} +1 -1
- package/dist/{chunk-M3UAZTDK.js → chunk-IMDMRJQ6.js} +2 -2
- package/dist/chunk-IXW7FOGX.js +2 -0
- package/dist/chunk-IZ65ZPWY.js +3 -0
- package/dist/chunk-JD52IXON.js +9 -0
- package/dist/chunk-JGRXMTME.js +15 -0
- package/dist/{chunk-NBXYL2JT.js → chunk-JIRNI5TB.js} +7 -7
- package/dist/chunk-JNSWKGTB.js +2 -0
- package/dist/chunk-JPYW6U4D.js +2 -0
- package/dist/chunk-JQSLUGD4.js +3 -0
- package/dist/{chunk-GFBAK7WQ.js → chunk-K45BKGB5.js} +7 -7
- package/dist/chunk-KF4DKXSS.js +2 -0
- package/dist/chunk-KGNE5CIM.js +2 -0
- package/dist/chunk-KM3YCIDV.js +3 -0
- package/dist/chunk-KU3YHPWZ.js +2 -0
- package/dist/chunk-L4UVUFL6.js +3 -0
- package/dist/chunk-LCSJ7GOG.js +2 -0
- package/dist/chunk-LKQFG4RW.js +5 -0
- package/dist/chunk-LNNWCBPQ.js +2 -0
- package/dist/chunk-LRS5MGBY.js +3 -0
- package/dist/chunk-LRXBJTD4.js +4 -0
- package/dist/chunk-LSDJOVWW.js +6 -0
- package/dist/chunk-LWJRSUE2.js +2 -0
- package/dist/chunk-LX2I4JEH.js +2 -0
- package/dist/{chunk-RWSOZPJQ.js → chunk-M6MBMRFR.js} +1 -1
- package/dist/chunk-MGNRNLBE.js +2 -0
- package/dist/chunk-MII3JOO3.js +4 -0
- package/dist/chunk-MNBGG4H3.js +16 -0
- package/dist/chunk-MYVKUJGS.js +2 -0
- package/dist/chunk-MYZHOBS4.js +2 -0
- package/dist/chunk-MZOIHUVX.js +27 -0
- package/dist/{chunk-7GAHJZLH.js → chunk-N3TCNZSX.js} +1 -1
- package/dist/chunk-NC7D7GOM.js +21 -0
- package/dist/{chunk-HAYV4D2I.js → chunk-NDEI7R4K.js} +1 -1
- package/dist/{chunk-BL3SJDCG.js → chunk-NFRA64NU.js} +1 -1
- package/dist/chunk-NLZZLANH.js +4 -0
- package/dist/{chunk-DWMESHFI.js → chunk-NQTYWHPB.js} +1 -1
- package/dist/chunk-NWBLYMH7.js +3 -0
- package/dist/chunk-NWD54VV5.js +2 -0
- package/dist/chunk-NXRF7FFS.js +2 -0
- package/dist/chunk-O3HHTKZ5.js +6 -0
- package/dist/{chunk-F7NSSQYZ.js → chunk-OAKYUBD3.js} +1 -1
- package/dist/{chunk-7WXMV3O3.js → chunk-OEWYXCTA.js} +1 -1
- package/dist/{chunk-4FHK4LKQ.js → chunk-OF7WPCTQ.js} +1 -1
- package/dist/chunk-OFSDB7B4.js +3 -0
- package/dist/chunk-OJ33Q6DU.js +2 -0
- package/dist/chunk-OQ5G773E.js +2 -0
- package/dist/chunk-OVNRRI4E.js +2 -0
- package/dist/{chunk-C6S2RPZA.js → chunk-OZNBTSW5.js} +1 -1
- package/dist/chunk-P2ZQDQDB.js +2 -0
- package/dist/chunk-P7MSVLAH.js +6 -0
- package/dist/chunk-PUVMC4PX.js +26 -0
- package/dist/{chunk-SEEEGDVK.js → chunk-PZA3BSOE.js} +1 -1
- package/dist/chunk-Q3C6NDGI.js +2 -0
- package/dist/chunk-QCKA665H.js +2 -0
- package/dist/chunk-QDFY5GGO.js +5 -0
- package/dist/{chunk-YBAVDT3G.js → chunk-QHRUBG7J.js} +1 -1
- package/dist/chunk-QI5RZ7LL.js +2 -0
- package/dist/chunk-QNLVC5ZB.js +2 -0
- package/dist/{chunk-WDMUPK6I.js → chunk-QQ4TKLWP.js} +1 -1
- package/dist/chunk-QS5ZJFGF.js +4 -0
- package/dist/chunk-QTZBVDPR.js +12 -0
- package/dist/chunk-QXQ7KVEN.js +2 -0
- package/dist/chunk-R4JUKTDO.js +2 -0
- package/dist/chunk-R7KXAISS.js +12 -0
- package/dist/chunk-RDP7GWSY.js +2 -0
- package/dist/chunk-REKHAN53.js +5 -0
- package/dist/{chunk-KWEOLPBJ.js → chunk-RFEON5GN.js} +1 -1
- package/dist/{chunk-SOCHN2PY.js → chunk-RFIIM33J.js} +1 -1
- package/dist/chunk-RG372DON.js +6 -0
- package/dist/chunk-RPRXRKKR.js +2 -0
- package/dist/chunk-RTVWQK7I.js +2 -0
- package/dist/{chunk-2PKME4VT.js → chunk-RW3Z2HMB.js} +4 -4
- package/dist/chunk-RX47NRSM.js +2 -0
- package/dist/chunk-RX6776AI.js +5 -0
- package/dist/chunk-S53AQU7R.js +6 -0
- package/dist/{chunk-XT7XA4DN.js → chunk-SA6IKFFD.js} +1 -1
- package/dist/{chunk-Q5CINJYL.js → chunk-SLKYD44Y.js} +1 -1
- package/dist/chunk-SMTBOSEJ.js +2 -0
- package/dist/chunk-SMXABALN.js +2 -0
- package/dist/chunk-SONMD3W5.js +5 -0
- package/dist/chunk-SWMTXMKB.js +2 -0
- package/dist/{chunk-TM7VRLWS.js → chunk-SXRHKXSE.js} +1 -1
- package/dist/chunk-T3HEJASG.js +5 -0
- package/dist/chunk-T4AVLJCW.js +6 -0
- package/dist/{chunk-6VY62QC2.js → chunk-T6K2MEWP.js} +1 -1
- package/dist/{chunk-PCKIANML.js → chunk-T7H4LBFK.js} +1 -1
- package/dist/chunk-TNORODUF.js +2 -0
- package/dist/chunk-TW63WWEN.js +2 -0
- package/dist/chunk-UALJTPSA.js +18 -0
- package/dist/chunk-UAWWLLTI.js +2 -0
- package/dist/chunk-UEE3RZN4.js +14 -0
- package/dist/chunk-UTM7D4PI.js +2 -0
- package/dist/chunk-UUJIGOEO.js +2 -0
- package/dist/chunk-UYDHOHSZ.js +2 -0
- package/dist/chunk-V5JGXOV7.js +2 -0
- package/dist/chunk-V7S6S5W3.js +2 -0
- package/dist/{chunk-OHOJSADN.js → chunk-VG44B5JD.js} +1 -1
- package/dist/chunk-VJGWVBZR.js +1 -0
- package/dist/chunk-VLDCHFXF.js +2 -0
- package/dist/chunk-VO66KP2W.js +2 -0
- package/dist/{chunk-J3BGYSMD.js → chunk-VQLH63X7.js} +8 -8
- package/dist/chunk-VRIZDOO5.js +2 -0
- package/dist/chunk-VYHT2IET.js +1397 -0
- package/dist/chunk-VZJ6LUXX.js +2 -0
- package/dist/chunk-W3OVSDBN.js +29 -0
- package/dist/chunk-W7FLXW6Q.js +5 -0
- package/dist/{chunk-UA2QDAWT.js → chunk-WEM3MOAL.js} +1 -1
- package/dist/chunk-WI7K6VKQ.js +2 -0
- package/dist/chunk-WMGKUERB.js +6 -0
- package/dist/{chunk-DFS4RMVP.js → chunk-WN5VKKJ3.js} +1 -1
- package/dist/chunk-WOSANGV6.js +5 -0
- package/dist/chunk-WYSZ6TPW.js +15 -0
- package/dist/chunk-XB6BJPDL.js +2 -0
- package/dist/{chunk-YWYORBY3.js → chunk-XBEYWXPV.js} +1 -1
- package/dist/chunk-XIPKSXRQ.js +16 -0
- package/dist/chunk-XJ7HCXKW.js +2 -0
- package/dist/chunk-XMPTFXPW.js +5 -0
- package/dist/chunk-XZYA7DNH.js +2 -0
- package/dist/chunk-Y4T4SLDO.js +2 -0
- package/dist/{chunk-OIUV3ISA.js → chunk-Y6Y6RAY4.js} +1 -1
- package/dist/chunk-YDPTSDIJ.js +2 -0
- package/dist/chunk-YDSGXB25.js +2 -0
- package/dist/chunk-YIKF4ERQ.js +375 -0
- package/dist/chunk-Z55KBMYV.js +2 -0
- package/dist/chunk-ZCRZFAOT.js +2 -0
- package/dist/chunk-ZFM77AQU.js +2 -0
- package/dist/{chunk-Q6F23V7L.js → chunk-ZFMRQ57Y.js} +1 -1
- package/dist/chunk-ZHWU6L2G.js +5 -0
- package/dist/chunk-ZTHYAHDN.js +17 -0
- package/dist/chunk-ZZP5SHUV.js +3 -0
- package/dist/committer-JGY66PFM.js +2 -0
- package/dist/config-5ZOALGKE.js +2 -0
- package/dist/controller-client-PB3AZAGG.js +2 -0
- package/dist/cover-cmd-UA2SVIZZ.js +2 -0
- package/dist/{credentials-QD32Y7K7.js → credentials-MRG452Y6.js} +1 -1
- package/dist/{deps-bundle-OI7JJ22L.js → deps-bundle-FWINW4XM.js} +1 -1
- package/dist/{deps-resolve-ZOALDS6H.js → deps-resolve-IET4KIBO.js} +1 -1
- package/dist/descriptor-7T32VRMB.js +2 -0
- package/dist/design-chat-MM5PJD2N.js +2 -0
- package/dist/design-committer-TRYP3LOZ.js +2 -0
- package/dist/design-headless-FZONCKHW.js +2 -0
- package/dist/design-remote-SPVRIY2H.js +3 -0
- package/dist/device-env-LXJ65AVF.js +2 -0
- package/dist/dispatch-DVQ3H7EJ.js +2 -0
- package/dist/doctor-VAX2BWQF.js +2 -0
- package/dist/docx-convert-6IZO5P5K.js +2 -0
- package/dist/{dossier-7HVC6BNK.js → dossier-NROC2MCY.js} +1 -1
- package/dist/evidence-LVVK7ROT.js +2 -0
- package/dist/evidence-presentation-YYTIDCBS.js +2 -0
- package/dist/evolve-cmd-AGRKG7T3.js +2 -0
- package/dist/evolve-remote-BGHULJTL.js +2 -0
- package/dist/{exit-manager-ZLDO54S4.js → exit-manager-EDHCETUN.js} +1 -1
- package/dist/explain-DGJ5T6V5.js +2 -0
- package/dist/explain-cmd-VYAANFFZ.js +4 -0
- package/dist/explain-cmd-WOBGS6KX.js +12 -0
- package/dist/explore-LOKNOVNP.js +2 -0
- package/dist/explore-context-tty-JTZVZFOE.js +2 -0
- package/dist/explore-entry-5OGNLFAU.js +6 -0
- package/dist/explore-live-2XZHUYFS.js +5 -0
- package/dist/explore-run-tty-LGTIK2NA.js +5 -0
- package/dist/extract-bind-NM2BBK4I.js +14 -0
- package/dist/extract-chat-HLQMJJIC.js +2 -0
- package/dist/extract-cmd-T2TSAC3N.js +6 -0
- package/dist/extract-headless-OQTQ3FJK.js +2 -0
- package/dist/feeder-NY45UFJK.js +2 -0
- package/dist/folder-flags-WXUR6OPJ.js +2 -0
- package/dist/gaps-cmd-PTSKPTF7.js +3 -0
- package/dist/gate-P57VP4E5.js +2 -0
- package/dist/gate-WISOUTHQ.js +2 -0
- package/dist/{generate-headless-6WMJYNI6.js → generate-headless-JYZP6VXZ.js} +3 -3
- package/dist/headless-io-FFM5T6KL.js +2 -0
- package/dist/hold-passthrough-IOWPVB4W.js +2 -0
- package/dist/identity-HL5CJJXR.js +2 -0
- package/dist/index.js +178 -160
- package/dist/ingest-PDGS5ZTL.js +2 -0
- package/dist/ingest-cmd-LHCBMO4Z.js +8 -0
- package/dist/ingest-remote-D5TO5JQP.js +2 -0
- package/dist/ink-screen-RZ7QDIUI.js +2 -0
- package/dist/install-Z6K2D2VY.js +2 -0
- package/dist/interactive-bind-5EJQUGKI.js +26 -0
- package/dist/interactive-remote-D77ULJGL.js +65 -0
- package/dist/interrupt-guard-QETBPINI.js +2 -0
- package/dist/lane-AQYRIW24.js +2 -0
- package/dist/lattice-auth-74XGF77Y.js +2 -0
- package/dist/lifecycle-cmd-7SM6UCMH.js +2 -0
- package/dist/list-cmd-Z6FZXMFU.js +3 -0
- package/dist/list-commands-CZYZ7GIG.js +2 -0
- package/dist/list-remote-WOPOC6KK.js +15 -0
- package/dist/locks-cmd-JJ2QNTNY.js +2 -0
- package/dist/logical-ids-RXAQJZ3T.js +2 -0
- package/dist/login-flow-2FZEOVHM.js +2 -0
- package/dist/maintenance-cmd-VRTGZVRE.js +2 -0
- package/dist/mobile-prompts-KNAHU64X.js +2 -0
- package/dist/{next-KZXH4UA4.js → next-O6SUSX3R.js} +1 -1
- package/dist/{objective-variable-gate-CG2KK5UX.js → objective-variable-gate-3Z7DNVVC.js} +1 -1
- package/dist/onboarding-LGT6PMDZ.js +5 -0
- package/dist/open-provider-OZAG6WZS.js +2 -0
- package/dist/{paths-JCYX6UWL.js → paths-UMIX3RJF.js} +1 -1
- package/dist/pdf-convert-447ACUB3.js +2 -0
- package/dist/persist-recorded-session-BX7II5P7.js +3 -0
- package/dist/phase-seed-LCJ4WSYV.js +2 -0
- package/dist/pipeline-IXVTVRS5.js +2 -0
- package/dist/prepare-target-ULMKVKMC.js +2 -0
- package/dist/pull-cmd-6AL2WYHB.js +2 -0
- package/dist/pull-route-TTVARJMV.js +2 -0
- package/dist/readmodel-INMP6MNW.js +2 -0
- package/dist/real-device-run-2LFS5WE2.js +2 -0
- package/dist/reconcile-cmd-R6H37SQR.js +5 -0
- package/dist/reconcile-deps-TWJ3FTSU.js +2 -0
- package/dist/reconcile-remote-GWDV5CUT.js +13 -0
- package/dist/recording-banner-ACC67Q2U.js +2 -0
- package/dist/registry-6IJYQXQC.js +2 -0
- package/dist/remote-entry-YL7O2NJQ.js +2 -0
- package/dist/remote-mode-7G6PLJCW.js +4 -0
- package/dist/remote-words-45USLRVN.js +2 -0
- package/dist/require-project-folder-A3UDRELU.js +2 -0
- package/dist/resolve-run-intent-ZGPSUBXV.js +2 -0
- package/dist/resolver-IPM6R7U4.js +2 -0
- package/dist/revert-FHOBLZWF.js +2 -0
- package/dist/review-cmd-NNT5C5RZ.js +5 -0
- package/dist/run-5RQUCNYP.js +2 -0
- package/dist/run-PC5YO4AS.js +2 -0
- package/dist/run-channel-63SVP5OI.js +2 -0
- package/dist/run-remote-3AYYVPKX.js +2 -0
- package/dist/run-startup-gate-NKRMKYBB.js +2 -0
- package/dist/run-test-md-HE6DUWQR.js +17 -0
- package/dist/scrollback-GGNBDFQV.js +2 -0
- package/dist/session-target-DD53UXO7.js +2 -0
- package/dist/session-worker.js +12 -0
- package/dist/sessions-CFV7FOIT.js +2 -0
- package/dist/sessions-cmd-GYMETJHG.js +26 -0
- package/dist/sessions-remote-GI7GOBMH.js +3 -0
- package/dist/shell-arg-FN3MT5U7.js +2 -0
- package/dist/{skill-installer-32YYMM4N.js → skill-installer-3QAVQGDH.js} +1 -1
- package/dist/spawner-C7NLLM4F.js +2 -0
- package/dist/store-X6XPFSKF.js +2 -0
- package/dist/store-choice-RT73HAI7.js +2 -0
- package/dist/store-guard-SNWKLHQV.js +2 -0
- package/dist/store-id-YZ5WKJ25.js +2 -0
- package/dist/store-site-KA2DNBGY.js +2 -0
- package/dist/stream-warnings-GEQKKJU7.js +2 -0
- package/dist/structured-answers-EQ2AP3F7.js +2 -0
- package/dist/sync-cmd-NBPPDG3B.js +2 -0
- package/dist/sync-setup-5NUCH6N3.js +2 -0
- package/dist/{sync-setup-ui-RC727VK6.js → sync-setup-ui-XITPGSO4.js} +2 -2
- package/dist/tcg-generate-Z23CUISY.js +2 -0
- package/dist/test-definition-VRI4YIYL.js +2 -0
- package/dist/testmd-actions-GH5BW5V5.js +2 -0
- package/dist/testmd-sync-ACKCIOL3.js +2 -0
- package/dist/tms-client-NXAB6VJD.js +2 -0
- package/dist/token-refresh-4UCYAG6A.js +2 -0
- package/dist/trust-gate-AT2XBWN4.js +2 -0
- package/dist/turn-preflight-LHYLRL7G.js +2 -0
- package/dist/ui-SNV3FD2G.js +4 -0
- package/dist/use-case-ref-NE4X4MZN.js +2 -0
- package/dist/validate-basic-RE2WLIGQ.js +2 -0
- package/dist/{variable-receipt-YWNS24TH.js → variable-receipt-BXSZO36E.js} +1 -1
- package/dist/verdicts-XK3GAUX3.js +2 -0
- package/dist/version-check-4FJVZP3K.js +2 -0
- package/dist/{view-cmd-3WHG6MVB.js → view-cmd-N47BQZPD.js} +4 -3
- package/dist/walk-session-DA7QWXSW.js +2 -0
- package/dist/with-telemetry-7V4LY2BG.js +2 -0
- package/package.json +11 -11
- package/dist/ChatSurface-FJPK3XEJ.js +0 -8
- package/dist/ChromeProfilePicker-7DUDJTE2.js +0 -2
- package/dist/CliFeedbackPrompt-ZZPYC6OS.js +0 -2
- package/dist/CliUploadProgress-WQYKIBAR.js +0 -2
- package/dist/ConfigView-KXNOODDW.js +0 -2
- package/dist/EvidenceViewOffer-BTBVPBZX.js +0 -2
- package/dist/FolderPicker-H4YEX5LV.js +0 -2
- package/dist/InfoBox-DTM7X24Z.js +0 -2
- package/dist/LinksBox-KFG3FVOT.js +0 -2
- package/dist/ProfilesView-KBZHT4KL.js +0 -2
- package/dist/ProjectPicker-OARWULNN.js +0 -2
- package/dist/SaveSessionPrompt-37SMU5MC.js +0 -2
- package/dist/ScrollbackTap-QHJOFYMC.js +0 -2
- package/dist/SingleShotApp-UYCAW65Y.js +0 -2
- package/dist/SummaryBox-6RB5DSAH.js +0 -2
- package/dist/TestMdRunView-ZMOII3PL.js +0 -2
- package/dist/TestrunEvidenceTable-3UP2EYIV.js +0 -2
- package/dist/WhoamiView-MC62GERR.js +0 -2
- package/dist/app-client-PQFJAB63.js +0 -2
- package/dist/app-download-P6YXWSVQ.js +0 -2
- package/dist/auth-LXW4OFKF.js +0 -2
- package/dist/bind-ZYESQSCJ.js +0 -15
- package/dist/bootstrap-DI4UGMH3.js +0 -2
- package/dist/bridge-7J3JE3JS.js +0 -2
- package/dist/build-JIKYOZUH.js +0 -2
- package/dist/catalog-LLME3744.js +0 -2
- package/dist/chat-committer-6D7AQI6Z.js +0 -2
- package/dist/chat-controller-UJQ6Z4RE.js +0 -2
- package/dist/chunk-243ZJHT6.js +0 -4
- package/dist/chunk-2KVECC36.js +0 -2
- package/dist/chunk-2YEHV2CX.js +0 -2
- package/dist/chunk-3MCPTVJX.js +0 -2
- package/dist/chunk-3UI5VTQS.js +0 -4
- package/dist/chunk-3VAU3PNU.js +0 -2
- package/dist/chunk-3YIZG7WZ.js +0 -3
- package/dist/chunk-4Y2WH77W.js +0 -2
- package/dist/chunk-5EOX4MEY.js +0 -2
- package/dist/chunk-5HMN74RZ.js +0 -9
- package/dist/chunk-5LJRZI7S.js +0 -6
- package/dist/chunk-5RCS2LIQ.js +0 -26
- package/dist/chunk-5TQFOPJV.js +0 -2
- package/dist/chunk-5ZFOKYFB.js +0 -5
- package/dist/chunk-63DYVWNX.js +0 -2
- package/dist/chunk-6MD7SR7D.js +0 -9
- package/dist/chunk-7N6OCHPC.js +0 -7
- package/dist/chunk-A2SQD2AY.js +0 -4
- package/dist/chunk-AACQE24F.js +0 -2
- package/dist/chunk-AHFIRHSP.js +0 -18
- package/dist/chunk-AJT34ESA.js +0 -38
- package/dist/chunk-AUMJ4RVA.js +0 -21
- package/dist/chunk-AXTPNZPX.js +0 -2
- package/dist/chunk-BB2W35TW.js +0 -2
- package/dist/chunk-BKM2LWU2.js +0 -3
- package/dist/chunk-BUPRL2TE.js +0 -2
- package/dist/chunk-C44QQJR4.js +0 -239
- package/dist/chunk-CW3RHKLA.js +0 -5
- package/dist/chunk-D6E6KRVX.js +0 -2
- package/dist/chunk-DTRKTBCE.js +0 -17
- package/dist/chunk-DTRSYWZE.js +0 -2
- package/dist/chunk-EVFFDODK.js +0 -5
- package/dist/chunk-F2OBORCG.js +0 -2
- package/dist/chunk-FQNQVC5O.js +0 -5
- package/dist/chunk-FY7TCYPK.js +0 -6
- package/dist/chunk-GTVQYT3D.js +0 -35
- package/dist/chunk-HG5LLZBU.js +0 -2
- package/dist/chunk-I7TIGB7K.js +0 -2
- package/dist/chunk-IICT4VOU.js +0 -2
- package/dist/chunk-ILDHE4P4.js +0 -6
- package/dist/chunk-IPXKUYUK.js +0 -2
- package/dist/chunk-JQY5HRZ4.js +0 -15
- package/dist/chunk-JX6BFEDO.js +0 -4
- package/dist/chunk-K2UJYY2U.js +0 -2
- package/dist/chunk-KBM3XHAM.js +0 -2
- package/dist/chunk-KDNNMU7Q.js +0 -4
- package/dist/chunk-KJQNAOOE.js +0 -6
- package/dist/chunk-LH4IPANP.js +0 -2
- package/dist/chunk-LLG7NEGX.js +0 -6
- package/dist/chunk-LSDWPG6C.js +0 -2
- package/dist/chunk-MSGW4JDG.js +0 -2
- package/dist/chunk-NJ4BXZBX.js +0 -2
- package/dist/chunk-NLCCBXXV.js +0 -2
- package/dist/chunk-NMSZ7G6P.js +0 -2
- package/dist/chunk-OC6H6BYI.js +0 -6
- package/dist/chunk-OJAXOOZ5.js +0 -8
- package/dist/chunk-OMNLAGQC.js +0 -29
- package/dist/chunk-OOCCUUR2.js +0 -2
- package/dist/chunk-OXC6O5O7.js +0 -2
- package/dist/chunk-OZQDD2EX.js +0 -94
- package/dist/chunk-PEDINHVU.js +0 -2
- package/dist/chunk-PNUAP3RY.js +0 -8
- package/dist/chunk-Q2F5QB2W.js +0 -2
- package/dist/chunk-Q4YYAN6E.js +0 -2
- package/dist/chunk-Q6AHSGOE.js +0 -5
- package/dist/chunk-QAB3Y5FQ.js +0 -4
- package/dist/chunk-RDHWNSDP.js +0 -7
- package/dist/chunk-RKXHVP2Z.js +0 -2
- package/dist/chunk-RRY5IXOB.js +0 -2
- package/dist/chunk-RSSOJ3L2.js +0 -21
- package/dist/chunk-RTSBKCZY.js +0 -16
- package/dist/chunk-SID4X77D.js +0 -370
- package/dist/chunk-SRTKRHYI.js +0 -12
- package/dist/chunk-T2ONUKTL.js +0 -5
- package/dist/chunk-U6OTFMIT.js +0 -4
- package/dist/chunk-UD7KKHPW.js +0 -5
- package/dist/chunk-USOYXCZ4.js +0 -2
- package/dist/chunk-USY7VAO6.js +0 -2
- package/dist/chunk-V4B5QA3U.js +0 -4
- package/dist/chunk-VBS33P2C.js +0 -2
- package/dist/chunk-VHW7BMZQ.js +0 -2
- package/dist/chunk-VIO7CCFW.js +0 -5
- package/dist/chunk-VORWZLS3.js +0 -9
- package/dist/chunk-VVOKM2VO.js +0 -2
- package/dist/chunk-W5TTF7GB.js +0 -6
- package/dist/chunk-WESMQEPO.js +0 -2
- package/dist/chunk-WMI4P76K.js +0 -27
- package/dist/chunk-WNOC6MQC.js +0 -2
- package/dist/chunk-WVHMPIDQ.js +0 -2
- package/dist/chunk-XBX643ZD.js +0 -2
- package/dist/chunk-XKHWWKJZ.js +0 -3
- package/dist/chunk-XLSOQLVT.js +0 -2
- package/dist/chunk-Y3ZYN6AK.js +0 -4
- package/dist/chunk-YCCUBQY4.js +0 -2
- package/dist/chunk-YKTYVJBN.js +0 -3
- package/dist/chunk-YLQHY4A7.js +0 -2
- package/dist/chunk-Z7IGTVJW.js +0 -2
- package/dist/chunk-ZC2CKWLB.js +0 -2
- package/dist/chunk-ZER3FZSZ.js +0 -22
- package/dist/chunk-ZJYT72BA.js +0 -9
- package/dist/chunk-ZKSN2SJ7.js +0 -2
- package/dist/chunk-ZLWURCJ7.js +0 -2
- package/dist/committer-2QPBANRD.js +0 -2
- package/dist/config-YGTHSGQN.js +0 -2
- package/dist/controller-client-ZF5IXRUV.js +0 -2
- package/dist/cover-cmd-6RO366CC.js +0 -3
- package/dist/descriptor-3JJUOHBM.js +0 -2
- package/dist/design-committer-D44GSUXY.js +0 -2
- package/dist/device-env-DXDJJMTL.js +0 -2
- package/dist/dispatch-7EWWQRQ5.js +0 -2
- package/dist/doctor-TPYPEEUL.js +0 -2
- package/dist/docx-convert-SQRTF7XS.js +0 -2
- package/dist/evidence-NPFTBGDF.js +0 -2
- package/dist/evidence-presentation-XF23B7F2.js +0 -2
- package/dist/evolve-cmd-VGVXV6XW.js +0 -2
- package/dist/explain-NEFBUX5G.js +0 -2
- package/dist/explain-cmd-GOP5TE63.js +0 -9
- package/dist/explain-cmd-M7IX2YNB.js +0 -3
- package/dist/extract-bind-CKIRLXAJ.js +0 -14
- package/dist/extract-cmd-3EWLSPGS.js +0 -5
- package/dist/feeder-66TUPB2R.js +0 -2
- package/dist/gaps-cmd-WVC5GXQC.js +0 -3
- package/dist/gate-OYRDJMF6.js +0 -2
- package/dist/headless-io-75HUMWZB.js +0 -2
- package/dist/identity-ADZ4PAJF.js +0 -2
- package/dist/ingest-OSNNM3DH.js +0 -2
- package/dist/ingest-cmd-AECK5T4H.js +0 -2
- package/dist/install-ZV3KJZV4.js +0 -2
- package/dist/interactive-bind-IYS6KDOH.js +0 -26
- package/dist/interrupt-guard-UREUWNRL.js +0 -2
- package/dist/lifecycle-cmd-XCSBELFQ.js +0 -2
- package/dist/list-cmd-S4DSN2ET.js +0 -3
- package/dist/list-commands-GLNGHPDU.js +0 -2
- package/dist/locks-cmd-67OHQZNV.js +0 -2
- package/dist/logical-ids-GLVM2SVR.js +0 -2
- package/dist/login-flow-ASUUU7SO.js +0 -2
- package/dist/maintenance-cmd-K5KXRIFL.js +0 -2
- package/dist/mobile-prompts-ZUZTA3RV.js +0 -2
- package/dist/open-provider-YIBB77FE.js +0 -2
- package/dist/pdf-convert-RLXSXFWN.js +0 -2
- package/dist/persist-recorded-session-EWV56TSZ.js +0 -3
- package/dist/phase-seed-MKHEWUN6.js +0 -2
- package/dist/pipeline-LAWACB2O.js +0 -2
- package/dist/prepare-target-WGPCZKLE.js +0 -2
- package/dist/readmodel-FVLRQWZ7.js +0 -2
- package/dist/real-device-run-MDLFKFVQ.js +0 -2
- package/dist/reconcile-cmd-XFM2ZXUJ.js +0 -2
- package/dist/reconcile-deps-V5VLDPYT.js +0 -4
- package/dist/reconcile-engine-VZBTMPUK.js +0 -2
- package/dist/recording-banner-CJHRPHHF.js +0 -2
- package/dist/records-LMCVKPE5.js +0 -2
- package/dist/registry-3JXQFZEG.js +0 -2
- package/dist/require-project-folder-SE5GVCYJ.js +0 -2
- package/dist/resolve-run-intent-DD4MB6UD.js +0 -2
- package/dist/resolver-TLO4SRWV.js +0 -2
- package/dist/revert-NOUECRW4.js +0 -2
- package/dist/review-cmd-7EOYQMPE.js +0 -5
- package/dist/run-EHUNJPW6.js +0 -2
- package/dist/run-OTMPUQSH.js +0 -2
- package/dist/run-channel-RGH4WIQX.js +0 -2
- package/dist/run-test-md-KBDEHGXJ.js +0 -17
- package/dist/scrollback-JLPJR25X.js +0 -2
- package/dist/session-items-2ATN7VXG.js +0 -2
- package/dist/session-target-UMNASXI7.js +0 -2
- package/dist/sessions-NH7WQWMX.js +0 -2
- package/dist/sessions-cmd-M3SECFKQ.js +0 -25
- package/dist/spawner-DPT2RLAO.js +0 -2
- package/dist/store-guard-U32JE6JJ.js +0 -2
- package/dist/store-id-EOSGEKVK.js +0 -2
- package/dist/structured-answers-ZI2B6JJE.js +0 -2
- package/dist/sync-cmd-3EP7LZGL.js +0 -2
- package/dist/sync-setup-SWTBVQEV.js +0 -2
- package/dist/tcg-generate-KXU7E2GF.js +0 -2
- package/dist/testmd-actions-PEWCPQ5R.js +0 -2
- package/dist/testmd-sync-ZWFQWZ2X.js +0 -2
- package/dist/tms-client-KU6HCA23.js +0 -2
- package/dist/token-refresh-QD3OCGJJ.js +0 -2
- package/dist/trust-gate-EX7R2P4Y.js +0 -2
- package/dist/turn-preflight-JGYT7LXP.js +0 -2
- package/dist/ui-JEJGTURD.js +0 -4
- package/dist/validate-basic-AAIXSAWH.js +0 -2
- package/dist/verdicts-LAB5BGCC.js +0 -2
- package/dist/version-check-EHOLX3YH.js +0 -2
- package/dist/walk-session-XP4KYFKO.js +0 -2
- package/dist/with-telemetry-FJMJQDCM.js +0 -2
- /package/dist/{chunk-BKHXPBWN.js → chunk-2RUSXQ3O.js} +0 -0
- /package/dist/{chunk-6J5T5FEY.js → chunk-3AGP2BVN.js} +0 -0
- /package/dist/{chunk-CH273NAE.js → chunk-73Y6T2UK.js} +0 -0
- /package/dist/{chunk-ZMNJBUAO.js → chunk-73ZFOJOK.js} +0 -0
- /package/dist/{chunk-NOL7MNZH.js → chunk-A7RJQJNT.js} +0 -0
- /package/dist/{chunk-N2P4MI32.js → chunk-FWGUISUG.js} +0 -0
- /package/dist/{chunk-UJZZDPDY.js → chunk-HD6NR44L.js} +0 -0
- /package/dist/{chunk-LDPLJFCV.js → chunk-I6S6DZ2E.js} +0 -0
- /package/dist/{chunk-427OQS2N.js → chunk-LD5B3QFW.js} +0 -0
- /package/dist/{chunk-2UIHS2FH.js → chunk-PGESS7BW.js} +0 -0
- /package/dist/{chunk-BZAGVBCX.js → chunk-ZCIWQHCO.js} +0 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as vs,b as ws,c as Is,d as ks,e as _s,f as Ss}from"./chunk-DNGOT65K.js";import{R as Ls}from"./chunk-432ZOE42.js";import{a as jr,b as fs,c as ps,d as Mt,e as ut,f as gs,g as Rs,h as $r,i as Mr,j as Vr,k as Cs,l as Es}from"./chunk-RW3Z2HMB.js";import{a as as}from"./chunk-WD52ZNQY.js";import{a as mt,b as hs,c as Fr}from"./chunk-BHSHGWBL.js";import{c as ys}from"./chunk-S3DAAAE5.js";import{f as Nr,h as Ur,i as Br}from"./chunk-K45BKGB5.js";import{k as As}from"./chunk-QTZBVDPR.js";import{d as xs}from"./chunk-2S3W2JT3.js";import{a as xr}from"./chunk-W3USRQX6.js";import{b as Kr,c as Hr}from"./chunk-RFEON5GN.js";import{a as Ot}from"./chunk-72KYMWQ5.js";import{a as _o,b as So,c as Ro,d as Co,e as Eo,f as Ao,g as wr,i as xo}from"./chunk-JQ64X2TO.js";import{d as $t,e as ms}from"./chunk-MII3JOO3.js";import{b as ds,c as Pr,d as Tr,e as Dr,f as he,g as Lr,i as Or,k as us}from"./chunk-JGRXMTME.js";import{a as ct,b as X,c as ss,e as we,f as Ye,g as Ar,k as is}from"./chunk-77ZZQJLX.js";import{a as ls}from"./chunk-UTM7D4PI.js";import{a as yo,b as bo,c as Nt,e as Ut,f as _r}from"./chunk-OEWYXCTA.js";import{a as jt,c as Lo,d as Oo,e as Ft,f as jo}from"./chunk-I2KOGINW.js";import{A as Vo,B as Ko,D as Sr,E as Ho,G as zo,I as Jo,J as Qo,K as Zo,M as Xo,N as es,W as ts,X as rs,ba as ns,ca as os,h as Bt,u as Bo,v as $o,z as Mo}from"./chunk-EXFDIVNI.js";import{a as Uo}from"./chunk-DREQ3RAA.js";import{c as Go,d as qo}from"./chunk-FIP5L6LV.js";import{a as Yo}from"./chunk-R7KXAISS.js";import{c as Fo,e as No}from"./chunk-IINZZ4BZ.js";import{d as Cr}from"./chunk-XMPTFXPW.js";import{a as Rr}from"./chunk-73Y6T2UK.js";import{g as Po,h as To}from"./chunk-IMDMRJQ6.js";import{f as lo,i as co,j as uo}from"./chunk-7RPKHKA3.js";import{a as fo,b as go,d as ho}from"./chunk-DD5TULWQ.js";import{e as po}from"./chunk-T4AVLJCW.js";import{h as mo}from"./chunk-5D7ENQTQ.js";import{a as vo,b as wo,d as Io,e as ko}from"./chunk-UAWWLLTI.js";import{a as vr}from"./chunk-Y6Y6RAY4.js";import{d as dt}from"./chunk-C6HI6Y3S.js";import{a as to}from"./chunk-Z7S3IWUX.js";import{d as ro}from"./chunk-4JOD47QI.js";import{a as Fe}from"./chunk-FCD3NYOM.js";import{a as no}from"./chunk-3G2LSTK5.js";import{a as bs}from"./chunk-4IEQNX7F.js";import{c as Ps,h as Ts,i as Ds}from"./chunk-GRURFGBP.js";import{c as cs}from"./chunk-MYZHOBS4.js";import{Ha as Er,s as Wo}from"./chunk-W3OVSDBN.js";import{a as Zn}from"./chunk-RPRXRKKR.js";import{a as Ir}from"./chunk-NWBLYMH7.js";import{a as kr}from"./chunk-QSCXXNC2.js";import{a as Do}from"./chunk-VO66KP2W.js";import{j as oo,m as so,n as Lt,o as io,p as ao}from"./chunk-NC7D7GOM.js";import{a as ae}from"./chunk-MGNRNLBE.js";import{a as Dt}from"./chunk-4QTH7VYE.js";import{a as ve}from"./chunk-RZ4F3BHX.js";import{a as Xn}from"./chunk-E47GFYXA.js";import{e as br,f as lt,p as eo}from"./chunk-A7RJQJNT.js";import{a as Pt,b as Tt,i as Qn,j as ze}from"./chunk-I6OQISK4.js";import{join as ke,basename as Me}from"path";import{existsSync as el,readFileSync as $i}from"fs";function Os(e,t){if(process.env.KANE_REPLAY_TRACE==="1")for(let r=0;r<e.steps.length;r++){let n=e.steps[r],o=t[r],s=" ".repeat(n.trace.length-1),d=`step ${n.flatIndex}`;if(o.kind==="replay"){let p=o.replayOnly?` [replay-only @${o.replayOnly}]`:"";process.stderr.write(`[replay-trace] ${s}${d}: REPLAY${p} (would skip; v1 always authors)
|
|
3
|
+
`)}else process.stderr.write(`[replay-trace] ${s}${d}: AUTHOR (${o.reason})
|
|
4
|
+
`)}}function Ne(e){process.env.KANE_REPLAY_TRACE==="1"&&process.stderr.write(e)}function js(e,t){let r=e===0?"(none)":`0..${e-1}`,n=e>=t?"(none)":`${e}..${t-1}`;Ne(`[replay-trace] phase: replay ${r}, author ${n}
|
|
5
|
+
`)}function Fs(e,t){Ne(`[replay-trace] step ${e}: REPLAY ${t==="ok"?"OK":"FAILED"}
|
|
6
|
+
`)}function Ns(e,t,r){Ne(`[replay-trace] shrink ${e}/${t} \u2192 new boundary ${r}
|
|
7
|
+
`)}function Us(e,t){Ne(`[replay-trace] complete-reauthor (${e} shrinks exhausted of ${t})
|
|
8
|
+
`)}function Gr(){Ne(`[replay-trace] force-author (--author) \u2014 walker bypassed; identity kept
|
|
9
|
+
`)}function Bs(e){Ne(`[replay-trace] cancelled at step ${e}
|
|
10
|
+
`)}function Ue(e,t){Ne(`[replay-trace] step ${e}: replay-only @${t} failed \u2014 adaptive heal cannot re-author it; the run fails here
|
|
11
|
+
`)}import{join as $s}from"path";function qr(e){let t=gs(e.decision),r={objective:e.step.objective,model:"v16-alpha",width:e.windowSize.width,height:e.windowSize.height,session_id:e.sessionId,run_index:e.runIndex,mode:"replay",replay:{recording_path:t[0],...t.length>1?{recording_paths:t}:{},step_label:e.step.objective,...e.investigationAsync?{investigation:"async"}:{}},screenshot_dir:e.evidence?$s(e.sessionDir,"scratch",String(e.runIndex)):$s(e.sessionDir,"runs",String(e.runIndex)),run_id:"run",test_id:"test",disable_ask_user:!0};return e.forceNavigateUrl&&(r.url=e.forceNavigateUrl),e.chrome.wsEndpoint?r.ws_endpoint=e.chrome.wsEndpoint:e.chrome.cdpEndpoint&&(r.cdp_endpoint=e.chrome.cdpEndpoint),e.auth.basicAuth?(r.username=e.auth.basicAuth.username,r.access_key=e.auth.basicAuth.access_key):e.auth.token&&(r.auth={type:"bearer",token:e.auth.token}),e.auth.resolvedCreds?.org_id&&(r.org_id=String(e.auth.resolvedCreds.org_id)),e.environmentId&&(r.environment_id=e.environmentId),e.variables&&Object.keys(e.variables).length>0&&(r.variables=e.variables),e.sessionContext&&(r.session_context=e.sessionContext),e.device&&(r.device=e.device),e.evidence&&(r.evidence=Bt(e.evidence.packTestDir,e.evidence.ordinalOffset)),r}async function Ms(e){let t=e.forceAuthor?0:ut(e.decisions),r=0,n=!1;for(;;){let o=e.session.snapshot(),s=e.accumulator.snapshot(),d=await e.runReplayPhase(t);if(d.cancelled)return n=!0,Bs(d.failedAt??0),{authorBoundary:t,cancelledInPhase:n,shrinkCount:r};if(d.failedAt===null)return{authorBoundary:t,cancelledInPhase:n,shrinkCount:r};let p=e.decisions[d.failedAt],i=p?.kind==="replay"?p.replayOnly:void 0,c=hs({failedAt:d.failedAt,shrinkCount:r,hasRetry:e.hasRetry,maxShrinks:e.maxShrinks,failedAtReplayOnly:i});if(c.kind==="fail")return c.replayOnly&&(Ue(d.failedAt,c.replayOnly),e.onReplayOnlyFail?.(d.failedAt,c.replayOnly)),{authorBoundary:-1,cancelledInPhase:n,shrinkCount:r};if(e.acquireLockIfNeeded&&!await e.acquireLockIfNeeded())return{authorBoundary:-1,cancelledInPhase:n,shrinkCount:r};if(e.recycleBrowser&&!await e.recycleBrowser())return{authorBoundary:-1,cancelledInPhase:n,shrinkCount:r};if(e.archiveAttempt&&await e.archiveAttempt(d.failedAt),e.session.rollback(o),e.accumulator.rollback(s),c.kind==="complete-reauthor")return Us(r+1,e.maxShrinks),{authorBoundary:0,cancelledInPhase:n,shrinkCount:r};r++,Ns(r,mt.maxShrinks,c.newAuthorBoundary),t=c.newAuthorBoundary}}var na=15e3,zr=3,Vs=[500,1e3];async function Yr(e){if(process.env.KANE_LOCK_CONFLICT_SIMULATE==="1")return{ok:!1,reason:"concurrent",httpStatus:409,message:"simulated contention (KANE_LOCK_CONFLICT_SIMULATE=1)"};let t=`${e.baseUrl}/test/${encodeURIComponent(e.testId)}/playground`,r=await Vt(t,{from_commit_id:e.fromCommitId,new_commit_id:e.newCommitId},e.auth);return r.ok?{ok:!0,sessionExpiresAt:ee(r.body,"session_expires_at")??""}:{ok:!1,...oa(r)}}function oa(e){let t=ee(e.body,"error")??ee(e.body,"code")??"",r=ee(e.body,"message")??ee(e.body,"detail")??e.text??`HTTP ${e.status}`,n;return e.status===0?n="network":e.status===401||e.status===403?n="auth":e.status===409&&t==="PlaygroundBaseCommitMismatch"?n="base_mismatch":e.status===409?n="concurrent":e.status===422?n="disabled":e.status===400&&/no committed/i.test(r)?n="no_commits":e.status===400?n="missing_field":e.status>=500||e.status===408||e.status===429?n="network":n="other",{reason:n,httpStatus:e.status,message:r}}async function Hs(e){let t=`${e.baseUrl}/test/${encodeURIComponent(e.testId)}/playground/reserve`,r=await Vt(t,void 0,e.auth);return r.ok?{ok:!0,sessionExpiresAt:ee(r.body,"session_expires_at")??""}:{ok:!1,expired:r.status===404,httpStatus:r.status,message:ee(r.body,"message")??ee(r.body,"detail")??r.text??`HTTP ${r.status}`}}async function Wr(e){let t=`${e.baseUrl}/test/${encodeURIComponent(e.testId)}/commit`,r={commit_id:e.body.commitId,from_commit_id:e.body.fromCommitId,commit_message:e.body.commitMessage,total_steps:e.body.totalSteps};e.body.timeTaken!==void 0&&(r.time_taken=e.body.timeTaken),e.body.objectives!==void 0&&(r.objectives=e.body.objectives),e.body.testInstanceId!==void 0&&(r.test_instance_id=e.body.testInstanceId),e.body.trigger!==void 0&&(r.trigger=e.body.trigger),e.body.assurance!==void 0&&(r.assurance={test:e.body.assurance.test,definition_id:e.body.assurance.definitionId});let n=await Vt(t,r,e.auth);return n.ok?{ok:!0,testId:ee(n.body,"test_id")??e.testId,testcaseId:ee(n.body,"testcase_id")??"",projectId:ee(n.body,"project_id"),isTestCaseDeleted:typeof n.body?.is_test_case_deleted=="boolean"?n.body.is_test_case_deleted:void 0}:{ok:!1,...sa(n)}}function sa(e){let t=ee(e.body,"error")??ee(e.body,"code")??"",r=ee(e.body,"message")??ee(e.body,"detail")??e.text??`HTTP ${e.status}`,n;return e.status===0?n="network":e.status===401||e.status===403?n="auth":e.status===409&&t==="PlaygroundBaseCommitMismatch"?n="base_mismatch":e.status===409&&t==="PlaygroundCommitLockMismatch"?n="lock_mismatch":e.status===409?n="expired":e.status===422?n="not_found":e.status>=500||e.status===408||e.status===429?n="network":n="other",{reason:n,httpStatus:e.status,message:r}}async function Be(e){let t=`${e.baseUrl}/test/${encodeURIComponent(e.testId)}/commit`,r={discard:!0,commit_id:e.body.commitId,from_commit_id:e.body.fromCommitId,commit_message:"(discarded)",total_steps:1},n=await Vt(t,r,e.auth);return n.ok?{ok:!0}:{ok:!1,reason:ee(n.body,"error")??"other",httpStatus:n.status,message:ee(n.body,"message")??ee(n.body,"detail")??n.text??`HTTP ${n.status}`}}async function Vt(e,t,r){let n=null;for(let o=1;o<=zr;o++){let s=new AbortController,d=setTimeout(()=>s.abort(),na);try{let p=await ve(e,{method:"POST",headers:{Authorization:Dt(r.username,r.accessKey),"Content-Type":"application/json",Accept:"application/json"},...t!==void 0?{body:JSON.stringify(t)}:{},signal:s.signal});clearTimeout(d);let i=await p.text(),c=null;if(i)try{c=JSON.parse(i)}catch{}let v=p.status>=500||p.status===408||p.status===429;if(p.ok||!v)return{ok:p.ok,status:p.status,body:c,text:i};if(o<zr){await Ks(Vs[o-1]??1e3);continue}return{ok:!1,status:p.status,body:c,text:i}}catch(p){if(clearTimeout(d),n=p,o<zr){await Ks(Vs[o-1]??1e3);continue}}}return{ok:!1,status:0,body:null,text:n?.message??"exhausted retries"}}function Ks(e){return new Promise(t=>setTimeout(t,e))}function ee(e,t){if(typeof e!="object"||e===null)return;let r=e[t];return typeof r=="string"?r:void 0}var ia=60*1e3,Gs="lock-heartbeat",Te=new Map,ft=null,aa={register:(e,t)=>Lt(e,t),deregister:e=>io(e),cleanup:(e,t)=>ao(e,t),remoteLogger:null};function qs(e){if(e!==void 0){let t=Te.get(e);t!==void 0&&(clearInterval(t),Te.delete(e));return}for(let t of Te.values())clearInterval(t);Te.clear()}function Kt(e){if(Te.has(e.testId))return;let t=e.lifecycle??aa,r=setInterval(async()=>{let n=await Hs({baseUrl:e.baseUrl,testId:e.testId,auth:e.auth});if(!n.ok){let o=n.expired?"session expired":n.message;process.stderr.write(`[lock] heartbeat failed (${e.testId}): ${o}; continuing run
|
|
12
|
+
`)}},ia);Te.set(e.testId,r),ft===null&&(ft=t,t.register(Gs,()=>qs()))}function Ie(e){Te.size!==0&&(qs(e),Te.size===0&&ft!==null&&(ft.deregister(Gs),ft=null))}import{readFileSync as zs,readdirSync as Ys,existsSync as $e,promises as Jr}from"fs";import{join as ue}from"path";async function la(e,t){let r=ue(e,"steps",`${t.ordinal}-${t.id}`),n,o=null,s=[];try{n=JSON.parse(await Jr.readFile(ue(r,"step.json"),"utf8")),o=n.action_id??null,Array.isArray(n.analyze_action_ids)&&(s=n.analyze_action_ids.filter(d=>typeof d=="string"))}catch{}if(typeof n?.screenshot=="string"&&/^screenshot\.(?:png|jpg)$/i.test(n.screenshot)){let d=n.screenshot;try{return{png:await Jr.readFile(ue(r,d)),filename:d,actionId:o,analyzeActionIds:s}}catch{}}for(let d of["screenshot.png","screenshot.jpg"])try{return{png:await Jr.readFile(ue(r,d)),filename:d,actionId:o,analyzeActionIds:s}}catch{}return null}function Ul(){let e=[];return{track:t=>{e.push(t.catch(()=>{}))},settle:async()=>{await Promise.all(e)}}}async function Ws(e,t,r,n){try{let o=await la(e,t);if(!o){n("warn","SCREENSHOT_SKIP","Pack step folder or screenshot not found",{ordinal:t.ordinal,id:t.id,reason:"pack_step_not_found"});return}let s=new Set;o.actionId&&s.add(o.actionId);for(let d of o.analyzeActionIds)s.add(d);if(s.size===0){n("warn","SCREENSHOT_SKIP","No action_id in step.json",{ordinal:t.ordinal,id:t.id,reason:"no_action_id"});return}for(let d of s)r.enqueue(d,o.png);n("info","SCREENSHOT_ENQUEUED","Screenshot enqueued",{ordinal:t.ordinal,id:t.id,action_id:o.actionId,action_ids:[...s],screenshot:o.filename,size:o.png.length})}catch(o){n("error","SCREENSHOT_DISPATCH_ERROR","Screenshot dispatch error",{ordinal:t.ordinal,id:t.id,error:o instanceof Error?o.message:String(o)})}}function Js(e,t,r,n,o,s){try{let d=ue(e,"runs",String(t),"run-test");if(!$e(d)){o("warn","SCREENSHOT_SKIP","Runs dir not found",{step_index:r,reason:"runsDir_not_found",path:d});return}let p=d;if(s){let S=ue(d,`child-${s}`);if(!$e(S)){o("warn","SCREENSHOT_SKIP","Child dir not found",{step_index:r,child_id:s,reason:"child_dir_not_found",path:S});return}let R=Ys(S).filter(l=>$e(ue(S,l,"screenshots")));if(R.length===0){o("warn","SCREENSHOT_SKIP","No screenshots dir under child",{step_index:r,child_id:s,reason:"no_child_screenshots_dir"});return}p=ue(S,R[0])}else if(!$e(ue(d,"screenshots"))){let S=Ys(d).filter(R=>$e(ue(d,R,"screenshots")));if(S.length===0){o("warn","SCREENSHOT_SKIP","No screenshots dir found",{step_index:r,reason:"no_screenshots_dir"});return}p=ue(d,S[0])}let i=ue(p,"screenshots",`step_${String(r).padStart(3,"0")}.png`);if(!$e(i)){o("warn","SCREENSHOT_SKIP","Screenshot not found",{step_index:r,child_id:s,reason:"screenshot_not_found",path:i});return}let c=ue(d,"actions.ndjson");if(!$e(c)){o("warn","SCREENSHOT_SKIP","NDJSON not found",{step_index:r,reason:"ndjson_not_found"});return}let v=zs(c,"utf-8").trim().split(`
|
|
13
|
+
`),m=v[v.length-1];if(!m){o("warn","SCREENSHOT_SKIP","NDJSON empty",{step_index:r,reason:"ndjson_empty"});return}let k=JSON.parse(m).action_id;if(!k){o("warn","SCREENSHOT_SKIP","No action_id in NDJSON",{step_index:r,reason:"no_action_id"});return}let D=zs(i);n.enqueue(k,D),o("info","SCREENSHOT_ENQUEUED","Screenshot enqueued",{step_index:r,child_id:s,action_id:k,size:D.length})}catch(d){o("error","SCREENSHOT_DISPATCH_ERROR","Screenshot dispatch error",{step_index:r,error:d instanceof Error?d.message:String(d)})}}import{dirname as da,join as ca}from"path";function Qs(e,t,r){let n=e.total_runs??1,o=e.run_dir,s,d;if(n>1&&o){let p=da(o);s=Array.from({length:n},(i,c)=>ca(p,String(t+c))),r&&r.length===n&&(d=r)}return{allRunDirs:s,flowObjectives:d}}function Zs(e,t,r,n){return{index:r,objective:t,summary:e.summary,oneLiner:e.one_liner,status:e.status,resultCode:e.result_code,reasonCode:e.reason_code,perFlowMetadata:e.per_flow_metadata,context:e.context??{memory:{},variables:{},pointer:""},run_dir:e.run_dir,run_dirs:n.allRunDirs,flow_objectives:n.flowObjectives}}var Ht=class{constructor(t){this.resolved=t;this.outcomes=t.rootSteps.map(r=>({rootStepIndex:r.index,status:"skipped"}))}outcomes;skipRoot=null;overallHalted=!1;shouldRunFlatStep(t){if(this.overallHalted)return!1;let r=t.trace[0].stepIndex;return!(this.skipRoot!==null&&r===this.skipRoot)}recordStep(t,r){let n=t.trace[0].stepIndex,o=this.outcomes.find(i=>i.rootStepIndex===n),s=this.resolved.rootSteps.find(i=>i.index===n),d=s.body.kind!=="objective";return d&&(o.refKind="import",o.refLabel=s.body.path,o.inlinedCount=(o.inlinedCount??0)+1,o.duration_s=(o.duration_s??0)+r.duration_s),r.status==="passed"?(d?o.status!=="failed"&&(o.status="passed"):(o.status="passed",o.duration_s=r.duration_s),{continueOverall:!0}):t.optional?(o.softFailures=o.softFailures??[],o.softFailures.push({subStepIndex:t.trace[t.trace.length-1].stepIndex,reason:r.reason}),{continueOverall:!0}):(o.status="failed",o.duration_s=d?o.duration_s:r.duration_s,o.failedSubStepIndex=d?t.trace.slice(1).map(i=>i.stepIndex):void 0,o.reason=r.reason,this.skipRoot=n,s.optional??!1?(o.softFailed=!0,{continueOverall:!0}):(this.overallHalted=!0,{continueOverall:!1}))}snapshotOutcomes(){return[...this.outcomes]}snapshot(){return{outcomes:this.outcomes.map(t=>({...t,softFailures:t.softFailures?[...t.softFailures]:void 0})),skipRoot:this.skipRoot,overallHalted:this.overallHalted}}rollback(t){this.outcomes=t.outcomes.map(r=>({...r,softFailures:r.softFailures?[...r.softFailures]:void 0})),this.skipRoot=t.skipRoot,this.overallHalted=t.overallHalted}finalize(t={}){let r=t.cancelled||this.outcomes.some(o=>o.status==="failed"&&!o.softFailed)?"failed":"passed",n=this.outcomes.reduce((o,s)=>o+(s.duration_s??0),0);return{overallStatus:r,outcomes:this.outcomes,totalDurationS:n}}};var Hl=ze;function Qr(e){if(!e)return null;let t=e.trim();return t?/^https?:\/\//i.test(t)?t:`https://${t}`:null}function Xs(e){return Qr(e.flag)??Qr(e.frontmatter)??(e.configDefault&&e.configDefault!==ze?Qr(e.configDefault):null)}function ei(e){return e.resolvedUrl!==null?!1:!((!!e.local||!!e.allowMissingUrl)&&!e.isTTY)}import{spawn as ua}from"child_process";async function ti(e,t,r=100){let n=`${e.replace(/\/+$/,"")}/json/version`,o=await ve(n);if(!o.ok)throw new Error(`CDP /json/version returned ${o.status}`);let s=await o.json();if(!s.webSocketDebuggerUrl)throw new Error("CDP /json/version missing webSocketDebuggerUrl");let d=new Xn(s.webSocketDebuggerUrl);await new Promise((B,x)=>{d.once("open",B),d.once("error",x)});let p=1,i=new Map;d.on("message",B=>{let x;try{x=JSON.parse(B.toString())}catch{return}if(x.id==null)return;let H=i.get(x.id);H&&(i.delete(x.id),x.error?H.reject(new Error(x.error.message)):H.resolve(x.result))});function c(B,x){let H=p++;return new Promise((fe,C)=>{i.set(H,{resolve:b=>fe(b),reject:C});let De={id:H,method:B};x&&(De.params=x),d.send(JSON.stringify(De))})}let m=(await c("Target.getTargets")).targetInfos.find(B=>B.type==="page");if(!m)throw d.close(),new Error("CDP: no page target found");let k=(await c("Browser.getWindowForTarget",{targetId:m.targetId})).windowId,D="",S=!1,R=null,l=!1;d.on("close",()=>{l=!0}),d.on("error",()=>{l=!0});async function M(){if(!S){if(l){S=!0;return}try{let x=(await c("Browser.getWindowBounds",{windowId:k})).bounds,H=`${x.left}:${x.top}:${x.width}:${x.height}`;H!==D&&(D=H,t({left:x.left,top:x.top,width:x.width,height:x.height}))}catch{}S||(R=setTimeout(M,r))}}return M(),{stop(){if(!S){S=!0,R&&clearTimeout(R);try{d.close()}catch{}}}}}var ma=new Set(["1","true","yes"]);function Zr(e){if(e?.headless)return null;let t=process.env.KANE_CLI_DISABLE_MARKER;if(t!=null&&ma.has(t.toLowerCase()))return null;let r=jt();if(!r)return null;let n=[...r.args,"overlay"];e?.text&&n.push(e.text);let o;try{o=ua(r.cmd,n,{cwd:r.cwd,stdio:["pipe","ignore","ignore"],detached:!1,windowsHide:!0})}catch{return null}o.stdin?.on("error",()=>{});let s=!1;o.on("exit",()=>{s=!0}),o.on("error",()=>{s=!0});function d(c){if(!(s||!o.stdin||o.stdin.destroyed))try{o.stdin.write(JSON.stringify(c)+`
|
|
14
|
+
`)}catch{}}e?.chromePid&&e.chromePid>0&&d({type:"chrome_pid",pid:e.chromePid});let p=null;e?.cdpEndpoint&&ti(e.cdpEndpoint,c=>d({type:"bounds",...c})).then(c=>{p=c.stop}).catch(()=>{});let i=!1;return{setRunActive(c){i||d({type:"run_active",active:c})},setStepText(c){if(i)return;let v=c.trim();v&&d({type:"step_text",text:v})},setStepComplete(){i||d({type:"step_complete"})},kill(){if(!i){i=!0,p?.();try{o.stdin?.end()}catch{}try{o.kill("SIGTERM")}catch{}}}}}function ri(e,t,r){return`${e}/projects/${t}/test-cases/${r}`}function Gt(e,t,r,n){return`${ri(e,t,r)}/dashboard/share/${n}?type=summary&agentView=true&fqdn=summary-page`}function ni(e,t,r,n){if(!(!t||!r||!n))return Gt(e,t,r,n)}function oi(e,t,r){return`${ri(e,t,r)}/dashboard?type=summary&agentView=true&fqdn=summary-page`}import{mkdtempSync as ka,rmSync as _a}from"fs";import{join as Sa}from"path";import{tmpdir as Ra}from"os";import{readFileSync as fa}from"fs";var pa="wss://cdp.lambdatest.com/playwright",ga="1.57.0",ha=new Set(["chrome","microsoftedge","pw-chromium"]),ya=e=>e==="true"||e==="1",ba="KANE_CLI_GRID",qt="KANE_CLI_GRID_CAPS";function Ce(e=process.env){return ya((e[ba]??"").trim().toLowerCase())}function va(){return{browserName:"Chrome",browserVersion:"latest","LT:Options":{platform:"linux",resolution:"1920x1080",video:!0,console:!0,network:!1,"network.full.har":!1,"network.http2":!0,w3c:!0,plugin:"kane-cli",project:"KaneAI-CLI",idleTimeout:1800,hideInternalCommandLogs:!0,"goog:chromeOptions":["--enable-logging","--disable-notifications","--no-sandbox","--log-level=0","--ignore-certificate-errors","--disable-blink-features=AutomationControlled","--password-store=basic","--safebrowsing-disable-auto-update","--disable-sync"]}}}function wa(e=process.env){let t=(e[qt]??"").trim();if(!t)return va();let r;try{r=fa(t,"utf8")}catch(d){throw new Error(`${qt}: cannot read grid capabilities at ${t}: ${d.message}`)}let n;try{n=bs(r,t)}catch{throw new Error(`${qt}: cannot read grid capabilities at ${t}: the file isn't valid JSON`)}let o=n,s=o?.["LT:Options"];if(!o||typeof o!="object"||!s||typeof s!="object"||Array.isArray(s))throw new Error(`${qt}: ${t} is not a grid capability object (needs "LT:Options")`);return{browserName:String(o.browserName||"Chrome"),browserVersion:String(o.browserVersion||"latest"),"LT:Options":{...s}}}function si(e,t=process.env){let r=wa(t);if(!ha.has(r.browserName.toLowerCase()))throw new Error(`LT grid browser "${r.browserName}" is not supported by kane-cli (it drives Chromium: Chrome or Edge)`);let n=r["LT:Options"];n.user=e.username,n.accessKey=e.accessKey,n.build=t.BUILD||n.build||"kane-cli",n.playwrightClientVersion=ga,n.name||(n.name=e.name),!n["tms.tc_id"]&&e.tcId&&(n["tms.tc_id"]=e.tcId);let o=Ia(n.customHeaders,t);return o?n.customHeaders=o:delete n.customHeaders,{browserName:r.browserName,browserVersion:r.browserVersion,"LT:Options":n}}function Ia(e,t){if(!e||typeof e!="object"||Array.isArray(e))return;let r={};for(let[n,o]of Object.entries(e))typeof o=="string"&&(r[n]=o.replace(/\{\{\s*([^}]+?)\s*\}\}/g,(s,d)=>{let p=d.split(".").pop()??d,i=t[p];return i===void 0?(process.stderr.write(`warn: LT grid custom header ${n}: ${s} has no value
|
|
15
|
+
`),s):i}));return Object.keys(r).length?r:void 0}function ii(e,t=process.env){let r=(t.HYE_HUB??"").trim().replace(/^[a-z]+:\/\//i,"").replace(/^[^@/]*@/,"").split("/")[0];return`${r?`wss://${r}/playwright`:pa}?capabilities=${encodeURIComponent(JSON.stringify(e))}`}async function ai(e){if(!e)return null;if(e.basicAuth)return{username:e.basicAuth.username,accessKey:e.basicAuth.access_key};let t=e.resolvedCreds??await e.resolver.resolve().catch(()=>null);return t?.username&&t?.access_key?{username:t.username,accessKey:t.access_key}:null}async function Xr(e){if(e.cft)return{instance:null,tempDir:null};if(e.wsEndpoint)return{wsEndpoint:e.wsEndpoint,instance:null,tempDir:null};if(e.cdpEndpoint){let o=await ve(`${e.cdpEndpoint}/json/version`);if(!o.ok)throw new Error(`CDP endpoint not reachable: ${e.cdpEndpoint} (${o.status})`);return{cdpEndpoint:e.cdpEndpoint,instance:null,tempDir:null}}if(Ce()){if(!e.ltGrid)throw new Error("KANE_CLI_GRID is set but no LambdaTest credentials were resolved for the LT browser");let o=ii(si(e.ltGrid));return process.stderr.write(`chrome: KANE_CLI_GRID \u2014 LT grid session "${e.ltGrid.name}"
|
|
16
|
+
`),{wsEndpoint:o,instance:null,tempDir:null,...e.startUrl?{startUrl:e.startUrl}:{}}}let t,r=null;if(e.config.chrome_profile_path)t=e.config.chrome_profile_path.replace("~",process.env.HOME??"~");else{r=ka(Sa(Ra(),"kane-clean-")),t=r;let o=r;Lt("tempDir",()=>{try{_a(o,{recursive:!0,force:!0})}catch{}})}let n=await po({userDataDir:t,width:e.config.window_size.width,height:e.config.window_size.height,startUrl:e.startUrl,headless:e.headless});return{cdpEndpoint:n.cdpEndpoint,instance:n,tempDir:r}}async function li(e,t){if(e==="device"){let{device:r,appRef:n,appId:o}=await t.prepareDevice();return{kind:"device",device:r,...n?{appRef:n}:{},...o?{appId:o}:{}}}return{kind:"web",chrome:await t.prepareWeb()}}function fd(e,t={}){if(e.kind==="device")return br(e.device.target);if(e.chrome.instance)return"chrome";if(t.cdpEndpoint)return"cdp";if(t.wsEndpoint)return"ws"}function pd(e,t){if(!(e.kind!=="device"||e.device.target!=="simulator"))return t?to(t):void 0}function gd(e){if(!(e.kind!=="device"||!br(e.device.target)))return e.appRef??""}function en(e){let t={objective:e.objective,model:e.model,width:e.windowSize.width,height:e.windowSize.height,session_id:e.sessionId,run_index:e.runIndex,max_steps:e.maxSteps??30,headless:e.headless??!1};return e.conditions&&e.conditions.length>0&&(t.conditions=[...e.conditions]),e.url&&(t.url=e.url),e.requireStartUrl&&(t.require_start_url=!0),e.chrome.wsEndpoint?t.ws_endpoint=e.chrome.wsEndpoint:e.chrome.cdpEndpoint&&(t.cdp_endpoint=e.chrome.cdpEndpoint),e.auth.basicAuth?(t.username=e.auth.basicAuth.username,t.access_key=e.auth.basicAuth.access_key):e.auth.token&&(t.auth={type:"bearer",token:e.auth.token}),e.auth.resolvedCreds?.org_id&&(t.org_id=String(e.auth.resolvedCreds.org_id)),e.projectId&&(t.project_id=e.projectId),e.disableAskUser&&(t.disable_ask_user=!0),e.enableTaskSkills&&(t.enable_task_skills=!0),e.networkWs&&(t.network_ws=!0),e.networkSse&&(t.network_sse=!0),(e.bugDetection==="stop"||e.bugDetection==="continue")&&(t.bug_detection=e.bugDetection),e.assertionFailureMode==="continue"&&(t.assertion_failure_mode="continue"),e.variables&&Object.keys(e.variables).length>0&&(t.variables=e.variables),e.globalContext&&(t.global_context=e.globalContext),e.localContext&&(t.local_context=e.localContext),e.sessionContext&&(t.session_context=e.sessionContext),e.device&&(t.device=e.device),e.environmentId&&(t.environment_id=e.environmentId),e.evidence&&(t.evidence=Bt(e.evidence.packTestDir,e.evidence.ordinalOffset)),t}import{existsSync as Ca,readFileSync as Ea}from"fs";import{join as Aa}from"path";var zt={max_retries:5,settle_ms:500,on_exhaust:"fail"},We=class{constructor(t,r,n){this.steps=t;this.decisions=r;this.deps=n;for(let o=0;o<t.length;o++){let s=t[o];if(s.controlFlow!=="if"&&s.controlFlow!=="while")continue;let d=s.block,p=t.map((h,k)=>[h,k]).filter(([h])=>h.block?.id===d.id&&h.block.depth===d.depth),i=p.find(([h])=>h.block.branch===-1)[1],c=p.filter(([h])=>h.controlFlow!==void 0&&h.block.branch!==-1).map(([,h])=>h),v=c.filter(h=>t[h].controlFlow!=="else").map(h=>t[h].objective),m={kind:s.controlFlow,opener:o,closer:i,markers:c,conditions:v,hasElse:t[c[c.length-1]].controlFlow==="else"};this.blocks.set(o,m),this.closers.set(i,m)}}blocks=new Map;closers=new Map;skip=new Set;attempts=new Map;taken=new Map;whileRuns=new Map;static hasBlocks(t){return t.some(r=>r.block!==void 0)}reset(){this.skip.clear(),this.attempts.clear(),this.taken.clear(),this.whileRuns.clear()}outcomes(){let t={};for(let[n,o]of this.taken)t[this.steps[n].flatIndex]=o;let r={};for(let[n,o]of this.whileRuns)r[this.steps[n].flatIndex]={...o};return{taken:t,whileRuns:r}}range(t,r){let n=t.markers[r]+1,o=r+1<t.markers.length?t.markers[r+1]:t.closer,s=[];for(let d=n;d<o;d++)s.push(d);return s}skipBranch(t,r){for(let n of this.range(t,r))this.skip.add(n)}unskipBody(t){for(let r=t.opener+1;r<t.closer;r++)this.skip.delete(r)}async judge(t){let r=await this.deps.evaluate(t),n=r.findIndex(o=>o==null);return n!==-1||r.length<t.length?{fail:`condition could not be judged: ${t[n===-1?r.length:n]}`}:r}async before(t){if(this.skip.has(t))return{action:"skip"};let n=this.steps[t].controlFlow;if(n==="if"){let s=this.blocks.get(t),d=await this.judge(s.conditions);if("fail"in d)return{action:"fail",reason:d.fail};let p=d.findIndex(i=>i===!0);p===-1&&s.hasElse&&(p=s.markers.length-1),this.taken.set(t,p);for(let i=0;i<s.markers.length;i++)i!==p&&this.skipBranch(s,i);return{action:"structural"}}if(n==="while"){let s=this.blocks.get(t);this.attempts.set(t,0);let d=await this.judge(s.conditions);return"fail"in d?{action:"fail",reason:d.fail}:(this.whileRuns.set(t,{iterations:d[0]?1:0,condition_met:!d[0]}),d[0]||this.skipBranch(s,0),{action:"structural"})}if(n==="end-while"){let s=this.closers.get(t);if(!(s.opener+1===s.closer)&&this.skip.has(s.opener+1))return{action:"structural"};let p=this.deps.whileConfig(s.opener),i=(this.attempts.get(s.opener)??0)+1;this.attempts.set(s.opener,i);let c=this.whileRuns.get(s.opener)??{iterations:i,condition_met:!1};if(c.iterations=i,this.whileRuns.set(s.opener,c),i>=p.max_retries)return p.on_exhaust==="fail"?{action:"fail",reason:`while exhausted after ${i} iteration(s): ${s.conditions[0]}`}:{action:"structural"};await this.deps.sleep(p.settle_ms);let v=await this.judge(s.conditions);return"fail"in v?{action:"fail",reason:v.fail}:v[0]?(this.unskipBody(s),c.iterations=i+1,{action:"jump",to:s.opener+1}):(c.condition_met=!0,{action:"structural"})}if(n!==void 0)return{action:"structural"};let o=this.decisions[t];return o?.kind==="replay"&&o.unrecorded?{action:"author"}:{action:"run"}}};function tn(e){try{let t=ds(e),r=is(e.owningFile,e.trace[e.trace.length-1].stepIndex,t.slice(0,8)),n=Aa(r,"flows","0","actions.ndjson");if(!Ca(n))return null;let o=Ea(n,"utf8").split(`
|
|
17
|
+
`).find(s=>s.trim().length>0);return o?JSON.parse(o):null}catch{return null}}function Yt(e){let t=tn(e);if(!t||t.action_type!=="while")return{...zt};let r=t.action_params??{};return{max_retries:typeof r.max_retries=="number"&&r.max_retries>0?r.max_retries:zt.max_retries,settle_ms:typeof r.settle_ms=="number"&&r.settle_ms>=0?r.settle_ms:zt.settle_ms,on_exhaust:typeof r.on_exhaust=="string"&&r.on_exhaust?r.on_exhaust:zt.on_exhaust}}import{mkdirSync as xa,writeFileSync as Pa}from"fs";import{join as di}from"path";var Wt=class extends no{constructor(t,r,n){super(t,{username:r,accessKey:n})}async getDataset(t,r){let n=`/v1/dataset/${encodeURIComponent(t)}`,o=r?.versionId?`?version_id=${encodeURIComponent(r.versionId)}`:"",s=await ve(`${this.baseUrl}${n}${o}`,{method:"GET",headers:this.headers()}),d=await s.text();if(!s.ok){let c=d.trim();try{let v=JSON.parse(d);typeof v.message=="string"&&v.message&&(c=v.message)}catch{}throw new Error(`GET ${n} failed: ${s.status} ${c}`)}let p;try{p=JSON.parse(d)}catch{throw new Error(`dataset ${t}: response is not JSON`)}let i=p;if(!i||!Array.isArray(i.headers)||!Array.isArray(i.rows))throw new Error(`dataset ${t}: response carries no headers / rows`);return i}};async function ci(e){let{id:t,version:r,row:n}=e.selection,o=new Wt(e.tmsBaseUrl,e.auth.username,e.auth.access_key),s;try{s=await o.getDataset(t,r?{versionId:r}:void 0)}catch(m){throw new Error(`dataset ${t}: ${m.message}`)}let d=di(e.saveDir,"dataset"),p=di(d,`${t}.json`);try{xa(d,{recursive:!0}),Pa(p,JSON.stringify(s,null,2)+`
|
|
18
|
+
`,"utf8")}catch(m){e.log?.("warn","DATASET_SAVE_FAILED","Could not save the fetched dataset",{path:p,error:String(m)})}let i;try{i=So(s,n)}catch(m){throw new Error(`dataset ${t}: ${m.message}`)}let c=Ro(s,i.row),v=typeof s.latest_version_id=="string"&&s.latest_version_id?s.latest_version_id:void 0;return e.log?.("info","DATASET_ROW_LOADED","Dataset row loaded as parameters",{dataset_id:t,row_id:i.id,row_index:i.index,columns:Object.keys(c)}),{selection:e.selection,dataset:s,rowIndex:i.index,rowId:i.id,versionId:v,externalId:xo(t,i.id,v),evidenceRecord:{dataset_id:t,dataset_name:typeof s.name=="string"&&s.name?s.name:null,dataset_version_id:v??null,row_id:i.id,row_index:i.index,columns:Object.keys(c),values:Object.fromEntries(Object.entries(c).map(([m,h])=>[m,h.value]))},parameters:c,testParams:Co(s,i.row),columns:new Set(Object.keys(c)),savedPath:p}}import{readFileSync as Ta,existsSync as Da}from"fs";function rn(e){if(!Da(e))return null;try{return Ta(e,"utf-8").trim()||null}catch{return null}}var La=()=>{};async function ui(e,t,r){let n=t.log??La,o=e.session.testId??null,s=null,d=null,p=null;if(!r.localMode&&t.performUpload)try{s=await t.performUpload(),s?.success&&(s.testId&&(o=s.testId),s.testcaseId&&e.session.setTestcaseId(s.testcaseId))}catch(i){n("error","FINALIZE_UPLOAD_ERROR","Upload pipeline threw",{error:String(i)})}if(t.renderFeedbackPrompt)try{d=await t.renderFeedbackPrompt(),d&&o&&t.submitFeedback&&t.submitFeedback(o,d).catch(i=>{n("error","FINALIZE_FEEDBACK_SUBMIT_ERROR","Feedback submit failed",{error:String(i)})})}catch(i){n("error","FINALIZE_FEEDBACK_RENDER_ERROR","Feedback prompt threw",{error:String(i)})}if(e.session.flushRecorder(),r.skipLocalWrites)n("info","FINALIZE_SKIP_LOCAL_WRITES","Skipping local writes (testmd flow handles via staging)");else if(r.sourcePath&&r.rootSteps&&r.outcomes){try{p=jr({sourcePath:r.sourcePath,title:r.title,rootSteps:r.rootSteps,outcomes:r.outcomes,overallStatus:r.overallStatus,startedISO:r.startedISO,durationS:r.durationS,sessionId:e.session.sessionId})}catch(i){n("error","FINALIZE_RESULT_MD_ERROR","_Result.md write failed",{error:String(i)})}try{Lr({sourcePath:r.sourcePath,commitId:e.session.sessionId,testId:o??void 0,testcaseId:e.session.testcaseId??void 0,projectId:e.tuiConfig.project_id??void 0,folderId:e.tuiConfig.folder_id??void 0,orgId:e.session.orgId??void 0,sessionName:e.session.sessionName??ct(r.sourcePath),plan:e.session.plan??void 0,media:Mr({priorMetaPath:we(r.sourcePath),recordFiles:$r(e.session.sessionDir)}),tcId:Tr(r.sourcePath),environmentId:Dr(r.sourcePath)})}catch(i){n("error","FINALIZE_META_WRITE_ERROR","meta.json write failed",{error:String(i)})}if(s?.codeExportDir)try{let i=xr(e.tuiConfig.code_export?.language??"python",r.mobile);Vr(s.codeExportDir,Ar(r.sourcePath,i.framework,i.language))}catch(i){n("error","FINALIZE_CODE_COPY_ERROR","code-export copy failed",{error:String(i)})}}else if(e.session.recorder?.lastWrittenPath){let i=e.session.recorder.lastWrittenPath,c=e.session.getFlows(),v=c.map((k,D)=>({index:D+1,heading:`Step ${D+1}`,verifies:[],headingLine:0,body:{kind:"objective",text:k.objective}})),m=c.map((k,D)=>({rootStepIndex:D+1,status:k.status==="passed"?"passed":k.status==="failed"?"failed":"skipped",duration_s:k.duration,reason:k.reason})),h=m.some(k=>k.status==="failed")?"failed":"passed";try{p=jr({sourcePath:i,title:e.session.sessionName??"Session",rootSteps:v,outcomes:m,overallStatus:h,startedISO:e.session.startedAt,durationS:m.reduce((k,D)=>k+(D.duration_s??0),0),sessionId:e.session.sessionId})}catch(k){n("error","FINALIZE_TUI_RESULT_MD_ERROR","TUI _Result.md write failed",{error:String(k)})}try{Lr({sourcePath:i,commitId:e.session.sessionId,testId:o??void 0,testcaseId:e.session.testcaseId??void 0,sessionName:e.session.sessionName??void 0,projectId:e.tuiConfig.project_id??void 0,folderId:e.tuiConfig.folder_id??void 0,plan:e.session.plan??void 0,media:Mr({priorMetaPath:we(i),recordFiles:$r(e.session.sessionDir)}),tcId:Tr(i),environmentId:Dr(i)})}catch(k){n("error","FINALIZE_TUI_META_WRITE_ERROR","TUI meta.json write failed",{error:String(k)})}if(s?.codeExportDir)try{let k=xr(e.tuiConfig.code_export?.language??"python",r.mobile);Vr(s.codeExportDir,Ar(i,k.framework,k.language))}catch(k){n("error","FINALIZE_TUI_CODE_COPY_ERROR","TUI code-export copy failed",{error:String(k)})}e.session.recorder.lastCollisionSuffixed&&process.stderr.write(`Saved to ${i} (renamed: ${e.session.sessionName}_test.md already existed)
|
|
19
|
+
`)}try{t.runCleanup?.()}catch(i){n("error","FINALIZE_CLEANUP_ERROR","Cleanup hook threw",{error:String(i)})}try{await e.session.finish("complete")}catch(i){n("error","FINALIZE_SESSION_FINISH_ERROR","session.finish threw",{error:String(i)})}return{uploadResult:s,feedbackChoice:d,resultMdPath:p}}import{readFileSync as Jt,writeFileSync as Qt,existsSync as on}from"fs";function mi(e,t,r){if(r.forceAuthor)return"re-recorded from scratch";if(r.retryTriggered)return"re-recorded after retry";if(t.length>0&&t.every(d=>d.kind==="author"&&d.reason==="no-result-md"))return"initial recording";if(t.length>0&&t.every(d=>d.kind==="replay"))return r.wantsPush?"re-recorded (no source changes)":"no changes";let n=[];for(let d=0;d<t.length;d++){let p=t[d];if(!p||p.kind!=="author"||p.reason==="downstream-of-divergence"||p.reason==="no-result-md")continue;let i=Oa(e,e.steps[d]);switch(p.reason){case"structure-mismatch":n.push(`added/removed: ${i}`);break;case"md5-mismatch":n.push(`modified: ${i}`);break;case"missing-recording":n.push(`re-recorded: ${i}`);break;case"recorded-failed":n.push(`re-authored after failure: ${i}`);break}}if(n.length===0)return"automated commit";let o=n.filter((d,p)=>p===0||n[p-1]!==d),s=o.slice(0,3).join("; ");return o.length>3?`${s}; +${o.length-3} more`:s}function Oa(e,t){if(!t)return"unknown step";let r=t.trace[0]?.stepIndex;if(r==null)return"unknown step";let o=e.rootSteps[r-1]?.heading?.trim()??"";return t.trace.length>1?o?`imported step in "${o}"`:`imported step ${r}`:o||`step ${r}`}import{existsSync as ja}from"fs";function Fa(e){return!!e&&typeof e.module_id=="string"&&e.module_id.trim()!==""}function nn(e){return`warn: ${e}: *_module.md without a cloud meta.json module_id \u2014 it ran as a module, but its steps upload as plain blocks (no module_block)`}function fi(e,t,r={}){let n=r.tapePresent??(h=>ja(ss(h))),o=r.readMeta??(h=>he(h)),s=r.onMissingIdentity??(h=>{process.stderr.write(`${nn(h)}
|
|
20
|
+
`)}),d=new Set,p=new Set(e.unitFiles.filter(h=>h.kind==="module").map(h=>h.file)),i=new Map,c=[];for(let h of e.steps){let k=h.flatIndex,D,S="";for(let R=0;R+1<h.trace.length;R++){let l=h.trace[R],M=h.trace[R+1].file;if(S=S?`${S}>${l.file}#${l.stepIndex}`:`${l.file}#${l.stepIndex}`,!p.has(M))continue;let B=i.get(S);if(!B){let x=o(M);if(!Fa(x)){d.has(M)||(d.add(M),s(M));continue}B={key:S,file:M,meta:x,flatFrom:k,flatTo:k,dirty:!1,children:[]},i.set(S,B),(D?D.children:c).push(B)}B.flatFrom=Math.min(B.flatFrom,k),B.flatTo=Math.max(B.flatTo,k),D=B}}let v=h=>{for(let k=h.flatFrom;k<=h.flatTo;k++)if(t.has(k))return!0;return!1},m=h=>{for(let k of h)k.dirty=n(k.file)&&v(k),m(k.children)};return m(c),c}function pi(e){let t={};for(let r of e)for(let n=0;n<Math.max(1,r.totalRunDirs);n++)t[r.runIndex+n]=r.testmdStepIndex;return t}function hi(e,t){let r=e.steps,n=[],o=[];for(let s=0;s<r.length;s++){let d=r[s],p=d.controlFlow;if(p==="if"||p==="while"){let i=Na(d,p,t);(o.length?o[o.length-1].children:n).push(i),o.push(i);continue}if(p==="elif"||p==="else"){let i=o[o.length-1];gi(i,d.flatIndex-1),i.branches.push({branch_type:p,condition:p==="else"?"":d.objective,flatFrom:d.flatIndex+1,flatTo:d.flatIndex,taken:!1});continue}if(p==="end-if"||p==="end-while"){let i=o.pop();gi(i,d.flatIndex-1),i.flatTo=d.flatIndex,Ua(i,t);continue}}return n}function Na(e,t,r){let n=tn(e),o=n?.action_params??{},s=typeof o.block_id=="string"?o.block_id:"",d=n?.action_instruction&&n.action_instruction.trim()||e.objective,p={kind:t,blockId:s,instruction:d,flatFrom:e.flatIndex,flatTo:e.flatIndex,branches:[{branch_type:"if",condition:e.objective,flatFrom:e.flatIndex+1,flatTo:e.flatIndex,taken:!1}],children:[]};if(t==="while"){let i=Yt(e),c=r?.whileRuns[e.flatIndex];p.whileCfg={...i,iterations:c?.iterations??0,condition_met:c?.condition_met??!1}}return p}function gi(e,t){let r=e.branches[e.branches.length-1];r.flatTo=t}function Ua(e,t){if(e.kind==="while"){e.branches[0].taken=(e.whileCfg?.iterations??0)>0;return}let r=t?.taken[e.flatFrom];typeof r=="number"&&r>=0&&r<e.branches.length&&(e.branches[r].taken=!0)}function Ba(e,t){if(!(!e.shouldReplaceLocalOutput||!e.resolvedTest||!e.sourcePath||!e.stepRunRecords||!e.outcomes||!e.overallStatus))return async()=>{let{changedUnitFiles:r,legacySweep:n}=await Cs({resolvedTest:e.resolvedTest,sessionDir:e.session.sessionDir,stepRunRecords:e.stepRunRecords,outcomes:e.outcomes,overallStatus:e.overallStatus,startedISO:e.startedISO??new Date().toISOString(),durationS:e.durationS??0,sessionId:e.session.sessionId,commitId:e.fromCommitId??"",tmsIds:e.tmsIds??{},codeExportDir:e.codeExportDir,packTestDir:e.evidence?.packTestDir??e.evidenceRead?.packTestDir,authoredFlatIdx:new Set(e.authoredFlatIdx??[])});t.files=r;for(let o of r){let s=X(o);if(on(`${s}.staging`)){as(s);let d=n.find(p=>p.unitFile===o);d&&Es(d.dirs)}}}}function $a(e,t){if(!e.shouldCommit||e.isFirstRun||!e.tmsBaseUrl||!e.testId||!e.fromCommitId||!e.newCommitId||!e.basicAuth||!e.resolvedTest||!e.decisions)return;let r=(o,s)=>$t({sourcePath:o,testId:s,sessionId:e.session.sessionId,commitId:e.newCommitId,identityOverride:{commit_id:e.newCommitId},controller:new Fe(ae(e.env).controllerBaseUrl,{username:e.basicAuth.username,accessKey:e.basicAuth.access_key})}),n=(o,s)=>e.onAgentEvent?.({type:"test_md_bundle_sync",status:s.ok?"ok":"failed",commit_id:e.newCommitId,path:o,...s.ok?{bytes:s.bytes}:{stage:s.stage}});return async()=>{let o;if(e.testmdSync===!1)e.log?.("info","BUNDLE_SYNC_SKIPPED","testmd bundle sync skipped",{reason:"flag",commit_id:e.newCommitId});else{if(!e.sourcePath){let m="bundle sync requires a source path";return e.log?.("warn","BUNDLE_SYNC_FAILED","testmd bundle sync failed",{commit_id:e.newCommitId,stage:"collect",error:m}),{ok:!1,reason:"bundle_sync_failed",message:m}}if(o=await r(e.sourcePath,e.testId),!o.ok)return e.log?.("warn","BUNDLE_SYNC_FAILED","testmd bundle sync failed",{commit_id:e.newCommitId,stage:o.stage,error:o.error}),n(e.sourcePath,o),process.stderr.write(` \u26A0 bundle sync failed (${o.stage}): ${o.error} \u2014 commit not attempted; the local tape is kept, run again with --push once fixed
|
|
21
|
+
`),{ok:!1,reason:"bundle_sync_failed",message:o.error}}let s=mi(e.resolvedTest,e.decisions,{wantsPush:e.wantsPush??!1,retryTriggered:e.retryTriggered??!1,forceAuthor:e.forceAuthor??!1}),d=e.resolvedTest.steps.map(m=>m.objective).filter(m=>typeof m=="string"&&m.length>0).slice(0,50),p=e.forceAuthor?"always_reauthor":e.retryTriggered?"adaptive_heal":void 0,i=Uo().testInstanceId,c={...i?{testInstanceId:i}:{},...p?{trigger:p}:{}},v=await Wr({baseUrl:`${e.tmsBaseUrl}/kane-cli/v1`,testId:e.testId,body:{commitId:e.newCommitId,fromCommitId:e.fromCommitId,commitMessage:s,totalSteps:e.resolvedTest.steps.length,timeTaken:Math.round(e.durationS??0),objectives:d,...c,...e.assuranceStamps?.root?{assurance:e.assuranceStamps.root}:{}},auth:{username:e.basicAuth.username,accessKey:e.basicAuth.access_key}});if(v.ok&&e.commitBox&&(e.commitBox.committed=!0,e.commitBox.testcaseId=v.testcaseId||void 0),v.ok&&o?.ok&&e.sourcePath&&(e.log?.("info","BUNDLE_SYNC_OK","testmd bundle pushed",{commit_id:e.newCommitId,bytes:o.bytes}),n(e.sourcePath,o)),v.ok&&e.sourcePath){let m=we(e.sourcePath);try{let h=JSON.parse(Jt(m,"utf8"));h.commit_id=e.newCommitId,Qt(m,JSON.stringify(h,null,2)+`
|
|
22
|
+
`,"utf8")}catch(h){process.stderr.write(`warn: failed to update meta.json commit_id: ${h.message}
|
|
23
|
+
`)}}if(v.ok)for(let m of e.unitLocks??[]){if(!t.files.includes(m.file)){await Be({baseUrl:`${e.tmsBaseUrl}/kane-cli/v1`,testId:m.testId,body:{commitId:e.newCommitId,fromCommitId:m.fromCommitId},auth:{username:e.basicAuth.username,accessKey:e.basicAuth.access_key}}),Ie(m.testId);continue}let h;if(e.testmdSync!==!1&&(h=await r(m.file,m.testId),!h.ok)){e.log?.("warn","BUNDLE_SYNC_FAILED","unit bundle sync failed",{commit_id:e.newCommitId,path:m.file,stage:h.stage,error:h.error}),n(m.file,h),process.stderr.write(`warn: unit bundle sync failed (${m.file}): ${h.stage}: ${h.error} \u2014 unit not committed
|
|
24
|
+
`),await Be({baseUrl:`${e.tmsBaseUrl}/kane-cli/v1`,testId:m.testId,body:{commitId:e.newCommitId,fromCommitId:m.fromCommitId},auth:{username:e.basicAuth.username,accessKey:e.basicAuth.access_key}}),Ie(m.testId);continue}let k=e.resolvedTest.steps.filter(R=>R.owningFile===m.file),D=k.map(R=>R.objective).filter(R=>typeof R=="string"&&R.length>0).slice(0,50),S=await Wr({baseUrl:`${e.tmsBaseUrl}/kane-cli/v1`,testId:m.testId,body:{commitId:e.newCommitId,fromCommitId:m.fromCommitId,commitMessage:`healed via importer ${e.sourcePath??""}`,totalSteps:k.length,timeTaken:0,objectives:D,...c,...e.assuranceStamps?.units?.[m.file]?{assurance:e.assuranceStamps.units[m.file]}:{}},auth:{username:e.basicAuth.username,accessKey:e.basicAuth.access_key}});if(S.ok){let R=we(m.file);try{let l=JSON.parse(Jt(R,"utf8"));l.commit_id=e.newCommitId,Qt(R,JSON.stringify(l,null,2)+`
|
|
25
|
+
`,"utf8")}catch(l){process.stderr.write(`warn: failed to update unit meta commit_id (${m.file}): ${l.message}
|
|
26
|
+
`)}h?.ok&&(e.log?.("info","BUNDLE_SYNC_OK","unit bundle pushed",{commit_id:e.newCommitId,path:m.file,bytes:h.bytes}),n(m.file,h))}else process.stderr.write(`warn: unit self-commit failed (${m.file}): ${S.reason??""} ${S.message??""} \u2014 unit lock released
|
|
27
|
+
`),e.log?.("warn","UNIT_COMMIT_FAILED","Imported unit commit failed; lock discarded",{path:m.file,test_id:m.testId,reason:S.reason,message:S.message}),await Be({baseUrl:`${e.tmsBaseUrl}/kane-cli/v1`,testId:m.testId,body:{commitId:e.newCommitId,fromCommitId:m.fromCommitId},auth:{username:e.basicAuth.username,accessKey:e.basicAuth.access_key}}),Ie(m.testId)}return v.ok?{...v,...c}:v}}function yi(e,t){t.attachedTc!==void 0&&(t.attachedTc?e.tc_id=t.attachedTc:delete e.tc_id)}function Ma(e){if(!e.attachedStop||!e.isFirstRun||!e.sourcePath)return;let t=we(e.sourcePath);return async()=>{let r=on(t)?JSON.parse(Jt(t,"utf8")):{};delete r.commit_id,delete r.testcase_id,e.attachedCaseId&&(r.attached_case_id=e.attachedCaseId),yi(r,e),e.tmsIds?.testId&&(r.test_id=e.tmsIds.testId),e.tmsIds?.projectId&&(r.project_id=e.tmsIds.projectId),Qt(t,JSON.stringify(r,null,2)+`
|
|
28
|
+
`,"utf8")}}function Va(e){if(!(!e.isFirstRun||!e.sourcePath))return async(t,r)=>{if(!e.sourcePath)return;let n=we(e.sourcePath);try{let o=on(n)?JSON.parse(Jt(n,"utf8")):{};e.session.sessionId&&(o.commit_id=e.session.sessionId),r&&(o.commit_id=r),t&&(o.testcase_id=t),delete o.attached_case_id,yi(o,e),e.tmsIds?.testId&&(o.test_id=e.tmsIds.testId),e.tmsIds?.projectId&&(o.project_id=e.tmsIds.projectId),e.tmsIds?.folderId&&(o.folder_id=e.tmsIds.folderId),e.tmsIds?.orgId&&(o.org_id=e.tmsIds.orgId),e.tmsIds?.sessionName&&(o.session_name=e.tmsIds.sessionName),Qt(n,JSON.stringify(o,null,2)+`
|
|
29
|
+
`,"utf8")}catch(o){process.stderr.write(`warn: failed to update meta.json after endTest: ${o.message}
|
|
30
|
+
`)}}}function Ka(e){let t=e.decisions,r=e.resolvedTest?.steps,n=e.sourcePath;if(!t||!r||!n)return;let o=[];if(t.forEach((s,d)=>{s.kind==="replay"&&s.replayOnly&&o.push(r[d]?.flatIndex??d+1)}),o.length!==0)return{authoredExecutionPath:Ye(n),flatIndices:o}}function bi(e){let t=Ka(e),r=ae(e.env),n=e.resolvedTest,o=!!n&&Array.isArray(n.unitFiles)&&(e.stepRunRecords?.length??0)>0,s=o?fi(n,new Set(e.authoredFlatIdx??[]),{onMissingIdentity:C=>{e.log?.("warn","MODULE_IDENTITY_MISSING","*_module.md without a cloud module_id; its blocks upload unfolded",{path:C}),process.stderr.write(`${nn(C)}
|
|
31
|
+
`)}}):void 0,d=o?pi(e.stepRunRecords):void 0,p=!!n&&n.steps.some(C=>C.block!==void 0),i=o&&p?hi(n,e.blockOutcomes):void 0,c=i?.length&&e.sourcePath?Ye(e.sourcePath):void 0,v={files:[]},{session:m,auth:h}=e,k=h.basicAuth?{username:h.basicAuth.username,accessKey:h.basicAuth.access_key}:h.token,D=h.resolvedCreds?.username??h.basicAuth?.username??"",S=h.resolvedCreds?.access_key??h.basicAuth?.access_key??"",R=h.resolvedCreds?.org_id??0,l=h.resolvedCreds?.user_id??0,M=[];for(let C of Object.keys(m.auteurVariables))C.startsWith("secrets.user.")&&M.push({key_name:C.replace("secrets.user.",""),scope:"user"});let x=m.getContext().prior_runs.map(C=>C.status),H=m.auteurVariables,fe=Object.keys(H).length>0;return{controllerBaseUrl:r.controllerBaseUrl,tmsBaseUrl:r.tmsBaseUrl,auth:k,authResolver:h.resolver,sessionId:m.sessionId,sessionDir:m.sessionDir,testId:m.testId,commitId:m.sessionId,apMode:m.apMode,projectId:e.projectId,folderId:e.folderId,firstObjective:m.firstObjective??"KaneAI Test",firstUrl:m.firstUrl??"",runDirs:m.getRunDirs(),runObjectives:m.getRunObjectives(),runMetadata:m.getRunMetadata(),startedAt:m.startedAt,endedAt:new Date().toISOString(),totalSteps:e.totalSteps,totalDuration:e.totalDuration,runStatuses:x,orgId:R,userId:l,tmsUsername:D,tmsAccessKey:S,screenshotBaseUrl:m.screenshotBaseUrl,screenshotExtMap:e.screenshotExtMap,shareApiBaseUrl:r.shareApiBaseUrl,variables:fe?H:void 0,variableIds:e.variableIds,...e.testParams?{testParams:e.testParams}:{},secrets:M,codeExport:e.codeExport,...e.mobile?{mobile:!0}:{},...e.environmentId?{environmentId:e.environmentId}:{},onProgress:e.onProgress,log:e.log,shouldUploadArtifacts:e.shouldUploadArtifacts,shouldReplaceLocalOutput:e.shouldReplaceLocalOutput,shouldCommit:e.shouldCommit,isFirstRun:e.isFirstRun,onAtomicReplace:Ba(e,v),onCommitLock:$a(e,v),onFinalizeSuccess:Va(e),onFinalizeGaveUp:Ma(e),...e.attachedStop?{attachedStop:!0}:{},...e.assuranceStamps?.root?{assuranceStamp:e.assuranceStamps.root}:{},evidence:e.evidence,evidenceRead:e.evidenceRead,...s?{moduleSpans:s}:{},...i?.length?{blockSpans:i,blockAuthoredExecutionPath:c}:{},...d?{runFlatIndex:d}:{},authoredExecutionPath:e.authoredExecutionPath,...t?{replayOnlyPassthrough:t}:{}}}var vi=["python","javascript"];function lc(e,t){return e?e.kind==="mobile":t}function Ha(e){if(e!==void 0){if(!vi.includes(e))throw new Error(`--code-language must be one of: ${vi.join(", ")} (got "${e}")`);return e}}function wi(e,t,r=!1){if(r&&e.skipCodeValidation===!1)throw new Error("Code export validation is web only: --skip-code-validation=false and --no-skip-code-validation are not supported for mobile. Remove the flag or use --skip-code-validation=true.");let n=Ha(e.codeLanguage);return{enabled:e.codeExport??t.enabled,language:n??t.language,skipValidation:r?!0:e.skipCodeValidation??t.skip_validation}}function Ii(e){let t=e.platform?.toLowerCase(),r=lt(e.target)?e.target:t==="android"||t==="ios"?eo(t):void 0,n=vo({model:e.deviceModel,name:e.deviceName});return{platform:e.platform??"",...e.appId?{appId:e.appId}:{},...e.deviceName?{deviceName:e.deviceName}:{},...e.osVersion?{osVersion:e.osVersion}:{},...e.udid?{udid:e.udid}:{},...r?{settings:mo(e.mobile,r)}:{},...n?{skinKey:n}:{}}}async function ki(e){try{let t=new dt(e.tmsBaseUrl,e.auth.username,e.auth.access_key);if(e.mobile){if(!e.mobile.appId)return e.log("warn","ATM_CREATE_SKIPPED","Mobile test not registered in TMS",{reason:"no cloud app id for the build under test"}),null;let n=e.mobile.skinKey&&e.environment?await wo(e.environment,e.mobile.skinKey):void 0,o=await t.createMobileAtmTest({objective:e.objective.slice(0,100),creation_mode:"KANECLI",playground_disabled:e.hasCustomProfile,mobile_browser:!1,os:e.mobile.platform.toLowerCase(),app_id:e.mobile.appId,project_id:e.projectId,folder_id:e.folderId,authoring_version:4,...e.mobile.deviceName?{deviceName:e.mobile.deviceName}:{},...e.mobile.osVersion?{osVersion:e.mobile.osVersion}:{},...e.mobile.udid?{udid:e.mobile.udid}:{},...e.mobile.settings,...n?{skin_url:n.skin_url,skin_data:n.skin_data}:{}});return e.log("info","ATM_CREATE_OK","Mobile test created",{test_id:o}),o}let r=await t.createAtmTest({objective:e.objective.slice(0,100),creation_mode:"KANECLI",playground_disabled:e.hasCustomProfile,testURL:e.url,project_id:e.projectId,folder_id:e.folderId,authoring_version:4});return e.log("info","ATM_CREATE_OK","Test created",{test_id:r}),r}catch(t){return e.log("error","ATM_CREATE_FAILED","Test creation failed",{error:t instanceof Error?t.message:String(t)}),null}}async function _i(e){let r=await new dt(e.tmsBaseUrl,e.auth.username,e.auth.access_key).createAttachedTest({objective:e.objective.slice(0,100),creation_mode:"KANECLI",playground_disabled:e.hasCustomProfile,testURL:e.url,project_id:e.projectId,folder_id:e.folderId,authoring_version:4,test_case_id:e.testCaseId});return r.ok?e.log("info","ATM_ATTACH_OK","Test created on its test case",{test_id:r.testId,test_case_id:e.testCaseId}):e.log("error","ATM_ATTACH_FAILED","Test not created on its test case",{...r,test_case_id:e.testCaseId}),r}var Ga=null,qa=()=>Ga??=import("sharp").then(e=>e.default??e).catch(()=>null),Zt=class{maxWorkers;maxRetries=2;queue=[];activeCount=0;drainResolvers=[];sas;log;uploadedExt=new Map;refreshSas;refreshInFlight=null;constructor(t,r=3,n,o){this.sas=t,this.maxWorkers=r,this.log=n,this.refreshSas=o}updateSas(t){this.sas=t}refresh(t){return this.refreshSas?(this.refreshInFlight??=this.refreshSas().then(r=>{this.updateSas(r),this.log?.("info","SCREENSHOT_SAS_REFRESHED","Screenshot SAS refreshed",{reason:t,expiry:r.expiry})}).catch(r=>{this.log?.("warn","SCREENSHOT_SAS_REFRESH_FAILED","Screenshot SAS refresh failed",{reason:t,error:r instanceof Error?r.message:String(r)})}).finally(()=>{this.refreshInFlight=null}),this.refreshInFlight):Promise.resolve()}enqueue(t,r){this.queue.push({operationId:t,buffer:r}),this.pump()}async drain(t=3e4){if(!(this.queue.length===0&&this.activeCount===0))return new Promise(r=>{this.drainResolvers.push(r),setTimeout(()=>{r()},t)})}pump(){for(;this.activeCount<this.maxWorkers&&this.queue.length>0;){let t=this.queue.shift();this.activeCount++,this.processJob(t).finally(()=>{if(this.activeCount--,this.pump(),this.queue.length===0&&this.activeCount===0){for(let r of this.drainResolvers)r();this.drainResolvers=[]}})}}async processJob(t){let r,n="image/webp",o=await qa();if(o)try{let i=await o(t.buffer).webp({quality:80}).toBuffer();r=new Uint8Array(i)}catch(i){r=new Uint8Array(t.buffer),n="image/png",this.log?.("warn","SCREENSHOT_CONVERT_FAILED","WebP conversion failed, using PNG",{operation_id:t.operationId,error:i instanceof Error?i.message:String(i)})}else r=new Uint8Array(t.buffer),n="image/png";let s=n==="image/webp"?"webp":"png",d=`test_screenshots/untagged_screenshot/${t.operationId}.${s}`;this.isNearExpiry()&&await this.refresh("near_expiry");let p=!1;for(let i=0;i<=this.maxRetries;i++){let c=`${this.sas.base_url}/${this.sas.container}/${d}?${this.sas.sas_token}`;try{let v=await ve(c,{method:"PUT",headers:{"Content-Type":n,"x-ms-blob-type":"BlockBlob"},body:r});if(v.ok){this.uploadedExt.set(t.operationId,s);return}if(v.status===403&&!p&&this.refreshSas){p=!0,await this.refresh("forbidden"),i--;continue}if(i<this.maxRetries){await this.backoff(i);continue}this.log?.("warn","SCREENSHOT_UPLOAD_FAILED","Screenshot upload failed after retries",{operation_id:t.operationId,status:v.status,attempts:this.maxRetries+1})}catch{if(i<this.maxRetries){await this.backoff(i);continue}this.log?.("warn","SCREENSHOT_UPLOAD_FAILED","Screenshot upload failed (network error)",{operation_id:t.operationId,error:"network",attempts:this.maxRetries+1})}}}backoff(t){let r=t===0?1e3:3e3;return new Promise(n=>setTimeout(n,r))}getExt(t){return this.uploadedExt.get(t)??"png"}getExtMap(){return this.uploadedExt}isNearExpiry(){if(!this.sas.expiry)return!1;let t=new Date(this.sas.expiry).getTime();return Date.now()>t-5*6e4}};import{platform as za,arch as Ya}from"os";function Si(e){let t={proxyUrl:Qn,sessionId:e.sessionId,identity:e.identity,device:{cli_version:Pt,platform:za(),arch:Ya(),host_agent:kr(),invocation_mode:e.invocationMode},getToken:e.getToken};return new Ir(t)}async function Wa(e){try{let t=ae(e.env),r=new Fe(t.controllerBaseUrl,e.auth),n=await r.getScreenshotSas();return e.session.setScreenshotSas(n),e.log("info","SCREENSHOT_SAS_OK","Screenshot SAS fetched",{base_url:n.base_url,container:n.container,expiry:n.expiry}),new Zt(n,3,e.log,async()=>{let o=await r.getScreenshotSas();return e.session.setScreenshotSas(o),o})}catch(t){return e.log("warn","SCREENSHOT_SAS_FAIL","Screenshot SAS fetch failed",{error:t instanceof Error?t.message:String(t)}),null}}async function Ja(e){if(e.session.hasRemoteLogger||!e.tmsCreds)return null;let t=e.tmsCreds,r=Si({sessionId:e.session.sessionId,identity:{org_id:String(t.org_id??""),user_id:String(t.user_id??""),machine_id:Do(),email:t.email??null,email_domain:t.email_domain??"unknown",user_type:t.user_type??"unknown",env:e.env,plan:t.plan??"unknown"},invocationMode:e.invocationMode,getToken:e.getToken});return e.session.setRemoteLogger(r),r.start(),r}async function dn(e){let[t,r]=await Promise.allSettled([e.skipScreenshotQueue?Promise.resolve(null):Wa({env:e.env,auth:e.auth,session:e.session,log:e.log}),Ja({env:e.env,tmsCreds:e.tmsCreds,getToken:e.getToken,session:e.session,invocationMode:e.invocationMode})]);return{resolver:e.resolver,screenshotQueue:t.status==="fulfilled"?t.value:null,remoteLogger:r.status==="fulfilled"?r.value:null}}async function sn(e){await Promise.allSettled([e.screenshotQueue?.drain(),e.remoteLogger?.shutdown()])}async function xc(e,t){switch(e.kind){case"boot":{if(t.state.identityServicesRef.current)return t.state.identityServicesRef.current;let r=t.auth.initResolver(e.env);r.prime(e.tmsCreds),t.state.setTmsCredsCache(e.tmsCreds);let n=await an(e.env,e.tmsCreds,r,t);return ln(n,t),n}case"login":case"switch":{let r=t.state.identityServicesRef.current;r&&(await sn(r),r.resolver.revoke()),t.state.identityServicesRef.current=null,t.state.screenshotQueueRef.current=null,t.state.setTmsCredsCache(null);let n=t.auth.initResolver(e.env),o=await n.resolve(!0).catch(()=>null);if(!o)return t.log("warn","IDENTITY_VALIDATE_FAILED","Identity validation failed",{kind:e.kind,env:e.env}),null;t.state.setTmsCredsCache(o);let s=await an(e.env,o,n,t);return ln(s,t),s}case"logout":{let r=t.state.identityServicesRef.current;return r&&(await sn(r),r.resolver.revoke()),t.state.identityServicesRef.current=null,t.state.screenshotQueueRef.current=null,t.state.setTmsCredsCache(null),null}case"resessionize":{let r=t.state.identityServicesRef.current;r&&await sn(r),t.state.identityServicesRef.current=null,t.state.screenshotQueueRef.current=null;let n=t.state.getTmsCredsCache(),o=t.auth.getResolver(),s=o??t.auth.initResolver(e.env);!o&&n&&s.prime(n);let d=await an(e.env,n,s,t);return ln(d,t),d}}}async function an(e,t,r,n){!n.options?.localMode&&t?.user_id!==void 0&&n.getSession().setCompletionIdentity(Number(t.user_id));let o=n.auth.getBasicAuth(),s=o?null:await n.auth.getToken(),d=o?{username:o.username,accessKey:o.access_key}:s??null;return d===null?{resolver:r,screenshotQueue:null,remoteLogger:null}:dn({env:e,tmsCreds:t,resolver:r,auth:d,getToken:()=>n.auth.getToken(),session:n.getSession(),log:n.log,skipScreenshotQueue:n.options?.localMode,invocationMode:"tui"})}function ln(e,t){t.state.identityServicesRef.current=e,t.state.screenshotQueueRef.current=e.screenshotQueue,e.remoteLogger&&(t.exit.registerCleanup("remote-logger",()=>e.remoteLogger.shutdownSync()),t.exit.setExitRemoteLogger(e.remoteLogger))}function Ri(e){if(!e.executionId)return;let t={executionId:e.executionId,published:e.published};return e.testId&&(t.testId=e.testId),e.testcaseId&&(t.testcaseId=e.testcaseId),e.commitId&&(t.commitId=e.commitId),e.coverage&&(t.coverage=e.coverage),t}function Ci(e,t){return{type:"error",code:e.code,message:e.message,...e.remedy?{remedy:e.remedy}:{},...e.support?{support_id:t.agentEventsShown===!1?Zn():Wo(`refused_${e.code}`)}:{}}}import{relative as Ni}from"path";var Qa="coverage couldn't be worked out for this run; the run itself isn't affected";function Ei(e,t){switch(e.status){case"written":{let r=e.doc;return{type:"coverage",status:"written",computed_by:e.computedBy,coverage_version:2,scope:r.scope,pct:Math.round(r.pct),usecases:r.usecases,criteria:r.criteria,...r.this_run?{this_run:r.this_run}:{},flags:r.flags,pack:t}}case"failed":return{type:"coverage",status:"failed",detail:Qa,pack:t};default:return{type:"coverage",status:xi(e),reason:e.reason,pack:t}}}function Ai(e){return e.status==="written"?{status:"written",pct:Math.round(e.doc.pct)}:{status:xi(e)}}var xi=e=>e.status==="pending"?"none":e.status;var Pi=e=>`${e} use-case${e===1?"":"s"}`,Za=e=>`${e} ${e===1?"criterion":"criteria"}`;function Ti(e){if(e===void 0)return[];switch(e.status){case"skipped":return[];case"pending":return e.reason==="on_grid"?["coverage: none in this run's evidence; a run on the grid doesn't record it"]:["coverage: none in this run's evidence; the shared project didn't answer in time"];case"failed":return["coverage: couldn't be worked out for this run; the run itself isn't affected"];case"written":{let t=e.doc.this_run??{usecases:[],criteria_passed:[],criteria_failed:[]};if(t.usecases.length===0)return["coverage: 0% from this run, which ran no designed test"," for coverage so far, run: kane-cli cover"];let r=e.project!==void 0?`"${e.project}"'s`:"this folder's",n=t.criteria_failed.length;return[`coverage: ${Math.round(e.doc.pct)}% across ${r} ${Pi(e.doc.usecases.total)}, from this run's tests`,` this run reached ${Pi(t.usecases.length)}: ${Za(t.criteria_passed.length)} passed${n>0?`, ${n} failed`:""}`]}}}import{readFile as Xa}from"fs/promises";function Di(e){let t=!e.lockHeld&&!e.isFirstRun;return e.shouldUploadArtifacts&&e.sealed&&!!e.testId&&(t||e.committed&&!e.coordinatorPublishes)}function Li(e){return e.isFirstRun?!!e.testcaseId:e.lockHeld&&e.committed}var cn=e=>e instanceof Error?e.message:String(e);async function Oi(e){let{controller:t,tms:r,testId:n,sessionId:o,executionId:s,sealedPackPath:d,projectId:p}=e,i;try{let c={key:"evidence",content_type:"application/zip",filename:`${s}.evidence`},m=(await t.getPresignedUrls(n,o,[c])).urls?.evidence?.upload_url;if(!m)return{ok:!1,stage:"presign",error:"presign response missing evidence upload_url"};i=m}catch(c){return{ok:!1,stage:"presign",error:cn(c)}}try{let c=await Xa(d);await ls(i,c,"application/zip")}catch(c){return{ok:!1,stage:"upload",error:cn(c)}}try{await r.ingestEvidence(s,p)}catch(c){return{ok:!1,stage:"ingest",error:cn(c)}}return{ok:!0}}function ji(e){return e.isFirstRun||Mt(e.decisions)||e.push===!0||e.author===!0}function Fi(e,t){return{projectId:e?.project_id??t.project_id??null,folderId:e?.folder_id??t.folder_id??null}}function un(e){return e?"author":"replay"}function tl(e,t){return e?{session:e,ownsLifecycle:!1}:{session:t,ownsLifecycle:!0}}function Xt(e,t){return e?.total_runs??t?.length??1}function rl(e){let t=(e?.per_flow_metadata??[]).map(r=>({resultCode:r?.result_code!=null?Number(r.result_code):null}));return{resultCode:e?.result_code!=null?Number(e.result_code):null,...t.length?{perFlow:t}:{}}}var er=["target","chrome_profile","cdp_endpoint","ws_endpoint","headless"];async function ym(e,t,r){let{path:n,cwd:o,opts:s,isAgent:d,disableAskUser:p,resolved:i,resolvedAuth:c,cliOverrides:v,environment:m,envConfig:h,profile:k,model:D,creds:S,configStore:R,session:l}=e,M=!1,B=Nr({flags:{target:s.target,deviceName:s.deviceName,osVersion:s.osVersion,app:s.app},file:{target:i.rootGlobal.target,device_name:i.rootGlobal.device_name,os_version:i.rootGlobal.os_version,app:i.rootGlobal.app,no_reset:i.rootGlobal.no_reset},grid:Ce(),deviceConfig:vr()});if(B.kind==="mobile"&&!B.app&&!pl(R.load().mobile,B.target))return d?t.onAgentEvent(Ur(B.target)):process.stderr.write(`error: ${Br(B.target,"app")}
|
|
32
|
+
`),{overallStatus:"failed",exitCode:2,outputDir:X(n),durationS:0,uploadResult:null};let x=process.env.KANE_CLI_MODE==="hyperexecute",H=x?ml(s.assuranceCase):null,fe=he(n),C=s.local||x&&H===null?{kind:"unlinked"}:await Qo({testFile:n,metaCaseId:fe?.testcase_id??null,...H?{gridCase:H}:{},...c.basicAuth?{auth:Dt(c.basicAuth.username,c.basicAuth.access_key)}:{}});if(C.kind==="attach"&&!C.rehome&&fe?.test_id&&fe.attached_case_id!==C.caseId&&(C={...C,rehome:!0}),C.kind==="attach"&&fl.has(String(s.target??i.rootGlobal.target??""))&&(C={kind:"stop",stop:{why:"outdated"},projectName:""}),C.kind==="stop")return Bi(Zo(C.stop,C.projectName),{isAgent:d,host:t,abs:n});let De=C.kind==="attach"&&C.rehome,b=await ll(n,i,s,{resolvedAuth:c,tmsBaseUrl:h.tmsBaseUrl},l.sessionId,r,{setAsideMeta:De});if(b.abort)return{overallStatus:"failed",exitCode:b.abort.exitCode,outputDir:X(n),durationS:0,uploadResult:null};let $=b.lockAcquired,fn=!1;try{let fr=function(a,u){let f=i.steps[a],y=Ui(f.config,v),w=Je(Oe.raw,y.variables,f.objective);return en({objective:w.objective,url:A.kind==="device"?void 0:tr(a)?Ae??void 0:f.unitEntryUrl,requireStartUrl:A.kind==="web"&&tr(a)&&zi,model:D,chrome:J,device:A.kind==="device"?A.device:void 0,auth:c,sessionId:l.sessionId,runIndex:u,projectId:s.local?null:G,windowSize:{width:1920,height:1080},maxSteps:il(y,Yi),headless:z.headless??!1,disableAskUser:!0,variables:Object.keys(w.variables).length>0?w.variables:void 0,globalContext:y.global_context??Cn,localContext:y.local_context??En,sessionContext:l.getContext(),environmentId:vt,bugDetection:s.bugDetection??K.bug_detection,assertionFailureMode:s.assertionFailureMode??K.assertion_failure_mode,evidence:mr()})},st=function(a){let f=i.steps[a].trace[0].stepIndex,y=i.rootSteps.find(g=>g.index===f);i.steps.slice(0,a).some(g=>g.trace[0].stepIndex===f)||t.onAgentEvent({type:"test_md_step_start",step_index:f,heading:y.heading,ref:y.body.kind==="import_ref"?{kind:"import",label:y.body.path,unit_kind:Or(y.body.path)}:null,...y.replayOnly?{replay_only:y.replayOnly}:{}})},St=function(a,u,f,y,w,g){let I=i.steps[a],j=I.trace[0].stepIndex,q=!i.steps.slice(a+1).some(N=>N.trace[0].stepIndex===j),_=f?.status==="passed"?"passed":"failed",P=f?.reason??w??void 0,F=f?.duration??g,T=f?.verdict;if(T&&typeof T=="object"){let N=typeof T.one_liner=="string"?T.one_liner:"",V=typeof T.bug_title=="string"&&T.bug_title?T.bug_title:N;if(V&&_==="failed"){let ge=[T.family,T.category].filter(Boolean).join("/"),xt=typeof T.confidence=="number"?`, confidence ${T.confidence.toFixed(2)}`:"";P=`${P??"failed"} \u2014 bug verdict: ${V}${ge?` [${ge}${xt}]`:""}`}let at=typeof T.category_proposal=="string"?T.category_proposal:"";at&&_==="failed"&&(P=`${P??"failed"}; category proposal: ${at} \u2014 consider adding to taxonomy`),t.onAgentEvent({type:"test_md_bug_verdict",step_index:I.trace[0].stepIndex,confirmed:T.confirmed===!0,bug_title:V||null,family:T.family??null,category:T.category??null,category_proposal:at||null,severity:T.severity??null,confidence:typeof T.confidence=="number"?T.confidence:null,one_liner:N||null})}let{continueOverall:L}=de.recordStep(I,{status:_,duration_s:F,reason:P}),Y=Ui(I.config,v),E=Je(Oe.raw,Y.variables,I.objective).objective;if(f){let N=Qs(f,u,y);l.addRunResult(Zs(f,E,u,N),f.total_runs)}else l.addRunResult({index:u,objective:E,status:_,summary:"",context:{memory:{},variables:{},pointer:""}},1);if(q||!L){let N=de.snapshotOutcomes().find(V=>V.rootStepIndex===j);t.onAgentEvent({type:"test_md_step_end",step_index:j,status:N.status,duration_s:N.duration_s??0,ref_kind:N.refKind??null,unit_kind:N.refKind==="import"?Or(N.refLabel??""):null,inlined_count:N.inlinedCount??null,failed_sub_step_index:N.failedSubStepIndex??null})}return L},Ge=function(a,u){let f=i.steps[a],y=f.trace[f.trace.length-1].heading;process.stderr.write(`\u{1FA79} step ${f.flatIndex} "${y}" @${u} broke on replay \u2014 adaptive heal cannot re-author a replay-only step; the run fails here
|
|
33
|
+
`),l.log("warn","REPLAY_ONLY_STEP_FAILED","Replay-only step failed on replay; heal not attempted",{flat_index:f.flatIndex,marker:u})};var hl=fr,yl=st,bl=St,vl=Ge;let gt={committed:!1},pe=!1,ht=new Set,Xe=0,Ki=i.steps.some(a=>a.block!==void 0),tr=a=>Ki?Xe===0:a===0,me=!1,yt=!1,et=s.author===!0?0:ut(b.decisions),rr=0,nr=0,Ve=0,tt=a=>typeof a?.credits_consumed=="number"&&Number.isFinite(a.credits_consumed)?a.credits_consumed:0;{let a;try{a=typeof s.sessionContext=="string"?JSON.parse(s.sessionContext):void 0}catch{a=void 0}let u=nl({resolved:i,cwd:o,globalDir:ke(Tt,"variables"),opts:s,authorFrom:et,produced:Ds(a)});u&&(d?t.onAgentEvent(u.event):process.stderr.write(u.text))}$&&t.onLockState({phase:"acquired",scope:"preemptive"}),l.start({model:D,environment:m,profile:k}),l.setRecordingEnabled(!1);let bt=0,pn=c.basicAuth?{username:c.basicAuth.username,accessKey:c.basicAuth.access_key}:c.token??null,rt=null;if(pn!==null){let a=await dn({env:m,tmsCreds:c.resolvedCreds??null,resolver:c.resolver,auth:pn,getToken:async()=>c.token??null,session:l,log:(u,f,y,w)=>l.log(u,f,y,w),skipScreenshotQueue:!!s.local||!c.basicAuth,invocationMode:d?"agent":"cli"});rt=a.screenshotQueue,a.remoteLogger&&(r.register("remote-logger",()=>a.remoteLogger.shutdownSync()),r.remoteLogger=a.remoteLogger,e.skipGlobalRemoteLogger||oo(a.remoteLogger))}if(s.name){try{ys(s.name)}catch(a){return process.stderr.write(`error: ${a.message}
|
|
34
|
+
`),{overallStatus:"failed",exitCode:2,outputDir:X(n),durationS:0,uploadResult:null}}l.setSessionName(s.name)}let or={};for(let[a,u]of Object.entries(i.rootGlobal))er.includes(a)||(or[a]=u);for(let[a,u]of Object.entries(v))er.includes(a)||u!==void 0&&(or[a]=u);let z={...i.chrome};for(let a of er){let u=v[a];u!==void 0&&(z[a]=u)}let Ke={...or,...z},Ee=Nr({flags:{target:s.target,deviceName:s.deviceName,osVersion:s.osVersion,app:s.app},file:{target:i.rootGlobal.target,device_name:i.rootGlobal.device_name,os_version:i.rootGlobal.os_version,app:i.rootGlobal.app,no_reset:i.rootGlobal.no_reset},grid:Ce(),deviceConfig:vr()});if(Ee.kind==="invalid")return process.stderr.write(`error: ${Ee.message}
|
|
35
|
+
`),await l.finish("complete"),{overallStatus:"failed",exitCode:2,outputDir:X(n),durationS:0,uploadResult:null};for(let a of Ee.warnings)process.stderr.write(`warning: ${a}
|
|
36
|
+
`);let ye=Ee.kind==="mobile"?Ee:null,ne=Ee.kind==="real-device"?Ee:null,gn=Fr(s)&&!ne;if(ne&&Fr(s)&&(process.stderr.write(`note: adaptive heal is off on real devices \u2014 a failed replay step is not repaired, and the test fails.
|
|
37
|
+
`),l.log("info","ADAPTIVE_HEAL_OFF_REAL_DEVICE","Adaptive heal is off for a real-device run")),l.setCompletionMetadata({runType:i.rootGlobal.assurance?.id?"assurance":"testmd",target:ne?ne.platform==="ios"?"simulator":"emulator":ye?.target??"desktop"}),Ee.kind==="web"&&i.rootGlobal.target===void 0){let u=i.rootSteps.map(y=>y.body).find(y=>y.kind==="objective")?.text??"",f=/^\s*\[mobile:\s*(emulator|simulator)\]/.exec(u);if(f)return process.stderr.write(`error: this test was designed for a mobile ${f[1]} but its frontmatter has no target: \u2014 add \`target: ${f[1]}\` and \`app: <path-to-build | AppId>\` to the file (or re-design it with the app named in the design chat: kane-cli design tests --use-case <uc> --force), then run again
|
|
38
|
+
`),await l.finish("complete"),{overallStatus:"failed",exitCode:2,outputDir:X(n),durationS:0,uploadResult:null}}ye?(Ke.target=ye.target,ye.app&&(Ke.app=ye.app)):ne?Ke.target=ne.platform:(i.rootGlobal.target==="emulator"||i.rootGlobal.target==="simulator")&&(delete Ke.app,delete Ke.no_reset),l.setResolvedGlobal(Ke);let _e=null;{let a=f=>(process.stderr.write(`error: ${f}
|
|
39
|
+
`),{overallStatus:"failed",exitCode:2,outputDir:X(n),durationS:0,uploadResult:null}),u;try{u=Eo({datasetId:s.datasetId,datasetVersion:s.datasetVersion,datasetRow:s.datasetRow},i.rootGlobal.dataset)}catch(f){return a(f.message)}if(u){if(!c.basicAuth)return a("--dataset-id needs Test Manager credentials \u2014 run 'kane-cli login' or pass --username/--access-key");try{_e=await ci({selection:u,tmsBaseUrl:ae(m).tmsBaseUrl,auth:c.basicAuth,saveDir:l.sessionDir,log:(y,w,g,I)=>l.log(y,w,g,I)})}catch(y){return a(y.message)}l.setResolvedGlobal({dataset:Ao(u.id,_e.rowId)});let f=Ps(i.steps.filter(y=>y.flatIndex-1>=et).map(y=>({text:y.objective,usedBy:{file:Me(y.sourceFile),step:y.flatIndex}})),_e.columns,u.id);f.length>0&&(d?t.onAgentEvent(Hr(f,{cwd:o})):process.stderr.write(Kr(f,{cwd:o,entryFile:Me(i.rootPath)})))}}let hn=S.getActiveProfile()??"default",yn=S.getDefaultEnv(),{rehydrateIfStale:Hi}=await import("./profile-sync-DTTRRIVP.js");Hi(S,R,hn,yn);let K=R.load(),bn=(v.assertion_mode??K.assertion_mode)==="dom"?"dom":"visual",vn=v.final_validation,wn=vn===void 0?void 0:vn==="on",G=K.project_id??null,be=K.folder_id??null,In=he(n),vt=In?.environment_id,sr=C.kind==="attach"?Pr(C.tc??void 0)??null:void 0,Le=sr!==void 0?sr??void 0:Pr(In?.tc_id),kn=async()=>{if(!Ce())return;let a=await ai(c);if(a)return{name:i.rootTitle||Me(n).replace(/_test\.md$/,""),...Le?{tcId:Le}:{},...a}},_n=ji({isFirstRun:b.isFirstRun,decisions:b.decisions,push:s.push===!0,author:s.author===!0});if(C.kind==="attach"||C.kind==="run")G=C.projectId,be=null,l.log("info","GATE_SKIP_LINKED","Project/folder gate skipped (the test's folder is linked to its project)",{project_id:G});else if(_n){if(c.basicAuth){let a=await To({creds:S,config:R,profile:hn,env:yn,tmsCreds:c.basicAuth,isLocal:!!s.local,log:(u,f,y,w)=>l.log(u,f,y,w),onAnnounce:e.onAnnounce,onFatalExit:e.onFatalExit});if(a.status==="ok"){G=a.projectId,be=a.folderId,K=R.load();let u=he(n);u?.project_id&&(G=u.project_id,be=u.folder_id??be),d&&a.autoDefaulted&&t.onAgentEvent(Po(a.autoDefaulted))}else if(a.status==="cancelled"){process.stderr.write(`error: project/folder configuration failed. See remediation above, or use --local.
|
|
40
|
+
`);let{shutdown:u}=await import("./exit-manager-EDHCETUN.js");return u(2,"project/folder gate failed"),{}}}}else{let a=he(n);({projectId:G,folderId:be}=Fi(a,{project_id:K.project_id??null,folder_id:K.folder_id??null})),l.log("info","GATE_SKIP_REPLAY","Project/folder gate skipped (planned pure replay)",{meta_project:!!a?.project_id,config_project:!!K.project_id})}{let a=us(i).filter(g=>!(De&&g.file===n)),u=c.resolvedCreds?.org_id!=null?String(c.resolvedCreds.org_id):void 0,f=a.find(g=>g.project_id&&G&&g.project_id!==String(G)||g.org_id&&u&&g.org_id!==u),y=new Set(a.map(g=>g.project_id).filter(Boolean)),w=new Set(a.map(g=>g.org_id).filter(Boolean));if(f||y.size>1||w.size>1){let g=f??a[0];return process.stderr.write(`error: tenant mismatch \u2014 imported test '${g.file}' was authored under project ${g.project_id??"?"} / org ${g.org_id??"?"}, which differs from the run's project/org (or another imported test). Cross-tenant imports are not allowed.
|
|
41
|
+
`),await l.finish("complete"),{overallStatus:"failed",exitCode:2,outputDir:X(n),durationS:0,uploadResult:null}}}if(C.kind==="attach"&&(C.rehome||b.testId==null)){let a=c.basicAuth,u=a?await _i({tmsBaseUrl:ae(m).tmsBaseUrl,auth:a,objective:i.steps[0].objective,url:"",projectId:C.projectId,folderId:be??"",hasCustomProfile:!!z.chrome_profile,testCaseId:C.caseId,log:(f,y,w,g)=>l.log(f,y,w,g)}):null;if(u===null||!u.ok){await l.finish("complete");let f=u===null?{refusal:Er.credentialsMissing(),exit:2}:Xo(u);return Bi(f,{isAgent:d,host:t,abs:n})}l.setTestId(u.testId)}let oe={},nt,A;try{A=await li(ye||ne?"device":"web",{prepareDevice:async()=>{if(ne){let f=await ho({target:ne.platform,...ne.selection?{selection:ne.selection}:{},env:m,sessionDir:l.sessionDir,auth:c,mobile:K.mobile,testName:i.rootTitle||Me(n).replace(/_test\.md$/,""),...Le?{tcId:Le}:{},write:y=>process.stderr.write(`${y}
|
|
42
|
+
`),stream:go({interactive:Cr()&&!d,flag:s.stream,mobile:K.mobile})});return f.deviceName&&(oe.deviceName=f.deviceName),f.osVersion&&(oe.osVersion=f.osVersion),f.app&&(oe.app=f.app),nt=f.announce,f.appId&&l.setResolvedGlobal({app:f.appId}),{device:f.device,...f.appId?{appId:f.appId}:{}}}let a=ye,u=await uo({platform:a.platform,...a.deviceSelector?{device:a.deviceSelector}:{},...a.app?{app:a.app}:{},...a.noReset!==void 0?{noReset:a.noReset}:{},defaults:K.mobile,interactive:Cr()&&!d,agent:d,...!s.local&&c.basicAuth&&c.resolvedCreds?.org_id?{cloudUpload:{env:m,orgId:String(c.resolvedCreds.org_id),userId:String(c.resolvedCreds.user_id??""),baseUrl:fo(m),auth:{username:c.basicAuth.username,accessKey:c.basicAuth.access_key}}}:{},onProgress:f=>process.stderr.write(`${f}
|
|
43
|
+
`)});return oe.deviceName=u.target.displayName,u.target.osVersion&&(oe.osVersion=u.target.osVersion),u.target.modelIdentifier&&(oe.modelIdentifier=u.target.modelIdentifier),u.appRef&&(oe.app=u.appRef),{device:u.device,...u.appRef?{appRef:u.appRef}:{},...u.appId?{appId:u.appId}:{}}},prepareWeb:async()=>Xr({config:{chrome_profile_path:z.chrome_profile??null,window_size:{width:1920,height:1080}},startUrl:ze,headless:z.headless??!1,wsEndpoint:z.ws_endpoint,cdpEndpoint:z.cdp_endpoint,ltGrid:await kn()})})}catch(a){if(ne)process.stderr.write(`error: real-device target preparation failed: ${a.message}
|
|
44
|
+
`);else if(ye){let u=a instanceof lo?`${a.doctorText}
|
|
45
|
+
${a.message}`:a.message;process.stderr.write(`error: mobile target preparation failed: ${u}
|
|
46
|
+
`)}else process.stderr.write(`error: Chrome launch failed: ${a.message}
|
|
47
|
+
`);return await l.finish("complete"),{overallStatus:"failed",exitCode:2,outputDir:X(n),durationS:0,uploadResult:null}}if(A.kind==="device"&&!lt(A.device.target)&&!A.device.app_package)return d?t.onAgentEvent(Ur(ye.target)):process.stderr.write(`error: ${Br(ye.target,"app")}
|
|
48
|
+
`),await l.finish("complete"),{overallStatus:"failed",exitCode:2,outputDir:X(n),durationS:0,uploadResult:null};let J=A.kind==="web"?A.chrome:{instance:null,tempDir:null},Se=J.instance;Se&&r.register("chrome",()=>{try{Se?.kill()}catch{}});let ir=Sr(J.cdpEndpoint),W=null,Sn=!1,wt=()=>{if(!W?.diedUnexpectedly)return!1;if(!Sn){Sn=!0;let a=W.stderr.slice(-500);l.log("error","RUNNER_FATAL_DEATH","v16-runner exited unexpectedly mid-session",{stderr_tail:a}),process.stderr.write(`error: v16-runner exited unexpectedly mid-session \u2014 remaining steps skipped.
|
|
49
|
+
`)}return!0},Z=null,Rn=J.cdpEndpoint??z.cdp_endpoint;if(Rn&&!z.ws_endpoint&&!z.headless&&!e.isAgent)try{Z=Zr({headless:z.headless??!1,cdpEndpoint:Rn,chromePid:Se?.process.pid}),Z&&r.register("marker-overlay",()=>Z?.kill())}catch(a){l.log("warn","OVERLAY_SPAWN_FAILED","Marker overlay spawn failed",{error:String(a)})}c.resolvedCreds?.org_id!==void 0&&l.setOrgId(String(c.resolvedCreds.org_id)),!s.local&&c.resolvedCreds?.user_id!==void 0&&l.setCompletionIdentity(Number(c.resolvedCreds.user_id)),l.setUserIdentity(c.resolvedCreds?.username??null,c.resolvedCreds?.email??null);let Oe=ks({objective:"",globalDir:ke(Tt,"variables"),localDir:ke(o,".testmuai","variables"),file:s.variablesFile,inline:s.variables,parameters:_e?.parameters}),Gi=i.rootGlobal.variables??{},le=ol(Oe.raw,Gi);l.setAuteurVariables(le.auteur);let Cn=rn(ke(Tt,"global-memory.md"))??void 0,En=rn(ke(o,".testmuai","context.md"))??void 0;s.local?process.stderr.write(`info: --local \u2014 cloud upload skipped
|
|
50
|
+
`):c.basicAuth?G||(_n?process.stderr.write(`warn: cloud upload skipped \u2014 no project configured.
|
|
51
|
+
`):process.stderr.write(`warn: evidence publish will be skipped \u2014 no project_id in meta.json or config.
|
|
52
|
+
`)):process.stderr.write(`warn: cloud upload skipped \u2014 TMS credentials could not be resolved.
|
|
53
|
+
Run 'kane-cli login' (OAuth) or 'kane-cli config set-username/set-access-key' (basic auth).
|
|
54
|
+
`);let He=!s.local&&!!c.basicAuth&&G!=null;if(l.log("info","PIPELINE_GATE_STATE","Initial gate state (run-start)",{phase:"run-start",shouldUploadArtifacts:He,lockHeld:$,isFirstRun:b.isFirstRun,hasAuth:b.hasAuth}),He&&b.testId==null&&!b.degradedReadonly&&C.kind!=="attach"){let a=ae(m);try{let u=await ki({tmsBaseUrl:a.tmsBaseUrl,environment:m,auth:c.basicAuth,objective:i.steps[0].objective,url:"",projectId:G,folderId:be??"",hasCustomProfile:!!z.chrome_profile,...A.kind==="device"?{mobile:Ii({platform:A.device.platform,target:A.device.target,mobile:K.mobile,appId:A.appId,deviceName:oe.deviceName,deviceModel:oe.modelIdentifier,osVersion:oe.osVersion,udid:A.device.udid})}:{},log:(f,y,w,g)=>l.log(f,y,w,g)});u&&l.setTestId(u)}catch(u){process.stderr.write(`warn: ATM test creation failed: ${u.message}
|
|
55
|
+
`)}}else b.testId&&l.setTestId(b.testId);let It={};if(c.basicAuth&&!s.local&&(le.secretEntries.length>0||le.nonSecretEntries.length>0))try{It=await Ss({variables:le,auth:c.basicAuth,orgId:String(c.resolvedCreds?.org_id??""),env:m,localMode:!!s.local,log:(a,u,f,y)=>l.log(a,u,f,y)})}catch(a){process.stderr.write(`warn: variable/secret push failed: ${a.message}
|
|
56
|
+
`)}let ar=new Map;for(let[a,u]of le.nonSecretEntries)ar.set(a,u.value);let lr=new Map;for(let[a,u]of le.secretEntries)lr.set(a,u.value);async function dr(a){if(!c.basicAuth||s.local)return;let u=[],f=[];for(let[w,g]of Object.entries(a))if(!_o(g))if(g.secret){if(lr.get(w)===g.value)continue;f.push([w,g])}else{if(ar.get(w)===g.value)continue;u.push([w,g])}if(u.length===0&&f.length===0)return;let y=ae(m);if(u.length>0){let w=new ws(y.tmsBaseUrl,c.basicAuth.username,c.basicAuth.access_key);for(let[g,I]of u)try{let j=await w.upsertVariable({name:g,value:I.value});It[g]=j.id,ar.set(g,I.value),l.log("info","VAR_PUSH_STEP","Variable updated mid-run",{name:g})}catch(j){l.log("warn","VAR_PUSH_STEP_FAILED","Mid-run variable push failed",{name:g,error:String(j)})}}if(f.length>0){let w=new vs(y.secretsBaseUrl);for(let[g,I]of f)try{await w.pushSecret({secretKey:g,secretValue:I.value,username:c.basicAuth.username,accessKey:c.basicAuth.access_key,orgId:String(c.resolvedCreds?.org_id??"")}),lr.set(g,I.value),l.log("info","SECRET_PUSH_STEP","Secret updated mid-run",{name:g})}catch(j){l.log("warn","SECRET_PUSH_STEP_FAILED","Mid-run secret push failed",{name:g,error:String(j)})}}}let ot=rt?(a,u,f,y)=>{if(!($||b.isFirstRun))return;if(O&&y){Ws(O.packTestDir,y,rt,(g,I,j,q)=>l.log(g,I,j,q));return}let w=bt+u;Js(l.sessionDir,w,a,rt,(g,I,j,q)=>l.log(g,I,j,q),f)}:void 0,An=i.rootTitle??i.rootSteps[0]?.heading??Me(n),qi=Object.keys(le.raw).length>0?Ot(le.raw,An).objective:An,Ae=Xs({flag:s.url,frontmatter:i.rootGlobal?.url,configDefault:R.load().default_url}),zi=ei({resolvedUrl:Ae,local:!!s.local,allowMissingUrl:!!s.allowMissingUrl,isTTY:!d});l.setFirstRun(qi,Ae??"");let de=new Ht(i),kt=new Date().toISOString(),xn=Date.now(),cr=e.evidenceAttach?null:new Ho({origin:"testmd",runKind:"author",pid:process.pid,title:i.rootTitle??Me(n),started:kt,producerVersion:Pt,surfaces:Ae?[Ae]:void 0,testmdRelPath:Ni(o,n),definition:{path:"test.md",content:$i(n,"utf8")},cwd:o,packRootDir:ke(l.sessionDir,"evidence")}),re=tl(e.evidenceAttach,cr),Q=re.session,O=null;if(e.evidenceAttach)O={executionId:e.evidenceAttach.id,testId:e.evidenceAttach.test,packTestDir:e.evidenceAttach.packTestDir};else if(cr)try{O=await cr.start()}catch(a){l.log("warn","EVIDENCE_START_FAILED","Evidence pack creation failed",{error:String(a)})}let xe=[],_t=[],Pn,je,ur=(a,u,f,y,w)=>{if(!O)return;Q.noteSpawn(w?.length?{...a,steps:a.steps.map(I=>({...I,verifies:w}))}:a),a.resolution&&(Pn=a.resolution),je=Fo(je,a.runnerEnvironment),xe.push(rl(u));let g=Xt(u,y);for(let I=0;I<g;I++)_t.push(f+I)},mr=()=>O?{packTestDir:O.packTestDir,ordinalOffset:Q.nextOrdinalOffset()}:void 0,Tn=async a=>{if(!O||!Q)return;let u=Bo(xe.length?xe:[{resultCode:null}]);await Q.archiveAttempt(u,a,{log:(f,y,w,g)=>l.log(f,y,w,g)}),xe.length=0,_t.length=0},Yi=typeof s.maxSteps=="string"&&s.maxSteps!==""?parseInt(s.maxSteps,10):void 0,pr=[],Rt=We.hasBlocks(i.steps)?new We(i.steps,b.decisions,{evaluate:async a=>{let u=l.nextRunIndex(),f=Xe===0,w={...en({objective:a.join(`
|
|
57
|
+
`),conditions:a,url:f&&A.kind!=="device"?Ae??void 0:void 0,model:D,chrome:J,auth:c,sessionId:l.sessionId,runIndex:u,projectId:s.local?null:G,windowSize:{width:1920,height:1080},maxSteps:1,headless:z.headless??!1,disableAskUser:!0})};delete w.run_id,Ft(w,{environment:m});let g=null;try{for await(let I of W.run(`run-${u}`,"evaluate",w)){if(t.onAgentEvent(I),I.type==="run_end"){g=I;break}if(I.type==="error")break}}catch(I){l.log("error","BLOCK_CONDITION_JUDGE_FAILED","evaluate run failed",{error:I.message})}return f&&g&&Xe++,l.log("info","BLOCK_CONDITION_JUDGED","Control-flow conditions judged",{conditions:a,results:g?.condition_results??null,reasons:g?.condition_reasons??null}),g?.condition_results??a.map(()=>null)},whileConfig:a=>Yt(i.steps[a]),sleep:a=>new Promise(u=>setTimeout(u,a))}):null;async function Dn(a){if(!Rt)return null;let u=await Rt.before(a),f=i.steps[a];switch(u.action){case"run":return null;case"author":return{kind:"author"};case"skip":return{kind:"done",stop:null};case"structural":return st(a),de.recordStep(f,{status:"passed",duration_s:0}),l.log("info","BLOCK_STRUCTURAL_STEP","Control-flow marker step",{step:f.flatIndex,marker:f.controlFlow}),{kind:"done",stop:null};case"jump":return l.log("info","BLOCK_WHILE_REENTER","While condition holds \u2014 re-entering the body",{from:f.flatIndex,to:u.to+1}),{kind:"jump",to:u.to};case"fail":return st(a),de.recordStep(f,{status:"failed",duration_s:0,reason:u.reason}),l.log("error","BLOCK_STEP_FAILED",u.reason,{step:f.flatIndex}),{kind:"done",stop:{failedAt:a,cancelled:!1}}}}async function Ln(a){let u=i.steps[a];st(a),Xe++,pe=!0,ht.add(i.steps[a].flatIndex);let f=l.nextRunIndex();bt=f,await dr(Je(Oe.raw,u.config.variables,u.objective).raw);let y=fr(a,f),w=Date.now(),g=null,I=null,j=null,q=!1,_=0,P=Ut(),F={...y};delete F.run_id,Ft(F,{environment:m});let T=`run-${f}`;try{Z?.setRunActive(!0);try{for await(let E of W.run(T,"author",F)){if(t.onAgentEvent(E),P=_r(P,E),E.type==="bifurcation"){let N=E.count??E.flows?.length??0;(E.is_single_flow??N<=1)||(j=E.flows??null,q=!0,_=0)}else if(E.type==="run_start"&&q)_++;else if(E.type==="step_event"&&E.event==="reasoning")Z?.setStepText(E.detail);else if(E.type==="step_end"&&(E.status==="passed"&&Z?.setStepComplete(),ot)){let N=q?Math.max(0,_-1):0;ot(E.index,N,E.child_id,typeof E.ordinal=="number"&&E.id?{ordinal:E.ordinal,id:E.id}:void 0)}if(E.type==="run_end"){g=E;break}if(E.type==="error"){I=E.message??"runner error";break}}}finally{Z?.setRunActive(!1)}}catch(E){I=E.message}W.diedUnexpectedly&&wt();let L=Math.round((Date.now()-w)/1e3),Y=St(a,f,g,j,I,L);return l.recordStepRun({testmdStepIndex:i.steps[a].flatIndex,runIndex:f,totalRunDirs:Xt(g,j)}),nr+=tt(g),Ve+=tt(g),ur(P,g,f,j,i.steps[a].verifies),{continueOverall:Y}}async function On(a){if(M||e.signal?.aborted)return{failedAt:a,cancelled:!0};if(wt())return{failedAt:a,cancelled:!1};let u=i.steps[a],f=b.decisions[a];if(f.kind!=="replay")return process.stderr.write(`error: runReplayPhase invoked on a non-replay decision at step ${a}
|
|
58
|
+
`),{failedAt:a,cancelled:!1};let y=l.nextRunIndex();bt=y;let w=tr(a)?Ae??void 0:i.steps[a].unitEntryUrl,g={width:K.window_size.width,height:K.window_size.height},I=Je(Oe.raw,u.config.variables,u.objective),j=qr({step:u,decision:f,chrome:J,device:A.kind==="device"?A.device:void 0,auth:c,sessionId:l.sessionId,runIndex:y,sessionDir:l.sessionDir,windowSize:g,environmentId:vt,forceNavigateUrl:A.kind==="device"?void 0:w,sessionContext:l.getContext(),variables:Object.keys(I.variables).length>0?I.variables:void 0,evidence:mr(),investigationAsync:!re.ownsLifecycle});await dr(I.raw),st(a),Xe++;let q=Date.now(),_=null,P=null,F=Ut(),T={...j};delete T.run_id,Ft(T,{environment:m});let L=`run-${y}`;try{Z?.setRunActive(!0);try{for await(let V of W.run(L,"replay",T)){if(t.onAgentEvent(V),F=_r(F,V),V.type==="step_event"&&V.event==="reasoning"?Z?.setStepText(V.detail):V.type==="step_end"&&(V.status==="passed"&&Z?.setStepComplete(),ot&&ot(V.index,0,V.child_id,typeof V.ordinal=="number"&&V.id?{ordinal:V.ordinal,id:V.id}:void 0)),V.type==="run_end"){_=V;break}if(V.type==="error"){P=V.message??"runner error";break}}!re.ownsLifecycle&&_?.status==="failed"&&pr.push({exited:W.exited.then(()=>{}).catch(()=>{}),cancel:()=>{try{W?.cancel()}catch{}}})}finally{Z?.setRunActive(!1)}}catch(V){P=V.message}if(W.diedUnexpectedly&&wt(),M)return{failedAt:a,cancelled:!0};let Y=Math.round((Date.now()-q)/1e3),E=St(a,y,_,null,P,Y);l.recordStepRun({testmdStepIndex:i.steps[a].flatIndex,runIndex:y,totalRunDirs:Xt(_,null)}),ur(F,_,y,null,i.steps[a].verifies),Ve+=tt(_);let N=!!P||_?.status==="failed";return Fs(a,N?"failed":"ok"),N||!E?{failedAt:a,cancelled:!1}:null}async function Wi(a){js(a,i.steps.length),Rt?.reset();for(let u=0;u<a;u++){let f=await Dn(u);if(f?.kind==="done"){if(f.stop)return f.stop;continue}if(f?.kind==="jump"){u=f.to-1;continue}if(f?.kind==="author"){let w=i.steps[u];if(w.replayOnly)return Ue(u,w.replayOnly),Ge(u,w.replayOnly),de.recordStep(w,{status:"failed",duration_s:0,reason:`replay-only step @${w.replayOnly} has no recording`}),{failedAt:u,cancelled:!1};if(!(await Ln(u)).continueOverall)return{failedAt:u,cancelled:!1};continue}let y=await On(u);if(y)return y}return{failedAt:null,cancelled:!1}}let jn=async()=>{if($||b.degradedReadonly)return!0;let a=c.basicAuth;if(!a){let g=await c.resolver.resolve(!0);g?.username&&g?.access_key&&(a={username:g.username,access_key:g.access_key},c.basicAuth=a)}if(!b.testId||!b.fromCommitId||!a)return process.stderr.write(`error: cannot acquire lock \u2014 missing required state
|
|
59
|
+
`),!1;let u=l.sessionId,f=s.onLockConflict??i.rootGlobal.on_lock_conflict??"readonly",y=await mn({tmsBaseUrl:h.tmsBaseUrl,testId:b.testId,fromCommitId:b.fromCommitId,newCommitId:u,basicAuth:a,onLockConflict:f}),w=y.outcome;if(w==="ok"){$=!0,b.newCommitId=u,l.log("info","MID_RUN_LOCK_ACQUIRED","Mid-run lock acquired",{test_id:b.testId}),d&&t.onLockState({phase:"acquired",scope:"mid_run"}),Kt({baseUrl:Qe(h.tmsBaseUrl),testId:b.testId,auth:Ze(a),lifecycle:r});let g=await Mi({resolved:i,decisions:b.decisions,tmsBaseUrl:h.tmsBaseUrl,newCommitId:u,basicAuth:a,mode:f,lifecycle:r,alreadyLocked:b.unitLocks,allUnits:!0});return g.outcome==="ok"?b.unitLocks.push(...g.locks):process.stderr.write(`warn: mid-run unit lock acquisition degraded (${g.outcome}) \u2014 affected units will not self-commit
|
|
60
|
+
`),!0}if(y.outcome==="readonly"){b.degradedReadonly=!0;let g=y.reason==="disabled"?"playground disabled for this test":y.reason==="base_mismatch"?"base commit mismatch":"concurrent session";return l.log("warn","MID_RUN_LOCK_READONLY","Mid-run lock unavailable; healing continues in readonly (no commit)",{test_id:b.testId,reason:y.reason}),d&&t.onLockState({phase:"conflict",scope:"mid_run",reason:"readonly"}),process.stderr.write(`[lock] mid-run ${g} \u2014 healing continues in readonly mode (no commit)
|
|
61
|
+
`),!0}return l.log("error","MID_RUN_LOCK_CONFLICT","Mid-run lock acquisition failed",{reason:w}),d&&t.onLockState({phase:"conflict",scope:"mid_run",reason:w}),process.stderr.write(`error: mid-run lock acquisition failed (${w})
|
|
62
|
+
`),!1},Fn=async()=>{try{Z?.kill(),Z=null,Se?.kill(),J=await Xr({config:{chrome_profile_path:z.chrome_profile??null,window_size:{width:1920,height:1080}},startUrl:ze,headless:z.headless??!1,wsEndpoint:z.ws_endpoint,cdpEndpoint:z.cdp_endpoint,ltGrid:await kn()}),Se=J.instance,ir=Sr(J.cdpEndpoint);let a=J.cdpEndpoint??z.cdp_endpoint;if(a&&!z.ws_endpoint&&!z.headless&&!e.isAgent)try{Z=Zr({headless:z.headless??!1,cdpEndpoint:a,chromePid:Se?.process.pid})}catch(u){l.log("warn","OVERLAY_SPAWN_FAILED","Marker overlay respawn failed",{error:String(u)})}return l.log("info","BROWSER_RECYCLED","Fresh browser brought up for the replay re-attempt",{cdp_endpoint:J.cdpEndpoint}),!0}catch(a){return l.log("error","RECYCLE_FAILED","Could not bring up a fresh browser for the replay re-attempt",{error:a.message}),process.stderr.write(`error: could not recycle the browser for the replay re-attempt: ${a.message}
|
|
63
|
+
`),!1}},Nn=async()=>{if(A.kind!=="device"||A.device.target!=="simulator"||A.device.no_reset===!0||!A.device.udid)return;let a=await ro("xcrun",["simctl","keychain",A.device.udid,"reset"],{timeoutMs:3e4});a.code===0?l.log("info","SIM_KEYCHAIN_RESET","Simulator keychain reset for the replay re-attempt"):l.log("warn","SIM_KEYCHAIN_RESET_FAILED","Could not reset the simulator keychain; keychain-backed login state may survive the recycle",{error:a.stderr.trim()||a.stdout.trim()})};if(d){let a=jt();if(!a)return process.stderr.write("error: v16-runner not found. Build the binary with `cd v16-runner && python build.py` or ensure Python is available.\n"),r.cleanup("marker-overlay","v16-runner not found"),r.cleanup("chrome","v16-runner not found"),await l.finish("complete"),{overallStatus:"failed",exitCode:2,outputDir:X(n),durationS:0,uploadResult:null};let u=Oo({environment:m,mode:v.mode??"testing",assertionMode:bn,finalValidation:wn,username:c.basicAuth?.username,accessKey:c.basicAuth?.access_key,sessionId:l.sessionId});A.kind==="device"&&await Lo(u,A.device),W=new Nt({env:u,runner:a,log:(_,P,F,T)=>l.log(_,P,F,T),sessionId:l.sessionId,...nt?{onEvent:nt}:{}}),r.register("runner",()=>{(so()||e.signal?.aborted)&&(M=!0);try{W?.kill()}catch{}});let f=_=>{let P={...A.kind==="device"?{device:A.device}:{},cdp_endpoint:_.cdpEndpoint,ws_endpoint:_.wsEndpoint,..._.startUrl?{start_url:_.startUrl}:{},width:K.window_size.width,height:K.window_size.height,headless:z.headless??!1,model:D,session_id:l.sessionId,disable_ask_user:!0},F=Rs(he(i.rootPath));return F.length>0&&(P.media_info=F),!s.local&&G&&(P.project_id=G),c.basicAuth?(P.username=c.basicAuth.username,P.access_key=c.basicAuth.access_key,c.resolvedCreds?.org_id&&(P.media_upload=jo(ae(m),String(c.resolvedCreds.org_id)))):c.token&&(P.auth={type:"bearer",token:c.token}),P};await W.start(f(J));let y=async()=>{try{await W?.shutdown()}catch{}if(!await Fn())return!1;try{return W=new Nt({env:u,runner:a,log:(_,P,F,T)=>l.log(_,P,F,T),sessionId:l.sessionId}),await W.start(f(J)),!0}catch(_){return l.log("error","RECYCLE_FAILED","Could not restart the persistent runner after recycle",{error:_.message}),process.stderr.write(`error: could not restart the runner for the replay re-attempt: ${_.message}
|
|
64
|
+
`),!1}},w=async()=>{try{await W?.shutdown()}catch{}await Nn();try{return W=new Nt({env:u,runner:a,log:(_,P,F,T)=>l.log(_,P,F,T),sessionId:l.sessionId}),await W.start(f(J)),A.kind==="device"&&A.device.no_reset===!0&&l.log("warn","DEVICE_RECYCLED_DIRTY","no_reset: true \u2014 the re-attempt keeps the app state the broken replay left behind"),l.log("info","DEVICE_RECYCLED","Fresh device session brought up for the replay re-attempt"),!0}catch(_){return l.log("error","RECYCLE_FAILED","Could not bring up a fresh device session for the replay re-attempt",{error:_.message}),process.stderr.write(`error: could not recycle the device session for the replay re-attempt: ${_.message}
|
|
65
|
+
`),!1}},g=s.author===!0;g&&(Gr(),l.log("info","FORCE_AUTHOR_RUN","--author flag set; walker bypassed; identity kept"));let{authorBoundary:I,cancelledInPhase:j,shrinkCount:q}=await Ms({decisions:b.decisions,forceAuthor:g,hasRetry:gn,onReplayOnlyFail:Ge,maxShrinks:mt.maxShrinks,runReplayPhase:Wi,session:l,accumulator:de,acquireLockIfNeeded:jn,archiveAttempt:Tn,recycleBrowser:A.kind==="web"&&Se&&re.ownsLifecycle?y:A.kind==="device"&&!lt(A.device.target)&&re.ownsLifecycle?w:void 0});if(yt=q>0,et=I,rr=q,q>0&&(l.log("info","ADAPTIVE_HEAL_TRIGGERED","Adaptive heal engaged",{shrink_count:q,final_author_boundary:I}),t.onAdaptiveHeal({shrink_count:q,final_author_boundary:I,complete_reauthor:I===0})),I===0&&q>0&&l.log("info","COMPLETE_REAUTHOR_TRIGGERED","Complete reauthor fallback",{shrink_count:q}),!j&&I>=0)for(let _=I;_<i.steps.length&&!e.signal?.aborted;_++){let P=i.steps[_],F=await Dn(_);if(F?.kind==="done"){if(F.stop)break;continue}if(F?.kind==="jump"){_=F.to-1;continue}if(F?.kind==="author"&&P.replayOnly){Ue(_,P.replayOnly),Ge(_,P.replayOnly),de.recordStep(P,{status:"failed",duration_s:0,reason:`replay-only step @${P.replayOnly} has no recording`});break}if(wt()){de.recordStep(P,{status:"failed",duration_s:0,reason:"v16-runner exited unexpectedly mid-session"});break}if(!de.shouldRunFlatStep(P))continue;let T=b.decisions[_];if(T?.kind==="replay"&&T.replayOnly){let Y=await On(_);if(Y){Y.cancelled||(Ue(_,T.replayOnly),Ge(_,T.replayOnly));break}continue}let{continueOverall:L}=await Ln(_);if(!L||M||e.signal?.aborted)break}}else{if(We.hasBlocks(i.steps))return process.stderr.write(`error: this test has if/else or while blocks (@if \u2026 @end-if, @while \u2026 @end-while), which run in agent mode only \u2014 re-run with --agent
|
|
66
|
+
`),r.cleanup("marker-overlay","control-flow blocks need agent mode"),r.cleanup("chrome","control-flow blocks need agent mode"),await l.finish("complete"),{overallStatus:"failed",exitCode:2,outputDir:X(n),durationS:0,uploadResult:null};let{effectiveDecisions:a}=await import("./effective-decisions-UNE2TFVA.js"),{decideRetry:u}=await import("./replay-policy-A62KXE6Y.js"),f=gn,y=mt.maxShrinks,w=s.author===!0;w&&(Gr(),l.log("info","FORCE_AUTHOR_RUN","--author flag set; walker bypassed; identity kept"));let g=w?0:ut(b.decisions),I=0,j=null,q=A.kind==="device"?A.device.no_reset:void 0,_=0,P=()=>_++===0?q??!1:!0,F=b.decisions.filter(E=>E.kind==="replay").length,T=b.decisions.length-F,L=[];s.push&&L.push("--push"),f||L.push("--no-adaptive-heal"),w&&L.push("--author");let Y={source:n,steps:{total:b.decisions.length,replay:F,author:T},model:D,viewport:{width:K.window_size.width,height:K.window_size.height},chrome:J.cdpEndpoint??(Ce()?J.wsEndpoint?.split("?")[0]:J.wsEndpoint)??"managed",session:l.sessionName??"ephemeral",variables:{count:Object.keys(le.raw).length,secrets:Object.values(le.raw).filter(E=>E.secret).length,names:Object.keys(le.raw)},flags:L,mode:v.mode??"testing"};for(;;){let E=l.snapshot(),N=de.snapshot();_=0;let V=a(b.decisions,g,w);if(I>=1){let U=g===0?`\u{1FA79} Healing \u2014 full re-author, heal budget exhausted (${I}/${y})`:`\u{1FA79} Healing ${I}/${y} \u2014 replay 0..${g-1}, re-author ${g}..${b.decisions.length-1}
|
|
67
|
+
reason: replay miss at step ${(j??0)+1}`;process.stderr.write(U+`
|
|
68
|
+
`)}let at=I>=1&&g>0&&j!==null?{startIdx:0,endIdx:j,count:j}:void 0;Z?.setRunActive(!0);let ge=await ul({decisions:V,resolved:i,session:l,accumulator:de,tuiConfig:K,globalConfig:Y,buildStepConfigAt:(U,ce)=>{let se=fr(U,ce);return A.kind==="device"&&se.device&&(se.device={...se.device,no_reset:P()}),se},buildReplayConfig:U=>{let ce=b.decisions[U];if(ce.kind!=="replay")throw new Error("expected replay decision at index "+U);let se=i.steps[U];return qr({step:se,decision:ce,chrome:J,device:A.kind==="device"?{...A.device,no_reset:P()}:void 0,auth:c,sessionId:l.sessionId,runIndex:l.nextRunIndex(),sessionDir:l.sessionDir,windowSize:{width:K.window_size.width,height:K.window_size.height},environmentId:vt,forceNavigateUrl:A.kind==="device"?void 0:U===0?Ae??void 0:se.unitEntryUrl,sessionContext:l.getContext(),variables:sl(Oe.raw,se.config.variables,se.objective),evidence:mr()})},onAnyAuthorStep:U=>{pe=!0,ht.add(i.steps[U].flatIndex)},onCancel:()=>{me=!0},topBannerModel:D,topBannerAuth:`${S.getActiveProfile()??"no profile"}/${m}`,spawnOpts:{environment:m,mode:v.mode??"testing",assertionMode:bn,finalValidation:wn,log:(U,ce,se,yr)=>l.log(U,ce,se,yr),...nt?{onRunnerEvent:nt}:{}},priorAttemptRollup:at,reportVerdictOnComplete:Ce()||!!ne,pushStepLevelDelta:(U,ce)=>dr(Je(Oe.raw,U,ce).raw),onSequencerStepEnd:(U,ce,se,yr)=>{let ea=Math.round((Date.now()-yr)/1e3),ta=U.hadError?U.reason??"runner error":null,ra=St(ce,se,U.runEnd,U.bifurcationFlows??null,ta,ea);return l.recordStepRun({testmdStepIndex:i.steps[ce].flatIndex,runIndex:se,totalRunDirs:Xt(U.runEnd,U.bifurcationFlows)}),ur(U.evidence??Ut(),U.runEnd,se,U.bifurcationFlows,i.steps[ce].verifies),Ve+=tt(U.runEnd),V[ce]?.kind==="author"&&(nr+=tt(U.runEnd)),ra},screenshotDispatcher:ot,onReasoning:U=>Z?.setStepText(U),onStepComplete:()=>Z?.setStepComplete(),onSpawnStart:U=>{bt=U},host:t});if(Z?.setRunActive(!1),ge.cancelled){r.cleanup("marker-overlay","user cancelled run"),r.cleanup("chrome","user cancelled run");break}if(ge.failedAt===null)break;let xt=b.decisions[ge.failedAt],qe=u({failedAt:ge.failedAt,shrinkCount:I,hasRetry:f,maxShrinks:y,failedAtReplayOnly:xt?.kind==="replay"?xt.replayOnly:void 0});if(qe.kind==="fail"){qe.replayOnly&&(Ue(ge.failedAt,qe.replayOnly),Ge(ge.failedAt,qe.replayOnly));break}if(!$&&!await jn()||A.kind==="web"&&Se&&re.ownsLifecycle&&!await Fn())break;A.kind==="device"&&re.ownsLifecycle&&await Nn(),await Tn(ge.failedAt),l.rollback(E),de.rollback(N),qe.kind==="complete-reauthor"?g=0:(g=qe.newAuthorBoundary,I++),yt=!0,l.log("info","RETRY_TRIGGERED","Retry loop triggered (TTY)",{shrink_count:I,failed_at:j}),g===0&&l.log("info","COMPLETE_REAUTHOR_TRIGGERED","Complete reauthor fallback (TTY)",{shrink_count:I}),j=ge.failedAt}et=g,rr=I}let te=de.finalize({cancelled:me}),Pe=Math.round((Date.now()-xn)/1e3),Ji={session:l,resolvedAuth:c,chromeResult:J,chromeInstance:Se??null,testId:l.testId??null,preparedVariables:le,variableIds:It,globalContext:Cn,localContext:En,tuiConfig:K,env:m,localMode:!!s.local},Un=!1,Bn=!1,Re,$n=!1,gr=!1,Mn=async(a={})=>{if(!O)return!1;if(re.ownsLifecycle?Un:$n)return!0;try{let u=await ir(),f=un(pe)==="replay",y=Ye(n),w=ke(l.sessionDir,"execution.json"),g=ts(O.packTestDir,f?[y,w]:[w,y],(L,Y,E,N)=>l.log(L,Y,E,N));_e&&rs(O.packTestDir,_e.evidenceRecord,(L,Y,E,N)=>l.log(L,Y,E,N));let{ids:I,linear:j}=g?os(O.packTestDir):{ids:[],linear:!0},{steps:q,tail:_,unjoined:P}=ns(Q.steps,I,f,j);g?P?l.log("warn","SKIPPED_TAIL_UNJOINED","Executed records don't align with the authored blob \u2014 skipped tail withheld",{executed:Q.steps.length,leaves:I.length}):_.length>0&&l.log("info","SKIPPED_TAIL_APPENDED","Unexecuted authored actions recorded as skipped",{count:_.length}):l.log("warn","SKIPPED_TAIL_NO_BLOB","No auteur blob in pack \u2014 unexecuted actions cannot be recorded as skipped",{});let F=await Q.writeResult({steps:[...q,..._],heal:{shrinkCount:rr,authorBoundary:et,totalSteps:b.decisions.length,forced:s.author===!0,creditsConsumed:nr},spawns:me?[...xe,{resultCode:null}]:xe.length?xe:[{resultCode:null}],tags:i.rootGlobal.tags,externalIdInput:{..._e?_e.externalId:{},execution_id:O.executionId,session_id:l.sessionId,commit_id:f?b.fromCommitId??l.sessionId:l.sessionId,test_id:b.testId??l.testId??void 0,testcase_id:a.testcaseId||b.testcaseId||l.testcaseId||void 0,tc_id:Le,project_id:G??void 0,folder_id:be??void 0,org_id:l.orgId!=null?String(l.orgId):void 0,session_name:l.sessionName??ct(n),user_name:l.userName??void 0,user_email:l.userEmail??void 0,sharable_link:ni(ae(m).testManagerUiUrl,G,a.testcaseId??b.testcaseId??l.testcaseId,a.shareId)},runnerEnv:await ko(Ko({cdpBrowser:u,resolution:Pn,runnerEnvironment:je,deviceName:oe.deviceName,deviceApp:oe.app,...ne&&oe.osVersion?{deviceOsVersion:oe.osVersion}:{},pixelResolution:O?await Io(O.packTestDir):void 0}),{environment:m,deviceModel:oe.modelIdentifier,runnerEnvironment:je}),intentEnv:No(D,je,re.ownsLifecycle?void 0:un(pe)),durationMs:Date.now()-xn,log:(L,Y,E,N)=>l.log(L,Y,E,N)});if(!re.ownsLifecycle)return await Mo(Q.pack,O.testId,ke(l.sessionDir,"tui.log"),{requireRealLog:!!je?.native_platform,appiumMarks:Q.appiumMarks}),$n=!0,l.log("info","EVIDENCE_RESULT_WRITTEN","Member result.yaml written",{execution_id:O.executionId,verdict:F}),!0;let T=Yo(Rr(process.cwd()));if(!Bn)try{await Ls(Rr(process.cwd()),Y=>l.log("warn","SYNC_BEHIND",Y,{}));let L=qo({projectDir:process.cwd(),store:T,members:[{path:n,verdict:F,executionId:O.executionId,startedAt:new Date().toISOString(),acs:Go(Q.steps),mode:"testmd",local:!!s.local}]});Bn=!0;for(let Y of L.warnings)l.log("warn","EXEC_SYNC",Y,{});L.synced>0&&l.log("info","EXEC_SYNC",`context sync: ${L.synced} fact(s), ${L.superseded} supersession(s)`,{})}catch(L){l.log("warn","EXEC_SYNC",`exec-sync failed: ${L instanceof Error?L.message:String(L)}`,{})}try{if(Re=await zo(Q.pack,es(process.cwd()),{executionId:O.executionId}),Re.status==="skipped"||Re.status==="failed"){let L=Re.status==="skipped"?Re.reason:Re.detail;l.log("warn","EVIDENCE_COVERAGE_SKIPPED",`coverage/usecases.yaml not written: ${L}`,{})}}catch(L){Re={status:"failed",detail:String(L)},l.log("warn","EVIDENCE_COVERAGE_SKIPPED","coverage writer threw",{error:String(L)})}return await Vo({executionId:O.executionId,testId:O.testId,saved:!0,runKind:un(pe),verdict:F,outputStemDir:X(n),cwd:o,packDir:Q.pack,tuiLogPath:ke(l.sessionDir,"tui.log"),expectStatusDisagrees:(s.bugDetection??K.bug_detection)==="continue",log:(L,Y,E,N)=>l.log(L,Y,E,N),surface:"testmd",requireRealLog:!!je?.native_platform,appiumMarks:Q.appiumMarks}),Un=!0,l.log("info","EVIDENCE_SEALED","Evidence pack sealed",{execution_id:O.executionId,verdict:F}),!0}catch(u){return l.log("warn","EVIDENCE_SEAL_FAILED","Evidence pack seal failed",{error:String(u)}),!1}},Vn=s.local?void 0:gl(C,i.unitFiles,n,x),Ct=He&&($||b.isFirstRun)&&!b.degradedReadonly,Qi=async()=>{if(!c.basicAuth)return null;let a=ae(m),u=(pe||s.push===!0)&&!me,f=($||b.isFirstRun)&&!me&&te.overallStatus==="passed"&&!b.degradedReadonly;l.log("info","PIPELINE_GATE_STATE","Derived gate state (finalize)",{phase:"finalize",shouldUploadArtifacts:He,shouldUploadPipeline:Ct,shouldReplaceLocalOutput:u,shouldCommit:f,lockHeld:$,anyAuthorStepRan:pe,cancelled:me,overallStatus:te.overallStatus});let y=bi({mobile:A.kind==="device",environmentId:vt,session:l,env:m,auth:c,variables:le,variableIds:It,testParams:_e?.testParams,projectId:G,folderId:be,totalSteps:te.outcomes.length,totalDuration:Pe,screenshotExtMap:rt?.getExtMap(),codeExport:wi({codeExport:s.codeExport,codeLanguage:s.codeLanguage,skipCodeValidation:s.skipCodeValidation},K.code_export),onProgress:()=>{},log:(g,I,j,q)=>l.log(g,I,j,q),shouldUploadArtifacts:Ct,shouldReplaceLocalOutput:u,shouldCommit:f,isFirstRun:b.isFirstRun,resolvedTest:i,sourcePath:n,stepRunRecords:l.getStepRunRecords(),authoredFlatIdx:[...ht],blockOutcomes:Rt?.outcomes(),unitLocks:b.unitLocks,...Vn?{assuranceStamps:Vn}:{},...C.kind==="attach"?{attachedStop:!0,attachedCaseId:C.caseId,attachedTc:sr??null}:{},outcomes:te.outcomes,overallStatus:te.overallStatus,fromCommitId:b.fromCommitId,startedISO:kt,durationS:Pe,tmsIds:{testId:b.testId??l.testId??void 0,testcaseId:b.testcaseId??l.testcaseId??void 0,projectId:G??void 0,folderId:be??void 0,orgId:l.orgId??void 0,sessionName:l.sessionName??ct(n)},tmsBaseUrl:h.tmsBaseUrl,testId:b.testId??void 0,newCommitId:b.newCommitId??void 0,basicAuth:c.basicAuth??void 0,decisions:b.decisions,wantsPush:s.push===!0,retryTriggered:yt,forceAuthor:s.author===!0,commitBox:gt,testmdSync:s.testmdSync!==!1,onAgentEvent:g=>t.onAgentEvent(g),evidence:O&&re.ownsLifecycle?{executionId:O.executionId,packTestDir:O.packTestDir,sealedPackPath:Q.pack,cwd:o,runIndices:_t,sealFn:Mn}:void 0,evidenceRead:O&&!re.ownsLifecycle?{packTestDir:O.packTestDir,runIndices:_t}:void 0,authoredExecutionPath:pe?void 0:Ye(n)});b.newCommitId!=null&&(y.skipTmsFinalize=!0);let w=new xs(y);return d?await w.execute():await t.runUpload(w,g=>{if(g.testcaseId&&g.shareId&&G)return Gt(a.testManagerUiUrl,G,g.testcaseId,g.shareId)})};O&&await ir(),W&&(await W.shutdown(Ce()||ne?me?bo:yo(te.overallStatus):{}),r.cleanup("runner","test.md run complete"));let ie=await ui(Ji,{performUpload:Qi,runCleanup:()=>{r.cleanup("chrome","test.md run complete")},log:(a,u,f,y)=>l.log(a,u,f,y)},{overallStatus:te.overallStatus,outcomes:te.outcomes,sourcePath:n,title:i.rootTitle,rootSteps:i.rootSteps,startedISO:kt,durationS:Pe,localMode:!!s.local,skipLocalWrites:!0,mobile:A.kind==="device"});re.ownsLifecycle&&Ct&&ie.uploadResult?.success&&(gr=!0);let Kn=await Mn({testcaseId:ie.uploadResult?.testcaseId,shareId:ie.uploadResult?.shareId}),Hn=s.evidencePublish===!1,Gn=b.testId??l.testId??void 0,qn=re.ownsLifecycle&&!!O&&!!c.basicAuth&&Di({shouldUploadArtifacts:He,lockHeld:$,isFirstRun:b.isFirstRun,sealed:Kn,testId:Gn,committed:Li({isFirstRun:b.isFirstRun,lockHeld:$,testcaseId:ie.uploadResult?.testcaseId,committed:gt.committed}),coordinatorPublishes:!!e.coordinatorPublishes});if(qn&&Hn)l.log("info","EVIDENCE_PUBLISH_SKIPPED","Replay evidence publish skipped (--no-evidence-publish)",{execution_id:O.executionId}),process.stderr.write(`info: evidence publish skipped (--no-evidence-publish)
|
|
69
|
+
`);else if(Hn&&($||b.isFirstRun))process.stderr.write(`note: --no-evidence-publish has no effect on author/commit runs
|
|
70
|
+
`);else if(qn){let a=c.basicAuth,u=O,f=G,y=await Oi({controller:new Fe(h.controllerBaseUrl,{username:a.username,accessKey:a.access_key}),tms:new dt(h.tmsBaseUrl,c.resolvedCreds?.username??a.username,c.resolvedCreds?.access_key??a.access_key),testId:Gn,sessionId:l.sessionId,executionId:u.executionId,sealedPackPath:Q.pack,projectId:f});gr||=y.ok,y.ok?l.log("info","EVIDENCE_INGESTED","Replay evidence uploaded and ingested",{execution_id:u.executionId,project_id:f}):(l.log("warn","EVIDENCE_PUBLISH_FAILED","Replay evidence publish failed",{execution_id:u.executionId,stage:y.stage,error:y.error}),process.stderr.write(` \u26A0 evidence publish failed (${y.stage}): ${y.error}
|
|
71
|
+
`)),t.onAgentEvent({type:"test_md_evidence_ingest",status:y.ok?"ok":"failed",evidence_id:u.executionId,...y.ok?{}:{stage:y.stage}})}if(fn=!0,await dl(n,b,l,te.outcomes,te.overallStatus,kt,Pe,ie.uploadResult,K,s,{resolvedAuth:c,tmsBaseUrl:h.tmsBaseUrl},$,me,gt.committed),b.isFirstRun&&s.testmdSync!==!1)try{let a=he(n);if(ms({shouldUploadPipeline:Ct,uploadSucceeded:!!ie.uploadResult?.success,metaCommitId:a?.commit_id,metaTestId:a?.test_id})){let u=await $t({sourcePath:n,testId:a.test_id,sessionId:l.sessionId,commitId:a.commit_id,controller:new Fe(h.controllerBaseUrl,{username:c.basicAuth.username,accessKey:c.basicAuth.access_key})});u.ok?l.log("info","BUNDLE_SYNC_OK","testmd bundle pushed",{commit_id:a.commit_id,bytes:u.bytes}):(l.log("warn","BUNDLE_SYNC_FAILED","testmd bundle sync failed",{commit_id:a.commit_id,stage:u.stage,error:u.error}),process.stderr.write(` \u26A0 bundle sync failed (${u.stage}): ${u.error}
|
|
72
|
+
`)),t.onAgentEvent({type:"test_md_bundle_sync",status:u.ok?"ok":"failed",commit_id:a.commit_id,path:n,...u.ok?{bytes:u.bytes}:{stage:u.stage}})}}catch(a){l.log("warn","BUNDLE_SYNC_FAILED","testmd bundle sync threw",{error:a instanceof Error?a.message:String(a)})}else b.isFirstRun&&l.log("info","BUNDLE_SYNC_SKIPPED","testmd bundle sync skipped",{reason:"flag"});let zn=ae(m),Et=ie.uploadResult?.testcaseId,At=Et&&ie.uploadResult?.shareId&&G?Gt(zn.testManagerUiUrl,G,Et,ie.uploadResult.shareId):void 0,Zi=i.unitFiles.filter(a=>a.file!==i.rootPath).map(a=>{let u=i.steps.filter(g=>g.owningFile===a.file),f=u.filter(g=>ht.has(g.flatIndex)).length,w=(a.kind==="test"?he(a.file):null)?.commit_id===l.sessionId;return{path:a.file,kind:a.kind,replayed:u.length-f,authored:f,committed:w,...w?{commit_id:l.sessionId}:{}}}),Yn={overallStatus:te.overallStatus,durationS:Pe,creditsConsumed:Ve,decisions:b.decisions,outcomes:te.outcomes,cancelled:me,retryTriggered:yt,lockHeld:$,anyAuthorStepRan:pe,isFirstRun:b.isFirstRun,wantsPush:s.push===!0,uploadResult:ie.uploadResult,shouldUploadArtifacts:He,shouldReplaceLocalOutput:pe&&!me,shouldCommit:($||b.isFirstRun)&&!me&&te.overallStatus==="passed"&&!b.degradedReadonly,committed:gt.committed,...(C.kind==="attach"||C.kind==="run")&&(C.tc??Le)?{caseTc:C.tc??Le}:{},degradedReadonly:b.degradedReadonly,shareUrl:At,imports:Zi},{buildSummaryEvent:Xi}=await import("./SummaryBox-FALOODAQ.js");d?t.onAgentEvent(Xi(Yn)):await t.onSummary(Yn);let Wn=ie.uploadResult?.notSaved===!0;if(!d){let a=Et&&G?oi(zn.testManagerUiUrl,G,Et):void 0;await t.onLinks({recordedTestPath:n,outputDir:X(n),shareableLink:At,testCaseLink:a,codeExportDir:ie.uploadResult?.codeExportDir})}let hr=!d&&!me&&!!process.stdin.isTTY&&!!process.stderr.isTTY,Jn=()=>{if(!Wn)return;let a=Ni(process.cwd(),n);Vi(Er.testRunNotSaved(C.kind==="attach"?C.tc:null,te.overallStatus==="passed",a.startsWith("..")?n:a),{isAgent:d,host:t})};hr&&Jn();let it=!e.suppressEvidenceOffer&&Q?Re:void 0;if(re.ownsLifecycle&&Q&&Kn&&!e.suppressEvidenceOffer){for(let u of Ti(it))process.stderr.write(u+`
|
|
73
|
+
`);let{offerEvidenceView:a}=await import("./evidence-LVVK7ROT.js");await a({packPath:Q.pack,env:m,isTTY:hr,log:u=>process.stderr.write(u+`
|
|
74
|
+
`)})}return hr||Jn(),it&&t.onAgentEvent(Ei(it,Q.pack)),t.onAgentEvent({type:"test_md_done",overall_status:te.overallStatus,duration_s:Pe,session_id:l.sessionId,...At?{share_url:At}:{},...it?{coverage:Ai(it)}:{}}),await l.reportCompletedSession({runsCompleted:l.getStepRunRecords().length,creditsConsumed:Ve,durationSeconds:Pe}),{overallStatus:te.overallStatus,exitCode:te.overallStatus==="passed"&&!Wn?0:1,outputDir:X(n),durationS:Pe,creditsConsumed:Ve,uploadResult:ie.uploadResult,anyAuthorStepRan:pe,resultCode:$o(xe),...pr.length?{pendingInvestigations:pr}:{},ownPack:re.ownsLifecycle?Ri({executionId:O?.executionId,testId:b.testId??O?.testId,testcaseId:ie?.uploadResult?.testcaseId,commitId:l.sessionId,published:gr,coverage:Re}):void 0}}finally{!fn&&($||b.unitLocks.length>0)&&await cl(b,l,$,{resolvedAuth:c,tmsBaseUrl:h.tmsBaseUrl})}}function nl(e){if((e.env??process.env).KANE_CLI_MODE==="hyperexecute")return null;let t=cs({globalDir:e.globalDir,localDir:ke(e.cwd,".testmuai","variables"),file:e.opts.variablesFile,inline:e.opts.variables}),r=Ts(e.resolved,t,{authorFrom:e.authorFrom,produced:e.produced});return r.length===0?null:{text:Kr(r,{cwd:e.cwd,entryFile:Me(e.resolved.rootPath)}),event:Hr(r,{cwd:e.cwd})}}function ol(e,t){let r={...e,...t,...wr(e)},n=Object.keys(r).length>0?Ot(r,""):{variables:{},objective:"",keyMap:{}};return{raw:r,auteur:n.variables,auteurObjective:"",..._s(r)}}function Je(e,t,r){let n={...e,...t??{},...wr(e)};if(Object.keys(n).length===0)return{raw:n,variables:{},objective:r};let o=Ot(n,r);return{raw:n,variables:Is(o.variables,o.objective),objective:o.objective}}function sl(e,t,r){let n=Je(e,t,r).variables;return Object.keys(n).length>0?n:void 0}function il(e,t){return e.max_steps??t??50}function Ui(e,t){let r=new Set(er),n={...e};for(let[o,s]of Object.entries(t))r.has(o)||o!=="variables"&&s!==void 0&&e[o]===void 0&&(n[o]=s);return n}function al(e,t){return e.length<=t?e:e.slice(0,t-1)+"\u2026"}async function ll(e,t,r,n,o,s,d={}){let p=ps(t);Os(t,p);let i=we(e),c=!d.setAsideMeta&&el(i)?JSON.parse($i(i,"utf8")):null,v=c?.testcase_id,m=c?.test_id,h=c?.commit_id,k=r.push===!0,D=r.author===!0;k&&!v&&process.stderr.write(`[--push] no meta.json yet \u2014 flag is a no-op on first run
|
|
75
|
+
`);let S=n.resolvedAuth.basicAuth;if(!S){let $=await n.resolvedAuth.resolver.resolve(!0);$?.username&&$?.access_key&&(S={username:$.username,access_key:$.access_key},n.resolvedAuth.basicAuth=S)}let R=!!S,l=!r.local&&R&&m!=null&&h!=null&&v!=null,M=l&&(Mt(p)||k||D),B=fs(t,p);if(B.length>0)return process.stderr.write(`error: replay-only step(s) cannot be replayed \u2014 the agent cannot author them, so the run will not start:
|
|
76
|
+
`+B.map(b=>` step ${b.flatIndex} "${b.heading}" @${b.kind} \u2014 ${b.reason} (${b.file})`).join(`
|
|
77
|
+
`)+`
|
|
78
|
+
Regenerate the test from KaneAI, or drop the marker to let the agent author the step.
|
|
79
|
+
`),{resolved:t,decisions:p,testId:m,testcaseId:v,fromCommitId:h,newCommitId:null,isFirstRun:!1,hasAuth:R,canLock:l,lockAcquired:!1,unitLocks:[],degradedReadonly:!1,abort:{exitCode:2}};if(k&&!l)return process.stderr.write(`error: --push requires authenticated credentials for the lock API. Run 'kane-cli login' (OAuth) or pass --username/--access-key inline.
|
|
80
|
+
`),{resolved:t,decisions:p,testId:m,testcaseId:v,fromCommitId:h,newCommitId:null,isFirstRun:!1,hasAuth:R,canLock:l,lockAcquired:!1,unitLocks:[],degradedReadonly:!1,abort:{exitCode:2}};if(D&&!R)return process.stderr.write(`error: --author requires authenticated credentials for the TMS API. Run 'kane-cli login' (OAuth) or pass --username/--access-key inline.
|
|
81
|
+
`),{resolved:t,decisions:p,testId:m,testcaseId:v,fromCommitId:h,newCommitId:null,isFirstRun:!1,hasAuth:R,canLock:l,lockAcquired:!1,unitLocks:[],degradedReadonly:!1,abort:{exitCode:2}};let x=null,H=!1,fe=!1;if(M){x=o;let b=r.onLockConflict??t.rootGlobal.on_lock_conflict??"readonly",$=await mn({tmsBaseUrl:n.tmsBaseUrl,testId:m,fromCommitId:h,newCommitId:x,basicAuth:S,onLockConflict:b});if($.outcome==="ok")H=!0,Kt({baseUrl:Qe(n.tmsBaseUrl),testId:m,auth:Ze(S),lifecycle:s});else{if($.outcome==="abort")return{resolved:t,decisions:p,testId:m,testcaseId:v,fromCommitId:h,newCommitId:null,isFirstRun:!1,hasAuth:R,canLock:l,lockAcquired:!1,unitLocks:[],degradedReadonly:!1,abort:{exitCode:2}};x=null,fe=!0,D&&process.stderr.write($.reason==="disabled"?`[lock] --author: re-authoring locally in readonly mode (not committed); this test cannot be evolved, so the changes stay local
|
|
82
|
+
`:`[lock] --author: re-authoring locally in readonly mode (not committed); run again with --push once the playground is free
|
|
83
|
+
`)}}let C=[],De=M&&!H;if(!r.local&&R&&!De){let b=r.onLockConflict??t.rootGlobal.on_lock_conflict??"readonly",$=await Mi({resolved:t,decisions:p,allUnits:D,tmsBaseUrl:n.tmsBaseUrl,newCommitId:x??o,basicAuth:S,mode:b,lifecycle:s});if($.outcome==="ok")C=$.locks;else{if(H&&m&&h&&x&&await pt(n,m,h,x),Ie(),$.outcome==="abort")return{resolved:t,decisions:p,testId:m,testcaseId:v,fromCommitId:h,newCommitId:null,isFirstRun:v==null,hasAuth:R,canLock:l,lockAcquired:!1,unitLocks:[],degradedReadonly:!1,abort:{exitCode:2}};process.stderr.write(`[lock] imported-unit conflict \u2014 whole run degrades to readonly (no commits, no uploads)
|
|
84
|
+
`),x=null,H=!1,fe=!0}}return{resolved:t,decisions:p,testId:m,testcaseId:v,fromCommitId:h,newCommitId:x,isFirstRun:v==null,hasAuth:R,canLock:l,lockAcquired:H,unitLocks:C,degradedReadonly:fe}}async function Mi(e){let t=new Set(e.resolved.steps.filter((n,o)=>e.decisions[o]?.kind==="author").map(n=>n.owningFile)),r=[];for(let n of e.resolved.unitFiles){if(n.kind!=="test"||n.file===e.resolved.rootPath||!e.allUnits&&!t.has(n.file)||e.alreadyLocked?.some(d=>d.file===n.file))continue;let o=he(n.file);if(!o?.test_id||!o?.commit_id)continue;let s=await mn({tmsBaseUrl:e.tmsBaseUrl,testId:String(o.test_id),fromCommitId:String(o.commit_id),newCommitId:e.newCommitId,basicAuth:e.basicAuth,onLockConflict:e.mode});if(s.outcome==="ok"){r.push({file:n.file,testId:String(o.test_id),fromCommitId:String(o.commit_id)}),Kt({baseUrl:Qe(e.tmsBaseUrl),testId:String(o.test_id),auth:Ze(e.basicAuth),lifecycle:e.lifecycle});continue}if(s.outcome==="readonly"&&s.reason==="disabled"){process.stderr.write(`[lock] ${n.file}: playground disabled \u2014 this unit will not be committed
|
|
85
|
+
`);continue}for(let d of r)await Be({baseUrl:Qe(e.tmsBaseUrl),testId:d.testId,body:{commitId:e.newCommitId,fromCommitId:d.fromCommitId},auth:Ze(e.basicAuth)}),Ie(d.testId);return{outcome:s.outcome,locks:[]}}return{outcome:"ok",locks:r}}function Qe(e){return`${e}/kane-cli/v1`}function Ze(e){return{username:e.username,accessKey:e.access_key}}async function mn(e){let t=Qe(e.tmsBaseUrl),r=Ze(e.basicAuth),n={baseUrl:t,testId:e.testId,fromCommitId:e.fromCommitId,newCommitId:e.newCommitId,auth:r},o=await Yr(n);if(o.ok)return{outcome:"ok"};if(o.reason==="disabled")return process.stderr.write(`[lock] ${o.message}
|
|
86
|
+
[lock] running in readonly mode (no commit)
|
|
87
|
+
`),{outcome:"readonly",reason:"disabled"};if(!(o.reason==="concurrent"||o.reason==="base_mismatch"))return process.stderr.write(`[lock] acquire failed: ${o.reason} (HTTP ${o.httpStatus}): ${o.message}
|
|
88
|
+
`),{outcome:"abort"};let d=o.reason,p=o.reason==="concurrent"?"concurrent session":"base commit mismatch (pull latest)";if(e.onLockConflict==="fail")return process.stderr.write(`[lock] ${p}; aborting (--on-lock-conflict fail)
|
|
89
|
+
`),{outcome:"abort"};if(e.onLockConflict==="wait"){if(o.reason==="base_mismatch")return process.stderr.write(`[lock] base commit mismatch \u2014 pull latest; aborting
|
|
90
|
+
`),{outcome:"abort"};for(;;){process.stderr.write(`[lock] waiting (concurrent session)...
|
|
91
|
+
`),await new Promise(c=>setTimeout(c,3e4));let i=await Yr(n);if(i.ok)return{outcome:"ok"};if(i.reason!=="concurrent")return process.stderr.write(`[lock] wait drifted to ${i.reason} (HTTP ${i.httpStatus}): ${i.message}; aborting
|
|
92
|
+
`),{outcome:"abort"}}}return process.stderr.write(`[lock] ${p} \u2014 running in readonly mode (no commit)
|
|
93
|
+
`),{outcome:"readonly",reason:d}}async function dl(e,t,r,n,o,s,d,p,i,c,v,m,h,k){let{decisions:D,testId:S,testcaseId:R,fromCommitId:l,newCommitId:M}=t,B=o==="passed";if(!k){let x=h?"cancelled":B?"commit did not land":o;m&&S&&l&&M&&(process.stderr.write(`[lock] run not committed (${x}); discarding playground lock
|
|
94
|
+
`),await pt(v,S,l,M));for(let H of t.unitLocks)await pt(v,H.testId,H.fromCommitId,M??r.sessionId);Ie();return}Ie()}async function cl(e,t,r,n){let o=e.newCommitId??t.sessionId,s=e.unitLocks.length;process.stderr.write(`[lock] run exited before finalize; discarding playground lock${s?` + ${s} unit lock${s===1?"":"s"}`:""}
|
|
95
|
+
`);try{t.log("warn","LOCKS_RELEASED_EARLY_EXIT","Run exited before finalize; discarding held playground locks",{test_id:e.testId??null,unit_locks:s})}catch{}try{r&&e.testId&&e.fromCommitId&&await pt(n,e.testId,e.fromCommitId,o);for(let d of e.unitLocks)await pt(n,d.testId,d.fromCommitId,o)}finally{Ie()}}async function pt(e,t,r,n){let o=e.resolvedAuth.basicAuth;if(!o){let d=await e.resolvedAuth.resolver.resolve(!0);d?.username&&d?.access_key&&(o={username:d.username,access_key:d.access_key},e.resolvedAuth.basicAuth=o)}if(!o)return;let s=await Be({baseUrl:Qe(e.tmsBaseUrl),testId:t,body:{commitId:n,fromCommitId:r},auth:Ze(o)});s.ok||process.stderr.write(`warn: discardLock failed: ${s.reason} (HTTP ${s.httpStatus}): ${s.message}
|
|
96
|
+
`)}async function ul(e){let t=null,r=!1,n=0,o=-1,s=-1,d=0,p=async i=>{if(i&&i.status==="failed")return n>0&&e.decisions[n-1].kind==="replay"&&(t=n-1),null;for(;n<e.decisions.length&&!e.accumulator.shouldRunFlatStep(e.resolved.steps[n]);)n++;if(n>=e.decisions.length)return null;let c=e.decisions[n],v=e.resolved.steps[n],m=n;n++;let h=e.session.nextRunIndex();o=m,s=h,d=Date.now(),e.onSpawnStart?.(h),c.kind==="author"&&e.onAnyAuthorStep(m),await e.pushStepLevelDelta(v.config.variables,v.objective);let k=c.kind==="replay"?e.buildReplayConfig(m):e.buildStepConfigAt(m,h),D=c.kind==="replay"?"md5-match":c.reason,S=v.config??{},R={};for(let[l,M]of Object.entries(S))M!=null&&l!=="variables"&&l!=="assurance"&&(R[l]=M);return{config:k,banner:{stepLabel:`Step ${m+1}/${e.decisions.length}`,objective:al(v.objective,100)},mode:c.kind,modeReason:D,perStepOverrides:Object.keys(R).length>0?R:void 0}};return await e.host.runSteps({topBanner:{model:e.topBannerModel,auth:e.topBannerAuth},globalConfig:e.globalConfig,getNextStep:p,onStepEnd:i=>(i.status==="failed"&&o>=0&&e.decisions[o]?.kind==="replay"&&(t=o),e.onSequencerStepEnd(i,o,s,d)),onAllComplete:()=>{},onCancel:()=>{r=!0,e.onCancel()},spawnOpts:e.spawnOpts,priorAttemptRollup:e.priorAttemptRollup,...e.reportVerdictOnComplete?{reportVerdictOnComplete:!0,runVerdict:()=>e.accumulator.finalize().overallStatus}:{},screenshotDispatcher:e.screenshotDispatcher,onReasoning:e.onReasoning,onStepComplete:e.onStepComplete}),{failedAt:t,cancelled:r}}function ml(e){if(typeof e!="string")return null;let t=e.indexOf(":"),r=t<0?e:e.slice(0,t),n=t<0?"":e.slice(t+1);return r?{caseId:r,tc:n||null}:null}var fl=new Set(["emulator","simulator","android","ios"]);function pl(e,t){return co(e?.default_app)&&e?.default_target?.kind===t}function Bi(e,t){return Vi(e.refusal,t),{overallStatus:"failed",exitCode:e.exit,outputDir:X(t.abs),durationS:0,uploadResult:null}}function Vi(e,t){t.isAgent?t.host.onAgentEvent(Ci(e,t.host)):(As(e),process.stderr.write(`
|
|
97
|
+
`))}function gl(e,t,r,n){let o=e.kind==="attach"||e.kind==="run"?e.stamp:null,s=Jo(t.filter(p=>p.kind==="test"&&p.file!==r).map(p=>p.file),{grid:n}),d=Object.keys(s).length>0;if(!(!o&&!d))return{...o?{root:o}:{},...d?{units:s}:{}}}export{Qs as a,Zs as b,Zr as c,Ul as d,Ws as e,Js as f,Hl as g,Qr as h,Xs as i,ei as j,Gt as k,ni as l,oi as m,Ce as n,ai as o,Xr as p,li as q,fd as r,pd as s,gd as t,en as u,ci as v,rn as w,bi as x,lc as y,wi as z,Ii as A,ki as B,Si as C,dn as D,xc as E,Qa as F,Ei as G,Ai as H,Ti as I,Oi as J,un as K,ym as L,ol as M,Je as N,sl as O,il as P,Ui as Q};
|