@testmuai/kane-cli 0.9.0 → 0.10.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ChatSurface-6NZGMNHL.js +2 -0
- package/dist/ChromeProfilePicker-M4WXOB5O.js +2 -0
- package/dist/CliFeedbackPrompt-6MJA7DF6.js +2 -0
- package/dist/CliUploadProgress-6NLS7XHH.js +2 -0
- package/dist/ConfigView-O4WKZ5PU.js +2 -0
- package/dist/EvidenceViewOffer-WIEWCZUP.js +2 -0
- package/dist/FolderPicker-AF7ZMV3M.js +2 -0
- package/dist/InfoBox-D7GGZJU4.js +2 -0
- package/dist/LinksBox-DXP66H3H.js +2 -0
- package/dist/ProfilesView-TWOY5PVC.js +2 -0
- package/dist/ProjectPicker-OBYHJJLU.js +2 -0
- package/dist/SaveSessionPrompt-7XSHS4NL.js +2 -0
- package/dist/ScrollbackTap-4SPXGFMU.js +2 -0
- package/dist/SingleShotApp-XQUDR36R.js +2 -0
- package/dist/SummaryBox-IA2KS6GT.js +2 -0
- package/dist/TestMdRunView-LS2QUFWR.js +2 -0
- package/dist/TestrunEvidenceTable-HNDVJDIF.js +2 -0
- package/dist/WhoamiView-SNL75TEF.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-UI4ABEIX.js +2 -0
- package/dist/assurance-job-FFSSS4XV.js +7 -0
- package/dist/auth-7Z54TMQQ.js +2 -0
- package/dist/{binary-LVHXED3O.js → binary-THPLXCOD.js} +1 -1
- package/dist/bind-4XWK3DG2.js +2 -0
- package/dist/bootstrap-6ACT4ALI.js +2 -0
- package/dist/bridge-T6QMYKED.js +2 -0
- package/dist/build-5ZN47FAT.js +2 -0
- package/dist/catalog-MYPS2BXY.js +2 -0
- package/dist/{changelog-N5AZHXOS.js → changelog-SU674BVE.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-2DYHAP4E.js +2 -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-OHOJSADN.js → chunk-36N3EHW5.js} +1 -1
- package/dist/chunk-3BSYOCSW.js +3 -0
- package/dist/chunk-3E4ZO73O.js +6 -0
- package/dist/chunk-3F5FMH76.js +2 -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-3OQW2GTA.js +2 -0
- package/dist/chunk-3QICDXY5.js +5 -0
- package/dist/chunk-3RJHXOZH.js +3 -0
- package/dist/{chunk-Q5RDCSYM.js → chunk-3YTCKCBG.js} +1 -1
- package/dist/chunk-42PALMW2.js +4 -0
- package/dist/chunk-44B6THYK.js +2 -0
- package/dist/chunk-457Y5TEC.js +19 -0
- package/dist/chunk-47WQBG5I.js +6 -0
- package/dist/chunk-4I7YN6YY.js +3 -0
- package/dist/chunk-4IEQNX7F.js +2 -0
- package/dist/chunk-4LTHDJ3D.js +2 -0
- package/dist/chunk-4QFTHUJA.js +34 -0
- package/dist/chunk-4QTH7VYE.js +2 -0
- package/dist/chunk-4YW767UV.js +47 -0
- package/dist/chunk-54XA5MZH.js +2 -0
- package/dist/chunk-5AKJPYUW.js +11 -0
- 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-J3BGYSMD.js → chunk-6DZX5HLZ.js} +8 -8
- package/dist/{chunk-YBAVDT3G.js → chunk-6EB5VRAN.js} +1 -1
- package/dist/chunk-6NFOH4AC.js +4 -0
- package/dist/chunk-6PIIUAZF.js +3 -0
- package/dist/chunk-6UVIY56J.js +2 -0
- package/dist/chunk-72KYMWQ5.js +2 -0
- package/dist/chunk-72RC7JSA.js +21 -0
- package/dist/chunk-734ORT6O.js +4 -0
- package/dist/chunk-77ZZQJLX.js +2 -0
- package/dist/chunk-7AET4JKQ.js +2 -0
- package/dist/chunk-7DFBOVUB.js +2 -0
- package/dist/chunk-7HMSMAUG.js +29 -0
- package/dist/chunk-7HO4NX5W.js +1 -0
- package/dist/chunk-7KX2BHKG.js +2 -0
- package/dist/{chunk-ULGZPRKU.js → chunk-7NCJMWFX.js} +1 -1
- package/dist/chunk-7NPTL66J.js +2 -0
- package/dist/chunk-7RWP4Y3H.js +2 -0
- package/dist/{chunk-PCKIANML.js → chunk-7SY34IIL.js} +1 -1
- package/dist/chunk-7V4BQSSV.js +2 -0
- package/dist/chunk-7XBNMOH4.js +6 -0
- package/dist/{chunk-SOCHN2PY.js → chunk-7YT4TTKL.js} +1 -1
- package/dist/{chunk-C25M2J5Q.js → chunk-ACMBMZDQ.js} +1 -1
- package/dist/chunk-AEWNWAXW.js +18 -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-AVSMXDTX.js +2 -0
- package/dist/chunk-AZLNLHUA.js +4 -0
- package/dist/{chunk-HGFWIBVF.js → chunk-B7ZX5HEN.js} +5 -5
- package/dist/{chunk-66MOZKD2.js → chunk-BSRSXYDZ.js} +1 -1
- package/dist/chunk-BWXLZS5O.js +2 -0
- package/dist/chunk-BY65QAAN.js +4 -0
- package/dist/chunk-C2RUDJ46.js +2 -0
- package/dist/chunk-C5Z7MQE6.js +2 -0
- package/dist/{chunk-WDMUPK6I.js → chunk-C62QWG4B.js} +1 -1
- package/dist/chunk-C6HI6Y3S.js +2 -0
- package/dist/chunk-CB4ARIHR.js +2 -0
- package/dist/{chunk-7WXMV3O3.js → chunk-CCP4X75B.js} +1 -1
- package/dist/chunk-CGITGJ3I.js +4 -0
- package/dist/chunk-CM4CHYSN.js +2 -0
- package/dist/{chunk-ZXY4P76I.js → chunk-CUXY6KQ2.js} +1 -1
- package/dist/chunk-D36V5OX6.js +2 -0
- package/dist/chunk-D756UWY2.js +6 -0
- package/dist/chunk-D7TKE7LK.js +2 -0
- package/dist/{chunk-UWXDURAB.js → chunk-D7U2M26S.js} +1 -1
- package/dist/chunk-DBMW3VUN.js +4 -0
- package/dist/chunk-DDZLCAEO.js +5 -0
- package/dist/chunk-DJC7NTLA.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-DZOYYWOW.js +2 -0
- package/dist/chunk-E6KSRQXL.js +8 -0
- package/dist/chunk-EBPRPNSA.js +2 -0
- package/dist/chunk-ECPFI75W.js +5 -0
- package/dist/chunk-EECDDDSB.js +3 -0
- package/dist/chunk-EF47KRUK.js +2 -0
- package/dist/chunk-ETZMFRD6.js +2 -0
- package/dist/chunk-EZN7CF45.js +4 -0
- package/dist/{chunk-CNUCP6DK.js → chunk-F22K3RRX.js} +1 -1
- package/dist/{chunk-WRSIKZ2V.js → chunk-F5NHG7VB.js} +1 -1
- package/dist/{chunk-DHJSM5DT.js → chunk-FCD3NYOM.js} +1 -1
- package/dist/chunk-FIP5L6LV.js +9 -0
- package/dist/chunk-FOJHSG5M.js +6 -0
- package/dist/chunk-FSYOTRMC.js +2 -0
- package/dist/chunk-FWDUVFS6.js +26 -0
- package/dist/chunk-FWUPJORV.js +6 -0
- package/dist/chunk-GFLB2SHW.js +2 -0
- package/dist/chunk-GMTHZUZ3.js +2 -0
- package/dist/chunk-GQRU3B54.js +1397 -0
- package/dist/chunk-GRURFGBP.js +2 -0
- package/dist/chunk-GXKY5A46.js +9 -0
- package/dist/chunk-HAW5WEKT.js +13 -0
- package/dist/chunk-HCJ2N3XB.js +12 -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-YWYORBY3.js → chunk-HJMCXSUJ.js} +1 -1
- package/dist/chunk-HK62JVQM.js +3 -0
- package/dist/{chunk-5GUD3CIH.js → chunk-HQ2E2XCU.js} +1 -1
- package/dist/chunk-I2MC6VVX.js +2 -0
- package/dist/chunk-I4RVVBG3.js +10 -0
- package/dist/chunk-I4WXALQR.js +2 -0
- package/dist/chunk-ICLUC44J.js +2 -0
- package/dist/{chunk-6HU5M2DS.js → chunk-IGEAET7M.js} +1 -1
- package/dist/{chunk-GCISXCDU.js → chunk-IINZZ4BZ.js} +1 -1
- package/dist/chunk-IJ2AHSWW.js +2 -0
- package/dist/{chunk-CSNJPD2J.js → chunk-IUQOG7Z5.js} +3 -3
- package/dist/chunk-IZ65ZPWY.js +3 -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-JZP3Y4ZM.js +2 -0
- package/dist/chunk-KF4DKXSS.js +2 -0
- package/dist/chunk-KGNE5CIM.js +2 -0
- package/dist/chunk-KM3YCIDV.js +3 -0
- package/dist/{chunk-HAYV4D2I.js → chunk-KODJVOCN.js} +1 -1
- package/dist/chunk-KU3YHPWZ.js +2 -0
- package/dist/{chunk-M3UAZTDK.js → chunk-KXHJMAZU.js} +2 -2
- package/dist/chunk-L5DALV5N.js +2 -0
- package/dist/chunk-LAOTVZHV.js +6 -0
- package/dist/chunk-LCSJ7GOG.js +2 -0
- package/dist/{chunk-DWMESHFI.js → chunk-LIGTP3A3.js} +1 -1
- package/dist/chunk-LKQFG4RW.js +5 -0
- package/dist/{chunk-EBLXHOE3.js → chunk-LQQNPMOD.js} +1 -1
- package/dist/chunk-LSDJOVWW.js +6 -0
- package/dist/{chunk-C6S2RPZA.js → chunk-LUR7JFPP.js} +1 -1
- package/dist/chunk-LUZBGTYB.js +2 -0
- package/dist/chunk-LX2I4JEH.js +2 -0
- package/dist/{chunk-7GAHJZLH.js → chunk-M43WH5DQ.js} +1 -1
- package/dist/chunk-MEKPGQAM.js +21 -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-NC7D7GOM.js +21 -0
- package/dist/chunk-NIVFEACM.js +2 -0
- package/dist/chunk-NLZZLANH.js +4 -0
- package/dist/{chunk-XT7XA4DN.js → chunk-NXAJBSIF.js} +1 -1
- package/dist/chunk-NXRF7FFS.js +2 -0
- package/dist/chunk-NZ6AV2TA.js +4 -0
- package/dist/chunk-O3HHTKZ5.js +6 -0
- package/dist/chunk-OCDBTAYS.js +12 -0
- package/dist/chunk-OFSDB7B4.js +3 -0
- package/dist/{chunk-Q5CINJYL.js → chunk-OGFU4YY4.js} +1 -1
- package/dist/chunk-OJ33Q6DU.js +2 -0
- package/dist/chunk-P2ZQDQDB.js +2 -0
- package/dist/{chunk-KXEE6VCA.js → chunk-P3JXJ4BW.js} +1 -1
- package/dist/chunk-PAWQ4AKN.js +2 -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-QBYENBMB.js +2 -0
- package/dist/chunk-QDFY5GGO.js +5 -0
- package/dist/chunk-QDXKEOKI.js +16 -0
- package/dist/{chunk-6VY62QC2.js → chunk-QENCC2ZS.js} +1 -1
- package/dist/chunk-QI5RZ7LL.js +2 -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-RF37IJNN.js +2 -0
- package/dist/{chunk-KWEOLPBJ.js → chunk-RFEON5GN.js} +1 -1
- package/dist/chunk-RHGW7B5Q.js +2 -0
- package/dist/chunk-RPRXRKKR.js +2 -0
- package/dist/{chunk-EOA6YPES.js → chunk-RTVHJ23A.js} +4 -4
- package/dist/chunk-RTVWQK7I.js +2 -0
- package/dist/chunk-RX6776AI.js +5 -0
- package/dist/{chunk-F7NSSQYZ.js → chunk-SGPAM5DZ.js} +1 -1
- package/dist/chunk-SMTBOSEJ.js +2 -0
- package/dist/chunk-SMXABALN.js +2 -0
- package/dist/{chunk-TM7VRLWS.js → chunk-SXRHKXSE.js} +1 -1
- package/dist/chunk-TNORODUF.js +2 -0
- package/dist/chunk-TU42YZOJ.js +6 -0
- package/dist/chunk-TU7TVFBK.js +2 -0
- package/dist/chunk-TW5AA5A7.js +8 -0
- package/dist/chunk-UEE3RZN4.js +14 -0
- package/dist/chunk-URH4FX3H.js +2 -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-4BZOG6PE.js → chunk-V7USCQWO.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-VRIZDOO5.js +2 -0
- package/dist/{chunk-DOOI2JBD.js → chunk-VSVWNRI2.js} +1 -1
- package/dist/chunk-VUFIL5VR.js +6 -0
- package/dist/chunk-VX657KIK.js +2 -0
- package/dist/chunk-VXGN3IV7.js +2 -0
- package/dist/chunk-VZ4A6WMK.js +97 -0
- package/dist/chunk-VZJ6LUXX.js +2 -0
- package/dist/{chunk-RWSOZPJQ.js → chunk-W4QSZNMB.js} +1 -1
- package/dist/chunk-W54OT2FU.js +9 -0
- package/dist/{chunk-BL3SJDCG.js → chunk-W6HZF56M.js} +1 -1
- package/dist/chunk-W72ACCFL.js +27 -0
- package/dist/chunk-W7FLXW6Q.js +5 -0
- package/dist/chunk-WAOUE7MP.js +9 -0
- package/dist/chunk-WEIPY3CI.js +16 -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-K3IQEL7R.js → chunk-WXJCJL5L.js} +1 -1
- package/dist/chunk-WZXPF3BI.js +2 -0
- package/dist/chunk-XB6BJPDL.js +2 -0
- package/dist/{chunk-4FHK4LKQ.js → chunk-XLEGGC4Y.js} +1 -1
- package/dist/chunk-XMPTFXPW.js +5 -0
- package/dist/chunk-XQMWHPZI.js +3 -0
- package/dist/{chunk-75MMTNPB.js → chunk-XRNQSXOM.js} +2 -2
- package/dist/{chunk-2PKME4VT.js → chunk-XZGEN4NU.js} +4 -4
- package/dist/chunk-XZYA7DNH.js +2 -0
- package/dist/{chunk-OIUV3ISA.js → chunk-Y6Y6RAY4.js} +1 -1
- package/dist/chunk-Y7E5L42F.js +3 -0
- package/dist/{chunk-GFBAK7WQ.js → chunk-YAW6JW6D.js} +7 -7
- package/dist/chunk-YDPTSDIJ.js +2 -0
- package/dist/chunk-YDSGXB25.js +2 -0
- package/dist/chunk-YGRULEZY.js +2 -0
- package/dist/chunk-YHFZFV3A.js +22 -0
- package/dist/chunk-YIKF4ERQ.js +375 -0
- package/dist/chunk-YLXWAY7D.js +2 -0
- package/dist/{chunk-UA2QDAWT.js → chunk-YPFQ4UGF.js} +1 -1
- package/dist/{chunk-4CYBXJIA.js → chunk-YQ5C6UDG.js} +1 -1
- package/dist/chunk-Z55KBMYV.js +2 -0
- package/dist/chunk-ZAFJQ3SM.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-X2A6CC6B.js → chunk-ZTRRFG52.js} +1 -1
- package/dist/chunk-ZU4W2QGM.js +3 -0
- package/dist/committer-JGY66PFM.js +2 -0
- package/dist/config-754B73XK.js +2 -0
- package/dist/controller-client-PB3AZAGG.js +2 -0
- package/dist/cover-cmd-NBNZCR6C.js +2 -0
- package/dist/{credentials-QD32Y7K7.js → credentials-F7DYLVWY.js} +1 -1
- package/dist/{deps-bundle-OI7JJ22L.js → deps-bundle-PW3WEQJ7.js} +1 -1
- package/dist/{deps-resolve-ZOALDS6H.js → deps-resolve-SQYVN76L.js} +1 -1
- package/dist/descriptor-7T32VRMB.js +2 -0
- package/dist/design-chat-F3OEZPNJ.js +2 -0
- package/dist/design-committer-TRYP3LOZ.js +2 -0
- package/dist/design-headless-OTHYOX3E.js +2 -0
- package/dist/design-remote-2BEGCVCX.js +3 -0
- package/dist/device-env-CHFRRV6W.js +2 -0
- package/dist/dispatch-DVQ3H7EJ.js +2 -0
- package/dist/doctor-XY26Z35T.js +2 -0
- package/dist/docx-convert-6IZO5P5K.js +2 -0
- package/dist/{dossier-7HVC6BNK.js → dossier-NROC2MCY.js} +1 -1
- package/dist/evidence-P6FFKC7B.js +2 -0
- package/dist/evidence-presentation-YYTIDCBS.js +2 -0
- package/dist/evolve-cmd-WWOB3QJR.js +2 -0
- package/dist/evolve-remote-WLVY3QID.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-OP5I5W3O.js +12 -0
- package/dist/explain-cmd-VYAANFFZ.js +4 -0
- package/dist/explore-K5YBGHK6.js +2 -0
- package/dist/explore-context-tty-RZ7D2TBV.js +2 -0
- package/dist/explore-entry-EKXJ67BD.js +6 -0
- package/dist/explore-live-2YVRAQZO.js +5 -0
- package/dist/explore-run-tty-D47FGPX7.js +5 -0
- package/dist/extract-bind-W2NET364.js +14 -0
- package/dist/extract-chat-M65NWGUK.js +2 -0
- package/dist/extract-cmd-FTFLETOP.js +6 -0
- package/dist/extract-headless-G6W6JQ27.js +2 -0
- package/dist/feeder-NY45UFJK.js +2 -0
- package/dist/folder-flags-KKIH654K.js +2 -0
- package/dist/gaps-cmd-OIDDLRYL.js +3 -0
- package/dist/gate-7AKRPRMK.js +2 -0
- package/dist/gate-WISOUTHQ.js +2 -0
- package/dist/{generate-headless-6WMJYNI6.js → generate-headless-RURIEKVS.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-4G2AK4Y2.js +8 -0
- package/dist/ingest-remote-SSLUHQVG.js +2 -0
- package/dist/ink-screen-RZ7QDIUI.js +2 -0
- package/dist/install-ZVBHPXGP.js +2 -0
- package/dist/interactive-bind-SI2ZS55Q.js +26 -0
- package/dist/interactive-remote-J56EWJGA.js +65 -0
- package/dist/interrupt-guard-QETBPINI.js +2 -0
- package/dist/lane-AQYRIW24.js +2 -0
- package/dist/lattice-auth-6FEVSR7E.js +2 -0
- package/dist/lifecycle-cmd-HJ37LTXE.js +2 -0
- package/dist/list-cmd-6XL2FYLQ.js +3 -0
- package/dist/list-commands-5DCCKU3L.js +2 -0
- package/dist/list-remote-LXPQNXYN.js +15 -0
- package/dist/locks-cmd-JJ2QNTNY.js +2 -0
- package/dist/logical-ids-RXAQJZ3T.js +2 -0
- package/dist/login-flow-WEK3E476.js +2 -0
- package/dist/maintenance-cmd-BXXHP36K.js +2 -0
- package/dist/mobile-prompts-CECJ5UY2.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-PDVYMTY5.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-A3ID7JFA.js +3 -0
- package/dist/phase-seed-LCJ4WSYV.js +2 -0
- package/dist/pipeline-GX3LKPI5.js +2 -0
- package/dist/prepare-target-FMT6QFHZ.js +2 -0
- package/dist/pull-cmd-UPFQYUND.js +2 -0
- package/dist/pull-route-FWBXJMR7.js +2 -0
- package/dist/readmodel-INMP6MNW.js +2 -0
- package/dist/real-device-run-X7JJWOIK.js +2 -0
- package/dist/reconcile-cmd-JBH365JL.js +5 -0
- package/dist/reconcile-deps-TWJ3FTSU.js +2 -0
- package/dist/reconcile-remote-BCX6SWFC.js +13 -0
- package/dist/recording-banner-YKBAL6UB.js +2 -0
- package/dist/registry-VQC757MJ.js +2 -0
- package/dist/remote-entry-X6JMPC2K.js +2 -0
- package/dist/remote-mode-FDPA7EWG.js +4 -0
- package/dist/remote-words-YVB66R3F.js +2 -0
- package/dist/require-project-folder-MLMEQJYP.js +2 -0
- package/dist/resolve-run-intent-PC7TQZUL.js +2 -0
- package/dist/resolver-EID34LQE.js +2 -0
- package/dist/revert-FHOBLZWF.js +2 -0
- package/dist/review-cmd-EUHFLFMY.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-SJCRTL7O.js +2 -0
- package/dist/run-startup-gate-YO66G6LS.js +2 -0
- package/dist/run-test-md-BLNBK4MH.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-S7WZBUCN.js +26 -0
- package/dist/sessions-remote-IWHWIQ2T.js +3 -0
- package/dist/shell-arg-FN3MT5U7.js +2 -0
- package/dist/{skill-installer-32YYMM4N.js → skill-installer-MAVQY6GW.js} +1 -1
- package/dist/spawner-C7NLLM4F.js +2 -0
- package/dist/store-MSA7KASS.js +2 -0
- package/dist/store-choice-3OJCV26J.js +2 -0
- package/dist/store-guard-OOSDLMEC.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-RDFDMVKQ.js +2 -0
- package/dist/sync-setup-RBRDUV7Q.js +2 -0
- package/dist/{sync-setup-ui-RC727VK6.js → sync-setup-ui-XITPGSO4.js} +2 -2
- package/dist/tcg-generate-KIECTZ2C.js +2 -0
- package/dist/test-definition-VRI4YIYL.js +2 -0
- package/dist/testmd-actions-CMAG6HWI.js +2 -0
- package/dist/testmd-sync-UPAA5UMD.js +2 -0
- package/dist/tms-client-NXAB6VJD.js +2 -0
- package/dist/token-refresh-KP3AYMYK.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-M5JHHNZA.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-Q737BE65.js +2 -0
- package/dist/{view-cmd-3WHG6MVB.js → view-cmd-XSNL5DGI.js} +4 -3
- package/dist/walk-session-SHGYLFRB.js +2 -0
- package/dist/with-telemetry-PM2HVN2B.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,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as O,c as P}from"./chunk-SMXABALN.js";import{a as M,b as $}from"./chunk-7NPTL66J.js";import{b as I,c as L}from"./chunk-BWXLZS5O.js";import{oa as j}from"./chunk-UEE3RZN4.js";import{a as D}from"./chunk-HCBYKLMW.js";import{a as m,b as s,k as _}from"./chunk-33DWJV67.js";import{a as q}from"./chunk-6YGTRKDT.js";import{y as f}from"./chunk-D36V5OX6.js";import{e as C}from"./chunk-UR6MHSHU.js";var F={"acceptance criteria":1,scenarios:2,"acceptance criteria + exercises":3,"tests + gaps":4,tests:4};function J(e,i,n={}){let r=[],u=L(e.turns).entries.length;if(i==="design"){let c;for(let g=e.ledger.length-1;g>=0;g--){let p=e.ledger[g];if(p.kind==="banner"&&p.text.startsWith("designing: ")){c=p.text.slice(11);break}}let o=n.remote&&!c?e.ledger.find(g=>g.kind==="header")?.phase:void 0,v=c?F[c]:o;v&&r.push(`phase ${v}/4`),u>0&&!n.remote&&r.push(`${u} item${u===1?"":"s"} this session`)}else u>0&&!n.remote&&r.push(`${u} saved as draft${u===1?"":"s"}`);let l=n.remote?n.added??I(e.turns):0,a=n.remote?n.updated??0:0;(l>0||a>0)&&r.push([l>0?`${l} added`:"",a>0?`${a} updated`:"","not saved yet"].filter(Boolean).join(" \xB7 "));let h=e.pending?e.pending.resolution.filter(c=>!c).length:0;return h>0&&r.push(`${h} question${h===1?"":"s"} pending`),e.credits&&r.push(`${e.credits.total.toFixed(1)} credits`),{items:r}}function Z(e,i){let n=[],r=e.applied+e.committed+e.retired;n.push(`${r} applied`),n.push(`${i} to decide`);let u=[];return e.skipped>0&&u.push(`${e.skipped} skipped`),e.deferred>0&&u.push(`${e.deferred} deferred`),e.failed>0&&u.push(`${e.failed} failed`),{items:[...n,...u]}}var x=C(q(),1);function ne({onToggleThinking:e,onCtrlC:i,explorer:n,panel:r}){let l=(0,x.useRef)(null),a=(0,x.useRef)(""),h=()=>{l.current&&clearTimeout(l.current),l.current=null,a.current=""};return(0,x.useEffect)(()=>h,[]),O((c,o)=>{if(o.ctrl&&c==="t"){e();return}if(o.ctrl&&c==="c"){i();return}if(!o.ctrl&&c.includes("")){i();return}if(!o.ctrl&&c.includes("")){e();return}if(n&&n.isOpen()){let v=()=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{h(),n.onBack()},150)};if(l.current){if(o.upArrow||o.downArrow||o.return){h(),o.return?n.onEnter():n.onMove(o.upArrow?-1:1);return}if(a.current+=c,a.current==="["){v();return}let g=a.current;h();let p=/^\[([ABCD])/.exec(g);if(p){(p[1]==="A"||p[1]==="B")&&n.onMove(p[1]==="A"?-1:1);return}n.onBack();return}if(o.upArrow){n.onMove(-1);return}if(o.downArrow){n.onMove(1);return}if(o.return){n.onEnter();return}if(o.escape){a.current="",v();return}return}if(r&&r.isFocused()){let v=()=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{h(),r.onBack()},150)};if(l.current){if(o.upArrow||o.downArrow||o.return||o.leftArrow||o.rightArrow){h(),o.return?r.onSelect():o.leftArrow?r.onLeft?.():o.rightArrow?r.onRight?.():r.onMove(o.upArrow?-1:1);return}if(a.current+=c,a.current==="["){v();return}let g=a.current;h();let p=/^\[([ABCD])/.exec(g);if(p){p[1]==="A"||p[1]==="B"?r.onMove(p[1]==="A"?-1:1):p[1]==="C"?r.onRight?.():r.onLeft?.();return}r.onBack();return}if(o.upArrow){r.onMove(-1);return}if(o.downArrow){r.onMove(1);return}if(o.leftArrow){r.onLeft?.();return}if(o.rightArrow){r.onRight?.();return}if(o.return){r.onSelect();return}if(o.escape){a.current="",v();return}if(/^[1-9]$/.test(c)){r.onDigit(Number(c));return}if(o.tab){r.onTab?.();return}if(c===" "&&r.isMulti()){r.onSpace();return}if(c&&!o.ctrl&&!o.meta){r.onType(c);return}return}}),null}var t=C(D(),1);function N(e,i=!1){return i?Y(e):e.kind==="REVIEW"?[{v:"approve",label:"approve",detail:"mark it reviewed and trusted"},{v:"archive",label:"archive",detail:"reject it \u2014 asks for a reason; impact shown above"},{v:"defer",label:"defer",detail:"not now \u2014 stays queued"}]:e.kind==="PAIR"?[{v:"merge",label:"merge",detail:"duplicate \u2014 fold into the older item (it stays unreviewed)"},{v:"keep_both",label:"keep both",detail:"genuinely distinct \u2014 promote both"},{v:"defer",label:"defer",detail:"not now \u2014 stays queued"}]:e.kind==="ARCHIVE"?[{v:"archive",label:"retire",detail:"hidden from now on; history is kept and it can be reverted"},{v:"skip",label:"skip",detail:"keep it \u2014 decided, never re-offered"},{v:"defer",label:"defer",detail:"not now \u2014 the plan re-offers it"}]:e.heldPayload?[{v:"approve",label:"approve update",detail:"commit the held payload \u2014 impact preview above"},{v:"skip",label:"keep current",detail:"drop the held payload (the owner's disk state stays untouched)"},{v:"defer",label:"defer",detail:"not now \u2014 stays held"}]:[{v:"approve",label:"approve",detail:e.kind==="ADD"?"commit + design it":"commit the updated version (old\u2192new redirect)"},{v:"skip",label:e.origin==="content-change"?"reject":"skip",detail:e.origin==="content-change"?"drop the staged proposal \u2014 nothing committed":"leave it as is"},{v:"defer",label:"defer",detail:"not now \u2014 the plan keeps it staged"}]}var Q=e=>e===0?null:e===1?"its test was designed for the old version":`its ${e} tests were designed for the old version`;function Y(e){return e.heldPayload?[{v:"approve",label:"approve the change",detail:"the use-case takes the new version"},{v:"skip",label:"keep it as it is",detail:"the change is dropped"},{v:"defer",label:"decide later",detail:"it keeps waiting"}]:e.kind==="ARCHIVE"?[...e.archiveRefused?[]:[{v:"archive",label:"archive",detail:"it's hidden from the project from now on"}],{v:"skip",label:"keep it",detail:"it stays as it is; this may be suggested again"},{v:"defer",label:"defer",detail:"decide later; it's kept as an open question"}]:e.kind==="ADD"?[{v:"approve",label:"approve",detail:"add it to this session"},{v:"skip",label:"reject",detail:"leave it out; it may be suggested again"},{v:"defer",label:"defer",detail:"leave it out for now, as an open question"}]:[{v:"approve",label:"approve",detail:"the use-case takes the new version"},{v:"skip",label:"reject",detail:"it stays as it is; the change may be suggested again"},{v:"defer",label:"defer",detail:"it stays as it is for now, as an open question"}]}function K(e,i=!1){let n=N(e,i);return e.viewDiff&&n.push({v:"view_diff",label:"view diff",detail:i?"the whole change, old \u2192 new":"full old \u2192 new"}),n}function R(e,i=!1){return e.kind==="ARCHIVE"?null:K(e,i).length}var G={ADD:{color:f.green??"green"},MODIFY:{color:"yellow"},ARCHIVE:{color:f.red},REVIEW:{color:"cyan"},PAIR:{color:"magenta"}},U=60,X=(e,i)=>`${e.heldPayload?"changed earlier":e.kind==="ADD"?"new":e.kind==="ARCHIVE"?`no longer in ${$(i)}`:"changed"}:`;function de({card:e,position:i,sel:n=0,focused:r=!1,freeText:u=null,editorIntent:l="steer",remote:a,gapAbove:h=!0}){let{stdout:c}=_(),o=c?.columns??80,v=o<U,g=K(e,!!a),p=R(e,!!a),H=G[e.kind],S=d=>r&&n===d?(0,t.jsx)(s,{color:f.assuranceAccent,children:"\u276F"}):" ",b=e.impact,k=a?e.kind==="MODIFY"?Q(e.tests??0):null:b&&"stale_refs"in b&&b.stale_refs.length>0?`${e.kind==="ARCHIVE"?"retiring leaves":"approving marks"} ${b.stale_refs.length} item(s) stale`+((b.direct_refs?.length??0)>0?` \u2014 ${b.direct_refs.length} directly touched: ${b.direct_refs.join(", ")}`:""):b&&"design_children"in b?`${e.kind==="REVIEW"?"archiving drops":"merging folds"} ${b.design_children} design child(ren)`:null,T=e.provenance&&e.provenance!==e.why?e.provenance:a?null:e.origin??null,B=a?[{label:"change",text:e.why},...T?[{label:"from",text:T,dimmer:!0}]:[],...k?[{label:"tests",text:k}]:[]]:[{label:"why",text:e.why},...T?[{label:"from",text:T,dimmer:!0}]:[],...e.tier?[{label:"match",text:e.tier,dimmer:!0}]:[],...k?[{label:"impact",text:k}]:[]],E=Math.max(...B.map(d=>d.label.length)),A=a?`? review the changes from ${$(a.source)}`:"? reconcile",y=a?`${i.n} of ${i.of}`:`item ${i.n} of ${i.of}`,W=(0,t.jsxs)(m,{flexDirection:"column",children:[(0,t.jsx)(m,{paddingLeft:2,children:(0,t.jsxs)(s,{bold:!0,children:[(0,t.jsx)(s,{color:H.color,children:a?X(e,a.source):`[${e.kind}]`}),` ${a?M(e):j(e.title)}`]})}),B.map((d,w)=>a?(0,t.jsxs)(m,{paddingLeft:2,children:[(0,t.jsx)(m,{flexShrink:0,width:E+2,children:(0,t.jsx)(s,{color:f.dim,children:d.label})}),(0,t.jsx)(m,{flexGrow:1,children:(0,t.jsx)(s,{color:d.dimmer?f.dim:void 0,children:d.text})})]},`f-${w}`):(0,t.jsx)(m,{paddingLeft:2,children:(0,t.jsxs)(s,{children:[(0,t.jsx)(s,{color:f.dim,children:`${d.label.padEnd(E)} `}),(0,t.jsx)(s,{color:d.dimmer?f.dim:void 0,children:d.text})]})},`f-${w}`)),e.diffSummary?(0,t.jsx)(m,{paddingLeft:2,children:(0,t.jsx)(s,{color:f.dim,children:e.diffSummary})}):(e.diff??[]).map((d,w)=>(0,t.jsx)(m,{paddingLeft:4,children:(0,t.jsx)(s,{color:d.op==="-"?"red":"green",children:`${d.op==="-"?"\u2212":"+"} ${d.field==="criteria"?a?"acceptance criterion":"criterion":d.field}: ${d.text}`})},`d-${w}`)),(a?[]:e.citeLines??[]).map((d,w)=>(0,t.jsx)(m,{paddingLeft:2,children:(0,t.jsx)(s,{color:f.dim,children:d})},`c-${w}`)),(0,t.jsx)(s,{children:" "}),g.map((d,w)=>(0,t.jsxs)(s,{children:[S(w),` ${w+1}. ${d.label}`,(0,t.jsx)(s,{color:f.dim,children:` \u2014 ${d.detail}`})]},`o-${w}`)),p!==null||u&&l==="because"?u?(0,t.jsxs)(m,{flexDirection:"column",children:[(0,t.jsxs)(m,{children:[(0,t.jsxs)(s,{children:[(0,t.jsx)(s,{color:f.assuranceAccent,children:"\u276F"})," ",(0,t.jsx)(s,{color:f.dim,children:"\u270E "})]}),(0,t.jsx)(P,{value:u.value,onChange:u.onChange,onSubmit:u.onSubmit,onCancel:u.onCancel,placeholder:l==="because"?"why archive it?":l==="adjust"?"tell me what to change":"say what to adjust"})]}),(0,t.jsx)(s,{color:f.muted,children:l==="because"?" submits as: archive \xB7 your reason goes on the record":l==="adjust"?" the agent looks at this change again, with your words":e.kind==="PAIR"?" submits as: defer \xB7 your note parks with the card (it re-offers)":" submits as: approve \xB7 your words steer the re-design"})]}):p!==null?(0,t.jsxs)(s,{children:[S(p)," ",(0,t.jsx)(s,{color:f.dim,children:l==="adjust"?"\u270E adjust \u2014 tell me what to change":e.kind==="PAIR"?"\u270E defer with a note \u2014 say what you noticed":"\u270E approve with changes \u2014 say what to adjust"})]}):null:null]});if(v)return(0,t.jsxs)(m,{marginTop:h?1:0,marginBottom:1,flexDirection:"column",children:[(0,t.jsx)(s,{bold:!0,color:f.assuranceAccent,children:A}),(0,t.jsx)(s,{color:f.dim,children:y}),W]});let V=Math.max(2,Math.min(o-1,100)-A.length-y.length);return(0,t.jsxs)(m,{marginTop:h?1:0,marginBottom:1,flexDirection:"column",children:[(0,t.jsxs)(s,{children:[(0,t.jsx)(s,{bold:!0,color:f.assuranceAccent,children:A})," ".repeat(V),(0,t.jsx)(s,{color:f.dim,children:y})]}),(0,t.jsx)(s,{children:" "}),W]})}function fe(e,i){let n=["\u2191\u2193 select","\u23CE confirm"];return e.multi_select&&n.push("space toggle"),i.batchCount>1&&n.push("\u2190 \u2192 questions"),(e.allow_free_text||e.options.some(r=>r.input===!0))&&n.push("\u270E type your own"),i.canAttach&&n.push("@ attach a file or URL"),i.escBack&&n.push("esc back"),{keys:n}}function pe(e,i){let n=["\u2191\u2193 select","\u23CE confirm"];return e.some(r=>r.free)&&n.push("\u270E type your own"),i.escBack&&n.push("esc back"),{keys:n}}function he(e){let i=["\u2191\u2193 select","\u23CE confirm","1-9 verdict"];return R(e)!==null&&i.push("type = adjust"),i.push("esc \xB7 nothing to undo"),{keys:i}}export{J as a,Z as b,ne as c,N as d,K as e,R as f,de as g,fe as h,pe as i,he as j};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as
|
|
2
|
+
import{b as et,c as nt}from"./chunk-W3USRQX6.js";import{a as Z}from"./chunk-JQ64X2TO.js";import{a as Lt}from"./chunk-JIRNI5TB.js";import{a as k}from"./chunk-UTM7D4PI.js";import{Y as tt}from"./chunk-W54OT2FU.js";import{b as Q}from"./chunk-HQ2E2XCU.js";import{a as W,d as X}from"./chunk-C6HI6Y3S.js";import{a as Y}from"./chunk-FCD3NYOM.js";import{a as J}from"./chunk-4QTH7VYE.js";import{a as R}from"./chunk-RZ4F3BHX.js";import{e as Nt}from"./chunk-UR6MHSHU.js";import{readFileSync as T,existsSync as G,readdirSync as be,mkdirSync as K,writeFileSync as w}from"fs";import{readFile as Ot,unlink as ye}from"fs/promises";import{join as y}from"path";import{existsSync as ae,mkdirSync as ce,readdirSync as At,writeFileSync as ue}from"fs";import{join as S}from"path";import{randomUUID as v}from"crypto";var it=["children","instructions","branches","module_content","true_branch","false_branch"];function D(e){let t=new Map,n=r=>{if(!r||typeof r!="object")return;let o=r;if(Array.isArray(o.operations))for(let i of o.operations){let s=i.operation_id;if(typeof s!="string"||!s)continue;let a=t.get(s)??[];a.includes(o)||a.push(o),t.set(s,a)}for(let i of it){let s=o[i];Array.isArray(s)?s.forEach(n):s&&typeof s=="object"&&n(s)}};return e.forEach(n),t}function Tt(e,t){if(!t||t.length===0)return;if(t.length===1)return t[0];let n=e.action_params?.script;if(typeof n=="string"&&n.trim()){let r=n.trim(),o=t.find(i=>jt(i)?.trim()===r);if(o)return o}return t[0]}function jt(e){let t=e,n=t.script_content??t.js_snippet;return typeof n=="string"?n:void 0}function U(e,t){let n=new Map;for(let r of e){let o=Tt(r,r.action_id?t.get(r.action_id):void 0);if(!o)continue;let i=n.get(o)??[];i.push(r),n.set(o,i)}return n.size===0?null:[...n].map(([r,o])=>Bt(r,o))}function ot(e,t){let n=D(t.authoredInstructions),r=[];for(let o of e){if(o.flatIndex===void 0||!t.replayOnlyFlatIndices.has(o.flatIndex))continue;let i=U(o.records,n);i&&r.push(...i)}return r}function st(e,t){let n=new Map(t.map(a=>[a.instruction_id,a])),r=[],o=a=>{if(!a||typeof a!="object")return;let c=a.instruction_id,u=typeof c=="string"?n.get(c):void 0;return u&&r.push(c),u},i=a=>{if(!a||typeof a!="object")return;let c=a;for(let u of it){let l=c[u];if(Array.isArray(l))s(l);else if(l&&typeof l=="object"){let _=o(l);_&&(c[u]=_),i(_??l)}}},s=a=>{for(let c=0;c<a.length;c++){let u=o(a[c]);u&&(a[c]=u),i(u??a[c])}};return s(e),r}function Ct(e){if(!e.timestamp||e.duration_ms==null)return"";let t=new Date(e.timestamp);return isNaN(t.getTime())?"":new Date(t.getTime()+e.duration_ms).toISOString()}function j(e){if(e!=null)try{return JSON.parse(e)}catch{return e}}function Dt(e){return typeof e=="string"?"string":typeof e=="boolean"?"bool":typeof e=="number"?Number.isInteger(e)?"int":"float":Array.isArray(e)?"list":e==null?"NoneType":"JSON"}function C(e,t,n){let r=e.user_variables,o=typeof r=="string",i;try{i=o?JSON.parse(r):r??[]}catch{return}if(!Array.isArray(i)||i.length===0)return;let s=i.find(a=>t&&a.name===t)??(i.length===1?i[0]:void 0);s&&(s.value=n,s.value_type=Dt(n),e.user_variables=o?JSON.stringify(i):i)}function rt(e){e.user_variables!==void 0&&(e.user_variables=typeof e.user_variables=="string"?"[]":[])}function Ut(e,t){let n=e.operations??[],r=new Set(t.map(i=>i.action_id).filter(Boolean)),o=n.filter(i=>r.has(i.operation_id));return o.length>0?o:n.length===1?n:[]}function Ft(e){let t=e.error??"Script execution failed";return{error:t,error_code:"SCRIPT_EXECUTION_ERROR",error_message:t,reason:t}}function Bt(e,t){let n=structuredClone(e),r=t[0],o=t[t.length-1];n.status=t.find(s=>s.status!=="success")?.status??r.status,n.start_timestamp=r.timestamp??n.start_timestamp,n.end_timestamp=Ct(o)||n.end_timestamp;let i=Ut(n,t);for(let s of i)s.status=n.status,s.operation_start=n.start_timestamp,s.operation_end=n.end_timestamp;switch(n.content_type){case"api":{let s=o.action_params?.api_data?.response;if(s&&typeof s=="object")for(let a of[n,...i])a.api_data={...a.api_data??{},response:s},C(a,o.output_variable,s);break}case"script":{let s=o.output_variable??n.output_variable_name;if(n.status!=="success"){let a=Ft(o);n.code_error=a,rt(n);for(let c of i)c.execution_result=a,c.code_error=a,rt(c)}else if(o.output_value!=null){let a=j(o.output_value);C(n,s,a);for(let c of i)c.execution_result={value:a},C(c,s,a)}break}case"db_query":{o.output_value!=null&&(n.db_details={...n.db_details??{},carried_out_query:j(o.output_value)});break}case"screenshot_command":{let s=j(o.output_value);s&&typeof s=="object"&&(n.smartui_results=s);break}case"network_assertion":case"network_query":break;default:break}return n}var Mt="/home/kaneai/Downloads";function O(e){return`${Mt}/${e}`}function ut(e){return"FILE__"+e.replace(/[^A-Za-z0-9]/g,"_")}function M(e){return"file."+e}function N(e){let t=e?.media;return!t||!t.name||!t.media_url?null:{media_id:t.media_id??"",name:t.name,media_url:t.media_url,type:t.type??"doc",...t.alias?{alias:t.alias}:{}}}function lt(e){return e?e.includes(`
|
|
3
3
|
`)?e.split(`
|
|
4
|
-
`).map(t=>t.trim()).filter(Boolean):e.split(". ").map(t=>t.trim()).filter(Boolean).map(t=>t.endsWith(".")?t:t+"."):[]}function F(e){return typeof e=="string"&&e.includes("{{secrets.")}var Mt={click:"CLICK",double_click:"CLICK",type:"TYPE",fill:"TYPE",clear:"CLEAR",select:"SELECT",hover:"HOVER",drag:"DRAG_DROP",upload_files:"UPLOAD_FILE",navigate:"OPEN",go_back:"NAVIGATE",go_forward:"NAVIGATE",refresh:"REFRESH",press_key:"SENDKEYS",scroll:"SCROLL_PIXELS",scroll_into_view:"SCROLL_UNTIL_ELEMENT",wait:"WAIT",wait_until:"WAIT_UNTIL",wait_for_load:"WAIT_FOR_LOAD",switch_tab:"SWITCH_TAB",new_tab:"NEW_TAB",close_tab:"CLOSE_TAB",api:"API",evaluate_js:"EVALUATE_JS",vision_query:"VISION_QUERY",textual_query:"TEXTUAL_QUERY",get_url:"GET_URL",get_title:"GET_TITLE",assert:"ASSERTION",math:"MATHEMATICAL_OPERATION",set_cookies:"SET_COOKIES",delete_cookies:"DELETE_COOKIES",clear_cookies:"CLEAR_COOKIES",set_local_storage:"SET_LOCAL_STORAGE",delete_local_storage:"DELETE_LOCAL_STORAGE",clear_local_storage:"CLEAR_LOCAL_STORAGE",set_clipboard:"SET_CLIPBOARD",paste_clipboard:"PASTE_CLIPBOARD",clear_clipboard:"CLEAR_CLIPBOARD",device_control:"DEVICE_CONTROL",device_control_query:"DEVICE_CONTROL_QUERY"},lt={literal:"SET_VARIABLE",condition:"SET_VARIABLE",visual:"VISION_QUERY",dom:"TEXTUAL_QUERY",url:"GET_URL",title:"GET_TITLE",devtool_network:"DEVTOOLS_NETWORK_QUERY",devtool_console:"DEVTOOLS_CONSOLE_QUERY",devtool_cookies:"DEVTOOLS_COOKIES_QUERY",devtool_storage:"DEVTOOLS_STORAGE_QUERY",devtool_performance:"DEVTOOLS_PERFORMANCE",api_response:"API_CALLS_QUERY",textual_visual:"TEXTUAL_ANALYZER"},zt=new Set(["CLICK","TYPE","FILL","HOVER","SCROLL_UNTIL_ELEMENT","UPLOAD_FILE","VISION_QUERY","DRAG_DROP","SELECT"]);function dt(e,t){if(e==="analyze"){let r=t?.action_params?.analyzer_type??"";return lt[r]}if(e==="scroll"&&t?.action_params?.into_view===!0)return"SCROLL_UNTIL_ELEMENT";let n=Mt[e];return n||console.warn(`[migrator] UNKNOWN action_type "${e}" \u2014 falling back to "${e.toUpperCase()}"; explicit mapping required`),n??e.toUpperCase()}function _t(e,t){if(!e||!t)return"";try{let n=new Date(e);return isNaN(n.getTime())?"":new Date(n.getTime()+t).toISOString()}catch{return""}}function pt(e){try{return JSON.parse(e.output_value??"{}")}catch{return{}}}function Vt(e){let t=e.output_variable??"";if(!t)return"[]";let r={...pt(e)};return delete r.body,JSON.stringify([{name:t,unique_key:(e.action_id??"").replace(/-/g,"").slice(0,8)||v().replace(/-/g,"").slice(0,8),value:r,variable_description:"API Response"}])}function $t(e,t,n){let r=e.action_params??{},o=zt.has(t)?"Vision Agent":"Operation Agent",i={operation_type:t};t==="OPEN"&&(i.url=r.url??""),t==="SET_VARIABLE"&&(i.variable_name=e.output_variable??r.key??"",i.variable_value=e.output_value??"");let s=t==="UPLOAD_FILE"?N(r):null;s&&(i.value=O(s.name));let a={},c={},u=e.action_instruction??"",l=r.text??"",_=r.url??"",p=[["intent",u],["value",l],["url",_]];for(let[h,A]of Object.entries(n)){let I=String(A);if(h.startsWith("secrets."))for(let[b,E]of p)E.includes(I)&&(c[b]=h);for(let[b,E]of p)E.includes(I)&&!(b in a)&&(a[b]=E)}s?.alias&&(a.value=`{{${M(s.alias)}}}`);let d=e.action_type,f={operation:e.action_instruction??"",agent:o,operation_dict:i,reasoning:d==="analyze"?r.query??"":e.intent??e.action_instruction??"",variable:a,secrets:c,params:{}};d==="analyze"&&typeof r.code=="string"&&r.code&&(f.code=r.code),d==="analyze"&&typeof r.code_js=="string"&&r.code_js&&(f.code_js=r.code_js),d==="analyze"&&typeof r.condition_expression=="string"&&r.condition_expression&&(f.condition_expression=r.condition_expression),r.uses_websocket===!0&&(f.uses_websocket=!0),r.uses_sse===!0&&(f.uses_sse=!0),d==="analyze"&&r.analyzer_type==="textual_visual"&&(typeof r.wrapped_js=="string"&&(f.wrapped_js=r.wrapped_js),Array.isArray(r.locators)&&(f.locators=r.locators),typeof r.operator=="string"&&(f.operator=r.operator),Array.isArray(r.transforms)&&(f.transforms=r.transforms),typeof r.query=="string"&&(f.query=r.query),typeof r.expected_value=="string"&&(f.expected_value=r.expected_value),typeof r.needs_unit_conversion=="boolean"&&(f.needs_unit_conversion=r.needs_unit_conversion),typeof r.condition=="string"&&(f.condition=r.condition));let m={set_cookies:"cookies",set_clipboard:"text",delete_cookies:"names",set_local_storage:"items",delete_local_storage:"keys"}[d];return m&&r[m]!==void 0&&(f[m]=r[m]),d==="set_clipboard"&&typeof r.html=="string"&&r.html&&(f.html=r.html),f}function L(e){let t=e.assertion_tree;return t&&typeof t=="object"&&Object.keys(t).length>0?t:Array.isArray(e.sub_results)?e:{}}function qt(e){let t=L(e);if(typeof t.passed=="boolean")return t.passed;let n=t.sub_results??[];return n.length===0?t.status==="passed":(t.composite_operator??"and")==="or"?n.some(o=>o.passed===!0):n.every(o=>o.passed===!0)}function ft(e){return e.map(t=>({description:t.description??"",store_key:t.store_key??"",expected_value:t.expected??"",extracted_value:t.extracted_value??"",operator:t.operator??"equals",transforms:t.transforms??[]}))}function Gt(e){let t=L(e),n=t.sub_results??[],r=ft(n);return{operator:[],assertion_operands:[],left_operand:null,right_operand:null,operands:[],sub_results:n,sub_checks:r,composite_operator:t.composite_operator??"and",verification:t.verification??"",claim:t.description??""}}function Kt(e){let t=e.action_params??{},n=L(t),r=n.sub_results??[],o=ft(r);return[{operation:e.action_instruction??"",agent:"Operation Agent",operation_dict:{operation_type:"ASSERTION",assertion_tree:{sub_results:r,sub_checks:o,composite_operator:n.composite_operator??"and",verification:"",claim:n.description??e.action_instruction??"",operator:[],assertion_operands:[],left_operand:null,right_operand:null,operands:[]}},variable:{},secrets:{},params:{}}]}function Ht(e,t,n,r){let o=e.visual_data;if(!o||o.x==null||o.y==null)return null;let i=t?`${t}/test_screenshots`:"";return{x:o.x,y:o.y,confidence:0,bbox:o.bbox??null,bbox_source:o.bbox?"accessibility_tree":"fallback",viewport_width:o.viewport_width??1280,viewport_height:o.viewport_height??800,scale_factor:null,raw_image_url:i?`${i}/untagged_screenshot/${n}.${r?.get(n)??"png"}`:"",raw_image_sas_url:"",annotated_image_url:"",annotated_image_sas_url:""}}function Jt(e){if(!e)return"";let t=e;return typeof e=="object"&&!Array.isArray(e)&&Array.isArray(e.frameInfo)&&(t=e.frameInfo),!Array.isArray(t)||t.length===0?"":JSON.stringify(t)}function Wt(e){return/^(android|ios)_native$/i.test(e.platform??"")}function gt(e,t){return e.map(n=>({...n,type:t?n.strategy??n.type??"native":n.isXPath?"xpath":"css"}))}function Xt(e,t,n){let r={selector_target:"",drag_displacement:{},hold_duration_ms:null,move_duration_ms:null,hold_at_destination_ms:null};if(e!=="drag")return r;let o=t.target_selectors,i={};typeof t.direction=="string"&&t.direction&&(i.direction=t.direction,typeof t.fraction=="number"&&(i.fraction=t.fraction));let s=a=>typeof t[a]=="number"?Math.trunc(t[a]):null;return{selector_target:Array.isArray(o)&&o.length>0?gt(o,n):"",drag_displacement:i,hold_duration_ms:s("hold_duration_ms"),move_duration_ms:s("move_duration_ms"),hold_at_destination_ms:s("hold_at_destination_ms")}}function st(e,t="",n){let r=e.action_type,o=dt(r,e),i=e.action_params??{},s=e.coordinates??null,a=e.selectors??null,c=!!(a&&a.length>0),u=Wt(e),l=Xt(r,i,u),_=e.timestamp??"",p=e.duration_ms??0,d=e.variables_used??{},f=e.action_id??v(),g=v(),m=_t(_,p),h="",A="";if(r==="navigate")A=i.url??"",h=A;else if(r==="type"||r==="fill")h=i.text??"";else if(r==="press_key")h=i.key??"";else if(r==="wait")h=String(i.ms??i.timeout_ms??"");else if(r==="evaluate_js")h=i.script??"";else if(r==="upload_files"){let H=N(i);H&&(h=O(H.name))}else r==="analyze"&&o==="SET_VARIABLE"&&(h=e.output_value??"");let I="";r==="go_back"?I="back":r==="go_forward"&&(I="forward");let b=e.action_instruction??"",E=F(h)||F(A)||F(b),x=$t(e,o,d);return{operation_id:f,instruction_id:g,instruction:b,intent:b,operation_start:_,operation_end:m,status:e.status??"",command:o,name:"",target:"",value:h,message:"",operation_dict:"",frame:Jt(e.frame_info),surface:typeof i.surface=="string"?i.surface:"",frame_path:typeof i.frame_path=="string"?i.frame_path:"",grounded_by:typeof i.grounded_by=="string"?i.grounded_by:"",error_message:e.error??"",code_snippet:"",sub_instruction_obj:JSON.stringify(x),test_id:"",test_version:"",action:"",string_to_float:!1,feedback_msg:"",time_taken:"",create_time_stamp:"",update_time_stamp:"",locator_variable:"",locator_variable_name:"",image_url:t?`${t}/test_screenshots/untagged_screenshot/${f}.${n?.get(f)??"png"}`:"",alternative_xpaths:[],attribute:"",value_description:"",url:A,navigation_direction:I,tagified_image_url:"",query_variable_name:e.output_variable??"",query_variable_value:e.output_value??"",query_variable_type:"",expected_value:"",queried_value:"",operator:"",assertion_status:o==="ASSERTION"?qt(i):"",query_info_dict:{},query_content_confidence:"none",debugging_logs:[],locator_index:0,query_html:"",user_variables:"[]",optional_flag:!1,max_retries:0,retries_delay:0,explicit_wait:0,implicit_wait:0,tab_index:String(i.tab_index??""),tab_identifier:String(i.tab_identifier??""),scroll_value:i.amount??1,scroll_direction:i.direction??"",mi_scroll_payload:{},sleep_duration:0,app_id:"",manual_interaction_tag:"",string_to_float_list:[],js_snippet:r==="evaluate_js"?i.script??"":"",code_error:"",hide:E,dismiss_dialog:!1,use_v2_mobile_tagging:u,multiple_inputs:!1,dialog_action:"",dialog_type:"",is_coordinates_used_for_interaction:s!==null&&!c,element_coordinates_ratio:[],element_bounds_ratio:[],x_coord:c?null:s?.x??null,y_coord:c?null:s?.y??null,target_x_coord:i.target_x??null,target_y_coord:i.target_y??null,source_description:i.source_description??null,target_description:i.target_description??null,use_coordinates:s!==null&&!c,kaneaiMobileTaggingImageLimit:1,clicks_order_code:"se_js_ac",selector:c?gt(a,u):"",selector_target:l.selector_target,math_result_variable_name:"",math_result_variable_value:"",expression_tree:o==="ASSERTION"?Gt(i):i.expression_tree??{},assertion_tree:o==="ASSERTION"?L(i):i.assertion_tree??{},assertion_tree_simplified:{},network_throttle:{},is_mobile_offline:!1,autoheal:!1,reprobe:e.reprobe??!1,click_modifier:(i.click_count??1)>=2?{kind:"multi_click",frequency:i.click_count}:null,db_query:"",db_details:{},db_query_decoded:"",is_global_variable:!1,is_global_variable_persist:!1,global_variable_id:"",wait_for_element_timeout:0,failure_condition:o==="ASSERTION"?"Fail test immediately":"",screenshot_command:"",smartui_contents:{},smartui_results:{},result_type:"",result_hint:"",drag_offset:{},drag_displacement:l.drag_displacement,hold_duration_ms:l.hold_duration_ms,move_duration_ms:l.move_duration_ms,hold_at_destination_ms:l.hold_at_destination_ms,start_coordinates:i.source_coordinates?{x:i.source_coordinates[0],y:i.source_coordinates[1]}:{},end_coordinates:i.target_coordinates?{x:i.target_coordinates[0],y:i.target_coordinates[1]}:{},element_rect:null,is_canvas:!1,until_condition:"",until_max_retries:0,until_settle_ms:0,api_data:r==="api"?{request:e.action_params?.api_data?.request??{}}:{},output_variables:r==="api"?e.output_variable?{[e.output_variable]:null}:{}:e.output_variable?{[e.output_variable]:e.output_value??""}:{},visual_context:Ht(e,t,f,n),reasoning:r==="analyze"?i.query??"":e.intent??e.action_instruction??""}}function at(e,t){let n=e.action_type,r=dt(n,e),o=e.timestamp??"",i=e.duration_ms??0,s=_t(o,i),a=r==="ASSERTION"||r==="MATHEMATICAL_OPERATION";return{instruction_id:t.instruction_id,instruction_class:a?"non_driver_action":"driver_action",module_id:"",instruction:e.action_instruction??"",command:r,error:null,parent_instruction_id:"",classification_layer_resp:r==="ASSERTION"?Kt(e):[],classification_error:{},operations:[t],status:e.status??"",start_timestamp:o,end_timestamp:s,type:"agent_generated",tags:[],html_paths:[],optional_flag:!1,max_retries:0,retries_delay:0,explicit_wait:0,implicit_wait:0,content_type:n==="api"?"api":n==="analyze"&&e.action_params?.analyzer_type==="api_response"?"api_calls_query":n==="analyze"&&e.action_params?.analyzer_type?.startsWith("devtool_")?e.action_params.analyzer_type.replace("devtool_","devtools_"):"instruction",js_snippet:n==="evaluate_js"?e.action_params?.script??"":"",user_variables:n==="api"?Vt(e):"[]",api_data:n==="api"?{request:e.action_params?.api_data?.request??{},response:pt(e)}:{},params_used:!1,hard_assertion:r==="ASSERTION"?e.action_params?.failure_condition==="hard":!1,expected_outcome:"",module_execution_index:0,module_version:null,network_throttle:{},isEdited:!1,use_query_assertion_v2:!1,db_query:"",db_details:{},network_assertion_content:{},screenshot_command:"",smartui_contents:{},generative_id:"",plan_id:"",generative_objective:"",error_message:"",error_code:"",reason:"",title:"",used_variables:[],reasoning:n==="analyze"?e.action_params?.query??"":e.intent??e.action_instruction??""}}function Yt(e,t=[]){let n=e.action_params??{},r=n.branches??[],o=n.winning_index??-1,i=n.sub_results??[],s={};for(let c of i){let u=c.sub_results;if(u)for(let l of u){let _=l.store_key;_&&(s[_]=l)}}let a=r.map((c,u)=>{let l=u===o,_=(c.sub_checks??[]).map(p=>{let d=s[p.store_key];return{description:p.description,store_key:p.store_key,expected_value:p.expected_value,stored_value:d?.extracted_value??p.stored_value,operator:p.operator??d?.operator??"equals",transforms:p.transforms??d?.transforms??[]}});if(_.length===0&&c.condition&&i.length>0){let d=i.find(f=>f.branch_index===u)?.sub_results??[];d.length>0&&(_=d.map(f=>({description:f.description??c.condition,store_key:f.store_key??"",expected_value:f.expected??"true",stored_value:f.extracted_value??void 0,operator:f.operator??"equals",transforms:f.transforms??[]})))}return{branch_index:u,condition:c.condition??null,branch_type:c.branch_type??"sub_objective",passed:l,sub_objective:null,custom_event:c.custom_event??null,children:l?t:[],sub_checks:c.condition?_:[],composite_operator:c.composite_operator??"and"}});return{content_type:"conditional_block",instruction_id:`if_else_${v().slice(0,8)}`,instruction:e.action_instruction??"",instruction_class:"driver_action",command:"",status:e.status??"success",resolved_branch_index:o,branches:a,generative_id:"",generative_objective:"",variables_used:{},classification_layer_resp:[],classification_error:{},used_variables:[],user_variables:"[]",module_id:"",module_execution_index:0,module_version:"",plan_id:"",optional_flag:!1,max_retries:0,retries_delay:0,explicit_wait:0,implicit_wait:0,error:null,error_message:"",error_code:"",reason:"",start_timestamp:e.timestamp??"",end_timestamp:"",type:"agent_generated",hook:null,hook_type:null,evaluation_context:{},query_variables:{}}}function mt(e,t,n){for(let r of e)r.content_type==="instruction"&&"generative_id"in r&&(r.generative_id=t,r.generative_objective=n)}function B(e,t="",n,r){let o=[],i=0;for(;i<e.length;){let s=e[i],a=s.action_type;if(!r?.keepFailedActions&&s.status==="error"&&a!=="assert"&&a!=="if_else"&&a!=="child_agent_start"&&a!=="child_agent_end"&&!(s.until_condition&&!s.error)){i+=1;continue}if(a==="analyze"&&(!lt[s.action_params?.analyzer_type??""]||s.action_params?.analyzer_type==="textual_visual"&&s.action_params?.code)){i+=1;continue}if(a==="child_agent_start"){let c=s.action_params?.child_id??"",u=s.action_params?.objective??"",l=[];i+=1;let _=1,p="error",d;for(;i<e.length&&_>0;){let E=e[i],x=E.action_type;if(x==="child_agent_start")_+=1;else if(x==="child_agent_end"&&(_-=1,_===0)){p=E.status??"success",d=E,i+=1;break}_>0&&l.push(E),i+=1}let f=B(l,t,n);mt(f,c,u);let g=d?.action_params?.result_code??null,m=d?.action_params?.reason_code??null,h=d?.action_params?.error_message??null,A=d?.action_params?.summary??null,I=d?.action_params?.one_liner??null,b=p==="error";o.push({content_type:"generative_block",instruction_id:`generative_block_${c}`,generative_id:c,objective:u,status:p,children:f,error_message:b?h??null:null,error_code:b?m??null:null,result_code:g??null,bifurcation_context:[],approach_reason:ut(A),one_liner:I??null});continue}else if(a==="child_agent_end"){i+=1;continue}else if(a==="if_else"){i+=1;let c=[];for(;i<e.length&&e[i].action_type==="child_agent_start";){let u=e[i],l=u.action_params?.child_id??"",_=u.action_params?.objective??"",p=[];i+=1;let d=1,f="error";for(;i<e.length&&d>0;){let m=e[i];if(m.action_type==="child_agent_start")d+=1;else if(m.action_type==="child_agent_end"&&(d-=1,d===0)){f=m.status??"success",i+=1;break}d>0&&p.push(m),i+=1}let g=B(p,t,n);c.push(...g)}o.push(Yt(s,c));continue}else if(a==="query_tool"){i+=1;continue}else if(s.until_condition){let c=st(s,t,n),u=at(s,c),l=typeof s.until_condition_met=="boolean"?s.until_condition_met:s.status==="success";o.push({content_type:"until_block",instruction_id:`until_${v().slice(0,8)}`,condition:s.until_condition,max_retries:s.until_max_retries??10,settle_ms:s.until_settle_ms??500,current_count:0,condition_met:l,children:[u],generative_id:"",generative_objective:"",variables_used:{},status:s.status??"success"})}else{let c=st(s,t,n),u=at(s,c);o.push(u)}i+=1}return o}function P(e,t="",n,r){let o=[],i=[],s=r?.passthrough,a=s?D(s.authoredInstructions):null;for(let d of e){if(s&&a&&d.flatIndex!==void 0&&s.replayOnlyFlatIndices.has(d.flatIndex)){let b=U(d.records,a);if(b){for(let E of b)o.push(E),i.push(d.flatIndex);continue}console.warn(`[migrator] replay-only passthrough: no authored operation matched step ${d.flatIndex} (action_id \u2260 any operation_id in the authored blob) \u2014 falling back to this run's records`)}let f=B(d.records,t,n,r);if(f.length===0)continue;let g=v().replace(/-/g,"");mt(f,g,d.objective);let m=f.some(b=>"status"in b&&typeof b.status=="string"?b.status==="error"||b.status==="failed":!1),h=d.resultCode?parseInt(d.resultCode,10):null,A=h!==null&&!isNaN(h)&&h>=200,I=m||A?"error":"success";o.push({content_type:"generative_block",instruction_id:`generative_block_${g}`,generative_id:g,objective:d.objective,status:I,children:f,error_message:I==="error"?d.errorMessage??null:null,error_code:I==="error"?d.reasonCode??null:null,result_code:d.resultCode??null,bifurcation_context:[],approach_reason:ut(d.summary),one_liner:d.oneLiner??null}),i.push(d.flatIndex)}let c=o.map((d,f)=>({block:d,flat:i[f]})),u=r?.moduleSpans??[],l=r?.blockSpans??[],_=r?.authoredBlocks??[];u.length>0&&(c=ht(c,u,l,_));let p=Et(l,u);return p.length>0&&(c=z(c,p,_)),{instructions:c.map(d=>d.block)}}function ht(e,t,n,r){let o=[],i=a=>a===void 0?void 0:t.find(c=>a>=c.flatFrom&&a<=c.flatTo),s=0;for(;s<e.length;){let a=i(e[s].flat);if(!a){o.push(e[s]),s++;continue}let c=[];for(;s<e.length&&i(e[s].flat)===a;)c.push(e[s++]);let u=ht(c,a.children,n,r),l=Et(yt(n,a),a.children);l.length>0&&(u=z(u,l,r)),o.push({block:oe(a,u.map(_=>_.block)),flat:c[0].flat})}return o}function bt(e,t){return e.flatFrom>=t.flatFrom&&e.flatTo<=t.flatTo}function yt(e,t){let n=[];for(let r of e)bt(r,t)?n.push(r):n.push(...yt(r.children,t));return n}function Et(e,t){let n=[],r=i=>{for(let s of i)n.push(s),r(s.children)};r(t);let o=i=>i.filter(s=>!n.some(a=>bt(s,a))).map(s=>({...s,children:o(s.children)}));return n.length>0?o(e):e}function z(e,t,n){let r=[...t].sort((u,l)=>u.flatFrom-l.flatFrom),o=[],i=(u,l)=>{o.push({block:ne(u,l,n),flat:u.flatFrom})},s=(u,l)=>u!==void 0&&u>=l.flatFrom&&u<=l.flatTo,a=0,c=0;for(;c<e.length;){let u=e[c].flat;for(;a<r.length&&u!==void 0&&r[a].flatTo<u;)i(r[a++],[]);let l=a<r.length&&s(u,r[a])?r[a]:void 0;if(!l){o.push(e[c]),c++;continue}let _=[];for(;c<e.length&&s(e[c].flat,l);)_.push(e[c++]);i(l,_),a++}for(;a<r.length;)i(r[a++],[]);return o}function Zt(e){let t=new Map;for(let n of e)t.set(n.flat,n);return e.filter(n=>t.get(n.flat)===n)}var Qt=["children","instructions","branches","module_content","true_branch","false_branch"];function te(e,t){if(!t)return;let n=[...e];for(;n.length>0;){let r=n.pop();if(!r||typeof r!="object")continue;let o=r;if(o.instruction_id===t&&(o.content_type==="conditional_block"||o.content_type==="until_block"))return o;for(let i of Qt){let s=o[i];Array.isArray(s)?n.push(...s):s&&typeof s=="object"&&n.push(s)}}}function ee(e,t,n){if(!e)return[];if(t==="while")return Array.isArray(e.children)?e.children:[];let o=(Array.isArray(e.branches)?e.branches:[])[n];return o&&Array.isArray(o.children)?o.children:[]}function ne(e,t,n){let r=te(n,e.blockId),o=e.branches.map((i,s)=>{let a=t.filter(l=>l.flat!==void 0&&l.flat>=i.flatFrom&&l.flat<=i.flatTo);e.kind==="while"&&(a=Zt(a));let c=z(a,e.children,n).map(l=>l.block);if(c.length>0)return c;let u=ee(r,e.kind,s);return u.length===0&&!i.taken&&console.warn(`[migrator] control-flow: branch ${s} of block ${e.blockId||e.instruction} did not run and no authored block matched \u2014 emitted empty`),u});return e.kind==="if"?re(e,o,r):ie(e,o[0]??[],r)}function re(e,t,n){let r=Array.isArray(n?.branches)?n.branches:[],o=V(t.flat()),i=e.branches.map((s,a)=>{let c=r[a];return{branch_index:a,condition:s.branch_type==="else"?null:s.condition,branch_type:s.branch_type,passed:s.taken,sub_objective:null,custom_event:c?.custom_event??null,children:t[a],sub_checks:Array.isArray(c?.sub_checks)?c.sub_checks:[],composite_operator:c?.composite_operator??"and"}});return{content_type:"conditional_block",instruction_id:e.blockId||`if_else_${v().slice(0,8)}`,instruction:e.instruction,instruction_class:"driver_action",command:"",status:o?"error":"success",resolved_branch_index:e.branches.findIndex(s=>s.taken),branches:i,generative_id:"",generative_objective:"",variables_used:{},classification_layer_resp:[],classification_error:{},used_variables:[],user_variables:"[]",module_id:"",module_execution_index:0,module_version:"",plan_id:"",optional_flag:!1,max_retries:0,retries_delay:0,explicit_wait:0,implicit_wait:0,error:null,error_message:o?.message??"",error_code:o?.code??"",reason:"",start_timestamp:"",end_timestamp:"",type:"agent_generated",hook:null,hook_type:null,evaluation_context:{},query_variables:{}}}function ie(e,t,n){let r=e.whileCfg??{max_retries:5,settle_ms:500,on_exhaust:"fail",iterations:0,condition_met:!1},o=V(t),i=(s,a)=>n&&n[s]!==void 0?n[s]:a;return{content_type:"until_block",instruction_id:e.blockId||`until_${v().slice(0,8)}`,condition:e.instruction,max_retries:r.max_retries,settle_ms:r.settle_ms,current_count:r.iterations,condition_met:r.condition_met,children:t,generative_id:"",generative_objective:"",variables_used:{},status:o?"error":"success",on_exhaust:i("on_exhaust",r.on_exhaust),mode:i("mode",""),check:i("check",""),conditions:i("conditions",[]),connectors:i("connectors",[]),sub_checks:i("sub_checks",[]),composite_operator:i("composite_operator","and")}}function V(e){for(let t of e){let n="status"in t&&typeof t.status=="string"?t.status:"";if(n==="error"||n==="failed"){let r="error_message"in t?t.error_message:void 0,o="error_code"in t?t.error_code:void 0;return{message:r??null,code:o??null}}}return null}function oe(e,t){let n=e.meta,r=(u,l="")=>typeof n[u]=="string"?n[u]:l,o=(u,l=!1)=>typeof n[u]=="boolean"?n[u]:l,i=u=>Array.isArray(n[u])?n[u]:[],s=typeof n.module_version=="number"||typeof n.module_version=="string"?n.module_version:null,a=r("module_id"),c=V(t);return{content_type:Q,instruction_id:`module_block_${a}`,module_id:a,module_version:s,module_instance_id:v(),module_name:r("module_name"),module_description:r("module_description"),module_platform:r("module_platform"),creation_mode:r("creation_mode","Agent"),tms_status:r("tms_status","active"),is_validated:o("is_validated"),is_dirty:e.dirty,enrichment_id:r("enrichment_id"),tags:i("tags"),project_ids:i("project_ids"),link_to_all:o("link_to_all"),status:c?"error":"success",children:t,error_message:c?.message??null,error_code:c?.code??null,update_available:!1,update_info:{}}}function At(e,t){let n;try{n=It(e)}catch{return 0}let r=0,o=n.filter(i=>/^\d+$/.test(i)).sort((i,s)=>Number(i)-Number(s));for(let i of o){let s=S(e,i),a=S(s,"logs");if(!se(a))continue;let c;try{c=It(a)}catch{continue}let u=c.filter(p=>p.endsWith("-actions.ndjson")).sort((p,d)=>(parseInt(p,10)||0)-(parseInt(d,10)||0)),l=[];for(let p of u){let d=t.readActions(S(a,p));d.length&&l.push({objective:t.objective??"",records:d})}if(l.length===0)continue;let{instructions:_}=P(l,t.screenshotBaseUrl??"",t.extMap,{keepFailedActions:!0});if(_.length!==0)try{let p=S(s,"auteur");ae(p,{recursive:!0}),ce(S(p,"execution.json"),JSON.stringify(t.buildBlob(_),null,2)),r++,t.log?.("info","EVIDENCE_ARCHIVED_ATTEMPT_BLOB","Derived nested attempt blob",{attempt:i,instructions:_.length})}catch(p){t.log?.("debug","EVIDENCE_ARCHIVED_ATTEMPT_BLOB_FAILED","Nested attempt blob derivation failed",{attempt:i,error:p instanceof Error?p.message:String(p)})}}return r}import{existsSync as ue,readFileSync as le}from"fs";function vt(e){try{return ue(e)?JSON.parse(le(e,"utf-8")):void 0}catch{return}}function $(e,t){if(!e||typeof e!="object")return;let n=e,r=n.project_token;if(typeof r!="string"||!r)return;let o={project_token:r},i=n[t];typeof i=="string"&&i&&(o.project_name=i);let s=n.project_id;return typeof s=="string"&&s&&(o.project_id=s),o}function q(e){if(Array.isArray(e)){for(let r of e){let o=q(r);if(o)return o}return}if(!e||typeof e!="object")return;let t=e,n=t.smartui_results;if(n&&typeof n=="object"){let r=$(n.project,"name");if(r)return r}for(let r of Object.values(t)){let o=q(r);if(o)return o}}function kt(e){for(let t of e.runMetaPaths){let n=vt(t),r=$(n?.smartui,"project_name");if(r)return r}if(e.authoredBlobPath){let t=vt(e.authoredBlobPath),n=$(t?.smartui,"project_name");if(n)return n}return q(e.instructions)??{}}var Rt=Ot(Nt(),1);import{createWriteStream as de}from"fs";import{readFile as _e}from"fs/promises";import{join as pe,basename as fe}from"path";import{tmpdir as ge}from"os";var me=["**/screenshots/**","**/annotated/**","**/tcg/**","**/bifurcation/**"];async function Pt(e){let t=pe(ge(),`${fe(e)}_artifacts.zip`);return new Promise((n,r)=>{let o=de(t),i=(0,Rt.default)("zip",{zlib:{level:6}});o.on("close",()=>n(t)),i.on("error",r),i.pipe(o),i.glob("**/*",{cwd:e,ignore:me}),i.finalize()})}async function St(e){return _e(e)}async function ye(e,t){return xt(Z(e,t))}function Ee(e){return{key:"artifacts",content_type:"application/zip",filename:`${e}.evidence`}}var wt=class{config;controller;testId;constructor(t){this.config=t,this.controller=new W(t.controllerBaseUrl,t.auth),this.testId=t.testId}log(t,n,r,o){this.config.log?.(t,n,r,o)}async execute(){let{onProgress:t}=this.config;try{if(!this.testId)return this.log("error","PIPELINE_ABORT","No test_id available"),{success:!1,testId:null,error:"No test_id available"};let n=this.config.evidence,r=null;if(this.config.shouldUploadArtifacts!==!1){t("convert","running");let a=this.collectNdjsonPerRun(),c=a.reduce((g,m)=>g+m.records.length,0);this.log("info","PIPELINE_CONVERT","Collected NDJSON records",{total_records:c,run_groups:a.length});let u=this.loadReplayOnlyPassthrough(),{instructions:l}=a.length>0?P(a,this.config.screenshotBaseUrl??"",this.config.screenshotExtMap,{moduleSpans:this.config.moduleSpans,...u?{passthrough:u}:{},...this.config.blockSpans?.length?{blockSpans:this.config.blockSpans,authoredBlocks:this.loadAuthoredBlocks()}:{}}):{instructions:[]};this.log("info","PIPELINE_CONVERT_INSTRUCTIONS","Auteur instructions produced",{count:l.length});let _=this.buildExecutionEnvelope(l),p=Buffer.from(JSON.stringify(_));this.log("info","PIPELINE_CONVERT_BLOB","Blob created",{size_kb:+(p.length/1024).toFixed(1)});let d=y(this.config.sessionDir,"execution.json");w(d,JSON.stringify(_,null,2)),this.log("info","PIPELINE_CONVERT_LOCAL_SAVE","Execution blob saved locally",{path:d});let f=n?.packTestDir??this.config.evidenceRead?.packTestDir;if(f){let g=y(f,"auteur");K(g,{recursive:!0}),w(y(g,"execution.json"),JSON.stringify(_,null,2)),this.log("info","PIPELINE_CONVERT_PACK_COPY","Execution blob copied into pack",{path:y(g,"execution.json")}),this.deriveArchivedAttemptBlobs(f)}if(t("convert","done"),n)r=p;else{t("zip","running"),this.log("info","PIPELINE_ZIP_START","Zipping session",{session_dir:this.config.sessionDir});let g=null,m;try{g=await Pt(this.config.sessionDir),m=await St(g),this.log("info","PIPELINE_ZIP_DONE","Zip complete",{size_mb:+(m.length/1024/1024).toFixed(1),path:g}),t("zip","done",`${(m.length/1024/1024).toFixed(1)}MB`)}finally{g&&await be(g).catch(()=>{})}t("presign","running"),this.log("info","PIPELINE_PRESIGN_START","Requesting presigned URLs",{url:`${this.config.controllerBaseUrl}/upload/presign`,test_id:this.testId,session_id:this.config.sessionId});let h=await this.controller.getPresignedUrls(this.testId,this.config.sessionId,[{key:"artifacts",content_type:"application/zip",filename:`${this.config.sessionId}_artifacts.zip`},{key:"blob",content_type:"application/json",filename:`${this.config.commitId}.json`}]);this.log("info","PIPELINE_PRESIGN_OK","Presigned URLs received",{artifacts_url:h.urls.artifacts?.blob_url,blob_url:h.urls.blob?.blob_url}),t("presign","done"),t("upload","running"),this.log("info","PIPELINE_UPLOAD_START","Uploading artifacts and blob",{artifact_size_mb:+(m.length/1024/1024).toFixed(1),blob_size_kb:+(p.length/1024).toFixed(1)}),await Promise.all([k(h.urls.artifacts.upload_url,m,"application/zip"),k(h.urls.blob.upload_url,p,"application/json")]),this.log("info","PIPELINE_UPLOAD_OK","Upload complete"),t("upload","done")}}else{let a=this.collectNdjsonPerRun(),c=this.loadReplayOnlyPassthrough(),{instructions:u}=a.length>0?P(a,this.config.screenshotBaseUrl??"",this.config.screenshotExtMap,{keepFailedActions:!0,moduleSpans:this.config.moduleSpans,...c?{passthrough:c}:{},...this.config.blockSpans?.length?{blockSpans:this.config.blockSpans,authoredBlocks:this.loadAuthoredBlocks()}:{}}):{instructions:[]},l=this.buildExecutionEnvelope(u),_=y(this.config.sessionDir,"execution.json");w(_,JSON.stringify(l,null,2)),this.log("info","PIPELINE_LOCAL_SAVE","Execution blob saved locally (no upload)",{path:_});let p=this.config.evidence?.packTestDir??this.config.evidenceRead?.packTestDir;if(p){let d=y(p,"auteur");K(d,{recursive:!0});let f=this.readAuthoredExecution(),g=f?this.refreshReplayOnlyInPack(f,a,c):null;w(y(d,"execution.json"),g?.raw??JSON.stringify(l,null,2)),this.log("info","PIPELINE_CONVERT_PACK_COPY","Execution blob copied into pack (gated)",{path:y(d,"execution.json"),source:g?g.refreshed.length>0?"authored+replay_results":"authored":"run_envelope",...g&&g.refreshed.length>0?{refreshed_instruction_ids:g.refreshed}:{}}),this.deriveArchivedAttemptBlobs(p)}t("convert","skipped"),t("zip","skipped"),t("presign","skipped"),t("upload","skipped"),this.log("info","PIPELINE_UPLOAD_SKIPPED","Upload steps skipped (gate disabled)")}if(this.config.shouldReplaceLocalOutput&&this.config.onAtomicReplace){t("atomic_replace","running");try{await this.config.onAtomicReplace(),this.log("info","PIPELINE_ATOMIC_REPLACE_OK","Local output replaced"),t("atomic_replace","done")}catch(a){let c=a instanceof Error?a.message:String(a);throw this.log("error","PIPELINE_ATOMIC_REPLACE_FAILED","Atomic-replace failed",{error:c}),t("atomic_replace","failed",c),a}}else t("atomic_replace","skipped");let o,i;if(this.config.shouldCommit&&!this.config.isFirstRun&&this.config.onCommitLock){t("commit_lock","running");let a=await this.config.onCommitLock();if(a.ok)o=a.testcaseId||void 0,this.log("info","PIPELINE_COMMIT_LOCK_OK","Commit lock acquired",{testcase_id:o??"none",trigger:a.trigger??null,test_instance_id:a.testInstanceId??null}),t("commit_lock","done");else return this.log("error","PIPELINE_COMMIT_LOCK_FAILED","Commit lock failed",{reason:a.reason,message:a.message}),t("commit_lock","failed",`${a.reason??"unknown"}: ${a.message??""}`),{success:!1,testId:this.testId,error:`commit-lock failed: ${a.reason??"unknown"}`}}else t("commit_lock","skipped");if(this.config.isFirstRun&&!this.config.skipTmsFinalize){t("finalize","running"),this.log("info","PIPELINE_FINALIZE_START","Finalizing test (first-run)",{test_id:this.testId,commit_id:this.config.commitId});let a=new X(this.config.tmsBaseUrl,this.config.tmsUsername,this.config.tmsAccessKey),c=this.config.runObjectives&&this.config.runObjectives.length>0?this.config.runObjectives:[this.config.firstObjective];if(o=(await a.endTest(this.testId,{commit_id:this.config.commitId,time_taken:Math.round(this.config.totalDuration),steps_count:this.config.totalSteps,commit_message:this.config.firstObjective.slice(0,255),objectives:c})).testcase_id||void 0,this.log("info","PIPELINE_FINALIZE_OK","Test finalized",{testcase_id:o??"none"}),this.config.onFinalizeSuccess)try{await this.config.onFinalizeSuccess(o)}catch(l){this.log("warn","PIPELINE_FINALIZE_META_FAILED","Meta-rewrite after endTest failed",{error:String(l)})}t("finalize","done")}else t("finalize","skipped"),this.log("info","PIPELINE_FINALIZE_SKIPPED","Finalize skipped (evolve flow or first-run disabled)");if(o&&this.config.shareApiBaseUrl)try{i=await this.generateShareLink(o),this.log("info","PIPELINE_SHARE_OK","Share link generated",{share_id:i})}catch(a){this.log("warn","PIPELINE_SHARE_FAILED","Share link failed",{error:String(a)})}if(n&&r){let a=null;t("zip","running");try{await n.sealFn({testcaseId:o,shareId:i}),a=n.sealedPackPath?await xt(n.sealedPackPath):await ye(n.executionId,n.cwd),this.log("info","PIPELINE_EVIDENCE_SEALED","Evidence pack sealed",{execution_id:n.executionId}),this.log("info","PIPELINE_PACK_READ","Sealed pack read",{size_mb:+(a.length/1024/1024).toFixed(1)})}catch(c){let u=c instanceof Error?c.message:String(c);this.log("warn","PIPELINE_EVIDENCE_UPLOAD_SKIPPED","Evidence seal/read failed \u2014 uploading blob only",{execution_id:n.executionId,error:u})}if(a){t("zip","done",`${(a.length/1024/1024).toFixed(1)}MB`),t("presign","running");let c=await this.controller.getPresignedUrls(this.testId,this.config.sessionId,[Ee(n.executionId),{key:"blob",content_type:"application/json",filename:`${this.config.commitId}.json`}]);this.log("info","PIPELINE_PRESIGN_OK","Presigned URLs received",{artifacts_url:c.urls.artifacts?.blob_url,blob_url:c.urls.blob?.blob_url}),t("presign","done"),t("upload","running"),this.log("info","PIPELINE_UPLOAD_START","Uploading pack and blob",{artifact_size_mb:+(a.length/1024/1024).toFixed(1),blob_size_kb:+(r.length/1024).toFixed(1)}),await Promise.all([k(c.urls.artifacts.upload_url,a,"application/zip"),k(c.urls.blob.upload_url,r,"application/json")]),this.log("info","PIPELINE_UPLOAD_OK","Upload complete"),t("upload","done")}else{t("zip","skipped"),t("presign","running");let c=await this.controller.getPresignedUrls(this.testId,this.config.sessionId,[{key:"blob",content_type:"application/json",filename:`${this.config.commitId}.json`}]);t("presign","done"),t("upload","running"),this.log("info","PIPELINE_UPLOAD_START","Uploading blob only (evidence skipped)",{blob_size_kb:+(r.length/1024).toFixed(1)}),await k(c.urls.blob.upload_url,r,"application/json"),this.log("info","PIPELINE_UPLOAD_OK","Blob upload complete (pack skipped)"),t("upload","done")}}let s;if(this.config.codeExport?.enabled&&o){let a=!1;try{await this.triggerCodeExport(o),this.log("info","PIPELINE_CODE_EXPORT_START","Code export triggered"),a=!0}catch(c){let u=c instanceof Error?c.message:String(c);this.log("error","PIPELINE_CODE_EXPORT_FAILED","Code export trigger failed; skipping poll",{error:u}),t("code_export","failed",`trigger failed: ${u}`)}if(a){t("code_export","running","Waiting for code generation\u2026");try{s=await this.pollAndDownloadCode(o,t),this.log("info","PIPELINE_CODE_EXPORT_OK","Code export complete",{dir:s}),t("code_export","done",s)}catch(c){let u=c instanceof Error?c.message:String(c);this.log("error","PIPELINE_CODE_EXPORT_FAILED","Code export failed",{error:u}),t("code_export","failed",u)}}}else t("code_export","skipped");return this.log("info","PIPELINE_COMPLETE","Pipeline complete"),{success:!0,testId:this.testId,testcaseId:o,shareId:i,codeExportDir:s}}catch(n){return{success:!1,testId:this.testId,error:n instanceof Error?n.message:String(n)}}}async runCodeExport(t,n){let r=n??this.config.onProgress,o=!1;try{await this.triggerCodeExport(t),this.log("info","PIPELINE_CODE_EXPORT_TRIGGER","Code export triggered",{testcase_id:t}),o=!0}catch(i){let s=i instanceof Error?i.message:String(i);this.log("error","PIPELINE_CODE_EXPORT_TRIGGER_FAILED","Code export trigger failed; skipping poll",{error:s}),r("code_export","failed",`trigger failed: ${s}`)}if(o){r("code_export","running","Waiting for code generation\u2026");try{let i=await this.pollAndDownloadCode(t,r);return this.log("info","PIPELINE_CODE_EXPORT_OK","Code export complete",{dir:i}),r("code_export","done",i),i}catch(i){let s=i instanceof Error?i.message:String(i);this.log("error","PIPELINE_CODE_EXPORT_FAILED","Code export failed",{error:s}),r("code_export","failed",s);return}}}deriveArchivedAttemptBlobs(t){try{let n=At(t,{readActions:r=>this.readNdjsonFromFile(r),buildBlob:r=>this.buildExecutionEnvelope(r),objective:this.config.firstObjective,screenshotBaseUrl:this.config.screenshotBaseUrl??"",extMap:this.config.screenshotExtMap,log:(r,o,i,s)=>this.log(r,o,i,s)});n>0&&this.log("info","PIPELINE_ARCHIVED_ATTEMPTS","Nested retry-attempt blobs derived",{count:n})}catch(n){this.log("debug","PIPELINE_ARCHIVED_ATTEMPTS_FAILED","Nested attempt blob pass failed",{error:n instanceof Error?n.message:String(n)})}}collectNdjsonPerRun(){let t=[],n=this.config.runObjectives??[],r=this.config.runMetadata??[],o=this.config.evidence??this.config.evidenceRead;for(let i=0;i<this.config.runDirs.length;i++){let s=this.config.runDirs[i],a=n[i]||this.config.firstObjective,c=r[i],u=o?this.readNdjsonFromFile(y(o.packTestDir,"logs",`${o.runIndices?.[i]??i}-actions.ndjson`)):this.readNdjsonFromDir(s);if(u.length>0){let l=o?.runIndices?.[i]??i,_=this.config.runFlatIndex?.[l];t.push({objective:a,records:u,..._!==void 0?{flatIndex:_}:{},resultCode:c?.resultCode,reasonCode:c?.reasonCode,errorMessage:c?.errorMessage,summary:c?.summary,oneLiner:c?.oneLiner})}}if(t.length===0){let i=y(this.config.sessionDir,"runs");if(G(i))try{let a=he(i,{withFileTypes:!0}).filter(c=>c.isDirectory()).map(c=>c.name).sort();for(let c of a){let u=y(i,c),l=this.readNdjsonFromDir(u);l.length>0&&t.push({objective:this.config.firstObjective,records:l})}}catch{}}return t}readNdjsonFromDir(t){let n=[y(t,"run-test","actions.ndjson"),y(t,"actions.ndjson")];for(let r of n)if(G(r))return this.readNdjsonFromFile(r);return[]}readNdjsonFromFile(t){let n=[];if(!G(t))return n;this.log("debug","PIPELINE_COLLECT_READ","Reading NDJSON file",{path:t});let r=j(t,"utf-8");for(let o of r.split(`
|
|
5
|
-
`)){let i=o.trim();if(i)try{n.push(JSON.parse(i))}catch{}}return n}async generateShareLink(t){let n=`${this.config.shareApiBaseUrl}/lshs/api/v1.0/share-item/generate-sharable-link`;this.log("info","PIPELINE_SHARE_START","Requesting share link",{url:n,testcase_id:t});let r={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({entityIds:[t],entityType:"Test Case Details",expiresAt:7})},o=!!this.config.authResolver;this.log("debug","PIPELINE_SHARE_AUTH","Share link auth config",{resolver:o,fallback_auth_type:typeof this.config.auth=="string"?"bearer":"basic",tms_user:this.config.tmsUsername});let i=o?await this.config.authResolver.fetch(n,r):await R(n,{...r,headers:{...r.headers,Authorization:this.buildAuthHeader()}});if(!i.ok)throw new Error(`Share link API failed: ${i.status} ${await i.text()}`);let s=await i.json();if(!s.shareId)throw new Error("Share link API returned no shareId");return s.shareId}async triggerCodeExport(t){if(!this.config.codeExport)throw new Error("triggerCodeExport called without resolved codeExport config");let{url:n,body:r}=
|
|
4
|
+
`).map(t=>t.trim()).filter(Boolean):e.split(". ").map(t=>t.trim()).filter(Boolean).map(t=>t.endsWith(".")?t:t+"."):[]}function F(e){return typeof e=="string"&&e.includes("{{secrets.")}var zt={click:"CLICK",double_click:"CLICK",type:"TYPE",fill:"TYPE",clear:"CLEAR",select:"SELECT",hover:"HOVER",drag:"DRAG_DROP",upload_files:"UPLOAD_FILE",navigate:"OPEN",go_back:"NAVIGATE",go_forward:"NAVIGATE",refresh:"REFRESH",press_key:"SENDKEYS",scroll:"SCROLL_PIXELS",scroll_into_view:"SCROLL_UNTIL_ELEMENT",wait:"WAIT",wait_until:"WAIT_UNTIL",wait_for_load:"WAIT_FOR_LOAD",switch_tab:"SWITCH_TAB",new_tab:"NEW_TAB",close_tab:"CLOSE_TAB",api:"API",evaluate_js:"EVALUATE_JS",vision_query:"VISION_QUERY",textual_query:"TEXTUAL_QUERY",get_url:"GET_URL",get_title:"GET_TITLE",assert:"ASSERTION",math:"MATHEMATICAL_OPERATION",set_cookies:"SET_COOKIES",delete_cookies:"DELETE_COOKIES",clear_cookies:"CLEAR_COOKIES",set_local_storage:"SET_LOCAL_STORAGE",delete_local_storage:"DELETE_LOCAL_STORAGE",clear_local_storage:"CLEAR_LOCAL_STORAGE",set_clipboard:"SET_CLIPBOARD",paste_clipboard:"PASTE_CLIPBOARD",clear_clipboard:"CLEAR_CLIPBOARD",device_control:"DEVICE_CONTROL",device_control_query:"DEVICE_CONTROL_QUERY"},dt={literal:"SET_VARIABLE",condition:"SET_VARIABLE",visual:"VISION_QUERY",dom:"TEXTUAL_QUERY",url:"GET_URL",title:"GET_TITLE",devtool_network:"DEVTOOLS_NETWORK_QUERY",devtool_console:"DEVTOOLS_CONSOLE_QUERY",devtool_cookies:"DEVTOOLS_COOKIES_QUERY",devtool_storage:"DEVTOOLS_STORAGE_QUERY",devtool_performance:"DEVTOOLS_PERFORMANCE",api_response:"API_CALLS_QUERY",textual_visual:"TEXTUAL_ANALYZER"},Vt=new Set(["CLICK","TYPE","FILL","HOVER","SCROLL_UNTIL_ELEMENT","UPLOAD_FILE","VISION_QUERY","DRAG_DROP","SELECT"]);function _t(e,t){if(e==="analyze"){let r=t?.action_params?.analyzer_type??"";return dt[r]}if(e==="scroll"&&t?.action_params?.into_view===!0)return"SCROLL_UNTIL_ELEMENT";let n=zt[e];return n||console.warn(`[migrator] UNKNOWN action_type "${e}" \u2014 falling back to "${e.toUpperCase()}"; explicit mapping required`),n??e.toUpperCase()}function pt(e,t){if(!e||!t)return"";try{let n=new Date(e);return isNaN(n.getTime())?"":new Date(n.getTime()+t).toISOString()}catch{return""}}function ft(e){try{return JSON.parse(e.output_value??"{}")}catch{return{}}}function $t(e){let t=e.output_variable??"";if(!t)return"[]";let r={...ft(e)};return delete r.body,JSON.stringify([{name:t,unique_key:(e.action_id??"").replace(/-/g,"").slice(0,8)||v().replace(/-/g,"").slice(0,8),value:r,variable_description:"API Response"}])}function qt(e,t,n){let r=e.action_params??{},o=Vt.has(t)?"Vision Agent":"Operation Agent",i={operation_type:t};t==="OPEN"&&(i.url=r.url??""),t==="SET_VARIABLE"&&(i.variable_name=e.output_variable??r.key??"",i.variable_value=e.output_value??"");let s=t==="UPLOAD_FILE"?N(r):null;s&&(i.value=O(s.name));let a={},c={},u=e.action_instruction??"",l=r.text??"",_=r.url??"",p=[["intent",u],["value",l],["url",_]];for(let[h,A]of Object.entries(n)){let I=String(A);if(h.startsWith("secrets."))for(let[b,E]of p)E.includes(I)&&(c[b]=h);for(let[b,E]of p)E.includes(I)&&!(b in a)&&(a[b]=E)}s?.alias&&(a.value=`{{${M(s.alias)}}}`);let d=e.action_type,f={operation:e.action_instruction??"",agent:o,operation_dict:i,reasoning:d==="analyze"?r.query??"":e.intent??e.action_instruction??"",variable:a,secrets:c,params:{}};d==="analyze"&&typeof r.code=="string"&&r.code&&(f.code=r.code),d==="analyze"&&typeof r.code_js=="string"&&r.code_js&&(f.code_js=r.code_js),d==="analyze"&&typeof r.condition_expression=="string"&&r.condition_expression&&(f.condition_expression=r.condition_expression),r.uses_websocket===!0&&(f.uses_websocket=!0),r.uses_sse===!0&&(f.uses_sse=!0),d==="analyze"&&r.analyzer_type==="textual_visual"&&(typeof r.wrapped_js=="string"&&(f.wrapped_js=r.wrapped_js),Array.isArray(r.locators)&&(f.locators=r.locators),typeof r.operator=="string"&&(f.operator=r.operator),Array.isArray(r.transforms)&&(f.transforms=r.transforms),typeof r.query=="string"&&(f.query=r.query),typeof r.expected_value=="string"&&(f.expected_value=r.expected_value),typeof r.needs_unit_conversion=="boolean"&&(f.needs_unit_conversion=r.needs_unit_conversion),typeof r.condition=="string"&&(f.condition=r.condition));let m={set_cookies:"cookies",set_clipboard:"text",delete_cookies:"names",set_local_storage:"items",delete_local_storage:"keys"}[d];return m&&r[m]!==void 0&&(f[m]=r[m]),d==="set_clipboard"&&typeof r.html=="string"&&r.html&&(f.html=r.html),f}function L(e){let t=e.assertion_tree;return t&&typeof t=="object"&&Object.keys(t).length>0?t:Array.isArray(e.sub_results)?e:{}}function Gt(e){let t=L(e);if(typeof t.passed=="boolean")return t.passed;let n=t.sub_results??[];return n.length===0?t.status==="passed":(t.composite_operator??"and")==="or"?n.some(o=>o.passed===!0):n.every(o=>o.passed===!0)}function gt(e){return e.map(t=>({description:t.description??"",store_key:t.store_key??"",expected_value:t.expected??"",extracted_value:t.extracted_value??"",operator:t.operator??"equals",transforms:t.transforms??[]}))}function Kt(e){let t=L(e),n=t.sub_results??[],r=gt(n);return{operator:[],assertion_operands:[],left_operand:null,right_operand:null,operands:[],sub_results:n,sub_checks:r,composite_operator:t.composite_operator??"and",verification:t.verification??"",claim:t.description??""}}function Ht(e){let t=e.action_params??{},n=L(t),r=n.sub_results??[],o=gt(r);return[{operation:e.action_instruction??"",agent:"Operation Agent",operation_dict:{operation_type:"ASSERTION",assertion_tree:{sub_results:r,sub_checks:o,composite_operator:n.composite_operator??"and",verification:"",claim:n.description??e.action_instruction??"",operator:[],assertion_operands:[],left_operand:null,right_operand:null,operands:[]}},variable:{},secrets:{},params:{}}]}function Jt(e,t,n,r){let o=e.visual_data;if(!o||o.x==null||o.y==null)return null;let i=t?`${t}/test_screenshots`:"";return{x:o.x,y:o.y,confidence:0,bbox:o.bbox??null,bbox_source:o.bbox?"accessibility_tree":"fallback",viewport_width:o.viewport_width??1280,viewport_height:o.viewport_height??800,scale_factor:null,raw_image_url:i?`${i}/untagged_screenshot/${n}.${r?.get(n)??"png"}`:"",raw_image_sas_url:"",annotated_image_url:"",annotated_image_sas_url:""}}function Yt(e){if(!e)return"";let t=e;return typeof e=="object"&&!Array.isArray(e)&&Array.isArray(e.frameInfo)&&(t=e.frameInfo),!Array.isArray(t)||t.length===0?"":JSON.stringify(t)}function Wt(e){return/^(android|ios)_native$/i.test(e.platform??"")}function mt(e,t){return e.map(n=>({...n,type:t?n.strategy??n.type??"native":n.isXPath?"xpath":"css"}))}function Xt(e,t,n){let r={selector_target:"",drag_displacement:{},hold_duration_ms:null,move_duration_ms:null,hold_at_destination_ms:null};if(e!=="drag")return r;let o=t.target_selectors,i={};typeof t.direction=="string"&&t.direction&&(i.direction=t.direction,typeof t.fraction=="number"&&(i.fraction=t.fraction));let s=a=>typeof t[a]=="number"?Math.trunc(t[a]):null;return{selector_target:Array.isArray(o)&&o.length>0?mt(o,n):"",drag_displacement:i,hold_duration_ms:s("hold_duration_ms"),move_duration_ms:s("move_duration_ms"),hold_at_destination_ms:s("hold_at_destination_ms")}}function at(e,t="",n){let r=e.action_type,o=_t(r,e),i=e.action_params??{},s=e.coordinates??null,a=e.selectors??null,c=!!(a&&a.length>0),u=Wt(e),l=Xt(r,i,u),_=e.timestamp??"",p=e.duration_ms??0,d=e.variables_used??{},f=e.action_id??v(),g=v(),m=pt(_,p),h="",A="";if(r==="navigate")A=i.url??"",h=A;else if(r==="type"||r==="fill")h=i.text??"";else if(r==="press_key")h=i.key??"";else if(r==="wait")h=String(i.ms??i.timeout_ms??"");else if(r==="evaluate_js")h=i.script??"";else if(r==="upload_files"){let H=N(i);H&&(h=O(H.name))}else r==="analyze"&&o==="SET_VARIABLE"&&(h=e.output_value??"");let I="";r==="go_back"?I="back":r==="go_forward"&&(I="forward");let b=e.action_instruction??"",E=F(h)||F(A)||F(b),x=qt(e,o,d);return{operation_id:f,instruction_id:g,instruction:b,intent:b,operation_start:_,operation_end:m,status:e.status??"",command:o,name:"",target:"",value:h,message:"",operation_dict:"",frame:Yt(e.frame_info),surface:typeof i.surface=="string"?i.surface:"",frame_path:typeof i.frame_path=="string"?i.frame_path:"",grounded_by:typeof i.grounded_by=="string"?i.grounded_by:"",error_message:e.error??"",code_snippet:"",sub_instruction_obj:JSON.stringify(x),test_id:"",test_version:"",action:"",string_to_float:!1,feedback_msg:"",time_taken:"",create_time_stamp:"",update_time_stamp:"",locator_variable:"",locator_variable_name:"",image_url:t?`${t}/test_screenshots/untagged_screenshot/${f}.${n?.get(f)??"png"}`:"",alternative_xpaths:[],attribute:"",value_description:"",url:A,navigation_direction:I,tagified_image_url:"",query_variable_name:e.output_variable??"",query_variable_value:e.output_value??"",query_variable_type:"",expected_value:"",queried_value:"",operator:"",assertion_status:o==="ASSERTION"?Gt(i):"",query_info_dict:{},query_content_confidence:"none",debugging_logs:[],locator_index:0,query_html:"",user_variables:"[]",optional_flag:!1,max_retries:0,retries_delay:0,explicit_wait:0,implicit_wait:0,tab_index:String(i.tab_index??""),tab_identifier:String(i.tab_identifier??""),scroll_value:i.amount??1,scroll_direction:i.direction??"",mi_scroll_payload:{},sleep_duration:0,app_id:"",manual_interaction_tag:"",string_to_float_list:[],js_snippet:r==="evaluate_js"?i.script??"":"",code_error:"",hide:E,dismiss_dialog:!1,use_v2_mobile_tagging:u,multiple_inputs:!1,dialog_action:"",dialog_type:"",is_coordinates_used_for_interaction:s!==null&&!c,element_coordinates_ratio:[],element_bounds_ratio:[],x_coord:c?null:s?.x??null,y_coord:c?null:s?.y??null,target_x_coord:i.target_x??null,target_y_coord:i.target_y??null,source_description:i.source_description??null,target_description:i.target_description??null,use_coordinates:s!==null&&!c,kaneaiMobileTaggingImageLimit:1,clicks_order_code:"se_js_ac",selector:c?mt(a,u):"",selector_target:l.selector_target,math_result_variable_name:"",math_result_variable_value:"",expression_tree:o==="ASSERTION"?Kt(i):i.expression_tree??{},assertion_tree:o==="ASSERTION"?L(i):i.assertion_tree??{},assertion_tree_simplified:{},network_throttle:{},is_mobile_offline:!1,autoheal:!1,reprobe:e.reprobe??!1,click_modifier:(i.click_count??1)>=2?{kind:"multi_click",frequency:i.click_count}:null,db_query:"",db_details:{},db_query_decoded:"",is_global_variable:!1,is_global_variable_persist:!1,global_variable_id:"",wait_for_element_timeout:0,failure_condition:o==="ASSERTION"?"Fail test immediately":"",screenshot_command:"",smartui_contents:{},smartui_results:{},result_type:"",result_hint:"",drag_offset:{},drag_displacement:l.drag_displacement,hold_duration_ms:l.hold_duration_ms,move_duration_ms:l.move_duration_ms,hold_at_destination_ms:l.hold_at_destination_ms,start_coordinates:i.source_coordinates?{x:i.source_coordinates[0],y:i.source_coordinates[1]}:{},end_coordinates:i.target_coordinates?{x:i.target_coordinates[0],y:i.target_coordinates[1]}:{},element_rect:null,is_canvas:!1,until_condition:"",until_max_retries:0,until_settle_ms:0,api_data:r==="api"?{request:e.action_params?.api_data?.request??{}}:{},output_variables:r==="api"?e.output_variable?{[e.output_variable]:null}:{}:e.output_variable?{[e.output_variable]:e.output_value??""}:{},visual_context:Jt(e,t,f,n),reasoning:r==="analyze"?i.query??"":e.intent??e.action_instruction??""}}function ct(e,t){let n=e.action_type,r=_t(n,e),o=e.timestamp??"",i=e.duration_ms??0,s=pt(o,i),a=r==="ASSERTION"||r==="MATHEMATICAL_OPERATION";return{instruction_id:t.instruction_id,instruction_class:a?"non_driver_action":"driver_action",module_id:"",instruction:e.action_instruction??"",command:r,error:null,parent_instruction_id:"",classification_layer_resp:r==="ASSERTION"?Ht(e):[],classification_error:{},operations:[t],status:e.status??"",start_timestamp:o,end_timestamp:s,type:"agent_generated",tags:[],html_paths:[],optional_flag:!1,max_retries:0,retries_delay:0,explicit_wait:0,implicit_wait:0,content_type:n==="api"?"api":n==="analyze"&&e.action_params?.analyzer_type==="api_response"?"api_calls_query":n==="analyze"&&e.action_params?.analyzer_type?.startsWith("devtool_")?e.action_params.analyzer_type.replace("devtool_","devtools_"):"instruction",js_snippet:n==="evaluate_js"?e.action_params?.script??"":"",user_variables:n==="api"?$t(e):"[]",api_data:n==="api"?{request:e.action_params?.api_data?.request??{},response:ft(e)}:{},params_used:!1,hard_assertion:r==="ASSERTION"?e.action_params?.failure_condition==="hard":!1,expected_outcome:"",module_execution_index:0,module_version:null,network_throttle:{},isEdited:!1,use_query_assertion_v2:!1,db_query:"",db_details:{},network_assertion_content:{},screenshot_command:"",smartui_contents:{},generative_id:"",plan_id:"",generative_objective:"",error_message:"",error_code:"",reason:"",title:"",used_variables:[],reasoning:n==="analyze"?e.action_params?.query??"":e.intent??e.action_instruction??""}}function Zt(e,t=[]){let n=e.action_params??{},r=n.branches??[],o=n.winning_index??-1,i=n.sub_results??[],s={};for(let c of i){let u=c.sub_results;if(u)for(let l of u){let _=l.store_key;_&&(s[_]=l)}}let a=r.map((c,u)=>{let l=u===o,_=(c.sub_checks??[]).map(p=>{let d=s[p.store_key];return{description:p.description,store_key:p.store_key,expected_value:p.expected_value,stored_value:d?.extracted_value??p.stored_value,operator:p.operator??d?.operator??"equals",transforms:p.transforms??d?.transforms??[]}});if(_.length===0&&c.condition&&i.length>0){let d=i.find(f=>f.branch_index===u)?.sub_results??[];d.length>0&&(_=d.map(f=>({description:f.description??c.condition,store_key:f.store_key??"",expected_value:f.expected??"true",stored_value:f.extracted_value??void 0,operator:f.operator??"equals",transforms:f.transforms??[]})))}return{branch_index:u,condition:c.condition??null,branch_type:c.branch_type??"sub_objective",passed:l,sub_objective:null,custom_event:c.custom_event??null,children:l?t:[],sub_checks:c.condition?_:[],composite_operator:c.composite_operator??"and"}});return{content_type:"conditional_block",instruction_id:`if_else_${v().slice(0,8)}`,instruction:e.action_instruction??"",instruction_class:"driver_action",command:"",status:e.status??"success",resolved_branch_index:o,branches:a,generative_id:"",generative_objective:"",variables_used:{},classification_layer_resp:[],classification_error:{},used_variables:[],user_variables:"[]",module_id:"",module_execution_index:0,module_version:"",plan_id:"",optional_flag:!1,max_retries:0,retries_delay:0,explicit_wait:0,implicit_wait:0,error:null,error_message:"",error_code:"",reason:"",start_timestamp:e.timestamp??"",end_timestamp:"",type:"agent_generated",hook:null,hook_type:null,evaluation_context:{},query_variables:{}}}function ht(e,t,n){for(let r of e)r.content_type==="instruction"&&"generative_id"in r&&(r.generative_id=t,r.generative_objective=n)}function B(e,t="",n,r){let o=[],i=0;for(;i<e.length;){let s=e[i],a=s.action_type;if(!r?.keepFailedActions&&s.status==="error"&&a!=="assert"&&a!=="if_else"&&a!=="child_agent_start"&&a!=="child_agent_end"&&!(s.until_condition&&!s.error)){i+=1;continue}if(a==="analyze"&&(!dt[s.action_params?.analyzer_type??""]||s.action_params?.analyzer_type==="textual_visual"&&s.action_params?.code)){i+=1;continue}if(a==="child_agent_start"){let c=s.action_params?.child_id??"",u=s.action_params?.objective??"",l=[];i+=1;let _=1,p="error",d;for(;i<e.length&&_>0;){let E=e[i],x=E.action_type;if(x==="child_agent_start")_+=1;else if(x==="child_agent_end"&&(_-=1,_===0)){p=E.status??"success",d=E,i+=1;break}_>0&&l.push(E),i+=1}let f=B(l,t,n);ht(f,c,u);let g=d?.action_params?.result_code??null,m=d?.action_params?.reason_code??null,h=d?.action_params?.error_message??null,A=d?.action_params?.summary??null,I=d?.action_params?.one_liner??null,b=p==="error";o.push({content_type:"generative_block",instruction_id:`generative_block_${c}`,generative_id:c,objective:u,status:p,children:f,error_message:b?h??null:null,error_code:b?m??null:null,result_code:g??null,bifurcation_context:[],approach_reason:lt(A),one_liner:I??null});continue}else if(a==="child_agent_end"){i+=1;continue}else if(a==="if_else"){i+=1;let c=[];for(;i<e.length&&e[i].action_type==="child_agent_start";){let u=e[i],l=u.action_params?.child_id??"",_=u.action_params?.objective??"",p=[];i+=1;let d=1,f="error";for(;i<e.length&&d>0;){let m=e[i];if(m.action_type==="child_agent_start")d+=1;else if(m.action_type==="child_agent_end"&&(d-=1,d===0)){f=m.status??"success",i+=1;break}d>0&&p.push(m),i+=1}let g=B(p,t,n);c.push(...g)}o.push(Zt(s,c));continue}else if(a==="query_tool"){i+=1;continue}else if(s.until_condition){let c=at(s,t,n),u=ct(s,c),l=typeof s.until_condition_met=="boolean"?s.until_condition_met:s.status==="success";o.push({content_type:"until_block",instruction_id:`until_${v().slice(0,8)}`,condition:s.until_condition,max_retries:s.until_max_retries??10,settle_ms:s.until_settle_ms??500,current_count:0,condition_met:l,children:[u],generative_id:"",generative_objective:"",variables_used:{},status:s.status??"success"})}else{let c=at(s,t,n),u=ct(s,c);o.push(u)}i+=1}return o}function P(e,t="",n,r){let o=[],i=[],s=r?.passthrough,a=s?D(s.authoredInstructions):null;for(let d of e){if(s&&a&&d.flatIndex!==void 0&&s.replayOnlyFlatIndices.has(d.flatIndex)){let b=U(d.records,a);if(b){for(let E of b)o.push(E),i.push(d.flatIndex);continue}console.warn(`[migrator] replay-only passthrough: no authored operation matched step ${d.flatIndex} (action_id \u2260 any operation_id in the authored blob) \u2014 falling back to this run's records`)}let f=B(d.records,t,n,r);if(f.length===0)continue;let g=v().replace(/-/g,"");ht(f,g,d.objective);let m=f.some(b=>"status"in b&&typeof b.status=="string"?b.status==="error"||b.status==="failed":!1),h=d.resultCode?parseInt(d.resultCode,10):null,A=h!==null&&!isNaN(h)&&h>=200,I=m||A?"error":"success";o.push({content_type:"generative_block",instruction_id:`generative_block_${g}`,generative_id:g,objective:d.objective,status:I,children:f,error_message:I==="error"?d.errorMessage??null:null,error_code:I==="error"?d.reasonCode??null:null,result_code:d.resultCode??null,bifurcation_context:[],approach_reason:lt(d.summary),one_liner:d.oneLiner??null}),i.push(d.flatIndex)}let c=o.map((d,f)=>({block:d,flat:i[f]})),u=r?.moduleSpans??[],l=r?.blockSpans??[],_=r?.authoredBlocks??[];u.length>0&&(c=bt(c,u,l,_));let p=It(l,u);return p.length>0&&(c=z(c,p,_)),{instructions:c.map(d=>d.block)}}function bt(e,t,n,r){let o=[],i=a=>a===void 0?void 0:t.find(c=>a>=c.flatFrom&&a<=c.flatTo),s=0;for(;s<e.length;){let a=i(e[s].flat);if(!a){o.push(e[s]),s++;continue}let c=[];for(;s<e.length&&i(e[s].flat)===a;)c.push(e[s++]);let u=bt(c,a.children,n,r),l=It(Et(n,a),a.children);l.length>0&&(u=z(u,l,r)),o.push({block:se(a,u.map(_=>_.block)),flat:c[0].flat})}return o}function yt(e,t){return e.flatFrom>=t.flatFrom&&e.flatTo<=t.flatTo}function Et(e,t){let n=[];for(let r of e)yt(r,t)?n.push(r):n.push(...Et(r.children,t));return n}function It(e,t){let n=[],r=i=>{for(let s of i)n.push(s),r(s.children)};r(t);let o=i=>i.filter(s=>!n.some(a=>yt(s,a))).map(s=>({...s,children:o(s.children)}));return n.length>0?o(e):e}function z(e,t,n){let r=[...t].sort((u,l)=>u.flatFrom-l.flatFrom),o=[],i=(u,l)=>{o.push({block:re(u,l,n),flat:u.flatFrom})},s=(u,l)=>u!==void 0&&u>=l.flatFrom&&u<=l.flatTo,a=0,c=0;for(;c<e.length;){let u=e[c].flat;for(;a<r.length&&u!==void 0&&r[a].flatTo<u;)i(r[a++],[]);let l=a<r.length&&s(u,r[a])?r[a]:void 0;if(!l){o.push(e[c]),c++;continue}let _=[];for(;c<e.length&&s(e[c].flat,l);)_.push(e[c++]);i(l,_),a++}for(;a<r.length;)i(r[a++],[]);return o}function Qt(e){let t=new Map;for(let n of e)t.set(n.flat,n);return e.filter(n=>t.get(n.flat)===n)}var te=["children","instructions","branches","module_content","true_branch","false_branch"];function ee(e,t){if(!t)return;let n=[...e];for(;n.length>0;){let r=n.pop();if(!r||typeof r!="object")continue;let o=r;if(o.instruction_id===t&&(o.content_type==="conditional_block"||o.content_type==="until_block"))return o;for(let i of te){let s=o[i];Array.isArray(s)?n.push(...s):s&&typeof s=="object"&&n.push(s)}}}function ne(e,t,n){if(!e)return[];if(t==="while")return Array.isArray(e.children)?e.children:[];let o=(Array.isArray(e.branches)?e.branches:[])[n];return o&&Array.isArray(o.children)?o.children:[]}function re(e,t,n){let r=ee(n,e.blockId),o=e.branches.map((i,s)=>{let a=t.filter(l=>l.flat!==void 0&&l.flat>=i.flatFrom&&l.flat<=i.flatTo);e.kind==="while"&&(a=Qt(a));let c=z(a,e.children,n).map(l=>l.block);if(c.length>0)return c;let u=ne(r,e.kind,s);return u.length===0&&!i.taken&&console.warn(`[migrator] control-flow: branch ${s} of block ${e.blockId||e.instruction} did not run and no authored block matched \u2014 emitted empty`),u});return e.kind==="if"?ie(e,o,r):oe(e,o[0]??[],r)}function ie(e,t,n){let r=Array.isArray(n?.branches)?n.branches:[],o=V(t.flat()),i=e.branches.map((s,a)=>{let c=r[a];return{branch_index:a,condition:s.branch_type==="else"?null:s.condition,branch_type:s.branch_type,passed:s.taken,sub_objective:null,custom_event:c?.custom_event??null,children:t[a],sub_checks:Array.isArray(c?.sub_checks)?c.sub_checks:[],composite_operator:c?.composite_operator??"and"}});return{content_type:"conditional_block",instruction_id:e.blockId||`if_else_${v().slice(0,8)}`,instruction:e.instruction,instruction_class:"driver_action",command:"",status:o?"error":"success",resolved_branch_index:e.branches.findIndex(s=>s.taken),branches:i,generative_id:"",generative_objective:"",variables_used:{},classification_layer_resp:[],classification_error:{},used_variables:[],user_variables:"[]",module_id:"",module_execution_index:0,module_version:"",plan_id:"",optional_flag:!1,max_retries:0,retries_delay:0,explicit_wait:0,implicit_wait:0,error:null,error_message:o?.message??"",error_code:o?.code??"",reason:"",start_timestamp:"",end_timestamp:"",type:"agent_generated",hook:null,hook_type:null,evaluation_context:{},query_variables:{}}}function oe(e,t,n){let r=e.whileCfg??{max_retries:5,settle_ms:500,on_exhaust:"fail",iterations:0,condition_met:!1},o=V(t),i=(s,a)=>n&&n[s]!==void 0?n[s]:a;return{content_type:"until_block",instruction_id:e.blockId||`until_${v().slice(0,8)}`,condition:e.instruction,max_retries:r.max_retries,settle_ms:r.settle_ms,current_count:r.iterations,condition_met:r.condition_met,children:t,generative_id:"",generative_objective:"",variables_used:{},status:o?"error":"success",on_exhaust:i("on_exhaust",r.on_exhaust),mode:i("mode",""),check:i("check",""),conditions:i("conditions",[]),connectors:i("connectors",[]),sub_checks:i("sub_checks",[]),composite_operator:i("composite_operator","and")}}function V(e){for(let t of e){let n="status"in t&&typeof t.status=="string"?t.status:"";if(n==="error"||n==="failed"){let r="error_message"in t?t.error_message:void 0,o="error_code"in t?t.error_code:void 0;return{message:r??null,code:o??null}}}return null}function se(e,t){let n=e.meta,r=(u,l="")=>typeof n[u]=="string"?n[u]:l,o=(u,l=!1)=>typeof n[u]=="boolean"?n[u]:l,i=u=>Array.isArray(n[u])?n[u]:[],s=typeof n.module_version=="number"||typeof n.module_version=="string"?n.module_version:null,a=r("module_id"),c=V(t);return{content_type:tt,instruction_id:`module_block_${a}`,module_id:a,module_version:s,module_instance_id:v(),module_name:r("module_name"),module_description:r("module_description"),module_platform:r("module_platform"),creation_mode:r("creation_mode","Agent"),tms_status:r("tms_status","active"),is_validated:o("is_validated"),is_dirty:e.dirty,enrichment_id:r("enrichment_id"),tags:i("tags"),project_ids:i("project_ids"),link_to_all:o("link_to_all"),status:c?"error":"success",children:t,error_message:c?.message??null,error_code:c?.code??null,update_available:!1,update_info:{}}}function vt(e,t){let n;try{n=At(e)}catch{return 0}let r=0,o=n.filter(i=>/^\d+$/.test(i)).sort((i,s)=>Number(i)-Number(s));for(let i of o){let s=S(e,i),a=S(s,"logs");if(!ae(a))continue;let c;try{c=At(a)}catch{continue}let u=c.filter(p=>p.endsWith("-actions.ndjson")).sort((p,d)=>(parseInt(p,10)||0)-(parseInt(d,10)||0)),l=[];for(let p of u){let d=t.readActions(S(a,p));d.length&&l.push({objective:t.objective??"",records:d})}if(l.length===0)continue;let{instructions:_}=P(l,t.screenshotBaseUrl??"",t.extMap,{keepFailedActions:!0});if(_.length!==0)try{let p=S(s,"auteur");ce(p,{recursive:!0}),ue(S(p,"execution.json"),JSON.stringify(t.buildBlob(_),null,2)),r++,t.log?.("info","EVIDENCE_ARCHIVED_ATTEMPT_BLOB","Derived nested attempt blob",{attempt:i,instructions:_.length})}catch(p){t.log?.("debug","EVIDENCE_ARCHIVED_ATTEMPT_BLOB_FAILED","Nested attempt blob derivation failed",{attempt:i,error:p instanceof Error?p.message:String(p)})}}return r}import{existsSync as le,readFileSync as de}from"fs";function kt(e){try{return le(e)?JSON.parse(de(e,"utf-8")):void 0}catch{return}}function $(e,t){if(!e||typeof e!="object")return;let n=e,r=n.project_token;if(typeof r!="string"||!r)return;let o={project_token:r},i=n[t];typeof i=="string"&&i&&(o.project_name=i);let s=n.project_id;return typeof s=="string"&&s&&(o.project_id=s),o}function q(e){if(Array.isArray(e)){for(let r of e){let o=q(r);if(o)return o}return}if(!e||typeof e!="object")return;let t=e,n=t.smartui_results;if(n&&typeof n=="object"){let r=$(n.project,"name");if(r)return r}for(let r of Object.values(t)){let o=q(r);if(o)return o}}function Rt(e){for(let t of e.runMetaPaths){let n=kt(t),r=$(n?.smartui,"project_name");if(r)return r}if(e.authoredBlobPath){let t=kt(e.authoredBlobPath),n=$(t?.smartui,"project_name");if(n)return n}return q(e.instructions)??{}}var Pt=Nt(Lt(),1);import{createWriteStream as _e}from"fs";import{readFile as pe}from"fs/promises";import{join as fe,basename as ge}from"path";import{tmpdir as me}from"os";var he=["**/screenshots/**","**/annotated/**","**/tcg/**","**/bifurcation/**"];async function St(e){let t=fe(me(),`${ge(e)}_artifacts.zip`);return new Promise((n,r)=>{let o=_e(t),i=(0,Pt.default)("zip",{zlib:{level:6}});o.on("close",()=>n(t)),i.on("error",r),i.pipe(o),i.glob("**/*",{cwd:e,ignore:he}),i.finalize()})}async function wt(e){return pe(e)}async function Ee(e,t){return Ot(Q(e,t))}function Ie(e){return{key:"artifacts",content_type:"application/zip",filename:`${e}.evidence`}}var Ae=[1e3,2e3,4e3],xt=class{config;controller;testId;constructor(t){this.config=t,this.controller=new Y(t.controllerBaseUrl,t.auth),this.testId=t.testId}log(t,n,r,o){this.config.log?.(t,n,r,o)}async execute(){let{onProgress:t}=this.config;try{if(!this.testId)return this.log("error","PIPELINE_ABORT","No test_id available"),{success:!1,testId:null,error:"No test_id available"};let n=this.config.evidence,r=null;if(this.config.shouldUploadArtifacts!==!1){t("convert","running");let a=this.collectNdjsonPerRun(),c=a.reduce((g,m)=>g+m.records.length,0);this.log("info","PIPELINE_CONVERT","Collected NDJSON records",{total_records:c,run_groups:a.length});let u=this.loadReplayOnlyPassthrough(),{instructions:l}=a.length>0?P(a,this.config.screenshotBaseUrl??"",this.config.screenshotExtMap,{moduleSpans:this.config.moduleSpans,...u?{passthrough:u}:{},...this.config.blockSpans?.length?{blockSpans:this.config.blockSpans,authoredBlocks:this.loadAuthoredBlocks()}:{}}):{instructions:[]};this.log("info","PIPELINE_CONVERT_INSTRUCTIONS","Auteur instructions produced",{count:l.length});let _=this.buildExecutionEnvelope(l),p=Buffer.from(JSON.stringify(_));this.log("info","PIPELINE_CONVERT_BLOB","Blob created",{size_kb:+(p.length/1024).toFixed(1)});let d=y(this.config.sessionDir,"execution.json");w(d,JSON.stringify(_,null,2)),this.log("info","PIPELINE_CONVERT_LOCAL_SAVE","Execution blob saved locally",{path:d});let f=n?.packTestDir??this.config.evidenceRead?.packTestDir;if(f){let g=y(f,"auteur");K(g,{recursive:!0}),w(y(g,"execution.json"),JSON.stringify(_,null,2)),this.log("info","PIPELINE_CONVERT_PACK_COPY","Execution blob copied into pack",{path:y(g,"execution.json")}),this.deriveArchivedAttemptBlobs(f)}if(t("convert","done"),n)r=p;else{t("zip","running"),this.log("info","PIPELINE_ZIP_START","Zipping session",{session_dir:this.config.sessionDir});let g=null,m;try{g=await St(this.config.sessionDir),m=await wt(g),this.log("info","PIPELINE_ZIP_DONE","Zip complete",{size_mb:+(m.length/1024/1024).toFixed(1),path:g}),t("zip","done",`${(m.length/1024/1024).toFixed(1)}MB`)}finally{g&&await ye(g).catch(()=>{})}t("presign","running"),this.log("info","PIPELINE_PRESIGN_START","Requesting presigned URLs",{url:`${this.config.controllerBaseUrl}/upload/presign`,test_id:this.testId,session_id:this.config.sessionId});let h=await this.controller.getPresignedUrls(this.testId,this.config.sessionId,[{key:"artifacts",content_type:"application/zip",filename:`${this.config.sessionId}_artifacts.zip`},{key:"blob",content_type:"application/json",filename:`${this.config.commitId}.json`}]);this.log("info","PIPELINE_PRESIGN_OK","Presigned URLs received",{artifacts_url:h.urls.artifacts?.blob_url,blob_url:h.urls.blob?.blob_url}),t("presign","done"),t("upload","running"),this.log("info","PIPELINE_UPLOAD_START","Uploading artifacts and blob",{artifact_size_mb:+(m.length/1024/1024).toFixed(1),blob_size_kb:+(p.length/1024).toFixed(1)}),await Promise.all([k(h.urls.artifacts.upload_url,m,"application/zip"),k(h.urls.blob.upload_url,p,"application/json")]),this.log("info","PIPELINE_UPLOAD_OK","Upload complete"),t("upload","done")}}else{let a=this.collectNdjsonPerRun(),c=this.loadReplayOnlyPassthrough(),{instructions:u}=a.length>0?P(a,this.config.screenshotBaseUrl??"",this.config.screenshotExtMap,{keepFailedActions:!0,moduleSpans:this.config.moduleSpans,...c?{passthrough:c}:{},...this.config.blockSpans?.length?{blockSpans:this.config.blockSpans,authoredBlocks:this.loadAuthoredBlocks()}:{}}):{instructions:[]},l=this.buildExecutionEnvelope(u),_=y(this.config.sessionDir,"execution.json");w(_,JSON.stringify(l,null,2)),this.log("info","PIPELINE_LOCAL_SAVE","Execution blob saved locally (no upload)",{path:_});let p=this.config.evidence?.packTestDir??this.config.evidenceRead?.packTestDir;if(p){let d=y(p,"auteur");K(d,{recursive:!0});let f=this.readAuthoredExecution(),g=f?this.refreshReplayOnlyInPack(f,a,c):null;w(y(d,"execution.json"),g?.raw??JSON.stringify(l,null,2)),this.log("info","PIPELINE_CONVERT_PACK_COPY","Execution blob copied into pack (gated)",{path:y(d,"execution.json"),source:g?g.refreshed.length>0?"authored+replay_results":"authored":"run_envelope",...g&&g.refreshed.length>0?{refreshed_instruction_ids:g.refreshed}:{}}),this.deriveArchivedAttemptBlobs(p)}t("convert","skipped"),t("zip","skipped"),t("presign","skipped"),t("upload","skipped"),this.log("info","PIPELINE_UPLOAD_SKIPPED","Upload steps skipped (gate disabled)")}if(this.config.shouldReplaceLocalOutput&&this.config.onAtomicReplace){t("atomic_replace","running");try{await this.config.onAtomicReplace(),this.log("info","PIPELINE_ATOMIC_REPLACE_OK","Local output replaced"),t("atomic_replace","done")}catch(a){let c=a instanceof Error?a.message:String(a);throw this.log("error","PIPELINE_ATOMIC_REPLACE_FAILED","Atomic-replace failed",{error:c}),t("atomic_replace","failed",c),a}}else t("atomic_replace","skipped");let o,i;if(this.config.shouldCommit&&!this.config.isFirstRun&&this.config.onCommitLock){t("commit_lock","running");let a=await this.config.onCommitLock();if(a.ok)o=a.testcaseId||void 0,this.log("info","PIPELINE_COMMIT_LOCK_OK","Commit lock acquired",{testcase_id:o??"none",trigger:a.trigger??null,test_instance_id:a.testInstanceId??null}),t("commit_lock","done");else return this.log("error","PIPELINE_COMMIT_LOCK_FAILED","Commit lock failed",{reason:a.reason,message:a.message}),t("commit_lock","failed",`${a.reason??"unknown"}: ${a.message??""}`),{success:!1,testId:this.testId,error:`commit-lock failed: ${a.reason??"unknown"}`}}else t("commit_lock","skipped");if(this.config.isFirstRun&&!this.config.skipTmsFinalize){t("finalize","running"),this.log("info","PIPELINE_FINALIZE_START","Finalizing test (first-run)",{test_id:this.testId,commit_id:this.config.commitId});let a=new X(this.config.tmsBaseUrl,this.config.tmsUsername,this.config.tmsAccessKey),c=this.config.runObjectives&&this.config.runObjectives.length>0?this.config.runObjectives:[this.config.firstObjective],u={commit_id:this.config.commitId,time_taken:Math.round(this.config.totalDuration),steps_count:this.config.totalSteps,commit_message:this.config.firstObjective.slice(0,255),objectives:c,...this.config.assuranceStamp?{assurance:this.config.assuranceStamp}:{}},l;try{l=await this.stop(a,u)}catch(_){if(!this.config.attachedStop)throw _;let p=_ instanceof Error?_.message:String(_);this.log("error","PIPELINE_FINALIZE_NOT_SAVED","Attached test's stop did not finalize after its retries",{test_id:this.testId,error:p}),t("finalize","failed",p);try{await this.config.onFinalizeGaveUp?.()}catch(d){this.log("warn","PIPELINE_FINALIZE_META_FAILED","Meta-rewrite after a stop that did not finalize failed",{error:String(d)})}return{success:!1,testId:this.testId,error:`finalize failed: ${p}`,notSaved:!0}}if(o=l.testcase_id||void 0,this.log("info","PIPELINE_FINALIZE_OK","Test finalized",{testcase_id:o??"none",commit_id:l.commit_id??null}),this.config.onFinalizeSuccess)try{await this.config.onFinalizeSuccess(o,l.commit_id)}catch(_){this.log("warn","PIPELINE_FINALIZE_META_FAILED","Meta-rewrite after endTest failed",{error:String(_)})}t("finalize","done")}else t("finalize","skipped"),this.log("info","PIPELINE_FINALIZE_SKIPPED","Finalize skipped (evolve flow or first-run disabled)");if(o&&this.config.shareApiBaseUrl)try{i=await this.generateShareLink(o),this.log("info","PIPELINE_SHARE_OK","Share link generated",{share_id:i})}catch(a){this.log("warn","PIPELINE_SHARE_FAILED","Share link failed",{error:String(a)})}if(n&&r){let a=null;t("zip","running");try{await n.sealFn({testcaseId:o,shareId:i}),a=n.sealedPackPath?await Ot(n.sealedPackPath):await Ee(n.executionId,n.cwd),this.log("info","PIPELINE_EVIDENCE_SEALED","Evidence pack sealed",{execution_id:n.executionId}),this.log("info","PIPELINE_PACK_READ","Sealed pack read",{size_mb:+(a.length/1024/1024).toFixed(1)})}catch(c){let u=c instanceof Error?c.message:String(c);this.log("warn","PIPELINE_EVIDENCE_UPLOAD_SKIPPED","Evidence seal/read failed \u2014 uploading blob only",{execution_id:n.executionId,error:u})}if(a){t("zip","done",`${(a.length/1024/1024).toFixed(1)}MB`),t("presign","running");let c=await this.controller.getPresignedUrls(this.testId,this.config.sessionId,[Ie(n.executionId),{key:"blob",content_type:"application/json",filename:`${this.config.commitId}.json`}]);this.log("info","PIPELINE_PRESIGN_OK","Presigned URLs received",{artifacts_url:c.urls.artifacts?.blob_url,blob_url:c.urls.blob?.blob_url}),t("presign","done"),t("upload","running"),this.log("info","PIPELINE_UPLOAD_START","Uploading pack and blob",{artifact_size_mb:+(a.length/1024/1024).toFixed(1),blob_size_kb:+(r.length/1024).toFixed(1)}),await Promise.all([k(c.urls.artifacts.upload_url,a,"application/zip"),k(c.urls.blob.upload_url,r,"application/json")]),this.log("info","PIPELINE_UPLOAD_OK","Upload complete"),t("upload","done")}else{t("zip","skipped"),t("presign","running");let c=await this.controller.getPresignedUrls(this.testId,this.config.sessionId,[{key:"blob",content_type:"application/json",filename:`${this.config.commitId}.json`}]);t("presign","done"),t("upload","running"),this.log("info","PIPELINE_UPLOAD_START","Uploading blob only (evidence skipped)",{blob_size_kb:+(r.length/1024).toFixed(1)}),await k(c.urls.blob.upload_url,r,"application/json"),this.log("info","PIPELINE_UPLOAD_OK","Blob upload complete (pack skipped)"),t("upload","done")}}let s;if(this.config.codeExport?.enabled&&o){let a=!1;try{await this.triggerCodeExport(o),this.log("info","PIPELINE_CODE_EXPORT_START","Code export triggered"),a=!0}catch(c){let u=c instanceof Error?c.message:String(c);this.log("error","PIPELINE_CODE_EXPORT_FAILED","Code export trigger failed; skipping poll",{error:u}),t("code_export","failed",`trigger failed: ${u}`)}if(a){t("code_export","running","Waiting for code generation\u2026");try{s=await this.pollAndDownloadCode(o,t),this.log("info","PIPELINE_CODE_EXPORT_OK","Code export complete",{dir:s}),t("code_export","done",s)}catch(c){let u=c instanceof Error?c.message:String(c);this.log("error","PIPELINE_CODE_EXPORT_FAILED","Code export failed",{error:u}),t("code_export","failed",u)}}}else t("code_export","skipped");return this.log("info","PIPELINE_COMPLETE","Pipeline complete"),{success:!0,testId:this.testId,testcaseId:o,shareId:i,codeExportDir:s}}catch(n){return{success:!1,testId:this.testId,error:n instanceof Error?n.message:String(n)}}}async stop(t,n){let r=this.config.attachedStop?this.config.stopRetryDelaysMs??Ae:[];for(let o=0;;o++)try{return await t.endTest(this.testId,n)}catch(i){if(!(i instanceof W&&(i.status===null||i.status>=500)&&o<r.length))throw i;this.log("warn","PIPELINE_FINALIZE_RETRY","Attached test's stop sent again",{attempt:o+1,status:i.status}),await new Promise(a=>setTimeout(a,r[o]))}}async runCodeExport(t,n){let r=n??this.config.onProgress,o=!1;try{await this.triggerCodeExport(t),this.log("info","PIPELINE_CODE_EXPORT_TRIGGER","Code export triggered",{testcase_id:t}),o=!0}catch(i){let s=i instanceof Error?i.message:String(i);this.log("error","PIPELINE_CODE_EXPORT_TRIGGER_FAILED","Code export trigger failed; skipping poll",{error:s}),r("code_export","failed",`trigger failed: ${s}`)}if(o){r("code_export","running","Waiting for code generation\u2026");try{let i=await this.pollAndDownloadCode(t,r);return this.log("info","PIPELINE_CODE_EXPORT_OK","Code export complete",{dir:i}),r("code_export","done",i),i}catch(i){let s=i instanceof Error?i.message:String(i);this.log("error","PIPELINE_CODE_EXPORT_FAILED","Code export failed",{error:s}),r("code_export","failed",s);return}}}deriveArchivedAttemptBlobs(t){try{let n=vt(t,{readActions:r=>this.readNdjsonFromFile(r),buildBlob:r=>this.buildExecutionEnvelope(r),objective:this.config.firstObjective,screenshotBaseUrl:this.config.screenshotBaseUrl??"",extMap:this.config.screenshotExtMap,log:(r,o,i,s)=>this.log(r,o,i,s)});n>0&&this.log("info","PIPELINE_ARCHIVED_ATTEMPTS","Nested retry-attempt blobs derived",{count:n})}catch(n){this.log("debug","PIPELINE_ARCHIVED_ATTEMPTS_FAILED","Nested attempt blob pass failed",{error:n instanceof Error?n.message:String(n)})}}collectNdjsonPerRun(){let t=[],n=this.config.runObjectives??[],r=this.config.runMetadata??[],o=this.config.evidence??this.config.evidenceRead;for(let i=0;i<this.config.runDirs.length;i++){let s=this.config.runDirs[i],a=n[i]||this.config.firstObjective,c=r[i],u=o?this.readNdjsonFromFile(y(o.packTestDir,"logs",`${o.runIndices?.[i]??i}-actions.ndjson`)):this.readNdjsonFromDir(s);if(u.length>0){let l=o?.runIndices?.[i]??i,_=this.config.runFlatIndex?.[l];t.push({objective:a,records:u,..._!==void 0?{flatIndex:_}:{},resultCode:c?.resultCode,reasonCode:c?.reasonCode,errorMessage:c?.errorMessage,summary:c?.summary,oneLiner:c?.oneLiner})}}if(t.length===0){let i=y(this.config.sessionDir,"runs");if(G(i))try{let a=be(i,{withFileTypes:!0}).filter(c=>c.isDirectory()).map(c=>c.name).sort();for(let c of a){let u=y(i,c),l=this.readNdjsonFromDir(u);l.length>0&&t.push({objective:this.config.firstObjective,records:l})}}catch{}}return t}readNdjsonFromDir(t){let n=[y(t,"run-test","actions.ndjson"),y(t,"actions.ndjson")];for(let r of n)if(G(r))return this.readNdjsonFromFile(r);return[]}readNdjsonFromFile(t){let n=[];if(!G(t))return n;this.log("debug","PIPELINE_COLLECT_READ","Reading NDJSON file",{path:t});let r=T(t,"utf-8");for(let o of r.split(`
|
|
5
|
+
`)){let i=o.trim();if(i)try{n.push(JSON.parse(i))}catch{}}return n}async generateShareLink(t){let n=`${this.config.shareApiBaseUrl}/lshs/api/v1.0/share-item/generate-sharable-link`;this.log("info","PIPELINE_SHARE_START","Requesting share link",{url:n,testcase_id:t});let r={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({entityIds:[t],entityType:"Test Case Details",expiresAt:7})},o=!!this.config.authResolver;this.log("debug","PIPELINE_SHARE_AUTH","Share link auth config",{resolver:o,fallback_auth_type:typeof this.config.auth=="string"?"bearer":"basic",tms_user:this.config.tmsUsername});let i=o?await this.config.authResolver.fetch(n,r):await R(n,{...r,headers:{...r.headers,Authorization:this.buildAuthHeader()}});if(!i.ok)throw new Error(`Share link API failed: ${i.status} ${await i.text()}`);let s=await i.json();if(!s.shareId)throw new Error("Share link API returned no shareId");return s.shareId}async triggerCodeExport(t){if(!this.config.codeExport)throw new Error("triggerCodeExport called without resolved codeExport config");let{url:n,body:r}=et({tmsBaseUrl:this.config.tmsBaseUrl,testcaseId:t,codeExport:this.config.codeExport,mobile:this.config.mobile});this.log("info","PIPELINE_CODE_EXPORT_POST","Triggering code export",{url:n});let o={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(r)},i=this.config.authResolver?await this.config.authResolver.fetch(n,o):await R(n,{...o,headers:{...o.headers,Authorization:this.buildAuthHeader()}});if(!i.ok)throw new Error(`Code export failed: ${i.status} ${await i.text()}`)}async pollAndDownloadCode(t,n){let r=nt({tmsBaseUrl:this.config.tmsBaseUrl,testcaseId:t}),o=this.config.exitTimeoutMs??3e5,i=5e3,s=Date.now()+o;this.log("info","PIPELINE_CODE_EXPORT_POLL","Polling for code export",{url:r,timeout_ms:o});let a=(c,u)=>this.config.authResolver?this.config.authResolver.fetch(c,u):R(c,{...u,headers:{...u?.headers,Authorization:this.buildAuthHeader()}});for(;Date.now()<s;){let c=await a(r,{method:"GET",headers:{Accept:"application/json"}});if(!c.ok){let d=await c.text().catch(()=>"");throw this.log("warn","PIPELINE_CODE_EXPORT_POLL_FAILED","Code export poll non-200; skipping",{status:c.status,body:d.slice(0,200)}),new Error(`code export poll skipped: HTTP ${c.status}`)}let l=(await c.json()).data?.find(d=>d.code_name==="kane-cli-trigger");if(!l){this.log("debug","PIPELINE_CODE_EXPORT_WAITING","No kane-cli-trigger entry yet"),n("code_export","running","Waiting for code generation\u2026"),await this.sleep(i);continue}let _=l.status.toLowerCase();if(_==="in progress"||_==="in_progress"||_==="pending"){this.log("debug","PIPELINE_CODE_EXPORT_IN_PROGRESS","Code export in progress",{status:l.status}),n("code_export","running","Generating code\u2026"),await this.sleep(i);continue}if(!l.url||l.url.length===0)throw new Error(`Code export status=${l.status} but no files returned`);let p=this.config.codeExportDir??y(this.config.sessionDir,"code-export");K(p,{recursive:!0}),this.log("info","PIPELINE_CODE_EXPORT_DOWNLOAD","Downloading code files",{file_count:l.url.length,dir:p}),n("code_export","running",`Downloading ${l.url.length} files\u2026`);for(let d of l.url){let f=y(p,d.file_name),g=await R(d.file_url);if(!g.ok){this.log("warn","PIPELINE_CODE_EXPORT_FILE_FAILED","Failed to download file",{file_name:d.file_name,status:g.status});continue}let m=await g.text();w(f,m,"utf-8"),this.log("info","PIPELINE_CODE_EXPORT_FILE_SAVED","File saved",{file_name:d.file_name,size_bytes:m.length})}return p}throw new Error("Code export timed out")}sleep(t){return new Promise(n=>setTimeout(n,t))}buildAuthHeader(){return typeof this.config.auth=="string"?`Bearer ${this.config.auth}`:J(this.config.auth.username,this.config.auth.accessKey)}readAuthoredExecution(){let t=this.config.authoredExecutionPath;if(!t)return null;try{let n=T(t,"utf8");return JSON.parse(n),n}catch{return this.log("warn","PIPELINE_AUTHORED_BLOB_UNREADABLE","Authored execution.json missing/unreadable \u2014 pack gets this run's envelope",{path:t}),null}}refreshReplayOnlyInPack(t,n,r){if(!r)return{raw:t,refreshed:[]};let o=ot(n,r);if(o.length===0)return{raw:t,refreshed:[]};let i=JSON.parse(t);if(!Array.isArray(i.instructions))return{raw:t,refreshed:[]};let s=st(i.instructions,o);return s.length===0?{raw:t,refreshed:s}:{raw:JSON.stringify(i,null,2),refreshed:s}}loadAuthoredBlocks(){let t=this.config.blockAuthoredExecutionPath;if(!t)return[];try{let n=JSON.parse(T(t,"utf8"));return Array.isArray(n.instructions)?n.instructions:[]}catch(n){return this.log("warn","PIPELINE_AUTHORED_BLOB_UNREADABLE","Authored execution.json missing/unreadable \u2014 branches that did not run this time upload empty",{path:t,error:n instanceof Error?n.message:String(n)}),[]}}loadReplayOnlyPassthrough(){let t=this.config.replayOnlyPassthrough;if(!(!t||t.flatIndices.length===0))try{let n=JSON.parse(T(t.authoredExecutionPath,"utf8"));if(!Array.isArray(n.instructions))throw new Error("no instructions array");return{authoredInstructions:n.instructions,replayOnlyFlatIndices:new Set(t.flatIndices)}}catch(n){this.log("warn","PIPELINE_PASSTHROUGH_BLOB_UNREADABLE","Authored execution.json missing/unreadable \u2014 replay-only steps convert from this run's records",{path:t.authoredExecutionPath,flat_indices:t.flatIndices,error:n instanceof Error?n.message:String(n)});return}}smartuiProject(t){let n=this.config.evidence??this.config.evidenceRead,r=this.config.runDirs.map((i,s)=>n?y(n.packTestDir,"logs",`${n.runIndices?.[s]??s}-run_meta.json`):y(i,"run_meta.json"));return{...Rt({runMetaPaths:r,authoredBlobPath:this.config.replayOnlyPassthrough?.authoredExecutionPath??this.config.authoredExecutionPath,instructions:t})}}buildExecutionEnvelope(t){let n=this.config.runStatuses.every(u=>u==="passed")?"success":"error",r=this.config.variableIds??{},o=[];if(this.config.variables)for(let[u,l]of Object.entries(this.config.variables)){if(l.secret||Z(l))continue;let _=u.startsWith("global.")?u.slice(7):u;o.push({id:r[_]??0,name:_,value:l.value,session_value:l.value,is_persist:!1,environment_id:0,environment_name:"No Env"})}let i=[],s=u=>{let l=i.find(_=>_.name===u.name);l?l.value=u.value:i.push(u)},a=[],c=new Set;for(let u of this.collectNdjsonPerRun())for(let l of u.records)if(l.output_variable&&l.output_value!=null&&s({name:l.output_variable,value:String(l.output_value),value_type:"test_level",variable_description:"ANALYZE result"}),l.action_type==="upload_files"){let _=N(l.action_params);if(_){let p=_.media_id||_.media_url;if(!c.has(p)){c.add(p),a.push({media_url:_.media_url,media_id:_.media_id,name:_.name,type:_.type,..._.alias?{alias:_.alias}:{}});let d=O(_.name);_.alias?s({name:M(_.alias),type:"file",value:d,value_type:"string",scope:_.alias.startsWith("local.")?"local":"global",media_id:_.media_id}):s({name:ut(_.name),value:d,value_type:"string",variable_description:`variable for ${d}`})}}}return{test_id:this.testId,version:"v4",auto_heal_version:this.config.apMode==="v2"?"AH2":"",session_id:this.config.sessionId,org_id:String(this.config.orgId),user_id:String(this.config.userId),url:this.config.firstUrl??"",start_timestamp:this.config.startedAt,end_timestamp:this.config.endedAt,status:n,commit_id:this.config.commitId,instructions:t,modules:[],uploaded_files:a,test_params:this.config.testParams??[],test_level_variables:JSON.stringify(i),test_global_variables:o,max_network_wait:0,wait_buffer:0,network_throttle:{},secrets:this.config.secrets??[],totp:[],environment_id:this.config.environmentId??0,environment:"",mobile_browser:!1,native_popups:[],smartui:this.smartuiProject(t),module_index:0}}};export{Ee as a,Ie as b,Ae as c,xt as d};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as h}from"./chunk-DPGOAFKF.js";import{e as f}from"./chunk-6NFOH4AC.js";import{g}from"./chunk-4I7YN6YY.js";import{readFileSync as T,writeFileSync as x,renameSync as _,mkdirSync as I}from"fs";import{dirname as F,join as P}from"path";var A=1,D=720*60*1e3;function p(e){return P(g().baseDir,"embeddings",`alias-${e}.json`)}function y(e,r=Date.now()){return e!==null&&r-e.fetchedAt<D}function E(e){try{let r=JSON.parse(T(e,"utf-8"));return r.wrapperVersion!==A||typeof r.purposes!="object"||r.purposes===null?null:{wrapperVersion:A,writtenByVersion:String(r.writtenByVersion??""),purposes:r.purposes}}catch{return null}}function v(e,r,s=p(e)){let i=E(s)?.purposes?.[r];return!i||typeof i.alias!="string"||typeof i.dims!="number"||typeof i.fetchedAt!="number"?null:{alias:i.alias,dims:i.dims,fetchedAt:i.fetchedAt}}function S(e,r,s,t=p(e)){try{I(F(t),{recursive:!0});let n=E(t)?.purposes??{};n[r]={alias:s.alias,dims:s.dims,fetchedAt:Date.now()};let a={wrapperVersion:A,writtenByVersion:g().version,purposes:n},o=`${t}.tmp`;x(o,JSON.stringify(a,null,2)+`
|
|
3
|
+
`),_(o,t)}catch(i){f(`[embed] Failed to save alias cache: ${i instanceof Error?i.message:String(i)}`,"EMBED_CACHE_WRITE_FAILED")}}async function M(e,r,s,t,i=100){let n=[...r.map((o,l)=>({text:o,query:l})),...s],a=new Array(r.length);for(let o=0;o<n.length;o+=i){let l=n.slice(o,o+i),{vectors:m}=await e(l.map(c=>c.text));l.forEach((c,u)=>{let b=Float32Array.from(m[u]);"query"in c?a[c.query]=b:t(c.cid,b)})}return a}var R=8e3,V=2e4;function B(e,r=process.env){let s=(e instanceof Error?e.message:String(e)).replace(/\b([a-z][a-z0-9+.-]*:\/\/)[^\s/@]+@/gi,"$1[redacted]@").replace(/(authorization\s*[:=])[^\r\n]+/gi,"$1 [redacted]");for(let t of[r.TESTMUAI_API_KEY,r.TESTMUAI_BASIC_AUTH])t&&(s=s.split(t).join("[redacted]"));return s}var d=class extends Error{};async function w(e,r,s){let t=AbortSignal.timeout(r);try{return await s(t)}catch(i){throw t.aborted?new d(`${e} timed out after ${r} ms`):i}}function U(e){return e.TESTMUAI_ENV==="stage"?"stage":"prod"}function C(e){let r=e.env??process.env,s=e.auth?.TESTMUAI_BASIC_AUTH||r.TESTMUAI_BASIC_AUTH;if(s)return{authorization:`Basic ${s}`};let t=e.auth?.TESTMUAI_API_KEY||r.TESTMUAI_API_KEY;return t?{authorization:`Bearer ${t}`}:{}}async function $(e,r={}){let s=r.env??process.env,t=U(s),i=r.aliasCacheFile??p(t),n=r.now??Date.now,a=v(t,e,i);if(y(a,n()))return{alias:a.alias,dims:a.dims};let l=`${h(s)}/assurance/embed/alias?purpose=${encodeURIComponent(e)}`,m=await w("embed alias resolve",r.timeoutMs??R,async c=>{let u=await(r.fetchImpl??fetch)(l,{method:"GET",headers:C(r),signal:c});if(!u.ok)throw new Error(`embed alias resolve failed: ${u.status}`);return await u.json()});return S(t,e,{alias:m.alias,dims:m.dims},i),{alias:m.alias,dims:m.dims}}async function H(e,r,s={}){let t=s.env??process.env,i=h(t);return w("embed",s.timeoutMs??V,async n=>{let a=await(s.fetchImpl??fetch)(`${i}/assurance/embed`,{method:"POST",headers:{...C(s),"content-type":"application/json"},body:JSON.stringify({purpose:e,input:r}),signal:n});if(!a.ok)throw new Error(`embed failed: ${a.status}`);return await a.json()})}function W(){let e=null,r={off:null,traced:!1,calls:t=>({resolveAlias:i=>s("alias",t,n=>$(i,n)),embed:(i,n)=>s("embed",t,a=>H(i,n,a))})};async function s(t,i,n){if(e)throw new d(`similarity search is off for this run: ${e.message}`);let a={};try{return a=await i(),await n(a)}catch(o){throw r.off??={call:t,reason:B(o,{...process.env,...a.auth??{}})},o instanceof d&&(e=o),o}}return r}function q(e,r){!e.off||e.traced||(e.traced=!0,r("similarity_off",e.off))}function Z(e,r,s,t){try{return e.vectors().read(r,s,t)}catch{return null}}function ee(e,r,s,t,i){try{e.vectors().write(r,s,t,i)}catch(n){f(`[embed] Failed to cache vector: ${n instanceof Error?n.message:String(n)}`,"EMBED_CACHE_WRITE_FAILED")}}function re(e,r,s,t){e.vectors().prefetch(r,s,t)}export{M as a,W as b,q as c,Z as d,ee as e,re as f};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{e as _}from"./chunk-77ZZQJLX.js";import{e as j}from"./chunk-MYZHOBS4.js";import{a as k,c as I}from"./chunk-B7ZX5HEN.js";import{writeFileSync as G,mkdirSync as J,readFileSync as W}from"fs";import{dirname as S}from"path";function L(e){return typeof e=="string"&&e.trim()||void 0}function oe(e){return L(b(e)?.tc_id)}function se(e){let t=b(e)?.environment_id;return typeof t=="number"&&Number.isInteger(t)&&t>0?t:void 0}function b(e){try{return JSON.parse(W(_(e),"utf8"))}catch{return null}}function de(e){let t=_(e.sourcePath);try{J(S(t),{recursive:!0})}catch(r){return process.stderr.write(`
|
|
3
|
+
\u26A0 Failed to create output directory.
|
|
4
|
+
${r.message}
|
|
5
|
+
Path: ${S(t)}
|
|
6
|
+
|
|
7
|
+
`),t}let n={commit_id:e.commitId};e.testId!==void 0&&(n.test_id=e.testId),e.testcaseId!==void 0&&(n.testcase_id=e.testcaseId),e.projectId!==void 0&&(n.project_id=e.projectId),e.folderId!==void 0&&(n.folder_id=e.folderId),e.orgId!==void 0&&(n.org_id=e.orgId),e.sessionName!==void 0&&(n.session_name=e.sessionName),e.plan!==void 0&&(n.plan=e.plan),e.media&&Object.keys(e.media).length>0&&(n.media=e.media),e.tcId&&(n.tc_id=e.tcId),e.environmentId&&(n.environment_id=e.environmentId);try{G(t,JSON.stringify(n,null,2)+`
|
|
8
|
+
`,"utf8")}catch(r){process.stderr.write(`
|
|
9
|
+
\u26A0 Failed to write meta.json.
|
|
10
|
+
${r.message}
|
|
11
|
+
Path: ${t}
|
|
12
|
+
|
|
13
|
+
`)}return t}import{readFileSync as U,existsSync as Y}from"fs";import{basename as O,dirname as z,isAbsolute as D,resolve as C}from"path";import{createHash as x}from"crypto";function h(e){if(e==null)return null;if(Array.isArray(e))return e.map(h);if(typeof e=="object"){let t={};for(let n of Object.keys(e).sort()){let r=e[n];r!==void 0&&(t[n]=h(r))}return t}return e}function H(e){if(e.body.kind!=="objective")throw new Error("stepMd5: only objective steps have an md5; @import rows do not");let t={...e.config??{},optional:e.optional??!1},n=JSON.stringify(h(t));return x("md5").update(e.body.text).update(`
|
|
14
|
+
`).update(n).digest("hex")}function T(e){let t={};for(let[r,o]of Object.entries(e.bindings??{}))t[r]={value:o.value,...o.secret===!0?{secret:!0}:{},...o.syntax?{syntax:o.syntax}:{}};let n=JSON.stringify(h({bindings:t,optional:e.optional}));return x("md5").update(e.path).update(`
|
|
15
|
+
`).update(n).digest("hex")}function le(e){return H({index:e.trace[e.trace.length-1].stepIndex,heading:e.trace[e.trace.length-1].heading,verifies:[],body:{kind:"objective",text:e.objective},config:e.parsedConfig,headingLine:1,optional:e.optional})}var E=["target","chrome_profile","cdp_endpoint","ws_endpoint","headless"],q=["app","no_reset","os_version","device_name"],B=["mode","on_lock_conflict","tags","dataset","target","chrome_profile","cdp_endpoint","ws_endpoint","headless","app","no_reset","os_version","device_name"],g=class extends Error{constructor(t){super(t),this.name="TestMdResolveError"}};function v(e){let t=O(e);return t.endsWith("_test.md")?"test":t.endsWith("_module.md")?"module":"helper"}function ye(e){let t=C(e),n=F(t),r=Z(n.global),o=[],s=[],a=[{file:t,kind:v(t)}],d=[];return V(n,s,o,[],t,{},{},a,d,{}),o.forEach((c,p)=>c.flatIndex=p+1),{rootPath:t,rootTitle:n.title,rootGlobal:n.global,rootSteps:n.steps,chrome:r,steps:o,unitFiles:a,warnings:d}}function _e(e){let t=[];for(let n of e.unitFiles){if(n.kind!=="test")continue;let r=b(n.file);r&&t.push({file:n.file,...r.project_id?{project_id:String(r.project_id)}:{},...r.org_id?{org_id:String(r.org_id)}:{}})}return t}function F(e){if(!Y(e))throw new g(`@import path not found: ${e}`);let t=U(e,"utf8");return k(e,t)}function V(e,t,n,r,o,s,a,d,l,c){if(t.includes(e.path)){let i=[...t,e.path].map(f=>O(f)).join(" \u2192 ");throw new g(`cyclic reference: ${i}`)}t.push(e.path);let p=r.length===0,u=e.global.variables??{};for(let i of Object.keys(s))if(Object.hasOwn(u,i))throw new g(`callsite binding '${i}' collides with a declared variable in ${e.path} (frontmatter variables are pinned; parameters are its undeclared names)`);let M=e.global;if(!p){let i={...e.global};for(let f of B)i[f]!==void 0&&(l.push(`${e.path}: '${f}' is root-governed on imported units \u2014 ignored`),delete i[f]);i.url!==void 0&&(c.pending=String(i.url),delete i.url),M=i}let $=new Map;for(let i of e.steps){let f=i.body.kind!=="objective";if(i.optional&&f&&!p)throw new g(`intermediate-ref 'optional' is not supported in v1: ${e.path}:${i.headingLine}`);if(i.body.kind==="objective"){let y={file:e.path,stepIndex:i.index,heading:i.heading,optional:i.optional??!1},A=ee(M,i.config,s,a),w={flatIndex:0,objective:i.body.text,sourceFile:e.path,trace:[...r,y],config:A,parsedConfig:i.config,optional:i.optional??!1,verifies:i.verifies,owningFile:e.path,unitKind:v(e.path),...i.replayOnly?{replayOnly:i.replayOnly}:{},...i.controlFlow?{controlFlow:i.controlFlow}:{},...i.block?{block:{...i.block,id:te(i,n.length+1,$)}}:{}};c.pending&&(w.unitEntryUrl=c.pending,c.pending=void 0),n.push(w);continue}let P={file:e.path,stepIndex:i.index,heading:i.heading,optional:i.optional??!1,rowMd5:T({path:i.body.path,bindings:i.body.bindings,optional:i.optional??!1})},N=z(e.path),m=D(i.body.path)?i.body.path:C(N,i.body.path),K=F(m);d.some(y=>y.file===m)||d.push({file:m,kind:v(m)});let R={...a,...s,...u};V(K,t,n,[...r,P],o,X(i.body.bindings??{},R),R,d,l,c)}p||(c.pending=void 0),t.pop()}var Q=/(\\?)\{\{\s*([^{}]+?)\s*\}\}/g;function X(e,t){let n=new Map;for(let[o,s]of Object.entries(t))n.set(j(o),s);let r={};for(let[o,s]of Object.entries(e)){let a=s.secret===!0,d=s.value.replace(Q,(l,c,p)=>{if(c)return l;let u=n.get(p);return u?(u.secret&&(a=!0),u.value):l});r[o]={...s,value:d,...a?{secret:!0}:{}}}return r}function Z(e){let t={};for(let n of E){if(n==="target"){let r=I(e);r!==void 0&&(t.target=r);continue}e[n]!==void 0&&(t[n]=e[n])}return t}function ee(e,t,n,r){let o={};for(let[d,l]of Object.entries(e))E.includes(d)||q.includes(d)||(o[d]=l);let s={...o,...t??{}},a={...r,...n,...e.variables??{},...t?.variables??{}};return Object.keys(a).length>0?s.variables=a:delete s.variables,s}function te(e,t,n){let r=e.block.id;if(e.controlFlow==="if"||e.controlFlow==="while")return n.set(r,t),t;let o=n.get(r);if(o===void 0)throw new g(`block member before its opener in ${e.heading}`);return o}export{T as a,le as b,L as c,oe as d,se as e,b as f,de as g,g as h,v as i,ye as j,_e as k};
|