@testmuai/kane-cli 0.10.0-rc.1 → 0.10.0
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-XUV3EQPZ.js +2 -0
- package/dist/{ChromeProfilePicker-CRKQEFYD.js → ChromeProfilePicker-FWPUDKD6.js} +1 -1
- package/dist/{CliFeedbackPrompt-M7BMWLKK.js → CliFeedbackPrompt-D5L2DO6A.js} +1 -1
- package/dist/{CliUploadProgress-OP7DXMC2.js → CliUploadProgress-HQX57WE6.js} +1 -1
- package/dist/{ConfigView-XI74BCCH.js → ConfigView-DGQXKEON.js} +1 -1
- package/dist/EvidenceViewOffer-EIANIYN7.js +2 -0
- package/dist/FolderPicker-XOA7FTHF.js +2 -0
- package/dist/InfoBox-OBH7SUGC.js +2 -0
- package/dist/{LinksBox-PNSESNCU.js → LinksBox-WZ4RAMSH.js} +1 -1
- package/dist/{ProfilesView-PYDZZHKO.js → ProfilesView-AGRNPGSW.js} +1 -1
- package/dist/ProjectPicker-6KRLKV4U.js +2 -0
- package/dist/SaveSessionPrompt-J2OPDEOO.js +2 -0
- package/dist/SingleShotApp-QI4B2TSL.js +2 -0
- package/dist/{SummaryBox-FALOODAQ.js → SummaryBox-XQJUZBAN.js} +1 -1
- package/dist/TestMdRunView-I4MV54FB.js +2 -0
- package/dist/TestrunEvidenceTable-WEIUSW3E.js +2 -0
- package/dist/{WhoamiView-6WXGRANY.js → WhoamiView-JQCURK2M.js} +1 -1
- package/dist/{app-download-RXVZB6MM.js → app-download-OU6AGH2X.js} +1 -1
- package/dist/{assurance-job-C3TXZGLL.js → assurance-job-ZI3L6I4F.js} +1 -1
- package/dist/{binary-DJCDMGPX.js → binary-S5YL5GJD.js} +1 -1
- package/dist/bind-LIV72SEZ.js +2 -0
- package/dist/bootstrap-3V6TOO6I.js +2 -0
- package/dist/{bridge-T6QMYKED.js → bridge-SDEP7Y33.js} +1 -1
- package/dist/{catalog-RRQF4TCA.js → catalog-I3PC6LT6.js} +1 -1
- package/dist/catalog-client-WKYG3JN6.js +2 -0
- package/dist/{changelog-GBEVIUFJ.js → changelog-IHNWFYWY.js} +1 -1
- package/dist/chat-committer-FM5NG46O.js +2 -0
- package/dist/{chat-controller-XINCDH6Z.js → chat-controller-FWFQVZTB.js} +1 -1
- package/dist/child-H2YSDFCG.js +2 -0
- package/dist/{chunk-QDFY5GGO.js → chunk-252GEI3H.js} +1 -1
- package/dist/{chunk-TNORODUF.js → chunk-2B75UL7Y.js} +1 -1
- package/dist/{chunk-B2HXPGIZ.js → chunk-2EVP636F.js} +17 -17
- package/dist/{chunk-7XBNMOH4.js → chunk-2GE5X2A5.js} +1 -1
- package/dist/{chunk-NWBLYMH7.js → chunk-2L3A5NKZ.js} +1 -1
- package/dist/{chunk-2OOFURWD.js → chunk-2N75WO7Y.js} +1 -1
- package/dist/{chunk-LRXBJTD4.js → chunk-2PZKMT3I.js} +1 -1
- package/dist/{chunk-N3TCNZSX.js → chunk-2SY2NCOP.js} +1 -1
- package/dist/{chunk-Q3C6NDGI.js → chunk-32Y6QVFG.js} +1 -1
- package/dist/{chunk-QS5ZJFGF.js → chunk-3OVFKUXV.js} +1 -1
- package/dist/{chunk-DHQ4SQWA.js → chunk-3T2TYDPT.js} +1 -1
- package/dist/{chunk-RG372DON.js → chunk-3UHPVQLU.js} +1 -1
- package/dist/{chunk-WYSZ6TPW.js → chunk-3ZPEQDXZ.js} +10 -9
- package/dist/{chunk-XJ7HCXKW.js → chunk-436FZ4KG.js} +1 -1
- package/dist/{chunk-6U7ID777.js → chunk-4523YDTG.js} +1 -1
- package/dist/{chunk-T7H4LBFK.js → chunk-45URQUAK.js} +1 -1
- package/dist/{chunk-4D5PC6QE.js → chunk-4BUEOKFV.js} +1 -1
- package/dist/{chunk-MII3JOO3.js → chunk-4JWJH6TB.js} +1 -1
- package/dist/{chunk-WEM3MOAL.js → chunk-4MNSP4EO.js} +1 -1
- package/dist/{chunk-ZFMRQ57Y.js → chunk-4NUSW4A2.js} +1 -1
- package/dist/{chunk-FSYOTRMC.js → chunk-4R4YUOVY.js} +1 -1
- package/dist/{chunk-T4AVLJCW.js → chunk-4SJAOAYY.js} +1 -1
- package/dist/{chunk-SMTBOSEJ.js → chunk-52VCA4K2.js} +1 -1
- package/dist/{chunk-672CQECV.js → chunk-567D5ZTO.js} +7 -7
- package/dist/{chunk-M6MBMRFR.js → chunk-5IO5ZC4S.js} +1 -1
- package/dist/{chunk-LSDJOVWW.js → chunk-5R3ODQHH.js} +1 -1
- package/dist/{chunk-I2KOGINW.js → chunk-5T6II7VN.js} +1 -1
- package/dist/{chunk-DDJNYQBH.js → chunk-65BG6GAE.js} +1 -1
- package/dist/{chunk-S53AQU7R.js → chunk-6DZ7LVOG.js} +1 -1
- package/dist/chunk-6K5BEEAJ.js +2 -0
- package/dist/{chunk-42PALMW2.js → chunk-6TNLITJO.js} +1 -1
- package/dist/{chunk-A6TJOZ24.js → chunk-7C4IEL5V.js} +1 -1
- package/dist/{chunk-PUVMC4PX.js → chunk-7V34ZMMS.js} +1 -1
- package/dist/{chunk-SONMD3W5.js → chunk-7ZJWUWSN.js} +1 -1
- package/dist/{chunk-OVNRRI4E.js → chunk-A3TCFSCK.js} +1 -1
- package/dist/{chunk-BJJUKB5K.js → chunk-A4BB6GLN.js} +1 -1
- package/dist/{chunk-V7S6S5W3.js → chunk-AG5XJWEV.js} +1 -1
- package/dist/{chunk-VYHT2IET.js → chunk-AGXAJ2II.js} +1 -1
- package/dist/{chunk-6UVIY56J.js → chunk-AIGQCMGY.js} +1 -1
- package/dist/{chunk-RX6776AI.js → chunk-AU26ZZTX.js} +1 -1
- package/dist/{chunk-OEWYXCTA.js → chunk-AUBSLPJZ.js} +1 -1
- package/dist/{chunk-6LIC2R22.js → chunk-B2WFW74J.js} +1 -1
- package/dist/{chunk-NXRF7FFS.js → chunk-B7JLM3IX.js} +1 -1
- package/dist/{chunk-QNLVC5ZB.js → chunk-BRVIK3BU.js} +1 -1
- package/dist/{chunk-WI7K6VKQ.js → chunk-BY2B4YJN.js} +1 -1
- package/dist/{chunk-DNGOT65K.js → chunk-CBVHP7JB.js} +1 -1
- package/dist/{chunk-ZFM77AQU.js → chunk-CJE7PKRV.js} +1 -1
- package/dist/{chunk-AA674WLL.js → chunk-CJQUVHHS.js} +1 -1
- package/dist/{chunk-OFSDB7B4.js → chunk-COJINPOK.js} +2 -2
- package/dist/{chunk-IBBD36FQ.js → chunk-D6CS62O7.js} +1 -1
- package/dist/{chunk-252FWF2G.js → chunk-DBTMKBHU.js} +1 -1
- package/dist/{chunk-QCKA665H.js → chunk-DHYGCHKB.js} +1 -1
- package/dist/{chunk-TW63WWEN.js → chunk-DTYT6KBO.js} +1 -1
- package/dist/{chunk-QHRUBG7J.js → chunk-EC5IP5HZ.js} +1 -1
- package/dist/{chunk-35ECWCCK.js → chunk-EH43VWVR.js} +1 -1
- package/dist/{chunk-HQ2E2XCU.js → chunk-ENG2UTMX.js} +1 -1
- package/dist/{chunk-BZVNI44O.js → chunk-EPJ5SJL2.js} +2 -2
- package/dist/{chunk-F3U6T4YD.js → chunk-EQWMOGLO.js} +9 -9
- package/dist/{chunk-OF7WPCTQ.js → chunk-EVZLINBN.js} +1 -1
- package/dist/{chunk-44B6THYK.js → chunk-EX6ORR7P.js} +1 -1
- package/dist/{chunk-UAWWLLTI.js → chunk-FBQ7PQJV.js} +1 -1
- package/dist/{chunk-UALJTPSA.js → chunk-FLOQ5NZL.js} +2 -2
- package/dist/{chunk-LCSJ7GOG.js → chunk-FPPVNF53.js} +1 -1
- package/dist/{chunk-5BUIIFLC.js → chunk-FPVGA6XT.js} +1 -1
- package/dist/{chunk-IXW7FOGX.js → chunk-FVYIV36L.js} +1 -1
- package/dist/chunk-FYCD765R.js +161 -0
- package/dist/{chunk-AVI5H4UM.js → chunk-G2KTWFMU.js} +1 -1
- package/dist/{chunk-CPBBYNL7.js → chunk-G3CYFCSR.js} +1 -1
- package/dist/{chunk-JNSWKGTB.js → chunk-G3J4XY3Z.js} +1 -1
- package/dist/{chunk-IMDMRJQ6.js → chunk-GET4DINR.js} +2 -2
- package/dist/{chunk-54XA5MZH.js → chunk-GGS3ATPB.js} +1 -1
- package/dist/{chunk-MGNRNLBE.js → chunk-GGV336P5.js} +1 -1
- package/dist/{chunk-OQ5G773E.js → chunk-GI2JPIX5.js} +1 -1
- package/dist/{chunk-HAW5WEKT.js → chunk-GRO6DLN3.js} +1 -1
- package/dist/{chunk-LRS5MGBY.js → chunk-GXMD23XB.js} +1 -1
- package/dist/chunk-GYDJO32R.js +2 -0
- package/dist/{chunk-W7FLXW6Q.js → chunk-H4KPNGY4.js} +1 -1
- package/dist/{chunk-Y4T4SLDO.js → chunk-HBVHIEPB.js} +1 -1
- package/dist/{chunk-EF47KRUK.js → chunk-HGVM2OZU.js} +1 -1
- package/dist/{chunk-DD5TULWQ.js → chunk-HMQ5M4JJ.js} +1 -1
- package/dist/{chunk-ZTHYAHDN.js → chunk-I2VU2DTS.js} +1 -1
- package/dist/{chunk-7NCJMWFX.js → chunk-J4LQAT5P.js} +1 -1
- package/dist/{chunk-ZZP5SHUV.js → chunk-JCSVBD4F.js} +1 -1
- package/dist/{chunk-57MDWTON.js → chunk-JFBEHCJN.js} +1 -1
- package/dist/{chunk-JQSLUGD4.js → chunk-JGLADDRH.js} +1 -1
- package/dist/{chunk-JPYW6U4D.js → chunk-JOCEZK2M.js} +1 -1
- package/dist/{chunk-7LKCWO2R.js → chunk-JQ7ZZQXC.js} +3 -3
- package/dist/{chunk-QQ4TKLWP.js → chunk-JRSEAXFE.js} +1 -1
- package/dist/{chunk-2IZRPMZN.js → chunk-JSLKCCD2.js} +1 -1
- package/dist/{chunk-H3HHSTEK.js → chunk-JT6WLJSV.js} +1 -1
- package/dist/{chunk-4LPX2OLV.js → chunk-JTJ7IPNI.js} +1 -1
- package/dist/{chunk-2NFS4KE4.js → chunk-JX5NVKTV.js} +1 -1
- package/dist/{chunk-6NWT2TEJ.js → chunk-K2PLULJD.js} +1 -1
- package/dist/{chunk-SWMTXMKB.js → chunk-K3OSK6PB.js} +1 -1
- package/dist/{chunk-3GXN6VF6.js → chunk-KDR662D2.js} +1 -1
- package/dist/{chunk-NLZZLANH.js → chunk-KRRZCY7U.js} +1 -1
- package/dist/{chunk-NDEI7R4K.js → chunk-LHQUCRCH.js} +1 -1
- package/dist/{chunk-WOSANGV6.js → chunk-LNHBZEDC.js} +1 -1
- package/dist/{chunk-PZA3BSOE.js → chunk-LXM7VHYN.js} +1 -1
- package/dist/{chunk-LNNWCBPQ.js → chunk-MHB6DMKZ.js} +1 -1
- package/dist/{chunk-NFRA64NU.js → chunk-MJKRJGER.js} +1 -1
- package/dist/{chunk-BVO4C5F2.js → chunk-MKPDF26Q.js} +1 -1
- package/dist/{chunk-VLDCHFXF.js → chunk-MPEIMWQI.js} +1 -1
- package/dist/{chunk-YIKF4ERQ.js → chunk-MW2WNYJO.js} +2 -2
- package/dist/{chunk-MYVKUJGS.js → chunk-N3KTLWJL.js} +1 -1
- package/dist/{chunk-XIPKSXRQ.js → chunk-NJCN6LP5.js} +6 -6
- package/dist/{chunk-2S3W2JT3.js → chunk-NOFJXCYP.js} +1 -1
- package/dist/{chunk-3UVSAAES.js → chunk-NTXFPNAP.js} +1 -1
- package/dist/{chunk-RW3Z2HMB.js → chunk-ONZ2CSTZ.js} +1 -1
- package/dist/{chunk-UYDHOHSZ.js → chunk-OR2B6T3B.js} +1 -1
- package/dist/{chunk-UUJIGOEO.js → chunk-ORNVIEUA.js} +1 -1
- package/dist/{chunk-R7KXAISS.js → chunk-P2LDAW3C.js} +1 -1
- package/dist/{chunk-T3HEJASG.js → chunk-PBWYQR5I.js} +1 -1
- package/dist/{chunk-O3HHTKZ5.js → chunk-PCDIEYV6.js} +1 -1
- package/dist/{chunk-EZN7CF45.js → chunk-PL3SG3M2.js} +1 -1
- package/dist/{chunk-SA6IKFFD.js → chunk-PQXYHI5W.js} +1 -1
- package/dist/{chunk-JD52IXON.js → chunk-PTISAIZW.js} +1 -1
- package/dist/{chunk-XZYA7DNH.js → chunk-PVN64537.js} +1 -1
- package/dist/{chunk-GZFLJORM.js → chunk-QECTIQAC.js} +1 -1
- package/dist/chunk-QMOGBKJM.js +2 -0
- package/dist/{chunk-L4UVUFL6.js → chunk-QQI6N3FO.js} +1 -1
- package/dist/{chunk-7RWP4Y3H.js → chunk-QVP4FSKT.js} +1 -1
- package/dist/{chunk-2SWSVJUP.js → chunk-QWZJ5QDO.js} +2 -2
- package/dist/{chunk-RX47NRSM.js → chunk-RARD6TC6.js} +1 -1
- package/dist/chunk-RDH3E25Q.js +27 -0
- package/dist/{chunk-AZLNLHUA.js → chunk-RLOJH5O6.js} +1 -1
- package/dist/{chunk-RPRXRKKR.js → chunk-RQKMSNEU.js} +1 -1
- package/dist/{chunk-R4JUKTDO.js → chunk-SB6P5EQH.js} +1 -1
- package/dist/{chunk-V5JGXOV7.js → chunk-SBR6D6GS.js} +1 -1
- package/dist/{chunk-W3OVSDBN.js → chunk-TLOYTGVT.js} +5 -5
- package/dist/{chunk-OZNBTSW5.js → chunk-TZVPDGJD.js} +1 -1
- package/dist/{chunk-D756UWY2.js → chunk-U7NRZBB5.js} +1 -1
- package/dist/{chunk-72RC7JSA.js → chunk-UEPJ26X2.js} +1 -1
- package/dist/chunk-UJLULWSR.js +21 -0
- package/dist/{chunk-7RPKHKA3.js → chunk-ULGBK4NS.js} +1 -1
- package/dist/{chunk-VQLH63X7.js → chunk-UNWPBMVM.js} +1 -1
- package/dist/chunk-URAYFJGM.js +87 -0
- package/dist/{chunk-FIP5L6LV.js → chunk-USJ3LUAL.js} +1 -1
- package/dist/chunk-UUWSULIM.js +101 -0
- package/dist/chunk-UX2CDUPE.js +9 -0
- package/dist/{chunk-AIXJYMSP.js → chunk-VA3BSIUQ.js} +1 -1
- package/dist/chunk-VQZOKTJ2.js +12 -0
- package/dist/{chunk-VG44B5JD.js → chunk-VVCZRCRD.js} +1 -1
- package/dist/{chunk-XBEYWXPV.js → chunk-VZA7BPCK.js} +1 -1
- package/dist/{chunk-NQTYWHPB.js → chunk-W3NWHWK2.js} +1 -1
- package/dist/{chunk-E6KSRQXL.js → chunk-WERIGVOH.js} +1 -1
- package/dist/{chunk-7EXDYXXD.js → chunk-WKZLK57W.js} +1 -1
- package/dist/{chunk-I5NSJBOZ.js → chunk-WQR2GYP7.js} +1 -1
- package/dist/{chunk-OAKYUBD3.js → chunk-WX4VGH5Q.js} +1 -1
- package/dist/{chunk-OJ33Q6DU.js → chunk-WZLDFEWR.js} +1 -1
- package/dist/{chunk-HFJSP4KD.js → chunk-X3J4CC27.js} +1 -1
- package/dist/chunk-XLQ4F6BI.js +9 -0
- package/dist/{chunk-D4FFXCX6.js → chunk-XMALVGH7.js} +2 -2
- package/dist/{chunk-AJQZ3ST5.js → chunk-Y3YULFCK.js} +1 -1
- package/dist/{chunk-RFIIM33J.js → chunk-YGMQXS2J.js} +1 -1
- package/dist/{chunk-RDP7GWSY.js → chunk-YH4VZVHJ.js} +1 -1
- package/dist/{chunk-ENL4XTQ2.js → chunk-YI4ESDAX.js} +1 -1
- package/dist/{chunk-K45BKGB5.js → chunk-YKL5H4K6.js} +1 -1
- package/dist/{chunk-74W4AOT2.js → chunk-YKOEABP2.js} +1 -1
- package/dist/{chunk-P7MSVLAH.js → chunk-YYVBE6W2.js} +1 -1
- package/dist/{chunk-432ZOE42.js → chunk-Z5BFCTHI.js} +2 -2
- package/dist/{chunk-UEE3RZN4.js → chunk-Z777GGHB.js} +1 -1
- package/dist/{chunk-FFL55I2M.js → chunk-ZGQM6KWN.js} +1 -1
- package/dist/{chunk-T6K2MEWP.js → chunk-ZI3X7DI2.js} +1 -1
- package/dist/{chunk-NWD54VV5.js → chunk-ZKPY3AXW.js} +1 -1
- package/dist/chunk-ZRDX2ARO.js +4 -0
- package/dist/{chunk-MNBGG4H3.js → chunk-ZTAZ2R5Z.js} +1 -1
- package/dist/{chunk-LKQFG4RW.js → chunk-ZY65IZJR.js} +1 -1
- package/dist/{chunk-LWJRSUE2.js → chunk-ZZNQIFFI.js} +1 -1
- package/dist/commands-QOORPTSI.js +2 -0
- package/dist/{committer-JGY66PFM.js → committer-26UZDYSA.js} +1 -1
- package/dist/{config-5ZOALGKE.js → config-B472DZSR.js} +1 -1
- package/dist/{cover-cmd-UA2SVIZZ.js → cover-cmd-3VO6QC5Y.js} +1 -1
- package/dist/{credentials-MRG452Y6.js → credentials-TLT3RQOO.js} +1 -1
- package/dist/{deps-bundle-FWINW4XM.js → deps-bundle-CMTIWBS5.js} +1 -1
- package/dist/{deps-resolve-IET4KIBO.js → deps-resolve-XLFZK74A.js} +1 -1
- package/dist/{design-chat-MM5PJD2N.js → design-chat-I7X3QDDY.js} +1 -1
- package/dist/design-committer-Y7R56RFZ.js +2 -0
- package/dist/design-headless-HUQOXLZB.js +2 -0
- package/dist/{design-remote-SPVRIY2H.js → design-remote-UDC5FP45.js} +2 -2
- package/dist/device-env-MMGISNHN.js +2 -0
- package/dist/dispatch-P2445PUU.js +2 -0
- package/dist/{doctor-VAX2BWQF.js → doctor-UHFCIM4B.js} +1 -1
- package/dist/{docx-convert-6IZO5P5K.js → docx-convert-N4KMLLKO.js} +1 -1
- package/dist/{dossier-NROC2MCY.js → dossier-6KMKEIXV.js} +1 -1
- package/dist/evidence-M3JTOJNL.js +2 -0
- package/dist/{evidence-presentation-YYTIDCBS.js → evidence-presentation-DV3DRB4S.js} +1 -1
- package/dist/evolve-cmd-K3JXACMN.js +2 -0
- package/dist/{evolve-remote-BGHULJTL.js → evolve-remote-CUDVV2O2.js} +1 -1
- package/dist/{exit-manager-EDHCETUN.js → exit-manager-EGWAZHCR.js} +1 -1
- package/dist/{explain-cmd-WOBGS6KX.js → explain-cmd-235TY7QX.js} +1 -1
- package/dist/{explain-cmd-VYAANFFZ.js → explain-cmd-R67B4YR3.js} +1 -1
- package/dist/explore-UDD5FHXW.js +2 -0
- package/dist/{explore-context-tty-JTZVZFOE.js → explore-context-tty-YXEFT32U.js} +1 -1
- package/dist/{explore-entry-5OGNLFAU.js → explore-entry-V6L5FSP4.js} +4 -4
- package/dist/{explore-live-2XZHUYFS.js → explore-live-N5VBLBUI.js} +1 -1
- package/dist/{explore-run-tty-LGTIK2NA.js → explore-run-tty-ZZQ33GNA.js} +2 -2
- package/dist/{extract-bind-NM2BBK4I.js → extract-bind-BTINHHE5.js} +3 -3
- package/dist/{extract-chat-HLQMJJIC.js → extract-chat-ABZ5S7UU.js} +1 -1
- package/dist/{extract-cmd-T2TSAC3N.js → extract-cmd-45OZETCM.js} +2 -2
- package/dist/extract-headless-ALEFAMVS.js +2 -0
- package/dist/{feeder-NY45UFJK.js → feeder-L55TH2NC.js} +1 -1
- package/dist/folder-flags-HTKJCXKB.js +2 -0
- package/dist/{gaps-cmd-PTSKPTF7.js → gaps-cmd-ROGQWK5X.js} +1 -1
- package/dist/{gate-WISOUTHQ.js → gate-QA5J7UZA.js} +1 -1
- package/dist/gate-XFFFX5ZF.js +2 -0
- package/dist/{generate-headless-JYZP6VXZ.js → generate-headless-DAH3HHRQ.js} +2 -2
- package/dist/hold-passthrough-K5PP26CP.js +2 -0
- package/dist/impact-cmd-3VFJAKYK.js +11 -0
- package/dist/index.js +171 -165
- package/dist/ingest-S5R736ZV.js +2 -0
- package/dist/{ingest-cmd-LHCBMO4Z.js → ingest-cmd-YSEH5EPU.js} +3 -3
- package/dist/ingest-remote-C6AP2Q7E.js +2 -0
- package/dist/install-B26Y2NU4.js +2 -0
- package/dist/{interactive-bind-5EJQUGKI.js → interactive-bind-P3GTFIZM.js} +4 -4
- package/dist/{interactive-remote-D77ULJGL.js → interactive-remote-PBRQHTAF.js} +2 -2
- package/dist/lane-7IEAE6AC.js +2 -0
- package/dist/lattice-auth-7EL4ET3P.js +2 -0
- package/dist/{lifecycle-cmd-7SM6UCMH.js → lifecycle-cmd-PUNFWKV5.js} +1 -1
- package/dist/{list-cmd-Z6FZXMFU.js → list-cmd-RD7YBF4S.js} +1 -1
- package/dist/list-commands-UZELZAB3.js +2 -0
- package/dist/{list-remote-WOPOC6KK.js → list-remote-KGKXPCQA.js} +1 -1
- package/dist/{locks-cmd-JJ2QNTNY.js → locks-cmd-LXZ6I4QG.js} +1 -1
- package/dist/{logical-ids-RXAQJZ3T.js → logical-ids-D5PFYY4C.js} +1 -1
- package/dist/login-flow-CHLGQGHK.js +2 -0
- package/dist/{maintenance-cmd-VRTGZVRE.js → maintenance-cmd-WRWBCP3R.js} +1 -1
- package/dist/{mobile-prompts-KNAHU64X.js → mobile-prompts-Z7NQHRGP.js} +1 -1
- package/dist/{onboarding-LGT6PMDZ.js → onboarding-ZP4XDYEO.js} +1 -1
- package/dist/{open-provider-OZAG6WZS.js → open-provider-U26BBVUE.js} +1 -1
- package/dist/pdf-convert-LMKOKLXT.js +2 -0
- package/dist/{persist-recorded-session-BX7II5P7.js → persist-recorded-session-4IRYG5CJ.js} +1 -1
- package/dist/phase-seed-2H6OXZXT.js +2 -0
- package/dist/pipeline-U7D25NST.js +2 -0
- package/dist/policy-commands-TY6WOR73.js +8 -0
- package/dist/prepare-target-EVL2QSXA.js +2 -0
- package/dist/{pull-cmd-6AL2WYHB.js → pull-cmd-QJQANBAW.js} +1 -1
- package/dist/pull-route-AIOTLA3D.js +2 -0
- package/dist/{readmodel-INMP6MNW.js → readmodel-KXCFPL2M.js} +1 -1
- package/dist/real-device-run-QODMDUXF.js +2 -0
- package/dist/{reconcile-cmd-R6H37SQR.js → reconcile-cmd-IJTQAJZX.js} +4 -4
- package/dist/reconcile-deps-2CTIFXDR.js +2 -0
- package/dist/{reconcile-remote-GWDV5CUT.js → reconcile-remote-23D6SXXT.js} +2 -2
- package/dist/{recording-banner-ACC67Q2U.js → recording-banner-MNRMMEX4.js} +1 -1
- package/dist/registry-MZYBLEW2.js +2 -0
- package/dist/remote-entry-DW2J56N4.js +2 -0
- package/dist/remote-mode-AFNCN6EE.js +4 -0
- package/dist/{remote-words-45USLRVN.js → remote-words-RCNFI2TQ.js} +1 -1
- package/dist/{require-project-folder-A3UDRELU.js → require-project-folder-7UH43GHI.js} +1 -1
- package/dist/{resolve-run-intent-ZGPSUBXV.js → resolve-run-intent-XEWFYMGN.js} +1 -1
- package/dist/{resolver-IPM6R7U4.js → resolver-QMPX6RBR.js} +1 -1
- package/dist/{revert-FHOBLZWF.js → revert-37346WLE.js} +1 -1
- package/dist/{review-cmd-NNT5C5RZ.js → review-cmd-2OECKNL5.js} +1 -1
- package/dist/run-JWOHNWA3.js +2 -0
- package/dist/run-QFJ6ZRVD.js +2 -0
- package/dist/run-remote-66QTUQ2M.js +2 -0
- package/dist/{run-startup-gate-NKRMKYBB.js → run-startup-gate-USQFSW47.js} +1 -1
- package/dist/run-test-md-7DRWCSQE.js +19 -0
- package/dist/session-worker.js +2 -2
- package/dist/{sessions-cmd-GYMETJHG.js → sessions-cmd-LQ2LZQOC.js} +2 -2
- package/dist/{sessions-remote-GI7GOBMH.js → sessions-remote-H7CQST42.js} +1 -1
- package/dist/{skill-installer-3QAVQGDH.js → skill-installer-LKYY6XFJ.js} +1 -1
- package/dist/{store-X6XPFSKF.js → store-KM5MG3XB.js} +1 -1
- package/dist/store-choice-4J2NN6OQ.js +2 -0
- package/dist/store-guard-34GG2TW2.js +2 -0
- package/dist/{store-site-KA2DNBGY.js → store-site-ZSFINU6C.js} +1 -1
- package/dist/stream-warnings-N4KVVWXV.js +2 -0
- package/dist/sync-cmd-3CHSWWWW.js +2 -0
- package/dist/{sync-setup-5NUCH6N3.js → sync-setup-QQXYO6R4.js} +1 -1
- package/dist/tcg-generate-IPD5FQUW.js +2 -0
- package/dist/{test-definition-VRI4YIYL.js → test-definition-53XNBEDE.js} +1 -1
- package/dist/testmd-actions-V7P7BMKE.js +2 -0
- package/dist/{testmd-sync-ACKCIOL3.js → testmd-sync-PQ4GFKHB.js} +1 -1
- package/dist/tms-client-XWCR7O7J.js +2 -0
- package/dist/token-refresh-LR33BKAB.js +2 -0
- package/dist/{use-case-ref-NE4X4MZN.js → use-case-ref-NA3IXGQW.js} +1 -1
- package/dist/{validate-basic-RE2WLIGQ.js → validate-basic-3DX3MMC7.js} +1 -1
- package/dist/verdicts-7GKZEDHV.js +2 -0
- package/dist/{version-check-4FJVZP3K.js → version-check-OV6AOVED.js} +1 -1
- package/dist/{view-cmd-N47BQZPD.js → view-cmd-QDKBBNIU.js} +1 -1
- package/dist/{walk-session-DA7QWXSW.js → walk-session-BAYYPIKN.js} +1 -1
- package/dist/with-telemetry-62LW4VFI.js +2 -0
- package/package.json +12 -12
- package/dist/ChatSurface-VPD5G67Q.js +0 -2
- package/dist/EvidenceViewOffer-HAAK6DS5.js +0 -2
- package/dist/FolderPicker-W5S6RFCP.js +0 -2
- package/dist/InfoBox-OWUEHV2D.js +0 -2
- package/dist/ProjectPicker-BGFCUGT5.js +0 -2
- package/dist/SaveSessionPrompt-SUJE54GS.js +0 -2
- package/dist/SingleShotApp-4TDXZEUA.js +0 -2
- package/dist/TestMdRunView-4GPRWHEU.js +0 -2
- package/dist/TestrunEvidenceTable-OBVQJ6IO.js +0 -2
- package/dist/bind-XVO4CQYV.js +0 -2
- package/dist/bootstrap-TY5RANJ7.js +0 -2
- package/dist/chat-committer-ZCSRJEUB.js +0 -2
- package/dist/child-G2GCW73X.js +0 -2
- package/dist/chunk-2OSFI33O.js +0 -97
- package/dist/chunk-65VANXOF.js +0 -147
- package/dist/chunk-C6HI6Y3S.js +0 -2
- package/dist/chunk-EXFDIVNI.js +0 -9
- package/dist/chunk-I6OQISK4.js +0 -2
- package/dist/chunk-MZOIHUVX.js +0 -27
- package/dist/chunk-NC7D7GOM.js +0 -21
- package/dist/chunk-QTZBVDPR.js +0 -12
- package/dist/chunk-SLKYD44Y.js +0 -2
- package/dist/design-committer-TRYP3LOZ.js +0 -2
- package/dist/design-headless-FZONCKHW.js +0 -2
- package/dist/device-env-LXJ65AVF.js +0 -2
- package/dist/dispatch-DVQ3H7EJ.js +0 -2
- package/dist/evidence-LVVK7ROT.js +0 -2
- package/dist/evolve-cmd-AGRKG7T3.js +0 -2
- package/dist/explore-LOKNOVNP.js +0 -2
- package/dist/extract-headless-OQTQ3FJK.js +0 -2
- package/dist/folder-flags-WXUR6OPJ.js +0 -2
- package/dist/gate-P57VP4E5.js +0 -2
- package/dist/hold-passthrough-IOWPVB4W.js +0 -2
- package/dist/ingest-PDGS5ZTL.js +0 -2
- package/dist/ingest-remote-D5TO5JQP.js +0 -2
- package/dist/install-Z6K2D2VY.js +0 -2
- package/dist/lane-AQYRIW24.js +0 -2
- package/dist/lattice-auth-74XGF77Y.js +0 -2
- package/dist/list-commands-CZYZ7GIG.js +0 -2
- package/dist/login-flow-2FZEOVHM.js +0 -2
- package/dist/pdf-convert-447ACUB3.js +0 -2
- package/dist/phase-seed-LCJ4WSYV.js +0 -2
- package/dist/pipeline-IXVTVRS5.js +0 -2
- package/dist/prepare-target-ULMKVKMC.js +0 -2
- package/dist/pull-route-TTVARJMV.js +0 -2
- package/dist/real-device-run-2LFS5WE2.js +0 -2
- package/dist/reconcile-deps-TWJ3FTSU.js +0 -2
- package/dist/registry-6IJYQXQC.js +0 -2
- package/dist/remote-entry-YL7O2NJQ.js +0 -2
- package/dist/remote-mode-7G6PLJCW.js +0 -4
- package/dist/run-5RQUCNYP.js +0 -2
- package/dist/run-PC5YO4AS.js +0 -2
- package/dist/run-remote-3AYYVPKX.js +0 -2
- package/dist/run-test-md-HE6DUWQR.js +0 -17
- package/dist/store-choice-RT73HAI7.js +0 -2
- package/dist/store-guard-SNWKLHQV.js +0 -2
- package/dist/stream-warnings-GEQKKJU7.js +0 -2
- package/dist/sync-cmd-NBPPDG3B.js +0 -2
- package/dist/tcg-generate-Z23CUISY.js +0 -2
- package/dist/testmd-actions-GH5BW5V5.js +0 -2
- package/dist/tms-client-NXAB6VJD.js +0 -2
- package/dist/token-refresh-4UCYAG6A.js +0 -2
- package/dist/verdicts-XK3GAUX3.js +0 -2
- package/dist/with-telemetry-7V4LY2BG.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as et,c as nt}from"./chunk-W3USRQX6.js";import{
|
|
2
|
+
import{b as et,c as nt}from"./chunk-W3USRQX6.js";import{R as tt}from"./chunk-XLQ4F6BI.js";import{a as Z}from"./chunk-JQ64X2TO.js";import{a as Lt}from"./chunk-JIRNI5TB.js";import{a as k}from"./chunk-UTM7D4PI.js";import{b as Q}from"./chunk-ENG2UTMX.js";import{b as W,e as X}from"./chunk-6K5BEEAJ.js";import{a as Y}from"./chunk-FCD3NYOM.js";import{a as J}from"./chunk-4QTH7VYE.js";import{a as R}from"./chunk-RZ4F3BHX.js";import{e as Nt}from"./chunk-UR6MHSHU.js";import{readFileSync as T,existsSync as G,readdirSync as be,mkdirSync as K,writeFileSync as w}from"fs";import{readFile as Ot,unlink as ye}from"fs/promises";import{join as y}from"path";import{existsSync as ae,mkdirSync as ce,readdirSync as At,writeFileSync as ue}from"fs";import{join as S}from"path";import{randomUUID as v}from"crypto";var it=["children","instructions","branches","module_content","true_branch","false_branch"];function D(e){let t=new Map,n=r=>{if(!r||typeof r!="object")return;let o=r;if(Array.isArray(o.operations))for(let i of o.operations){let s=i.operation_id;if(typeof s!="string"||!s)continue;let a=t.get(s)??[];a.includes(o)||a.push(o),t.set(s,a)}for(let i of it){let s=o[i];Array.isArray(s)?s.forEach(n):s&&typeof s=="object"&&n(s)}};return e.forEach(n),t}function Tt(e,t){if(!t||t.length===0)return;if(t.length===1)return t[0];let n=e.action_params?.script;if(typeof n=="string"&&n.trim()){let r=n.trim(),o=t.find(i=>jt(i)?.trim()===r);if(o)return o}return t[0]}function jt(e){let t=e,n=t.script_content??t.js_snippet;return typeof n=="string"?n:void 0}function U(e,t){let n=new Map;for(let r of e){let o=Tt(r,r.action_id?t.get(r.action_id):void 0);if(!o)continue;let i=n.get(o)??[];i.push(r),n.set(o,i)}return n.size===0?null:[...n].map(([r,o])=>Bt(r,o))}function ot(e,t){let n=D(t.authoredInstructions),r=[];for(let o of e){if(o.flatIndex===void 0||!t.replayOnlyFlatIndices.has(o.flatIndex))continue;let i=U(o.records,n);i&&r.push(...i)}return r}function st(e,t){let n=new Map(t.map(a=>[a.instruction_id,a])),r=[],o=a=>{if(!a||typeof a!="object")return;let c=a.instruction_id,u=typeof c=="string"?n.get(c):void 0;return u&&r.push(c),u},i=a=>{if(!a||typeof a!="object")return;let c=a;for(let u of it){let l=c[u];if(Array.isArray(l))s(l);else if(l&&typeof l=="object"){let _=o(l);_&&(c[u]=_),i(_??l)}}},s=a=>{for(let c=0;c<a.length;c++){let u=o(a[c]);u&&(a[c]=u),i(u??a[c])}};return s(e),r}function Ct(e){if(!e.timestamp||e.duration_ms==null)return"";let t=new Date(e.timestamp);return isNaN(t.getTime())?"":new Date(t.getTime()+e.duration_ms).toISOString()}function j(e){if(e!=null)try{return JSON.parse(e)}catch{return e}}function Dt(e){return typeof e=="string"?"string":typeof e=="boolean"?"bool":typeof e=="number"?Number.isInteger(e)?"int":"float":Array.isArray(e)?"list":e==null?"NoneType":"JSON"}function C(e,t,n){let r=e.user_variables,o=typeof r=="string",i;try{i=o?JSON.parse(r):r??[]}catch{return}if(!Array.isArray(i)||i.length===0)return;let s=i.find(a=>t&&a.name===t)??(i.length===1?i[0]:void 0);s&&(s.value=n,s.value_type=Dt(n),e.user_variables=o?JSON.stringify(i):i)}function rt(e){e.user_variables!==void 0&&(e.user_variables=typeof e.user_variables=="string"?"[]":[])}function Ut(e,t){let n=e.operations??[],r=new Set(t.map(i=>i.action_id).filter(Boolean)),o=n.filter(i=>r.has(i.operation_id));return o.length>0?o:n.length===1?n:[]}function Ft(e){let t=e.error??"Script execution failed";return{error:t,error_code:"SCRIPT_EXECUTION_ERROR",error_message:t,reason:t}}function Bt(e,t){let n=structuredClone(e),r=t[0],o=t[t.length-1];n.status=t.find(s=>s.status!=="success")?.status??r.status,n.start_timestamp=r.timestamp??n.start_timestamp,n.end_timestamp=Ct(o)||n.end_timestamp;let i=Ut(n,t);for(let s of i)s.status=n.status,s.operation_start=n.start_timestamp,s.operation_end=n.end_timestamp;switch(n.content_type){case"api":{let s=o.action_params?.api_data?.response;if(s&&typeof s=="object")for(let a of[n,...i])a.api_data={...a.api_data??{},response:s},C(a,o.output_variable,s);break}case"script":{let s=o.output_variable??n.output_variable_name;if(n.status!=="success"){let a=Ft(o);n.code_error=a,rt(n);for(let c of i)c.execution_result=a,c.code_error=a,rt(c)}else if(o.output_value!=null){let a=j(o.output_value);C(n,s,a);for(let c of i)c.execution_result={value:a},C(c,s,a)}break}case"db_query":{o.output_value!=null&&(n.db_details={...n.db_details??{},carried_out_query:j(o.output_value)});break}case"screenshot_command":{let s=j(o.output_value);s&&typeof s=="object"&&(n.smartui_results=s);break}case"network_assertion":case"network_query":break;default:break}return n}var Mt="/home/kaneai/Downloads";function O(e){return`${Mt}/${e}`}function ut(e){return"FILE__"+e.replace(/[^A-Za-z0-9]/g,"_")}function M(e){return"file."+e}function N(e){let t=e?.media;return!t||!t.name||!t.media_url?null:{media_id:t.media_id??"",name:t.name,media_url:t.media_url,type:t.type??"doc",...t.alias?{alias:t.alias}:{}}}function lt(e){return e?e.includes(`
|
|
3
3
|
`)?e.split(`
|
|
4
4
|
`).map(t=>t.trim()).filter(Boolean):e.split(". ").map(t=>t.trim()).filter(Boolean).map(t=>t.endsWith(".")?t:t+"."):[]}function F(e){return typeof e=="string"&&e.includes("{{secrets.")}var zt={click:"CLICK",double_click:"CLICK",type:"TYPE",fill:"TYPE",clear:"CLEAR",select:"SELECT",hover:"HOVER",drag:"DRAG_DROP",upload_files:"UPLOAD_FILE",navigate:"OPEN",go_back:"NAVIGATE",go_forward:"NAVIGATE",refresh:"REFRESH",press_key:"SENDKEYS",scroll:"SCROLL_PIXELS",scroll_into_view:"SCROLL_UNTIL_ELEMENT",wait:"WAIT",wait_until:"WAIT_UNTIL",wait_for_load:"WAIT_FOR_LOAD",switch_tab:"SWITCH_TAB",new_tab:"NEW_TAB",close_tab:"CLOSE_TAB",api:"API",evaluate_js:"EVALUATE_JS",vision_query:"VISION_QUERY",textual_query:"TEXTUAL_QUERY",get_url:"GET_URL",get_title:"GET_TITLE",assert:"ASSERTION",math:"MATHEMATICAL_OPERATION",set_cookies:"SET_COOKIES",delete_cookies:"DELETE_COOKIES",clear_cookies:"CLEAR_COOKIES",set_local_storage:"SET_LOCAL_STORAGE",delete_local_storage:"DELETE_LOCAL_STORAGE",clear_local_storage:"CLEAR_LOCAL_STORAGE",set_clipboard:"SET_CLIPBOARD",paste_clipboard:"PASTE_CLIPBOARD",clear_clipboard:"CLEAR_CLIPBOARD",device_control:"DEVICE_CONTROL",device_control_query:"DEVICE_CONTROL_QUERY"},dt={literal:"SET_VARIABLE",condition:"SET_VARIABLE",visual:"VISION_QUERY",dom:"TEXTUAL_QUERY",url:"GET_URL",title:"GET_TITLE",devtool_network:"DEVTOOLS_NETWORK_QUERY",devtool_console:"DEVTOOLS_CONSOLE_QUERY",devtool_cookies:"DEVTOOLS_COOKIES_QUERY",devtool_storage:"DEVTOOLS_STORAGE_QUERY",devtool_performance:"DEVTOOLS_PERFORMANCE",api_response:"API_CALLS_QUERY",textual_visual:"TEXTUAL_ANALYZER"},Vt=new Set(["CLICK","TYPE","FILL","HOVER","SCROLL_UNTIL_ELEMENT","UPLOAD_FILE","VISION_QUERY","DRAG_DROP","SELECT"]);function _t(e,t){if(e==="analyze"){let r=t?.action_params?.analyzer_type??"";return dt[r]}if(e==="scroll"&&t?.action_params?.into_view===!0)return"SCROLL_UNTIL_ELEMENT";let n=zt[e];return n||console.warn(`[migrator] UNKNOWN action_type "${e}" \u2014 falling back to "${e.toUpperCase()}"; explicit mapping required`),n??e.toUpperCase()}function pt(e,t){if(!e||!t)return"";try{let n=new Date(e);return isNaN(n.getTime())?"":new Date(n.getTime()+t).toISOString()}catch{return""}}function ft(e){try{return JSON.parse(e.output_value??"{}")}catch{return{}}}function $t(e){let t=e.output_variable??"";if(!t)return"[]";let r={...ft(e)};return delete r.body,JSON.stringify([{name:t,unique_key:(e.action_id??"").replace(/-/g,"").slice(0,8)||v().replace(/-/g,"").slice(0,8),value:r,variable_description:"API Response"}])}function qt(e,t,n){let r=e.action_params??{},o=Vt.has(t)?"Vision Agent":"Operation Agent",i={operation_type:t};t==="OPEN"&&(i.url=r.url??""),t==="SET_VARIABLE"&&(i.variable_name=e.output_variable??r.key??"",i.variable_value=e.output_value??"");let s=t==="UPLOAD_FILE"?N(r):null;s&&(i.value=O(s.name));let a={},c={},u=e.action_instruction??"",l=r.text??"",_=r.url??"",p=[["intent",u],["value",l],["url",_]];for(let[h,A]of Object.entries(n)){let I=String(A);if(h.startsWith("secrets."))for(let[b,E]of p)E.includes(I)&&(c[b]=h);for(let[b,E]of p)E.includes(I)&&!(b in a)&&(a[b]=E)}s?.alias&&(a.value=`{{${M(s.alias)}}}`);let d=e.action_type,f={operation:e.action_instruction??"",agent:o,operation_dict:i,reasoning:d==="analyze"?r.query??"":e.intent??e.action_instruction??"",variable:a,secrets:c,params:{}};d==="analyze"&&typeof r.code=="string"&&r.code&&(f.code=r.code),d==="analyze"&&typeof r.code_js=="string"&&r.code_js&&(f.code_js=r.code_js),d==="analyze"&&typeof r.condition_expression=="string"&&r.condition_expression&&(f.condition_expression=r.condition_expression),r.uses_websocket===!0&&(f.uses_websocket=!0),r.uses_sse===!0&&(f.uses_sse=!0),d==="analyze"&&r.analyzer_type==="textual_visual"&&(typeof r.wrapped_js=="string"&&(f.wrapped_js=r.wrapped_js),Array.isArray(r.locators)&&(f.locators=r.locators),typeof r.operator=="string"&&(f.operator=r.operator),Array.isArray(r.transforms)&&(f.transforms=r.transforms),typeof r.query=="string"&&(f.query=r.query),typeof r.expected_value=="string"&&(f.expected_value=r.expected_value),typeof r.needs_unit_conversion=="boolean"&&(f.needs_unit_conversion=r.needs_unit_conversion),typeof r.condition=="string"&&(f.condition=r.condition));let m={set_cookies:"cookies",set_clipboard:"text",delete_cookies:"names",set_local_storage:"items",delete_local_storage:"keys"}[d];return m&&r[m]!==void 0&&(f[m]=r[m]),d==="set_clipboard"&&typeof r.html=="string"&&r.html&&(f.html=r.html),f}function L(e){let t=e.assertion_tree;return t&&typeof t=="object"&&Object.keys(t).length>0?t:Array.isArray(e.sub_results)?e:{}}function Gt(e){let t=L(e);if(typeof t.passed=="boolean")return t.passed;let n=t.sub_results??[];return n.length===0?t.status==="passed":(t.composite_operator??"and")==="or"?n.some(o=>o.passed===!0):n.every(o=>o.passed===!0)}function gt(e){return e.map(t=>({description:t.description??"",store_key:t.store_key??"",expected_value:t.expected??"",extracted_value:t.extracted_value??"",operator:t.operator??"equals",transforms:t.transforms??[]}))}function Kt(e){let t=L(e),n=t.sub_results??[],r=gt(n);return{operator:[],assertion_operands:[],left_operand:null,right_operand:null,operands:[],sub_results:n,sub_checks:r,composite_operator:t.composite_operator??"and",verification:t.verification??"",claim:t.description??""}}function Ht(e){let t=e.action_params??{},n=L(t),r=n.sub_results??[],o=gt(r);return[{operation:e.action_instruction??"",agent:"Operation Agent",operation_dict:{operation_type:"ASSERTION",assertion_tree:{sub_results:r,sub_checks:o,composite_operator:n.composite_operator??"and",verification:"",claim:n.description??e.action_instruction??"",operator:[],assertion_operands:[],left_operand:null,right_operand:null,operands:[]}},variable:{},secrets:{},params:{}}]}function Jt(e,t,n,r){let o=e.visual_data;if(!o||o.x==null||o.y==null)return null;let i=t?`${t}/test_screenshots`:"";return{x:o.x,y:o.y,confidence:0,bbox:o.bbox??null,bbox_source:o.bbox?"accessibility_tree":"fallback",viewport_width:o.viewport_width??1280,viewport_height:o.viewport_height??800,scale_factor:null,raw_image_url:i?`${i}/untagged_screenshot/${n}.${r?.get(n)??"png"}`:"",raw_image_sas_url:"",annotated_image_url:"",annotated_image_sas_url:""}}function Yt(e){if(!e)return"";let t=e;return typeof e=="object"&&!Array.isArray(e)&&Array.isArray(e.frameInfo)&&(t=e.frameInfo),!Array.isArray(t)||t.length===0?"":JSON.stringify(t)}function Wt(e){return/^(android|ios)_native$/i.test(e.platform??"")}function mt(e,t){return e.map(n=>({...n,type:t?n.strategy??n.type??"native":n.isXPath?"xpath":"css"}))}function Xt(e,t,n){let r={selector_target:"",drag_displacement:{},hold_duration_ms:null,move_duration_ms:null,hold_at_destination_ms:null};if(e!=="drag")return r;let o=t.target_selectors,i={};typeof t.direction=="string"&&t.direction&&(i.direction=t.direction,typeof t.fraction=="number"&&(i.fraction=t.fraction));let s=a=>typeof t[a]=="number"?Math.trunc(t[a]):null;return{selector_target:Array.isArray(o)&&o.length>0?mt(o,n):"",drag_displacement:i,hold_duration_ms:s("hold_duration_ms"),move_duration_ms:s("move_duration_ms"),hold_at_destination_ms:s("hold_at_destination_ms")}}function at(e,t="",n){let r=e.action_type,o=_t(r,e),i=e.action_params??{},s=e.coordinates??null,a=e.selectors??null,c=!!(a&&a.length>0),u=Wt(e),l=Xt(r,i,u),_=e.timestamp??"",p=e.duration_ms??0,d=e.variables_used??{},f=e.action_id??v(),g=v(),m=pt(_,p),h="",A="";if(r==="navigate")A=i.url??"",h=A;else if(r==="type"||r==="fill")h=i.text??"";else if(r==="press_key")h=i.key??"";else if(r==="wait")h=String(i.ms??i.timeout_ms??"");else if(r==="evaluate_js")h=i.script??"";else if(r==="upload_files"){let H=N(i);H&&(h=O(H.name))}else r==="analyze"&&o==="SET_VARIABLE"&&(h=e.output_value??"");let I="";r==="go_back"?I="back":r==="go_forward"&&(I="forward");let b=e.action_instruction??"",E=F(h)||F(A)||F(b),x=qt(e,o,d);return{operation_id:f,instruction_id:g,instruction:b,intent:b,operation_start:_,operation_end:m,status:e.status??"",command:o,name:"",target:"",value:h,message:"",operation_dict:"",frame:Yt(e.frame_info),surface:typeof i.surface=="string"?i.surface:"",frame_path:typeof i.frame_path=="string"?i.frame_path:"",grounded_by:typeof i.grounded_by=="string"?i.grounded_by:"",error_message:e.error??"",code_snippet:"",sub_instruction_obj:JSON.stringify(x),test_id:"",test_version:"",action:"",string_to_float:!1,feedback_msg:"",time_taken:"",create_time_stamp:"",update_time_stamp:"",locator_variable:"",locator_variable_name:"",image_url:t?`${t}/test_screenshots/untagged_screenshot/${f}.${n?.get(f)??"png"}`:"",alternative_xpaths:[],attribute:"",value_description:"",url:A,navigation_direction:I,tagified_image_url:"",query_variable_name:e.output_variable??"",query_variable_value:e.output_value??"",query_variable_type:"",expected_value:"",queried_value:"",operator:"",assertion_status:o==="ASSERTION"?Gt(i):"",query_info_dict:{},query_content_confidence:"none",debugging_logs:[],locator_index:0,query_html:"",user_variables:"[]",optional_flag:!1,max_retries:0,retries_delay:0,explicit_wait:0,implicit_wait:0,tab_index:String(i.tab_index??""),tab_identifier:String(i.tab_identifier??""),scroll_value:i.amount??1,scroll_direction:i.direction??"",mi_scroll_payload:{},sleep_duration:0,app_id:"",manual_interaction_tag:"",string_to_float_list:[],js_snippet:r==="evaluate_js"?i.script??"":"",code_error:"",hide:E,dismiss_dialog:!1,use_v2_mobile_tagging:u,multiple_inputs:!1,dialog_action:"",dialog_type:"",is_coordinates_used_for_interaction:s!==null&&!c,element_coordinates_ratio:[],element_bounds_ratio:[],x_coord:c?null:s?.x??null,y_coord:c?null:s?.y??null,target_x_coord:i.target_x??null,target_y_coord:i.target_y??null,source_description:i.source_description??null,target_description:i.target_description??null,use_coordinates:s!==null&&!c,kaneaiMobileTaggingImageLimit:1,clicks_order_code:"se_js_ac",selector:c?mt(a,u):"",selector_target:l.selector_target,math_result_variable_name:"",math_result_variable_value:"",expression_tree:o==="ASSERTION"?Kt(i):i.expression_tree??{},assertion_tree:o==="ASSERTION"?L(i):i.assertion_tree??{},assertion_tree_simplified:{},network_throttle:{},is_mobile_offline:!1,autoheal:!1,reprobe:e.reprobe??!1,click_modifier:(i.click_count??1)>=2?{kind:"multi_click",frequency:i.click_count}:null,db_query:"",db_details:{},db_query_decoded:"",is_global_variable:!1,is_global_variable_persist:!1,global_variable_id:"",wait_for_element_timeout:0,failure_condition:o==="ASSERTION"?"Fail test immediately":"",screenshot_command:"",smartui_contents:{},smartui_results:{},result_type:"",result_hint:"",drag_offset:{},drag_displacement:l.drag_displacement,hold_duration_ms:l.hold_duration_ms,move_duration_ms:l.move_duration_ms,hold_at_destination_ms:l.hold_at_destination_ms,start_coordinates:i.source_coordinates?{x:i.source_coordinates[0],y:i.source_coordinates[1]}:{},end_coordinates:i.target_coordinates?{x:i.target_coordinates[0],y:i.target_coordinates[1]}:{},element_rect:null,is_canvas:!1,until_condition:"",until_max_retries:0,until_settle_ms:0,api_data:r==="api"?{request:e.action_params?.api_data?.request??{}}:{},output_variables:r==="api"?e.output_variable?{[e.output_variable]:null}:{}:e.output_variable?{[e.output_variable]:e.output_value??""}:{},visual_context:Jt(e,t,f,n),reasoning:r==="analyze"?i.query??"":e.intent??e.action_instruction??""}}function ct(e,t){let n=e.action_type,r=_t(n,e),o=e.timestamp??"",i=e.duration_ms??0,s=pt(o,i),a=r==="ASSERTION"||r==="MATHEMATICAL_OPERATION";return{instruction_id:t.instruction_id,instruction_class:a?"non_driver_action":"driver_action",module_id:"",instruction:e.action_instruction??"",command:r,error:null,parent_instruction_id:"",classification_layer_resp:r==="ASSERTION"?Ht(e):[],classification_error:{},operations:[t],status:e.status??"",start_timestamp:o,end_timestamp:s,type:"agent_generated",tags:[],html_paths:[],optional_flag:!1,max_retries:0,retries_delay:0,explicit_wait:0,implicit_wait:0,content_type:n==="api"?"api":n==="analyze"&&e.action_params?.analyzer_type==="api_response"?"api_calls_query":n==="analyze"&&e.action_params?.analyzer_type?.startsWith("devtool_")?e.action_params.analyzer_type.replace("devtool_","devtools_"):"instruction",js_snippet:n==="evaluate_js"?e.action_params?.script??"":"",user_variables:n==="api"?$t(e):"[]",api_data:n==="api"?{request:e.action_params?.api_data?.request??{},response:ft(e)}:{},params_used:!1,hard_assertion:r==="ASSERTION"?e.action_params?.failure_condition==="hard":!1,expected_outcome:"",module_execution_index:0,module_version:null,network_throttle:{},isEdited:!1,use_query_assertion_v2:!1,db_query:"",db_details:{},network_assertion_content:{},screenshot_command:"",smartui_contents:{},generative_id:"",plan_id:"",generative_objective:"",error_message:"",error_code:"",reason:"",title:"",used_variables:[],reasoning:n==="analyze"?e.action_params?.query??"":e.intent??e.action_instruction??""}}function Zt(e,t=[]){let n=e.action_params??{},r=n.branches??[],o=n.winning_index??-1,i=n.sub_results??[],s={};for(let c of i){let u=c.sub_results;if(u)for(let l of u){let _=l.store_key;_&&(s[_]=l)}}let a=r.map((c,u)=>{let l=u===o,_=(c.sub_checks??[]).map(p=>{let d=s[p.store_key];return{description:p.description,store_key:p.store_key,expected_value:p.expected_value,stored_value:d?.extracted_value??p.stored_value,operator:p.operator??d?.operator??"equals",transforms:p.transforms??d?.transforms??[]}});if(_.length===0&&c.condition&&i.length>0){let d=i.find(f=>f.branch_index===u)?.sub_results??[];d.length>0&&(_=d.map(f=>({description:f.description??c.condition,store_key:f.store_key??"",expected_value:f.expected??"true",stored_value:f.extracted_value??void 0,operator:f.operator??"equals",transforms:f.transforms??[]})))}return{branch_index:u,condition:c.condition??null,branch_type:c.branch_type??"sub_objective",passed:l,sub_objective:null,custom_event:c.custom_event??null,children:l?t:[],sub_checks:c.condition?_:[],composite_operator:c.composite_operator??"and"}});return{content_type:"conditional_block",instruction_id:`if_else_${v().slice(0,8)}`,instruction:e.action_instruction??"",instruction_class:"driver_action",command:"",status:e.status??"success",resolved_branch_index:o,branches:a,generative_id:"",generative_objective:"",variables_used:{},classification_layer_resp:[],classification_error:{},used_variables:[],user_variables:"[]",module_id:"",module_execution_index:0,module_version:"",plan_id:"",optional_flag:!1,max_retries:0,retries_delay:0,explicit_wait:0,implicit_wait:0,error:null,error_message:"",error_code:"",reason:"",start_timestamp:e.timestamp??"",end_timestamp:"",type:"agent_generated",hook:null,hook_type:null,evaluation_context:{},query_variables:{}}}function ht(e,t,n){for(let r of e)r.content_type==="instruction"&&"generative_id"in r&&(r.generative_id=t,r.generative_objective=n)}function B(e,t="",n,r){let o=[],i=0;for(;i<e.length;){let s=e[i],a=s.action_type;if(!r?.keepFailedActions&&s.status==="error"&&a!=="assert"&&a!=="if_else"&&a!=="child_agent_start"&&a!=="child_agent_end"&&!(s.until_condition&&!s.error)){i+=1;continue}if(a==="analyze"&&(!dt[s.action_params?.analyzer_type??""]||s.action_params?.analyzer_type==="textual_visual"&&s.action_params?.code)){i+=1;continue}if(a==="child_agent_start"){let c=s.action_params?.child_id??"",u=s.action_params?.objective??"",l=[];i+=1;let _=1,p="error",d;for(;i<e.length&&_>0;){let E=e[i],x=E.action_type;if(x==="child_agent_start")_+=1;else if(x==="child_agent_end"&&(_-=1,_===0)){p=E.status??"success",d=E,i+=1;break}_>0&&l.push(E),i+=1}let f=B(l,t,n);ht(f,c,u);let g=d?.action_params?.result_code??null,m=d?.action_params?.reason_code??null,h=d?.action_params?.error_message??null,A=d?.action_params?.summary??null,I=d?.action_params?.one_liner??null,b=p==="error";o.push({content_type:"generative_block",instruction_id:`generative_block_${c}`,generative_id:c,objective:u,status:p,children:f,error_message:b?h??null:null,error_code:b?m??null:null,result_code:g??null,bifurcation_context:[],approach_reason:lt(A),one_liner:I??null});continue}else if(a==="child_agent_end"){i+=1;continue}else if(a==="if_else"){i+=1;let c=[];for(;i<e.length&&e[i].action_type==="child_agent_start";){let u=e[i],l=u.action_params?.child_id??"",_=u.action_params?.objective??"",p=[];i+=1;let d=1,f="error";for(;i<e.length&&d>0;){let m=e[i];if(m.action_type==="child_agent_start")d+=1;else if(m.action_type==="child_agent_end"&&(d-=1,d===0)){f=m.status??"success",i+=1;break}d>0&&p.push(m),i+=1}let g=B(p,t,n);c.push(...g)}o.push(Zt(s,c));continue}else if(a==="query_tool"){i+=1;continue}else if(s.until_condition){let c=at(s,t,n),u=ct(s,c),l=typeof s.until_condition_met=="boolean"?s.until_condition_met:s.status==="success";o.push({content_type:"until_block",instruction_id:`until_${v().slice(0,8)}`,condition:s.until_condition,max_retries:s.until_max_retries??10,settle_ms:s.until_settle_ms??500,current_count:0,condition_met:l,children:[u],generative_id:"",generative_objective:"",variables_used:{},status:s.status??"success"})}else{let c=at(s,t,n),u=ct(s,c);o.push(u)}i+=1}return o}function P(e,t="",n,r){let o=[],i=[],s=r?.passthrough,a=s?D(s.authoredInstructions):null;for(let d of e){if(s&&a&&d.flatIndex!==void 0&&s.replayOnlyFlatIndices.has(d.flatIndex)){let b=U(d.records,a);if(b){for(let E of b)o.push(E),i.push(d.flatIndex);continue}console.warn(`[migrator] replay-only passthrough: no authored operation matched step ${d.flatIndex} (action_id \u2260 any operation_id in the authored blob) \u2014 falling back to this run's records`)}let f=B(d.records,t,n,r);if(f.length===0)continue;let g=v().replace(/-/g,"");ht(f,g,d.objective);let m=f.some(b=>"status"in b&&typeof b.status=="string"?b.status==="error"||b.status==="failed":!1),h=d.resultCode?parseInt(d.resultCode,10):null,A=h!==null&&!isNaN(h)&&h>=200,I=m||A?"error":"success";o.push({content_type:"generative_block",instruction_id:`generative_block_${g}`,generative_id:g,objective:d.objective,status:I,children:f,error_message:I==="error"?d.errorMessage??null:null,error_code:I==="error"?d.reasonCode??null:null,result_code:d.resultCode??null,bifurcation_context:[],approach_reason:lt(d.summary),one_liner:d.oneLiner??null}),i.push(d.flatIndex)}let c=o.map((d,f)=>({block:d,flat:i[f]})),u=r?.moduleSpans??[],l=r?.blockSpans??[],_=r?.authoredBlocks??[];u.length>0&&(c=bt(c,u,l,_));let p=It(l,u);return p.length>0&&(c=z(c,p,_)),{instructions:c.map(d=>d.block)}}function bt(e,t,n,r){let o=[],i=a=>a===void 0?void 0:t.find(c=>a>=c.flatFrom&&a<=c.flatTo),s=0;for(;s<e.length;){let a=i(e[s].flat);if(!a){o.push(e[s]),s++;continue}let c=[];for(;s<e.length&&i(e[s].flat)===a;)c.push(e[s++]);let u=bt(c,a.children,n,r),l=It(Et(n,a),a.children);l.length>0&&(u=z(u,l,r)),o.push({block:se(a,u.map(_=>_.block)),flat:c[0].flat})}return o}function yt(e,t){return e.flatFrom>=t.flatFrom&&e.flatTo<=t.flatTo}function Et(e,t){let n=[];for(let r of e)yt(r,t)?n.push(r):n.push(...Et(r.children,t));return n}function It(e,t){let n=[],r=i=>{for(let s of i)n.push(s),r(s.children)};r(t);let o=i=>i.filter(s=>!n.some(a=>yt(s,a))).map(s=>({...s,children:o(s.children)}));return n.length>0?o(e):e}function z(e,t,n){let r=[...t].sort((u,l)=>u.flatFrom-l.flatFrom),o=[],i=(u,l)=>{o.push({block:re(u,l,n),flat:u.flatFrom})},s=(u,l)=>u!==void 0&&u>=l.flatFrom&&u<=l.flatTo,a=0,c=0;for(;c<e.length;){let u=e[c].flat;for(;a<r.length&&u!==void 0&&r[a].flatTo<u;)i(r[a++],[]);let l=a<r.length&&s(u,r[a])?r[a]:void 0;if(!l){o.push(e[c]),c++;continue}let _=[];for(;c<e.length&&s(e[c].flat,l);)_.push(e[c++]);i(l,_),a++}for(;a<r.length;)i(r[a++],[]);return o}function Qt(e){let t=new Map;for(let n of e)t.set(n.flat,n);return e.filter(n=>t.get(n.flat)===n)}var te=["children","instructions","branches","module_content","true_branch","false_branch"];function ee(e,t){if(!t)return;let n=[...e];for(;n.length>0;){let r=n.pop();if(!r||typeof r!="object")continue;let o=r;if(o.instruction_id===t&&(o.content_type==="conditional_block"||o.content_type==="until_block"))return o;for(let i of te){let s=o[i];Array.isArray(s)?n.push(...s):s&&typeof s=="object"&&n.push(s)}}}function ne(e,t,n){if(!e)return[];if(t==="while")return Array.isArray(e.children)?e.children:[];let o=(Array.isArray(e.branches)?e.branches:[])[n];return o&&Array.isArray(o.children)?o.children:[]}function re(e,t,n){let r=ee(n,e.blockId),o=e.branches.map((i,s)=>{let a=t.filter(l=>l.flat!==void 0&&l.flat>=i.flatFrom&&l.flat<=i.flatTo);e.kind==="while"&&(a=Qt(a));let c=z(a,e.children,n).map(l=>l.block);if(c.length>0)return c;let u=ne(r,e.kind,s);return u.length===0&&!i.taken&&console.warn(`[migrator] control-flow: branch ${s} of block ${e.blockId||e.instruction} did not run and no authored block matched \u2014 emitted empty`),u});return e.kind==="if"?ie(e,o,r):oe(e,o[0]??[],r)}function ie(e,t,n){let r=Array.isArray(n?.branches)?n.branches:[],o=V(t.flat()),i=e.branches.map((s,a)=>{let c=r[a];return{branch_index:a,condition:s.branch_type==="else"?null:s.condition,branch_type:s.branch_type,passed:s.taken,sub_objective:null,custom_event:c?.custom_event??null,children:t[a],sub_checks:Array.isArray(c?.sub_checks)?c.sub_checks:[],composite_operator:c?.composite_operator??"and"}});return{content_type:"conditional_block",instruction_id:e.blockId||`if_else_${v().slice(0,8)}`,instruction:e.instruction,instruction_class:"driver_action",command:"",status:o?"error":"success",resolved_branch_index:e.branches.findIndex(s=>s.taken),branches:i,generative_id:"",generative_objective:"",variables_used:{},classification_layer_resp:[],classification_error:{},used_variables:[],user_variables:"[]",module_id:"",module_execution_index:0,module_version:"",plan_id:"",optional_flag:!1,max_retries:0,retries_delay:0,explicit_wait:0,implicit_wait:0,error:null,error_message:o?.message??"",error_code:o?.code??"",reason:"",start_timestamp:"",end_timestamp:"",type:"agent_generated",hook:null,hook_type:null,evaluation_context:{},query_variables:{}}}function oe(e,t,n){let r=e.whileCfg??{max_retries:5,settle_ms:500,on_exhaust:"fail",iterations:0,condition_met:!1},o=V(t),i=(s,a)=>n&&n[s]!==void 0?n[s]:a;return{content_type:"until_block",instruction_id:e.blockId||`until_${v().slice(0,8)}`,condition:e.instruction,max_retries:r.max_retries,settle_ms:r.settle_ms,current_count:r.iterations,condition_met:r.condition_met,children:t,generative_id:"",generative_objective:"",variables_used:{},status:o?"error":"success",on_exhaust:i("on_exhaust",r.on_exhaust),mode:i("mode",""),check:i("check",""),conditions:i("conditions",[]),connectors:i("connectors",[]),sub_checks:i("sub_checks",[]),composite_operator:i("composite_operator","and")}}function V(e){for(let t of e){let n="status"in t&&typeof t.status=="string"?t.status:"";if(n==="error"||n==="failed"){let r="error_message"in t?t.error_message:void 0,o="error_code"in t?t.error_code:void 0;return{message:r??null,code:o??null}}}return null}function se(e,t){let n=e.meta,r=(u,l="")=>typeof n[u]=="string"?n[u]:l,o=(u,l=!1)=>typeof n[u]=="boolean"?n[u]:l,i=u=>Array.isArray(n[u])?n[u]:[],s=typeof n.module_version=="number"||typeof n.module_version=="string"?n.module_version:null,a=r("module_id"),c=V(t);return{content_type:tt,instruction_id:`module_block_${a}`,module_id:a,module_version:s,module_instance_id:v(),module_name:r("module_name"),module_description:r("module_description"),module_platform:r("module_platform"),creation_mode:r("creation_mode","Agent"),tms_status:r("tms_status","active"),is_validated:o("is_validated"),is_dirty:e.dirty,enrichment_id:r("enrichment_id"),tags:i("tags"),project_ids:i("project_ids"),link_to_all:o("link_to_all"),status:c?"error":"success",children:t,error_message:c?.message??null,error_code:c?.code??null,update_available:!1,update_info:{}}}function vt(e,t){let n;try{n=At(e)}catch{return 0}let r=0,o=n.filter(i=>/^\d+$/.test(i)).sort((i,s)=>Number(i)-Number(s));for(let i of o){let s=S(e,i),a=S(s,"logs");if(!ae(a))continue;let c;try{c=At(a)}catch{continue}let u=c.filter(p=>p.endsWith("-actions.ndjson")).sort((p,d)=>(parseInt(p,10)||0)-(parseInt(d,10)||0)),l=[];for(let p of u){let d=t.readActions(S(a,p));d.length&&l.push({objective:t.objective??"",records:d})}if(l.length===0)continue;let{instructions:_}=P(l,t.screenshotBaseUrl??"",t.extMap,{keepFailedActions:!0});if(_.length!==0)try{let p=S(s,"auteur");ce(p,{recursive:!0}),ue(S(p,"execution.json"),JSON.stringify(t.buildBlob(_),null,2)),r++,t.log?.("info","EVIDENCE_ARCHIVED_ATTEMPT_BLOB","Derived nested attempt blob",{attempt:i,instructions:_.length})}catch(p){t.log?.("debug","EVIDENCE_ARCHIVED_ATTEMPT_BLOB_FAILED","Nested attempt blob derivation failed",{attempt:i,error:p instanceof Error?p.message:String(p)})}}return r}import{existsSync as le,readFileSync as de}from"fs";function kt(e){try{return le(e)?JSON.parse(de(e,"utf-8")):void 0}catch{return}}function $(e,t){if(!e||typeof e!="object")return;let n=e,r=n.project_token;if(typeof r!="string"||!r)return;let o={project_token:r},i=n[t];typeof i=="string"&&i&&(o.project_name=i);let s=n.project_id;return typeof s=="string"&&s&&(o.project_id=s),o}function q(e){if(Array.isArray(e)){for(let r of e){let o=q(r);if(o)return o}return}if(!e||typeof e!="object")return;let t=e,n=t.smartui_results;if(n&&typeof n=="object"){let r=$(n.project,"name");if(r)return r}for(let r of Object.values(t)){let o=q(r);if(o)return o}}function Rt(e){for(let t of e.runMetaPaths){let n=kt(t),r=$(n?.smartui,"project_name");if(r)return r}if(e.authoredBlobPath){let t=kt(e.authoredBlobPath),n=$(t?.smartui,"project_name");if(n)return n}return q(e.instructions)??{}}var Pt=Nt(Lt(),1);import{createWriteStream as _e}from"fs";import{readFile as pe}from"fs/promises";import{join as fe,basename as ge}from"path";import{tmpdir as me}from"os";var he=["**/screenshots/**","**/annotated/**","**/tcg/**","**/bifurcation/**"];async function St(e){let t=fe(me(),`${ge(e)}_artifacts.zip`);return new Promise((n,r)=>{let o=_e(t),i=(0,Pt.default)("zip",{zlib:{level:6}});o.on("close",()=>n(t)),i.on("error",r),i.pipe(o),i.glob("**/*",{cwd:e,ignore:he}),i.finalize()})}async function wt(e){return pe(e)}async function Ee(e,t){return Ot(Q(e,t))}function Ie(e){return{key:"artifacts",content_type:"application/zip",filename:`${e}.evidence`}}var Ae=[1e3,2e3,4e3],xt=class{config;controller;testId;constructor(t){this.config=t,this.controller=new Y(t.controllerBaseUrl,t.auth),this.testId=t.testId}log(t,n,r,o){this.config.log?.(t,n,r,o)}async execute(){let{onProgress:t}=this.config;try{if(!this.testId)return this.log("error","PIPELINE_ABORT","No test_id available"),{success:!1,testId:null,error:"No test_id available"};let n=this.config.evidence,r=null;if(this.config.shouldUploadArtifacts!==!1){t("convert","running");let a=this.collectNdjsonPerRun(),c=a.reduce((g,m)=>g+m.records.length,0);this.log("info","PIPELINE_CONVERT","Collected NDJSON records",{total_records:c,run_groups:a.length});let u=this.loadReplayOnlyPassthrough(),{instructions:l}=a.length>0?P(a,this.config.screenshotBaseUrl??"",this.config.screenshotExtMap,{moduleSpans:this.config.moduleSpans,...u?{passthrough:u}:{},...this.config.blockSpans?.length?{blockSpans:this.config.blockSpans,authoredBlocks:this.loadAuthoredBlocks()}:{}}):{instructions:[]};this.log("info","PIPELINE_CONVERT_INSTRUCTIONS","Auteur instructions produced",{count:l.length});let _=this.buildExecutionEnvelope(l),p=Buffer.from(JSON.stringify(_));this.log("info","PIPELINE_CONVERT_BLOB","Blob created",{size_kb:+(p.length/1024).toFixed(1)});let d=y(this.config.sessionDir,"execution.json");w(d,JSON.stringify(_,null,2)),this.log("info","PIPELINE_CONVERT_LOCAL_SAVE","Execution blob saved locally",{path:d});let f=n?.packTestDir??this.config.evidenceRead?.packTestDir;if(f){let g=y(f,"auteur");K(g,{recursive:!0}),w(y(g,"execution.json"),JSON.stringify(_,null,2)),this.log("info","PIPELINE_CONVERT_PACK_COPY","Execution blob copied into pack",{path:y(g,"execution.json")}),this.deriveArchivedAttemptBlobs(f)}if(t("convert","done"),n)r=p;else{t("zip","running"),this.log("info","PIPELINE_ZIP_START","Zipping session",{session_dir:this.config.sessionDir});let g=null,m;try{g=await St(this.config.sessionDir),m=await wt(g),this.log("info","PIPELINE_ZIP_DONE","Zip complete",{size_mb:+(m.length/1024/1024).toFixed(1),path:g}),t("zip","done",`${(m.length/1024/1024).toFixed(1)}MB`)}finally{g&&await ye(g).catch(()=>{})}t("presign","running"),this.log("info","PIPELINE_PRESIGN_START","Requesting presigned URLs",{url:`${this.config.controllerBaseUrl}/upload/presign`,test_id:this.testId,session_id:this.config.sessionId});let h=await this.controller.getPresignedUrls(this.testId,this.config.sessionId,[{key:"artifacts",content_type:"application/zip",filename:`${this.config.sessionId}_artifacts.zip`},{key:"blob",content_type:"application/json",filename:`${this.config.commitId}.json`}]);this.log("info","PIPELINE_PRESIGN_OK","Presigned URLs received",{artifacts_url:h.urls.artifacts?.blob_url,blob_url:h.urls.blob?.blob_url}),t("presign","done"),t("upload","running"),this.log("info","PIPELINE_UPLOAD_START","Uploading artifacts and blob",{artifact_size_mb:+(m.length/1024/1024).toFixed(1),blob_size_kb:+(p.length/1024).toFixed(1)}),await Promise.all([k(h.urls.artifacts.upload_url,m,"application/zip"),k(h.urls.blob.upload_url,p,"application/json")]),this.log("info","PIPELINE_UPLOAD_OK","Upload complete"),t("upload","done")}}else{let a=this.collectNdjsonPerRun(),c=this.loadReplayOnlyPassthrough(),{instructions:u}=a.length>0?P(a,this.config.screenshotBaseUrl??"",this.config.screenshotExtMap,{keepFailedActions:!0,moduleSpans:this.config.moduleSpans,...c?{passthrough:c}:{},...this.config.blockSpans?.length?{blockSpans:this.config.blockSpans,authoredBlocks:this.loadAuthoredBlocks()}:{}}):{instructions:[]},l=this.buildExecutionEnvelope(u),_=y(this.config.sessionDir,"execution.json");w(_,JSON.stringify(l,null,2)),this.log("info","PIPELINE_LOCAL_SAVE","Execution blob saved locally (no upload)",{path:_});let p=this.config.evidence?.packTestDir??this.config.evidenceRead?.packTestDir;if(p){let d=y(p,"auteur");K(d,{recursive:!0});let f=this.readAuthoredExecution(),g=f?this.refreshReplayOnlyInPack(f,a,c):null;w(y(d,"execution.json"),g?.raw??JSON.stringify(l,null,2)),this.log("info","PIPELINE_CONVERT_PACK_COPY","Execution blob copied into pack (gated)",{path:y(d,"execution.json"),source:g?g.refreshed.length>0?"authored+replay_results":"authored":"run_envelope",...g&&g.refreshed.length>0?{refreshed_instruction_ids:g.refreshed}:{}}),this.deriveArchivedAttemptBlobs(p)}t("convert","skipped"),t("zip","skipped"),t("presign","skipped"),t("upload","skipped"),this.log("info","PIPELINE_UPLOAD_SKIPPED","Upload steps skipped (gate disabled)")}if(this.config.shouldReplaceLocalOutput&&this.config.onAtomicReplace){t("atomic_replace","running");try{await this.config.onAtomicReplace(),this.log("info","PIPELINE_ATOMIC_REPLACE_OK","Local output replaced"),t("atomic_replace","done")}catch(a){let c=a instanceof Error?a.message:String(a);throw this.log("error","PIPELINE_ATOMIC_REPLACE_FAILED","Atomic-replace failed",{error:c}),t("atomic_replace","failed",c),a}}else t("atomic_replace","skipped");let o,i;if(this.config.shouldCommit&&!this.config.isFirstRun&&this.config.onCommitLock){t("commit_lock","running");let a=await this.config.onCommitLock();if(a.ok)o=a.testcaseId||void 0,this.log("info","PIPELINE_COMMIT_LOCK_OK","Commit lock acquired",{testcase_id:o??"none",trigger:a.trigger??null,test_instance_id:a.testInstanceId??null}),t("commit_lock","done");else return this.log("error","PIPELINE_COMMIT_LOCK_FAILED","Commit lock failed",{reason:a.reason,message:a.message}),t("commit_lock","failed",`${a.reason??"unknown"}: ${a.message??""}`),{success:!1,testId:this.testId,error:`commit-lock failed: ${a.reason??"unknown"}`}}else t("commit_lock","skipped");if(this.config.isFirstRun&&!this.config.skipTmsFinalize){t("finalize","running"),this.log("info","PIPELINE_FINALIZE_START","Finalizing test (first-run)",{test_id:this.testId,commit_id:this.config.commitId});let a=new X(this.config.tmsBaseUrl,this.config.tmsUsername,this.config.tmsAccessKey),c=this.config.runObjectives&&this.config.runObjectives.length>0?this.config.runObjectives:[this.config.firstObjective],u={commit_id:this.config.commitId,time_taken:Math.round(this.config.totalDuration),steps_count:this.config.totalSteps,commit_message:this.config.firstObjective.slice(0,255),objectives:c,...this.config.assuranceStamp?{assurance:this.config.assuranceStamp}:{}},l;try{l=await this.stop(a,u)}catch(_){if(!this.config.attachedStop)throw _;let p=_ instanceof Error?_.message:String(_);this.log("error","PIPELINE_FINALIZE_NOT_SAVED","Attached test's stop did not finalize after its retries",{test_id:this.testId,error:p}),t("finalize","failed",p);try{await this.config.onFinalizeGaveUp?.()}catch(d){this.log("warn","PIPELINE_FINALIZE_META_FAILED","Meta-rewrite after a stop that did not finalize failed",{error:String(d)})}return{success:!1,testId:this.testId,error:`finalize failed: ${p}`,notSaved:!0}}if(o=l.testcase_id||void 0,this.log("info","PIPELINE_FINALIZE_OK","Test finalized",{testcase_id:o??"none",commit_id:l.commit_id??null}),this.config.onFinalizeSuccess)try{await this.config.onFinalizeSuccess(o,l.commit_id)}catch(_){this.log("warn","PIPELINE_FINALIZE_META_FAILED","Meta-rewrite after endTest failed",{error:String(_)})}t("finalize","done")}else t("finalize","skipped"),this.log("info","PIPELINE_FINALIZE_SKIPPED","Finalize skipped (evolve flow or first-run disabled)");if(o&&this.config.shareApiBaseUrl)try{i=await this.generateShareLink(o),this.log("info","PIPELINE_SHARE_OK","Share link generated",{share_id:i})}catch(a){this.log("warn","PIPELINE_SHARE_FAILED","Share link failed",{error:String(a)})}if(n&&r){let a=null;t("zip","running");try{await n.sealFn({testcaseId:o,shareId:i}),a=n.sealedPackPath?await Ot(n.sealedPackPath):await Ee(n.executionId,n.cwd),this.log("info","PIPELINE_EVIDENCE_SEALED","Evidence pack sealed",{execution_id:n.executionId}),this.log("info","PIPELINE_PACK_READ","Sealed pack read",{size_mb:+(a.length/1024/1024).toFixed(1)})}catch(c){let u=c instanceof Error?c.message:String(c);this.log("warn","PIPELINE_EVIDENCE_UPLOAD_SKIPPED","Evidence seal/read failed \u2014 uploading blob only",{execution_id:n.executionId,error:u})}if(a){t("zip","done",`${(a.length/1024/1024).toFixed(1)}MB`),t("presign","running");let c=await this.controller.getPresignedUrls(this.testId,this.config.sessionId,[Ie(n.executionId),{key:"blob",content_type:"application/json",filename:`${this.config.commitId}.json`}]);this.log("info","PIPELINE_PRESIGN_OK","Presigned URLs received",{artifacts_url:c.urls.artifacts?.blob_url,blob_url:c.urls.blob?.blob_url}),t("presign","done"),t("upload","running"),this.log("info","PIPELINE_UPLOAD_START","Uploading pack and blob",{artifact_size_mb:+(a.length/1024/1024).toFixed(1),blob_size_kb:+(r.length/1024).toFixed(1)}),await Promise.all([k(c.urls.artifacts.upload_url,a,"application/zip"),k(c.urls.blob.upload_url,r,"application/json")]),this.log("info","PIPELINE_UPLOAD_OK","Upload complete"),t("upload","done")}else{t("zip","skipped"),t("presign","running");let c=await this.controller.getPresignedUrls(this.testId,this.config.sessionId,[{key:"blob",content_type:"application/json",filename:`${this.config.commitId}.json`}]);t("presign","done"),t("upload","running"),this.log("info","PIPELINE_UPLOAD_START","Uploading blob only (evidence skipped)",{blob_size_kb:+(r.length/1024).toFixed(1)}),await k(c.urls.blob.upload_url,r,"application/json"),this.log("info","PIPELINE_UPLOAD_OK","Blob upload complete (pack skipped)"),t("upload","done")}}let s;if(this.config.codeExport?.enabled&&o){let a=!1;try{await this.triggerCodeExport(o),this.log("info","PIPELINE_CODE_EXPORT_START","Code export triggered"),a=!0}catch(c){let u=c instanceof Error?c.message:String(c);this.log("error","PIPELINE_CODE_EXPORT_FAILED","Code export trigger failed; skipping poll",{error:u}),t("code_export","failed",`trigger failed: ${u}`)}if(a){t("code_export","running","Waiting for code generation\u2026");try{s=await this.pollAndDownloadCode(o,t),this.log("info","PIPELINE_CODE_EXPORT_OK","Code export complete",{dir:s}),t("code_export","done",s)}catch(c){let u=c instanceof Error?c.message:String(c);this.log("error","PIPELINE_CODE_EXPORT_FAILED","Code export failed",{error:u}),t("code_export","failed",u)}}}else t("code_export","skipped");return this.log("info","PIPELINE_COMPLETE","Pipeline complete"),{success:!0,testId:this.testId,testcaseId:o,shareId:i,codeExportDir:s}}catch(n){return{success:!1,testId:this.testId,error:n instanceof Error?n.message:String(n)}}}async stop(t,n){let r=this.config.attachedStop?this.config.stopRetryDelaysMs??Ae:[];for(let o=0;;o++)try{return await t.endTest(this.testId,n)}catch(i){if(!(i instanceof W&&(i.status===null||i.status>=500)&&o<r.length))throw i;this.log("warn","PIPELINE_FINALIZE_RETRY","Attached test's stop sent again",{attempt:o+1,status:i.status}),await new Promise(a=>setTimeout(a,r[o]))}}async runCodeExport(t,n){let r=n??this.config.onProgress,o=!1;try{await this.triggerCodeExport(t),this.log("info","PIPELINE_CODE_EXPORT_TRIGGER","Code export triggered",{testcase_id:t}),o=!0}catch(i){let s=i instanceof Error?i.message:String(i);this.log("error","PIPELINE_CODE_EXPORT_TRIGGER_FAILED","Code export trigger failed; skipping poll",{error:s}),r("code_export","failed",`trigger failed: ${s}`)}if(o){r("code_export","running","Waiting for code generation\u2026");try{let i=await this.pollAndDownloadCode(t,r);return this.log("info","PIPELINE_CODE_EXPORT_OK","Code export complete",{dir:i}),r("code_export","done",i),i}catch(i){let s=i instanceof Error?i.message:String(i);this.log("error","PIPELINE_CODE_EXPORT_FAILED","Code export failed",{error:s}),r("code_export","failed",s);return}}}deriveArchivedAttemptBlobs(t){try{let n=vt(t,{readActions:r=>this.readNdjsonFromFile(r),buildBlob:r=>this.buildExecutionEnvelope(r),objective:this.config.firstObjective,screenshotBaseUrl:this.config.screenshotBaseUrl??"",extMap:this.config.screenshotExtMap,log:(r,o,i,s)=>this.log(r,o,i,s)});n>0&&this.log("info","PIPELINE_ARCHIVED_ATTEMPTS","Nested retry-attempt blobs derived",{count:n})}catch(n){this.log("debug","PIPELINE_ARCHIVED_ATTEMPTS_FAILED","Nested attempt blob pass failed",{error:n instanceof Error?n.message:String(n)})}}collectNdjsonPerRun(){let t=[],n=this.config.runObjectives??[],r=this.config.runMetadata??[],o=this.config.evidence??this.config.evidenceRead;for(let i=0;i<this.config.runDirs.length;i++){let s=this.config.runDirs[i],a=n[i]||this.config.firstObjective,c=r[i],u=o?this.readNdjsonFromFile(y(o.packTestDir,"logs",`${o.runIndices?.[i]??i}-actions.ndjson`)):this.readNdjsonFromDir(s);if(u.length>0){let l=o?.runIndices?.[i]??i,_=this.config.runFlatIndex?.[l];t.push({objective:a,records:u,..._!==void 0?{flatIndex:_}:{},resultCode:c?.resultCode,reasonCode:c?.reasonCode,errorMessage:c?.errorMessage,summary:c?.summary,oneLiner:c?.oneLiner})}}if(t.length===0){let i=y(this.config.sessionDir,"runs");if(G(i))try{let a=be(i,{withFileTypes:!0}).filter(c=>c.isDirectory()).map(c=>c.name).sort();for(let c of a){let u=y(i,c),l=this.readNdjsonFromDir(u);l.length>0&&t.push({objective:this.config.firstObjective,records:l})}}catch{}}return t}readNdjsonFromDir(t){let n=[y(t,"run-test","actions.ndjson"),y(t,"actions.ndjson")];for(let r of n)if(G(r))return this.readNdjsonFromFile(r);return[]}readNdjsonFromFile(t){let n=[];if(!G(t))return n;this.log("debug","PIPELINE_COLLECT_READ","Reading NDJSON file",{path:t});let r=T(t,"utf-8");for(let o of r.split(`
|
|
5
5
|
`)){let i=o.trim();if(i)try{n.push(JSON.parse(i))}catch{}}return n}async generateShareLink(t){let n=`${this.config.shareApiBaseUrl}/lshs/api/v1.0/share-item/generate-sharable-link`;this.log("info","PIPELINE_SHARE_START","Requesting share link",{url:n,testcase_id:t});let r={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({entityIds:[t],entityType:"Test Case Details",expiresAt:7})},o=!!this.config.authResolver;this.log("debug","PIPELINE_SHARE_AUTH","Share link auth config",{resolver:o,fallback_auth_type:typeof this.config.auth=="string"?"bearer":"basic",tms_user:this.config.tmsUsername});let i=o?await this.config.authResolver.fetch(n,r):await R(n,{...r,headers:{...r.headers,Authorization:this.buildAuthHeader()}});if(!i.ok)throw new Error(`Share link API failed: ${i.status} ${await i.text()}`);let s=await i.json();if(!s.shareId)throw new Error("Share link API returned no shareId");return s.shareId}async triggerCodeExport(t){if(!this.config.codeExport)throw new Error("triggerCodeExport called without resolved codeExport config");let{url:n,body:r}=et({tmsBaseUrl:this.config.tmsBaseUrl,testcaseId:t,codeExport:this.config.codeExport,mobile:this.config.mobile});this.log("info","PIPELINE_CODE_EXPORT_POST","Triggering code export",{url:n});let o={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(r)},i=this.config.authResolver?await this.config.authResolver.fetch(n,o):await R(n,{...o,headers:{...o.headers,Authorization:this.buildAuthHeader()}});if(!i.ok)throw new Error(`Code export failed: ${i.status} ${await i.text()}`)}async pollAndDownloadCode(t,n){let r=nt({tmsBaseUrl:this.config.tmsBaseUrl,testcaseId:t}),o=this.config.exitTimeoutMs??3e5,i=5e3,s=Date.now()+o;this.log("info","PIPELINE_CODE_EXPORT_POLL","Polling for code export",{url:r,timeout_ms:o});let a=(c,u)=>this.config.authResolver?this.config.authResolver.fetch(c,u):R(c,{...u,headers:{...u?.headers,Authorization:this.buildAuthHeader()}});for(;Date.now()<s;){let c=await a(r,{method:"GET",headers:{Accept:"application/json"}});if(!c.ok){let d=await c.text().catch(()=>"");throw this.log("warn","PIPELINE_CODE_EXPORT_POLL_FAILED","Code export poll non-200; skipping",{status:c.status,body:d.slice(0,200)}),new Error(`code export poll skipped: HTTP ${c.status}`)}let l=(await c.json()).data?.find(d=>d.code_name==="kane-cli-trigger");if(!l){this.log("debug","PIPELINE_CODE_EXPORT_WAITING","No kane-cli-trigger entry yet"),n("code_export","running","Waiting for code generation\u2026"),await this.sleep(i);continue}let _=l.status.toLowerCase();if(_==="in progress"||_==="in_progress"||_==="pending"){this.log("debug","PIPELINE_CODE_EXPORT_IN_PROGRESS","Code export in progress",{status:l.status}),n("code_export","running","Generating code\u2026"),await this.sleep(i);continue}if(!l.url||l.url.length===0)throw new Error(`Code export status=${l.status} but no files returned`);let p=this.config.codeExportDir??y(this.config.sessionDir,"code-export");K(p,{recursive:!0}),this.log("info","PIPELINE_CODE_EXPORT_DOWNLOAD","Downloading code files",{file_count:l.url.length,dir:p}),n("code_export","running",`Downloading ${l.url.length} files\u2026`);for(let d of l.url){let f=y(p,d.file_name),g=await R(d.file_url);if(!g.ok){this.log("warn","PIPELINE_CODE_EXPORT_FILE_FAILED","Failed to download file",{file_name:d.file_name,status:g.status});continue}let m=await g.text();w(f,m,"utf-8"),this.log("info","PIPELINE_CODE_EXPORT_FILE_SAVED","File saved",{file_name:d.file_name,size_bytes:m.length})}return p}throw new Error("Code export timed out")}sleep(t){return new Promise(n=>setTimeout(n,t))}buildAuthHeader(){return typeof this.config.auth=="string"?`Bearer ${this.config.auth}`:J(this.config.auth.username,this.config.auth.accessKey)}readAuthoredExecution(){let t=this.config.authoredExecutionPath;if(!t)return null;try{let n=T(t,"utf8");return JSON.parse(n),n}catch{return this.log("warn","PIPELINE_AUTHORED_BLOB_UNREADABLE","Authored execution.json missing/unreadable \u2014 pack gets this run's envelope",{path:t}),null}}refreshReplayOnlyInPack(t,n,r){if(!r)return{raw:t,refreshed:[]};let o=ot(n,r);if(o.length===0)return{raw:t,refreshed:[]};let i=JSON.parse(t);if(!Array.isArray(i.instructions))return{raw:t,refreshed:[]};let s=st(i.instructions,o);return s.length===0?{raw:t,refreshed:s}:{raw:JSON.stringify(i,null,2),refreshed:s}}loadAuthoredBlocks(){let t=this.config.blockAuthoredExecutionPath;if(!t)return[];try{let n=JSON.parse(T(t,"utf8"));return Array.isArray(n.instructions)?n.instructions:[]}catch(n){return this.log("warn","PIPELINE_AUTHORED_BLOB_UNREADABLE","Authored execution.json missing/unreadable \u2014 branches that did not run this time upload empty",{path:t,error:n instanceof Error?n.message:String(n)}),[]}}loadReplayOnlyPassthrough(){let t=this.config.replayOnlyPassthrough;if(!(!t||t.flatIndices.length===0))try{let n=JSON.parse(T(t.authoredExecutionPath,"utf8"));if(!Array.isArray(n.instructions))throw new Error("no instructions array");return{authoredInstructions:n.instructions,replayOnlyFlatIndices:new Set(t.flatIndices)}}catch(n){this.log("warn","PIPELINE_PASSTHROUGH_BLOB_UNREADABLE","Authored execution.json missing/unreadable \u2014 replay-only steps convert from this run's records",{path:t.authoredExecutionPath,flat_indices:t.flatIndices,error:n instanceof Error?n.message:String(n)});return}}smartuiProject(t){let n=this.config.evidence??this.config.evidenceRead,r=this.config.runDirs.map((i,s)=>n?y(n.packTestDir,"logs",`${n.runIndices?.[s]??s}-run_meta.json`):y(i,"run_meta.json"));return{...Rt({runMetaPaths:r,authoredBlobPath:this.config.replayOnlyPassthrough?.authoredExecutionPath??this.config.authoredExecutionPath,instructions:t})}}buildExecutionEnvelope(t){let n=this.config.runStatuses.every(u=>u==="passed")?"success":"error",r=this.config.variableIds??{},o=[];if(this.config.variables)for(let[u,l]of Object.entries(this.config.variables)){if(l.secret||Z(l))continue;let _=u.startsWith("global.")?u.slice(7):u;o.push({id:r[_]??0,name:_,value:l.value,session_value:l.value,is_persist:!1,environment_id:0,environment_name:"No Env"})}let i=[],s=u=>{let l=i.find(_=>_.name===u.name);l?l.value=u.value:i.push(u)},a=[],c=new Set;for(let u of this.collectNdjsonPerRun())for(let l of u.records)if(l.output_variable&&l.output_value!=null&&s({name:l.output_variable,value:String(l.output_value),value_type:"test_level",variable_description:"ANALYZE result"}),l.action_type==="upload_files"){let _=N(l.action_params);if(_){let p=_.media_id||_.media_url;if(!c.has(p)){c.add(p),a.push({media_url:_.media_url,media_id:_.media_id,name:_.name,type:_.type,..._.alias?{alias:_.alias}:{}});let d=O(_.name);_.alias?s({name:M(_.alias),type:"file",value:d,value_type:"string",scope:_.alias.startsWith("local.")?"local":"global",media_id:_.media_id}):s({name:ut(_.name),value:d,value_type:"string",variable_description:`variable for ${d}`})}}}return{test_id:this.testId,version:"v4",auto_heal_version:this.config.apMode==="v2"?"AH2":"",session_id:this.config.sessionId,org_id:String(this.config.orgId),user_id:String(this.config.userId),url:this.config.firstUrl??"",start_timestamp:this.config.startedAt,end_timestamp:this.config.endedAt,status:n,commit_id:this.config.commitId,instructions:t,modules:[],uploaded_files:a,test_params:this.config.testParams??[],test_level_variables:JSON.stringify(i),test_global_variables:o,max_network_wait:0,wait_buffer:0,network_throttle:{},secrets:this.config.secrets??[],totp:[],environment_id:this.config.environmentId??0,environment:"",mobile_browser:!1,native_popups:[],smartui:this.smartuiProject(t),module_index:0}}};export{Ee as a,Ie as b,Ae as c,xt as d};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as w,c as L,g as fe,j as ge}from"./chunk-UUJIGOEO.js";import{b as pe}from"./chunk-SWMTXMKB.js";import{d as X}from"./chunk-DBMW3VUN.js";import{a as Q}from"./chunk-7V4BQSSV.js";import{a as ue,b as le}from"./chunk-MGNRNLBE.js";import{a as de}from"./chunk-4QTH7VYE.js";var De={requestMs:3e4,requests:64,redirects:5,bodyBytes:X.contentBytes},Fe=new Set(["authorization","proxy-authorization","cookie","host"]),He=new Set(["set-cookie","set-cookie2","www-authenticate","proxy-authenticate"]);function he(e){try{let t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"?t.origin:null}catch{return null}}async function Je(e,t,n,r){let i=Number(e.headers.get("content-length"));if(Number.isFinite(i)&&i>t&&(await e.body?.cancel().catch(()=>{}),r(`${n} answered with ${i} bytes; a plugin's source may be at most ${t}`)),e.body===null)return new Uint8Array(0);let s=e.body.getReader(),u=[],c=0;for(;;){let{done:k,value:x}=await s.read();if(k)break;c+=x.byteLength,c>t&&(await s.cancel().catch(()=>{}),r(`${n} answered with more than ${t} bytes; a plugin's source may be at most ${t}`)),u.push(x)}let l=new Uint8Array(c),g=0;for(let k of u)l.set(k,g),g+=k.byteLength;return l}function xe(e){let{plugin:t}=e,n={...De,...e.limits},r=e.fetchImpl??fetch,i=new Set(e.allow.map(h=>he(h)).filter(h=>h!==null)),s=[...i].join(", ")||"no origin",u=0,c=null,l=!1,g=new Set,k=()=>{throw new L({code:"PLUGIN_CONNECTION_REFUSED",message:`the connection for plugin ${t} is closed: its fetch has ended`,plugin:t,hook:"fetch"})},x=(h,o)=>{let d=new L({code:h,message:o,plugin:t,hook:"fetch"});throw c??=d,d},$=h=>x("PLUGIN_CONNECTION_REFUSED",`plugin ${t} ${h}`),R=(h,o)=>{let d=he(h);return d===null&&$(`${o} ${JSON.stringify(h)}, which is not an http or https URL`),i.has(d)||$(`${o} ${h}, which is not an origin it may reach \u2014 it may reach ${s}`),new URL(h)};return{get breach(){return c},close(){l=!0;for(let h of g)h.abort();g.clear()},async request(h){l&&k();let o=h.method??"GET",d=o==="POST"?h.body:void 0;o!=="GET"&&o!=="POST"&&$(`asked for a ${JSON.stringify(o)} request; a plugin's connection makes GET and POST requests only`);let p={};for(let[m,O]of Object.entries(h.headers??{})){let E=m.toLowerCase();Fe.has(E)&&$(`set the ${E} header itself; the host adds its own credentials, and a plugin never sends any`),p[E]=String(O)}let a=R(h.url,"asked the connection for");for(let m=0;;m+=1){u+=1,u>n.requests&&$(`made more than ${n.requests} requests in one fetch`);let O={...p};for(let[C,T]of Object.entries(await e.authorize(a)))O[C.toLowerCase()]=String(T);l&&k();let E=new AbortController;g.add(E);let I=setTimeout(()=>E.abort(),n.requestMs),U;try{U=await r(a,{method:o,headers:O,redirect:"manual",signal:E.signal,...d!==void 0?{body:d}:{}})}catch(C){throw g.delete(E),clearTimeout(I),l&&k(),E.signal.aborted?new Error(`${a.origin} did not answer plugin ${t}'s request within ${n.requestMs/1e3} seconds`):new Error(`plugin ${t}'s request to ${a.origin} failed: ${C instanceof Error?C.message:String(C)}`)}try{let C=U.status>=300&&U.status<400?U.headers.get("location"):null;if(C!==null){await U.body?.cancel().catch(()=>{}),m>=n.redirects&&$(`was redirected more than ${n.redirects} times from ${h.url}`),a=R(new URL(C,a).href,"was redirected to"),(U.status===303||(U.status===301||U.status===302)&&o==="POST")&&(o="GET",d=void 0,delete p["content-type"],delete p["content-length"]);continue}let T=await Je(U,n.bodyBytes,a.href,M=>x("PLUGIN_CONTENT_TOO_LARGE",M)),H={};return U.headers.forEach((M,S)=>{He.has(S.toLowerCase())||(H[S.toLowerCase()]=M)}),{status:U.status,headers:H,body:T}}catch(C){throw l&&!(C instanceof L)&&k(),E.signal.aborted?new Error(`${a.origin} did not finish answering plugin ${t}'s request within ${n.requestMs/1e3} seconds`):C}finally{g.delete(E),clearTimeout(I)}}}}}var ee=()=>ue(le()).controllerBaseUrl,Me={explore:e=>[new URL(e).origin]};async function Xe(e){let t=await e.controller();if(t.basic)return{authorization:de(t.basic.username,t.basic.accessKey)};if(t.token)return{authorization:`Bearer ${t.token}`};throw new Error("no credentials for the controller: run `kane-cli login`, then try again")}var Ge="run `kane-cli login`, then run the command again";function qe(e,t){let n=null;return{get breach(){return t.breach??n},close:()=>t.close(),request:async r=>{if(n!==null)throw n;let i=await t.request(r);return i.status===401&&n===null&&(n=new L({code:"PLUGIN_REFUSED",message:`${new URL(r.url).origin} refused the credential this run holds (${i.status}) when plugin ${e} fetched`,plugin:e,hook:"fetch",remedy:Ge})),i}}}function Ve(e,t={}){let n=t.origins??Me;if(!Object.hasOwn(n,e))return;let r=n[e],i=t.credentials??pe;return qe(e,xe({plugin:e,allow:r((t.controller??ee)()),authorize:()=>Xe(i),...t.fetchImpl?{fetchImpl:t.fetchImpl}:{}}))}var we=e=>Ve(e);import{createHash as ze}from"crypto";var re="exploration-export/1",F="exploration-export/2",We=new Set([re,F]),ye="/exploration/{id}/assurance",W="explore",te=/^[0-9a-f]{8}-[0-9a-f]{4}-[47][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;function $e(e){let t=`${W}://`;if(!e.startsWith(t))return{ok:!1,why:`it does not start with ${t}`};let n=e.slice(t.length),r=n.indexOf("?"),i=r===-1?n:n.slice(0,r);if(!te.test(i))return{ok:!1,why:`${JSON.stringify(i)} is not an exploration id: a lowercase UUID, as kane-cli explore prints it`};if(r===-1)return{ok:!0,value:{exploration:i}};let s={exploration:i};for(let u of n.slice(r+1).split("&")){let c=/^(run|cut)=(.*)$/.exec(u);if(c===null)return{ok:!1,why:`after "?" only run=<run id> and cut=<N>|end may come; found ${JSON.stringify(u)}`};let[,l,g]=c;if(s[l]!==void 0)return{ok:!1,why:`${l} is given twice`};if(l==="run"){if(!te.test(g))return{ok:!1,why:`${JSON.stringify(g)} is not a run id: a lowercase UUID`};s.run=g}else if(g==="end")s.cut="end";else if(/^(0|[1-9]\d{0,8})$/.test(g))s.cut=Number(g);else return{ok:!1,why:`${JSON.stringify(g)} is not a cut: a whole number or end`}}return{ok:!0,value:s}}var me=e=>`explore-${e.exploration}`,Ee=e=>`${W}://${e.exploration}`,Be={junction:"junctions",control:"controls",flow:"flows",finding:"findings"},ne=/^[A-Za-z0-9][A-Za-z0-9._:/#-]{0,127}$/,y=e=>{throw new w(`the exploration export cannot be read: ${e}`,"the explorer answered an export this build does not understand; update kane-cli, or report it to the explorer's team")};function oe(e){if(typeof e!="string"||!We.has(e))throw new w(`exploration export version ${JSON.stringify(e)} is not supported by this build \u2014 update kane-cli`,"update kane-cli, then ingest it again")}var P=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),D=e=>typeof e=="number"&&Number.isSafeInteger(e)&&e>=0,Ke=(e,t)=>e.id<t.id?-1:e.id>t.id?1:0;function z(e,t){let n=Be[e];Array.isArray(t)||y(`${n} is not a list`);let r=new Set;return t.map((i,s)=>{P(i)||y(`${n}[${s}] is not an object`);let u=i;(typeof u.id!="string"||!ne.test(u.id))&&y(`${n}[${s}] has no id the explorer gives a ${e}`);let c=u.id;return r.has(c)&&y(`${n} names ${c} twice`),r.add(c),(u.fp===void 0||u.fp===null)&&y(`${n}[${s}] (${c}) has no fp, which its fingerprint is made of`),{id:c,fp:u.fp,text:P(u.text)?u.text:{},info:P(u.info)?u.info:{}}}).sort(Ke)}var Ye=new Set(["stopped","completed","paused","failed","cancelled"]),ie="x-export-digest",_e=(e,t)=>t===`sha256:${ze("sha256").update(e).digest("hex")}`;function B(e,t){P(e)||y(`${t} has no cursor`);let n=e;oe(n.export_version),(typeof n.run!="string"||n.run==="")&&y(`${t}'s cursor names no run`),D(n.run_version)||y(`${t}'s cursor has no whole run_version`),D(n.deltas)||y(`${t}'s cursor has no whole deltas`);let r={export_version:n.export_version,run:n.run,run_version:n.run_version,deltas:n.deltas};return r.export_version===F&&(n.cut!=="end"&&!D(n.cut)&&y(`${t}'s cursor has no cut (a whole number or end)`),typeof n.provisional!="boolean"&&y(`${t}'s cursor does not say whether it is provisional`),r.cut=n.cut,r.provisional=n.provisional),r}var se=e=>JSON.stringify(e.export_version===F?[e.export_version,e.run,e.run_version,e.deltas,e.cut??"end",e.provisional===!0]:[e.export_version,e.run,e.run_version,e.deltas]);function ke(e){let t;try{t=JSON.parse(e)}catch{return null}if(!Array.isArray(t)||t.length<4)return null;let[n,r,i,s,u,c]=t;return typeof n!="string"||typeof r!="string"||!D(i)||!D(s)?null:{export_version:n,run:r,run_version:i,deltas:s,...t.length>=6&&(u==="end"||D(u))?{cut:u,provisional:c===!0}:{}}}function be(e){let t;try{t=JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(e))}catch{y("it is not JSON")}P(t)||y("it is not a JSON object");let n=t;P(n.cursor)||y("the export has no cursor");let r=n.cursor;return n.cursor={export_version:r.export_version,...r.provisional!==void 0?{provisional:r.provisional}:{}},delete n.run_state,new TextEncoder().encode(JSON.stringify(n))}function Ze(e,t){if(P(e)&&e.run!==void 0)return B(e,t);P(e)||y(`${t} has no cursor`);let n=e;return oe(n.export_version),n.export_version===F&&typeof n.provisional!="boolean"&&y(`${t}'s cursor does not say whether it is provisional`),{export_version:n.export_version,...typeof n.provisional=="boolean"?{provisional:n.provisional}:{}}}function Se(e){return ve(e,B,!0)}function K(e){return ve(e,Ze,!1)}function ve(e,t,n){let r;try{r=JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(e))}catch{y("it is not JSON")}P(r)||y("it is not a JSON object");let i=r;oe(i.export_version),(typeof i.exploration_id!="string"||!te.test(i.exploration_id))&&y("exploration_id is not a lowercase UUID");let s=t(i.cursor,"the export");if(s.export_version!==i.export_version&&y(`its cursor is of ${s.export_version}, the export of ${String(i.export_version)}`),n&&s.provisional!==!0&&(typeof i.run_state!="string"||!Ye.has(i.run_state))){let x=s.run;throw new w(`the export of exploration ${i.exploration_id} is of ${x!==void 0?`run ${x}`:"a run"}, which has not ended (${JSON.stringify(i.run_state??null)}): the export is read once it ends`,"try again after the run ends; the current version is kept")}let u=x=>typeof i[x]=="string"?i[x]:null,c={junctions:z("junction",i.junctions),controls:z("control",i.controls),flows:z("flow",i.flows),findings:z("finding",i.findings)},l=new Set(Object.values(c).flatMap(x=>x.map($=>$.id))),g=i.redirects??{};P(g)||y("redirects is not an object");let k={};for(let[x,$]of Object.entries(g).sort(([R],[h])=>R<h?-1:R>h?1:0))(!ne.test(x)||typeof $!="string"||!ne.test($))&&y(`the redirect from ${JSON.stringify(x)} is not one explorer id to another`),Object.hasOwn(g,$)&&y(`the redirect from ${x} goes to ${$}, which is itself redirected: a redirect names the unit that took the id over`),l.has(x)&&y(`${x} is both a unit and redirected to ${$}`),l.has($)||y(`${x} is redirected to ${$}, which is not a unit of the export`),k[x]=$;return{export_version:i.export_version,exploration_id:i.exploration_id,project_id:u("project_id"),target_url:u("target_url"),cursor:s,run_state:u("run_state"),skipped:D(i.skipped)?i.skipped:0,...c,redirects:k}}import{createHash as Qe}from"crypto";var b={junction:"junction",control:"control",flow:"flow",retiredFlow:"flow.retired",finding:"finding",alias:"merged"},Re=/^[0-9a-f]{64}$/,j={junction:e=>`j:${e}`,control:e=>`c:${Re.test(e)?e.slice(0,16):e}`,flow:e=>`f:${e}`,finding:e=>`fd:${e}`},Oe=e=>Qe("sha256").update(Q(e),"utf8").digest().subarray(0,16).toString("base64url"),G=(e,t)=>Oe({kind:e,fp:t.fp}),et=(e,t)=>Oe({kind:"alias",survivor:e,fingerprint:t}),v=(e,t=200)=>{let n=(typeof e=="string"?e:Q(e??null)).replace(/\s+/g," ").trim();return n.length>t?`${n.slice(0,t-1)}\u2026`:n},N=e=>JSON.stringify(v(e??"")),Y=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),f=(e,t)=>Y(e)?e[t]:void 0,_=e=>typeof e=="string"&&e!==""?e:void 0,ae=e=>typeof e=="string"&&Re.test(e)?e.slice(0,12):v(e),tt=" (in flight at this cut: not citable yet)";function Z(e){let t=o=>e.cursor.provisional===!0&&o.info.settled===!1,n=o=>t(o)?tt:"",r=[],i=[],s=new Map,u=(o,d,p,a,m,O)=>{let E=s.get(o);if(E!==void 0)throw new w(`two units of exploration ${e.exploration_id} have the id ${o} (${E} and ${d}), so neither can be told apart`,"report it to kane's team: the unit id needs more of the explorer's id");s.set(o,d),i.push({id:o,ref:o,kind:p,lines:[a,r.length],fingerprint:m,...O!==void 0?{label:v(O,80)}:{}})},c=new Map;for(let o of["junction","control","flow","finding"])for(let d of e[`${o}s`])c.set(d.id,o);let l=o=>{if(typeof o!="string")return v(o);let d=c.get(e.redirects[o]??o);return d!==void 0?j[d](o):o};r.push(`Exploration ${e.exploration_id}${e.target_url!==null?` of ${v(e.target_url)}`:""}`),r.push(`Project: ${e.project_id??"none"}`),e.skipped>0&&r.push(`Left out by the explorer: ${e.skipped} item(s) whose ids cannot be cited`),r.push("Units: j: a screen, c: a control on it, f: a flow, fd: a finding. Cite the unit's id.");let g=new Map,k=new Set(e.junctions.map(o=>o.id)),x=new Map,$=[];for(let o of e.controls){let d=_(o.info.junction);d!==void 0&&k.has(d)?x.set(d,[...x.get(d)??[],o]):$.push(o)}let R=o=>{let{text:d,fp:p,info:a}=o,m=[_(d.container)?` in ${N(d.container)}`:"",_(f(p,"href_pattern"))?` to ${v(f(p,"href_pattern"))}`:"",a.disabled===!0?" disabled":"",f(p,"gated")===!0?" gated":""].join("");r.push(`${j.control(o.id)} ${v(_(d.role)??f(p,"role")??"control")} ${N(d.name??d.label)}${m}${n(o)}`);let O=G("control",o);g.set(o.id,O),t(o)||u(j.control(o.id),o.id,b.control,r.length,O)};r.push("","## Screens");for(let o of e.junctions){let d=j.junction(o.id),{text:p,fp:a,info:m}=o;r.push("");let O=r.length+1;r.push(`${d} screen ${N(p.name??p.heading??p.url_pattern??o.id)} at ${v(p.url_pattern??f(a,"url_pattern")??"?")}${n(o)}`),_(p.heading)&&p.heading!==p.name&&r.push(` heading: ${N(p.heading)}`);let E=f(a,"signatures");r.push(` kind ${v(f(a,"kind")??"?")}, ${Array.isArray(E)?E.length:0} version(s), current ${ae(m.current_signature??"none")}`);let I=G("junction",o);g.set(o.id,I),t(o)||u(d,o.id,b.junction,O,I,_(p.name));for(let U of x.get(o.id)??[])R(U)}if($.length>0){r.push("","## Controls on no screen of this export");for(let o of $)R(o)}r.push("","## Flows");for(let o of e.flows){let d=j.flow(o.id),{text:p,fp:a,info:m}=o;r.push("");let O=r.length+1,E=f(a,"exit")!==null&&f(a,"exit")!==void 0?l(f(a,"exit")):"(no exit)";r.push(`${d} flow ${N(p.name??o.id)}: ${l(f(a,"entry"))} to ${E}, ${v(m.status??"?")}${n(o)}`),r.push(` steps key: ${ae(f(a,"steps_key")??"none")}`);let I=Array.isArray(p.steps)?p.steps:[];for(let S of I)r.push(` step: ${v(f(S,"kind")??"step")} ${N(f(S,"label")??"")}`);let U=Array.isArray(p.assertions)?p.assertions:[];for(let S of U)r.push(` asserts ${ae(f(S,"id"))}: ${N(f(S,"text")??"")}`);let C=f(a,"assertions");Array.isArray(C)&&C.length!==U.length&&r.push(` assertions: ${C.length}`);let T=f(a,"stateful");(Y(T)||f(a,"state")===!0||_(f(a,"in_state")))&&r.push(` stateful${Y(T)?` ${v([T.type,T.role,T.kind].filter(S=>typeof S=="string").join(" "))}`:""}${f(a,"state")===!0?", sets state":""}${_(f(a,"in_state"))?`, needs ${N(f(a,"in_state"))}`:""}`),_(f(a,"after_flow"))&&r.push(` after: ${l(f(a,"after_flow"))}`);let H=_(f(a,"retired"));H!==void 0&&r.push(` retired: ${v(H)}${_(f(a,"superseded_by"))?`, superseded by ${l(f(a,"superseded_by"))}`:""}`);let M=Array.isArray(m.changes)?m.changes.filter(Y).slice(-3).reverse():[];for(let S of M){let Le=_(S.from_exit)||_(S.to_exit)?`: exit ${_(S.from_exit)?l(S.from_exit):"none"} to ${_(S.to_exit)?l(S.to_exit):"none"}`:"";r.push(` changed in run ${v(S.run_id??"?")}: ${v(S.kind??"a change")}${Le}`)}t(o)||u(d,o.id,H!==void 0?b.retiredFlow:b.flow,O,G("flow",o),_(p.name))}r.push("","## Findings");for(let o of e.findings){let d=j.finding(o.id),{text:p,fp:a,info:m}=o;r.push("");let O=r.length+1,E=(Array.isArray(m.junctions)?m.junctions:[]).map(l).join(", "),I=[_(f(a,"candidate"))?` at ${l(f(a,"candidate"))}`:"",E!==""?` on ${E}`:""].join("");r.push(`${d} finding ${v(f(a,"kind")??"?")}${_(f(a,"category"))?` (${v(f(a,"category"))})`:""}${I}${_(m.severity)?`, ${v(m.severity)}`:""}${n(o)}`),_(p.title)&&r.push(` ${N(p.title)}`),_(p.description)&&r.push(` ${N(p.description)}`),f(a,"blocked_by")!==null&&f(a,"blocked_by")!==void 0&&r.push(` blocked by: ${v(f(a,"blocked_by"))}`),t(o)||u(d,o.id,b.finding,O,G("finding",o),_(p.title))}let h=Object.entries(e.redirects);if(h.length>0){r.push("","## Merged");for(let[o,d]of h){let p=c.get(d),a=e[`${p}s`].find(m=>m.id===d);r.push(`${j[p](o)} merged into ${j[p](d)}${n(a)}`),t(a)||u(j[p](o),o,b.alias,r.length,et(d,g.get(d)??G(p,e[`${p}s`].find(m=>m.id===d))))}}return{text:r.join(`
|
|
2
|
+
import{b as w,c as L,g as fe,j as ge}from"./chunk-ORNVIEUA.js";import{b as pe}from"./chunk-K3OSK6PB.js";import{d as X}from"./chunk-DBMW3VUN.js";import{a as Q}from"./chunk-7V4BQSSV.js";import{a as ue,b as le}from"./chunk-GGV336P5.js";import{a as de}from"./chunk-4QTH7VYE.js";var De={requestMs:3e4,requests:64,redirects:5,bodyBytes:X.contentBytes},Fe=new Set(["authorization","proxy-authorization","cookie","host"]),He=new Set(["set-cookie","set-cookie2","www-authenticate","proxy-authenticate"]);function he(e){try{let t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"?t.origin:null}catch{return null}}async function Je(e,t,n,r){let i=Number(e.headers.get("content-length"));if(Number.isFinite(i)&&i>t&&(await e.body?.cancel().catch(()=>{}),r(`${n} answered with ${i} bytes; a plugin's source may be at most ${t}`)),e.body===null)return new Uint8Array(0);let s=e.body.getReader(),u=[],c=0;for(;;){let{done:k,value:x}=await s.read();if(k)break;c+=x.byteLength,c>t&&(await s.cancel().catch(()=>{}),r(`${n} answered with more than ${t} bytes; a plugin's source may be at most ${t}`)),u.push(x)}let l=new Uint8Array(c),g=0;for(let k of u)l.set(k,g),g+=k.byteLength;return l}function xe(e){let{plugin:t}=e,n={...De,...e.limits},r=e.fetchImpl??fetch,i=new Set(e.allow.map(h=>he(h)).filter(h=>h!==null)),s=[...i].join(", ")||"no origin",u=0,c=null,l=!1,g=new Set,k=()=>{throw new L({code:"PLUGIN_CONNECTION_REFUSED",message:`the connection for plugin ${t} is closed: its fetch has ended`,plugin:t,hook:"fetch"})},x=(h,o)=>{let d=new L({code:h,message:o,plugin:t,hook:"fetch"});throw c??=d,d},$=h=>x("PLUGIN_CONNECTION_REFUSED",`plugin ${t} ${h}`),R=(h,o)=>{let d=he(h);return d===null&&$(`${o} ${JSON.stringify(h)}, which is not an http or https URL`),i.has(d)||$(`${o} ${h}, which is not an origin it may reach \u2014 it may reach ${s}`),new URL(h)};return{get breach(){return c},close(){l=!0;for(let h of g)h.abort();g.clear()},async request(h){l&&k();let o=h.method??"GET",d=o==="POST"?h.body:void 0;o!=="GET"&&o!=="POST"&&$(`asked for a ${JSON.stringify(o)} request; a plugin's connection makes GET and POST requests only`);let p={};for(let[m,O]of Object.entries(h.headers??{})){let E=m.toLowerCase();Fe.has(E)&&$(`set the ${E} header itself; the host adds its own credentials, and a plugin never sends any`),p[E]=String(O)}let a=R(h.url,"asked the connection for");for(let m=0;;m+=1){u+=1,u>n.requests&&$(`made more than ${n.requests} requests in one fetch`);let O={...p};for(let[C,T]of Object.entries(await e.authorize(a)))O[C.toLowerCase()]=String(T);l&&k();let E=new AbortController;g.add(E);let I=setTimeout(()=>E.abort(),n.requestMs),U;try{U=await r(a,{method:o,headers:O,redirect:"manual",signal:E.signal,...d!==void 0?{body:d}:{}})}catch(C){throw g.delete(E),clearTimeout(I),l&&k(),E.signal.aborted?new Error(`${a.origin} did not answer plugin ${t}'s request within ${n.requestMs/1e3} seconds`):new Error(`plugin ${t}'s request to ${a.origin} failed: ${C instanceof Error?C.message:String(C)}`)}try{let C=U.status>=300&&U.status<400?U.headers.get("location"):null;if(C!==null){await U.body?.cancel().catch(()=>{}),m>=n.redirects&&$(`was redirected more than ${n.redirects} times from ${h.url}`),a=R(new URL(C,a).href,"was redirected to"),(U.status===303||(U.status===301||U.status===302)&&o==="POST")&&(o="GET",d=void 0,delete p["content-type"],delete p["content-length"]);continue}let T=await Je(U,n.bodyBytes,a.href,M=>x("PLUGIN_CONTENT_TOO_LARGE",M)),H={};return U.headers.forEach((M,S)=>{He.has(S.toLowerCase())||(H[S.toLowerCase()]=M)}),{status:U.status,headers:H,body:T}}catch(C){throw l&&!(C instanceof L)&&k(),E.signal.aborted?new Error(`${a.origin} did not finish answering plugin ${t}'s request within ${n.requestMs/1e3} seconds`):C}finally{g.delete(E),clearTimeout(I)}}}}}var ee=()=>ue(le()).controllerBaseUrl,Me={explore:e=>[new URL(e).origin]};async function Xe(e){let t=await e.controller();if(t.basic)return{authorization:de(t.basic.username,t.basic.accessKey)};if(t.token)return{authorization:`Bearer ${t.token}`};throw new Error("no credentials for the controller: run `kane-cli login`, then try again")}var Ge="run `kane-cli login`, then run the command again";function qe(e,t){let n=null;return{get breach(){return t.breach??n},close:()=>t.close(),request:async r=>{if(n!==null)throw n;let i=await t.request(r);return i.status===401&&n===null&&(n=new L({code:"PLUGIN_REFUSED",message:`${new URL(r.url).origin} refused the credential this run holds (${i.status}) when plugin ${e} fetched`,plugin:e,hook:"fetch",remedy:Ge})),i}}}function Ve(e,t={}){let n=t.origins??Me;if(!Object.hasOwn(n,e))return;let r=n[e],i=t.credentials??pe;return qe(e,xe({plugin:e,allow:r((t.controller??ee)()),authorize:()=>Xe(i),...t.fetchImpl?{fetchImpl:t.fetchImpl}:{}}))}var we=e=>Ve(e);import{createHash as ze}from"crypto";var re="exploration-export/1",F="exploration-export/2",We=new Set([re,F]),ye="/exploration/{id}/assurance",W="explore",te=/^[0-9a-f]{8}-[0-9a-f]{4}-[47][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;function $e(e){let t=`${W}://`;if(!e.startsWith(t))return{ok:!1,why:`it does not start with ${t}`};let n=e.slice(t.length),r=n.indexOf("?"),i=r===-1?n:n.slice(0,r);if(!te.test(i))return{ok:!1,why:`${JSON.stringify(i)} is not an exploration id: a lowercase UUID, as kane-cli explore prints it`};if(r===-1)return{ok:!0,value:{exploration:i}};let s={exploration:i};for(let u of n.slice(r+1).split("&")){let c=/^(run|cut)=(.*)$/.exec(u);if(c===null)return{ok:!1,why:`after "?" only run=<run id> and cut=<N>|end may come; found ${JSON.stringify(u)}`};let[,l,g]=c;if(s[l]!==void 0)return{ok:!1,why:`${l} is given twice`};if(l==="run"){if(!te.test(g))return{ok:!1,why:`${JSON.stringify(g)} is not a run id: a lowercase UUID`};s.run=g}else if(g==="end")s.cut="end";else if(/^(0|[1-9]\d{0,8})$/.test(g))s.cut=Number(g);else return{ok:!1,why:`${JSON.stringify(g)} is not a cut: a whole number or end`}}return{ok:!0,value:s}}var me=e=>`explore-${e.exploration}`,Ee=e=>`${W}://${e.exploration}`,Be={junction:"junctions",control:"controls",flow:"flows",finding:"findings"},ne=/^[A-Za-z0-9][A-Za-z0-9._:/#-]{0,127}$/,y=e=>{throw new w(`the exploration export cannot be read: ${e}`,"the explorer answered an export this build does not understand; update kane-cli, or report it to the explorer's team")};function oe(e){if(typeof e!="string"||!We.has(e))throw new w(`exploration export version ${JSON.stringify(e)} is not supported by this build \u2014 update kane-cli`,"update kane-cli, then ingest it again")}var P=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),D=e=>typeof e=="number"&&Number.isSafeInteger(e)&&e>=0,Ke=(e,t)=>e.id<t.id?-1:e.id>t.id?1:0;function z(e,t){let n=Be[e];Array.isArray(t)||y(`${n} is not a list`);let r=new Set;return t.map((i,s)=>{P(i)||y(`${n}[${s}] is not an object`);let u=i;(typeof u.id!="string"||!ne.test(u.id))&&y(`${n}[${s}] has no id the explorer gives a ${e}`);let c=u.id;return r.has(c)&&y(`${n} names ${c} twice`),r.add(c),(u.fp===void 0||u.fp===null)&&y(`${n}[${s}] (${c}) has no fp, which its fingerprint is made of`),{id:c,fp:u.fp,text:P(u.text)?u.text:{},info:P(u.info)?u.info:{}}}).sort(Ke)}var Ye=new Set(["stopped","completed","paused","failed","cancelled"]),ie="x-export-digest",_e=(e,t)=>t===`sha256:${ze("sha256").update(e).digest("hex")}`;function B(e,t){P(e)||y(`${t} has no cursor`);let n=e;oe(n.export_version),(typeof n.run!="string"||n.run==="")&&y(`${t}'s cursor names no run`),D(n.run_version)||y(`${t}'s cursor has no whole run_version`),D(n.deltas)||y(`${t}'s cursor has no whole deltas`);let r={export_version:n.export_version,run:n.run,run_version:n.run_version,deltas:n.deltas};return r.export_version===F&&(n.cut!=="end"&&!D(n.cut)&&y(`${t}'s cursor has no cut (a whole number or end)`),typeof n.provisional!="boolean"&&y(`${t}'s cursor does not say whether it is provisional`),r.cut=n.cut,r.provisional=n.provisional),r}var se=e=>JSON.stringify(e.export_version===F?[e.export_version,e.run,e.run_version,e.deltas,e.cut??"end",e.provisional===!0]:[e.export_version,e.run,e.run_version,e.deltas]);function ke(e){let t;try{t=JSON.parse(e)}catch{return null}if(!Array.isArray(t)||t.length<4)return null;let[n,r,i,s,u,c]=t;return typeof n!="string"||typeof r!="string"||!D(i)||!D(s)?null:{export_version:n,run:r,run_version:i,deltas:s,...t.length>=6&&(u==="end"||D(u))?{cut:u,provisional:c===!0}:{}}}function be(e){let t;try{t=JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(e))}catch{y("it is not JSON")}P(t)||y("it is not a JSON object");let n=t;P(n.cursor)||y("the export has no cursor");let r=n.cursor;return n.cursor={export_version:r.export_version,...r.provisional!==void 0?{provisional:r.provisional}:{}},delete n.run_state,new TextEncoder().encode(JSON.stringify(n))}function Ze(e,t){if(P(e)&&e.run!==void 0)return B(e,t);P(e)||y(`${t} has no cursor`);let n=e;return oe(n.export_version),n.export_version===F&&typeof n.provisional!="boolean"&&y(`${t}'s cursor does not say whether it is provisional`),{export_version:n.export_version,...typeof n.provisional=="boolean"?{provisional:n.provisional}:{}}}function Se(e){return ve(e,B,!0)}function K(e){return ve(e,Ze,!1)}function ve(e,t,n){let r;try{r=JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(e))}catch{y("it is not JSON")}P(r)||y("it is not a JSON object");let i=r;oe(i.export_version),(typeof i.exploration_id!="string"||!te.test(i.exploration_id))&&y("exploration_id is not a lowercase UUID");let s=t(i.cursor,"the export");if(s.export_version!==i.export_version&&y(`its cursor is of ${s.export_version}, the export of ${String(i.export_version)}`),n&&s.provisional!==!0&&(typeof i.run_state!="string"||!Ye.has(i.run_state))){let x=s.run;throw new w(`the export of exploration ${i.exploration_id} is of ${x!==void 0?`run ${x}`:"a run"}, which has not ended (${JSON.stringify(i.run_state??null)}): the export is read once it ends`,"try again after the run ends; the current version is kept")}let u=x=>typeof i[x]=="string"?i[x]:null,c={junctions:z("junction",i.junctions),controls:z("control",i.controls),flows:z("flow",i.flows),findings:z("finding",i.findings)},l=new Set(Object.values(c).flatMap(x=>x.map($=>$.id))),g=i.redirects??{};P(g)||y("redirects is not an object");let k={};for(let[x,$]of Object.entries(g).sort(([R],[h])=>R<h?-1:R>h?1:0))(!ne.test(x)||typeof $!="string"||!ne.test($))&&y(`the redirect from ${JSON.stringify(x)} is not one explorer id to another`),Object.hasOwn(g,$)&&y(`the redirect from ${x} goes to ${$}, which is itself redirected: a redirect names the unit that took the id over`),l.has(x)&&y(`${x} is both a unit and redirected to ${$}`),l.has($)||y(`${x} is redirected to ${$}, which is not a unit of the export`),k[x]=$;return{export_version:i.export_version,exploration_id:i.exploration_id,project_id:u("project_id"),target_url:u("target_url"),cursor:s,run_state:u("run_state"),skipped:D(i.skipped)?i.skipped:0,...c,redirects:k}}import{createHash as Qe}from"crypto";var b={junction:"junction",control:"control",flow:"flow",retiredFlow:"flow.retired",finding:"finding",alias:"merged"},Re=/^[0-9a-f]{64}$/,j={junction:e=>`j:${e}`,control:e=>`c:${Re.test(e)?e.slice(0,16):e}`,flow:e=>`f:${e}`,finding:e=>`fd:${e}`},Oe=e=>Qe("sha256").update(Q(e),"utf8").digest().subarray(0,16).toString("base64url"),G=(e,t)=>Oe({kind:e,fp:t.fp}),et=(e,t)=>Oe({kind:"alias",survivor:e,fingerprint:t}),v=(e,t=200)=>{let n=(typeof e=="string"?e:Q(e??null)).replace(/\s+/g," ").trim();return n.length>t?`${n.slice(0,t-1)}\u2026`:n},N=e=>JSON.stringify(v(e??"")),Y=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),f=(e,t)=>Y(e)?e[t]:void 0,_=e=>typeof e=="string"&&e!==""?e:void 0,ae=e=>typeof e=="string"&&Re.test(e)?e.slice(0,12):v(e),tt=" (in flight at this cut: not citable yet)";function Z(e){let t=o=>e.cursor.provisional===!0&&o.info.settled===!1,n=o=>t(o)?tt:"",r=[],i=[],s=new Map,u=(o,d,p,a,m,O)=>{let E=s.get(o);if(E!==void 0)throw new w(`two units of exploration ${e.exploration_id} have the id ${o} (${E} and ${d}), so neither can be told apart`,"report it to kane's team: the unit id needs more of the explorer's id");s.set(o,d),i.push({id:o,ref:o,kind:p,lines:[a,r.length],fingerprint:m,...O!==void 0?{label:v(O,80)}:{}})},c=new Map;for(let o of["junction","control","flow","finding"])for(let d of e[`${o}s`])c.set(d.id,o);let l=o=>{if(typeof o!="string")return v(o);let d=c.get(e.redirects[o]??o);return d!==void 0?j[d](o):o};r.push(`Exploration ${e.exploration_id}${e.target_url!==null?` of ${v(e.target_url)}`:""}`),r.push(`Project: ${e.project_id??"none"}`),e.skipped>0&&r.push(`Left out by the explorer: ${e.skipped} item(s) whose ids cannot be cited`),r.push("Units: j: a screen, c: a control on it, f: a flow, fd: a finding. Cite the unit's id.");let g=new Map,k=new Set(e.junctions.map(o=>o.id)),x=new Map,$=[];for(let o of e.controls){let d=_(o.info.junction);d!==void 0&&k.has(d)?x.set(d,[...x.get(d)??[],o]):$.push(o)}let R=o=>{let{text:d,fp:p,info:a}=o,m=[_(d.container)?` in ${N(d.container)}`:"",_(f(p,"href_pattern"))?` to ${v(f(p,"href_pattern"))}`:"",a.disabled===!0?" disabled":"",f(p,"gated")===!0?" gated":""].join("");r.push(`${j.control(o.id)} ${v(_(d.role)??f(p,"role")??"control")} ${N(d.name??d.label)}${m}${n(o)}`);let O=G("control",o);g.set(o.id,O),t(o)||u(j.control(o.id),o.id,b.control,r.length,O)};r.push("","## Screens");for(let o of e.junctions){let d=j.junction(o.id),{text:p,fp:a,info:m}=o;r.push("");let O=r.length+1;r.push(`${d} screen ${N(p.name??p.heading??p.url_pattern??o.id)} at ${v(p.url_pattern??f(a,"url_pattern")??"?")}${n(o)}`),_(p.heading)&&p.heading!==p.name&&r.push(` heading: ${N(p.heading)}`);let E=f(a,"signatures");r.push(` kind ${v(f(a,"kind")??"?")}, ${Array.isArray(E)?E.length:0} version(s), current ${ae(m.current_signature??"none")}`);let I=G("junction",o);g.set(o.id,I),t(o)||u(d,o.id,b.junction,O,I,_(p.name));for(let U of x.get(o.id)??[])R(U)}if($.length>0){r.push("","## Controls on no screen of this export");for(let o of $)R(o)}r.push("","## Flows");for(let o of e.flows){let d=j.flow(o.id),{text:p,fp:a,info:m}=o;r.push("");let O=r.length+1,E=f(a,"exit")!==null&&f(a,"exit")!==void 0?l(f(a,"exit")):"(no exit)";r.push(`${d} flow ${N(p.name??o.id)}: ${l(f(a,"entry"))} to ${E}, ${v(m.status??"?")}${n(o)}`),r.push(` steps key: ${ae(f(a,"steps_key")??"none")}`);let I=Array.isArray(p.steps)?p.steps:[];for(let S of I)r.push(` step: ${v(f(S,"kind")??"step")} ${N(f(S,"label")??"")}`);let U=Array.isArray(p.assertions)?p.assertions:[];for(let S of U)r.push(` asserts ${ae(f(S,"id"))}: ${N(f(S,"text")??"")}`);let C=f(a,"assertions");Array.isArray(C)&&C.length!==U.length&&r.push(` assertions: ${C.length}`);let T=f(a,"stateful");(Y(T)||f(a,"state")===!0||_(f(a,"in_state")))&&r.push(` stateful${Y(T)?` ${v([T.type,T.role,T.kind].filter(S=>typeof S=="string").join(" "))}`:""}${f(a,"state")===!0?", sets state":""}${_(f(a,"in_state"))?`, needs ${N(f(a,"in_state"))}`:""}`),_(f(a,"after_flow"))&&r.push(` after: ${l(f(a,"after_flow"))}`);let H=_(f(a,"retired"));H!==void 0&&r.push(` retired: ${v(H)}${_(f(a,"superseded_by"))?`, superseded by ${l(f(a,"superseded_by"))}`:""}`);let M=Array.isArray(m.changes)?m.changes.filter(Y).slice(-3).reverse():[];for(let S of M){let Le=_(S.from_exit)||_(S.to_exit)?`: exit ${_(S.from_exit)?l(S.from_exit):"none"} to ${_(S.to_exit)?l(S.to_exit):"none"}`:"";r.push(` changed in run ${v(S.run_id??"?")}: ${v(S.kind??"a change")}${Le}`)}t(o)||u(d,o.id,H!==void 0?b.retiredFlow:b.flow,O,G("flow",o),_(p.name))}r.push("","## Findings");for(let o of e.findings){let d=j.finding(o.id),{text:p,fp:a,info:m}=o;r.push("");let O=r.length+1,E=(Array.isArray(m.junctions)?m.junctions:[]).map(l).join(", "),I=[_(f(a,"candidate"))?` at ${l(f(a,"candidate"))}`:"",E!==""?` on ${E}`:""].join("");r.push(`${d} finding ${v(f(a,"kind")??"?")}${_(f(a,"category"))?` (${v(f(a,"category"))})`:""}${I}${_(m.severity)?`, ${v(m.severity)}`:""}${n(o)}`),_(p.title)&&r.push(` ${N(p.title)}`),_(p.description)&&r.push(` ${N(p.description)}`),f(a,"blocked_by")!==null&&f(a,"blocked_by")!==void 0&&r.push(` blocked by: ${v(f(a,"blocked_by"))}`),t(o)||u(d,o.id,b.finding,O,G("finding",o),_(p.title))}let h=Object.entries(e.redirects);if(h.length>0){r.push("","## Merged");for(let[o,d]of h){let p=c.get(d),a=e[`${p}s`].find(m=>m.id===d);r.push(`${j[p](o)} merged into ${j[p](d)}${n(a)}`),t(a)||u(j[p](o),o,b.alias,r.length,et(d,g.get(d)??G(p,e[`${p}s`].find(m=>m.id===d))))}}return{text:r.join(`
|
|
3
3
|
`)+`
|
|
4
4
|
`,units:i}}var nt="explore",rt="exploration-export/1";function Ue(e,t,n){let r=ye.replace("{id}",t.exploration);return`${e.replace(/\/+$/,"")}${r}/${n}?cut=${t.cut??"end"}${t.run!==void 0?`&run=${t.run}`:""}`}function ot(e,t){let n=e.headers[ie];if(n===void 0)throw new w(`the export of exploration ${t.exploration} came with no digest (the ${ie} header)`,V);if(!_e(e.body,n))throw new w(`the export of exploration ${t.exploration} is not the bytes its digest names: it was changed on the way, or not served whole`,V);let r=Se(e.body);if(r.exploration_id!==t.exploration)throw new w(`the explorer answered the export of exploration ${r.exploration_id} when asked for ${t.exploration}`,"report it to the explorer's team");if(t.run!==void 0&&r.cursor.run!==t.run)throw new w(`the explorer answered the export as of run ${r.cursor.run} when asked for run ${t.run}`,"report it to the explorer's team");if(r.export_version!==F)throw new w(`the explorer answered ${r.export_version} when asked for a cut (export/2)`,"report it to the explorer's team");if((r.cursor.cut??"end")!==(t.cut??"end"))throw new w(`the explorer answered ${r.cursor.cut==="end"?"the end":`cut ${String(r.cursor.cut)}`} when asked for ${ce(t)}`,"report it to the explorer's team");return Z(r),r}var ce=e=>e.cut===void 0||e.cut==="end"?e.run!==void 0?`the end of run ${e.run}`:"its latest ended run":`cut ${e.cut}${e.run!==void 0?` of run ${e.run}`:""}`,Ce=e=>{let t=$e(e);if(!t.ok)throw new w(`${e} is not an exploration reference: ${t.why}`,"name it as explore://<exploration id>, with ?run=<run id> and/or cut=<N>|end to read one cut");return t.value},V="try again later; the current version is kept";function it(e){try{let t=JSON.parse(new TextDecoder().decode(e));return typeof t=="object"&&t!==null?t:{}}catch{return{}}}function Pe(e,t,n,r){let i=`exploration ${n.exploration}${n.run!==void 0?` at run ${n.run}`:""}`,s=it(t);throw e===409&&s.code==="CUT_SUPERSEDED"?new w(`${ce(n)} of exploration ${n.exploration} is superseded (CUT_SUPERSEDED): a later run's cuts are served now`,"nothing to do: a later cut covers it"):e===404&&s.code==="CUT_NOT_FOUND"?new w(`${ce(n)} of exploration ${n.exploration} was never taken (CUT_NOT_FOUND)`,"name a cut the controller took (a checkpoint or a sync), or cut=end"):e===409&&s.code==="RUN_ACTIVE"?new w(`a run of exploration ${n.exploration} is in progress${typeof s.active_run=="string"?` (run ${s.active_run})`:""}: the export is read once it ends`,"try again after the run ends; the current version is kept"):e===409&&s.code==="EXPLORATION_OUTDATED"?new w(`${i} can no longer be read (OUTDATED): re-explore`,"explore the site again, then ingest the new exploration"):e===404&&s.code==="NO_ENDED_RUN"?new w(`exploration ${n.exploration} has no ended run yet: the export is read once its first run ends`,"try again after the first run ends"):e===404?new w(`${i} was not found (404): the explorer has no such exploration${n.run!==void 0?" or run":""}, or it is not one of your organisation's`,"check the id, and that kane-cli is signed in to the controller the exploration ran on"):e===401||e===403?new w(`the controller refused kane-cli's credentials (${e}) for ${i}`,"sign in again with kane-cli login, then try again"):e===400?new w(`the explorer refused the request for the ${r} of ${i} (400)${typeof s.error=="string"?`: ${s.error.slice(0,200)}`:""}`,"report it to kane's team"):new w(`the explorer answered ${e} for the ${r} of ${i}`,V)}async function Ne(e,t,n){try{return await e.connection.request({url:t,headers:{accept:"application/json"}})}catch(r){throw r instanceof L?r:new w(`exploration ${n.exploration} could not be read: ${r instanceof Error?r.message:String(r)}`,V)}}function Te(e){return{manifest:{contract:1,id:nt,version:"0.1.0",rules:rt,capabilities:["remote","explain","context","coverage","cites-deep"],claims:{schemes:[W]}},claim(t){if(t.isFile)return null;let n=Ce(t.ref),r=Ee(n);return{sourceId:me(n),label:`Exploration ${n.exploration}`,...r!==t.ref?{recorded:r}:{}}},async fetch(t){let n=Ce(t.ref);if(t.cursor!==null){let s=await Ne(t,Ue(e.controller,n,"head"),n);s.status!==200&&Pe(s.status,s.body,n,"head");let u;try{u=JSON.parse(new TextDecoder().decode(s.body))}catch{throw new w(`the head of exploration ${n.exploration} is not JSON`,V)}let c=B(u?.cursor,"the head");if(n.run!==void 0&&c.run!==n.run)throw new w(`the explorer answered the head as of run ${c.run} when asked for run ${n.run}`,"report it to the explorer's team");if(se(c)===t.cursor)return{kind:"unchanged"};let l=ke(t.cursor);if(l!==null&&l.export_version===re&&c.export_version===F&&l.run_version===c.run_version&&l.deltas===c.deltas)return{kind:"unchanged"}}let r=await Ne(t,Ue(e.controller,n,"export"),n);r.status!==200&&Pe(r.status,r.body,n,"export");let i=ot(r,n);return{kind:"content",bytes:be(r.body),cursor:se(i.cursor)}},render(t){return{text:Z(K(t.bytes)).text}},index(t){return Z(K(t.bytes)).units},explain:at,context:ct,coverage:ut}}var Ie=e=>e.replace(/\n$/,"").split(`
|
|
5
5
|
`).slice(1).map(t=>t.trim()),A=e=>e.split(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as te,b as E,d as ne,e as se}from"./chunk-JGRXMTME.js";import{b as X,c as v,e as W,i as Y,j as Z,k as ee}from"./chunk-77ZZQJLX.js";import{
|
|
2
|
+
import{a as te,b as E,d as ne,e as se}from"./chunk-JGRXMTME.js";import{b as X,c as v,e as W,i as Y,j as Z,k as ee}from"./chunk-77ZZQJLX.js";import{f as z}from"./chunk-FYCD765R.js";import{a as Q}from"./chunk-B7ZX5HEN.js";import{d as q}from"./chunk-QMOGBKJM.js";import{copyFileSync as Re,cpSync as xe,existsSync as P,mkdirSync as Ie,readFileSync as ze,readdirSync as ke,rmSync as Qe,writeFileSync as Xe}from"fs";import{dirname as Ye,isAbsolute as Ze,join as x,relative as et,resolve as tt}from"path";import{writeFileSync as ve,mkdirSync as Pe,readFileSync as je}from"fs";import{dirname as De,basename as re}from"path";function oe(e){let t=e.outPath??v(e.sourcePath);Pe(De(t),{recursive:!0});let n=[];n.push("---"),n.push(`test: ../${re(e.sourcePath)}`),n.push(`status: ${e.overallStatus}`),n.push(`started: ${e.startedISO}`),n.push(`duration_s: ${e.durationS}`),n.push(`session_id: ${e.sessionId}`),n.push("---",""),n.push(`# ${e.title??re(e.sourcePath)} \u2014 Result`,"");for(let r=0;r<e.rootSteps.length;r++){let o=e.rootSteps[r],s=e.outcomes.find(d=>d.rootStepIndex===r+1);if(n.push($e(o,s)),s?.stepMd5&&n.push(`md5: ${s.stepMd5}`),s?.status==="failed"&&s.reason&&n.push(`Reason: ${s.reason}`),s?.softFailures?.length)for(let d of s.softFailures){let a=d.reason?`: ${d.reason}`:"";n.push(`\u26A0 optional sub-step ${d.subStepIndex} failed${a}`)}o.body.kind==="objective"&&s?.status!=="skipped"&&n.push(o.body.text),n.push("")}return ve(t,n.join(`
|
|
3
3
|
`),"utf8"),t}function $e(e,t){if(!t)return`## ${e.heading} (no outcome)`;let n=t.duration_s!=null?`${t.duration_s}s`:"\u2014";if(t.status==="skipped")return`## ${e.heading} \u23ED skipped`;let r=t.softFailed?" (optional)":"";if(t.refKind&&t.status==="passed"){let o=t.helperResultRelPath?` \u2192 ${t.helperResultRelPath}`:"";return`## ${e.heading} \u2713 passed (via @${t.refKind} ${t.refLabel} \u2014 ${t.inlinedCount} inlined steps, ${n}${o})`}if(t.refKind&&t.status==="failed"){let o=t.failedSubStepIndex&&t.failedSubStepIndex.length>0?` \u2014 at sub-step ${t.failedSubStepIndex.join(" \u2192 sub-step ")}`:"",s=t.helperResultRelPath?` \u2192 ${t.helperResultRelPath}`:"";return`## ${e.heading} \u2717 failed${r} (via @${t.refKind} ${t.refLabel}${o}, ${n}${s})`}return t.status==="passed"?`## ${e.heading} \u2713 passed (${n})`:`## ${e.heading} \u2717 failed${r} (${n})`}var Fe=/^##\s+(.+?)\s+(✓ passed|✗ failed(?:\s+\(optional\))?|⏭ skipped)(?:\s+\((.*)\))?\s*$/,Oe=/via\s+@\w+\s+(\S+).*?(?:→\s+(\S+))?\s*$/,_e=/^md5:\s+([a-f0-9]{32})\s*$/;function ie(e,t){for(let n=t;n<e.length&&!/^##\s/.test(e[n]);n++){if(e[n].trim()==="")continue;let r=_e.exec(e[n]);return r?r[1]:null}return null}function D(e){let n=je(e,"utf8").split(`
|
|
4
4
|
`),r="passed";if(n[0]?.trim()==="---")for(let s=1;s<n.length&&n[s].trim()!=="---";s++){let d=/^status:\s+(passed|failed|interrupted)\s*$/.exec(n[s]);d&&(r=d[1])}let o=[];for(let s=0;s<n.length;s++){let d=Fe.exec(n[s]);if(!d)continue;let a=d[1],i=d[2],u=d[3]??"",f=i.startsWith("\u2713")?"passed":i.startsWith("\u23ED")?"skipped":"failed";if(/via\s+@/.test(u)){let m=Oe.exec(u),w=m?.[1]??"",I=m?.[2]??null;o.push({kind:"import",heading:a,status:f,md5:ie(n,s+1),importPath:w,helperResultRelPath:I})}else o.push({kind:"objective",heading:a,status:f,md5:ie(n,s+1)})}return{overallStatus:r,steps:o}}import{copyFileSync as ae,existsSync as H,mkdirSync as Ae,writeFileSync as de,promises as dt}from"fs";import{join as $,dirname as le,basename as Te}from"path";async function pe(e){for(let t=0;t<e.totalRunDirs;t++){let n=e.runIndex+t,r=$(e.sessionDir,"runs",String(n)),o=$(e.stagingStepDir,"flows",String(t));Ae(o,{recursive:!0});let s=$(o,"actions.ndjson");if(e.packTestDir){let i=$(e.packTestDir,"logs",`${n}-actions.ndjson`);if(H(i)){ae(i,s);continue}let u=le(le(e.packTestDir)),f=Te(e.packTestDir),S=H(u)?await z(u,`tests/${f}/logs/${n}-actions.ndjson`).catch(()=>null):null;de(s,S??"");continue}let d=[$(r,"run-test","actions.ndjson"),$(r,"actions.ndjson")],a=!1;for(let i of d)if(H(i)){ae(i,s),a=!0;break}a||de(s,"")}}import{existsSync as ue,readFileSync as fe,readdirSync as Ne}from"fs";import{join as F}from"path";function Ee(e){if(e.action_type!=="upload_files")return null;let t=e.action_params?.media;if(!t||typeof t!="object")return null;let n=a=>typeof t[a]=="string"?t[a]:"",r=n("media_id"),o=n("name"),s=n("media_url");if(!r||!o||!s)return null;let d=n("type")||"doc";return{media_id:r,name:o,media_url:s,type:d,alias:n("alias")}}function Le(e){let t=e.action_params?.file_paths,n=Array.isArray(t)?t[0]:t;return typeof n=="string"&&n.length>0?n:null}function Ue(e){let t={};for(let[n,r]of Object.entries(e??{}))t[n]={...r,refs:[...r.refs??[]]};return t}function Ke(e,t){if(!t)return!1;let n=t.endsWith("/")?t:t+"/";return e.startsWith(n)}function ce(e,t,n,r={}){let o=Ue(e);for(let s of t){let d=Ee(s);if(!d)continue;let a=o[d.media_id]??={name:d.name,media_url:d.media_url,type:d.type,refs:[],recorded_at:n,...d.alias?{alias:d.alias}:{}};a.recorded_at=n;let i=Le(s);if(!(!i||Ke(i,r.ignoreAliasUnder))){for(let[u,f]of Object.entries(o))u!==d.media_id&&(f.refs=f.refs.filter(S=>S!==i));a.refs.includes(i)||a.refs.push(i)}}return o}function ut(e){let t=e?.media;if(!t||typeof t!="object")return[];let n=[];for(let[r,o]of Object.entries(t)){if(!r||!o||typeof o!="object")continue;let s=o;typeof s.name!="string"||!s.name||typeof s.media_url!="string"||!s.media_url||n.push({media_id:r,name:s.name,media_url:s.media_url,type:typeof s.type=="string"&&s.type?s.type:"doc",refs:Array.isArray(s.refs)?s.refs.filter(d=>typeof d=="string"&&d.length>0):[],...typeof s.alias=="string"&&s.alias?{alias:s.alias}:{}})}return n}function Ce(e){let t=[];for(let n of e){let r;try{r=fe(n,"utf8")}catch{continue}for(let o of r.split(`
|
|
5
5
|
`)){let s=o.trim();if(s)try{let d=JSON.parse(s);d&&typeof d=="object"&&t.push(d)}catch{}}}return t}function V(e){try{return Ne(e,{withFileTypes:!0}).filter(t=>t.isDirectory()).map(t=>t.name).sort((t,n)=>t.localeCompare(n,void 0,{numeric:!0}))}catch{return[]}}function St(e){if(!e)return[];let t=[];for(let n of V(F(e,"runs")))for(let r of[F(e,"runs",n,"run-test","actions.ndjson"),F(e,"runs",n,"actions.ndjson")])if(ue(r)){t.push(r);break}return t}function me(e){let t=[],n=F(e,".internal","steps");for(let r of V(n)){let o=F(n,r,"flows");for(let s of V(o)){let d=F(o,s,"actions.ndjson");ue(d)&&t.push(d)}}return t}function We(e){try{let n=JSON.parse(fe(e,"utf8"))?.media;return n&&typeof n=="object"?n:void 0}catch{return}}function ge(e){let t=We(e.priorMetaPath),n=Ce(e.recordFiles),r=ce(t,n,e.now??new Date().toISOString(),{ignoreAliasUnder:e.ignoreAliasUnder??q});return Object.keys(r).length>0?r:void 0}import{existsSync as L,readdirSync as He}from"fs";import{dirname as Ve,join as O,basename as B}from"path";function wt(e,t){let n=[];return e.steps.forEach((r,o)=>{let s=t[o];r.block||!r.replayOnly||!s||s.kind!=="author"||n.push({flatIndex:r.flatIndex,file:r.owningFile,heading:r.trace[r.trace.length-1].heading,kind:r.replayOnly,reason:s.reason})}),n}function vt(e){let t=[],n=new Set,r=new Map;function o(i){if(r.has(i))return r.get(i);let u=v(i),f=L(u)?D(u):null;return r.set(i,f),f}let s=new Map;function d(i){if(s.has(i))return s.get(i);let u=O(i,"Result.md"),f=L(u)?D(u):null;return s.set(i,f),f}function a(i){for(let u=1;u<i.trace.length;u++){let f=i.trace[u-1],S=o(f.file);if(!S)continue;let m=S.steps[f.stepIndex-1];if(m){if(m.kind!=="import")return{kind:"author",reason:"structure-mismatch"};if(B(m.importPath)!==B(i.trace[u].file))return{kind:"author",reason:"structure-mismatch"};if(m.md5!=null&&m.md5!==f.rowMd5)return{kind:"author",reason:"structure-mismatch"}}}return null}for(let i of e.steps){let u=i.trace[i.trace.length-1].stepIndex,f=i.replayOnly;if(i.block){let g=o(i.owningFile)?.steps[u-1],j=i.controlFlow!==void 0,T=g?.kind==="objective"&&g.status==="skipped";if(j||T){t.push({kind:"replay",recordingDir:"",flowCount:0,unrecorded:!0,...f?{replayOnly:f}:{}});continue}}let S=n.has(i.owningFile);for(let g=0;g<i.trace.length-1&&!S;g++)n.has(i.trace[g].file)&&(S=!0);if(S&&!f){t.push({kind:"author",reason:o(i.owningFile)===null?"no-result-md":"downstream-of-divergence"});continue}let m=a(i);if(m){for(let g=0;g<i.trace.length;g++)n.add(i.trace[g].file);if(!f){t.push(m);continue}}let w=o(i.owningFile),I;if(w===null&&i.trace.length>1){let g=J(i.trace);I=he(i,d(g),u,g)}else I=he(i,w,u);if(f&&I.kind==="replay"&&(I={...I,replayOnly:f}),t.push(I),I.kind==="author"){n.add(i.owningFile);for(let g=0;g<i.trace.length-1;g++)n.add(i.trace[g].file)}}return t}function he(e,t,n,r=null){if(!t)return{kind:"author",reason:"no-result-md"};let o=t.steps[n-1];if(!o)return{kind:"author",reason:"no-result-md"};if(o.kind!=="objective")return{kind:"author",reason:"structure-mismatch"};if(o.status!=="passed")return{kind:"author",reason:"recorded-failed"};let s=E(e);if(s!==o.md5)return{kind:"author",reason:"md5-mismatch"};let d=r===null?ee(e.owningFile,n,s.slice(0,8)):O(r,".internal","steps",`${n}-${s.slice(0,8)}`),a=Be(d);return a===0?{kind:"author",reason:"missing-recording"}:{kind:"replay",recordingDir:d,flowCount:a}}function Be(e){let t=O(e,"flows");if(!L(t))return 0;let n;try{n=He(t,{withFileTypes:!0}).filter(o=>o.isDirectory()&&/^\d+$/.test(o.name)).map(o=>parseInt(o.name,10))}catch{return 0}if(n.length===0)return 0;let r=Math.max(...n);for(let o=0;o<=r;o++)if(!L(O(t,String(o),"actions.ndjson")))return 0;return r+1}function Pt(e){return e.some(t=>t.kind==="author")}function jt(e){for(let t=0;t<e.length;t++)if(e[t].kind==="author")return t;return e.length}function J(e){let t=s=>{let d=B(s);return d.endsWith("_test.md")?d.slice(0,-8):d.endsWith(".md")?d.slice(0,-3):d},n=t(e[0].file),r=t(e[e.length-1].file),o=e.slice(0,-1).map(s=>String(s.stepIndex));return O(Ve(e[e.length-1].file),`helper-output-${r}-${n}-${o.join("-")}`)}function Dt(e){return Array.from({length:e.flowCount},(t,n)=>O(e.recordingDir,"flows",String(n),"actions.ndjson"))}import{existsSync as ye,mkdirSync as Je,rmSync as Ge,cpSync as qe}from"fs";function Se(e,t){ye(e)&&(ye(t)&&Ge(t,{recursive:!0,force:!0}),Je(t,{recursive:!0}),qe(e,t,{recursive:!0}))}async function Vt(e){let t=new Map;for(let a of e.stepRunRecords)t.set(a.testmdStepIndex,a);let n=e.authoredFlatIdx??new Set,r=[],o=[],s=new Map,d=a=>{if(s.has(a))return s.get(a);let i=x(a,"Result.md"),u=P(i)?D(i):null;return s.set(a,u),u};for(let a of e.resolvedTest.unitFiles){let i=a.file===e.resolvedTest.rootPath,u=Q(a.file,ze(a.file,"utf8")),f=v(a.file),S=P(f)?D(f):null,m=[],w=[],I=[],g=[];if(!i)for(let p of e.resolvedTest.steps){if(p.owningFile!==a.file||p.trace.length<2)continue;let l=J(p.trace);g.includes(l)||g.push(l)}let j=p=>{if(S!==null)return null;for(let l of g){let M=d(l)?.steps[p-1];if(M)return{row:M,dir:l}}return null},T=[],U=!1,G=!1,K=!1,N=!1;for(let p of u.steps){let l=p.index,c=S?.steps[l-1];if(p.body.kind==="objective"){let h=e.resolvedTest.steps.filter(y=>y.owningFile===a.file&&y.trace[y.trace.length-1].stepIndex===l&&t.has(y.flatIndex)),R=h.length>0?h[h.length-1]:null;if(R){U=!0,n.has(R.flatIndex)&&(G=!0);let y=E(R),k;i?k=e.outcomes.find(we=>we.rootStepIndex===l)??{rootStepIndex:l,status:"skipped"}:k={rootStepIndex:l,status:be(R,e.outcomes)},k.status==="failed"&&(K=!0),k.stepMd5==null&&(k.stepMd5=y),m.push(k),w.push({stepIndex:l,md5:y,rec:t.get(R.flatIndex)}),(!c||c.kind!=="objective"||c.status!==k.status||k.status==="passed"&&c.md5!==y)&&(N=!0)}else if(c&&c.kind==="objective")m.push({rootStepIndex:l,status:c.status,...c.md5?{stepMd5:c.md5}:{}}),I.push(l);else if(!i&&j(l)?.row.kind==="objective"){let y=j(l),k=y.row;m.push({rootStepIndex:l,status:k.status,...k.md5?{stepMd5:k.md5}:{}}),T.push({psIdx:l,dir:y.dir})}else i?m.push(e.outcomes.find(y=>y.rootStepIndex===l)??{rootStepIndex:l,status:"skipped"}):m.push({rootStepIndex:l,status:"skipped"});continue}let M=Ze(p.body.path)?p.body.path:tt(Ye(a.file),p.body.path),_=te({path:p.body.path,bindings:p.body.bindings,optional:p.optional??!1}),C=et(X(a.file),v(M)),A=e.resolvedTest.steps.filter(h=>h.trace.some((R,y)=>y<h.trace.length-1&&R.file===a.file&&R.stepIndex===l)&&t.has(h.flatIndex));if(A.length>0){U=!0;let h;if(i)h=e.outcomes.find(R=>R.rootStepIndex===l)??{rootStepIndex:l,status:"passed",refKind:"import",refLabel:p.body.path};else{let R=A.some(y=>be(y,e.outcomes)==="failed");h={rootStepIndex:l,status:R?"failed":"passed",refKind:"import",refLabel:p.body.path,inlinedCount:A.length}}h.status==="failed"&&(K=!0),h.stepMd5==null&&(h.stepMd5=_),h.helperResultRelPath==null&&(h.helperResultRelPath=C),m.push(h),(!c||c.kind!=="import"||c.status!==h.status||c.md5!==_)&&(N=!0)}else if(c&&c.kind==="import")m.push({rootStepIndex:l,status:c.status,refKind:"import",refLabel:c.importPath,...c.md5?{stepMd5:c.md5}:{},...c.helperResultRelPath?{helperResultRelPath:c.helperResultRelPath}:{}});else if(!i&&j(l)?.row.kind==="import"){let h=j(l).row;m.push({rootStepIndex:l,status:h.status,refKind:"import",refLabel:p.body.path})}else i?m.push(e.outcomes.find(h=>h.rootStepIndex===l)??{rootStepIndex:l,status:"skipped",refKind:"import",refLabel:p.body.path}):m.push({rootStepIndex:l,status:"skipped",refKind:"import",refLabel:p.body.path})}if(!(i||U&&(G||K||S===null||N)))continue;r.push(a.file);let b=Y(a.file);Ie(x(b,".internal"),{recursive:!0});for(let p of w){let l=x(b,".internal","steps",`${p.stepIndex}-${p.md5.slice(0,8)}`);Ie(l,{recursive:!0}),await pe({sessionDir:e.sessionDir,runIndex:p.rec.runIndex,totalRunDirs:p.rec.totalRunDirs,stagingStepDir:l,packTestDir:e.packTestDir})}if(I.length>0){let p=Z(a.file);if(P(p))for(let l of ke(p)){let c=parseInt(l.split("-")[0]??"",10);!Number.isNaN(c)&&I.includes(c)&&xe(x(p,l),x(b,".internal","steps",l),{recursive:!0})}}for(let p of T){let l=x(p.dir,".internal","steps");if(P(l))for(let c of ke(l))parseInt(c.split("-")[0]??"",10)===p.psIdx&&xe(x(l,c),x(b,".internal","steps",c),{recursive:!0})}let Me=m.some(p=>p.status==="failed");if(oe({sourcePath:a.file,title:u.title,rootSteps:u.steps,outcomes:m,overallStatus:i?e.overallStatus:Me?"failed":"passed",startedISO:e.startedISO,durationS:i?e.durationS:0,sessionId:e.sessionId,outPath:x(b,"Result.md")}),i){let p={};e.commitId&&(p.commit_id=e.commitId),e.tmsIds.testId&&(p.test_id=e.tmsIds.testId),e.tmsIds.testcaseId&&(p.testcase_id=e.tmsIds.testcaseId),e.tmsIds.projectId&&(p.project_id=e.tmsIds.projectId),e.tmsIds.folderId&&(p.folder_id=e.tmsIds.folderId),e.tmsIds.orgId&&(p.org_id=e.tmsIds.orgId),e.tmsIds.sessionName&&(p.session_name=e.tmsIds.sessionName);let l=ge({priorMetaPath:W(a.file),recordFiles:me(b)});l&&(p.media=l);let c=ne(a.file);c&&(p.tc_id=c);let M=se(a.file);M&&(p.environment_id=M),Xe(x(b,".internal","meta.json"),JSON.stringify(p,null,2)+`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{L as c,r as d}from"./chunk-
|
|
2
|
+
import{L as c,r as d}from"./chunk-Z777GGHB.js";function u(a,e,t){let{ref:r,reason:o,by:s}=t;if(!o||o.trim().length===0)return{record:null,errors:[{code:"REASON_REQUIRED",detail:"archiving a node needs a reason \u2014 it becomes the tombstone's provenance"}]};let i=e.resolve(r);if(!i)return{record:null,errors:[{code:"UNKNOWN_REF",detail:`no node '${r}' in the graph`}]};let n=e.tipOf(i.cid);return e.superseded.has(n)?{record:null,errors:[{code:"ALREADY_ARCHIVED",detail:`${r} is already superseded at its tip (${n.slice(0,19)}\u2026)`}]}:{record:c(a,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:[],supersessions:[{kind:"node",old:n,new:null,reason:o,by:s}],source_head_moves:{}},{graph:e,expectPrev:e.latestHash,intent:{v:1,verb:"archive",args:d({ref:r,reason:o,by:s}),pins:{ref:n}},provenance:t.provenance}).record,errors:null}}export{u as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{i as U}from"./chunk-
|
|
2
|
+
import{i as U}from"./chunk-I2VU2DTS.js";import{g as S}from"./chunk-RLOJH5O6.js";import{a as E}from"./chunk-DBMW3VUN.js";var h=1,v=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;var L=["cites-deep"],C=["observe","events","refresh","check","tools","migrate"],d={remote:"fetch",explain:"explain",context:"context",coverage:"coverage"},x=class extends Error{remedy;constructor(a,p){super(a),this.name="SourcePluginRefusal",this.remedy=p}};var T=class extends Error{refusal;constructor(a){super(`${a.code}: ${a.message}${a.remedy?` \u2014 ${a.remedy}`:""}`),this.name="SourcePluginError",this.refusal=a}};function A(l){let a=l.manifest?.capabilities;return Array.isArray(a)?a:[]}var i=(l,a,p={})=>{throw new T({code:l,message:a,...p})},R="test-",O=new Set(["http","https","file"]),b=new Set(U.map(l=>l.name)),G=Object.values(d),$=/^([a-z][a-z0-9-]{1,31}):([\s\S]+)$/,_={plugins:[],byId:()=>{},route:()=>null},D=l=>/(\.[^./\\]+)$/.exec(l)?.[1]?.toLowerCase()??"";function Y(l,a={}){let p=new Set(S.flatMap(o=>o.extensions)),c=new Map,P=new Map,I=new Map;for(let o of l){let r=o?.manifest,e=typeof r?.id=="string"?r.id:"",t={plugin:e||"(no id)"};r?.contract!==h&&i("PLUGIN_CONTRACT_UNSUPPORTED",`plugin ${t.plugin} is written against contract ${String(r?.contract)}; this build has contract ${h}`,t),E.test(e)||i("PLUGIN_ID_INVALID",`${JSON.stringify(r.id)} is not a plugin id: lower-case letters, digits and hyphens, starting with a letter, 2 to 32 characters`,t),e.startsWith(R)&&a.allowTestPlugins!==!0&&i("PLUGIN_ID_RESERVED",`plugin ${e} is a test plugin: an id starting with ${R} is loaded by the conformance suite only`,t),O.has(e)&&i("PLUGIN_ID_TAKEN",`${e} cannot be a plugin id: it already means something at the start of an input`,t),b.has(e)&&i("PLUGIN_ID_TAKEN",`${e} cannot be a plugin id: it is the name of a built-in remote source kind`,t),(c.has(e)||I.has(e))&&i("PLUGIN_ID_TAKEN",`two loaded plugins use the name ${e}`,t),(typeof r.version!="string"||r.version==="")&&i("PLUGIN_ID_INVALID",`plugin ${e} names no version`,t),(typeof r.rules!="string"||r.rules==="")&&i("PLUGIN_RULES_MISSING",`plugin ${e} names no fingerprint-rules version`,t),r.capabilities!==void 0&&!Array.isArray(r.capabilities)&&i("PLUGIN_CAPABILITY_UNKNOWN",`plugin ${e}: capabilities must be a list of capability names`,t);let u=A(o);for(let n of u){if(L.includes(n))continue;if(!(n in d)){let N=C.includes(n);i("PLUGIN_CAPABILITY_UNKNOWN",`plugin ${e} lists the capability ${JSON.stringify(n)}, which ${N?"is reserved and not defined yet":"this contract does not define"}`,t)}let s=d[n];typeof o[s]!="function"&&i("PLUGIN_CAPABILITY_WITHOUT_HOOK",`plugin ${e} lists the capability ${n} and has no ${s} hook`,t)}u.includes("cites-deep")&&!(u.includes("context")&&typeof o.context=="function")&&i("PLUGIN_CITES_DEEP_WITHOUT_CONTEXT",`plugin ${e} lists the capability cites-deep without the capability context and its hook: the instruction to cite each criterion, scenario and test could never reach the design agent`,{...t,remedy:"list the context capability, with its hook, and say in its design note what each item should cite"});for(let n of G){let s=Object.entries(d).find(([,N])=>N===n)[0];o[n]!==void 0&&!u.includes(s)&&i("PLUGIN_HOOK_WITHOUT_CAPABILITY",`plugin ${e} has the hook ${n} and does not list the capability ${s}`,t)}for(let n of["claim","render","index"])typeof o[n]!="function"&&i("PLUGIN_CAPABILITY_WITHOUT_HOOK",`plugin ${e} has no ${n} hook, which every plugin needs`,t);let g=r.claims?.extensions??[];Array.isArray(g)||i("PLUGIN_EXTENSION_TAKEN",`plugin ${e} claims its extensions as ${JSON.stringify(g)}, which is not a list`,t);for(let n of g){(typeof n!="string"||!/^\.[a-z0-9][a-z0-9._-]*$/.test(n))&&i("PLUGIN_EXTENSION_TAKEN",`plugin ${e} claims ${JSON.stringify(n)}, which is not a file extension: lower-case, starting with a dot`,t);let s=n;s.lastIndexOf(".")!==0&&i("PLUGIN_EXTENSION_TAKEN",`plugin ${e} claims ${s}, which holds a second dot: an input's extension is what follows its last dot, so no input would ever be routed to it`,t),p.has(s)&&i("PLUGIN_EXTENSION_TAKEN",`plugin ${e} claims ${s}, which a built-in source kind already reads`,t),P.has(s)&&i("PLUGIN_EXTENSION_TAKEN",`plugin ${e} claims ${s}, which plugin ${P.get(s).manifest.id} already claims`,t),P.set(s,o)}let y=r.claims?.schemes??[];Array.isArray(y)||i("PLUGIN_SCHEME_TAKEN",`plugin ${e} claims its schemes as ${JSON.stringify(y)}, which is not a list`,t);for(let n of y){(typeof n!="string"||!E.test(n)||O.has(n))&&i("PLUGIN_SCHEME_TAKEN",`plugin ${e} claims the scheme ${JSON.stringify(n)}, which is not one a plugin may have`,t);let s=n;b.has(s)&&i("PLUGIN_SCHEME_TAKEN",`plugin ${e} claims the scheme ${s}, which is the name of a built-in remote source kind`,t),(I.has(s)||c.has(s)&&s!==e)&&i("PLUGIN_SCHEME_TAKEN",`plugin ${e} claims the scheme ${s}, which another loaded plugin already uses`,t),I.set(s,o)}c.set(e,o)}for(let[o,r]of I)A(r).includes("remote")||i("PLUGIN_SCHEME_WITHOUT_REMOTE",`plugin ${r.manifest.id} claims the scheme ${o} but has no remote capability, so it can never read a ${o}:// input`,{plugin:r.manifest.id});return c.size===0?_:{plugins:[...c.values()],byId:o=>c.get(o),route(o,r){let e=$.exec(o);if(e&&!r(o)){let u=I.get(e[1]);if(u)return{plugin:u,ref:o,named:!1};let g=c.get(e[1]);if(g)return{plugin:g,ref:e[2],named:!0}}let t=P.get(D(o));return t&&!/^https?:\/\//i.test(o)?{plugin:t,ref:o,named:!1}:null}}}var f=_,m,J=()=>f,j=()=>m;function q(l,a){if(f!==_)throw new Error("a source-plugin registry is already installed: a host installs its registry once");return f=l,m=a,()=>{f===l&&(f=_,m=void 0)}}export{v as a,x as b,T as c,A as d,i as e,_ as f,Y as g,J as h,j as i,q as j};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as ne}from"./chunk-WMGKUERB.js";import{a as y,b as ie,c as oe,d as le,e as ae}from"./chunk-
|
|
2
|
+
import{b as ne}from"./chunk-WMGKUERB.js";import{a as y,b as ie,c as oe,d as le,e as ae}from"./chunk-LNHBZEDC.js";import{a as F,b as x,c as D,d as ee,f as re,h as de,i as pe}from"./chunk-PL3SG3M2.js";import{a as se,d as te}from"./chunk-ZCIWQHCO.js";import{a as X,c as Y,d as Z}from"./chunk-CJE7PKRV.js";import{Ba as B,Ea as v,Ja as Q,Pa as w,Va as U,Xa as $,Ya as O,Za as b,_a as G,ab as J,fb as H,i as _,jb as z,kb as W,mb as R,nb as K,ob as T,t as I}from"./chunk-Z777GGHB.js";import{a as C}from"./chunk-7DFBOVUB.js";import{existsSync as Se,readFileSync as Ee}from"fs";import{join as Me}from"path";import{mkdirSync as be,readFileSync as Re,renameSync as Fe,writeFileSync as Ae}from"fs";import{dirname as A,join as M}from"path";function E(r,o){be(A(r),{recursive:!0});let s=M(A(r),`.${process.pid}.tmp`);Ae(s,o),Fe(s,r)}function ue(r){try{return JSON.parse(Re(r,"utf8"))}catch{return null}}function ce(r){let o=s=>M(A(y(r,s)),"verdicts.json");return{read:s=>ue(y(r,s)),write:(s,i)=>E(y(r,s),JSON.stringify(i,null,2)+`
|
|
3
3
|
`),writeReview:(s,i)=>E(M(A(y(r,s)),"review.json"),JSON.stringify(i,null,2)+`
|
|
4
4
|
`),verdicts:s=>ue(o(s))??{verdicts:{}},saveVerdicts:(s,i)=>E(o(s),JSON.stringify(i,null,2)+`
|
|
5
5
|
`)}}import{appendFileSync as fe,closeSync as qe,existsSync as V,openSync as Pe,readdirSync as Oe,readFileSync as ge,renameSync as Te,writeFileSync as he}from"fs";import{join as q}from"path";var me=".pending-facts.bad";function ye(r){let o=q(r,ie);return{quarantinePath:q(r,me),park:(s,i)=>{let l=null;try{l=w(r,{deadlineMs:i.deadlineMs})}catch{l=null}try{if(l)return fe(o,s+`
|
|
@@ -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{a as m}from"./chunk-
|
|
2
|
+
import{b as o,e as p}from"./chunk-XMPTFXPW.js";import{a as m}from"./chunk-RQKMSNEU.js";import{d,f as c}from"./chunk-2L3A5NKZ.js";import{Ia as a}from"./chunk-Z777GGHB.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};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{C,D as L,E as b,e as S}from"./chunk-
|
|
2
|
+
import{C,D as L,E as b,e as S}from"./chunk-Z777GGHB.js";import{m as c}from"./chunk-4I7YN6YY.js";function x(o){return o.replace(/\n$/,"").split(`
|
|
3
3
|
`).map((l,i)=>`${String(i+1).padStart(4,"0")}| ${l}`).join(`
|
|
4
4
|
`)}function T(o,d,l){if(!o.quote)return o;let i=C(l,o.anchor);if(i!==null&&L(o.quote,i))return o;let s=b(d,o.quote);if(s.length!==1)return"gone-or-ambiguous";let[{index:t,length:r}]=s,h=d.slice(0,t).split(`
|
|
5
5
|
`).length,e=d.slice(0,t+r).replace(/\n$/,"").split(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as I,c as L,e as _,f as B,g as V,h as P,i as $,k as H}from"./chunk-
|
|
2
|
+
import{b as I,c as L,e as _,f as B,g as V,h as P,i as $,k as H}from"./chunk-2GE5X2A5.js";import{Ua as M,qa as R,ra as k,ta as E,ua as F,va as N,xa as j}from"./chunk-Z777GGHB.js";import{i as w}from"./chunk-DBMW3VUN.js";import{l as y,m as v,n as C,o as b}from"./chunk-HHW6MRU3.js";function me(e){return{index:e,reverse:null,memo:new Map,nameOfMap:null,predecessors:null,fresh:null}}function he(e){e.reverse=null,e.nameOfMap=null,e.predecessors=null,e.fresh=null,e.memo.clear()}function Se(e,s){(s.edges??[]).length>0&&(e.reverse=null),e.nameOfMap=null,e.predecessors=null,e.fresh=null;for(let t of s.nodes??[])e.memo.delete(t.cid)}var Z=(e,s)=>{for(let t of s){let o=e.get(t.dst);o?o.push(t):e.set(t.dst,[t])}},Q=e=>{if(e.reverse===null){let s=new Map;for(let t of Object.values(e.index.forward))Z(s,t);e.reverse=s}return e.reverse},q=e=>{if(e.nameOfMap===null){e.nameOfMap=new Map;for(let[s,t]of Object.entries(e.index.names))e.nameOfMap.set(t,s)}return e.nameOfMap},m=(e,s)=>Object.prototype.hasOwnProperty.call(e,s),a=(e,s)=>e!==void 0&&m(e,s)?e[s]:void 0;function Oe(e,s){let t=(n,r)=>{if(n.memo.has(r))return n.memo.get(r);let i=m(n.index.nodeLabel,r)?s(r):null;return n.memo.set(r,i),i},o=n=>r=>m(n.index.superseded,r)?n.index.superseded[r]:void 0,d=(n,r)=>R(r,o(n)),p=(n,r)=>F(r,i=>q(n).get(i),i=>(n.predecessors??=E(Object.entries(n.index.superseded),l=>m(n.index.nodeLabel,l)?n.index.nodeLabel[l]:void 0)).get(i)),g=(n,r)=>{let i=k(r,{hasNode:l=>m(n.index.nodeLabel,l),cidOfName:l=>a(n.index.names,l),headOf:l=>a(n.index.heads,l)});return i===null?null:{cid:i,tip:d(n,i)}},c=(n,r)=>(r??[]).filter(i=>!m(n.index.superseded,i.ecid)),u=(n,r)=>c(n,a(n.index.forward,r)),x=(n,r)=>c(n,Q(n).get(r)),J=(n,r)=>(n.fresh??=w({supersededBy:o(n),edgesInto:i=>x(n,i),edgesFrom:i=>u(n,i),headOf:i=>a(n.index.heads,i),convChain:i=>a(n.index.conv,i)?.chain,pluginOf:i=>a(n.index.media,i)?.plugin}))(r),T=(n,r)=>N(r,o(n),()=>Object.entries(n.index.superseded),i=>a(n.index.nodeLabel,i));return{getNode:(n,r)=>t(e(r),n),labelOf:(n,r)=>a(e(r).index.nodeLabel,n)??null,trustOf:(n,r)=>a(e(r).index.trust,n)??null,supersededBy:(n,r)=>o(e(r))(n),tipOf:(n,r)=>d(e(r),n),headOf:(n,r)=>a(e(r).index.heads,n),mediaOf:(n,r)=>a(e(r).index.media,n)??null,nameOf:(n,r)=>p(e(r),n),assignedName:(n,r)=>q(e(r)).get(n)??null,cidOfName:(n,r)=>a(e(r).index.names,n)??null,edgesFrom:(n,r)=>u(e(r),n),edgesInto:(n,r)=>x(e(r),n),execHistory:(n,r)=>{let i=e(r),l=g(i,n);if(!l)return[];let h=T(i,l.cid),S=[];for(let[f,O]of Object.entries(i.index.exec??{}))h.has(f)&&S.push(...O);return S.sort((f,O)=>f.started_at<O.started_at?-1:f.started_at>O.started_at?1:0)},archivedReason:(n,r)=>a(e(r).index.archivedReason,n)??null,designFacts:(n,r)=>({generation:a(e(r).index.design_generation,n)??null}),completenessOf:(n,r)=>{let i=a(e(r).index.completeness,n);if(!i)return null;let{seq:l,...h}=i;return h},convChain:(n,r)=>a(e(r).index.conv,n)??null,byLabel:(n,r)=>Object.entries(e(r).index.nodeLabel).filter(([,i])=>i===n).map(([i])=>i),staleList:n=>{let r=e(n);return Object.keys(r.index.nodeLabel).map(i=>({cid:i,state:J(r,i)})).filter(i=>i.state!=="fresh")},allNames:n=>Object.entries(e(n).index.names).map(([r,i])=>({slug:r,cid:i})),extractedSources:n=>[...e(n).index.extracted],designOf:(n,r)=>a(e(r).index.design_of,n)??null,appliedEvent:(n,r)=>{let i=a(e(r).index.eventDigests,n);return i===void 0?null:{digest:i}},nodeIds:n=>Object.entries(e(n).index.nodeLabel).map(([r,i])=>({cid:r,label:i})),sourceIds:n=>Object.entries(e(n).index.heads).map(([r,i])=>({sourceId:r,head:i})),supersessions:n=>Object.entries(e(n).index.superseded).map(([r,i])=>({id:r,next:i})),retractedEdges:n=>{let r=e(n),i=r.index.edgeRetractions??{},l=[];for(let h of Object.values(r.index.forward))for(let S of h){let f=i[S.ecid];f&&l.push({edge:S,retraction:f})}return l},appliedEventsAt:n=>[...e(n).index.appliedEvents],factIds:(n,r)=>{let i=e(n).index,l=r==="trust"?i.trust:r==="archivedReason"?i.archivedReason:r==="designOf"?i.design_of??{}:r==="designGeneration"?i.design_generation??{}:r==="completeness"?i.completeness??{}:i.conv;return Object.keys(l)}}}import{readFileSync as U,rmdirSync as X}from"fs";import{join as D}from"path";function Y(e,s){return{persistCheckpoint:(t,o,d,p)=>V(e(t.state.sid),t,o,d,p),loadCheckpoint:t=>P(e(t),t,()=>s(t)),initCheckpoints:(t,o)=>_(e(t),o),hasBase:t=>e(t).read(I)!==null,gcOrphans:(t,o)=>H(e(t),o)}}function Fe(e){return{create:(s,t)=>y(e,s,t),resume:(s,t)=>v(e,s,t),peek:s=>C(e,s),list:()=>b(e),...Y(s=>L(e,s),s=>B(e,s)),appliedEvents:s=>$(e,s),recordCount:(s,t)=>M(e).records.filter(o=>o.sid===s&&o.seq<=t).length,isLive:s=>{try{let t=JSON.parse(U(D(e,"sessions",s,".lock"),"utf8"));return typeof t.pid=="number"&&j(t.pid)}catch{return!1}},tidy:()=>{try{X(D(e,"sessions"))}catch{}}}}import{existsSync as G,mkdirSync as A,readdirSync as ee,readFileSync as ne,writeFileSync as re}from"fs";import{dirname as te,join as K}from"path";var W=e=>`rationale/${e.startsWith("sha256:")?e.slice(7):e}.yaml`;function ie(e){let s=t=>{let o=e.read(t);return o===null?null:{text:o,where:e.where(t)}};return{override:t=>s(t),profiles:()=>e.list("profiles").filter(t=>t.endsWith(".yaml")||t.endsWith(".yml")).sort().map(t=>{let o=s(`profiles/${t}`);if(o===null)throw new Error(`the design profile ${e.where(`profiles/${t}`)} is listed but cannot be read`);return o}),writeRationale:(t,o)=>{let d=W(t);return e.write(d,o),e.where(d)},readRationale:t=>e.read(W(t))}}function se(e){let s=K(e,"design"),t=o=>K(s,...o.split("/"));return{read:o=>G(t(o))?ne(t(o),"utf8"):null,list:o=>G(t(o))?ee(t(o)):[],write:(o,d)=>{A(te(t(o)),{recursive:!0}),re(t(o),d)},where:t}}function Ie(e){return ie(se(e))}import{mkdirSync as oe,readFileSync as de,renameSync as ae,writeFileSync as le}from"fs";import{dirname as pe,join as ce}from"path";var ge=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function z(e,s,t,o){if(!ge.test(t))throw new Error(`the purpose ${JSON.stringify(t)} is not a plain name`);let d=o.slice(o.indexOf(":")+1);return ce(e,"embeddings",s,t,d.slice(0,2),`${d.slice(2)}.f32`)}function Ve(e){return{read(s,t,o){let d=z(e,s,t,o),p;try{p=de(d)}catch{return null}let g=new Float32Array(Math.floor(p.length/4));for(let c=0;c<g.length;c++)g[c]=p.readFloatLE(c*4);return g},write(s,t,o,d){let p=z(e,s,t,o);oe(pe(p),{recursive:!0});let g=Buffer.alloc(d.length*4);for(let u=0;u<d.length;u++)g.writeFloatLE(d[u],u*4);let c=`${p}.tmp`;le(c,g),ae(c,p)},prefetch:()=>{}}}function Pe(){let e=new Map,s=(t,o,d)=>`${t}
|
|
3
3
|
${o}
|
|
4
4
|
${d}`;return{read:(t,o,d)=>e.get(s(t,o,d))??null,write:(t,o,d,p)=>{e.set(s(t,o,d),p)},prefetch:()=>{}}}export{me as a,he as b,Se as c,Oe as d,Y as e,Fe as f,ie as g,Ie as h,Ve as i,Pe as j};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{h as w}from"./chunk-SXRHKXSE.js";import{a as h}from"./chunk-RZ4F3BHX.js";import{b as f}from"./chunk-
|
|
2
|
+
import{h as w}from"./chunk-SXRHKXSE.js";import{a as h}from"./chunk-RZ4F3BHX.js";import{b as f}from"./chunk-QMOGBKJM.js";import{mkdtemp as O,rm as $}from"fs/promises";import{createWriteStream as R}from"fs";import{Readable as U}from"stream";import{pipeline as F}from"stream/promises";import{tmpdir as T}from"os";import{basename as z,join as A}from"path";import{access as x,cp as P,mkdir as g,readdir as y,readFile as S,rename as I,rm as k,stat as b,writeFile as v}from"fs/promises";import{basename as D,join as d}from"path";function u(){return d(f,"mobile","apps")}function m(){return d(u(),"index.json")}function C(){return{readIndex:async()=>{try{let e=JSON.parse(await S(m(),"utf8"));return{apps:Array.isArray(e.apps)?e.apps:[]}}catch{return{apps:[]}}},writeIndex:async r=>{await g(u(),{recursive:!0});let e=`${m()}.tmp`;await v(e,JSON.stringify(r,null,2)),await I(e,m())},exists:async r=>{try{return await x(r),!0}catch{return!1}},copy:(r,e)=>P(r,e,{recursive:!0,force:!0}),remove:r=>k(r,{recursive:!0,force:!0}),sizeOf:async r=>{try{return(await b(r)).size}catch{return}},now:()=>new Date}}var c=class{deps;constructor(e={}){this.deps={...C(),...e}}async list(){let{apps:e}=await this.deps.readIndex();return[...e].sort((t,s)=>s.lastUsedAt.localeCompare(t.lastUsedAt))}async find(e){return(await this.deps.readIndex()).apps.find(t=>t.key===e)}async put(e){let t=await this.deps.readIndex(),s=t.apps.find(n=>n.key===e.key),a=this.deps.now().toISOString();if(s&&await this.deps.exists(s.path))return s.lastUsedAt=a,await this.deps.writeIndex(t),s;s&&(t.apps=t.apps.filter(n=>n.key!==e.key));let l=D(e.name??e.sourcePath),o=d(u(),e.key),p=d(o,l);await g(o,{recursive:!0}),await this.deps.copy(e.sourcePath,p);let i={key:e.key,path:p,name:l,source:e.source,...e.source==="local"?{originPath:e.sourcePath}:{},addedAt:a,lastUsedAt:a,...await this.deps.sizeOf(p).then(n=>n?{bytes:n}:{})};return t.apps=[...t.apps.filter(n=>n.key!==e.key),i],await this.deps.writeIndex(t),i}async exists(e){if(await this.deps.sizeOf(e.path)!==void 0)return!0;try{return await y(e.path),!0}catch{return!1}}async forget(e){let t=await this.deps.readIndex(),s=t.apps.find(a=>a.key===e);s&&(await this.deps.remove(s.path),t.apps=t.apps.filter(a=>a.key!==e),await this.deps.writeIndex(t))}async prune(){let e=await this.deps.readIndex(),t=[];for(let s of e.apps)if(await this.deps.sizeOf(s.path)!==void 0)t.push(s);else try{await y(s.path),t.push(s)}catch{}return t.length!==e.apps.length&&await this.deps.writeIndex({apps:t}),t}};var E=30*6e4,j=/^APP\d{6,}$/;function Y(r){return!!r&&j.test(r.trim())}function _(){return{store:new c,client:(r,e)=>new w(r,e),fetchToFile:async(r,e)=>{let t=await h(r,{method:"GET",signal:AbortSignal.timeout(E)});if(!t.ok)throw new Error(`Downloading the app failed: ${t.status} ${t.statusText}`);if(!t.body)throw new Error("Downloading the app failed: empty response body");await F(U.fromWeb(t.body),R(e))}}}async function Z(r,e={}){let t={..._(),...e},s=r.appId.trim(),a=await t.store.find(s);if(a&&await t.store.exists(a))return r.onProgress?.(`using the copy of ${a.name} already on this machine`),await t.store.put({key:s,sourcePath:a.path,source:"cloud",name:a.name}),{path:a.path,name:a.name,fromStore:!0};r.onProgress?.(`looking up ${s}\u2026`);let o=await t.client(r.baseUrl,r.auth).details(s);if(r.accepts&&!r.accepts.some(i=>o.name.toLowerCase().endsWith(i)))throw new Error(`${o.name} cannot run on this device \u2014 expected ${r.accepts.join(" or ")}.`);r.onProgress?.(`downloading ${o.name} \u2014 this can take a while, please wait\u2026`);let p=await O(A(T(),"kane-app-dl-"));try{let i=A(p,z(o.name));await t.fetchToFile(o.url,i);let n=await t.store.put({key:s,sourcePath:i,source:"cloud",name:o.name});return r.onProgress?.(`${o.name} is ready`),{path:n.path,name:n.name,fromStore:!1,details:o}}finally{await $(p,{recursive:!0,force:!0})}}export{c as a,Y as b,Z as c};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c as A,l as E}from"./chunk-
|
|
2
|
+
import{c as A,l as E}from"./chunk-JCSVBD4F.js";import{e as _,f as v}from"./chunk-6K5BEEAJ.js";import{a as P}from"./chunk-4QTH7VYE.js";import{mkdtempSync as N,rmSync as B}from"fs";import{tmpdir as U}from"os";import{join as D}from"path";function T(e){let o=Promise.resolve(),i=new Map,r=s=>{try{B(s,{recursive:!0,force:!0})}catch{}};function a(s){let f=o.then(async()=>{if(i.has(s))throw new Error(`chrome slot ${s} already acquired (one acquire per worker index)`);let c=N(D(U(),"kane-testrun-chrome-")),g;try{g=await e.launch({userDataDir:c,width:e.width,height:e.height,headless:e.headless})}catch(u){throw r(c),u}return i.set(s,{chrome:g,dataDir:c}),{cdpEndpoint:g.cdpEndpoint,release(){let u=i.get(s);if(u){i.delete(s);try{u.chrome.kill()}catch{}r(u.dataDir)}}}});return o=f.catch(()=>{}),f}return{acquire:a,killAll(){for(let[,s]of i){try{s.chrome.kill()}catch{}r(s.dataDir)}i.clear()}}}var x=4;function Y(e){let o=T(e);return{kind:"local",maxParallel:x,async acquire(i){let r=await o.acquire(i);return{cdpEndpoint:r.cdpEndpoint,release:async()=>{r.release()}}},async releaseAll(){o.killAll()},releaseAllSync(){o.killAll()}}}function $(e){return e.replace(/([?&]capabilities=)[^&\s'"]*/g,"$1<redacted>")}function S(e){let o=new Set;for(let r of e)!r||r.length<4||(o.add(r),o.add(encodeURIComponent(r)),o.add(JSON.stringify(r).slice(1,-1)),o.add(encodeURIComponent(JSON.stringify(r).slice(1,-1))));let i=[...o].sort((r,a)=>a.length-r.length);return r=>{let a=$(r);for(let s of i)a=a.split(s).join("<redacted>");return a}}function Q(e){let o=S(e);return i=>JSON.parse(o(JSON.stringify(i)))}import{spawnSync as M}from"child_process";var h=20,ne=["us","eu","mumbai","oregon"],j={stage:"wss://stage-cdp.lambdatestinternal.com",prod:"wss://cdp.lambdatest.com"};function se(e,o){if(!o)return j[e];if(e!=="prod")throw new Error(`--hps-region ${o}: regional HPS hosts are prod only; stage has one host`);return`wss://cdp-${o}.lambdatest.com`}function K(e,o,i,r){let a={user:o.username,accessKey:o.access_key,browserName:"Chrome"};return r&&(a.tunnel=!0,r.name&&(a.tunnelName=r.name)),`${e.replace(/\/+$/,"")}/kane-cli?capabilities=${encodeURIComponent(JSON.stringify(a))}&testId=${encodeURIComponent(i)}`}function ae(e,o,i){let r=new _(e,o.username,o.access_key);return{create:(a,s)=>r.createBrowserSession({...i(),worker_index:a,source:"explore"},{signal:s}),release:(a,s)=>r.endBrowserSession(a,{signal:s})}}var G=`
|
|
3
3
|
const ids = JSON.parse(process.env.KANE_HPS_IDS || "[]");
|
|
4
4
|
Promise.allSettled(ids.map((id) => fetch(process.env.KANE_HPS_FORGE + "/kane-cli/v1/browser-sessions/" + encodeURIComponent(id), {
|
|
5
5
|
method: "DELETE", headers: { Authorization: process.env.KANE_HPS_AUTH, Accept: "application/json" },
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
var e=class extends Error{constructor(
|
|
2
|
+
var e=class extends Error{constructor(r,i){super(r);this.code=i;this.name="AuthError"}};export{e as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{e as L}from"./chunk-
|
|
2
|
+
import{e as L}from"./chunk-DBTMKBHU.js";async function T(n,i,c){let[h,d,l,m,a]=await Promise.all([c.includes("source")?n.sources(i):Promise.resolve([]),c.includes("usecase")?n.nodes(i,"usecase"):Promise.resolve([]),c.includes("usecase")?n.stale(i):Promise.resolve([]),c.includes("scenario")?n.nodes(i,"scenario"):Promise.resolve([]),c.includes("test")?n.nodes(i,"test"):Promise.resolve([])]),o=new Set;for(let e of l.filter(s=>s.label==="scenario"&&(s.freshness==="stale"||s.freshness==="orphaned"))){let s=await n.mainNode(i,e.cid);for(let t of s.edgesOut)t.type==="belongs_to"&&t.other?.name&&(t.other.freshness==="superseded"||t.other.supersededBy)&&o.add(t.other.name)}let r=h.filter(e=>e.head!==null).map(e=>{let s=L(e.origin);return{id:e.sourceId,label:"source",title:e.sourceId,trust:"-",fresh:"fresh",upToDate:"yes",...s?{shown:s}:{}}}),R=d.map(e=>{let s=e.name??"-";if(e.trust==="archived")return{id:s,label:"usecase",title:e.title??"",trust:e.trust,fresh:"-",upToDate:"archived"};let t=e.name!==null&&o.has(e.name),u=e.freshness??"fresh",f=u==="stale"?"source_changed":u==="orphaned"?"source_removed":t?"tests_out_of_date":"yes";return{id:s,label:"usecase",title:e.title??"",trust:e.trust,fresh:u,...t?{testsFresh:"stale"}:{},upToDate:f}}),g=(e,s)=>e.map(t=>{let u=t.name??"-",f=t.title??"";if(t.trust==="archived")return{id:u,label:s,title:f,trust:t.trust,fresh:"-",upToDate:"archived"};let w=t.freshness??"fresh",b=w==="stale"?"designed_from_changed":w==="orphaned"?"source_removed":"yes";return{id:u,label:s,title:f,trust:t.trust,fresh:w,upToDate:b}}),y=g(m,"scenario"),_=g(a,"test"),v=e=>Number(/^[a-z]+-(\d+)$/i.exec(e.id)?.[1]??Number.MAX_SAFE_INTEGER),p=(e,s)=>v(e)-v(s)||e.title.localeCompare(s.title);return r.sort((e,s)=>e.id.localeCompare(s.id)),R.sort(p),y.sort(p),_.sort(p),[...r,...R,...y,..._]}async function P(n,i){let c=(await n.nodes(i,"test")).filter(a=>a.trust!=="archived"),h=new Set((await n.nodes(i,"scenario")).filter(a=>a.trust==="archived").map(a=>a.cid)),d=new Set;for(let a of c){let o=await n.mainNode(i,a.cid);for(let r of o.edgesOut)r.type==="automates"&&r.other!==null&&d.add(r.other.cid)}let l=new Set,m=new Set;for(let a of d){let o=await n.mainNode(i,a);for(let r=0;o.supersededBy!==null&&o.supersededBy!==""&&r<64;r++)o=await n.mainNode(i,o.supersededBy);if(!(o.supersededBy===""||m.has(o.cid))&&(m.add(o.cid),!h.has(o.cid)))for(let r of o.edgesOut)r.type==="belongs_to"&&r.other?.name&&l.add(r.other.name)}return l}export{T as a,P as b};
|
|
@@ -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.0";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}`,r="kane-cli",L=[{dir:t(s(),".claude","skills",r),agent:"Claude Code"},{dir:t(s(),".agents","skills",r),agent:"Codex CLI"},{dir:t(s(),".gemini","skills",r),agent:"Gemini CLI"}],I="https://dd-proxy.lambdatest.com/intake/kane-cli",R="https://kaneai-playground.lambdatest.io",E=9222,C=9230,v=t(a,"chrome-profiles"),o=t(a,"hints"),f=t(o,"state.json");function B(e){return t(o,`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 T(e,n="android"){return t(c,n==="ios"?`device-catalog-ios-${e}.json`:`device-catalog-${e}.json`)}var m="127.0.0.1",N=18392,k=18400,p="/callback";function O(e){return`http://${m}:${e}${p}`}var P="KANE CLI",D="*",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"}},M={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,I as i,R as j,E as k,C as l,v as m,f as n,B as o,S as p,T as q,m as r,N as s,k as t,p as u,O as v,P as w,D as x,H as y,M as z};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as p}from"./chunk-73Y6T2UK.js";import{Ha as l}from"./chunk-
|
|
2
|
+
import{a as p}from"./chunk-73Y6T2UK.js";import{Ha as l}from"./chunk-TLOYTGVT.js";import{c as u}from"./chunk-GGV336P5.js";import{existsSync as d,mkdirSync as m,readFileSync as j,rmSync as g,writeFileSync as y,statSync as I}from"fs";import{dirname as f,join as n}from"path";var o=n(".testmuai","assurance.json");function N(e,r=u()){let t={kind:"local",dir:p(e)},s=r.trim().replace(/\/+$/,"");if(!s)return t;let a=d(n(e,o));if(d(t.dir))return a?{kind:"refuse",code:"BOTH_STORES",refusal:l.bothStores(i(n(e,o))?.projectName??null)}:t;if(!a)return{kind:"pick",latticeUrl:s};let c=i(n(e,o));return c===null?{kind:"refuse",code:"PROJECT_FILE_UNREADABLE",refusal:l.linkUnreadable()}:{kind:"remote",latticeUrl:s,projectId:c.projectId,projectName:c.projectName}}function P(e){return i(n(e,o))?.lastUserId??null}function R(e,r){let t=i(n(e,o));t!==null&&t.lastUserId!==r&&S(e,{...t,lastUserId:r})}function i(e){try{let r=JSON.parse(j(e,"utf8"));return typeof r!="object"||r===null||Array.isArray(r)||typeof r.projectId!="string"||r.projectId===""||typeof r.projectName!="string"?null:{projectId:r.projectId,projectName:r.projectName,writtenBy:typeof r.writtenBy=="string"?r.writtenBy:"",...typeof r.lastUserId=="string"?{lastUserId:r.lastUserId}:{}}}catch{return null}}function O(e){try{return!I(n(e,f(o))).isDirectory()}catch{return!1}}function S(e,r){let t=n(e,o);m(f(t),{recursive:!0}),y(t,JSON.stringify(r,null,2)+`
|
|
3
3
|
`)}function A(e){g(n(e,o),{force:!0})}export{o as a,N as b,P as c,R as d,i as e,O as f,S as g,A as h};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as d}from"./chunk-73ZFOJOK.js";import{a as m}from"./chunk-
|
|
2
|
+
import{b as d}from"./chunk-73ZFOJOK.js";import{a as m}from"./chunk-HGVM2OZU.js";import{da as u}from"./chunk-Z777GGHB.js";function h(e,r){return`${e}:hold:${r}`}function g(e,r){let n=[],o=[];for(let i of e.use_cases){let c=i.matches_existing;c?.cid&&r.hasNode(c.cid)?n.push({ref:c.cid,expectedTip:r.tipOf(c.cid)}):o.push({tempRef:i.temp_ref,title:String(i.title??""),probeText:String(i.title??"")})}return{verb:"extract",ucTargets:n,newBuCandidates:o,sourcePins:[{source_id:e.source.source_id,source_cid:e.source.source_cid}],readBasis:e.read_basis??null}}async function b(e){let r=d(e.proposal),n=t=>r.passthrough.use_cases.filter(a=>{let l=a.matches_existing?.cid,s=l?t.resolve(l):null,p=s?t.tipOf(s.cid):null;return p!=null&&(e.matchUnreviewed===!0||(t.trust.get(p)??null)!=="derived")}),o=n(e.graph),i=new Set(o.map(t=>t.temp_ref));return{ok:(await m(e.ctx,{...g({...r.passthrough,use_cases:o},e.graph),eventIds:[h(e.sid,e.proposalId)]},t=>{let a={...r.passthrough,use_cases:n(t.graph).filter(p=>i.has(p.temp_ref))},l=new Map(a.use_cases.map(p=>[p.temp_ref,{resolution:"approved"}])),s=u({store:e.store,graph:t.graph,scope:t.scope,proposal:a,proposalId:e.proposalId,verdicts:l,by:e.by,autoName:!0,allowStaleBasis:!0,eventIds:t.eventIds("extract",1),...e.durable?{sid:t.sid}:{},probeHits:t.probeHits,...e.matchUnreviewed?{matchUnreviewed:!0}:{}});return s.errors!==null?{errors:s.errors}:{result:s,record:s.record}})).ok,skippedAttach:r.passthrough.use_cases.length-o.length}}export{h as a,g as b,b as c};
|