@testmuai/kane-cli 0.10.4 → 0.10.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ChatSurface-DN7VVN3Y.js → ChatSurface-WKYH5MYP.js} +1 -1
- package/dist/{ChromeProfilePicker-TVGWXTUU.js → ChromeProfilePicker-ROQIRMWR.js} +1 -1
- package/dist/{CliFeedbackPrompt-L5ILK66U.js → CliFeedbackPrompt-55OKAT4W.js} +1 -1
- package/dist/{CliUploadProgress-IU6BQLMV.js → CliUploadProgress-NK2U3CKQ.js} +1 -1
- package/dist/{ConfigView-LU5IRRQU.js → ConfigView-7A5JTKLF.js} +1 -1
- package/dist/{EvidenceViewOffer-DNTARDEL.js → EvidenceViewOffer-U7J5ZRVK.js} +1 -1
- package/dist/{FolderPicker-6E5GE2K2.js → FolderPicker-R4QDIFTW.js} +1 -1
- package/dist/{InfoBox-SFFPLWCV.js → InfoBox-SRQ4TSUT.js} +1 -1
- package/dist/{LinksBox-6YDTIO6I.js → LinksBox-7BWLLQVR.js} +1 -1
- package/dist/{ProfilesView-6C5HJQ3Y.js → ProfilesView-TQTJR4WQ.js} +1 -1
- package/dist/{ProjectPicker-YIQIVXGK.js → ProjectPicker-A5SXNDUL.js} +1 -1
- package/dist/{SaveSessionPrompt-X3N6OGYB.js → SaveSessionPrompt-IECYZMXW.js} +1 -1
- package/dist/SingleShotApp-MN5IE6EU.js +2 -0
- package/dist/{SummaryBox-T7PDXDKS.js → SummaryBox-WFOS6GON.js} +1 -1
- package/dist/{TestMdRunView-HRJSBP2C.js → TestMdRunView-URNSXIVC.js} +1 -1
- package/dist/TestrunEvidenceTable-SZPZMW3J.js +2 -0
- package/dist/{WhoamiView-WGCWD7GP.js → WhoamiView-G6QP4SID.js} +1 -1
- package/dist/{app-download-ZS6ZMX2Z.js → app-download-UGLDWWTX.js} +1 -1
- package/dist/{assurance-job-QO4VJJCL.js → assurance-job-V5QB36WJ.js} +1 -1
- package/dist/{binary-CCCTW3QQ.js → binary-32FXH6PQ.js} +1 -1
- package/dist/{bind-JU4XPDN3.js → bind-3PB77PWJ.js} +1 -1
- package/dist/{bootstrap-BV7HAARR.js → bootstrap-A2O4UZUJ.js} +1 -1
- package/dist/{catalog-ZAROGOJA.js → catalog-P5IOIVYP.js} +1 -1
- package/dist/{catalog-client-QLHCEPPZ.js → catalog-client-LR2KPSU7.js} +1 -1
- package/dist/{changelog-6L7W76ZH.js → changelog-GKIKDJ32.js} +1 -1
- package/dist/{chunk-FTP2K6RS.js → chunk-2AHQ3D3D.js} +1 -1
- package/dist/{chunk-SZQNYDST.js → chunk-2G7UYQOW.js} +1 -1
- package/dist/{chunk-3O2RPYPM.js → chunk-2MBNAW2G.js} +1 -1
- package/dist/{chunk-SO3IXFAJ.js → chunk-2NP3THOE.js} +1 -1
- package/dist/{chunk-YZP4F23B.js → chunk-37KFCYHG.js} +1 -1
- package/dist/{chunk-Z4O5HOFX.js → chunk-3RJRCAUX.js} +3 -3
- package/dist/{chunk-PBVNX43X.js → chunk-4DM5EWEV.js} +1 -1
- package/dist/{chunk-QYWWL7M7.js → chunk-5K7PCSTP.js} +1 -1
- package/dist/{chunk-LCBDNZL3.js → chunk-5LKDOE3P.js} +1 -1
- package/dist/{chunk-ZVSZ6DIQ.js → chunk-5OFHMBZC.js} +2 -2
- package/dist/{chunk-SMSQVGLH.js → chunk-63BFLTJI.js} +1 -1
- package/dist/{chunk-PMYN3XMN.js → chunk-642GD7E6.js} +1 -1
- package/dist/{chunk-HMGM4KO6.js → chunk-66C5A2F5.js} +1 -1
- package/dist/{chunk-3HGKFRFL.js → chunk-6OL5EVRC.js} +1 -1
- package/dist/{chunk-LLDEAV3W.js → chunk-6PZ3SVWE.js} +1 -1
- package/dist/{chunk-7V6JPZBM.js → chunk-6VG2FG67.js} +1 -1
- package/dist/{chunk-Q5B54TR5.js → chunk-6WN4WSXR.js} +1 -1
- package/dist/{chunk-TO2ROHIJ.js → chunk-76MKY7FG.js} +2 -2
- package/dist/{chunk-2CJ75THZ.js → chunk-77BZTEHJ.js} +1 -1
- package/dist/chunk-7TSM2FCL.js +5 -0
- package/dist/{chunk-ECPSBI2Z.js → chunk-A5C7HIAH.js} +1 -1
- package/dist/{chunk-BV7NUIRT.js → chunk-AXOSLGQ4.js} +1 -1
- package/dist/{chunk-DJ76NDW6.js → chunk-BDZWRJAL.js} +1 -1
- package/dist/{chunk-6PURZLKM.js → chunk-BFRWZPIK.js} +1 -1
- package/dist/{chunk-MWLRLQ27.js → chunk-BLHFNL5K.js} +1 -1
- package/dist/chunk-BRWCWZE3.js +2 -0
- package/dist/{chunk-IQMJJN52.js → chunk-BZEW7CSM.js} +1 -1
- package/dist/{chunk-TXRWH6HL.js → chunk-C466XER3.js} +2 -2
- package/dist/{chunk-55W3WAAL.js → chunk-C4UME2PA.js} +1 -1
- package/dist/{chunk-ZHENGHYZ.js → chunk-CBPACEYQ.js} +1 -1
- package/dist/{chunk-IDWAG6L4.js → chunk-CJGQFKLJ.js} +1 -1
- package/dist/{chunk-4G2T54FE.js → chunk-CQBLJTDU.js} +1 -1
- package/dist/{chunk-BPTWMV5L.js → chunk-CVVUBCB7.js} +1 -1
- package/dist/{chunk-4WFN23DE.js → chunk-EIQSXD7B.js} +1 -1
- package/dist/{chunk-AFOP7DVG.js → chunk-EP4WGGMY.js} +1 -1
- package/dist/{chunk-S5PIVHPC.js → chunk-F4GWIX66.js} +1 -1
- package/dist/{chunk-GMSWZIAS.js → chunk-FHULYIG3.js} +1 -1
- package/dist/{chunk-JE5M5QIK.js → chunk-FKA5SWWF.js} +1 -1
- package/dist/{chunk-WHMCVH3T.js → chunk-FLGOQ6Q6.js} +1 -1
- package/dist/{chunk-ABNQL3PQ.js → chunk-FNBHP75S.js} +1 -1
- package/dist/{chunk-GJYMR4RT.js → chunk-FOURJ24E.js} +1 -1
- package/dist/{chunk-UZKVV3LW.js → chunk-FOUUD3LI.js} +1 -1
- package/dist/{chunk-CVVZ6NWR.js → chunk-FP6JCXOS.js} +1 -1
- package/dist/{chunk-WMIR4UXG.js → chunk-H23ZMHHC.js} +1 -1
- package/dist/{chunk-ZFKR5I3J.js → chunk-HHF7AM3D.js} +1 -1
- package/dist/{chunk-6CMBA5SG.js → chunk-HTJDMLZS.js} +1 -1
- package/dist/{chunk-DRWHVVW6.js → chunk-HY5BBSYX.js} +1 -1
- package/dist/{chunk-RG3FNO37.js → chunk-IPXITNFD.js} +1 -1
- package/dist/{chunk-EWSNJ3IX.js → chunk-IT6M7OMG.js} +1 -1
- package/dist/{chunk-5OGYXLOR.js → chunk-ITG5WMQG.js} +1 -1
- package/dist/{chunk-MZ4GTIO2.js → chunk-J3YID4A5.js} +1 -1
- package/dist/{chunk-TELSHQ3W.js → chunk-J44FV6CH.js} +1 -1
- package/dist/{chunk-JYSIPTX3.js → chunk-J5D4IGAM.js} +1 -1
- package/dist/{chunk-WB4JZ67W.js → chunk-J5QFO7LW.js} +1 -1
- package/dist/{chunk-EOLMWSLX.js → chunk-JGQ3VB44.js} +1 -1
- package/dist/{chunk-MOAZZKIZ.js → chunk-JVXEAO62.js} +1 -1
- package/dist/{chunk-YWQNZRJG.js → chunk-JYH7CTF7.js} +1 -1
- package/dist/{chunk-FH4FWIET.js → chunk-JZ7GFPKZ.js} +1 -1
- package/dist/{chunk-I3G3IUKY.js → chunk-KUSHV5SR.js} +1 -1
- package/dist/{chunk-NMCE7VR2.js → chunk-LMOW4NM5.js} +1 -1
- package/dist/{chunk-UVBPUZC4.js → chunk-LPJX5L3F.js} +1 -1
- package/dist/{chunk-4FA44D6S.js → chunk-LWP7E5FU.js} +1 -1
- package/dist/{chunk-MQU6EA44.js → chunk-LXYXCANZ.js} +1 -1
- package/dist/{chunk-5HJRYEOT.js → chunk-MAQVRBUQ.js} +1 -1
- package/dist/{chunk-4WKFM72U.js → chunk-MBNSCXVK.js} +1 -1
- package/dist/{chunk-P7V24ZXP.js → chunk-MIQ6J5YG.js} +1 -1
- package/dist/{chunk-454IWKHT.js → chunk-MUL2QFG2.js} +1 -1
- package/dist/{chunk-DBMDAWTA.js → chunk-N4XUGIAK.js} +1 -1
- package/dist/{chunk-ACBNVGVJ.js → chunk-NAUIJF72.js} +1 -1
- package/dist/{chunk-QFA6JPVE.js → chunk-NFDVDEOH.js} +2 -2
- package/dist/{chunk-BIXABKSK.js → chunk-NGBXXBHP.js} +1 -1
- package/dist/{chunk-RNKJXVG2.js → chunk-NIBNVPAE.js} +1 -1
- package/dist/{chunk-DAV4ONGS.js → chunk-NNVHWFLI.js} +1 -1
- package/dist/{chunk-QOXUGYEA.js → chunk-NZ7UCAN6.js} +1 -1
- package/dist/{chunk-HGKAUG7L.js → chunk-OPR5XIPT.js} +1 -1
- package/dist/{chunk-QXZGBYGQ.js → chunk-PCL2FYPE.js} +1 -1
- package/dist/{chunk-KJZD2ADR.js → chunk-PE3CEG6E.js} +1 -1
- package/dist/{chunk-3VSAAB2W.js → chunk-PKXWYYVK.js} +1 -1
- package/dist/{chunk-56NUPYFG.js → chunk-PSBR2LVL.js} +1 -1
- package/dist/{chunk-H6QHG62O.js → chunk-PZOQ2IQK.js} +1 -1
- package/dist/{chunk-2VLM4L3S.js → chunk-Q4QCSO6Y.js} +1 -1
- package/dist/{chunk-MNELOQ4J.js → chunk-QJ5XHVS5.js} +1 -1
- package/dist/{chunk-JJDD4HPX.js → chunk-QRUAI2ST.js} +1 -1
- package/dist/{chunk-2KPJ62RZ.js → chunk-QWEQ742S.js} +1 -1
- package/dist/{chunk-DXXHCLFC.js → chunk-R6S4EJ5R.js} +1 -1
- package/dist/{chunk-7WWCIS2B.js → chunk-RHQLDNZL.js} +1 -1
- package/dist/{chunk-X3O4VGTM.js → chunk-RM5ZVDVR.js} +1 -1
- package/dist/{chunk-4KFSSETE.js → chunk-RU3SWHRE.js} +1 -1
- package/dist/{chunk-662MCICY.js → chunk-S5UITUBB.js} +1 -1
- package/dist/{chunk-T5FQRUI2.js → chunk-SACFQNUH.js} +7 -7
- package/dist/{chunk-EG3B52WU.js → chunk-SDIHDYWT.js} +1 -1
- package/dist/{chunk-GPIVYCHQ.js → chunk-SFHDRKUX.js} +1 -1
- package/dist/{chunk-EWK3UPEN.js → chunk-SLISNOG6.js} +1 -1
- package/dist/{chunk-OSEXVHEN.js → chunk-TC2PHBPH.js} +1 -1
- package/dist/{chunk-FQ2AMM3E.js → chunk-TPCW5OU5.js} +1 -1
- package/dist/{chunk-P43YHCF3.js → chunk-UJYC2XDD.js} +1 -1
- package/dist/chunk-UV7FPIBL.js +2 -0
- package/dist/{chunk-A74JRNNX.js → chunk-UWEBI76C.js} +1 -1
- package/dist/{chunk-LV7OWLJK.js → chunk-UWQ4KXLB.js} +1 -1
- package/dist/{chunk-73EHVDL5.js → chunk-V24LUINK.js} +1 -1
- package/dist/{chunk-OX3ZAGCH.js → chunk-V3IWCGZT.js} +1 -1
- package/dist/{chunk-4QV2RL6P.js → chunk-VEE2O524.js} +1 -1
- package/dist/{chunk-3JATEWA5.js → chunk-VJRXJJML.js} +2 -2
- package/dist/{chunk-JM45SLKV.js → chunk-VKIUHHNT.js} +2 -2
- package/dist/{chunk-7KASYSFM.js → chunk-W3PQMIXE.js} +1 -1
- package/dist/{chunk-S74NLCFZ.js → chunk-WAC5WISH.js} +1 -1
- package/dist/{chunk-KLY6IQD5.js → chunk-XJV5SF3X.js} +3 -3
- package/dist/{chunk-ATCJ7EHL.js → chunk-XRJH4UF3.js} +1 -1
- package/dist/{chunk-SBW3QVHN.js → chunk-Y3RDLUH5.js} +5 -5
- package/dist/{chunk-BXAPTB2H.js → chunk-YF22VTR5.js} +3 -3
- package/dist/{chunk-TLYFHPNM.js → chunk-YLI7DQMJ.js} +2 -2
- package/dist/{chunk-BK3LWNKB.js → chunk-YQXOD7SV.js} +3 -3
- package/dist/{chunk-PHKJIJ7D.js → chunk-YTWBNACA.js} +1 -1
- package/dist/{chunk-QEBVYQNC.js → chunk-YUFXE6WU.js} +1 -1
- package/dist/{commands-X5T6YANK.js → commands-TRAUFCRZ.js} +1 -1
- package/dist/{config-F5Q6QX27.js → config-O3BWQUP4.js} +1 -1
- package/dist/{cover-cmd-PWUZU4HK.js → cover-cmd-SAWVP7TL.js} +1 -1
- package/dist/{credentials-D5KQMHCK.js → credentials-NNNODDXF.js} +1 -1
- package/dist/{deps-bundle-R7FNIV4M.js → deps-bundle-CXKBCA7W.js} +1 -1
- package/dist/{deps-resolve-IF6P6NWI.js → deps-resolve-K7XNTRZX.js} +1 -1
- package/dist/{design-chat-HYK3HNIM.js → design-chat-S4KYE6PP.js} +1 -1
- package/dist/{design-headless-DR7WB37W.js → design-headless-DDAFAJNR.js} +1 -1
- package/dist/{design-remote-TGUNEWEM.js → design-remote-UITWJ72Q.js} +2 -2
- package/dist/device-env-SBTHFSVK.js +2 -0
- package/dist/doctor-SRMLENYN.js +2 -0
- package/dist/{evidence-SRWISQMQ.js → evidence-FOWW3MOS.js} +1 -1
- package/dist/{evolve-cmd-2BALEYZU.js → evolve-cmd-MDK2H4JY.js} +1 -1
- package/dist/{evolve-remote-OHOUWO65.js → evolve-remote-4G7YFC5H.js} +1 -1
- package/dist/{explain-cmd-VTDAMXAW.js → explain-cmd-Q4NLNJFB.js} +1 -1
- package/dist/{explore-UZWQRJ7H.js → explore-MWUMVGRM.js} +1 -1
- package/dist/{explore-context-tty-PAKJVDJU.js → explore-context-tty-QLMZGYBX.js} +1 -1
- package/dist/{explore-entry-ZOPO7DBZ.js → explore-entry-QMCVGRP4.js} +4 -4
- package/dist/{explore-live-RUAAZGX4.js → explore-live-QIET6WO4.js} +1 -1
- package/dist/{explore-run-tty-DYLMHI7F.js → explore-run-tty-6UTBRCEF.js} +2 -2
- package/dist/{extract-bind-WPICR4IC.js → extract-bind-UTERWZMW.js} +3 -3
- package/dist/{extract-chat-KVUB5HPM.js → extract-chat-4WBNRVPG.js} +1 -1
- package/dist/{extract-cmd-OJ7LXSKL.js → extract-cmd-SYZX6CML.js} +2 -2
- package/dist/{extract-headless-OQJSUSG4.js → extract-headless-QBF77JWP.js} +1 -1
- package/dist/{folder-flags-MEZUAXTT.js → folder-flags-IJ556UET.js} +1 -1
- package/dist/{gaps-cmd-2R4RMWN6.js → gaps-cmd-E55OGZ7P.js} +1 -1
- package/dist/{gate-SM4HPJLA.js → gate-5UIJVMHL.js} +1 -1
- package/dist/{generate-headless-XR3RVULC.js → generate-headless-VYD2QIUO.js} +2 -2
- package/dist/{impact-cmd-EL3QSOAF.js → impact-cmd-3P6SKFJC.js} +2 -2
- package/dist/index.js +20 -20
- package/dist/{ingest-cmd-N3USC7TW.js → ingest-cmd-HMTLO5MB.js} +3 -3
- package/dist/{ingest-remote-2VKWAFJZ.js → ingest-remote-NIW5VAGW.js} +1 -1
- package/dist/install-KJDAGU2R.js +2 -0
- package/dist/{interactive-bind-F7QTQOKC.js → interactive-bind-K3ZQFHLH.js} +2 -2
- package/dist/{interactive-remote-A33J4KMP.js → interactive-remote-SGM76D6M.js} +1 -1
- package/dist/{lattice-auth-IJT542IF.js → lattice-auth-DCAVEQKY.js} +1 -1
- package/dist/{lifecycle-cmd-OKUFZKEX.js → lifecycle-cmd-Y5DH2PL5.js} +1 -1
- package/dist/{list-cmd-7OTI66MQ.js → list-cmd-RYHICCUV.js} +1 -1
- package/dist/{list-commands-FZPVH76I.js → list-commands-QFTIQE6Q.js} +1 -1
- package/dist/{list-remote-BQ4NILCA.js → list-remote-PWAQBF57.js} +1 -1
- package/dist/login-flow-W7RAVXSD.js +2 -0
- package/dist/{maintenance-cmd-BLV7K4RK.js → maintenance-cmd-JNP2KCSI.js} +1 -1
- package/dist/{mobile-prompts-5TGLJUBV.js → mobile-prompts-SP2RULD7.js} +1 -1
- package/dist/{onboarding-F4EIJ4GD.js → onboarding-YPIKXNYA.js} +1 -1
- package/dist/{persist-recorded-session-WYMOHDTB.js → persist-recorded-session-BWGA7WXR.js} +1 -1
- package/dist/{pipeline-XYM6HIDZ.js → pipeline-YE4IRKQX.js} +1 -1
- package/dist/{policy-commands-AOLVAZZD.js → policy-commands-MSJIPHDB.js} +1 -1
- package/dist/{prepare-target-P4AZWC37.js → prepare-target-G7LU4LYX.js} +1 -1
- package/dist/{pull-cmd-C4HMYD4I.js → pull-cmd-G3PVSSFP.js} +1 -1
- package/dist/{pull-route-MHW5PWDW.js → pull-route-5JQUUSU7.js} +1 -1
- package/dist/real-device-run-425XK527.js +2 -0
- package/dist/{reconcile-cmd-VXY737OT.js → reconcile-cmd-QJBYZVUB.js} +4 -4
- package/dist/{reconcile-remote-UGW2433E.js → reconcile-remote-JMV26DLX.js} +2 -2
- package/dist/{recording-banner-EPOTSMYF.js → recording-banner-VZ67EWWQ.js} +1 -1
- package/dist/{registry-WTWTFRXD.js → registry-3YMKU5GC.js} +1 -1
- package/dist/{remote-entry-SPA4CSJJ.js → remote-entry-6LQRYR5F.js} +1 -1
- package/dist/{remote-mode-QO6BDGXM.js → remote-mode-35BQUMEL.js} +1 -1
- package/dist/{remote-words-TAZT4YBT.js → remote-words-QXVFVHOB.js} +1 -1
- package/dist/{require-project-folder-WBCAVVMB.js → require-project-folder-O2XCXDRE.js} +1 -1
- package/dist/{resolve-run-intent-RBOCIYEA.js → resolve-run-intent-QCRZPYXM.js} +1 -1
- package/dist/{resolver-3BGIXYYJ.js → resolver-LWXOB7PH.js} +1 -1
- package/dist/{review-cmd-WE6I5XTY.js → review-cmd-PYU7YCAC.js} +1 -1
- package/dist/{run-remote-6Y62RWMJ.js → run-remote-PS45MTHW.js} +1 -1
- package/dist/{run-startup-gate-Q7FP2IRE.js → run-startup-gate-YBQB2JLF.js} +1 -1
- package/dist/{run-test-md-24MBKBC6.js → run-test-md-XYOCVA6F.js} +2 -2
- package/dist/session-worker.js +2 -2
- package/dist/{sessions-cmd-5NS5P4CP.js → sessions-cmd-WUWZYZJW.js} +1 -1
- package/dist/{sessions-remote-75PDRPOY.js → sessions-remote-4J7ITZB4.js} +1 -1
- package/dist/{skill-installer-7PK64TZE.js → skill-installer-54ZAFNOB.js} +1 -1
- package/dist/{store-AVYBL5HB.js → store-2F26FIUS.js} +1 -1
- package/dist/{store-choice-ZWU3PDNL.js → store-choice-ZE7AZMRC.js} +1 -1
- package/dist/{store-guard-ETUXXG7X.js → store-guard-X5FIEZWZ.js} +1 -1
- package/dist/{sync-cmd-CSTMT6E6.js → sync-cmd-TAVE44DU.js} +1 -1
- package/dist/{sync-setup-Y53K6TJ6.js → sync-setup-M65RX34Y.js} +1 -1
- package/dist/tcg-generate-OXZF7TNQ.js +2 -0
- package/dist/{testmd-actions-BE4YJ6ZZ.js → testmd-actions-4OHRME2Z.js} +1 -1
- package/dist/{testmd-sync-QZWVWTZZ.js → testmd-sync-HM24JCS7.js} +1 -1
- package/dist/token-refresh-3SEDPIXO.js +2 -0
- package/dist/{validate-basic-QWPESO74.js → validate-basic-HWDR665U.js} +1 -1
- package/dist/{version-check-EOYWTY3Z.js → version-check-DRE5KT7F.js} +1 -1
- package/dist/{view-cmd-KG4HI334.js → view-cmd-3UKV3YEX.js} +1 -1
- package/dist/{walk-session-WM4S2JMV.js → walk-session-W6OLG5NT.js} +1 -1
- package/dist/{with-telemetry-RJM3JKL6.js → with-telemetry-BF4BGK5S.js} +1 -1
- package/package.json +11 -11
- package/dist/SingleShotApp-MXNJPU6A.js +0 -2
- package/dist/TestrunEvidenceTable-OGMWTJQF.js +0 -2
- package/dist/chunk-APXJRWIJ.js +0 -2
- package/dist/chunk-V57R4X3O.js +0 -5
- package/dist/chunk-YKOZBFR3.js +0 -2
- package/dist/device-env-LZB3PKMA.js +0 -2
- package/dist/doctor-PLFEA2HM.js +0 -2
- package/dist/install-3IEM3I3X.js +0 -2
- package/dist/login-flow-BYQ7SYGB.js +0 -2
- package/dist/real-device-run-WAOWKEFJ.js +0 -2
- package/dist/tcg-generate-VQLI6NGK.js +0 -2
- package/dist/token-refresh-PZ3TOKAL.js +0 -2
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as rt,b as st,c as ot}from"./chunk-W3USRQX6.js";import{a as Dt}from"./chunk-JIRNI5TB.js";import{a as R}from"./chunk-UTM7D4PI.js";import{R as nt}from"./chunk-76MKY7FG.js";import{a as tt}from"./chunk-JQ64X2TO.js";import{b as et}from"./chunk-Z36KVIRR.js";import{b as Z,e as Q}from"./chunk-SB26HQO7.js";import{a as X}from"./chunk-FCD3NYOM.js";import{a as Y}from"./chunk-4QTH7VYE.js";import{a as P}from"./chunk-RZ4F3BHX.js";import{e as Ct}from"./chunk-UR6MHSHU.js";import{readFileSync as L,existsSync as H,readdirSync as ke,mkdirSync as J,writeFileSync as x}from"fs";import{readFile as jt,unlink as Re}from"fs/promises";import{join as v}from"path";import{existsSync as de,mkdirSync as _e,readdirSync as Rt,writeFileSync as pe}from"fs";import{join as S}from"path";import{randomUUID as k}from"crypto";var at=["children","instructions","branches","module_content","true_branch","false_branch"];function D(t){let e=new Map,n=r=>{if(!r||typeof r!="object")return;let o=r;if(Array.isArray(o.operations))for(let s of o.operations){let i=s.operation_id;if(typeof i!="string"||!i)continue;let a=e.get(i)??[];a.includes(o)||a.push(o),e.set(i,a)}for(let s of at){let i=o[s];Array.isArray(i)?i.forEach(n):i&&typeof i=="object"&&n(i)}};return t.forEach(n),e}function Ft(t,e){if(!e||e.length===0)return;if(e.length===1)return e[0];let n=t.action_params?.script;if(typeof n=="string"&&n.trim()){let r=n.trim(),o=e.find(s=>Bt(s)?.trim()===r);if(o)return o}return e[0]}function Bt(t){let e=t,n=e.script_content??e.js_snippet;return typeof n=="string"?n:void 0}function F(t,e){let n=new Map;for(let r of t){let o=Ft(r,r.action_id?e.get(r.action_id):void 0);if(!o)continue;let s=n.get(o)??[];s.push(r),n.set(o,s)}return n.size===0?null:[...n].map(([r,o])=>Vt(r,o))}function ct(t,e){let n=D(e.authoredInstructions),r=[];for(let o of t){if(o.flatIndex===void 0||!e.replayOnlyFlatIndices.has(o.flatIndex))continue;let s=F(o.records,n);s&&r.push(...s)}return r}function ut(t,e){let n=new Map(e.map(a=>[a.instruction_id,a])),r=[],o=a=>{if(!a||typeof a!="object")return;let c=a.instruction_id,u=typeof c=="string"?n.get(c):void 0;return u&&r.push(c),u},s=a=>{if(!a||typeof a!="object")return;let c=a;for(let u of at){let d=c[u];if(Array.isArray(d))i(d);else if(d&&typeof d=="object"){let p=o(d);p&&(c[u]=p),s(p??d)}}},i=a=>{for(let c=0;c<a.length;c++){let u=o(a[c]);u&&(a[c]=u),s(u??a[c])}};return i(t),r}function Ut(t){if(!t.timestamp||t.duration_ms==null)return"";let e=new Date(t.timestamp);return isNaN(e.getTime())?"":new Date(e.getTime()+t.duration_ms).toISOString()}function j(t){if(t!=null)try{return JSON.parse(t)}catch{return t}}function Mt(t){return typeof t=="string"?"string":typeof t=="boolean"?"bool":typeof t=="number"?Number.isInteger(t)?"int":"float":Array.isArray(t)?"list":t==null?"NoneType":"JSON"}function C(t,e,n){let r=t.user_variables,o=typeof r=="string",s;try{s=o?JSON.parse(r):r??[]}catch{return}if(!Array.isArray(s)||s.length===0)return;let i=s.find(a=>e&&a.name===e)??(s.length===1?s[0]:void 0);i&&(i.value=n,i.value_type=Mt(n),t.user_variables=o?JSON.stringify(s):s)}function it(t){t.user_variables!==void 0&&(t.user_variables=typeof t.user_variables=="string"?"[]":[])}function zt(t,e){let n=t.operations??[],r=new Set(e.map(s=>s.action_id).filter(Boolean)),o=n.filter(s=>r.has(s.operation_id));return o.length>0?o:n.length===1?n:[]}function $t(t){let e=t.error??"Script execution failed";return{error:e,error_code:"SCRIPT_EXECUTION_ERROR",error_message:e,reason:e}}function Vt(t,e){let n=structuredClone(t),r=e[0],o=e[e.length-1];n.status=e.find(i=>i.status!=="success")?.status??r.status,n.start_timestamp=r.timestamp??n.start_timestamp,n.end_timestamp=Ut(o)||n.end_timestamp;let s=zt(n,e);for(let i of s)i.status=n.status,i.operation_start=n.start_timestamp,i.operation_end=n.end_timestamp;switch(n.content_type){case"api":{let i=o.action_params?.api_data?.response;if(i&&typeof i=="object")for(let a of[n,...s])a.api_data={...a.api_data??{},response:i},C(a,o.output_variable,i);break}case"script":{let i=o.output_variable??n.output_variable_name;if(n.status!=="success"){let a=$t(o);n.code_error=a,it(n);for(let c of s)c.execution_result=a,c.code_error=a,it(c)}else if(o.output_value!=null){let a=j(o.output_value);C(n,i,a);for(let c of s)c.execution_result={value:a},C(c,i,a)}break}case"db_query":{o.output_value!=null&&(n.db_details={...n.db_details??{},carried_out_query:j(o.output_value)});break}case"screenshot_command":{let i=j(o.output_value);i&&typeof i=="object"&&(n.smartui_results=i);break}case"network_assertion":case"network_query":break;default:break}return n}var qt="/home/kaneai/Downloads";function O(t){return`${qt}/${t}`}function _t(t){return"FILE__"+t.replace(/[^A-Za-z0-9]/g,"_")}function z(t){return"file."+t}function N(t){let e=t?.media;return!e||!e.name||!e.media_url?null:{media_id:e.media_id??"",name:e.name,media_url:e.media_url,type:e.type??"doc",...e.alias?{alias:e.alias}:{}}}function pt(t){return t?t.includes(`
|
|
3
|
+
`)?t.split(`
|
|
4
|
+
`).map(e=>e.trim()).filter(Boolean):t.split(". ").map(e=>e.trim()).filter(Boolean).map(e=>e.endsWith(".")?e:e+"."):[]}function B(t){return typeof t=="string"&&t.includes("{{secrets.")}var Gt={click:"CLICK",double_click:"CLICK",type:"TYPE",fill:"TYPE",clear:"CLEAR",select:"SELECT",hover:"HOVER",drag:"DRAG_DROP",upload_files:"UPLOAD_FILE",navigate:"OPEN",go_back:"NAVIGATE",go_forward:"NAVIGATE",refresh:"REFRESH",press_key:"SENDKEYS",scroll:"SCROLL_PIXELS",scroll_into_view:"SCROLL_UNTIL_ELEMENT",js_dialog:"JS_DIALOG",wait:"WAIT",wait_until:"WAIT_UNTIL",wait_for_load:"WAIT_FOR_LOAD",switch_tab:"SWITCH_TAB",new_tab:"NEW_TAB",close_tab:"CLOSE_TAB",api:"API",evaluate_js:"EVALUATE_JS",vision_query:"VISION_QUERY",textual_query:"TEXTUAL_QUERY",get_url:"GET_URL",get_title:"GET_TITLE",assert:"ASSERTION",math:"MATHEMATICAL_OPERATION",set_cookies:"SET_COOKIES",delete_cookies:"DELETE_COOKIES",clear_cookies:"CLEAR_COOKIES",set_local_storage:"SET_LOCAL_STORAGE",delete_local_storage:"DELETE_LOCAL_STORAGE",clear_local_storage:"CLEAR_LOCAL_STORAGE",set_clipboard:"SET_CLIPBOARD",paste_clipboard:"PASTE_CLIPBOARD",clear_clipboard:"CLEAR_CLIPBOARD",device_control:"DEVICE_CONTROL",device_control_query:"DEVICE_CONTROL_QUERY"},gt={literal:"SET_VARIABLE",condition:"SET_VARIABLE",visual:"VISION_QUERY",dom:"TEXTUAL_QUERY",url:"GET_URL",title:"GET_TITLE",devtool_network:"DEVTOOLS_NETWORK_QUERY",devtool_console:"DEVTOOLS_CONSOLE_QUERY",devtool_cookies:"DEVTOOLS_COOKIES_QUERY",devtool_storage:"DEVTOOLS_STORAGE_QUERY",devtool_performance:"DEVTOOLS_PERFORMANCE",api_response:"API_CALLS_QUERY",textual_visual:"TEXTUAL_ANALYZER"},Kt=new Set(["CLICK","TYPE","FILL","HOVER","SCROLL_UNTIL_ELEMENT","UPLOAD_FILE","VISION_QUERY","DRAG_DROP","SELECT"]);function U(t,e){return t!=="fill"&&!(t==="type"&&e.delay_requested===!0)?0:typeof e.delay_ms=="number"&&e.delay_ms>0?e.delay_ms:0}function ft(t,e){if(U(t,e?.action_params??{})&&(t==="fill"||(e?.selectors?.length??0)>0))return"FILL";if(t==="analyze"){let r=e?.action_params?.analyzer_type??"";return gt[r]}if(t==="scroll"&&e?.action_params?.into_view===!0)return"SCROLL_UNTIL_ELEMENT";let n=Gt[t];return n||console.warn(`[migrator] UNKNOWN action_type "${t}" \u2014 falling back to "${t.toUpperCase()}"; explicit mapping required`),n??t.toUpperCase()}function mt(t,e){if(!t||!e)return"";try{let n=new Date(t);return isNaN(n.getTime())?"":new Date(n.getTime()+e).toISOString()}catch{return""}}function ht(t){try{return JSON.parse(t.output_value??"{}")}catch{return{}}}function Ht(t){let e=t.output_variable??"";if(!e)return"[]";let r={...ht(t)};return delete r.body,JSON.stringify([{name:e,unique_key:(t.action_id??"").replace(/-/g,"").slice(0,8)||k().replace(/-/g,"").slice(0,8),value:r,variable_description:"API Response"}])}function Jt(t,e,n){let r=t.action_params??{},o=Kt.has(e)?"Vision Agent":"Operation Agent",s={operation_type:e};e==="OPEN"&&(s.url=r.url??""),e==="SET_VARIABLE"&&(s.variable_name=t.output_variable??r.key??"",s.variable_value=t.output_value??"");let i=e==="UPLOAD_FILE"?N(r):null;i&&(s.value=O(i.name));let a={},c={},u=t.action_instruction??"",d=r.text??"",p=r.url??"",_=[["intent",u],["value",d],["url",p]];for(let[h,I]of Object.entries(n)){let y=String(I);if(h.startsWith("secrets."))for(let[m,E]of _)E.includes(y)&&(c[m]=h);for(let[m,E]of _)E.includes(y)&&!(m in a)&&(a[m]=E)}i?.alias&&(a.value=`{{${z(i.alias)}}}`);let l=t.action_type,g={operation:t.action_instruction??"",agent:o,operation_dict:s,reasoning:l==="analyze"?r.query??"":t.intent??t.action_instruction??"",variable:a,secrets:c,params:{}};l==="analyze"&&typeof r.code=="string"&&r.code&&(g.code=r.code),l==="analyze"&&typeof r.code_js=="string"&&r.code_js&&(g.code_js=r.code_js),l==="analyze"&&typeof r.condition_expression=="string"&&r.condition_expression&&(g.condition_expression=r.condition_expression),r.uses_websocket===!0&&(g.uses_websocket=!0),r.uses_sse===!0&&(g.uses_sse=!0),l==="analyze"&&r.analyzer_type==="textual_visual"&&(typeof r.wrapped_js=="string"&&(g.wrapped_js=r.wrapped_js),Array.isArray(r.locators)&&(g.locators=r.locators),typeof r.operator=="string"&&(g.operator=r.operator),Array.isArray(r.transforms)&&(g.transforms=r.transforms),typeof r.query=="string"&&(g.query=r.query),typeof r.expected_value=="string"&&(g.expected_value=r.expected_value),typeof r.needs_unit_conversion=="boolean"&&(g.needs_unit_conversion=r.needs_unit_conversion),typeof r.condition=="string"&&(g.condition=r.condition));let b={set_cookies:"cookies",set_clipboard:"text",delete_cookies:"names",set_local_storage:"items",delete_local_storage:"keys"}[l];return b&&r[b]!==void 0&&(g[b]=r[b]),l==="set_clipboard"&&typeof r.html=="string"&&r.html&&(g.html=r.html),g}function T(t){let e=t.assertion_tree;return e&&typeof e=="object"&&Object.keys(e).length>0?e:Array.isArray(t.sub_results)?t:{}}function Wt(t){let e=T(t);if(typeof e.passed=="boolean")return e.passed;let n=e.sub_results??[];return n.length===0?e.status==="passed":(e.composite_operator??"and")==="or"?n.some(o=>o.passed===!0):n.every(o=>o.passed===!0)}function bt(t){return t.map(e=>({description:e.description??"",store_key:e.store_key??"",expected_value:e.expected??"",extracted_value:e.extracted_value??"",operator:e.operator??"equals",transforms:e.transforms??[]}))}function Yt(t){let e=T(t),n=e.sub_results??[],r=bt(n);return{operator:[],assertion_operands:[],left_operand:null,right_operand:null,operands:[],sub_results:n,sub_checks:r,composite_operator:e.composite_operator??"and",verification:e.verification??"",claim:e.description??""}}function Xt(t){let e=t.action_params??{},n=T(e),r=n.sub_results??[],o=bt(r);return[{operation:t.action_instruction??"",agent:"Operation Agent",operation_dict:{operation_type:"ASSERTION",assertion_tree:{sub_results:r,sub_checks:o,composite_operator:n.composite_operator??"and",verification:"",claim:n.description??t.action_instruction??"",operator:[],assertion_operands:[],left_operand:null,right_operand:null,operands:[]}},variable:{},secrets:{},params:{}}]}function Zt(t,e,n,r){let o=t.visual_data;if(!o||o.x==null||o.y==null)return null;let s=e?`${e}/test_screenshots`:"";return{x:o.x,y:o.y,confidence:0,bbox:o.bbox??null,bbox_source:o.bbox?"accessibility_tree":"fallback",viewport_width:o.viewport_width??1280,viewport_height:o.viewport_height??800,scale_factor:null,raw_image_url:s?`${s}/untagged_screenshot/${n}.${r?.get(n)??"png"}`:"",raw_image_sas_url:"",annotated_image_url:"",annotated_image_sas_url:""}}function Qt(t){if(!t)return"";let e=t;return typeof t=="object"&&!Array.isArray(t)&&Array.isArray(t.frameInfo)&&(e=t.frameInfo),!Array.isArray(e)||e.length===0?"":JSON.stringify(e)}function te(t){return/^(android|ios)_native$/i.test(t.platform??"")}function yt(t,e){return t.map(n=>({...n,type:e?n.strategy??n.type??"native":n.isXPath?"xpath":"css"}))}function ee(t,e,n){let r={selector_target:"",drag_displacement:{},hold_duration_ms:null,move_duration_ms:null,hold_at_destination_ms:null};if(t!=="drag")return r;let o=e.target_selectors,s={};typeof e.direction=="string"&&e.direction&&(s.direction=e.direction,typeof e.fraction=="number"&&(s.fraction=e.fraction));let i=a=>typeof e[a]=="number"?Math.trunc(e[a]):null;return{selector_target:Array.isArray(o)&&o.length>0?yt(o,n):"",drag_displacement:s,hold_duration_ms:i("hold_duration_ms"),move_duration_ms:i("move_duration_ms"),hold_at_destination_ms:i("hold_at_destination_ms")}}function lt(t,e="",n){let r=t.action_type,o=ft(r,t),s=t.action_params??{},i=t.coordinates??null,a=t.selectors??null,c=!!(a&&a.length>0),u=te(t),d=ee(r,s,u),p=t.timestamp??"",_=t.duration_ms??0,l=t.variables_used??{},g=t.action_id??k(),f=k(),b=mt(p,_),h="",I="";if(r==="navigate")I=s.url??"",h=I;else if(r==="type"||r==="fill")h=s.text??"";else if(r==="press_key")h=s.key??"";else if(r==="wait")h=String(s.ms??s.timeout_ms??"");else if(r==="evaluate_js")h=s.script??"";else if(r==="js_dialog")h=s.prompt_text??"";else if(r==="upload_files"){let W=N(s);W&&(h=O(W.name))}else r==="analyze"&&o==="SET_VARIABLE"&&(h=t.output_value??"");let y="";r==="go_back"?y="back":r==="go_forward"&&(y="forward");let m=t.action_instruction??"",E=B(h)||B(I)||B(m),A=Jt(t,o,l);return{operation_id:g,instruction_id:f,instruction:m,intent:m,operation_start:p,operation_end:b,status:t.status??"",command:o,name:"",target:"",value:h,message:"",operation_dict:"",frame:Qt(t.frame_info),surface:typeof s.surface=="string"?s.surface:"",...U(r,s)?{delay_ms:U(r,s)}:{},frame_path:typeof s.frame_path=="string"?s.frame_path:"",grounded_by:typeof s.grounded_by=="string"?s.grounded_by:"",error_message:t.error??"",code_snippet:"",sub_instruction_obj:JSON.stringify(A),test_id:"",test_version:"",action:"",string_to_float:!1,feedback_msg:"",time_taken:"",create_time_stamp:"",update_time_stamp:"",locator_variable:"",locator_variable_name:"",image_url:e&&r!=="js_dialog"?`${e}/test_screenshots/untagged_screenshot/${g}.${n?.get(g)??"png"}`:"",alternative_xpaths:[],attribute:"",value_description:"",url:I,navigation_direction:y,tagified_image_url:"",query_variable_name:t.output_variable??"",query_variable_value:t.output_value??"",query_variable_type:"",expected_value:"",queried_value:"",operator:"",assertion_status:o==="ASSERTION"?Wt(s):"",query_info_dict:{},query_content_confidence:"none",debugging_logs:[],locator_index:0,query_html:"",user_variables:"[]",optional_flag:!1,max_retries:0,retries_delay:0,explicit_wait:0,implicit_wait:0,tab_index:String(s.tab_index??""),tab_identifier:String(s.tab_identifier??""),scroll_value:s.amount??1,scroll_direction:s.direction??"",mi_scroll_payload:{},sleep_duration:0,app_id:"",manual_interaction_tag:"",string_to_float_list:[],js_snippet:r==="evaluate_js"?s.script??"":"",code_error:"",hide:E,dismiss_dialog:!1,use_v2_mobile_tagging:u,multiple_inputs:!1,dialog_action:r==="js_dialog"?s.action??"":"",dialog_type:r==="js_dialog"?s.dialog_type??"":"",is_coordinates_used_for_interaction:i!==null&&!c,element_coordinates_ratio:[],element_bounds_ratio:[],x_coord:c?null:i?.x??null,y_coord:c?null:i?.y??null,target_x_coord:s.target_x??null,target_y_coord:s.target_y??null,source_description:s.source_description??null,target_description:s.target_description??null,use_coordinates:i!==null&&!c,kaneaiMobileTaggingImageLimit:1,clicks_order_code:"se_js_ac",selector:c?yt(a,u):"",selector_target:d.selector_target,math_result_variable_name:"",math_result_variable_value:"",expression_tree:o==="ASSERTION"?Yt(s):s.expression_tree??{},assertion_tree:o==="ASSERTION"?T(s):s.assertion_tree??{},assertion_tree_simplified:{},network_throttle:{},is_mobile_offline:!1,autoheal:!1,reprobe:t.reprobe??!1,click_modifier:(s.click_count??1)>=2?{kind:"multi_click",frequency:s.click_count}:null,db_query:"",db_details:{},db_query_decoded:"",is_global_variable:!1,is_global_variable_persist:!1,global_variable_id:"",wait_for_element_timeout:0,failure_condition:o==="ASSERTION"?"Fail test immediately":"",screenshot_command:"",smartui_contents:{},smartui_results:{},result_type:"",result_hint:"",drag_offset:{},drag_displacement:d.drag_displacement,hold_duration_ms:d.hold_duration_ms,move_duration_ms:d.move_duration_ms,hold_at_destination_ms:d.hold_at_destination_ms,start_coordinates:s.source_coordinates?{x:s.source_coordinates[0],y:s.source_coordinates[1]}:{},end_coordinates:s.target_coordinates?{x:s.target_coordinates[0],y:s.target_coordinates[1]}:{},element_rect:null,is_canvas:!1,until_condition:"",until_max_retries:0,until_settle_ms:0,api_data:r==="api"?{request:t.action_params?.api_data?.request??{}}:{},output_variables:r==="api"?t.output_variable?{[t.output_variable]:null}:{}:t.output_variable?{[t.output_variable]:t.output_value??""}:{},visual_context:Zt(t,e,g,n),reasoning:r==="analyze"?s.query??"":t.intent??t.action_instruction??""}}function dt(t,e){let n=t.action_type,r=ft(n,t),o=t.timestamp??"",s=t.duration_ms??0,i=mt(o,s),a=r==="ASSERTION"||r==="MATHEMATICAL_OPERATION";return{instruction_id:e.instruction_id,instruction_class:a?"non_driver_action":"driver_action",module_id:"",instruction:t.action_instruction??"",command:r,error:null,parent_instruction_id:"",classification_layer_resp:r==="ASSERTION"?Xt(t):[],classification_error:{},operations:[e],status:t.status??"",start_timestamp:o,end_timestamp:i,type:"agent_generated",tags:[],html_paths:[],optional_flag:!1,max_retries:0,retries_delay:0,explicit_wait:0,implicit_wait:0,content_type:n==="api"?"api":n==="analyze"&&t.action_params?.analyzer_type==="api_response"?"api_calls_query":n==="analyze"&&t.action_params?.analyzer_type?.startsWith("devtool_")?t.action_params.analyzer_type.replace("devtool_","devtools_"):"instruction",js_snippet:n==="evaluate_js"?t.action_params?.script??"":"",user_variables:n==="api"?Ht(t):"[]",api_data:n==="api"?{request:t.action_params?.api_data?.request??{},response:ht(t)}:{},params_used:!1,hard_assertion:r==="ASSERTION"?t.action_params?.failure_condition==="hard":!1,expected_outcome:"",module_execution_index:0,module_version:null,network_throttle:{},isEdited:!1,use_query_assertion_v2:!1,db_query:"",db_details:{},network_assertion_content:{},screenshot_command:"",smartui_contents:{},generative_id:"",plan_id:"",generative_objective:"",error_message:"",error_code:"",reason:"",title:"",used_variables:[],reasoning:n==="analyze"?t.action_params?.query??"":t.intent??t.action_instruction??""}}function ne(t,e=[]){let n=t.action_params??{},r=n.branches??[],o=(u,d)=>u||(d?`{{${d}}}`:void 0),s=n.winning_index??-1,i=n.sub_results??[],a={};for(let u of i){let d=u.sub_results;if(d)for(let p of d){let _=p.store_key;_&&(a[_]=p)}}let c=r.map((u,d)=>{let p=d===s,_=(u.sub_checks??[]).map(l=>{let g=a[l.store_key];return{description:l.description,store_key:l.store_key,expected_value:l.expected_value,stored_value:g?.extracted_value??l.stored_value,extracted_value:o(l.extracted_value,l.store_key),operator:l.operator??g?.operator??"equals",transforms:l.transforms??g?.transforms??[]}});if(_.length===0&&u.condition&&i.length>0){let g=i.find(f=>f.branch_index===d)?.sub_results??[];g.length>0&&(_=g.map(f=>({description:f.description??u.condition,store_key:f.store_key??"",expected_value:f.expected??"true",stored_value:f.extracted_value??void 0,extracted_value:o(void 0,f.store_key)??(f.extracted_value||void 0),operator:f.operator??"equals",transforms:f.transforms??[]})))}return{branch_index:d,condition:u.condition??null,branch_type:u.branch_type??"sub_objective",passed:p,sub_objective:null,custom_event:u.custom_event??null,children:p?e:[],sub_checks:u.condition?_:[],composite_operator:u.composite_operator??"and"}});return{content_type:"conditional_block",instruction_id:`if_else_${k().slice(0,8)}`,instruction:t.action_instruction??"",instruction_class:"driver_action",command:"",status:t.status??"success",resolved_branch_index:s,branches:c,generative_id:"",generative_objective:"",variables_used:{},classification_layer_resp:[],classification_error:{},used_variables:[],user_variables:"[]",module_id:"",module_execution_index:0,module_version:"",plan_id:"",optional_flag:!1,max_retries:0,retries_delay:0,explicit_wait:0,implicit_wait:0,error:null,error_message:"",error_code:"",reason:"",start_timestamp:t.timestamp??"",end_timestamp:"",type:"agent_generated",hook:null,hook_type:null,evaluation_context:{},query_variables:{}}}function Et(t,e,n){for(let r of t)r.content_type==="instruction"&&"generative_id"in r&&(r.generative_id=e,r.generative_objective=n)}function M(t,e="",n,r){let o=[],s=0;for(;s<t.length;){let i=t[s],a=i.action_type;if(!r?.keepFailedActions&&i.status==="error"&&a!=="assert"&&a!=="if_else"&&a!=="child_agent_start"&&a!=="child_agent_end"&&a!=="js_dialog"&&!(i.until_condition&&!i.error)){s+=1;continue}if(a==="analyze"&&(!gt[i.action_params?.analyzer_type??""]||i.action_params?.analyzer_type==="textual_visual"&&i.action_params?.code)){s+=1;continue}if(a==="child_agent_start"){let c=i.action_params?.child_id??"",u=i.action_params?.objective??"",d=[];s+=1;let p=1,_="error",l;for(;s<t.length&&p>0;){let E=t[s],A=E.action_type;if(A==="child_agent_start")p+=1;else if(A==="child_agent_end"&&(p-=1,p===0)){_=E.status??"success",l=E,s+=1;break}p>0&&d.push(E),s+=1}let g=M(d,e,n);Et(g,c,u);let f=l?.action_params?.result_code??null,b=l?.action_params?.reason_code??null,h=l?.action_params?.error_message??null,I=l?.action_params?.summary??null,y=l?.action_params?.one_liner??null,m=_==="error";o.push({content_type:"generative_block",instruction_id:`generative_block_${c}`,generative_id:c,objective:u,status:_,children:g,error_message:m?h??null:null,error_code:m?b??null:null,result_code:f??null,bifurcation_context:[],approach_reason:pt(I),one_liner:y??null});continue}else if(a==="child_agent_end"){s+=1;continue}else if(a==="if_else"){s+=1;let c=[];for(;s<t.length&&t[s].action_type==="child_agent_start";){let u=t[s],d=u.action_params?.child_id??"",p=u.action_params?.objective??"",_=[];s+=1;let l=1,g="error";for(;s<t.length&&l>0;){let b=t[s];if(b.action_type==="child_agent_start")l+=1;else if(b.action_type==="child_agent_end"&&(l-=1,l===0)){g=b.status??"success",s+=1;break}l>0&&_.push(b),s+=1}let f=M(_,e,n);c.push(...f)}o.push(ne(i,c));continue}else if(a==="query_tool"){s+=1;continue}else if(i.until_condition){let c=lt(i,e,n),u=dt(i,c),d=typeof i.until_condition_met=="boolean"?i.until_condition_met:i.status==="success";o.push({content_type:"until_block",instruction_id:`until_${k().slice(0,8)}`,condition:i.until_condition,max_retries:i.until_max_retries??10,settle_ms:i.until_settle_ms??500,current_count:0,condition_met:d,children:[u],generative_id:"",generative_objective:"",variables_used:{},status:i.status??"success"})}else{let c=lt(i,e,n),u=dt(i,c);o.push(u)}s+=1}return o}function w(t,e="",n,r){let o=[],s=[],i=r?.passthrough,a=i?D(i.authoredInstructions):null;for(let l of t){if(i&&a&&l.flatIndex!==void 0&&i.replayOnlyFlatIndices.has(l.flatIndex)){let m=F(l.records,a);if(m){for(let E of m)o.push(E),s.push(l.flatIndex);continue}console.warn(`[migrator] replay-only passthrough: no authored operation matched step ${l.flatIndex} (action_id \u2260 any operation_id in the authored blob) \u2014 falling back to this run's records`)}let g=M(l.records,e,n,r);if(g.length===0)continue;let f=k().replace(/-/g,"");Et(g,f,l.objective);let b=g.some(m=>"status"in m&&typeof m.status=="string"?m.status==="error"||m.status==="failed":!1),h=l.resultCode?parseInt(l.resultCode,10):null,I=h!==null&&!isNaN(h)&&h>=200,y=b||I?"error":"success";o.push({content_type:"generative_block",instruction_id:`generative_block_${f}`,generative_id:f,objective:l.objective,status:y,children:g,error_message:y==="error"?l.errorMessage??null:null,error_code:y==="error"?l.reasonCode??null:null,result_code:l.resultCode??null,bifurcation_context:[],approach_reason:pt(l.summary),one_liner:l.oneLiner??null}),s.push(l.flatIndex)}let c=o.map((l,g)=>({block:l,flat:s[g]})),u=r?.moduleSpans??[],d=r?.blockSpans??[],p=r?.authoredBlocks??[];u.length>0&&(c=It(c,u,d,p));let _=kt(d,u);return _.length>0&&(c=$(c,_,p)),{instructions:c.map(l=>l.block)}}function It(t,e,n,r){let o=[],s=a=>a===void 0?void 0:e.find(c=>a>=c.flatFrom&&a<=c.flatTo),i=0;for(;i<t.length;){let a=s(t[i].flat);if(!a){o.push(t[i]),i++;continue}let c=[];for(;i<t.length&&s(t[i].flat)===a;)c.push(t[i++]);let u=It(c,a.children,n,r),d=kt(At(n,a),a.children);d.length>0&&(u=$(u,d,r)),o.push({block:le(a,u.map(p=>p.block)),flat:c[0].flat})}return o}function vt(t,e){return t.flatFrom>=e.flatFrom&&t.flatTo<=e.flatTo}function At(t,e){let n=[];for(let r of t)vt(r,e)?n.push(r):n.push(...At(r.children,e));return n}function kt(t,e){let n=[],r=s=>{for(let i of s)n.push(i),r(i.children)};r(e);let o=s=>s.filter(i=>!n.some(a=>vt(i,a))).map(i=>({...i,children:o(i.children)}));return n.length>0?o(t):t}function $(t,e,n){let r=[...e].sort((u,d)=>u.flatFrom-d.flatFrom),o=[],s=(u,d)=>{o.push({block:ae(u,d,n),flat:u.flatFrom})},i=(u,d)=>u!==void 0&&u>=d.flatFrom&&u<=d.flatTo,a=0,c=0;for(;c<t.length;){let u=t[c].flat;for(;a<r.length&&u!==void 0&&r[a].flatTo<u;)s(r[a++],[]);let d=a<r.length&&i(u,r[a])?r[a]:void 0;if(!d){o.push(t[c]),c++;continue}let p=[];for(;c<t.length&&i(t[c].flat,d);)p.push(t[c++]);s(d,p),a++}for(;a<r.length;)s(r[a++],[]);return o}function re(t){let e=new Map;for(let n of t)e.set(n.flat,n);return t.filter(n=>e.get(n.flat)===n)}var se=["children","instructions","branches","module_content","true_branch","false_branch"];function oe(t,e){if(!e)return;let n=[...t];for(;n.length>0;){let r=n.pop();if(!r||typeof r!="object")continue;let o=r;if(o.instruction_id===e&&(o.content_type==="conditional_block"||o.content_type==="until_block"))return o;for(let s of se){let i=o[s];Array.isArray(i)?n.push(...i):i&&typeof i=="object"&&n.push(i)}}}function ie(t,e,n){if(!t)return[];if(e==="while")return Array.isArray(t.children)?t.children:[];let o=(Array.isArray(t.branches)?t.branches:[])[n];return o&&Array.isArray(o.children)?o.children:[]}function ae(t,e,n){let r=oe(n,t.blockId),o=t.branches.map((s,i)=>{let a=e.filter(d=>d.flat!==void 0&&d.flat>=s.flatFrom&&d.flat<=s.flatTo);t.kind==="while"&&(a=re(a));let c=$(a,t.children,n).map(d=>d.block);if(c.length>0)return c;let u=ie(r,t.kind,i);return u.length===0&&!s.taken&&console.warn(`[migrator] control-flow: branch ${i} of block ${t.blockId||t.instruction} did not run and no authored block matched \u2014 emitted empty`),u});return t.kind==="if"?ce(t,o,r):ue(t,o[0]??[],r)}function ce(t,e,n){let r=Array.isArray(n?.branches)?n.branches:[],o=V(e.flat()),s=t.branches.map((i,a)=>{let c=r[a];return{branch_index:a,condition:i.branch_type==="else"?null:i.condition,branch_type:i.branch_type,passed:i.taken,sub_objective:null,custom_event:c?.custom_event??null,children:e[a],sub_checks:Array.isArray(c?.sub_checks)?c.sub_checks:[],composite_operator:c?.composite_operator??"and"}});return{content_type:"conditional_block",instruction_id:t.blockId||`if_else_${k().slice(0,8)}`,instruction:t.instruction,instruction_class:"driver_action",command:"",status:o?"error":"success",resolved_branch_index:t.branches.findIndex(i=>i.taken),branches:s,generative_id:"",generative_objective:"",variables_used:{},classification_layer_resp:[],classification_error:{},used_variables:[],user_variables:"[]",module_id:"",module_execution_index:0,module_version:"",plan_id:"",optional_flag:!1,max_retries:0,retries_delay:0,explicit_wait:0,implicit_wait:0,error:null,error_message:o?.message??"",error_code:o?.code??"",reason:"",start_timestamp:"",end_timestamp:"",type:"agent_generated",hook:null,hook_type:null,evaluation_context:{},query_variables:{}}}function ue(t,e,n){let r=t.whileCfg??{max_retries:5,settle_ms:500,on_exhaust:"fail",iterations:0,condition_met:!1},o=V(e),s=(i,a)=>n&&n[i]!==void 0?n[i]:a;return{content_type:"until_block",instruction_id:t.blockId||`until_${k().slice(0,8)}`,condition:t.instruction,max_retries:r.max_retries,settle_ms:r.settle_ms,current_count:r.iterations,condition_met:r.condition_met,children:e,generative_id:"",generative_objective:"",variables_used:{},status:o?"error":"success",on_exhaust:s("on_exhaust",r.on_exhaust),mode:s("mode",""),check:s("check",""),conditions:s("conditions",[]),connectors:s("connectors",[]),sub_checks:s("sub_checks",[]),composite_operator:s("composite_operator","and")}}function V(t){for(let e of t){let n="status"in e&&typeof e.status=="string"?e.status:"";if(n==="error"||n==="failed"){let r="error_message"in e?e.error_message:void 0,o="error_code"in e?e.error_code:void 0;return{message:r??null,code:o??null}}}return null}function le(t,e){let n=t.meta,r=(u,d="")=>typeof n[u]=="string"?n[u]:d,o=(u,d=!1)=>typeof n[u]=="boolean"?n[u]:d,s=u=>Array.isArray(n[u])?n[u]:[],i=typeof n.module_version=="number"||typeof n.module_version=="string"?n.module_version:null,a=r("module_id"),c=V(e);return{content_type:nt,instruction_id:`module_block_${a}`,module_id:a,module_version:i,module_instance_id:k(),module_name:r("module_name"),module_description:r("module_description"),module_platform:r("module_platform"),creation_mode:r("creation_mode","Agent"),tms_status:r("tms_status","active"),is_validated:o("is_validated"),is_dirty:t.dirty,enrichment_id:r("enrichment_id"),tags:s("tags"),project_ids:s("project_ids"),link_to_all:o("link_to_all"),status:c?"error":"success",children:e,error_message:c?.message??null,error_code:c?.code??null,update_available:!1,update_info:{}}}function Pt(t,e){let n;try{n=Rt(t)}catch{return 0}let r=0,o=n.filter(s=>/^\d+$/.test(s)).sort((s,i)=>Number(s)-Number(i));for(let s of o){let i=S(t,s),a=S(i,"logs");if(!de(a))continue;let c;try{c=Rt(a)}catch{continue}let u=c.filter(_=>_.endsWith("-actions.ndjson")).sort((_,l)=>(parseInt(_,10)||0)-(parseInt(l,10)||0)),d=[];for(let _ of u){let l=e.readActions(S(a,_));l.length&&d.push({objective:e.objective??"",records:l})}if(d.length===0)continue;let{instructions:p}=w(d,e.screenshotBaseUrl??"",e.extMap,{keepFailedActions:!0});if(p.length!==0)try{let _=S(i,"auteur");_e(_,{recursive:!0}),pe(S(_,"execution.json"),JSON.stringify(e.buildBlob(p),null,2)),r++,e.log?.("info","EVIDENCE_ARCHIVED_ATTEMPT_BLOB","Derived nested attempt blob",{attempt:s,instructions:p.length})}catch(_){e.log?.("debug","EVIDENCE_ARCHIVED_ATTEMPT_BLOB_FAILED","Nested attempt blob derivation failed",{attempt:s,error:_ instanceof Error?_.message:String(_)})}}return r}import{existsSync as ge,readFileSync as fe}from"fs";function wt(t){try{return ge(t)?JSON.parse(fe(t,"utf-8")):void 0}catch{return}}function q(t,e){if(!t||typeof t!="object")return;let n=t,r=n.project_token;if(typeof r!="string"||!r)return;let o={project_token:r},s=n[e];typeof s=="string"&&s&&(o.project_name=s);let i=n.project_id;return typeof i=="string"&&i&&(o.project_id=i),o}function G(t){if(Array.isArray(t)){for(let r of t){let o=G(r);if(o)return o}return}if(!t||typeof t!="object")return;let e=t,n=e.smartui_results;if(n&&typeof n=="object"){let r=q(n.project,"name");if(r)return r}for(let r of Object.values(e)){let o=G(r);if(o)return o}}function St(t){for(let e of t.runMetaPaths){let n=wt(e),r=q(n?.smartui,"project_name");if(r)return r}if(t.authoredBlobPath){let e=wt(t.authoredBlobPath),n=q(e?.smartui,"project_name");if(n)return n}return G(t.instructions)??{}}var xt=Ct(Dt(),1);import{createWriteStream as me}from"fs";import{readFile as he}from"fs/promises";import{join as be,basename as ye}from"path";import{tmpdir as Ee}from"os";var Ie=["**/screenshots/**","**/annotated/**","**/tcg/**","**/bifurcation/**"];async function Ot(t){let e=be(Ee(),`${ye(t)}_artifacts.zip`);return new Promise((n,r)=>{let o=me(e),s=(0,xt.default)("zip",{zlib:{level:6}});o.on("close",()=>n(e)),s.on("error",r),s.pipe(o),s.glob("**/*",{cwd:t,ignore:Ie}),s.finalize()})}async function Nt(t){return he(t)}function ve(t){if(!t||typeof t!="object")return;let e=t,n=typeof e.message=="string"?e.message:e.error?.message;return typeof n=="string"&&n.trim()?n.trim():void 0}function Ae(t){if(!(t instanceof Error)||t.name!=="TmsHttpError")return null;let e=t.status;return typeof e=="number"?{status:e,body:t.body}:null}function Ge(t){let e=Ae(t);return e?{kind:"tms_refused",status:e.status,message:ve(e.body)}:{kind:"tms_unreachable",detail:t instanceof Error?t.message:String(t)}}function K(t){if(!t)return"no Test Manager test was created for this session";switch(t.kind){case"tms_refused":return t.message?`${t.message} (HTTP ${t.status})`:t.status===401?"Test Manager didn't accept your login (HTTP 401) \u2014 run `kane-cli login` and try again":t.status>=500?`Test Manager had an error (HTTP ${t.status}) \u2014 try again later`:`Test Manager refused to create the test (HTTP ${t.status})`;case"tms_unreachable":return`Test Manager couldn't be reached${t.detail?` (${t.detail})`:""} \u2014 try again later`;case"no_cloud_app":return"the app under test wasn't uploaded to LambdaTest, so Test Manager has no build to file this test under";case"signed_out":return"you're not signed in \u2014 run `kane-cli login` to save runs to Test Manager"}}function Ke(t){return`This run won't be saved to Test Manager: ${K(t)}.`}function Tt(t,e){let n=e?.trim()?` (${e.trim()})`:"";switch(t){case"expired":return`Not saved to Test Manager: this test's edit session expired before the save${n}. Run it again to save.`;case"base_mismatch":return`Not saved to Test Manager: someone saved a newer version of this test while this run was going${n}. Pull the latest version and run it again.`;case"lock_mismatch":return`Not saved to Test Manager: another session holds this test for editing${n}.`;case"not_found":return`Not saved to Test Manager: the version this run was saving was not found${n}. Run it again to save.`;case"auth":return`Not saved to Test Manager: your account isn't allowed to save this test${n}. Check your login and your KaneAI access in this organization.`;case"network":return`Not saved to Test Manager: Test Manager couldn't be reached${n}. Try again later.`;case"bundle_sync_failed":return`Not saved to Test Manager: the test files couldn't be uploaded before saving${n}, so no new version was committed. The local recording is kept \u2014 run again with --push once fixed.`;default:return`Not saved to Test Manager: committing the new version failed (${t??"unknown"}${e?.trim()?`: ${e.trim()}`:""}).`}}async function Pe(t,e){return jt(et(t,e))}function we(t){return{key:"artifacts",content_type:"application/zip",filename:`${t}.evidence`}}var Se=[1e3,2e3,4e3],Lt=class{config;controller;testId;constructor(e){this.config=e,this.controller=new X(e.controllerBaseUrl,e.auth),this.testId=e.testId}log(e,n,r,o){if(n.startsWith("PIPELINE_CODE_EXPORT")&&this.config.codeExport){let s=rt(this.config.codeExport.language,!!this.config.mobile);o={language:s.language,framework:s.framework,mobile:!!this.config.mobile,...o}}this.config.log?.(e,n,r,o)}async execute(){let e={},n=null,r=this.config.onProgress,o=(a,c,u)=>{c==="running"&&e[a]===void 0&&(e[a]=Date.now(),n=a),r(a,c,u)},s=a=>e[a]===void 0?null:Date.now()-e[a],i=Date.now();try{if(!this.testId)return this.log("error","PIPELINE_ABORT","No test_id available",{save_blocker:this.config.saveBlocker?.kind??null}),{success:!1,testId:null,error:`Not saved to Test Manager: ${K(this.config.saveBlocker)}.`};let a=this.config.evidence,c=null;if(this.config.shouldUploadArtifacts!==!1){o("convert","running");let _=this.collectNdjsonPerRun(),l=_.reduce((m,E)=>m+E.records.length,0);this.log("info","PIPELINE_CONVERT","Collected NDJSON records",{total_records:l,run_groups:_.length});let g=this.loadReplayOnlyPassthrough(),{instructions:f}=_.length>0?w(_,this.config.screenshotBaseUrl??"",this.config.screenshotExtMap,{moduleSpans:this.config.moduleSpans,...g?{passthrough:g}:{},...this.config.blockSpans?.length?{blockSpans:this.config.blockSpans,authoredBlocks:this.loadAuthoredBlocks()}:{}}):{instructions:[]};this.log("debug","PIPELINE_CONVERT_INSTRUCTIONS","Auteur instructions produced",{count:f.length});let b=this.buildExecutionEnvelope(f),h=Buffer.from(JSON.stringify(b));this.log("debug","PIPELINE_CONVERT_BLOB","Blob created",{size_kb:+(h.length/1024).toFixed(1)});let I=v(this.config.sessionDir,"execution.json");x(I,JSON.stringify(b,null,2)),this.log("debug","PIPELINE_CONVERT_LOCAL_SAVE","Execution blob saved locally",{path:I});let y=a?.packTestDir??this.config.evidenceRead?.packTestDir;if(y){let m=v(y,"auteur");J(m,{recursive:!0}),x(v(m,"execution.json"),JSON.stringify(b,null,2)),this.log("debug","PIPELINE_CONVERT_PACK_COPY","Execution blob copied into pack",{path:v(m,"execution.json")}),this.deriveArchivedAttemptBlobs(y)}if(this.log("info","PIPELINE_CONVERT_OK","Conversion complete",{instructions:f.length,blob_size_kb:+(h.length/1024).toFixed(1),local_path:I,pack_path:y?v(y,"auteur","execution.json"):null,duration_ms:s("convert")}),o("convert","done"),a)c=h;else{o("zip","running"),this.log("info","PIPELINE_ZIP_START","Zipping session",{session_dir:this.config.sessionDir});let m=null,E;try{m=await Ot(this.config.sessionDir),E=await Nt(m),this.log("info","PIPELINE_ZIP_DONE","Zip complete",{size_mb:+(E.length/1024/1024).toFixed(1),path:m,duration_ms:s("zip")}),o("zip","done",`${(E.length/1024/1024).toFixed(1)}MB`)}finally{m&&await Re(m).catch(()=>{})}o("presign","running"),this.log("info","PIPELINE_PRESIGN_START","Requesting presigned URLs",{url:`${this.config.controllerBaseUrl}/upload/presign`,test_id:this.testId,session_id:this.config.sessionId});let A=await this.controller.getPresignedUrls(this.testId,this.config.sessionId,[{key:"artifacts",content_type:"application/zip",filename:`${this.config.sessionId}_artifacts.zip`},{key:"blob",content_type:"application/json",filename:`${this.config.commitId}.json`}]);this.log("info","PIPELINE_PRESIGN_OK","Presigned URLs received",{artifacts_url:A.urls.artifacts?.blob_url,blob_url:A.urls.blob?.blob_url,duration_ms:s("presign")}),o("presign","done"),o("upload","running"),this.log("info","PIPELINE_UPLOAD_START","Uploading artifacts and blob",{artifact_size_mb:+(E.length/1024/1024).toFixed(1),blob_size_kb:+(h.length/1024).toFixed(1)}),await Promise.all([R(A.urls.artifacts.upload_url,E,"application/zip"),R(A.urls.blob.upload_url,h,"application/json")]),this.log("info","PIPELINE_UPLOAD_OK","Upload complete",{duration_ms:s("upload")}),o("upload","done")}}else{let _=this.collectNdjsonPerRun(),l=this.loadReplayOnlyPassthrough(),{instructions:g}=_.length>0?w(_,this.config.screenshotBaseUrl??"",this.config.screenshotExtMap,{keepFailedActions:!0,moduleSpans:this.config.moduleSpans,...l?{passthrough:l}:{},...this.config.blockSpans?.length?{blockSpans:this.config.blockSpans,authoredBlocks:this.loadAuthoredBlocks()}:{}}):{instructions:[]},f=this.buildExecutionEnvelope(g),b=v(this.config.sessionDir,"execution.json");x(b,JSON.stringify(f,null,2)),this.log("info","PIPELINE_LOCAL_SAVE","Execution blob saved locally (no upload)",{path:b});let h=this.config.evidence?.packTestDir??this.config.evidenceRead?.packTestDir;if(h){let I=v(h,"auteur");J(I,{recursive:!0});let y=this.readAuthoredExecution(),m=y?this.refreshReplayOnlyInPack(y,_,l):null;x(v(I,"execution.json"),m?.raw??JSON.stringify(f,null,2)),this.log("info","PIPELINE_CONVERT_PACK_COPY","Execution blob copied into pack (gated)",{path:v(I,"execution.json"),source:m?m.refreshed.length>0?"authored+replay_results":"authored":"run_envelope",...m&&m.refreshed.length>0?{refreshed_instruction_ids:m.refreshed}:{}}),this.deriveArchivedAttemptBlobs(h)}o("convert","skipped"),o("zip","skipped"),o("presign","skipped"),o("upload","skipped"),this.log("info","PIPELINE_UPLOAD_SKIPPED","Upload steps skipped (gate disabled)")}if(this.config.shouldReplaceLocalOutput&&this.config.onAtomicReplace){o("atomic_replace","running");try{await this.config.onAtomicReplace(),this.log("debug","PIPELINE_ATOMIC_REPLACE_OK","Local output replaced"),o("atomic_replace","done")}catch(_){let l=_ instanceof Error?_.message:String(_);throw this.log("error","PIPELINE_ATOMIC_REPLACE_FAILED","Atomic-replace failed",{error:l}),o("atomic_replace","failed",l),_}}else o("atomic_replace","skipped");let u,d;if(this.config.shouldCommit&&!this.config.isFirstRun&&this.config.onCommitLock){o("commit_lock","running");let _=await this.config.onCommitLock();if(_.ok)u=_.testcaseId||void 0,this.log("info","PIPELINE_COMMIT_LOCK_OK","Commit lock acquired",{testcase_id:u??"none",trigger:_.trigger??null,test_instance_id:_.testInstanceId??null}),o("commit_lock","done");else return this.log("error","PIPELINE_COMMIT_LOCK_FAILED","Commit lock failed",{reason:_.reason,message:_.message}),o("commit_lock","failed",`${_.reason??"unknown"}: ${_.message??""}`),{success:!1,testId:this.testId,error:Tt(_.reason,_.message)}}else o("commit_lock","skipped");if(this.config.isFirstRun&&!this.config.skipTmsFinalize){o("finalize","running"),this.log("info","PIPELINE_FINALIZE_START","Finalizing test (first-run)",{test_id:this.testId,commit_id:this.config.commitId});let _=new Q(this.config.tmsBaseUrl,this.config.tmsUsername,this.config.tmsAccessKey),l=this.config.runObjectives&&this.config.runObjectives.length>0?this.config.runObjectives:[this.config.firstObjective],g={commit_id:this.config.commitId,time_taken:Math.round(this.config.totalDuration),steps_count:this.config.totalSteps,commit_message:this.config.firstObjective.slice(0,255),objectives:l,...this.config.assuranceStamp?{assurance:this.config.assuranceStamp}:{}},f;try{f=await this.stop(_,g)}catch(b){if(!this.config.attachedStop)throw b;let h=b instanceof Error?b.message:String(b);this.log("error","PIPELINE_FINALIZE_NOT_SAVED","Attached test's stop did not finalize after its retries",{test_id:this.testId,error:h}),o("finalize","failed",h);try{await this.config.onFinalizeGaveUp?.()}catch(I){this.log("warn","PIPELINE_FINALIZE_META_FAILED","Meta-rewrite after a stop that did not finalize failed",{error:String(I)})}return{success:!1,testId:this.testId,error:`finalize failed: ${h}`,notSaved:!0}}if(u=f.testcase_id||void 0,this.log("info","PIPELINE_FINALIZE_OK","Test finalized",{testcase_id:u??"none",commit_id:f.commit_id??null}),this.config.onFinalizeSuccess)try{await this.config.onFinalizeSuccess(u,f.commit_id)}catch(b){this.log("warn","PIPELINE_FINALIZE_META_FAILED","Meta-rewrite after endTest failed",{error:String(b)})}o("finalize","done")}else o("finalize","skipped"),this.log("info","PIPELINE_FINALIZE_SKIPPED","Finalize skipped (evolve flow or first-run disabled)");if(u&&this.config.shareApiBaseUrl){let _=Date.now();try{d=await this.generateShareLink(u),this.log("info","PIPELINE_SHARE_OK","Share link generated",{share_id:d,duration_ms:Date.now()-_})}catch(l){this.log("warn","PIPELINE_SHARE_FAILED","Share link failed",{error:String(l),duration_ms:Date.now()-_})}}if(a&&c){let _=null;o("zip","running");try{await a.sealFn({testcaseId:u,shareId:d}),_=a.sealedPackPath?await jt(a.sealedPackPath):await Pe(a.executionId,a.cwd),this.log("info","PIPELINE_EVIDENCE_SEALED","Evidence pack sealed",{execution_id:a.executionId}),this.log("info","PIPELINE_PACK_READ","Sealed pack read",{size_mb:+(_.length/1024/1024).toFixed(1)})}catch(l){let g=l instanceof Error?l.message:String(l);this.log("warn","PIPELINE_EVIDENCE_UPLOAD_SKIPPED","Evidence seal/read failed \u2014 uploading blob only",{execution_id:a.executionId,error:g})}if(_){o("zip","done",`${(_.length/1024/1024).toFixed(1)}MB`),o("presign","running");let l=await this.controller.getPresignedUrls(this.testId,this.config.sessionId,[we(a.executionId),{key:"blob",content_type:"application/json",filename:`${this.config.commitId}.json`}]);this.log("info","PIPELINE_PRESIGN_OK","Presigned URLs received",{artifacts_url:l.urls.artifacts?.blob_url,blob_url:l.urls.blob?.blob_url,duration_ms:s("presign")}),o("presign","done"),o("upload","running"),this.log("info","PIPELINE_UPLOAD_START","Uploading pack and blob",{artifact_size_mb:+(_.length/1024/1024).toFixed(1),blob_size_kb:+(c.length/1024).toFixed(1)}),await Promise.all([R(l.urls.artifacts.upload_url,_,"application/zip"),R(l.urls.blob.upload_url,c,"application/json")]),this.log("info","PIPELINE_UPLOAD_OK","Upload complete",{duration_ms:s("upload")}),o("upload","done")}else{o("zip","skipped"),o("presign","running");let l=await this.controller.getPresignedUrls(this.testId,this.config.sessionId,[{key:"blob",content_type:"application/json",filename:`${this.config.commitId}.json`}]);o("presign","done"),o("upload","running"),this.log("info","PIPELINE_UPLOAD_START","Uploading blob only (evidence skipped)",{blob_size_kb:+(c.length/1024).toFixed(1)}),await R(l.urls.blob.upload_url,c,"application/json"),this.log("info","PIPELINE_UPLOAD_OK","Blob upload complete (pack skipped)",{duration_ms:s("upload")}),o("upload","done")}}let p;if(this.config.codeExport?.enabled&&u){let _=!1,l=Date.now();try{await this.triggerCodeExport(u),this.log("info","PIPELINE_CODE_EXPORT_START","Code export triggered"),_=!0}catch(g){let f=g instanceof Error?g.message:String(g);this.log("error","PIPELINE_CODE_EXPORT_FAILED","Code export trigger failed; skipping poll",{error:f,stage:"trigger",duration_ms:Date.now()-l}),o("code_export","failed",`trigger failed: ${f}`)}if(_){o("code_export","running","Waiting for code generation\u2026");try{p=await this.pollAndDownloadCode(u,o),this.log("info","PIPELINE_CODE_EXPORT_OK","Code export complete",{dir:p,duration_ms:Date.now()-l}),o("code_export","done",p)}catch(g){let f=g instanceof Error?g.message:String(g);this.log("error","PIPELINE_CODE_EXPORT_FAILED","Code export failed",{error:f,stage:"poll",duration_ms:Date.now()-l}),o("code_export","failed",f)}}}else o("code_export","skipped");return this.log("info","PIPELINE_COMPLETE","Pipeline complete",{duration_ms:Date.now()-i}),{success:!0,testId:this.testId,testcaseId:u,shareId:d,codeExportDir:p}}catch(a){return this.log("error","PIPELINE_FAILED","Pipeline failed",{stage:n,error:a instanceof Error?a.message:String(a),duration_ms:n?s(n):null}),{success:!1,testId:this.testId,error:a instanceof Error?a.message:String(a)}}}async stop(e,n){let r=this.config.attachedStop?this.config.stopRetryDelaysMs??Se:[];for(let o=0;;o++)try{return await e.endTest(this.testId,n)}catch(s){if(!(s instanceof Z&&(s.status===null||s.status>=500)&&o<r.length))throw s;this.log("warn","PIPELINE_FINALIZE_RETRY","Attached test's stop sent again",{attempt:o+1,status:s.status}),await new Promise(a=>setTimeout(a,r[o]))}}async runCodeExport(e,n){let r=n??this.config.onProgress,o=!1,s=Date.now();try{await this.triggerCodeExport(e),this.log("info","PIPELINE_CODE_EXPORT_TRIGGER","Code export triggered",{testcase_id:e}),o=!0}catch(i){let a=i instanceof Error?i.message:String(i);this.log("error","PIPELINE_CODE_EXPORT_TRIGGER_FAILED","Code export trigger failed; skipping poll",{error:a}),r("code_export","failed",`trigger failed: ${a}`)}if(o){r("code_export","running","Waiting for code generation\u2026");try{let i=await this.pollAndDownloadCode(e,r);return this.log("info","PIPELINE_CODE_EXPORT_OK","Code export complete",{dir:i,duration_ms:Date.now()-s}),r("code_export","done",i),i}catch(i){let a=i instanceof Error?i.message:String(i);this.log("error","PIPELINE_CODE_EXPORT_FAILED","Code export failed",{error:a,stage:"poll",duration_ms:Date.now()-s}),r("code_export","failed",a);return}}}deriveArchivedAttemptBlobs(e){try{let n=Pt(e,{readActions:r=>this.readNdjsonFromFile(r),buildBlob:r=>this.buildExecutionEnvelope(r),objective:this.config.firstObjective,screenshotBaseUrl:this.config.screenshotBaseUrl??"",extMap:this.config.screenshotExtMap,log:(r,o,s,i)=>this.log(r,o,s,i)});n>0&&this.log("info","PIPELINE_ARCHIVED_ATTEMPTS","Nested retry-attempt blobs derived",{count:n})}catch(n){this.log("debug","PIPELINE_ARCHIVED_ATTEMPTS_FAILED","Nested attempt blob pass failed",{error:n instanceof Error?n.message:String(n)})}}collectNdjsonPerRun(){let e=[],n=this.config.runObjectives??[],r=this.config.runMetadata??[],o=this.config.evidence??this.config.evidenceRead;for(let s=0;s<this.config.runDirs.length;s++){let i=this.config.runDirs[s],a=n[s]||this.config.firstObjective,c=r[s],u=o?this.readNdjsonFromFile(v(o.packTestDir,"logs",`${o.runIndices?.[s]??s}-actions.ndjson`)):this.readNdjsonFromDir(i);if(u.length>0){let d=o?.runIndices?.[s]??s,p=this.config.runFlatIndex?.[d];e.push({objective:a,records:u,...p!==void 0?{flatIndex:p}:{},resultCode:c?.resultCode,reasonCode:c?.reasonCode,errorMessage:c?.errorMessage,summary:c?.summary,oneLiner:c?.oneLiner})}}if(e.length===0){let s=v(this.config.sessionDir,"runs");if(H(s))try{let a=ke(s,{withFileTypes:!0}).filter(c=>c.isDirectory()).map(c=>c.name).sort();for(let c of a){let u=v(s,c),d=this.readNdjsonFromDir(u);d.length>0&&e.push({objective:this.config.firstObjective,records:d})}}catch{}}return e}readNdjsonFromDir(e){let n=[v(e,"run-test","actions.ndjson"),v(e,"actions.ndjson")];for(let r of n)if(H(r))return this.readNdjsonFromFile(r);return[]}readNdjsonFromFile(e){let n=[];if(!H(e))return n;this.log("debug","PIPELINE_COLLECT_READ","Reading NDJSON file",{path:e});let r=L(e,"utf-8");for(let o of r.split(`
|
|
5
|
+
`)){let s=o.trim();if(s)try{n.push(JSON.parse(s))}catch{}}return n}async generateShareLink(e){let n=`${this.config.shareApiBaseUrl}/lshs/api/v1.0/share-item/generate-sharable-link`;this.log("info","PIPELINE_SHARE_START","Requesting share link",{url:n,testcase_id:e});let r={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({entityIds:[e],entityType:"Test Case Details",expiresAt:7})},o=!!this.config.authResolver;this.log("debug","PIPELINE_SHARE_AUTH","Share link auth config",{resolver:o,fallback_auth_type:typeof this.config.auth=="string"?"bearer":"basic",tms_user:this.config.tmsUsername});let s=o?await this.config.authResolver.fetch(n,r):await P(n,{...r,headers:{...r.headers,Authorization:this.buildAuthHeader()}});if(!s.ok)throw new Error(`Share link API failed: ${s.status} ${await s.text()}`);let i=await s.json();if(!i.shareId)throw new Error("Share link API returned no shareId");return i.shareId}async triggerCodeExport(e){if(!this.config.codeExport)throw new Error("triggerCodeExport called without resolved codeExport config");let{url:n,body:r}=st({tmsBaseUrl:this.config.tmsBaseUrl,testcaseId:e,codeExport:this.config.codeExport,mobile:this.config.mobile});this.log("debug","PIPELINE_CODE_EXPORT_POST","Triggering code export",{url:n});let o={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(r)},s=this.config.authResolver?await this.config.authResolver.fetch(n,o):await P(n,{...o,headers:{...o.headers,Authorization:this.buildAuthHeader()}});if(!s.ok)throw new Error(`Code export failed: ${s.status} ${await s.text()}`)}async pollAndDownloadCode(e,n){let r=ot({tmsBaseUrl:this.config.tmsBaseUrl,testcaseId:e}),o=this.config.exitTimeoutMs??3e5,s=5e3,i=Date.now()+o;this.log("debug","PIPELINE_CODE_EXPORT_POLL","Polling for code export",{url:r,timeout_ms:o});let a=(c,u)=>this.config.authResolver?this.config.authResolver.fetch(c,u):P(c,{...u,headers:{...u?.headers,Authorization:this.buildAuthHeader()}});for(;Date.now()<i;){let c=await a(r,{method:"GET",headers:{Accept:"application/json"}});if(!c.ok){let l=await c.text().catch(()=>"");throw this.log("warn","PIPELINE_CODE_EXPORT_POLL_FAILED","Code export poll non-200; skipping",{status:c.status,body:l.slice(0,200)}),new Error(`code export poll skipped: HTTP ${c.status}`)}let d=(await c.json()).data?.find(l=>l.code_name==="kane-cli-trigger");if(!d){this.log("debug","PIPELINE_CODE_EXPORT_WAITING","No kane-cli-trigger entry yet"),n("code_export","running","Waiting for code generation\u2026"),await this.sleep(s);continue}let p=d.status.toLowerCase();if(p==="in progress"||p==="in_progress"||p==="pending"){this.log("debug","PIPELINE_CODE_EXPORT_IN_PROGRESS","Code export in progress",{status:d.status}),n("code_export","running","Generating code\u2026"),await this.sleep(s);continue}if(!d.url||d.url.length===0)throw new Error(`Code export status=${d.status} but no files returned`);let _=this.config.codeExportDir??v(this.config.sessionDir,"code-export");J(_,{recursive:!0}),this.log("debug","PIPELINE_CODE_EXPORT_DOWNLOAD","Downloading code files",{file_count:d.url.length,dir:_}),n("code_export","running",`Downloading ${d.url.length} files\u2026`);for(let l of d.url){let g=v(_,l.file_name),f=await P(l.file_url);if(!f.ok){this.log("warn","PIPELINE_CODE_EXPORT_FILE_FAILED","Failed to download file",{file_name:l.file_name,status:f.status});continue}let b=await f.text();x(g,b,"utf-8"),this.log("debug","PIPELINE_CODE_EXPORT_FILE_SAVED","File saved",{file_name:l.file_name,size_bytes:b.length})}return _}throw new Error("Code export timed out")}sleep(e){return new Promise(n=>setTimeout(n,e))}buildAuthHeader(){return typeof this.config.auth=="string"?`Bearer ${this.config.auth}`:Y(this.config.auth.username,this.config.auth.accessKey)}readAuthoredExecution(){let e=this.config.authoredExecutionPath;if(!e)return null;try{let n=L(e,"utf8");return JSON.parse(n),n}catch{return this.log("warn","PIPELINE_AUTHORED_BLOB_UNREADABLE","Authored execution.json missing/unreadable \u2014 pack gets this run's envelope",{path:e}),null}}refreshReplayOnlyInPack(e,n,r){if(!r)return{raw:e,refreshed:[]};let o=ct(n,r);if(o.length===0)return{raw:e,refreshed:[]};let s=JSON.parse(e);if(!Array.isArray(s.instructions))return{raw:e,refreshed:[]};let i=ut(s.instructions,o);return i.length===0?{raw:e,refreshed:i}:{raw:JSON.stringify(s,null,2),refreshed:i}}loadAuthoredBlocks(){let e=this.config.blockAuthoredExecutionPath;if(!e)return[];try{let n=JSON.parse(L(e,"utf8"));return Array.isArray(n.instructions)?n.instructions:[]}catch(n){return this.log("warn","PIPELINE_AUTHORED_BLOB_UNREADABLE","Authored execution.json missing/unreadable \u2014 branches that did not run this time upload empty",{path:e,error:n instanceof Error?n.message:String(n)}),[]}}loadReplayOnlyPassthrough(){let e=this.config.replayOnlyPassthrough;if(!(!e||e.flatIndices.length===0))try{let n=JSON.parse(L(e.authoredExecutionPath,"utf8"));if(!Array.isArray(n.instructions))throw new Error("no instructions array");return{authoredInstructions:n.instructions,replayOnlyFlatIndices:new Set(e.flatIndices)}}catch(n){this.log("warn","PIPELINE_PASSTHROUGH_BLOB_UNREADABLE","Authored execution.json missing/unreadable \u2014 replay-only steps convert from this run's records",{path:e.authoredExecutionPath,flat_indices:e.flatIndices,error:n instanceof Error?n.message:String(n)});return}}smartuiProject(e){let n=this.config.evidence??this.config.evidenceRead,r=this.config.runDirs.map((s,i)=>n?v(n.packTestDir,"logs",`${n.runIndices?.[i]??i}-run_meta.json`):v(s,"run_meta.json"));return{...St({runMetaPaths:r,authoredBlobPath:this.config.replayOnlyPassthrough?.authoredExecutionPath??this.config.authoredExecutionPath,instructions:e})}}buildExecutionEnvelope(e){let n=this.config.runStatuses.every(u=>u==="passed")?"success":"error",r=this.config.variableIds??{},o=[];if(this.config.variables)for(let[u,d]of Object.entries(this.config.variables)){if(d.secret||tt(d))continue;let p=u.startsWith("global.")?u.slice(7):u;o.push({id:r[p]??0,name:p,value:d.value,session_value:d.value,is_persist:!1,environment_id:0,environment_name:"No Env"})}let s=[],i=u=>{let d=s.find(p=>p.name===u.name);d?d.value=u.value:s.push(u)},a=[],c=new Set;for(let u of this.collectNdjsonPerRun())for(let d of u.records)if(d.output_variable&&d.output_value!=null&&i({name:d.output_variable,value:String(d.output_value),value_type:"test_level",variable_description:"ANALYZE result"}),d.action_type==="upload_files"){let p=N(d.action_params);if(p){let _=p.media_id||p.media_url;if(!c.has(_)){c.add(_),a.push({media_url:p.media_url,media_id:p.media_id,name:p.name,type:p.type,...p.alias?{alias:p.alias}:{}});let l=O(p.name);p.alias?i({name:z(p.alias),type:"file",value:l,value_type:"string",scope:p.alias.startsWith("local.")?"local":"global",media_id:p.media_id}):i({name:_t(p.name),value:l,value_type:"string",variable_description:`variable for ${l}`})}}}return{test_id:this.testId,version:"v4",auto_heal_version:this.config.apMode==="v2"?"AH2":"",session_id:this.config.sessionId,org_id:String(this.config.orgId),user_id:String(this.config.userId),url:this.config.firstUrl??"",start_timestamp:this.config.startedAt,end_timestamp:this.config.endedAt,status:n,commit_id:this.config.commitId,instructions:e,modules:[],uploaded_files:a,test_params:this.config.testParams??[],test_level_variables:JSON.stringify(s),test_global_variables:o,max_network_wait:0,wait_buffer:0,network_throttle:{},secrets:this.config.secrets??[],totp:[],environment_id:this.config.environmentId??0,environment:"",mobile_browser:!1,native_popups:[],smartui:this.smartuiProject(e),module_index:0}}};export{Ge as a,Ke as b,Pe as c,we as d,Se as e,Lt as f};
|
|
@@ -1,5 +1,5 @@
|
|
|
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-V24LUINK.js";import{a as p}from"./chunk-RZ4F3BHX.js";function f(e,t){if(e===t)return 0;if(e.length===0)return t.length;if(t.length===0)return e.length;let n=new Array(t.length+1),o=new Array(t.length+1);for(let r=0;r<=t.length;r++)n[r]=r;for(let r=1;r<=e.length;r++){o[0]=r;for(let i=1;i<=t.length;i++){let s=e[r-1]===t[i-1]?0:1;o[i]=Math.min(n[i]+1,o[i-1]+1,n[i-1]+s)}[n,o]=[o,n]}return n[t.length]}function C(e){let t=e.indexOf(".");return t>=0?e.slice(0,t):e}function l(e){return e.toLowerCase().replace(/\+/g,"plus").replace(/[^a-z0-9]/g,"")}function u(e){return e==="ios"?{os:"iOS",device:"simulator",target:"simulator"}:{os:"Android",device:"emulator",target:"emulator"}}var x=.4,y=3;function _(e,t,n){let o=l(t);if(o==="")return[];let r=Math.max(1,Math.round(o.length*x)),i=[];for(let s of e.devices){if(n&&!s.osVersions.includes(n))continue;let a=Math.min(f(o,l(s.name)),s.configName?f(o,l(s.configName)):1/0);a<=r&&i.push({device:s,score:a})}return i.sort((s,a)=>s.score-a.score||s.device.name.localeCompare(a.device.name)),i.slice(0,y).map(s=>s.device)}function w(e,t){let n=Number.parseFloat(t);if(!Number.isFinite(n))return e.osVersions[e.osVersions.length-1];let o,r=1/0;for(let i of e.osVersions){let s=Math.abs(Number.parseFloat(i)-n);Number.isFinite(s)&&s<r&&(r=s,o=i)}return o??e.osVersions[e.osVersions.length-1]}function D(e){return` See all devices: kane-cli devices list --target ${u(e).target} --remote`}function N(e,t){let n=l(t);return e.devices.find(o=>l(o.name)===n||o.configName!==void 0&&l(o.configName)===n)}function k(e,t){return e.runson?.[C(t)]}function G(e,t,n){let o=u(e.platform),r=N(e,t);if(!r){let i=_(e,t,n),s=i.length?` Did you mean: ${i.map(a=>`${a.name} (${a.osVersions.join(", ")})`).join(`
|
|
3
3
|
`)}
|
|
4
4
|
`:"";return{ok:!1,code:"device_not_found",detail:`no ${o.device} device named "${t}"`+(n&&i.length?` running ${o.os} ${n}`:"")+`.
|
|
5
5
|
${s}${D(e.platform)}`}}if(!r.osVersions.includes(n)){let i=w(r,n);return{ok:!1,code:"device_os_version_unsupported",detail:`${r.name} does not run ${o.os} ${n}.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as l}from"./chunk-
|
|
2
|
+
import{b as l}from"./chunk-RM5ZVDVR.js";import{e as d,h as p}from"./chunk-XMPTFXPW.js";import{b as f}from"./chunk-REKHAN53.js";import{Ha as i,s as g}from"./chunk-RHQLDNZL.js";import{a as c}from"./chunk-FOJHSG5M.js";var h=new Set(["context extract","design tests","context sessions","context ingest","context list","maintain reconcile","maintain evolve","cover","context pull","context impact"]),I=new Set(["context ingest","context extract"]),y=new Set(["testmd run","testrun run"]),w=new Set(["context","design","maintain","cover"]);function $(e,n){return n.kind==="local"||n.kind==="pick"||!w.has(e.split(" ")[0])?null:n.kind==="refuse"?n.refusal:w.has(e)||h.has(e)||y.has(e)?null:i.notYet(e)}var R={tests:"design",sessions:"save","sessions discard":"discard",ingest:"extract",list:"list",reconcile:"reconcile"};function a(e,n,t){return t?p(d("ndjson",R[n]??n),e.message,e.code,e.remedy):(k(e),2)}function G(e,n,t){if(e.code!=="LIST_FAILED"&&e.code!=="COVERAGE_FAILED")return a(e,n,t);if(t){let r=d("ndjson",R[n]??n);return r.event({type:"error",code:e.code,message:e.message,...e.remedy?{remedy:e.remedy}:{}}),r.done(1)}return k(e),1}function E(e,n){if(!e.answer?.length)return null;let t=f({answer:e.answer});return t.ok?e.resume?e.mode!=="agent"?i.answerAgentOnly(n,e.resume):null:i.answerNeedsResume():i.answerParse(t.error)}function v(e,n){if(!e.answer?.length||l(process.cwd()).kind!=="remote")return null;let t=E(e,n);return t===null?null:a(t,n.split(" ")[1],e.mode==="agent")}var B=e=>`${c.green(`\u2713 Project: "${e}"`)}
|
|
3
3
|
${c.dim(" this folder is now linked to it; what you save goes to the project")}
|
|
4
4
|
`;function k(e){if(process.stderr.write(`${u(`error: ${e.message}`)}
|
|
5
5
|
`),e.detail&&process.stderr.write(`${c.dim(` ${e.detail}`)}
|
|
@@ -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-MAQVRBUQ.js";import{c as L}from"./chunk-RFHMDQXZ.js";import{a as R}from"./chunk-HCBYKLMW.js";import{A as s}from"./chunk-BRWCWZE3.js";import{m as E,n as h}from"./chunk-WMXBRC4B.js";import{a as y,b as o,i as P}from"./chunk-33DWJV67.js";import{a as B}from"./chunk-6YGTRKDT.js";import{e as d}from"./chunk-UR6MHSHU.js";var n=d(B(),1);import{basename as D}from"path";var r=d(R(),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&&(h(U),await e.close())},v=()=>{u.current||(u.current=!0,V())};return P((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,E(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)(y,{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,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c as g,d as u}from"./chunk-
|
|
2
|
+
import{c as g,d as u}from"./chunk-TPCW5OU5.js";import{a as f}from"./chunk-72KYMWQ5.js";import{readFileSync as E}from"fs";var p=/\{\{\s*([A-Za-z_][A-Za-z0-9_.]*)\s*\}\}/g;function h(a){let e=[];for(let o of a){let r=o.trim();if(r){if(r.startsWith("@")){let n=r.slice(1).trim(),t;try{t=E(n,"utf8")}catch(l){throw new Error(`--deps @${n}: ${l.message}`)}let s=t.trim();s&&e.push(s);continue}e.push(r)}}return e.join(`
|
|
3
3
|
|
|
4
4
|
`)}function y(a,e){let o=a.prompt.trim(),r=a.deps.trim(),n=[["--prompt",o],["--deps",r]];if(!n.some(([,i])=>p.test(i)))return p.lastIndex=0,{prompt:o,deps:r,variables:{},secretNames:[]};p.lastIndex=0;let t=u({objective:[o,r].join(`
|
|
5
5
|
`),globalDir:e.globalDir,localDir:e.localDir,file:e.file,inline:e.inline,onLoadError:e.onLoadError});for(let[i,x]of n)for(let v of x.matchAll(p)){let c=v[1],b=c.replace(/^(global\.|secrets\.user\.)/,"");if(!(c in t.raw)&&!(b in t.raw))return{error:`${i} uses {{${c}}} but no variable "${b}" is defined (variables files, --variables-file or --variables)`}}let s=o?f(t.raw,o).objective:"",l=r?f(t.raw,r).objective:"",m=g(t.auteur,[s,l].join(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as C}from"./chunk-
|
|
2
|
+
import{a as C}from"./chunk-Q4QCSO6Y.js";import{a as E}from"./chunk-UJYC2XDD.js";import{c as O}from"./chunk-SMXABALN.js";import{h as Q}from"./chunk-6WN4WSXR.js";import{b as G}from"./chunk-LMOW4NM5.js";import{a as z}from"./chunk-QWEQ742S.js";import{a as B}from"./chunk-NIBNVPAE.js";import{a as A}from"./chunk-HCBYKLMW.js";import{e as q}from"./chunk-Z7S3IWUX.js";import{A as o}from"./chunk-BRWCWZE3.js";import{a as n,b as r,i as N}from"./chunk-33DWJV67.js";import{a as L}from"./chunk-6YGTRKDT.js";import{l as M,q as R,t as Z}from"./chunk-A7RJQJNT.js";import{e as g}from"./chunk-UR6MHSHU.js";var H=g(L(),1);var y=g(A(),1);function ie(e){return[{value:"local",label:"Local build",hint:R(e).join(" / "),available:!0},{value:"uploaded",label:"Uploaded app",hint:"an app id from your cloud uploads",available:!0}]}function he({kind:e,onSelect:i,onCancel:m}){let s=ie(e),[b,f]=(0,H.useState)(0),[l,d]=(0,H.useState)(null);return N((p,a)=>{if(a.escape){m();return}if(a.upArrow&&f(t=>Math.max(0,t-1)),a.downArrow&&f(t=>Math.min(s.length-1,t+1)),a.return){let t=s[b];if(!t.available){d("That source isn't available \u2014 choose a local build for now.");return}d(null),i(t.value)}}),(0,y.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,y.jsx)(r,{color:o.orange,bold:!0,children:"App under test"}),(0,y.jsx)(n,{marginTop:1,flexDirection:"column",children:s.map((p,a)=>{let t=a===b,S=p.available?t?o.orange:void 0:o.muted;return(0,y.jsxs)(n,{children:[(0,y.jsxs)(r,{color:S,children:[t?"\u276F ":" ",p.label]}),(0,y.jsxs)(r,{color:o.dim,children:[" ",p.hint]})]},p.value)})}),l&&(0,y.jsx)(n,{marginTop:1,children:(0,y.jsx)(r,{color:o.red,children:l})}),(0,y.jsx)(B,{bindings:[{keys:"\u2191\u2193",label:"navigate"},{keys:"\u21B5",label:"select"}],escBackLabel:"back"})]})}var x=g(L(),1);var u=g(A(),1),j=50,J=500;function ae(e){return`${e.name} (${e.appId})`}function Re({kind:e,listApps:i,onSelect:m,onManualEntry:s,onCancel:b,busyMessage:f}){let[l,d]=(0,x.useState)([]),[p,a]=(0,x.useState)(!0),[t,S]=(0,x.useState)(!1),[ee,$]=(0,x.useState)(!1),[w,V]=(0,x.useState)(null),[X,oe]=(0,x.useState)(""),[re,_]=(0,x.useState)(!1),F=(0,x.useRef)(!0),D=(0,x.useRef)(0);if((0,x.useEffect)(()=>{let T=++D.current,k=X.trim();F.current?a(!0):k&&$(!0),S(!0),V(null),_(!1),(async()=>{let I=[];try{for(let P=0;;P+=j){let Y=await i({limit:j,offset:P,search:k});if(T!==D.current)return;if(I.push(...Y.apps),d([...I]),F.current&&(a(!1),F.current=!1),$(!1),Y.apps.length===0||I.length>=Y.total)break;if(I.length>=J){_(!0);break}}}catch(P){if(T!==D.current)return;V(P instanceof Error?P.message:String(P)),a(!1),$(!1)}finally{T===D.current&&S(!1)}})()},[X,i]),N((T,k)=>{if(k.tab){s();return}k.escape&&b()},{isActive:!!w&&!f}),f)return(0,u.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,u.jsx)(r,{color:o.orange,bold:!0,children:"App under test"}),(0,u.jsxs)(n,{marginTop:1,children:[(0,u.jsx)(C,{}),(0,u.jsxs)(r,{color:o.secondary,children:[" ",f]})]})]});if(w)return(0,u.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.red,paddingX:2,paddingY:1,children:[(0,u.jsx)(r,{color:o.red,bold:!0,children:"App under test"}),(0,u.jsx)(n,{marginTop:1,children:(0,u.jsx)(r,{color:o.red,children:"Could not load your uploads."})}),(0,u.jsx)(n,{marginTop:1,children:(0,u.jsx)(r,{color:o.dim,children:w})}),(0,u.jsx)(B,{bindings:[{keys:"tab",label:"tab to enter an app id"}],escBackLabel:"back to chat"})]});let te=new Map(l.map(T=>[T.appId,T])),ne=l.map(T=>({id:T.appId,label:ae(T)})),W=!p&&!t&&l.length===0&&!X.trim()?`No builds for ${M(e)} uploaded to this account yet \u2014 press Tab to enter an app id.`:null;return(0,u.jsx)(E,{title:"App under test",items:ne,loading:p,loadingText:"Loading your uploads\u2026",loadingMore:t,searching:ee,itemNoun:"uploads",preserveSelectionById:!0,onSearch:oe,onTab:s,extraHint:"tab to enter an id",footer:W?(0,u.jsx)(r,{color:o.dim,children:W}):re?(0,u.jsx)(r,{color:o.dim,children:`Showing the first ${J} \u2014 type to search the rest.`}):void 0,onSelect:T=>{let k=te.get(T.id);k&&m({appId:k.appId,name:k.name})},onCancel:b})}var U=g(L(),1);var c=g(A(),1);function we({busyMessage:e,onSubmit:i,onBack:m}){let[s,b]=(0,U.useState)(""),[f,l]=(0,U.useState)(null);return e?(0,c.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,c.jsx)(r,{color:o.orange,bold:!0,children:"App under test"}),(0,c.jsxs)(n,{marginTop:1,children:[(0,c.jsx)(C,{}),(0,c.jsxs)(r,{color:o.secondary,children:[" ",e]})]})]}):(0,c.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,c.jsx)(r,{color:o.orange,bold:!0,children:"App under test"}),(0,c.jsx)(n,{marginTop:1,children:(0,c.jsx)(r,{color:o.dim,children:"App id from your cloud uploads:"})}),(0,c.jsxs)(n,{marginTop:1,children:[(0,c.jsx)(r,{color:o.dim,children:" "}),(0,c.jsx)(O,{value:s,onChange:d=>{b(d),f&&l(null)},onSubmit:d=>{let p=d.trim();if(!p){l("Enter an app id.");return}if(!G(p)){l("That doesn't look like an app id \u2014 they start with APP.");return}l(null),i(p).then(a=>{!a.ok&&a.error&&l(a.error)})},onCancel:m,placeholder:"APP1016032231178585590501450"})]}),f&&(0,c.jsxs)(n,{marginTop:1,flexDirection:"column",children:[(0,c.jsx)(r,{color:o.red,children:f}),(0,c.jsx)(r,{color:o.dim,children:"Enter a valid app id \u2014 copy it from your cloud uploads."})]}),(0,c.jsx)(B,{bindings:[{keys:"\u21B5",label:"use this app"}],escBackLabel:"back"})]})}var K=g(L(),1);var h=g(A(),1);function le(e){return Q(e.trim())}function _e({kind:e,onBack:i,onSelect:m,onCancel:s}){let[b,f]=(0,K.useState)(""),[l,d]=(0,K.useState)(null),p=R(e).join(" / ");return(0,h.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,h.jsx)(r,{color:o.orange,bold:!0,children:"App under test"}),(0,h.jsx)(n,{marginTop:1,children:(0,h.jsx)(r,{color:o.dim,children:`Path to a build (${p}): `})}),(0,h.jsxs)(n,{marginTop:1,children:[(0,h.jsx)(r,{color:o.dim,children:" "}),(0,h.jsx)(O,{value:b,onChange:a=>{f(a),l&&d(null)},onSubmit:a=>{let t=le(a);if(!t){d(a.trim()?`Not a build \u2014 expected ${p}.`:"Enter the path to a build.");return}if(!Z(e,t.value)){d(`${t.kind} builds don't run on ${M(e)} \u2014 expected ${p}.`);return}d(null),m(t).then(S=>{!S.ok&&S.error&&d(S.error)})},onCancel:i,placeholder:`/path/to/app${R(e)[0]}`})]}),l&&(0,h.jsx)(n,{marginTop:1,children:(0,h.jsx)(r,{color:o.red,children:l})}),(0,h.jsx)(B,{bindings:[{keys:"\u21B5",label:"use this build"}],escBackLabel:"back"})]})}var v=g(A(),1);function pe(e){let i=e.kind==="simulator";switch(e.state){case"ready":return i?"Booted":"Running";case"stopped":return i?"Shutdown":"Stopped";case"unauthorized":return"UNAUTHORIZED";case"offline":return"Offline"}}function ce(e){switch(e.state){case"unauthorized":return"accept the authorisation prompt on the device, then reopen this list";case"offline":return e.kind==="simulator"?"not responding \u2014 open Simulator.app to inspect it":"not responding \u2014 reconnect it, or restart the emulator";default:return}}function se(e,i){let m=i.id!==void 0?{...i,id:z(i.id)}:i,s=e.virtualName!==void 0?{...e,virtualName:z(e.virtualName)}:e;return q(s,m)}function de(e){return e.virtualName??e.displayName}function ue(e,i){let m=e.state==="ready"||e.state==="stopped",s=ce(e),b=e.osVersion?` (${e.osVersion})`:"";return{id:e.id,label:`${de(e)}${b} \xB7 ${pe(e)}`,...i&&se(e,i)?{isActive:!0}:{},...m?{}:{disabled:!0},...!m&&s?{disabledHint:s}:{}}}function me(e){return e==="emulator"?"No Android emulator found. Make sure an emulator exists on this machine (Android Studio \u2192 Device Manager), then reopen this list.":e==="simulator"?"No iOS simulator found. Make sure a simulator exists on this machine (Xcode \u2192 Windows \u2192 Devices and Simulators), then reopen this list.":"No emulator or simulator found. Make sure one exists on this machine, then reopen this list."}function eo({targets:e,preselectedTarget:i,preselectedId:m,busyMessage:s,onSelect:b,onCancel:f,kind:l}){if(s)return(0,v.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,v.jsx)(r,{color:o.orange,bold:!0,children:"Device"}),(0,v.jsxs)(n,{marginTop:1,children:[(0,v.jsx)(C,{}),(0,v.jsxs)(r,{color:o.secondary,children:[" ",s]})]})]});if(e.length===0)return(0,v.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,v.jsx)(r,{color:o.orange,bold:!0,children:"Device"}),(0,v.jsx)(n,{marginTop:1,children:(0,v.jsx)(r,{color:o.dim,children:me(l)})})]});let d=e.map(t=>ue(t,i)),p=i?d.find(t=>t.isActive)?.id??null:m?e.find(t=>t.id===m||t.virtualName===m)?.id??null:null,a=new Map(e.map(t=>[t.id,t]));return(0,v.jsx)(E,{title:"Device",items:d,itemNoun:"devices",defaultActiveId:p,preserveSelectionById:!0,onSelect:t=>{let S=a.get(t.id);S&&b(S)},onCancel:f})}export{he as a,Re as b,we as c,_e as d,eo as e};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{homedir as s}from"os";import{join as t}from"path";var g="0.10.5";var a=t(s(),".testmuai","kaneai"),h=t(a,"profiles"),u=t(a,"tui-config.json"),U=t(a,"media"),_="https://registry.npmjs.org/@testmuai/kane-cli",x="https://api.github.com/repos/LambdaTest/kane-cli/releases",i="@testmuai/kane-cli-skill",A=`https://registry.npmjs.org/${i}`,o="kane-cli",L=[{dir:t(s(),".claude","skills",o),agent:"Claude Code"},{dir:t(s(),".agents","skills",o),agent:"Codex CLI"},{dir:t(s(),".gemini","skills",o),agent:"Gemini CLI"}],E="https://dd-proxy.lambdatest.com/intake/kane-cli",R="https://v16-sumo.lambdatest.com/intake/v16-agent-telemetry",I="https://kaneai-playground.lambdatest.io",v=9222,C=9230,T=t(a,"chrome-profiles"),r=t(a,"hints"),f=t(r,"state.json");function B(e){return t(r,`catalog-${e}.json`)}var l=t(a,"evidence");function S(e){return t(l,`catalog-kane-cli-${e}.json`)}var c=t(a,"mobile");function N(e,n="android"){return t(c,n==="ios"?`device-catalog-ios-${e}.json`:`device-catalog-${e}.json`)}var m="127.0.0.1",k=18392,O=18400,p="/callback";function P(e){return`http://${m}:${e}${p}`}var D="KANE CLI",M="*",H={prod:{authBaseUrl:"https://auth.lambdatest.com",consentUrl:"https://accounts.lambdatest.com",controllerBaseUrl:"https://kaneai-api.lambdatest.com/v16-controller/v1",tmsBaseUrl:"https://test-manager-api.lambdatest.com/api",testGeneratorBaseUrl:"https://test-manager-api.lambdatest.com",secretsBaseUrl:"https://api-hyperexecute.lambdatest.com",testManagerUiUrl:"https://test-manager.lambdatest.com",shareApiBaseUrl:"https://api.lambdatest.com",v16ServerHost:"https://kaneai-api.lambdatest.com/v16-server",evidenceViewerUrl:"https://evidence.lambdatest.com",mediaArtefactsHost:"prod-mobile-artefacts.lambdatest.com",mobileAppBaseUrl:"https://api.lambdatest.com",mobileHubUrl:"https://mobile-hub.lambdatest.com/wd/hub",lrmaaBaseUrl:"https://mobile-api.lambdatest.com/mobile-automation/api/v1",latticeBaseUrl:"https://kaneai-api.lambdatest.com/v16-lattice",deviceStreamUrl:"https://stream-microfrontend.lambdatest.com"},stage:{authBaseUrl:"https://stage-auth.lambdatestinternal.com",consentUrl:"https://stage-accounts.lambdatestinternal.com",controllerBaseUrl:"https://auteur-stage-automind.lambdatestinternal.com/v16-controller/v1",tmsBaseUrl:"https://stage-test-manager-api.lambdatestinternal.com/api",testGeneratorBaseUrl:"https://stage-test-manager-api.lambdatestinternal.com",secretsBaseUrl:"https://api-stage-hyperexecute.lambdatestinternal.com",testManagerUiUrl:"https://stage-test-manager.lambdatestinternal.com",shareApiBaseUrl:"https://stage-api.lambdatestinternal.com",v16ServerHost:"https://auteur-stage-automind.lambdatestinternal.com/v16-server",evidenceViewerUrl:"https://stage-evidence.lambdatestinternal.com",mediaArtefactsHost:"stage-mobile-artefacts.lambdatestinternal.com",mobileAppBaseUrl:"https://stage-api.lambdatestinternal.com",mobileHubUrl:"https://stage-mobile-hub.lambdatestinternal.com/wd/hub",lrmaaBaseUrl:"https://stage-mobile-api.lambdatestinternal.com/mobile-automation/api/v1",latticeBaseUrl:"https://auteur-stage-automind.lambdatestinternal.com/v16-lattice",deviceStreamUrl:"https://stage-stream-microfrontend.lambdatestinternal.com"}},G={orange:"#ff9500",generateAccent:"#0d9488",assuranceAccent:"#b388ff",purple:"#b388ff",secondary:"#888888",dim:"#666666",muted:"#444444",green:"#4ade80",red:"#ef4444",amber:"#fbbf24"};export{g as a,a as b,u as c,U as d,_ as e,x as f,i as g,L as h,E as i,R as j,I as k,v as l,C as m,T as n,f as o,B as p,S as q,N as r,m as s,k as t,O as u,p as v,P as w,D as x,M as y,H as z,G as A};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as k}from"./chunk-QSCXXNC2.js";import{a as f}from"./chunk-APXJRWIJ.js";import{b as C,d as N}from"./chunk-CBEMXSWF.js";import{n as P}from"./chunk-G4K3TP2I.js";import{a as B,b as M}from"./chunk-6PIIUAZF.js";import{b as D}from"./chunk-XTQUCCJH.js";import{a as m}from"./chunk-YKOZBFR3.js";import{a as L,b,c as h,e as I,g as _}from"./chunk-WMXBRC4B.js";import{d as O,g}from"./chunk-ZCRZFAOT.js";import{a as T}from"./chunk-RZ4F3BHX.js";import{b as A,c as w}from"./chunk-U5V3L5QH.js";var q=/(_FAILED|_FAIL|_ERROR|_ABORT|_DEATH|_INVALID)$|^CRASH$/;function z(t,e){return t==="error"||q.test(e)}var Y=[["ASR_","assurance"],["PIPELINE_","upload"],["UPLOAD_","upload"],["DIRECT_UPLOAD_","upload"],["SCREENSHOT_","screenshot"],["EVIDENCE_","evidence"],["ARCHIVE_","evidence"],["BUNDLE_SYNC_","evidence"],["RUNNER_","runner"],["CHROME_","chrome"],["ATM_","tms"],["TMS_","tms"],["GATE_","tms"],["ENSURE_FOLDER_","tms"],["SECRET_","variables"],["VAR_","variables"],["AUTH_","auth"],["CRM_","crm"],["TESTRUN_","testrun"],["DEVICE_","device"],["SIM_","device"],["REAL_DEVICE_","device"],["CRASH","cli"]];function W(t){for(let[e,i]of Y)if(t.startsWith(e))return i;return"cli"}function a(t){if(t==null||t==="")return null;if(t instanceof Error)return`${t.name}: ${t.message}`;if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}function F(t,e,i,n){if(!z(t,e))return n;let r={...n};return a(r.error_code)===null&&(r.error_code=a(r.first_code)??a(r.save_blocker)??a(r.code)??a(r.reason_code)??e.toLowerCase()),a(r.error_domain)===null&&(r.error_domain=W(e)),a(r.error)===null?r.error=a(r.stderr_tail)??a(r.message)??(i&&i!==e?i:`${String(r.error_domain)}: ${String(r.error_code)}`):typeof r.error!="string"&&(r.error=a(r.error)),r}var x=-1,U=5e3,E=class{config;buffer=[];stepBuffer=new Map;heldDropped=new Map;sessionEscalated=!1;flushTimer=null;currentRunIndex=null;currentRunId=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,i=e===null?null:`run-${e}`){this.currentRunIndex=e,this.currentRunId=i}log(e,i,n,r={}){let s=this.buildEntry(e,i,n,r);if(this.stopped){e!=="debug"&&h([s]);return}if(e==="debug"){if(this.currentRunIndex===null&&this.sessionEscalated){this.buffer.push(s);return}this.hold(this.currentRunIndex??x,s);return}e==="error"&&(this.currentRunIndex!==null&&this.promote(this.currentRunIndex),this.promote(x),this.sessionEscalated=!0),this.buffer.push(s)}logStep(e,i,n,r={}){let s=this.buildEntry("debug",i,n,r);s.run_index=e,s.run_id=`run-${e}`,!this.stopped&&this.hold(e,s)}hold(e,i){let n=this.stepBuffer.get(e);n||(n=[],this.stepBuffer.set(e,n)),n.push(i),n.length>U&&(n.shift(),this.heldDropped.set(e,(this.heldDropped.get(e)??0)+1))}promote(e){let i=this.stepBuffer.get(e),n=this.heldDropped.get(e)??0;n>0&&this.buffer.push(this.buildEntry("warn","DEBUG_LINES_DROPPED",`Dropped ${n} held debug lines`,{bucket:e,dropped:n,cap:U})),i&&i.length>0&&this.buffer.push(...i),this.stepBuffer.delete(e),this.heldDropped.delete(e)}escalate(e){this.promote(e),this.promote(x)}escalateAll(){for(let e of[...this.stepBuffer.keys()].sort((i,n)=>i-n))this.promote(e);this.sessionEscalated=!0}discardSteps(e){this.stepBuffer.delete(e),this.heldDropped.delete(e)}discardAll(){this.stepBuffer.clear(),this.heldDropped.clear()}amendUnsent(e,i){for(let n=this.buffer.length-1;n>=0;n--)if(this.buffer[n].event===e)return this.buffer[n].context={...this.buffer[n].context,...i},!0;return!1}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),i=null;try{i=await this.config.getToken()}catch{this.buffer.unshift(...e);return}let n={"Content-Type":"application/json"};i&&(n.Authorization=`Bearer ${i}`);let r=JSON.stringify(e);for(let s=0;s<3;s++){try{let o=new AbortController,l=setTimeout(()=>o.abort(),1e4),c=await T(this.config.proxyUrl,{method:"POST",headers:n,body:r,signal:o.signal});if(clearTimeout(l),c.ok)return}catch{}if(this._stoppingFast){this.buffer.unshift(...e);return}s<2&&await new Promise(o=>setTimeout(o,1e3*Math.pow(2,s)))}this._droppedBatches++,this._droppedEntries+=e.length}async flushOnce(e){if(this.buffer.length===0)return"empty";let i=this.buffer.splice(0),n=Date.now()+e,r=!1,s,o=null;try{o=await Promise.race([this.config.getToken(),new Promise(u=>{s=setTimeout(()=>{r=!0,u(null)},e),s.unref&&s.unref()})])}catch{o=null}finally{s&&clearTimeout(s)}let l=n-Date.now();if(r||l<=0)return this.buffer.unshift(...i),"timeout";let c={"Content-Type":"application/json"};o&&(c.Authorization=`Bearer ${o}`);try{let u=new AbortController,p=setTimeout(()=>u.abort(),l);p.unref&&p.unref();let d=await T(this.config.proxyUrl,{method:"POST",headers:c,body:JSON.stringify(i),signal:u.signal});return clearTimeout(p),d.ok?"sent":(this.buffer.unshift(...i),"failed")}catch{return this.buffer.unshift(...i),Date.now()>=n?"timeout":"failed"}}async stopAndFlushOnce(e){let i=Date.now()+e;this._stoppingFast=!0,this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null);let n=this._inFlightFlush;if(n){let s;await Promise.race([n.catch(()=>{}),new Promise(o=>{s=setTimeout(o,e),s.unref&&s.unref()})]),s&&clearTimeout(s)}if(this.buffer.length===0)return"empty";let r=i-Date.now();if(r<=0)return"timeout";try{return await this.flushOnce(r)}catch{return"failed"}}drainBuffer(){return this.buffer.splice(0)}get droppedBatches(){return this._droppedBatches}get droppedEntries(){return this._droppedEntries}logDropStats(){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._droppedBatches=0,this._droppedEntries=0)}async flushNow(){this.stopped||(this.logDropStats(),await this.flush())}async shutdown(){this.stopped||(this.logDropStats(),this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null),await this.flush(),this.spoolBuffer())}shutdownSync(){this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null),this.spoolBuffer()}spoolBuffer(){let e=this.buffer.splice(0);e.length>0&&h(e)}get bufferSize(){return this.buffer.length}stepBufferSize(e){return this.stepBuffer.get(e)?.length??0}get runIndex(){return this.currentRunIndex}buildEntry(e,i,n,r){return{hostname:"kane-cli",service:"kane-cli",ddsource:"kane-cli",ddtags:`version:${this.config.device.cli_version}`,level:e,event:i,message:n,session_id:this.config.sessionId,run_index:i.startsWith("tcg_")?null:this.currentRunIndex,run_id:i.startsWith("tcg_")?null:this.currentRunId,identity:this.config.identity,device:this.config.device,context:F(e,i,n,r),timestamp:new Date().toISOString()}}};import{platform as Z,arch as ee}from"os";function v(t){let e=t?.trim();return e||void 0}function Q(t=process.env){let e=v(t.TEST_INSTANCE_ID),i=v(t.JOB_ID),n=v(t.TASK_ID),r=v(t.KANE_CLI_PARENT_EXECUTION_ID);return{...e?{testInstanceId:e}:{},...i?{jobId:i}:{},...n?{taskId:n}:{},...r?{parentExecutionId:r}:{}}}function j(t=process.env){if(t.KANE_CLI_MODE!=="hyperexecute")return{};let e=Q(t);return{remote:!0,...e.jobId?{hx_job_id:e.jobId}:{},...e.taskId?{hx_task_id:e.taskId}:{},...e.testInstanceId?{hx_test_instance_id:e.testInstanceId}:{},...e.parentExecutionId?{parent_execution_id:e.parentExecutionId}:{}}}function te(t=process.env){return!!t.VITEST||t.KANE_CLI_TEST==="1"}function V(t){return{cli_version:m,platform:Z(),arch:ee(),host_agent:k(),invocation_mode:t,...te()?{test:!0}:{},...j()}}import X from"fs";import $ from"fs";import ie from"path";var ne=1e3,S=0,re=new Set([130,3]),y=class t{ids;logger;opts;ended=!1;proposals=0;creditsSeen;runTotals={};createdAt=Date.now();errorState;constructor(e,i={emitted:!1}){this.ids=e.envelope,this.logger=e.logger,this.opts=e,this.errorState=i}get enabled(){return this.logger!==null}event(e,i={}){if(!this.logger)return;(e==="ASR_ERROR"||e==="EXPLORE_ERROR")&&(this.errorState.emitted=!0);let n=b(this.ids,e,i);this.logger.log(L[e],e,e,H(n))}error(e,i={}){this.logger&&(this.logger.escalate(S),this.event("ASR_ERROR",{...i,error_code:e}))}child(e,i){return new t({...this.opts,envelope:{...this.ids,operation_id:i,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:i}=await import("./store-id-YZ5WKJ25.js"),{ids:n,cloned:r}=i(e,g());this.ids.context_lineage_id=n.context_lineage_id,this.ids.context_instance_id=n.context_instance_id,r&&this.event("ASR_CONTEXT_CLONED")}catch{}}spoolError(e,i={}){this.logger&&(this.event("ASR_ERROR",{...i,error_code:e}),h(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 i=typeof e.kind=="string"?e.kind.slice(0,64):"trace",n={...H(b(this.ids,"ASR_CMD_START",{})),trace_kind:i};typeof e.code=="string"&&(n.trace_code=e.code.slice(0,64)),delete n.event,this.logger.logStep(S,`trace_${i}`,i,n)}}wireTrace(e,i,n){if(!this.logger)return;n&&this.agentSession(n);let r=i&&typeof i=="object"?i:{},s=o=>Array.isArray(o)?o.length:void 0;switch(e){case"agent_spawn":this.event("ASR_AGENT_SPAWN",{tier:r.tier,duration_ms:r.duration_ms});break;case"agent_exit":this.event("ASR_AGENT_EXIT",{exit_code:r.exit_code,signal:r.signal});break;case"session_paused":{let o=r.pending;if(!o){this.traceTee()({kind:e});break}this.event("ASR_SESSION_PAUSED",{pending_questions:s(o.questions)??0,pending_proposals:s(o.proposals)??0});break}case"proposal":{let o=r.proposal;this.event("ASR_PROPOSAL",{item_count:s(o?.use_cases),turn_index:++this.proposals});break}case"design":{let o=["acs","acceptance_criteria","scenarios","tests"].reduce((l,c)=>l+(s(r[c])??0),0);this.event("ASR_PROPOSAL",{item_count:o,turn_index:++this.proposals});break}case"validation_details":{let o=Array.isArray(r.errors)?r.errors:[];this.event("ASR_VALIDATE_FAILED",{error_code:o[0]?.code,count:o.length,turn_index:this.proposals});break}case"design_commit_failed":case"validate_failed":{let o=Array.isArray(r.codes)?r.codes:[];this.event("ASR_VALIDATE_FAILED",{error_code:o[0],count:o.length,turn_index:this.proposals});break}case"kane_validate":r.refused?this.event("ASR_VALIDATE_FAILED",{error_code:"validation_refused",count:1,turn_index:this.proposals}):this.traceTee()({kind:e});break;case"high_risk_ci":this.event("ASR_HIGH_RISK_CI",{count:r.count});break;case"resume_kind":this.event("ASR_SESSION_RESUMED",{});break;case"usage":typeof r.total_credits=="number"&&(this.creditsSeen=r.total_credits),this.traceTee()({kind:e});break;case"commit":this.event("ASR_COMMIT",r);break;case"design_phase_committed":this.event("ASR_COMMIT",{phase:r.phase,duration_ms:r.ms});break;default:this.traceTee()({kind:e,code:typeof r.code=="string"?r.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,i={}){if(!this.ended){if(this.ended=!0,this.closeEvents(e,i),this.logger)if(this.opts.longSession)await this.logger.shutdown();else{let n=await this.logger.flushOnce(ne);(n==="failed"||n==="timeout")&&h(this.logger.drainBuffer())}this.logger&&this.writeManifestLine(e.exit_code),_(null)}}endSync(e,i={}){this.ended||(this.ended=!0,this.closeEvents(e,i),this.logger&&(this.logger.shutdownSync(),this.writeManifestLine(e.exit_code)),_(null))}startInterval(){this.logger?.start()}closeEvents(e,i){e.duration_ms===void 0&&(e={...e,duration_ms:Date.now()-this.createdAt}),this.logger&&(e.exit_code===0?this.logger.discardSteps(S):this.logger.escalate(S),e.exit_code>0&&!re.has(e.exit_code)&&!i.testFailed&&!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",{credits_total:this.creditsSeen,...this.runTotals,...e,...i.testFailed&&!this.errorState.emitted?{outcome:"test_failed"}:{}}))}setRunTotals(e){for(let[i,n]of Object.entries(e))typeof n=="number"&&Number.isFinite(n)&&(this.runTotals[i]=n)}writeManifestLine(e){try{let i=O(this.ids.context_instance_id??null);$.mkdirSync(ie.dirname(i),{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};$.appendFileSync(i,JSON.stringify(n)+`
|
|
2
|
+
import{a as k}from"./chunk-QSCXXNC2.js";import{a as f}from"./chunk-UV7FPIBL.js";import{b as C,d as N}from"./chunk-CBEMXSWF.js";import{n as P}from"./chunk-G4K3TP2I.js";import{a as B,b as M}from"./chunk-6PIIUAZF.js";import{b as D}from"./chunk-XTQUCCJH.js";import{a as m}from"./chunk-BRWCWZE3.js";import{a as L,b,c as h,e as I,g as _}from"./chunk-WMXBRC4B.js";import{d as O,g}from"./chunk-ZCRZFAOT.js";import{a as T}from"./chunk-RZ4F3BHX.js";import{b as A,c as w}from"./chunk-U5V3L5QH.js";var q=/(_FAILED|_FAIL|_ERROR|_ABORT|_DEATH|_INVALID)$|^CRASH$/;function z(t,e){return t==="error"||q.test(e)}var Y=[["ASR_","assurance"],["PIPELINE_","upload"],["UPLOAD_","upload"],["DIRECT_UPLOAD_","upload"],["SCREENSHOT_","screenshot"],["EVIDENCE_","evidence"],["ARCHIVE_","evidence"],["BUNDLE_SYNC_","evidence"],["RUNNER_","runner"],["CHROME_","chrome"],["ATM_","tms"],["TMS_","tms"],["GATE_","tms"],["ENSURE_FOLDER_","tms"],["SECRET_","variables"],["VAR_","variables"],["AUTH_","auth"],["CRM_","crm"],["TESTRUN_","testrun"],["DEVICE_","device"],["SIM_","device"],["REAL_DEVICE_","device"],["CRASH","cli"]];function W(t){for(let[e,i]of Y)if(t.startsWith(e))return i;return"cli"}function a(t){if(t==null||t==="")return null;if(t instanceof Error)return`${t.name}: ${t.message}`;if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}function F(t,e,i,n){if(!z(t,e))return n;let r={...n};return a(r.error_code)===null&&(r.error_code=a(r.first_code)??a(r.save_blocker)??a(r.code)??a(r.reason_code)??e.toLowerCase()),a(r.error_domain)===null&&(r.error_domain=W(e)),a(r.error)===null?r.error=a(r.stderr_tail)??a(r.message)??(i&&i!==e?i:`${String(r.error_domain)}: ${String(r.error_code)}`):typeof r.error!="string"&&(r.error=a(r.error)),r}var x=-1,U=5e3,E=class{config;buffer=[];stepBuffer=new Map;heldDropped=new Map;sessionEscalated=!1;flushTimer=null;currentRunIndex=null;currentRunId=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,i=e===null?null:`run-${e}`){this.currentRunIndex=e,this.currentRunId=i}log(e,i,n,r={}){let s=this.buildEntry(e,i,n,r);if(this.stopped){e!=="debug"&&h([s]);return}if(e==="debug"){if(this.currentRunIndex===null&&this.sessionEscalated){this.buffer.push(s);return}this.hold(this.currentRunIndex??x,s);return}e==="error"&&(this.currentRunIndex!==null&&this.promote(this.currentRunIndex),this.promote(x),this.sessionEscalated=!0),this.buffer.push(s)}logStep(e,i,n,r={}){let s=this.buildEntry("debug",i,n,r);s.run_index=e,s.run_id=`run-${e}`,!this.stopped&&this.hold(e,s)}hold(e,i){let n=this.stepBuffer.get(e);n||(n=[],this.stepBuffer.set(e,n)),n.push(i),n.length>U&&(n.shift(),this.heldDropped.set(e,(this.heldDropped.get(e)??0)+1))}promote(e){let i=this.stepBuffer.get(e),n=this.heldDropped.get(e)??0;n>0&&this.buffer.push(this.buildEntry("warn","DEBUG_LINES_DROPPED",`Dropped ${n} held debug lines`,{bucket:e,dropped:n,cap:U})),i&&i.length>0&&this.buffer.push(...i),this.stepBuffer.delete(e),this.heldDropped.delete(e)}escalate(e){this.promote(e),this.promote(x)}escalateAll(){for(let e of[...this.stepBuffer.keys()].sort((i,n)=>i-n))this.promote(e);this.sessionEscalated=!0}discardSteps(e){this.stepBuffer.delete(e),this.heldDropped.delete(e)}discardAll(){this.stepBuffer.clear(),this.heldDropped.clear()}amendUnsent(e,i){for(let n=this.buffer.length-1;n>=0;n--)if(this.buffer[n].event===e)return this.buffer[n].context={...this.buffer[n].context,...i},!0;return!1}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),i=null;try{i=await this.config.getToken()}catch{this.buffer.unshift(...e);return}let n={"Content-Type":"application/json"};i&&(n.Authorization=`Bearer ${i}`);let r=JSON.stringify(e);for(let s=0;s<3;s++){try{let o=new AbortController,l=setTimeout(()=>o.abort(),1e4),c=await T(this.config.proxyUrl,{method:"POST",headers:n,body:r,signal:o.signal});if(clearTimeout(l),c.ok)return}catch{}if(this._stoppingFast){this.buffer.unshift(...e);return}s<2&&await new Promise(o=>setTimeout(o,1e3*Math.pow(2,s)))}this._droppedBatches++,this._droppedEntries+=e.length}async flushOnce(e){if(this.buffer.length===0)return"empty";let i=this.buffer.splice(0),n=Date.now()+e,r=!1,s,o=null;try{o=await Promise.race([this.config.getToken(),new Promise(u=>{s=setTimeout(()=>{r=!0,u(null)},e),s.unref&&s.unref()})])}catch{o=null}finally{s&&clearTimeout(s)}let l=n-Date.now();if(r||l<=0)return this.buffer.unshift(...i),"timeout";let c={"Content-Type":"application/json"};o&&(c.Authorization=`Bearer ${o}`);try{let u=new AbortController,p=setTimeout(()=>u.abort(),l);p.unref&&p.unref();let d=await T(this.config.proxyUrl,{method:"POST",headers:c,body:JSON.stringify(i),signal:u.signal});return clearTimeout(p),d.ok?"sent":(this.buffer.unshift(...i),"failed")}catch{return this.buffer.unshift(...i),Date.now()>=n?"timeout":"failed"}}async stopAndFlushOnce(e){let i=Date.now()+e;this._stoppingFast=!0,this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null);let n=this._inFlightFlush;if(n){let s;await Promise.race([n.catch(()=>{}),new Promise(o=>{s=setTimeout(o,e),s.unref&&s.unref()})]),s&&clearTimeout(s)}if(this.buffer.length===0)return"empty";let r=i-Date.now();if(r<=0)return"timeout";try{return await this.flushOnce(r)}catch{return"failed"}}drainBuffer(){return this.buffer.splice(0)}get droppedBatches(){return this._droppedBatches}get droppedEntries(){return this._droppedEntries}logDropStats(){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._droppedBatches=0,this._droppedEntries=0)}async flushNow(){this.stopped||(this.logDropStats(),await this.flush())}async shutdown(){this.stopped||(this.logDropStats(),this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null),await this.flush(),this.spoolBuffer())}shutdownSync(){this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null),this.spoolBuffer()}spoolBuffer(){let e=this.buffer.splice(0);e.length>0&&h(e)}get bufferSize(){return this.buffer.length}stepBufferSize(e){return this.stepBuffer.get(e)?.length??0}get runIndex(){return this.currentRunIndex}buildEntry(e,i,n,r){return{hostname:"kane-cli",service:"kane-cli",ddsource:"kane-cli",ddtags:`version:${this.config.device.cli_version}`,level:e,event:i,message:n,session_id:this.config.sessionId,run_index:i.startsWith("tcg_")?null:this.currentRunIndex,run_id:i.startsWith("tcg_")?null:this.currentRunId,identity:this.config.identity,device:this.config.device,context:F(e,i,n,r),timestamp:new Date().toISOString()}}};import{platform as Z,arch as ee}from"os";function v(t){let e=t?.trim();return e||void 0}function Q(t=process.env){let e=v(t.TEST_INSTANCE_ID),i=v(t.JOB_ID),n=v(t.TASK_ID),r=v(t.KANE_CLI_PARENT_EXECUTION_ID);return{...e?{testInstanceId:e}:{},...i?{jobId:i}:{},...n?{taskId:n}:{},...r?{parentExecutionId:r}:{}}}function j(t=process.env){if(t.KANE_CLI_MODE!=="hyperexecute")return{};let e=Q(t);return{remote:!0,...e.jobId?{hx_job_id:e.jobId}:{},...e.taskId?{hx_task_id:e.taskId}:{},...e.testInstanceId?{hx_test_instance_id:e.testInstanceId}:{},...e.parentExecutionId?{parent_execution_id:e.parentExecutionId}:{}}}function te(t=process.env){return!!t.VITEST||t.KANE_CLI_TEST==="1"}function V(t){return{cli_version:m,platform:Z(),arch:ee(),host_agent:k(),invocation_mode:t,...te()?{test:!0}:{},...j()}}import X from"fs";import $ from"fs";import ie from"path";var ne=1e3,S=0,re=new Set([130,3]),y=class t{ids;logger;opts;ended=!1;proposals=0;creditsSeen;runTotals={};createdAt=Date.now();errorState;constructor(e,i={emitted:!1}){this.ids=e.envelope,this.logger=e.logger,this.opts=e,this.errorState=i}get enabled(){return this.logger!==null}event(e,i={}){if(!this.logger)return;(e==="ASR_ERROR"||e==="EXPLORE_ERROR")&&(this.errorState.emitted=!0);let n=b(this.ids,e,i);this.logger.log(L[e],e,e,H(n))}error(e,i={}){this.logger&&(this.logger.escalate(S),this.event("ASR_ERROR",{...i,error_code:e}))}child(e,i){return new t({...this.opts,envelope:{...this.ids,operation_id:i,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:i}=await import("./store-id-YZ5WKJ25.js"),{ids:n,cloned:r}=i(e,g());this.ids.context_lineage_id=n.context_lineage_id,this.ids.context_instance_id=n.context_instance_id,r&&this.event("ASR_CONTEXT_CLONED")}catch{}}spoolError(e,i={}){this.logger&&(this.event("ASR_ERROR",{...i,error_code:e}),h(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 i=typeof e.kind=="string"?e.kind.slice(0,64):"trace",n={...H(b(this.ids,"ASR_CMD_START",{})),trace_kind:i};typeof e.code=="string"&&(n.trace_code=e.code.slice(0,64)),delete n.event,this.logger.logStep(S,`trace_${i}`,i,n)}}wireTrace(e,i,n){if(!this.logger)return;n&&this.agentSession(n);let r=i&&typeof i=="object"?i:{},s=o=>Array.isArray(o)?o.length:void 0;switch(e){case"agent_spawn":this.event("ASR_AGENT_SPAWN",{tier:r.tier,duration_ms:r.duration_ms});break;case"agent_exit":this.event("ASR_AGENT_EXIT",{exit_code:r.exit_code,signal:r.signal});break;case"session_paused":{let o=r.pending;if(!o){this.traceTee()({kind:e});break}this.event("ASR_SESSION_PAUSED",{pending_questions:s(o.questions)??0,pending_proposals:s(o.proposals)??0});break}case"proposal":{let o=r.proposal;this.event("ASR_PROPOSAL",{item_count:s(o?.use_cases),turn_index:++this.proposals});break}case"design":{let o=["acs","acceptance_criteria","scenarios","tests"].reduce((l,c)=>l+(s(r[c])??0),0);this.event("ASR_PROPOSAL",{item_count:o,turn_index:++this.proposals});break}case"validation_details":{let o=Array.isArray(r.errors)?r.errors:[];this.event("ASR_VALIDATE_FAILED",{error_code:o[0]?.code,count:o.length,turn_index:this.proposals});break}case"design_commit_failed":case"validate_failed":{let o=Array.isArray(r.codes)?r.codes:[];this.event("ASR_VALIDATE_FAILED",{error_code:o[0],count:o.length,turn_index:this.proposals});break}case"kane_validate":r.refused?this.event("ASR_VALIDATE_FAILED",{error_code:"validation_refused",count:1,turn_index:this.proposals}):this.traceTee()({kind:e});break;case"high_risk_ci":this.event("ASR_HIGH_RISK_CI",{count:r.count});break;case"resume_kind":this.event("ASR_SESSION_RESUMED",{});break;case"usage":typeof r.total_credits=="number"&&(this.creditsSeen=r.total_credits),this.traceTee()({kind:e});break;case"commit":this.event("ASR_COMMIT",r);break;case"design_phase_committed":this.event("ASR_COMMIT",{phase:r.phase,duration_ms:r.ms});break;default:this.traceTee()({kind:e,code:typeof r.code=="string"?r.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,i={}){if(!this.ended){if(this.ended=!0,this.closeEvents(e,i),this.logger)if(this.opts.longSession)await this.logger.shutdown();else{let n=await this.logger.flushOnce(ne);(n==="failed"||n==="timeout")&&h(this.logger.drainBuffer())}this.logger&&this.writeManifestLine(e.exit_code),_(null)}}endSync(e,i={}){this.ended||(this.ended=!0,this.closeEvents(e,i),this.logger&&(this.logger.shutdownSync(),this.writeManifestLine(e.exit_code)),_(null))}startInterval(){this.logger?.start()}closeEvents(e,i){e.duration_ms===void 0&&(e={...e,duration_ms:Date.now()-this.createdAt}),this.logger&&(e.exit_code===0?this.logger.discardSteps(S):this.logger.escalate(S),e.exit_code>0&&!re.has(e.exit_code)&&!i.testFailed&&!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",{credits_total:this.creditsSeen,...this.runTotals,...e,...i.testFailed&&!this.errorState.emitted?{outcome:"test_failed"}:{}}))}setRunTotals(e){for(let[i,n]of Object.entries(e))typeof n=="number"&&Number.isFinite(n)&&(this.runTotals[i]=n)}writeManifestLine(e){try{let i=O(this.ids.context_instance_id??null);$.mkdirSync(ie.dirname(i),{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};$.appendFileSync(i,JSON.stringify(n)+`
|
|
3
3
|
`,{flag:"a",mode:384})}catch{}}};function H(t){let e={event:t.event,session_id:t.session_id,operation_id:t.operation_id,verb:t.verb,mode:t.mode,component:t.component,seq:t.seq,context_lineage_id:t.context_lineage_id,context_instance_id:t.context_instance_id};t.parent_operation_id&&(e.parent_operation_id=t.parent_operation_id),t.agent_session_id&&(e.agent_session_id=t.agent_session_id),t.lattice_session_id&&(e.lattice_session_id=t.lattice_session_id),t.project_id&&(e.project_id=t.project_id);for(let[i,n]of Object.entries(t.context))e[i]=n;return e}import{isMainThread as R}from"worker_threads";function se(){return process.env.TESTMUAI_BASE_URL?"custom":process.env.TESTMUAI_ENV==="stage"?"stage":"prod"}function J(){return!process.env.VITEST||process.env.KANE_TELEMETRY_TEST_FORCE==="1"}function Ve(){!J()||!R||I(f()).catch(()=>{})}function $e(t){let e=J(),i=t.env??se(),n=t.sessionId??null;if(!n&&t.resumeSid&&t.contextRoot)try{let d=P(t.contextRoot,t.resumeSid);d?.user_session_id&&(n=d.user_session_id)}catch{}if(!n&&t.applyPlanPath)try{let d=JSON.parse(X.readFileSync(t.applyPlanPath,"utf8"));d.telemetry?.user_session_id&&(n=d.telemetry.user_session_id)}catch{}let r=t.sessionId===void 0?n!==null:t.resumeSid!==void 0;n||(n=A());let s=null,o=null,l=!1;if(t.contextRoot&&X.existsSync(t.contextRoot))if(t.write&&e){let d=M(t.contextRoot,g());s=d.ids.context_lineage_id,o=d.ids.context_instance_id,l=d.cloned}else{let d=B(t.contextRoot);s=d?.context_lineage_id??null,o=d?.context_instance_id??null}let c={session_id:n,operation_id:w(),context_lineage_id:s,context_instance_id:o,...t.remote?{lattice_session_id:t.remote.sessionId,project_id:t.remote.projectId}:{},verb:(R&&!t.errorsOnly?C():null)??t.verb,mode:t.mode,component:"kane-cli"},u=null;if(e){let d=D(i),K={org_id:d.org_id??"",user_id:d.user_id??"",machine_id:d.machine_id,email:null,email_domain:"",user_type:d.user_id||d.org_id?d.user_type??"unknown":"anonymous",env:d.env,plan:d.plan??"unknown"},G=t.mode==="interactive"||t.mode==="cli"?"cli":"agent";u=new E({proxyUrl:f(),sessionId:n,identity:K,device:V(G),getToken:async()=>null}),t.longSession&&u.start()}let p=new y({envelope:c,logger:u,longSession:!!t.longSession,proxyUrl:f(),clientVersion:`kane-cli/${m}`,telemetryEnabled:e});return e&&!t.errorsOnly&&(_(c),R&&N(),p.event("ASR_CMD_START",{resumed:r,applied_plan:!!t.applyPlanPath}),l&&p.event("ASR_CONTEXT_CLONED"),R&&I(f()).catch(()=>{})),p}export{E as a,Q as b,V as c,ne as d,se as e,J as f,Ve as g,$e as h};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as j}from"./chunk-
|
|
2
|
+
import{a as j}from"./chunk-SDIHDYWT.js";import{e as d}from"./chunk-SB26HQO7.js";import{a as y}from"./chunk-V24LUINK.js";import{a as h}from"./chunk-JYH7CTF7.js";import{q as a}from"./chunk-WMXBRC4B.js";var $=10,u=200,C=1e4,N=1e6;function k(t,e,r="streaming"){let n=r==="full-fetch"?N:C,o=$,i=0;if(t!==void 0){let s=Number(t);if(!Number.isInteger(s)||s<1||s>u)return{error:`--limit must be an integer in [1, ${u}] (got "${t}")`};o=s}if(e!==void 0){let s=Number(e);if(!Number.isInteger(s)||s<0||s>n)return{error:`--offset must be an integer in [0, ${n}] (got "${e}")`};i=s}return{limit:o,offset:i}}function S(t,e){if(!e)return t;let r=e.toLowerCase();return t.filter(n=>n.name.toLowerCase().includes(r))}function b(t,{limit:e,offset:r}){let n=t.slice(r,r+e),o=t.length>r+e;return{slice:n,hasMore:o}}function v(t,e,r=n=>process.stdout.write(`${n}
|
|
3
3
|
`)){for(let n of t)r(JSON.stringify(n));r(JSON.stringify({_meta:"page",limit:e.limit,offset:e.offset,returned:t.length,has_more:e.has_more}))}function T(t,e,r=n=>process.stdout.write(`${n}
|
|
4
|
-
`)){if(t.length===0){r("(no results)");return}let n=Math.max(2,...t.map(s=>s.id.length)),o=`${"ID".padEnd(n)} NAME`;r(o),r(`${"-".repeat(n)} ----`);for(let s of t)r(`${s.id.padEnd(n)} ${s.name}`);r("");let i=e.offset+t.length;if(e.hasMore){let s=e.totalIsLowerBound?`${e.total}+`:`${e.total}`;r(`${i} of ${s} \u2014 next: --offset ${e.offset+e.limit}`)}else r(`${t.length} shown (${e.total} total)`)}async function B(t,e,r){if(r.username&&r.accessKey)return{ok:!0,creds:{username:r.username,access_key:r.accessKey}};let n=new h,o=n.loadBasicAuth(t,e);if(o)return{ok:!0,creds:{username:o.username,access_key:o.access_key}};let i=n.loadCredentials(t,e);if(!i)return{ok:!1,reason:"no_credentials"};let s=i.access_token;try{let{refreshOAuthToken:m}=await import("./token-refresh-
|
|
4
|
+
`)){if(t.length===0){r("(no results)");return}let n=Math.max(2,...t.map(s=>s.id.length)),o=`${"ID".padEnd(n)} NAME`;r(o),r(`${"-".repeat(n)} ----`);for(let s of t)r(`${s.id.padEnd(n)} ${s.name}`);r("");let i=e.offset+t.length;if(e.hasMore){let s=e.totalIsLowerBound?`${e.total}+`:`${e.total}`;r(`${i} of ${s} \u2014 next: --offset ${e.offset+e.limit}`)}else r(`${t.length} shown (${e.total} total)`)}async function B(t,e,r){if(r.username&&r.accessKey)return{ok:!0,creds:{username:r.username,access_key:r.accessKey}};let n=new h,o=n.loadBasicAuth(t,e);if(o)return{ok:!0,creds:{username:o.username,access_key:o.access_key}};let i=n.loadCredentials(t,e);if(!i)return{ok:!1,reason:"no_credentials"};let s=i.access_token;try{let{refreshOAuthToken:m}=await import("./token-refresh-3SEDPIXO.js"),w=await m({creds:n,profile:t,env:e,credentials:i});w&&(s=w.accessToken)}catch(m){return{ok:!1,reason:"refresh_failed",detail:m instanceof Error?m.message:String(m)}}let c=y(e),f=await new j(c.controllerBaseUrl,async()=>s,null).resolve();return f?{ok:!0,creds:{username:f.username,access_key:f.access_key}}:{ok:!1,reason:"exchange_failed"}}function E(t,e,r){switch(r.reason){case"no_credentials":return{message:`error: no credentials for profile "${t}" [${e}]. Run \`kane-cli login\` or pass --username/--access-key.
|
|
5
5
|
`,exitCode:2};case"refresh_failed":return{message:`error: OAuth token refresh failed for profile "${t}" [${e}]${r.detail?`: ${r.detail}`:""}. Run \`kane-cli login\` to re-auth.
|
|
6
6
|
`,exitCode:2};case"exchange_failed":return{message:`error: TMS credential exchange failed for profile "${t}" [${e}]. Token may be revoked \u2014 try \`kane-cli login\`; if the problem persists, TMS may be down.
|
|
7
7
|
`,exitCode:2}}}function M(t){return{id:t.project_id,name:t.name}}function O(t){return{id:t.id,name:t.name}}async function P(t,e,r,n){let o=r+n+1,i=[],s=!0;for await(let c of t.listProjectsStream({name:e})){if(i.push(...c.projects),c.done){s=!0;break}if(i.length>=o){s=!1;break}}return{items:i,doneStreaming:s}}function g(t){return!!t.agent||!process.stdin.isTTY||!process.stdout.isTTY}function x(t,e=r=>process.stdout.write(`${r}
|
|
@@ -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-5K7PCSTP.js";import{a as te}from"./chunk-Q4QCSO6Y.js";import{a as G}from"./chunk-5Y2G4NC7.js";import{a as Be}from"./chunk-CQBLJTDU.js";import{a as Te}from"./chunk-V3IWCGZT.js";import{b as ye}from"./chunk-WN5VKKJ3.js";import{a as E}from"./chunk-HCBYKLMW.js";import{A as i}from"./chunk-BRWCWZE3.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{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,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{g as f}from"./chunk-47WQBG5I.js";import{a as l}from"./chunk-KM3YCIDV.js";import{i as u}from"./chunk-YIBLZIXF.js";import{a as c}from"./chunk-
|
|
2
|
+
import{g as f}from"./chunk-47WQBG5I.js";import{a as l}from"./chunk-KM3YCIDV.js";import{i as u}from"./chunk-YIBLZIXF.js";import{a as c}from"./chunk-JZ7GFPKZ.js";import{f as s}from"./chunk-CB344EDO.js";import{c as p}from"./chunk-GBQ4K25P.js";import{b as i}from"./chunk-XRJH4UF3.js";async function E(n,o,e,t){let m=async()=>{let r=t.auth??{...await s(i),...t.telemetry?.spawnEnv()??{}};return u(e.sid!==void 0&&n.resume===void 0?{...n,sessionId:e.sid}:n,{store:o.store,pendingReconcilePlan:a=>o.dir===null?null:f(o.dir,a),agent:t.agent,tracePath:c,credentials:i,onIngestRefusal:l,preflightTurn:t.preflightTurn??(()=>p(r)),ask:async()=>[],review:async a=>new Map(a.map(d=>[d.temp_ref,{resolution:"skipped"}])),confirmStale:async()=>!1,out:e.out,...e.note?{note:e.note}:{},emit:e.emit,progress:e.progress,isTTY:!1,auth:r,...t.telemetry?{telemetry:t.telemetry}:{},...t.probe?{probe:t.probe}:{},...t.matchUnreviewed?{matchUnreviewed:!0}:{},...e.onSummary?{onSummary:e.onSummary}:{}})};if(!e.channel)return m();let{runWithChannel:g}=await import("./run-channel-IIIYXOIW.js");return g({event:r=>e.emit(r)},m)}export{E as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as g}from"./chunk-TZXXJWHA.js";import{a as C}from"./chunk-
|
|
2
|
+
import{b as g}from"./chunk-TZXXJWHA.js";import{a as C}from"./chunk-NIBNVPAE.js";import{a as v}from"./chunk-HCBYKLMW.js";import{A as s}from"./chunk-BRWCWZE3.js";import{a,b as l,i as f}from"./chunk-33DWJV67.js";import{a as B}from"./chunk-6YGTRKDT.js";import{d as b,j as x,k as T,n as S}from"./chunk-A7RJQJNT.js";import{e as h}from"./chunk-UR6MHSHU.js";var y=h(B(),1);var o=h(v(),1);function k(i,d=g()){let n=S(d);return(i==="all"?n:i==="devices"?n.filter(e=>b(e)):["emulator","simulator"].filter(e=>n.includes(e))).map(e=>({value:e,label:x(e),hint:T(e)}))}function H({mode:i="all",hostSupportsMobile:d=g(),onSelect:n,onCancel:c}){let e=k(i,d),[m,u]=(0,y.useState)(0);return f((p,t)=>{if(t.escape&&c){c();return}t.upArrow&&u(r=>Math.max(0,r-1)),t.downArrow&&u(r=>Math.min(e.length-1,r+1)),t.return&&n(e[m].value)}),(0,o.jsxs)(a,{flexDirection:"column",borderStyle:"round",borderColor:s.orange,paddingX:2,paddingY:1,children:[(0,o.jsx)(l,{color:s.orange,bold:!0,children:i==="all"?"Where should tests run?":"Which kind of device?"}),(0,o.jsx)(a,{marginTop:1,flexDirection:"column",children:e.map((p,t)=>{let r=t===m;return(0,o.jsxs)(a,{children:[(0,o.jsxs)(l,{color:r?s.orange:void 0,children:[r?"\u276F ":" ",p.label]}),(0,o.jsxs)(l,{color:s.dim,children:[" ",p.hint]})]},p.value)})}),(0,o.jsx)(a,{marginTop:1,children:(0,o.jsx)(l,{color:s.dim,children:"You can change this any time with /desktop or /mobile."})}),(0,o.jsx)(C,{bindings:[{keys:"\u2191\u2193",label:"navigate"},{keys:"\u21B5",label:"select"}],suppressEscBack:!c,escBackLabel:"skip"})]})}export{H as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as u,b as x}from"./chunk-
|
|
2
|
+
import{a as u,b as x}from"./chunk-V3IWCGZT.js";import{a as f}from"./chunk-HCBYKLMW.js";import{A as i}from"./chunk-BRWCWZE3.js";import{a as r,b as m}from"./chunk-33DWJV67.js";import{e as n}from"./chunk-UR6MHSHU.js";var e=n(f(),1);function C({title:B,titleColor:c,borderColor:d,variant:p,rows:s,footer:t,labelWidth:l=14,marginBottom:b=1}){return(0,e.jsxs)(u,{title:B,titleColor:c,borderColor:d,variant:p,marginBottom:b,children:[s.map((o,a)=>typeof o.value=="string"?(0,e.jsx)(x,{label:o.label,value:o.value,valueColor:o.valueColor,labelWidth:l},`${o.label}-${a}`):(0,e.jsxs)(r,{children:[(0,e.jsx)(r,{width:l,children:(0,e.jsx)(m,{color:i.dim,children:o.label})}),o.value]},`${o.label}-${a}`)),t&&(0,e.jsx)(r,{marginTop:1,children:t})]})}export{C as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as E}from"./chunk-
|
|
2
|
+
import{b as E}from"./chunk-77BZTEHJ.js";import{a as A,b as I,c as L,d as p,e as N,f as O,g as R,m as T}from"./chunk-3CFAE36M.js";import{Fa as f,ka as c}from"./chunk-RHQLDNZL.js";var h="https://integrations.lambdatest.com",m=" kane-cli context ingest <file>";function $(e){try{let n=new URL(e);return`${n.hostname}${n.pathname==="/"?"":n.pathname}`}catch{return e}}function D(e){switch(e.provider){case"web":return`the page ${e.display}`;case"jira":return`Jira issue ${e.display}`;case"confluence":return e.title?`Confluence page "${e.title}"`:`Confluence page ${e.display.split("/").at(-1)}`;case"linear":return`Linear issue ${e.display}`;case"linear-doc":return e.display.startsWith("document ")?`Linear ${e.display}`:`Linear document "${e.display}"`;default:return e.display}}function U(e,n){let t=C(e,n),i={jira:"Jira issue",confluence:"Confluence page",linear:"Linear issue","linear-doc":"Linear document"}[e];return i&&t!==n?`${i} ${t}`:t}function C(e,n){return e==="jira"?A(n)?.issueKey??n:e==="confluence"?L(n)?.pageId??n:e==="linear"?p(n)?.key??n:e==="linear-doc"?N(n)?.slugId??n:$(n)}var k=(e,n)=>e==="web"?`the page ${$(n)}`:U(e,n);function z(e){if(!e?.url)return null;let n=e.kind==="url"?"web":e.kind==="linear"?p(e.url)?"linear":"linear-doc":e.kind;return["web","jira","confluence","linear","linear-doc"].includes(n)?k(n,e.url):null}var x=e=>e.provider==="confluence"?e.title??e.display.split("/").at(-1):e.display;function P(e,n){let t={reading:e.provider==="web"?e.display:D(e),address:e.address,...n?{as:n}:{}};return e.provider==="confluence"&&!e.title?{...t,shown:`Confluence page ${e.display.split("/").at(-1)}`,bare:!0}:e.provider==="linear-doc"&&e.display.startsWith("document ")?{...t,shown:`Linear ${e.display}`,bare:!0}:{...t,shown:x(e)}}function q(e,n,t){return T(e)?.sourceIdFor(n)===t?void 0:t}function Q(e,n){try{let t=I(e,n)?.title;return typeof t=="string"&&t.length>0?t:void 0}catch{return}}function X(e,n,t,i){let s=C(e,n),d=e==="linear-doc"?t??`document ${s}`:s;return P({provider:e,display:d,...t?{title:t}:{},address:n},i)}var Z=e=>`with ${e.delivered+e.omitted} attachments: ${e.delivered} of its images added, ${e.omitted} left out`,ee=(e,n,t=!1)=>`the same ${t?"file":"text"} as "${e}", already in "${n}"`;function y(e,n){return e==="jira"?A(n)?.issueKey??n:e==="confluence"?`the Confluence page ${L(n)?.pageId??n}`:e==="linear"?p(n)?.key??n:e==="linear-doc"?`the Linear document ${N(n)?.slugId??n}`:`the page ${$(n)}`}var w=e=>e==="jira"?"Jira":e==="confluence"?"Confluence":e.startsWith("linear")?"Linear":"the web",S=e=>e.startsWith("linear")?"Linear":"Atlassian",b=e=>O(e)?.workspace??R(e)?.workspace??"<workspace>",G={invalid_url:"INVALID_URL",target_disallowed:"ADDRESS_NOT_ALLOWED",page_not_found:"PAGE_NOT_FOUND",page_access_blocked:"PAGE_BLOCKED",page_paywalled:"PAGE_PAYWALLED",unsupported_content_type:"NOT_A_PAGE",page_too_large:"PAGE_TOO_LARGE",page_timeout:"PAGE_TIMEOUT",scrape_unavailable:"PAGES_UNAVAILABLE",scrape_rate_limited:"PAGES_UNAVAILABLE",internal_error:"PAGES_UNAVAILABLE",malformed_response:"PAGES_UNAVAILABLE",credit_denied:"OUT_OF_CREDITS",auth_rejected:"CREDENTIALS_REJECTED",route_missing:"PAGES_NOT_AVAILABLE",transport_unreachable:"CONNECTION_FAILED",LIS_AUTH:"CREDENTIALS_REJECTED",JIRA_NOT_CONNECTED:"NO_CONNECTION",JIRA_ISSUE_UNAVAILABLE:"ITEM_UNAVAILABLE",LIS_UNAVAILABLE:"INTEGRATION_UNAVAILABLE",LIS_SETUP:"INTEGRATION_SETUP",LIS_FORBIDDEN:"NO_ACCESS",LIS_RATE_LIMITED:"INTEGRATION_BUSY"};function ne(e,n,t){let i=G[t.code]??t.code,s=y(e,n),d=w(e),a=(u,o,g=!1)=>({code:i,message:u,remedy:o,...g?{support:!0}:{}});switch(i){case"INVALID_URL":return a(`${n} isn't a valid public web address, so nothing was added`,"check the address, then run the command again");case"ADDRESS_NOT_ALLOWED":return a(`${n} can't be fetched: it isn't an allowed public web page, so nothing was added`,`use a public page's address, or save the page as a file and add the file:
|
|
3
3
|
${m}`);case"PAGE_NOT_FOUND":return a(`${s} couldn't be found, so nothing was added`,"check that the address is right and the page still exists, then run the command again");case"PAGE_BLOCKED":return a(`${s} refused automated access, so nothing was added`,`use a version of the page anyone can open, or save it as a file and add the file:
|
|
4
4
|
${m}`);case"PAGE_PAYWALLED":return a(`${s} is behind a paywall or a sign-in, so nothing was added`,`use a copy anyone can open, or save it as a file and add the file:
|
|
5
5
|
${m}`);case"NOT_A_PAGE":return a(`${$(n)} isn't a web page, so nothing was added`,`download the document, then add the file:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as D}from"./chunk-KGNE5CIM.js";import{a as ue,b as te,d as ce,e as R,k as de}from"./chunk-
|
|
2
|
+
import{a as D}from"./chunk-KGNE5CIM.js";import{a as ue,b as te,d as ce,e as R,k as de}from"./chunk-MBNSCXVK.js";import{mkdirSync as Be,writeFileSync as Ae}from"fs";import{join as X}from"path";var ve="start LT with --env ht-stage|ht-prod --tunnelName <name>; see kane-cli explore run --help";function me(t){if(/either tunnel is not running or disconnected/i.test(t))return`remote browser: no running LT tunnel found for this run (HPS: either tunnel is not running or disconnected)
|
|
3
3
|
next: ${ve}`;let e=/WebSocket error: \S*\/kane-cli\S* (5\d\d)\b/.exec(t)?.[1];if(e){let r=Ee(t);return`remote browser: HPS answered HTTP ${e} to the connect${r?` (HPS: ${r})`:""} (on a tunnel run: the tunnel service failed); run again, and report it to the platform team if it persists`}return null}function Ee(t){let e=t.split(`
|
|
4
4
|
`).slice(1).find(i=>i.trim()&&!/^Call log:/.test(i.trim())&&!/^\s*-\s*</.test(i));if(!e)return null;let r=e.trim();try{let i=JSON.parse(r),s=i?.value?.message??i?.message;typeof s=="string"&&s.trim()&&(r=s.trim())}catch{}return r=r.replace(/\b(?:wss?|https?):\/\/\S+/g,"<url>"),r.length>300?r.slice(0,300)+"\u2026":r}var Se={baseMs:500,maxMs:3e4},W=class{o;backoff;sleep;nextSeq;draining=null;stopDeadline=null;wake=null;_state="open";_refusal=null;_fatal=null;_committedThisRun=0;constructor(e){this.o=e,this.backoff=e.backoff??Se,this.sleep=e.sleep??(r=>new Promise(i=>setTimeout(i,r))),this.nextSeq=Math.max(e.firstSeq,e.queue.lastParked+1)}get state(){return this._state}get refusal(){return this._refusal}get fatal(){return this._fatal}get pendingCount(){return this.o.queue.pendingCount}get committedThisRun(){return this._committedThisRun}get lastCommitted(){return this.o.queue.lastCommitted}enqueue(e){return e.run_id!==this.o.runId?{ok:!1,code:"RUN_MISMATCH",reason:`delta ${e.seq} names run ${e.run_id}, this run is ${this.o.runId}`}:!Number.isInteger(e.seq)||e.seq!==this.nextSeq?{ok:!1,code:"SEQUENCE_LOCAL",reason:`expected seq ${this.nextSeq} for run ${this.o.runId}, received ${String(e.seq)}`}:(this.o.queue.append(e),this.nextSeq=e.seq+1,this.kick(),{ok:!0})}kick(){this._state==="open"&&(this.draining||(this.draining=this.drainLoop().catch(e=>(this.markFatal(this.o.queue.pending()[0]?.seq??-1,"LOCAL_IO",e instanceof Error?e.message:String(e)),"stopped")).then(e=>{this.draining=null,e==="empty"&&this._state==="open"&&this.o.queue.pendingCount>0&&this.kick()})))}async flush(e){if(this.stopDeadline=Date.now()+e,this.kick(),this.wake){let r=this.wake;this.wake=null,r()}for(;this.draining;)await this.draining;return this.o.queue.pendingCount}async drainLoop(){let e=0;for(;this._state==="open";){let r=this.o.queue.pending()[0];if(!r)return"empty";let i=this.o.queue.refused(r.seq);if(i)return this.refuse(r.seq,i.code,`previously refused: ${i.reason}`,!1),"stopped";let s=await this.o.client.commitDelta(this.o.explorationId,this.o.runId,r);switch(s.kind){case"committed":e=0,this.o.queue.markCommitted(r.seq),this._committedThisRun++,this.o.onAck?.(r.seq);break;case"refused":return this.refuse(r.seq,s.code,s.reason,!0),"stopped";case"fatal":return this.markFatal(r.seq,s.code,s.reason),"stopped";case"transient":{e++;let a=Math.min(this.backoff.maxMs,this.backoff.baseMs*2**(e-1));if(this.stopDeadline!==null&&Date.now()+a>this.stopDeadline)return"deadline";this.o.onRetry?.(r.seq,e,s.reason,a),await this.interruptibleSleep(a);break}}}return"stopped"}markFatal(e,r,i){this._state="fatal",this._fatal={seq:e,code:r,reason:i},this.o.onFatal?.(e,r,i)}refuse(e,r,i,s){s&&this.o.queue.markRefused(e,r,i,{controller_wire:this.o.controllerWire,client_wire:ue}),this._state="refused",this._refusal={seq:e,code:r,reason:i},this.o.onRefused?.(e,r,i)}async interruptibleSleep(e){await Promise.race([this.sleep(e),new Promise(r=>{this.wake=r})]),this.wake=null}};import{appendFileSync as Ce,closeSync as $e,existsSync as Pe,fsyncSync as Te,mkdirSync as Ie,openSync as De,readFileSync as Me}from"fs";import{dirname as Oe,join as Le}from"path";var Fe="pending-deltas.ndjson",Q=class{path;deltas=new Map;committed=new Set;refusedBySeq=new Map;tornTail=!1;constructor(e){this.path=Le(e,Fe),this.load()}append(e){let r=this.deltas.get(e.seq);if(r){if(JSON.stringify(r)===JSON.stringify(e))return;throw new Error(`pending queue already holds a different delta for seq ${e.seq}`)}this.write({op:"delta",seq:e.seq,delta:e}),this.deltas.set(e.seq,e)}markCommitted(e){this.committed.has(e)||(this.write({op:"committed",seq:e}),this.committed.add(e))}markRefused(e,r,i,s={}){let a={...s.controller_wire?{controller_wire:s.controller_wire}:{},...s.client_wire?{client_wire:s.client_wire}:{}};this.write({op:"refused",seq:e,code:r,reason:i,...a}),this.refusedBySeq.set(e,{seq:e,code:r,reason:i,...a})}pending(){return[...this.deltas.entries()].filter(([e])=>!this.committed.has(e)).sort(([e],[r])=>e-r).map(([,e])=>e)}get pendingCount(){return this.pending().length}get lastCommitted(){let e=0;for(let r of this.committed)e=Math.max(e,r);return e}get lastParked(){let e=0;for(let r of this.deltas.keys())e=Math.max(e,r);return e}refused(e){return this.refusedBySeq.get(e)}load(){if(!Pe(this.path))return;let e=Me(this.path,"utf8");this.tornTail=e.length>0&&!e.endsWith(`
|
|
5
5
|
`);let r=e.split(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a}from"./chunk-HCBYKLMW.js";import{
|
|
2
|
+
import{a}from"./chunk-HCBYKLMW.js";import{A as o}from"./chunk-BRWCWZE3.js";import{a as m,b as r,i as d}from"./chunk-33DWJV67.js";import{a as u}from"./chunk-6YGTRKDT.js";import{e as s}from"./chunk-UR6MHSHU.js";var l=s(u(),1);var e=s(a(),1);function T({message:t,confirmLabel:c,choice:n}){return(0,e.jsxs)(m,{flexDirection:"column",borderStyle:"round",borderColor:o.dim,paddingX:1,children:[(0,e.jsx)(r,{bold:!0,children:t}),(0,e.jsxs)(m,{marginTop:1,children:[(0,e.jsx)(r,{color:n==="yes"?o.red:o.dim,children:`\u276F ${c}`}),(0,e.jsx)(r,{children:" "}),(0,e.jsx)(r,{color:n==="no"?o.green:o.dim,children:"\u276F No"})]}),(0,e.jsx)(r,{color:o.dim,children:"\u2190 \u2192 choose \xB7 \u21B5 confirm \xB7 esc cancel"})]})}function y({message:t,onConfirm:c,onCancel:n,confirmLabel:p="Yes, end"}){let[f,g]=(0,l.useState)("no");return d((b,i)=>{(i.leftArrow||i.rightArrow)&&g(x=>x==="yes"?"no":"yes"),i.return&&(f==="yes"?c:n)(),i.escape&&n()}),(0,e.jsx)(T,{message:t,confirmLabel:p,choice:f})}export{y as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as o,e as p}from"./chunk-XMPTFXPW.js";import{Ia as a}from"./chunk-5EAJO372.js";import{e as d,h as c}from"./chunk-
|
|
2
|
+
import{b as o,e as p}from"./chunk-XMPTFXPW.js";import{Ia as a}from"./chunk-5EAJO372.js";import{e as d,h as c}from"./chunk-BZEW7CSM.js";import{a as m}from"./chunk-WTMCDYR3.js";import{resolve as l}from"path";async function g(s,w,t={}){let r=c({verb:s,mode:"cli",contextRoot:l(process.cwd(),".context"),env:d(),write:t.write,sessionId:m()}),n=()=>{o(t.mode??"")!=="ndjson"&&process.stderr.write(r.supportFooter()+`
|
|
3
3
|
`)};try{let e=await w(r);return t.write&&e===0&&await r.lateBindContext(l(process.cwd(),".context")),e===1&&n(),await r.end({exit_code:e}),e}catch(e){if(e instanceof a){if(o(t.mode??"")==="ndjson"){let i=p("ndjson",t.streamVerb??s,{stdout:y=>process.stdout.write(y),stderr:()=>{}});i.event({type:"sync_error",code:e.code,detail:e.message,remedy:e.remedy}),i.done(2,"refused")}else process.stderr.write(`error: ${e.message}
|
|
4
4
|
next: ${e.remedy}
|
|
5
5
|
`);return r.error("rebase_open"),await r.end({exit_code:2}),2}throw r.error("cli_crash"),n(),await r.end({exit_code:1}),e}}export{g as a};
|