@testmuai/kane-cli 0.9.0 → 0.10.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ChatSurface-6NZGMNHL.js +2 -0
- package/dist/ChromeProfilePicker-M4WXOB5O.js +2 -0
- package/dist/CliFeedbackPrompt-6MJA7DF6.js +2 -0
- package/dist/CliUploadProgress-6NLS7XHH.js +2 -0
- package/dist/ConfigView-O4WKZ5PU.js +2 -0
- package/dist/EvidenceViewOffer-WIEWCZUP.js +2 -0
- package/dist/FolderPicker-AF7ZMV3M.js +2 -0
- package/dist/InfoBox-D7GGZJU4.js +2 -0
- package/dist/LinksBox-DXP66H3H.js +2 -0
- package/dist/ProfilesView-TWOY5PVC.js +2 -0
- package/dist/ProjectPicker-OBYHJJLU.js +2 -0
- package/dist/SaveSessionPrompt-7XSHS4NL.js +2 -0
- package/dist/ScrollbackTap-4SPXGFMU.js +2 -0
- package/dist/SingleShotApp-XQUDR36R.js +2 -0
- package/dist/SummaryBox-IA2KS6GT.js +2 -0
- package/dist/TestMdRunView-LS2QUFWR.js +2 -0
- package/dist/TestrunEvidenceTable-HNDVJDIF.js +2 -0
- package/dist/WhoamiView-SNL75TEF.js +2 -0
- package/dist/{agent-parse-2MLJOJTH.js → agent-parse-CAS45UKA.js} +1 -1
- package/dist/app-client-U2YYF65L.js +2 -0
- package/dist/app-download-UI4ABEIX.js +2 -0
- package/dist/assurance-job-FFSSS4XV.js +7 -0
- package/dist/auth-7Z54TMQQ.js +2 -0
- package/dist/{binary-LVHXED3O.js → binary-THPLXCOD.js} +1 -1
- package/dist/bind-4XWK3DG2.js +2 -0
- package/dist/bootstrap-6ACT4ALI.js +2 -0
- package/dist/bridge-T6QMYKED.js +2 -0
- package/dist/build-5ZN47FAT.js +2 -0
- package/dist/catalog-MYPS2BXY.js +2 -0
- package/dist/{changelog-N5AZHXOS.js → changelog-SU674BVE.js} +1 -1
- package/dist/chat-committer-ZCSRJEUB.js +2 -0
- package/dist/chat-controller-XINCDH6Z.js +2 -0
- package/dist/child-G2GCW73X.js +2 -0
- package/dist/chunk-22PIMG52.js +2 -0
- package/dist/chunk-2DYHAP4E.js +2 -0
- package/dist/chunk-2TVPA3LL.js +2 -0
- package/dist/{chunk-FMUV6UCX.js → chunk-2XW33VOK.js} +1 -1
- package/dist/chunk-33DWJV67.js +235 -0
- package/dist/chunk-34R7BNZ2.js +2 -0
- package/dist/chunk-35ECWCCK.js +2 -0
- package/dist/{chunk-OHOJSADN.js → chunk-36N3EHW5.js} +1 -1
- package/dist/chunk-3BSYOCSW.js +3 -0
- package/dist/chunk-3E4ZO73O.js +6 -0
- package/dist/chunk-3F5FMH76.js +2 -0
- package/dist/chunk-3G2LSTK5.js +2 -0
- package/dist/chunk-3GXN6VF6.js +2 -0
- package/dist/chunk-3JLEDSG5.js +4 -0
- package/dist/chunk-3OQW2GTA.js +2 -0
- package/dist/chunk-3QICDXY5.js +5 -0
- package/dist/chunk-3RJHXOZH.js +3 -0
- package/dist/{chunk-Q5RDCSYM.js → chunk-3YTCKCBG.js} +1 -1
- package/dist/chunk-42PALMW2.js +4 -0
- package/dist/chunk-44B6THYK.js +2 -0
- package/dist/chunk-457Y5TEC.js +19 -0
- package/dist/chunk-47WQBG5I.js +6 -0
- package/dist/chunk-4I7YN6YY.js +3 -0
- package/dist/chunk-4IEQNX7F.js +2 -0
- package/dist/chunk-4LTHDJ3D.js +2 -0
- package/dist/chunk-4QFTHUJA.js +34 -0
- package/dist/chunk-4QTH7VYE.js +2 -0
- package/dist/chunk-4YW767UV.js +47 -0
- package/dist/chunk-54XA5MZH.js +2 -0
- package/dist/chunk-5AKJPYUW.js +11 -0
- package/dist/{chunk-AKE2CTV6.js → chunk-5D7ENQTQ.js} +1 -1
- package/dist/chunk-63EKRZKI.js +2 -0
- package/dist/{chunk-EHN5HTUD.js → chunk-65VANXOF.js} +51 -51
- package/dist/{chunk-J3BGYSMD.js → chunk-6DZX5HLZ.js} +8 -8
- package/dist/{chunk-YBAVDT3G.js → chunk-6EB5VRAN.js} +1 -1
- package/dist/chunk-6NFOH4AC.js +4 -0
- package/dist/chunk-6PIIUAZF.js +3 -0
- package/dist/chunk-6UVIY56J.js +2 -0
- package/dist/chunk-72KYMWQ5.js +2 -0
- package/dist/chunk-72RC7JSA.js +21 -0
- package/dist/chunk-734ORT6O.js +4 -0
- package/dist/chunk-77ZZQJLX.js +2 -0
- package/dist/chunk-7AET4JKQ.js +2 -0
- package/dist/chunk-7DFBOVUB.js +2 -0
- package/dist/chunk-7HMSMAUG.js +29 -0
- package/dist/chunk-7HO4NX5W.js +1 -0
- package/dist/chunk-7KX2BHKG.js +2 -0
- package/dist/{chunk-ULGZPRKU.js → chunk-7NCJMWFX.js} +1 -1
- package/dist/chunk-7NPTL66J.js +2 -0
- package/dist/chunk-7RWP4Y3H.js +2 -0
- package/dist/{chunk-PCKIANML.js → chunk-7SY34IIL.js} +1 -1
- package/dist/chunk-7V4BQSSV.js +2 -0
- package/dist/chunk-7XBNMOH4.js +6 -0
- package/dist/{chunk-SOCHN2PY.js → chunk-7YT4TTKL.js} +1 -1
- package/dist/{chunk-C25M2J5Q.js → chunk-ACMBMZDQ.js} +1 -1
- package/dist/chunk-AEWNWAXW.js +18 -0
- package/dist/chunk-AQ2OG2EF.js +2 -0
- package/dist/chunk-AUJSC7PU.js +4 -0
- package/dist/chunk-AVI5H4UM.js +13 -0
- package/dist/chunk-AVSMXDTX.js +2 -0
- package/dist/chunk-AZLNLHUA.js +4 -0
- package/dist/{chunk-HGFWIBVF.js → chunk-B7ZX5HEN.js} +5 -5
- package/dist/{chunk-66MOZKD2.js → chunk-BSRSXYDZ.js} +1 -1
- package/dist/chunk-BWXLZS5O.js +2 -0
- package/dist/chunk-BY65QAAN.js +4 -0
- package/dist/chunk-C2RUDJ46.js +2 -0
- package/dist/chunk-C5Z7MQE6.js +2 -0
- package/dist/{chunk-WDMUPK6I.js → chunk-C62QWG4B.js} +1 -1
- package/dist/chunk-C6HI6Y3S.js +2 -0
- package/dist/chunk-CB4ARIHR.js +2 -0
- package/dist/{chunk-7WXMV3O3.js → chunk-CCP4X75B.js} +1 -1
- package/dist/chunk-CGITGJ3I.js +4 -0
- package/dist/chunk-CM4CHYSN.js +2 -0
- package/dist/{chunk-ZXY4P76I.js → chunk-CUXY6KQ2.js} +1 -1
- package/dist/chunk-D36V5OX6.js +2 -0
- package/dist/chunk-D756UWY2.js +6 -0
- package/dist/chunk-D7TKE7LK.js +2 -0
- package/dist/{chunk-UWXDURAB.js → chunk-D7U2M26S.js} +1 -1
- package/dist/chunk-DBMW3VUN.js +4 -0
- package/dist/chunk-DDZLCAEO.js +5 -0
- package/dist/chunk-DJC7NTLA.js +3 -0
- package/dist/chunk-DPGOAFKF.js +2 -0
- package/dist/chunk-DREQ3RAA.js +2 -0
- package/dist/chunk-DTUPEKEO.js +2 -0
- package/dist/chunk-DZOYYWOW.js +2 -0
- package/dist/chunk-E6KSRQXL.js +8 -0
- package/dist/chunk-EBPRPNSA.js +2 -0
- package/dist/chunk-ECPFI75W.js +5 -0
- package/dist/chunk-EECDDDSB.js +3 -0
- package/dist/chunk-EF47KRUK.js +2 -0
- package/dist/chunk-ETZMFRD6.js +2 -0
- package/dist/chunk-EZN7CF45.js +4 -0
- package/dist/{chunk-CNUCP6DK.js → chunk-F22K3RRX.js} +1 -1
- package/dist/{chunk-WRSIKZ2V.js → chunk-F5NHG7VB.js} +1 -1
- package/dist/{chunk-DHJSM5DT.js → chunk-FCD3NYOM.js} +1 -1
- package/dist/chunk-FIP5L6LV.js +9 -0
- package/dist/chunk-FOJHSG5M.js +6 -0
- package/dist/chunk-FSYOTRMC.js +2 -0
- package/dist/chunk-FWDUVFS6.js +26 -0
- package/dist/chunk-FWUPJORV.js +6 -0
- package/dist/chunk-GFLB2SHW.js +2 -0
- package/dist/chunk-GMTHZUZ3.js +2 -0
- package/dist/chunk-GQRU3B54.js +1397 -0
- package/dist/chunk-GRURFGBP.js +2 -0
- package/dist/chunk-GXKY5A46.js +9 -0
- package/dist/chunk-HAW5WEKT.js +13 -0
- package/dist/chunk-HCJ2N3XB.js +12 -0
- package/dist/chunk-HHW6MRU3.js +6 -0
- package/dist/chunk-HIUAUZNL.js +2 -0
- package/dist/chunk-HJLMH7ZM.js +2 -0
- package/dist/{chunk-YWYORBY3.js → chunk-HJMCXSUJ.js} +1 -1
- package/dist/chunk-HK62JVQM.js +3 -0
- package/dist/{chunk-5GUD3CIH.js → chunk-HQ2E2XCU.js} +1 -1
- package/dist/chunk-I2MC6VVX.js +2 -0
- package/dist/chunk-I4RVVBG3.js +10 -0
- package/dist/chunk-I4WXALQR.js +2 -0
- package/dist/chunk-ICLUC44J.js +2 -0
- package/dist/{chunk-6HU5M2DS.js → chunk-IGEAET7M.js} +1 -1
- package/dist/{chunk-GCISXCDU.js → chunk-IINZZ4BZ.js} +1 -1
- package/dist/chunk-IJ2AHSWW.js +2 -0
- package/dist/{chunk-CSNJPD2J.js → chunk-IUQOG7Z5.js} +3 -3
- package/dist/chunk-IZ65ZPWY.js +3 -0
- package/dist/chunk-JGRXMTME.js +15 -0
- package/dist/{chunk-NBXYL2JT.js → chunk-JIRNI5TB.js} +7 -7
- package/dist/chunk-JNSWKGTB.js +2 -0
- package/dist/chunk-JZP3Y4ZM.js +2 -0
- package/dist/chunk-KF4DKXSS.js +2 -0
- package/dist/chunk-KGNE5CIM.js +2 -0
- package/dist/chunk-KM3YCIDV.js +3 -0
- package/dist/{chunk-HAYV4D2I.js → chunk-KODJVOCN.js} +1 -1
- package/dist/chunk-KU3YHPWZ.js +2 -0
- package/dist/{chunk-M3UAZTDK.js → chunk-KXHJMAZU.js} +2 -2
- package/dist/chunk-L5DALV5N.js +2 -0
- package/dist/chunk-LAOTVZHV.js +6 -0
- package/dist/chunk-LCSJ7GOG.js +2 -0
- package/dist/{chunk-DWMESHFI.js → chunk-LIGTP3A3.js} +1 -1
- package/dist/chunk-LKQFG4RW.js +5 -0
- package/dist/{chunk-EBLXHOE3.js → chunk-LQQNPMOD.js} +1 -1
- package/dist/chunk-LSDJOVWW.js +6 -0
- package/dist/{chunk-C6S2RPZA.js → chunk-LUR7JFPP.js} +1 -1
- package/dist/chunk-LUZBGTYB.js +2 -0
- package/dist/chunk-LX2I4JEH.js +2 -0
- package/dist/{chunk-7GAHJZLH.js → chunk-M43WH5DQ.js} +1 -1
- package/dist/chunk-MEKPGQAM.js +21 -0
- package/dist/chunk-MNBGG4H3.js +16 -0
- package/dist/chunk-MYVKUJGS.js +2 -0
- package/dist/chunk-MYZHOBS4.js +2 -0
- package/dist/chunk-NC7D7GOM.js +21 -0
- package/dist/chunk-NIVFEACM.js +2 -0
- package/dist/chunk-NLZZLANH.js +4 -0
- package/dist/{chunk-XT7XA4DN.js → chunk-NXAJBSIF.js} +1 -1
- package/dist/chunk-NXRF7FFS.js +2 -0
- package/dist/chunk-NZ6AV2TA.js +4 -0
- package/dist/chunk-O3HHTKZ5.js +6 -0
- package/dist/chunk-OCDBTAYS.js +12 -0
- package/dist/chunk-OFSDB7B4.js +3 -0
- package/dist/{chunk-Q5CINJYL.js → chunk-OGFU4YY4.js} +1 -1
- package/dist/chunk-OJ33Q6DU.js +2 -0
- package/dist/chunk-P2ZQDQDB.js +2 -0
- package/dist/{chunk-KXEE6VCA.js → chunk-P3JXJ4BW.js} +1 -1
- package/dist/chunk-PAWQ4AKN.js +2 -0
- package/dist/chunk-PUVMC4PX.js +26 -0
- package/dist/{chunk-SEEEGDVK.js → chunk-PZA3BSOE.js} +1 -1
- package/dist/chunk-Q3C6NDGI.js +2 -0
- package/dist/chunk-QBYENBMB.js +2 -0
- package/dist/chunk-QDFY5GGO.js +5 -0
- package/dist/chunk-QDXKEOKI.js +16 -0
- package/dist/{chunk-6VY62QC2.js → chunk-QENCC2ZS.js} +1 -1
- package/dist/chunk-QI5RZ7LL.js +2 -0
- package/dist/chunk-QXQ7KVEN.js +2 -0
- package/dist/chunk-R4JUKTDO.js +2 -0
- package/dist/chunk-R7KXAISS.js +12 -0
- package/dist/chunk-RDP7GWSY.js +2 -0
- package/dist/chunk-REKHAN53.js +5 -0
- package/dist/chunk-RF37IJNN.js +2 -0
- package/dist/{chunk-KWEOLPBJ.js → chunk-RFEON5GN.js} +1 -1
- package/dist/chunk-RHGW7B5Q.js +2 -0
- package/dist/chunk-RPRXRKKR.js +2 -0
- package/dist/{chunk-EOA6YPES.js → chunk-RTVHJ23A.js} +4 -4
- package/dist/chunk-RTVWQK7I.js +2 -0
- package/dist/chunk-RX6776AI.js +5 -0
- package/dist/{chunk-F7NSSQYZ.js → chunk-SGPAM5DZ.js} +1 -1
- package/dist/chunk-SMTBOSEJ.js +2 -0
- package/dist/chunk-SMXABALN.js +2 -0
- package/dist/{chunk-TM7VRLWS.js → chunk-SXRHKXSE.js} +1 -1
- package/dist/chunk-TNORODUF.js +2 -0
- package/dist/chunk-TU42YZOJ.js +6 -0
- package/dist/chunk-TU7TVFBK.js +2 -0
- package/dist/chunk-TW5AA5A7.js +8 -0
- package/dist/chunk-UEE3RZN4.js +14 -0
- package/dist/chunk-URH4FX3H.js +2 -0
- package/dist/chunk-UTM7D4PI.js +2 -0
- package/dist/chunk-UUJIGOEO.js +2 -0
- package/dist/chunk-UYDHOHSZ.js +2 -0
- package/dist/{chunk-4BZOG6PE.js → chunk-V7USCQWO.js} +1 -1
- package/dist/chunk-VJGWVBZR.js +1 -0
- package/dist/chunk-VLDCHFXF.js +2 -0
- package/dist/chunk-VO66KP2W.js +2 -0
- package/dist/chunk-VRIZDOO5.js +2 -0
- package/dist/{chunk-DOOI2JBD.js → chunk-VSVWNRI2.js} +1 -1
- package/dist/chunk-VUFIL5VR.js +6 -0
- package/dist/chunk-VX657KIK.js +2 -0
- package/dist/chunk-VXGN3IV7.js +2 -0
- package/dist/chunk-VZ4A6WMK.js +97 -0
- package/dist/chunk-VZJ6LUXX.js +2 -0
- package/dist/{chunk-RWSOZPJQ.js → chunk-W4QSZNMB.js} +1 -1
- package/dist/chunk-W54OT2FU.js +9 -0
- package/dist/{chunk-BL3SJDCG.js → chunk-W6HZF56M.js} +1 -1
- package/dist/chunk-W72ACCFL.js +27 -0
- package/dist/chunk-W7FLXW6Q.js +5 -0
- package/dist/chunk-WAOUE7MP.js +9 -0
- package/dist/chunk-WEIPY3CI.js +16 -0
- package/dist/chunk-WMGKUERB.js +6 -0
- package/dist/{chunk-DFS4RMVP.js → chunk-WN5VKKJ3.js} +1 -1
- package/dist/chunk-WOSANGV6.js +5 -0
- package/dist/{chunk-K3IQEL7R.js → chunk-WXJCJL5L.js} +1 -1
- package/dist/chunk-WZXPF3BI.js +2 -0
- package/dist/chunk-XB6BJPDL.js +2 -0
- package/dist/{chunk-4FHK4LKQ.js → chunk-XLEGGC4Y.js} +1 -1
- package/dist/chunk-XMPTFXPW.js +5 -0
- package/dist/chunk-XQMWHPZI.js +3 -0
- package/dist/{chunk-75MMTNPB.js → chunk-XRNQSXOM.js} +2 -2
- package/dist/{chunk-2PKME4VT.js → chunk-XZGEN4NU.js} +4 -4
- package/dist/chunk-XZYA7DNH.js +2 -0
- package/dist/{chunk-OIUV3ISA.js → chunk-Y6Y6RAY4.js} +1 -1
- package/dist/chunk-Y7E5L42F.js +3 -0
- package/dist/{chunk-GFBAK7WQ.js → chunk-YAW6JW6D.js} +7 -7
- package/dist/chunk-YDPTSDIJ.js +2 -0
- package/dist/chunk-YDSGXB25.js +2 -0
- package/dist/chunk-YGRULEZY.js +2 -0
- package/dist/chunk-YHFZFV3A.js +22 -0
- package/dist/chunk-YIKF4ERQ.js +375 -0
- package/dist/chunk-YLXWAY7D.js +2 -0
- package/dist/{chunk-UA2QDAWT.js → chunk-YPFQ4UGF.js} +1 -1
- package/dist/{chunk-4CYBXJIA.js → chunk-YQ5C6UDG.js} +1 -1
- package/dist/chunk-Z55KBMYV.js +2 -0
- package/dist/chunk-ZAFJQ3SM.js +2 -0
- package/dist/chunk-ZCRZFAOT.js +2 -0
- package/dist/chunk-ZFM77AQU.js +2 -0
- package/dist/{chunk-Q6F23V7L.js → chunk-ZFMRQ57Y.js} +1 -1
- package/dist/chunk-ZHWU6L2G.js +5 -0
- package/dist/chunk-ZTHYAHDN.js +17 -0
- package/dist/{chunk-X2A6CC6B.js → chunk-ZTRRFG52.js} +1 -1
- package/dist/chunk-ZU4W2QGM.js +3 -0
- package/dist/committer-JGY66PFM.js +2 -0
- package/dist/config-754B73XK.js +2 -0
- package/dist/controller-client-PB3AZAGG.js +2 -0
- package/dist/cover-cmd-NBNZCR6C.js +2 -0
- package/dist/{credentials-QD32Y7K7.js → credentials-F7DYLVWY.js} +1 -1
- package/dist/{deps-bundle-OI7JJ22L.js → deps-bundle-PW3WEQJ7.js} +1 -1
- package/dist/{deps-resolve-ZOALDS6H.js → deps-resolve-SQYVN76L.js} +1 -1
- package/dist/descriptor-7T32VRMB.js +2 -0
- package/dist/design-chat-F3OEZPNJ.js +2 -0
- package/dist/design-committer-TRYP3LOZ.js +2 -0
- package/dist/design-headless-OTHYOX3E.js +2 -0
- package/dist/design-remote-2BEGCVCX.js +3 -0
- package/dist/device-env-CHFRRV6W.js +2 -0
- package/dist/dispatch-DVQ3H7EJ.js +2 -0
- package/dist/doctor-XY26Z35T.js +2 -0
- package/dist/docx-convert-6IZO5P5K.js +2 -0
- package/dist/{dossier-7HVC6BNK.js → dossier-NROC2MCY.js} +1 -1
- package/dist/evidence-P6FFKC7B.js +2 -0
- package/dist/evidence-presentation-YYTIDCBS.js +2 -0
- package/dist/evolve-cmd-WWOB3QJR.js +2 -0
- package/dist/evolve-remote-WLVY3QID.js +2 -0
- package/dist/{exit-manager-ZLDO54S4.js → exit-manager-EDHCETUN.js} +1 -1
- package/dist/explain-DGJ5T6V5.js +2 -0
- package/dist/explain-cmd-OP5I5W3O.js +12 -0
- package/dist/explain-cmd-VYAANFFZ.js +4 -0
- package/dist/explore-K5YBGHK6.js +2 -0
- package/dist/explore-context-tty-RZ7D2TBV.js +2 -0
- package/dist/explore-entry-EKXJ67BD.js +6 -0
- package/dist/explore-live-2YVRAQZO.js +5 -0
- package/dist/explore-run-tty-D47FGPX7.js +5 -0
- package/dist/extract-bind-W2NET364.js +14 -0
- package/dist/extract-chat-M65NWGUK.js +2 -0
- package/dist/extract-cmd-FTFLETOP.js +6 -0
- package/dist/extract-headless-G6W6JQ27.js +2 -0
- package/dist/feeder-NY45UFJK.js +2 -0
- package/dist/folder-flags-KKIH654K.js +2 -0
- package/dist/gaps-cmd-OIDDLRYL.js +3 -0
- package/dist/gate-7AKRPRMK.js +2 -0
- package/dist/gate-WISOUTHQ.js +2 -0
- package/dist/{generate-headless-6WMJYNI6.js → generate-headless-RURIEKVS.js} +3 -3
- package/dist/headless-io-FFM5T6KL.js +2 -0
- package/dist/hold-passthrough-IOWPVB4W.js +2 -0
- package/dist/identity-HL5CJJXR.js +2 -0
- package/dist/index.js +178 -160
- package/dist/ingest-PDGS5ZTL.js +2 -0
- package/dist/ingest-cmd-4G2AK4Y2.js +8 -0
- package/dist/ingest-remote-SSLUHQVG.js +2 -0
- package/dist/ink-screen-RZ7QDIUI.js +2 -0
- package/dist/install-ZVBHPXGP.js +2 -0
- package/dist/interactive-bind-SI2ZS55Q.js +26 -0
- package/dist/interactive-remote-J56EWJGA.js +65 -0
- package/dist/interrupt-guard-QETBPINI.js +2 -0
- package/dist/lane-AQYRIW24.js +2 -0
- package/dist/lattice-auth-6FEVSR7E.js +2 -0
- package/dist/lifecycle-cmd-HJ37LTXE.js +2 -0
- package/dist/list-cmd-6XL2FYLQ.js +3 -0
- package/dist/list-commands-5DCCKU3L.js +2 -0
- package/dist/list-remote-LXPQNXYN.js +15 -0
- package/dist/locks-cmd-JJ2QNTNY.js +2 -0
- package/dist/logical-ids-RXAQJZ3T.js +2 -0
- package/dist/login-flow-WEK3E476.js +2 -0
- package/dist/maintenance-cmd-BXXHP36K.js +2 -0
- package/dist/mobile-prompts-CECJ5UY2.js +2 -0
- package/dist/{next-KZXH4UA4.js → next-O6SUSX3R.js} +1 -1
- package/dist/{objective-variable-gate-CG2KK5UX.js → objective-variable-gate-3Z7DNVVC.js} +1 -1
- package/dist/onboarding-PDVYMTY5.js +5 -0
- package/dist/open-provider-OZAG6WZS.js +2 -0
- package/dist/{paths-JCYX6UWL.js → paths-UMIX3RJF.js} +1 -1
- package/dist/pdf-convert-447ACUB3.js +2 -0
- package/dist/persist-recorded-session-A3ID7JFA.js +3 -0
- package/dist/phase-seed-LCJ4WSYV.js +2 -0
- package/dist/pipeline-GX3LKPI5.js +2 -0
- package/dist/prepare-target-FMT6QFHZ.js +2 -0
- package/dist/pull-cmd-UPFQYUND.js +2 -0
- package/dist/pull-route-FWBXJMR7.js +2 -0
- package/dist/readmodel-INMP6MNW.js +2 -0
- package/dist/real-device-run-X7JJWOIK.js +2 -0
- package/dist/reconcile-cmd-JBH365JL.js +5 -0
- package/dist/reconcile-deps-TWJ3FTSU.js +2 -0
- package/dist/reconcile-remote-BCX6SWFC.js +13 -0
- package/dist/recording-banner-YKBAL6UB.js +2 -0
- package/dist/registry-VQC757MJ.js +2 -0
- package/dist/remote-entry-X6JMPC2K.js +2 -0
- package/dist/remote-mode-FDPA7EWG.js +4 -0
- package/dist/remote-words-YVB66R3F.js +2 -0
- package/dist/require-project-folder-MLMEQJYP.js +2 -0
- package/dist/resolve-run-intent-PC7TQZUL.js +2 -0
- package/dist/resolver-EID34LQE.js +2 -0
- package/dist/revert-FHOBLZWF.js +2 -0
- package/dist/review-cmd-EUHFLFMY.js +5 -0
- package/dist/run-5RQUCNYP.js +2 -0
- package/dist/run-PC5YO4AS.js +2 -0
- package/dist/run-channel-63SVP5OI.js +2 -0
- package/dist/run-remote-SJCRTL7O.js +2 -0
- package/dist/run-startup-gate-YO66G6LS.js +2 -0
- package/dist/run-test-md-BLNBK4MH.js +17 -0
- package/dist/scrollback-GGNBDFQV.js +2 -0
- package/dist/session-target-DD53UXO7.js +2 -0
- package/dist/session-worker.js +12 -0
- package/dist/sessions-CFV7FOIT.js +2 -0
- package/dist/sessions-cmd-S7WZBUCN.js +26 -0
- package/dist/sessions-remote-IWHWIQ2T.js +3 -0
- package/dist/shell-arg-FN3MT5U7.js +2 -0
- package/dist/{skill-installer-32YYMM4N.js → skill-installer-MAVQY6GW.js} +1 -1
- package/dist/spawner-C7NLLM4F.js +2 -0
- package/dist/store-MSA7KASS.js +2 -0
- package/dist/store-choice-3OJCV26J.js +2 -0
- package/dist/store-guard-OOSDLMEC.js +2 -0
- package/dist/store-id-YZ5WKJ25.js +2 -0
- package/dist/store-site-KA2DNBGY.js +2 -0
- package/dist/stream-warnings-GEQKKJU7.js +2 -0
- package/dist/structured-answers-EQ2AP3F7.js +2 -0
- package/dist/sync-cmd-RDFDMVKQ.js +2 -0
- package/dist/sync-setup-RBRDUV7Q.js +2 -0
- package/dist/{sync-setup-ui-RC727VK6.js → sync-setup-ui-XITPGSO4.js} +2 -2
- package/dist/tcg-generate-KIECTZ2C.js +2 -0
- package/dist/test-definition-VRI4YIYL.js +2 -0
- package/dist/testmd-actions-CMAG6HWI.js +2 -0
- package/dist/testmd-sync-UPAA5UMD.js +2 -0
- package/dist/tms-client-NXAB6VJD.js +2 -0
- package/dist/token-refresh-KP3AYMYK.js +2 -0
- package/dist/trust-gate-AT2XBWN4.js +2 -0
- package/dist/turn-preflight-LHYLRL7G.js +2 -0
- package/dist/ui-SNV3FD2G.js +4 -0
- package/dist/use-case-ref-NE4X4MZN.js +2 -0
- package/dist/validate-basic-M5JHHNZA.js +2 -0
- package/dist/{variable-receipt-YWNS24TH.js → variable-receipt-BXSZO36E.js} +1 -1
- package/dist/verdicts-XK3GAUX3.js +2 -0
- package/dist/version-check-Q737BE65.js +2 -0
- package/dist/{view-cmd-3WHG6MVB.js → view-cmd-XSNL5DGI.js} +4 -3
- package/dist/walk-session-SHGYLFRB.js +2 -0
- package/dist/with-telemetry-PM2HVN2B.js +2 -0
- package/package.json +11 -11
- package/dist/ChatSurface-FJPK3XEJ.js +0 -8
- package/dist/ChromeProfilePicker-7DUDJTE2.js +0 -2
- package/dist/CliFeedbackPrompt-ZZPYC6OS.js +0 -2
- package/dist/CliUploadProgress-WQYKIBAR.js +0 -2
- package/dist/ConfigView-KXNOODDW.js +0 -2
- package/dist/EvidenceViewOffer-BTBVPBZX.js +0 -2
- package/dist/FolderPicker-H4YEX5LV.js +0 -2
- package/dist/InfoBox-DTM7X24Z.js +0 -2
- package/dist/LinksBox-KFG3FVOT.js +0 -2
- package/dist/ProfilesView-KBZHT4KL.js +0 -2
- package/dist/ProjectPicker-OARWULNN.js +0 -2
- package/dist/SaveSessionPrompt-37SMU5MC.js +0 -2
- package/dist/ScrollbackTap-QHJOFYMC.js +0 -2
- package/dist/SingleShotApp-UYCAW65Y.js +0 -2
- package/dist/SummaryBox-6RB5DSAH.js +0 -2
- package/dist/TestMdRunView-ZMOII3PL.js +0 -2
- package/dist/TestrunEvidenceTable-3UP2EYIV.js +0 -2
- package/dist/WhoamiView-MC62GERR.js +0 -2
- package/dist/app-client-PQFJAB63.js +0 -2
- package/dist/app-download-P6YXWSVQ.js +0 -2
- package/dist/auth-LXW4OFKF.js +0 -2
- package/dist/bind-ZYESQSCJ.js +0 -15
- package/dist/bootstrap-DI4UGMH3.js +0 -2
- package/dist/bridge-7J3JE3JS.js +0 -2
- package/dist/build-JIKYOZUH.js +0 -2
- package/dist/catalog-LLME3744.js +0 -2
- package/dist/chat-committer-6D7AQI6Z.js +0 -2
- package/dist/chat-controller-UJQ6Z4RE.js +0 -2
- package/dist/chunk-243ZJHT6.js +0 -4
- package/dist/chunk-2KVECC36.js +0 -2
- package/dist/chunk-2YEHV2CX.js +0 -2
- package/dist/chunk-3MCPTVJX.js +0 -2
- package/dist/chunk-3UI5VTQS.js +0 -4
- package/dist/chunk-3VAU3PNU.js +0 -2
- package/dist/chunk-3YIZG7WZ.js +0 -3
- package/dist/chunk-4Y2WH77W.js +0 -2
- package/dist/chunk-5EOX4MEY.js +0 -2
- package/dist/chunk-5HMN74RZ.js +0 -9
- package/dist/chunk-5LJRZI7S.js +0 -6
- package/dist/chunk-5RCS2LIQ.js +0 -26
- package/dist/chunk-5TQFOPJV.js +0 -2
- package/dist/chunk-5ZFOKYFB.js +0 -5
- package/dist/chunk-63DYVWNX.js +0 -2
- package/dist/chunk-6MD7SR7D.js +0 -9
- package/dist/chunk-7N6OCHPC.js +0 -7
- package/dist/chunk-A2SQD2AY.js +0 -4
- package/dist/chunk-AACQE24F.js +0 -2
- package/dist/chunk-AHFIRHSP.js +0 -18
- package/dist/chunk-AJT34ESA.js +0 -38
- package/dist/chunk-AUMJ4RVA.js +0 -21
- package/dist/chunk-AXTPNZPX.js +0 -2
- package/dist/chunk-BB2W35TW.js +0 -2
- package/dist/chunk-BKM2LWU2.js +0 -3
- package/dist/chunk-BUPRL2TE.js +0 -2
- package/dist/chunk-C44QQJR4.js +0 -239
- package/dist/chunk-CW3RHKLA.js +0 -5
- package/dist/chunk-D6E6KRVX.js +0 -2
- package/dist/chunk-DTRKTBCE.js +0 -17
- package/dist/chunk-DTRSYWZE.js +0 -2
- package/dist/chunk-EVFFDODK.js +0 -5
- package/dist/chunk-F2OBORCG.js +0 -2
- package/dist/chunk-FQNQVC5O.js +0 -5
- package/dist/chunk-FY7TCYPK.js +0 -6
- package/dist/chunk-GTVQYT3D.js +0 -35
- package/dist/chunk-HG5LLZBU.js +0 -2
- package/dist/chunk-I7TIGB7K.js +0 -2
- package/dist/chunk-IICT4VOU.js +0 -2
- package/dist/chunk-ILDHE4P4.js +0 -6
- package/dist/chunk-IPXKUYUK.js +0 -2
- package/dist/chunk-JQY5HRZ4.js +0 -15
- package/dist/chunk-JX6BFEDO.js +0 -4
- package/dist/chunk-K2UJYY2U.js +0 -2
- package/dist/chunk-KBM3XHAM.js +0 -2
- package/dist/chunk-KDNNMU7Q.js +0 -4
- package/dist/chunk-KJQNAOOE.js +0 -6
- package/dist/chunk-LH4IPANP.js +0 -2
- package/dist/chunk-LLG7NEGX.js +0 -6
- package/dist/chunk-LSDWPG6C.js +0 -2
- package/dist/chunk-MSGW4JDG.js +0 -2
- package/dist/chunk-NJ4BXZBX.js +0 -2
- package/dist/chunk-NLCCBXXV.js +0 -2
- package/dist/chunk-NMSZ7G6P.js +0 -2
- package/dist/chunk-OC6H6BYI.js +0 -6
- package/dist/chunk-OJAXOOZ5.js +0 -8
- package/dist/chunk-OMNLAGQC.js +0 -29
- package/dist/chunk-OOCCUUR2.js +0 -2
- package/dist/chunk-OXC6O5O7.js +0 -2
- package/dist/chunk-OZQDD2EX.js +0 -94
- package/dist/chunk-PEDINHVU.js +0 -2
- package/dist/chunk-PNUAP3RY.js +0 -8
- package/dist/chunk-Q2F5QB2W.js +0 -2
- package/dist/chunk-Q4YYAN6E.js +0 -2
- package/dist/chunk-Q6AHSGOE.js +0 -5
- package/dist/chunk-QAB3Y5FQ.js +0 -4
- package/dist/chunk-RDHWNSDP.js +0 -7
- package/dist/chunk-RKXHVP2Z.js +0 -2
- package/dist/chunk-RRY5IXOB.js +0 -2
- package/dist/chunk-RSSOJ3L2.js +0 -21
- package/dist/chunk-RTSBKCZY.js +0 -16
- package/dist/chunk-SID4X77D.js +0 -370
- package/dist/chunk-SRTKRHYI.js +0 -12
- package/dist/chunk-T2ONUKTL.js +0 -5
- package/dist/chunk-U6OTFMIT.js +0 -4
- package/dist/chunk-UD7KKHPW.js +0 -5
- package/dist/chunk-USOYXCZ4.js +0 -2
- package/dist/chunk-USY7VAO6.js +0 -2
- package/dist/chunk-V4B5QA3U.js +0 -4
- package/dist/chunk-VBS33P2C.js +0 -2
- package/dist/chunk-VHW7BMZQ.js +0 -2
- package/dist/chunk-VIO7CCFW.js +0 -5
- package/dist/chunk-VORWZLS3.js +0 -9
- package/dist/chunk-VVOKM2VO.js +0 -2
- package/dist/chunk-W5TTF7GB.js +0 -6
- package/dist/chunk-WESMQEPO.js +0 -2
- package/dist/chunk-WMI4P76K.js +0 -27
- package/dist/chunk-WNOC6MQC.js +0 -2
- package/dist/chunk-WVHMPIDQ.js +0 -2
- package/dist/chunk-XBX643ZD.js +0 -2
- package/dist/chunk-XKHWWKJZ.js +0 -3
- package/dist/chunk-XLSOQLVT.js +0 -2
- package/dist/chunk-Y3ZYN6AK.js +0 -4
- package/dist/chunk-YCCUBQY4.js +0 -2
- package/dist/chunk-YKTYVJBN.js +0 -3
- package/dist/chunk-YLQHY4A7.js +0 -2
- package/dist/chunk-Z7IGTVJW.js +0 -2
- package/dist/chunk-ZC2CKWLB.js +0 -2
- package/dist/chunk-ZER3FZSZ.js +0 -22
- package/dist/chunk-ZJYT72BA.js +0 -9
- package/dist/chunk-ZKSN2SJ7.js +0 -2
- package/dist/chunk-ZLWURCJ7.js +0 -2
- package/dist/committer-2QPBANRD.js +0 -2
- package/dist/config-YGTHSGQN.js +0 -2
- package/dist/controller-client-ZF5IXRUV.js +0 -2
- package/dist/cover-cmd-6RO366CC.js +0 -3
- package/dist/descriptor-3JJUOHBM.js +0 -2
- package/dist/design-committer-D44GSUXY.js +0 -2
- package/dist/device-env-DXDJJMTL.js +0 -2
- package/dist/dispatch-7EWWQRQ5.js +0 -2
- package/dist/doctor-TPYPEEUL.js +0 -2
- package/dist/docx-convert-SQRTF7XS.js +0 -2
- package/dist/evidence-NPFTBGDF.js +0 -2
- package/dist/evidence-presentation-XF23B7F2.js +0 -2
- package/dist/evolve-cmd-VGVXV6XW.js +0 -2
- package/dist/explain-NEFBUX5G.js +0 -2
- package/dist/explain-cmd-GOP5TE63.js +0 -9
- package/dist/explain-cmd-M7IX2YNB.js +0 -3
- package/dist/extract-bind-CKIRLXAJ.js +0 -14
- package/dist/extract-cmd-3EWLSPGS.js +0 -5
- package/dist/feeder-66TUPB2R.js +0 -2
- package/dist/gaps-cmd-WVC5GXQC.js +0 -3
- package/dist/gate-OYRDJMF6.js +0 -2
- package/dist/headless-io-75HUMWZB.js +0 -2
- package/dist/identity-ADZ4PAJF.js +0 -2
- package/dist/ingest-OSNNM3DH.js +0 -2
- package/dist/ingest-cmd-AECK5T4H.js +0 -2
- package/dist/install-ZV3KJZV4.js +0 -2
- package/dist/interactive-bind-IYS6KDOH.js +0 -26
- package/dist/interrupt-guard-UREUWNRL.js +0 -2
- package/dist/lifecycle-cmd-XCSBELFQ.js +0 -2
- package/dist/list-cmd-S4DSN2ET.js +0 -3
- package/dist/list-commands-GLNGHPDU.js +0 -2
- package/dist/locks-cmd-67OHQZNV.js +0 -2
- package/dist/logical-ids-GLVM2SVR.js +0 -2
- package/dist/login-flow-ASUUU7SO.js +0 -2
- package/dist/maintenance-cmd-K5KXRIFL.js +0 -2
- package/dist/mobile-prompts-ZUZTA3RV.js +0 -2
- package/dist/open-provider-YIBB77FE.js +0 -2
- package/dist/pdf-convert-RLXSXFWN.js +0 -2
- package/dist/persist-recorded-session-EWV56TSZ.js +0 -3
- package/dist/phase-seed-MKHEWUN6.js +0 -2
- package/dist/pipeline-LAWACB2O.js +0 -2
- package/dist/prepare-target-WGPCZKLE.js +0 -2
- package/dist/readmodel-FVLRQWZ7.js +0 -2
- package/dist/real-device-run-MDLFKFVQ.js +0 -2
- package/dist/reconcile-cmd-XFM2ZXUJ.js +0 -2
- package/dist/reconcile-deps-V5VLDPYT.js +0 -4
- package/dist/reconcile-engine-VZBTMPUK.js +0 -2
- package/dist/recording-banner-CJHRPHHF.js +0 -2
- package/dist/records-LMCVKPE5.js +0 -2
- package/dist/registry-3JXQFZEG.js +0 -2
- package/dist/require-project-folder-SE5GVCYJ.js +0 -2
- package/dist/resolve-run-intent-DD4MB6UD.js +0 -2
- package/dist/resolver-TLO4SRWV.js +0 -2
- package/dist/revert-NOUECRW4.js +0 -2
- package/dist/review-cmd-7EOYQMPE.js +0 -5
- package/dist/run-EHUNJPW6.js +0 -2
- package/dist/run-OTMPUQSH.js +0 -2
- package/dist/run-channel-RGH4WIQX.js +0 -2
- package/dist/run-test-md-KBDEHGXJ.js +0 -17
- package/dist/scrollback-JLPJR25X.js +0 -2
- package/dist/session-items-2ATN7VXG.js +0 -2
- package/dist/session-target-UMNASXI7.js +0 -2
- package/dist/sessions-NH7WQWMX.js +0 -2
- package/dist/sessions-cmd-M3SECFKQ.js +0 -25
- package/dist/spawner-DPT2RLAO.js +0 -2
- package/dist/store-guard-U32JE6JJ.js +0 -2
- package/dist/store-id-EOSGEKVK.js +0 -2
- package/dist/structured-answers-ZI2B6JJE.js +0 -2
- package/dist/sync-cmd-3EP7LZGL.js +0 -2
- package/dist/sync-setup-SWTBVQEV.js +0 -2
- package/dist/tcg-generate-KXU7E2GF.js +0 -2
- package/dist/testmd-actions-PEWCPQ5R.js +0 -2
- package/dist/testmd-sync-ZWFQWZ2X.js +0 -2
- package/dist/tms-client-KU6HCA23.js +0 -2
- package/dist/token-refresh-QD3OCGJJ.js +0 -2
- package/dist/trust-gate-EX7R2P4Y.js +0 -2
- package/dist/turn-preflight-JGYT7LXP.js +0 -2
- package/dist/ui-JEJGTURD.js +0 -4
- package/dist/validate-basic-AAIXSAWH.js +0 -2
- package/dist/verdicts-LAB5BGCC.js +0 -2
- package/dist/version-check-EHOLX3YH.js +0 -2
- package/dist/walk-session-XP4KYFKO.js +0 -2
- package/dist/with-telemetry-FJMJQDCM.js +0 -2
- /package/dist/{chunk-BKHXPBWN.js → chunk-2RUSXQ3O.js} +0 -0
- /package/dist/{chunk-6J5T5FEY.js → chunk-3AGP2BVN.js} +0 -0
- /package/dist/{chunk-CH273NAE.js → chunk-73Y6T2UK.js} +0 -0
- /package/dist/{chunk-ZMNJBUAO.js → chunk-73ZFOJOK.js} +0 -0
- /package/dist/{chunk-NOL7MNZH.js → chunk-A7RJQJNT.js} +0 -0
- /package/dist/{chunk-N2P4MI32.js → chunk-FWGUISUG.js} +0 -0
- /package/dist/{chunk-UJZZDPDY.js → chunk-HD6NR44L.js} +0 -0
- /package/dist/{chunk-LDPLJFCV.js → chunk-I6S6DZ2E.js} +0 -0
- /package/dist/{chunk-427OQS2N.js → chunk-LD5B3QFW.js} +0 -0
- /package/dist/{chunk-2UIHS2FH.js → chunk-PGESS7BW.js} +0 -0
- /package/dist/{chunk-BZAGVBCX.js → chunk-ZCIWQHCO.js} +0 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as B}from"./chunk-TU42YZOJ.js";import{a as N}from"./chunk-2DYHAP4E.js";import{a as ie,b as ae,c as ce}from"./chunk-W3USRQX6.js";import{a as H}from"./chunk-URH4FX3H.js";import{d as le}from"./chunk-NZ6AV2TA.js";import{a as $,b as X,e as M,g as se}from"./chunk-77ZZQJLX.js";import{b as oe}from"./chunk-ZU4W2QGM.js";import{b as L}from"./chunk-CGITGJ3I.js";import{a as te}from"./chunk-ZAFJQ3SM.js";import{a as ee}from"./chunk-FCD3NYOM.js";import{a as j}from"./chunk-XZYA7DNH.js";import{a as re,b as ne}from"./chunk-B7ZX5HEN.js";import{a as K}from"./chunk-C2RUDJ46.js";import{a as A}from"./chunk-RZ4F3BHX.js";import{a as O}from"./chunk-HJMCXSUJ.js";import{a as F}from"./chunk-HCBYKLMW.js";import{a as b,b as p,i as Z}from"./chunk-33DWJV67.js";import{a as q}from"./chunk-6YGTRKDT.js";import{y}from"./chunk-D36V5OX6.js";import{e as S}from"./chunk-UR6MHSHU.js";var D=S(q(),1);import{existsSync as P,readFileSync as Ye,rmSync as we,unlinkSync as ze}from"fs";import{resolve as Q}from"path";import{promises as ue,realpathSync as Re}from"fs";import{homedir as Pe}from"os";import{join as V,parse as Me,relative as de,resolve as fe}from"path";var me=new Set(["node_modules",".git","dist","build",".next",".venv","venv","target","__pycache__"]),R=class extends Error{constructor(s){super(`refusing to scan '${s}'. Run from your project root, or pass --root <dir>.`);this.cwd=s;this.name="HomeRefusedError"}};function ge(e){try{return Re(fe(e))}catch{return fe(e)}}function De(e){let r=ge(e),s=ge(Pe()),n=Me(r).root;if(process.platform==="win32"){let o=t=>t.toLowerCase();return o(r)===o(s)||o(r)===o(n)}return r===s||r===n}async function U(e){if(De(e.root))throw new R(e.root);let r=e.maxEntries??5e4,s=e.maxResults??5e3,n=new Set(e.ignore??[]),o=[],t=0,i=0,a=!1,u,c=[e.root];for(;c.length>0&&!a;){let l=c.shift(),g;try{g=await ue.readdir(l,{withFileTypes:!0})}catch{continue}i++;for(let _ of g){if(t++,t>r){a=!0,u="max_entries";break}let m=_.name,T=V(l,m);if(_.isDirectory()){if(me.has(m)||m.startsWith(".")||m.startsWith("output-")||n.has(m))continue;c.push(T)}else if(_.isFile()&&m.endsWith("_test.md")&&(o.push({path:T,relPath:de(e.root,T),source:"cwd"}),o.length>=s)){a=!0,u="max_results";break}}e.onProgress?.(i,o.length)}if(!a){let g=[{dir:V(e.root,".testmuai","tests"),depth:0}];for(;g.length>0&&!a;){let{dir:_,depth:m}=g.shift(),T;try{T=await ue.readdir(_,{withFileTypes:!0})}catch{continue}i++;for(let d of T){if(t++,t>r){a=!0,u="max_entries";break}let k=d.name,w=V(_,k);if(d.isDirectory()){if(m>=20||k.startsWith(".")||k.startsWith("output-")||me.has(k))continue;g.push({dir:w,depth:m+1})}else if(d.isFile()&&k.endsWith("_test.md")&&(o.push({path:w,relPath:de(e.root,w),source:"tests-dir"}),o.length>=s)){a=!0,u="max_results";break}}}}return{results:o,aborted:a,abortReason:u,dirsScanned:i}}import{readFileSync as Ce}from"fs";function Y(e){let r;try{r=Ce(e,"utf8")}catch{return{tags:[]}}try{let{global:s}=re(e,r),n=ne(s);return{tags:s.tags??[],...n?{mobileTarget:n}:{}}}catch{let s=$e(r);return{tags:[],...s?{mobileTarget:s}:{}}}}var pe={platform:"",app:""};function $e(e){let r=/^---\r?\n([\s\S]*?)\r?\n---/.exec(e);if(!r)return;let s=r[1].split(/\r?\n/);for(let o of s){let t=/^target:\s*['"]?(emulator|simulator|android|ios)['"]?\s*$/.exec(o);if(t)return t[1]==="android"||t[1]==="ios"?{platform:t[1],app:"",realDevice:!0}:pe}let n=s.findIndex(o=>/^target:\s*$/.test(o));if(!(n<0))return s.slice(n+1).some(o=>/^\s+\S/.test(o))?pe:void 0}function W(e){return Y(e).tags}import{mkdirSync as Ie,writeFileSync as Fe}from"fs";import{join as Oe}from"path";function he(e,r){return`Basic ${Buffer.from(`${e}:${r}`).toString("base64")}`}async function Ae(e){let r=ae({tmsBaseUrl:e.tmsBaseUrl,testcaseId:e.testcaseId,codeExport:{enabled:!0,language:e.language,skipValidation:e.skipValidation},mobile:e.framework==="appium"}),s=await A(r.url,{method:"POST",headers:{"content-type":"application/json",authorization:he(e.auth.username,e.auth.access_key)},body:JSON.stringify(r.body)});if(!s.ok)throw new Error(`code-export trigger failed: ${s.status} ${await s.text()}`);e.log("info","CODE_EXPORT_TRIGGERED","Code export triggered",{testcase_id:e.testcaseId})}async function Le(e){let r=ce({tmsBaseUrl:e.tmsBaseUrl,testcaseId:e.testcaseId}),s=e.pollIntervalMs??5e3,n=e.timeoutMs??3e5,o=Date.now()+n;for(;Date.now()<o;){let t=await A(r,{headers:{authorization:he(e.auth.username,e.auth.access_key),accept:"application/json"}});if(!t.ok){await new Promise(c=>setTimeout(c,s));continue}let a=(await t.json()).data?.find(c=>c.code_name==="kane-cli-trigger");if(!a){await new Promise(c=>setTimeout(c,s));continue}let u=(a.status??"").toLowerCase();if(u==="in progress"||u==="in_progress"||u==="pending"){await new Promise(c=>setTimeout(c,s));continue}if(!a.url||a.url.length===0)throw new Error(`code-export status=${a.status} but no files returned`);Ie(e.outDir,{recursive:!0});for(let c of a.url){let l=Oe(e.outDir,c.file_name),g=await A(c.file_url);if(!g.ok){e.log("warn","CODE_EXPORT_FILE_FAILED","Failed to download file",{file_name:c.file_name,status:g.status});continue}let _=await g.text();Fe(l,_,"utf-8")}return e.log("info","CODE_EXPORT_DOWNLOADED","Code export saved",{out_dir:e.outDir,file_count:a.url.length}),e.outDir}throw new Error("code-export polling timed out")}async function _e(e){return await Ae(e),await Le(e)}var E=S(q(),1);import{existsSync as je,readFileSync as Be}from"fs";var h=S(F(),1);function Ne(e){B(e);let r=M(e);if(!je(r))return null;try{return JSON.parse(Be(r,"utf8"))}catch{return{}}}function Ue(e){return e===null?"never_run":e.testcase_id?"synced":"local_only"}function We(e){return e==="synced"?"\u2601":e==="local_only"?"\u25A3":"\u25CB"}function Je(e){return e==="tests-dir"?"\u2726":" "}function Ge(e,r){return r==="all"?!0:r==="synced"?e.status==="synced":r==="local"?e.status==="local_only":r==="never_run"?e.status==="never_run":r==="cli"?e.source==="tests-dir":r==="hand"?e.source==="cwd":!0}var z=["all","synced","local","never_run","cli","hand"];function qe(e){let r=z.indexOf(e);return z[(r+1)%z.length]}function ye({root:e,currentOrgId:r,onSelect:s,onCancel:n}){let[o,t]=(0,E.useState)([]),[i,a]=(0,E.useState)(null),[u,c]=(0,E.useState)(!0),[l,g]=(0,E.useState)("all");(0,E.useEffect)(()=>{(async()=>{try{let d=await U({root:e}),k=[];for(let w of d.results){let G=Ne(w.path);G?.org_id!==void 0&&G.org_id!==r||k.push({path:w.path,relPath:w.relPath,name:$(w.path),status:Ue(G),source:w.source,tags:W(w.path)})}t(k),c(!1)}catch(d){d instanceof R,a(d.message),c(!1)}})()},[e,r]);let _=(0,E.useMemo)(()=>o.filter(d=>Ge(d,l)).map(d=>({id:d.path,label:`${We(d.status)} ${Je(d.source)} ${d.relPath}${d.tags.length>0?` [${d.tags.join(", ")}]`:""}`})),[o,l]),m=(0,E.useMemo)(()=>Xe(l,o),[l,o]);if(i)return(0,h.jsxs)(b,{flexDirection:"column",borderStyle:"round",borderColor:y.red,paddingX:2,paddingY:1,children:[(0,h.jsx)(p,{color:y.red,bold:!0,children:"testmd"}),(0,h.jsx)(b,{marginTop:1,children:(0,h.jsx)(p,{color:y.red,children:i})})]});let T=l==="all"?"all":Ke(l);return(0,h.jsx)(te,{title:`testmd \xB7 filter: ${T}`,items:_,loading:u,itemNoun:"tests",onSelect:d=>{let k=o.find(w=>w.path===d.id);k&&s(k)},onCancel:n,onTab:()=>g(d=>qe(d)),extraHint:"cycle filter",footer:m})}function Ke(e){return e==="synced"?"synced (\u2601)":e==="local"?"local (\u25A3)":e==="never_run"?"never run (\u25CB)":e==="cli"?"cli-generated (\u2726)":e==="hand"?"hand-written":"all"}function Xe(e,r){let s={synced:r.filter(o=>o.status==="synced").length,local:r.filter(o=>o.status==="local_only").length,never:r.filter(o=>o.status==="never_run").length,cli:r.filter(o=>o.source==="tests-dir").length,hand:r.filter(o=>o.source==="cwd").length},n=o=>o?y.orange:y.dim;return(0,h.jsxs)(b,{flexDirection:"column",children:[(0,h.jsx)(p,{color:y.dim,children:"legend:"}),(0,h.jsxs)(b,{children:[(0,h.jsx)(p,{color:n(e==="synced"),children:` \u2601 synced (${s.synced}) `}),(0,h.jsx)(p,{color:n(e==="local"),children:`\u25A3 local (${s.local}) `}),(0,h.jsx)(p,{color:n(e==="never_run"),children:`\u25CB never run (${s.never})`})]}),(0,h.jsxs)(b,{children:[(0,h.jsx)(p,{color:n(e==="cli"),children:` \u2726 cli-generated (${s.cli}) `}),(0,h.jsx)(p,{color:n(e==="hand"),children:` hand-written (${s.hand})`})]})]})}var I=S(q(),1);import{existsSync as He,readFileSync as Ve}from"fs";var f=S(F(),1);function xe({path:e,relPath:r,onAction:s,onBack:n,onView:o}){let[t,i]=(0,I.useState)(null),[a,u]=(0,I.useState)(!1);(0,I.useEffect)(()=>{let l=M(e);if(He(l))try{i(JSON.parse(Ve(l,"utf8")))}catch{i(null)}},[e]),Z((l,g)=>{if(g.escape){if(a){u(!1);return}n();return}if(a){l==="y"||l==="Y"?(u(!1),s("delete")):(l==="n"||l==="N")&&u(!1);return}l==="r"&&s("run"),l==="e"&&t?.testcase_id&&s("export"),l==="d"&&u(!0),l==="v"&&o&&o()});let c=({k:l,v:g})=>g?(0,f.jsxs)(p,{children:[(0,f.jsx)(p,{color:y.dim,children:l.padEnd(14)}),g]}):null;return(0,f.jsxs)(b,{flexDirection:"column",borderStyle:"round",borderColor:y.orange,paddingX:2,paddingY:1,children:[(0,f.jsx)(p,{color:y.orange,bold:!0,children:r}),(0,f.jsx)(b,{marginTop:1,flexDirection:"column",children:t?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(c,{k:"test_id",v:t.test_id}),(0,f.jsx)(c,{k:"testcase_id",v:t.testcase_id}),(0,f.jsx)(c,{k:"project_id",v:t.project_id}),(0,f.jsx)(c,{k:"folder_id",v:t.folder_id}),(0,f.jsx)(c,{k:"org_id",v:t.org_id}),(0,f.jsx)(c,{k:"session_name",v:t.session_name}),(0,f.jsx)(c,{k:"commit_id",v:t.commit_id})]}):(0,f.jsx)(p,{color:y.dim,children:"(never run \u2014 no meta.json)"})}),a?(0,f.jsx)(b,{marginTop:1,children:(0,f.jsxs)(p,{color:y.red,bold:!0,children:["Delete ",r," and its output dir? [y/n]"]})}):(0,f.jsx)(b,{marginTop:1,children:(0,f.jsxs)(p,{color:y.dim,children:["[r] run [e] export",t?.testcase_id?"":" (need testcase_id)"," [d] delete",o?" [v] view":""," [Esc] back"]})})]})}function C(e){B(e);let r=M(e);if(!P(r))return null;try{return JSON.parse(Ye(r,"utf8"))}catch{return null}}function ke(e,r){return!e||e.org_id===void 0?!0:e.org_id===r}function J(e,r){return ke(e,r)?null:(process.stderr.write(`error: this test belongs to org ${e.org_id}; you are logged in as org ${r}.
|
|
3
|
+
Switch profiles with \`kane-cli profiles switch\` to act on it.
|
|
4
|
+
`),2)}function be(){return oe(process.cwd()).kind==="remote"?{authOnly:!0}:{}}async function zt(e={}){let r=!!process.stdin.isTTY&&!e.json,s=new O,n=new L;await H({isInteractive:r,creds:s,config:n,...be()});let o=s.getDefaultEnv()??"prod";try{let t=await N({creds:s,env:o,log:()=>{}});return t.resolvedCreds?.org_id===void 0?(process.stderr.write("error: TMS did not return an org_id. Run `kane-cli login` again.\n"),{ok:!1,code:2}):{ok:!0,orgId:String(t.resolvedCreds.org_id)}}catch(t){if(t instanceof j)return process.stderr.write("error: not authenticated. Run `kane-cli login` first.\n"),{ok:!1,code:2};throw t}}async function Qt(e,r){if(process.stdin.isTTY&&!e.json)return await et(r,e.root);let s=e.root??process.cwd(),n;try{n=await U({root:s,ignore:e.ignore})}catch(o){if(o instanceof R)return process.stderr.write(`error: ${o.message}
|
|
5
|
+
`),2;throw o}for(let o of n.results){let t=C(o.path);if(!ke(t,r))continue;let i={path:o.relPath.startsWith(".")?o.relPath:`./${o.relPath}`,name:$(o.path),has_meta:t!==null,source:o.source,synced:!!t?.testcase_id,tags:W(o.path)};t&&(t.test_id&&(i.test_id=t.test_id),t.testcase_id&&(i.testcase_id=t.testcase_id),t.org_id&&(i.org_id=t.org_id),t.project_id&&(i.project_id=t.project_id),t.folder_id&&(i.folder_id=t.folder_id)),process.stdout.write(JSON.stringify(i)+`
|
|
6
|
+
`)}return n.aborted&&process.stderr.write(`warn: walk aborted (${n.abortReason}). Pass --root or --ignore to narrow.
|
|
7
|
+
`),0}var Te=-1001,Ee=-1002,ve=-1003,x={action:null,path:null};function Qe(e,r){return x.action=e,x.path=r,e==="run"?Te:e==="export"?Ee:ve}function Ze({root:e,currentOrgId:r,onComplete:s}){let[n,o]=D.default.useState({kind:"list"});return D.default.useEffect(()=>{n.kind==="exiting"&&s(n.code)},[n,s]),n.kind==="list"?D.default.createElement(ye,{root:e,currentOrgId:r,onSelect:t=>o({kind:"inspect",path:t.path,relPath:t.relPath}),onCancel:()=>o({kind:"exiting",code:0})}):n.kind==="inspect"?D.default.createElement(xe,{path:n.path,relPath:n.relPath,onAction:async t=>{o({kind:"exiting",code:Qe(t,n.path)})},onBack:()=>o({kind:"list"})}):null}async function et(e,r){let s=r??process.cwd(),{render:n}=await import("./build-5ZN47FAT.js"),o=await new Promise(t=>{let{unmount:i,waitUntilExit:a}=n(D.default.createElement(Ze,{root:s,currentOrgId:e,onComplete:u=>{i(),t(u)}}),{stdout:process.stderr,exitOnCtrlC:!0});a().then(()=>t(0)).catch(()=>t(0))});if(o===Te&&x.path){let{runTestMdFile:t}=await import("./run-test-md-BLNBK4MH.js"),i=await t(x.path,{});return x.action=null,x.path=null,i}if(o===Ee&&x.path){let t=await rt(x.path,{},e);return x.action=null,x.path=null,t}if(o===ve&&x.path){let t=await tt(x.path,!0,e);return x.action=null,x.path=null,t}return o}async function Zt(e,r){let s=Q(e);if(!P(s))return process.stderr.write(`error: file not found: ${s}
|
|
8
|
+
`),2;let n=C(s),o=J(n,r);if(o!==null)return o;let t={path:s,name:$(s),has_meta:n!==null};return n&&(n.commit_id&&(t.commit_id=n.commit_id),n.test_id&&(t.test_id=n.test_id),n.testcase_id&&(t.testcase_id=n.testcase_id),n.project_id&&(t.project_id=n.project_id),n.folder_id&&(t.folder_id=n.folder_id),n.org_id&&(t.org_id=n.org_id),n.session_name&&(t.session_name=n.session_name)),process.stdout.write(JSON.stringify(t)+`
|
|
9
|
+
`),0}async function tt(e,r,s){let n=Q(e);if(!P(n))return process.stderr.write(`error: file not found: ${n}
|
|
10
|
+
`),2;let o=C(n),t=J(o,s);if(t!==null)return t;if(!r)return process.stderr.write(`error: refusing to delete without --yes.
|
|
11
|
+
This will remove '${n}' and '${X(n)}/'.
|
|
12
|
+
`),2;let i=X(n);if(P(i))try{we(i,{recursive:!0,force:!0})}catch(a){return process.stderr.write(`error: failed to remove ${i}: ${a.message}
|
|
13
|
+
`),2}try{ze(n)}catch(a){return process.stderr.write(`error: failed to remove ${n}: ${a.message}
|
|
14
|
+
`),2}return process.stderr.write(`removed ${n} and ${i}/
|
|
15
|
+
`),0}var v=class extends Error{kind;constructor(r,s){super(s),this.name="ExportError",this.kind=r}};async function er(e,r){let{codeDir:s}=await Se(e,r);return{codeDir:s}}async function Se(e,r){let s=C(e);if(!s?.testcase_id)throw new v("not-synced","this test has not been synced to TMS \u2014 run `kane-cli testmd run` first.");let n=new L().load(),o=Y(e).mobileTarget!==void 0;if(o&&r.language?.toLowerCase()==="javascript")throw new v("js-on-mobile","--language javascript is not supported on a mobile target \u2014 mobile code export is Appium + Python only. Drop the flag, or pass --language python.");let t=r.language??n.code_export?.language;if(!o&&!t)throw new v("no-language","--language not provided and no default in tui-config.");let{framework:i,language:a}=ie(t??"python",o),u=r.output??se(e,i,a),c=P(u);if(c&&!r.force){let m=!1;try{let{readdirSync:T}=await import("fs");m=T(u).length>0}catch{}if(m)return{kind:"reused",codeDir:u}}c&&r.force&&we(u,{recursive:!0,force:!0});let l=new O,g=r.env??l.getDefaultEnv()??"prod",_;try{_=await N({creds:l,env:g,log:()=>{}})}catch(m){throw m instanceof j?new v("auth-fail","not authenticated. Run `kane-cli login` first."):m}if(!_.basicAuth)throw new v("auth-incomplete","TMS basic auth could not be resolved. Run `kane-cli login` again.");try{let m=K(g);await _e({tmsBaseUrl:m.tmsBaseUrl,testcaseId:s.testcase_id,auth:_.basicAuth,language:a,framework:i,skipValidation:n.code_export?.skip_validation??!0,outDir:u,log:()=>{}})}catch(m){throw new v("export-fail",`code export failed: ${m.message}`)}return{kind:"exported",codeDir:u}}async function rt(e,r,s){let n=Q(e);if(!P(n))return process.stderr.write(`error: file not found: ${n}
|
|
16
|
+
`),2;let o=C(n),t=J(o,s);if(t!==null)return t;try{let i=await Se(n,r);return i.kind==="reused"?process.stderr.write(`reusing existing export at ${i.codeDir}
|
|
17
|
+
`):process.stderr.write(`exported to ${i.codeDir}
|
|
18
|
+
`),0}catch(i){if(i instanceof v)return i.kind==="not-synced"?(process.stderr.write("error: this test has not been synced to TMS \u2014 run `kane-cli testmd run` first.\n"),2):i.kind==="no-language"?(process.stderr.write(`error: --language not provided and no default in tui-config.
|
|
19
|
+
`),2):i.kind==="js-on-mobile"?(process.stderr.write(`error: ${i.message}
|
|
20
|
+
`),2):i.kind==="auth-fail"?(process.stderr.write("error: not authenticated. Run `kane-cli login` first.\n"),2):i.kind==="auth-incomplete"?(process.stderr.write("error: TMS basic auth could not be resolved. Run `kane-cli login` again.\n"),2):(process.stderr.write(`error: ${i.message}
|
|
21
|
+
`),2);throw i}}async function tr(e={}){let r=!!process.stdin.isTTY,s=new O,n=new L;await H({isInteractive:r,creds:s,config:n,...be()});let o=e.env??s.getDefaultEnv()??"prod";try{let t=await N({creds:s,env:o,usernameFlag:e.username,accessKeyFlag:e.accessKey,log:()=>{}});return t.resolvedCreds?.org_id===void 0||!t.basicAuth?(process.stderr.write("error: could not resolve TMS credentials. Run `kane-cli login` again.\n"),{ok:!1,code:2}):{ok:!0,orgId:String(t.resolvedCreds.org_id),basicAuth:t.basicAuth,controllerBaseUrl:K(o).controllerBaseUrl}}catch(t){if(t instanceof j)return process.stderr.write("error: not authenticated. Run `kane-cli login` first.\n"),{ok:!1,code:2};throw t}}async function rr(e,r,s=le){if(!P(e))return process.stderr.write(`error: file not found: ${e}
|
|
22
|
+
`),2;if(!e.endsWith("_test.md"))return process.stderr.write(`error: not a *_test.md file: ${e}
|
|
23
|
+
`),2;let n=C(e),o=J(n,r.orgId);if(o!==null)return o;if(!n?.commit_id||!n?.test_id)return process.stderr.write(`error: ${e} is not authored \u2014 run \`kane-cli testmd run ${e}\` first.
|
|
24
|
+
`),2;let t=await s({sourcePath:e,testId:n.test_id,sessionId:n.commit_id,commitId:n.commit_id,controller:new ee(r.controllerBaseUrl,{username:r.basicAuth.username,accessKey:r.basicAuth.access_key})}),i={type:"test_md_bundle_sync",status:t.ok?"ok":"failed",commit_id:n.commit_id,...t.ok?{bytes:t.bytes}:{stage:t.stage}};return process.stdout.write(JSON.stringify(i)+`
|
|
25
|
+
`),t.ok?(process.stderr.write(`synced: ${n.commit_id}-testmd.zip (${t.bytes} bytes)
|
|
26
|
+
`),0):(process.stderr.write(`error: bundle sync failed at ${t.stage}: ${t.error}
|
|
27
|
+
`),t.stage==="collect"?2:1)}export{U as a,Y as b,ye as c,xe as d,C as e,ke as f,J as g,zt as h,Qt as i,et as j,Zt as k,tt as l,v as m,er as n,rt as o,tr as p,rr as q};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{h as N}from"./chunk-R4JUKTDO.js";import{C as k,M as C,O as R,R as v,sa as G,sb as D,ub as I,v as b}from"./chunk-UEE3RZN4.js";import{f as w,g as _}from"./chunk-KU3YHPWZ.js";var l=(e,t,i=new Set)=>{let n=e.nameOf.get(t);if(n!==void 0)return n;if(i.has(t))return t;i.add(t);for(let[o,s]of e.superseded){if(s!==t||G(o,t,c=>e.nodeLabel.get(c)))continue;let u=l(e,o,i);if(u!==o)return u}return t};function F(e,t){let i=e.stale(t);if(i==="fresh")return;if(i==="orphaned")return"orphaned \u2014 no live source evidences this item";let n=[],o=new Map;for(let s of e.derivesInto(t))o.set(String(s.props.source_id),s);for(let[s,u]of o){let c=e.heads.get(s);if(c==null)continue;let g=D(e,t,s);if(g!==null){g.stale&&n.push(`DERIVES pin ${s} broke \u2014 ${I(s,g)}`);continue}if(c===u.props.source_cid)continue;let S=e.convChains.get(s)?.chain;S&&S.includes(String(u.props.source_cid))||n.push(`DERIVES pin ${s}@${String(u.props.source_cid).slice(0,19)} broke \u2014 the source head moved`)}for(let s of e.edgesFrom(t)){if(s.type===_.DERIVES||!e.superseded.has(s.dst))continue;let u=e.tipOf(s.dst);if(e.superseded.has(u)){n.push(`${s.type} pin \u2192 ${l(e,s.dst)} \u2014 target retired`);continue}let c=P(e,s.dst,u);n.push(c.length>0?`${l(e,s.dst)} updated: ${c.map(g=>g.field).join(", ")}`:`${s.type} pin \u2192 ${l(e,s.dst)} \u2014 target superseded`)}return n.length>0?n.join("; "):"stale \u2014 a pinned dependency moved"}function P(e,t,i){let n=e.getNode(t)?.content??{},o=e.getNode(i)?.content??{},s=c=>c===void 0?"":Array.isArray(c)?c.map(String).join(" \xB7 "):typeof c=="object"?JSON.stringify(c):String(c),u=[];for(let c of[...new Set([...Object.keys(n),...Object.keys(o)])].sort())JSON.stringify(n[c])!==JSON.stringify(o[c])&&u.push({field:c,old:s(n[c]),new:s(o[c])});return u}function L(e,t){let i=[];for(let{cid:n}of e.byLabel(w.SCENARIO))e.superseded.has(n)||e.edgesFrom(n).some(o=>o.type===_.BELONGS_TO&&e.tipOf(o.dst)===t)&&i.push(n);return i}function j(e,t){let i=[],n=[],o=[],s=[],u=[],c=[],g=L(e,t),S=new Set(g),p=(d,f)=>{let r=F(e,f);return r===void 0?d:{...d,stale:!0,stale_reason:r}};for(let d of g){let f=e.getNode(d)?.content??{};i.push(p({ref:l(e,d),title:String(f.title??""),case_type:String(f.case_type??""),intent:String(f.intent??"")},d));for(let r of e.edgesInto(d)){if(r.type!==_.AUTOMATES||e.superseded.has(r.src))continue;let a=e.getNode(r.src)?.content??{},y=e.edgesFrom(r.src).filter(m=>m.type===_.VERIFIES&&!e.superseded.has(m.dst)).map(m=>l(e,m.dst));n.push(p({ref:l(e,r.src),title:String(a.title??""),automates:l(e,d),check:a.check,verifies:y,...typeof a.target=="string"?{target:a.target}:{},...typeof a.app=="string"?{app:a.app}:{}},r.src)),u.push(r.src)}for(let r of e.edgesFrom(d))r.type!==_.EXERCISES||e.superseded.has(r.dst)||s.push({scenario:l(e,d),ac:l(e,r.dst)})}for(let{cid:d}of e.byLabel(w.AC)){if(e.superseded.has(d))continue;let f=e.edgesFrom(d).find(x=>x.type===_.SCOPED_TO);if(!f)continue;let r=e.tipOf(f.dst),a=e.superseded.has(r)&&e.nodeLabel.get(r)===w.SCENARIO&&e.edgesFrom(r).some(x=>x.type===_.BELONGS_TO&&e.tipOf(x.dst)===t);if(!(r===t||S.has(r)||a))continue;let m=e.getNode(d)?.content??{},O={ref:l(e,d),text:String(m.text??""),kind:String(m.kind??""),scope:r===t?"use-case":l(e,r)};o.push(a?{...O,stale:!0,stale_reason:`orphaned: its scenario ${l(e,r)} was retired \u2014 re-scope it (scoped_to_repoints) to a live scenario or the use case if it still holds; a redesign retires it with its scenario otherwise`}:p(O,d)),c.push(d)}let E=[],h=new Set;for(let d of[t,...g,...u,...c])for(let f of e.retractedEdgesTouching(d))h.has(f.ecid)||(h.add(f.ecid),E.push({type:f.type,src:l(e,f.src),dst:l(e,f.dst),at:f.retraction.at,...f.retraction.reason?{reason:f.retraction.reason}:{}}));return{scenarios:i,tests:n,acs:o,exercises:s,retracted_edges:E}}function $(e,t,i){let n=b(e,t,i);return n===null?null:n.toString("utf8")}function A(e,t){let i=t.split(`
|
|
3
|
+
`).map(o=>o.replace(/^\d+\| /,"")),n=[];for(let o of e.split(`
|
|
4
|
+
`)){let s=o.trim();if(s.length===0)continue;let u=i.find(c=>c.includes(s));u!==void 0&&!n.includes(u.trim())&&n.push(u.trim())}return n.length>0?n.join(`
|
|
5
|
+
`):{removed:!0}}function T(e,t,i,n,o){let s=o?{requested:o}:{};if(n!==void 0&&n.trim().length>0)return{kind:"user-directive",text:n.trim(),...s};let u=[i,...j(t,i).acs.map(p=>t.resolve(p.ref)?.tip??"")].filter(Boolean),c=[],g=new Set;for(let p of u){let E=new Map;for(let d of R(t,p))for(let f of t.derivesInto(d))E.set(String(f.props.source_id),f);let h=(d,f,r)=>{let a=String(f.props.anchor),y=`${d}\0${a}`;if(g.has(y)||a==="img#whole")return;g.add(y);let m=$(e,t,String(f.props.source_cid)),O=m===null?null:k(m,a);if(O===null)return;let x=$(e,t,r);c.push({source_id:d,anchor:a,old_anchor_text:O,new_anchor_text:x===null?{removed:!0}:A(O,x)})};for(let[d,f]of E){let r=t.heads.get(d);if(r==null)continue;let a=D(t,p,d);if(a!==null){for(let y of a.failed)y.props.source_cid!==r&&h(d,y,r);continue}r!==f.props.source_cid&&h(d,f,r)}}let S;for(let[p,E]of t.superseded){if(E!==i||t.nodeLabel.get(p)!==w.USECASE)continue;let h=P(t,p,i);h.length>0&&(S=h);break}return{kind:"source-change",changes:c,...S?{uc_updated:S}:{},...s}}function U(e,t,i,n,o){let s=j(t,i);if(s.scenarios.length===0&&s.tests.length===0&&s.acs.length===0)return;let u=T(e,t,i,n,o);if(!(!o&&u.kind==="source-change"&&u.changes.length===0&&!u.uc_updated))return{prior_design:s,change_delta:u}}function K(e,t){if(!t.force||t.resume||!t.useCase||t.priorDesign!==void 0||t.changeDelta!==void 0)return t;let i=C(e),n=i.resolve(v(i,t.useCase));if(!n||i.nodeLabel.get(n.tip)!==w.USECASE||N(i,n.tip)===null)return t;let o=U(e,i,n.tip);return o?{...t,priorDesign:o.prior_design,changeDelta:o.change_delta}:t}export{F as a,j as b,U as c,K as d};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{c as A,l as E}from"./chunk-HK62JVQM.js";import{d as _,e as v}from"./chunk-C6HI6Y3S.js";import{a as P}from"./chunk-4QTH7VYE.js";import{mkdtempSync as N,rmSync as B}from"fs";import{tmpdir as U}from"os";import{join as D}from"path";function T(e){let o=Promise.resolve(),i=new Map,r=s=>{try{B(s,{recursive:!0,force:!0})}catch{}};function a(s){let f=o.then(async()=>{if(i.has(s))throw new Error(`chrome slot ${s} already acquired (one acquire per worker index)`);let c=N(D(U(),"kane-testrun-chrome-")),g;try{g=await e.launch({userDataDir:c,width:e.width,height:e.height,headless:e.headless})}catch(u){throw r(c),u}return i.set(s,{chrome:g,dataDir:c}),{cdpEndpoint:g.cdpEndpoint,release(){let u=i.get(s);if(u){i.delete(s);try{u.chrome.kill()}catch{}r(u.dataDir)}}}});return o=f.catch(()=>{}),f}return{acquire:a,killAll(){for(let[,s]of i){try{s.chrome.kill()}catch{}r(s.dataDir)}i.clear()}}}var x=4;function Y(e){let o=T(e);return{kind:"local",maxParallel:x,async acquire(i){let r=await o.acquire(i);return{cdpEndpoint:r.cdpEndpoint,release:async()=>{r.release()}}},async releaseAll(){o.killAll()},releaseAllSync(){o.killAll()}}}function $(e){return e.replace(/([?&]capabilities=)[^&\s'"]*/g,"$1<redacted>")}function S(e){let o=new Set;for(let r of e)!r||r.length<4||(o.add(r),o.add(encodeURIComponent(r)),o.add(JSON.stringify(r).slice(1,-1)),o.add(encodeURIComponent(JSON.stringify(r).slice(1,-1))));let i=[...o].sort((r,a)=>a.length-r.length);return r=>{let a=$(r);for(let s of i)a=a.split(s).join("<redacted>");return a}}function Q(e){let o=S(e);return i=>JSON.parse(o(JSON.stringify(i)))}import{spawnSync as M}from"child_process";var h=20,ne=["us","eu","mumbai","oregon"],j={stage:"wss://stage-cdp.lambdatestinternal.com",prod:"wss://cdp.lambdatest.com"};function se(e,o){if(!o)return j[e];if(e!=="prod")throw new Error(`--hps-region ${o}: regional HPS hosts are prod only; stage has one host`);return`wss://cdp-${o}.lambdatest.com`}function K(e,o,i,r){let a={user:o.username,accessKey:o.access_key,browserName:"Chrome"};return r&&(a.tunnel=!0,r.name&&(a.tunnelName=r.name)),`${e.replace(/\/+$/,"")}/kane-cli?capabilities=${encodeURIComponent(JSON.stringify(a))}&testId=${encodeURIComponent(i)}`}function ae(e,o,i){let r=new _(e,o.username,o.access_key);return{create:(a,s)=>r.createBrowserSession({...i(),worker_index:a,source:"explore"},{signal:s}),release:(a,s)=>r.endBrowserSession(a,{signal:s})}}var G=`
|
|
3
|
+
const ids = JSON.parse(process.env.KANE_HPS_IDS || "[]");
|
|
4
|
+
Promise.allSettled(ids.map((id) => fetch(process.env.KANE_HPS_FORGE + "/kane-cli/v1/browser-sessions/" + encodeURIComponent(id), {
|
|
5
|
+
method: "DELETE", headers: { Authorization: process.env.KANE_HPS_AUTH, Accept: "application/json" },
|
|
6
|
+
signal: AbortSignal.timeout(5000),
|
|
7
|
+
}))).then(() => process.exit(0));
|
|
8
|
+
`;function ie(e,o,i){i.length&&M(process.execPath,["-e",G],{env:{KANE_HPS_FORGE:e.replace(/\/+$/,""),KANE_HPS_AUTH:P(o.username,o.access_key),KANE_HPS_IDS:JSON.stringify(i)},stdio:"ignore",timeout:8e3})}function le(e){let o=S([e.auth.access_key]),i=e.forgeTimeoutMs??45e3,r=new Set,a=new Set,s=new Set,f=e.followUpMs??[15e3,6e4],c=t=>{try{e.onEvent?.(t)}catch{}},g=e.releaseTimeoutMs??5e3,u=async(t,n,p=i)=>{let l=new AbortController,L=setTimeout(()=>l.abort(),p);try{return await n(l.signal)}catch(d){if(d instanceof v&&d.code==="PLAN_NOT_ALLOWED"){let C=(d.detail??"").replace(/[\u0000-\u001f\u007f\s]+/g," ").trim().slice(0,300);throw new Error(o(`remote browser: ${C||"your plan does not allow remote browsers"} (PLAN_NOT_ALLOWED)`))}let O=d instanceof Error?d.message:String(d),H=l.signal.aborted?`no answer within ${Math.max(1,Math.round(p/1e3))}s`:d instanceof v?`HTTP ${d.status} ${d.text}`.slice(0,205):O.slice(0,200);throw new Error(o(`remote browser: Forge ${t} (${H})`))}finally{clearTimeout(L)}},m=new Map,y=t=>{if(!r.has(t))return Promise.resolve();let n=m.get(t);if(n)return n;let p=k(t).finally(()=>m.delete(t));return m.set(t,p),p},k=async t=>{try{await u(`did not end test ${t}`,n=>e.forge.release(t,n),g),r.delete(t),c({event:"released",test_id:t});for(let n of f){let p=setTimeout(()=>{s.delete(p),b(t)},n);p.unref?.(),s.add(p)}}catch(n){c({event:"release_failed",test_id:t,reason:n.message})}},b=async t=>{if(!(r.has(t)||m.has(t)))try{await u(`did not end test ${t}`,n=>e.forge.release(t,n),g)}catch(n){r.add(t),c({event:"release_failed",test_id:t,reason:n.message})}};return{kind:"remote",maxParallel:h,async acquire(t){let n=await u("refused the remote browser",l=>e.forge.create(t,l));if(!/^KCLI-/.test(n))throw r.add(n),await y(n),new Error(o(`remote browser: Forge returned test id ${n}, not a KCLI- id (the HPS refuses it)`));r.add(n),a.add(n),c({event:"minted",test_id:n,worker_index:t});let p=!1;return{cdpEndpoint:K(e.hpsBase,e.auth,n,e.tunnel),release:async()=>{p||(p=!0,await y(n))}}},async releaseAll(){for(let l of s)clearTimeout(l);s.clear();let t=[...m.keys()],n=[...r].filter(l=>!t.includes(l));await Promise.all([...n,...t].map(l=>y(l)));let p=[...a].filter(l=>!n.includes(l)&&!r.has(l));for(let l of[...a])r.has(l)||a.delete(l);p.length&&(await Promise.all(p.map(l=>b(l))),c({event:"swept",test_ids:p}))},releaseAllSync(){for(let n of s)clearTimeout(n);s.clear();let t=[...new Set([...a,...r])];if(!(!t.length||!e.releaseSync)){c({event:"exit_release",test_ids:t});try{e.releaseSync(t)}catch{}r.clear(),a.clear()}},live:()=>[...r]}}var q=["Target","Budget","Scope & safety","Browsers","Setup","Advanced","Output","Account"],R={url:{flag:"--url",group:"Target",purpose:"The app's entry URL; a re-run keeps its exploration's URL",values:"an http(s) URL",dflt:"the exploration's URL; required for a new exploration",note:"one project has one exploration of one URL: a different --url for an existing one is refused"},project:{flag:"--project",group:"Target",purpose:"The project the exploration belongs to (one exploration per project)",values:"a project id",dflt:"the configured project (kane-cli config set-project); a remote run needs one"},explorationId:{flag:"--exploration-id",group:"Target",purpose:"With --local-orchestration: add the run to this exploration",values:"an id from kane-cli explore list --all",dflt:"the project's exploration, or a new one"},prompt:{flag:"--prompt",group:"Target",purpose:"What to explore and why: the scope the strategist honours",values:"text",dflt:'"Explore the app"'},maxLeases:{flag:"--max-leases",group:"Budget",purpose:"Stop after this many leases (a lease is one piece of explorer work)",values:"a positive integer",dflt:"no limit"},maxParallel:{flag:"--max-parallel",group:"Budget",purpose:"Most browsers at once; an extra one opens only when there is work for it",values:`1-${x} local browsers, 1-${h} remote`,dflt:"1",note:"each extra browser may sign in once; use 1 for a single login"},depthCaps:{flag:"--depth-caps",group:"Advanced",purpose:"How many controls the explorer tries per screen, by click-depth from the start page",values:"depth:cap pairs (0 = no cap; the deepest listed depth applies below it)",dflt:"12 per screen at every depth",note:"e.g. 0:0,1:3,2:1 = everything on the start page, 3 per screen one click deep, 1 per screen deeper"},slowBudget:{flag:"--slow-budget",group:"Advanced",purpose:"When a finding calls the app slow (it must be slow on two runs)",values:"response=, page=, step= in s or ms, any of the three, e.g. page=4s",dflt:"response=3s,page=4s,step=2.5s"},recheck:{flag:"--no-recheck",group:"Advanced",purpose:"Re-check: walk each new finding's path once more to see if it reproduces",values:"on | off (--no-recheck)",dflt:"on"},policy:{flag:"--policy",group:"Scope & safety",purpose:"What the run may do: read_only only reads, mutating may change data",values:A.join(" | "),dflt:E,note:"mutating blocks nothing but --deny controls and warns before every run"},allowDomain:{flag:"--allow-domain",group:"Scope & safety",purpose:"A host the run may walk, subdomains included; repeatable",values:"a host, e.g. example.com",dflt:"the --url host",note:"read_only blocks writes to every allowed host; mutating only bounds the walk"},deny:{flag:"--deny",group:"Scope & safety",purpose:"A control name the explorer never acts on, under any policy; repeatable",values:`a control's name, e.g. "Archive"`,dflt:"none (read_only also never acts on delete, sign out, pay, \u2026)"},allowPost:{flag:"--allow-post",group:"Scope & safety",purpose:"read_only only: a read-only POST endpoint the gate lets through",values:"host/path, e.g. api.example.com/v1/flags (inside the run's domains), or * for every POST",dflt:"none",note:"repeatable; PUT, PATCH and DELETE stay blocked; no effect under mutating"},focus:{flag:"--focus",group:"Scope & safety",purpose:"Explore from one screen of the existing map (needs --exploration-id)",values:"the screen's name, words from its name or URL, or its id",dflt:"the whole app, from the entry"},localOrchestration:{flag:"--local-orchestration",group:"Browsers",purpose:"Run the exploration from this machine instead of on HyperExecute",dflt:"HyperExecute (the command exits once the run is queued; stop it with explore stop)"},browser:{flag:"--browser",group:"Browsers",purpose:"With --local-orchestration: where the browsers run",values:`local (Chrome here) | remote (LambdaTest cloud Chrome, up to ${h})`,dflt:"local; a HyperExecute run always uses remote"},headless:{flag:"--headless",group:"Browsers",purpose:"Run local Chrome without a window (local browsers only)",dflt:"off"},tunnel:{flag:"--tunnel",group:"Browsers",purpose:"Remote browsers go through your LT tunnel: for localhost or a private app",dflt:"off",note:"start LT first and keep it up (kane-cli does not): LT --user <user> --key <key> --env ht-stage|ht-prod --tunnelName <name>"},tunnelName:{flag:"--tunnel-name",group:"Browsers",purpose:"The LT tunnel to use, by its --tunnelName (implies --tunnel)",values:"the name LT was started with",dflt:"your one running tunnel"},deps:{flag:"--deps",group:"Setup",purpose:"What the app depends on, in plain words; it plans the setup walk",values:'text, e.g. "Logged in as {{u}} / {{p}}"; repeatable, or @file (read verbatim)',dflt:"none",note:"needs --allow-domain for every host the app signs in or writes on"},variables:{flag:"--variables",group:"Setup",purpose:"Inline variables JSON, over the variables files",values:`'{"pass": {"value": "\u2026", "secret": true}}'`,dflt:"none"},variablesFile:{flag:"--variables-file",group:"Setup",purpose:"A variables JSON file, over the global and local variables folders",values:"a path",dflt:"none (the folders are always loaded, as for run)"},context:{flag:"--no-context",group:"Setup",purpose:"Assurance context: the project's assurance context grows as it explores",values:"on | off (--no-context)",dflt:"on",note:"only a new exploration takes it; change an existing one with explore context on|off"},agent:{flag:"--agent",group:"Output",purpose:"NDJSON on stdout, the same stream a pipe gets, for agents on a terminal",dflt:"on when stdin or stdout is not a terminal"},env:{flag:"--env",group:"Account",purpose:"The environment to run in",values:"prod | stage",dflt:"your login's, else prod"},username:{flag:"--username",group:"Account",purpose:"Basic auth username (skips OAuth)",dflt:"your login's"},accessKey:{flag:"--access-key",group:"Account",purpose:"Basic auth access key",dflt:"your login's"},variablesRow:{purpose:"The variables the prompt and deps use, from your variables files"},moreRow:{purpose:"Every other run option: scope, browsers, setup, and the advanced tuning"},advancedRow:{purpose:"Tuning knobs: depth caps, the slow budget, re-check"}};function w(e){return F(R[e])}function F(e){return[e.purpose,e.values&&`values: ${e.values}`,e.dflt&&`default: ${e.dflt}`,e.note&&`note: ${e.note}`].filter(Boolean).join(`
|
|
9
|
+
`)}function ge(){return q.map(e=>({title:e,flags:[...Object.values(R).filter(o=>o.group===e&&o.flag).map(o=>o.flag),...e==="Output"?["--help"]:[]]}))}var me=w("agent"),fe=w("env"),he=w("username"),we=w("accessKey");export{T as a,x as b,Y as c,S as d,Q as e,h as f,ne as g,se as h,ae as i,ie as j,le as k,R as l,w as m,F as n,ge as o,me as p,fe as q,he as r,we as s};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as D}from"./chunk-KGNE5CIM.js";import{a as ue,b as te,d as ce,e as R,k as de}from"./chunk-HK62JVQM.js";import{mkdirSync as Be,writeFileSync as Ae}from"fs";import{join as X}from"path";var ve="start LT with --env ht-stage|ht-prod --tunnelName <name>; see kane-cli explore run --help";function me(t){if(/either tunnel is not running or disconnected/i.test(t))return`remote browser: no running LT tunnel found for this run (HPS: either tunnel is not running or disconnected)
|
|
3
|
+
next: ${ve}`;let e=/WebSocket error: \S*\/kane-cli\S* (5\d\d)\b/.exec(t)?.[1];if(e){let r=Ee(t);return`remote browser: HPS answered HTTP ${e} to the connect${r?` (HPS: ${r})`:""} (on a tunnel run: the tunnel service failed); run again, and report it to the platform team if it persists`}return null}function Ee(t){let e=t.split(`
|
|
4
|
+
`).slice(1).find(i=>i.trim()&&!/^Call log:/.test(i.trim())&&!/^\s*-\s*</.test(i));if(!e)return null;let r=e.trim();try{let i=JSON.parse(r),s=i?.value?.message??i?.message;typeof s=="string"&&s.trim()&&(r=s.trim())}catch{}return r=r.replace(/\b(?:wss?|https?):\/\/\S+/g,"<url>"),r.length>300?r.slice(0,300)+"\u2026":r}var Se={baseMs:500,maxMs:3e4},W=class{o;backoff;sleep;nextSeq;draining=null;stopDeadline=null;wake=null;_state="open";_refusal=null;_fatal=null;_committedThisRun=0;constructor(e){this.o=e,this.backoff=e.backoff??Se,this.sleep=e.sleep??(r=>new Promise(i=>setTimeout(i,r))),this.nextSeq=Math.max(e.firstSeq,e.queue.lastParked+1)}get state(){return this._state}get refusal(){return this._refusal}get fatal(){return this._fatal}get pendingCount(){return this.o.queue.pendingCount}get committedThisRun(){return this._committedThisRun}get lastCommitted(){return this.o.queue.lastCommitted}enqueue(e){return e.run_id!==this.o.runId?{ok:!1,code:"RUN_MISMATCH",reason:`delta ${e.seq} names run ${e.run_id}, this run is ${this.o.runId}`}:!Number.isInteger(e.seq)||e.seq!==this.nextSeq?{ok:!1,code:"SEQUENCE_LOCAL",reason:`expected seq ${this.nextSeq} for run ${this.o.runId}, received ${String(e.seq)}`}:(this.o.queue.append(e),this.nextSeq=e.seq+1,this.kick(),{ok:!0})}kick(){this._state==="open"&&(this.draining||(this.draining=this.drainLoop().catch(e=>(this.markFatal(this.o.queue.pending()[0]?.seq??-1,"LOCAL_IO",e instanceof Error?e.message:String(e)),"stopped")).then(e=>{this.draining=null,e==="empty"&&this._state==="open"&&this.o.queue.pendingCount>0&&this.kick()})))}async flush(e){if(this.stopDeadline=Date.now()+e,this.kick(),this.wake){let r=this.wake;this.wake=null,r()}for(;this.draining;)await this.draining;return this.o.queue.pendingCount}async drainLoop(){let e=0;for(;this._state==="open";){let r=this.o.queue.pending()[0];if(!r)return"empty";let i=this.o.queue.refused(r.seq);if(i)return this.refuse(r.seq,i.code,`previously refused: ${i.reason}`,!1),"stopped";let s=await this.o.client.commitDelta(this.o.explorationId,this.o.runId,r);switch(s.kind){case"committed":e=0,this.o.queue.markCommitted(r.seq),this._committedThisRun++,this.o.onAck?.(r.seq);break;case"refused":return this.refuse(r.seq,s.code,s.reason,!0),"stopped";case"fatal":return this.markFatal(r.seq,s.code,s.reason),"stopped";case"transient":{e++;let a=Math.min(this.backoff.maxMs,this.backoff.baseMs*2**(e-1));if(this.stopDeadline!==null&&Date.now()+a>this.stopDeadline)return"deadline";this.o.onRetry?.(r.seq,e,s.reason,a),await this.interruptibleSleep(a);break}}}return"stopped"}markFatal(e,r,i){this._state="fatal",this._fatal={seq:e,code:r,reason:i},this.o.onFatal?.(e,r,i)}refuse(e,r,i,s){s&&this.o.queue.markRefused(e,r,i,{controller_wire:this.o.controllerWire,client_wire:ue}),this._state="refused",this._refusal={seq:e,code:r,reason:i},this.o.onRefused?.(e,r,i)}async interruptibleSleep(e){await Promise.race([this.sleep(e),new Promise(r=>{this.wake=r})]),this.wake=null}};import{appendFileSync as Ce,closeSync as $e,existsSync as Pe,fsyncSync as Te,mkdirSync as Ie,openSync as De,readFileSync as Me}from"fs";import{dirname as Oe,join as Le}from"path";var Fe="pending-deltas.ndjson",Q=class{path;deltas=new Map;committed=new Set;refusedBySeq=new Map;tornTail=!1;constructor(e){this.path=Le(e,Fe),this.load()}append(e){let r=this.deltas.get(e.seq);if(r){if(JSON.stringify(r)===JSON.stringify(e))return;throw new Error(`pending queue already holds a different delta for seq ${e.seq}`)}this.write({op:"delta",seq:e.seq,delta:e}),this.deltas.set(e.seq,e)}markCommitted(e){this.committed.has(e)||(this.write({op:"committed",seq:e}),this.committed.add(e))}markRefused(e,r,i,s={}){let a={...s.controller_wire?{controller_wire:s.controller_wire}:{},...s.client_wire?{client_wire:s.client_wire}:{}};this.write({op:"refused",seq:e,code:r,reason:i,...a}),this.refusedBySeq.set(e,{seq:e,code:r,reason:i,...a})}pending(){return[...this.deltas.entries()].filter(([e])=>!this.committed.has(e)).sort(([e],[r])=>e-r).map(([,e])=>e)}get pendingCount(){return this.pending().length}get lastCommitted(){let e=0;for(let r of this.committed)e=Math.max(e,r);return e}get lastParked(){let e=0;for(let r of this.deltas.keys())e=Math.max(e,r);return e}refused(e){return this.refusedBySeq.get(e)}load(){if(!Pe(this.path))return;let e=Me(this.path,"utf8");this.tornTail=e.length>0&&!e.endsWith(`
|
|
5
|
+
`);let r=e.split(`
|
|
6
|
+
`);for(let i of r){let s=i.trim();if(!s)continue;let a;try{a=JSON.parse(s)}catch{continue}if(!(!a||typeof a.seq!="number")){if(a.op==="delta"&&a.delta)this.deltas.set(a.seq,a.delta);else if(a.op==="committed")this.committed.add(a.seq);else if(a.op==="refused"){let{op:h,...m}=a;this.refusedBySeq.set(a.seq,m)}}}}write(e){Ie(Oe(this.path),{recursive:!0});let r=this.tornTail?`
|
|
7
|
+
`:"";Ce(this.path,r+JSON.stringify(e)+`
|
|
8
|
+
`),this.tornTail=!1;try{let i=De(this.path,"r+");try{Te(i)}finally{$e(i)}}catch{}}};function H(t){return t.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)}function fe(t){return new Set([...H(t.name),...H(t.heading??""),...H(t.url_pattern)])}function pe(t){let e=t.heading&&t.heading!==t.name?`, heading "${t.heading}"`:"";return`"${t.name}" (${t.url_pattern}${e}, id ${t.id})`}function Ne(t,e,r=e){let i=e.filter(m=>m.id!==t.id),s=r.filter(m=>m.id!==t.id),a=(m,p)=>m.trim().toLowerCase()===p.trim().toLowerCase(),h=m=>!i.some(p=>a(p.name,m)||a(p.heading??"",m));if(t.name.trim()&&h(t.name))return t.name.trim();if(t.heading?.trim()&&h(t.heading))return t.heading.trim();for(let m=Math.min(12,t.id.length);m<t.id.length;m++){let p=t.id.slice(0,m);if(!s.some(g=>g.id.startsWith(p)))return p}return t.id}function he(t,e,r={}){let i=t.trim();if(!i)return{ok:!1,error:'--focus needs a screen name, e.g. --focus "Projects"'};let s=e.filter(l=>!r[l.id]||r[l.id]===l.id),a=s.filter(l=>l.id===i||i.length>=8&&l.id.startsWith(i));if(a.length===1)return{ok:!0,junction:a[0]};let h=s.filter(l=>!l.exit),m=h.filter(l=>[l.name,l.heading??""].some(d=>d.trim().toLowerCase()===i.toLowerCase()));if(m.length===1)return{ok:!0,junction:m[0]};let p=H(i),g=h.filter(l=>{let d=fe(l);return p.every(S=>d.has(S))});if(g.length===1)return{ok:!0,junction:g[0]};if(g.length>1){let l=g.map(d=>` ${pe(d)} \u2192 --focus "${Ne(d,g,s)}"`).join(`
|
|
9
|
+
`);return{ok:!1,error:`--focus "${i}" matches ${g.length} screens; name one:
|
|
10
|
+
${l}`}}let M=h.map(l=>({j:l,n:p.filter(d=>fe(l).has(d)).length})).filter(l=>l.n>0).sort((l,d)=>d.n-l.n).slice(0,5).map(l=>` ${pe(l.j)}`);return{ok:!1,error:`--focus "${i}" matches no screen on this exploration's map`+(M.length?`; closest:
|
|
11
|
+
${M.join(`
|
|
12
|
+
`)}`:"")}}function ge(t){let e=t.projection??t,i=(Array.isArray(e.junctions)?e.junctions:[]).filter(a=>typeof a.id=="string").map(a=>({id:a.id,name:String(a.name??""),url_pattern:String(a.url_pattern??""),...typeof a.heading=="string"&&a.heading?{heading:a.heading}:{},...Array.isArray(a.variants)&&a.variants.some(h=>typeof h=="string"&&h.startsWith("exit:"))?{exit:!0}:{}})),s=e.aliases&&typeof e.aliases=="object"?e.aliases:{};return{junctions:i,aliases:s}}var Je=1e3,U=2;function re(t){return t.code==="completed"||t.code==="budget"?0:t.code.startsWith("failed:")?1:3}function lt(t){return t.remark&&!t.remark.code.startsWith("failed:")?0:t.exitCode}function we(t,e,r){if(t&&typeof t=="object"&&typeof t.code=="string")return t;let i=ce.includes(e)?e:"runner_error";return R(i,r)}function ut(t){return{type:"done",state:t.state,remark:t.remark,exit_code:t.exitCode,exploration_id:t.explorationId??null,run_id:t.runId??null,committed:t.committed??0,pending:t.pending??0,last_seq:t.lastSeq??0,stop_reason:t.stopReason??null,complete:t.complete??!1,...t.runDir?{run_dir:t.runDir}:{},...t.error?{error:t.error}:{}}}function je(t,e){return X(t,"explorations",e)}function We(t,e,r){return X(je(t,e),"runs",r)}var Qe="this exploration service predates --no-context (it does not take context_enabled): run without --no-context, then turn it off with kane-cli explore context off <exploration-id>";function He(t){let e=t instanceof Error?t.message:String(t);return/unknown field\W+context_enabled/.test(e)&&(!(t instanceof D)||t.status===400)}function Ue(t){let e=t instanceof Error?t.message:String(t);return/unknown field\W+policy/.test(e)&&(!(t instanceof D)||t.status===400)}async function ct(t,e){let r={state:null,remark:null,exitCode:U,explorationId:t.explorationId??null,runId:null,runDir:null,committed:0,pending:0,lastSeq:0,stopReason:null,complete:!1},i=(n,o=U,u=null)=>(r.error=n,r.exitCode=o,u&&(r.state="stopped",r.remark=u),e.emit({type:"error",message:n}),r),s=t.explorationId,a;try{a=await e.client.wireVersion()}catch(n){return i(`could not reach the exploration service: ${b(n)}`)}let h=te(a);if(h)return i(h);if(t.claimRunId&&!s)return i("--claim-run needs --exploration-id (the exploration the queued run belongs to)");let m=n=>{e.emit({type:"warning",message:`exploration ${n} already exists; its assurance context is unchanged \u2014 use \`kane-cli explore context off ${n}\``})};if(s&&t.contextEnabled===!1&&m(s),!s)try{s=(await e.client.createExploration({project_id:t.projectId??null,target_url:t.url,prompt:t.prompt,policy:t.policy,...t.allowedDomains?.length?{allowed_domains:t.allowedDomains}:{},...t.contextEnabled===!1?{context_enabled:!1}:{}})).id,e.emit({type:"exploration_created",exploration_id:s,policy:t.policy})}catch(n){let o=n instanceof D&&n.code==="EXPLORATION_EXISTS"&&typeof n.body?.exploration_id=="string"?n.body.exploration_id:null;if(!o)return t.contextEnabled===!1&&He(n)?i(Qe):i(`could not create the exploration: ${b(n)}`);s=o,t.contextEnabled===!1&&m(o)}r.explorationId=s;let p=null;if(t.focus!==void 0){if(!t.explorationId)return i("--focus needs --exploration-id: it names a screen of an existing exploration's map");let n;try{n=await e.client.queryMap(s)}catch(x){return i(`--focus: could not read the exploration's map: ${b(x)}`)}let{junctions:o,aliases:u}=ge(n),f=he(t.focus,o,u);if(!f.ok)return i(f.error);p=f.junction,e.emit({type:"focus_resolved",junction_id:p.id,name:p.name,url_pattern:p.url_pattern})}let g=null,M=(n,o,u,f)=>new W({client:e.client,queue:n,explorationId:s,runId:o,firstSeq:u,backoff:e.backoff,sleep:e.sleep,controllerWire:a,onAck:x=>{e.emit({type:"delta_committed",seq:x}),f&&y("delta_ack",{seq:x,committed:!0})},onRefused:(x,P,T)=>{e.emit({type:"commit_refused",seq:x,code:P,reason:T}),f&&y("commit_refused",{seq:x,reason:`${P}: ${T}`})},onFatal:(x,P,T)=>{e.emit({type:"commit_failed",seq:x,code:P,reason:T})},onRetry:(x,P,T,qe)=>{e.emit({type:"commit_retry",seq:x,attempt:P,reason:T,wait_ms:qe})}}),l;try{let n={...t.claimRunId?{run_id:t.claimRunId}:t.requested?{requested:t.requested}:{},...t.claimRunId?{}:{policy:t.policy},sessions:Math.max(1,t.maxParallel??1),client_release:t.clientRelease};try{l=await e.client.startRun(s,n)}catch(o){if(!(n.policy&&Ue(o)))throw o;let{policy:u,...f}=n;l=await e.client.startRun(s,f)}}catch(n){let o=n instanceof D?` (${n.code})`:"";return i(`could not start the run${o}: ${b(n)}`)}let d=l.run_id,S=te(l.wire_version);if(S){try{await e.client.endRun(s,d,{remark:R("controller_outdated",S),stop_reason:"controller_outdated",last_seq:l.next_seq-1,complete:!1,totals:{},unacked:0})}catch{}return r.runId=d,i(S,U,R("controller_outdated",S))}r.runId=d;let C=We(e.baseDir,s,d);r.runDir=C,Be(C,{recursive:!0}),g=new Q(C);let O=Math.max(l.next_seq,g.lastCommitted+1),ke={...l.projection,last_seq:O-1},ne=X(C,"starting-projection.json");Ae(ne,JSON.stringify(ke)),e.onLiveRun?.({explorationId:s,runId:d,liveToken:l.live_token??null}),e.emit({type:"explore_run_started",exploration_id:s,run_id:d,...l.version!==void 0?{version:l.version}:{},next_seq:O,run_dir:C,policy:t.policy});let L,oe=e.browserAcquireTimeoutMs??6e4;try{L=await ye(e.acquireBrowser(0),oe,`worker 0's browser was not ready within ${Math.round(oe/1e3)}s`)}catch(n){try{await e.client.endRun(s,d,{remark:R("no_browsers",`worker 0's browser could not be opened: ${b(n)}`),stop_reason:"no_browsers",last_seq:O-1,complete:!1,totals:{},unacked:0})}catch{}return r.stopReason="no_browsers",i(`could not open worker 0's browser: ${b(n)}`,1,R("no_browsers",`worker 0's browser could not be opened: ${b(n)}`))}let w;try{w=e.spawnRunner(d)}catch(n){try{L.release()}catch{}return i(`could not spawn the runner: ${b(n)}`)}let F=n=>{try{w.child.stdin?.write(n)}catch{}};function y(n,o){F(de(n,o))}e.frameLink?.({start:n=>y("frames_start",{worker_index:n}),stop:n=>y("frames_stop",{worker_index:n})});let k=M(g,d,O,!0),N=0,ie=-1/0,xe=e.now??(()=>Date.now()),_e=e.onInterrupt?.(()=>{let n=xe();if(!(n-ie<Je))if(ie=n,N++,N===1&&!J){e.emit({type:"explore_control",control:"stop"}),ae=!0,e.releaseBrowsersOnInterrupt&&z();try{w.child.kill("SIGTERM")}catch{}}else if(N===1)e.emit({type:"explore_control",control:"stop"}),e.releaseBrowsersOnInterrupt&&z(),y("stop",e.releaseBrowsersOnInterrupt?{browsers_released:!0}:{});else if(N===2)e.emit({type:"warning",message:"the run is stopping cleanly (its leases finish, every delta is sent); press Ctrl-C again to kill it now"});else{V=!0,e.emit({type:"warning",message:"killing the runner: deltas not yet committed are lost"}),e.releaseBrowsersOnInterrupt&&z();try{w.child.kill("SIGKILL")}catch{}}}),se=Math.max(1,t.maxParallel??1),_=new Map([[0,L]]),G=1,I=Promise.resolve(),K=!1,z=()=>{K=!0;for(let[n,o]of _){try{o.release()}catch{}_.delete(n)}},be=n=>{I=I.then(async()=>{if(K){y("browser_failed",{worker_index:n,reason:"the run was interrupted: no new browser is opened while it stops"});return}if(_.has(n)){y("browser_failed",{worker_index:n,reason:`worker ${n} already holds a browser`});return}if(_.size>=se){y("browser_failed",{worker_index:n,reason:`--max-parallel ${se} reached: workers ${[..._.keys()].join(", ")} hold every browser`});return}try{let o=await ye(e.acquireBrowser(n),e.browserAcquireTimeoutMs??6e4,`browser for worker ${n} was not ready within ${Math.round((e.browserAcquireTimeoutMs??6e4)/1e3)}s`);if(K){try{o.release()}catch{}y("browser_failed",{worker_index:n,reason:"the run was interrupted: no new browser is opened while it stops"});return}_.set(n,o),G=Math.max(G,_.size),y("browser_ready",{worker_index:n,cdp_endpoint:o.cdpEndpoint})}catch(o){y("browser_failed",{worker_index:n,reason:b(o)})}})},Re=n=>{I=I.then(()=>{let o=_.get(n);if(o){try{o.release()}catch{}_.delete(n)}})},B=!1,$=null,c=null,q=null,A=null,J=!1,ae=!1,V=!1,Y=!1,Z=setTimeout(()=>{if(!J){q=q??`the runner did not become ready within ${e.readyTimeoutMs??12e4}ms`;try{w.child.kill("SIGTERM")}catch{}}},e.readyTimeoutMs??12e4);Z.unref?.(),F(JSON.stringify({command:"start",session_id:d,cdp_endpoint:L.cdpEndpoint,username:t.auth.username,access_key:t.auth.access_key,headless:t.headless,width:t.width,height:t.height,disable_ask_user:!0})+`
|
|
13
|
+
`);try{for await(let n of w.events){let o=n;switch(o.type){case"ready":J||(J=!0,clearTimeout(Z),F(JSON.stringify({command:"run",run_id:d,kind:"explore",exploration_id:s,url:t.url,prompt:t.context?.prompt??t.prompt,...t.context?.deps?{deps:t.context.deps}:{},policy:t.policy,attempt:1,sessions:Math.max(1,t.maxParallel??1),...t.maxLeases!==void 0?{max_leases:t.maxLeases}:{},...t.slowBudgets&&Object.keys(t.slowBudgets).length?{slow_budgets:t.slowBudgets}:{},...t.recheck===!1?{recheck:!1}:{},...t.variables&&Object.keys(t.variables).length?{variables:t.variables}:{},...t.denyNames?.length?{deny_names:t.denyNames}:{},...t.allowedDomains?.length?{allowed_domains:t.allowedDomains}:{},...t.allowPosts?.length?{allow_posts:t.allowPosts}:{},...t.depthCaps&&Object.keys(t.depthCaps).length?{thresholds:{depth_caps:t.depthCaps}}:{},...p?{focus:{junction_id:p.id,name:p.name}}:{},max_parallel:Math.max(1,t.maxParallel??1),width:t.width,height:t.height,evidence_dir:X(C,"evidence"),starting_projection:ne})+`
|
|
14
|
+
`));break;case"explore_frame":{let u=Number(o.worker_index);Number.isInteger(u)&&typeof o.data=="string"&&e.onFrame?.(u,o.data),y("frames_ack",{worker_index:u});break}case"browser_request":be(Number(o.worker_index));break;case"browser_release":Re(Number(o.worker_index)),e.emit(o);break;case"map_delta":{let u=o.delta;if(!u||typeof u!="object"){e.emit({type:"error",message:"map_delta without a delta"});break}if(Y)break;e.emit({type:"map_delta",seq:u.seq,attempt:u.attempt,lease_id:u.lease_id});let f=k.enqueue(u);f.ok||(Y=!0,e.emit({type:"commit_refused",seq:u.seq,code:f.code,reason:f.reason}),y("commit_refused",{seq:u.seq,reason:`${f.code}: ${f.reason}`}));break}case"explore_end":c=o,c.credits&&!r.credits&&(r.credits=c.credits),c.focus&&!r.focus&&(r.focus=c.focus),c.refused&&(r.refused=c.refused),c.parallelism&&!r.parallelism&&(r.parallelism=c.parallelism),e.emit(o);break;case"error":A=typeof o.message=="string"?o.message:JSON.stringify(o),q=me(A)??A,e.emit({type:"runner_error",message:q});break;case"done":B=!0,$=o,o.teardown&&typeof o.teardown=="object"&&(r.teardown=o.teardown),o.credits&&typeof o.credits=="object"&&(r.credits=o.credits),typeof o.credits_consumed=="number"&&(r.creditsConsumed=o.credits_consumed),o.focus&&typeof o.focus=="object"&&(r.focus=o.focus),typeof o.refused=="string"&&o.refused&&(r.refused=o.refused),o.parallelism&&typeof o.parallelism=="object"&&(r.parallelism=o.parallelism);break;default:e.emit(o)}if(B)break}}finally{clearTimeout(Z),_e?.(),e.frameLink?.(null)}F(JSON.stringify({command:"shutdown"})+`
|
|
15
|
+
`);try{w.child.stdin?.end()}catch{}if(await Promise.race([w.exited,new Promise(n=>setTimeout(n,e.runnerExitTimeoutMs??1e4).unref?.())]),w.getExitCode()===null&&w.getExitSignal()===null)try{w.child.kill("SIGTERM")}catch{}await I;for(let[n,o]of _){try{o.release()}catch{}_.delete(n)}r.peakParallel=G;let v=await k.flush(V?Math.min(1e3,e.drainTimeoutMs??1e3):e.drainTimeoutMs??6e4);r.committed=k.committedThisRun,r.pending=v,r.lastSeq=g.lastCommitted,r.stopReason=c?.stop_reason??null,r.complete=!!c?.complete&&v===0;let E=async(n,o)=>{try{return await e.client.endRun(s,d,{remark:n,stop_reason:o,last_seq:g.lastCommitted,complete:n.code==="completed"&&!!c?.complete,totals:c?.totals??{},unacked:c?.unacked??0,...c?.credits?{credits:c.credits}:{},...c?.audit_notes?.length?{audit_notes:c.audit_notes}:{},...c?.focus?{focus:c.focus}:{}}),null}catch(u){return b(u)}};if(k.state==="refused"||Y){let n=k.refusal?`seq ${k.refusal.seq} refused: ${k.refusal.code}: ${k.refusal.reason}`:"a delta broke the run's sequence and was refused locally",o=R("commit_refused",n),u=await E(o,"commit_refused");return r.stopReason="commit_refused",i(`${n}${u?` (ending the run also failed: ${u})`:""}; queue kept in ${g.path}`,1,o)}if(V){let n={code:"user_stop",message:"killed by the user"},o=await E(n,"killed");return r.stopReason="killed",o?i(`killed, but ending the run failed: ${o}`,3,n):(r.state="stopped",r.remark=n,r.exitCode=re(n),v>0&&(r.error=`${v} delta(s) were not committed and are lost with this run`),r)}if(k.state==="fatal"||v>0){let n=k.state==="fatal"&&k.fatal?`committing stopped: ${k.fatal.code}: ${k.fatal.reason}; `:"",o=R("commit_failed",`${v} delta(s) could not be committed`),u=await E(o,"commit_failed");return r.stopReason="commit_failed",i(`${n}${v} delta(s) could not be committed and are lost with this run (the queue stays in ${g.path}); a new run continues from the map${u?` (ending the run also failed: ${u})`:""}`,1,o)}if(B&&!c&&$&&$.success===!1&&typeof $.stop_reason=="string"){let n=$.stop_reason,o=q??`the runner refused the run: ${n}`,u=we($.remark,n,o),f=await E(u,n);return r.stopReason=n,i(`${o}${f?` (ending the run also failed: ${f})`:""}`,1,u)}if(ae&&!c){let n={code:"user_stop",message:"stopped with Ctrl-C before it explored"},o=await E(n,"stopped");return r.stopReason="stopped",o?i(`stopped before exploring, but ending the run failed: ${o}`,1,n):(r.state="stopped",r.remark=n,r.exitCode=re(n),r)}if(!B||!c){let n=q??`the runner exited (code=${w.getExitCode()}, signal=${w.getExitSignal()??"none"}) before explore_end`,o=q!==null&&q!==A?"":w.getStderr().slice(-500),u=R("runner_error",n),f=await E(u,"runner_exited"),x=f?` (ending it failed: ${f})`:" (the run is ended)";return i(`${n}${o?`
|
|
16
|
+
${o}`:""}${x}; a new run continues from the map`,U,u)}let ee=c.stop_reason,j=we(c.remark,ee,`the runner ended the run (${ee}) without a remark`),le=await E(j,ee);return le?i(`every delta is committed but ending the run failed: ${le}`,1,j):(r.state="stopped",r.remark=j,r.exitCode=re(j),c.refused&&(r.error=c.refused,e.emit({type:"error",message:c.refused})),r)}function ye(t,e,r){return new Promise((i,s)=>{let a=setTimeout(()=>s(new Error(r)),e);a.unref?.(),t.then(h=>{clearTimeout(a),i(h)},h=>{clearTimeout(a),s(h)})})}function b(t){return t instanceof Error?t.message:String(t)}export{re as a,lt as b,ut as c,Qe as d,He as e,ct as f};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as s}from"./chunk-KU3YHPWZ.js";import{existsSync as y,mkdirSync as N,writeFileSync as G}from"fs";import{dirname as O,join as C}from"path";import{spawnSync as l}from"child_process";import{appendFileSync as m,existsSync as i,readFileSync as u}from"fs";import{dirname as f,join as a}from"path";var p="# kane-cli context store: shared through a location, never merged with git",d=".context/",h=new Set([".context",".context/","/.context","/.context/"]);function g(e,t={}){let n=t.env??process.env;if(n.KANE_CONTEXT_GITIGNORE==="0")return{outcome:"skipped"};try{if(!x(e))return{outcome:"not-a-repo"};let r=a(e,".gitignore");if(E(r))return{outcome:"already",path:r};if((t.checkIgnore??(o=>I(o,n)))(e)===!0)return{outcome:"already"};let c="";if(i(r)){let o=u(r);o.length>0&&o[o.length-1]!==10&&(c=`
|
|
3
|
+
`)}return m(r,`${c}${p}
|
|
4
|
+
${d}
|
|
5
|
+
`),{outcome:"added",path:r}}catch(r){return{outcome:"failed",reason:r instanceof Error?r.message:String(r)}}}function x(e){let t=e;for(;;){if(i(a(t,".git")))return!0;let n=f(t);if(n===t)return!1;t=n}}function E(e){return i(e)?u(e,"utf8").split(/\r?\n/).some(t=>h.has(t.trim())):!1}function I(e,t){let n=l("git",["-C",e,"check-ignore","-q",".context"],{env:{...t,GIT_TERMINAL_PROMPT:"0"},stdio:"ignore",timeout:5e3});return n.error||n.status===null?null:n.status===0?!0:n.status===1?!1:null}function L(e){let t=C(e,"meta.json");return y(t)?{created:!1}:(N(e,{recursive:!0}),G(t,JSON.stringify({schema:s,canonicalizer:"v1"},null,2)+`
|
|
6
|
+
`),{created:!0,gitignore:g(O(e))})}export{g as a,L as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as R}from"./chunk-HCBYKLMW.js";import{a as h,d as k}from"./chunk-
|
|
2
|
+
import{a as R}from"./chunk-HCBYKLMW.js";import{a as h,d as k}from"./chunk-33DWJV67.js";import{a as A}from"./chunk-6YGTRKDT.js";import{e as p}from"./chunk-UR6MHSHU.js";var e=p(A(),1);var a=p(R(),1),g=(0,e.createContext)(null),T=250;function C({children:d}){let[s,x]=(0,e.useState)([]),m=(0,e.useRef)(0),f=(0,e.useRef)([]),c=(0,e.useRef)(null),u=(0,e.useRef)(new Map),b=(0,e.useRef)(0),S=(0,e.useRef)(0);(0,e.useEffect)(()=>{for(let r=S.current;r<s.length;r++){let i=s[r];b.current=i.seq;let t=u.current.get(i.seq);if(t){u.current.delete(i.seq);for(let n of t)n()}}S.current=s.length},[s]),(0,e.useEffect)(()=>()=>{c.current&&clearTimeout(c.current)},[]);let P=(0,e.useMemo)(()=>{let r=()=>{c.current&&(clearTimeout(c.current),c.current=null);let t=f.current;t.length!==0&&(f.current=[],x(n=>[...n,...t]))},i=()=>{c.current||(c.current=setTimeout(()=>{c.current=null,r()},0))};return{append:(t,n)=>{let o=++m.current;if(n){let l=u.current.get(o)??[];l.push(n),u.current.set(o,l)}f.current.push({id:`sb-${o}`,seq:o,content:t}),i()},flush:()=>{r();let t=m.current;return t===0||b.current>=t?Promise.resolve():new Promise(n=>{let o=!1,l=()=>{o||(o=!0,clearTimeout(q),n())},q=setTimeout(l,T),v=u.current.get(t)??[];v.push(l),u.current.set(t,v)})}}},[]);return(0,a.jsxs)(g.Provider,{value:P,children:[s.length>0&&(0,a.jsx)(k,{items:s,children:r=>(0,a.jsx)(h,{children:r.content},r.id)}),d]})}function I(){let d=(0,e.useContext)(g);if(!d)throw new Error("useScrollback must be used within a ScrollbackProvider. Wrap this Ink render() root in <ScrollbackProvider>. Never render <Static> directly \u2014 push via append().");return d}export{C as a,I as b};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{j as f,xa as a}from"./chunk-UEE3RZN4.js";import{join as m}from"path";function Q(n,o){if(!f(o))throw new Error(`proposal id ${JSON.stringify(o)} is not a plain name (letters, digits, . _ - after a letter or digit)`);return m(n,"proposals",o,"proposal.json")}import{appendFileSync as g,readdirSync as l,readFileSync as u,rmSync as S,statSync as y}from"fs";import{join as t}from"path";import{randomBytes as E}from"crypto";var j="pending-facts.ndjson",h=/^pending-facts\.(\d+)-[0-9a-f]+\.ndjson$/,N=()=>`pending-facts.${process.pid}-${E(4).toString("hex")}.ndjson`;function v(n,o=1/0){let r=[];for(let i of l(n)){let s=h.exec(i);if(!s)continue;let e=Number(s[1]),c=Date.now()-y(t(n,i)).mtimeMs;if(e!==process.pid&&a(e)&&c<o){r.push(i);continue}let p=u(t(n,i),"utf8").split(`
|
|
3
|
+
`).filter(d=>d!=="");p.length>0&&g(t(n,j),p.join(`
|
|
4
|
+
`)+`
|
|
5
|
+
`),S(t(n,i))}return r}export{Q as a,j as b,h as c,N as d,v as e};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as x}from"./chunk-TDPWFYTJ.js";import{
|
|
2
|
+
import{a as x}from"./chunk-TDPWFYTJ.js";import{b as A}from"./chunk-CGITGJ3I.js";import{d as S}from"./chunk-CUXY6KQ2.js";import{a as R}from"./chunk-MMBBQ4OZ.js";import{a as m}from"./chunk-C2RUDJ46.js";import{f as y}from"./chunk-A7RJQJNT.js";import{d as g,i as E}from"./chunk-D36V5OX6.js";import{spawn as h,execSync as U}from"child_process";import{appendFileSync as M,existsSync as f,mkdirSync as P}from"fs";import{homedir as L}from"os";import{join as V,resolve as s,dirname as v,delimiter as b}from"path";import{fileURLToPath as D}from"url";import{createInterface as I}from"readline";async function*T(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 N(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 O(e){return e?{set:{},unset:["V16_AGENT_SKIP_CP_FINAL"]}:{set:{V16_AGENT_SKIP_CP_FINAL:"true"},unset:[]}}function w(e){return e==="dom"?{set:{V16_AGENT_ENABLE_TEXTUAL_VISUAL:"true"},unset:[]}:{set:{},unset:["V16_AGENT_ENABLE_TEXTUAL_VISUAL"]}}var c=v(D(import.meta.url));function k(){for(let e of["python3","python"])try{return U(`${e} --version`,{stdio:"ignore"}),e}catch{}return null}function B(){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=k();if(a)return{cmd:a,args:["main.py"],cwd:t}}return null}function C(e){return e?V(L(),".testmuai","kaneai","sessions",e,"runner-stderr.log"):null}function H(e){let n=h(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{P(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{M(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=T(n.stdout);return{child:n,events:a,getStderr:()=>i,getExitCode:()=>d,getExitSignal:()=>l,exited:t}}async function K(e,n){if(!n?.platform||!n.target)return;if(y(n.target)){e.TESTMU_RUN_TARGET??="cloud",e.LT_HUB_URL??=m(e.TESTMUAI_ENV==="stage"?"stage":"prod").mobileHubUrl;return}let r=await S(n.platform)?.toolEnv(n.target)??{dirs:[]};if(r.dirs.length>0&&(e.PATH=[...r.dirs,e.PATH??""].filter(Boolean).join(b)),r.appiumHome&&(e.APPIUM_HOME=r.appiumHome),r.wdaRoot&&(e.TESTMU_IOS_WDA_DERIVED_DATA=r.wdaRoot),n.platform==="android"){let o=R();o&&(e.PATH=[o.platformToolsDir,e.PATH??""].filter(Boolean).join(b),e.ANDROID_HOME=o.root,e.ANDROID_SDK_ROOT=o.root)}}function G(e){let n={...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=N(e.mode??"testing");Object.assign(n,o.set);for(let a of o.unset)delete n[a];let i=new A().load(),d=w(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=O(l);Object.assign(n,t.set);for(let a of t.unset)delete n[a];return n}function j(e,n){let r=m(n?.environment),o=x();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=W(r,e.org_id))}function W(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 de(e,n){let r=B();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
3
|
`);let o=G({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 K(o,e.device),j(e,{environment:n?.environment});let i=H({env:o,runner:r,log:n?.log,sessionId:e.session_id}),d=i.child;d.stdin.write(JSON.stringify(e)+`
|
|
4
4
|
`);let l=C(e.session_id);if(l)try{P(v(l),{recursive:!0}),M(l,`--- runner spawn ${new Date().toISOString()} run_index=${e.run_index} ---
|
|
5
5
|
`)}catch{}return{child:d,events:i.events,sendUserResponse(t){let a=JSON.stringify({type:"user_response",answer:t});try{d.stdin.write(a+`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as Q,c as Z,d as ee,e as fe,f as de}from"./chunk-KODJVOCN.js";import{a as ge}from"./chunk-ZTRRFG52.js";import{d as le}from"./chunk-AEWNWAXW.js";import{a as ue}from"./chunk-V7USCQWO.js";import{b as ae}from"./chunk-CGITGJ3I.js";import{a as R,b as E,d as ce}from"./chunk-VE3SUJMA.js";import{c as N}from"./chunk-EBPRPNSA.js";import{d as ne}from"./chunk-Y6Y6RAY4.js";import{b as re,c as ie}from"./chunk-YGRULEZY.js";import{b as se}from"./chunk-JZP3Y4ZM.js";import{d as M}from"./chunk-C6HI6Y3S.js";import{b as oe}from"./chunk-TZXXJWHA.js";import{i as te}from"./chunk-Z7S3IWUX.js";import{r as w}from"./chunk-NC7D7GOM.js";import{a as B}from"./chunk-C2RUDJ46.js";import{a as T,c as W,e as I}from"./chunk-2XW33VOK.js";import{f as z,g as H}from"./chunk-A7RJQJNT.js";import{a as Y}from"./chunk-HJMCXSUJ.js";import{a as J}from"./chunk-HCBYKLMW.js";import{a as c,b as u,i as O,j as q}from"./chunk-33DWJV67.js";import{a as ye}from"./chunk-6YGTRKDT.js";import{e as F}from"./chunk-UR6MHSHU.js";var s=F(ye(),1);var r=F(J(),1);function Ae(f){return f.mode==="login"?f.authOnly?"done":"ensure-project":f.complete?"done":f.hasProject?"ensure-folder":"ensure-project"}function Je({resultRef:f,mode:p="singleshot",loginCompleteRef:d,authOnly:A=!1}){let{exit:h}=q(),k=(0,s.useRef)(new Y),P=(0,s.useRef)(new ae),g=(0,s.useRef)(new le),o=k.current,a=P.current,U=g.current,pe=Q(),[x,m]=(0,s.useState)(p==="login"?"login":"gate"),[X,me]=(0,s.useState)(null),[we,$]=(0,s.useState)(null),[Ee,L]=(0,s.useState)(null),[G,ve]=(0,s.useState)(null),[K,S]=(0,s.useState)([]),b=(0,s.useCallback)((e,t,i,n)=>U.log(e,t,i,n),[U]),ke=(0,s.useCallback)((e,t)=>{e?R(o,a,e,t):a.save({project_id:null,project_name:null,folder_id:null,folder_name:null})},[o,a]),C=(0,s.useCallback)(()=>{if(p==="login")d&&(d.current=!0),h();else{let e=a.load().mobile,t=T(e?.tui_target,e?.default_target?.kind),i=t.kind==="unset"||t.kind==="choose-mobile"&&oe();m(i?"target":"input")}},[p,h,d,a]),_=(0,s.useCallback)((e,t)=>{let i=R(o,a,e,t),n=Ae({mode:p,authOnly:A,hasProject:!!i.projectId,complete:ce(i)});n==="done"?C():m(n)},[o,a,C,p,A]);O((e,t)=>{t.ctrl&&e==="c"&&w(0,"Ctrl+C exit")});let V=(0,s.useRef)(!1);s.default.useEffect(()=>{V.current||(V.current=!0,p!=="login"&&de(o,b).then(e=>{me(e),e.status==="authenticated"?_(e.result.profile,e.result.env):e.status==="needs_pick"?m("pick"):($(e.profile??null),L(e.env??null),m("login"))}).catch(e=>{ve(`Auth check failed: ${e instanceof Error?e.message:String(e)}`)}))},[o,b]);let he=(0,s.useCallback)(e=>{f.current={objective:e},h()},[f,h]),Pe=(0,s.useCallback)(async(e,t)=>{o.setActiveProfile(e),o.setDefaultEnv(t),(await fe(o,e,t,b)).status==="authenticated"?_(e,t):($(e),L(t),m("login"))},[o,b,_]),j=(0,s.useCallback)(()=>{let e=o.getActiveProfile(),t=o.getDefaultEnv();if(!e)return null;let i=B(t),n=o.loadBasicAuth(e,t);return new ue(i.controllerBaseUrl,async()=>o.loadCredentials(e,t)?.access_token??null,n,b)},[o,b]),xe=(0,s.useCallback)(async()=>{let e=j();if(!e)return null;let t=e.cached??await e.resolve();if(!t)return null;let i=B(o.getDefaultEnv()),n=new M(i.tmsBaseUrl,t.username,t.access_key);try{let v=(await n.listProjects()).find(D=>D.name==="KaneAI Generated");if(v)return{id:v.project_id,name:v.name};let y=await n.createProject("KaneAI Generated");return{id:y.id,name:y.name}}catch{return null}},[j,o]),be=(0,s.useCallback)(async e=>{let t=j();if(!t)return null;let i=t.cached??await t.resolve();if(!i)return null;let n=B(o.getDefaultEnv()),l=new M(n.tmsBaseUrl,i.username,i.access_key);try{let y=(await l.listFolders(e)).find(je=>je.name==="Untitled");if(y)return{id:y.id,name:y.name};let D=await l.createFolder(e,"Untitled");return{id:D.id,name:D.name}}catch{return null}},[j,o]);if(x==="gate")return(0,r.jsx)(c,{paddingX:1,children:(0,r.jsx)(u,{color:"yellow",children:"Checking authentication..."})});if(G)return(0,r.jsxs)(c,{flexDirection:"column",paddingX:1,children:[(0,r.jsx)(u,{color:"red",children:G}),(0,r.jsx)(u,{color:"gray",children:"Press Ctrl+C to exit."})]});if(x==="pick"&&X?.status==="needs_pick")return(0,r.jsx)(Ce,{profiles:X.profiles,onSelect:Pe});if(x==="login")return(0,r.jsx)(ee,{devMode:process.env.KANE_DEV_MODE==="1",profiles:o.listProfiles(),onBasicLogin:async(e,t,i,n)=>{let{validateBasicAuth:l}=await import("./validate-basic-M5JHHNZA.js");await l(t,i,n),o.saveBasicAuth(e,t,{username:i,access_key:n}),o.setActiveProfile(e),o.setDefaultEnv(t)},onOAuthLogin:async(e,t)=>{let{LoginFlow:i}=await import("./login-flow-WEK3E476.js");o.setDefaultEnv(t),o.setActiveProfile(e),await new i(e,t,o).login()},onComplete:(e,t)=>{$(e),L(t),o.setActiveProfile(e),o.setDefaultEnv(t),_(e,t)},onCancel:()=>{w(0,"Login cancelled")}});if(x==="ensure-project"){let e=o.getActiveProfile()??"default",t=o.getDefaultEnv(),i=()=>{if(p==="login"){m("ensure-folder");return}R(o,a,e,t).folderId?C():m("ensure-folder")};return(0,r.jsxs)(c,{flexDirection:"column",children:[(0,r.jsx)(c,{paddingX:1,marginBottom:1,children:(0,r.jsx)(u,{color:"yellow",children:"Project & folder are required to save tests \xB7 Esc to use defaults \xB7 Ctrl+C to exit"})}),(0,r.jsx)(ie,{resolver:j(),currentProjectId:a.load().project_id,env:t,...re,onSelect:(n,l)=>{E(o,a,e,t,{projectId:n,projectName:l}),S(v=>[...v,`\u2713 Project: ${l} (${n})`]),i()},onCancel:async()=>{let n=await xe();n&&(E(o,a,e,t,{projectId:n.id,projectName:n.name}),S(l=>[...l,`\u2713 Default project: ${n.name} (${n.id})`]),i())}})]})}if(x==="ensure-folder"){let e=o.getActiveProfile()??"default",t=o.getDefaultEnv(),i=o.loadProfileConfig(e,t);return(0,r.jsxs)(c,{flexDirection:"column",children:[(0,r.jsx)(c,{paddingX:1,marginBottom:1,children:(0,r.jsx)(u,{color:"yellow",children:"Project & folder are required to save tests \xB7 Esc to use defaults \xB7 Ctrl+C to exit"})}),(0,r.jsx)(se,{resolver:j(),projectId:i?.project_id??"",currentFolderId:a.load().folder_id,env:t,onSelect:(n,l)=>{E(o,a,e,t,{folderId:n,folderName:l}),S(v=>[...v,`\u2713 Folder: ${l} (${n})`]),C()},onCancel:async()=>{if(!i?.project_id)return;let n=await be(i.project_id);n&&(E(o,a,e,t,{folderId:n.id,folderName:n.name}),S(l=>[...l,`\u2713 Default folder: ${n.name} (${n.id})`]),C())}})]})}if(x==="target"){let e=T(a.load().mobile?.tui_target,a.load().mobile?.default_target?.kind).kind==="choose-mobile";return(0,r.jsx)(c,{paddingX:1,children:(0,r.jsx)(ge,{mode:e?"legacy-mobile":"all",onSelect:t=>{a.setMobile({tui_target:t}),m("input")},onCancel:()=>m("input")})})}if(x==="input"){let e=a.load().mobile,t=T(e?.tui_target,e?.default_target?.kind),i=(()=>{if(H(t.kind)){let n=te(e?.default_target)??"(no device)",l=N(e?.default_app)??"(no app)";return`Config: ${I(t.kind)} \xB7 ${n} \xB7 ${l}`}if(z(t.kind)){let n=W(e,t.kind),l=N(n.app)??"(no app)";return`Config: ${I(t.kind)} \xB7 ${ne(n)} \xB7 ${l}`}return"Config: Desktop \xB7 Chrome"})();return(0,r.jsxs)(c,{flexDirection:"column",children:[K.length>0&&(0,r.jsx)(c,{flexDirection:"column",paddingX:1,marginBottom:1,children:K.map((n,l)=>(0,r.jsx)(u,{color:"green",children:n},l))}),(0,r.jsx)(c,{paddingX:1,children:(0,r.jsx)(u,{color:"gray",children:i})}),(0,r.jsx)(Z,{onSubmit:he,onEscape:()=>w(0,"User pressed Escape"),history:pe,placeholder:"Type an objective..."})]})}return(0,r.jsx)(r.Fragment,{})}function Ce({profiles:f,onSelect:p}){let[d,A]=(0,s.useState)(0),[h,k]=(0,s.useState)(!1);return O((P,g)=>{if(!h){if(g.escape){w(0,"Profile picker cancelled");return}if(g.upArrow&&d>0&&A(o=>o-1),g.downArrow&&d<f.length-1&&A(o=>o+1),g.return){k(!0);let o=f[d];p(o.profile,o.env).catch(()=>k(!1))}}}),(0,r.jsxs)(c,{flexDirection:"column",paddingX:1,children:[(0,r.jsx)(u,{color:"#ff9500",bold:!0,children:"Select a profile:"}),(0,r.jsx)(c,{marginTop:1,flexDirection:"column",children:f.map((P,g)=>(0,r.jsxs)(u,{children:[g===d?"\u276F ":" ",(0,r.jsx)(u,{color:g===d?"#ff9500":"white",bold:g===d,children:P.profile}),(0,r.jsxs)(u,{color:"gray",children:[" [",P.env,"]"]})]},`${P.profile}-${P.env}`))}),h&&(0,r.jsx)(c,{marginTop:1,children:(0,r.jsx)(u,{color:"yellow",children:"Validating credentials..."})})]})}export{Ae as a,Je as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{f as r}from"./chunk-KU3YHPWZ.js";var f=[r.SCENARIO,r.AC,r.TEST];function s(o){let t=o.byLabel(r.USECASE).map(e=>e.cid).filter(e=>!o.superseded.has(e)).sort();return{usecases:t,nodes:new Set(t),footprint:{edges:[],usecases:t,sources:[...o.heads.keys()].sort(),names:[...o.names.keys()].sort(),generation:null}}}function c(o,t,e){let n=o.resolve(e)?.tip;if(n!==void 0){t.add(n);for(let d of o.edgesFrom(n))t.add(d.dst);for(let d of o.edgesInto(n))t.add(d.src)}}var i=o=>({...o.footprint,nodes:[...o.nodes].sort()});function u(o){return i(s(o))}function a(o,t){let e=s(o);return c(o,e.nodes,t),i(e)}function F(o){let t=s(o);for(let[e,n]of o.trust)n==="derived"&&!o.superseded.has(e)&&t.nodes.add(e);return i(t)}function m(o){let t=s(o);for(let e of f)for(let n of o.byLabel(e))o.superseded.has(n.cid)||t.nodes.add(n.cid);return i(t)}function l(o,t){let e=s(o),n=o.heads.get(t);return n&&c(o,e.nodes,n),i(e)}export{u as a,a as b,F as c,m as d,l as e};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c as k}from"./chunk-RFHMDQXZ.js";import{a as b}from"./chunk-
|
|
2
|
+
import{c as k}from"./chunk-RFHMDQXZ.js";import{a as b}from"./chunk-LUR7JFPP.js";import{a as C}from"./chunk-HJMCXSUJ.js";import{q as m,r as u,s as f,t as x,u as y}from"./chunk-D36V5OX6.js";import{createServer as S}from"http";import{randomBytes as A}from"crypto";import{URL as L}from"url";var P=class{profile;environment;creds;oauth;constructor(r="default",o="prod",e){this.profile=r,this.environment=o,this.creds=e??new C,this.oauth=new b(o)}async login(){let{server:r,port:o}=await this.startCallbackServer(),e=y(o);try{let t=this.creds.loadClient(this.profile,this.environment),i=t?.redirect_uris;(!t||!i?.includes(e))&&(t=await this.oauth.registerClient(e),this.creds.saveClient(this.profile,this.environment,t));let c=t.client_id,[h,d]=b.generatePkce(),a=A(32).toString("hex"),n=this.oauth.buildAuthorizationUrl(c,d,a,e),l=await this.waitForCallback(r,o,n,a);if(!l)throw new Error("Login cancelled or timed out");let p=await this.oauth.exchangeCode(l,c,h,e),g={access_token:p.access_token,refresh_token:p.refresh_token,expires_at:Math.floor(Date.now()/1e3)+p.expires_in,scope:p.scope??"*"};return this.creds.saveCredentials(this.profile,this.environment,g),this.creds.setActiveProfile(this.profile),g}catch(t){throw r.close(),t}}startCallbackServer(){return new Promise((r,o)=>{let e=u,t=()=>{let i=S();i.on("error",c=>{c.code==="EADDRINUSE"&&e<f?(e++,t()):o(new Error(`Failed to start callback server: ${c.message}. Ports ${u}-${f} are all in use.`))}),i.listen(e,m,()=>{r({server:i,port:e})})};t()})}waitForCallback(r,o,e,t){return new Promise(i=>{let c=!1,h=setTimeout(()=>d(null),12e4),d=a=>{c||(c=!0,clearTimeout(h),r.close(),i(a))};r.on("request",(a,n)=>{let l=new L(a.url??"/",`http://${m}:${o}`);if(l.pathname!==x){n.writeHead(404),n.end();return}let p=l.searchParams.get("state"),g=l.searchParams.get("code");if(l.searchParams.get("error")){n.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),n.end(v({state:"error",title:"Login failed",message:"We couldn't complete the sign-in. You can close this tab and try again from your terminal."})),d(null);return}if(p!==t){n.writeHead(400,{"Content-Type":"text/html; charset=utf-8"}),n.end(v({state:"error",title:"Invalid state",message:"The sign-in response didn't match this session. Please return to your terminal and try again."})),d(null);return}n.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),n.end(v({state:"success",title:"You're signed in",message:"Head back to your terminal \u2014 KaneAI is ready when you are.",autoClose:!0})),d(g)}),k(e).catch(a=>{let n=a instanceof Error?a.message:String(a);process.stderr.write(`[auth] Could not open browser: ${n}
|
|
3
3
|
Please open this URL manually: ${e}
|
|
4
4
|
`)})})}};function v(s){let r=s.state==="success",o=r?"#22c55e":"#ef4444",e=r?"rgba(34, 197, 94, 0.12)":"rgba(239, 68, 68, 0.12)",t=r?'<svg viewBox="0 0 24 24" width="36" height="36" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7"/></svg>':'<svg viewBox="0 0 24 24" width="36" height="36" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 6l12 12M18 6L6 18"/></svg>',i=s.autoClose?"<script>setTimeout(function(){try{window.close();}catch(e){}}, 1500);</script>":"";return`<!doctype html>
|
|
5
5
|
<html lang="en">
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
var p=1;function f(e,t=!1){return e==="agent"||t&&(e==="override"||e==="ci")?"ndjson":"human"}function m(e,t,n){return!n||t==="override"||t==="ci"?null:`${e}: --json ${t==="agent"?"--mode agent writes NDJSON already":"it needs --mode override or --mode ci"}`}function v(){return!!(process.stdin.isTTY&&process.stdout.isTTY)}var g=/^(∷ |· |→ |✓ |✗ |… )/;function c(e){return e===0?"complete":e===2?"refused":e===3?"paused":e===130?"interrupted":"error"}function x(e,t,n={stdout:r=>process.stdout.write(r),stderr:r=>process.stderr.write(r)}){let r=!1,i=s=>{if(e!=="ndjson"||r)return;s.type==="done"&&(r=!0);let{type:u,...o}=s;n.stdout(JSON.stringify({type:u,v:1,verb:t,...o})+`
|
|
3
|
+
`)};return{encoding:e,out:e==="ndjson"?()=>{}:s=>n.stdout(s+`
|
|
4
|
+
`),progress:e==="ndjson"?()=>{}:s=>n.stderr(s.replace(g,"").replace(/…$/,"")+`
|
|
5
|
+
`),event:i,done:(s,u,o,d)=>(i({type:"done",status:u??c(s),exit_code:s,...d,...o!==void 0&&o.length>0?{next:o}:{}}),s),retag:s=>{t=s}}}var l=8*1024;function E(e,t){return e.message==null?null:e.message.trim()?e.resume?Buffer.byteLength(e.message,"utf8")>l?`${t==="extract"?"extract":"design"}: --message is over 8KB \u2014 the agent would silently drop it; shorten the statement`:null:`${t==="extract"?"extract":"design"}: --message only rides a resume \u2014 pair it with --resume <sid> (a fresh run takes its direction from the sources)`:`${t==="extract"?"extract":"design"}: --message is empty \u2014 say what you want the agent to know`}function y(e,t,n,r){return e.event({type:"error",message:t,...n?{code:n}:{},...r?{remedy:r}:{}}),e.done(2,"refused")}var a=class extends Error{constructor(n,r,i){super(r);this.code=n;this.remedy=i}};function S(e,t,n){return{out:r=>{t()&&n.test(r)||e.out(r)},emit:r=>{t()&&r.type==="error"&&n.test(String(r.message??""))||e.event(r)}}}export{p as a,f as b,m as c,v as d,x as e,l as f,E as g,y as h,a as i,S as j};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as v,b as P}from"./chunk-NLZZLANH.js";import{a as x,c as $,d as B,e as k}from"./chunk-P2ZQDQDB.js";import{b as F,d as I}from"./chunk-MNBGG4H3.js";import{c as M,d as _,e as R}from"./chunk-7HMSMAUG.js";import{a as S}from"./chunk-I2MC6VVX.js";import{o as j}from"./chunk-PUVMC4PX.js";import{existsSync as A,readdirSync as U,readFileSync as D}from"fs";import{join as L}from"path";var H=new Set(["unwritable","unreadable","unresolved"]),K=/^@import\s+(\S+)\s*$/,N=1e3;async function V(e){let i=[];for(let t=e.basePosition+1;t<=e.position;t++)i.push(await e.person.mainRecord(e.projectId,t));return i}async function re(e){try{let i=Array.from({length:Math.max(0,e.landing.position-e.landing.basePosition)},(f,p)=>e.landing.basePosition+1+p),[t,d]=await Promise.all([Promise.all(i.map(f=>e.person.mainRecord(e.projectId,f))),e.person.nodes(e.projectId,"usecase")]),c=new Map(d.flatMap(f=>f.name?[[f.cid,f.name]]:[])),g=new Set;for(let{record:f}of t){for(let l of M(f))l.label==="usecase"&&g.add(l.cid);let p=f.design_of?.uc_cid;typeof p=="string"&&g.add(p);for(let l of f.edges??[])(l.type==="belongs_to"||l.type==="scoped_to")&&typeof l.dst=="string"&&g.add(l.dst)}let w=f=>e.person.mainNode(e.projectId,f).catch(p=>p instanceof S&&p.code==="NOT_FOUND"?null:Promise.reject(p)),h=new Set;for(let f of g){let p=c.get(f);if(p){h.add(p.toLowerCase());continue}let l=await w(f);for(let u=0;l!==null&&l.name===null&&l.supersededBy&&u<N;u++)l=await w(l.supersededBy);l?.label==="usecase"&&l.name&&h.add(l.name.toLowerCase())}return h}catch(i){(e.trace??v("test-manager"))(`the session's use cases couldn't be read after the save: ${P(i)}`);return}}function C(e){let i=e.content.test_md_blob;return typeof i!="string"?[]:i.split(`
|
|
3
|
+
`).flatMap(t=>{let d=K.exec(t.trim());return d?[d[1]]:[]})}async function W(e){let i=new Map,t=new Map,d=new Map,c=new Map;for(let{record:n}of e.records){for(let o of M(n))i.set(o.cid,{label:o.label,content:o.content});for(let{cid:o,slug:r}of _(n))t.set(o,r),d.set(r,o);for(let o of R(n))c.set(o.old,o.new)}let{chainOf:g,tipOf:w}=T(c),h=n=>e.person.mainNode(e.projectId,n).catch(o=>o instanceof S&&o.code==="NOT_FOUND"?null:Promise.reject(o)),f=new Map([...c].flatMap(([n,o])=>o===null?[]:[[o,n]]));for(let[n,o]of[...i]){if(o.label!=="test"||c.has(n))continue;let r=n;for(let y=0;f.has(r)&&!t.has(r)&&y<N;y++)r=f.get(r);if(t.has(r)||i.has(r))continue;let m=await h(r);m===null||m.label!=="test"||!m.name||d.has(m.name)||(i.set(r,{label:m.label,content:m.content}),t.set(r,m.name),d.set(m.name,r))}let p=[...t.keys()].filter(n=>{if(i.get(n)?.label!=="test")return!1;let{later:o,retired:r}=g(n);return!r&&!o.some(m=>t.has(m))}),l=await X({read:h,nodes:i,nameOf:t,byName:d,next:c,tests:p,cwd:e.cwd}),u=e.trace??v("test-files"),s=await z({records:e.records,read:h,nameOf:t,here:[...l.wrote,...l.unchanged??[]],cwd:e.cwd,trace:u}).catch(n=>(u(`the replaced tests' files couldn't be looked for: ${P(n)}`),[])),a=q({tests:p,nodes:i,nameOf:t,tipOf:w,minted:l,cwd:e.cwd,trace:e.trace??v("test-files")});return{...l,saved:p.map(n=>t.get(n)),...s.length>0?{replaced:s}:{},...a?{needed:a}:{}}}function T(e){let i=t=>{let d=[],c=t;for(let g=0;e.has(c)&&g<N;g++){let w=e.get(c);if(w===null)return{later:d,retired:!0};d.push(w),c=w}return{later:d,retired:!1}};return{chainOf:i,tipOf:t=>i(t).later.at(-1)??t}}async function X(e){let{read:i,nodes:t,nameOf:d,byName:c,next:g,tests:w}=e,{chainOf:h,tipOf:f}=T(g),p=w.flatMap(u=>C(t.get(f(u))));for(;p.length>0;){let u=p.pop();if(c.has(u))continue;let s=await i(u);if(s===null||s.label!=="test")continue;let a=s;for(let n=0;a.supersededBy&&n<N;n++){let o=await i(a.supersededBy);if(o===null)throw new Error(`main names ${a.supersededBy} as what replaced ${a.cid}, but doesn't hold it`);a=o}t.set(s.cid,{label:s.label,content:s.content}),t.set(a.cid,{label:a.label,content:a.content}),d.set(s.cid,u),c.set(u,s.cid),a.cid!==s.cid&&g.set(s.cid,a.cid),p.push(...C(t.get(a.cid)))}return I({graph:{nameOf:d,getNode:u=>t.get(u)??null,resolve:u=>{let s=c.get(u)??(t.has(u)?u:void 0);if(s===void 0)return null;let{later:a,retired:n}=h(s),o=a.at(-1)??s;return{cid:s,tip:o,superseded:n||o!==s}}},cids:w,cwd:e.cwd,skipSame:!0,refuseUnwritable:!0,...e.overwriteEdited?{overwriteEdited:!0}:{}})}function q(e){try{let i=new Map([...e.minted.wrote,...e.minted.unchanged??[]].map(d=>[d.id,d.path])),t=x({cwd:e.cwd,tests:e.tests.map(d=>{let c=e.nameOf.get(d);return $(c,e.nodes.get(e.tipOf(d))?.content??{},i.get(c))})});if(t.variables.length===0&&t.noStartPage.length===0)return;try{B(t,e.cwd)}catch(d){e.trace(`the variables the saved tests need couldn't be written to ${t.file}: ${k(d)}`)}return t}catch(i){e.trace(`what the saved tests need couldn't be read: ${k(i)}`);return}}async function z(e){let i=new Map,t=new Map,d=new Set,c=new Map;for(let{record:s}of e.records){for(let r of M(s))d.add(r.cid);for(let r of R(s))c.set(r.old,r.new);for(let r of s.edges??[])r.type!=="verifies"||typeof r.src!="string"||typeof r.dst!="string"||t.set(r.src,(t.get(r.src)??new Set).add(r.dst));let a=s.design_of?.uc_cid;if(typeof a!="string")continue;let n=i.get(a)??{retired:[],made:[]};i.set(a,n);let o=new Set(M(s).flatMap(r=>r.label==="test"?[r.cid]:[]));for(let r of R(s))(r.new===null||r.new!==r.old&&o.has(r.new))&&n.retired.push(r.old);n.made.push(...o)}let g=F(e.cwd);if(![...i.values()].some(s=>s.retired.length>0)||!A(g))return[];let w=new Map(e.here.map(s=>[s.id,s.path])),h=new Set(e.here.map(s=>s.path)),f=new Map;for(let s of U(g)){let a=L(g,s);if(!(!s.endsWith("_test.md")||h.has(a)))try{let n=j(D(a,"utf8"));n?.base&&n.id&&f.set(n.base,{id:n.id,file:a})}catch{}}let p=new Set([...i.values()].flatMap(s=>s.made.flatMap(a=>[...t.get(a)??[]]))),l=async s=>{let a=new Set;for(let n=s,o=0;n&&!a.has(n)&&o<N;o++){if(a.add(n),!c.has(n)&&!p.has(n)&&!d.has(n)){let r=await e.read(n).catch(m=>e.trace(`a criterion's later versions couldn't be read: ${P(m)}`));c.set(n,r?.supersededBy??null)}n=c.get(n)}return a},u=[];for(let{retired:s,made:a}of i.values())for(let n of s){let o=await e.read(n),r=o?.label==="test"?o.content.definitionId:void 0,m=typeof r=="string"?f.get(r):void 0;if(!m||!o)continue;let y=new Set;for(let b of o.edgesOut)if(b.type==="verifies"){b.other&&c.set(b.dst,b.other.supersededBy);for(let O of await l(b.dst))y.add(O)}let E=a.flatMap(b=>{let O=w.get(e.nameOf.get(b)??"");return O&&[...t.get(b)??[]].some(G=>y.has(G))?[O]:[]});u.push({test:m.id,file:m.file,replacedBy:E})}return u}async function ie(e){let i=e.trace??v("test-files");try{let t=await V({person:e.person,projectId:e.projectId,basePosition:e.landing.basePosition,position:e.landing.position}),d=await W({person:e.person,projectId:e.projectId,records:t,cwd:e.cwd,trace:i});for(let c of d.refused)H.has(c.kind)&&i(`test file for ${c.id} not written: ${c.reason}`);return d}catch(t){return i(`main couldn't be read after the save: ${P(t)}`),"unread"}}export{re as a,X as b,ie as c};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as
|
|
3
|
-
`));this.deviceClass=s;this.name="DepsInstallRequiredError"}};function _(i){return i>=1024*1024?`${Math.ceil(i/(1024*1024))} MB`:`${i} bytes`}function at(i){let t=i/1048576;return t>=10?`${Math.round(t)} MB/s`:t>=1?`${t.toFixed(1)} MB/s`:`${Math.max(1,Math.round(i/1024))} KB/s`}function lt(i){let t=Math.max(1,Math.round(i));return t<60?`~${t}s left`:`~${Math.floor(t/60)}m ${t%60}s left`}var K=8*1024*1024,ct=8;function ut(i){if(!Number.isFinite(i)||i<2*K)return null;let t=Math.min(ct,Math.floor(i/K)),s=Math.ceil(i/t),e=[];for(let n=0;n<i;n+=s)e.push({start:n,end:Math.min(n+s,i)-1});return e}async function L(i,t){let s=i.body;if(!s||typeof s.getReader!="function"){let c=new Uint8Array(await i.arrayBuffer());return t?.(c.length),c}let e=s.getReader(),n=[],r=0;for(;;){let{done:c,value:h}=await e.read();if(c)break;h&&(n.push(h),r+=h.length,t?.(h.length))}let o=new Uint8Array(r),a=0;for(let c of n)o.set(c,a),a+=c.length;return o}var z=3,dt=3e4,k=class extends Error{};async function pt(i,t,s,e,n,r=dt){let o=new Uint8Array(s),a=0,c=new AbortController,h=null,b=!1;try{await Promise.all(e.map(async(f,M)=>{let P=0,V=d=>{P+=d,a+=d,n?.(a)},T=()=>{a=Math.max(0,a-P),P=0},R=null;for(let d=0;d<z;d+=1){if(c.signal.aborted)return;let u=new AbortController,m=()=>u.abort();c.signal.addEventListener("abort",m,{once:!0});let w=!1,g=null,$=()=>{g&&clearTimeout(g),g=setTimeout(()=>{w=!0,u.abort()},r)};try{$();let p=await i(t,{headers:{Range:`bytes=${f.start}-${f.end}`},signal:u.signal});if(typeof p.body?.getReader!="function"&&g&&(clearTimeout(g),g=null),!p.ok)throw new k(`Could not download ${t}: HTTP ${p.status}`);if(p.status!==206){b=!0,M===0?h=await L(p,I=>{$(),V(I)}):await(p.body?.cancel().catch(()=>{})??Promise.resolve());return}let D=f.end-f.start+1,E=await L(p,I=>{$(),V(I)});if(E.length!==D)throw new Error(`range ${f.start}-${f.end} returned ${E.length} bytes (expected ${D})`);o.set(E,f.start);return}catch(p){if(p instanceof k)throw p;if(c.signal.aborted)return;T(),R=w?new Error(`no data for ${Math.round(r/1e3)}s`):p instanceof Error?p:new Error(String(p))}finally{g&&clearTimeout(g),c.signal.removeEventListener("abort",m)}}throw new Error(`Could not download ${t}: range ${f.start}-${f.end} failed after ${z} attempts (${R?.message??"unknown error"}) \u2014 check your network and rerun \`kane-cli doctor --target <emulator|simulator> --install\`.`)}))}catch(f){throw c.abort(),f}return h||(b?null:o)}async function ht(i,t,s,e,n){let r=ut(s);if(r){let c=await pt(i,t,s,r,e,n?.stallMs);if(c)return c}let o=await i(t);if(!o.ok)throw new Error(`Could not download ${t}: HTTP ${o.status}`);let a=0;return L(o,e&&(c=>{a+=c,e(a)}))}function ft(i){return Y("sha256").update(i).digest("hex")}function mt(i,t){let s=X(i,t);return s!==""&&!s.startsWith(`..${it}`)&&s!==".."&&!nt(s)}async function A(i){try{return await Q(i),!0}catch{return!1}}function wt(){return{home:tt(),os:st,arch:et,cliVersion:H,nodeModuleVersion:process.versions.modules,fetch,resolveBundle:async i=>(await import("./deps-resolve-
|
|
2
|
+
import{d as U,e as F}from"./chunk-4JOD47QI.js";import{d as W}from"./chunk-GMTHZUZ3.js";import{a as H}from"./chunk-D36V5OX6.js";import{createHash as Y}from"crypto";import{access as Q,mkdir as S,mkdtemp as Z,readdir as O,readFile as y,rename as N,rm as v,writeFile as x}from"fs/promises";import{homedir as tt}from"os";import{arch as et,platform as st}from"process";import{dirname as C,isAbsolute as nt,join as l,relative as X,resolve as rt,sep as it}from"path";var q=1,ot={emulator:"emulator",simulator:"simulator"};function Pt(i){return ot[i.kind]??null}var j=class extends Error{constructor(s,e,n){super([`Managed mobile dependencies for ${s} are not installed.`,`- kaneai-mobile-deps ${s} ${e.bundleVersion}: ${e.url} (${_(e.bytes)})`,`Destination: ${n}`,`Run \`kane-cli doctor --target ${s} --install\` to download it.`].join(`
|
|
3
|
+
`));this.deviceClass=s;this.name="DepsInstallRequiredError"}};function _(i){return i>=1024*1024?`${Math.ceil(i/(1024*1024))} MB`:`${i} bytes`}function at(i){let t=i/1048576;return t>=10?`${Math.round(t)} MB/s`:t>=1?`${t.toFixed(1)} MB/s`:`${Math.max(1,Math.round(i/1024))} KB/s`}function lt(i){let t=Math.max(1,Math.round(i));return t<60?`~${t}s left`:`~${Math.floor(t/60)}m ${t%60}s left`}var K=8*1024*1024,ct=8;function ut(i){if(!Number.isFinite(i)||i<2*K)return null;let t=Math.min(ct,Math.floor(i/K)),s=Math.ceil(i/t),e=[];for(let n=0;n<i;n+=s)e.push({start:n,end:Math.min(n+s,i)-1});return e}async function L(i,t){let s=i.body;if(!s||typeof s.getReader!="function"){let c=new Uint8Array(await i.arrayBuffer());return t?.(c.length),c}let e=s.getReader(),n=[],r=0;for(;;){let{done:c,value:h}=await e.read();if(c)break;h&&(n.push(h),r+=h.length,t?.(h.length))}let o=new Uint8Array(r),a=0;for(let c of n)o.set(c,a),a+=c.length;return o}var z=3,dt=3e4,k=class extends Error{};async function pt(i,t,s,e,n,r=dt){let o=new Uint8Array(s),a=0,c=new AbortController,h=null,b=!1;try{await Promise.all(e.map(async(f,M)=>{let P=0,V=d=>{P+=d,a+=d,n?.(a)},T=()=>{a=Math.max(0,a-P),P=0},R=null;for(let d=0;d<z;d+=1){if(c.signal.aborted)return;let u=new AbortController,m=()=>u.abort();c.signal.addEventListener("abort",m,{once:!0});let w=!1,g=null,$=()=>{g&&clearTimeout(g),g=setTimeout(()=>{w=!0,u.abort()},r)};try{$();let p=await i(t,{headers:{Range:`bytes=${f.start}-${f.end}`},signal:u.signal});if(typeof p.body?.getReader!="function"&&g&&(clearTimeout(g),g=null),!p.ok)throw new k(`Could not download ${t}: HTTP ${p.status}`);if(p.status!==206){b=!0,M===0?h=await L(p,I=>{$(),V(I)}):await(p.body?.cancel().catch(()=>{})??Promise.resolve());return}let D=f.end-f.start+1,E=await L(p,I=>{$(),V(I)});if(E.length!==D)throw new Error(`range ${f.start}-${f.end} returned ${E.length} bytes (expected ${D})`);o.set(E,f.start);return}catch(p){if(p instanceof k)throw p;if(c.signal.aborted)return;T(),R=w?new Error(`no data for ${Math.round(r/1e3)}s`):p instanceof Error?p:new Error(String(p))}finally{g&&clearTimeout(g),c.signal.removeEventListener("abort",m)}}throw new Error(`Could not download ${t}: range ${f.start}-${f.end} failed after ${z} attempts (${R?.message??"unknown error"}) \u2014 check your network and rerun \`kane-cli doctor --target <emulator|simulator> --install\`.`)}))}catch(f){throw c.abort(),f}return h||(b?null:o)}async function ht(i,t,s,e,n){let r=ut(s);if(r){let c=await pt(i,t,s,r,e,n?.stallMs);if(c)return c}let o=await i(t);if(!o.ok)throw new Error(`Could not download ${t}: HTTP ${o.status}`);let a=0;return L(o,e&&(c=>{a+=c,e(a)}))}function ft(i){return Y("sha256").update(i).digest("hex")}function mt(i,t){let s=X(i,t);return s!==""&&!s.startsWith(`..${it}`)&&s!==".."&&!nt(s)}async function A(i){try{return await Q(i),!0}catch{return!1}}function wt(){return{home:tt(),os:st,arch:et,cliVersion:H,nodeModuleVersion:process.versions.modules,fetch,resolveBundle:async i=>(await import("./deps-resolve-SQYVN76L.js")).controllerResolveBundle()(i),exec:U,now:()=>new Date,wait:F,processAlive:i=>{try{return process.kill(i,0),!0}catch{return!1}}}}var B=class extends Error{constructor(s,e,n){super(`No managed mobile dependencies are published for ${s} (kane-cli ${e}).
|
|
4
4
|
This is a packaging gap, not something to install locally \u2014 report it, or pass --appium-url to use an Appium server you manage yourself.`);this.coordinate=s;this.cause=n;this.name="NoPublishedBundleError"}},J=class i{deps;constructor(t={}){this.deps={...wt(),...t}}mobileRoot(){return l(this.deps.home,".testmuai","kaneai","mobile")}depsRoot(){return l(this.mobileRoot(),"deps")}classRoot(t,s){return l(this.depsRoot(),s,t)}resolveCacheFile(){return l(this.depsRoot(),"resolve-cache.json")}resolveCacheKey(t){return`${this.deps.cliVersion}|${this.deps.os}-${this.deps.arch}-${t}`}static RESOLVE_CACHE_TTL_MS=1440*60*1e3;async readCachedWantedVersion(t){try{let e=JSON.parse(await y(this.resolveCacheFile(),"utf8"))[this.resolveCacheKey(t)];if(!e?.bundleVersion||!e.fetchedAt)return null;let n=this.deps.now().getTime()-new Date(e.fetchedAt).getTime();return n>=0&&n<i.RESOLVE_CACHE_TTL_MS?e.bundleVersion:null}catch{return null}}async writeResolveCache(t,s){try{let e={};try{e=JSON.parse(await y(this.resolveCacheFile(),"utf8"))}catch{}e[this.resolveCacheKey(t)]={bundleVersion:s,fetchedAt:this.deps.now().toISOString()},await S(this.depsRoot(),{recursive:!0}),await x(this.resolveCacheFile(),`${JSON.stringify(e,null,2)}
|
|
5
5
|
`)}catch{}}async warmResolveCache(t){if(await this.readCachedWantedVersion(t)===null)try{await this.resolveOrExplain(t)}catch{}}paths(t,s){let e=this.classRoot(t,s);return{root:e,appium:l(e,"appium"),appiumHome:l(e,"appium-home"),platformTools:l(e,"platform-tools"),wdaDir:l(e,"wda","Build","Products","Debug-iphonesimulator"),iwdpBinDir:l(e,"bin"),installManifest:l(e,"install-manifest.json")}}async status(t,s){s||(s=await this.readCachedWantedVersion(t)??void 0);let e=[];try{e=await O(this.depsRoot())}catch{}s&&(e=e.filter(c=>c===s));let n=null;for(let c of e){let h=this.classRoot(t,c),b=null;try{b=JSON.parse(await y(l(h,"install-manifest.json"),"utf8"))}catch{continue}b.schemaVersion===q&&(!s&&b.cliVersion!==this.deps.cliVersion||(!n||b.installedAt>n.manifest.installedAt)&&(n={manifest:b,root:h}))}if(!n)return{class:t,installed:!1};let r=this.paths(t,n.manifest.bundleVersion),o=[l(r.appium,"node_modules","appium","index.js")];t==="emulator"&&o.push(l(r.platformTools,this.deps.os==="win32"?"adb.exe":"adb")),t==="simulator"&&o.push(l(r.wdaDir,"WebDriverAgentRunner-Runner.app"));for(let c of o)if(!await A(c))return{class:t,installed:!1,version:n.manifest.bundleVersion,root:n.root,corrupt:`a bundle component is missing from disk (${X(n.root,c)})`};let a=await this.postInstallDrifted(r);return{class:t,installed:!0,version:n.manifest.bundleVersion,root:n.root,...a?{needsRepair:a}:{}}}async postInstallDrifted(t){let s=l(t.appiumHome,"node_modules",".cache","appium","extensions.yaml");if(!await A(s))return!1;let e=await y(s,"utf8");for(let n of e.split(`
|
|
6
6
|
`)){let r=/^\s*installPath:\s*(.+?)\s*$/.exec(n);if(r&&!r[1].startsWith(t.appiumHome))return!0}return!1}async environment(t){let s=await this.status(t);if(!s.installed||!s.version)return{dirs:[]};let e=this.paths(t,s.version),n=[],r={dirs:n,appiumHome:e.appiumHome};return t!=="simulator"&&(n.push(e.platformTools),r.platformToolsDir=e.platformTools),n.push(l(e.appium,"node_modules",".bin")),t==="simulator"&&(n.push(e.iwdpBinDir),r.wdaDir=e.wdaDir,r.wdaRoot=l(e.root,"wda"),r.iwdpBinDir=e.iwdpBinDir),r}async ensure(t,s){let e,n;try{e=await this.resolveOrExplain(t)}catch(a){n=a}let r=await this.status(t,e?.bundleVersion);if(r.installed&&!r.needsRepair)return e&&r.version&&await this.adoptInstall(t,r.version),r;if(!e)throw n;if(r.installed&&r.needsRepair&&r.version){let a=this.paths(t,r.version);return await this.withInstallLock(async()=>{await this.postInstall(a.root,a,s.onProgress)}),await this.adoptInstall(t,r.version),this.status(t,e.bundleVersion)}let o=e;if(!s.automatic&&!s.approved)throw new j(t,o,this.classRoot(t,o.bundleVersion));return await this.withInstallLock(async()=>{(await this.status(t,o.bundleVersion)).installed||await this.install(t,o,s.onProgress)}),this.status(t,o.bundleVersion)}async adoptInstall(t,s){try{let e=this.paths(t,s).installManifest,n=JSON.parse(await y(e,"utf8"));if(n.cliVersion===this.deps.cliVersion)return;n.cliVersion=this.deps.cliVersion;let r=l(C(e),`install-manifest-${process.pid}.json`);await x(r,`${JSON.stringify(n,null,2)}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{
|
|
2
|
+
import{a as te,b as E,d as ne,e as se}from"./chunk-JGRXMTME.js";import{b as X,c as v,e as W,i as Y,j as Z,k as ee}from"./chunk-77ZZQJLX.js";import{e as z}from"./chunk-65VANXOF.js";import{a as Q}from"./chunk-B7ZX5HEN.js";import{d as q}from"./chunk-D36V5OX6.js";import{copyFileSync as Re,cpSync as xe,existsSync as P,mkdirSync as Ie,readFileSync as ze,readdirSync as ke,rmSync as Qe,writeFileSync as Xe}from"fs";import{dirname as Ye,isAbsolute as Ze,join as x,relative as et,resolve as tt}from"path";import{writeFileSync as ve,mkdirSync as Pe,readFileSync as je}from"fs";import{dirname as De,basename as re}from"path";function oe(e){let t=e.outPath??v(e.sourcePath);Pe(De(t),{recursive:!0});let n=[];n.push("---"),n.push(`test: ../${re(e.sourcePath)}`),n.push(`status: ${e.overallStatus}`),n.push(`started: ${e.startedISO}`),n.push(`duration_s: ${e.durationS}`),n.push(`session_id: ${e.sessionId}`),n.push("---",""),n.push(`# ${e.title??re(e.sourcePath)} \u2014 Result`,"");for(let r=0;r<e.rootSteps.length;r++){let o=e.rootSteps[r],s=e.outcomes.find(d=>d.rootStepIndex===r+1);if(n.push($e(o,s)),s?.stepMd5&&n.push(`md5: ${s.stepMd5}`),s?.status==="failed"&&s.reason&&n.push(`Reason: ${s.reason}`),s?.softFailures?.length)for(let d of s.softFailures){let a=d.reason?`: ${d.reason}`:"";n.push(`\u26A0 optional sub-step ${d.subStepIndex} failed${a}`)}o.body.kind==="objective"&&s?.status!=="skipped"&&n.push(o.body.text),n.push("")}return ve(t,n.join(`
|
|
3
3
|
`),"utf8"),t}function $e(e,t){if(!t)return`## ${e.heading} (no outcome)`;let n=t.duration_s!=null?`${t.duration_s}s`:"\u2014";if(t.status==="skipped")return`## ${e.heading} \u23ED skipped`;let r=t.softFailed?" (optional)":"";if(t.refKind&&t.status==="passed"){let o=t.helperResultRelPath?` \u2192 ${t.helperResultRelPath}`:"";return`## ${e.heading} \u2713 passed (via @${t.refKind} ${t.refLabel} \u2014 ${t.inlinedCount} inlined steps, ${n}${o})`}if(t.refKind&&t.status==="failed"){let o=t.failedSubStepIndex&&t.failedSubStepIndex.length>0?` \u2014 at sub-step ${t.failedSubStepIndex.join(" \u2192 sub-step ")}`:"",s=t.helperResultRelPath?` \u2192 ${t.helperResultRelPath}`:"";return`## ${e.heading} \u2717 failed${r} (via @${t.refKind} ${t.refLabel}${o}, ${n}${s})`}return t.status==="passed"?`## ${e.heading} \u2713 passed (${n})`:`## ${e.heading} \u2717 failed${r} (${n})`}var Fe=/^##\s+(.+?)\s+(✓ passed|✗ failed(?:\s+\(optional\))?|⏭ skipped)(?:\s+\((.*)\))?\s*$/,Oe=/via\s+@\w+\s+(\S+).*?(?:→\s+(\S+))?\s*$/,_e=/^md5:\s+([a-f0-9]{32})\s*$/;function ie(e,t){for(let n=t;n<e.length&&!/^##\s/.test(e[n]);n++){if(e[n].trim()==="")continue;let r=_e.exec(e[n]);return r?r[1]:null}return null}function D(e){let n=je(e,"utf8").split(`
|
|
4
|
-
`),r="passed";if(n[0]?.trim()==="---")for(let s=1;s<n.length&&n[s].trim()!=="---";s++){let d=/^status:\s+(passed|failed|interrupted)\s*$/.exec(n[s]);d&&(r=d[1])}let o=[];for(let s=0;s<n.length;s++){let d=Fe.exec(n[s]);if(!d)continue;let a=d[1],i=d[2],
|
|
5
|
-
`)){let s=o.trim();if(s)try{let d=JSON.parse(s);d&&typeof d=="object"&&t.push(d)}catch{}}}return t}function V(e){try{return Ne(e,{withFileTypes:!0}).filter(t=>t.isDirectory()).map(t=>t.name).sort((t,n)=>t.localeCompare(n,void 0,{numeric:!0}))}catch{return[]}}function St(e){if(!e)return[];let t=[];for(let n of V(F(e,"runs")))for(let r of[F(e,"runs",n,"run-test","actions.ndjson"),F(e,"runs",n,"actions.ndjson")])if(
|
|
4
|
+
`),r="passed";if(n[0]?.trim()==="---")for(let s=1;s<n.length&&n[s].trim()!=="---";s++){let d=/^status:\s+(passed|failed|interrupted)\s*$/.exec(n[s]);d&&(r=d[1])}let o=[];for(let s=0;s<n.length;s++){let d=Fe.exec(n[s]);if(!d)continue;let a=d[1],i=d[2],u=d[3]??"",f=i.startsWith("\u2713")?"passed":i.startsWith("\u23ED")?"skipped":"failed";if(/via\s+@/.test(u)){let m=Oe.exec(u),w=m?.[1]??"",I=m?.[2]??null;o.push({kind:"import",heading:a,status:f,md5:ie(n,s+1),importPath:w,helperResultRelPath:I})}else o.push({kind:"objective",heading:a,status:f,md5:ie(n,s+1)})}return{overallStatus:r,steps:o}}import{copyFileSync as ae,existsSync as H,mkdirSync as Ae,writeFileSync as de,promises as dt}from"fs";import{join as $,dirname as le,basename as Te}from"path";async function pe(e){for(let t=0;t<e.totalRunDirs;t++){let n=e.runIndex+t,r=$(e.sessionDir,"runs",String(n)),o=$(e.stagingStepDir,"flows",String(t));Ae(o,{recursive:!0});let s=$(o,"actions.ndjson");if(e.packTestDir){let i=$(e.packTestDir,"logs",`${n}-actions.ndjson`);if(H(i)){ae(i,s);continue}let u=le(le(e.packTestDir)),f=Te(e.packTestDir),S=H(u)?await z(u,`tests/${f}/logs/${n}-actions.ndjson`).catch(()=>null):null;de(s,S??"");continue}let d=[$(r,"run-test","actions.ndjson"),$(r,"actions.ndjson")],a=!1;for(let i of d)if(H(i)){ae(i,s),a=!0;break}a||de(s,"")}}import{existsSync as ue,readFileSync as fe,readdirSync as Ne}from"fs";import{join as F}from"path";function Ee(e){if(e.action_type!=="upload_files")return null;let t=e.action_params?.media;if(!t||typeof t!="object")return null;let n=a=>typeof t[a]=="string"?t[a]:"",r=n("media_id"),o=n("name"),s=n("media_url");if(!r||!o||!s)return null;let d=n("type")||"doc";return{media_id:r,name:o,media_url:s,type:d,alias:n("alias")}}function Le(e){let t=e.action_params?.file_paths,n=Array.isArray(t)?t[0]:t;return typeof n=="string"&&n.length>0?n:null}function Ue(e){let t={};for(let[n,r]of Object.entries(e??{}))t[n]={...r,refs:[...r.refs??[]]};return t}function Ke(e,t){if(!t)return!1;let n=t.endsWith("/")?t:t+"/";return e.startsWith(n)}function ce(e,t,n,r={}){let o=Ue(e);for(let s of t){let d=Ee(s);if(!d)continue;let a=o[d.media_id]??={name:d.name,media_url:d.media_url,type:d.type,refs:[],recorded_at:n,...d.alias?{alias:d.alias}:{}};a.recorded_at=n;let i=Le(s);if(!(!i||Ke(i,r.ignoreAliasUnder))){for(let[u,f]of Object.entries(o))u!==d.media_id&&(f.refs=f.refs.filter(S=>S!==i));a.refs.includes(i)||a.refs.push(i)}}return o}function ut(e){let t=e?.media;if(!t||typeof t!="object")return[];let n=[];for(let[r,o]of Object.entries(t)){if(!r||!o||typeof o!="object")continue;let s=o;typeof s.name!="string"||!s.name||typeof s.media_url!="string"||!s.media_url||n.push({media_id:r,name:s.name,media_url:s.media_url,type:typeof s.type=="string"&&s.type?s.type:"doc",refs:Array.isArray(s.refs)?s.refs.filter(d=>typeof d=="string"&&d.length>0):[],...typeof s.alias=="string"&&s.alias?{alias:s.alias}:{}})}return n}function Ce(e){let t=[];for(let n of e){let r;try{r=fe(n,"utf8")}catch{continue}for(let o of r.split(`
|
|
5
|
+
`)){let s=o.trim();if(s)try{let d=JSON.parse(s);d&&typeof d=="object"&&t.push(d)}catch{}}}return t}function V(e){try{return Ne(e,{withFileTypes:!0}).filter(t=>t.isDirectory()).map(t=>t.name).sort((t,n)=>t.localeCompare(n,void 0,{numeric:!0}))}catch{return[]}}function St(e){if(!e)return[];let t=[];for(let n of V(F(e,"runs")))for(let r of[F(e,"runs",n,"run-test","actions.ndjson"),F(e,"runs",n,"actions.ndjson")])if(ue(r)){t.push(r);break}return t}function me(e){let t=[],n=F(e,".internal","steps");for(let r of V(n)){let o=F(n,r,"flows");for(let s of V(o)){let d=F(o,s,"actions.ndjson");ue(d)&&t.push(d)}}return t}function We(e){try{let n=JSON.parse(fe(e,"utf8"))?.media;return n&&typeof n=="object"?n:void 0}catch{return}}function ge(e){let t=We(e.priorMetaPath),n=Ce(e.recordFiles),r=ce(t,n,e.now??new Date().toISOString(),{ignoreAliasUnder:e.ignoreAliasUnder??q});return Object.keys(r).length>0?r:void 0}import{existsSync as L,readdirSync as He}from"fs";import{dirname as Ve,join as O,basename as B}from"path";function wt(e,t){let n=[];return e.steps.forEach((r,o)=>{let s=t[o];r.block||!r.replayOnly||!s||s.kind!=="author"||n.push({flatIndex:r.flatIndex,file:r.owningFile,heading:r.trace[r.trace.length-1].heading,kind:r.replayOnly,reason:s.reason})}),n}function vt(e){let t=[],n=new Set,r=new Map;function o(i){if(r.has(i))return r.get(i);let u=v(i),f=L(u)?D(u):null;return r.set(i,f),f}let s=new Map;function d(i){if(s.has(i))return s.get(i);let u=O(i,"Result.md"),f=L(u)?D(u):null;return s.set(i,f),f}function a(i){for(let u=1;u<i.trace.length;u++){let f=i.trace[u-1],S=o(f.file);if(!S)continue;let m=S.steps[f.stepIndex-1];if(m){if(m.kind!=="import")return{kind:"author",reason:"structure-mismatch"};if(B(m.importPath)!==B(i.trace[u].file))return{kind:"author",reason:"structure-mismatch"};if(m.md5!=null&&m.md5!==f.rowMd5)return{kind:"author",reason:"structure-mismatch"}}}return null}for(let i of e.steps){let u=i.trace[i.trace.length-1].stepIndex,f=i.replayOnly;if(i.block){let g=o(i.owningFile)?.steps[u-1],j=i.controlFlow!==void 0,T=g?.kind==="objective"&&g.status==="skipped";if(j||T){t.push({kind:"replay",recordingDir:"",flowCount:0,unrecorded:!0,...f?{replayOnly:f}:{}});continue}}let S=n.has(i.owningFile);for(let g=0;g<i.trace.length-1&&!S;g++)n.has(i.trace[g].file)&&(S=!0);if(S&&!f){t.push({kind:"author",reason:o(i.owningFile)===null?"no-result-md":"downstream-of-divergence"});continue}let m=a(i);if(m){for(let g=0;g<i.trace.length;g++)n.add(i.trace[g].file);if(!f){t.push(m);continue}}let w=o(i.owningFile),I;if(w===null&&i.trace.length>1){let g=J(i.trace);I=he(i,d(g),u,g)}else I=he(i,w,u);if(f&&I.kind==="replay"&&(I={...I,replayOnly:f}),t.push(I),I.kind==="author"){n.add(i.owningFile);for(let g=0;g<i.trace.length-1;g++)n.add(i.trace[g].file)}}return t}function he(e,t,n,r=null){if(!t)return{kind:"author",reason:"no-result-md"};let o=t.steps[n-1];if(!o)return{kind:"author",reason:"no-result-md"};if(o.kind!=="objective")return{kind:"author",reason:"structure-mismatch"};if(o.status!=="passed")return{kind:"author",reason:"recorded-failed"};let s=E(e);if(s!==o.md5)return{kind:"author",reason:"md5-mismatch"};let d=r===null?ee(e.owningFile,n,s.slice(0,8)):O(r,".internal","steps",`${n}-${s.slice(0,8)}`),a=Be(d);return a===0?{kind:"author",reason:"missing-recording"}:{kind:"replay",recordingDir:d,flowCount:a}}function Be(e){let t=O(e,"flows");if(!L(t))return 0;let n;try{n=He(t,{withFileTypes:!0}).filter(o=>o.isDirectory()&&/^\d+$/.test(o.name)).map(o=>parseInt(o.name,10))}catch{return 0}if(n.length===0)return 0;let r=Math.max(...n);for(let o=0;o<=r;o++)if(!L(O(t,String(o),"actions.ndjson")))return 0;return r+1}function Pt(e){return e.some(t=>t.kind==="author")}function jt(e){for(let t=0;t<e.length;t++)if(e[t].kind==="author")return t;return e.length}function J(e){let t=s=>{let d=B(s);return d.endsWith("_test.md")?d.slice(0,-8):d.endsWith(".md")?d.slice(0,-3):d},n=t(e[0].file),r=t(e[e.length-1].file),o=e.slice(0,-1).map(s=>String(s.stepIndex));return O(Ve(e[e.length-1].file),`helper-output-${r}-${n}-${o.join("-")}`)}function Dt(e){return Array.from({length:e.flowCount},(t,n)=>O(e.recordingDir,"flows",String(n),"actions.ndjson"))}import{existsSync as ye,mkdirSync as Je,rmSync as Ge,cpSync as qe}from"fs";function Se(e,t){ye(e)&&(ye(t)&&Ge(t,{recursive:!0,force:!0}),Je(t,{recursive:!0}),qe(e,t,{recursive:!0}))}async function Vt(e){let t=new Map;for(let a of e.stepRunRecords)t.set(a.testmdStepIndex,a);let n=e.authoredFlatIdx??new Set,r=[],o=[],s=new Map,d=a=>{if(s.has(a))return s.get(a);let i=x(a,"Result.md"),u=P(i)?D(i):null;return s.set(a,u),u};for(let a of e.resolvedTest.unitFiles){let i=a.file===e.resolvedTest.rootPath,u=Q(a.file,ze(a.file,"utf8")),f=v(a.file),S=P(f)?D(f):null,m=[],w=[],I=[],g=[];if(!i)for(let p of e.resolvedTest.steps){if(p.owningFile!==a.file||p.trace.length<2)continue;let l=J(p.trace);g.includes(l)||g.push(l)}let j=p=>{if(S!==null)return null;for(let l of g){let M=d(l)?.steps[p-1];if(M)return{row:M,dir:l}}return null},T=[],U=!1,G=!1,K=!1,N=!1;for(let p of u.steps){let l=p.index,c=S?.steps[l-1];if(p.body.kind==="objective"){let h=e.resolvedTest.steps.filter(y=>y.owningFile===a.file&&y.trace[y.trace.length-1].stepIndex===l&&t.has(y.flatIndex)),R=h.length>0?h[h.length-1]:null;if(R){U=!0,n.has(R.flatIndex)&&(G=!0);let y=E(R),k;i?k=e.outcomes.find(we=>we.rootStepIndex===l)??{rootStepIndex:l,status:"skipped"}:k={rootStepIndex:l,status:be(R,e.outcomes)},k.status==="failed"&&(K=!0),k.stepMd5==null&&(k.stepMd5=y),m.push(k),w.push({stepIndex:l,md5:y,rec:t.get(R.flatIndex)}),(!c||c.kind!=="objective"||c.status!==k.status||k.status==="passed"&&c.md5!==y)&&(N=!0)}else if(c&&c.kind==="objective")m.push({rootStepIndex:l,status:c.status,...c.md5?{stepMd5:c.md5}:{}}),I.push(l);else if(!i&&j(l)?.row.kind==="objective"){let y=j(l),k=y.row;m.push({rootStepIndex:l,status:k.status,...k.md5?{stepMd5:k.md5}:{}}),T.push({psIdx:l,dir:y.dir})}else i?m.push(e.outcomes.find(y=>y.rootStepIndex===l)??{rootStepIndex:l,status:"skipped"}):m.push({rootStepIndex:l,status:"skipped"});continue}let M=Ze(p.body.path)?p.body.path:tt(Ye(a.file),p.body.path),_=te({path:p.body.path,bindings:p.body.bindings,optional:p.optional??!1}),C=et(X(a.file),v(M)),A=e.resolvedTest.steps.filter(h=>h.trace.some((R,y)=>y<h.trace.length-1&&R.file===a.file&&R.stepIndex===l)&&t.has(h.flatIndex));if(A.length>0){U=!0;let h;if(i)h=e.outcomes.find(R=>R.rootStepIndex===l)??{rootStepIndex:l,status:"passed",refKind:"import",refLabel:p.body.path};else{let R=A.some(y=>be(y,e.outcomes)==="failed");h={rootStepIndex:l,status:R?"failed":"passed",refKind:"import",refLabel:p.body.path,inlinedCount:A.length}}h.status==="failed"&&(K=!0),h.stepMd5==null&&(h.stepMd5=_),h.helperResultRelPath==null&&(h.helperResultRelPath=C),m.push(h),(!c||c.kind!=="import"||c.status!==h.status||c.md5!==_)&&(N=!0)}else if(c&&c.kind==="import")m.push({rootStepIndex:l,status:c.status,refKind:"import",refLabel:c.importPath,...c.md5?{stepMd5:c.md5}:{},...c.helperResultRelPath?{helperResultRelPath:c.helperResultRelPath}:{}});else if(!i&&j(l)?.row.kind==="import"){let h=j(l).row;m.push({rootStepIndex:l,status:h.status,refKind:"import",refLabel:p.body.path})}else i?m.push(e.outcomes.find(h=>h.rootStepIndex===l)??{rootStepIndex:l,status:"skipped",refKind:"import",refLabel:p.body.path}):m.push({rootStepIndex:l,status:"skipped",refKind:"import",refLabel:p.body.path})}if(!(i||U&&(G||K||S===null||N)))continue;r.push(a.file);let b=Y(a.file);Ie(x(b,".internal"),{recursive:!0});for(let p of w){let l=x(b,".internal","steps",`${p.stepIndex}-${p.md5.slice(0,8)}`);Ie(l,{recursive:!0}),await pe({sessionDir:e.sessionDir,runIndex:p.rec.runIndex,totalRunDirs:p.rec.totalRunDirs,stagingStepDir:l,packTestDir:e.packTestDir})}if(I.length>0){let p=Z(a.file);if(P(p))for(let l of ke(p)){let c=parseInt(l.split("-")[0]??"",10);!Number.isNaN(c)&&I.includes(c)&&xe(x(p,l),x(b,".internal","steps",l),{recursive:!0})}}for(let p of T){let l=x(p.dir,".internal","steps");if(P(l))for(let c of ke(l))parseInt(c.split("-")[0]??"",10)===p.psIdx&&xe(x(l,c),x(b,".internal","steps",c),{recursive:!0})}let Me=m.some(p=>p.status==="failed");if(oe({sourcePath:a.file,title:u.title,rootSteps:u.steps,outcomes:m,overallStatus:i?e.overallStatus:Me?"failed":"passed",startedISO:e.startedISO,durationS:i?e.durationS:0,sessionId:e.sessionId,outPath:x(b,"Result.md")}),i){let p={};e.commitId&&(p.commit_id=e.commitId),e.tmsIds.testId&&(p.test_id=e.tmsIds.testId),e.tmsIds.testcaseId&&(p.testcase_id=e.tmsIds.testcaseId),e.tmsIds.projectId&&(p.project_id=e.tmsIds.projectId),e.tmsIds.folderId&&(p.folder_id=e.tmsIds.folderId),e.tmsIds.orgId&&(p.org_id=e.tmsIds.orgId),e.tmsIds.sessionName&&(p.session_name=e.tmsIds.sessionName);let l=ge({priorMetaPath:W(a.file),recordFiles:me(b)});l&&(p.media=l);let c=ne(a.file);c&&(p.tc_id=c);let M=se(a.file);M&&(p.environment_id=M),Xe(x(b,".internal","meta.json"),JSON.stringify(p,null,2)+`
|
|
6
6
|
`,"utf8");let _=x(e.sessionDir,"execution.json");if(P(_))try{Re(_,x(b,".internal","execution.json"))}catch{}if(e.codeExportDir){let C=e.codeExportLanguage??"python",A=e.codeExportFramework??"playwright",h=x(b,`${A}-${C}-code`);try{Se(e.codeExportDir,h)}catch(R){process.stderr.write(`warn: codegen copy failed: ${R.message}
|
|
7
|
-
`)}}}else if(a.kind==="test"||a.kind==="module"){let p=W(a.file);if(P(p))try{Re(p,x(b,".internal","meta.json"))}catch{}}!i&&g.length>0&&m.every(l=>l.status!=="skipped")&&o.push({unitFile:a.file,dirs:g.filter(l=>P(l))})}return{changedUnitFiles:r,legacySweep:o}}function Bt(e){for(let t of e)try{Qe(t,{recursive:!0,force:!0})}catch{}}function be(e,t){let n=e.trace[0].stepIndex,r=t.find(a=>a.rootStepIndex===n);if(!r)return"skipped";if(r.status==="passed")return"passed";if(r.status==="skipped")return"skipped";let o=e.trace.slice(1).map(a=>a.stepIndex),s=r.failedSubStepIndex??[],d=Math.min(o.length,s.length);for(let a=0;a<d;a++)if(o[a]!==s[a])return o[a]<s[a]?"passed":"skipped";return o.length===s.length?"failed":o.length<s.length?"passed":"skipped"}export{oe as a,wt as b,vt as c,Pt as d,jt as e,Dt as f,
|
|
7
|
+
`)}}}else if(a.kind==="test"||a.kind==="module"){let p=W(a.file);if(P(p))try{Re(p,x(b,".internal","meta.json"))}catch{}}!i&&g.length>0&&m.every(l=>l.status!=="skipped")&&o.push({unitFile:a.file,dirs:g.filter(l=>P(l))})}return{changedUnitFiles:r,legacySweep:o}}function Bt(e){for(let t of e)try{Qe(t,{recursive:!0,force:!0})}catch{}}function be(e,t){let n=e.trace[0].stepIndex,r=t.find(a=>a.rootStepIndex===n);if(!r)return"skipped";if(r.status==="passed")return"passed";if(r.status==="skipped")return"skipped";let o=e.trace.slice(1).map(a=>a.stepIndex),s=r.failedSubStepIndex??[],d=Math.min(o.length,s.length);for(let a=0;a<d;a++)if(o[a]!==s[a])return o[a]<s[a]?"passed":"skipped";return o.length===s.length?"failed":o.length<s.length?"passed":"skipped"}export{oe as a,wt as b,vt as c,Pt as d,jt as e,Dt as f,ut as g,St as h,ge as i,Se as j,Vt as k,Bt as l};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{h as c,i as d}from"./chunk-
|
|
2
|
+
import{h as c,i as d}from"./chunk-A7RJQJNT.js";import{readFileSync as l}from"fs";import{resolve as p}from"path";var i="KANE_CLI_DEVICE_CONFIG";function w(e=process.env){return(e[i]??"").trim()!==""}function v(e=process.env){let r=(e[i]??"").trim();if(!r)throw new Error(`a real-device run needs ${i} to name the run's device-config.json, and it is not set.`);let t=p(r),n;try{n=JSON.parse(l(t,"utf8"))}catch(o){throw new Error(`${i}: cannot read the device config at ${t}: ${o.message}`)}if(!n||typeof n!="object"||Array.isArray(n))throw new Error(`${i}: ${t} is not a device config object.`);return{path:t,entry:n}}function s(e){if(typeof e=="number")return String(e);if(typeof e=="string")return e.trim()||void 0}function N(e,r=process.env){let{path:t,entry:n}=v(r),o=s(n.platform_name)?.toLowerCase();if(o!==e.platform)throw new Error(`${i}: ${t} describes ${o?`a "${o}" device`:"no platform_name"}, but the test file's target is ${e.platform}.`);if(!e.hasCredentials)throw new Error("a real-device run needs your TestMu AI username and access key, and none were found. Run kane-cli login, or pass --username and --access-key.");let a=s(n.device_name),f=s(n.platform_version),u=s(n.app);return{device:{platform:e.platform,target:e.platform,device_config_path:t},...a?{deviceName:a}:{},...f?{osVersion:f}:{},...u?{app:u}:{}}}function _(e){return`Connecting to a real ${d(c(e))} device\u2026`}function h(e){let r=e.deviceName??"any device";return e.osVersion?`${r} (${e.osVersion})`:r}function m(e){return/[*?^$[\]{}|\\]/.test(e)}function g(e){return e?.name&&!m(e.name)?e.name:void 0}function D(e){return g(e)||e?.model}function R(e,r,t){let n=D(r),o=r?.os_version?`${d(c(e))} ${r.os_version}`:void 0,a=t?`App ${t.replace(/^lt:\/\//,"")}`:void 0;return`Running on: ${["Real device",n,o,a].filter(Boolean).join(" \xB7 ")}`}function C(e,r,t){let n=!1;return o=>{n||o.type!=="run_start"||o.child_id||(n=!0,t(R(e,o.environment?.device,r)))}}export{w as a,N as b,_ as c,h as d,m as e,g as f,D as g,C as h};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as h}from"./chunk-72KYMWQ5.js";import{a as d}from"./chunk-JQ64X2TO.js";import{a as m}from"./chunk-34R7BNZ2.js";import{a as p}from"./chunk-3G2LSTK5.js";import{a as V}from"./chunk-4IEQNX7F.js";import{a as y}from"./chunk-C2RUDJ46.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};
|