@testmuai/kane-cli 0.10.0 → 0.10.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-Z26BOE5U.js +2 -0
- package/dist/{ChromeProfilePicker-FWPUDKD6.js → ChromeProfilePicker-ODRIAXL3.js} +1 -1
- package/dist/{CliFeedbackPrompt-D5L2DO6A.js → CliFeedbackPrompt-JWCTMIGI.js} +1 -1
- package/dist/{CliUploadProgress-HQX57WE6.js → CliUploadProgress-XFRRFRL4.js} +1 -1
- package/dist/{ConfigView-DGQXKEON.js → ConfigView-6JF4DOJN.js} +1 -1
- package/dist/EvidenceViewOffer-6344EX74.js +2 -0
- package/dist/FolderPicker-4PCYHE75.js +2 -0
- package/dist/InfoBox-NJ2DL7YC.js +2 -0
- package/dist/{LinksBox-WZ4RAMSH.js → LinksBox-HNDNFVUT.js} +1 -1
- package/dist/{ProfilesView-AGRNPGSW.js → ProfilesView-DEJKJOHY.js} +1 -1
- package/dist/ProjectPicker-DTWMWOH7.js +2 -0
- package/dist/SaveSessionPrompt-3GCLB3ZT.js +2 -0
- package/dist/SingleShotApp-HMOXO5DW.js +2 -0
- package/dist/{SummaryBox-XQJUZBAN.js → SummaryBox-7PPDMSSM.js} +1 -1
- package/dist/TestMdRunView-QLKRUU4V.js +2 -0
- package/dist/TestrunEvidenceTable-T2JUB4TE.js +2 -0
- package/dist/{WhoamiView-JQCURK2M.js → WhoamiView-H7JNLLCY.js} +1 -1
- package/dist/{app-download-OU6AGH2X.js → app-download-GKRF2EIM.js} +1 -1
- package/dist/{assurance-job-ZI3L6I4F.js → assurance-job-F4L3T4VJ.js} +1 -1
- package/dist/{auth-7Z54TMQQ.js → auth-WBIEHHDS.js} +1 -1
- package/dist/{binary-S5YL5GJD.js → binary-K3XMILST.js} +1 -1
- package/dist/{bind-LIV72SEZ.js → bind-SSHAZAB3.js} +1 -1
- package/dist/{bootstrap-3V6TOO6I.js → bootstrap-XGKU4WXB.js} +1 -1
- package/dist/bridge-2UHJOVLX.js +2 -0
- package/dist/{catalog-I3PC6LT6.js → catalog-YCU6OHNV.js} +1 -1
- package/dist/{catalog-client-WKYG3JN6.js → catalog-client-MVEEHTG2.js} +1 -1
- package/dist/{changelog-IHNWFYWY.js → changelog-5UB3AQT6.js} +1 -1
- package/dist/chat-committer-ZKEKJA2R.js +2 -0
- package/dist/chat-controller-FXRJXUG3.js +2 -0
- package/dist/child-JHYENXE7.js +2 -0
- package/dist/{chunk-ZTAZ2R5Z.js → chunk-23DKB2MT.js} +1 -1
- package/dist/{chunk-UX2CDUPE.js → chunk-2JFRN62I.js} +2 -2
- package/dist/chunk-2RBMQTYS.js +26 -0
- package/dist/{chunk-VVCZRCRD.js → chunk-2TK4MDF2.js} +1 -1
- package/dist/{chunk-G3J4XY3Z.js → chunk-32HED7X2.js} +1 -1
- package/dist/{chunk-GRURFGBP.js → chunk-32MFECUA.js} +1 -1
- package/dist/{chunk-N3KTLWJL.js → chunk-35BG2EMW.js} +1 -1
- package/dist/{chunk-4523YDTG.js → chunk-35WUYKGO.js} +1 -1
- package/dist/{chunk-KDR662D2.js → chunk-3KY7HHQU.js} +1 -1
- package/dist/{chunk-UNWPBMVM.js → chunk-3MD2XLE7.js} +2 -2
- package/dist/{chunk-YKL5H4K6.js → chunk-3NWUXRSI.js} +1 -1
- package/dist/{chunk-QQI6N3FO.js → chunk-3RO2YGKH.js} +1 -1
- package/dist/{chunk-AGXAJ2II.js → chunk-3ZC7GSMM.js} +1 -1
- package/dist/{chunk-I2MC6VVX.js → chunk-4C7WVQOD.js} +1 -1
- package/dist/{chunk-VQZOKTJ2.js → chunk-4CJQ7XZP.js} +1 -1
- package/dist/{chunk-7KX2BHKG.js → chunk-4KCYNP2K.js} +1 -1
- package/dist/{chunk-AUBSLPJZ.js → chunk-4KL3TSTT.js} +5 -5
- package/dist/{chunk-AG5XJWEV.js → chunk-4UX5N7YI.js} +1 -1
- package/dist/{chunk-WERIGVOH.js → chunk-5F5IVART.js} +1 -1
- package/dist/{chunk-RFEON5GN.js → chunk-5XVWT6UK.js} +1 -1
- package/dist/{chunk-FBQ7PQJV.js → chunk-5YYCCM6K.js} +1 -1
- package/dist/{chunk-SBR6D6GS.js → chunk-6FFX4S7N.js} +1 -1
- package/dist/{chunk-DHYGCHKB.js → chunk-6HRNG4CK.js} +1 -1
- package/dist/{chunk-HBVHIEPB.js → chunk-6QCCTZO3.js} +1 -1
- package/dist/{chunk-GI2JPIX5.js → chunk-6QH75BPJ.js} +1 -1
- package/dist/{chunk-5R3ODQHH.js → chunk-6SD4XTYC.js} +1 -1
- package/dist/{chunk-J4LQAT5P.js → chunk-7LYLJ75Z.js} +1 -1
- package/dist/{chunk-Y3YULFCK.js → chunk-7RELCXRW.js} +1 -1
- package/dist/{chunk-GXMD23XB.js → chunk-7SU53QGU.js} +1 -1
- package/dist/{chunk-DTYT6KBO.js → chunk-7Y55CO42.js} +1 -1
- package/dist/{chunk-2L3A5NKZ.js → chunk-7YV2FCN4.js} +1 -1
- package/dist/{chunk-ULGBK4NS.js → chunk-A2DODRHG.js} +1 -1
- package/dist/{chunk-EVZLINBN.js → chunk-AHT2ORJT.js} +1 -1
- package/dist/{chunk-RDH3E25Q.js → chunk-AT7AT3AR.js} +2 -2
- package/dist/{chunk-ZI3X7DI2.js → chunk-AVLYSNEG.js} +1 -1
- package/dist/{chunk-GET4DINR.js → chunk-BBJAKSA7.js} +1 -1
- package/dist/{chunk-CBVHP7JB.js → chunk-BJO6J5X2.js} +1 -1
- package/dist/{chunk-G3CYFCSR.js → chunk-BLVDV3QQ.js} +1 -1
- package/dist/{chunk-2N75WO7Y.js → chunk-C4KAPGBS.js} +1 -1
- package/dist/{chunk-XLQ4F6BI.js → chunk-CB2BWDHG.js} +2 -2
- package/dist/chunk-CB344EDO.js +2 -0
- package/dist/chunk-CCOD4GQJ.js +2 -0
- package/dist/{chunk-JSLKCCD2.js → chunk-CNHKZE4F.js} +1 -1
- package/dist/{chunk-CJE7PKRV.js → chunk-CQDCNP7V.js} +1 -1
- package/dist/{chunk-3OVFKUXV.js → chunk-CTHUX7O4.js} +1 -1
- package/dist/{chunk-4JWJH6TB.js → chunk-DC5F2ADJ.js} +1 -1
- package/dist/chunk-DIOK3SER.js +34 -0
- package/dist/{chunk-EQWMOGLO.js → chunk-DQXQJJOP.js} +2 -2
- package/dist/{chunk-EH43VWVR.js → chunk-DXIQVBMI.js} +1 -1
- package/dist/{chunk-WZLDFEWR.js → chunk-E4GIGM5V.js} +1 -1
- package/dist/{chunk-K3OSK6PB.js → chunk-EBJW6POT.js} +1 -1
- package/dist/{chunk-MYZHOBS4.js → chunk-EHB55V23.js} +1 -1
- package/dist/{chunk-RARD6TC6.js → chunk-EJGCIGQY.js} +1 -1
- package/dist/{chunk-OR2B6T3B.js → chunk-ENRFXGID.js} +1 -1
- package/dist/{chunk-3ZPEQDXZ.js → chunk-ERRIDBE7.js} +1 -1
- package/dist/{chunk-HGVM2OZU.js → chunk-EZMRWXRT.js} +1 -1
- package/dist/chunk-F2F257PU.js +6 -0
- package/dist/{chunk-AUJSC7PU.js → chunk-FNUGDPTS.js} +1 -1
- package/dist/{chunk-MPEIMWQI.js → chunk-FOLUB336.js} +1 -1
- package/dist/{chunk-HHW6MRU3.js → chunk-G4K3TP2I.js} +1 -1
- package/dist/{chunk-P2ZQDQDB.js → chunk-GAKBHNC4.js} +1 -1
- package/dist/{chunk-DPGOAFKF.js → chunk-GBQ4K25P.js} +1 -1
- package/dist/{chunk-PCDIEYV6.js → chunk-GEZVC4S3.js} +1 -1
- package/dist/{chunk-PL3SG3M2.js → chunk-GJXO6FF7.js} +1 -1
- package/dist/{chunk-252GEI3H.js → chunk-GLM5UGTF.js} +1 -1
- package/dist/{chunk-JOCEZK2M.js → chunk-GQAWZEA4.js} +1 -1
- package/dist/{chunk-45URQUAK.js → chunk-GXQYFOBD.js} +1 -1
- package/dist/{chunk-PBWYQR5I.js → chunk-HBLHKQR7.js} +1 -1
- package/dist/chunk-HC6VLPUB.js +5 -0
- package/dist/{chunk-K2PLULJD.js → chunk-HRIDAK6Y.js} +1 -1
- package/dist/{chunk-D6CS62O7.js → chunk-HV2CDY4K.js} +1 -1
- package/dist/{chunk-P2LDAW3C.js → chunk-HVOXMCKE.js} +1 -1
- package/dist/{chunk-4I7YN6YY.js → chunk-HYJVYYAZ.js} +2 -2
- package/dist/{chunk-GYDJO32R.js → chunk-IEHJG6J4.js} +1 -1
- package/dist/{chunk-GGS3ATPB.js → chunk-IZ66FKPC.js} +1 -1
- package/dist/{chunk-QMOGBKJM.js → chunk-J4FIESTB.js} +1 -1
- package/dist/{chunk-436FZ4KG.js → chunk-JBKHX5ES.js} +1 -1
- package/dist/{chunk-EX6ORR7P.js → chunk-JNPFEBUR.js} +1 -1
- package/dist/{chunk-AU26ZZTX.js → chunk-JTNEF5ZP.js} +1 -1
- package/dist/{chunk-5IO5ZC4S.js → chunk-KBGMQYMD.js} +1 -1
- package/dist/{chunk-WX4VGH5Q.js → chunk-KCXLRR3Q.js} +1 -1
- package/dist/{chunk-4R4YUOVY.js → chunk-KKLCXRW6.js} +1 -1
- package/dist/{chunk-YGMQXS2J.js → chunk-KL7XFNSD.js} +1 -1
- package/dist/{chunk-MJKRJGER.js → chunk-KQ4XKTIZ.js} +1 -1
- package/dist/{chunk-I2VU2DTS.js → chunk-L3BUPFAQ.js} +4 -4
- package/dist/{chunk-ZZNQIFFI.js → chunk-LHJSIHLC.js} +1 -1
- package/dist/{chunk-2GE5X2A5.js → chunk-LLQWEGXD.js} +1 -1
- package/dist/{chunk-PQXYHI5W.js → chunk-LPJKNX6D.js} +1 -1
- package/dist/{chunk-ZGQM6KWN.js → chunk-LRNUGKYH.js} +1 -1
- package/dist/chunk-LTPOMMAB.js +2 -0
- package/dist/{chunk-MHB6DMKZ.js → chunk-LUA25RYS.js} +1 -1
- package/dist/{chunk-2PZKMT3I.js → chunk-LV7224DG.js} +1 -1
- package/dist/{chunk-X3J4CC27.js → chunk-LXK4B2FE.js} +1 -1
- package/dist/{chunk-YH4VZVHJ.js → chunk-LZGAFKYH.js} +1 -1
- package/dist/{chunk-3QICDXY5.js → chunk-LZPYIFHZ.js} +1 -1
- package/dist/{chunk-4BUEOKFV.js → chunk-M2E5CPPV.js} +1 -1
- package/dist/{chunk-65BG6GAE.js → chunk-M7A66MSK.js} +1 -1
- package/dist/{chunk-JX5NVKTV.js → chunk-MD3RABID.js} +1 -1
- package/dist/{chunk-QECTIQAC.js → chunk-MEBEVHGP.js} +1 -1
- package/dist/{chunk-52VCA4K2.js → chunk-MEMXFTLD.js} +1 -1
- package/dist/{chunk-U7NRZBB5.js → chunk-MINDIQET.js} +1 -1
- package/dist/{chunk-HJLMH7ZM.js → chunk-MUX2A37P.js} +1 -1
- package/dist/{chunk-YKOEABP2.js → chunk-N7IWR45S.js} +1 -1
- package/dist/{chunk-WQR2GYP7.js → chunk-ND6OP3O2.js} +1 -1
- package/dist/{chunk-URAYFJGM.js → chunk-NHGPMYM3.js} +1 -1
- package/dist/{chunk-ZKPY3AXW.js → chunk-NI3TIAD7.js} +1 -1
- package/dist/{chunk-JCSVBD4F.js → chunk-NPAUSUNM.js} +1 -1
- package/dist/{chunk-XMALVGH7.js → chunk-NRAPCFI2.js} +2 -2
- package/dist/{chunk-567D5ZTO.js → chunk-NZJSGINB.js} +16 -16
- package/dist/{chunk-A4BB6GLN.js → chunk-OBNVGD5H.js} +1 -1
- package/dist/{chunk-BRVIK3BU.js → chunk-OCMPWCKQ.js} +1 -1
- package/dist/{chunk-4SJAOAYY.js → chunk-OCVDMZWB.js} +1 -1
- package/dist/{chunk-JRSEAXFE.js → chunk-OHGL4GEJ.js} +1 -1
- package/dist/{chunk-YYVBE6W2.js → chunk-OOGKX4Y6.js} +1 -1
- package/dist/{chunk-QWZJ5QDO.js → chunk-OTMHCHH6.js} +2 -2
- package/dist/{chunk-Z5BFCTHI.js → chunk-OZNYQONA.js} +2 -2
- package/dist/{chunk-EPJ5SJL2.js → chunk-PB6RXDWQ.js} +2 -2
- package/dist/{chunk-TZVPDGJD.js → chunk-PCQK62MP.js} +1 -1
- package/dist/{chunk-Z777GGHB.js → chunk-PI7OXS62.js} +1 -1
- package/dist/{chunk-MW2WNYJO.js → chunk-PRBWZXFA.js} +2 -2
- package/dist/{chunk-2SY2NCOP.js → chunk-PTLOOVV4.js} +1 -1
- package/dist/{chunk-EC5IP5HZ.js → chunk-Q4ALB7SH.js} +1 -1
- package/dist/{chunk-FYCD765R.js → chunk-Q4JV4U65.js} +58 -58
- package/dist/{chunk-CJQUVHHS.js → chunk-Q4SMITTV.js} +1 -1
- package/dist/{chunk-NJCN6LP5.js → chunk-QE4AWNOV.js} +6 -6
- package/dist/{chunk-BY2B4YJN.js → chunk-QEM5ZRDN.js} +1 -1
- package/dist/{chunk-VA3BSIUQ.js → chunk-QHH42RH5.js} +1 -1
- package/dist/{chunk-FPPVNF53.js → chunk-R6TFRAMZ.js} +1 -1
- package/dist/{chunk-3T2TYDPT.js → chunk-RNHSULQM.js} +1 -1
- package/dist/{chunk-32Y6QVFG.js → chunk-SALZ6WSF.js} +1 -1
- package/dist/chunk-SB26HQO7.js +2 -0
- package/dist/{chunk-4NUSW4A2.js → chunk-SIHX5FW5.js} +1 -1
- package/dist/{chunk-LHQUCRCH.js → chunk-SJQTTEXQ.js} +1 -1
- package/dist/{chunk-W3NWHWK2.js → chunk-SMGRXKXX.js} +1 -1
- package/dist/{chunk-USJ3LUAL.js → chunk-SSOUYKVG.js} +1 -1
- package/dist/{chunk-2B75UL7Y.js → chunk-SVIIUKJ2.js} +1 -1
- package/dist/{chunk-7ZJWUWSN.js → chunk-SXBPUUQ5.js} +1 -1
- package/dist/{chunk-QVP4FSKT.js → chunk-T77LTLAD.js} +1 -1
- package/dist/{chunk-KRRZCY7U.js → chunk-TAY7J5VS.js} +1 -1
- package/dist/chunk-TD6GCEIK.js +2 -0
- package/dist/{chunk-VZA7BPCK.js → chunk-TM45NPWL.js} +1 -1
- package/dist/{chunk-ZY65IZJR.js → chunk-TM6VLC6V.js} +1 -1
- package/dist/{chunk-COJINPOK.js → chunk-TU2KPOW2.js} +2 -2
- package/dist/{chunk-JTJ7IPNI.js → chunk-TUSG7DIL.js} +1 -1
- package/dist/{chunk-3BSYOCSW.js → chunk-U2VYTVKV.js} +1 -1
- package/dist/{chunk-JQ7ZZQXC.js → chunk-UJ37XGSP.js} +3 -3
- package/dist/chunk-ULIIYKZB.js +7 -0
- package/dist/{chunk-LNHBZEDC.js → chunk-UWPG5MWM.js} +1 -1
- package/dist/{chunk-UUWSULIM.js → chunk-UXGMKRS4.js} +61 -60
- package/dist/{chunk-6DZ7LVOG.js → chunk-VCVEZEVS.js} +1 -1
- package/dist/{chunk-ZRDX2ARO.js → chunk-VKVYT6KZ.js} +2 -2
- package/dist/{chunk-B2WFW74J.js → chunk-VO2NNXKR.js} +1 -1
- package/dist/{chunk-B7JLM3IX.js → chunk-W54BX6HC.js} +1 -1
- package/dist/{chunk-IZ65ZPWY.js → chunk-W5HFUBXD.js} +1 -1
- package/dist/{chunk-TLOYTGVT.js → chunk-WE7HRAGO.js} +1 -1
- package/dist/{chunk-GRO6DLN3.js → chunk-WEJR2V7R.js} +1 -1
- package/dist/{chunk-YI4ESDAX.js → chunk-WIVKLNIO.js} +1 -1
- package/dist/chunk-WLEWXE6L.js +2 -0
- package/dist/{chunk-DBTMKBHU.js → chunk-X2MDL6S4.js} +1 -1
- package/dist/{chunk-MKPDF26Q.js → chunk-X45RZIAJ.js} +1 -1
- package/dist/{chunk-G2KTWFMU.js → chunk-X52YIWGG.js} +1 -1
- package/dist/{chunk-UEPJ26X2.js → chunk-X6FCXBXU.js} +1 -1
- package/dist/{chunk-LXM7VHYN.js → chunk-X7S7IGCV.js} +1 -1
- package/dist/{chunk-FVYIV36L.js → chunk-XKOVEMVZ.js} +1 -1
- package/dist/{chunk-3UHPVQLU.js → chunk-Y2HQMJGS.js} +1 -1
- package/dist/{chunk-4MNSP4EO.js → chunk-Y3RJHWNK.js} +1 -1
- package/dist/{chunk-A3TCFSCK.js → chunk-YCVEI7BT.js} +1 -1
- package/dist/{chunk-JGRXMTME.js → chunk-YDB72F4K.js} +1 -1
- package/dist/{chunk-7C4IEL5V.js → chunk-YILRYMMG.js} +1 -1
- package/dist/{chunk-7DFBOVUB.js → chunk-YJAQZMJT.js} +1 -1
- package/dist/{chunk-JGLADDRH.js → chunk-YNDELIXL.js} +1 -1
- package/dist/{chunk-WKZLK57W.js → chunk-YPGZ5E4I.js} +1 -1
- package/dist/{chunk-NTXFPNAP.js → chunk-YQZ736IQ.js} +1 -1
- package/dist/{chunk-FPVGA6XT.js → chunk-YVVFXBT5.js} +1 -1
- package/dist/{chunk-JT6WLJSV.js → chunk-YWWVF5OU.js} +1 -1
- package/dist/{chunk-RLOJH5O6.js → chunk-Z24SD2EJ.js} +1 -1
- package/dist/{chunk-ENG2UTMX.js → chunk-Z36KVIRR.js} +1 -1
- package/dist/{chunk-JFBEHCJN.js → chunk-Z47ZEFH7.js} +1 -1
- package/dist/{chunk-6NFOH4AC.js → chunk-ZAQGIC33.js} +1 -1
- package/dist/{chunk-GGV336P5.js → chunk-ZCBOHWN3.js} +1 -1
- package/dist/{chunk-AIGQCMGY.js → chunk-ZCL7XIVS.js} +1 -1
- package/dist/{chunk-ORNVIEUA.js → chunk-ZDCXWEQG.js} +1 -1
- package/dist/{chunk-6TNLITJO.js → chunk-ZHAMVLQZ.js} +1 -1
- package/dist/{chunk-FLOQ5NZL.js → chunk-ZIHQ5JGB.js} +4 -4
- package/dist/{chunk-PTISAIZW.js → chunk-ZMIKNNO6.js} +1 -1
- package/dist/{chunk-H4KPNGY4.js → chunk-ZMWTRXFH.js} +1 -1
- package/dist/{chunk-ONZ2CSTZ.js → chunk-ZPU3WAC4.js} +1 -1
- package/dist/commands-JBFLLT7A.js +2 -0
- package/dist/{committer-26UZDYSA.js → committer-UO3B3S5Y.js} +1 -1
- package/dist/{config-B472DZSR.js → config-7WTZPMAH.js} +1 -1
- package/dist/cover-cmd-DU6ZYJFL.js +2 -0
- package/dist/{credentials-TLT3RQOO.js → credentials-5WIFF5DG.js} +1 -1
- package/dist/{deps-bundle-CMTIWBS5.js → deps-bundle-BLLJ2BQ4.js} +1 -1
- package/dist/{deps-resolve-XLFZK74A.js → deps-resolve-WQ6J6RLI.js} +1 -1
- package/dist/{design-chat-I7X3QDDY.js → design-chat-ZICGVYIH.js} +1 -1
- package/dist/design-committer-7YIPFKMO.js +2 -0
- package/dist/design-headless-HYWZIIDS.js +2 -0
- package/dist/{design-remote-UDC5FP45.js → design-remote-HPX4VZ63.js} +2 -2
- package/dist/device-env-4P4GUVBW.js +2 -0
- package/dist/dispatch-BV6XMCN3.js +2 -0
- package/dist/{doctor-UHFCIM4B.js → doctor-Z2YQ2DBX.js} +1 -1
- package/dist/{docx-convert-N4KMLLKO.js → docx-convert-DO5AQYD3.js} +1 -1
- package/dist/{dossier-6KMKEIXV.js → dossier-5XKNAK6Q.js} +1 -1
- package/dist/evidence-BJIID6VT.js +2 -0
- package/dist/evidence-presentation-LSFOZGLH.js +2 -0
- package/dist/evolve-cmd-GZCUSCEK.js +2 -0
- package/dist/evolve-remote-LILOAHYH.js +2 -0
- package/dist/{explain-cmd-R67B4YR3.js → explain-cmd-KNDORU2D.js} +1 -1
- package/dist/{explain-cmd-235TY7QX.js → explain-cmd-LXIVHGN7.js} +1 -1
- package/dist/explore-SA2P3SGX.js +2 -0
- package/dist/{explore-context-tty-YXEFT32U.js → explore-context-tty-PERKIWXD.js} +1 -1
- package/dist/{explore-entry-V6L5FSP4.js → explore-entry-E6EY3VV3.js} +4 -4
- package/dist/{explore-live-N5VBLBUI.js → explore-live-XIWWUV52.js} +1 -1
- package/dist/{explore-run-tty-ZZQ33GNA.js → explore-run-tty-M56I23IF.js} +2 -2
- package/dist/{extract-bind-BTINHHE5.js → extract-bind-LZ22VFKB.js} +3 -3
- package/dist/extract-chat-Z64LEAJ5.js +2 -0
- package/dist/{extract-cmd-45OZETCM.js → extract-cmd-46E2XDWZ.js} +2 -2
- package/dist/extract-headless-XLS56LMN.js +2 -0
- package/dist/{feeder-L55TH2NC.js → feeder-NGWIPZ26.js} +1 -1
- package/dist/folder-flags-ZIDJVDKX.js +2 -0
- package/dist/gaps-cmd-XYOBJVTO.js +3 -0
- package/dist/gate-AK44VDHC.js +2 -0
- package/dist/gate-NB5CJMTN.js +2 -0
- package/dist/{generate-headless-DAH3HHRQ.js → generate-headless-HXAVEAEZ.js} +2 -2
- package/dist/hold-passthrough-JGHWMYDM.js +2 -0
- package/dist/{impact-cmd-3VFJAKYK.js → impact-cmd-TJTUFAFO.js} +2 -2
- package/dist/index.js +4159 -190
- package/dist/ingest-ZHHHBUXR.js +2 -0
- package/dist/{ingest-cmd-YSEH5EPU.js → ingest-cmd-OJSKTSQK.js} +3 -3
- package/dist/ingest-remote-2WM6PYUW.js +2 -0
- package/dist/install-JBWBF3WX.js +2 -0
- package/dist/{interactive-bind-P3GTFIZM.js → interactive-bind-SOD7VTAY.js} +4 -4
- package/dist/{interactive-remote-PBRQHTAF.js → interactive-remote-7ZSTI66T.js} +1 -1
- package/dist/lane-CNGO7LH5.js +2 -0
- package/dist/lattice-auth-UQPFQSG7.js +2 -0
- package/dist/{lifecycle-cmd-PUNFWKV5.js → lifecycle-cmd-DGIO3VAO.js} +1 -1
- package/dist/{list-cmd-RD7YBF4S.js → list-cmd-HQIN3HX4.js} +1 -1
- package/dist/{list-commands-UZELZAB3.js → list-commands-OFRRBU3D.js} +1 -1
- package/dist/{list-remote-KGKXPCQA.js → list-remote-EFCET42K.js} +1 -1
- package/dist/{locks-cmd-LXZ6I4QG.js → locks-cmd-AZKCSGHI.js} +1 -1
- package/dist/{logical-ids-D5PFYY4C.js → logical-ids-74PLU3VR.js} +1 -1
- package/dist/login-flow-SYKXXDLH.js +2 -0
- package/dist/{maintenance-cmd-WRWBCP3R.js → maintenance-cmd-X5247RSJ.js} +1 -1
- package/dist/{mobile-prompts-Z7NQHRGP.js → mobile-prompts-I66ENBDW.js} +1 -1
- package/dist/{objective-variable-gate-3Z7DNVVC.js → objective-variable-gate-V5HHFOUS.js} +1 -1
- package/dist/{onboarding-ZP4XDYEO.js → onboarding-6HIP3KW6.js} +1 -1
- package/dist/open-provider-XDJKT3W3.js +2 -0
- package/dist/pdf-convert-YB6PJFMI.js +2 -0
- package/dist/persist-recorded-session-RSSMTVF3.js +3 -0
- package/dist/phase-seed-ZZSJME7M.js +2 -0
- package/dist/pipeline-NTJDH5TC.js +2 -0
- package/dist/{policy-commands-TY6WOR73.js → policy-commands-4PUGESCW.js} +1 -1
- package/dist/{prepare-target-EVL2QSXA.js → prepare-target-AI3GGZF6.js} +1 -1
- package/dist/{pull-cmd-QJQANBAW.js → pull-cmd-NRVB5ZN7.js} +1 -1
- package/dist/{pull-route-AIOTLA3D.js → pull-route-FWCZW76M.js} +1 -1
- package/dist/readmodel-TRV4E3MW.js +2 -0
- package/dist/real-device-run-NQ7RNH7C.js +2 -0
- package/dist/{reconcile-cmd-IJTQAJZX.js → reconcile-cmd-7B7THAFJ.js} +4 -4
- package/dist/reconcile-deps-UDQBWSLE.js +2 -0
- package/dist/{reconcile-remote-23D6SXXT.js → reconcile-remote-3W6ZTO3G.js} +2 -2
- package/dist/{recording-banner-MNRMMEX4.js → recording-banner-WVDTWTSE.js} +1 -1
- package/dist/registry-PFOSXOIH.js +2 -0
- package/dist/remote-entry-BZU4NFNS.js +2 -0
- package/dist/{remote-mode-AFNCN6EE.js → remote-mode-NXUKDUXG.js} +1 -1
- package/dist/{remote-words-RCNFI2TQ.js → remote-words-JRDDNOZ6.js} +1 -1
- package/dist/{require-project-folder-7UH43GHI.js → require-project-folder-3DTI2CVB.js} +1 -1
- package/dist/{resolve-run-intent-XEWFYMGN.js → resolve-run-intent-QCL7QXIB.js} +1 -1
- package/dist/{resolver-QMPX6RBR.js → resolver-CDF7QKVD.js} +1 -1
- package/dist/revert-QKHPCRT6.js +2 -0
- package/dist/{review-cmd-2OECKNL5.js → review-cmd-XBK3TGRE.js} +1 -1
- package/dist/run-CSYGVV3D.js +2 -0
- package/dist/run-YUHHD54J.js +2 -0
- package/dist/{run-channel-63SVP5OI.js → run-channel-IIIYXOIW.js} +1 -1
- package/dist/run-remote-SFR3F2T5.js +2 -0
- package/dist/{run-startup-gate-USQFSW47.js → run-startup-gate-QSFJRYUY.js} +1 -1
- package/dist/run-test-md-ZSREINDQ.js +20 -0
- package/dist/session-worker.js +2 -2
- package/dist/{sessions-CFV7FOIT.js → sessions-NH2EG7BP.js} +1 -1
- package/dist/{sessions-cmd-LQ2LZQOC.js → sessions-cmd-TLUITRG5.js} +2 -2
- package/dist/{sessions-remote-H7CQST42.js → sessions-remote-INO7AWKB.js} +1 -1
- package/dist/{skill-installer-LKYY6XFJ.js → skill-installer-7JH5QCJF.js} +1 -1
- package/dist/spawner-MQ4XEHIX.js +2 -0
- package/dist/{store-KM5MG3XB.js → store-X4UK4AP7.js} +1 -1
- package/dist/store-choice-27HDIFTU.js +2 -0
- package/dist/{store-guard-34GG2TW2.js → store-guard-ZXKB5DQH.js} +1 -1
- package/dist/{store-site-ZSFINU6C.js → store-site-K5NHLI7D.js} +1 -1
- package/dist/stream-warnings-GM7YEOVG.js +2 -0
- package/dist/sync-cmd-2PCO7LZA.js +2 -0
- package/dist/{sync-setup-QQXYO6R4.js → sync-setup-5WQO73Y5.js} +1 -1
- package/dist/tcg-generate-DGJD5KSM.js +2 -0
- package/dist/testmd-actions-XE2JPQHB.js +2 -0
- package/dist/{testmd-sync-PQ4GFKHB.js → testmd-sync-LYHEXWCT.js} +1 -1
- package/dist/{tms-client-XWCR7O7J.js → tms-client-J4OCD3EP.js} +1 -1
- package/dist/token-refresh-E4FTJVHY.js +2 -0
- package/dist/{trust-gate-AT2XBWN4.js → trust-gate-674C2NZS.js} +1 -1
- package/dist/{turn-preflight-LHYLRL7G.js → turn-preflight-R4PU6NYY.js} +1 -1
- package/dist/{use-case-ref-NA3IXGQW.js → use-case-ref-44BPIP4N.js} +1 -1
- package/dist/{validate-basic-3DX3MMC7.js → validate-basic-66XDPA3S.js} +1 -1
- package/dist/{variable-receipt-BXSZO36E.js → variable-receipt-7PRKDTRJ.js} +1 -1
- package/dist/verdicts-PVB7TV5S.js +2 -0
- package/dist/{version-check-OV6AOVED.js → version-check-SHNVYTMU.js} +1 -1
- package/dist/{view-cmd-QDKBBNIU.js → view-cmd-QOB3O6YW.js} +1 -1
- package/dist/{walk-session-BAYYPIKN.js → walk-session-WIEROYOT.js} +1 -1
- package/dist/with-telemetry-T2PWI5CY.js +2 -0
- package/package.json +16 -16
- package/dist/ChatSurface-XUV3EQPZ.js +0 -2
- package/dist/EvidenceViewOffer-EIANIYN7.js +0 -2
- package/dist/FolderPicker-XOA7FTHF.js +0 -2
- package/dist/InfoBox-OBH7SUGC.js +0 -2
- package/dist/ProjectPicker-6KRLKV4U.js +0 -2
- package/dist/SaveSessionPrompt-J2OPDEOO.js +0 -2
- package/dist/SingleShotApp-QI4B2TSL.js +0 -2
- package/dist/TestMdRunView-I4MV54FB.js +0 -2
- package/dist/TestrunEvidenceTable-WEIUSW3E.js +0 -2
- package/dist/bridge-SDEP7Y33.js +0 -2
- package/dist/chat-committer-FM5NG46O.js +0 -2
- package/dist/chat-controller-FWFQVZTB.js +0 -2
- package/dist/child-H2YSDFCG.js +0 -2
- package/dist/chunk-2EVP636F.js +0 -26
- package/dist/chunk-34R7BNZ2.js +0 -2
- package/dist/chunk-5T6II7VN.js +0 -7
- package/dist/chunk-6K5BEEAJ.js +0 -2
- package/dist/chunk-HMQ5M4JJ.js +0 -34
- package/dist/chunk-KF4DKXSS.js +0 -2
- package/dist/chunk-NOFJXCYP.js +0 -5
- package/dist/chunk-SB6P5EQH.js +0 -2
- package/dist/chunk-Y6Y6RAY4.js +0 -2
- package/dist/commands-QOORPTSI.js +0 -2
- package/dist/cover-cmd-3VO6QC5Y.js +0 -2
- package/dist/design-committer-Y7R56RFZ.js +0 -2
- package/dist/design-headless-HUQOXLZB.js +0 -2
- package/dist/device-env-MMGISNHN.js +0 -2
- package/dist/dispatch-P2445PUU.js +0 -2
- package/dist/evidence-M3JTOJNL.js +0 -2
- package/dist/evidence-presentation-DV3DRB4S.js +0 -2
- package/dist/evolve-cmd-K3JXACMN.js +0 -2
- package/dist/evolve-remote-CUDVV2O2.js +0 -2
- package/dist/explore-UDD5FHXW.js +0 -2
- package/dist/extract-chat-ABZ5S7UU.js +0 -2
- package/dist/extract-headless-ALEFAMVS.js +0 -2
- package/dist/folder-flags-HTKJCXKB.js +0 -2
- package/dist/gaps-cmd-ROGQWK5X.js +0 -3
- package/dist/gate-QA5J7UZA.js +0 -2
- package/dist/gate-XFFFX5ZF.js +0 -2
- package/dist/hold-passthrough-K5PP26CP.js +0 -2
- package/dist/ingest-S5R736ZV.js +0 -2
- package/dist/ingest-remote-C6AP2Q7E.js +0 -2
- package/dist/install-B26Y2NU4.js +0 -2
- package/dist/lane-7IEAE6AC.js +0 -2
- package/dist/lattice-auth-7EL4ET3P.js +0 -2
- package/dist/login-flow-CHLGQGHK.js +0 -2
- package/dist/open-provider-U26BBVUE.js +0 -2
- package/dist/pdf-convert-LMKOKLXT.js +0 -2
- package/dist/persist-recorded-session-4IRYG5CJ.js +0 -3
- package/dist/phase-seed-2H6OXZXT.js +0 -2
- package/dist/pipeline-U7D25NST.js +0 -2
- package/dist/readmodel-KXCFPL2M.js +0 -2
- package/dist/real-device-run-QODMDUXF.js +0 -2
- package/dist/reconcile-deps-2CTIFXDR.js +0 -2
- package/dist/registry-MZYBLEW2.js +0 -2
- package/dist/remote-entry-DW2J56N4.js +0 -2
- package/dist/revert-37346WLE.js +0 -2
- package/dist/run-JWOHNWA3.js +0 -2
- package/dist/run-QFJ6ZRVD.js +0 -2
- package/dist/run-remote-66QTUQ2M.js +0 -2
- package/dist/run-test-md-7DRWCSQE.js +0 -19
- package/dist/spawner-C7NLLM4F.js +0 -2
- package/dist/store-choice-4J2NN6OQ.js +0 -2
- package/dist/stream-warnings-N4KVVWXV.js +0 -2
- package/dist/sync-cmd-3CHSWWWW.js +0 -2
- package/dist/tcg-generate-IPD5FQUW.js +0 -2
- package/dist/testmd-actions-V7P7BMKE.js +0 -2
- package/dist/token-refresh-LR33BKAB.js +0 -2
- package/dist/verdicts-7GKZEDHV.js +0 -2
- package/dist/with-telemetry-62LW4VFI.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as O}from"./chunk-QSCXXNC2.js";import{a as k,b as P}from"./chunk-6PIIUAZF.js";import{b as A}from"./chunk-VO66KP2W.js";import{n as L}from"./chunk-
|
|
2
|
+
import{a as O}from"./chunk-QSCXXNC2.js";import{a as k,b as P}from"./chunk-6PIIUAZF.js";import{b as A}from"./chunk-VO66KP2W.js";import{n as L}from"./chunk-G4K3TP2I.js";import{a as b,b as R,c as x,d as y,e as T,g as I,h as f}from"./chunk-UJLULWSR.js";import{d as w,g as p}from"./chunk-ZCRZFAOT.js";import{a as v}from"./chunk-RZ4F3BHX.js";import{a as m,i as S}from"./chunk-J4FIESTB.js";var h=class{config;buffer=[];stepBuffer=new Map;flushTimer=null;currentRunIndex=null;stopped=!1;_inFlightFlush=null;_stoppingFast=!1;_droppedBatches=0;_droppedEntries=0;constructor(e){this.config=e}start(){if(this.flushTimer)return;let e=this.config.flushIntervalMs??5e3;this.flushTimer=setInterval(()=>{this.flush().catch(()=>{})},e),this.flushTimer.unref&&this.flushTimer.unref()}setRunIndex(e){this.currentRunIndex=e}log(e,t,n,s={}){if(this.stopped)return;let o=this.buildEntry(e,t,n,s);this.buffer.push(o)}logStep(e,t,n,s={}){if(this.stopped)return;let o=this.buildEntry("debug",t,n,s);o.run_index=e,this.stepBuffer.has(e)||this.stepBuffer.set(e,[]),this.stepBuffer.get(e).push(o)}escalate(e){let t=this.stepBuffer.get(e);t&&t.length>0&&this.buffer.push(...t),this.stepBuffer.delete(e)}discardSteps(e){this.stepBuffer.delete(e)}async flush(){if(this.buffer.length===0)return;let e=this._flushBody();this._inFlightFlush=e;try{await e}finally{this._inFlightFlush===e&&(this._inFlightFlush=null)}}async _flushBody(){let e=this.buffer.splice(0),t=null;try{t=await this.config.getToken()}catch{this.buffer.unshift(...e);return}let n={"Content-Type":"application/json"};t&&(n.Authorization=`Bearer ${t}`);let s=JSON.stringify(e);for(let o=0;o<3;o++){try{let l=new AbortController,a=setTimeout(()=>l.abort(),1e4),c=await v(this.config.proxyUrl,{method:"POST",headers:n,body:s,signal:l.signal});if(clearTimeout(a),c.ok)return}catch{}if(this._stoppingFast){this.buffer.unshift(...e);return}o<2&&await new Promise(l=>setTimeout(l,1e3*Math.pow(2,o)))}this._droppedBatches++,this._droppedEntries+=e.length}async flushOnce(e){if(this.buffer.length===0)return"empty";let t=this.buffer.splice(0),n=Date.now()+e,s=!1,o,l=null;try{l=await Promise.race([this.config.getToken(),new Promise(d=>{o=setTimeout(()=>{s=!0,d(null)},e),o.unref&&o.unref()})])}catch{l=null}finally{o&&clearTimeout(o)}let a=n-Date.now();if(s||a<=0)return this.buffer.unshift(...t),"timeout";let c={"Content-Type":"application/json"};l&&(c.Authorization=`Bearer ${l}`);try{let d=new AbortController,u=setTimeout(()=>d.abort(),a);u.unref&&u.unref();let r=await v(this.config.proxyUrl,{method:"POST",headers:c,body:JSON.stringify(t),signal:d.signal});return clearTimeout(u),r.ok?"sent":(this.buffer.unshift(...t),"failed")}catch{return this.buffer.unshift(...t),Date.now()>=n?"timeout":"failed"}}async stopAndFlushOnce(e){let t=Date.now()+e;this._stoppingFast=!0,this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null);let n=this._inFlightFlush;if(n){let o;await Promise.race([n.catch(()=>{}),new Promise(l=>{o=setTimeout(l,e),o.unref&&o.unref()})]),o&&clearTimeout(o)}if(this.buffer.length===0)return"empty";let s=t-Date.now();if(s<=0)return"timeout";try{return await this.flushOnce(s)}catch{return"failed"}}drainBuffer(){return this.buffer.splice(0)}get droppedBatches(){return this._droppedBatches}get droppedEntries(){return this._droppedEntries}async shutdown(){this._droppedBatches>0&&this.log("warn","LOG_DROPS",`Dropped ${this._droppedEntries} entries in ${this._droppedBatches} batches`,{dropped_batches:this._droppedBatches,dropped_entries:this._droppedEntries}),this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null),await this.flush()}shutdownSync(){this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null)}get bufferSize(){return this.buffer.length}stepBufferSize(e){return this.stepBuffer.get(e)?.length??0}buildEntry(e,t,n,s){return{hostname:"kane-cli",service:"kane-cli",ddsource:"kane-cli",ddtags:`version:${this.config.device.cli_version}`,level:e,event:t,message:n,session_id:this.config.sessionId,run_index:t.startsWith("tcg_")?null:this.currentRunIndex,identity:this.config.identity,device:this.config.device,context:s,timestamp:new Date().toISOString()}}};import{platform as $,arch as V}from"os";import M from"fs";import B from"fs";import U from"path";var F=1e3,_=0,j=new Set([130,3]),g=class i{ids;logger;opts;ended=!1;createdAt=Date.now();errorState;constructor(e,t={emitted:!1}){this.ids=e.envelope,this.logger=e.logger,this.opts=e,this.errorState=t}get enabled(){return this.logger!==null}event(e,t={}){if(!this.logger)return;e==="ASR_ERROR"&&(this.errorState.emitted=!0);let n=y(this.ids,e,t);this.logger.log(x[e],e,e,C(n))}error(e,t={}){this.logger&&(this.logger.escalate(_),this.event("ASR_ERROR",{...t,error_code:e}))}child(e,t){return new i({...this.opts,envelope:{...this.ids,operation_id:t,parent_operation_id:this.ids.operation_id,verb:"design"}},this.errorState)}async lateBindContext(e){if(!(!this.logger||this.ids.context_instance_id))try{let{ensureStoreIds:t}=await import("./store-id-YZ5WKJ25.js"),{ids:n,cloned:s}=t(e,p());this.ids.context_lineage_id=n.context_lineage_id,this.ids.context_instance_id=n.context_instance_id,s&&this.event("ASR_CONTEXT_CLONED")}catch{}}spoolError(e,t={}){this.logger&&(this.event("ASR_ERROR",{...t,error_code:e}),T(this.logger.drainBuffer()))}agentSession(e){this.ids.agent_session_id=e}spawnEnv(){if(!this.opts.telemetryEnabled)return{};let e={TESTMUAI_USER_SESSION_ID:this.ids.session_id,TESTMUAI_OPERATION_ID:this.ids.operation_id,TESTMUAI_CLIENT_VERSION:this.opts.clientVersion,TESTMUAI_TELEMETRY_PROXY_URL:this.opts.proxyUrl};return this.ids.context_instance_id&&(e.TESTMUAI_CONTEXT_INSTANCE_ID=this.ids.context_instance_id),e}traceTee(){return e=>{if(!this.logger)return;let t=typeof e.kind=="string"?e.kind.slice(0,64):"trace",n={...C(y(this.ids,"ASR_CMD_START",{})),trace_kind:t};typeof e.code=="string"&&(n.trace_code=e.code.slice(0,64)),delete n.event,this.logger.logStep(_,`trace_${t}`,t,n)}}wireTrace(e,t,n){if(!this.logger)return;n&&this.agentSession(n);let s=t&&typeof t=="object"?t:{};switch(e){case"spawn":this.event("ASR_AGENT_SPAWN",{tier:s.tier});break;case"session_paused":this.event("ASR_SESSION_PAUSED",s);break;case"commit":this.event("ASR_COMMIT",s);break;case"design_phase_committed":this.event("ASR_COMMIT",{phase:s.phase,duration_ms:s.ms});break;default:this.traceTee()({kind:e,code:typeof s.code=="string"?s.code:void 0})}}banner(){return`session: ${this.ids.session_id}`}supportFooter(){return`if this keeps failing, share this id with support: ${this.ids.session_id}`}async end(e){if(!this.ended){if(this.ended=!0,e.duration_ms===void 0&&(e={...e,duration_ms:Date.now()-this.createdAt}),this.logger)if(e.exit_code===0?this.logger.discardSteps(_):this.logger.escalate(_),e.exit_code>0&&!j.has(e.exit_code)&&!this.errorState.emitted&&this.event("ASR_ERROR",{error_code:e.exit_code===2?"usage_exit_unattributed":`exit_${e.exit_code}_unattributed`,exit_code:e.exit_code}),this.event("ASR_CMD_END",e),this.opts.longSession)await this.logger.shutdown();else{let t=await this.logger.flushOnce(F);(t==="failed"||t==="timeout")&&T(this.logger.drainBuffer())}this.logger&&this.writeManifestLine(e.exit_code),f(null)}}writeManifestLine(e){try{let t=w(this.ids.context_instance_id??null);B.mkdirSync(U.dirname(t),{recursive:!0});let n={ts:new Date().toISOString(),session_id:this.ids.session_id,operation_id:this.ids.operation_id,agent_session_id:this.ids.agent_session_id,verb:this.ids.verb,mode:this.ids.mode,exit_code:e};B.appendFileSync(t,JSON.stringify(n)+`
|
|
3
3
|
`,{flag:"a",mode:384})}catch{}}};function C(i){let e={event:i.event,session_id:i.session_id,operation_id:i.operation_id,verb:i.verb,mode:i.mode,component:i.component,seq:i.seq,context_lineage_id:i.context_lineage_id,context_instance_id:i.context_instance_id};i.parent_operation_id&&(e.parent_operation_id=i.parent_operation_id),i.agent_session_id&&(e.agent_session_id=i.agent_session_id),i.lattice_session_id&&(e.lattice_session_id=i.lattice_session_id),i.project_id&&(e.project_id=i.project_id);for(let[t,n]of Object.entries(i.context))e[t]=n;return e}import{isMainThread as X}from"worker_threads";var E=()=>process.env.KANE_TELEMETRY_URL||S;function Y(){return process.env.TESTMUAI_BASE_URL?"custom":process.env.TESTMUAI_ENV==="stage"?"stage":"prod"}function z(){return process.env.KANE_TELEMETRY!=="0"&&(!process.env.VITEST||process.env.KANE_TELEMETRY==="1")}function me(i){let e=z(),t=i.env??Y(),n=i.sessionId??null;if(!n&&i.resumeSid&&i.contextRoot)try{let r=L(i.contextRoot,i.resumeSid);r?.user_session_id&&(n=r.user_session_id)}catch{}if(!n&&i.applyPlanPath)try{let r=JSON.parse(M.readFileSync(i.applyPlanPath,"utf8"));r.telemetry?.user_session_id&&(n=r.telemetry.user_session_id)}catch{}let s=i.sessionId===void 0?n!==null:i.resumeSid!==void 0;n||(n=b());let o=null,l=null,a=!1;if(i.contextRoot&&M.existsSync(i.contextRoot))if(i.write&&e){let r=P(i.contextRoot,p());o=r.ids.context_lineage_id,l=r.ids.context_instance_id,a=r.cloned}else{let r=k(i.contextRoot);o=r?.context_lineage_id??null,l=r?.context_instance_id??null}let c={session_id:n,operation_id:R(),context_lineage_id:o,context_instance_id:l,...i.remote?{lattice_session_id:i.remote.sessionId,project_id:i.remote.projectId}:{},verb:i.verb,mode:i.mode,component:"kane-cli"},d=null;if(e){let r=A(t),N={org_id:r.org_id??"",user_id:r.user_id??"",machine_id:r.machine_id,email:null,email_domain:"",user_type:r.user_type??"unknown",env:r.env,plan:r.plan??"unknown"},D=i.mode==="interactive"||i.mode==="cli"?"cli":"agent";d=new h({proxyUrl:E(),sessionId:n,identity:N,device:{cli_version:m,platform:$(),arch:V(),host_agent:O(),invocation_mode:D},getToken:async()=>null}),i.longSession&&d.start()}let u=new g({envelope:c,logger:d,longSession:!!i.longSession,proxyUrl:E(),clientVersion:`kane-cli/${m}`,telemetryEnabled:e});return e&&!i.errorsOnly&&(f(c),u.event("ASR_CMD_START",{resumed:s,applied_plan:!!i.applyPlanPath}),a&&u.event("ASR_CONTEXT_CLONED"),X&&I(E()).catch(()=>{})),u}export{h as a,F as b,E as c,Y as d,z as e,me as f};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as G,f as K,h as j}from"./chunk-
|
|
2
|
+
import{d as G,f as K,h as j}from"./chunk-2TK4MDF2.js";import{a as q,b as z,d as V,e as H}from"./chunk-KL7XFNSD.js";import{a as J,b as y,c as Q}from"./chunk-LPJKNX6D.js";import{a as N,b as L,c as O}from"./chunk-RNHSULQM.js";import{d as B,f as $}from"./chunk-C4KAPGBS.js";import{a as E}from"./chunk-MMBBQ4OZ.js";import{b as R,c as I,j as U}from"./chunk-NRAPCFI2.js";import{a as F}from"./chunk-TZXXJWHA.js";import{e as S}from"./chunk-Z7S3IWUX.js";import{n as h}from"./chunk-UJLULWSR.js";import{b as _,r as C,s as P}from"./chunk-A7RJQJNT.js";function W(e){return e.kind==="simulator"?e.id:e.virtualName??e.id}function X(e,r,o={}){let t={platform:e.platform,udid:e.id,target:e.kind};return r&&(t.app_package=r),o.noReset!==void 0&&(t.no_reset=o.noReset),o.appiumUrl&&(t.appium_url=o.appiumUrl),e.platform==="android"&&o.autoGrantPermissions!==void 0&&(t.auto_grant_permissions=o.autoGrantPermissions),e.platform==="ios"&&o.autoAcceptAlerts!==void 0&&(t.auto_accept_alerts=o.autoAcceptAlerts),t}function Y(e=process.env){let r=e.KANE_APPIUM_URL?.trim();return r||null}function m(e){return`${e.platform}|${W(e)}`}var g=new Map,Z=new Set;function ee(e){return Z.has(m(e))}function ye(e,r,o){r.state==="stopped"&&(g.has(m(r))||oe(e,r,o))}async function re(e,r,o){let t=g.get(m(r));return t?(o?.(`waiting for ${r.displayName} to finish booting\u2026`),t):oe(e,r,o)}function oe(e,r,o){let t=m(r),a=e.prepare(r,o);g.set(t,a),r.state==="stopped"&&a.then(()=>Z.add(t),()=>{});let n=()=>{g.get(t)===a&&g.delete(t)};return a.then(n,n),a.catch(()=>{}),a}import{basename as le}from"path";import{spawnSync as pe}from"child_process";async function de(e,r,o){if(!e.teardownPlan||!o.appPackage&&!o.shutdown)return;let t;try{t=await e.teardownPlan(r,o)}catch{return}t.length!==0&&h(`device:${r.id}`,()=>{G({udid:r.id,displayName:r.displayName});for(let a of t)try{pe(a.file,a.args,{timeout:3e4,stdio:"ignore"})}catch{}})}var te={emulator:[".apk"],simulator:[".zip"]};async function ce(e,r,o,t){if(e.kind==="package")return e;if(e.kind==="app_id"){let a=r.cloudUpload;if(!a)throw new Error(`${e.value} is an app id, which needs an account to download it. Log in, or pass a path to a local build instead.`);let n=await Q({appId:e.value,baseUrl:a.baseUrl,auth:a.auth,...te[o]?{accepts:te[o]}:{},...t?{onProgress:t}:{}}),s=x(n.path);if(!s||s.kind==="app_id")throw new Error(`${n.name} is not a build this CLI can install (from ${e.value}).`);return s}try{let a=new q,n=await V(e.value,a),s=new J;await s.find(n)||t?.(`copying ${le(e.value)} into the local app store\u2026`);let i=await s.put({key:n,sourcePath:e.value,source:"local"});return{...e,value:i.path}}catch{return e}}function ue(e){h(`appium:${e}`,()=>{j({deviceClass:e,owner:process.pid})})}var k=class extends Error{constructor(r){super(r),this.name="MobileHostUnsupportedError"}},v=class extends Error{constructor(o,t){super(o);this.doctorText=t;this.name="MobilePreflightError"}};async function ge(e,r,o){let t=o.cloudUpload,a=await H({path:e,type:r,env:t.env,orgId:t.orgId,userId:t.userId,auth:t.auth,baseUrl:t.baseUrl,...o.onProgress?{onProgress:o.onProgress}:{}});if(z(a)){o.onProgress?.(`app not uploaded \u2014 ${a.reason}`);return}return a.appId}var fe="app must be a build (.apk for an emulator, .zip of the .app bundle for a simulator) or an app id from your cloud uploads \u2014 a package id names something already installed on one device, so it cannot be uploaded, exported as code, or run anywhere else.",ae=C(_);function x(e){let r=e.trim();if(y(r))return{kind:"app_id",value:r};let o=P(r,ae);return o?{kind:o.slice(1),value:r}:null}function me(e){return!!e&&(P(e,ae)!==void 0||y(e.trim()))}function ve(e){return e.filter(r=>r.required&&r.status==="fail")}function be(e,r){return!!r&&S(e,r)}async function Ke(e){let r=F();if(!r.supported)throw new k(r.reason);let o=Y()??e.appiumUrl??e.defaults?.appium_url,t=!!(e.agent||!e.interactive),a=U(),n=!!E();t&&e.platform?.toLowerCase()!=="ios"&&!n&&((await a.status("emulator")).installed||await a.ensure("emulator",{automatic:!0,onProgress:e.onProgress}));let s=await N(e.platform,{appiumUrl:o});if(O(s)){let l=s.sections.flatMap(w=>ve(w.checks)).map(w=>w.label).join(", ");throw new v(`Mobile toolchain not ready (${l}). Run \`kane-cli doctor --target ${e.platform?.toLowerCase()==="ios"?"simulator":e.platform?.toLowerCase()==="android"?"emulator":"<emulator|simulator>"}\` for details.`,L(s))}let p=await $({device:e.device,platform:e.platform,defaultTarget:e.defaults?.default_target,interactive:e.interactive}),i;if(p.ok)i=p.target;else if(p.reason==="needs-picker"&&e.pickTarget){let l=await e.pickTarget(p.candidates);if(!l)throw new Error("Target selection cancelled");i=l}else throw new Error(p.message);let u=B(i.platform);if(!u)throw new Error(`No provider for platform "${i.platform}"`);let d=R(i);if(!d)throw new Error(`No managed dependencies serve ${i.platform} ${i.kind} targets yet.`);if(!(n&&i.platform.toLowerCase()==="android"))try{await a.ensure(d,{automatic:t,onProgress:e.onProgress})}catch(l){throw l instanceof I?new v(l.message,l.message):l}let ie=i.state!=="ready"||ee(i);i=await re(u,i,e.onProgress);let ne=await K(d,{...o?{appiumUrl:o}:{},device:{udid:i.id,displayName:i.displayName},onProgress:e.onProgress});ue(d);let D=be(i,e.defaults?.default_target)?e.defaults?.default_app:void 0,f=e.app??(me(D)?D:void 0);if(e.app&&!x(e.app))throw new Error(`${e.app}: ${fe}`);let c=f?x(f):null,M=c?await ce(c,e,d,e.onProgress):null,b=M?await u.ensureApp(i,M,e.onProgress):void 0,T=c?.kind==="app_id"?c.value:e.cloudUpload&&c&&f?await ge(c.value,d,e):void 0;await de(u,i,{shutdown:ie,...b?{appPackage:b}:{}});let se=X(i,b,{noReset:e.noReset??e.defaults?.no_reset,appiumUrl:ne.url,autoGrantPermissions:e.defaults?.auto_grant_permissions,autoAcceptAlerts:e.defaults?.auto_accept_alerts}),A=T??f;return{device:se,target:i,provider:u,...T?{appId:T}:{},...A?{appRef:A}:{}}}export{W as a,X as b,ye as c,re as d,k as e,v as f,fe as g,x as h,me as i,Ke as j};
|
|
@@ -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-PCQK62MP.js";import{a as C}from"./chunk-TM45NPWL.js";import{r as m,s as u,t as f,u as x,v as y}from"./chunk-J4FIESTB.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">
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as B}from"./chunk-3UHPVQLU.js";import{a as N}from"./chunk-CJQUVHHS.js";import{a as ie,b as ae,c as ce}from"./chunk-W3USRQX6.js";import{b as oe}from"./chunk-QQI6N3FO.js";import{a as H}from"./chunk-BY2B4YJN.js";import{d as le}from"./chunk-4JWJH6TB.js";import{a as $,b as X,e as M,g as se}from"./chunk-77ZZQJLX.js";import{b as L}from"./chunk-2PZKMT3I.js";import{a as te}from"./chunk-X3J4CC27.js";import{a as ee}from"./chunk-FCD3NYOM.js";import{a as re,b as ne}from"./chunk-B7ZX5HEN.js";import{a as j}from"./chunk-PVN64537.js";import{a as K}from"./chunk-GGV336P5.js";import{a as A}from"./chunk-RZ4F3BHX.js";import{a as O}from"./chunk-VZA7BPCK.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{z as y}from"./chunk-QMOGBKJM.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}.
|
|
2
|
+
import{a as B}from"./chunk-Y2HQMJGS.js";import{a as N}from"./chunk-Q4SMITTV.js";import{a as ie,b as ae,c as ce}from"./chunk-W3USRQX6.js";import{b as oe}from"./chunk-3RO2YGKH.js";import{a as H}from"./chunk-QEM5ZRDN.js";import{d as le}from"./chunk-DC5F2ADJ.js";import{a as $,b as X,e as M,g as se}from"./chunk-77ZZQJLX.js";import{b as L}from"./chunk-LV7224DG.js";import{a as te}from"./chunk-LXK4B2FE.js";import{a as ee}from"./chunk-FCD3NYOM.js";import{a as re,b as ne}from"./chunk-B7ZX5HEN.js";import{a as j}from"./chunk-PVN64537.js";import{a as K}from"./chunk-ZCBOHWN3.js";import{a as A}from"./chunk-RZ4F3BHX.js";import{a as O}from"./chunk-TM45NPWL.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{z as y}from"./chunk-J4FIESTB.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
3
|
Switch profiles with \`kane-cli profiles switch\` to act on it.
|
|
4
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
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
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-
|
|
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-ZSREINDQ.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
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
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
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.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as h}from"./chunk-
|
|
2
|
+
import{a as h}from"./chunk-YCVEI7BT.js";import{a as A}from"./chunk-HCBYKLMW.js";import{a as c,b as f,i as P}from"./chunk-33DWJV67.js";import{a as B}from"./chunk-6YGTRKDT.js";import{z as l}from"./chunk-J4FIESTB.js";import{e as x}from"./chunk-UR6MHSHU.js";var L=x(B(),1);var n=x(A(),1);function S(r,d,s,u,m){let p=s==="basic"&&u?`basic (${u})`:s,i=20,a=`${r} [${d}]`,g="\xB7".repeat(Math.max(2,i-a.length+3));return{label:`${a} ${g} ${p}`,profile:r,env:d,isActive:m}}function M({creds:r,onSwitch:d,onCancel:s}){let u=r.listProfiles(),m=r.getActiveProfile(),p=r.getDefaultEnv(),i=u.map(e=>{let o=r.loadBasicAuth(e.profile,e.env),t=r.loadCredentials(e.profile,e.env)!==null,v=o?"basic":t?"oauth":"none",b=o?o.username:null,w=e.profile===m&&e.env===p;return S(e.profile,e.env,v,b,w)}),[a,g]=(0,L.useState)(()=>{let e=i.findIndex(o=>o.isActive);return e>=0?e:0});return P((e,o)=>{if(o.escape){s();return}if(o.upArrow){g(t=>Math.max(0,t-1));return}if(o.downArrow){g(t=>Math.min(i.length-1,t+1));return}if(o.return&&i[a]){let t=i[a];t.isActive||d(t.profile,t.env),s();return}}),i.length===0?(0,n.jsxs)(c,{flexDirection:"column",borderStyle:"round",borderColor:l.orange,paddingX:2,paddingY:1,children:[(0,n.jsx)(f,{color:l.orange,bold:!0,children:"Profiles"}),(0,n.jsx)(c,{marginTop:1,children:(0,n.jsx)(f,{color:l.dim,children:"No profiles \u2014 use Login to create one"})}),(0,n.jsx)(h,{bindings:[],escBackLabel:"back"})]}):(0,n.jsxs)(c,{flexDirection:"column",borderStyle:"round",borderColor:l.orange,paddingX:2,paddingY:1,children:[(0,n.jsx)(f,{color:l.orange,bold:!0,children:"Profiles"}),(0,n.jsx)(c,{flexDirection:"column",marginTop:1,children:i.map((e,o)=>{let t=o===a,v=t?"\u276F ":" ",b=e.isActive?l.green:t?l.orange:void 0;return(0,n.jsxs)(f,{color:b,children:[v,e.label,e.isActive?" \u25CF active":""]},`${e.profile}-${e.env}`)})}),(0,n.jsx)(h,{bindings:[{keys:"\u2191\u2193",label:"navigate"},{keys:"\u21B5",label:"switch"}],escBackLabel:"back"})]})}export{S as a,M as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as f,c as j}from"./chunk-VE3SUJMA.js";import{e as g}from"./chunk-
|
|
2
|
+
import{b as f,c as j}from"./chunk-VE3SUJMA.js";import{e as g}from"./chunk-SB26HQO7.js";import{a as m}from"./chunk-ZCBOHWN3.js";var _="KaneAI Generated",E="Untitled";async function p(e){let r=e.config.load(),d=new g(m(e.env).tmsBaseUrl,e.tmsCreds.username,e.tmsCreds.access_key),n=e.projectName??_,o=e.folderName??E,t=r.project_id??null,s=r.project_name??null;if(!t){let a=(await d.listProjects()).find(l=>l.name===n);if(a)t=a.project_id,s=a.name,e.log("info","ENSURE_PROJECT_FOUND","Found default project",{project_id:t,name:s});else{let l=await d.createProject(n);t=l.id,s=l.name,e.log("info","ENSURE_PROJECT_CREATED","Created default project",{project_id:t,name:s})}f(e.creds,e.config,e.profile,e.env,{projectId:t,projectName:s})}let c=r.folder_id??null,i=r.folder_name??null,u=!r.project_id;if(!c||u){let a=(await d.listFolders(t)).find(l=>l.name===o);if(a)c=a.id,i=a.name,e.log("info","ENSURE_FOLDER_FOUND","Found default folder",{folder_id:c,name:i});else{let l=await d.createFolder(t,o);c=l.id,i=l.name,e.log("info","ENSURE_FOLDER_CREATED","Created default folder",{folder_id:c,name:i})}f(e.creds,e.config,e.profile,e.env,{folderId:c,folderName:i})}return{projectId:t,projectName:s??n,folderId:c,folderName:i??o}}function A(e,r,d){let n=e.loadProfileConfig(r,d)??{};return{projectId:n.project_id??null,folderId:n.folder_id??null}}function N(e,r){return e.projectId===null||e.folderId===null||r===null?"needs-picker":r.project==="ok"&&r.folder==="ok"?"ok":r.project==="error"&&r.folder==="error"?"ok-tms-degraded":"needs-picker"}var k=(e,r)=>`error: profile "${e}" (${r}) has no project/folder configured AND no TMS credentials were available to auto-configure one.
|
|
3
3
|
|
|
4
4
|
discover IDs:
|
|
5
5
|
kane-cli projects list --search "<keyword>" --limit 10
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as h}from"./chunk-72KYMWQ5.js";import{a as
|
|
2
|
+
import{a as h}from"./chunk-72KYMWQ5.js";import{a as m}from"./chunk-CCOD4GQJ.js";import{a as d}from"./chunk-JQ64X2TO.js";import{a as p}from"./chunk-3G2LSTK5.js";import{a as V}from"./chunk-4IEQNX7F.js";import{a as y}from"./chunk-ZCBOHWN3.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
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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as $e,b as we,g as Ee}from"./chunk-
|
|
2
|
+
import{a as $e,b as we,g as Ee}from"./chunk-4KL3TSTT.js";import{a as te}from"./chunk-SMGRXKXX.js";import{a as G}from"./chunk-5Y2G4NC7.js";import{b as ye}from"./chunk-WN5VKKJ3.js";import{a as Be}from"./chunk-YVVFXBT5.js";import{a as Te}from"./chunk-ND6OP3O2.js";import{a as E}from"./chunk-HCBYKLMW.js";import{a as s,b as o,i as Se,j as ve,k as ee}from"./chunk-33DWJV67.js";import{a as z}from"./chunk-6YGTRKDT.js";import{z as i}from"./chunk-J4FIESTB.js";import{e as R}from"./chunk-UR6MHSHU.js";var M=R(z(),1);var I=R(z(),1);function de(e){let t=e.flatMap(u=>[u,...u.children??[]]),n=t.filter(u=>u.status==="passed").length,l=t.filter(u=>u.status==="failed").length,a=t.filter(u=>u.status==="passed"||u.status==="failed").length;return{passed:n,failed:l,total:a}}function ke(e){let t=Ee(e.screenshotDispatcher,e.stepLogger,e.onReasoning,e.onStepComplete),[n,l]=(0,I.useState)(0),[a,u]=(0,I.useState)("idle"),c=(0,I.useRef)("idle"),B=(0,I.useRef)(0),S=(0,I.useRef)(!1),v=(0,I.useRef)(null),d=(0,I.useRef)(null),O=(0,I.useCallback)(m=>{c.current=m,u(m)},[]),P=(0,I.useCallback)(async m=>{e.reportVerdictOnComplete&&await t.shutdownRunner($e(e.runVerdict?.()??(m?"failed":"passed"))),e.onAllComplete?.()},[t,e]),T=(0,I.useCallback)(async m=>{let b=await e.getNextConfig(m);if(!b){O("done"),await P(!1);return}let C=m?B.current+1:0;B.current=C,l(C),e.onStepStart?.(b,C),v.current=null,d.current=null,O("running"),await t.startRun(b,e.spawnOpts)},[t,e,O]);(0,I.useEffect)(()=>{S.current||(S.current=!0,T(null))},[]),(0,I.useEffect)(()=>{if(!t.lastRunEnd||t.lastRunEnd===v.current||c.current!=="running")return;v.current=t.lastRunEnd,c.current="transitioning",u("transitioning");let m=t.lastRunEnd,b=de(t.steps),C=t.bifurcationInfo,A={status:m.status==="passed"?"passed":"failed",duration_s:m.duration??0,reason:m.reason,runEnd:m,hadError:!1,stepsPassed:b.passed,stepsFailed:b.failed,stepsTotal:b.total,bifurcationFlows:C&&!C.isSingleFlow?C.flows:null,evidence:t.getEvidenceState()};if(!(e.onStepEnd?.(A,B.current)??!0)){O("done"),P(A.status==="failed");return}T(A)},[t.lastRunEnd]),(0,I.useEffect)(()=>{if(!t.runError||t.runError===d.current||t.lastRunEnd||c.current!=="running")return;d.current=t.runError,c.current="transitioning",u("transitioning");let m=de(t.steps),b={status:"failed",duration_s:0,reason:t.runError,runEnd:null,hadError:!0,stepsPassed:m.passed,stepsFailed:m.failed,stepsTotal:m.total,bifurcationFlows:null,evidence:t.getEvidenceState()};if(!(e.onStepEnd?.(b,B.current)??!0)){O("done"),P(!0);return}T(b)},[t.runError,t.lastRunEnd]);let k=(0,I.useCallback)(()=>{t.cancelRun()},[t]);return{runner:t,currentStepIndex:n,phase:a,cancel:k}}var pe=R(z(),1);var ne=R(E(),1),Ce=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function Le({label:e,hasBifurcation:t=!1}){let[n,l]=(0,pe.useState)(0),[a,u]=(0,pe.useState)(0);G(()=>{l(B=>(B+1)%Ce.length)},80),G(()=>{u(B=>(B+1)%4)},400);let c=e??(t?"Planning approach":"Analyzing objective");return(0,ne.jsxs)(s,{marginLeft:1,children:[(0,ne.jsxs)(o,{color:i.orange,children:[Ce[n]," "]}),(0,ne.jsxs)(o,{color:i.dim,children:[c,".".repeat(a+1)]})]})}function Oe(e){if(!e.isRunning||e.replayInfo)return null;let t=e.bifurcationInfo;if(t&&!t.isSingleFlow){let n=e.steps.findIndex(a=>a.status==="running");return(n===-1?e.cmInitCounts.length===0:n>=e.cmInitCounts.length)?{label:n>0?`Planning flow ${n+1}`:void 0,hasBifurcation:!0}:null}return e.cmInitCounts.length>0||e.steps.some(n=>n.children?.length)?null:{hasBifurcation:!!t}}var L=R(z(),1);var Pe=R(z(),1);var re=R(E(),1),Ue="#ffc580",We="#ffd9a8",Ie="#ffffff";function oe({text:e,active:t=!0}){let[n,l]=(0,Pe.useState)(0),a=4;if(G(()=>{l(c=>(c+1)%(e.length+a*2))},t?80:null),!t)return(0,re.jsx)(o,{color:Ie,children:e});let u=e.split("").map((c,B)=>{let S=n-a,v=Math.abs(B-S-a/2),d;return v<=a/2?d=Ue:v<=a?d=We:d=Ie,(0,re.jsx)(o,{color:d,children:c},B)});return(0,re.jsx)(o,{children:u})}var _=R(E(),1),ze={starting:i.orange,running:i.orange,passed:i.green,failed:i.red,cancelled:i.dim,timed_out:i.orange};function ie({currentStep:e,maxSteps:t,elapsed:n,status:l}){let a=ze[l]??i.orange,u=n<60?`${n.toFixed(1)}s`:`${Math.floor(n/60)}m ${Math.round(n%60)}s`;return(0,_.jsxs)(s,{marginLeft:3,children:[(0,_.jsx)(o,{color:i.dim,children:"Steps "}),(0,_.jsx)(o,{bold:!0,children:e}),(0,_.jsxs)(o,{color:i.dim,children:["/",t]}),(0,_.jsx)(o,{children:" "}),(0,_.jsx)(o,{color:i.dim,children:"Elapsed "}),(0,_.jsx)(o,{bold:!0,children:u}),(0,_.jsx)(o,{children:" "}),(0,_.jsx)(o,{color:i.dim,children:"Status "}),(0,_.jsx)(o,{bold:!0,color:a,children:l})]})}var Xe={click:"\u25CF",type:"\u229E",scroll:"\u2195",navigate:"\u2192",analyze:"\u25CE",assert:"\u25C8","if-else":"\u2442",select:"\u25BC",press_key:"\u21B5",wait:"\u2026",tool_call:"\u2299"};function De(e){return Xe[e]??"\u25CF"}var q=R(E(),1);function fe({steps:e,flows:t,cmInitCounts:n,renderStep:l}){return(0,q.jsxs)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:[(0,q.jsxs)(o,{color:i.dim,children:["\u2501\u2501 Bifurcated into ",t?.length??e.length," flows \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"]}),e.map((a,u)=>(0,q.jsxs)(s,{flexDirection:"column",marginTop:u>0?1:0,children:[(0,q.jsxs)(o,{color:i.orange,children:["Flow ",u+1,": ",t?.[u]??a.objective]}),n&&n[u]!=null&&(0,q.jsxs)(o,{color:i.dim,children:[" \u25AA Generated task with ",n[u]," checkpoints"]}),a.children&&a.children.length>0?a.children.map(c=>{let B=!!c.branchObjective,S=`f${u}-${c.childId??"p"}-${c.index}`;return B?(0,q.jsxs)(s,{flexDirection:"column",children:[l({...c,children:void 0},S),(c.children??[]).map(v=>(0,q.jsx)(s,{marginLeft:2,children:l(v,`${S}-${v.childId??"p"}-${v.index}`)},`${S}-${v.childId??"p"}-${v.index}`))]},`${S}-host`):l(c,S)}):a.status==="pending"&&(0,q.jsx)(o,{color:i.dim,children:" \u25CB Waiting..."})]},u))]})}var K=R(E(),1);function je({label:e,shimmer:t=!1}){return(0,K.jsxs)(s,{marginLeft:6,children:[(0,K.jsx)(te,{}),(0,K.jsx)(o,{children:" "}),t?(0,K.jsx)(oe,{text:e,active:!0}):(0,K.jsx)(o,{color:i.dim,children:e})]})}var Fe=R(z(),1);var me=R(E(),1);function Ye(e,t){let n=[];for(let l of e.split(`
|
|
3
3
|
`)){if(l===""){n.push("");continue}let a="";for(let u of l.split(" ")){let c=u;for(;c.length>t;)a&&(n.push(a),a=""),n.push(c.slice(0,t)),c=c.slice(t);a===""?a=c:a.length+1+c.length<=t?a+=" "+c:(n.push(a),a=c)}n.push(a)}return n}function _e({text:e,maxLines:t=3}){let{stdout:n}=ee(),l=Math.max(20,(n?.columns??80)-7),a=!e.trim(),[u,c]=(0,Fe.useState)(!0);G(()=>c(v=>!v),500);let B=(a?"Thinking\u2026":e)+(u?"\u258C":" "),S=Ye(B,l).slice(-t);for(;S.length<t;)S.push("");return(0,me.jsx)(s,{borderStyle:"round",borderColor:i.muted,paddingX:1,marginLeft:3,flexDirection:"column",children:S.map((v,d)=>(0,me.jsx)(o,{color:a?i.dim:i.secondary,wrap:"truncate-end",children:v.length?v:" "},d))})}var H=R(E(),1);function se({activity:e,describe:t,describeVisible:n}){return(0,H.jsxs)(H.Fragment,{children:[e?(0,H.jsx)(je,{label:e.label,shimmer:e.shimmer}):null,n?(0,H.jsx)(_e,{text:t??""}):null]})}var r=R(E(),1);function le(e){for(let t of e){if(t.children&&t.children.length>0){let n=le(t.children);if(n)return n}if(t.status==="running")return t}}function X(e){return e.status==="running"&&!e.branchObjective&&(!e.children||e.children.length===0)}function Ae(e){let t=[];for(let n of e)X(n)||(n.children&&n.children.length>0?t.push({...n,children:Ae(n.children)}):t.push(n));return t}function ge(e,t){if(!e)return null;let n=e.objective??"";return n.length>0&&!/^Step \d+$/.test(n)?{label:n+"\u2026",shimmer:!1}:{label:t?"Looking at the screen\u2026":"Deciding next action\u2026",shimmer:!0}}function D({step:e,indent:t=2}){let n=e.actionType?De(e.actionType):null,l=e.status==="running",a=e.status==="passed",u=e.status==="failed",c=e.status==="pending"||e.status==="stopped",{stdout:B}=ee(),S=B?.columns??80,v=Math.max(20,S-t-21),d=e.objective??"",O=d.length>v?d.slice(0,v-1)+"\u2026":d,P=(e.duration??0)*1e3,T=e.duration!=null?P<1e3?`${Math.round(P)}ms`:`${(P/1e3).toFixed(1)}s`:"";return(0,r.jsxs)(s,{flexDirection:"column",children:[(0,r.jsxs)(s,{marginLeft:t,children:[(0,r.jsx)(s,{width:4,children:(0,r.jsxs)(o,{color:i.muted,children:[String(e.index).padStart(2," ")," "]})}),(0,r.jsx)(s,{width:3,children:l?(0,r.jsx)(te,{}):a?(0,r.jsx)(o,{color:i.green,bold:!0,children:"\u2713"}):u?(0,r.jsx)(o,{color:i.red,bold:!0,children:"\u2717"}):(0,r.jsx)(o,{color:i.muted,children:"\u25CB"})}),(0,r.jsx)(s,{flexGrow:1,children:l?(0,r.jsx)(oe,{text:O,active:!0}):u?(0,r.jsx)(o,{color:i.red,children:O}):c?(0,r.jsx)(o,{color:i.dim,children:O}):(0,r.jsx)(o,{color:i.dim,children:O})}),(a||u)&&n?(0,r.jsx)(s,{width:3,marginLeft:1,children:(0,r.jsx)(o,{color:i.muted,children:n})}):(0,r.jsx)(s,{width:3,marginLeft:1}),(0,r.jsx)(s,{width:7,justifyContent:"flex-end",children:(0,r.jsx)(o,{color:i.dim,children:T})})]}),e.children&&e.children.length>0&&(0,r.jsx)(s,{flexDirection:"column",children:e.children.map((k,m)=>(0,r.jsx)(D,{step:k,indent:t+2},`child-${m}`))})]})}function Je(e){return e.type==="cm_init"?(0,r.jsx)(s,{marginLeft:2,paddingLeft:1,children:(0,r.jsxs)(o,{color:i.dim,children:["\u25AA Generated task with ",e.count," checkpoints"]})}):(0,r.jsx)(s,{marginLeft:2,paddingLeft:1,children:(0,r.jsx)(D,{step:e.step})})}function Me({steps:e,bifurcated:t,flows:n,cmInitCounts:l,maxSteps:a=50,staticSteps:u=!1,onStepCommit:c,describe:B,describeVisible:S,describeRevealing:v}){let d=(0,L.useRef)(new Set),O=(0,L.useRef)(!1),P=(0,L.useRef)(new Set),T=(0,L.useRef)(!1),k=(0,L.useRef)(new Set),m=(0,L.useRef)(0);(0,L.useEffect)(()=>{e.length===0&&m.current>0&&(d.current.clear(),O.current=!1,P.current.clear(),T.current=!1,k.current.clear()),m.current=e.length},[e.length]);let b=e.flatMap(p=>[p,...p.children??[]]),C=b.some(p=>p.status==="running"),A=b.some(p=>p.status==="failed"),W=b.length===0||b.every(p=>p.status==="pending"),Y=b.filter(p=>p.status==="passed"||p.status==="failed").length,N;W?N="starting":C?N="running":A?N="failed":N="passed";let J=(0,L.useRef)(null),[ce,he]=(0,L.useState)(0);(0,L.useEffect)(()=>{b.length===0||W?(J.current=null,he(0)):C&&J.current==null&&(J.current=Date.now())},[C,W,b.length]),(0,L.useEffect)(()=>{if(!C)return;let p=setInterval(()=>{J.current!=null&&he((Date.now()-J.current)/1e3)},500);return()=>clearInterval(p)},[C]);let ae=(0,L.useRef)(new Set),[,xe]=(0,L.useState)(0),be=(0,L.useRef)(!1);(0,L.useEffect)(()=>{if(!c||!u||t)return;let p=[];!be.current&&l&&l[0]!=null&&(be.current=!0,l[0]>0&&p.push({key:"cm_init_0",type:"cm_init",count:l[0]}));for(let h of e)(h.status==="passed"||h.status==="failed")&&!ae.current.has(h.index)&&(ae.current.add(h.index),p.push({key:`step_${h.index}`,type:"step",step:{...h,children:h.children?[...h.children]:void 0}}));if(p.length>0){for(let h of p)c(Je(h));xe(h=>h+1)}},[e,t,l,u,c]),(0,L.useEffect)(()=>{if(!c||u)return;let p=d.current.size;if(!t&&!T.current&&l&&l[0]!=null&&(T.current=!0,l[0]>0&&c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsxs)(o,{color:i.dim,children:["\u25A0 Generated task with ",l[0]," checkpoints"]})}))),t&&n&&!O.current&&(O.current=!0,c((0,r.jsx)(o,{color:i.purple,children:"\u2501\u2501 Bifurcated into "+n.length+" flows \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"}))),t){let h=e.flatMap((x,f)=>{let g=x.children??[];return!P.current.has(f)&&g.length>0&&(P.current.add(f),c((0,r.jsx)(o,{color:i.purple,children:" Flow "+(f+1)+": "+(n?.[f]??"")})),l?.[f]!=null&&l[f]>0&&!k.current.has(f)&&(k.current.add(f),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsxs)(o,{color:i.dim,children:[" \u25AA Generated task with ",l[f]," checkpoints"]})})))),l?.[f]!=null&&l[f]>0&&P.current.has(f)&&!k.current.has(f)&&(k.current.add(f),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsxs)(o,{color:i.dim,children:[" \u25AA Generated task with ",l[f]," checkpoints"]})}))),g});for(let x of h){let f=`${x.childId??"p"}-${x.index}-${x.objective}`;if(!!x.branchObjective){d.current.has(f)||(d.current.add(f),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(D,{step:{...x,children:void 0}})})));for(let y of x.children??[]){let $=`child-${x.childId??"p"}-${x.index}-${y.childId??"p"}-${y.index}-${y.objective}`;d.current.has($)||(y.status==="passed"||y.status==="failed"||y.status==="stopped")&&(d.current.add($),c((0,r.jsx)(s,{marginLeft:4,children:(0,r.jsx)(D,{step:y})})))}continue}d.current.has(f)||(x.status==="passed"||x.status==="failed"||x.status==="stopped")&&(d.current.add(f),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(D,{step:x})})))}}else for(let h of e){let x=`${h.index}-${h.objective}`,f=!!h.branchObjective;f&&!d.current.has(x)&&(d.current.add(x),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(D,{step:{...h,children:void 0}})})));for(let g of h.children??[]){let y=`child-${h.index}-${g.childId??"p"}-${g.index}-${g.objective}`;d.current.has(y)||(g.status==="passed"||g.status==="failed"||g.status==="stopped")&&(d.current.add(y),c((0,r.jsx)(s,{marginLeft:4,children:(0,r.jsx)(D,{step:g})})))}!f&&!d.current.has(x)&&(h.status==="passed"||h.status==="failed"||h.status==="stopped")&&(d.current.add(x),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(D,{step:{...h,children:void 0}})})))}d.current.size>p&&xe(h=>h+1)},[e,c,t,n,l]);let V=[];if(u&&!t)for(let p of e)ae.current.has(p.index)||V.push(p);else if(c&&!u)if(t)for(let p of e){let h=p.children??[],x=[];for(let f of h){let g=`${f.childId??"p"}-${f.index}-${f.objective}`,y=d.current.has(g);if(f.branchObjective){let $=(f.children??[]).filter(Q=>{let ue=`child-${f.childId??"p"}-${f.index}-${Q.childId??"p"}-${Q.index}-${Q.objective}`;return!d.current.has(ue)});(!y||$.length>0)&&x.push({...f,children:$})}else y||x.push(f)}x.length>0&&V.push({...p,children:x})}else for(let p of e){let h=`${p.index}-${p.objective}`,x=d.current.has(h),f=(p.children??[]).filter(g=>{let y=`child-${p.index}-${g.childId??"p"}-${g.index}-${g.objective}`;return!d.current.has(y)});x?f.length>0&&V.push({...p,children:f}):V.push({...p,children:f})}if(!u){let p=c?V:e,h=le(p),x=ge(h,v);return(0,r.jsxs)(s,{flexDirection:"column",children:[t?c?p.length>0?(0,r.jsx)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:p.map((g,y)=>(0,r.jsx)(s,{flexDirection:"column",marginTop:y>0?1:0,children:g.children&&g.children.length>0?g.children.map($=>{if(X($))return null;let Q=!!$.branchObjective,ue=`${$.childId??"p"}-${$.index}-${$.objective}`,He=d.current.has(ue);return Q?(0,r.jsxs)(s,{flexDirection:"column",children:[!He&&(0,r.jsx)(D,{step:{...$,children:void 0}}),($.children??[]).filter(Z=>!X(Z)).map(Z=>(0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(D,{step:Z})},`f${y}-${$.index}-${Z.childId??"p"}-${Z.index}`))]},`f${y}-host-${$.childId??"p"}-${$.index}`):(0,r.jsx)(D,{step:$},`f${y}-${$.childId??"p"}-${$.index}`)}):g.status==="pending"&&(0,r.jsx)(o,{color:i.dim,children:" \u25CB Waiting..."})},y))}):null:(0,r.jsx)(fe,{steps:e,flows:n,cmInitCounts:l,renderStep:(g,y)=>X(g)?null:(0,r.jsx)(D,{step:g},y)}):(0,r.jsxs)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:[!c&&l&&l[0]!=null&&(0,r.jsxs)(o,{color:i.dim,children:["\u25AA Generated task with ",l[0]," checkpoints"]}),p.filter(g=>!(g.status==="running"&&(!g.children||g.children.length===0))).map(g=>{let y=`${g.index}-${g.objective}`;return c&&d.current.has(y)?(0,r.jsx)(s,{flexDirection:"column",children:(g.children??[]).filter($=>!X($)).map($=>(0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(D,{step:$})},`${$.childId??"p"}-${$.index}`))},`branch-children-${g.index}`):(0,r.jsx)(D,{step:g},g.index)})]}),(0,r.jsx)(se,{activity:x,describe:B,describeVisible:S}),b.length>0&&(0,r.jsx)(ie,{currentStep:Y,maxSteps:a,elapsed:ce,status:N})]})}if(t){let p=le(e),h=ge(p,v);return(0,r.jsxs)(s,{flexDirection:"column",children:[(0,r.jsx)(fe,{steps:e,flows:n,cmInitCounts:l,renderStep:(x,f)=>X(x)?null:(0,r.jsx)(D,{step:x},f)}),(0,r.jsx)(se,{activity:h,describe:B,describeVisible:S}),b.length>0&&(0,r.jsx)(ie,{currentStep:Y,maxSteps:a,elapsed:ce,status:N})]})}let Ge=le(V),Ke=ge(Ge,v),Re=Ae(V);return(0,r.jsxs)(s,{flexDirection:"column",children:[Re.length>0&&(0,r.jsx)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:Re.map(p=>(0,r.jsx)(D,{step:p},p.index))}),(0,r.jsx)(se,{activity:Ke,describe:B,describeVisible:S}),b.length>0&&(0,r.jsx)(ie,{currentStep:Y,maxSteps:a,elapsed:ce,status:N})]})}var U=R(E(),1);function qe({runner:e,runKey:t,onStepCommit:n}){let l=Oe({isRunning:e.isRunning,bifurcationInfo:e.bifurcationInfo,steps:e.steps,cmInitCounts:e.cmInitCounts,replayInfo:e.replayInfo});return(0,U.jsxs)(U.Fragment,{children:[l&&(0,U.jsx)(Le,{label:l.label,hasBifurcation:l.hasBifurcation}),e.isRunning&&e.steps.length>0&&(0,U.jsx)(Me,{steps:e.steps,bifurcated:!!e.bifurcationInfo&&!e.bifurcationInfo.isSingleFlow,flows:e.bifurcationInfo?.flows,cmInitCounts:e.cmInitCounts,maxSteps:e.maxSteps,onStepCommit:n},`run-${t}`)]})}var j=R(E(),1),Qe=64;function Ze(e){return e.split(`
|
|
4
4
|
`).map(t=>t.replace(/^[-–•]\s*/,"").trim()).filter(t=>t.length>0)}function Ne({status:e,summary:t,duration:n,steps:l,stepsPassed:a,stepsFailed:u,reason:c,creditsConsumed:B}){let S=e==="passed",v=S?i.green:i.red,d=S?"\u2713":"\u2717",O=e.toUpperCase(),P=a??(S?l:Math.max(0,l-1)),T=u??(S?0:1),k=T>0?`${l} steps (${P} passed, ${T} failed)`:`${l} steps`,m=n<60?`${n.toFixed(1)}s`:`${Math.floor(n/60)}m ${Math.round(n%60)}s`,b=Ze(t);return(0,j.jsx)(s,{flexDirection:"column",marginTop:1,children:(0,j.jsxs)(s,{borderStyle:"round",borderColor:v,flexDirection:"column",paddingX:2,paddingY:1,width:Qe+6,children:[(0,j.jsxs)(s,{flexDirection:"column",children:[(0,j.jsxs)(o,{bold:!0,color:v,children:[d," ",O]}),(0,j.jsxs)(o,{color:i.dim,wrap:"wrap",children:[k," \xB7 ",m,typeof B=="number"&&B>0?` \xB7 ${parseFloat(B.toFixed(4))} credits`:""]})]}),b.length>0&&(0,j.jsx)(s,{flexDirection:"column",marginTop:1,marginLeft:1,children:b.map((C,A)=>(0,j.jsxs)(s,{marginBottom:A<b.length-1?1:0,children:[(0,j.jsx)(o,{color:i.orange,children:"\u25CF "}),(0,j.jsx)(s,{flexShrink:1,children:(0,j.jsx)(o,{wrap:"wrap",children:C})})]},A))}),c&&!S&&(0,j.jsx)(s,{marginTop:1,children:(0,j.jsxs)(o,{color:i.red,wrap:"wrap",children:["Reason: ",c]})})]})})}var F=R(E(),1);function Ve({message:e,code:t,remediation:n,docsUrl:l}){return(0,F.jsx)(Te,{title:"Error",variant:"error",children:(0,F.jsxs)(s,{flexDirection:"column",paddingY:1,children:[(0,F.jsxs)(o,{color:i.red,bold:!0,children:[" \u2717 ",e]}),t&&(0,F.jsxs)(s,{marginTop:0,marginLeft:5,children:[(0,F.jsx)(o,{color:i.muted,children:"Code: "}),(0,F.jsx)(o,{color:i.dim,children:t})]}),n&&(0,F.jsxs)(s,{flexDirection:"column",marginTop:1,marginLeft:5,children:[(0,F.jsx)(o,{color:i.green,bold:!0,children:"Fix:"}),(0,F.jsxs)(o,{color:i.orange,children:["$ ",n]})]}),l&&(0,F.jsxs)(s,{marginTop:1,marginLeft:5,children:[(0,F.jsx)(o,{color:i.muted,children:"Docs: "}),(0,F.jsx)(o,{color:i.orange,underline:!0,children:l})]})]})})}var w=R(E(),1),et=1e4;function gn(e){let{exit:t}=ve(),{append:n}=ye(),l=(0,M.useRef)(!1);(0,M.useEffect)(()=>{l.current||(l.current=!0,n((0,w.jsx)(s,{flexDirection:"column",marginBottom:1,children:(0,w.jsxs)(s,{borderStyle:"round",borderColor:"#dc4e08",paddingX:2,children:[(0,w.jsx)(o,{color:"#ff9500",bold:!0,children:"KaneAI CLI"}),(0,w.jsx)(o,{color:i.dim,children:" \u2502 "}),(0,w.jsx)(o,{color:i.orange,children:e.topBanner.model}),(0,w.jsx)(o,{color:i.dim,children:" \u2502 "}),(0,w.jsx)(o,{color:i.dim,children:e.topBanner.auth})]})})),n((0,w.jsx)(tt,{data:e.globalConfig})),e.priorAttemptRollup&&n((0,w.jsx)(o,{color:i.dim,children:` \u21B3 replayed ${e.priorAttemptRollup.startIdx}..${e.priorAttemptRollup.endIdx-1} (${e.priorAttemptRollup.count} steps, from prior attempt)`})))},[]);let a=(0,M.useRef)(null),u=(0,M.useCallback)(async T=>{let k=await e.getNextStep(T);return k?(a.current=k,k.config):(a.current=null,null)},[e]),c=(0,M.useCallback)((T,k)=>{let m=a.current;if(!m)return;let b=m.mode==="replay"?"cyan":"#dc4e08",C=m.modeReason?` (${m.modeReason})`:"",A=m.perStepOverrides?Object.entries(m.perStepOverrides):[];n((0,w.jsxs)(s,{flexDirection:"column",marginBottom:0,children:[(0,w.jsxs)(o,{children:[(0,w.jsxs)(o,{color:i.dim,children:[m.banner.stepLabel," "]}),(0,w.jsxs)(o,{color:b,children:["[",m.mode,"]"]}),(0,w.jsx)(o,{color:i.dim,children:C})]}),(0,w.jsx)(o,{color:i.dim,children:m.banner.objective}),A.length>0&&(0,w.jsxs)(o,{color:i.dim,children:["overrides: ",A.map(([W,Y])=>`${W}=${Y}`).join(", ")]})]}))},[n]),B=(0,M.useRef)(0),S=(0,M.useRef)(!1),v=(0,M.useCallback)((T,k)=>(T.hadError?n((0,w.jsx)(Ve,{message:T.reason??"Runner error",code:"RUNNER_ERROR"})):n((0,w.jsx)(s,{flexDirection:"column",marginBottom:1,children:(0,w.jsx)(Ne,{status:T.status,summary:T.runEnd?.summary??"",duration:T.runEnd?.duration??0,steps:T.stepsTotal,stepsPassed:T.stepsPassed,stepsFailed:T.stepsFailed,reason:T.runEnd?.reason,creditsConsumed:T.runEnd?.credits_consumed})})),e.onStepEnd?.(T,k)??!0),[n,e]),d=ke({getNextConfig:u,onStepStart:c,onStepEnd:v,onAllComplete:()=>{e.onAllComplete(),e.exitOnComplete!==!1&&setImmediate(()=>t())},screenshotDispatcher:e.screenshotDispatcher,stepLogger:e.stepLogger,onReasoning:e.onReasoning,onStepComplete:e.onStepComplete,spawnOpts:e.spawnOpts,...e.reportVerdictOnComplete?{reportVerdictOnComplete:!0}:{},...e.runVerdict?{runVerdict:e.runVerdict}:{}}),O=250,P=5e3;return Se((T,k)=>{if(k.ctrl&&T==="c"){let m=Date.now(),b=m-B.current;if(b<O)return;if(S.current&&b<P){d.cancel(),e.onCancel?.();let C=e.reportVerdictOnComplete?d.runner.shutdownRunner(we,{timeoutMs:et}):Promise.resolve();e.exitOnComplete!==!1&&C.then(()=>setImmediate(()=>t()))}else S.current=!0,n((0,w.jsx)(o,{color:"yellow",children:"press Ctrl+C again to cancel run"}));B.current=m}}),(0,w.jsx)(s,{flexDirection:"column",children:d.phase!=="done"&&(0,w.jsx)(qe,{runner:d.runner,runKey:d.currentStepIndex,onStepCommit:n})})}function tt({data:e}){return(0,w.jsx)(Be,{title:"test.md run",titleColor:"#ff9500",borderColor:i.dim,rows:[{label:"source",value:e.source},{label:"steps",value:`${e.steps.total} (${e.steps.replay} replay, ${e.steps.author} author per walker)`},{label:"model",value:e.model},{label:"viewport",value:`${e.viewport.width} x ${e.viewport.height}`},{label:"chrome",value:e.chrome},{label:"session",value:e.session},{label:"variables",value:`${e.variables.count} (${e.variables.secrets} secret)`},{label:"flags",value:e.flags.length>0?e.flags.join(" "):"(none)"}]})}export{Me as a,Le as b,Oe as c,de as d,Ne as e,Ve as f,gn as g};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as ae}from"./chunk-MMBBQ4OZ.js";import{j as R}from"./chunk-
|
|
2
|
+
import{a as ae}from"./chunk-MMBBQ4OZ.js";import{j as R}from"./chunk-NRAPCFI2.js";import{c as ie,e as ne,i as re,j as K}from"./chunk-Z7S3IWUX.js";import{d as $,e as oe}from"./chunk-4JOD47QI.js";import{a as se}from"./chunk-RZ4F3BHX.js";import{spawn as ze}from"child_process";import{closeSync as Xe,existsSync as Ge,mkdirSync as We,openSync as Ye,readFileSync as Ze,rmSync as Qe}from"fs";import{homedir as ge}from"os";import{dirname as X,join as S}from"path";import{access as Re,mkdir as de,readFile as Le}from"fs/promises";import{homedir as Ce}from"os";import{arch as Fe,platform as Be}from"process";import{join as M}from"path";var Ue=35,qe="google_apis",Ve="KaneCLI_Pixel_API35",He="KaneAI_Pixel_API35";function Ht(t){return t===He?Ve:t}var je=1;function Ke(t,e){return t==="darwin"&&e==="arm64"?"arm64-v8a":"x86_64"}function Je(){return{home:Ce(),os:Be,arch:Fe}}async function le(t){try{return await Re(t),!0}catch{return!1}}var J=class{deps;constructor(e={}){this.deps={...Je(),...e}}paths(){let e=M(this.deps.home,".testmuai","kaneai","mobile"),r=M(e,"android-sdk");return{root:r,emulatorDir:M(r,"emulator"),systemImageDir:M(r,"system-images",`android-${Ue}`,qe,Ke(this.deps.os,this.deps.arch)),avdHome:M(e,"avd"),manifest:M(r,"sdk-manifest.json")}}environment(){let e=this.paths();return{ANDROID_HOME:e.root,ANDROID_SDK_ROOT:e.root,ANDROID_AVD_HOME:e.avdHome}}async ensureSdkRootMarkers(){let e=this.paths().root;await de(M(e,"platforms"),{recursive:!0}),await de(M(e,"platform-tools"),{recursive:!0})}async status(){let e=this.paths(),r=null;try{r=JSON.parse(await Le(e.manifest,"utf8"))}catch{}if(!r||r.schemaVersion!==je)return{emulator:!1,systemImage:!1};let o=this.deps.os==="win32"?"emulator.exe":"emulator";return{emulator:!!r.components.emulator&&await le(M(e.emulatorDir,o)),systemImage:!!r.components.systemImage&&await le(M(e.systemImageDir,"system.img"))}}},ue;function B(){return ue??=new J,ue}var G="android",et="http://127.0.0.1:4723/status",tt=2e3,z=(()=>{let t=Number(process.env.KANE_CLI_EMULATOR_BOOT_TIMEOUT_MS);return Number.isFinite(t)&&t>=3e4?t:3e5})(),it=1e3,nt=3e5;var rt=5,ce="Run `kane-cli doctor --target emulator --install` to install the managed Appium tree.",st={device:"ready",unauthorized:"unauthorized",offline:"offline"};function ot(t){let e={};for(let r of t){let o=r.indexOf(":");o<=0||(e[r.slice(0,o)]=r.slice(o+1))}return e}function at(t){let e=[];for(let r of t.split(`
|
|
3
3
|
`)){let o=r.trim();if(!o||o.startsWith("*"))continue;let u=o.toLowerCase();if(u.startsWith("list of devices")||u.startsWith("adb server"))continue;let g=o.split(/\s+/),p=g[0],w=g[1];if(!p||!w)continue;let v=ot(g.slice(2)),x=/^(localhost|127\.0\.0\.1):\d{1,5}$/.test(p),P=/^[A-Za-z0-9._-]+:\d{1,5}$/.test(p),C=/^sdk_/.test(v.product??"")||/^sdk_/.test(v.model??"")||/^emu/.test(v.device??"");if(!p.startsWith("emulator-")&&!x&&!(P&&C))continue;let l=v.model?v.model.replace(/_/g," "):void 0;e.push({platform:G,kind:"emulator",id:p,displayName:l??p,state:st[w]??"offline"})}return e}function me(t){let e=[];for(let r of t.split(`
|
|
4
4
|
`)){let o=r.trim();o&&/^[A-Za-z0-9._-]+$/.test(o)&&(e.includes(o)||e.push(o))}return e}function dt(t){for(let e of t.split(`
|
|
5
5
|
`)){let r=e.trim();if(!(!r||r==="OK"))return r}}function lt(t){let e=/^Version\s+(\S+)/m.exec(t);return e?.[1]?e[1].split("-")[0]:/Android Debug Bridge version\s+(\S+)/.exec(t)?.[1]}function ut(t){let e=[];for(let r of t.split(`
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as Je}from"./chunk-DREQ3RAA.js";import{b as ne,c as $,d as ie,e as oe}from"./chunk-
|
|
2
|
+
import{a as Je}from"./chunk-DREQ3RAA.js";import{b as ne,c as $,d as ie,e as oe}from"./chunk-35WUYKGO.js";import{h as jt,i as Ot}from"./chunk-IEHJG6J4.js";import{b as mt,c as ft,d as gt,e as _t,f as vt,j as yt,l as ht,m as wt,n as x,o as bt,p as kt,r as xt}from"./chunk-MEMXFTLD.js";import{c as St,d as It}from"./chunk-SSOUYKVG.js";import{a as N}from"./chunk-HVOXMCKE.js";import{a as At,b as Ct}from"./chunk-TAY7J5VS.js";import{b as Dt}from"./chunk-3RO2YGKH.js";import{a as X,c as qe,d as Ge,e as We,f as Z}from"./chunk-IINZZ4BZ.js";import{a as T}from"./chunk-73Y6T2UK.js";import{e as Pt}from"./chunk-NI3TIAD7.js";import{b as et,e as tt,g as rt,h as nt,i as it,j as ot}from"./chunk-2JFRN62I.js";import{b as h,c as ee,d as Qe,g as te}from"./chunk-Z36KVIRR.js";import{a as Q,b as C,d as Xe,e as Ze}from"./chunk-Q4JV4U65.js";import{a as Be,b as Ve}from"./chunk-2TK4MDF2.js";import{c as ze,d as Ye,e as He}from"./chunk-5YYCCM6K.js";import{g as Ue}from"./chunk-WLEWXE6L.js";import{b as Ke,d as U,e as z}from"./chunk-NHGPMYM3.js";import{a as F}from"./chunk-FOLUB336.js";import{d as pt}from"./chunk-XB6BJPDL.js";import{h as Y,k as st,m as at,o as ct}from"./chunk-7V34ZMMS.js";import{f as Et}from"./chunk-WE7HRAGO.js";import{a as Rt}from"./chunk-4C7WVQOD.js";import{M as dt,vb as lt}from"./chunk-PI7OXS62.js";import{f as re,g as ut}from"./chunk-KU3YHPWZ.js";import{b as A,c as b}from"./chunk-VZ7KXRXB.js";import{c as $e}from"./chunk-ZCBOHWN3.js";import{f as Ne}from"./chunk-A7RJQJNT.js";import{a as Te}from"./chunk-J4FIESTB.js";function j(e){if(e===null)return"broken";let t=Math.floor(e/100);return t===1?"passed":t===7?"failed":t===2?"skipped":"broken"}var D={failed:3,broken:2,passed:1,skipped:0};function se(e){let t="skipped";for(let r of e)D[r]>D[t]&&(t=r);return t}import{createHash as ur}from"crypto";import{basename as dr}from"path";function ae(e){let t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40);return t.length>0?t:"session"}function ce(e){return ur("sha256").update(e).digest("hex").slice(0,8)}function ue(e){let t=dr(e).replace(/_test\.md$/i,"").replace(/\.md$/i,"");return`${ae(t)}-${ce(e)}`}function de(e,t){return`${ae(e)}-${ce(t)}`}function le(e,t=process.env){let r=Je(t),n={...r.testInstanceId?{hyper_test_instance_id:r.testInstanceId}:{},...r.jobId?{hyper_job_id:r.jobId}:{},...r.taskId?{hyper_task_id:r.taskId}:{},...e},o={};for(let[i,s]of Object.entries(n))typeof s=="string"&&s.length>0&&(o[i]=s);return o}function lr(e,t){return{pack_test_dir:e,ordinal_offset:t}}import{promises as S}from"fs";import{join as I}from"path";function pe(e){let t={evidence:"0.1",run_id:e.execution_id,status:"running",title:e.title,started:e.started,environment:{producer:{name:"kane-cli",version:e.producerVersion},...e.surfaces?{surfaces:e.surfaces}:{},run_kind:e.run_kind,origin:e.origin,pid:e.pid,...e.overrideStartUrl?{override_start_url:e.overrideStartUrl}:{}},...e.credits!==void 0?{metrics:{credits:{value:e.credits,type:"count"}}}:{}};return b(t,{lineWidth:-1})}async function me(e,t,r,n=process.cwd(),o){let i=o??h(e.execution_id,n),s=I(i,"tests",t);return await S.mkdir(I(i,"coverage"),{recursive:!0}),await S.writeFile(I(i,"coverage",".keep"),""),await S.mkdir(s,{recursive:!0}),await S.writeFile(I(i,"run.yaml"),pe(e)),r&&await S.writeFile(I(s,r.path),r.content),i}async function pr(e,t=process.cwd()){let r=h(e.execution_id,t);await S.mkdir(I(r,"coverage"),{recursive:!0}),await S.writeFile(I(r,"coverage",".keep"),"");let n=A(pe(e));return n.environment&&delete n.environment.run_kind,await S.writeFile(I(r,"run.yaml"),b(n,{lineWidth:-1})),r}async function mr(e,t=process.cwd()){return C(h(e,t),new Date().toISOString())}async function fe(e,t=process.cwd()){await S.rm(h(e,t),{recursive:!0,force:!0})}import{promises as ge}from"fs";import{join as _e}from"path";function H(e){let t={evidence:"0.1",test:e.testId,status:e.status,...e.durationMs!==void 0?{duration_ms:e.durationMs}:{},...e.attempts&&e.attempts.length?{attempts:e.attempts}:{},...e.flaky!==void 0?{flaky:e.flaky}:{},...e.adaptiveHeal?{adaptive_heal:e.adaptiveHeal}:{},...e.definitionPath?{definition:{path:e.definitionPath}}:{},...e.definitionId?{definition_id:e.definitionId}:{},...e.assuranceId?{assurance_id:e.assuranceId}:{},...e.assuranceBase?{assurance_base:e.assuranceBase}:{},...Object.keys(e.externalId).length?{external_id:e.externalId}:{},...e.tags&&e.tags.length?{tags:e.tags}:{},...Object.keys(e.environment).length?{environment:e.environment}:{},steps:e.steps};return b(t,{lineWidth:-1})}function ve(e){return b({logs:e},{lineWidth:-1})}async function ye(e,t,r){await ge.writeFile(_e(e,"tests",t,"result.yaml"),r)}async function he(e,t,r){let n=_e(e,"tests",t,"logs");await ge.mkdir(n,{recursive:!0}),await ge.writeFile(_e(n,"meta.yaml"),r)}import{promises as K}from"fs";import{join as Lt}from"path";function Mt(e){return Lt(e,".internal","meta.json")}async function Ft(e){let t;try{t=await K.readFile(Mt(e),"utf8")}catch(n){if(n?.code==="ENOENT")return null;throw n}let r=JSON.parse(t);if(!r||typeof r!="object"||Array.isArray(r))throw new Error("meta.json is not a JSON object");return r}async function we(e,t){let r;try{r=await Ft(e)??{}}catch(s){console.warn(`evidence: meta.json at ${e} unreadable \u2014 skipping execution-pointer append to preserve identity`,s);return}let n=Array.isArray(r.executions)?r.executions:[];n.push(t),r.executions=n,await K.mkdir(Lt(e,".internal"),{recursive:!0});let o=Mt(e),i=`${o}.tmp-${process.pid}-${Date.now()}`;await K.writeFile(i,JSON.stringify(r,null,2)+`
|
|
3
3
|
`),await K.rename(i,o)}async function fr(e){try{let t=await Ft(e);return t&&Array.isArray(t.executions)?t.executions:[]}catch{return[]}}function be(e){let t=[];for(let r of e){let n=r.perFlow&&r.perFlow.length?r.perFlow.map(o=>o.resultCode):[r.resultCode];for(let o of n)t.push(j(o))}return se(t)}function gr(e){let t=null;for(let r of e){let n=r.perFlow&&r.perFlow.length?r.perFlow.map(o=>o.resultCode):[r.resultCode];for(let o of n)o!=null&&(t==null||D[j(o)]>D[j(t)]||D[j(o)]===D[j(t)]&&o>t)&&(t=o)}return t}import{promises as _r}from"fs";import{extname as Tt,basename as vr}from"path";var yr={".ndjson":"ndjson",".log":"log",".json":"json",".har":"har"};async function ke(e){let t;try{t=await _r.readdir(e)}catch{return[]}return t.filter(r=>r!=="meta.yaml"&&!r.startsWith(".")).sort().map(r=>({name:vr(r,Tt(r)),file:r,format:yr[Tt(r)]??"txt"}))}import{mkdirSync as hr,appendFileSync as wr}from"fs";import{join as Nt}from"path";function xe(e,t){return Nt(e,"tests",t,"logs")}function Se(e,t,r,n={},o){try{o?.(t,r,r,n)}catch{}if(e)try{hr(e,{recursive:!0});let i=JSON.stringify({ts:new Date().toISOString(),level:t,event:r,...n})+`
|
|
4
4
|
`;wr(Nt(e,"diagnostics.ndjson"),i)}catch{}}import{promises as R}from"fs";import{dirname as Ar,join as O}from"path";import{statSync as br}from"fs";import{promises as Ie}from"fs";import{basename as kr,join as xr}from"path";var Sr=1e6,Ir=2e6;function Rr(){return Be.map(e=>Ve(e))}function $t(e=Rr()){return e.map(t=>{let r=0;try{r=br(t).size}catch{}return{path:t,offset:r}})}var Er=/\x1b\[[0-9;]*[A-Za-z]/g;async function Pr(e,t,r){let n;try{n=await Ie.open(e,"r");let o=(await n.stat()).size,i=t<=o?t:0,s=o-i;if(s<=0)return null;let a=s>r?o-r:i,c=Buffer.alloc(Math.min(s,r));return await n.read(c,0,c.length,a),c.toString("utf8")}catch{return null}finally{await n?.close().catch(()=>{})}}async function Bt(e,t){let r=t.caps?.stderr??Sr,n=t.caps?.appium??Ir,o=[];t.runnerStderrPath&&o.push({src:t.runnerStderrPath,from:0,cap:r});for(let i of t.appiumMarks??[])o.push({src:i.path,from:i.offset,cap:n});for(let i of o){let s=await Pr(i.src,i.from,i.cap);if(s===null)continue;let a=s.replace(Er,"");if(a!=="")try{await Ie.mkdir(e,{recursive:!0}),await Ie.writeFile(xr(e,kr(i.src)),a)}catch{}}}async function Cr(e){try{let t=O(e,"tests"),r=await R.readdir(t).catch(()=>[]);for(let n of r){let o=O(t,n,"steps"),i=await R.readdir(o).catch(()=>[]);for(let s of i){let a=await R.readFile(O(o,s,"failure.yaml"),"utf8").catch(()=>null);if(a!=null)try{let c=A(a);if(c&&typeof c=="object"&&c.triage)return!0}catch{}}}}catch{}return!1}async function Vt(e,t,r,n={}){let o=O(e,"tests",t,"logs");if(r)try{await R.mkdir(o,{recursive:!0}),await R.copyFile(r,O(o,"tui.log"))}catch{}await Bt(o,{runnerStderrPath:r?O(Ar(r),"runner-stderr.log"):void 0,appiumMarks:n.appiumMarks});let i=await ke(o);if(!i.length&&n.requireRealLog)throw new Error(`evidence test ${t} has no real log to declare`);i.length&&await he(e,t,ve(i))}async function Re(e){let t=e.cwd??process.cwd(),r=e.packDir??h(e.executionId,t);if(!e.saved&&!e.packDir)return await fe(e.executionId,t),{sealed:!1};await Vt(r,e.testId,e.tuiLogPath,{requireRealLog:e.requireRealLog,appiumMarks:e.appiumMarks}),await z(r,await e.catalog??Ke());let n=O(r,"run.yaml"),o=A(await R.readFile(n,"utf8"));o.environment={...o.environment??{},saved:e.saved,run_kind:e.runKind},await R.writeFile(n,b(o,{lineWidth:-1}));let i=await R.open(n,"r+");try{await i.sync()}finally{await i.close()}let s=await Cr(r);await C(r,new Date().toISOString());let a;try{let u=await Q(r,"L1");a=u.valid;let p=(u.diagnostics??[]).filter(f=>String(f?.code??"").includes("failure.status_disagrees"));if(p.length>0)if(e.expectStatusDisagrees||s){let f=e.expectStatusDisagrees?"expected under --bug-detection continue":"self-explained by triaged failure record(s)";console.warn(`evidence: ${p.length} status_disagrees advisory(ies) \u2014 ${f}`)}else console.warn(`evidence: ${p.length} status_disagrees advisory(ies) \u2014 step verdicts disagree with their failure records`,p);if(!u.valid){console.warn(`evidence: sealed pack ${e.executionId} failed L1 validation`,u.diagnostics);let f=String(u.diagnostics?.[0]?.code??"");Se(xe(r,e.testId),"warn","EVIDENCE_INVALID",{execution_id:e.executionId,first_code:f,surface:e.surface??"testmd"},e.log)}}catch(u){console.warn(`evidence: validation error for ${e.executionId}`,u)}let c;if(e.saved&&e.packDir)try{c=await Qe(r,e.executionId,t)}catch(u){console.warn(`evidence: store install failed for ${e.executionId}`,u)}if(e.outputStemDir)try{await we(e.outputStemDir,{execution_id:e.executionId,run_kind:e.runKind,status:e.verdict,valid:a,at:new Date().toISOString()})}catch(u){console.warn(`evidence: execution-pointer append failed for ${e.executionId} (pack is sealed)`,u)}return{sealed:!0,valid:a,storePath:c}}import{release as Ut}from"os";import{execFileSync as Dr}from"child_process";var zt=!1,q;function jr(){if(!zt)if(zt=!0,process.platform==="darwin")try{q=Dr("sw_vers",["-productVersion"],{timeout:2e3}).toString().trim()||void 0}catch{q=Ut()||void 0}else q=Ut()||void 0;return q}function Ee(e){let t={os:X(process.platform)},r=jr();if(r&&(t.os_version=r),e.cdpBrowser){let i=/^([A-Za-z]+)\/(\d+)/.exec(e.cdpBrowser);i&&(t.browser=i[1].replace(/^Headless/,""),t.browser_version=i[2])}e.resolution&&(t.resolution=e.resolution);let n=Ge(t,e.runnerEnvironment);if(!n.native_platform)return n;e.deviceName&&(n.device=e.deviceName),!n.os_version&&e.deviceOsVersion&&(n.os_version=e.deviceOsVersion);let o=ze(e.deviceApp);if(o&&(n.app=o),Ne(n.target)){let i=Ue(e.runnerEnvironment?.device);i&&(n.device=i)}return e.pixelResolution&&(n.viewport=n.resolution??Or(e.pixelResolution,n.pixel_ratio)??e.pixelResolution,n.resolution=e.pixelResolution),n}function Or(e,t){if(!t||!Number.isFinite(t)||t<=0)return;let r=/^(\d+)x(\d+)$/.exec(e);if(r)return`${Math.round(Number(r[1])/t)}x${Math.round(Number(r[2])/t)}`}async function Yt(e){if(e)try{let t=await fetch(`${e}/json/version`,{signal:AbortSignal.timeout(2e3)});if(!t.ok)return;let r=await t.json();return typeof r.Browser=="string"?r.Browser:void 0}catch{return}}function Lr(e){let t;return()=>(t||(t=Yt(e)),t)}import{promises as w,existsSync as E,readFileSync as Nr}from"fs";import{basename as $r,join as v}from"path";import{readFileSync as Mr}from"fs";import{dirname as Fr,resolve as Tr}from"path";function Ht(e,t){let r=Tr(e),n=Mr(r,"utf8");return Y(t?st(n,at(Fr(r),t)):n)}async function Kt(e){for(let t of await w.readdir(e,{withFileTypes:!0})){let r=v(e,t.name);if(t.isDirectory()){await Kt(r);continue}try{await w.unlink(r)}catch{await w.truncate(r,0)}}await w.rmdir(e).catch(()=>{})}function Br(e){let t=e.authorBoundary<0||e.authorBoundary>e.totalSteps?e.totalSteps:e.authorBoundary;return{shrink_count:e.shrinkCount,complete_reauthor:t===0&&e.totalSteps>0,author_boundary:t,total_steps:e.totalSteps,reauthored_steps:e.totalSteps-t,credits_consumed:Math.round(e.creditsConsumed*100)/100}}var B=class e{constructor(t){this.opts=t}executionId;testId;definitionPath=null;definitionContent=null;accumulatedSteps=[];maxOrdinal=0;_attempts=[];_packDirOverride;_attached=!1;appiumMarks=$t();get attached(){return this._attached}static async attach(t){let r=$r(t.packDir).replace(/\.evidence$/,""),n=new e({origin:"testrun",runKind:"author",pid:process.pid,title:t.testId,started:new Date().toISOString(),producerVersion:Te,cwd:t.cwd});n.executionId=r,n.testId=t.testId,n._packDirOverride=t.packDir,n._attached=!0;let o=v(t.packDir,"tests",t.testId);return await w.mkdir(o,{recursive:!0}),t.definition&&(await w.writeFile(v(o,t.definition.path),t.definition.content),n.definitionPath=t.definition.path,n.definitionContent=t.definition.content),n}async start(){if(this._attached)throw new Error("attach-mode session is already started");this.executionId=ee(),this.testId=this.opts.testmdRelPath?ue(this.opts.testmdRelPath):de(this.opts.objectiveOrName??"session",this.opts.sessionId??this.executionId);let t=this.opts.definition??null;return await me({execution_id:this.executionId,title:this.opts.title,started:this.opts.started,producerVersion:this.opts.producerVersion,surfaces:this.opts.surfaces,run_kind:this.opts.runKind,origin:this.opts.origin,pid:this.opts.pid,...this.opts.credits!==void 0?{credits:this.opts.credits}:{},...this.opts.overrideStartUrl?{overrideStartUrl:this.opts.overrideStartUrl}:{}},this.testId,t,this.opts.cwd,this.opts.packRootDir?this.pack:void 0),t&&(this.definitionPath=t.path,this.definitionContent=t.content),{executionId:this.executionId,testId:this.testId,packTestDir:this.packTestDir}}get pack(){return this._packDirOverride?this._packDirOverride:this.opts.packRootDir?v(this.opts.packRootDir,`${this.executionId}.evidence`):h(this.executionId,this.opts.cwd)}get packTestDir(){return v(this.pack,"tests",this.testId)}async writeDefinition(t,r="test.md"){await w.writeFile(v(this.packTestDir,r),t),this.definitionPath=r,this.definitionContent=t}computeEngineBlock(){try{if(this.opts.testmdRelPath&&this.opts.cwd){let t=v(this.opts.cwd,this.opts.testmdRelPath);if(E(t))return ct(Nr(t,"utf8"))??{}}}catch{}return{}}computeDefinitionId(){try{if(this.opts.testmdRelPath&&this.opts.cwd){let t=v(this.opts.cwd,this.opts.testmdRelPath),r=v(this.opts.cwd,".context"),n=E(r)?lt(r):void 0;if(E(t))return Ht(t,n)}if(this.definitionContent!=null)return Y(this.definitionContent)}catch{}}noteSpawn(t){this.accumulatedSteps.push(...t.steps),this.maxOrdinal=Math.max(this.maxOrdinal,t.maxOrdinal)}nextOrdinalOffset(){return this.maxOrdinal}get steps(){return this.accumulatedSteps}get attempts(){return this._attempts}async archiveAttempt(t,r,n={}){let o=this._attempts.length+1,i=v(this.packTestDir,String(o)),s=n.log,a=(u,l)=>s?.("warn","ARCHIVE_ATTEMPT_FAILED",`Attempt ${o}: ${u} could not be archived into ${o}/; the next attempt will mingle with it`,{attempt:o,dir:u,error:String(l)}),c;try{await w.mkdir(i,{recursive:!0})}catch(u){a(`${o}/`,u)}for(let u of["steps","logs","v16-trajectory"]){let l=v(this.packTestDir,u);if(!E(l))continue;let p=v(i,u);try{await w.rename(l,p);continue}catch(f){s?.("warn","ARCHIVE_ATTEMPT_RENAME_FAILED",`Attempt ${o}: rename of ${u}/ refused; copying it into ${o}/ and emptying the originals in place`,{attempt:o,dir:u,error:String(f),fallback:"copy+truncate"})}try{await w.cp(l,p,{recursive:!0}),await Kt(l)}catch(f){a(u,f)}}try{this.definitionPath&&E(v(this.packTestDir,this.definitionPath))&&await w.copyFile(v(this.packTestDir,this.definitionPath),v(i,this.definitionPath));let u=v(i,"steps");if(E(u)){for(let l of await w.readdir(u))if(E(v(u,l,"failure.yaml"))){c=`${o}/steps/${l}/failure.yaml`;break}}}catch(u){a("definition + failure pointer",u)}return this._attempts.push({n:o,status:t,steps:this.accumulatedSteps,...r!==void 0?{failedAt:r}:{},...c?{failure:c}:{}}),this.accumulatedSteps=[],this.maxOrdinal=0,o}async writeResult(t){let r=be(t.spawns),n=this._attempts.length?[...this._attempts.map(m=>({status:m.status})),{status:r,...t.durationMs!==void 0?{duration_ms:t.durationMs}:{}}]:void 0,o=n?new Set(n.map(m=>m.status)).size>1:void 0,i=this._attempts.length>0,s=t.heal,a=i||s?.forced?{triggered:i,...i?{outcome:r==="passed"?"healed":"exhausted"}:{},...s?Br(s):{},...i?{attempts:this._attempts.map(m=>({n:m.n,status:m.status,failed_at:m.failedAt??-1,...m.failure?{failure:m.failure}:{}}))}:{}}:void 0,c=this.pack,u=le(t.externalIdInput),l=Z(t.runnerEnv,t.intentEnv),p=this.computeDefinitionId(),{id:f,base:y}=this.computeEngineBlock();await ye(c,this.testId,H({testId:this.testId,status:r,durationMs:t.durationMs,definitionPath:this.definitionPath,definitionId:p,assuranceId:f,assuranceBase:y,externalId:u,environment:l,steps:t.steps,tags:t.tags,attempts:n,flaky:o,adaptiveHeal:a}));for(let m of this._attempts){let _=v(this.packTestDir,String(m.n));E(_)&&await w.writeFile(v(_,"result.yaml"),H({testId:this.testId,status:m.status,definitionPath:this.definitionPath,definitionId:p,assuranceId:f,assuranceBase:y,externalId:u,environment:l,steps:m.steps,tags:t.tags}))}let d=t.externalIdInput;return t.log&&(d.commit_id||d.test_id||d.testcase_id)&&t.log("info","EVIDENCE_EXTERNAL_ID","Evidence external-id mapping",{execution_id:this.executionId,commit_id:d.commit_id??null,test_id:d.test_id??null,testcase_id:d.testcase_id??null,tc_id:u.tc_id??null,project_id:d.project_id??null,session_id:d.session_id??null,session_name:d.session_name??null,hyper_test_instance_id:u.hyper_test_instance_id??null,hyper_job_id:u.hyper_job_id??null,hyper_task_id:u.hyper_task_id??null,dataset_id:u.dataset_id??null,dataset_row_id:u.dataset_row_id??null,dataset_version_id:u.dataset_version_id??null}),r}get id(){return this.executionId}get test(){return this.testId}};async function Vr(e,t,r=te){try{let n=await r(e);if(n.aborted.length>0||n.removed.length>0)try{t?.("info","EVIDENCE_RECOVERY","Startup evidence recovery swept incomplete packs",{aborted:n.aborted,removed:n.removed,origin:"startup"})}catch{}return n}catch(n){return console.warn("evidence: startup recovery failed",n),{aborted:[],removed:[]}}}import{promises as dn}from"fs";import{existsSync as tn,mkdirSync as rn,rmSync as nn,writeFileSync as on}from"fs";import{join as Ce}from"path";import{mkdirSync as Ur,renameSync as zr,rmSync as Yr,writeFileSync as Hr}from"fs";import{join as qt}from"path";var Kr=5e6;function Gt(e,t,r){let n=qt(e,"coverage","sources"),o=new Map,i=!1;try{for(let s of r.usecases)for(let a of s.sources){if(o.has(a.id)){a.file=o.get(a.id);continue}if(!a.cid)continue;let c=t.getBlob(a.cid);if(c===null||c.byteLength>Kr)continue;i||(Ur(n,{recursive:!0}),i=!0);let u=qt(n,a.id),l=`${u}.tmp-${process.pid}`;Hr(l,c),zr(l,u);let p=`coverage/sources/${a.id}`;o.set(a.id,p),a.file=p}}catch{for(let s of r.usecases)for(let a of s.sources)delete a.file;if(i)try{Yr(n,{recursive:!0,force:!0})}catch{}}}function qr(e){return e.state==="proven"?"covered":e.proven>0?"partial":"uncovered"}function Gr(e,t,r){let n={};for(let s of e.perUc)n[s.id]={status:qr(s),state:s.state,pct:Math.round(s.pct)};let o={};for(let[s,a]of Object.entries(e.perAc)){let c=a.state==="proven";o[s]={score:c?1:0,verified:c,passes:t[s]?.passes??0,counted:t[s]?.counted??0}}let i=Object.values(n).map(s=>s.status);return{rollup_version:2,stale_sources:e.flags.stale_sources,high_risk_gaps:(r??[]).filter(s=>s.risk==="high").length,aspects:{coverage:{config:e.config,acs:o,usecases:n,summary:{coverage_pct:Math.round(e.pct),acs_verified:`${e.criteria.proven}/${e.criteria.total}`,usecases_covered:`${i.filter(s=>s==="covered").length}/${i.length}`,uncovered:i.filter(s=>s==="uncovered").length}}}}}var Wr={passed:"passed",failed:"failed",broken:"blocked"};function Jr(e,t,r){let n=e.edgesFrom(t).find(i=>i.type===ut.SCOPED_TO),o=n?e.tipOf(n.dst):r;return o===r?{type:"usecase",ref:x(e,r)}:{type:"scenario",ref:x(e,o)}}function Wt(e,t,r){let n=xt({graph:e,runs:t,thisRun:r}),{inScope:o}=ht(e),i=wt(e,new Set(o)),s=new Map(o.map(p=>[x(e,p),p])),a={},c=p=>F(e,p),u=n.perUc.map(p=>{let f=s.get(p.id),y=e.tipOf(f),d=mt(e,y,c).map(_=>gt(e,_,c,x)).sort((_,k)=>_.id<k.id?-1:1),m=(i.get(f)??[]).map(_=>{let k=x(e,_),L=e.getNode(_)?.content??{},V=bt(e,_).sort((g,P)=>x(e,g)<x(e,P)?-1:1),W=kt(e,t,_,V,r).sort((g,P)=>g.at<P.at?-1:g.at>P.at?1:0),M=n.perAc[k]?.this_run,J=V.length>0;a[k]={passes:W.filter(g=>g.verdict==="passed").length,counted:W.filter(g=>g.verdict==="passed"||g.verdict==="failed").length};let Fe=W.slice(-10).map(g=>({execution_id:g.executionId,ts:g.at,verdict:g.verdict,stale_at_run:!!g.fact.stale_at_run,oracle_mode:String(g.fact.oracle_mode),...g.fact.via_parent?{via_parent:String(g.fact.via_parent)}:{}}));return{id:k,text:String(L.text??""),risk:String(L.risk??""),scope:Jr(e,_,y),covered_by:V.map(g=>x(e,g)),...J?{link_type:"verifies"}:{},execution:M===void 0?"not-run":Wr[M]??"not-run",...M!==void 0?{this_run:M}:{},fresh:J&&M===void 0?"unknown":e.stale(_)==="fresh"?"fresh":"stale",derived:!!L.derived,..._t(L),...J?{satisfied_by:V.map(g=>{let P=e.getNode(g)?.content.check?.verified_against;return{test:x(e,g),...P?{step:P}:{}}})}:{},...Fe.length?{executions:Fe}:{}}}).sort((_,k)=>_.id<k.id?-1:1);return{...ft(e,f,x),scenarios:d,acceptance_criteria:m}}),l=vt(e);return{usecases:u,...l.length?{gaps:l}:{},rollup:Gr(n,a,l),coverage:n}}import{existsSync as Jt,readdirSync as Xr,readFileSync as Zr,statSync as Qr}from"fs";import{join as Pe}from"path";function Ae(e){let t=Pe(e,"tests");if(!Jt(t))return[];let r=[];for(let n of Xr(t).sort()){let o=Pe(t,n,"result.yaml");if(!Qr(Pe(t,n)).isDirectory()||!Jt(o))continue;let i=A(Zr(o,"utf8"));!i?.assurance_id&&!i?.definition_id||r.push({test:n,...i.assurance_id?{assuranceId:String(i.assurance_id)}:{},...i.definition_id?{definitionId:String(i.definition_id)}:{},...i.assurance_base?{base:String(i.assurance_base)}:{},verdict:String(i.status??""),acs:St(i.steps??[])})}return r}function en(e,t){if(t.assuranceId){let r=e.resolve(t.assuranceId),n=r?e.tipOf(r.cid):null;if(n!==null&&e.nodeLabel.get(n)===re.TEST&&F(e,n))return n}if(t.definitionId){for(let{cid:r,content:n}of e.byLabel(re.TEST))if(F(e,r)&&n.definitionId===t.definitionId)return r}return null}function Xt(e,t,r){let n=new Map,o=new Set;for(let i of t){let s=en(e,i);if(s===null||i.definitionId===void 0||r.definitionNow(e,s)!==i.definitionId)continue;let a=`${r.executionId}/${i.test}`;o.add(a);let c=n.get(s)??[];c.push({about:s,definition_id_at_run:i.definitionId,verdict:i.verdict,...i.acs.length?{per_ac:i.acs.map(u=>({ac_ref:u.ref,verdict:u.verdict}))}:{},drift_flag:!1,oracle_mode:"authored",stale_at_run:!1,execution_id:a,started_at:r.at,mode:"testmd",local:!0}),n.set(s,c)}return{runs:i=>n.get(e.tipOf(i))??[],thisRun:o}}var Zt=async(e,t,r)=>{if(t.kind==="grid")try{return Ae(e).some(i=>i.assuranceId)?{status:"pending",reason:"on_grid"}:{status:"skipped",reason:"not_assurance_project"}}catch{return{status:"pending",reason:"on_grid"}}if(t.kind==="none")return{status:"skipped",reason:t.reason};let n=Ce(e,"coverage"),o=tn(n);try{let i=Ae(e),s;if(t.kind==="lattice"){let a=await t.ask(i,r.executionId);if(a==="no_context")return{status:"skipped",reason:"no_use_cases_yet"};if(a==="no_answer")return{status:"pending",reason:"project_no_answer"};s=a}else{if(!t.store.exists())return{status:"skipped",reason:"not_assurance_project"};let a=dt(t.store);t.store.prefetch(pt(a),{token:null});let{runs:c,thisRun:u}=Xt(a,i,{executionId:r.executionId,at:new Date().toISOString(),definitionNow:yt});s=Wt(a,c,u);let l=new Set(s.coverage.this_run?.usecases??[]);Gt(e,t.store,{usecases:s.usecases.filter(p=>l.has(p.id))})}return rn(n,{recursive:!0}),on(Ce(n,"usecases.yaml"),b(s,{lineWidth:-1})),t.kind==="lattice"?{status:"written",computedBy:"project",project:t.project,doc:s.coverage}:{status:"written",computedBy:"local",doc:s.coverage}}catch(i){try{nn(o?Ce(n,"sources"):n,{recursive:!0,force:!0})}catch{}return{status:"failed",detail:i instanceof Error?i.message:String(i)}}};var sn=1e4,an=({url:e,basicAuth:t,projectId:r,body:n,budgetMs:o})=>Et({url:e,basicAuth:t,requestDeadlineMs:o}).coverageRun(r,n),cn=At("pack-coverage");function Qt(e,t={}){if((t.env??process.env).KANE_CLI_MODE==="hyperexecute")return{kind:"grid"};let r=Dt(e,t.address??$e());switch(r.kind){case"local":return{kind:"local",store:N(T(e))};case"refuse":return r.code==="BOTH_STORES"?{kind:"local",store:N(T(e))}:{kind:"none",reason:"project_file_unreadable"};case"remote":{let n=t.budgetMs??sn;return{kind:"lattice",project:r.projectName,ask:async(o,i)=>{try{let s=await(t.auth??Pt)(),a={execution_id:i,members:o.map(un)};return(await Ot((t.run??an)({url:r.latticeUrl,basicAuth:s,projectId:r.projectId,body:a,budgetMs:n}),n)).pack}catch(s){return s instanceof Rt&&s.code==="NO_CONTEXT"?"no_context":(cn(`the shared project's coverage wasn't read: ${s instanceof jt?s.message:Ct(s)}`),"no_answer")}}}}case"pick":return{kind:"none",reason:"not_assurance_project"}}}var un=e=>{let t=e.base??e.definitionId;return{...e.assuranceId?{assurance_id:e.assuranceId}:{},...t?{definition_id:t}:{},test:e.test,verdict:e.verdict,acs:e.acs}};async function ln(e){try{let t=new B({origin:"inline",runKind:"author",pid:e.pid,title:e.title,started:new Date().toISOString(),producerVersion:e.producerVersion,surfaces:e.surfaces,objectiveOrName:e.objectiveOrName,sessionId:e.sessionId,cwd:e.cwd,packRootDir:e.packRootDir}),r=await t.start();return{session:t,...r,packDir:t.pack,spawns:[],startedAtMs:Date.now(),cwd:e.cwd}}catch(t){return console.warn("evidence: inline pack creation failed",t),null}}function pn(e,t,r){if(!e)return;e.session.noteSpawn(t),t.resolution&&(e.resolution=t.resolution),e.runnerEnvironment=qe(e.runnerEnvironment,t.runnerEnvironment);let n=(r?.per_flow_metadata??[]).map(o=>({resultCode:o?.result_code!=null?Number(o.result_code):null}));e.spawns.push({resultCode:r?.result_code!=null?Number(r.result_code):null,...n.length?{perFlow:n}:{}})}function mn(e){if(e)return{packTestDir:e.packTestDir,ordinalOffset:e.session.nextOrdinalOffset()}}async function fn(e,t){if(!e)return null;if(e.finalized)return e.finalized;let r=(n,o,i)=>t.log?t.log("warn",n,o,i):console.warn(`evidence: ${o}`,i??"");try{if(t.recordedTestPath)try{await e.session.writeDefinition(await dn.readFile(t.recordedTestPath,"utf8"))}catch(c){r("EVIDENCE_DEFINITION_FAILED","could not attach synthesized test.md",{error:String(c)})}let n=t.cdpBrowserCapture?await t.cdpBrowserCapture():void 0,o=await e.session.writeResult({steps:e.session.steps,spawns:e.spawns.length?e.spawns:[{resultCode:null}],externalIdInput:{...t.externalIdInput,execution_id:e.executionId},runnerEnv:await He(Ee({cdpBrowser:n,resolution:e.resolution,runnerEnvironment:e.runnerEnvironment,deviceName:t.deviceName,deviceApp:t.deviceApp,pixelResolution:await Ye(e.packTestDir)}),{environment:t.environment,deviceModel:t.deviceModel,runnerEnvironment:e.runnerEnvironment}),intentEnv:We(t.model,e.runnerEnvironment),durationMs:t.durationMs??Date.now()-e.startedAtMs,log:t.log}),i=N(T(t.cwd??e.cwd??process.cwd()));try{if(t.recordedTestPath){let c=It({projectDir:t.cwd??e.cwd??process.cwd(),store:i,members:[{path:t.recordedTestPath,verdict:o,executionId:e.executionId,startedAt:new Date(e.startedAtMs).toISOString(),mode:"inline",local:t.local??!1}]});for(let u of c.warnings)r("EXEC_SYNC",u)}}catch(c){r("EXEC_SYNC","exec-sync failed",{error:String(c)})}let s;try{let c=t.cwd??e.cwd??process.cwd();s=await(t.coverageWriter??Zt)(e.packDir,(t.coverageSource??Qt)(c),{executionId:e.executionId}),(s.status==="skipped"||s.status==="failed")&&r("EVIDENCE_COVERAGE_SKIPPED",`coverage/usecases.yaml not written: ${s.status==="skipped"?s.reason:s.detail}`)}catch(c){s={status:"failed",detail:String(c)},r("EVIDENCE_COVERAGE_SKIPPED","coverage writer threw",{error:String(c)})}let a=await Re({executionId:e.executionId,testId:e.testId,saved:t.saved,runKind:"author",verdict:o,cwd:t.cwd??e.cwd,packDir:e.packDir,tuiLogPath:t.tuiLogPath,log:t.log,surface:"inline",requireRealLog:!!e.runnerEnvironment?.native_platform,appiumMarks:e.session.appiumMarks,catalog:t.environment?U(t.environment):void 0});return e.finalized={...a,coverage:s},t.log?.("info","EVIDENCE_SEALED","Inline pack sealed",{execution_id:e.executionId,verdict:o,valid:a.valid,pack:e.packDir,store_copy:a.storePath??null}),e.finalized}catch(n){return r("EVIDENCE_SEAL_FAILED","inline pack finalize failed",{error:String(n)}),null}}import{statSync as gn,openSync as _n,readSync as vn,closeSync as yn}from"fs";import{basename as hn,resolve as wn}from"path";async function bn(e,t,r={}){let n=r.out??(l=>process.stdout.write(l+`
|
|
5
5
|
`)),o=l=>(n(`error: ${l}`),2);if(t.env!=="prod"&&t.env!=="stage")return o(`invalid --env: ${String(t.env)}`);if(t.port!==void 0&&(!Number.isInteger(t.port)||t.port<1||t.port>65535))return o("invalid --port: expected an integer 1-65535");let i;try{i=$(t.env,t.viewerUrl),new URL(i)}catch{return o(`invalid --viewer-url: ${t.viewerUrl}`)}if(e.length===0)return o("no pack paths given");let s=new Map;for(let l of e){let p=wn(l),f;try{f=gn(p)}catch{return o(`${l}: not found`)}if(f.isDirectory())return o(`${l}: is a directory \u2014 packs must be sealed .evidence files (run the execution to completion, or seal it, first)`);if(!f.isFile())return o(`${l}: not a regular file`);let y=Buffer.alloc(2),d=_n(p,"r");try{vn(d,y,0,2,0)}finally{yn(d)}if(y.toString("latin1")!=="PK")return o(`${l}: not a sealed evidence pack (zip magic missing)`);let m=hn(p);if(s.has(m))return o(`duplicate pack basename: ${m} (URL names collide \u2014 rename one)`);s.set(m,p)}let a=r.log??((l,p,f)=>process.stderr.write(`warn: ${p} reason=${f.reason} path=${f.path}
|
|
6
|
-
`)),c;try{c=await ne({packs:s,allowedOrigins:[new URL(i).origin],port:t.port,log:a})}catch(l){return o(`could not bind 127.0.0.1${t.port?`:${t.port}`:""} \u2014 ${l.message}`)}n(`serving ${s.size} pack${s.size===1?"":"s"} on http://127.0.0.1:${c.port}`);for(let l of s.keys()){let p=c.urlFor(l);n(l),n(` pack ${p}`),n(` viewer ${ie(p,i)}`)}return n("press Ctrl-C to stop"),await(r.hold??kn)(),await c.close(),0}function kn(){return new Promise(e=>{let t=process.listeners("SIGINT");process.removeAllListeners("SIGINT"),process.once("SIGINT",()=>{for(let r of t)process.on("SIGINT",r);e()})})}import{promises as G}from"fs";import{tmpdir as Rn}from"os";import{basename as En,join as rr,resolve as je}from"path";var xn=["error","prefer_first","prefer_latest","discard"],Sn=["external_id.commit_id","external_id.test_id","external_id.dataset_row_id","environment.os","environment.os_version","environment.browser","environment.browser_version","environment.device","environment.app"];function er(e){let t=e.replace(/-/g,"_");return xn.includes(t)?t:null}function tr(e){let t=e==="discard"?{on_collision:"discard"}:{on_collision:"error",identity:{keys:[...Sn],on_same:e??"nest",on_different:e?"error":"split"}};return b({packs:{require_status:"finalized",require_valid:"L1",on_ineligible:"abort"},tests:t,rules:[{file:"run.yaml",key:"run_id",must:"different",on_violation:"skip"},{file:"result.yaml",key:"external_id.project_id",must:"same",on_violation:"error"},{file:"result.yaml",key:"external_id.org_id",must:"same",on_violation:"error"}]},{lineWidth:-1})}async function De(e){try{if(!e.isTTY){e.log(oe(e.packPath));return}let t=$(e.env);await(e.renderPrompt??In)(e.packPath,t)}catch(t){try{e.log(`evidence view failed \u2014 ${t.message}`)}catch{}}}async function In(e,t){let r=await import("./react-QWOAB3TB.js"),{render:n}=await import("./build-5ZN47FAT.js"),{EvidenceViewOffer:o}=await import("./EvidenceViewOffer-
|
|
6
|
+
`)),c;try{c=await ne({packs:s,allowedOrigins:[new URL(i).origin],port:t.port,log:a})}catch(l){return o(`could not bind 127.0.0.1${t.port?`:${t.port}`:""} \u2014 ${l.message}`)}n(`serving ${s.size} pack${s.size===1?"":"s"} on http://127.0.0.1:${c.port}`);for(let l of s.keys()){let p=c.urlFor(l);n(l),n(` pack ${p}`),n(` viewer ${ie(p,i)}`)}return n("press Ctrl-C to stop"),await(r.hold??kn)(),await c.close(),0}function kn(){return new Promise(e=>{let t=process.listeners("SIGINT");process.removeAllListeners("SIGINT"),process.once("SIGINT",()=>{for(let r of t)process.on("SIGINT",r);e()})})}import{promises as G}from"fs";import{tmpdir as Rn}from"os";import{basename as En,join as rr,resolve as je}from"path";var xn=["error","prefer_first","prefer_latest","discard"],Sn=["external_id.commit_id","external_id.test_id","external_id.dataset_row_id","environment.os","environment.os_version","environment.browser","environment.browser_version","environment.device","environment.app"];function er(e){let t=e.replace(/-/g,"_");return xn.includes(t)?t:null}function tr(e){let t=e==="discard"?{on_collision:"discard"}:{on_collision:"error",identity:{keys:[...Sn],on_same:e??"nest",on_different:e?"error":"split"}};return b({packs:{require_status:"finalized",require_valid:"L1",on_ineligible:"abort"},tests:t,rules:[{file:"run.yaml",key:"run_id",must:"different",on_violation:"skip"},{file:"result.yaml",key:"external_id.project_id",must:"same",on_violation:"error"},{file:"result.yaml",key:"external_id.org_id",must:"same",on_violation:"error"}]},{lineWidth:-1})}async function De(e){try{if(!e.isTTY){e.log(oe(e.packPath));return}let t=$(e.env);await(e.renderPrompt??In)(e.packPath,t)}catch(t){try{e.log(`evidence view failed \u2014 ${t.message}`)}catch{}}}async function In(e,t){let r=await import("./react-QWOAB3TB.js"),{render:n}=await import("./build-5ZN47FAT.js"),{EvidenceViewOffer:o}=await import("./EvidenceViewOffer-6344EX74.js");await new Promise(i=>{let s=n(r.default.createElement(o,{packPath:e,viewerBase:t,onDone:()=>{s.unmount(),i()}}),{stdout:process.stderr,exitOnCtrlC:!1})})}async function Pn(e,t,r=process.cwd(),n={}){let o=n.out??(d=>process.stdout.write(d+`
|
|
7
7
|
`)),i=n.err??(d=>process.stderr.write(d+`
|
|
8
8
|
`)),s=d=>(i(`evidence merge: ${d}`),2);if(!t.runId)return s("--run-id is required (merged identity is the caller's fact)");if(t.rules&&t.onCollision)return s("--rules and --on-collision are mutually exclusive");let a;if(t.onCollision!==void 0){let d=er(t.onCollision);if(!d)return s(`invalid --on-collision: ${t.onCollision} (expected error | prefer-first | prefer-latest | discard)`);a=d}let c=[];for(let d of e){let m=await Cn(d,r);if(!m)return s(`no pack found for "${d}"`);c.push(m)}let u=t.out?je(r,t.out):h(t.runId,r),l=[],p={files:t.policy??[],ids:t.policyId??[]};if(p.files.length+p.ids.length>0){if(!t.finalize)return s("--policy and --policy-id need a sealed merge (drop --no-finalize)");let d=await et(p,{cwd:r,fetchPolicy:n.fetchPolicy??tt({env:t.env})});if(!d.ok)return s(d.message);l=d.policies}let f=null,y;t.rules?y=je(r,t.rules):(f=await G.mkdtemp(rr(Rn(),"kane-merge-rules-")),y=rr(f,"merge-rules.yaml"),await G.writeFile(y,tr(a)));try{let d=await(n.mergeFn??Xe)(c,{runId:t.runId,out:u,rulesPath:y,title:t.title,finalize:!1});t.finalize&&(await(n.sealMergedFn??((k,L)=>An(k,L,U(t.env))))(u,Ze(d)),d={...d,output:{...d.output,finalized:!0}});let m=l.length?await nt(u,l,{judge:n.judge}):void 0;if(t.json)if(m){let{type:_,...k}=it(m,En(u,".evidence"));o(JSON.stringify({...d,verdict:{...k,verdicts:m.verdicts}}))}else o(JSON.stringify(d));else if(Dn(o,d),m){o(ot(m));for(let _ of m.files)o(` ${_}`)}return d.output.finalized&&!t.json&&await(n.offer??De)({packPath:u,env:t.env,isTTY:n.isTTY??(!!process.stdin.isTTY&&!!process.stderr.isTTY),log:i}),m?.filesError!==void 0?(i(`evidence merge: cannot write the verdict files: ${m.filesError}`),2):rt(0,m)}catch(d){let m=d instanceof Error?d.message:String(d);return d?.code==="ABORT"?(i(`evidence merge: aborted \u2014 ${m}`),1):s(m)}finally{f&&await G.rm(f,{recursive:!0,force:!0}).catch(()=>{})}}async function An(e,t,r){if(!t)throw new Error("cannot seal the merged pack: none of the merged packs records when it ended or started");await z(e,await r),await C(e,t)}async function Cn(e,t){let r=je(t,e);if(await nr(r))return r;let n=h(e,t);return await nr(n)?n:null}async function nr(e){try{return await G.stat(e),!0}catch{return!1}}function Dn(e,t){let{packs:r,tests:n,output:o}=t;e(`evidence: merged ${n.merged} tests from ${r.eligible.length} packs -> ${o.path} (${o.finalized?"sealed":"live"})`);for(let i of r.skipped)e(` skipped ${i.runId}: ${i.rule} \u2014 ${i.reason}`);for(let i of n.collisions){let s;i.action==="nest"?s=`nested into ${i.folder}, latest ${i.winner}`:i.action==="split"?s=`split into ${i.folder}`:s=`winner ${i.winner}`,e(` collision ${i.test}: ${s} (${i.rule})`)}for(let i of n.discarded)e(` discarded ${i}`)}import{copyFileSync as jn,existsSync as Oe,mkdirSync as On}from"fs";import{join as ir}from"path";function Ln(e,t,r){try{let n=ir(e,"auteur","execution.json");if(Oe(n))return!0;for(let o of t)if(!(!o||!Oe(o)))return On(ir(e,"auteur"),{recursive:!0}),jn(o,n),!0}catch(n){try{r?.("debug","EVIDENCE_BLOB_COPY_FAILED","auteur execution blob copy failed",{operation:"ensureAuteurExecution",source:t.find(o=>o&&Oe(o))??null,error:n instanceof Error?n.message:String(n)})}catch{}}return!1}import{mkdirSync as Mn,writeFileSync as Fn}from"fs";import{join as or}from"path";function Tn(e,t,r){try{return Mn(or(e,"auteur"),{recursive:!0}),Fn(or(e,"auteur","dataset.json"),JSON.stringify(t,null,2)+`
|
|
9
9
|
`,"utf8"),!0}catch(n){try{r?.("debug","EVIDENCE_DATASET_WRITE_FAILED","auteur dataset record write failed",{dataset_id:t.dataset_id,error:n instanceof Error?n.message:String(n)})}catch{}}return!1}import{readFileSync as Nn}from"fs";import{join as $n}from"path";var sr="module_block";var Bn=new Set(["generative_block",sr]);function Me(e){let t=[],r=!0,n=i=>{if(i===null||typeof i!="object")return;let s=i;if(Array.isArray(s.operations))for(let a of s.operations){let c=a?.operation_id;typeof c=="string"&&c&&t.push(c)}if(Array.isArray(s.children)){Bn.has(s.content_type)||(r=!1);for(let a of s.children)n(a)}if(Array.isArray(s.branches)){r=!1;for(let a of s.branches){let c=a?.children;if(Array.isArray(c))for(let u of c)n(u)}}},o=e?.instructions;if(Array.isArray(o))for(let i of o)n(i);return{ids:t,linear:r}}function Vn(e){return Me(e).ids}function Le(e,t){let r=new Set(t.map(a=>a.action_id).filter(Boolean)),n=-1;for(let a of r){let c=e.indexOf(a);c>n&&(n=c)}let o=t.reduce((a,c)=>Math.max(a,c.ordinal),0),i=new Set,s=[];for(let a of e.slice(n+1))r.has(a)||i.has(a)||(i.add(a),s.push({id:a,ordinal:++o,status:"skipped",action_id:a}));return s}function ar(e,t){let r=new Set(t),n=e.filter(i=>i.action_id);if(n.some(i=>r.has(i.action_id))||n.length>t.length)return null;let o=0;return e.map(i=>i.action_id?{...i,action_id:t[o++]}:i)}function Un(e,t){if(e.length>t.length)return!1;for(let r=0;r<e.length;r++)if(t[r]!==e[r].action_id)return!1;return!0}function zn(e,t,r,n=!0){if(t.length===0)return{steps:e,tail:[]};let o=(r&&n?ar(e,t):null)??e,i=o.filter(a=>a.action_id),s=new Set(t);return i.length>0&&i.every(a=>s.has(a.action_id))?{steps:o,tail:Le(t,o)}:i.length>0&&!Un(i,t)?{steps:o,tail:[],unjoined:!0}:{steps:o,tail:Le(t,o)}}function cr(e){try{let t=Nn($n(e,"auteur","execution.json"),"utf8");return Me(JSON.parse(t))}catch{return{ids:[],linear:!0}}}function Yn(e){return cr(e).ids}export{j as a,se as b,ae as c,ce as d,ue as e,de as f,le as g,lr as h,pe as i,me as j,pr as k,mr as l,fe as m,H as n,ve as o,ye as p,he as q,we as r,fr as s,be as t,gr as u,ke as v,xe as w,Se as x,Vt as y,Re as z,Ee as A,Yt as B,Lr as C,B as D,Vr as E,Zt as F,Qt as G,ln as H,pn as I,mn as J,fn as K,bn as L,tr as M,De as N,Pn as O,Ln as P,Tn as Q,sr as R,Me as S,Vn as T,Le as U,ar as V,zn as W,cr as X,Yn as Y};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as f}from"./chunk-FNUGDPTS.js";import{a as d}from"./chunk-TD6GCEIK.js";import{c as p}from"./chunk-4C7WVQOD.js";import{g}from"./chunk-HYJVYYAZ.js";import{existsSync as i}from"fs";import{resolve as a}from"path";function A(){let n=g().packageRoot;return n===null?[]:[n]}function S(n){return{"darwin-arm64":"kane-cli-darwin-arm64","darwin-x64":"kane-cli-darwin-x64","linux-x64":"kane-cli-linux-x64","linux-arm64":"kane-cli-linux-arm64","win32-x64":"kane-cli-win-x64"}[n]??null}function _(n){return{"darwin-arm64":"kane-cli-assurance-darwin-arm64","darwin-x64":"kane-cli-assurance-darwin-x64","linux-x64":"kane-cli-assurance-linux-x64","linux-arm64":"kane-cli-assurance-linux-arm64","win32-x64":"kane-cli-assurance-win-x64"}[n]??null}function C(n=A()){let e=S(`${process.platform}-${process.arch}`),c=_(`${process.platform}-${process.arch}`),t=process.platform==="win32"?"assurance-agent.exe":"assurance-agent";for(let r of n){for(let s of c?["@testmuai","@lambdatestincprivate"]:[]){let o=a(r,"node_modules",s,c,"bin",t);if(i(o))return{cmd:o,args:[],tier:"platform"}}for(let s of e?["@testmuai","@lambdatestincprivate"]:[]){let o=a(r,"node_modules",s,e,"bin",t);if(i(o))return{cmd:o,args:[],tier:"platform"}}let m=a(r,"dist","bin",t);if(i(m))return{cmd:m,args:[],tier:"embedded"};let u=a(r,"../assurance-agent/dist",t);if(i(u))return{cmd:u,args:[],tier:"sibling"};let l=a(r,"../assurance-agent/main.py");if(i(l)){let s=a(r,"../assurance-agent/.venv/bin/python");return{cmd:i(s)?s:"python3",args:[l],tier:"dev-python"}}}return null}var x=12e4+p;function U(n,e={}){return{...process.env,...d(process.env),...e,...f(),TESTMUAI_SOURCE:"kane-cli",TESTMUAI_SESSION_ID:n,ASSURANCE_LOG_LEVEL:process.env.ASSURANCE_LOG_LEVEL??"info",PYTHONIOENCODING:"utf-8",PYTHONUTF8:"1",ASSURANCE_CHECKPOINT_SAVE_DEADLINE_S:String(x/1e3)}}async function w(n,e=process.env){if(e.TESTMUAI_API_KEY||e.TESTMUAI_BASIC_AUTH)return{};try{let t={TESTMUAI_ENV:e.TESTMUAI_ENV==="stage"?"stage":"prod"},r=await n.controller();return r.basic?(t.TESTMUAI_BASIC_AUTH=Buffer.from(`${r.basic.username}:${r.basic.accessKey}`,"utf8").toString("base64"),t):r.token?(t.TESTMUAI_API_KEY=r.token,t):{}}catch{return{}}}export{S as a,_ as b,C as c,x as d,U as e,w as f};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
var r=new Set,s=[];function i(){let e=new Set;for(let t of r){e.add(t);let o=JSON.stringify(t).slice(1,-1);e.add(o),e.add(encodeURIComponent(t)),e.add(encodeURIComponent(t).replace(/%20/g,"+")),e.add(Buffer.from(t,"utf8").toString("base64"))}let n=[...r];for(let t of n)for(let o of n)t!==o&&e.add(Buffer.from(`${t}:${o}`,"utf8").toString("base64"));s=[...e].filter(t=>t.length>=4).sort((t,o)=>o.length-t.length)}function c(e){let n=!1;for(let t of e)typeof t!="string"||t.length<4||r.has(t)||(r.add(t),n=!0);n&&i()}function a(e){if(s.length===0||!e)return e;let n=e;for(let t of s)n.includes(t)&&(n=n.split(t).join("***"));return n}var f=64*1024*1024;export{c as a,a as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as O,d as S}from"./chunk-
|
|
2
|
+
import{b as O,d as S}from"./chunk-35WUYKGO.js";import{c as L}from"./chunk-RFHMDQXZ.js";import{n as P,o as R}from"./chunk-UJLULWSR.js";import{a as y}from"./chunk-HCBYKLMW.js";import{a as E,b as o,i as h}from"./chunk-33DWJV67.js";import{a as B}from"./chunk-6YGTRKDT.js";import{z as s}from"./chunk-J4FIESTB.js";import{e as d}from"./chunk-UR6MHSHU.js";var n=d(B(),1);import{basename as D}from"path";var r=d(y(),1),U="evidence-view-server";function Q({packPath:m,viewerBase:w,onDone:V,openUrl:k}){let[t,a]=(0,n.useState)("ask"),[g,b]=(0,n.useState)(null),[l,p]=(0,n.useState)(null),f=(0,n.useRef)(null),u=(0,n.useRef)(!1),x=async()=>{let e=f.current;f.current=null,e&&(R(U),await e.close())},v=()=>{u.current||(u.current=!0,V())};return h((e,i)=>{u.current||(t==="ask"?e==="y"||e==="Y"?a("starting"):(e==="n"||e==="N"||i.return||i.escape)&&v():t==="serving"&&(e==="q"||e==="Q"||i.escape)&&x().then(v))}),(0,n.useEffect)(()=>{if(t!=="starting")return;let e=!1;return(async()=>{try{let i=D(m),c=await O({packs:new Map([[i,m]]),allowedOrigins:[new URL(w).origin]});if(e){await c.close();return}f.current=c,P(U,()=>{c.close()});let T=S(c.urlFor(i),w);b(T);try{await(k??(q=>L(q)))(T)}catch{p("could not open browser \u2014 open the URL manually")}a("serving")}catch(i){p(`evidence view failed \u2014 ${i.message}`),a("failed")}})(),()=>{e=!0}},[t]),(0,n.useEffect)(()=>{if(t!=="failed")return;let e=setTimeout(v,0);return()=>clearTimeout(e)},[t]),(0,n.useEffect)(()=>()=>{x()},[]),t==="ask"?(0,r.jsxs)(o,{children:["View evidence in browser? ",(0,r.jsx)(o,{color:s.dim,children:"(y/N)"})]}):t==="serving"||t==="starting"?(0,r.jsxs)(E,{flexDirection:"column",children:[g?(0,r.jsxs)(o,{children:["viewer ",(0,r.jsx)(o,{color:s.orange,children:g})]}):(0,r.jsx)(o,{color:s.dim,children:"starting\u2026"}),l?(0,r.jsx)(o,{color:"yellow",children:l}):null,t==="serving"?(0,r.jsx)(o,{color:s.dim,children:"Press q when done"}):null]}):l?(0,r.jsx)(o,{color:"yellow",children:l}):null}export{Q as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{eb as u,fb as c}from"./chunk-
|
|
2
|
+
import{eb as u,fb as c}from"./chunk-PI7OXS62.js";import{b as f}from"./chunk-7V4BQSSV.js";import{existsSync as o,mkdirSync as g,readFileSync as b}from"fs";import{dirname as l,join as m}from"path";function s(t,r){let n=r.startsWith("sha256:")?r.slice(7):r;return m(t,"blobs",n.slice(0,2),n.slice(2))}function F(t,r){return s(t,r)}function p(t){let r=Buffer.concat([Buffer.from("assurance.blob\0","utf8"),t]);return"sha256:"+f(r)}function y(t,r){let n=p(r),i=s(t,n);if(!o(i)){let e=l(i),a=!o(e);g(e,{recursive:!0}),u(i,r),a&&c(l(e))}return n}function S(t,r){let n=s(t,r);return o(n)?b(n):null}export{F as a,p as b,y as c,S as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as ue,c as fe}from"./chunk-
|
|
2
|
+
import{a as ue,c as fe}from"./chunk-VO2NNXKR.js";import{a as ae}from"./chunk-SXBPUUQ5.js";import{k as re,l as oe}from"./chunk-4CJQ7XZP.js";import{a as C,b as k}from"./chunk-TAY7J5VS.js";import{c as de,d as ce,f as le}from"./chunk-YNDELIXL.js";import{B as A,Ba as ie,Ha as f,M as K,T as H,V as x,W as q,X as O,Z as B,ba as G,fa as z,ga as J,ia as Q,ja as V,ka as X,ma as Y,na as Z,pa as P,qa as ee,ra as ne,s as W,ua as te,va as se,y as D,z as U}from"./chunk-WE7HRAGO.js";import{a as S}from"./chunk-RQKMSNEU.js";import{a as w}from"./chunk-4C7WVQOD.js";import{oa as L}from"./chunk-PI7OXS62.js";import{a as p}from"./chunk-FOJHSG5M.js";import{z as I}from"./chunk-J4FIESTB.js";var ve={usecase:"use_case",scenario:"scenario",test:"test",ac:"acceptance_criterion",source:"source"},b={use_case:"the use case",scenario:"the scenario",test:"the test",acceptance_criterion:"the acceptance criterion",source:"the document"};async function pe(e,n,s,i=()=>{}){let r=e,t=r?.entity;if(typeof t!="string"||t==="")return null;let c=async d=>{if(typeof d!="string")return null;try{let a=await n.mainNode(s,d),o=ve[a.label];if(!o)return null;let l=o==="acceptance_criterion"?a.content.text:a.content.title;return{kind:o,id:a.name,title:typeof l=="string"&&l!==""?l:null}}catch(a){return i(`the conflict's node couldn't be read, so the save's refusal names nothing: ${k(a)}`),null}};if(r?.kind==="source")return{kind:"source",id:t,title:typeof r.fileName=="string"&&r.fileName!==""?r.fileName:null};if(r?.kind==="edge"){let[d,a]=r.ends?await Promise.all([c(r.ends.from),c(r.ends.to)]):[null,null];return d||a?{kind:"link",from:d,to:a}:null}if(r?.kind==="node"||t.startsWith("sha256:"))return c(t);try{return(await n.sources(s)).some(d=>d.sourceId===t)?{kind:"source",id:t,title:null}:null}catch(d){return i(`the project's sources couldn't be read, so the save's refusal names nothing: ${k(d)}`),null}}function $(e){if(e.kind==="source")return e.title?`${b.source} "${e.title}"`:"a document this session reads";let n=e.id?L(e.id):null;return e.kind==="acceptance_criterion"&&n?`${b[e.kind]} ${n}`:e.title?`${b[e.kind]} "${e.title}"`:n?`${b[e.kind]} ${n}`:b[e.kind]}function me(e,n,s,i=[]){return{code:"PROJECT_CHANGED",message:`not saved \u2014 another save also changed ${e.kind!=="link"?$(e):e.from&&e.to?`the link between ${$(e.from)} and ${$(e.to)}`:`a link to ${$(e.from??e.to)}`}`,detail:`this session can't be saved now, so ${Z(n)} won't reach the project`,remedy:V(s,i)}}function ke(e){let n=le(e);return n!==null?de(n,S()):ce("save",S())}async function ge(e,n){if(n.verb!=="evolve")return{notUpdated:[],stillStale:0,repins:new Map};let s=await e.sessionLog?.().catch(()=>[])??[],i=s.filter(t=>t.kind==="evolve_not_updated").at(-1)?.body,r=t=>Array.isArray(t)?t.filter(c=>typeof c=="string"):[];return{notUpdated:r(i?.use_cases),stillStale:r(i?.still_stale).length,repins:q(s)}}function _(e,n){let s=n==="agent"?" --mode agent":"";return e.verb==="evolve"?`kane-cli maintain evolve ${e.useCase??"--from-stale"}${s}`:e.verb==="design"&&e.useCase?`kane-cli design tests --use-case ${e.useCase}${s}`:`kane-cli context extract${s}`}async function Ke(e){let n={...e,trace:e.trace??ke(e.sid)},s=n.mode==="agent",i=n.print??(c=>{process.stdout.write(`${c}
|
|
3
3
|
`)}),r=(c,d)=>(n.trace.line("save_refused",{sid:n.sid,...c.code?{code:c.code}:{},exit:d}),s?n.emit({type:"error",code:c.code,message:c.message,...A(c)}):(re(c),i("")),d),t=!1;try{return await be(n,s,i,r,()=>t=!0)}catch(c){return c instanceof w&&c.retryable?r(t?f.saveUnconfirmed():f.noConnectionToSave(),2):r(f.assuranceOffOr(c,n.projectName,f.saveFailed("your work is")),1)}}async function be(e,n,s,i,r){let t;try{t=await e.person.getSession(e.sid)}catch(u){if(u instanceof w&&u.code==="NOT_FOUND")return i(f.noSuchSession(e.sid),2);throw u}if(t.ended==="failed")return i(f.sessionFailed(e.sid),2);if(t.ended!=="complete")return i(f.notFinished(e.sid,P(t.verb==="design"||t.verb==="evolve"?"design":"extract",e.sid,n)),2);if(t.scope?.state==="finalized")return T(e,t,{},n,s,i,r,!0);let c=await G(e.person,e.projectId,e.sid);if(!z(c,(t.scope?.position??t.basePosition)>t.basePosition))return await e.person.discard(e.sid,t.generation).catch(()=>{}),n?e.onProgress({kind:"save",sid:e.sid,phase:"saved",landed:0}):s(f.nothingToSave),0;let{notUpdated:d,repins:a}=await ge(e,t),o=O(x(t.verb,c),a);if(e.trace?.line("save_check",{sid:e.sid,verb:t.verb,counts:c}),n)return e.onProgress({kind:"save",sid:e.sid,phase:"check",project:e.projectName,counts:c,...d.length>0?{notUpdated:d}:{},...o.replaces?{replaces:o.replaces}:{},...o.keeps?{keeps:o.keeps}:{}}),e.yes?T(e,t,c,n,s,i,r):i(f.confirmRequired(e.sid),2);let l=(await e.person.project(e.projectId))?.mainPosition??null,g=l!==null&&l>t.basePosition;for(let u of ye(e.projectName,o,g))s(u);s("");let m=e.yes||await e.confirm("save this session? (y/N)");return e.yes||s(""),m?T(e,t,c,n,s,i,r):(s(`not saved \u2014 your work is kept in session ${e.sid}`),0)}function ye(e,n,s){return[p.bold(`save this session to "${e}"`),...J(n,s).map(([i,r])=>`${p.dim(` ${i.padEnd(10)}`)}${r}`)]}function we(e,n="",s=process.stdout.columns,i=null,r=null){let t=[];if(e.receipt!==null&&t.push(`${n}${p.green(`\u2714 ${e.receipt}`)}`),i?.line&&t.push(`${n}${p.dim(i.line)}`),i?.replacedHead&&i.replaced){t.push(`${n}${p.dim(i.replacedHead)}`);for(let d of i.replaced){if(t.push(`${n}${p.dim(` ${d.file}`)}`),d.by.length===0)continue;let a=` replaced by ${d.by.length===1?d.by[0]:`${d.by.slice(0,-1).join(", ")} and ${d.by[d.by.length-1]}`}`;!s||n.length+a.length<=s?t.push(`${n}${p.dim(a)}`):d.by.forEach((o,l)=>t.push(`${n}${p.dim(l===0?` replaced by ${o}`:` and ${o}`)}`))}}if(i?.needed){let d=[...D(i.needed,{cwd:process.cwd(),tests:i.needed.tests,indent:0,...s?{columns:s-n.length}:{}}),...U(i.needed.noStartPage,{indent:0})];for(let a of d)t.push(`${n}${p.dim(a)}`)}let c=Re(e.lines,i?.lines??[],r);if(c.length>0){t.push("");let d=a=>s&&!a.startsWith(" kane-cli ")?oe(a,s):a;for(let a of c)t.push(a.tone==="warning"?p.hex(I.amber)(d(a.text)):a.tone==="detail"?p.dim(a.command?$e(a.text,s):a.text):d(a.text));(e.support||i?.support)&&t.push(`if this keeps failing, share this id with support: ${W(e.support?"refused_TEST_MANAGER":"refused_TEST_FILES")}`)}return t}function $e(e,n){let s=e.indexOf("run: kane-cli ");if(!n||e.length<=n||s<0)return e;let i=e.match(/^ */)[0];return`${e.slice(0,s+4)}
|
|
4
4
|
${i} ${e.slice(s+5)}`}function Re(e,n,s){if(n.length===0)return e;if(e.length===0)return n;let i=c=>c.text.startsWith("next: "),r=e.findIndex(i),t=n.findIndex(i);return s!==null&&r>=0&&t>=0?[...e.slice(0,r),...n.slice(0,t),{text:s,tone:"plain"},...e.slice(r+1),...n.slice(t+2)]:[...e,{text:"",tone:"plain"},...n]}async function T(e,n,s,i,r,t,c,d=!1){e.onProgress({kind:"save",sid:e.sid,phase:"saving"}),d&&!i&&r(f.savedBefore);let a=o=>{i||r(d?`finishing test cases in Test Manager\u2026 ${o}`:`saving\u2026 ${o}`)};try{c();let o=await e.person.land(e.sid,n.generation),l=n.verb==="design"||n.verb==="reconcile"||n.verb==="evolve"?await fe({person:e.person,projectId:n.projectId,landing:o,cwd:process.cwd()}):null,g=o.testManager?.notCovered?.length?await ue({person:e.person,projectId:n.projectId,landing:o}):void 0;e.trace?.line("save_landed",Ne(e.sid,o,l));let m=B(s),{stillStale:u,repins:R}=await ge(e,n),{changes:M,approves:j,archives:E,removes:F}=s,v=O(x(n.verb,s),R);if(e.onProgress({kind:"save",sid:e.sid,phase:"saved",landed:o.landed,...m>0?{heldChanges:m}:{},...M?{changes:M}:{},...j?{approves:j}:{},...E?{archives:E}:{},...F?{removes:F}:{},...v.replaces?{replaces:v.replaces}:{},...v.keeps?{keeps:v.keeps}:{},...s.uncounted?{uncounted:s.uncounted}:{},...o.testManager!==void 0?{testManager:o.testManager}:{},...g?{sessionUseCases:[...g]}:{},...l!==null?{testFiles:l}:{},...u>0?{stillStale:u}:{}}),!i){let y=ne(o.testManager,e.sid,e.projectName,g,ee(l)),N=l===null?null:te(l,e.sid,d,{testManager:o.testManager});if(d){let h=y.receipt===null&&y.lines.length===0;a(o.testManager?.error?"stopped":h?"nothing left to do":"done"),(y.receipt!==null||N?.line)&&r("")}else{a("saved"),r("");let h=H(v);r(p.green(`\u2714 saved to "${e.projectName}"${h?` \u2014 ${h}`:""}`));for(let he of K(v))r(p.dim(` ${he}`))}for(let h of we(y,"",void 0,N,se(o.testManager,N,e.projectName)))r(h);if(u>0)for(let h of ie.stillOutOfDate(u))r(h);r("")}return 0}catch(o){if(!(o instanceof w))throw o;if(o.retryable)return a("failed"),i||r(""),t(f.saveUnconfirmed(),2);if(o.code==="SESSION_NOT_FINISHED")return a("failed"),i||r(""),t(f.notFinished(e.sid,P(n.verb==="design"||n.verb==="evolve"?"design":"extract",e.sid,i)),2);if(o.code==="SCOPE_BEHIND_HEAD"){let g={kind:"save",sid:e.sid,phase:"behind"},m=await pe(o.extra.conflict,e.person,e.projectId,C("remote-save")),u=Y(n);if(i){let R=u.length>0?{cmd:`${X(u)} --mode agent`,why:"start again from the latest, adding this session's documents again"}:{cmd:_(n,e.mode),why:"start again from the latest"};return e.emit({...ae(g),...m?{conflict:m}:{},next:[R]}),2}return e.onProgress(g),a("failed"),r(""),t(m?me(m,s,_(n,e.mode),u):f.projectChanged(e.projectName,s,_(n,e.mode),u),2)}let l=o.code==="SCOPE_RECORD_REFUSED";return l&&C("remote-save")(`session ${e.sid}: the save was refused: ${k(o)}`),e.onProgress({kind:"save",sid:e.sid,phase:"failed",reason:"not_accepted",...l?{code:"SCOPE_RECORD_REFUSED"}:{}}),i?1:(a("failed"),r(""),t(f.saveFailed(Q(s)),1))}}function Ne(e,n,s){return{sid:e,landed:n.landed,...n.testManager!==void 0?{test_manager:n.testManager===null?null:{error:n.testManager.error??null}}:{},...s!==null?{test_files:s==="unread"?"unread":{written:s.wrote.length,refused:s.refused.length}}:{}}}export{pe as a,me as b,ke as c,Ke as d,we as e,Ne as f};
|