@testmuai/kane-cli 0.8.16 → 0.8.18
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-5JEEFY34.js → ChatSurface-SY7HJD46.js} +1 -1
- package/dist/{ChromeProfilePicker-6IVAYCWJ.js → ChromeProfilePicker-NCIURJK6.js} +1 -1
- package/dist/{CliFeedbackPrompt-K4IN7S6J.js → CliFeedbackPrompt-TTVW5COG.js} +1 -1
- package/dist/{CliUploadProgress-MI4H4LKT.js → CliUploadProgress-E3WEIF36.js} +1 -1
- package/dist/{ConfigView-CJY5MB6H.js → ConfigView-ZY37EGAO.js} +1 -1
- package/dist/EvidenceViewOffer-6KT64W7L.js +2 -0
- package/dist/FolderPicker-MPLLN4VP.js +2 -0
- package/dist/{InfoBox-RP6RDCG7.js → InfoBox-JP3TTPIO.js} +1 -1
- package/dist/{LinksBox-QOQJ3S2I.js → LinksBox-4ZB7G5ET.js} +1 -1
- package/dist/{ProfilesView-BZEBT6R5.js → ProfilesView-25AXMCKS.js} +1 -1
- package/dist/{ProjectPicker-J42MEJRQ.js → ProjectPicker-RL3LXLTV.js} +1 -1
- package/dist/{SaveSessionPrompt-MKAIUVX7.js → SaveSessionPrompt-5W4ATISN.js} +1 -1
- package/dist/SingleShotApp-JV64B4XL.js +2 -0
- package/dist/{SummaryBox-JQJKGYDM.js → SummaryBox-GW4XAX5T.js} +1 -1
- package/dist/TestMdRunView-7N6QXMNR.js +2 -0
- package/dist/{TestrunEvidenceTable-FYDS3ZVU.js → TestrunEvidenceTable-SYCFAGM4.js} +1 -1
- package/dist/WhoamiView-H2DRYRRA.js +2 -0
- package/dist/{app-download-RA4CGTC5.js → app-download-2IZ4GPTA.js} +1 -1
- package/dist/{auth-TAT427C3.js → auth-6PKLNV6Z.js} +1 -1
- package/dist/{binary-OFPMBJ34.js → binary-OMBH4UTI.js} +1 -1
- package/dist/{bind-LY362KX7.js → bind-IHLHM5UM.js} +4 -4
- package/dist/bootstrap-UKZX3LRC.js +2 -0
- package/dist/bridge-KJNDGKPU.js +2 -0
- package/dist/{changelog-ZC3LHV2Z.js → changelog-ZWOIODQ4.js} +1 -1
- package/dist/chat-committer-6D7AQI6Z.js +2 -0
- package/dist/chat-controller-UJQ6Z4RE.js +2 -0
- package/dist/{chunk-OYY566GN.js → chunk-2KYJOBNI.js} +1 -1
- package/dist/{chunk-C6JFTSIQ.js → chunk-2LKSDGWA.js} +1 -1
- package/dist/chunk-3UI5VTQS.js +4 -0
- package/dist/chunk-3VAU3PNU.js +2 -0
- package/dist/{chunk-UAFCBZ3P.js → chunk-47FQ7ZUQ.js} +1 -1
- package/dist/{chunk-5VZAWKDF.js → chunk-4ANRRDC7.js} +1 -1
- package/dist/{chunk-KYZKPNPQ.js → chunk-4B3EHSTD.js} +1 -1
- package/dist/{chunk-NPKB7EK3.js → chunk-4BKSQFEP.js} +1 -1
- package/dist/{chunk-ICUTARPB.js → chunk-4JRCAHHB.js} +1 -1
- package/dist/{chunk-FQFVAFWK.js → chunk-4R5U7CHE.js} +1 -1
- package/dist/{chunk-QMZLIHBS.js → chunk-5B2NEYHF.js} +2 -2
- package/dist/{chunk-HYCOX7AB.js → chunk-5NZUMWUD.js} +2 -2
- package/dist/chunk-5RJ2J5QU.js +6 -0
- package/dist/{chunk-Q7LZ5QJV.js → chunk-5WUDW6BG.js} +1 -1
- package/dist/{chunk-GX3FPJUG.js → chunk-63DYVWNX.js} +1 -1
- package/dist/{chunk-ECIGXPLN.js → chunk-6FEEYKSE.js} +1 -1
- package/dist/{chunk-NN6UG2BE.js → chunk-6OIC4S3C.js} +1 -1
- package/dist/{chunk-2GWMENG5.js → chunk-6VB4FGBZ.js} +1 -1
- package/dist/{chunk-AAT4O22C.js → chunk-7BMM5DFP.js} +1 -1
- package/dist/{chunk-WPNNRMTP.js → chunk-7DSZ2YSD.js} +1 -1
- package/dist/{chunk-AHXOKBVE.js → chunk-7N6OCHPC.js} +1 -1
- package/dist/{chunk-OUWOLCCS.js → chunk-7PLIZBXB.js} +1 -1
- package/dist/{chunk-W4Y3PG7F.js → chunk-7ZKVI4US.js} +1 -1
- package/dist/chunk-7ZSHB3AN.js +2 -0
- package/dist/{chunk-7O54QURK.js → chunk-AACQE24F.js} +1 -1
- package/dist/{chunk-NADKZKGS.js → chunk-AK7BMF5T.js} +1 -1
- package/dist/{chunk-3MVEGB2I.js → chunk-ALHCB3LL.js} +1 -1
- package/dist/chunk-BXM5GDIO.js +8 -0
- package/dist/{chunk-VATOIZYG.js → chunk-C3GDK2OS.js} +5 -5
- package/dist/{chunk-J2LWXO55.js → chunk-CHA75LBJ.js} +1 -1
- package/dist/{chunk-JQW2QFSX.js → chunk-D6E6KRVX.js} +1 -1
- package/dist/chunk-D7WG7SRA.js +2 -0
- package/dist/chunk-DDLEZGZB.js +3 -0
- package/dist/chunk-DH3H6GWD.js +2 -0
- package/dist/{chunk-IYOPWIG4.js → chunk-DKPRWI7U.js} +2 -2
- package/dist/{chunk-H6S7L2I2.js → chunk-EA2LT5OJ.js} +1 -1
- package/dist/{chunk-4LVZLLTN.js → chunk-EHOYD6VL.js} +3 -3
- package/dist/{chunk-XGL3RSI5.js → chunk-EJBJ7MYC.js} +1 -1
- package/dist/{chunk-CDWUZ54U.js → chunk-EKZI5HZV.js} +1 -1
- package/dist/chunk-EVFFDODK.js +5 -0
- package/dist/{chunk-UEG4LJD6.js → chunk-EW3KRQGF.js} +1 -1
- package/dist/{chunk-GCMJDOAE.js → chunk-EYVHPJLK.js} +1 -1
- package/dist/{chunk-3IXEARDX.js → chunk-F2OBORCG.js} +1 -1
- package/dist/{chunk-ULGFPKC7.js → chunk-F3IWJ73B.js} +1 -1
- package/dist/chunk-FY7TCYPK.js +6 -0
- package/dist/{chunk-ZLIYWELJ.js → chunk-G76O7C56.js} +1 -1
- package/dist/{chunk-23MVD7GY.js → chunk-GESZSIB6.js} +1 -1
- package/dist/{chunk-WML5KSGQ.js → chunk-GUFIE3Z2.js} +1 -1
- package/dist/{chunk-O3ZKP4DY.js → chunk-H5N25XIT.js} +1 -1
- package/dist/{chunk-HBMNUT6E.js → chunk-H7A4R7WY.js} +1 -1
- package/dist/{chunk-O3XBIURC.js → chunk-HS7OIRGU.js} +1 -1
- package/dist/{chunk-EMAKLNDV.js → chunk-IFQD53QB.js} +1 -1
- package/dist/{chunk-BY2MU3ZS.js → chunk-IGLCR4J2.js} +1 -1
- package/dist/chunk-IICT4VOU.js +2 -0
- package/dist/{chunk-SWTJMTBY.js → chunk-IPQAKIJO.js} +1 -1
- package/dist/{chunk-TGBXIV7O.js → chunk-IQCW5SV5.js} +1 -1
- package/dist/chunk-J3OGBEEP.js +2 -0
- package/dist/{chunk-4PWYSDZR.js → chunk-JMWRMDSI.js} +1 -1
- package/dist/chunk-JQ64X2TO.js +2 -0
- package/dist/chunk-K2UJYY2U.js +2 -0
- package/dist/{chunk-ALCE5RLK.js → chunk-KDNNMU7Q.js} +1 -1
- package/dist/chunk-KJQNAOOE.js +6 -0
- package/dist/{chunk-V4JR5JCK.js → chunk-L4U7NP5Q.js} +1 -1
- package/dist/{chunk-G2ZMNVYN.js → chunk-LHU6TEKD.js} +1 -1
- package/dist/{chunk-U466V5JN.js → chunk-LQMA6N5S.js} +1 -1
- package/dist/chunk-LSDWPG6C.js +2 -0
- package/dist/{chunk-AGKE5WF3.js → chunk-MMLYJDXO.js} +1 -1
- package/dist/{chunk-BK42G6RI.js → chunk-MSLYSXGM.js} +1 -1
- package/dist/{chunk-Z2GDSCPS.js → chunk-MVOO7RPO.js} +1 -1
- package/dist/{chunk-QXUPBIV3.js → chunk-N4HKQTD5.js} +36 -36
- package/dist/{chunk-OPL2MIQG.js → chunk-NJ4BXZBX.js} +1 -1
- package/dist/{chunk-CVNHUDT4.js → chunk-NXZPWMK5.js} +1 -1
- package/dist/{chunk-IQDZ6YMY.js → chunk-NYP7QV54.js} +1 -1
- package/dist/{chunk-ZYEFWJNZ.js → chunk-OVL4WXGF.js} +1 -1
- package/dist/{chunk-IJTSA34Q.js → chunk-PMBQU63H.js} +1 -1
- package/dist/{chunk-TBYYPGHF.js → chunk-PVJB7CVS.js} +1 -1
- package/dist/{chunk-TU6IMGWO.js → chunk-Q4YYAN6E.js} +1 -1
- package/dist/{chunk-55YDTPB7.js → chunk-Q6F23V7L.js} +1 -1
- package/dist/chunk-QSCXXNC2.js +2 -0
- package/dist/{chunk-E44OHYDS.js → chunk-QX5LJVTD.js} +2 -2
- package/dist/{chunk-BCJNIDS3.js → chunk-RBVLIMOV.js} +1 -1
- package/dist/{chunk-3N6IAVD5.js → chunk-RDHWNSDP.js} +1 -1
- package/dist/{chunk-TCAHDVII.js → chunk-RRY5IXOB.js} +1 -1
- package/dist/{chunk-7QUFOWMU.js → chunk-SBQUEGTP.js} +1 -1
- package/dist/{chunk-YCH7H7JX.js → chunk-SEEEGDVK.js} +1 -1
- package/dist/{chunk-MD3S2RXN.js → chunk-SYKS57PK.js} +1 -1
- package/dist/{chunk-6HCY5LJO.js → chunk-TG4GGP3H.js} +3 -3
- package/dist/{chunk-CR7UWQ76.js → chunk-TSNQLZE3.js} +1 -1
- package/dist/{chunk-VOTIGXQ4.js → chunk-U2LDPUDZ.js} +1 -1
- package/dist/chunk-U6OTFMIT.js +4 -0
- package/dist/{chunk-7P6FSGRD.js → chunk-UAEU5IPH.js} +2 -2
- package/dist/{chunk-FYJ62EVY.js → chunk-UE5EYEFI.js} +1 -1
- package/dist/{chunk-F2XTOZTN.js → chunk-UQ6A52ML.js} +1 -1
- package/dist/{chunk-GGD7NKPL.js → chunk-UUS5AK6L.js} +2 -2
- package/dist/{chunk-52WM3XYO.js → chunk-V4B5QA3U.js} +1 -1
- package/dist/{chunk-5ACSALRU.js → chunk-VH73F65W.js} +2 -2
- package/dist/chunk-VIO7CCFW.js +5 -0
- package/dist/{chunk-IE3OO5GI.js → chunk-VVOKM2VO.js} +1 -1
- package/dist/{chunk-KPL2XHYF.js → chunk-WAZUOA3Y.js} +1 -1
- package/dist/chunk-WESMQEPO.js +2 -0
- package/dist/{chunk-Z5DGFN7R.js → chunk-WQV5SM5P.js} +1 -1
- package/dist/{chunk-SF5QPR6T.js → chunk-WTAJTPI5.js} +1 -1
- package/dist/{chunk-KZG4E5RM.js → chunk-WVHMPIDQ.js} +1 -1
- package/dist/{chunk-MZYPDLD3.js → chunk-WWVHK7OA.js} +1 -1
- package/dist/chunk-XLSOQLVT.js +2 -0
- package/dist/{chunk-Z4KRSLAM.js → chunk-XYMUKOKK.js} +1 -1
- package/dist/{chunk-WECVT7WE.js → chunk-YAUR5CBH.js} +1 -1
- package/dist/{chunk-PDTFQGQF.js → chunk-YNOADDF7.js} +1 -1
- package/dist/{chunk-U7BVK5IX.js → chunk-YPEIPCQY.js} +1 -1
- package/dist/{chunk-3LXN6AV5.js → chunk-YVKNKK22.js} +1 -1
- package/dist/chunk-ZARM7ESN.js +368 -0
- package/dist/chunk-ZLWURCJ7.js +2 -0
- package/dist/{chunk-MU3I453X.js → chunk-ZMM3Y6U7.js} +1 -1
- package/dist/{chunk-DSWHEEHN.js → chunk-ZO75BQ3Z.js} +1 -1
- package/dist/{chunk-IZ5CTC6M.js → chunk-ZV5KM7LI.js} +1 -1
- package/dist/{chunk-TWZ6NZWE.js → chunk-ZW3JBY5E.js} +4 -4
- package/dist/committer-2QPBANRD.js +2 -0
- package/dist/{config-WETHR632.js → config-ODCFEOAN.js} +1 -1
- package/dist/cover-cmd-AQ7PWJRH.js +3 -0
- package/dist/{credentials-RQPAP5KY.js → credentials-MUZUCSJJ.js} +1 -1
- package/dist/{deps-bundle-F47ZDYIM.js → deps-bundle-7COKI7UV.js} +1 -1
- package/dist/{deps-resolve-URKD4QCB.js → deps-resolve-ADN7P5L7.js} +1 -1
- package/dist/descriptor-3JJUOHBM.js +2 -0
- package/dist/design-committer-D44GSUXY.js +2 -0
- package/dist/dispatch-V24LFEAO.js +2 -0
- package/dist/{doctor-J44UKALC.js → doctor-3BRZM4EW.js} +1 -1
- package/dist/{docx-convert-WPZS6OIC.js → docx-convert-SQRTF7XS.js} +1 -1
- package/dist/{dossier-UGJMYYAB.js → dossier-7HVC6BNK.js} +1 -1
- package/dist/evidence-EBD3FIXA.js +2 -0
- package/dist/evolve-cmd-IR7UGOD2.js +2 -0
- package/dist/{explain-H5HJEDEF.js → explain-NEFBUX5G.js} +1 -1
- package/dist/{explain-cmd-R45I5MT7.js → explain-cmd-ENSJNQK7.js} +1 -1
- package/dist/{explain-cmd-USGRZFBY.js → explain-cmd-NNYKSAQK.js} +1 -1
- package/dist/{extract-bind-X4QRQX53.js → extract-bind-2GGLO5KU.js} +3 -3
- package/dist/{extract-cmd-RKEE32FN.js → extract-cmd-2BQJ2HNT.js} +2 -2
- package/dist/feeder-66TUPB2R.js +2 -0
- package/dist/gaps-cmd-Y6CZUCIX.js +3 -0
- package/dist/{gate-E3BLIUEA.js → gate-OYRDJMF6.js} +1 -1
- package/dist/{generate-headless-LSQHOR3G.js → generate-headless-SPGLBRH5.js} +2 -2
- package/dist/index.js +155 -158
- package/dist/ingest-OSNNM3DH.js +2 -0
- package/dist/ingest-cmd-N37FGNP5.js +2 -0
- package/dist/install-2PUHCC2Y.js +2 -0
- package/dist/interactive-bind-ZLO6S2SG.js +26 -0
- package/dist/lifecycle-cmd-6TWIQCKR.js +2 -0
- package/dist/list-cmd-NDD2OSP5.js +3 -0
- package/dist/{list-commands-Q77CAQJ2.js → list-commands-AARQ2RZG.js} +1 -1
- package/dist/logical-ids-GLVM2SVR.js +2 -0
- package/dist/login-flow-V4US6VQP.js +2 -0
- package/dist/maintenance-cmd-4QUVSGUY.js +2 -0
- package/dist/{mobile-prompts-PPPPKRS2.js → mobile-prompts-GYJS5BYX.js} +1 -1
- package/dist/{objective-variable-gate-BCKULIFQ.js → objective-variable-gate-FUVNHKRA.js} +1 -1
- package/dist/open-provider-QTPN6XOL.js +2 -0
- package/dist/{pdf-convert-5H4HQNN3.js → pdf-convert-RLXSXFWN.js} +1 -1
- package/dist/{persist-recorded-session-MK4HCDOY.js → persist-recorded-session-UFK5VC7S.js} +1 -1
- package/dist/phase-seed-H7KXNQO6.js +2 -0
- package/dist/pipeline-Z477UOXV.js +2 -0
- package/dist/prepare-target-IES7FXJG.js +2 -0
- package/dist/readmodel-FVLRQWZ7.js +2 -0
- package/dist/reconcile-cmd-NDLEM54D.js +2 -0
- package/dist/reconcile-deps-APR2LE3C.js +4 -0
- package/dist/reconcile-engine-C72AP4WS.js +2 -0
- package/dist/recording-banner-AZOKNSU3.js +2 -0
- package/dist/{records-TJJJWBUD.js → records-LMCVKPE5.js} +1 -1
- package/dist/registry-W3BMHQDQ.js +2 -0
- package/dist/{require-project-folder-ZLKONKKP.js → require-project-folder-LTVPPY3Q.js} +1 -1
- package/dist/{resolve-run-intent-3SXUS676.js → resolve-run-intent-XX6O3RYT.js} +1 -1
- package/dist/{resolver-G7NGWACO.js → resolver-XMASFMID.js} +1 -1
- package/dist/revert-NOUECRW4.js +2 -0
- package/dist/review-cmd-4TNBQDJU.js +5 -0
- package/dist/run-EOIV3OQE.js +2 -0
- package/dist/run-XXA7ILIM.js +2 -0
- package/dist/run-test-md-GVRVMPRZ.js +17 -0
- package/dist/{sessions-cmd-DV442ZCY.js → sessions-cmd-IV25N2L7.js} +1 -1
- package/dist/skill-installer-AWQT3LM2.js +3 -0
- package/dist/{spawner-H6IDWY5U.js → spawner-O3VKHYUY.js} +1 -1
- package/dist/store-guard-MHWBXA4C.js +2 -0
- package/dist/{structured-answers-NADW6D44.js → structured-answers-3C2DCFFF.js} +1 -1
- package/dist/sync-cmd-P2CL6YA6.js +2 -0
- package/dist/sync-setup-JY4T2X3M.js +2 -0
- package/dist/tcg-generate-GWLHZYLF.js +2 -0
- package/dist/testmd-actions-SYMNRTK4.js +2 -0
- package/dist/{testmd-sync-2CXNIPJ7.js → testmd-sync-IRV44CGT.js} +1 -1
- package/dist/token-refresh-IM6ELK6S.js +2 -0
- package/dist/{validate-basic-MN5NDCT2.js → validate-basic-A5TEMJNT.js} +1 -1
- package/dist/{variable-receipt-SIABUC74.js → variable-receipt-QDP2S5CQ.js} +1 -1
- package/dist/verdicts-H755EUQL.js +2 -0
- package/dist/{version-check-TDGK5REB.js → version-check-26W5GVBQ.js} +1 -1
- package/dist/{view-cmd-RLO7AP4X.js → view-cmd-D3BYBDZE.js} +1 -1
- package/dist/walk-session-ZZ26LEQE.js +2 -0
- package/dist/with-telemetry-UE6SYQWL.js +2 -0
- package/package.json +11 -11
- package/dist/EvidenceViewOffer-ABKTGD4K.js +0 -2
- package/dist/FolderPicker-RQIVS7ZR.js +0 -2
- package/dist/SingleShotApp-TZZ2J7ZO.js +0 -2
- package/dist/TestMdRunView-2YVGGFLU.js +0 -2
- package/dist/WhoamiView-F4PPB7SN.js +0 -2
- package/dist/bootstrap-RCDB5OWA.js +0 -2
- package/dist/bridge-E2NGMJYM.js +0 -2
- package/dist/chat-committer-HDE3TP5I.js +0 -2
- package/dist/chat-controller-3EPK7UZG.js +0 -2
- package/dist/chunk-3AVBUEBL.js +0 -8
- package/dist/chunk-4PMZ5FCD.js +0 -2
- package/dist/chunk-4WEVTED6.js +0 -3
- package/dist/chunk-7XMDCGIZ.js +0 -3
- package/dist/chunk-AKX4VRRR.js +0 -2
- package/dist/chunk-CRZUBDJ3.js +0 -6
- package/dist/chunk-FFVNISYH.js +0 -2
- package/dist/chunk-FWPRUGJJ.js +0 -368
- package/dist/chunk-GP7WD4UY.js +0 -4
- package/dist/chunk-HOA4VWSD.js +0 -5
- package/dist/chunk-JUJ4SAGH.js +0 -2
- package/dist/chunk-L2TV4G56.js +0 -4
- package/dist/chunk-NMBFAIXZ.js +0 -2
- package/dist/chunk-O25AL4B7.js +0 -5
- package/dist/chunk-RCYYE6ED.js +0 -2
- package/dist/chunk-TNBF5OMZ.js +0 -2
- package/dist/chunk-UHT5SVP5.js +0 -2
- package/dist/chunk-VWOAEF7J.js +0 -2
- package/dist/chunk-YMLC55J4.js +0 -2
- package/dist/chunk-YYYQ5MVD.js +0 -6
- package/dist/committer-IYQPXG6C.js +0 -2
- package/dist/cover-cmd-J3CTQT3R.js +0 -3
- package/dist/descriptor-PWUUNYV7.js +0 -2
- package/dist/design-committer-J57IAAA5.js +0 -2
- package/dist/dispatch-KOZAJQDW.js +0 -2
- package/dist/evidence-KRNDKDCT.js +0 -2
- package/dist/evolve-cmd-CEYGGIWA.js +0 -2
- package/dist/feeder-RSHMGW6B.js +0 -2
- package/dist/gaps-cmd-WL6P6YKS.js +0 -3
- package/dist/ingest-QGLVY7ND.js +0 -2
- package/dist/ingest-cmd-TQ4ARSDE.js +0 -2
- package/dist/install-47CRHVU6.js +0 -2
- package/dist/interactive-bind-FPC4RYEW.js +0 -26
- package/dist/lifecycle-cmd-DB5EFO2O.js +0 -2
- package/dist/list-cmd-UWGJRGKF.js +0 -3
- package/dist/logical-ids-DN6IZSUM.js +0 -2
- package/dist/login-flow-RSNR5HY2.js +0 -2
- package/dist/maintenance-cmd-EJ2RAMWB.js +0 -2
- package/dist/open-provider-XIGABCD3.js +0 -2
- package/dist/phase-seed-HKJ2EF7R.js +0 -2
- package/dist/pipeline-XDWHEZ5S.js +0 -2
- package/dist/prepare-target-NR3MTLLI.js +0 -2
- package/dist/readmodel-IBFRM6EO.js +0 -2
- package/dist/reconcile-cmd-VJPEY7YD.js +0 -2
- package/dist/reconcile-deps-T5YX6HRG.js +0 -4
- package/dist/reconcile-engine-GELPXSLV.js +0 -2
- package/dist/recording-banner-3ET3PMSV.js +0 -3
- package/dist/registry-3XMA4FOC.js +0 -2
- package/dist/revert-6BBBK3I4.js +0 -2
- package/dist/review-cmd-6DNGXV5E.js +0 -5
- package/dist/run-MUVZVTTC.js +0 -2
- package/dist/run-UJLRTKTO.js +0 -2
- package/dist/run-test-md-RI5RXVFU.js +0 -17
- package/dist/skill-installer-CAO2NJZP.js +0 -3
- package/dist/store-guard-PIA2DYZX.js +0 -2
- package/dist/sync-cmd-VFVTFIIJ.js +0 -2
- package/dist/sync-setup-R7BZDE24.js +0 -2
- package/dist/tcg-generate-QADJKNYZ.js +0 -2
- package/dist/testmd-actions-EXSVQRHQ.js +0 -2
- package/dist/token-refresh-5TVNSL4U.js +0 -2
- package/dist/verdicts-ZXXBKTOZ.js +0 -2
- package/dist/walk-session-ATWNUGHX.js +0 -2
- package/dist/with-telemetry-CLSDKQAG.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{e as z}from"./chunk-EHN5HTUD.js";import{b as X,c as v,e as W,i as Y,j as Z,k as ee,l as te,m as E,o as ne}from"./chunk-L45HDSJ7.js";import{a as Q}from"./chunk-CAOZKSQ3.js";import{d as q}from"./chunk-
|
|
2
|
+
import{e as z}from"./chunk-EHN5HTUD.js";import{b as X,c as v,e as W,i as Y,j as Z,k as ee,l as te,m as E,o as ne}from"./chunk-L45HDSJ7.js";import{a as Q}from"./chunk-CAOZKSQ3.js";import{d as q}from"./chunk-UQ6A52ML.js";import{copyFileSync as Se,cpSync as Re,existsSync as P,mkdirSync as xe,readFileSync as qe,readdirSync as Ie,rmSync as ze,writeFileSync as Qe}from"fs";import{dirname as Xe,isAbsolute as Ye,join as R,relative as Ze,resolve as et}from"path";import{writeFileSync as we,mkdirSync as ve,readFileSync as Pe}from"fs";import{dirname as je,basename as se}from"path";function ie(e){let t=e.outPath??v(e.sourcePath);ve(je(t),{recursive:!0});let n=[];n.push("---"),n.push(`test: ../${se(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??se(e.sourcePath)} \u2014 Result`,"");for(let r=0;r<e.rootSteps.length;r++){let o=e.rootSteps[r],s=e.outcomes.find(l=>l.rootStepIndex===r+1);if(n.push(De(o,s)),s?.stepMd5&&n.push(`md5: ${s.stepMd5}`),s?.status==="failed"&&s.reason&&n.push(`Reason: ${s.reason}`),s?.softFailures?.length)for(let l of s.softFailures){let a=l.reason?`: ${l.reason}`:"";n.push(`\u26A0 optional sub-step ${l.subStepIndex} failed${a}`)}o.body.kind==="objective"&&s?.status!=="skipped"&&n.push(o.body.text),n.push("")}return we(t,n.join(`
|
|
3
3
|
`),"utf8"),t}function De(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 $e=/^##\s+(.+?)\s+(✓ passed|✗ failed(?:\s+\(optional\))?|⏭ skipped)(?:\s+\((.*)\))?\s*$/,Fe=/via\s+@\w+\s+(\S+).*?(?:→\s+(\S+))?\s*$/,Oe=/^md5:\s+([a-f0-9]{32})\s*$/;function re(e,t){for(let n=t;n<e.length&&!/^##\s/.test(e[n]);n++){if(e[n].trim()==="")continue;let r=Oe.exec(e[n]);return r?r[1]:null}return null}function D(e){let n=Pe(e,"utf8").split(`
|
|
4
4
|
`),r="passed";if(n[0]?.trim()==="---")for(let s=1;s<n.length&&n[s].trim()!=="---";s++){let l=/^status:\s+(passed|failed|interrupted)\s*$/.exec(n[s]);l&&(r=l[1])}let o=[];for(let s=0;s<n.length;s++){let l=$e.exec(n[s]);if(!l)continue;let a=l[1],i=l[2],c=l[3]??"",f=i.startsWith("\u2713")?"passed":i.startsWith("\u23ED")?"skipped":"failed";if(/via\s+@/.test(c)){let m=Fe.exec(c),w=m?.[1]??"",x=m?.[2]??null;o.push({kind:"import",heading:a,status:f,md5:re(n,s+1),importPath:w,helperResultRelPath:x})}else o.push({kind:"objective",heading:a,status:f,md5:re(n,s+1)})}return{overallStatus:r,steps:o}}import{copyFileSync as oe,existsSync as H,mkdirSync as _e,writeFileSync as ae,promises as at}from"fs";import{join as $,dirname as de,basename as Ae}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));_e(o,{recursive:!0});let s=$(o,"actions.ndjson");if(e.packTestDir){let i=$(e.packTestDir,"logs",`${n}-actions.ndjson`);if(H(i)){oe(i,s);continue}let c=de(de(e.packTestDir)),f=Ae(e.packTestDir),S=H(c)?await z(c,`tests/${f}/logs/${n}-actions.ndjson`).catch(()=>null):null;ae(s,S??"");continue}let l=[$(r,"run-test","actions.ndjson"),$(r,"actions.ndjson")],a=!1;for(let i of l)if(H(i)){oe(i,s),a=!0;break}a||ae(s,"")}}import{existsSync as ue,readFileSync as ce,readdirSync as Ke}from"fs";import{join as F}from"path";function Te(e){if(e.action_type!=="upload_files")return null;let t=e.action_params?.media;if(!t||typeof t!="object")return null;let n=typeof t.media_id=="string"?t.media_id:"",r=typeof t.name=="string"?t.name:"",o=typeof t.media_url=="string"?t.media_url:"";if(!n||!r||!o)return null;let s=typeof t.type=="string"&&t.type?t.type:"doc";return{media_id:n,name:r,media_url:o,type:s}}function Ee(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 Le(e){let t={};for(let[n,r]of Object.entries(e??{}))t[n]={...r,refs:[...r.refs??[]]};return t}function Ue(e,t){if(!t)return!1;let n=t.endsWith("/")?t:t+"/";return e.startsWith(n)}function le(e,t,n,r={}){let o=Le(e);for(let s of t){let l=Te(s);if(!l)continue;let a=o[l.media_id]??={name:l.name,media_url:l.media_url,type:l.type,refs:[],recorded_at:n};a.recorded_at=n;let i=Ee(s);if(!(!i||Ue(i,r.ignoreAliasUnder))){for(let[c,f]of Object.entries(o))c!==l.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(l=>typeof l=="string"&&l.length>0):[]})}return n}function Ne(e){let t=[];for(let n of e){let r;try{r=ce(n,"utf8")}catch{continue}for(let o of r.split(`
|
|
5
5
|
`)){let s=o.trim();if(s)try{let l=JSON.parse(s);l&&typeof l=="object"&&t.push(l)}catch{}}}return t}function V(e){try{return Ke(e,{withFileTypes:!0}).filter(t=>t.isDirectory()).map(t=>t.name).sort((t,n)=>t.localeCompare(n,void 0,{numeric:!0}))}catch{return[]}}function yt(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 fe(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 l=F(o,s,"actions.ndjson");ue(l)&&t.push(l)}}return t}function Ce(e){try{let n=JSON.parse(ce(e,"utf8"))?.media;return n&&typeof n=="object"?n:void 0}catch{return}}function me(e){let t=Ce(e.priorMetaPath),n=Ne(e.recordFiles),r=le(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 We}from"fs";import{dirname as He,join as O,basename as B}from"path";function Mt(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 wt(e){let t=[],n=new Set,r=new Map;function o(i){if(r.has(i))return r.get(i);let c=v(i),f=L(c)?D(c):null;return r.set(i,f),f}let s=new Map;function l(i){if(s.has(i))return s.get(i);let c=O(i,"Result.md"),f=L(c)?D(c):null;return s.set(i,f),f}function a(i){for(let c=1;c<i.trace.length;c++){let f=i.trace[c-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[c].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 c=i.trace[i.trace.length-1].stepIndex,f=i.replayOnly;if(i.block){let g=o(i.owningFile)?.steps[c-1],j=i.controlFlow!==void 0,A=g?.kind==="objective"&&g.status==="skipped";if(j||A){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),x;if(w===null&&i.trace.length>1){let g=J(i.trace);x=ge(i,l(g),c,g)}else x=ge(i,w,c);if(f&&x.kind==="replay"&&(x={...x,replayOnly:f}),t.push(x),x.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 ge(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 l=r===null?ee(e.owningFile,n,s.slice(0,8)):O(r,".internal","steps",`${n}-${s.slice(0,8)}`),a=Ve(l);return a===0?{kind:"author",reason:"missing-recording"}:{kind:"replay",recordingDir:l,flowCount:a}}function Ve(e){let t=O(e,"flows");if(!L(t))return 0;let n;try{n=We(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 vt(e){return e.some(t=>t.kind==="author")}function Pt(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 l=B(s);return l.endsWith("_test.md")?l.slice(0,-8):l.endsWith(".md")?l.slice(0,-3):l},n=t(e[0].file),r=t(e[e.length-1].file),o=e.slice(0,-1).map(s=>String(s.stepIndex));return O(He(e[e.length-1].file),`helper-output-${r}-${n}-${o.join("-")}`)}function jt(e){return Array.from({length:e.flowCount},(t,n)=>O(e.recordingDir,"flows",String(n),"actions.ndjson"))}import{existsSync as he,mkdirSync as Be,rmSync as Je,cpSync as Ge}from"fs";function ye(e,t){he(e)&&(he(t)&&Je(t,{recursive:!0,force:!0}),Be(t,{recursive:!0}),Ge(e,t,{recursive:!0}))}async function Ht(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,l=a=>{if(s.has(a))return s.get(a);let i=R(a,"Result.md"),c=P(i)?D(i):null;return s.set(a,c),c};for(let a of e.resolvedTest.unitFiles){let i=a.file===e.resolvedTest.rootPath,c=Q(a.file,qe(a.file,"utf8")),f=v(a.file),S=P(f)?D(f):null,m=[],w=[],x=[],g=[];if(!i)for(let p of e.resolvedTest.steps){if(p.owningFile!==a.file||p.trace.length<2)continue;let d=J(p.trace);g.includes(d)||g.push(d)}let j=p=>{if(S!==null)return null;for(let d of g){let M=l(d)?.steps[p-1];if(M)return{row:M,dir:d}}return null},A=[],U=!1,G=!1,K=!1,N=!1;for(let p of c.steps){let d=p.index,u=S?.steps[d-1];if(p.body.kind==="objective"){let h=e.resolvedTest.steps.filter(y=>y.owningFile===a.file&&y.trace[y.trace.length-1].stepIndex===d&&t.has(y.flatIndex)),I=h.length>0?h[h.length-1]:null;if(I){U=!0,n.has(I.flatIndex)&&(G=!0);let y=E(I),k;i?k=e.outcomes.find(Me=>Me.rootStepIndex===d)??{rootStepIndex:d,status:"skipped"}:k={rootStepIndex:d,status:ke(I,e.outcomes)},k.status==="failed"&&(K=!0),k.stepMd5==null&&(k.stepMd5=y),m.push(k),w.push({stepIndex:d,md5:y,rec:t.get(I.flatIndex)}),(!u||u.kind!=="objective"||u.status!==k.status||k.status==="passed"&&u.md5!==y)&&(N=!0)}else if(u&&u.kind==="objective")m.push({rootStepIndex:d,status:u.status,...u.md5?{stepMd5:u.md5}:{}}),x.push(d);else if(!i&&j(d)?.row.kind==="objective"){let y=j(d),k=y.row;m.push({rootStepIndex:d,status:k.status,...k.md5?{stepMd5:k.md5}:{}}),A.push({psIdx:d,dir:y.dir})}else i?m.push(e.outcomes.find(y=>y.rootStepIndex===d)??{rootStepIndex:d,status:"skipped"}):m.push({rootStepIndex:d,status:"skipped"});continue}let M=Ye(p.body.path)?p.body.path:et(Xe(a.file),p.body.path),T=te({path:p.body.path,bindings:p.body.bindings,optional:p.optional??!1}),C=Ze(X(a.file),v(M)),_=e.resolvedTest.steps.filter(h=>h.trace.some((I,y)=>y<h.trace.length-1&&I.file===a.file&&I.stepIndex===d)&&t.has(h.flatIndex));if(_.length>0){U=!0;let h;if(i)h=e.outcomes.find(I=>I.rootStepIndex===d)??{rootStepIndex:d,status:"passed",refKind:"import",refLabel:p.body.path};else{let I=_.some(y=>ke(y,e.outcomes)==="failed");h={rootStepIndex:d,status:I?"failed":"passed",refKind:"import",refLabel:p.body.path,inlinedCount:_.length}}h.status==="failed"&&(K=!0),h.stepMd5==null&&(h.stepMd5=T),h.helperResultRelPath==null&&(h.helperResultRelPath=C),m.push(h),(!u||u.kind!=="import"||u.status!==h.status||u.md5!==T)&&(N=!0)}else if(u&&u.kind==="import")m.push({rootStepIndex:d,status:u.status,refKind:"import",refLabel:u.importPath,...u.md5?{stepMd5:u.md5}:{},...u.helperResultRelPath?{helperResultRelPath:u.helperResultRelPath}:{}});else if(!i&&j(d)?.row.kind==="import"){let h=j(d).row;m.push({rootStepIndex:d,status:h.status,refKind:"import",refLabel:p.body.path})}else i?m.push(e.outcomes.find(h=>h.rootStepIndex===d)??{rootStepIndex:d,status:"skipped",refKind:"import",refLabel:p.body.path}):m.push({rootStepIndex:d,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);xe(R(b,".internal"),{recursive:!0});for(let p of w){let d=R(b,".internal","steps",`${p.stepIndex}-${p.md5.slice(0,8)}`);xe(d,{recursive:!0}),await pe({sessionDir:e.sessionDir,runIndex:p.rec.runIndex,totalRunDirs:p.rec.totalRunDirs,stagingStepDir:d,packTestDir:e.packTestDir})}if(x.length>0){let p=Z(a.file);if(P(p))for(let d of Ie(p)){let u=parseInt(d.split("-")[0]??"",10);!Number.isNaN(u)&&x.includes(u)&&Re(R(p,d),R(b,".internal","steps",d),{recursive:!0})}}for(let p of A){let d=R(p.dir,".internal","steps");if(P(d))for(let u of Ie(d))parseInt(u.split("-")[0]??"",10)===p.psIdx&&Re(R(d,u),R(b,".internal","steps",u),{recursive:!0})}let be=m.some(p=>p.status==="failed");if(ie({sourcePath:a.file,title:c.title,rootSteps:c.steps,outcomes:m,overallStatus:i?e.overallStatus:be?"failed":"passed",startedISO:e.startedISO,durationS:i?e.durationS:0,sessionId:e.sessionId,outPath:R(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 d=me({priorMetaPath:W(a.file),recordFiles:fe(b)});d&&(p.media=d);let u=ne(a.file);u&&(p.tc_id=u),Qe(R(b,".internal","meta.json"),JSON.stringify(p,null,2)+`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as ae}from"./chunk-MMBBQ4OZ.js";import{j as R}from"./chunk-
|
|
2
|
+
import{a as ae}from"./chunk-MMBBQ4OZ.js";import{j as R}from"./chunk-UUS5AK6L.js";import{c as ie,e as ne,i as re,j as K}from"./chunk-Z7S3IWUX.js";import{d as $,e as oe}from"./chunk-4JOD47QI.js";import{a as se}from"./chunk-RZ4F3BHX.js";import{spawn as ze}from"child_process";import{closeSync as Xe,existsSync as Ge,mkdirSync as We,openSync as Ye,readFileSync as Ze,rmSync as Qe}from"fs";import{homedir as ge}from"os";import{dirname as X,join as S}from"path";import{access as Re,mkdir as de,readFile as Le}from"fs/promises";import{homedir as Ce}from"os";import{arch as Fe,platform as Be}from"process";import{join as M}from"path";var Ue=35,qe="google_apis",Ve="KaneCLI_Pixel_API35",He="KaneAI_Pixel_API35";function Ht(t){return t===He?Ve:t}var je=1;function Ke(t,e){return t==="darwin"&&e==="arm64"?"arm64-v8a":"x86_64"}function Je(){return{home:Ce(),os:Be,arch:Fe}}async function le(t){try{return await Re(t),!0}catch{return!1}}var J=class{deps;constructor(e={}){this.deps={...Je(),...e}}paths(){let e=M(this.deps.home,".testmuai","kaneai","mobile"),r=M(e,"android-sdk");return{root:r,emulatorDir:M(r,"emulator"),systemImageDir:M(r,"system-images",`android-${Ue}`,qe,Ke(this.deps.os,this.deps.arch)),avdHome:M(e,"avd"),manifest:M(r,"sdk-manifest.json")}}environment(){let e=this.paths();return{ANDROID_HOME:e.root,ANDROID_SDK_ROOT:e.root,ANDROID_AVD_HOME:e.avdHome}}async ensureSdkRootMarkers(){let e=this.paths().root;await de(M(e,"platforms"),{recursive:!0}),await de(M(e,"platform-tools"),{recursive:!0})}async status(){let e=this.paths(),r=null;try{r=JSON.parse(await Le(e.manifest,"utf8"))}catch{}if(!r||r.schemaVersion!==je)return{emulator:!1,systemImage:!1};let o=this.deps.os==="win32"?"emulator.exe":"emulator";return{emulator:!!r.components.emulator&&await le(M(e.emulatorDir,o)),systemImage:!!r.components.systemImage&&await le(M(e.systemImageDir,"system.img"))}}},ue;function B(){return ue??=new J,ue}var G="android",et="http://127.0.0.1:4723/status",tt=2e3,z=(()=>{let t=Number(process.env.KANE_CLI_EMULATOR_BOOT_TIMEOUT_MS);return Number.isFinite(t)&&t>=3e4?t:3e5})(),it=1e3,nt=3e5;var rt=5,ce="Run `kane-cli doctor --target emulator --install` to install the managed Appium tree.",st={device:"ready",unauthorized:"unauthorized",offline:"offline"};function ot(t){let e={};for(let r of t){let o=r.indexOf(":");o<=0||(e[r.slice(0,o)]=r.slice(o+1))}return e}function at(t){let e=[];for(let r of t.split(`
|
|
3
3
|
`)){let o=r.trim();if(!o||o.startsWith("*"))continue;let u=o.toLowerCase();if(u.startsWith("list of devices")||u.startsWith("adb server"))continue;let g=o.split(/\s+/),p=g[0],w=g[1];if(!p||!w)continue;let v=ot(g.slice(2)),x=/^(localhost|127\.0\.0\.1):\d{1,5}$/.test(p),P=/^[A-Za-z0-9._-]+:\d{1,5}$/.test(p),C=/^sdk_/.test(v.product??"")||/^sdk_/.test(v.model??"")||/^emu/.test(v.device??"");if(!p.startsWith("emulator-")&&!x&&!(P&&C))continue;let l=v.model?v.model.replace(/_/g," "):void 0;e.push({platform:G,kind:"emulator",id:p,displayName:l??p,state:st[w]??"offline"})}return e}function me(t){let e=[];for(let r of t.split(`
|
|
4
4
|
`)){let o=r.trim();o&&/^[A-Za-z0-9._-]+$/.test(o)&&(e.includes(o)||e.push(o))}return e}function dt(t){for(let e of t.split(`
|
|
5
5
|
`)){let r=e.trim();if(!(!r||r==="OK"))return r}}function lt(t){let e=/^Version\s+(\S+)/m.exec(t);return e?.[1]?e[1].split("-")[0]:/Android Debug Bridge version\s+(\S+)/.exec(t)?.[1]}function ut(t){let e=[];for(let r of t.split(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{y as o}from"./chunk-
|
|
2
|
+
import{y as o}from"./chunk-UQ6A52ML.js";import{a as m}from"./chunk-HCBYKLMW.js";import{a as e,b as i}from"./chunk-C44QQJR4.js";import{e as d}from"./chunk-UR6MHSHU.js";var r=d(m(),1),s={default:o.muted,error:o.red,success:o.green,info:o.orange,warning:o.orange};function h({title:t,titleColor:a,borderColor:l,variant:n="default",children:c,width:u,paddingX:x=2,paddingY:g=0,marginBottom:f=0}){let p=l??s[n],B=a??(n==="default"?o.orange:s[n]);return(0,r.jsxs)(e,{flexDirection:"column",marginBottom:f,children:[t&&(0,r.jsx)(e,{marginBottom:0,children:(0,r.jsxs)(i,{color:B,bold:!0,children:[" ",t]})}),(0,r.jsx)(e,{borderStyle:"round",borderColor:p,flexDirection:"column",paddingX:x,paddingY:g,width:u,children:c})]})}function k({label:t,value:a,labelColor:l=o.dim,valueColor:n,labelWidth:c=14}){return(0,r.jsxs)(e,{children:[(0,r.jsx)(e,{width:c,flexShrink:0,children:(0,r.jsx)(i,{color:l,children:t})}),(0,r.jsx)(e,{flexShrink:1,children:(0,r.jsx)(i,{color:n,wrap:"wrap",children:a})})]})}function I({label:t}){return(0,r.jsx)(e,{marginTop:1,marginBottom:0,children:(0,r.jsx)(i,{bold:!0,children:t})})}export{h as a,k as b,I as c};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as N,b as U,c as Y,d as L}from"./chunk-
|
|
2
|
+
import{a as N,b as U,c as Y,d as L}from"./chunk-ZW3JBY5E.js";import{l as R,m as D,o as P}from"./chunk-7N6OCHPC.js";import{g as A}from"./chunk-Q6F23V7L.js";import{i as G}from"./chunk-SEEEGDVK.js";import{T as S,W as k,X as C}from"./chunk-QX5LJVTD.js";import{c as E}from"./chunk-H6TNBKGR.js";import{a as h}from"./chunk-CH273NAE.js";import{z as y}from"./chunk-IICT4VOU.js";import{t as T}from"./chunk-RDHWNSDP.js";import{existsSync as H}from"fs";import{basename as Z}from"path";import{appendFileSync as W,mkdirSync as B}from"fs";import{homedir as X}from"os";import{dirname as K,join as V}from"path";function F(d,a){let t=/^(DOCX_[A-Z_]+):/.exec(a)?.[1];if(t)try{let u=process.env.KANE_CONTEXT_REFUSAL_LOG??V(X(),".testmuai","kaneai","context-refusals.log");B(K(u),{recursive:!0}),W(u,`${new Date().toISOString()} ${t} ${d}
|
|
3
3
|
`)}catch{}}function j(d){return d?.outcome==="added"?"added .context/ to .gitignore":d?.outcome==="failed"?`warning: could not add .context/ to .gitignore: ${d.reason}`:null}async function x(d,a,t,u=process.cwd(),f){let l=h(u),g=[];if(a.as!==void 0&&d.length>1)return(t.err??t.out)(`error: --as names ONE source identity \u2014 pass a single file (got ${d.length})`,"AS_SINGLE_SOURCE"),{code:2,results:g};for(let i of d){if(Y(i)){let e=L(i);if(e===null)return(t.err??t.out)(`error: ${i}: unsupported remote URL \u2014 supported: ${U.map(c=>c.hint).join("; ")}`,"UNSUPPORTED_URL"),{code:1,results:g};let o=await e.ingest(i,a.as,t,l,f);if(o.code!==0)return{code:o.code,results:g};if(o.result){let c=j(o.result.gitignore);c&&t.out(c),g.push({status:o.result.status==="versioned"?"versioned":o.result.status==="unchanged"?"unchanged":"created",source_id:o.result.source_id,source_cid:o.result.source_cid,...o.result.gitignore?{gitignore:o.result.gitignore}:{}})}continue}let m=a.as,p;if(m===void 0&&H(l)){let e=R(i),o=D(e);if(o){let c=y(l);c.heads.get(o)!=null&&c.heads.get(e)==null&&(p=o,t.isTTY&&await t.confirm(`${e} looks like a new version of existing source '${o}' \u2014 ingest as '${o}' (replaces the current version; items built on it go stale)?`)&&(m=o))}}let n;try{n=await P({contextDir:l,filePath:i,asId:m,confirmSameSource:t.isTTY?e=>t.confirm(`identical bytes already ingested as ${e} \u2014 treat as the same source?`):void 0,converters:{pdf:A,docx:G}})}catch(e){let o=e instanceof Error?e.message:String(e);return e instanceof T?((t.err??t.out)(`error: ${o}`,e.code),(t.err??t.out)(`next: ${e.remedy}`,e.code),{code:2,results:g}):(F(i,o),(t.err??t.out)(`error: ${i}: ${o}`,"INGEST_FAILED"),{code:1,results:g})}t.out(N(t.isTTY,n,Z(i)));for(let e of n.warnings??[])t.out(`warning: ${e}`);let _=j(n.gitignore);if(_&&t.out(_),n.composite&&(n.composite.delivered>0||n.composite.omitted>0)){let e=n.composite.pages!==void 0?` ${n.composite.pages} pages,`:"";t.out(`${n.source_id}: ${n.composite.kind},${e} ${n.composite.delivered} images delivered (${n.composite.omitted} omitted)`)}let v;if(!t.isTTY&&n.status==="created"){let e=y(l);for(let[o,c]of e.heads.entries())if(!(o===n.source_id||c==null)&&e.getNode(c)?.content.blob===n.blob){v=o,t.out(`hint: identical bytes already ingested as ${o} \u2014 merged later via review`);break}}g.push({status:n.status,source_id:n.source_id,source_cid:n.cid,...n.warnings?.length?{warnings:n.warnings}:{},...n.composite?{media:{kind:n.composite.kind,...n.composite.pages!==void 0?{pages:n.composite.pages}:{},delivered:n.composite.delivered,omitted:n.composite.omitted}}:{},...v?{duplicate_of:v}:{},...p&&m===void 0?{lineage_candidate:p}:{},...n.gitignore?{gitignore:n.gitignore}:{}})}return{code:0,results:g}}async function le(d,a,t,u=process.cwd(),f){return(await x(d,a,t,u,f)).code}async function fe(d,a){if(a.mode!=null&&!["interactive","agent","ci","override"].includes(a.mode)){let{makeHeadlessIO:r,agentRefusal:s}=await import("./headless-io-3A3BZVQ5.js");return s(r("ndjson","extract"),`ingest: --mode must be interactive | agent | ci | override, got '${a.mode}'`,"MODE_USAGE")}let t=E();if(a.mode==="interactive"&&!t)return process.stderr.write(`ingest: --mode interactive needs a TTY on stdin and stdout (use --mode agent|ci|override headless)
|
|
4
4
|
`),2;let u=a.mode??(t?"interactive":void 0),f=u==="interactive"||u==="agent"||u==="override";if(!f&&(a.plan||a.force||a.trust!==void 0))return process.stderr.write(`ingest: --plan/--force/--trust steer the extraction \u2014 not available when only landing (use --mode agent to extract headless)
|
|
5
5
|
`),2;let{createInterface:l}=await import("readline/promises"),g=u==="agent",i=g?(await import("./headless-io-3A3BZVQ5.js")).makeHeadlessIO("ndjson","extract"):null,m=H(h(process.cwd()))?k(h(process.cwd())):null;if(m)return i?(i.event(C(m)),i.done(2,"refused")):(process.stderr.write(`error: ${m.text}
|
|
6
6
|
next: ${m.remedy}
|
|
7
7
|
`),2);let p=[],n=()=>{for(let r of p.splice(0))i.event({type:"error",message:r.message,...r.code?{code:r.code}:{}})},_=r=>{for(let s of r)i.event({type:"ingested",source_id:s.source_id,status:s.status,cid:s.source_cid,...s.warnings?.length?{warnings:s.warnings}:{},...s.media?{media:s.media}:{},...s.duplicate_of?{duplicate_of:s.duplicate_of}:{},...s.lineage_candidate?{lineage_candidate:s.lineage_candidate}:{}})},v=r=>{for(let s of r)s.gitignore?.outcome==="added"?i.event({type:"gitignore_updated",path:".gitignore"}):s.gitignore?.outcome==="failed"&&i.event({type:"warning",message:`could not add .context/ to .gitignore: ${s.gitignore.reason}`})},e=i?{out:()=>{},err:(r,s)=>p.push({message:r.replace(/^error: /,""),...s?{code:s}:{}}),isTTY:!1,confirm:async()=>!1}:{out:r=>process.stdout.write(r+`
|
|
8
8
|
`),err:r=>process.stderr.write(r+`
|
|
9
|
-
`),isTTY:t,confirm:async r=>{let s=l({input:process.stdin,output:process.stdout});try{let O=await s.question(`${r} [Y/n] `);return!/^n(o)?$/i.test(O.trim())}finally{s.close()}}};if(!f){let{withTelemetry:r}=await import("./with-telemetry-
|
|
9
|
+
`),isTTY:t,confirm:async r=>{let s=l({input:process.stdin,output:process.stdout});try{let O=await s.question(`${r} [Y/n] `);return!/^n(o)?$/i.test(O.trim())}finally{s.close()}}};if(!f){let{withTelemetry:r}=await import("./with-telemetry-UE6SYQWL.js");return r("ingest",async()=>{await S(h(process.cwd()),I=>(e.err??e.out)(I));let{code:s,results:O}=await x(d,{as:a.as},e,void 0,void 0);if(s!==0)return s;let b=O.filter(I=>I.status!=="unchanged").length;return b>0&&(e.err??e.out)(`landed ${b} source(s) \u2014 run kane-cli context extract to extract them`),0},{write:!0})}let o;try{o=i?await(await import("./run-channel-RGH4WIQX.js")).runWithChannel({event:i.event},()=>x(d,{as:a.as},e,void 0,void 0)):await x(d,{as:a.as},e,void 0,void 0)}catch(r){if(i)return n(),i.event({type:"error",message:r instanceof Error?r.message:String(r),code:"INGEST_FAILED"}),i.done(1,"error");throw r}let{code:c,results:w}=o;if(i&&v(w),c!==0)return i?(_(w),n(),i.done(c,c===2?"refused":"error")):c;if(w.length===0)return i?i.done(0):0;let{extractCommand:q}=await import("./extract-cmd-2BQJ2HNT.js"),M=[...new Set(w.map(r=>r.source_id))],$=await q({...a.mode!==void 0?{mode:a.mode}:{},...a.plan?{plan:!0}:{},...a.force?{force:!0}:{},...a.trust!==void 0?{trust:a.trust}:{},sources:M,landed:w});if($===2&&!g){let r=w.filter(s=>s.status!=="unchanged").length;r>0&&(e.err??e.out)(`note: the ${r} landed source(s) are safe \u2014 extract later with kane-cli context extract`)}return $}export{x as a,le as b,fe as c};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as y}from"./chunk-WD52ZNQY.js";import{b as l,d,e as m,g,h as S}from"./chunk-L45HDSJ7.js";import{a as f}from"./chunk-
|
|
2
|
+
import{b as y}from"./chunk-WD52ZNQY.js";import{b as l,d,e as m,g,h as S}from"./chunk-L45HDSJ7.js";import{a as f}from"./chunk-GESZSIB6.js";import{r as u,s as p}from"./chunk-RSSOJ3L2.js";import{existsSync as s,mkdirSync as h,readFileSync as C,renameSync as w,writeFileSync as R}from"fs";import{join as x}from"path";function G(e){y(l(e));let r=l(e);if(!s(r))return;let n=x(r,"meta.json"),o=m(e);if(s(n)&&!s(o))try{h(d(e),{recursive:!0}),w(n,o)}catch(t){process.stderr.write(`warn: meta.json migration failed: ${t.message}
|
|
3
3
|
`)}let a=S(e);if(s(a)){let t="python";try{let i=new f().load();i.code_export?.language&&(t=i.code_export.language)}catch{}let c=g(e,"playwright",t);if(!s(c))try{w(a,c)}catch(i){process.stderr.write(`warn: generated-code migration failed: ${i.message}
|
|
4
4
|
`)}}if(s(o))try{let t=JSON.parse(C(o,"utf8"));"md5sum"in t&&(delete t.md5sum,R(o,JSON.stringify(t,null,2)+`
|
|
5
5
|
`,"utf8"))}catch(t){process.stderr.write(`warn: meta.json md5sum strip failed: ${t.message}
|
|
6
|
-
`)}}async function O(e){if(!e.isInteractive)return{recovered:!1};if(E(e.creds))return{recovered:!1};let{SingleShotApp:r}=await import("./SingleShotApp-
|
|
6
|
+
`)}}async function O(e){if(!e.isInteractive)return{recovered:!1};if(E(e.creds))return{recovered:!1};let{SingleShotApp:r}=await import("./SingleShotApp-JV64B4XL.js"),{ScrollbackProvider:n}=await import("./scrollback-JLPJR25X.js"),{render:o}=await import("./build-JIKYOZUH.js"),a=await import("./react-QWOAB3TB.js"),t={current:null},c={current:!1},{waitUntilExit:i,unmount:v}=o(a.default.createElement(n,null,a.default.createElement(r,{resultRef:t,mode:"login",loginCompleteRef:c})),{exitOnCtrlC:!1});p(()=>v()),await i();try{process.stdin.setRawMode?.(!1)}catch{}return process.stdout.write("\x1B[?25h"),c.current?{recovered:!0}:(u(0,"Startup gate cancelled"),{recovered:!1})}function E(e){let r=e.getActiveProfile(),n=e.getDefaultEnv();if(!r||!!!(e.loadBasicAuth(r,n)||e.loadCredentials(r,n)))return!1;let a=e.loadProfileConfig(r,n)??{};return!!a.project_id&&!!a.folder_id}export{G as a,O as b};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as v}from"./chunk-QSCXXNC2.js";import{n as g}from"./chunk-RSSOJ3L2.js";import{a as u,b as d}from"./chunk-UQ6A52ML.js";import{existsSync as F}from"fs";import{join as P}from"path";import{mkdirSync as w,rmSync as b,writeFileSync as h}from"fs";import{join as S,resolve as k}from"path";import{join as W}from"path";function f(){return process.env.KANE_CLI_WIRE_BASE_DIR||d}function B(e){return W(f(),"sessions",`testrun-${e}`)}function E(e=f()){return S(e,"sessions","active")}function y(e,r){return S(E(r),`${e}.json`)}function _(e){let r=e.pid??process.pid,n=y(r,e.baseDir);try{w(E(e.baseDir),{recursive:!0}),h(n,JSON.stringify({pid:r,cwd:process.cwd(),surface:e.surface,session_dir:k(e.sessionDir),started:new Date().toISOString(),cli_version:u,host_agent:v()},null,2)+`
|
|
3
|
+
`)}catch{}return n}function m(e=process.pid,r){try{b(y(e,r),{force:!0})}catch{}}var R={run:"run_end",testmd:"test_md_done",testrun:"testrun_done"};import{appendFileSync as A,mkdirSync as I}from"fs";import{dirname as N}from"path";function x(e){let r=!1;return{path:e,append(n){try{r||(I(N(e),{recursive:!0}),r=!0),A(e,n+`
|
|
4
|
+
`)}catch{}}}}function D(e,r=()=>new Date){let{v:n,ts:c,...i}=e;return{...i,v:1,ts:typeof c=="string"?c:r().toISOString()}}function T(e){let r=e.stdout??(t=>{process.stdout.write(t)}),n=R[e.surface],c=!1,i=null,o=null,p=[],l=()=>{if(!(o||!i||!F(i))){o=x(P(i,"events.ndjson"));for(let t of p)o.append(t);p=[];try{e.onAttach?.(i)}catch{}}};return{emit(t){if(c)return;let a=JSON.stringify(D(t,e.now));r(a+`
|
|
5
|
+
`),l(),o?o.append(a):p.push(a),t.type===n&&(c=!0,p=[])},attachSessionDir(t){i=t,l()},setTerminal(t){n=t},get logPath(){return o?o.path:null}}}var s=null;function V(e){return r=>{_({surface:e,sessionDir:r}),g("wire-active-run",()=>m()),process.once("exit",()=>m())}}function ie(e,r){return s=T({surface:e,cliVersion:u,onAttach:r??V(e)}),s.emit({type:"stream_start",cli_version:u,surface:e,pid:process.pid}),s}function oe(){return s}function se(e){if(s){s.emit(e);return}process.stdout.write(JSON.stringify(D(e))+`
|
|
6
|
+
`)}export{B as a,x as b,D as c,ie as d,oe as e,se as f};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as f}from"./chunk-
|
|
2
|
+
import{a as f}from"./chunk-6VB4FGBZ.js";import{y as t}from"./chunk-UQ6A52ML.js";import{a as x}from"./chunk-HCBYKLMW.js";import{a,b as n}from"./chunk-C44QQJR4.js";import{a as R}from"./chunk-6YGTRKDT.js";import{e as c}from"./chunk-UR6MHSHU.js";var p=c(R(),1);var e=c(x(),1);function v(){return[{name:"convert",label:"Converting session data",status:"pending"},{name:"zip",label:"Compressing artifacts",status:"pending"},{name:"presign",label:"Requesting upload URLs",status:"pending"},{name:"upload",label:"Uploading to KaneAI",status:"pending"},{name:"atomic_replace",label:"Replacing local output",status:"pending"},{name:"commit_lock",label:"Committing to TMS",status:"pending"},{name:"finalize",label:"Finalizing test case",status:"pending"},{name:"code_export",label:"Downloading test code",status:"pending"}]}function U(s,o,d,i){return s.map(l=>l.name===o?{...l,status:d,detail:i}:l)}function D(s){let o=s/1e3;if(o<60)return`${o.toFixed(1)}s`;let d=Math.floor(o/60),i=Math.round(o%60);return`${d}m ${i}s`}function w(s){let[o,d]=(0,p.useState)(0),i=p.default.useRef(Date.now());return(0,p.useEffect)(()=>{if(!s)return;i.current=Date.now();let l=setInterval(()=>{d(Date.now()-i.current)},100);return()=>clearInterval(l)},[s]),o}function h({steps:s,status:o,testUrl:d,error:i}){let l=w(o==="uploading");return o==="uploading"?(0,e.jsxs)(a,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,e.jsxs)(a,{children:[(0,e.jsx)(n,{color:t.orange,children:"\u2601 "}),(0,e.jsx)(n,{color:t.orange,bold:!0,children:"Saving to KaneAI"}),(0,e.jsxs)(n,{color:t.dim,children:[" ",D(l)]})]}),(0,e.jsx)(a,{flexDirection:"column",marginTop:1,children:s.filter(r=>r.status!=="skipped"||r.detail).map((r,S,T)=>{let b=S===T.length-1?"\u2514\u2500":"\u251C\u2500",u=r.status==="done",m=r.status==="running",g=r.status==="failed",B=r.status==="skipped";return(0,e.jsxs)(a,{children:[(0,e.jsxs)(n,{color:t.dim,children:[" ",b," "]}),(0,e.jsx)(a,{width:3,children:m?(0,e.jsx)(f,{}):u?(0,e.jsx)(n,{color:t.green,children:"\u2713"}):g?(0,e.jsx)(n,{color:t.red,children:"\u2717"}):B?(0,e.jsx)(n,{color:t.muted,children:"\u2013"}):(0,e.jsx)(n,{color:t.muted,children:"\u25CB"})}),(0,e.jsx)(n,{color:u?t.dim:m?void 0:g?t.red:t.muted,children:r.label}),r.detail&&(0,e.jsxs)(n,{color:t.dim,children:[" ",r.detail]})]},r.name)})}),(0,e.jsx)(a,{marginTop:1,children:(0,e.jsx)(n,{color:t.muted,children:" press Ctrl+C twice to force exit"})})]}):o==="success"?(0,e.jsx)(e.Fragment,{}):(0,e.jsxs)(a,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,e.jsxs)(a,{children:[(0,e.jsx)(n,{color:t.red,children:"\u2601 "}),(0,e.jsx)(n,{color:t.red,bold:!0,children:"Save failed"})]}),i&&(0,e.jsxs)(a,{marginTop:0,children:[(0,e.jsx)(n,{color:t.dim,children:" "}),(0,e.jsx)(n,{color:t.dim,children:i})]})]})}export{v as a,U as b,h as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as t}from"./chunk-427OQS2N.js";import{a,b as s,c as n}from"./chunk-
|
|
2
|
+
import{a as t}from"./chunk-427OQS2N.js";import{a,b as s,c as n}from"./chunk-XLSOQLVT.js";function y(o="extract"){let i=new Set(t(o)),c=Object.fromEntries(Object.keys(s).map(r=>{let e=s[r];return[r,{hashed:[...e.hashed],unhashed:[...e.unhashed??[]],required:[...e.required],enums:Object.fromEntries(Object.entries(e.enums).map(([p,g])=>[p,[...g]])),mintable:i.has(r)}]})),d=Object.fromEntries(Object.keys(n).map(r=>{let e=n[r];return[r,{src:[...e.src],dst:[...e.dst],salient:[...e.salient],props:[...e.props],cardinality:e.cardinality,acyclic:e.acyclic,direction:"dependent->dependency"}]}));return{schema_version:a,nodes:c,edges:d,mint_gate:t(o),blob_fingerprint:{algo:"sha256",domain:"assurance.blob\0",prefix:"sha256:"}}}export{y as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c as m,d as p,e as g}from"./chunk-
|
|
2
|
+
import{c as m,d as p,e as g}from"./chunk-ALHCB3LL.js";import{b as d}from"./chunk-UQ6A52ML.js";import{mkdirSync as h,writeFileSync as o,existsSync as u,readFileSync as M}from"fs";import{join as a}from"path";var E={name:"remote-execution",version:"0.5.0",backendId:"hyper",kaneCompat:">=0.4.0",defaults:{runson:"mac",concurrency:1}},f={runson:"mac",concurrency:1,timeoutMinutes:120,mobile:{runson:"mac26",deviceName:"Galaxy A53 5G",osVersion:"15",queueTimeout:300,appiumPort:4739,androidHome:"$HOME/android-sdk-shim",globalTimeout:90,testSuiteTimeout:90,testSuiteStep:45,ios:{deviceName:"iPhone 15",osVersion:"17.5",runson:{}}}},v=`version: "0.1"
|
|
3
3
|
runson: {{runson}}
|
|
4
4
|
autosplit: true
|
|
5
5
|
concurrency: {{concurrency}}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as g,e as p}from"./chunk-
|
|
2
|
+
import{a as g,e as p}from"./chunk-XYMUKOKK.js";import{existsSync as f}from"fs";import{isAbsolute as m,join as d,relative as v}from"path";function c(t){let n=f(d(t,".context"))?"assurance.json":"variables.json";return d(".testmuai","variables",n)}function h(t,n){if(!m(t))return t;let e=v(n,t);return e.startsWith("..")?t:e}function w(t,n){let e=t.used_by;if(e.length===0||e.every(s=>s.file===p))return"";if(n===void 0||!e.every(s=>s.file===n))return e.map(s=>`${s.file} step ${s.step}`).join(" \xB7 ");let a=[...new Set(e.map(s=>s.step))].sort((s,i)=>s-i);return a.length===1?`step ${a[0]}`:`steps ${a.join(", ")}`}function b(t,n){let e=new Map,a=new Map,s={header:"Not in any variables file",rows:[],declare:!0};for(let i of t){if(i.reason==="not_a_dataset_column"){let l=i.dataset??"",u=a.get(l);u||(u={header:`Not a column of dataset ${l}`.trimEnd(),rows:[],declare:!1},a.set(l,u)),u.rows.push(i);continue}if(i.reason!=="value_missing"){s.rows.push(i);continue}let r=h(i.file??c(n),n),o=e.get(r);o||(o={header:r===g?"Waiting for a value passed with --variables":`Waiting for a value in ${r}`,rows:[],declare:!1},e.set(r,o)),o.rows.push(i)}return[...e.values(),...a.values(),...s.rows.length>0?[s]:[]]}function $(t,n){let e=c(n);if(f(d(n,e)))return["",` Add ${t.length===1?"it":"them"} to ${e}`];let a=t.map(r=>`${JSON.stringify(r.name)}:`),s=Math.max(...a.map(r=>r.length))+1,i=a.map((r,o)=>` ${r.padEnd(s)}{ "value": "" }${o<a.length-1?",":""}`);return["",` Create ${e}:`,""," {",...i," }"]}function _(t,n){let e=t.length,a=`warning: ${e} variable${e===1?" has":"s have"} no value`,s=Math.max(...t.map(r=>r.name.length),8)+2,i=b(t,n.cwd).map(r=>{let o=[` ${r.header}`];for(let l of r.rows)o.push(` ${l.name.padEnd(s)}${w(l,n.entryFile)}`.trimEnd());return r.declare&&o.push(...$(r.rows,n.cwd)),o.join(`
|
|
3
3
|
`)});return`${a}
|
|
4
4
|
|
|
5
5
|
${i.join(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a}from"./chunk-5Y2G4NC7.js";import{y as o}from"./chunk-
|
|
2
|
+
import{a}from"./chunk-5Y2G4NC7.js";import{y as o}from"./chunk-UQ6A52ML.js";import{a as n}from"./chunk-HCBYKLMW.js";import{b as t}from"./chunk-C44QQJR4.js";import{a as s}from"./chunk-6YGTRKDT.js";import{e as r}from"./chunk-UR6MHSHU.js";var l=r(s(),1);var m=r(n(),1),i=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function b({active:e=!0}){let[p,c]=(0,l.useState)(0);return a(()=>{c(f=>(f+1)%i.length)},e?80:null),(0,m.jsx)(t,{color:o.orange,children:e?i[p]:"\u25CF"})}export{b as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as b}from"./chunk-
|
|
2
|
+
import{a as b}from"./chunk-YPEIPCQY.js";import{m as d,y as o}from"./chunk-UQ6A52ML.js";import{a as L}from"./chunk-HCBYKLMW.js";import{a as u,b as c,i as A}from"./chunk-C44QQJR4.js";import{a as D}from"./chunk-6YGTRKDT.js";import{e as h}from"./chunk-UR6MHSHU.js";var x=h(D(),1);import{readdirSync as N,mkdirSync as B,statSync as k}from"fs";import{join as P}from"path";var r=h(L(),1);function O(n){try{return N(n).filter(l=>{try{return k(P(n,l)).isDirectory()}catch{return!1}})}catch{return[]}}function E(n,l,f,v){return{name:n,path:l,label:n,isActive:v}}function H({currentPath:n,onSelect:l,onCancel:f}){let s=O(d).map(i=>{let e=P(d,i);return E(i,e,n,e===n)}),p=!n,R=s.length+2,[a,C]=(0,x.useState)(()=>{if(p)return 0;let i=s.findIndex(e=>e.isActive);return i>=0?i+1:0}),[T,I]=(0,x.useState)(!1),[S,g]=(0,x.useState)("");return A((i,e)=>{if(T){if(e.escape){I(!1),g("");return}if(e.return){let t=S.trim();if(t){let m=P(d,t);B(m,{recursive:!0}),l(m),f()}return}if(e.backspace||e.delete){g(t=>t.slice(0,-1));return}i&&!e.ctrl&&!e.meta&&g(t=>t+i);return}if(e.escape){f();return}if(e.upArrow){C(t=>Math.max(0,t-1));return}if(e.downArrow){C(t=>Math.min(R-1,t+1));return}if(e.return){if(a===0){p||l(""),f();return}if(a===s.length+1){B(d,{recursive:!0}),I(!0),g("");return}let t=s[a-1];t&&!t.isActive&&l(t.path),f();return}}),T?(0,r.jsxs)(u,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,r.jsx)(c,{color:o.orange,bold:!0,children:"Chrome Profile \u203A New"}),(0,r.jsxs)(u,{marginTop:1,children:[(0,r.jsx)(c,{color:o.secondary,children:"Name: "}),(0,r.jsx)(c,{children:S}),(0,r.jsx)(c,{color:o.dim,children:"\u2588"})]}),(0,r.jsx)(b,{bindings:[{keys:"\u21B5",label:"create"}],escBackLabel:"back"})]}):(0,r.jsxs)(u,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,r.jsx)(c,{color:o.orange,bold:!0,children:"Chrome Profile"}),(0,r.jsxs)(u,{flexDirection:"column",marginTop:1,children:[(0,r.jsxs)(c,{color:p?o.green:a===0?o.orange:o.dim,children:[a===0?"\u276F ":" ","Use temporary (no profile)",p?" \u25CF active":""]}),s.map((i,e)=>{let m=e+1===a,w=m?"\u276F ":" ",y=i.isActive?o.green:m?o.orange:void 0;return(0,r.jsxs)(c,{color:y,children:[w,i.label,i.isActive?" \u25CF active":""]},i.name)}),(0,r.jsxs)(c,{color:a===s.length+1?o.orange:o.dim,children:[a===s.length+1?"\u276F ":" ","+ Create new"]})]}),(0,r.jsx)(b,{bindings:[{keys:"\u2191\u2193",label:"navigate"},{keys:"\u21B5",label:"select"}],escBackLabel:"back"})]})}export{O as a,E as b,H as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{y as m}from"./chunk-
|
|
2
|
+
import{y as m}from"./chunk-UQ6A52ML.js";import{a as x}from"./chunk-HCBYKLMW.js";import{a as u,b as a,j as g}from"./chunk-C44QQJR4.js";import{a as b}from"./chunk-6YGTRKDT.js";import{e as f}from"./chunk-UR6MHSHU.js";var T=f(b(),1);function k(i,n){if(!n)return i;let l=i.trim()||n;return`\x1B]8;;${n}\x07${l}\x1B]8;;\x07`}var r=f(x(),1);function $({shareableLink:i,testCaseLink:n,codeExportDir:l,recordedTestPath:s,outputDir:o,autoExit:p=!0}){let{exit:c}=g();(0,T.useEffect)(()=>{if(!p)return;let t=setTimeout(()=>c(),100);return()=>clearTimeout(t)},[c,p]);let e=[];return s&&e.push({label:"Test",url:s,linkUrl:`file://${s}`}),o&&e.push({label:"Output",url:o,linkUrl:`file://${o}`}),i&&e.push({label:"ShareLink",url:i}),n&&e.push({label:"TestCase",url:n}),l&&!o&&e.push({label:"CodeExport",url:l,linkUrl:`file://${l}`}),e.length===0?(0,r.jsx)(r.Fragment,{}):(0,r.jsx)(u,{flexDirection:"column",marginTop:1,marginLeft:1,children:e.map(t=>(0,r.jsxs)(u,{flexDirection:"column",marginBottom:1,children:[(0,r.jsxs)(a,{color:m.orange,children:[t.label,":"]}),(0,r.jsx)(a,{color:m.dim,children:k(t.url,t.linkUrl??t.url)})]},t.label))})}export{$ as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as V}from"./chunk-
|
|
2
|
+
import{b as V}from"./chunk-KDNNMU7Q.js";import{a as Y}from"./chunk-Q2F5QB2W.js";import{b as C,c as E}from"./chunk-VVOKM2VO.js";import{z as J}from"./chunk-IICT4VOU.js";import{M as K,c as $,e as G,g as B,m as j,x as U}from"./chunk-RDHWNSDP.js";import{a as L,f as P,h as T}from"./chunk-XLSOQLVT.js";import{existsSync as ve,mkdirSync as he,readFileSync as Ee,writeFileSync as we}from"fs";import{basename as A,dirname as Ie,extname as ee,join as ke}from"path";import{spawnSync as oe}from"child_process";import{appendFileSync as re,existsSync as O,readFileSync as z}from"fs";import{dirname as se,join as H}from"path";var ae="# kane-cli context store: shared through a location, never merged with git",ce=".context/",de=new Set([".context",".context/","/.context","/.context/"]);function X(e,n={}){let t=n.env??process.env;if(t.KANE_CONTEXT_GITIGNORE==="0")return{outcome:"skipped"};try{if(!le(e))return{outcome:"not-a-repo"};let i=H(e,".gitignore");if(me(i))return{outcome:"already",path:i};if((n.checkIgnore??(o=>pe(o,t)))(e)===!0)return{outcome:"already"};let g="";if(O(i)){let o=z(i);o.length>0&&o[o.length-1]!==10&&(g=`
|
|
3
3
|
`)}return re(i,`${g}${ae}
|
|
4
4
|
${ce}
|
|
5
5
|
`),{outcome:"added",path:i}}catch(i){return{outcome:"failed",reason:i instanceof Error?i.message:String(i)}}}function le(e){let n=e;for(;;){if(O(H(n,".git")))return!0;let t=se(n);if(t===n)return!1;n=t}}function me(e){return O(e)?z(e,"utf8").split(/\r?\n/).some(n=>de.has(n.trim())):!1}function pe(e,n){let t=oe("git",["-C",e,"check-ignore","-q",".context"],{env:{...n,GIT_TERMINAL_PROMPT:"0"},stdio:"ignore",timeout:5e3});return t.error||t.status===null?null:t.status===0?!0:t.status===1?!1:null}import{extname as ue}from"path";var fe={kind:"jira",media_type:"application/x-kane-jira-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},ge={kind:"confluence",media_type:"application/x-kane-confluence-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},De={kind:"web",media_type:"application/x-kane-web-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},xe={kind:"linear",media_type:"application/x-kane-linear-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},_e={kind:"linear-doc",media_type:"application/x-kane-linear-doc-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},q=[{kind:"text",media_type:"text/plain",extensions:[".txt"],cite:"verbatim",maxBytes:2e6},{kind:"markdown",media_type:"text/markdown",extensions:[".md",".markdown"],cite:"verbatim",maxBytes:2e6},{kind:"image",media_type:"image/png",extensions:[".png"],cite:"anchor-only",maxBytes:5e6},{kind:"image",media_type:"image/jpeg",extensions:[".jpg",".jpeg"],cite:"anchor-only",maxBytes:5e6},{kind:"image",media_type:"image/webp",extensions:[".webp"],cite:"anchor-only",maxBytes:5e6},{kind:"text",media_type:"application/json",extensions:[".json"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"application/yaml",extensions:[".yaml",".yml"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"application/toml",extensions:[".toml"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"application/xml",extensions:[".xml"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"text/plain",extensions:[".log"],cite:"verbatim",maxBytes:2e6},{kind:"pdf",media_type:"application/pdf",extensions:[".pdf"],cite:"verbatim",maxBytes:25e6,sniff:e=>e.subarray(0,5).toString("latin1")==="%PDF-"},{kind:"docx",media_type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",extensions:[".docx"],cite:"verbatim",maxBytes:25e6,sniff:e=>e.length>=4&&e[0]===80&&e[1]===75&&e[2]===3&&e[3]===4,sniffFail:e=>e.length>=8&&e.subarray(0,8).equals(ye)?"DOCX_ENCRYPTED_OR_LEGACY: password-protected Office file (or a legacy .doc renamed .docx) \u2014 remove the password / save as .docx and re-ingest":void 0},fe,ge,xe,_e],ye=Buffer.from([208,207,17,224,161,177,26,225]),S={pdf:"pdf",docx:"docx",jira:"jira",confluence:"confluence",web:"web",linear:"linear","linear-doc":"linearDoc"},Fe=new Set(Object.keys(S));function W(e){let n=ue(e).toLowerCase(),t=q.find(i=>i.extensions.includes(n));return t?{ok:!0,media:t}:{ok:!1,code:"UNSUPPORTED_MEDIA",allowlist:q.flatMap(i=>i.extensions)}}function w(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`}function Me(e,n,t){return Y({source_id:e,source_cid:"sha256:".padEnd(71,"0"),doc_kind:n,numbered_text:V(t)})}var Q=2e3;function Be(e){let t=A(e,ee(e)).toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^[^a-z0-9]+/,"");return B(t),t}function qe(e){let n=/^(.*?)[-_.]?v?\d+$/.exec(e);if(!n)return null;let t=(n[1]??"").replace(/[-_.]+$/,"");return t.length>0&&t!==e?t:null}function te(e){let n=ke(e,"meta.json");return ve(n)?{created:!1}:(he(e,{recursive:!0}),we(n,JSON.stringify({schema:L,canonicalizer:"v1"},null,2)+`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as R}from"./chunk-TDPWFYTJ.js";import{a as x}from"./chunk-
|
|
2
|
+
import{a as R}from"./chunk-TDPWFYTJ.js";import{a as x}from"./chunk-GESZSIB6.js";import{d as S}from"./chunk-4JRCAHHB.js";import{a as y}from"./chunk-MMBBQ4OZ.js";import{a as p}from"./chunk-RBVLIMOV.js";import{d as g,i as E}from"./chunk-UQ6A52ML.js";import{spawn as M,execSync as h}from"child_process";import{appendFileSync as b,existsSync as m,mkdirSync as C}from"fs";import{homedir as L}from"os";import{join as V,resolve as s,dirname as v,delimiter as T}from"path";import{fileURLToPath as U}from"url";import{createInterface as I}from"readline";async function*A(e){let n=I({input:e,crlfDelay:1/0});for await(let r of n){let o=r.trim();if(o)try{let i=JSON.parse(o);i&&typeof i.type=="string"&&(yield i)}catch{}}}function O(e){return e==="action"?{set:{V16_AGENT_ENABLE_ALL_BLOCKERS:"true",V16_BIFURCATION_PHASES:"1"},unset:["V16_NETWORK_WS","V16_NETWORK_SSE"]}:{set:{V16_BIFURCATION_PHASES:"1"},unset:["V16_AGENT_ENABLE_ALL_BLOCKERS","V16_NETWORK_WS","V16_NETWORK_SSE"]}}function w(e){return e?{set:{},unset:["V16_AGENT_SKIP_CP_FINAL"]}:{set:{V16_AGENT_SKIP_CP_FINAL:"true"},unset:[]}}function N(e){return e==="dom"?{set:{V16_AGENT_ENABLE_TEXTUAL_VISUAL:"true"},unset:[]}:{set:{},unset:["V16_AGENT_ENABLE_TEXTUAL_VISUAL"]}}var c=v(U(import.meta.url));function k(){for(let e of["python3","python"])try{return h(`${e} --version`,{stdio:"ignore"}),e}catch{}return null}function D(){let n=process.platform==="win32"?"v16-runner.exe":"v16-runner",r={"darwin-arm64":["@testmuai/kane-cli-darwin-arm64","@lambdatestincprivate/kane-cli-darwin-arm64"],"darwin-x64":["@testmuai/kane-cli-darwin-x64","@lambdatestincprivate/kane-cli-darwin-x64"],"linux-x64":["@testmuai/kane-cli-linux-x64","@lambdatestincprivate/kane-cli-linux-x64"],"linux-arm64":["@testmuai/kane-cli-linux-arm64","@lambdatestincprivate/kane-cli-linux-arm64"],"win32-x64":["@testmuai/kane-cli-win-x64","@lambdatestincprivate/kane-cli-win-x64"]},o=`${process.platform}-${process.arch}`,i=r[o];if(i)for(let t of i){let a=[s(c,"..","node_modules",t,"bin",n),s(c,"..","..","node_modules",t,"bin",n),s(c,"..","..","..","node_modules",t,"bin",n),s(c,"..","..","..","..","node_modules",t,"bin",n)];for(let u of a)if(m(u))return{cmd:u,args:[]}}let d=[s(c,"bin",n),s(c,"..","bin",n),s(c,"..","..","..","..","v16-runner","dist",n),s(c,"..","..","..","v16-runner","dist",n),s(c,"..","..","v16-runner","dist",n),s(process.cwd(),"v16-runner","dist",n),s(process.cwd(),"..","v16-runner","dist",n)];for(let t of d)if(m(t))return{cmd:t,args:[]};let l=[s(c,"..","..","v16-runner"),s(c,"..","..","..","..","v16-runner"),s(c,"..","..","..","v16-runner"),s(process.cwd(),"v16-runner"),s(process.cwd(),"..","v16-runner")];for(let t of l)if(m(s(t,"main.py"))){for(let u of[s(t,".venv","bin","python"),s(t,"..",".venv","bin","python"),s(t,"..","browser-agent",".venv","bin","python")])if(m(u))return{cmd:u,args:["main.py"],cwd:t};let a=k();if(a)return{cmd:a,args:["main.py"],cwd:t}}return null}function P(e){return e?V(L(),".testmuai","kaneai","sessions",e,"runner-stderr.log"):null}function K(e){let n=M(e.runner.cmd,e.runner.args,{stdio:["pipe","pipe","pipe"],env:e.env,cwd:e.runner.cwd});n.stdin.on("error",()=>{});let r=P(e.sessionId);if(r)try{C(v(r),{recursive:!0})}catch{}let o=1e5,i="";n.stderr.on("data",u=>{if(i+=u.toString(),i.length>o&&(i=i.slice(-o)),r)try{b(r,u)}catch{}}),n.on("error",u=>{e.log?.("error","RUNNER_SPAWN_ERROR","Runner spawn error",{error:u.message})});let d=null,l=null,t=new Promise(u=>{n.on("close",(f,_)=>{d=f,l=_?String(_):null,e.log?.("info","RUNNER_EXIT","Runner exited",{code:f,signal:l??"none"}),u({code:f,signal:l})})}),a=A(n.stdout);return{child:n,events:a,getStderr:()=>i,getExitCode:()=>d,getExitSignal:()=>l,exited:t}}async function B(e,n){if(!n?.platform||!n.target_kind)return;let r=await S(n.platform)?.toolEnv(n.target_kind)??{dirs:[]};if(r.dirs.length>0&&(e.PATH=[...r.dirs,e.PATH??""].filter(Boolean).join(T)),r.appiumHome&&(e.APPIUM_HOME=r.appiumHome),r.wdaRoot&&(e.TESTMU_IOS_WDA_DERIVED_DATA=r.wdaRoot),n.platform==="android"){let o=y();o&&(e.PATH=[o.platformToolsDir,e.PATH??""].filter(Boolean).join(T),e.ANDROID_HOME=o.root,e.ANDROID_SDK_ROOT=o.root)}}function H(e){let n={...process.env};e.environment&&(n.TESTMUAI_ENV=e.environment),n.TESTMUAI_SOURCE="kane-cli",process.platform==="win32"&&(n.PYTHONIOENCODING="utf-8",n.PYTHONUTF8="1");let r=p(e.environment);n.V16_SERVER_API_HOST=r.v16ServerHost,n.ATMS_URL=r.tmsBaseUrl.replace(/\/api\/?$/,""),e.username&&e.accessKey&&(n.LT_USERNAME=e.username,n.LT_ACCESS_KEY=e.accessKey),e.sessionId&&(n.TESTMUAI_SESSION_ID=e.sessionId);let o=O(e.mode??"testing");Object.assign(n,o.set);for(let a of o.unset)delete n[a];let i=new x().load(),d=N(e.assertionMode??(i.assertion_mode==="visual"?"visual":"dom"));Object.assign(n,d.set);for(let a of d.unset)delete n[a];let l=e.finalValidation??i.final_validation,t=w(l);Object.assign(n,t.set);for(let a of t.unset)delete n[a];return n}function G(e,n){let r=p(n?.environment),o=R();o!==void 0&&e.ap_mode===void 0&&(e.ap_mode=o),e.telemetry_proxy_url===void 0&&process.env.KANE_TELEMETRY!=="0"&&(e.telemetry_proxy_url=E),e.media_upload===void 0&&e.org_id&&e.username&&e.access_key&&(e.media_upload={url:r.shareApiBaseUrl.replace(/\/$/,"")+"/mfs/v1.0/media/upload",artefacts_host:r.mediaArtefactsHost,org_id:e.org_id,media_dir:g})}async function oe(e,n){let r=D();if(!r)throw new Error("v16-runner not found. Build the binary with `cd v16-runner && python build.py` or ensure Python is available.");process.env.KANE_SPAWN_DEBUG&&process.stderr.write(`[spawn-debug] ${JSON.stringify(r)}
|
|
3
3
|
`);let o=H({environment:n?.environment,mode:n?.mode,assertionMode:n?.assertionMode,finalValidation:n?.finalValidation,username:e.username,accessKey:e.access_key,sessionId:e.session_id});e.device?.platform&&await B(o,e.device),G(e,{environment:n?.environment});let i=K({env:o,runner:r,log:n?.log,sessionId:e.session_id}),d=i.child;d.stdin.write(JSON.stringify(e)+`
|
|
4
4
|
`);let l=P(e.session_id);if(l)try{C(v(l),{recursive:!0}),b(l,`--- runner spawn ${new Date().toISOString()} run_index=${e.run_index} ---
|
|
5
5
|
`)}catch{}return{child:d,events:i.events,sendUserResponse(t){let a=JSON.stringify({type:"user_response",answer:t});try{d.stdin.write(a+`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as y}from"./chunk-
|
|
2
|
+
import{a as y}from"./chunk-RBVLIMOV.js";import{createServer as b}from"http";import{createReadStream as C,promises as S}from"fs";import{randomBytes as R}from"crypto";var u="127.0.0.1";function A(n,e){if(!n)return null;let o=/^bytes=(\d*)-(\d*)$/.exec(n.trim());if(!o)return null;let[,a,r]=o;if(a===""&&r==="")return null;if(a===""){let i=Number(r);return i===0||e===0?"unsatisfiable":{start:Math.max(0,e-i),end:e-1}}let t=Number(a);if(t>=e)return"unsatisfiable";let c=r===""?e-1:Math.min(Number(r),e-1);return c<t?null:{start:t,end:c}}async function I(n){let e=R(16).toString("hex"),o=b((r,t)=>{H(r,t,n,e).catch(()=>t.destroy())});await new Promise((r,t)=>{o.once("error",t),o.listen(n.port??0,u,()=>{o.removeListener("error",t),r()})});let a=o.address().port;return{port:a,urlFor:r=>`http://${u}:${a}/${e}/${encodeURIComponent(r)}`,close:()=>new Promise(r=>{o.close(()=>r()),o.closeAllConnections()})}}async function H(n,e,o,a){let r=n.url??"/",t=s=>{try{o.log?.("warn","EVIDENCE_SERVE_DENIED",{reason:s,path:r})}catch{}};if(n.headers.host!==`${u}:${n.socket.localPort}`){t("host_mismatch"),e.writeHead(403).end();return}let c=n.headers.origin;if(c!==void 0&&!o.allowedOrigins.includes(c)){t("origin_denied"),e.writeHead(403).end();return}let i=c?{"Access-Control-Allow-Origin":c,Vary:"Origin","Access-Control-Expose-Headers":"Content-Range, Content-Length"}:{};if(n.method==="OPTIONS"){let s={...i,"Access-Control-Allow-Methods":"GET, HEAD, OPTIONS","Access-Control-Allow-Headers":"range","Access-Control-Max-Age":"86400"};n.headers["access-control-request-private-network"]==="true"&&(s["Access-Control-Allow-Private-Network"]="true"),e.writeHead(204,s).end();return}if(n.method!=="GET"&&n.method!=="HEAD"){e.writeHead(405,i).end();return}let v;try{let s=new URL(n.url??"/",`http://${u}`).pathname.split("/");if(s.length!==3||s[1]!==a){t("bad_token"),e.writeHead(404,i).end();return}v=decodeURIComponent(s[2])}catch{t("not_found"),e.writeHead(404,i).end();return}let g=o.packs.get(v);if(!g){t("not_found"),e.writeHead(404,i).end();return}let d;try{let s=await S.stat(g);if(!s.isFile())throw new Error("not a file");d=s.size}catch{t("not_found"),e.writeHead(404,i).end();return}let h={...i,"Accept-Ranges":"bytes","Content-Type":"application/zip","Cache-Control":"no-store"};if(n.method==="HEAD"){e.writeHead(200,{...h,"Content-Length":String(d)}).end();return}let l=A(n.headers.range,d);if(l==="unsatisfiable"){t("unsatisfiable"),e.writeHead(416,{...i,"Content-Range":`bytes */${d}`}).end();return}let[m,p,w]=l===null?[0,d-1,200]:[l.start,l.end,206],E={...h,"Content-Length":String(p-m+1)};if(w===206&&(E["Content-Range"]=`bytes ${m}-${p}/${d}`),e.writeHead(w,E),d===0){e.end();return}let f=C(g,{start:m,end:p});f.on("error",()=>e.destroy()),e.on("close",()=>f.destroy()),f.pipe(e)}function O(n,e){return(e??y(n).evidenceViewerUrl).replace(/\/+$/,"")}function k(n,e){return`${e}/?pack=${encodeURIComponent(n)}`}function P(n){return`evidence: view locally with \`kane-cli evidence serve ${n}\``}export{A as a,I as b,O as c,k as d,P as e};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as G}from"./chunk-HS7OIRGU.js";import{a as A,b as C}from"./chunk-UJZZDPDY.js";import{a as x}from"./chunk-BZAGVBCX.js";import{a as S}from"./chunk-LSDWPG6C.js";import{P as v,Q as w,S as U}from"./chunk-QX5LJVTD.js";import{B as $,z as E}from"./chunk-IICT4VOU.js";import{f as d,g as m}from"./chunk-XLSOQLVT.js";var k=new Set([d.USECASE,d.SCENARIO,d.AC,d.TEST]);function b(e,t){return!e.superseded.has(t)&&e.trust.get(t)!=="archived"}function h(e,t,n){let s=e.edgesFrom(t).find(o=>o.type===n);return s?e.tipOf(s.dst):null}function O(e,t,n){if(n===d.USECASE)return t;if(n===d.SCENARIO)return h(e,t,m.BELONGS_TO);if(n===d.AC){let s=h(e,t,m.SCOPED_TO);return s?e.nodeLabel.get(s)===d.USECASE?s:h(e,s,m.BELONGS_TO):null}if(n===d.TEST){let s=h(e,t,m.AUTOMATES);return s?h(e,s,m.BELONGS_TO):null}return null}function L(e,t){let n=e.nameOf.get(t);if(n)return n;for(let[s,o]of e.names)if(e.tipOf(o)===t)return s;return t}function F(e,t){return{ucTip:t,display:L(e,t),seamRef:e.nameOf.get(t)??t}}function N(e,t){let n=e.resolve(t);if(!n)return{ok:!1,message:`unknown ref '${t}' \u2014 no test/scenario/ac/use-case by that id or cid`};let s=n.tip,o=e.nodeLabel.get(s);if(!o||!k.has(o))return{ok:!1,message:`'${t}' is a ${o??"missing node"} \u2014 evolve takes a test, scenario, acceptance criterion, or use-case`};let a=O(e,s,o);return!a||e.nodeLabel.get(a)!==d.USECASE?{ok:!1,message:`cannot resolve '${t}' to a parent use-case \u2014 its ${o} chain is broken`}:e.superseded.has(a)?{ok:!1,message:`use-case ${L(e,a)} was removed \u2014 nothing to evolve`}:{ok:!0,target:F(e,a)}}function Z(e,t){return D(e,t)}function D(e,t){let n=[];for(let{cid:o}of e.byLabel(d.SCENARIO)){if(!b(e,o)||!e.edgesFrom(o).some(r=>r.type===m.BELONGS_TO&&e.tipOf(r.dst)===t))continue;let a=e.edgesInto(o).filter(r=>r.type===m.AUTOMATES&&b(e,r.src));if(a.length===0)n.push({scenario:o,test:null});else for(let r of a)n.push({scenario:o,test:r.src})}let s=new Map;for(let{cid:o}of e.byLabel(d.AC)){if(!b(e,o)||O(e,o,d.AC)!==t)continue;let a=e.edgesInto(o).filter(r=>r.type===m.VERIFIES&&b(e,r.src)).map(r=>r.src).sort();s.set(o,a)}return{pairs:n,verifies:s}}function B(e,t){let n=r=>`${r.scenario}\0${r.test??""}`,s=new Set(e.pairs.map(n)),o=new Set(t.pairs.map(n)),a=[];for(let[r,i]of e.verifies){let u=t.verifies.get(r);u&&(i.length===u.length&&i.every((l,g)=>l===u[g])||a.push({ac:r,before:i,after:u}))}return{superseded:e.pairs.filter(r=>!o.has(n(r))),minted:t.pairs.filter(r=>!s.has(n(r))),retained:t.pairs.filter(r=>s.has(n(r))),moves:a}}function _(e,t,n,s,o){let a=i=>t.nameOf.get(i)??i,r=i=>` - ${a(i.scenario)} \xB7 ${i.test?a(i.test):"(no test)"}`;e.out(`evolved: use-case ${n} \u2014 design record ${s.before} \u2192 ${s.after}`),e.out(` superseded ${o.superseded.length} pair(s)`);for(let i of o.superseded)e.out(r(i));e.out(` minted ${o.minted.length} pair(s)`);for(let i of o.minted)e.out(r(i));e.out(` retained ${o.retained.length} pair(s)`);for(let i of o.retained)e.out(r(i));if(o.moves.length===0)e.out(" verifies none moved");else{e.out(" verifies moved:");for(let i of o.moves){let u=l=>l.length>0?l.map(a).join(" + "):"(none)";e.out(` - ${a(i.ac)}: ${u(i.before)} \u2192 ${u(i.after)}`)}}}async function R(e,t,n,s,o,a,r){let i=E(e),u=S(i,t.ucTip);if(!u)return a==="batch"?(s.out(`note: ${t.display} has no design output \u2014 nothing to evolve; run kane-cli design tests --use-case ${t.display} first`),{code:0,outcome:"no-design"}):(v(s,`nothing to evolve \u2014 run kane-cli design tests --use-case ${t.display} first (no design output)`),{code:2,outcome:"no-design"});let l=D(i,t.ucTip),g=[`evolve ${t.display}`,` re-designs use-case ${t.display}`,` affects ${l.pairs.length} pair(s)`,...n.because?[` because ${n.because}`]:[]];if(n.yes)for(let y of g)s.out(y);else{for(let I of g)s.out(I);if(!await s.confirm(`proceed with the re-design of ${t.display}?`))return s.out(a==="batch"?`skipped ${t.display}`:"declined \u2014 nothing evolved"),{code:0,outcome:"declined"}}let p=G(e,i,t.ucTip,n.because),c=await A(r,{verb:"evolve",subject:t.display},()=>o(t.seamRef,{yes:!!n.yes,...n.mode?{mode:n.mode}:{},...n.because?{because:n.because}:{},...p!==void 0?{changeDelta:p.change_delta,priorDesign:p.prior_design}:{}}),y=>({ok:y===0,exitCode:y}));if(c===3)return s.out(`design session for ${t.display} paused \u2014 resume with \`kane-cli design tests --resume\`, then re-run evolve for the diff`),{code:c,outcome:"paused"};if(c!==0)return v(s,`design run for ${t.display} ended with exit code ${c} \u2014 no diff to report`),{code:c,outcome:"failed"};let f=E(e),T=f.tipOf(t.ucTip),P=S(f,T)?.seq;return _(s,f,t.display,{before:u.seq,after:P??"?"},B(l,D(f,T))),{code:0,outcome:"evolved"}}function j(e){let t=new Map,n=0;for(let{cid:o,state:a}of e.staleList()){if(a==="superseded")continue;let r=e.nodeLabel.get(o);if(!r||!k.has(r)||!b(e,o)||!$(e,o))continue;let i=O(e,o,r);!i||e.nodeLabel.get(i)!==d.USECASE||e.superseded.has(i)||(n++,t.has(i)||t.set(i,F(e,i)))}return{targets:[...t.values()].sort((o,a)=>o.display<a.display?-1:o.display>a.display?1:0),staleCount:n}}function M(e,t){for(let{cid:n,state:s}of e.staleList()){if(s==="superseded")continue;let o=e.nodeLabel.get(n);if(!(!o||!k.has(o)||!b(e,n))&&$(e,n)&&O(e,n,o)===t)return!0}return!1}async function q(e,t,n,s={},o=process.cwd()){if(e&&t.fromStale)return v(n,"pass a <ref> OR --from-stale, not both"),2;if(!e&&!t.fromStale)return v(n,"evolve needs a <ref> or --from-stale"),2;let a=w(o,n);if(!a)return 2;let r=s.runDesignForUc??Y,i=s.onChild??(n.isTTY?V(n):void 0);n.out(`evolving ${e??"stale use-cases"}: reading the graph\u2026`);let u=E(a),l,g=null;if(e){let c=N(u,e);if(!c.ok)return v(n,c.message),2;if(!t.because&&S(u,c.target.ucTip)&&!M(u,c.target.ucTip))return v(n,`nothing changed underneath ${e} \u2014 its sources and requirements are current; use --because "<reason>" to re-design anyway`),2;l=[c.target]}else{let{targets:c,staleCount:f}=j(u);if(c.length===0)return n.out("nothing stale \u2014 nothing to evolve"),0;g=`from-stale: ${f} stale node(s) \u2192 ${c.length} use-case(s)`,l=c}if(!t.yes&&!n.isTTY)return v(n,"evolve needs a TTY \u2014 the blast-radius confirm is the point; headless evolution rides `kane-cli maintain reconcile`"),2;if(g&&n.out(g),e){let c=await R(a,l[0],t,n,r,"single",i);return c.outcome==="evolved"&&t.because&&x(a,{ts:new Date().toISOString(),command:"evolve",id:e,verdict:"gap-resolved-evolve",polarity:"preference",by:{kind:"human",id:process.env.USER??"operator"},target:e,reason:t.because}),c.code}let p=0;for(let c of l){let{code:f}=await R(a,c,t,n,r,"batch",i);f!==0&&p===0&&(p=f)}return p}function V(e){let t="",n="evolve";return s=>{s.kind==="start"?(t=s.subject,n=s.verb,e.out(`\u25CF ${C(s.verb).ing} ${s.subject}`)):s.kind==="end"&&e.out(s.ok?`\u25CF ${C(n).ed} ${t} \u2014 ${s.durS}s`:`\u25CF ${n} failed \u2014 ${s.exitCode!=null?`exited ${s.exitCode}`:"error"}${s.fixCmd?` \xB7 ${s.fixCmd}`:""}`)}}var Y=async(e,t)=>{let{designTestsCommand:n}=await import("./bind-IHLHM5UM.js"),s=()=>n({useCase:e,force:!0,...t.mode?{mode:t.mode}:t.yes?{mode:"override"}:{},...t.because?{because:t.because}:{},...t.changeDelta!==void 0?{changeDelta:t.changeDelta}:{},...t.priorDesign!==void 0?{priorDesign:t.priorDesign}:{}});if(t.mode!=="agent")return s();let o=process.stdout.write;process.stdout.write=((...a)=>!0);try{return await s()}finally{process.stdout.write=o}};async function ee(e,t){return q(e,t,U(),{})}export{N as a,Z as b,R as c,j as d,q as e,Y as f,ee as g};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as C,b as F,c as B}from"./chunk-
|
|
2
|
+
import{a as C,b as F,c as B}from"./chunk-WESMQEPO.js";import{f as w,g as h}from"./chunk-XLSOQLVT.js";var z={window:10,latest_only:!1,stale_at_run_weight:.5,counted_verdicts:["passed","failed"],accepted_oracle_modes:["authored","inferred","runtime-derived"],verified_threshold:.5,min_passes:1,risk_weights:{high:3}},Y={window:10,latest_only:!0,stale_at_run_weight:0,counted_verdicts:["passed","failed"],accepted_oracle_modes:["authored","inferred"],verified_threshold:1,min_passes:1,risk_weights:{high:3}},K={lenient:z,strict:Y};function Q(e,t){let s=e.slice(-t.window),o=new Map;for(let d of s)o.set(d.execution_id,d);let c=[...o.values()].sort((d,a)=>d.ts<a.ts?-1:d.ts>a.ts?1:d.execution_id<a.execution_id?-1:1).filter(d=>t.counted_verdicts.includes(d.verdict)&&t.accepted_oracle_modes.includes(d.oracle_mode));return t.latest_only&&c.length>1?[c[c.length-1]]:c}function Z(e,t){let s=Q(e,t),o=0,c=0,d=0;for(let l of s){let b=l.stale_at_run?t.stale_at_run_weight:1;o+=b,l.verdict==="passed"&&(c+=b,d++)}let a=o>0?Math.round(c/o*100)/100:0;return{score:a,verified:a>=t.verified_threshold&&d>=t.min_passes,passes:d,counted:s.length}}function U(e,t){let s=0,o=0;for(let c of e){let d=t[c.risk]??1;s+=d,c.verified&&(o+=d)}return s>0?Math.round(o/s*100):0}function ee(e,t){let s={},o={},c=[],d=0;for(let a of e.usecases){let l=[];for(let i of a.acceptance_criteria){let _=Z(i.executions??[],t);s[i.id]=_;let m={risk:i.risk,verified:_.verified};l.push(m),c.push(m)}let b=l.filter(i=>i.verified).length,n=l.length>0&&b===l.length?"covered":b>0?"partial":"uncovered";n==="covered"&&d++,o[a.id]={status:n,pct:U(l,t.risk_weights)}}return{config:t,acs:s,usecases:o,summary:{coverage_pct:U(c,t.risk_weights),acs_verified:`${c.filter(a=>a.verified).length}/${c.length}`,usecases_covered:`${d}/${e.usecases.length}`,uncovered:Object.values(o).filter(a=>a.status==="uncovered").length}}}function pe(e,t=K){return{rollup_version:1,stale_sources:new Set(e.usecases.flatMap(s=>s.stale_sources??[])).size,high_risk_gaps:(e.gaps??[]).filter(s=>s.risk==="high").length,aspects:Object.fromEntries(Object.entries(t).map(([s,o])=>[s,ee(e,o)]))}}var P={high:3};function ge(e){let t=e.byLabel(w.USECASE).filter(({cid:n})=>C(e,n)),s=new Map(t.map(({cid:n})=>[n,[]]));for(let{cid:n,content:i}of e.byLabel(w.AC)){if(!C(e,n))continue;let _=B(e,n),m=_?s.get(_):void 0;m&&m.push({risk:String(i.risk??""),designed:F(e,n),stale:e.stale(n)!=="fresh"})}let o={},c=[],d=0,a=0,l=0,b=0;for(let{cid:n}of t){let i=s.get(n),_=i.map(v=>({risk:v.risk,verified:v.designed}));c.push(..._),a+=i.length;let m=i.filter(v=>v.designed).length;d+=m;let x=i.filter(v=>v.stale).length,A=e.edgesInto(n).some(v=>v.type===h.BELONGS_TO&&C(e,v.src));A||b++;let k=i.length===0||m===0?"undesigned":m===i.length&&x===0&&A?"complete":"partial";k==="complete"&&l++,o[e.displayNameOf(n)??n]={pct:U(_,P),status:k,staleAcs:x}}return{pct:U(c,P),acs_designed:`${d}/${a}`,usecases_complete:`${l}/${t.length}`,ucs_needing_scenarios:b,perUc:o,config:{criterion:"live_verifies_edge",risk_weights:{high:3},freshness:"not_discounted"}}}var y=(e,t)=>e.nameOf.get(t)??t,R=(e,t)=>!e.superseded.has(t);function te(e,t){return e.byLabel(w.SCENARIO).filter(({cid:s})=>R(e,s)).filter(({cid:s})=>e.edgesFrom(s).some(o=>o.type===h.BELONGS_TO&&e.tipOf(o.dst)===t)).map(({cid:s})=>s)}function se(e,t,s){let o=[];for(let{cid:c}of e.byLabel(w.AC)){if(!R(e,c))continue;let d=e.edgesFrom(c).find(l=>l.type===h.SCOPED_TO);if(!d)continue;let a=e.tipOf(d.dst);a===t?o.push({cid:c,scope:{type:"usecase",ref:y(e,t)}}):s.has(a)&&o.push({cid:c,scope:{type:"scenario",ref:y(e,a)}})}return o}function ne(e){let t=e.filter(s=>s!==void 0).map(s=>s.execution);return t.includes("failed")?"failed":t.includes("blocked")?"blocked":t.includes("passed")?"passed":"not-run"}var ie={passed:"passed",failed:"failed",broken:"blocked",skipped:"not-run"};function re(e,t,s,o){return t?.find(c=>c.ac_cid&&s?e.tipOf(c.ac_cid)===e.tipOf(s):c.ac_ref===o)?.verdict}function oe(e,t){let s=t.flatMap(o=>o?.acs??[]).filter(o=>o.ref===e).map(o=>ie[o.verdict]??"not-run");return s.length===0?ne(t):s.includes("failed")?"failed":s.includes("blocked")?"blocked":s.includes("passed")?"passed":"not-run"}function be(e){return ce(e,new Map)}function ce(e,t,s){let o=s?.scope==="run",c=[],d=new Set,a=new Map;for(let[n,i]of e.nameOf)a.set(e.tipOf(n)??n,i);let l=n=>a.get(n)??y(e,n);for(let{cid:n,content:i}of e.byLabel(w.USECASE)){if(!R(e,n)||e.trust.get(n)==="archived")continue;let _=e.tipOf(n),m=e.derivesInto(_).filter(r=>!e.superseded.has(r.ecid)),x=[...new Set(m.map(r=>String(r.props?.source_id??"")).filter(Boolean))].sort(),A=x.map(r=>{let p=e.heads.get(r);if(typeof p!="string")return{id:r};let f=e.getNode(p)?.content.blob;return{id:r,media_type:e.mediaOf(p).media_type,...typeof f=="string"?{cid:f}:{}}}),k=m[0],v=new Map;for(let r of m)r.props?.source_id&&r.props?.source_cid&&v.set(String(r.props.source_id),String(r.props.source_cid));let M=x.filter(r=>{let p=e.heads.get(r),f=v.get(r);return p!=null&&f!==void 0&&p!==f}).sort(),T=e.edgesFrom(n).filter(r=>r.type===h.DEPENDS_ON&&!e.superseded.has(r.ecid)).map(r=>ue(e,r.dst)).filter(r=>r!==null).sort(),D=te(e,_),W=new Set(D),q=D.map(r=>{let p=e.getNode(r)?.content??{},f=e.edgesFrom(r).filter(S=>S.type===h.EXERCISES&&!e.superseded.has(S.ecid)&&R(e,e.tipOf(S.dst))).map(S=>y(e,e.tipOf(S.dst))).sort();return{id:y(e,r),case_type:String(p.case_type??""),intent:String(p.intent??""),exercises:f}}).sort((r,p)=>r.id<p.id?-1:1),L=!1,E=new Set([_]);for(let r of D)E.add(r);let H=se(e,_,W).map(({cid:r,scope:p})=>{let f=e.getNode(r)?.content??{},S=[...new Set(e.edgesInto(r).filter(u=>u.type===h.VERIFIES&&!e.superseded.has(u.ecid)).map(u=>e.tipOf(u.src)).filter(u=>!!u&&R(e,u)))].sort((u,g)=>l(u)<l(g)?-1:1),G=S.length>0,N=S.map(u=>t.get(`id:${l(u)}`)??t.get(`def:${String(e.getNode(u)?.content.definitionId??"")}`)),$=N.some(u=>u!==void 0);$&&(L=!0),E.add(r);for(let u of S)E.add(u);let J=G&&!$?"unknown":e.stale(r)==="fresh"?"fresh":"stale",O=f.expected_answer??{},I=y(e,r),j=S.flatMap(u=>(e.execHistory?.(l(u))??[]).map(g=>({execution_id:String(g.execution_id),ts:String(g.started_at),verdict:String(re(e,g.per_ac,r,I)??g.verdict),stale_at_run:!!g.stale_at_run,oracle_mode:String(g.oracle_mode),...g.via_parent?{via_parent:String(g.via_parent)}:{}}))).sort((u,g)=>u.ts<g.ts?-1:1).slice(-10);return{id:I,text:String(f.text??""),risk:String(f.risk??""),scope:p,covered_by:S.map(u=>l(u)),...G?{link_type:"verifies"}:{},execution:oe(I,N),fresh:J,derived:!!f.derived,...f.kind||f.expected_answer?{expected_answer:{...f.kind?{kind:String(f.kind)}:{},statement:String(f.text??""),...O.operator!==void 0?{operator:O.operator}:{},...O.operand!==void 0?{operand:O.operand}:{}}}:{},...G?{satisfied_by:S.map((u,g)=>{let X=e.getNode(u)?.content.check??{},V=N[g]?.steps?.checkStepId??X.verified_against;return{test:l(u),...V?{step:V}:{}}})}:{},...j.length?{executions:j}:{}}}).sort((r,p)=>r.id<p.id?-1:1);if(!(o&&!L)){for(let r of E)d.add(r);c.push({id:y(e,n),title:String(i.title??""),...i.description||i.summary?{description:String(i.description??i.summary)}:{},...Array.isArray(i.actors)&&i.actors.length?{actors:i.actors.map(String)}:{},...i.value?{value:String(i.value)}:{},risk:String(i.risk??""),status:e.trust.get(n)==="trusted"?"approved":"draft",sources:A,...M.length?{stale_sources:M}:{},...T.length?{depends_on:T}:{},...k?{provenance:{derived_from:`${String(k.props?.source_id??"")}#${String(k.props?.anchor??"")}`}}:{},scenarios:q,acceptance_criteria:H})}}c.sort((n,i)=>n.id<i.id?-1:1);let b=e.byLabel(w.GAP).filter(({cid:n})=>R(e,n)&&e.trust.get(n)!=="archived").filter(({content:n})=>{if(!o||typeof n.uc=="string"&&d.has(e.tipOf(n.uc)))return!0;let i=typeof n.ref=="string"?e.resolve(n.ref):null;return i!==null&&d.has(e.tipOf(i.cid))}).map(({cid:n,content:i})=>({ref:y(e,n),kind:String(i.kind??""),...i.risk?{risk:String(i.risk)}:{},...i.question?{question:de(i.question)}:{}})).sort((n,i)=>n.ref<i.ref?-1:1);return{usecases:c,...b.length?{gaps:b}:{},...o?{scope:"run"}:{}}}function de(e){if(typeof e=="string")return e;let t=e?.header;return typeof t=="string"?t:""}function ue(e,t){let s=e.tipOf(t);return e.nodeLabel.get(s)!==w.USECASE||!R(e,s)?null:y(e,s)}export{K as a,Q as b,Z as c,pe as d,ge as e,re as f,be as g,ce as h};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{e as $e}from"./chunk-
|
|
2
|
+
import{e as $e}from"./chunk-2KYJOBNI.js";import{a as te}from"./chunk-6VB4FGBZ.js";import{a as K}from"./chunk-5Y2G4NC7.js";import{a as Be}from"./chunk-ZV5KM7LI.js";import{a as ve}from"./chunk-4R5U7CHE.js";import{y as i}from"./chunk-UQ6A52ML.js";import{b as ye}from"./chunk-DFS4RMVP.js";import{a as k}from"./chunk-HCBYKLMW.js";import{a as s,b as o,i as Se,j as Te,k as ee}from"./chunk-C44QQJR4.js";import{a as V}from"./chunk-6YGTRKDT.js";import{e as R}from"./chunk-UR6MHSHU.js";var A=R(V(),1);var C=R(V(),1);function de(e){let t=e.flatMap(u=>[u,...u.children??[]]),n=t.filter(u=>u.status==="passed").length,l=t.filter(u=>u.status==="failed").length,a=t.filter(u=>u.status==="passed"||u.status==="failed").length;return{passed:n,failed:l,total:a}}function we(e){let t=$e(e.screenshotDispatcher,e.stepLogger,e.onReasoning,e.onStepComplete),[n,l]=(0,C.useState)(0),[a,u]=(0,C.useState)("idle"),c=(0,C.useRef)("idle"),v=(0,C.useRef)(0),S=(0,C.useRef)(!1),T=(0,C.useRef)(null),d=(0,C.useRef)(null),L=(0,C.useCallback)(h=>{c.current=h,u(h)},[]),O=(0,C.useCallback)(async h=>{let b=await e.getNextConfig(h);if(!b){L("done"),e.onAllComplete?.();return}let B=h?v.current+1:0;v.current=B,l(B),e.onStepStart?.(b,B),T.current=null,d.current=null,L("running"),await t.startRun(b,e.spawnOpts)},[t,e,L]);(0,C.useEffect)(()=>{S.current||(S.current=!0,O(null))},[]),(0,C.useEffect)(()=>{if(!t.lastRunEnd||t.lastRunEnd===T.current||c.current!=="running")return;T.current=t.lastRunEnd,c.current="transitioning",u("transitioning");let h=t.lastRunEnd,b=de(t.steps),B=t.bifurcationInfo,F={status:h.status==="passed"?"passed":"failed",duration_s:h.duration??0,reason:h.reason,runEnd:h,hadError:!1,stepsPassed:b.passed,stepsFailed:b.failed,stepsTotal:b.total,bifurcationFlows:B&&!B.isSingleFlow?B.flows:null,evidence:t.getEvidenceState()};if(!(e.onStepEnd?.(F,v.current)??!0)){L("done"),e.onAllComplete?.();return}O(F)},[t.lastRunEnd]),(0,C.useEffect)(()=>{if(!t.runError||t.runError===d.current||t.lastRunEnd||c.current!=="running")return;d.current=t.runError,c.current="transitioning",u("transitioning");let h=de(t.steps),b={status:"failed",duration_s:0,reason:t.runError,runEnd:null,hadError:!0,stepsPassed:h.passed,stepsFailed:h.failed,stepsTotal:h.total,bifurcationFlows:null,evidence:t.getEvidenceState()};if(!(e.onStepEnd?.(b,v.current)??!0)){L("done"),e.onAllComplete?.();return}O(b)},[t.runError,t.lastRunEnd]);let y=(0,C.useCallback)(()=>{t.cancelRun()},[t]);return{runner:t,currentStepIndex:n,phase:a,cancel:y}}var pe=R(V(),1);var ne=R(k(),1),Ee=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function ke({label:e,hasBifurcation:t=!1}){let[n,l]=(0,pe.useState)(0),[a,u]=(0,pe.useState)(0);K(()=>{l(v=>(v+1)%Ee.length)},80),K(()=>{u(v=>(v+1)%4)},400);let c=e??(t?"Planning approach":"Analyzing objective");return(0,ne.jsxs)(s,{marginLeft:1,children:[(0,ne.jsxs)(o,{color:i.orange,children:[Ee[n]," "]}),(0,ne.jsxs)(o,{color:i.dim,children:[c,".".repeat(a+1)]})]})}function Ie(e){if(!e.isRunning||e.replayInfo)return null;let t=e.bifurcationInfo;if(t&&!t.isSingleFlow){let n=e.steps.findIndex(a=>a.status==="running");return(n===-1?e.cmInitCounts.length===0:n>=e.cmInitCounts.length)?{label:n>0?`Planning flow ${n+1}`:void 0,hasBifurcation:!0}:null}return e.cmInitCounts.length>0||e.steps.some(n=>n.children?.length)?null:{hasBifurcation:!!t}}var I=R(V(),1);var Ce=R(V(),1);var re=R(k(),1),He="#ffc580",Ue="#ffd9a8",Le="#ffffff";function oe({text:e,active:t=!0}){let[n,l]=(0,Ce.useState)(0),a=4;if(K(()=>{l(c=>(c+1)%(e.length+a*2))},t?80:null),!t)return(0,re.jsx)(o,{color:Le,children:e});let u=e.split("").map((c,v)=>{let S=n-a,T=Math.abs(v-S-a/2),d;return T<=a/2?d=He:T<=a?d=Ue:d=Le,(0,re.jsx)(o,{color:d,children:c},v)});return(0,re.jsx)(o,{children:u})}var _=R(k(),1),We={starting:i.orange,running:i.orange,passed:i.green,failed:i.red,cancelled:i.dim,timed_out:i.orange};function ie({currentStep:e,maxSteps:t,elapsed:n,status:l}){let a=We[l]??i.orange,u=n<60?`${n.toFixed(1)}s`:`${Math.floor(n/60)}m ${Math.round(n%60)}s`;return(0,_.jsxs)(s,{marginLeft:3,children:[(0,_.jsx)(o,{color:i.dim,children:"Steps "}),(0,_.jsx)(o,{bold:!0,children:e}),(0,_.jsxs)(o,{color:i.dim,children:["/",t]}),(0,_.jsx)(o,{children:" "}),(0,_.jsx)(o,{color:i.dim,children:"Elapsed "}),(0,_.jsx)(o,{bold:!0,children:u}),(0,_.jsx)(o,{children:" "}),(0,_.jsx)(o,{color:i.dim,children:"Status "}),(0,_.jsx)(o,{bold:!0,color:a,children:l})]})}var Ve={click:"\u25CF",type:"\u229E",scroll:"\u2195",navigate:"\u2192",analyze:"\u25CE",assert:"\u25C8","if-else":"\u2442",select:"\u25BC",press_key:"\u21B5",wait:"\u2026",tool_call:"\u2299"};function Oe(e){return Ve[e]??"\u25CF"}var q=R(k(),1);function fe({steps:e,flows:t,cmInitCounts:n,renderStep:l}){return(0,q.jsxs)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:[(0,q.jsxs)(o,{color:i.dim,children:["\u2501\u2501 Bifurcated into ",t?.length??e.length," flows \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"]}),e.map((a,u)=>(0,q.jsxs)(s,{flexDirection:"column",marginTop:u>0?1:0,children:[(0,q.jsxs)(o,{color:i.orange,children:["Flow ",u+1,": ",t?.[u]??a.objective]}),n&&n[u]!=null&&(0,q.jsxs)(o,{color:i.dim,children:[" \u25AA Generated task with ",n[u]," checkpoints"]}),a.children&&a.children.length>0?a.children.map(c=>{let v=!!c.branchObjective,S=`f${u}-${c.childId??"p"}-${c.index}`;return v?(0,q.jsxs)(s,{flexDirection:"column",children:[l({...c,children:void 0},S),(c.children??[]).map(T=>(0,q.jsx)(s,{marginLeft:2,children:l(T,`${S}-${T.childId??"p"}-${T.index}`)},`${S}-${T.childId??"p"}-${T.index}`))]},`${S}-host`):l(c,S)}):a.status==="pending"&&(0,q.jsx)(o,{color:i.dim,children:" \u25CB Waiting..."})]},u))]})}var H=R(k(),1);function Pe({label:e,shimmer:t=!1}){return(0,H.jsxs)(s,{marginLeft:6,children:[(0,H.jsx)(te,{}),(0,H.jsx)(o,{children:" "}),t?(0,H.jsx)(oe,{text:e,active:!0}):(0,H.jsx)(o,{color:i.dim,children:e})]})}var De=R(V(),1);var me=R(k(),1);function ze(e,t){let n=[];for(let l of e.split(`
|
|
3
3
|
`)){if(l===""){n.push("");continue}let a="";for(let u of l.split(" ")){let c=u;for(;c.length>t;)a&&(n.push(a),a=""),n.push(c.slice(0,t)),c=c.slice(t);a===""?a=c:a.length+1+c.length<=t?a+=" "+c:(n.push(a),a=c)}n.push(a)}return n}function je({text:e,maxLines:t=3}){let{stdout:n}=ee(),l=Math.max(20,(n?.columns??80)-7),a=!e.trim(),[u,c]=(0,De.useState)(!0);K(()=>c(T=>!T),500);let v=(a?"Thinking\u2026":e)+(u?"\u258C":" "),S=ze(v,l).slice(-t);for(;S.length<t;)S.push("");return(0,me.jsx)(s,{borderStyle:"round",borderColor:i.muted,paddingX:1,marginLeft:3,flexDirection:"column",children:S.map((T,d)=>(0,me.jsx)(o,{color:a?i.dim:i.secondary,wrap:"truncate-end",children:T.length?T:" "},d))})}var U=R(k(),1);function se({activity:e,describe:t,describeVisible:n}){return(0,U.jsxs)(U.Fragment,{children:[e?(0,U.jsx)(Pe,{label:e.label,shimmer:e.shimmer}):null,n?(0,U.jsx)(je,{text:t??""}):null]})}var r=R(k(),1);function le(e){for(let t of e){if(t.children&&t.children.length>0){let n=le(t.children);if(n)return n}if(t.status==="running")return t}}function z(e){return e.status==="running"&&!e.branchObjective&&(!e.children||e.children.length===0)}function Fe(e){let t=[];for(let n of e)z(n)||(n.children&&n.children.length>0?t.push({...n,children:Fe(n.children)}):t.push(n));return t}function ge(e,t){if(!e)return null;let n=e.objective??"";return n.length>0&&!/^Step \d+$/.test(n)?{label:n+"\u2026",shimmer:!1}:{label:t?"Looking at the screen\u2026":"Deciding next action\u2026",shimmer:!0}}function P({step:e,indent:t=2}){let n=e.actionType?Oe(e.actionType):null,l=e.status==="running",a=e.status==="passed",u=e.status==="failed",c=e.status==="pending"||e.status==="stopped",{stdout:v}=ee(),S=v?.columns??80,T=Math.max(20,S-t-21),d=e.objective??"",L=d.length>T?d.slice(0,T-1)+"\u2026":d,O=(e.duration??0)*1e3,y=e.duration!=null?O<1e3?`${Math.round(O)}ms`:`${(O/1e3).toFixed(1)}s`:"";return(0,r.jsxs)(s,{flexDirection:"column",children:[(0,r.jsxs)(s,{marginLeft:t,children:[(0,r.jsx)(s,{width:4,children:(0,r.jsxs)(o,{color:i.muted,children:[String(e.index).padStart(2," ")," "]})}),(0,r.jsx)(s,{width:3,children:l?(0,r.jsx)(te,{}):a?(0,r.jsx)(o,{color:i.green,bold:!0,children:"\u2713"}):u?(0,r.jsx)(o,{color:i.red,bold:!0,children:"\u2717"}):(0,r.jsx)(o,{color:i.muted,children:"\u25CB"})}),(0,r.jsx)(s,{flexGrow:1,children:l?(0,r.jsx)(oe,{text:L,active:!0}):u?(0,r.jsx)(o,{color:i.red,children:L}):c?(0,r.jsx)(o,{color:i.dim,children:L}):(0,r.jsx)(o,{color:i.dim,children:L})}),(a||u)&&n?(0,r.jsx)(s,{width:3,marginLeft:1,children:(0,r.jsx)(o,{color:i.muted,children:n})}):(0,r.jsx)(s,{width:3,marginLeft:1}),(0,r.jsx)(s,{width:7,justifyContent:"flex-end",children:(0,r.jsx)(o,{color:i.dim,children:y})})]}),e.children&&e.children.length>0&&(0,r.jsx)(s,{flexDirection:"column",children:e.children.map((h,b)=>(0,r.jsx)(P,{step:h,indent:t+2},`child-${b}`))})]})}function Xe(e){return e.type==="cm_init"?(0,r.jsx)(s,{marginLeft:2,paddingLeft:1,children:(0,r.jsxs)(o,{color:i.dim,children:["\u25AA Generated task with ",e.count," checkpoints"]})}):(0,r.jsx)(s,{marginLeft:2,paddingLeft:1,children:(0,r.jsx)(P,{step:e.step})})}function _e({steps:e,bifurcated:t,flows:n,cmInitCounts:l,maxSteps:a=50,staticSteps:u=!1,onStepCommit:c,describe:v,describeVisible:S,describeRevealing:T}){let d=(0,I.useRef)(new Set),L=(0,I.useRef)(!1),O=(0,I.useRef)(new Set),y=(0,I.useRef)(!1),h=(0,I.useRef)(new Set),b=(0,I.useRef)(0);(0,I.useEffect)(()=>{e.length===0&&b.current>0&&(d.current.clear(),L.current=!1,O.current.clear(),y.current=!1,h.current.clear()),b.current=e.length},[e.length]);let B=e.flatMap(p=>[p,...p.children??[]]),F=B.some(p=>p.status==="running"),M=B.some(p=>p.status==="failed"),X=B.length===0||B.every(p=>p.status==="pending"),Y=B.filter(p=>p.status==="passed"||p.status==="failed").length,N;X?N="starting":F?N="running":M?N="failed":N="passed";let J=(0,I.useRef)(null),[ce,he]=(0,I.useState)(0);(0,I.useEffect)(()=>{B.length===0||X?(J.current=null,he(0)):F&&J.current==null&&(J.current=Date.now())},[F,X,B.length]),(0,I.useEffect)(()=>{if(!F)return;let p=setInterval(()=>{J.current!=null&&he((Date.now()-J.current)/1e3)},500);return()=>clearInterval(p)},[F]);let ae=(0,I.useRef)(new Set),[,xe]=(0,I.useState)(0),be=(0,I.useRef)(!1);(0,I.useEffect)(()=>{if(!c||!u||t)return;let p=[];!be.current&&l&&l[0]!=null&&(be.current=!0,l[0]>0&&p.push({key:"cm_init_0",type:"cm_init",count:l[0]}));for(let g of e)(g.status==="passed"||g.status==="failed")&&!ae.current.has(g.index)&&(ae.current.add(g.index),p.push({key:`step_${g.index}`,type:"step",step:{...g,children:g.children?[...g.children]:void 0}}));if(p.length>0){for(let g of p)c(Xe(g));xe(g=>g+1)}},[e,t,l,u,c]),(0,I.useEffect)(()=>{if(!c||u)return;let p=d.current.size;if(!t&&!y.current&&l&&l[0]!=null&&(y.current=!0,l[0]>0&&c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsxs)(o,{color:i.dim,children:["\u25A0 Generated task with ",l[0]," checkpoints"]})}))),t&&n&&!L.current&&(L.current=!0,c((0,r.jsx)(o,{color:i.purple,children:"\u2501\u2501 Bifurcated into "+n.length+" flows \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"}))),t){let g=e.flatMap((x,f)=>{let m=x.children??[];return!O.current.has(f)&&m.length>0&&(O.current.add(f),c((0,r.jsx)(o,{color:i.purple,children:" Flow "+(f+1)+": "+(n?.[f]??"")})),l?.[f]!=null&&l[f]>0&&!h.current.has(f)&&(h.current.add(f),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsxs)(o,{color:i.dim,children:[" \u25AA Generated task with ",l[f]," checkpoints"]})})))),l?.[f]!=null&&l[f]>0&&O.current.has(f)&&!h.current.has(f)&&(h.current.add(f),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsxs)(o,{color:i.dim,children:[" \u25AA Generated task with ",l[f]," checkpoints"]})}))),m});for(let x of g){let f=`${x.childId??"p"}-${x.index}-${x.objective}`;if(!!x.branchObjective){d.current.has(f)||(d.current.add(f),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:{...x,children:void 0}})})));for(let $ of x.children??[]){let w=`child-${x.childId??"p"}-${x.index}-${$.childId??"p"}-${$.index}-${$.objective}`;d.current.has(w)||($.status==="passed"||$.status==="failed"||$.status==="stopped")&&(d.current.add(w),c((0,r.jsx)(s,{marginLeft:4,children:(0,r.jsx)(P,{step:$})})))}continue}d.current.has(f)||(x.status==="passed"||x.status==="failed"||x.status==="stopped")&&(d.current.add(f),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:x})})))}}else for(let g of e){let x=`${g.index}-${g.objective}`,f=!!g.branchObjective;f&&!d.current.has(x)&&(d.current.add(x),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:{...g,children:void 0}})})));for(let m of g.children??[]){let $=`child-${g.index}-${m.childId??"p"}-${m.index}-${m.objective}`;d.current.has($)||(m.status==="passed"||m.status==="failed"||m.status==="stopped")&&(d.current.add($),c((0,r.jsx)(s,{marginLeft:4,children:(0,r.jsx)(P,{step:m})})))}!f&&!d.current.has(x)&&(g.status==="passed"||g.status==="failed"||g.status==="stopped")&&(d.current.add(x),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:{...g,children:void 0}})})))}d.current.size>p&&xe(g=>g+1)},[e,c,t,n,l]);let G=[];if(u&&!t)for(let p of e)ae.current.has(p.index)||G.push(p);else if(c&&!u)if(t)for(let p of e){let g=p.children??[],x=[];for(let f of g){let m=`${f.childId??"p"}-${f.index}-${f.objective}`,$=d.current.has(m);if(f.branchObjective){let w=(f.children??[]).filter(Q=>{let ue=`child-${f.childId??"p"}-${f.index}-${Q.childId??"p"}-${Q.index}-${Q.objective}`;return!d.current.has(ue)});(!$||w.length>0)&&x.push({...f,children:w})}else $||x.push(f)}x.length>0&&G.push({...p,children:x})}else for(let p of e){let g=`${p.index}-${p.objective}`,x=d.current.has(g),f=(p.children??[]).filter(m=>{let $=`child-${p.index}-${m.childId??"p"}-${m.index}-${m.objective}`;return!d.current.has($)});x?f.length>0&&G.push({...p,children:f}):G.push({...p,children:f})}if(!u){let p=c?G:e,g=le(p),x=ge(g,T);return(0,r.jsxs)(s,{flexDirection:"column",children:[t?c?p.length>0?(0,r.jsx)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:p.map((m,$)=>(0,r.jsx)(s,{flexDirection:"column",marginTop:$>0?1:0,children:m.children&&m.children.length>0?m.children.map(w=>{if(z(w))return null;let Q=!!w.branchObjective,ue=`${w.childId??"p"}-${w.index}-${w.objective}`,Ke=d.current.has(ue);return Q?(0,r.jsxs)(s,{flexDirection:"column",children:[!Ke&&(0,r.jsx)(P,{step:{...w,children:void 0}}),(w.children??[]).filter(Z=>!z(Z)).map(Z=>(0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:Z})},`f${$}-${w.index}-${Z.childId??"p"}-${Z.index}`))]},`f${$}-host-${w.childId??"p"}-${w.index}`):(0,r.jsx)(P,{step:w},`f${$}-${w.childId??"p"}-${w.index}`)}):m.status==="pending"&&(0,r.jsx)(o,{color:i.dim,children:" \u25CB Waiting..."})},$))}):null:(0,r.jsx)(fe,{steps:e,flows:n,cmInitCounts:l,renderStep:(m,$)=>z(m)?null:(0,r.jsx)(P,{step:m},$)}):(0,r.jsxs)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:[!c&&l&&l[0]!=null&&(0,r.jsxs)(o,{color:i.dim,children:["\u25AA Generated task with ",l[0]," checkpoints"]}),p.filter(m=>!(m.status==="running"&&(!m.children||m.children.length===0))).map(m=>{let $=`${m.index}-${m.objective}`;return c&&d.current.has($)?(0,r.jsx)(s,{flexDirection:"column",children:(m.children??[]).filter(w=>!z(w)).map(w=>(0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:w})},`${w.childId??"p"}-${w.index}`))},`branch-children-${m.index}`):(0,r.jsx)(P,{step:m},m.index)})]}),(0,r.jsx)(se,{activity:x,describe:v,describeVisible:S}),B.length>0&&(0,r.jsx)(ie,{currentStep:Y,maxSteps:a,elapsed:ce,status:N})]})}if(t){let p=le(e),g=ge(p,T);return(0,r.jsxs)(s,{flexDirection:"column",children:[(0,r.jsx)(fe,{steps:e,flows:n,cmInitCounts:l,renderStep:(x,f)=>z(x)?null:(0,r.jsx)(P,{step:x},f)}),(0,r.jsx)(se,{activity:g,describe:v,describeVisible:S}),B.length>0&&(0,r.jsx)(ie,{currentStep:Y,maxSteps:a,elapsed:ce,status:N})]})}let Ne=le(G),Ge=ge(Ne,T),Re=Fe(G);return(0,r.jsxs)(s,{flexDirection:"column",children:[Re.length>0&&(0,r.jsx)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:Re.map(p=>(0,r.jsx)(P,{step:p},p.index))}),(0,r.jsx)(se,{activity:Ge,describe:v,describeVisible:S}),B.length>0&&(0,r.jsx)(ie,{currentStep:Y,maxSteps:a,elapsed:ce,status:N})]})}var W=R(k(),1);function Ae({runner:e,runKey:t,onStepCommit:n}){let l=Ie({isRunning:e.isRunning,bifurcationInfo:e.bifurcationInfo,steps:e.steps,cmInitCounts:e.cmInitCounts,replayInfo:e.replayInfo});return(0,W.jsxs)(W.Fragment,{children:[l&&(0,W.jsx)(ke,{label:l.label,hasBifurcation:l.hasBifurcation}),e.isRunning&&e.steps.length>0&&(0,W.jsx)(_e,{steps:e.steps,bifurcated:!!e.bifurcationInfo&&!e.bifurcationInfo.isSingleFlow,flows:e.bifurcationInfo?.flows,cmInitCounts:e.cmInitCounts,maxSteps:e.maxSteps,onStepCommit:n},`run-${t}`)]})}var D=R(k(),1),Ye=64;function Je(e){return e.split(`
|
|
4
4
|
`).map(t=>t.replace(/^[-–•]\s*/,"").trim()).filter(t=>t.length>0)}function qe({status:e,summary:t,duration:n,steps:l,stepsPassed:a,stepsFailed:u,reason:c,creditsConsumed:v}){let S=e==="passed",T=S?i.green:i.red,d=S?"\u2713":"\u2717",L=e.toUpperCase(),O=a??(S?l:Math.max(0,l-1)),y=u??(S?0:1),h=y>0?`${l} steps (${O} passed, ${y} failed)`:`${l} steps`,b=n<60?`${n.toFixed(1)}s`:`${Math.floor(n/60)}m ${Math.round(n%60)}s`,B=Je(t);return(0,D.jsx)(s,{flexDirection:"column",marginTop:1,children:(0,D.jsxs)(s,{borderStyle:"round",borderColor:T,flexDirection:"column",paddingX:2,paddingY:1,width:Ye+6,children:[(0,D.jsxs)(s,{flexDirection:"column",children:[(0,D.jsxs)(o,{bold:!0,color:T,children:[d," ",L]}),(0,D.jsxs)(o,{color:i.dim,wrap:"wrap",children:[h," \xB7 ",b,typeof v=="number"&&v>0?` \xB7 ${parseFloat(v.toFixed(4))} credits`:""]})]}),B.length>0&&(0,D.jsx)(s,{flexDirection:"column",marginTop:1,marginLeft:1,children:B.map((F,M)=>(0,D.jsxs)(s,{marginBottom:M<B.length-1?1:0,children:[(0,D.jsx)(o,{color:i.orange,children:"\u25CF "}),(0,D.jsx)(s,{flexShrink:1,children:(0,D.jsx)(o,{wrap:"wrap",children:F})})]},M))}),c&&!S&&(0,D.jsx)(s,{marginTop:1,children:(0,D.jsxs)(o,{color:i.red,wrap:"wrap",children:["Reason: ",c]})})]})})}var j=R(k(),1);function Me({message:e,code:t,remediation:n,docsUrl:l}){return(0,j.jsx)(ve,{title:"Error",variant:"error",children:(0,j.jsxs)(s,{flexDirection:"column",paddingY:1,children:[(0,j.jsxs)(o,{color:i.red,bold:!0,children:[" \u2717 ",e]}),t&&(0,j.jsxs)(s,{marginTop:0,marginLeft:5,children:[(0,j.jsx)(o,{color:i.muted,children:"Code: "}),(0,j.jsx)(o,{color:i.dim,children:t})]}),n&&(0,j.jsxs)(s,{flexDirection:"column",marginTop:1,marginLeft:5,children:[(0,j.jsx)(o,{color:i.green,bold:!0,children:"Fix:"}),(0,j.jsxs)(o,{color:i.orange,children:["$ ",n]})]}),l&&(0,j.jsxs)(s,{marginTop:1,marginLeft:5,children:[(0,j.jsx)(o,{color:i.muted,children:"Docs: "}),(0,j.jsx)(o,{color:i.orange,underline:!0,children:l})]})]})})}var E=R(k(),1);function un(e){let{exit:t}=Te(),{append:n}=ye(),l=(0,A.useRef)(!1);(0,A.useEffect)(()=>{l.current||(l.current=!0,n((0,E.jsx)(s,{flexDirection:"column",marginBottom:1,children:(0,E.jsxs)(s,{borderStyle:"round",borderColor:"#dc4e08",paddingX:2,children:[(0,E.jsx)(o,{color:"#ff9500",bold:!0,children:"KaneAI CLI"}),(0,E.jsx)(o,{color:i.dim,children:" \u2502 "}),(0,E.jsx)(o,{color:i.orange,children:e.topBanner.model}),(0,E.jsx)(o,{color:i.dim,children:" \u2502 "}),(0,E.jsx)(o,{color:i.dim,children:e.topBanner.auth})]})})),n((0,E.jsx)(Qe,{data:e.globalConfig})),e.priorAttemptRollup&&n((0,E.jsx)(o,{color:i.dim,children:` \u21B3 replayed ${e.priorAttemptRollup.startIdx}..${e.priorAttemptRollup.endIdx-1} (${e.priorAttemptRollup.count} steps, from prior attempt)`})))},[]);let a=(0,A.useRef)(null),u=(0,A.useCallback)(async y=>{let h=await e.getNextStep(y);return h?(a.current=h,h.config):(a.current=null,null)},[e]),c=(0,A.useCallback)((y,h)=>{let b=a.current;if(!b)return;let B=b.mode==="replay"?"cyan":"#dc4e08",F=b.modeReason?` (${b.modeReason})`:"",M=b.perStepOverrides?Object.entries(b.perStepOverrides):[];n((0,E.jsxs)(s,{flexDirection:"column",marginBottom:0,children:[(0,E.jsxs)(o,{children:[(0,E.jsxs)(o,{color:i.dim,children:[b.banner.stepLabel," "]}),(0,E.jsxs)(o,{color:B,children:["[",b.mode,"]"]}),(0,E.jsx)(o,{color:i.dim,children:F})]}),(0,E.jsx)(o,{color:i.dim,children:b.banner.objective}),M.length>0&&(0,E.jsxs)(o,{color:i.dim,children:["overrides: ",M.map(([X,Y])=>`${X}=${Y}`).join(", ")]})]}))},[n]),v=(0,A.useRef)(0),S=(0,A.useRef)(!1),T=(0,A.useCallback)((y,h)=>(y.hadError?n((0,E.jsx)(Me,{message:y.reason??"Runner error",code:"RUNNER_ERROR"})):n((0,E.jsx)(s,{flexDirection:"column",marginBottom:1,children:(0,E.jsx)(qe,{status:y.status,summary:y.runEnd?.summary??"",duration:y.runEnd?.duration??0,steps:y.stepsTotal,stepsPassed:y.stepsPassed,stepsFailed:y.stepsFailed,reason:y.runEnd?.reason,creditsConsumed:y.runEnd?.credits_consumed})})),e.onStepEnd?.(y,h)??!0),[n,e]),d=we({getNextConfig:u,onStepStart:c,onStepEnd:T,onAllComplete:()=>{e.onAllComplete(),e.exitOnComplete!==!1&&setImmediate(()=>t())},screenshotDispatcher:e.screenshotDispatcher,stepLogger:e.stepLogger,onReasoning:e.onReasoning,onStepComplete:e.onStepComplete,spawnOpts:e.spawnOpts}),L=250,O=5e3;return Se((y,h)=>{if(h.ctrl&&y==="c"){let b=Date.now(),B=b-v.current;if(B<L)return;S.current&&B<O?(d.cancel(),e.onCancel?.(),e.exitOnComplete!==!1&&setImmediate(()=>t())):(S.current=!0,n((0,E.jsx)(o,{color:"yellow",children:"press Ctrl+C again to cancel run"}))),v.current=b}}),(0,E.jsx)(s,{flexDirection:"column",children:d.phase!=="done"&&(0,E.jsx)(Ae,{runner:d.runner,runKey:d.currentStepIndex,onStepCommit:n})})}function Qe({data:e}){return(0,E.jsx)(Be,{title:"test.md run",titleColor:"#ff9500",borderColor:i.dim,rows:[{label:"source",value:e.source},{label:"steps",value:`${e.steps.total} (${e.steps.replay} replay, ${e.steps.author} author per walker)`},{label:"model",value:e.model},{label:"viewport",value:`${e.viewport.width} x ${e.viewport.height}`},{label:"chrome",value:e.chrome},{label:"session",value:e.session},{label:"variables",value:`${e.variables.count} (${e.variables.secrets} secret)`},{label:"flags",value:e.flags.length>0?e.flags.join(" "):"(none)"}]})}export{_e as a,ke as b,Ie as c,de as d,qe as e,Me as f,un as g};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as t}from"./chunk-
|
|
2
|
+
import{b as t}from"./chunk-UQ6A52ML.js";import{join as i}from"path";function e(n=t){return i(n,"plugins")}function g(n,r=t){return i(e(r),n)}function c(n,r,o=t){return i(g(n,o),r)}function f(n,r=t){return i(g(n,r),"current")}function x(n,r=t){return i(g(n,r),"config.json")}function l(n,r=t){return i(g(n,r),".jobs")}function s(n=t){return i(n,"bin")}function h(n=t){return i(s(n),"hyperexecute")}export{e as a,g as b,c,f as d,x as e,l as f,s as g,h};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as K}from"./chunk-7ZSHB3AN.js";import{a as U,b as Y,c as q}from"./chunk-KJQNAOOE.js";import{a as B}from"./chunk-KDNNMU7Q.js";import{d as j}from"./chunk-WESMQEPO.js";import{j as N,n as F,z as k}from"./chunk-IICT4VOU.js";import{a as L,b as V,c as G}from"./chunk-3UI5VTQS.js";import{F as I}from"./chunk-RDHWNSDP.js";import{f as v,g as x,i as H}from"./chunk-XLSOQLVT.js";function te(t,e,n,i,s){let f=n.rows.filter(u=>{let d=i.get(u.temp_ref);return d!==void 0&&d!=="reject"});if(f.length===0)return{record:null,errors:null};let o={version:1,read_basis:e.latestHash,source:{source_id:n.source_id,source_cid:e.heads.get(n.source_id)??""},use_cases:f.map(u=>u.uc)},p=new Map;for(let u of f){let d=i.get(u.temp_ref);typeof d=="object"?p.set(u.temp_ref,{resolution:"edited",edit:d.edited}):p.set(u.temp_ref,{resolution:u.uc.matches_existing&&u.uc.changed?"edited":"approved"})}let g=q(o,e,n.staged_source_cid);if(g.errors!==null)return{record:null,errors:g.errors};let r=g.proposal,l=o.source.source_cid?D(t,e,o.source.source_cid):null;if(l!==null){r=Y(r,l);let u=N(r,U(l),e);if(u.length>0)return{record:null,errors:[{code:"HELD_CITES_STALE",detail:"the source moved after this plan staged \u2014 its quotes no longer verify against the current head; re-run kane-cli maintain reconcile to re-stage"},...u]}}let m=`held-${(e.latestHash??"root").slice(-12)}-${f.length}`;return F({contextDir:t,graph:e,proposal:r,proposalId:m,verdicts:p,by:s,autoName:!0})}function Z(t,e,n=[]){let i=K(t,e),s=new Set,f=[],o=l=>{!l||s.has(l)||(s.add(l),f.push(y(t,l)))};for(let l of i.pairs)o(l.scenario),o(l.test);for(let[l,m]of i.verifies){o(l);for(let u of m)o(u)}if(n.length===0)return{stale_refs:f};let p=l=>`${String(l.props.source_id)}\0${String(l.props.anchor)}`,g=new Set;for(let{cid:l}of t.byLabel(v.USECASE))if(t.tipOf(l)===e)for(let m of t.edgesInto(l)){if(m.type!==x.DERIVES)continue;let u=m.props.claim;typeof u=="string"&&n.includes(u)&&g.add(p(m))}if(g.size===0)return{stale_refs:f};let r=new Set;for(let[l,m]of i.verifies)if(t.edgesInto(l).some(d=>d.type===x.DERIVES&&g.has(p(d)))){r.add(y(t,l));for(let d of m)r.add(y(t,d))}return{stale_refs:f,...r.size>0?{direct_refs:[...r]}:{}}}var X="this release plans changes only \u2014 blast-radius impact and drift meaning-checks are not measured, and REMOVE rows are never executed automatically",ne="suite untouched; graph updated";function M(t,e){return!t.superseded.has(e)&&t.trust.get(e)!=="archived"}function y(t,e,n=new Set){let i=t.nameOf.get(e);if(i!==void 0)return i;if(n.has(e))return e;n.add(e);for(let[s,f]of t.superseded){if(f!==e)continue;let o=y(t,s,n);if(o!==s)return o}return e}function C(t){return String(t).slice(0,19)}function A(t,e,n){let i=t.edgesFrom(e).find(s=>s.type===n);return i?t.tipOf(i.dst):null}function z(t,e){let n=t.nodeLabel.get(e);if(n===v.USECASE)return e;if(n===v.SCENARIO)return A(t,e,x.BELONGS_TO);if(n===v.AC){let i=A(t,e,x.SCOPED_TO);return i?t.nodeLabel.get(i)===v.USECASE?i:A(t,i,x.BELONGS_TO):null}if(n===v.TEST){let i=A(t,e,x.AUTOMATES);return i?A(t,i,x.BELONGS_TO):null}return null}function J(t,e){let n=[],i=new Map;for(let s of t.derivesInto(e))i.set(String(s.props.source_id),s);for(let[s,f]of i){let o=t.heads.get(s);if(o==null){n.push(`DERIVES pin ${s} @ ${C(f.props.source_cid)} \u2014 source retired`);continue}if(o!==f.props.source_cid){let p=t.convChains.get(s)?.chain;if(p&&p.includes(String(f.props.source_cid)))continue;n.push(`DERIVES pin ${s} @ ${C(f.props.source_cid)} \u2014 source head moved to ${C(o)}`)}}for(let s of t.edgesFrom(e))H(s.type)?.pin?.comparesTo==="dst_tip"&&t.superseded.has(s.dst)&&n.push(`${s.type} pin \u2192 ${y(t,s.dst)} \u2014 target superseded`);return n.join("; ")||"structural pin broken"}var se=new Set([v.USECASE,v.SCENARIO,v.AC,v.TEST]);function $(t,e){return t.ref<e.ref?-1:t.ref>e.ref?1:0}function D(t,e,n){let i=B(t,e,n);return i===null?null:i.toString("utf8")}function oe(t,e,n,i,s){let f=n.props.quote;if(typeof f=="string"&&f.length>0)return G(f,i);let o=String(n.props.source_cid);s.has(o)||s.set(o,D(t,e,o));let p=s.get(o);if(p===null)return!1;let g=V(p,String(n.props.anchor));return g===null?!1:g.split(`
|
|
3
|
+
`).some(r=>r.trim().length>0&&i.includes(r.trim()))}function re(t,e,n){let i=L(String(e.props.anchor));if(i?.kind!=="img-part")return!1;let f=(t.mediaOf(String(e.props.source_cid)).images??[]).find(r=>r.ref===i.ref),o=f?.blob;if(o===void 0)return!1;let p=t.mediaOf(n).images??[];if(p.some(r=>r.blob===o))return!0;let g=f?.appearance;return g!==void 0&&p.filter(r=>r.appearance===g).length===1}var W=128*1024,Q=64*1024;function ie(t,e){let n=t.split(`
|
|
4
|
+
`),i=e.split(`
|
|
5
|
+
`),s=0;for(;s<n.length&&s<i.length&&n[s]===i[s];)s++;let f=n.length,o=i.length;for(;f>s&&o>s&&n[f-1]===i[o-1];)f--,o--;if(f===s&&o===s)return"";let p=n.slice(s,f),g=i.slice(s,o),l=ce(p,g,2e3),m=[];if(l===null)m.push(`@@ old L${s+1}-L${f} \u2192 new L${s+1}-L${o} @@`,...p.map(u=>`- ${u}`),...g.map(u=>`+ ${u}`));else{let u=l.map((a,h)=>a.op==="="?-1:h).filter(a=>a>=0),d=0;for(;d<u.length;){let a=d;for(;a+1<u.length&&u[a+1]-u[a]<=3;)a++;let h=Math.max(u[d]-1,0),R=Math.min(u[a]+1,l.length-1),b=l.slice(h,R+1),S=s+(b[0].ai??0)+1,_=s+(b[0].bi??0)+1,c=b.filter(E=>E.op!=="+").length,w=b.filter(E=>E.op!=="-").length;m.push(`@@ old L${S}-L${S+Math.max(c-1,0)} \u2192 new L${_}-L${_+Math.max(w-1,0)} @@`);for(let E of b)m.push(E.op==="="?` ${E.line}`:`${E.op} ${E.line}`);d=a+1}}return m.join(`
|
|
6
|
+
`)}function ce(t,e,n){let i=t.length,s=e.length,f=Math.min(i+s,n),o=new Map([[1,0]]),p=[],g=!1;for(let u=0;u<=f&&!g;u++){p.push(new Map(o));for(let d=-u;d<=u;d+=2){let a=d===-u||d!==u&&(o.get(d-1)??0)<(o.get(d+1)??0)?o.get(d+1)??0:(o.get(d-1)??0)+1,h=a-d;for(;a<i&&h<s&&t[a]===e[h];)a++,h++;if(o.set(d,a),a>=i&&h>=s){g=!0;break}}}if(!g)return null;let r=i,l=s,m=[];for(let u=p.length-1;u>0;u--){let d=p[u],a=r-l,h=a===-u||a!==u&&(d.get(a-1)??0)<(d.get(a+1)??0)?a+1:a-1,R=d.get(h)??0,b=R-h;for(;r>R&&l>b;)m.push({op:"=",line:t[r-1],ai:r-1,bi:l-1}),r--,l--;u>0&&(r===R?(m.push({op:"+",line:e[l-1],ai:r,bi:l-1}),l--):(m.push({op:"-",line:t[r-1],ai:r-1,bi:l}),r--))}for(;r>0&&l>0;)m.push({op:"=",line:t[r-1],ai:r-1,bi:l-1}),r--,l--;for(;r>0;)m.push({op:"-",line:t[r-1],ai:r-1,bi:0}),r--;for(;l>0;)m.push({op:"+",line:e[l-1],ai:0,bi:l-1}),l--;return m.reverse()}function ae(t){let e=Buffer.byteLength(t,"utf8");if(e<=W+Q)return{diff:t,truncated:!1};let n=Buffer.from(t,"utf8"),i=W;for(;i>0&&(n[i]&192)===128;)i--;let s=e-Q;for(;s<e&&(n[s]&192)===128;)s++;let f=n.subarray(0,i).toString("utf8"),o=n.subarray(s).toString("utf8");return{diff:`${f}
|
|
7
|
+
\u2026 [diff truncated: ${e-i-(e-s)} bytes omitted] \u2026
|
|
8
|
+
${o}`,truncated:!0}}function de(t,e){let n=k(t),i=n.heads.get(e);if(typeof i!="string")return null;let s=[];for(let d of I(t).records){let a=d.source_head_moves?.[e];a!==void 0&&a!==s[s.length-1]&&s.push(a)}let f=s.lastIndexOf(i),o=f>0?s[f-1]:null;if(typeof o!="string"||o===i)return null;let p=D(t,n,o),g=D(t,n,i);if(p===null||g===null)return null;let{diff:r,truncated:l}=ae(ie(p,g)),m=new Set,u=[];for(let d of n.edgesFrom(o))d.type!==x.DERIVES||n.nodeLabel.get(d.dst)!==v.USECASE||m.has(d.dst)||(m.add(d.dst),u.push({id:d.dst,title:String(n.getNode(d.dst)?.content.title??"")}));return{source_id:e,old_head:o,new_head:i,diff:r,...l?{truncated:!0}:{},prior_ucs:u}}function le(t,e,n){let i=t.getNode(e)?.content??{},s=t.getNode(n)?.content??{},o=[...new Set([...Object.keys(i),...Object.keys(s)])].sort().filter(p=>JSON.stringify(i[p])!==JSON.stringify(s[p]));return o.length>0?`updated: ${o.join(", ")}`:"updated"}function ue(t,e,n,i,s,f,o){let p=new Set((o?.rows??[]).map(a=>a.matched_cid).filter(a=>!!a)),g=[];for(let[a,h]of n.superseded)h===null||a===h||e.superseded.has(a)||n.nodeLabel.get(a)===v.USECASE&&g.push({kind:"MODIFY",ref:y(n,a),old_cid:a,new_cid:h,summary:le(n,a,h)});let r=f.map(a=>({kind:"ADD",ref:y(n,a),cid:a}));for(let a of o?.rows??[])a.kind==="MODIFY"&&a.matched_cid?g.push({kind:"MODIFY",ref:y(n,a.matched_cid),old_cid:a.matched_cid,new_cid:null,summary:`${a.why} (staged)`}):a.kind==="ADD"&&r.push({kind:"ADD",ref:a.title,cid:null});let l=[],m=D(t,n,s),u=new Map;for(let{cid:a}of n.byLabel(v.USECASE)){if(!M(n,a)||p.has(a))continue;let h=n.derivesInto(a),R=h.filter(_=>String(_.props.source_id)===i);R.length===0||R.some(_=>_.props.source_cid===s)||R.some(_=>{let c=String(_.props.anchor),w=L(c);return w?.kind==="img-whole"?!1:w?.kind==="img-part"?re(n,_,s):m!==null&&oe(t,n,_,m,u)})||h.some(_=>{let c=String(_.props.source_id);if(c===i)return!1;let w=n.heads.get(c);return w!=null})||l.push({kind:"ARCHIVE",ref:y(n,a),cid:a,why:`evidence decayed: no quote from ${i} relocates into @${C(s)}, no other live source, no fresh evidence this run`,impact:Z(n,n.tipOf(a))})}let d=(a,h)=>a.ref<h.ref?-1:a.ref>h.ref?1:0;return[...g.sort(d),...r.sort(d),...l.sort(d)]}function Re(t,e,n,i,s){let f=e.rows.find(d=>d.temp_ref===n);if(!f)return{ok:!1,message:`held item ${n} missing from the plan artifact`};let o=f,p=k(t);if(o.matched_cid){let d=p.tipOf(o.matched_cid);if(p.superseded.get(d)===null)return{ok:!1,message:`use-case for "${o.title}" was retired meanwhile \u2014 nothing to update`};d!==o.matched_cid&&(o={...o,matched_cid:d,uc:{...o.uc,matches_existing:{cid:d}}})}let g=s?{edited:s}:"approve",r=te(t,p,{source_id:e.source_id,...e.staged_source_cid!==void 0?{staged_source_cid:e.staged_source_cid}:{},rows:[o]},new Map([[o.temp_ref,g]]),i);if(r.errors)return{ok:!1,message:r.errors.map(d=>`${d.code}: ${d.detail}`).join("; ")};let l=k(t),m=o.matched_cid?l.tipOf(o.matched_cid):r.record?.nodes.find(d=>d.label==="usecase")?.cid??r.record?.review[0]?.id;return{ok:!0,ref:m?y(l,m):o.title,kind:o.kind}}async function ye(t,e,n,i={}){let s=k(t),f=s.heads.get(e)??null,o=new Set(s.staleList().filter(c=>c.state==="stale").map(c=>c.cid)),p=await n.reingest(e);if(p.status==="unchanged"&&!i.resumeHeld)return{source_id:e,changed:!1,head:{status:p.status,before:f,after:p.cid},note:`nothing to reconcile \u2014 ${e} is unchanged`,skipped_arms:X,changeset:[],rows:[]};let g=i.resumeHeld?{minted:[],matched:[],held:i.resumeHeld}:await n.reextract(e),r=k(t),l=g.minted.map(c=>{let w=y(r,c);return{kind:"ADD",origin:"content-change",ref:w,reason:`new use-case extracted from ${e}`,provenance:`extraction commit \u2014 DERIVES ${e} @ ${C(p.cid)}`,action:`kane-cli design tests --use-case ${w}`}}),m=r.staleList().filter(c=>c.state==="stale"&&!o.has(c.cid)&&M(r,c.cid)).map(c=>c.cid),u=m.map(c=>{let w=y(r,c),E=se.has(r.nodeLabel.get(c)??"");return{kind:"MODIFY",origin:"structural-stale",ref:w,reason:"stale (structural)",provenance:J(r,c),action:E?`kane-cli maintain evolve ${w}`:`kane-cli design explain ${w}`}}),d=[],a=[];for(let c of g.held?.rows??[])if(c.kind==="ADD")d.push({kind:"ADD",origin:"content-change",ref:c.title,held_ref:c.temp_ref,reason:`${c.why} (staged \u2014 commits on approval)`,provenance:`staged extraction of ${e} @ ${C(p.cid)}`,action:"approve to commit + design"});else{let w=c.matched_cid?r.tipOf(c.matched_cid):null,E=w?r.getNode(w)?.content.criteria??[]:[],T=(c.uc.updated?.criteria??[]).map(O=>typeof O=="string"?O:O.text),ee=[...T.filter(O=>!E.includes(O)),...c.uc.updated?.criteria!==void 0?E.filter(O=>!T.includes(O)):[]],P=w?Z(r,w,ee):void 0;a.push({kind:"MODIFY",origin:"content-change",ref:c.matched_cid?y(r,c.matched_cid):c.title,held_ref:c.temp_ref,reason:`${c.why} (staged \u2014 commits on approval)`,provenance:`staged extraction of ${e} @ ${C(p.cid)}`,action:"approve to commit the updated version (old\u2192new redirect)",...P?{impact:P}:{}})}let h=new Set;for(let c of[...g.minted,...g.matched])h.add(r.tipOf(c));for(let c of g.held?.rows??[])c.matched_cid&&h.add(r.tipOf(c.matched_cid));for(let c of m){let w=z(r,r.tipOf(c));w&&r.nodeLabel.get(w)===v.USECASE&&h.add(r.tipOf(w))}let R=[];for(let c of await j(r,"design")){if(c.kind!=="no-verifies")continue;let w=r.resolve(c.ref);if(!w)continue;let E=z(r,w.tip);!E||!h.has(r.tipOf(E))||R.push({kind:"ADD",origin:"content-change",ref:c.ref,reason:c.why,provenance:`gaps engine (design) \u2014 uncovered AC of touched use-case ${y(r,E)}`,action:c.ready_command})}let b=[];for(let{cid:c}of r.byLabel(v.USECASE))M(r,c)&&r.stale(c)==="orphaned"&&b.push({kind:"REMOVE",ref:y(r,c),reason:"orphaned \u2014 no live source evidences this use-case",provenance:J(r,c),action:"plan-only \u2014 REMOVE is not executed in this release"});let S=new Set,_=[...l.sort($),...d.sort($),...R.sort($),...a.sort($),...u.sort($),...b.sort($)].filter(c=>{let w=`${c.kind}\0${c.ref}`;return S.has(w)?!1:(S.add(w),!0)});return{source_id:e,changed:!0,head:{status:p.status,before:f,after:p.cid},note:ne,skipped_arms:X,changeset:ue(t,s,r,e,p.cid,g.minted,g.held),rows:_,...g.held?{held:g.held}:{}}}function be(t,e){return async n=>{let{ingestFile:i}=await import("./ingest-OSNNM3DH.js"),{convertPdf:s}=await import("./pdf-convert-RLXSXFWN.js"),{convertDocx:f}=await import("./docx-convert-SQRTF7XS.js"),o=await i({contextDir:t,filePath:e,asId:n,converters:{pdf:s,docx:f}});return{status:o.status,cid:o.cid}}}function xe(t,e,n,i){return async()=>{let f=(i??(await import("./dispatch-V24LFEAO.js")).findProvider)(e);if(!f)throw new Error(`the remote re-ingest failed \u2014 no provider matches '${e}'`);let o=await f.ingest(e,void 0,{out:n.out,err:n.err,confirm:async()=>!0,isTTY:!1},t,void 0);if(o.code!==0||!o.result)throw new Error("the remote re-ingest failed \u2014 fix the reported problem and re-run");return{status:o.result.status,cid:o.result.source_cid}}}function ke(t,e={}){return async n=>{let i=[],[{runExtract:s},{resolveAgentAuthEnv:f},{runAgent:o},{preflightTurn:p}]=await Promise.all([import("./run-XXA7ILIM.js"),import("./spawner-O3VKHYUY.js"),import("./bridge-KJNDGKPU.js"),import("./turn-preflight-JGYT7LXP.js")]),g=await f(),r=new Set(k(t).byLabel(v.USECASE).map(S=>S.cid)),l=de(t,n)??void 0,m=0,u=await s({mode:"override",source:n,...l?{changeContext:l}:{}},{contextDir:t,agent:o,preflightTurn:()=>p(g),ask:async()=>[],review:async S=>{if(!e.stage)return new Map(S.map(c=>[c.temp_ref,{resolution:c.matches_existing&&c.changed?"edited":"skipped"}]));let _=new Map;for(let c of S){if(c.matches_existing&&!c.changed){_.set(c.temp_ref,{resolution:"skipped"});continue}i.push({kind:c.matches_existing?"MODIFY":"ADD",temp_ref:c.temp_ref,title:c.title,why:c.matches_existing?`updated: ${Object.keys(c.updated??{}).join(", ")||"content"}`:`newly extracted from ${n}`,...c.matches_existing?{matched_cid:c.matches_existing.cid,updated:c.updated}:{},uc:c}),_.set(c.temp_ref,{resolution:"rejected"})}return _},confirmStale:async()=>!1,out:S=>e.hostOut?.(S),progress:S=>e.hostProgress?.(S),emit:S=>{S.type==="commit"&&typeof S.assumed=="number"&&(m+=S.assumed),e.hostEmit?.(S)},isTTY:!1,auth:g});if(u!==0)throw new Error(`reconcile: re-extract of ${n} failed (exit ${u})`);let d=k(t),a=d.heads.get(n),h=[],R=[];if(typeof a=="string"){let S=new Set;for(let _ of d.edgesFrom(a))_.type!==x.DERIVES||d.nodeLabel.get(_.dst)!==v.USECASE||S.has(_.dst)||(S.add(_.dst),!(e.stage&&d.trust.get(_.dst)==="archived")&&(r.has(_.dst)?R:h).push(_.dst))}let b=k(t).heads.get(n);return{minted:h,matched:R,defaultsTaken:m,...e.stage?{held:{source_id:n,...b!=null?{staged_source_cid:b}:{},rows:i}}:{}}}}export{te as a,Z as b,X as c,ne as d,M as e,z as f,se as g,ie as h,ae as i,de as j,Re as k,ye as l,be as m,xe as n,ke as o};
|