@testmuai/kane-cli 0.10.2 → 0.10.4
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-DN7VVN3Y.js +2 -0
- package/dist/ChromeProfilePicker-TVGWXTUU.js +2 -0
- package/dist/{CliFeedbackPrompt-2NV2G65E.js → CliFeedbackPrompt-L5ILK66U.js} +1 -1
- package/dist/{CliUploadProgress-JZ5FXODE.js → CliUploadProgress-IU6BQLMV.js} +1 -1
- package/dist/{ConfigView-TZ4YINOE.js → ConfigView-LU5IRRQU.js} +1 -1
- package/dist/EvidenceViewOffer-DNTARDEL.js +2 -0
- package/dist/FolderPicker-6E5GE2K2.js +2 -0
- package/dist/InfoBox-SFFPLWCV.js +2 -0
- package/dist/LinksBox-6YDTIO6I.js +2 -0
- package/dist/ProfilesView-6C5HJQ3Y.js +2 -0
- package/dist/ProjectPicker-YIQIVXGK.js +2 -0
- package/dist/SaveSessionPrompt-X3N6OGYB.js +2 -0
- package/dist/SingleShotApp-MXNJPU6A.js +2 -0
- package/dist/SummaryBox-T7PDXDKS.js +2 -0
- package/dist/TestMdRunView-HRJSBP2C.js +2 -0
- package/dist/TestrunEvidenceTable-OGMWTJQF.js +2 -0
- package/dist/{WhoamiView-4XIJXMTU.js → WhoamiView-WGCWD7GP.js} +1 -1
- package/dist/{app-client-U2YYF65L.js → app-client-2RR5ATI6.js} +1 -1
- package/dist/app-download-ZS6ZMX2Z.js +2 -0
- package/dist/{assurance-job-MD65GQLC.js → assurance-job-QO4VJJCL.js} +1 -1
- package/dist/{binary-NVYLR36K.js → binary-CCCTW3QQ.js} +1 -1
- package/dist/bind-JU4XPDN3.js +2 -0
- package/dist/bootstrap-BV7HAARR.js +2 -0
- package/dist/{bridge-2UHJOVLX.js → bridge-SPGIYAAG.js} +1 -1
- package/dist/{catalog-5UYBWA4W.js → catalog-ZAROGOJA.js} +1 -1
- package/dist/{catalog-client-VVKV4JKW.js → catalog-client-QLHCEPPZ.js} +1 -1
- package/dist/{changelog-FPWJXERY.js → changelog-6L7W76ZH.js} +1 -1
- package/dist/chat-committer-7E3TRZ6P.js +2 -0
- package/dist/chat-controller-5ZBG23L6.js +2 -0
- package/dist/child-MNLSG77W.js +2 -0
- package/dist/{chunk-3V4J65GN.js → chunk-2CJ75THZ.js} +1 -1
- package/dist/{chunk-UWPG5MWM.js → chunk-2EKLTUY2.js} +1 -1
- package/dist/{chunk-I52NWH4U.js → chunk-2KPJ62RZ.js} +3 -3
- package/dist/{chunk-UCVP7ZY4.js → chunk-2VLM4L3S.js} +1 -1
- package/dist/{chunk-ZHAMVLQZ.js → chunk-3A4KK22B.js} +1 -1
- package/dist/{chunk-L3BUPFAQ.js → chunk-3CFAE36M.js} +1 -1
- package/dist/{chunk-TU2KPOW2.js → chunk-3DFBFYTD.js} +2 -2
- package/dist/{chunk-IT5JVCZN.js → chunk-3HGKFRFL.js} +1 -1
- package/dist/{chunk-XNXJXGVB.js → chunk-3JATEWA5.js} +2 -2
- package/dist/{chunk-2QKBXRLI.js → chunk-3O2RPYPM.js} +1 -1
- package/dist/chunk-3UY4WPMQ.js +8 -0
- package/dist/{chunk-HM6LZ2KM.js → chunk-3VSAAB2W.js} +1 -1
- package/dist/{chunk-IB5WG5YY.js → chunk-454IWKHT.js} +1 -1
- package/dist/{chunk-ZMWTRXFH.js → chunk-4DRFMDAW.js} +1 -1
- package/dist/{chunk-JUVY6PHY.js → chunk-4FA44D6S.js} +1 -1
- package/dist/{chunk-XHFU5TGS.js → chunk-4G2T54FE.js} +1 -1
- package/dist/{chunk-C6P6YUCR.js → chunk-4KFSSETE.js} +1 -1
- package/dist/chunk-4QV2RL6P.js +34 -0
- package/dist/{chunk-7ZR5CQY3.js → chunk-4WFN23DE.js} +1 -1
- package/dist/{chunk-GQARXS6F.js → chunk-4WKFM72U.js} +1 -1
- package/dist/{chunk-EEOAU43D.js → chunk-55W3WAAL.js} +1 -1
- package/dist/{chunk-GT3JDX5H.js → chunk-56NUPYFG.js} +1 -1
- package/dist/{chunk-PI7OXS62.js → chunk-5EAJO372.js} +1 -1
- package/dist/{chunk-P4VFC6HO.js → chunk-5HJRYEOT.js} +1 -1
- package/dist/{chunk-B226SFOV.js → chunk-5OGYXLOR.js} +1 -1
- package/dist/{chunk-CQDCNP7V.js → chunk-5ORBAYTU.js} +1 -1
- package/dist/{chunk-KKLCXRW6.js → chunk-642LB5R2.js} +1 -1
- package/dist/{chunk-X3A4QPA3.js → chunk-662MCICY.js} +1 -1
- package/dist/{chunk-2GEAKFAV.js → chunk-6CMBA5SG.js} +1 -1
- package/dist/{chunk-X6FCXBXU.js → chunk-6FVGPKVX.js} +1 -1
- package/dist/{chunk-32HED7X2.js → chunk-6KUUSONE.js} +1 -1
- package/dist/{chunk-IH73ZCBB.js → chunk-6PURZLKM.js} +1 -1
- package/dist/{chunk-FI2DVNRT.js → chunk-73EHVDL5.js} +1 -1
- package/dist/{chunk-MSYRAPDK.js → chunk-7KASYSFM.js} +1 -1
- package/dist/{chunk-QVMXL675.js → chunk-7V6JPZBM.js} +1 -1
- package/dist/{chunk-H4TIVILC.js → chunk-7WWCIS2B.js} +1 -1
- package/dist/{chunk-OVNTCBNS.js → chunk-A74JRNNX.js} +1 -1
- package/dist/{chunk-ENRFXGID.js → chunk-ABAUIIPD.js} +1 -1
- package/dist/{chunk-HG2ILWCE.js → chunk-ABNQL3PQ.js} +1 -1
- package/dist/{chunk-EAWU2TOG.js → chunk-ACBNVGVJ.js} +1 -1
- package/dist/{chunk-4NEPHIAO.js → chunk-AFOP7DVG.js} +1 -1
- package/dist/{chunk-JTNEF5ZP.js → chunk-AL6IAMYV.js} +1 -1
- package/dist/chunk-APXJRWIJ.js +2 -0
- package/dist/{chunk-W2HRX3DR.js → chunk-ATCJ7EHL.js} +1 -1
- package/dist/{chunk-IZ66FKPC.js → chunk-BIGOLVK6.js} +1 -1
- package/dist/{chunk-PR5EGLEI.js → chunk-BIXABKSK.js} +1 -1
- package/dist/chunk-BK3LWNKB.js +102 -0
- package/dist/{chunk-3YIA3DSL.js → chunk-BPTWMV5L.js} +1 -1
- package/dist/{chunk-LXCTV75T.js → chunk-BV7NUIRT.js} +1 -1
- package/dist/{chunk-K4K2BGQC.js → chunk-BXAPTB2H.js} +3 -3
- package/dist/{chunk-X7S7IGCV.js → chunk-BXJNL22L.js} +1 -1
- package/dist/{chunk-Z24SD2EJ.js → chunk-C3DMMAFP.js} +1 -1
- package/dist/chunk-CBEMXSWF.js +2 -0
- package/dist/{chunk-YO6SNXBJ.js → chunk-CVVZ6NWR.js} +1 -1
- package/dist/{chunk-45NM23EQ.js → chunk-DAV4ONGS.js} +3 -3
- package/dist/{chunk-AUSLHNXQ.js → chunk-DBMDAWTA.js} +1 -1
- package/dist/{chunk-HWPWCCEV.js → chunk-DJ76NDW6.js} +1 -1
- package/dist/{chunk-O3TXAMFW.js → chunk-DRWHVVW6.js} +1 -1
- package/dist/{chunk-OKA6FPJM.js → chunk-DXXHCLFC.js} +1 -1
- package/dist/{chunk-35BG2EMW.js → chunk-E3C4OWSD.js} +1 -1
- package/dist/{chunk-V3OZJO7Y.js → chunk-ECPSBI2Z.js} +1 -1
- package/dist/{chunk-M7Y5GGVJ.js → chunk-EG3B52WU.js} +1 -1
- package/dist/{chunk-GZQAETB2.js → chunk-EOLMWSLX.js} +1 -1
- package/dist/{chunk-GAKBHNC4.js → chunk-EUGFABAS.js} +1 -1
- package/dist/{chunk-UMNCM4RJ.js → chunk-EWK3UPEN.js} +2 -2
- package/dist/{chunk-VE4HLIGA.js → chunk-EWSNJ3IX.js} +1 -1
- package/dist/chunk-F2F257PU.js +6 -0
- package/dist/{chunk-SALZ6WSF.js → chunk-F4XCCOWC.js} +1 -1
- package/dist/{chunk-2COXO5LQ.js → chunk-FH4FWIET.js} +1 -1
- package/dist/chunk-FQ2AMM3E.js +3 -0
- package/dist/{chunk-5KJU4MG4.js → chunk-FTP2K6RS.js} +1 -1
- package/dist/{chunk-UICJ2KLJ.js → chunk-GJYMR4RT.js} +1 -1
- package/dist/{chunk-226AGYHB.js → chunk-GMSWZIAS.js} +1 -1
- package/dist/{chunk-ABMM37L2.js → chunk-GPIVYCHQ.js} +1 -1
- package/dist/{chunk-ZDCXWEQG.js → chunk-GRQKMOKE.js} +1 -1
- package/dist/{chunk-E4GIGM5V.js → chunk-H6IPGZTP.js} +1 -1
- package/dist/{chunk-6JUS2ULI.js → chunk-H6QHG62O.js} +1 -1
- package/dist/{chunk-MINDIQET.js → chunk-HBGYEA3O.js} +1 -1
- package/dist/{chunk-PEUIHME2.js → chunk-HGKAUG7L.js} +1 -1
- package/dist/{chunk-A474TUCE.js → chunk-HMGM4KO6.js} +1 -1
- package/dist/{chunk-5F44KH3R.js → chunk-I3G3IUKY.js} +1 -1
- package/dist/{chunk-MP6NCJFE.js → chunk-IDWAG6L4.js} +1 -1
- package/dist/{chunk-TM6VLC6V.js → chunk-IPIARGHE.js} +1 -1
- package/dist/chunk-IQMJJN52.js +3 -0
- package/dist/{chunk-WEJR2V7R.js → chunk-J3XOEMKO.js} +1 -1
- package/dist/{chunk-GJXO6FF7.js → chunk-JBUKEIYL.js} +1 -1
- package/dist/{chunk-6SWHEBPR.js → chunk-JE5M5QIK.js} +1 -1
- package/dist/{chunk-6YBH3WUW.js → chunk-JJDD4HPX.js} +1 -1
- package/dist/{chunk-HX5OLRKU.js → chunk-JM45SLKV.js} +2 -2
- package/dist/{chunk-GEZVC4S3.js → chunk-JM6AKCN4.js} +1 -1
- package/dist/{chunk-3KY7HHQU.js → chunk-JSSM2TWY.js} +1 -1
- package/dist/{chunk-XCUF5AVM.js → chunk-JYSIPTX3.js} +10 -9
- package/dist/{chunk-5WLXAQ4H.js → chunk-KJZD2ADR.js} +1 -1
- package/dist/chunk-KLY6IQD5.js +26 -0
- package/dist/{chunk-LTPOMMAB.js → chunk-LB5NIDW6.js} +1 -1
- package/dist/{chunk-5MFPQYW3.js → chunk-LCBDNZL3.js} +1 -1
- package/dist/{chunk-SIHX5FW5.js → chunk-LJKTIKZY.js} +1 -1
- package/dist/{chunk-RDAIOJCR.js → chunk-LLDEAV3W.js} +1 -1
- package/dist/{chunk-HHOVANJ7.js → chunk-LV7OWLJK.js} +1 -1
- package/dist/{chunk-7DLDADQR.js → chunk-MNELOQ4J.js} +1 -1
- package/dist/{chunk-QUNIY6NN.js → chunk-MOAZZKIZ.js} +1 -1
- package/dist/{chunk-ET5EK2CM.js → chunk-MQU6EA44.js} +1 -1
- package/dist/chunk-MTMHB5LF.js +2 -0
- package/dist/{chunk-QB77LRF4.js → chunk-MWLRLQ27.js} +1 -1
- package/dist/{chunk-XZ6J3Y2W.js → chunk-MZ4GTIO2.js} +1 -1
- package/dist/chunk-NKJRAQ6L.js +6 -0
- package/dist/{chunk-75FF7J5R.js → chunk-NMCE7VR2.js} +1 -1
- package/dist/{chunk-7V34ZMMS.js → chunk-OKCVG7AG.js} +1 -1
- package/dist/{chunk-LZGAFKYH.js → chunk-OMCJD4LH.js} +1 -1
- package/dist/{chunk-54NJJVG5.js → chunk-OSEXVHEN.js} +1 -1
- package/dist/{chunk-EZMRWXRT.js → chunk-OVB5GVRB.js} +1 -1
- package/dist/{chunk-M3TFOFUQ.js → chunk-OX3ZAGCH.js} +1 -1
- package/dist/{chunk-73HMW2WA.js → chunk-P43YHCF3.js} +1 -1
- package/dist/{chunk-Z6SI7YNV.js → chunk-P7V24ZXP.js} +1 -1
- package/dist/{chunk-TMH4TPMB.js → chunk-PBVNX43X.js} +1 -1
- package/dist/{chunk-MEMXFTLD.js → chunk-PEHVBCXM.js} +1 -1
- package/dist/{chunk-2ULYGALF.js → chunk-PHKJIJ7D.js} +1 -1
- package/dist/{chunk-ZO3ZAMUU.js → chunk-PMYN3XMN.js} +2 -2
- package/dist/{chunk-R6TFRAMZ.js → chunk-PUNFWBRW.js} +1 -1
- package/dist/chunk-Q5B54TR5.js +2 -0
- package/dist/{chunk-ZDQYGLCZ.js → chunk-QEBVYQNC.js} +1 -1
- package/dist/{chunk-D4QXYAYA.js → chunk-QFA6JPVE.js} +2 -2
- package/dist/{chunk-TAY7J5VS.js → chunk-QLGQDNA3.js} +1 -1
- package/dist/{chunk-S7XCOBYD.js → chunk-QOXUGYEA.js} +1 -1
- package/dist/{chunk-BHQIH2FE.js → chunk-QXZGBYGQ.js} +1 -1
- package/dist/{chunk-LWCP4GLY.js → chunk-QYWWL7M7.js} +5 -5
- package/dist/{chunk-PWNYTIVA.js → chunk-RG3FNO37.js} +1 -1
- package/dist/{chunk-4HYPMGDF.js → chunk-RNKJXVG2.js} +1 -1
- package/dist/{chunk-RRKYHUOD.js → chunk-S5PIVHPC.js} +1 -1
- package/dist/{chunk-POA336CU.js → chunk-S74NLCFZ.js} +1 -1
- package/dist/chunk-SB26HQO7.js +2 -0
- package/dist/chunk-SBW3QVHN.js +7 -0
- package/dist/{chunk-44SIFDNY.js → chunk-SMSQVGLH.js} +1 -1
- package/dist/{chunk-4HARMERK.js → chunk-SO3IXFAJ.js} +1 -1
- package/dist/{chunk-T77LTLAD.js → chunk-SULRMI2J.js} +1 -1
- package/dist/{chunk-KN7GZWKK.js → chunk-SZQNYDST.js} +1 -1
- package/dist/chunk-T5FQRUI2.js +47 -0
- package/dist/{chunk-HVOXMCKE.js → chunk-TCK7WR3M.js} +1 -1
- package/dist/{chunk-Q5AKIQIE.js → chunk-TELSHQ3W.js} +1 -1
- package/dist/{chunk-FOLUB336.js → chunk-TFSWG7AS.js} +1 -1
- package/dist/{chunk-GJ7MO2FW.js → chunk-TLYFHPNM.js} +2 -2
- package/dist/{chunk-7O2FIZB7.js → chunk-TO2ROHIJ.js} +4 -4
- package/dist/{chunk-PRBWZXFA.js → chunk-TOOJTCON.js} +6 -6
- package/dist/{chunk-NCP54AIQ.js → chunk-TXRWH6HL.js} +2 -2
- package/dist/chunk-U5V3L5QH.js +2 -0
- package/dist/{chunk-O5KTMDTH.js → chunk-UVBPUZC4.js} +1 -1
- package/dist/{chunk-23DKB2MT.js → chunk-UVL6XQHU.js} +1 -1
- package/dist/{chunk-FYPIF3BE.js → chunk-UZKVV3LW.js} +1 -1
- package/dist/{chunk-YDB72F4K.js → chunk-V4SL74TK.js} +1 -1
- package/dist/chunk-V57R4X3O.js +5 -0
- package/dist/{chunk-LLQWEGXD.js → chunk-W5EDS4DF.js} +1 -1
- package/dist/{chunk-ZZZGTDYE.js → chunk-WB4JZ67W.js} +1 -1
- package/dist/{chunk-W54BX6HC.js → chunk-WCIRLITM.js} +1 -1
- package/dist/{chunk-BJT6PZXL.js → chunk-WHMCVH3T.js} +1 -1
- package/dist/chunk-WLEWXE6L.js +2 -0
- package/dist/{chunk-4LGQHTXM.js → chunk-WMIR4UXG.js} +1 -1
- package/dist/chunk-WMXBRC4B.js +21 -0
- package/dist/{chunk-RQKMSNEU.js → chunk-WTMCDYR3.js} +1 -1
- package/dist/{chunk-DXIQVBMI.js → chunk-WZ3FE5MT.js} +1 -1
- package/dist/{chunk-NVD2MXHQ.js → chunk-X3O4VGTM.js} +1 -1
- package/dist/{chunk-GLM5UGTF.js → chunk-X66NIHT4.js} +1 -1
- package/dist/{chunk-B7ZX5HEN.js → chunk-XDAFRUAJ.js} +1 -1
- package/dist/{chunk-JNPFEBUR.js → chunk-XDAHKZ4J.js} +1 -1
- package/dist/{chunk-ZCL7XIVS.js → chunk-XKJZG4GR.js} +1 -1
- package/dist/chunk-XTQUCCJH.js +2 -0
- package/dist/{chunk-SVIIUKJ2.js → chunk-Y7GSOKXS.js} +1 -1
- package/dist/chunk-YIBLZIXF.js +13 -0
- package/dist/{chunk-FAMQ4DHU.js → chunk-YKOZBFR3.js} +1 -1
- package/dist/{chunk-K75WIRI5.js → chunk-YWQNZRJG.js} +1 -1
- package/dist/chunk-YZP4F23B.js +18 -0
- package/dist/{chunk-HNF3PWF3.js → chunk-Z4O5HOFX.js} +6 -6
- package/dist/{chunk-6CS23F3E.js → chunk-ZFKR5I3J.js} +1 -1
- package/dist/{chunk-OK6NLITG.js → chunk-ZHENGHYZ.js} +1 -1
- package/dist/{chunk-SSOUYKVG.js → chunk-ZIRSTOEV.js} +1 -1
- package/dist/{chunk-A7IMHUFY.js → chunk-ZVSZ6DIQ.js} +5 -5
- package/dist/command-span-HZSKIZH7.js +2 -0
- package/dist/commands-X5T6YANK.js +2 -0
- package/dist/{committer-UO3B3S5Y.js → committer-L2HXEODA.js} +1 -1
- package/dist/{config-YMHI3H3Y.js → config-F5Q6QX27.js} +1 -1
- package/dist/cover-cmd-PWUZU4HK.js +2 -0
- package/dist/{credentials-BCR73VGS.js → credentials-D5KQMHCK.js} +1 -1
- package/dist/{deps-bundle-6WLX44OA.js → deps-bundle-R7FNIV4M.js} +1 -1
- package/dist/{deps-resolve-DSAKPZ3T.js → deps-resolve-IF6P6NWI.js} +1 -1
- package/dist/design-chat-HYK3HNIM.js +2 -0
- package/dist/{design-committer-7YIPFKMO.js → design-committer-ZKNW5LUS.js} +1 -1
- package/dist/design-headless-DR7WB37W.js +2 -0
- package/dist/design-remote-TGUNEWEM.js +3 -0
- package/dist/device-env-LZB3PKMA.js +2 -0
- package/dist/dispatch-BGH5PVZ4.js +2 -0
- package/dist/doctor-PLFEA2HM.js +2 -0
- package/dist/{docx-convert-DO5AQYD3.js → docx-convert-PA5S2S7P.js} +1 -1
- package/dist/{dossier-5XKNAK6Q.js → dossier-B6KBSRJY.js} +1 -1
- package/dist/evidence-SRWISQMQ.js +2 -0
- package/dist/evolve-cmd-2BALEYZU.js +2 -0
- package/dist/evolve-remote-OHOUWO65.js +2 -0
- package/dist/exit-manager-UZ7DGXS4.js +2 -0
- package/dist/{explain-cmd-KNDORU2D.js → explain-cmd-A5YMPXAJ.js} +1 -1
- package/dist/explain-cmd-VTDAMXAW.js +12 -0
- package/dist/explore-UZWQRJ7H.js +2 -0
- package/dist/explore-context-tty-PAKJVDJU.js +2 -0
- package/dist/explore-entry-ZOPO7DBZ.js +6 -0
- package/dist/{explore-live-TRY5A2ME.js → explore-live-RUAAZGX4.js} +1 -1
- package/dist/{explore-run-tty-ZV5XFKZA.js → explore-run-tty-DYLMHI7F.js} +2 -2
- package/dist/{extract-bind-TXUBMK3T.js → extract-bind-WPICR4IC.js} +3 -3
- package/dist/extract-chat-KVUB5HPM.js +2 -0
- package/dist/{extract-cmd-YUOYMVF5.js → extract-cmd-OJ7LXSKL.js} +2 -2
- package/dist/extract-headless-OQJSUSG4.js +2 -0
- package/dist/{feeder-NGWIPZ26.js → feeder-VAY4NYBX.js} +1 -1
- package/dist/folder-flags-MEZUAXTT.js +2 -0
- package/dist/gaps-cmd-2R4RMWN6.js +3 -0
- package/dist/gate-SM4HPJLA.js +2 -0
- package/dist/gate-VJ7W5QIH.js +2 -0
- package/dist/{generate-headless-KMBBZTLS.js → generate-headless-XR3RVULC.js} +3 -3
- package/dist/hold-passthrough-ZHOC2Q26.js +2 -0
- package/dist/identity-66TGWITQ.js +2 -0
- package/dist/{impact-cmd-PW33L5RF.js → impact-cmd-EL3QSOAF.js} +2 -2
- package/dist/index.js +185 -179
- package/dist/ingest-6UQGSQYU.js +2 -0
- package/dist/ingest-cmd-N3USC7TW.js +8 -0
- package/dist/ingest-remote-2VKWAFJZ.js +2 -0
- package/dist/install-3IEM3I3X.js +2 -0
- package/dist/{interactive-bind-FDWJUTI6.js → interactive-bind-F7QTQOKC.js} +4 -4
- package/dist/{interactive-remote-O2Q2FNOH.js → interactive-remote-A33J4KMP.js} +2 -2
- package/dist/lane-EHU4JRRU.js +2 -0
- package/dist/lattice-auth-IJT542IF.js +2 -0
- package/dist/lifecycle-cmd-OKUFZKEX.js +2 -0
- package/dist/list-cmd-7OTI66MQ.js +3 -0
- package/dist/list-commands-FZPVH76I.js +2 -0
- package/dist/{list-remote-AA3VSWOI.js → list-remote-BQ4NILCA.js} +1 -1
- package/dist/{locks-cmd-AZKCSGHI.js → locks-cmd-76IU4JB7.js} +1 -1
- package/dist/{logical-ids-74PLU3VR.js → logical-ids-YMNV2MDB.js} +1 -1
- package/dist/login-flow-BYQ7SYGB.js +2 -0
- package/dist/maintenance-cmd-BLV7K4RK.js +2 -0
- package/dist/mobile-prompts-5TGLJUBV.js +2 -0
- package/dist/onboarding-F4EIJ4GD.js +5 -0
- package/dist/open-provider-LXCPVNUU.js +2 -0
- package/dist/{pdf-convert-YB6PJFMI.js → pdf-convert-N2C3KB4Q.js} +1 -1
- package/dist/persist-recorded-session-WYMOHDTB.js +3 -0
- package/dist/phase-seed-G5JSYKSL.js +2 -0
- package/dist/pipeline-XYM6HIDZ.js +2 -0
- package/dist/{policy-commands-3YJ6YCDN.js → policy-commands-AOLVAZZD.js} +1 -1
- package/dist/prepare-target-P4AZWC37.js +2 -0
- package/dist/pull-cmd-C4HMYD4I.js +2 -0
- package/dist/pull-route-MHW5PWDW.js +2 -0
- package/dist/readmodel-FARAAPUU.js +2 -0
- package/dist/real-device-run-WAOWKEFJ.js +2 -0
- package/dist/reconcile-cmd-VXY737OT.js +5 -0
- package/dist/reconcile-deps-TILDRCHG.js +2 -0
- package/dist/{reconcile-remote-6WISFGRG.js → reconcile-remote-UGW2433E.js} +2 -2
- package/dist/recording-banner-EPOTSMYF.js +2 -0
- package/dist/registry-WTWTFRXD.js +2 -0
- package/dist/remote-entry-SPA4CSJJ.js +2 -0
- package/dist/remote-mode-QO6BDGXM.js +4 -0
- package/dist/remote-words-TAZT4YBT.js +2 -0
- package/dist/{require-project-folder-ZK4JJCDB.js → require-project-folder-WBCAVVMB.js} +1 -1
- package/dist/resolve-run-intent-RBOCIYEA.js +2 -0
- package/dist/{resolver-RMHGGYRP.js → resolver-3BGIXYYJ.js} +1 -1
- package/dist/revert-F6MKJ73M.js +2 -0
- package/dist/review-cmd-WE6I5XTY.js +5 -0
- package/dist/run-EABFRFOF.js +2 -0
- package/dist/run-LX3ARF53.js +2 -0
- package/dist/run-remote-6Y62RWMJ.js +2 -0
- package/dist/run-startup-gate-Q7FP2IRE.js +2 -0
- package/dist/run-test-md-24MBKBC6.js +20 -0
- package/dist/session-worker.js +2 -2
- package/dist/{sessions-cmd-CABAX7BO.js → sessions-cmd-5NS5P4CP.js} +2 -2
- package/dist/{sessions-remote-Y4FTZL7Y.js → sessions-remote-75PDRPOY.js} +1 -1
- package/dist/{skill-installer-FS2AV7GX.js → skill-installer-7PK64TZE.js} +1 -1
- package/dist/store-AVYBL5HB.js +2 -0
- package/dist/store-choice-ZWU3PDNL.js +2 -0
- package/dist/store-guard-ETUXXG7X.js +2 -0
- package/dist/{store-site-K5NHLI7D.js → store-site-AFXB6SBW.js} +1 -1
- package/dist/{stream-warnings-GM7YEOVG.js → stream-warnings-I5LUWVFU.js} +1 -1
- package/dist/support-id-RISKXA53.js +2 -0
- package/dist/sync-cmd-CSTMT6E6.js +2 -0
- package/dist/sync-setup-Y53K6TJ6.js +2 -0
- package/dist/tcg-generate-VQLI6NGK.js +2 -0
- package/dist/{test-definition-53XNBEDE.js → test-definition-GXEKFRRB.js} +1 -1
- package/dist/testmd-actions-BE4YJ6ZZ.js +2 -0
- package/dist/{testmd-sync-EEJ7GPLR.js → testmd-sync-QZWVWTZZ.js} +1 -1
- package/dist/{tms-client-XWCR7O7J.js → tms-client-J4OCD3EP.js} +1 -1
- package/dist/token-refresh-PZ3TOKAL.js +2 -0
- package/dist/{use-case-ref-44BPIP4N.js → use-case-ref-E3PJDHQB.js} +1 -1
- package/dist/{validate-basic-3JZRZL45.js → validate-basic-QWPESO74.js} +1 -1
- package/dist/verdicts-KB6YTIY6.js +2 -0
- package/dist/{version-check-IY3YSQIP.js → version-check-EOYWTY3Z.js} +1 -1
- package/dist/{view-cmd-WUIGTRFX.js → view-cmd-KG4HI334.js} +1 -1
- package/dist/walk-session-WM4S2JMV.js +2 -0
- package/dist/with-telemetry-RJM3JKL6.js +2 -0
- package/package.json +11 -11
- package/dist/ChatSurface-FIYDTZSI.js +0 -2
- package/dist/ChromeProfilePicker-Q6FIGVYU.js +0 -2
- package/dist/EvidenceViewOffer-LKPN5BHX.js +0 -2
- package/dist/FolderPicker-H5K74PCH.js +0 -2
- package/dist/InfoBox-DNSOAK5L.js +0 -2
- package/dist/LinksBox-32TZOANP.js +0 -2
- package/dist/ProfilesView-UC4MPM54.js +0 -2
- package/dist/ProjectPicker-ZJ5RW6XL.js +0 -2
- package/dist/SaveSessionPrompt-F327WC7A.js +0 -2
- package/dist/SingleShotApp-OMLRYOSI.js +0 -2
- package/dist/SummaryBox-XGFO5X76.js +0 -2
- package/dist/TestMdRunView-ZZ77QTAQ.js +0 -2
- package/dist/TestrunEvidenceTable-G7MPF55X.js +0 -2
- package/dist/app-download-XEDO3EMV.js +0 -2
- package/dist/bind-H3ALI2NG.js +0 -2
- package/dist/bootstrap-JEVSVPQ2.js +0 -2
- package/dist/chat-committer-ZKEKJA2R.js +0 -2
- package/dist/chat-controller-FXRJXUG3.js +0 -2
- package/dist/child-JHYENXE7.js +0 -2
- package/dist/chunk-5F5IVART.js +0 -8
- package/dist/chunk-6K5BEEAJ.js +0 -2
- package/dist/chunk-6LEHGRRG.js +0 -34
- package/dist/chunk-6SD4XTYC.js +0 -6
- package/dist/chunk-7PCLHURF.js +0 -101
- package/dist/chunk-7XJNYLQW.js +0 -18
- package/dist/chunk-A4ZV2SHL.js +0 -5
- package/dist/chunk-B57ZRHEQ.js +0 -3
- package/dist/chunk-DLP5S3TO.js +0 -3
- package/dist/chunk-DREQ3RAA.js +0 -2
- package/dist/chunk-DXLZCJH5.js +0 -7
- package/dist/chunk-O2Y46A3G.js +0 -26
- package/dist/chunk-PC22QRIY.js +0 -2
- package/dist/chunk-RAVAJZV2.js +0 -47
- package/dist/chunk-SXRHKXSE.js +0 -2
- package/dist/chunk-UJLULWSR.js +0 -21
- package/dist/chunk-VO66KP2W.js +0 -2
- package/dist/chunk-X52YIWGG.js +0 -13
- package/dist/chunk-Y6Y6RAY4.js +0 -2
- package/dist/commands-R5AYK6XM.js +0 -2
- package/dist/cover-cmd-DVQIGFDY.js +0 -2
- package/dist/design-chat-YUI2JPO6.js +0 -2
- package/dist/design-headless-KIP6R7UV.js +0 -2
- package/dist/design-remote-XMSHDDUX.js +0 -3
- package/dist/device-env-K7J5NN66.js +0 -2
- package/dist/dispatch-BV6XMCN3.js +0 -2
- package/dist/doctor-PGTNOMSP.js +0 -2
- package/dist/evidence-RO3RDZXO.js +0 -2
- package/dist/evolve-cmd-U2ALVGMT.js +0 -2
- package/dist/evolve-remote-K2MCCVMM.js +0 -2
- package/dist/exit-manager-EGWAZHCR.js +0 -2
- package/dist/explain-cmd-UWK5YVXG.js +0 -12
- package/dist/explore-S2BGQUIF.js +0 -2
- package/dist/explore-context-tty-WJHUSP3A.js +0 -2
- package/dist/explore-entry-3EX2T3NS.js +0 -6
- package/dist/extract-chat-VPYDGQKO.js +0 -2
- package/dist/extract-headless-UWTAPOET.js +0 -2
- package/dist/folder-flags-WV7UV3JG.js +0 -2
- package/dist/gaps-cmd-PFV3FZCM.js +0 -3
- package/dist/gate-7ALXLCNB.js +0 -2
- package/dist/gate-NB5CJMTN.js +0 -2
- package/dist/hold-passthrough-JGHWMYDM.js +0 -2
- package/dist/identity-HL5CJJXR.js +0 -2
- package/dist/ingest-ZHHHBUXR.js +0 -2
- package/dist/ingest-cmd-MXYILQLV.js +0 -8
- package/dist/ingest-remote-2EEJP6ML.js +0 -2
- package/dist/install-7J34AYB6.js +0 -2
- package/dist/lane-CNGO7LH5.js +0 -2
- package/dist/lattice-auth-TXNDLHM6.js +0 -2
- package/dist/lifecycle-cmd-GFHDBRXX.js +0 -2
- package/dist/list-cmd-RR75PMPE.js +0 -3
- package/dist/list-commands-3QGZWJ5P.js +0 -2
- package/dist/login-flow-ZQ6UFTS2.js +0 -2
- package/dist/maintenance-cmd-OHGVARQ2.js +0 -2
- package/dist/mobile-prompts-FZRKLLTN.js +0 -2
- package/dist/onboarding-NXGMV3VG.js +0 -5
- package/dist/open-provider-XDJKT3W3.js +0 -2
- package/dist/persist-recorded-session-INFN4JZT.js +0 -3
- package/dist/phase-seed-ZZSJME7M.js +0 -2
- package/dist/pipeline-MVZRI6YZ.js +0 -2
- package/dist/prepare-target-DII5WZCX.js +0 -2
- package/dist/pull-cmd-XZN53XFZ.js +0 -2
- package/dist/pull-route-R33BVADE.js +0 -2
- package/dist/readmodel-TRV4E3MW.js +0 -2
- package/dist/real-device-run-DGENHGUV.js +0 -2
- package/dist/reconcile-cmd-KFPRCCJB.js +0 -5
- package/dist/reconcile-deps-UDQBWSLE.js +0 -2
- package/dist/recording-banner-XOX2CDCF.js +0 -2
- package/dist/registry-NV3EMDMK.js +0 -2
- package/dist/remote-entry-BCTFT643.js +0 -2
- package/dist/remote-mode-4HN27MD4.js +0 -4
- package/dist/remote-words-LFDYKIZ7.js +0 -2
- package/dist/resolve-run-intent-LYLVNNDZ.js +0 -2
- package/dist/revert-QKHPCRT6.js +0 -2
- package/dist/review-cmd-UGF2FC5Y.js +0 -5
- package/dist/run-CSYGVV3D.js +0 -2
- package/dist/run-YUHHD54J.js +0 -2
- package/dist/run-remote-BGKQDAOA.js +0 -2
- package/dist/run-startup-gate-4XE73OON.js +0 -2
- package/dist/run-test-md-G6U3RU2Q.js +0 -19
- package/dist/store-PLKJZTGC.js +0 -2
- package/dist/store-choice-UAB6Z4AL.js +0 -2
- package/dist/store-guard-DUN2X3SR.js +0 -2
- package/dist/sync-cmd-AGTOGPYM.js +0 -2
- package/dist/sync-setup-4KIY3PDO.js +0 -2
- package/dist/tcg-generate-CUY4AZ2V.js +0 -2
- package/dist/testmd-actions-UD6PAWUX.js +0 -2
- package/dist/token-refresh-K6PVBBFE.js +0 -2
- package/dist/verdicts-PVB7TV5S.js +0 -2
- package/dist/walk-session-EH7227WR.js +0 -2
- package/dist/with-telemetry-7JMZUBUZ.js +0 -2
package/dist/chunk-A4ZV2SHL.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as et,c as nt}from"./chunk-W3USRQX6.js";import{R as tt}from"./chunk-7O2FIZB7.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{b as Q}from"./chunk-Z36KVIRR.js";import{b as W,e as X}from"./chunk-6K5BEEAJ.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
|
-
`)?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 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",js_dialog:"JS_DIALOG",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 gt(e){try{return JSON.parse(e.output_value??"{}")}catch{return{}}}function $t(e){let t=e.output_variable??"";if(!t)return"[]";let r={...gt(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,g={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&&(g.code=r.code),d==="analyze"&&typeof r.code_js=="string"&&r.code_js&&(g.code_js=r.code_js),d==="analyze"&&typeof r.condition_expression=="string"&&r.condition_expression&&(g.condition_expression=r.condition_expression),r.uses_websocket===!0&&(g.uses_websocket=!0),r.uses_sse===!0&&(g.uses_sse=!0),d==="analyze"&&r.analyzer_type==="textual_visual"&&(typeof r.wrapped_js=="string"&&(g.wrapped_js=r.wrapped_js),Array.isArray(r.locators)&&(g.locators=r.locators),typeof r.operator=="string"&&(g.operator=r.operator),Array.isArray(r.transforms)&&(g.transforms=r.transforms),typeof r.query=="string"&&(g.query=r.query),typeof r.expected_value=="string"&&(g.expected_value=r.expected_value),typeof r.needs_unit_conversion=="boolean"&&(g.needs_unit_conversion=r.needs_unit_conversion),typeof r.condition=="string"&&(g.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&&(g[m]=r[m]),d==="set_clipboard"&&typeof r.html=="string"&&r.html&&(g.html=r.html),g}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 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 Kt(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 Ht(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 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??{},g=e.action_id??v(),f=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==="js_dialog")h=i.prompt_text??"";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:g,instruction_id:f,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&&r!=="js_dialog"?`${t}/test_screenshots/untagged_screenshot/${g}.${n?.get(g)??"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:r==="js_dialog"?i.action??"":"",dialog_type:r==="js_dialog"?i.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,g,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:gt(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(g=>g.branch_index===u)?.sub_results??[];d.length>0&&(_=d.map(g=>({description:g.description??c.condition,store_key:g.store_key??"",expected_value:g.expected??"true",stored_value:g.extracted_value??void 0,operator:g.operator??"equals",transforms:g.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"&&a!=="js_dialog"&&!(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 g=B(l,t,n);ht(g,c,u);let f=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:g,error_message:b?h??null:null,error_code:b?m??null:null,result_code:f??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,g="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)){g=m.status??"success",i+=1;break}d>0&&p.push(m),i+=1}let f=B(p,t,n);c.push(...f)}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 g=B(d.records,t,n,r);if(g.length===0)continue;let f=v().replace(/-/g,"");ht(g,f,d.objective);let m=g.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_${f}`,generative_id:f,objective:d.objective,status:I,children:g,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,g)=>({block:d,flat:i[g]})),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 ge,basename as fe}from"path";import{tmpdir as me}from"os";var he=["**/screenshots/**","**/annotated/**","**/tcg/**","**/bifurcation/**"];async function St(e){let t=ge(me(),`${fe(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((f,m)=>f+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 g=n?.packTestDir??this.config.evidenceRead?.packTestDir;if(g){let f=y(g,"auteur");K(f,{recursive:!0}),w(y(f,"execution.json"),JSON.stringify(_,null,2)),this.log("info","PIPELINE_CONVERT_PACK_COPY","Execution blob copied into pack",{path:y(f,"execution.json")}),this.deriveArchivedAttemptBlobs(g)}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 f=null,m;try{f=await St(this.config.sessionDir),m=await wt(f),this.log("info","PIPELINE_ZIP_DONE","Zip complete",{size_mb:+(m.length/1024/1024).toFixed(1),path:f}),t("zip","done",`${(m.length/1024/1024).toFixed(1)}MB`)}finally{f&&await ye(f).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 g=this.readAuthoredExecution(),f=g?this.refreshReplayOnlyInPack(g,a,c):null;w(y(d,"execution.json"),f?.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:f?f.refreshed.length>0?"authored+replay_results":"authored":"run_envelope",...f&&f.refreshed.length>0?{refreshed_instruction_ids:f.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 g=y(p,d.file_name),f=await R(d.file_url);if(!f.ok){this.log("warn","PIPELINE_CODE_EXPORT_FILE_FAILED","Failed to download file",{file_name:d.file_name,status:f.status});continue}let m=await f.text();w(g,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};
|
package/dist/chunk-B57ZRHEQ.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as O}from"./chunk-QSCXXNC2.js";import{a as k,b as P}from"./chunk-6PIIUAZF.js";import{b as A}from"./chunk-VO66KP2W.js";import{n as L}from"./chunk-G4K3TP2I.js";import{a as b,b as R,c as x,d as y,e as T,g as I,h as f}from"./chunk-UJLULWSR.js";import{d as w,g as p}from"./chunk-ZCRZFAOT.js";import{a as v}from"./chunk-RZ4F3BHX.js";import{a as m,i as S}from"./chunk-FAMQ4DHU.js";var h=class{config;buffer=[];stepBuffer=new Map;flushTimer=null;currentRunIndex=null;stopped=!1;_inFlightFlush=null;_stoppingFast=!1;_droppedBatches=0;_droppedEntries=0;constructor(e){this.config=e}start(){if(this.flushTimer)return;let e=this.config.flushIntervalMs??5e3;this.flushTimer=setInterval(()=>{this.flush().catch(()=>{})},e),this.flushTimer.unref&&this.flushTimer.unref()}setRunIndex(e){this.currentRunIndex=e}log(e,t,n,s={}){if(this.stopped)return;let o=this.buildEntry(e,t,n,s);this.buffer.push(o)}logStep(e,t,n,s={}){if(this.stopped)return;let o=this.buildEntry("debug",t,n,s);o.run_index=e,this.stepBuffer.has(e)||this.stepBuffer.set(e,[]),this.stepBuffer.get(e).push(o)}escalate(e){let t=this.stepBuffer.get(e);t&&t.length>0&&this.buffer.push(...t),this.stepBuffer.delete(e)}discardSteps(e){this.stepBuffer.delete(e)}async flush(){if(this.buffer.length===0)return;let e=this._flushBody();this._inFlightFlush=e;try{await e}finally{this._inFlightFlush===e&&(this._inFlightFlush=null)}}async _flushBody(){let e=this.buffer.splice(0),t=null;try{t=await this.config.getToken()}catch{this.buffer.unshift(...e);return}let n={"Content-Type":"application/json"};t&&(n.Authorization=`Bearer ${t}`);let s=JSON.stringify(e);for(let o=0;o<3;o++){try{let l=new AbortController,a=setTimeout(()=>l.abort(),1e4),c=await v(this.config.proxyUrl,{method:"POST",headers:n,body:s,signal:l.signal});if(clearTimeout(a),c.ok)return}catch{}if(this._stoppingFast){this.buffer.unshift(...e);return}o<2&&await new Promise(l=>setTimeout(l,1e3*Math.pow(2,o)))}this._droppedBatches++,this._droppedEntries+=e.length}async flushOnce(e){if(this.buffer.length===0)return"empty";let t=this.buffer.splice(0),n=Date.now()+e,s=!1,o,l=null;try{l=await Promise.race([this.config.getToken(),new Promise(d=>{o=setTimeout(()=>{s=!0,d(null)},e),o.unref&&o.unref()})])}catch{l=null}finally{o&&clearTimeout(o)}let a=n-Date.now();if(s||a<=0)return this.buffer.unshift(...t),"timeout";let c={"Content-Type":"application/json"};l&&(c.Authorization=`Bearer ${l}`);try{let d=new AbortController,u=setTimeout(()=>d.abort(),a);u.unref&&u.unref();let r=await v(this.config.proxyUrl,{method:"POST",headers:c,body:JSON.stringify(t),signal:d.signal});return clearTimeout(u),r.ok?"sent":(this.buffer.unshift(...t),"failed")}catch{return this.buffer.unshift(...t),Date.now()>=n?"timeout":"failed"}}async stopAndFlushOnce(e){let t=Date.now()+e;this._stoppingFast=!0,this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null);let n=this._inFlightFlush;if(n){let o;await Promise.race([n.catch(()=>{}),new Promise(l=>{o=setTimeout(l,e),o.unref&&o.unref()})]),o&&clearTimeout(o)}if(this.buffer.length===0)return"empty";let s=t-Date.now();if(s<=0)return"timeout";try{return await this.flushOnce(s)}catch{return"failed"}}drainBuffer(){return this.buffer.splice(0)}get droppedBatches(){return this._droppedBatches}get droppedEntries(){return this._droppedEntries}async shutdown(){this._droppedBatches>0&&this.log("warn","LOG_DROPS",`Dropped ${this._droppedEntries} entries in ${this._droppedBatches} batches`,{dropped_batches:this._droppedBatches,dropped_entries:this._droppedEntries}),this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null),await this.flush()}shutdownSync(){this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null)}get bufferSize(){return this.buffer.length}stepBufferSize(e){return this.stepBuffer.get(e)?.length??0}buildEntry(e,t,n,s){return{hostname:"kane-cli",service:"kane-cli",ddsource:"kane-cli",ddtags:`version:${this.config.device.cli_version}`,level:e,event:t,message:n,session_id:this.config.sessionId,run_index:t.startsWith("tcg_")?null:this.currentRunIndex,identity:this.config.identity,device:this.config.device,context:s,timestamp:new Date().toISOString()}}};import{platform as $,arch as V}from"os";import M from"fs";import B from"fs";import U from"path";var F=1e3,_=0,j=new Set([130,3]),g=class i{ids;logger;opts;ended=!1;createdAt=Date.now();errorState;constructor(e,t={emitted:!1}){this.ids=e.envelope,this.logger=e.logger,this.opts=e,this.errorState=t}get enabled(){return this.logger!==null}event(e,t={}){if(!this.logger)return;e==="ASR_ERROR"&&(this.errorState.emitted=!0);let n=y(this.ids,e,t);this.logger.log(x[e],e,e,C(n))}error(e,t={}){this.logger&&(this.logger.escalate(_),this.event("ASR_ERROR",{...t,error_code:e}))}child(e,t){return new i({...this.opts,envelope:{...this.ids,operation_id:t,parent_operation_id:this.ids.operation_id,verb:"design"}},this.errorState)}async lateBindContext(e){if(!(!this.logger||this.ids.context_instance_id))try{let{ensureStoreIds:t}=await import("./store-id-YZ5WKJ25.js"),{ids:n,cloned:s}=t(e,p());this.ids.context_lineage_id=n.context_lineage_id,this.ids.context_instance_id=n.context_instance_id,s&&this.event("ASR_CONTEXT_CLONED")}catch{}}spoolError(e,t={}){this.logger&&(this.event("ASR_ERROR",{...t,error_code:e}),T(this.logger.drainBuffer()))}agentSession(e){this.ids.agent_session_id=e}spawnEnv(){if(!this.opts.telemetryEnabled)return{};let e={TESTMUAI_USER_SESSION_ID:this.ids.session_id,TESTMUAI_OPERATION_ID:this.ids.operation_id,TESTMUAI_CLIENT_VERSION:this.opts.clientVersion,TESTMUAI_TELEMETRY_PROXY_URL:this.opts.proxyUrl};return this.ids.context_instance_id&&(e.TESTMUAI_CONTEXT_INSTANCE_ID=this.ids.context_instance_id),e}traceTee(){return e=>{if(!this.logger)return;let t=typeof e.kind=="string"?e.kind.slice(0,64):"trace",n={...C(y(this.ids,"ASR_CMD_START",{})),trace_kind:t};typeof e.code=="string"&&(n.trace_code=e.code.slice(0,64)),delete n.event,this.logger.logStep(_,`trace_${t}`,t,n)}}wireTrace(e,t,n){if(!this.logger)return;n&&this.agentSession(n);let s=t&&typeof t=="object"?t:{};switch(e){case"spawn":this.event("ASR_AGENT_SPAWN",{tier:s.tier});break;case"session_paused":this.event("ASR_SESSION_PAUSED",s);break;case"commit":this.event("ASR_COMMIT",s);break;case"design_phase_committed":this.event("ASR_COMMIT",{phase:s.phase,duration_ms:s.ms});break;default:this.traceTee()({kind:e,code:typeof s.code=="string"?s.code:void 0})}}banner(){return`session: ${this.ids.session_id}`}supportFooter(){return`if this keeps failing, share this id with support: ${this.ids.session_id}`}async end(e){if(!this.ended){if(this.ended=!0,e.duration_ms===void 0&&(e={...e,duration_ms:Date.now()-this.createdAt}),this.logger)if(e.exit_code===0?this.logger.discardSteps(_):this.logger.escalate(_),e.exit_code>0&&!j.has(e.exit_code)&&!this.errorState.emitted&&this.event("ASR_ERROR",{error_code:e.exit_code===2?"usage_exit_unattributed":`exit_${e.exit_code}_unattributed`,exit_code:e.exit_code}),this.event("ASR_CMD_END",e),this.opts.longSession)await this.logger.shutdown();else{let t=await this.logger.flushOnce(F);(t==="failed"||t==="timeout")&&T(this.logger.drainBuffer())}this.logger&&this.writeManifestLine(e.exit_code),f(null)}}writeManifestLine(e){try{let t=w(this.ids.context_instance_id??null);B.mkdirSync(U.dirname(t),{recursive:!0});let n={ts:new Date().toISOString(),session_id:this.ids.session_id,operation_id:this.ids.operation_id,agent_session_id:this.ids.agent_session_id,verb:this.ids.verb,mode:this.ids.mode,exit_code:e};B.appendFileSync(t,JSON.stringify(n)+`
|
|
3
|
-
`,{flag:"a",mode:384})}catch{}}};function C(i){let e={event:i.event,session_id:i.session_id,operation_id:i.operation_id,verb:i.verb,mode:i.mode,component:i.component,seq:i.seq,context_lineage_id:i.context_lineage_id,context_instance_id:i.context_instance_id};i.parent_operation_id&&(e.parent_operation_id=i.parent_operation_id),i.agent_session_id&&(e.agent_session_id=i.agent_session_id),i.lattice_session_id&&(e.lattice_session_id=i.lattice_session_id),i.project_id&&(e.project_id=i.project_id);for(let[t,n]of Object.entries(i.context))e[t]=n;return e}import{isMainThread as X}from"worker_threads";var E=()=>process.env.KANE_TELEMETRY_URL||S;function Y(){return process.env.TESTMUAI_BASE_URL?"custom":process.env.TESTMUAI_ENV==="stage"?"stage":"prod"}function z(){return process.env.KANE_TELEMETRY!=="0"&&(!process.env.VITEST||process.env.KANE_TELEMETRY==="1")}function me(i){let e=z(),t=i.env??Y(),n=i.sessionId??null;if(!n&&i.resumeSid&&i.contextRoot)try{let r=L(i.contextRoot,i.resumeSid);r?.user_session_id&&(n=r.user_session_id)}catch{}if(!n&&i.applyPlanPath)try{let r=JSON.parse(M.readFileSync(i.applyPlanPath,"utf8"));r.telemetry?.user_session_id&&(n=r.telemetry.user_session_id)}catch{}let s=i.sessionId===void 0?n!==null:i.resumeSid!==void 0;n||(n=b());let o=null,l=null,a=!1;if(i.contextRoot&&M.existsSync(i.contextRoot))if(i.write&&e){let r=P(i.contextRoot,p());o=r.ids.context_lineage_id,l=r.ids.context_instance_id,a=r.cloned}else{let r=k(i.contextRoot);o=r?.context_lineage_id??null,l=r?.context_instance_id??null}let c={session_id:n,operation_id:R(),context_lineage_id:o,context_instance_id:l,...i.remote?{lattice_session_id:i.remote.sessionId,project_id:i.remote.projectId}:{},verb:i.verb,mode:i.mode,component:"kane-cli"},d=null;if(e){let r=A(t),N={org_id:r.org_id??"",user_id:r.user_id??"",machine_id:r.machine_id,email:null,email_domain:"",user_type:r.user_type??"unknown",env:r.env,plan:r.plan??"unknown"},D=i.mode==="interactive"||i.mode==="cli"?"cli":"agent";d=new h({proxyUrl:E(),sessionId:n,identity:N,device:{cli_version:m,platform:$(),arch:V(),host_agent:O(),invocation_mode:D},getToken:async()=>null}),i.longSession&&d.start()}let u=new g({envelope:c,logger:d,longSession:!!i.longSession,proxyUrl:E(),clientVersion:`kane-cli/${m}`,telemetryEnabled:e});return e&&!i.errorsOnly&&(f(c),u.event("ASR_CMD_START",{resumed:s,applied_plan:!!i.applyPlanPath}),a&&u.event("ASR_CONTEXT_CLONED"),X&&I(E()).catch(()=>{})),u}export{h as a,F as b,E as c,Y as d,z as e,me as f};
|
package/dist/chunk-DLP5S3TO.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as h}from"./chunk-72KYMWQ5.js";import{a as m}from"./chunk-CCOD4GQJ.js";import{a as d}from"./chunk-JQ64X2TO.js";import{a as p}from"./chunk-3G2LSTK5.js";import{a as V}from"./chunk-4IEQNX7F.js";import{a as y}from"./chunk-FI2DVNRT.js";import{a as g}from"./chunk-4QTH7VYE.js";import{a as c}from"./chunk-RZ4F3BHX.js";var u=class{constructor(e){this.baseUrl=e}async pushSecret(e){let s=g(e.username,e.accessKey),n=await c(`${this.baseUrl}/logistics/v1.0/secrets/create`,{method:"PUT",headers:{Authorization:s,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({secretKey:e.secretKey,secretValue:e.secretValue,orgId:e.orgId,username:e.username,scope:"user",type:"user",accessKey:e.accessKey})});if(!n.ok)throw new Error(`Push secret failed: ${n.status} ${await n.text()}`)}static extractVariableKeys(e){let s=e.matchAll(/\{\{([a-zA-Z_][a-zA-Z0-9_]*)\}\}/g),n=new Set;for(let t of s)n.add(t[1]);return[...n]}};var f=class extends p{constructor(e,s,n){super(e,{username:s,accessKey:n})}async upsertVariable(e){let s=e.environmentId??0,n=await c(`${this.baseUrl}/v1/variables`,{method:"POST",headers:this.headers(),body:JSON.stringify({name:e.name,value:String(e.value),type:"variable",value_type:"string",is_persist:e.isPersist??!1,environment_id:s})});if(n.ok){let o=await n.json().catch(()=>({}));if(o.type==="Success"&&o.id!=null)return{id:Number(o.id)||0}}let t=await c(`${this.baseUrl}/v1/variables/${encodeURIComponent(e.name)}?environment_id=${s}`,{method:"GET",headers:this.headers()});if(!t.ok)return{id:0};let i=(await t.json().catch(()=>({}))).data?.id;return i==null?{id:0}:(await c(`${this.baseUrl}/v1/variables/${i}`,{method:"PUT",headers:this.headers(),body:JSON.stringify({value:String(e.value),value_type:"string"})})).ok?{id:Number(i)||0}:{id:0}}};import{readdirSync as P,readFileSync as E,existsSync as S}from"fs";import{join as A}from"path";function b(r,e){let s=e.type==="parameter";return{value:typeof e.value=="number"?String(e.value):e.value,secret:e.secret??!1,syntax:e.syntax??(s?"${"+r+"}":`{{${r}}}`),...typeof e.type=="string"?{type:e.type}:{},...typeof e.description=="string"?{description:e.description}:{}}}function v(r,e){if(!S(r))return{};let s={},n;try{n=P(r).filter(t=>t.endsWith(".json")).sort()}catch{return{}}for(let t of n)try{let a=E(A(r,t),"utf-8"),i=JSON.parse(a);if(i&&typeof i=="object")for(let[l,o]of Object.entries(i))o&&typeof o=="object"&&"value"in o&&(s[l]=b(l,o))}catch{e?e("warn","VARIABLE_PARSE_FAILED","Skipping invalid variables file",{file:t}):process.stderr.write(`[variables] Warning: skipping invalid variables file: ${t}
|
|
3
|
-
`)}return s}function R(r){if(!S(r))throw new Error(`Variables file not found: ${r}`);let e=E(r,"utf-8"),s=V(e,r),n={};if(s&&typeof s=="object")for(let[t,a]of Object.entries(s))a&&typeof a=="object"&&"value"in a&&(n[t]=b(t,a));return n}function w(r){let e;try{e=JSON.parse(r)}catch{throw new Error("Invalid --variables JSON")}let s={};if(e&&typeof e=="object")for(let[n,t]of Object.entries(e))t&&typeof t=="object"&&"value"in t&&(s[n]=b(n,t));return s}function j(r,e,s){let n=v(r,s),t=v(e,s);return{...n,...t}}function G(r,e){if(Object.keys(r).length===0)return{};let s={};for(let[n,t]of Object.entries(r)){let a=t.syntax??`{{${n}}}`;k(e,a)&&(s[n]=t)}return s}function I(r){let e=r.trim();return e.startsWith("{{")&&e.endsWith("}}")?e.slice(2,-2).trim():e.startsWith("${")&&e.endsWith("}")?e.slice(2,-1).trim():e}function k(r,e){if(!e||!r)return!1;if(r.includes(e))return!0;let s=I(e);if(!s)return!1;let n=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`(?:\\{\\{|\\$\\{)\\s*${n}(?=\\s*\\}|[.\\[])`).test(r)}function M(r){let e=j(r.globalDir,r.localDir,r.onLoadError),s=r.file?R(r.file):{},n=r.inline?w(r.inline):{},t={...e,...s,...n,...r.parameters??{}},a=Object.keys(t).length>0,{variables:i,objective:l}=a?h(t,r.objective):{variables:{},objective:r.objective},o=_(t);return m(o.secretEntries.map(([,x])=>x.value)),{raw:t,auteur:i,auteurObjective:l,...o}}function _(r){let e=Object.entries(r),s=e.filter(([,t])=>d(t)),n=e.filter(([,t])=>!d(t));return{secretEntries:n.filter(([,t])=>t.secret),nonSecretEntries:n.filter(([,t])=>!t.secret),parameterEntries:s}}async function Q(r){if(r.localMode)return{};let e=y(r.env);if(r.variables.secretEntries.length>0){let n=new u(e.secretsBaseUrl);for(let[t,a]of r.variables.secretEntries)n.pushSecret({secretKey:t,secretValue:a.value,username:r.auth.username,accessKey:r.auth.access_key,orgId:r.orgId}).then(()=>r.log("info","SECRET_PUSH_OK","Secret pushed",{key:t})).catch(i=>r.log("error","SECRET_PUSH_FAILED","Secret push failed",{key:t,error:String(i)}))}let s={};if(r.variables.nonSecretEntries.length>0){let n=new f(e.tmsBaseUrl,r.auth.username,r.auth.access_key);for(let[t,a]of r.variables.nonSecretEntries)try{let i=await n.upsertVariable({name:t,value:a.value});s[t]=i.id,r.log("info","VAR_PUSH_OK","Variable pushed",{name:t,id:i.id})}catch(i){r.log("error","VAR_PUSH_FAILED","Variable push failed",{name:t,error:String(i)})}}return s}export{u as a,f as b,G as c,M as d,_ as e,Q as f};
|
package/dist/chunk-DREQ3RAA.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
function e(t){let n=t?.trim();return n||void 0}function o(t=process.env){let n=e(t.TEST_INSTANCE_ID),r=e(t.JOB_ID),s=e(t.TASK_ID);return{...n?{testInstanceId:n}:{},...r?{jobId:r}:{},...s?{taskId:s}:{}}}export{o as a};
|
package/dist/chunk-DXLZCJH5.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as A}from"./chunk-TDPWFYTJ.js";import{b as T}from"./chunk-BHQIH2FE.js";import{d as x}from"./chunk-I52NWH4U.js";import{a as S}from"./chunk-MMBBQ4OZ.js";import{a as y}from"./chunk-TD6GCEIK.js";import{a as m}from"./chunk-FI2DVNRT.js";import{f as R}from"./chunk-A7RJQJNT.js";import{d as g,i as E}from"./chunk-FAMQ4DHU.js";import{spawn as U,execSync as L}from"child_process";import{appendFileSync as P,existsSync as f,mkdirSync as h}from"fs";import{homedir as V}from"os";import{join as D,resolve as s,dirname as v,delimiter as M}from"path";import{fileURLToPath as k}from"url";import{createInterface as I}from"readline";async function*N(e){let n=I({input:e,crlfDelay:1/0});for await(let r of n){let o=r.trim();if(o)try{let i=JSON.parse(o);i&&typeof i.type=="string"&&(yield i)}catch{}}}function O(e){return e==="action"?{set:{V16_AGENT_ENABLE_ALL_BLOCKERS:"true",V16_BIFURCATION_PHASES:"1"},unset:["V16_NETWORK_WS","V16_NETWORK_SSE"]}:{set:{V16_BIFURCATION_PHASES:"1"},unset:["V16_AGENT_ENABLE_ALL_BLOCKERS","V16_NETWORK_WS","V16_NETWORK_SSE"]}}function w(e){return e?{set:{},unset:["V16_AGENT_SKIP_CP_FINAL"]}:{set:{V16_AGENT_SKIP_CP_FINAL:"true"},unset:[]}}function b(e){return e==="dom"?{set:{V16_AGENT_ENABLE_TEXTUAL_VISUAL:"true"},unset:[]}:{set:{},unset:["V16_AGENT_ENABLE_TEXTUAL_VISUAL"]}}var c=v(k(import.meta.url));function B(){for(let e of["python3","python"])try{return L(`${e} --version`,{stdio:"ignore"}),e}catch{}return null}function H(){let n=process.platform==="win32"?"v16-runner.exe":"v16-runner",r={"darwin-arm64":["@testmuai/kane-cli-darwin-arm64","@lambdatestincprivate/kane-cli-darwin-arm64"],"darwin-x64":["@testmuai/kane-cli-darwin-x64","@lambdatestincprivate/kane-cli-darwin-x64"],"linux-x64":["@testmuai/kane-cli-linux-x64","@lambdatestincprivate/kane-cli-linux-x64"],"linux-arm64":["@testmuai/kane-cli-linux-arm64","@lambdatestincprivate/kane-cli-linux-arm64"],"win32-x64":["@testmuai/kane-cli-win-x64","@lambdatestincprivate/kane-cli-win-x64"]},o=`${process.platform}-${process.arch}`,i=r[o];if(i)for(let t of i){let a=[s(c,"..","node_modules",t,"bin",n),s(c,"..","..","node_modules",t,"bin",n),s(c,"..","..","..","node_modules",t,"bin",n),s(c,"..","..","..","..","node_modules",t,"bin",n)];for(let u of a)if(f(u))return{cmd:u,args:[]}}let d=[s(c,"bin",n),s(c,"..","bin",n),s(c,"..","..","..","..","v16-runner","dist",n),s(c,"..","..","..","v16-runner","dist",n),s(c,"..","..","v16-runner","dist",n),s(process.cwd(),"v16-runner","dist",n),s(process.cwd(),"..","v16-runner","dist",n)];for(let t of d)if(f(t))return{cmd:t,args:[]};let l=[s(c,"..","..","v16-runner"),s(c,"..","..","..","..","v16-runner"),s(c,"..","..","..","v16-runner"),s(process.cwd(),"v16-runner"),s(process.cwd(),"..","v16-runner")];for(let t of l)if(f(s(t,"main.py"))){for(let u of[s(t,".venv","bin","python"),s(t,"..",".venv","bin","python"),s(t,"..","browser-agent",".venv","bin","python")])if(f(u))return{cmd:u,args:["main.py"],cwd:t};let a=B();if(a)return{cmd:a,args:["main.py"],cwd:t}}return null}function C(e){return e?D(V(),".testmuai","kaneai","sessions",e,"runner-stderr.log"):null}function K(e){let n=U(e.runner.cmd,e.runner.args,{stdio:["pipe","pipe","pipe"],env:e.env,cwd:e.runner.cwd});n.stdin.on("error",()=>{});let r=C(e.sessionId);if(r)try{h(v(r),{recursive:!0})}catch{}let o=1e5,i="";n.stderr.on("data",u=>{if(i+=u.toString(),i.length>o&&(i=i.slice(-o)),r)try{P(r,u)}catch{}}),n.on("error",u=>{e.log?.("error","RUNNER_SPAWN_ERROR","Runner spawn error",{error:u.message})});let d=null,l=null,t=new Promise(u=>{n.on("close",(p,_)=>{d=p,l=_?String(_):null,e.log?.("info","RUNNER_EXIT","Runner exited",{code:p,signal:l??"none"}),u({code:p,signal:l})})}),a=N(n.stdout);return{child:n,events:a,getStderr:()=>i,getExitCode:()=>d,getExitSignal:()=>l,exited:t}}async function G(e,n){if(!n?.platform||!n.target)return;if(R(n.target)){e.TESTMU_RUN_TARGET??="cloud",e.LT_HUB_URL??=m(e.TESTMUAI_ENV==="stage"?"stage":"prod").mobileHubUrl;return}let r=await x(n.platform)?.toolEnv(n.target)??{dirs:[]};if(r.dirs.length>0&&(e.PATH=[...r.dirs,e.PATH??""].filter(Boolean).join(M)),r.appiumHome&&(e.APPIUM_HOME=r.appiumHome),r.wdaRoot&&(e.TESTMU_IOS_WDA_DERIVED_DATA=r.wdaRoot),n.platform==="android"){let o=S();o&&(e.PATH=[o.platformToolsDir,e.PATH??""].filter(Boolean).join(M),e.ANDROID_HOME=o.root,e.ANDROID_SDK_ROOT=o.root)}}function j(e){let n={...process.env,...y(process.env)};e.environment&&(n.TESTMUAI_ENV=e.environment),n.TESTMUAI_SOURCE="kane-cli",process.platform==="win32"&&(n.PYTHONIOENCODING="utf-8",n.PYTHONUTF8="1");let r=m(e.environment);n.V16_SERVER_API_HOST=r.v16ServerHost,n.ATMS_URL=r.tmsBaseUrl.replace(/\/api\/?$/,""),e.username&&e.accessKey&&(n.LT_USERNAME=e.username,n.LT_ACCESS_KEY=e.accessKey),e.sessionId&&(n.TESTMUAI_SESSION_ID=e.sessionId);let o=O(e.mode??"testing");Object.assign(n,o.set);for(let a of o.unset)delete n[a];let i=new T().load(),d=b(e.assertionMode??(i.assertion_mode==="visual"?"visual":"dom"));Object.assign(n,d.set);for(let a of d.unset)delete n[a];let l=e.finalValidation??i.final_validation,t=w(l);Object.assign(n,t.set);for(let a of t.unset)delete n[a];return n}function W(e,n){let r=m(n?.environment),o=A();o!==void 0&&e.ap_mode===void 0&&(e.ap_mode=o),e.telemetry_proxy_url===void 0&&process.env.KANE_TELEMETRY!=="0"&&(e.telemetry_proxy_url=E),e.media_upload===void 0&&e.org_id&&e.username&&e.access_key&&(e.media_upload=$(r,e.org_id))}function $(e,n){return{url:e.shareApiBaseUrl.replace(/\/$/,"")+"/mfs/v1.0/media/upload",artefacts_host:e.mediaArtefactsHost,org_id:n,media_dir:g,files_url:e.tmsBaseUrl.replace(/\/api\/?$/,"")}}async function ue(e,n){let r=H();if(!r)throw new Error("v16-runner not found. Build the binary with `cd v16-runner && python build.py` or ensure Python is available.");process.env.KANE_SPAWN_DEBUG&&process.stderr.write(`[spawn-debug] ${JSON.stringify(r)}
|
|
3
|
-
`);let o=j({environment:n?.environment,mode:n?.mode,assertionMode:n?.assertionMode,finalValidation:n?.finalValidation,username:e.username,accessKey:e.access_key,sessionId:e.session_id});e.device?.platform&&await G(o,e.device),W(e,{environment:n?.environment});let i=K({env:o,runner:r,log:n?.log,sessionId:e.session_id}),d=i.child;d.stdin.write(JSON.stringify(e)+`
|
|
4
|
-
`);let l=C(e.session_id);if(l)try{h(v(l),{recursive:!0}),P(l,`--- runner spawn ${new Date().toISOString()} run_index=${e.run_index} ---
|
|
5
|
-
`)}catch{}return{child:d,events:i.events,sendUserResponse(t){let a=JSON.stringify({type:"user_response",answer:t});try{d.stdin.write(a+`
|
|
6
|
-
`)}catch{}},sendCancel(t){let a=JSON.stringify({type:"cancel",reason:t});try{d.stdin.write(a+`
|
|
7
|
-
`)}catch{}},cancel(){d.kill("SIGTERM")},get stderr(){return i.getStderr()},get exitCode(){return i.getExitCode()},get exitSignal(){return i.getExitSignal()},exited:i.exited}}export{H as a,K as b,G as c,j as d,W as e,$ as f,ue as g};
|