@testmuai/kane-cli 0.9.0 → 0.10.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ChatSurface-6NZGMNHL.js +2 -0
- package/dist/ChromeProfilePicker-M4WXOB5O.js +2 -0
- package/dist/CliFeedbackPrompt-6MJA7DF6.js +2 -0
- package/dist/CliUploadProgress-6NLS7XHH.js +2 -0
- package/dist/ConfigView-O4WKZ5PU.js +2 -0
- package/dist/EvidenceViewOffer-WIEWCZUP.js +2 -0
- package/dist/FolderPicker-AF7ZMV3M.js +2 -0
- package/dist/InfoBox-D7GGZJU4.js +2 -0
- package/dist/LinksBox-DXP66H3H.js +2 -0
- package/dist/ProfilesView-TWOY5PVC.js +2 -0
- package/dist/ProjectPicker-OBYHJJLU.js +2 -0
- package/dist/SaveSessionPrompt-7XSHS4NL.js +2 -0
- package/dist/ScrollbackTap-4SPXGFMU.js +2 -0
- package/dist/SingleShotApp-XQUDR36R.js +2 -0
- package/dist/SummaryBox-IA2KS6GT.js +2 -0
- package/dist/TestMdRunView-LS2QUFWR.js +2 -0
- package/dist/TestrunEvidenceTable-HNDVJDIF.js +2 -0
- package/dist/WhoamiView-SNL75TEF.js +2 -0
- package/dist/{agent-parse-2MLJOJTH.js → agent-parse-CAS45UKA.js} +1 -1
- package/dist/app-client-U2YYF65L.js +2 -0
- package/dist/app-download-UI4ABEIX.js +2 -0
- package/dist/assurance-job-FFSSS4XV.js +7 -0
- package/dist/auth-7Z54TMQQ.js +2 -0
- package/dist/{binary-LVHXED3O.js → binary-THPLXCOD.js} +1 -1
- package/dist/bind-4XWK3DG2.js +2 -0
- package/dist/bootstrap-6ACT4ALI.js +2 -0
- package/dist/bridge-T6QMYKED.js +2 -0
- package/dist/build-5ZN47FAT.js +2 -0
- package/dist/catalog-MYPS2BXY.js +2 -0
- package/dist/{changelog-N5AZHXOS.js → changelog-SU674BVE.js} +1 -1
- package/dist/chat-committer-ZCSRJEUB.js +2 -0
- package/dist/chat-controller-XINCDH6Z.js +2 -0
- package/dist/child-G2GCW73X.js +2 -0
- package/dist/chunk-22PIMG52.js +2 -0
- package/dist/chunk-2DYHAP4E.js +2 -0
- package/dist/chunk-2TVPA3LL.js +2 -0
- package/dist/{chunk-FMUV6UCX.js → chunk-2XW33VOK.js} +1 -1
- package/dist/chunk-33DWJV67.js +235 -0
- package/dist/chunk-34R7BNZ2.js +2 -0
- package/dist/chunk-35ECWCCK.js +2 -0
- package/dist/{chunk-OHOJSADN.js → chunk-36N3EHW5.js} +1 -1
- package/dist/chunk-3BSYOCSW.js +3 -0
- package/dist/chunk-3E4ZO73O.js +6 -0
- package/dist/chunk-3F5FMH76.js +2 -0
- package/dist/chunk-3G2LSTK5.js +2 -0
- package/dist/chunk-3GXN6VF6.js +2 -0
- package/dist/chunk-3JLEDSG5.js +4 -0
- package/dist/chunk-3OQW2GTA.js +2 -0
- package/dist/chunk-3QICDXY5.js +5 -0
- package/dist/chunk-3RJHXOZH.js +3 -0
- package/dist/{chunk-Q5RDCSYM.js → chunk-3YTCKCBG.js} +1 -1
- package/dist/chunk-42PALMW2.js +4 -0
- package/dist/chunk-44B6THYK.js +2 -0
- package/dist/chunk-457Y5TEC.js +19 -0
- package/dist/chunk-47WQBG5I.js +6 -0
- package/dist/chunk-4I7YN6YY.js +3 -0
- package/dist/chunk-4IEQNX7F.js +2 -0
- package/dist/chunk-4LTHDJ3D.js +2 -0
- package/dist/chunk-4QFTHUJA.js +34 -0
- package/dist/chunk-4QTH7VYE.js +2 -0
- package/dist/chunk-4YW767UV.js +47 -0
- package/dist/chunk-54XA5MZH.js +2 -0
- package/dist/chunk-5AKJPYUW.js +11 -0
- package/dist/{chunk-AKE2CTV6.js → chunk-5D7ENQTQ.js} +1 -1
- package/dist/chunk-63EKRZKI.js +2 -0
- package/dist/{chunk-EHN5HTUD.js → chunk-65VANXOF.js} +51 -51
- package/dist/{chunk-J3BGYSMD.js → chunk-6DZX5HLZ.js} +8 -8
- package/dist/{chunk-YBAVDT3G.js → chunk-6EB5VRAN.js} +1 -1
- package/dist/chunk-6NFOH4AC.js +4 -0
- package/dist/chunk-6PIIUAZF.js +3 -0
- package/dist/chunk-6UVIY56J.js +2 -0
- package/dist/chunk-72KYMWQ5.js +2 -0
- package/dist/chunk-72RC7JSA.js +21 -0
- package/dist/chunk-734ORT6O.js +4 -0
- package/dist/chunk-77ZZQJLX.js +2 -0
- package/dist/chunk-7AET4JKQ.js +2 -0
- package/dist/chunk-7DFBOVUB.js +2 -0
- package/dist/chunk-7HMSMAUG.js +29 -0
- package/dist/chunk-7HO4NX5W.js +1 -0
- package/dist/chunk-7KX2BHKG.js +2 -0
- package/dist/{chunk-ULGZPRKU.js → chunk-7NCJMWFX.js} +1 -1
- package/dist/chunk-7NPTL66J.js +2 -0
- package/dist/chunk-7RWP4Y3H.js +2 -0
- package/dist/{chunk-PCKIANML.js → chunk-7SY34IIL.js} +1 -1
- package/dist/chunk-7V4BQSSV.js +2 -0
- package/dist/chunk-7XBNMOH4.js +6 -0
- package/dist/{chunk-SOCHN2PY.js → chunk-7YT4TTKL.js} +1 -1
- package/dist/{chunk-C25M2J5Q.js → chunk-ACMBMZDQ.js} +1 -1
- package/dist/chunk-AEWNWAXW.js +18 -0
- package/dist/chunk-AQ2OG2EF.js +2 -0
- package/dist/chunk-AUJSC7PU.js +4 -0
- package/dist/chunk-AVI5H4UM.js +13 -0
- package/dist/chunk-AVSMXDTX.js +2 -0
- package/dist/chunk-AZLNLHUA.js +4 -0
- package/dist/{chunk-HGFWIBVF.js → chunk-B7ZX5HEN.js} +5 -5
- package/dist/{chunk-66MOZKD2.js → chunk-BSRSXYDZ.js} +1 -1
- package/dist/chunk-BWXLZS5O.js +2 -0
- package/dist/chunk-BY65QAAN.js +4 -0
- package/dist/chunk-C2RUDJ46.js +2 -0
- package/dist/chunk-C5Z7MQE6.js +2 -0
- package/dist/{chunk-WDMUPK6I.js → chunk-C62QWG4B.js} +1 -1
- package/dist/chunk-C6HI6Y3S.js +2 -0
- package/dist/chunk-CB4ARIHR.js +2 -0
- package/dist/{chunk-7WXMV3O3.js → chunk-CCP4X75B.js} +1 -1
- package/dist/chunk-CGITGJ3I.js +4 -0
- package/dist/chunk-CM4CHYSN.js +2 -0
- package/dist/{chunk-ZXY4P76I.js → chunk-CUXY6KQ2.js} +1 -1
- package/dist/chunk-D36V5OX6.js +2 -0
- package/dist/chunk-D756UWY2.js +6 -0
- package/dist/chunk-D7TKE7LK.js +2 -0
- package/dist/{chunk-UWXDURAB.js → chunk-D7U2M26S.js} +1 -1
- package/dist/chunk-DBMW3VUN.js +4 -0
- package/dist/chunk-DDZLCAEO.js +5 -0
- package/dist/chunk-DJC7NTLA.js +3 -0
- package/dist/chunk-DPGOAFKF.js +2 -0
- package/dist/chunk-DREQ3RAA.js +2 -0
- package/dist/chunk-DTUPEKEO.js +2 -0
- package/dist/chunk-DZOYYWOW.js +2 -0
- package/dist/chunk-E6KSRQXL.js +8 -0
- package/dist/chunk-EBPRPNSA.js +2 -0
- package/dist/chunk-ECPFI75W.js +5 -0
- package/dist/chunk-EECDDDSB.js +3 -0
- package/dist/chunk-EF47KRUK.js +2 -0
- package/dist/chunk-ETZMFRD6.js +2 -0
- package/dist/chunk-EZN7CF45.js +4 -0
- package/dist/{chunk-CNUCP6DK.js → chunk-F22K3RRX.js} +1 -1
- package/dist/{chunk-WRSIKZ2V.js → chunk-F5NHG7VB.js} +1 -1
- package/dist/{chunk-DHJSM5DT.js → chunk-FCD3NYOM.js} +1 -1
- package/dist/chunk-FIP5L6LV.js +9 -0
- package/dist/chunk-FOJHSG5M.js +6 -0
- package/dist/chunk-FSYOTRMC.js +2 -0
- package/dist/chunk-FWDUVFS6.js +26 -0
- package/dist/chunk-FWUPJORV.js +6 -0
- package/dist/chunk-GFLB2SHW.js +2 -0
- package/dist/chunk-GMTHZUZ3.js +2 -0
- package/dist/chunk-GQRU3B54.js +1397 -0
- package/dist/chunk-GRURFGBP.js +2 -0
- package/dist/chunk-GXKY5A46.js +9 -0
- package/dist/chunk-HAW5WEKT.js +13 -0
- package/dist/chunk-HCJ2N3XB.js +12 -0
- package/dist/chunk-HHW6MRU3.js +6 -0
- package/dist/chunk-HIUAUZNL.js +2 -0
- package/dist/chunk-HJLMH7ZM.js +2 -0
- package/dist/{chunk-YWYORBY3.js → chunk-HJMCXSUJ.js} +1 -1
- package/dist/chunk-HK62JVQM.js +3 -0
- package/dist/{chunk-5GUD3CIH.js → chunk-HQ2E2XCU.js} +1 -1
- package/dist/chunk-I2MC6VVX.js +2 -0
- package/dist/chunk-I4RVVBG3.js +10 -0
- package/dist/chunk-I4WXALQR.js +2 -0
- package/dist/chunk-ICLUC44J.js +2 -0
- package/dist/{chunk-6HU5M2DS.js → chunk-IGEAET7M.js} +1 -1
- package/dist/{chunk-GCISXCDU.js → chunk-IINZZ4BZ.js} +1 -1
- package/dist/chunk-IJ2AHSWW.js +2 -0
- package/dist/{chunk-CSNJPD2J.js → chunk-IUQOG7Z5.js} +3 -3
- package/dist/chunk-IZ65ZPWY.js +3 -0
- package/dist/chunk-JGRXMTME.js +15 -0
- package/dist/{chunk-NBXYL2JT.js → chunk-JIRNI5TB.js} +7 -7
- package/dist/chunk-JNSWKGTB.js +2 -0
- package/dist/chunk-JZP3Y4ZM.js +2 -0
- package/dist/chunk-KF4DKXSS.js +2 -0
- package/dist/chunk-KGNE5CIM.js +2 -0
- package/dist/chunk-KM3YCIDV.js +3 -0
- package/dist/{chunk-HAYV4D2I.js → chunk-KODJVOCN.js} +1 -1
- package/dist/chunk-KU3YHPWZ.js +2 -0
- package/dist/{chunk-M3UAZTDK.js → chunk-KXHJMAZU.js} +2 -2
- package/dist/chunk-L5DALV5N.js +2 -0
- package/dist/chunk-LAOTVZHV.js +6 -0
- package/dist/chunk-LCSJ7GOG.js +2 -0
- package/dist/{chunk-DWMESHFI.js → chunk-LIGTP3A3.js} +1 -1
- package/dist/chunk-LKQFG4RW.js +5 -0
- package/dist/{chunk-EBLXHOE3.js → chunk-LQQNPMOD.js} +1 -1
- package/dist/chunk-LSDJOVWW.js +6 -0
- package/dist/{chunk-C6S2RPZA.js → chunk-LUR7JFPP.js} +1 -1
- package/dist/chunk-LUZBGTYB.js +2 -0
- package/dist/chunk-LX2I4JEH.js +2 -0
- package/dist/{chunk-7GAHJZLH.js → chunk-M43WH5DQ.js} +1 -1
- package/dist/chunk-MEKPGQAM.js +21 -0
- package/dist/chunk-MNBGG4H3.js +16 -0
- package/dist/chunk-MYVKUJGS.js +2 -0
- package/dist/chunk-MYZHOBS4.js +2 -0
- package/dist/chunk-NC7D7GOM.js +21 -0
- package/dist/chunk-NIVFEACM.js +2 -0
- package/dist/chunk-NLZZLANH.js +4 -0
- package/dist/{chunk-XT7XA4DN.js → chunk-NXAJBSIF.js} +1 -1
- package/dist/chunk-NXRF7FFS.js +2 -0
- package/dist/chunk-NZ6AV2TA.js +4 -0
- package/dist/chunk-O3HHTKZ5.js +6 -0
- package/dist/chunk-OCDBTAYS.js +12 -0
- package/dist/chunk-OFSDB7B4.js +3 -0
- package/dist/{chunk-Q5CINJYL.js → chunk-OGFU4YY4.js} +1 -1
- package/dist/chunk-OJ33Q6DU.js +2 -0
- package/dist/chunk-P2ZQDQDB.js +2 -0
- package/dist/{chunk-KXEE6VCA.js → chunk-P3JXJ4BW.js} +1 -1
- package/dist/chunk-PAWQ4AKN.js +2 -0
- package/dist/chunk-PUVMC4PX.js +26 -0
- package/dist/{chunk-SEEEGDVK.js → chunk-PZA3BSOE.js} +1 -1
- package/dist/chunk-Q3C6NDGI.js +2 -0
- package/dist/chunk-QBYENBMB.js +2 -0
- package/dist/chunk-QDFY5GGO.js +5 -0
- package/dist/chunk-QDXKEOKI.js +16 -0
- package/dist/{chunk-6VY62QC2.js → chunk-QENCC2ZS.js} +1 -1
- package/dist/chunk-QI5RZ7LL.js +2 -0
- package/dist/chunk-QXQ7KVEN.js +2 -0
- package/dist/chunk-R4JUKTDO.js +2 -0
- package/dist/chunk-R7KXAISS.js +12 -0
- package/dist/chunk-RDP7GWSY.js +2 -0
- package/dist/chunk-REKHAN53.js +5 -0
- package/dist/chunk-RF37IJNN.js +2 -0
- package/dist/{chunk-KWEOLPBJ.js → chunk-RFEON5GN.js} +1 -1
- package/dist/chunk-RHGW7B5Q.js +2 -0
- package/dist/chunk-RPRXRKKR.js +2 -0
- package/dist/{chunk-EOA6YPES.js → chunk-RTVHJ23A.js} +4 -4
- package/dist/chunk-RTVWQK7I.js +2 -0
- package/dist/chunk-RX6776AI.js +5 -0
- package/dist/{chunk-F7NSSQYZ.js → chunk-SGPAM5DZ.js} +1 -1
- package/dist/chunk-SMTBOSEJ.js +2 -0
- package/dist/chunk-SMXABALN.js +2 -0
- package/dist/{chunk-TM7VRLWS.js → chunk-SXRHKXSE.js} +1 -1
- package/dist/chunk-TNORODUF.js +2 -0
- package/dist/chunk-TU42YZOJ.js +6 -0
- package/dist/chunk-TU7TVFBK.js +2 -0
- package/dist/chunk-TW5AA5A7.js +8 -0
- package/dist/chunk-UEE3RZN4.js +14 -0
- package/dist/chunk-URH4FX3H.js +2 -0
- package/dist/chunk-UTM7D4PI.js +2 -0
- package/dist/chunk-UUJIGOEO.js +2 -0
- package/dist/chunk-UYDHOHSZ.js +2 -0
- package/dist/{chunk-4BZOG6PE.js → chunk-V7USCQWO.js} +1 -1
- package/dist/chunk-VJGWVBZR.js +1 -0
- package/dist/chunk-VLDCHFXF.js +2 -0
- package/dist/chunk-VO66KP2W.js +2 -0
- package/dist/chunk-VRIZDOO5.js +2 -0
- package/dist/{chunk-DOOI2JBD.js → chunk-VSVWNRI2.js} +1 -1
- package/dist/chunk-VUFIL5VR.js +6 -0
- package/dist/chunk-VX657KIK.js +2 -0
- package/dist/chunk-VXGN3IV7.js +2 -0
- package/dist/chunk-VZ4A6WMK.js +97 -0
- package/dist/chunk-VZJ6LUXX.js +2 -0
- package/dist/{chunk-RWSOZPJQ.js → chunk-W4QSZNMB.js} +1 -1
- package/dist/chunk-W54OT2FU.js +9 -0
- package/dist/{chunk-BL3SJDCG.js → chunk-W6HZF56M.js} +1 -1
- package/dist/chunk-W72ACCFL.js +27 -0
- package/dist/chunk-W7FLXW6Q.js +5 -0
- package/dist/chunk-WAOUE7MP.js +9 -0
- package/dist/chunk-WEIPY3CI.js +16 -0
- package/dist/chunk-WMGKUERB.js +6 -0
- package/dist/{chunk-DFS4RMVP.js → chunk-WN5VKKJ3.js} +1 -1
- package/dist/chunk-WOSANGV6.js +5 -0
- package/dist/{chunk-K3IQEL7R.js → chunk-WXJCJL5L.js} +1 -1
- package/dist/chunk-WZXPF3BI.js +2 -0
- package/dist/chunk-XB6BJPDL.js +2 -0
- package/dist/{chunk-4FHK4LKQ.js → chunk-XLEGGC4Y.js} +1 -1
- package/dist/chunk-XMPTFXPW.js +5 -0
- package/dist/chunk-XQMWHPZI.js +3 -0
- package/dist/{chunk-75MMTNPB.js → chunk-XRNQSXOM.js} +2 -2
- package/dist/{chunk-2PKME4VT.js → chunk-XZGEN4NU.js} +4 -4
- package/dist/chunk-XZYA7DNH.js +2 -0
- package/dist/{chunk-OIUV3ISA.js → chunk-Y6Y6RAY4.js} +1 -1
- package/dist/chunk-Y7E5L42F.js +3 -0
- package/dist/{chunk-GFBAK7WQ.js → chunk-YAW6JW6D.js} +7 -7
- package/dist/chunk-YDPTSDIJ.js +2 -0
- package/dist/chunk-YDSGXB25.js +2 -0
- package/dist/chunk-YGRULEZY.js +2 -0
- package/dist/chunk-YHFZFV3A.js +22 -0
- package/dist/chunk-YIKF4ERQ.js +375 -0
- package/dist/chunk-YLXWAY7D.js +2 -0
- package/dist/{chunk-UA2QDAWT.js → chunk-YPFQ4UGF.js} +1 -1
- package/dist/{chunk-4CYBXJIA.js → chunk-YQ5C6UDG.js} +1 -1
- package/dist/chunk-Z55KBMYV.js +2 -0
- package/dist/chunk-ZAFJQ3SM.js +2 -0
- package/dist/chunk-ZCRZFAOT.js +2 -0
- package/dist/chunk-ZFM77AQU.js +2 -0
- package/dist/{chunk-Q6F23V7L.js → chunk-ZFMRQ57Y.js} +1 -1
- package/dist/chunk-ZHWU6L2G.js +5 -0
- package/dist/chunk-ZTHYAHDN.js +17 -0
- package/dist/{chunk-X2A6CC6B.js → chunk-ZTRRFG52.js} +1 -1
- package/dist/chunk-ZU4W2QGM.js +3 -0
- package/dist/committer-JGY66PFM.js +2 -0
- package/dist/config-754B73XK.js +2 -0
- package/dist/controller-client-PB3AZAGG.js +2 -0
- package/dist/cover-cmd-NBNZCR6C.js +2 -0
- package/dist/{credentials-QD32Y7K7.js → credentials-F7DYLVWY.js} +1 -1
- package/dist/{deps-bundle-OI7JJ22L.js → deps-bundle-PW3WEQJ7.js} +1 -1
- package/dist/{deps-resolve-ZOALDS6H.js → deps-resolve-SQYVN76L.js} +1 -1
- package/dist/descriptor-7T32VRMB.js +2 -0
- package/dist/design-chat-F3OEZPNJ.js +2 -0
- package/dist/design-committer-TRYP3LOZ.js +2 -0
- package/dist/design-headless-OTHYOX3E.js +2 -0
- package/dist/design-remote-2BEGCVCX.js +3 -0
- package/dist/device-env-CHFRRV6W.js +2 -0
- package/dist/dispatch-DVQ3H7EJ.js +2 -0
- package/dist/doctor-XY26Z35T.js +2 -0
- package/dist/docx-convert-6IZO5P5K.js +2 -0
- package/dist/{dossier-7HVC6BNK.js → dossier-NROC2MCY.js} +1 -1
- package/dist/evidence-P6FFKC7B.js +2 -0
- package/dist/evidence-presentation-YYTIDCBS.js +2 -0
- package/dist/evolve-cmd-WWOB3QJR.js +2 -0
- package/dist/evolve-remote-WLVY3QID.js +2 -0
- package/dist/{exit-manager-ZLDO54S4.js → exit-manager-EDHCETUN.js} +1 -1
- package/dist/explain-DGJ5T6V5.js +2 -0
- package/dist/explain-cmd-OP5I5W3O.js +12 -0
- package/dist/explain-cmd-VYAANFFZ.js +4 -0
- package/dist/explore-K5YBGHK6.js +2 -0
- package/dist/explore-context-tty-RZ7D2TBV.js +2 -0
- package/dist/explore-entry-EKXJ67BD.js +6 -0
- package/dist/explore-live-2YVRAQZO.js +5 -0
- package/dist/explore-run-tty-D47FGPX7.js +5 -0
- package/dist/extract-bind-W2NET364.js +14 -0
- package/dist/extract-chat-M65NWGUK.js +2 -0
- package/dist/extract-cmd-FTFLETOP.js +6 -0
- package/dist/extract-headless-G6W6JQ27.js +2 -0
- package/dist/feeder-NY45UFJK.js +2 -0
- package/dist/folder-flags-KKIH654K.js +2 -0
- package/dist/gaps-cmd-OIDDLRYL.js +3 -0
- package/dist/gate-7AKRPRMK.js +2 -0
- package/dist/gate-WISOUTHQ.js +2 -0
- package/dist/{generate-headless-6WMJYNI6.js → generate-headless-RURIEKVS.js} +3 -3
- package/dist/headless-io-FFM5T6KL.js +2 -0
- package/dist/hold-passthrough-IOWPVB4W.js +2 -0
- package/dist/identity-HL5CJJXR.js +2 -0
- package/dist/index.js +178 -160
- package/dist/ingest-PDGS5ZTL.js +2 -0
- package/dist/ingest-cmd-4G2AK4Y2.js +8 -0
- package/dist/ingest-remote-SSLUHQVG.js +2 -0
- package/dist/ink-screen-RZ7QDIUI.js +2 -0
- package/dist/install-ZVBHPXGP.js +2 -0
- package/dist/interactive-bind-SI2ZS55Q.js +26 -0
- package/dist/interactive-remote-J56EWJGA.js +65 -0
- package/dist/interrupt-guard-QETBPINI.js +2 -0
- package/dist/lane-AQYRIW24.js +2 -0
- package/dist/lattice-auth-6FEVSR7E.js +2 -0
- package/dist/lifecycle-cmd-HJ37LTXE.js +2 -0
- package/dist/list-cmd-6XL2FYLQ.js +3 -0
- package/dist/list-commands-5DCCKU3L.js +2 -0
- package/dist/list-remote-LXPQNXYN.js +15 -0
- package/dist/locks-cmd-JJ2QNTNY.js +2 -0
- package/dist/logical-ids-RXAQJZ3T.js +2 -0
- package/dist/login-flow-WEK3E476.js +2 -0
- package/dist/maintenance-cmd-BXXHP36K.js +2 -0
- package/dist/mobile-prompts-CECJ5UY2.js +2 -0
- package/dist/{next-KZXH4UA4.js → next-O6SUSX3R.js} +1 -1
- package/dist/{objective-variable-gate-CG2KK5UX.js → objective-variable-gate-3Z7DNVVC.js} +1 -1
- package/dist/onboarding-PDVYMTY5.js +5 -0
- package/dist/open-provider-OZAG6WZS.js +2 -0
- package/dist/{paths-JCYX6UWL.js → paths-UMIX3RJF.js} +1 -1
- package/dist/pdf-convert-447ACUB3.js +2 -0
- package/dist/persist-recorded-session-A3ID7JFA.js +3 -0
- package/dist/phase-seed-LCJ4WSYV.js +2 -0
- package/dist/pipeline-GX3LKPI5.js +2 -0
- package/dist/prepare-target-FMT6QFHZ.js +2 -0
- package/dist/pull-cmd-UPFQYUND.js +2 -0
- package/dist/pull-route-FWBXJMR7.js +2 -0
- package/dist/readmodel-INMP6MNW.js +2 -0
- package/dist/real-device-run-X7JJWOIK.js +2 -0
- package/dist/reconcile-cmd-JBH365JL.js +5 -0
- package/dist/reconcile-deps-TWJ3FTSU.js +2 -0
- package/dist/reconcile-remote-BCX6SWFC.js +13 -0
- package/dist/recording-banner-YKBAL6UB.js +2 -0
- package/dist/registry-VQC757MJ.js +2 -0
- package/dist/remote-entry-X6JMPC2K.js +2 -0
- package/dist/remote-mode-FDPA7EWG.js +4 -0
- package/dist/remote-words-YVB66R3F.js +2 -0
- package/dist/require-project-folder-MLMEQJYP.js +2 -0
- package/dist/resolve-run-intent-PC7TQZUL.js +2 -0
- package/dist/resolver-EID34LQE.js +2 -0
- package/dist/revert-FHOBLZWF.js +2 -0
- package/dist/review-cmd-EUHFLFMY.js +5 -0
- package/dist/run-5RQUCNYP.js +2 -0
- package/dist/run-PC5YO4AS.js +2 -0
- package/dist/run-channel-63SVP5OI.js +2 -0
- package/dist/run-remote-SJCRTL7O.js +2 -0
- package/dist/run-startup-gate-YO66G6LS.js +2 -0
- package/dist/run-test-md-BLNBK4MH.js +17 -0
- package/dist/scrollback-GGNBDFQV.js +2 -0
- package/dist/session-target-DD53UXO7.js +2 -0
- package/dist/session-worker.js +12 -0
- package/dist/sessions-CFV7FOIT.js +2 -0
- package/dist/sessions-cmd-S7WZBUCN.js +26 -0
- package/dist/sessions-remote-IWHWIQ2T.js +3 -0
- package/dist/shell-arg-FN3MT5U7.js +2 -0
- package/dist/{skill-installer-32YYMM4N.js → skill-installer-MAVQY6GW.js} +1 -1
- package/dist/spawner-C7NLLM4F.js +2 -0
- package/dist/store-MSA7KASS.js +2 -0
- package/dist/store-choice-3OJCV26J.js +2 -0
- package/dist/store-guard-OOSDLMEC.js +2 -0
- package/dist/store-id-YZ5WKJ25.js +2 -0
- package/dist/store-site-KA2DNBGY.js +2 -0
- package/dist/stream-warnings-GEQKKJU7.js +2 -0
- package/dist/structured-answers-EQ2AP3F7.js +2 -0
- package/dist/sync-cmd-RDFDMVKQ.js +2 -0
- package/dist/sync-setup-RBRDUV7Q.js +2 -0
- package/dist/{sync-setup-ui-RC727VK6.js → sync-setup-ui-XITPGSO4.js} +2 -2
- package/dist/tcg-generate-KIECTZ2C.js +2 -0
- package/dist/test-definition-VRI4YIYL.js +2 -0
- package/dist/testmd-actions-CMAG6HWI.js +2 -0
- package/dist/testmd-sync-UPAA5UMD.js +2 -0
- package/dist/tms-client-NXAB6VJD.js +2 -0
- package/dist/token-refresh-KP3AYMYK.js +2 -0
- package/dist/trust-gate-AT2XBWN4.js +2 -0
- package/dist/turn-preflight-LHYLRL7G.js +2 -0
- package/dist/ui-SNV3FD2G.js +4 -0
- package/dist/use-case-ref-NE4X4MZN.js +2 -0
- package/dist/validate-basic-M5JHHNZA.js +2 -0
- package/dist/{variable-receipt-YWNS24TH.js → variable-receipt-BXSZO36E.js} +1 -1
- package/dist/verdicts-XK3GAUX3.js +2 -0
- package/dist/version-check-Q737BE65.js +2 -0
- package/dist/{view-cmd-3WHG6MVB.js → view-cmd-XSNL5DGI.js} +4 -3
- package/dist/walk-session-SHGYLFRB.js +2 -0
- package/dist/with-telemetry-PM2HVN2B.js +2 -0
- package/package.json +11 -11
- package/dist/ChatSurface-FJPK3XEJ.js +0 -8
- package/dist/ChromeProfilePicker-7DUDJTE2.js +0 -2
- package/dist/CliFeedbackPrompt-ZZPYC6OS.js +0 -2
- package/dist/CliUploadProgress-WQYKIBAR.js +0 -2
- package/dist/ConfigView-KXNOODDW.js +0 -2
- package/dist/EvidenceViewOffer-BTBVPBZX.js +0 -2
- package/dist/FolderPicker-H4YEX5LV.js +0 -2
- package/dist/InfoBox-DTM7X24Z.js +0 -2
- package/dist/LinksBox-KFG3FVOT.js +0 -2
- package/dist/ProfilesView-KBZHT4KL.js +0 -2
- package/dist/ProjectPicker-OARWULNN.js +0 -2
- package/dist/SaveSessionPrompt-37SMU5MC.js +0 -2
- package/dist/ScrollbackTap-QHJOFYMC.js +0 -2
- package/dist/SingleShotApp-UYCAW65Y.js +0 -2
- package/dist/SummaryBox-6RB5DSAH.js +0 -2
- package/dist/TestMdRunView-ZMOII3PL.js +0 -2
- package/dist/TestrunEvidenceTable-3UP2EYIV.js +0 -2
- package/dist/WhoamiView-MC62GERR.js +0 -2
- package/dist/app-client-PQFJAB63.js +0 -2
- package/dist/app-download-P6YXWSVQ.js +0 -2
- package/dist/auth-LXW4OFKF.js +0 -2
- package/dist/bind-ZYESQSCJ.js +0 -15
- package/dist/bootstrap-DI4UGMH3.js +0 -2
- package/dist/bridge-7J3JE3JS.js +0 -2
- package/dist/build-JIKYOZUH.js +0 -2
- package/dist/catalog-LLME3744.js +0 -2
- package/dist/chat-committer-6D7AQI6Z.js +0 -2
- package/dist/chat-controller-UJQ6Z4RE.js +0 -2
- package/dist/chunk-243ZJHT6.js +0 -4
- package/dist/chunk-2KVECC36.js +0 -2
- package/dist/chunk-2YEHV2CX.js +0 -2
- package/dist/chunk-3MCPTVJX.js +0 -2
- package/dist/chunk-3UI5VTQS.js +0 -4
- package/dist/chunk-3VAU3PNU.js +0 -2
- package/dist/chunk-3YIZG7WZ.js +0 -3
- package/dist/chunk-4Y2WH77W.js +0 -2
- package/dist/chunk-5EOX4MEY.js +0 -2
- package/dist/chunk-5HMN74RZ.js +0 -9
- package/dist/chunk-5LJRZI7S.js +0 -6
- package/dist/chunk-5RCS2LIQ.js +0 -26
- package/dist/chunk-5TQFOPJV.js +0 -2
- package/dist/chunk-5ZFOKYFB.js +0 -5
- package/dist/chunk-63DYVWNX.js +0 -2
- package/dist/chunk-6MD7SR7D.js +0 -9
- package/dist/chunk-7N6OCHPC.js +0 -7
- package/dist/chunk-A2SQD2AY.js +0 -4
- package/dist/chunk-AACQE24F.js +0 -2
- package/dist/chunk-AHFIRHSP.js +0 -18
- package/dist/chunk-AJT34ESA.js +0 -38
- package/dist/chunk-AUMJ4RVA.js +0 -21
- package/dist/chunk-AXTPNZPX.js +0 -2
- package/dist/chunk-BB2W35TW.js +0 -2
- package/dist/chunk-BKM2LWU2.js +0 -3
- package/dist/chunk-BUPRL2TE.js +0 -2
- package/dist/chunk-C44QQJR4.js +0 -239
- package/dist/chunk-CW3RHKLA.js +0 -5
- package/dist/chunk-D6E6KRVX.js +0 -2
- package/dist/chunk-DTRKTBCE.js +0 -17
- package/dist/chunk-DTRSYWZE.js +0 -2
- package/dist/chunk-EVFFDODK.js +0 -5
- package/dist/chunk-F2OBORCG.js +0 -2
- package/dist/chunk-FQNQVC5O.js +0 -5
- package/dist/chunk-FY7TCYPK.js +0 -6
- package/dist/chunk-GTVQYT3D.js +0 -35
- package/dist/chunk-HG5LLZBU.js +0 -2
- package/dist/chunk-I7TIGB7K.js +0 -2
- package/dist/chunk-IICT4VOU.js +0 -2
- package/dist/chunk-ILDHE4P4.js +0 -6
- package/dist/chunk-IPXKUYUK.js +0 -2
- package/dist/chunk-JQY5HRZ4.js +0 -15
- package/dist/chunk-JX6BFEDO.js +0 -4
- package/dist/chunk-K2UJYY2U.js +0 -2
- package/dist/chunk-KBM3XHAM.js +0 -2
- package/dist/chunk-KDNNMU7Q.js +0 -4
- package/dist/chunk-KJQNAOOE.js +0 -6
- package/dist/chunk-LH4IPANP.js +0 -2
- package/dist/chunk-LLG7NEGX.js +0 -6
- package/dist/chunk-LSDWPG6C.js +0 -2
- package/dist/chunk-MSGW4JDG.js +0 -2
- package/dist/chunk-NJ4BXZBX.js +0 -2
- package/dist/chunk-NLCCBXXV.js +0 -2
- package/dist/chunk-NMSZ7G6P.js +0 -2
- package/dist/chunk-OC6H6BYI.js +0 -6
- package/dist/chunk-OJAXOOZ5.js +0 -8
- package/dist/chunk-OMNLAGQC.js +0 -29
- package/dist/chunk-OOCCUUR2.js +0 -2
- package/dist/chunk-OXC6O5O7.js +0 -2
- package/dist/chunk-OZQDD2EX.js +0 -94
- package/dist/chunk-PEDINHVU.js +0 -2
- package/dist/chunk-PNUAP3RY.js +0 -8
- package/dist/chunk-Q2F5QB2W.js +0 -2
- package/dist/chunk-Q4YYAN6E.js +0 -2
- package/dist/chunk-Q6AHSGOE.js +0 -5
- package/dist/chunk-QAB3Y5FQ.js +0 -4
- package/dist/chunk-RDHWNSDP.js +0 -7
- package/dist/chunk-RKXHVP2Z.js +0 -2
- package/dist/chunk-RRY5IXOB.js +0 -2
- package/dist/chunk-RSSOJ3L2.js +0 -21
- package/dist/chunk-RTSBKCZY.js +0 -16
- package/dist/chunk-SID4X77D.js +0 -370
- package/dist/chunk-SRTKRHYI.js +0 -12
- package/dist/chunk-T2ONUKTL.js +0 -5
- package/dist/chunk-U6OTFMIT.js +0 -4
- package/dist/chunk-UD7KKHPW.js +0 -5
- package/dist/chunk-USOYXCZ4.js +0 -2
- package/dist/chunk-USY7VAO6.js +0 -2
- package/dist/chunk-V4B5QA3U.js +0 -4
- package/dist/chunk-VBS33P2C.js +0 -2
- package/dist/chunk-VHW7BMZQ.js +0 -2
- package/dist/chunk-VIO7CCFW.js +0 -5
- package/dist/chunk-VORWZLS3.js +0 -9
- package/dist/chunk-VVOKM2VO.js +0 -2
- package/dist/chunk-W5TTF7GB.js +0 -6
- package/dist/chunk-WESMQEPO.js +0 -2
- package/dist/chunk-WMI4P76K.js +0 -27
- package/dist/chunk-WNOC6MQC.js +0 -2
- package/dist/chunk-WVHMPIDQ.js +0 -2
- package/dist/chunk-XBX643ZD.js +0 -2
- package/dist/chunk-XKHWWKJZ.js +0 -3
- package/dist/chunk-XLSOQLVT.js +0 -2
- package/dist/chunk-Y3ZYN6AK.js +0 -4
- package/dist/chunk-YCCUBQY4.js +0 -2
- package/dist/chunk-YKTYVJBN.js +0 -3
- package/dist/chunk-YLQHY4A7.js +0 -2
- package/dist/chunk-Z7IGTVJW.js +0 -2
- package/dist/chunk-ZC2CKWLB.js +0 -2
- package/dist/chunk-ZER3FZSZ.js +0 -22
- package/dist/chunk-ZJYT72BA.js +0 -9
- package/dist/chunk-ZKSN2SJ7.js +0 -2
- package/dist/chunk-ZLWURCJ7.js +0 -2
- package/dist/committer-2QPBANRD.js +0 -2
- package/dist/config-YGTHSGQN.js +0 -2
- package/dist/controller-client-ZF5IXRUV.js +0 -2
- package/dist/cover-cmd-6RO366CC.js +0 -3
- package/dist/descriptor-3JJUOHBM.js +0 -2
- package/dist/design-committer-D44GSUXY.js +0 -2
- package/dist/device-env-DXDJJMTL.js +0 -2
- package/dist/dispatch-7EWWQRQ5.js +0 -2
- package/dist/doctor-TPYPEEUL.js +0 -2
- package/dist/docx-convert-SQRTF7XS.js +0 -2
- package/dist/evidence-NPFTBGDF.js +0 -2
- package/dist/evidence-presentation-XF23B7F2.js +0 -2
- package/dist/evolve-cmd-VGVXV6XW.js +0 -2
- package/dist/explain-NEFBUX5G.js +0 -2
- package/dist/explain-cmd-GOP5TE63.js +0 -9
- package/dist/explain-cmd-M7IX2YNB.js +0 -3
- package/dist/extract-bind-CKIRLXAJ.js +0 -14
- package/dist/extract-cmd-3EWLSPGS.js +0 -5
- package/dist/feeder-66TUPB2R.js +0 -2
- package/dist/gaps-cmd-WVC5GXQC.js +0 -3
- package/dist/gate-OYRDJMF6.js +0 -2
- package/dist/headless-io-75HUMWZB.js +0 -2
- package/dist/identity-ADZ4PAJF.js +0 -2
- package/dist/ingest-OSNNM3DH.js +0 -2
- package/dist/ingest-cmd-AECK5T4H.js +0 -2
- package/dist/install-ZV3KJZV4.js +0 -2
- package/dist/interactive-bind-IYS6KDOH.js +0 -26
- package/dist/interrupt-guard-UREUWNRL.js +0 -2
- package/dist/lifecycle-cmd-XCSBELFQ.js +0 -2
- package/dist/list-cmd-S4DSN2ET.js +0 -3
- package/dist/list-commands-GLNGHPDU.js +0 -2
- package/dist/locks-cmd-67OHQZNV.js +0 -2
- package/dist/logical-ids-GLVM2SVR.js +0 -2
- package/dist/login-flow-ASUUU7SO.js +0 -2
- package/dist/maintenance-cmd-K5KXRIFL.js +0 -2
- package/dist/mobile-prompts-ZUZTA3RV.js +0 -2
- package/dist/open-provider-YIBB77FE.js +0 -2
- package/dist/pdf-convert-RLXSXFWN.js +0 -2
- package/dist/persist-recorded-session-EWV56TSZ.js +0 -3
- package/dist/phase-seed-MKHEWUN6.js +0 -2
- package/dist/pipeline-LAWACB2O.js +0 -2
- package/dist/prepare-target-WGPCZKLE.js +0 -2
- package/dist/readmodel-FVLRQWZ7.js +0 -2
- package/dist/real-device-run-MDLFKFVQ.js +0 -2
- package/dist/reconcile-cmd-XFM2ZXUJ.js +0 -2
- package/dist/reconcile-deps-V5VLDPYT.js +0 -4
- package/dist/reconcile-engine-VZBTMPUK.js +0 -2
- package/dist/recording-banner-CJHRPHHF.js +0 -2
- package/dist/records-LMCVKPE5.js +0 -2
- package/dist/registry-3JXQFZEG.js +0 -2
- package/dist/require-project-folder-SE5GVCYJ.js +0 -2
- package/dist/resolve-run-intent-DD4MB6UD.js +0 -2
- package/dist/resolver-TLO4SRWV.js +0 -2
- package/dist/revert-NOUECRW4.js +0 -2
- package/dist/review-cmd-7EOYQMPE.js +0 -5
- package/dist/run-EHUNJPW6.js +0 -2
- package/dist/run-OTMPUQSH.js +0 -2
- package/dist/run-channel-RGH4WIQX.js +0 -2
- package/dist/run-test-md-KBDEHGXJ.js +0 -17
- package/dist/scrollback-JLPJR25X.js +0 -2
- package/dist/session-items-2ATN7VXG.js +0 -2
- package/dist/session-target-UMNASXI7.js +0 -2
- package/dist/sessions-NH7WQWMX.js +0 -2
- package/dist/sessions-cmd-M3SECFKQ.js +0 -25
- package/dist/spawner-DPT2RLAO.js +0 -2
- package/dist/store-guard-U32JE6JJ.js +0 -2
- package/dist/store-id-EOSGEKVK.js +0 -2
- package/dist/structured-answers-ZI2B6JJE.js +0 -2
- package/dist/sync-cmd-3EP7LZGL.js +0 -2
- package/dist/sync-setup-SWTBVQEV.js +0 -2
- package/dist/tcg-generate-KXU7E2GF.js +0 -2
- package/dist/testmd-actions-PEWCPQ5R.js +0 -2
- package/dist/testmd-sync-ZWFQWZ2X.js +0 -2
- package/dist/tms-client-KU6HCA23.js +0 -2
- package/dist/token-refresh-QD3OCGJJ.js +0 -2
- package/dist/trust-gate-EX7R2P4Y.js +0 -2
- package/dist/turn-preflight-JGYT7LXP.js +0 -2
- package/dist/ui-JEJGTURD.js +0 -4
- package/dist/validate-basic-AAIXSAWH.js +0 -2
- package/dist/verdicts-LAB5BGCC.js +0 -2
- package/dist/version-check-EHOLX3YH.js +0 -2
- package/dist/walk-session-XP4KYFKO.js +0 -2
- package/dist/with-telemetry-FJMJQDCM.js +0 -2
- /package/dist/{chunk-BKHXPBWN.js → chunk-2RUSXQ3O.js} +0 -0
- /package/dist/{chunk-6J5T5FEY.js → chunk-3AGP2BVN.js} +0 -0
- /package/dist/{chunk-CH273NAE.js → chunk-73Y6T2UK.js} +0 -0
- /package/dist/{chunk-ZMNJBUAO.js → chunk-73ZFOJOK.js} +0 -0
- /package/dist/{chunk-NOL7MNZH.js → chunk-A7RJQJNT.js} +0 -0
- /package/dist/{chunk-N2P4MI32.js → chunk-FWGUISUG.js} +0 -0
- /package/dist/{chunk-UJZZDPDY.js → chunk-HD6NR44L.js} +0 -0
- /package/dist/{chunk-LDPLJFCV.js → chunk-I6S6DZ2E.js} +0 -0
- /package/dist/{chunk-427OQS2N.js → chunk-LD5B3QFW.js} +0 -0
- /package/dist/{chunk-2UIHS2FH.js → chunk-PGESS7BW.js} +0 -0
- /package/dist/{chunk-BZAGVBCX.js → chunk-ZCIWQHCO.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c as d,d as p,e as g}from"./chunk-
|
|
2
|
+
import{c as d,d as p,e as g}from"./chunk-M43WH5DQ.js";import{b as m}from"./chunk-D36V5OX6.js";import{mkdirSync as y,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",queueTimeout:300,appiumPort:4739,androidHome:"$HOME/android-sdk-shim",globalTimeout:90,testSuiteTimeout:90,testSuiteStep:45,ios:{runson:{}},realDevice:{runson:"linux"}}},v=`version: "0.1"
|
|
3
3
|
runson: {{runson}}
|
|
4
4
|
autosplit: true
|
|
5
5
|
concurrency: {{concurrency}}
|
|
@@ -11,7 +11,7 @@ runtime:
|
|
|
11
11
|
{{timeouts}}{{deviceDirective}}env:
|
|
12
12
|
KANE_CLI_MODE: hyperexecute
|
|
13
13
|
TESTMUAI_ENV: {{env}}
|
|
14
|
-
pre:
|
|
14
|
+
{{gridEnv}}pre:
|
|
15
15
|
- rm -rf .testmuai/evidence
|
|
16
16
|
- npm install -g @testmuai/kane-cli@{{kaneVersion}}
|
|
17
17
|
{{devicePre}} - kane-cli login --env {{env}} --username \${{.secrets.LT_USERNAME}} --access-key \${{.secrets.LT_ACCESS_KEY}}{{projectFolderFlags}}
|
|
@@ -34,21 +34,21 @@ uploadArtefacts:
|
|
|
34
34
|
`,$=`{{kaneDistSwap}} C=$(find /Users/ltuser/lrc/chrome /Applications "$HOME/Applications" -maxdepth 6 -name 'Google Chrome' -path '*/MacOS/*' -type f 2>/dev/null | head -1)
|
|
35
35
|
if [ -z "$C" ]; then C=$(command -v google-chrome || command -v google-chrome-stable || true); fi
|
|
36
36
|
if [ -n "$C" ]; then export KANE_CLI_CHROME_PATH="$C"; echo "using chrome: $C"; fi
|
|
37
|
-
{{sessionMark}} kane-cli testmd run "$test" --env {{env}} --no-evidence-publish --headless --agent{{memberFlags}}
|
|
37
|
+
{{memberLookup}}{{sessionMark}} kane-cli testmd run "$test" --env {{env}} --no-evidence-publish --headless --agent{{caseFlag}}{{memberFlags}}
|
|
38
38
|
rc=$?
|
|
39
39
|
{{sessionCopy}} exit $rc`,P=` NPMROOT=$(npm root -g)
|
|
40
40
|
rm -rf "$NPMROOT/@testmuai/kane-cli/dist"
|
|
41
41
|
cp -R {{kaneDist}} "$NPMROOT/@testmuai/kane-cli/dist"
|
|
42
42
|
echo "[swap] patched kane-cli dist installed from {{kaneDist}}"
|
|
43
43
|
`,C=`{{kaneDistSwap}} adb devices
|
|
44
|
-
{{memberLookup}}{{sessionMark}} kane-cli testmd run "$test" --env {{env}} --no-evidence-publish --agent{{deviceFlags}}{{memberFlags}}
|
|
44
|
+
{{memberLookup}}{{sessionMark}} kane-cli testmd run "$test" --env {{env}} --no-evidence-publish --agent{{deviceFlags}}{{caseFlag}}{{memberFlags}}
|
|
45
45
|
rc=$?
|
|
46
46
|
{{sessionCopy}} exit $rc`,x=`{{kaneDistSwap}} xcrun simctl list devices available | grep -v -- '-- Unavailable' || true
|
|
47
|
-
{{memberLookup}}{{sessionMark}} kane-cli testmd run "$test" --env {{env}} --no-evidence-publish --agent{{deviceFlags}}{{memberFlags}}
|
|
47
|
+
{{memberLookup}}{{sessionMark}} kane-cli testmd run "$test" --env {{env}} --no-evidence-publish --agent{{deviceFlags}}{{caseFlag}}{{memberFlags}}
|
|
48
48
|
rc=$?
|
|
49
|
-
{{sessionCopy}} exit $rc`,b=`{{kaneDistSwap}}{{memberLookup}}{{sessionMark}} kane-cli testmd run "$test" --env {{env}} --no-evidence-publish --agent{{deviceFlags}}{{memberFlags}}
|
|
49
|
+
{{sessionCopy}} exit $rc`,b=`{{kaneDistSwap}}{{memberLookup}}{{sessionMark}} kane-cli testmd run "$test" --env {{env}} --no-evidence-publish --agent{{deviceFlags}}{{caseFlag}}{{memberFlags}}
|
|
50
50
|
rc=$?
|
|
51
|
-
{{sessionCopy}} exit $rc`;var
|
|
52
|
-
`);for(let[N,
|
|
51
|
+
{{sessionCopy}} exit $rc`;var O={"remote-execution":{manifest:E,templates:{"hyperexecute.yaml.tmpl":v},config:f}};function S(e){return O[e]}function B(e,i){let l=i.base??m,s=S(e);if(!s)return{status:"failed",name:e,version:"",dir:"",error:`unknown plugin '${e}'`};let n=s.manifest.version;if(i.version&&i.version!==n)return{status:"failed",name:e,version:n,dir:"",error:`only bundled version ${n} is available (requested ${i.version})`};let t=d(e,n,l),c=p(e,l),_=u(a(t,"plugin.json"))&&u(c)&&M(c,"utf8").trim()===n;try{y(a(t,"templates"),{recursive:!0}),o(a(t,"plugin.json"),JSON.stringify(s.manifest,null,2)+`
|
|
52
|
+
`);for(let[N,k]of Object.entries(s.templates))o(a(t,"templates",N),k);let r=g(e,l);return u(r)||o(r,JSON.stringify(s.config,null,2)+`
|
|
53
53
|
`),o(c,n+`
|
|
54
54
|
`),{status:_?"already-installed":"installed",name:e,version:n,dir:t}}catch(r){return{status:"failed",name:e,version:n,dir:t,error:r.message}}}export{v as a,R as b,h as c,$ as d,P as e,C as f,x as g,b as h,B as i};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as C}from"./chunk-
|
|
2
|
+
import{a as C}from"./chunk-LIGTP3A3.js";import{h as Q}from"./chunk-LQQNPMOD.js";import{b as G}from"./chunk-NXAJBSIF.js";import{c as O}from"./chunk-SMXABALN.js";import{a as E}from"./chunk-ZAFJQ3SM.js";import{a as z}from"./chunk-CUXY6KQ2.js";import{a as B}from"./chunk-ICLUC44J.js";import{e as q}from"./chunk-Z7S3IWUX.js";import{l as M,q as R,t as Z}from"./chunk-A7RJQJNT.js";import{a as A}from"./chunk-HCBYKLMW.js";import{a as n,b as r,i as N}from"./chunk-33DWJV67.js";import{a as L}from"./chunk-6YGTRKDT.js";import{y as o}from"./chunk-D36V5OX6.js";import{e as g}from"./chunk-UR6MHSHU.js";var H=g(L(),1);var y=g(A(),1);function ie(e){return[{value:"local",label:"Local build",hint:R(e).join(" / "),available:!0},{value:"uploaded",label:"Uploaded app",hint:"an app id from your cloud uploads",available:!0}]}function he({kind:e,onSelect:i,onCancel:m}){let s=ie(e),[b,f]=(0,H.useState)(0),[l,d]=(0,H.useState)(null);return N((p,a)=>{if(a.escape){m();return}if(a.upArrow&&f(t=>Math.max(0,t-1)),a.downArrow&&f(t=>Math.min(s.length-1,t+1)),a.return){let t=s[b];if(!t.available){d("That source isn't available \u2014 choose a local build for now.");return}d(null),i(t.value)}}),(0,y.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,y.jsx)(r,{color:o.orange,bold:!0,children:"App under test"}),(0,y.jsx)(n,{marginTop:1,flexDirection:"column",children:s.map((p,a)=>{let t=a===b,S=p.available?t?o.orange:void 0:o.muted;return(0,y.jsxs)(n,{children:[(0,y.jsxs)(r,{color:S,children:[t?"\u276F ":" ",p.label]}),(0,y.jsxs)(r,{color:o.dim,children:[" ",p.hint]})]},p.value)})}),l&&(0,y.jsx)(n,{marginTop:1,children:(0,y.jsx)(r,{color:o.red,children:l})}),(0,y.jsx)(B,{bindings:[{keys:"\u2191\u2193",label:"navigate"},{keys:"\u21B5",label:"select"}],escBackLabel:"back"})]})}var x=g(L(),1);var u=g(A(),1),j=50,J=500;function ae(e){return`${e.name} (${e.appId})`}function Re({kind:e,listApps:i,onSelect:m,onManualEntry:s,onCancel:b,busyMessage:f}){let[l,d]=(0,x.useState)([]),[p,a]=(0,x.useState)(!0),[t,S]=(0,x.useState)(!1),[ee,$]=(0,x.useState)(!1),[w,V]=(0,x.useState)(null),[X,oe]=(0,x.useState)(""),[re,_]=(0,x.useState)(!1),F=(0,x.useRef)(!0),D=(0,x.useRef)(0);if((0,x.useEffect)(()=>{let T=++D.current,k=X.trim();F.current?a(!0):k&&$(!0),S(!0),V(null),_(!1),(async()=>{let I=[];try{for(let P=0;;P+=j){let Y=await i({limit:j,offset:P,search:k});if(T!==D.current)return;if(I.push(...Y.apps),d([...I]),F.current&&(a(!1),F.current=!1),$(!1),Y.apps.length===0||I.length>=Y.total)break;if(I.length>=J){_(!0);break}}}catch(P){if(T!==D.current)return;V(P instanceof Error?P.message:String(P)),a(!1),$(!1)}finally{T===D.current&&S(!1)}})()},[X,i]),N((T,k)=>{if(k.tab){s();return}k.escape&&b()},{isActive:!!w&&!f}),f)return(0,u.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,u.jsx)(r,{color:o.orange,bold:!0,children:"App under test"}),(0,u.jsxs)(n,{marginTop:1,children:[(0,u.jsx)(C,{}),(0,u.jsxs)(r,{color:o.secondary,children:[" ",f]})]})]});if(w)return(0,u.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.red,paddingX:2,paddingY:1,children:[(0,u.jsx)(r,{color:o.red,bold:!0,children:"App under test"}),(0,u.jsx)(n,{marginTop:1,children:(0,u.jsx)(r,{color:o.red,children:"Could not load your uploads."})}),(0,u.jsx)(n,{marginTop:1,children:(0,u.jsx)(r,{color:o.dim,children:w})}),(0,u.jsx)(B,{bindings:[{keys:"tab",label:"tab to enter an app id"}],escBackLabel:"back to chat"})]});let te=new Map(l.map(T=>[T.appId,T])),ne=l.map(T=>({id:T.appId,label:ae(T)})),W=!p&&!t&&l.length===0&&!X.trim()?`No builds for ${M(e)} uploaded to this account yet \u2014 press Tab to enter an app id.`:null;return(0,u.jsx)(E,{title:"App under test",items:ne,loading:p,loadingText:"Loading your uploads\u2026",loadingMore:t,searching:ee,itemNoun:"uploads",preserveSelectionById:!0,onSearch:oe,onTab:s,extraHint:"tab to enter an id",footer:W?(0,u.jsx)(r,{color:o.dim,children:W}):re?(0,u.jsx)(r,{color:o.dim,children:`Showing the first ${J} \u2014 type to search the rest.`}):void 0,onSelect:T=>{let k=te.get(T.id);k&&m({appId:k.appId,name:k.name})},onCancel:b})}var U=g(L(),1);var c=g(A(),1);function we({busyMessage:e,onSubmit:i,onBack:m}){let[s,b]=(0,U.useState)(""),[f,l]=(0,U.useState)(null);return e?(0,c.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,c.jsx)(r,{color:o.orange,bold:!0,children:"App under test"}),(0,c.jsxs)(n,{marginTop:1,children:[(0,c.jsx)(C,{}),(0,c.jsxs)(r,{color:o.secondary,children:[" ",e]})]})]}):(0,c.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,c.jsx)(r,{color:o.orange,bold:!0,children:"App under test"}),(0,c.jsx)(n,{marginTop:1,children:(0,c.jsx)(r,{color:o.dim,children:"App id from your cloud uploads:"})}),(0,c.jsxs)(n,{marginTop:1,children:[(0,c.jsx)(r,{color:o.dim,children:" "}),(0,c.jsx)(O,{value:s,onChange:d=>{b(d),f&&l(null)},onSubmit:d=>{let p=d.trim();if(!p){l("Enter an app id.");return}if(!G(p)){l("That doesn't look like an app id \u2014 they start with APP.");return}l(null),i(p).then(a=>{!a.ok&&a.error&&l(a.error)})},onCancel:m,placeholder:"APP1016032231178585590501450"})]}),f&&(0,c.jsxs)(n,{marginTop:1,flexDirection:"column",children:[(0,c.jsx)(r,{color:o.red,children:f}),(0,c.jsx)(r,{color:o.dim,children:"Enter a valid app id \u2014 copy it from your cloud uploads."})]}),(0,c.jsx)(B,{bindings:[{keys:"\u21B5",label:"use this app"}],escBackLabel:"back"})]})}var K=g(L(),1);var h=g(A(),1);function le(e){return Q(e.trim())}function _e({kind:e,onBack:i,onSelect:m,onCancel:s}){let[b,f]=(0,K.useState)(""),[l,d]=(0,K.useState)(null),p=R(e).join(" / ");return(0,h.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,h.jsx)(r,{color:o.orange,bold:!0,children:"App under test"}),(0,h.jsx)(n,{marginTop:1,children:(0,h.jsx)(r,{color:o.dim,children:`Path to a build (${p}): `})}),(0,h.jsxs)(n,{marginTop:1,children:[(0,h.jsx)(r,{color:o.dim,children:" "}),(0,h.jsx)(O,{value:b,onChange:a=>{f(a),l&&d(null)},onSubmit:a=>{let t=le(a);if(!t){d(a.trim()?`Not a build \u2014 expected ${p}.`:"Enter the path to a build.");return}if(!Z(e,t.value)){d(`${t.kind} builds don't run on ${M(e)} \u2014 expected ${p}.`);return}d(null),m(t).then(S=>{!S.ok&&S.error&&d(S.error)})},onCancel:i,placeholder:`/path/to/app${R(e)[0]}`})]}),l&&(0,h.jsx)(n,{marginTop:1,children:(0,h.jsx)(r,{color:o.red,children:l})}),(0,h.jsx)(B,{bindings:[{keys:"\u21B5",label:"use this build"}],escBackLabel:"back"})]})}var v=g(A(),1);function pe(e){let i=e.kind==="simulator";switch(e.state){case"ready":return i?"Booted":"Running";case"stopped":return i?"Shutdown":"Stopped";case"unauthorized":return"UNAUTHORIZED";case"offline":return"Offline"}}function ce(e){switch(e.state){case"unauthorized":return"accept the authorisation prompt on the device, then reopen this list";case"offline":return e.kind==="simulator"?"not responding \u2014 open Simulator.app to inspect it":"not responding \u2014 reconnect it, or restart the emulator";default:return}}function se(e,i){let m=i.id!==void 0?{...i,id:z(i.id)}:i,s=e.virtualName!==void 0?{...e,virtualName:z(e.virtualName)}:e;return q(s,m)}function de(e){return e.virtualName??e.displayName}function ue(e,i){let m=e.state==="ready"||e.state==="stopped",s=ce(e),b=e.osVersion?` (${e.osVersion})`:"";return{id:e.id,label:`${de(e)}${b} \xB7 ${pe(e)}`,...i&&se(e,i)?{isActive:!0}:{},...m?{}:{disabled:!0},...!m&&s?{disabledHint:s}:{}}}function me(e){return e==="emulator"?"No Android emulator found. Make sure an emulator exists on this machine (Android Studio \u2192 Device Manager), then reopen this list.":e==="simulator"?"No iOS simulator found. Make sure a simulator exists on this machine (Xcode \u2192 Windows \u2192 Devices and Simulators), then reopen this list.":"No emulator or simulator found. Make sure one exists on this machine, then reopen this list."}function eo({targets:e,preselectedTarget:i,preselectedId:m,busyMessage:s,onSelect:b,onCancel:f,kind:l}){if(s)return(0,v.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,v.jsx)(r,{color:o.orange,bold:!0,children:"Device"}),(0,v.jsxs)(n,{marginTop:1,children:[(0,v.jsx)(C,{}),(0,v.jsxs)(r,{color:o.secondary,children:[" ",s]})]})]});if(e.length===0)return(0,v.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,v.jsx)(r,{color:o.orange,bold:!0,children:"Device"}),(0,v.jsx)(n,{marginTop:1,children:(0,v.jsx)(r,{color:o.dim,children:me(l)})})]});let d=e.map(t=>ue(t,i)),p=i?d.find(t=>t.isActive)?.id??null:m?e.find(t=>t.id===m||t.virtualName===m)?.id??null:null,a=new Map(e.map(t=>[t.id,t]));return(0,v.jsx)(E,{title:"Device",items:d,itemNoun:"devices",defaultActiveId:p,preserveSelectionById:!0,onSelect:t=>{let S=a.get(t.id);S&&b(S)},onCancel:f})}export{he as a,Re as b,we as c,_e as d,eo as e};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{j as s}from"./chunk-4I7YN6YY.js";import{AsyncLocalStorage as c}from"async_hooks";function a(n,t){let e=s();e?e(n,t):process.stderr.write(n+`
|
|
3
|
+
`)}var i=new c;function l(n,t){let e=i.getStore(),o=n.attempt!==void 0,r=o?n.attempt:e?.attempt,p=!o&&e?e.appends:{made:0};return i.run({channel:n,...r!==void 0?{attempt:r}:{},appends:p},t)}function g(n){let t=i.getStore()?.channel.event;if(t){t(n);return}process.env.KANE_DEV_MODE==="1"&&a(JSON.stringify(n))}function v(){let n=i.getStore();return n?.attempt===void 0?null:(n.appends.made+=1,`${n.attempt}:${n.appends.made}`)}function h(n,t,e=""){let o=i.getStore()?.channel.event;if(o){o({type:"warning",message:n,...t?{code:t}:{}});return}let r=e+n;a(r.endsWith(`
|
|
4
|
+
`)?r.slice(0,-1):r,t)}export{a,l as b,g as c,v as d,h as e};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{createHash as f,randomBytes as p}from"crypto";import r from"fs";import u from"os";import s from"path";function l(t){return s.join(t,"store.json")}function a(){return`ctx-${p(6).toString("hex")}`}function S(t){return f("sha256").update(`${u.hostname()}|${s.resolve(t)}`).digest("hex").slice(0,32)}function _(t){try{let e=JSON.parse(r.readFileSync(l(t),"utf8"));if(typeof e.context_lineage_id=="string"&&typeof e.context_instance_id=="string")return e}catch{}return null}function m(t){try{return JSON.parse(r.readFileSync(t,"utf8"))}catch{return{}}}function y(t,e){r.mkdirSync(s.dirname(t),{recursive:!0});let n=`${t}.tmp-${process.pid}`;r.writeFileSync(n,JSON.stringify(e,null,2),{mode:384}),r.renameSync(n,t)}function g(t,e){let n=l(t),i=`${n}.tmp-${process.pid}`;r.writeFileSync(i,JSON.stringify(e,null,2)+`
|
|
3
|
+
`,{mode:420}),r.renameSync(i,n)}function O(t,e){let n=_(t);if(!n){n={context_lineage_id:a(),context_instance_id:a(),created_at:new Date().toISOString(),schema:1};try{g(t,n)}catch{return{ids:n,cloned:!1}}}let i=!1;try{let o=m(e),d=S(t),c=o[n.context_lineage_id];c&&c.fingerprint!==d&&r.existsSync(s.join(c.store_path,"store.json"))&&(i=!0,n={...n,context_instance_id:a()},g(t,n)),o[n.context_lineage_id]={fingerprint:d,store_path:s.resolve(t),last_seen:new Date().toISOString()},y(e,o)}catch{}return{ids:n,cloned:i}}export{_ as a,O as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as V}from"./chunk-RTVWQK7I.js";import{a as j,f as q}from"./chunk-YIKF4ERQ.js";import{c as _}from"./chunk-44B6THYK.js";import{c as H,e as A,g as P}from"./chunk-7KX2BHKG.js";import{a as O}from"./chunk-VZJ6LUXX.js";import{n as L}from"./chunk-35ECWCCK.js";import{c as h}from"./chunk-BWXLZS5O.js";import{a as I}from"./chunk-GFLB2SHW.js";import{M as S}from"./chunk-UEE3RZN4.js";import{m as D}from"./chunk-4I7YN6YY.js";function F(e,n){try{let s=e.sessions().peek(n);return!s||!L(s,e.sessions().hasBase(n))?!1:(e.sessions().resume(n).complete({ended:"failed",code:"SESSION_KEPT_NOTHING"}),!0)}catch{return!1}}var J=e=>e!==null?{fixCmd:e}:{};function Q(e,n){return e.recordsSince(null).flatMap(o=>{let r=o.design_phase?.phase;return o.sid===n&&typeof r=="string"&&_[r]?[_[r]]:[]}).at(-1)}function X(e,n,s){return e.recordsSince(s).some(o=>o.sid!==n||!o.design_of?!1:o.design_phase?.phase==="tests"||o.nodes.some(r=>r.label==="test"))}async function le(e,n,s){let o=n.enterNested?.("opening the design\u2026")??(()=>{});try{return await Z(e,n,s)}finally{o()}}async function Z(e,n,s){let{force:o=!1,verb:r="design",childSession:d}=e,i=e.resume===!0?d:void 0;if(e.resume===!0&&i===void 0)return n.note("design child not resumed \u2014 a resume needs the child's session"),n.endUnstartedTurn(),2;if(i!==void 0&&F(s.store,i.id))return n.note(`design child ${i.id} kept nothing to resume \u2014 its agent never started; its offer opens again`),n.endUnstartedTurn(),2;let f=(()=>{if(i===void 0)return e.ucRef;try{return s.store.sessions().peek(i.id)?.use_case??e.ucRef}catch{return e.ucRef}})(),y=!1;if(i===void 0)try{let t=H(S(s.store),f);if(!t.ok&&(t.code==="UC_UNREVIEWED"||t.code==="UC_ARCHIVED")){let l=e.confirmUnreviewed??(C=>P(m=>n.ask(m),C)),a=!A(t);if(a||!await l(t))return n.note(t.reviewCmd!==void 0?`design child refused \u2014 approve it first: ${t.reviewCmd}`:"design child refused \u2014 approve it first"),n.endUnstartedTurn(),e.onEnded?.(a?"refused":"declined",a?{code:t.code}:void 0),2;y=!0}}catch{y=!1}let p=(()=>{try{let t=S(s.store),l=t.resolve(f);return(l?t.getNode(l.tip)?.content?.title:void 0)??f}catch{return f}})(),c=d?.id??i?.id,E=i?null:s.store.head(),B=i&&c!==void 0?Q(s.store,c):void 0,W=h(n.state.turns).entries.length,R=()=>h(n.state.turns).entries.filter(t=>t.kind==="test").length,$=R(),T=n.state.credits?.total,K=Date.now();n.ledger({kind:"childOpen",verb:r,subject:p,...d?{sid:d.id}:{},...i?{resumed:!0}:{},...e.replaces?{replaces:e.replaces}:{},...B?{landed:B}:{},...e.evolution?{update:!0}:{},...e.evolution?.changed?{changed:!0}:{}});let M=t=>{let l=Math.max(1,Math.round((Date.now()-K)/1e3)),a=h(n.state.turns).entries.length-W,C=R()-$,m=n.state.credits?.total,w=m!==void 0&&T!==void 0?m-T:m,U=e.evolution!==void 0&&t===0&&c!==void 0&&!s.store.recordsSince(E).some(x=>x.sid===c),G=t===0&&c!==void 0&&!U&&!X(s.store,c,E);if(n.ledger(t===0?{kind:"childClose",verb:r,subject:p,ok:!0,durS:l,...e.evolution?{update:!0}:{},...U?{untouched:!0}:{},...G?{unfinished:!0}:{},...a>0?{results:`${a} item${a===1?"":"s"}`}:{},...C>0?{tests:C}:{},...e.evolution&&c!==void 0?{testsWritten:j(s.store.recordsSince(E).filter(x=>x.sid===c),S(s.store))}:{},...w!==void 0&&w>0?{credits:w}:{}}:{kind:"childClose",verb:r,subject:p,ok:!1,durS:l,exitCode:t,...e.evolution?{update:!0}:{},...J(i!==void 0?D().command("next.resume_child",{sid:i.id}):D().command("next.design_use_case",{use_case:f,force:o||r==="evolve"}))}),e.quietEnding)return;let z=h(n.state.turns).entries.length;n.ledger({kind:"childBack",parentVerb:"extract",context:D().text("chat.child_back",{drafts:z})})},b="",u=1,v=!1,k,g,N=d?.id,Y=(...t)=>(v=!0,s.agent(...t));try{u=await q(i?{resume:i.id,mode:"interactive"}:{useCase:f,force:o,mode:"interactive",...y?{allowUnreviewed:!0}:{},...e.statement?{agentStatement:e.statement}:{},...e.evolution?.because?{because:e.evolution.because}:{},...e.evolution?.changeDelta!==void 0?{changeDelta:e.evolution.changeDelta}:{},...e.evolution?.priorDesign!==void 0?{priorDesign:e.evolution.priorDesign}:{},...d?{sessionId:d.id,registerSession:t=>d.register(t)}:{}},{...s,emit:t=>{!v&&k===void 0&&(k=O(t)??void 0),s.emit?.(V(t,{verb:"design",...N!==void 0?{id:N}:{}}))},agent:Y,ask:t=>n.ask(t),chat:n,nested:!0,out:t=>{b=t},progress:()=>{},isTTY:!0})}catch(t){if(!(e.onHeld&&t instanceof I&&t.code==="SESSION_CLASH"))throw t;g={heldBy:t.extra?.heldBy??null},u=2}finally{let t=u===3&&n.state.status==="pausing";g?n.ledger({kind:"childClose",verb:r,subject:p,ok:!1,durS:0,held:!0}):t&&e.quietEnding||M(u),v||n.endUnstartedTurn(),v&&!t?e.onEnded?.("ran",{exit:u}):g?e.onEnded?.("refused",{code:"SESSION_CLASH"}):k?.final&&e.onEnded?.("refused",{code:k.code})}return g?(e.onHeld(g.heldBy),u):(u!==0&&b&&!e.quietEnding&&n.note(b),u)}export{Q as a,X as b,le as c};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as c}from"./chunk-JQ64X2TO.js";function l(r,s){let t=s.syntax?.trim()??"";return t.startsWith("${")&&t.endsWith("}")?t:"${"+r+"}"}function u(r,s,t){let n=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return r.replace(new RegExp(`\\{\\{\\s*${n}(?=\\s*\\}\\}|[.\\[])`,"g"),`{{${t}.${s}`)}function b(r,s){let t={},n={},o=s;for(let[e,a]of Object.entries(r)){if(c(a)){t[e]={value:a.value,secret:!!a.secret,syntax:l(e,a),type:"parameter"},n[e]=e;continue}if(e.startsWith("global.")||e.startsWith("secrets.user.")||e.startsWith("environment.")){let i=e.startsWith("secrets.user.");t[e]={value:a.value,secret:i,syntax:`{{${e}}}`,type:i?"secret":e.startsWith("environment.")?"environment":"global"},n[e]=e;continue}if(a.secret){let i=`secrets.user.${e}`;t[i]={value:a.value,secret:!0,syntax:`{{secrets.user.${e}}}`,type:"secret"},n[e]=i,o=u(o,e,"secrets.user")}else{let i=`global.${e}`;t[i]={value:a.value,secret:!1,syntax:`{{global.${e}}}`,type:"global"},n[e]=i,o=u(o,e,"global")}}return{variables:t,objective:o,keyMap:n}}var p=/\{\{\s*(?:global|secrets\.user|environment)\.([^{}]+?)\s*\}\}/g;function f(r){return typeof r!="string"||!r.includes("{{")?r:r.replace(p,"{{$1}}")}function g(r){if(typeof r=="string")return f(r);if(Array.isArray(r))return r.map(s=>g(s));if(r&&typeof r=="object"){let s={};for(let[t,n]of Object.entries(r))s[t]=g(n);return s}return r}export{b as a,f as b,g as c};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as d,g as B,k as re}from"./chunk-CB4ARIHR.js";import{a as te}from"./chunk-4IEQNX7F.js";import{fb as ee}from"./chunk-UEE3RZN4.js";import{a as Z}from"./chunk-7DFBOVUB.js";import{g as A}from"./chunk-4I7YN6YY.js";import{createHash as ve,randomBytes as F}from"crypto";import{mkdirSync as ke,mkdtempSync as P,rmSync as $,existsSync as Oe,renameSync as Re}from"fs";import{tmpdir as j}from"os";import{join as _,dirname as de}from"path";import{spawn as ie}from"child_process";function N(n,e=process.env){let t=n.replace(/https?:\/\/[^\s/@]+:[^\s/@]+@/gi,"https://[redacted]@").replace(/(authorization\s*[:=])[^\r\n]+/gi,"$1 [redacted]"),r=e.KANE_SYNC_GIT_TOKEN;if(r)for(let i of[r,Buffer.from(`x-access-token:${r}`).toString("base64")])t=t.split(i).join("[redacted]");return t}function Ae(n,e){if(n.GIT_SSH_COMMAND)return ne(n.GIT_SSH_COMMAND);if(!n.GIT_SSH)return e?ne(e):"ssh -o BatchMode=yes"}function ne(n){return/(^|\s)-o\s*BatchMode=yes(\s|$)/.test(n)?n:`${n} -o BatchMode=yes`}var Ce=/^(?:ssh:\/\/|[^/\s@:]+@[^/\s:]+:)/i,se=new Map;function Ne(n,e){let t=[e??"",n.GIT_CONFIG_GLOBAL??"",n.HOME??""].join("\0"),r=se.get(t);return r===void 0&&(r=ae(["config","--get","core.sshCommand"],n,e,12e4).then(i=>i.code===0&&i.stdout.toString().trim()||void 0,()=>{}),se.set(t,r)),r}var oe=new Set(["fetch","push","clone","ls-remote"]);function xe(n,e,t){if(t!==void 0)return t;if(!n.some(i=>oe.has(i)))return 12e4;let r=e.KANE_SYNC_GIT_TRANSFER_TIMEOUT_SECONDS;if(r!==void 0){if(!/^\d+$/.test(r)||Number(r)<60||Number(r)>3600)throw new Error("KANE_SYNC_GIT_TRANSFER_TIMEOUT_SECONDS must be 60 to 3600");return Number(r)*1e3}return 9e5}function Ie(n){if(n.some(t=>/^(--force(?:-with-lease|-if-includes)?(?:=|$)|--mirror(?:=|$)|--delete(?:=|$)|-f$)/.test(t)))throw new Error("Git location cannot force, mirror or delete");let e=n.indexOf("push");if(e>=0){let t=n.slice(e+1);if(t.length!==3||t[0]!=="--porcelain"||!/^[0-9a-f]{40,64}:refs\/(heads|kane\/probe)\/[A-Za-z0-9._/-]+$/.test(t[2]))throw new Error("Git location requires an exact commit SHA and explicit ref")}}var H=async(n,e={})=>{Ie(n);let t={...process.env,...e.env};for(let h of["GIT_DIR","GIT_WORK_TREE","GIT_INDEX_FILE","GIT_OBJECT_DIRECTORY","GIT_ALTERNATE_OBJECT_DIRECTORIES","GIT_CONFIG_PARAMETERS"])delete t[h];e.env?.GIT_INDEX_FILE&&(t.GIT_INDEX_FILE=e.env.GIT_INDEX_FILE);let r=[["core.autocrlf","false"],["core.eol","lf"],["core.symlinks","false"],["core.hooksPath","/dev/null"],["gc.autoDetach","false"],["gc.pruneExpire","3.days.ago"],["maintenance.auto","false"],["push.followTags","false"],["push.gpgSign","false"],["commit.gpgSign","false"]],i=t.KANE_SYNC_GIT_HTTP_POST_BUFFER;if(i!==void 0){if(!/^\d+$/.test(i)||Number(i)<1048576||Number(i)>536870912)throw new Error("KANE_SYNC_GIT_HTTP_POST_BUFFER must be 1048576 to 536870912 bytes; use it only for a proxy that rejects chunked uploads");r.push(["http.postBuffer",i])}for(let h of Object.keys(t))h.startsWith("GIT_TRACE")&&delete t[h];let s=n.find(h=>h.startsWith("https://"));if(t.KANE_SYNC_GIT_TOKEN&&s){let h=new URL(s);r.push([`http.${h.origin}${h.pathname}.extraheader`,""],[`http.${h.origin}${h.pathname}.extraheader`,`AUTHORIZATION: basic ${Buffer.from(`x-access-token:${t.KANE_SYNC_GIT_TOKEN}`).toString("base64")}`],["credential.helper",""])}for(let h of Object.keys(t))/^GIT_CONFIG_(COUNT|KEY_\d+|VALUE_\d+)$/.test(h)&&delete t[h];let a=!t.GIT_SSH_COMMAND&&!t.GIT_SSH&&n.some(h=>oe.has(h))&&n.some(h=>Ce.test(h))?await Ne({...t},e.cwd):void 0;r.forEach(([h,u],g)=>{t[`GIT_CONFIG_KEY_${g}`]=h,t[`GIT_CONFIG_VALUE_${g}`]=u}),t.GIT_CONFIG_COUNT=String(r.length),t.GIT_TERMINAL_PROMPT="0",t.GCM_INTERACTIVE="never",t.GIT_ASKPASS="",t.SSH_ASKPASS="";let c=Ae(t,a);return c!==void 0&&(t.GIT_SSH_COMMAND=c),t.GIT_NO_REPLACE_OBJECTS="1",ae(n,t,e.cwd,xe(n,t,e.timeout),e.input)};function ae(n,e,t,r,i){return new Promise((s,o)=>{let a=ie("git",n,{cwd:t,env:e,windowsHide:!0,detached:process.platform!=="win32",stdio:["pipe","pipe","pipe"]}),c=[],h=0,u="",g=!1,w=()=>{if(process.platform==="win32"&&a.pid)ie("taskkill",["/pid",String(a.pid),"/t","/f"],{windowsHide:!0,stdio:"ignore"}).on("error",()=>a.kill("SIGKILL"));else try{a.pid&&process.kill(-a.pid,"SIGKILL")}catch{a.kill("SIGKILL")}},S=setTimeout(()=>{g=!0,w()},r);a.stdout.on("data",l=>{h+=l.length,h>128*1024*1024?w():c.push(l)}),a.stderr.on("data",l=>{u.length<64e3&&(u+=l.toString())}),a.stdin.on("error",()=>{}),a.on("error",l=>{clearTimeout(S),o(new d("SYNC_GIT_REQUIRED",`Git could not start: ${N(l.message,e)}`,"Install Git 2.31 or newer, then run the command again: https://git-scm.com/downloads"))}),a.on("close",l=>{clearTimeout(S),s({code:g||h>128*1024*1024?124:l??1,stdout:Buffer.concat(c),stderr:N(g?"Git operation timed out":u,e)})}),a.stdin.end(i)})}async function ce(n=H){let e=await n(["--version"],{timeout:1e4}),t=/git version (\d+)\.(\d+)/.exec(e.stdout.toString());if(e.code||!t||+t[1]<2||+t[1]==2&&+t[2]<31)throw new d("SYNC_GIT_REQUIRED","This location needs Git 2.31 or newer.","Install or update Git, then run setup again: https://git-scm.com/downloads")}function he(n){let e=/^([^/@:]+)@([^/:]+):/.exec(n);if(e)return{user:e[1],host:e[2]};try{let t=new URL(n);return{host:t.hostname||"the server",user:t.username||"git",port:t.port||void 0}}catch{return{host:"the server",user:"git"}}}function yt(n){let e=/^[^/@:]+@([^/:]+):/.exec(n);if(e)return e[1].toLowerCase();try{return new URL(n).hostname.toLowerCase()}catch{return""}}function Y(n,e){let{host:t,user:r,port:i}=he(e),s=N(n).trim().split(`
|
|
3
|
+
`).slice(-2).join(" ").trim();return/Host key verification failed|REMOTE HOST IDENTIFICATION HAS CHANGED/i.test(n)?{code:"SYNC_LOCATION_DENIED",message:`this computer has not accepted ${t}'s SSH host key yet`,remedy:`in a terminal run: ssh -T ${i?`-p ${i} `:""}${r}@${t} and answer yes, then run the command again`,diagnostic:s}:/Permission denied \(publickey/i.test(n)?{code:"SYNC_LOCATION_DENIED",message:`${t} did not accept your SSH key`,remedy:"load it with ssh-add, or ask the repository owner to grant your account access",diagnostic:s}:/could not read Username|Authentication failed|Access denied|Invalid username or (password|token)|returned error: 401|returned error: 403/i.test(n)?{code:"SYNC_LOCATION_DENIED",message:`sign in is needed, or your account has no access to this repository on ${t}`,remedy:"sign in through Git, or ask the owner to grant your account access",diagnostic:s}:/Could not resolve host|Connection refused|Connection timed out|timed out|Network is unreachable|Failed to connect/i.test(n)?{code:"SYNC_LOCATION_UNREACHABLE",message:`${t} could not be reached`,remedy:"check the address and your network, then run the command again",diagnostic:s}:/not found|does not appear to be a git repository|Repository not found/i.test(n)?{code:"SYNC_LOCATION_UNREACHABLE",message:"no repository answered at that address, or your account cannot see it; a private repository looks missing until access is granted",remedy:"check the address, then run the command again",diagnostic:s}:{code:"SYNC_LOCATION_UNREACHABLE",message:`git could not read the repository on ${t}`,remedy:"check the address and your access, then run the command again",...s?{diagnostic:s}:{}}}function M(n,e){return(n.startsWith(e)?n:n.charAt(0).toUpperCase()+n.slice(1))+"."}function wt(n,e){let t=Y(n,e),{host:r}=he(e),i=t.remedy.replace(/,? ?(and )?then run the command again$/,"");return i?`${M(t.message,r)} ${M(i,r)}`:M(t.message,r)}var Pe=Buffer.from(`* -text -filter -ident -working-tree-encoding
|
|
4
|
+
`),$e="refs/kane/tip",Ge=/unexpected disconnect|hung up unexpectedly|Connection reset|Connection timed out|timed out|Could not resolve host|Failed to connect|RPC failed|Broken pipe|early EOF/i,Ue={GIT_AUTHOR_NAME:"kane-cli context",GIT_AUTHOR_EMAIL:"context@kane-cli.invalid",GIT_COMMITTER_NAME:"kane-cli context",GIT_COMMITTER_EMAIL:"context@kane-cli.invalid"},G=class n{constructor(e){this.options=e;this.exec=e.exec??H,this.prefix=e.prefix?`${e.prefix}/`:"";let t=ve("sha256").update(JSON.stringify([e.url,e.branch,this.prefix])).digest("hex");if(this.repo=_(e.cacheDir??_(A().baseDir,"context-sync","mirrors"),`${t}.git`),this.ref=e.ref??`refs/heads/${e.branch}`,!/^refs\/(heads|kane\/probe)\/[A-Za-z0-9][A-Za-z0-9._/-]*$/.test(this.ref)||this.ref.includes(".."))throw new Error("Invalid Git location ref")}kind="git";contractVersion=1;ceilingTier=1;exec;repo;ref;prefix;ready;tip=null;tree=new Map;async run(e,t={}){let r=await this.exec(["--git-dir",this.repo,...e],t);if(r.code)throw new Error(`Git ${e[0]} failed: ${r.stderr||"unable to read the location"}`);return r.stdout}async transfer(e){let t=await this.exec(["--git-dir",this.repo,...e]);if(t.code){let r=Y(t.stderr||"",this.options.url);throw new d(r.code,r.message,r.remedy,r.diagnostic)}return t.stdout}get name(){return this.options.name??"<name>"}takenRemedy(e){return e===1?`${this.name} holds a different history: to work on it, clone it with kane-cli context clone <descriptor of ${this.name}> <dir>; to share this store, add an empty location`:`kane-cli context pull ${this.name} --rebase`}init(){return this.ready??=(async()=>{if(await ce(this.exec),ke(de(this.repo),{recursive:!0}),!Oe(this.repo)){let e=P(_(de(this.repo),".init-"));try{let t=await this.exec(["init","--bare",e]);if(t.code)throw new Error(`Cannot open Git cache: ${t.stderr}`);try{Re(e,this.repo)}catch(r){if(!["EEXIST","ENOTEMPTY"].includes(r.code??""))throw r}}finally{$(e,{recursive:!0,force:!0})}}if((await this.run(["rev-parse","--is-bare-repository"])).toString().trim()!=="true")throw new Error("The Git cache must be a bare repository");await this.refresh()})()}async refresh(){let t=(await this.transfer(["ls-remote",this.options.url,this.ref])).toString().trim();if(!t){this.tip=null,this.tree=new Map;return}let r=t.split(/\s+/)[0];if(!/^[0-9a-f]{40,64}$/.test(r))throw new Error("Git returned an invalid ref");if(r===this.tip)return;let i=`refs/kane/snapshots/${F(16).toString("hex")}`;await this.transfer(["fetch","--no-tags","--no-write-fetch-head",this.options.url,`${this.ref}:${i}`]);let s=(await this.run(["rev-parse",i])).toString().trim();await this.run(["update-ref",$e,s]),await this.run(["update-ref","-d",i]);let o=await this.readTree(s);this.tip=s,this.tree=o}contextKeys(e){let t=new Map;for(let[r,i]of e)r.startsWith(`${this.prefix}kane-context/`)&&t.set(r,i);return t}async readTree(e){let t=await this.run(["ls-tree","-rz","--full-tree",e]),r=new Map;for(let i of t.toString().split("\0").filter(Boolean)){let s=/^(\d+) (\w+) ([0-9a-f]+)\t([\s\S]+)$/.exec(i);if(!s)throw new Error("Git returned an invalid tree entry");if(s[4].startsWith(`${this.prefix}kane-context/`)&&(s[1]!=="100644"||s[2]!=="blob"))throw new d("SYNC_OBJECT_CORRUPT","Context storage contains a link or non-file object.","Ask the repository owner to restore the original context files.");r.set(s[4],s[3])}return r}key(e){if(!/^[a-zA-Z0-9_~./-]+$/.test(e)||e.split("/").some(t=>!t||t==="."||t===".."||t.toLowerCase()===".git"))throw new Error("Invalid context storage key");return this.prefix+e}async head(e){return await this.init(),this.tree.has(this.key(e))}async get(e){await this.init();let t=this.tree.get(this.key(e));return t?this.run(["cat-file","blob",t]):null}async list(e){return await this.init(),e&&e.replace(/\/$/,"")&&this.key(e.replace(/\/$/,"")),[...this.tree.keys()].filter(t=>t.startsWith(this.prefix+e)).map(t=>t.slice(this.prefix.length)).sort()}async beginTransaction(){await this.init();let e=new Map(this.tree),t=this.tip,r=new Map,i=!1,s=()=>{if(i)throw new Error("Git transaction is closed")},o=async a=>{s();let c=this.key(a),h=r.get(c),u=e.get(c);return h?Buffer.from(h):u?this.run(["cat-file","blob",u]):null};return{get:o,head:async a=>await o(a)!==null,stageIfAbsent:async(a,c)=>{s();let h=this.key(a);if(e.has(h)||r.has(h))return"exists";if(c.length>1e8)throw new d("SYNC_LOCATION_REFUSED_WRITE","A context object is too large for this Git location.","Use an S3 location for this context.");return r.set(h,Buffer.from(c)),"staged"},abort:async()=>{i=!0,r.clear()},commit:async()=>{s();try{if(!r.size)return{created:[]};let a=this.prefix+"kane-context/.gitattributes";e.has(a)||r.set(a,Pe);let c=new Map;for(let[l,m]of r)c.set(l,(await this.run(["hash-object","-w","--no-filters","--stdin"],{input:m})).toString().trim());let h=this.contextKeys(e),u=()=>{this.assertUnchanged(h);for(let[l,m]of this.contextKeys(this.tree))h.set(l,m)},g=!1,w="",S=0;for(let l=0;l<4;l++){u();for(let f of this.tree.keys())if(!(!f.startsWith(this.prefix)||e.has(f)||c.has(f))&&B(f.slice(this.prefix.length))!==null)throw new d("SYNC_BEHIND","the location gained records after this batch was prepared; nothing was published","run kane-cli context pull, then push again");let m=new Map;for(let[f,b]of c){let C=this.tree.get(f);if(C&&C!==b){let R=B(f.slice(this.prefix.length));throw R?new d("SYNC_POSITION_TAKEN",g?`position ${R} on ${this.name} now holds different work; an earlier publication could not be confirmed`:`position ${R} on ${this.name} was published by another writer; this batch was not published`,this.takenRemedy(R)):new d("SYNC_OBJECT_CORRUPT",`existing context object ${f} differs from the intended bytes`,"the object needs a person to look; nothing was published")}C||m.set(f,b)}if(!m.size)return await this.verifyPublication(c),{created:[]};t=this.tip;let x=await this.build(t,m);await this.checkAttributes(x,[...r.keys()]),S++;let E=await this.exec(["--git-dir",this.repo,"push","--porcelain",this.options.url,`${x}:${this.ref}`]),y=N(E.stdout.toString()+`
|
|
5
|
+
`+E.stderr);w=y.trim();let O=E.code!==0&&/\[rejected\]|\[remote rejected\]/.test(y),p=E.code!==0&&(E.code===124||Ge.test(y));g||=p;try{await this.refresh()}catch{throw new d("SYNC_PUBLICATION_UNKNOWN","we could not confirm whether your context was uploaded; your local work is safe","check the connection and retry; kane-cli compares the published data before writing again")}if(u(),[...c].every(([f,b])=>this.tree.get(f)===b)){await this.verifyPublication(c);let f=E.code===0&&!E.stdout.toString().split(`
|
|
6
|
+
`).some(b=>b.startsWith("= "));return f&&await this.maintain(),{created:f?[...m.keys()].map(b=>b.slice(this.prefix.length)):[]}}if(E.code===0)throw new d("SYNC_PUBLICATION_UNKNOWN","the server accepted publication, but a fresh read did not confirm all context objects","retry after checking the location; do not discard local context");if(this.tip===t&&!g)throw new d("SYNC_LOCATION_REFUSED_WRITE",`${this.name} refused publication`,"check repository write access and branch rules, then retry",y.trim());if(this.tip===t&&!O&&g){await new Promise(f=>setTimeout(f,200*(l+1)+Math.random()*200));continue}await new Promise(f=>setTimeout(f,50*(l+1)+Math.random()*100))}throw new d("SYNC_PUBLICATION_UNKNOWN",`publication could not be confirmed after ${S} attempts; your local work is safe`,"run kane-cli context sync status, then retry",w||void 0)}finally{i=!0,r.clear()}}}}async maintain(){try{await this.exec(["--git-dir",this.repo,"gc","--auto","--quiet"],{timeout:3e5})}catch{}}assertUnchanged(e){for(let[t,r]of e)if(t.startsWith(`${this.prefix}kane-context/`)&&this.tree.get(t)!==r)throw new d("SYNC_REMOTE_ROLLED_BACK","The location changed or removed previously observed context data.","Ask the repository owner to restore the published context; keep your local copy.")}async verifyPublication(e){try{await this.verify(e)}catch{throw new d("SYNC_PUBLICATION_UNKNOWN","Publication was observed, but its bytes could not be fully verified. Your local work is safe.","Check the connection and retry before discarding local context.")}}async verify(e){for(let[t,r]of e){if(this.tree.get(t)!==r)throw new Error("Published context verification failed");let i=await this.run(["cat-file","blob",r]);if((await this.run(["hash-object","--no-filters","--stdin"],{input:i})).toString().trim()!==r)throw new Error("Published bytes do not match their Git object")}}async checkAttributes(e,t=[]){if(!e)return;let r=P(_(j(),"kane-git-attributes-"));try{let i={GIT_INDEX_FILE:_(r,"index")};await this.run(["read-tree",e],{env:i});let s=["commits/000000/000000001.json","blobs/ab/1234","proposals/sample/1234.json"].map(u=>`${this.prefix}kane-context/v1/${u}`),o=t.filter(u=>u.startsWith(`${this.prefix}kane-context/`)&&!u.endsWith("/.gitattributes")),a=Buffer.from([...new Set([...s,...o])].join("\0")+"\0"),h=(await this.run(["check-attr","--cached","-z","--stdin","text","filter","ident","working-tree-encoding"],{env:i,input:a})).toString().split("\0");for(let u=0;u+2<h.length;u+=3)if(!["unset","unspecified"].includes(h[u+2]))throw new d("SYNC_LOCATION_REFUSED_WRITE",`Git attributes transform context bytes (${h[u+1]}).`,"Use a dedicated context repository with no text, filter, ident or encoding conversions.")}finally{$(r,{recursive:!0,force:!0})}}async build(e,t){let r=P(_(j(),"kane-git-index-"));try{let i={GIT_INDEX_FILE:_(r,"index")};await this.run(e?["read-tree",e]:["read-tree","--empty"],{env:i});let s=Buffer.from([...t].map(([l,m])=>`100644 ${m} ${l}\0`).join(""));await this.run(["update-index","-z","--index-info"],{env:i,input:s});let a=["commit-tree",(await this.run(["write-tree"],{env:i})).toString().trim(),...e?["-p",e]:[],"-m",`Append context objects
|
|
7
|
+
|
|
8
|
+
Kane-Context: v1`],c=await this.exec(["--git-dir",this.repo,...a]),h=(c.code===0?c.stdout:await this.run(a,{env:Ue})).toString().trim(),u=(await this.run(["rev-list","--parents","-n","1",h])).toString().trim().split(" ");if(u.length!==(e?2:1)||e&&u[1]!==e)throw new Error("Unsafe Git commit parent");let g=(await this.run(["diff-tree","--no-commit-id","--name-status","--no-renames","-r","-z",...e?[e,h]:["--root",h]])).toString().split("\0").filter(Boolean);if(g.length!==t.size*2||g.some((l,m)=>m%2===0?l!=="A":!t.has(l)))throw new Error("Unsafe Git commit: unexpected changed path or file mode");let w=await this.readTree(h),S=e?await this.readTree(e):new Map;if(w.size!==S.size+t.size||[...S].some(([l,m])=>w.get(l)!==m)||[...t].some(([l,m])=>S.has(l)||w.get(l)!==m))throw new Error("Unsafe Git commit: only intended new keys may be added");return h}finally{$(r,{recursive:!0,force:!0})}}async putIfAbsent(e,t){let r=await this.beginTransaction();try{if(await r.stageIfAbsent(e,t)==="exists")return"exists";try{return(await r.commit()).created.includes(e)?"created":"exists"}catch(i){if(i instanceof d&&["SYNC_POSITION_TAKEN","SYNC_OBJECT_CORRUPT"].includes(i.code)&&await this.head(e))return"exists";throw i}}finally{await r.abort()}}async probe(){await this.init();let e=re(F(16).toString("hex"));try{await this.putIfAbsent(e,Buffer.from("connection check"))}catch(c){if(c instanceof d&&c.code==="SYNC_LOCATION_REFUSED_WRITE")return await this.refresh(),{tier:3,detail:"This location can be downloaded, but publication was refused."};throw c}if(await this.putIfAbsent(e,Buffer.from("must not replace"))!=="exists")throw new d("SYNC_PROBE_INCONCLUSIVE","Exclusive create could not be verified.","Retry the connection check.");let t=P(_(j(),"kane-git-reader-"));try{let c=new n({...this.options,cacheDir:t});if(!Buffer.from(await c.get(e)??[]).equals(Buffer.from("connection check"))||!await c.head(e)||!(await c.list(e)).includes(e))throw new Error("Independent reader could not confirm published bytes")}finally{$(t,{recursive:!0,force:!0})}let r=`refs/kane/probe/${F(16).toString("hex")}`,i=Array.from({length:8},()=>new n({...this.options,ref:r}));if((await Promise.allSettled(i.map(c=>c.head(e)))).some(c=>c.status==="rejected"))throw new d("SYNC_PROBE_INCONCLUSIVE","The concurrent connection check could not initialize its independent clients.","Retry the connection check.");let o=await Promise.allSettled(i.map((c,h)=>c.putIfAbsent(e,Buffer.from(`contender ${h}`))));if(o.some(c=>c.status==="rejected"))throw new d("SYNC_PROBE_INCONCLUSIVE","The server did not complete the concurrent connection check. Its scratch-ref policy may differ from the storage branch.","Ask the repository owner to allow the connection-check ref, then retry.");if(o.filter(c=>c.status==="fulfilled"&&c.value==="created").length!==1)throw new d("SYNC_PROBE_INCONCLUSIVE","The concurrent connection check did not produce exactly one winner.","Do not publish to this location until its connection check passes.");return{tier:1,detail:"Can download and publish; independent reads and concurrent writes verified."}}};import{closeSync as De,existsSync as Le,linkSync as Ke,lstatSync as Be,mkdirSync as He,openSync as Me,readFileSync as Ye,readdirSync as Fe,realpathSync as q,rmSync as ue,statSync as z,writeFileSync as je}from"fs";import{randomBytes as ze}from"crypto";import{dirname as le,join as fe,resolve as pe,sep as U}from"path";var We=[/^Dropbox( \(.*\))?$/,/^Mobile Documents$/,/^OneDrive(-.*)?$/,/^Google ?Drive(-.*)?$/,/^My Drive$/,/^CloudStorage$/,/^iCloud Drive/],qe="a folder synced by Dropbox, OneDrive, Google Drive or iCloud cannot be a location: these keep both sides of a conflict as duplicate files instead of refusing the second write \u2014 use a directory outside the sync client, a git-tracked folder, or an s3:// bucket";function me(n){return n.split(U).some(e=>We.some(t=>t.test(e)))}function Xe(n){try{return q(n)}catch{return n}}var ge=".tmp-";function Je(n){try{return Be(n),!0}catch{return!1}}var T=n=>n.code??"",I=new Set(["ENOENT","ENOTDIR"]),W=new Set(["EACCES","EPERM"]),D=class{kind="dir";contractVersion=1;ceilingTier;root;createRoot;constructor(e,t={}){if(this.root=pe(e),me(this.root)||me(Xe(this.root)))throw new Error(qe);this.ceilingTier=1,this.createRoot=t.createRoot??!0}requireRoot(){if(!this.createRoot){try{if(z(this.root).isDirectory())return}catch(e){if(W.has(T(e)))throw this.denied();if(!I.has(T(e)))throw e}throw this.unreachable()}}unreachable(){return new d("SYNC_LOCATION_UNREACHABLE",`nothing answered at ${this.root}: that folder does not exist and cannot be created`,"check the path, then run the command again")}denied(){return new d("SYNC_LOCATION_DENIED",`${this.root} cannot be read by this account`,"ask the owner of the folder for access")}readFault(e){return W.has(T(e))?this.denied():e}writeFault(e){return I.has(T(e))||T(e)==="EROFS"?this.rootExists()?this.refusedWrite("its filesystem is read-only"):this.unreachable():W.has(T(e))?this.refusedWrite("this account has no write access"):e}refusedWrite(e){return new d("SYNC_LOCATION_REFUSED_WRITE",`${this.root} cannot be written: ${e}`,"ask the owner of the folder for write access, or pull from it without pushing")}rootExists(){try{return z(this.root).isDirectory()}catch{return!1}}path(e){let t=e.split("/"),r=e!==""&&!e.startsWith("/")&&!e.includes("\\")&&t.every(s=>s!==""&&s!=="."&&s!==".."),i=r?pe(this.root,...t):"";if(!r||!i.startsWith(this.root+U)||!this.contained(i))throw new Error(`bad key ${e}`);return i}contained(e){let t=e;for(;!Je(t);)t=le(t);if(t===this.root||!t.startsWith(this.root+U))return!0;try{let r=q(this.root),i=q(t);return i===r||i.startsWith(r+U)}catch{return!1}}async head(e){this.requireRoot();try{return z(this.path(e)).isFile()}catch(t){if(I.has(T(t)))return!1;throw this.readFault(t)}}async get(e){this.requireRoot();try{return new Uint8Array(Ye(this.path(e)))}catch(t){if(I.has(T(t)))return null;throw this.readFault(t)}}async list(e){this.requireRoot();let t=e.lastIndexOf("/"),r=t===-1?"":e.slice(0,t),i=r===""?this.root:this.path(r),s=[],o=(a,c)=>{for(let h of Fe(a,{withFileTypes:!0})){let u=c+h.name;h.isDirectory()?o(fe(a,h.name),`${u}/`):!h.name.startsWith(ge)&&u.startsWith(e)&&s.push(u)}};try{o(i,r===""?"":`${r}/`)}catch(a){if(I.has(T(a))&&!Le(i))return[];throw this.readFault(a)}return s.sort()}async putIfAbsent(e,t){this.requireRoot();let r=this.path(e),i=le(r),s=fe(i,`${ge}${process.pid}-${ze(6).toString("hex")}`),o;try{He(i,{recursive:!0}),o=Me(s,"wx")}catch(c){throw this.writeFault(c)}try{je(o,t),Z(o)}finally{De(o)}let a="created";try{Ke(s,r)}catch(c){if(c.code!=="EEXIST")throw ue(s,{force:!0}),c;a="exists"}return ue(s,{force:!0}),ee(i),a}};var J=new TextEncoder,Ve={appstream2:"appstream",cloudhsmv2:"cloudhsm",email:"ses",marketplace:"aws-marketplace",mobile:"AWSMobileHubService",pinpoint:"mobiletargeting",queue:"sqs","git-codecommit":"codecommit","mturk-requester-sandbox":"mturk-requester","personalize-runtime":"personalize"},Qe=new Set(["authorization","content-type","content-length","user-agent","presigned-expires","expect","x-amzn-trace-id","range","connection"]),L=class{constructor({accessKeyId:e,secretAccessKey:t,sessionToken:r,service:i,region:s,cache:o,retries:a,initRetryMs:c}){if(e==null)throw new TypeError("accessKeyId is a required option");if(t==null)throw new TypeError("secretAccessKey is a required option");this.accessKeyId=e,this.secretAccessKey=t,this.sessionToken=r,this.service=i,this.region=s,this.cache=o||new Map,this.retries=a??10,this.initRetryMs=c||50}async sign(e,t){if(e instanceof Request){let{method:s,url:o,headers:a,body:c}=e;t=Object.assign({method:s,url:o,headers:a},t),t.body==null&&a.has("Content-Type")&&(t.body=c!=null&&a.has("X-Amz-Content-Sha256")?c:await e.clone().arrayBuffer()),e=o}let r=new V(Object.assign({url:e.toString()},t,this,t&&t.aws)),i=Object.assign({},t,await r.sign());delete i.aws;try{return new Request(i.url.toString(),i)}catch(s){if(s instanceof TypeError)return new Request(i.url.toString(),Object.assign({duplex:"half"},i));throw s}}async fetch(e,t){for(let r=0;r<=this.retries;r++){let i=fetch(await this.sign(e,t));if(r===this.retries)return i;let s=await i;if(s.status<500&&s.status!==429)return s;await new Promise(o=>setTimeout(o,Math.random()*this.initRetryMs*Math.pow(2,r)))}throw new Error("An unknown error occurred, ensure retries is not negative")}},V=class{constructor({method:e,url:t,headers:r,body:i,accessKeyId:s,secretAccessKey:o,sessionToken:a,service:c,region:h,cache:u,datetime:g,signQuery:w,appendSessionToken:S,allHeaders:l,singleEncode:m}){if(t==null)throw new TypeError("url is a required option");if(s==null)throw new TypeError("accessKeyId is a required option");if(o==null)throw new TypeError("secretAccessKey is a required option");this.method=e||(i?"POST":"GET"),this.url=new URL(t),this.headers=new Headers(r||{}),this.body=i,this.accessKeyId=s,this.secretAccessKey=o,this.sessionToken=a;let x,E;(!c||!h)&&([x,E]=Ze(this.url,this.headers)),this.service=c||x||"",this.region=h||E||"us-east-1",this.cache=u||new Map,this.datetime=g||new Date().toISOString().replace(/[:-]|\.\d{3}/g,""),this.signQuery=w,this.appendSessionToken=S||this.service==="iotdevicegateway",this.headers.delete("Host"),this.service==="s3"&&!this.signQuery&&!this.headers.has("X-Amz-Content-Sha256")&&this.headers.set("X-Amz-Content-Sha256","UNSIGNED-PAYLOAD");let y=this.signQuery?this.url.searchParams:this.headers;if(y.set("X-Amz-Date",this.datetime),this.sessionToken&&!this.appendSessionToken&&y.set("X-Amz-Security-Token",this.sessionToken),this.signableHeaders=["host",...this.headers.keys()].filter(p=>l||!Qe.has(p)).sort(),this.signedHeaders=this.signableHeaders.join(";"),this.canonicalHeaders=this.signableHeaders.map(p=>p+":"+(p==="host"?this.url.host:(this.headers.get(p)||"").replace(/\s+/g," "))).join(`
|
|
9
|
+
`),this.credentialString=[this.datetime.slice(0,8),this.region,this.service,"aws4_request"].join("/"),this.signQuery&&(this.service==="s3"&&!y.has("X-Amz-Expires")&&y.set("X-Amz-Expires","86400"),y.set("X-Amz-Algorithm","AWS4-HMAC-SHA256"),y.set("X-Amz-Credential",this.accessKeyId+"/"+this.credentialString),y.set("X-Amz-SignedHeaders",this.signedHeaders)),this.service==="s3")try{this.encodedPath=decodeURIComponent(this.url.pathname.replace(/\+/g," "))}catch{this.encodedPath=this.url.pathname}else this.encodedPath=this.url.pathname.replace(/\/+/g,"/");m||(this.encodedPath=encodeURIComponent(this.encodedPath).replace(/%2F/g,"/")),this.encodedPath=Se(this.encodedPath);let O=new Set;this.encodedSearch=[...this.url.searchParams].filter(([p])=>{if(!p)return!1;if(this.service==="s3"){if(O.has(p))return!1;O.add(p)}return!0}).map(p=>p.map(f=>Se(encodeURIComponent(f)))).sort(([p,f],[b,C])=>p<b?-1:p>b?1:f<C?-1:f>C?1:0).map(p=>p.join("=")).join("&")}async sign(){return this.signQuery?(this.url.searchParams.set("X-Amz-Signature",await this.signature()),this.sessionToken&&this.appendSessionToken&&this.url.searchParams.set("X-Amz-Security-Token",this.sessionToken)):this.headers.set("Authorization",await this.authHeader()),{method:this.method,url:this.url,headers:this.headers,body:this.body}}async authHeader(){return["AWS4-HMAC-SHA256 Credential="+this.accessKeyId+"/"+this.credentialString,"SignedHeaders="+this.signedHeaders,"Signature="+await this.signature()].join(", ")}async signature(){let e=this.datetime.slice(0,8),t=[this.secretAccessKey,e,this.region,this.service].join(),r=this.cache.get(t);if(!r){let i=await v("AWS4"+this.secretAccessKey,e),s=await v(i,this.region),o=await v(s,this.service);r=await v(o,"aws4_request"),this.cache.set(t,r)}return X(await v(r,await this.stringToSign()))}async stringToSign(){return["AWS4-HMAC-SHA256",this.datetime,this.credentialString,X(await ye(await this.canonicalString()))].join(`
|
|
10
|
+
`)}async canonicalString(){return[this.method.toUpperCase(),this.encodedPath,this.encodedSearch,this.canonicalHeaders+`
|
|
11
|
+
`,this.signedHeaders,await this.hexBodyHash()].join(`
|
|
12
|
+
`)}async hexBodyHash(){let e=this.headers.get("X-Amz-Content-Sha256")||(this.service==="s3"&&this.signQuery?"UNSIGNED-PAYLOAD":null);if(e==null){if(this.body&&typeof this.body!="string"&&!("byteLength"in this.body))throw new Error("body must be a string, ArrayBuffer or ArrayBufferView, unless you include the X-Amz-Content-Sha256 header");e=X(await ye(this.body||""))}return e}};async function v(n,e){let t=await crypto.subtle.importKey("raw",typeof n=="string"?J.encode(n):n,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return crypto.subtle.sign("HMAC",t,J.encode(e))}async function ye(n){return crypto.subtle.digest("SHA-256",typeof n=="string"?J.encode(n):n)}var we=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function X(n){let e=new Uint8Array(n),t="";for(let r=0;r<e.length;r++){let i=e[r];t+=we[i>>>4&15],t+=we[i&15]}return t}function Se(n){return n.replace(/[!'()*]/g,e=>"%"+e.charCodeAt(0).toString(16).toUpperCase())}function Ze(n,e){let{hostname:t,pathname:r}=n;if(t.endsWith(".on.aws")){let a=t.match(/^[^.]{1,63}\.lambda-url\.([^.]{1,63})\.on\.aws$/);return a!=null?["lambda",a[1]||""]:["",""]}if(t.endsWith(".r2.cloudflarestorage.com"))return["s3","auto"];if(t.endsWith(".backblazeb2.com")){let a=t.match(/^(?:[^.]{1,63}\.)?s3\.([^.]{1,63})\.backblazeb2\.com$/);return a!=null?["s3",a[1]||""]:["",""]}let i=t.replace("dualstack.","").match(/([^.]{1,63})\.(?:([^.]{0,63})\.)?amazonaws\.com(?:\.cn)?$/),s=i&&i[1]||"",o=i&&i[2];if(o==="us-gov")o="us-gov-west-1";else if(o==="s3"||o==="s3-accelerate")o="us-east-1",s="s3";else if(s==="iot")t.startsWith("iot.")?s="execute-api":t.startsWith("data.jobs.iot.")?s="iot-jobs-data":s=r==="/mqtt"?"iotdevicegateway":"iotdata";else if(s==="autoscaling"){let a=(e.get("X-Amz-Target")||"").split(".")[0];a==="AnyScaleFrontendService"?s="application-autoscaling":a==="AnyScaleScalingPlannerFrontendService"&&(s="autoscaling-plans")}else o==null&&s.startsWith("s3-")?(o=s.slice(3).replace(/^fips-|^external-1/,""),s="s3"):s.endsWith("-fips")?s=s.slice(0,-5):o&&/-\d$/.test(s)&&!/-\d$/.test(o)&&([s,o]=[o,s]);return[Ve[s]||s,o||""]}var Q=3,et=[300,900],tt=200,rt=15e3,it=/<Key>([^<]*)<\/Key>/g,nt=/<NextContinuationToken>([^<]*)<\/NextContinuationToken>/,Ee=n=>new Promise(e=>setTimeout(e,n));function st(n){let e=n instanceof Error?n.name:"";return e==="TimeoutError"||e==="AbortError"?"timeout":"network"}async function ot(n){try{return await n.text()}catch{return""}}var K=class n{kind="s3";contractVersion=1;ceilingTier=1;client;base;prefix;pageSize;name;constructor(e){this.client=new L({accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,service:"s3",region:e.region}),this.base=e.endpoint?`${e.endpoint.replace(/\/+$/,"")}/${e.bucket}`:`https://${e.bucket}.s3.${e.region}.amazonaws.com`,this.prefix=e.prefix,this.pageSize=e.pageSize??1e3,this.name=e.name??"this location"}url(e){return`${this.base}/${this.prefix}${e}`}static line(e,t,r){return`${e} ${new URL(t).pathname} -> ${r}`}answer(e,t,r){let i=n.line(e,t,r);return r===404?new d("SYNC_LOCATION_UNREACHABLE",`nothing answered at ${this.base}: no bucket there`,"check the bucket name and the endpoint, then run the command again",i):r===401||r===403?new d("SYNC_LOCATION_DENIED",`the bucket at ${this.base} did not accept ${this.name}'s access keys, even for reading`,`ask the owner of the bucket for access, or bind it again with the right keys: kane-cli context sync add ${this.name} <descriptor> --credential-env <VAR>`,i):r>=500||r===429?this.unreachable(i):r===301||r===307||r===308?new d("SYNC_LOCATION_UNREACHABLE",`the bucket at ${this.base} answered with a redirect: it lives in another region or behind another endpoint`,`set region=<its region> (or endpoint=<its endpoint>) in the descriptor, then bind ${this.name} again`,i):new Error(i)}unreachable(e){return new d("SYNC_LOCATION_UNREACHABLE",`nothing answered at ${this.base}`,"check the endpoint and your network, then run the command again",e)}async request(e,t,r={}){let i="";for(let s=0;s<Q;s++){s>0&&await Ee(et[s-1]);let o;try{o=await fetch(await this.client.sign(t,{method:e,headers:r.headers,body:r.body&&new Uint8Array(r.body),signal:AbortSignal.timeout(rt)}))}catch(a){i=st(a);continue}if((o.status>=500||o.status===429)&&s<Q-1){i=String(o.status);continue}return o}throw this.unreachable(`${n.line(e,t,i)} after ${Q} attempts`)}async head(e){let t=await this.request("HEAD",this.url(e));if(t.status===200)return!0;if(t.status===404)return!1;throw this.answer("HEAD",this.url(e),t.status)}async bodyOf(e,t,r,i){try{return await i(e)}catch{throw this.unreachable(n.line(t,r,"body read failed"))}}async get(e){let t=await this.request("GET",this.url(e));if(t.status===200)return new Uint8Array(await this.bodyOf(t,"GET",this.url(e),r=>r.arrayBuffer()));if(t.status===404)return null;throw this.answer("GET",this.url(e),t.status)}async list(e){let t=[],r=null;do{let i=new URLSearchParams({"list-type":"2",prefix:this.prefix+e,"max-keys":String(this.pageSize)});r&&i.set("continuation-token",r);let s=`${this.base}?${i.toString()}`,o=await this.request("GET",s);if(o.status!==200)throw this.answer("GET",s,o.status);let a=await this.bodyOf(o,"GET",s,c=>c.text());for(let c of a.matchAll(it))t.push(c[1].slice(this.prefix.length));r=nt.exec(a)?.[1]??null}while(r);return t.sort()}async putIfAbsent(e,t){let r=await this.create(e,t);if(r!=="conflict")return r;if(await Ee(tt),await this.head(e))return"exists";let i=await this.create(e,t);if(i!=="conflict")return i;throw new Error(`${n.line("PUT",this.url(e),409)} twice (ConditionalRequestConflict) and the key is still absent`)}async create(e,t){let r=this.url(e),i=await this.request("PUT",r,{headers:{"If-None-Match":"*","Content-Type":"application/octet-stream"},body:t});if(i.status===200||i.status===201)return"created";if(i.status===412)return"exists";if(i.status===409&&(await ot(i)).includes("ConditionalRequestConflict"))return"conflict";throw i.status===401||i.status===403?new d("SYNC_LOCATION_REFUSED_WRITE",`${this.name}'s access keys cannot write to ${this.base}`,"ask the owner of the bucket for write access, or pull from it without pushing",n.line("PUT",r,i.status)):this.answer("PUT",r,i.status)}};import{chmodSync as at,mkdirSync as ct,readFileSync as ht,rmSync as dt,writeFileSync as ut}from"fs";import{join as be}from"path";var Te="context-sync",lt=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function k(n,e=A().baseDir){if(!lt.test(n))throw new Error(`bad location name ${JSON.stringify(n)} \u2014 letters, digits, dot, dash and underscore only`);return be(e,Te,`${n}.json`)}function _e(n,e=A().baseDir){let t=process.env.KANE_SYNC_S3_ACCESS_KEY_ID,r=process.env.KANE_SYNC_S3_SECRET_ACCESS_KEY;if(t&&r)return{accessKeyId:t,secretAccessKey:r};let i=k(n,e),s;try{s=ht(i,"utf-8")}catch{return null}let o=te(s,i);if(typeof o!="object"||o===null||!("accessKeyId"in o)||!("secretAccessKey"in o)||typeof o.accessKeyId!="string"||typeof o.secretAccessKey!="string")throw new Error(`${i} does not hold an access key and a secret \u2014 re-add the location to replace it`);return{accessKeyId:o.accessKeyId,secretAccessKey:o.secretAccessKey}}function jt(n,e,t=A().baseDir){let r=k(n,t);ct(be(t,Te),{recursive:!0,mode:448}),ut(r,JSON.stringify(e)+`
|
|
13
|
+
`,{mode:384}),at(r,384)}function zt(n,e=A().baseDir){dt(k(n,e),{force:!0})}function Qt(n,e,t,r={}){switch(n.kind){case"fake":{let i=t?.get(n.location.slice(7));if(!i)throw new Error(`${n.location} is a test-only location and no test registered it`);return i}case"git":return new G({url:n.gitUrl,branch:n.branch,prefix:n.prefix,name:e});case"dir":return new D(n.path,{createRoot:r.createRoot});case"s3":{let i=_e(e);if(!i)throw new Error(`no credentials for ${e} \u2014 re-add it with --credential-env <VAR> or --credential-file <path> (kane-cli context sync add), set KANE_SYNC_S3_ACCESS_KEY_ID and KANE_SYNC_S3_SECRET_ACCESS_KEY, or write {"accessKeyId", "secretAccessKey"} to ${k(e)} with mode 0600`);return new K({endpoint:n.endpoint,region:n.region,bucket:n.bucket,prefix:n.prefix,name:e,...i})}}}export{H as a,ce as b,yt as c,wt as d,k as e,jt as f,zt as g,Qt as h};
|
|
14
|
+
/*! Bundled license information:
|
|
15
|
+
|
|
16
|
+
aws4fetch/dist/aws4fetch.esm.js:
|
|
17
|
+
(**
|
|
18
|
+
* @license MIT <https://opensource.org/licenses/MIT>
|
|
19
|
+
* @copyright Michael Hart 2024
|
|
20
|
+
*)
|
|
21
|
+
*/
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as ue,c as fe}from"./chunk-XQMWHPZI.js";import{a as ae}from"./chunk-DDZLCAEO.js";import{k as re,l as oe}from"./chunk-HCJ2N3XB.js";import{a as C,b as k}from"./chunk-NLZZLANH.js";import{c as de,d as ce,f as le}from"./chunk-EECDDDSB.js";import{B as A,Ba as ie,Ha as f,M as K,T as H,V as x,W as q,X as O,Z as B,ba as G,fa as z,ga as J,ia as Q,ja as V,ka as X,ma as Y,na as Z,pa as P,qa as ee,ra as ne,s as W,ua as te,va as se,y as D,z as U}from"./chunk-7HMSMAUG.js";import{a as w}from"./chunk-I2MC6VVX.js";import{a as S}from"./chunk-RPRXRKKR.js";import{oa as L}from"./chunk-UEE3RZN4.js";import{a as p}from"./chunk-FOJHSG5M.js";import{y as I}from"./chunk-D36V5OX6.js";var ve={usecase:"use_case",scenario:"scenario",test:"test",ac:"acceptance_criterion",source:"source"},b={use_case:"the use case",scenario:"the scenario",test:"the test",acceptance_criterion:"the acceptance criterion",source:"the document"};async function pe(e,n,s,i=()=>{}){let r=e,t=r?.entity;if(typeof t!="string"||t==="")return null;let c=async d=>{if(typeof d!="string")return null;try{let a=await n.mainNode(s,d),o=ve[a.label];if(!o)return null;let l=o==="acceptance_criterion"?a.content.text:a.content.title;return{kind:o,id:a.name,title:typeof l=="string"&&l!==""?l:null}}catch(a){return i(`the conflict's node couldn't be read, so the save's refusal names nothing: ${k(a)}`),null}};if(r?.kind==="source")return{kind:"source",id:t,title:typeof r.fileName=="string"&&r.fileName!==""?r.fileName:null};if(r?.kind==="edge"){let[d,a]=r.ends?await Promise.all([c(r.ends.from),c(r.ends.to)]):[null,null];return d||a?{kind:"link",from:d,to:a}:null}if(r?.kind==="node"||t.startsWith("sha256:"))return c(t);try{return(await n.sources(s)).some(d=>d.sourceId===t)?{kind:"source",id:t,title:null}:null}catch(d){return i(`the project's sources couldn't be read, so the save's refusal names nothing: ${k(d)}`),null}}function $(e){if(e.kind==="source")return e.title?`${b.source} "${e.title}"`:"a document this session reads";let n=e.id?L(e.id):null;return e.kind==="acceptance_criterion"&&n?`${b[e.kind]} ${n}`:e.title?`${b[e.kind]} "${e.title}"`:n?`${b[e.kind]} ${n}`:b[e.kind]}function me(e,n,s,i=[]){return{code:"PROJECT_CHANGED",message:`not saved \u2014 another save also changed ${e.kind!=="link"?$(e):e.from&&e.to?`the link between ${$(e.from)} and ${$(e.to)}`:`a link to ${$(e.from??e.to)}`}`,detail:`this session can't be saved now, so ${Z(n)} won't reach the project`,remedy:V(s,i)}}function ke(e){let n=le(e);return n!==null?de(n,S()):ce("save",S())}async function ge(e,n){if(n.verb!=="evolve")return{notUpdated:[],stillStale:0,repins:new Map};let s=await e.sessionLog?.().catch(()=>[])??[],i=s.filter(t=>t.kind==="evolve_not_updated").at(-1)?.body,r=t=>Array.isArray(t)?t.filter(c=>typeof c=="string"):[];return{notUpdated:r(i?.use_cases),stillStale:r(i?.still_stale).length,repins:q(s)}}function _(e,n){let s=n==="agent"?" --mode agent":"";return e.verb==="evolve"?`kane-cli maintain evolve ${e.useCase??"--from-stale"}${s}`:e.verb==="design"&&e.useCase?`kane-cli design tests --use-case ${e.useCase}${s}`:`kane-cli context extract${s}`}async function Ke(e){let n={...e,trace:e.trace??ke(e.sid)},s=n.mode==="agent",i=n.print??(c=>{process.stdout.write(`${c}
|
|
3
|
+
`)}),r=(c,d)=>(n.trace.line("save_refused",{sid:n.sid,...c.code?{code:c.code}:{},exit:d}),s?n.emit({type:"error",code:c.code,message:c.message,...A(c)}):(re(c),i("")),d),t=!1;try{return await be(n,s,i,r,()=>t=!0)}catch(c){return c instanceof w&&c.retryable?r(t?f.saveUnconfirmed():f.noConnectionToSave(),2):r(f.assuranceOffOr(c,n.projectName,f.saveFailed("your work is")),1)}}async function be(e,n,s,i,r){let t;try{t=await e.person.getSession(e.sid)}catch(u){if(u instanceof w&&u.code==="NOT_FOUND")return i(f.noSuchSession(e.sid),2);throw u}if(t.ended==="failed")return i(f.sessionFailed(e.sid),2);if(t.ended!=="complete")return i(f.notFinished(e.sid,P(t.verb==="design"||t.verb==="evolve"?"design":"extract",e.sid,n)),2);if(t.scope?.state==="finalized")return T(e,t,{},n,s,i,r,!0);let c=await G(e.person,e.projectId,e.sid);if(!z(c,(t.scope?.position??t.basePosition)>t.basePosition))return await e.person.discard(e.sid,t.generation).catch(()=>{}),n?e.onProgress({kind:"save",sid:e.sid,phase:"saved",landed:0}):s(f.nothingToSave),0;let{notUpdated:d,repins:a}=await ge(e,t),o=O(x(t.verb,c),a);if(e.trace?.line("save_check",{sid:e.sid,verb:t.verb,counts:c}),n)return e.onProgress({kind:"save",sid:e.sid,phase:"check",project:e.projectName,counts:c,...d.length>0?{notUpdated:d}:{},...o.replaces?{replaces:o.replaces}:{},...o.keeps?{keeps:o.keeps}:{}}),e.yes?T(e,t,c,n,s,i,r):i(f.confirmRequired(e.sid),2);let l=(await e.person.project(e.projectId))?.mainPosition??null,g=l!==null&&l>t.basePosition;for(let u of ye(e.projectName,o,g))s(u);s("");let m=e.yes||await e.confirm("save this session? (y/N)");return e.yes||s(""),m?T(e,t,c,n,s,i,r):(s(`not saved \u2014 your work is kept in session ${e.sid}`),0)}function ye(e,n,s){return[p.bold(`save this session to "${e}"`),...J(n,s).map(([i,r])=>`${p.dim(` ${i.padEnd(10)}`)}${r}`)]}function we(e,n="",s=process.stdout.columns,i=null,r=null){let t=[];if(e.receipt!==null&&t.push(`${n}${p.green(`\u2714 ${e.receipt}`)}`),i?.line&&t.push(`${n}${p.dim(i.line)}`),i?.replacedHead&&i.replaced){t.push(`${n}${p.dim(i.replacedHead)}`);for(let d of i.replaced){if(t.push(`${n}${p.dim(` ${d.file}`)}`),d.by.length===0)continue;let a=` replaced by ${d.by.length===1?d.by[0]:`${d.by.slice(0,-1).join(", ")} and ${d.by[d.by.length-1]}`}`;!s||n.length+a.length<=s?t.push(`${n}${p.dim(a)}`):d.by.forEach((o,l)=>t.push(`${n}${p.dim(l===0?` replaced by ${o}`:` and ${o}`)}`))}}if(i?.needed){let d=[...D(i.needed,{cwd:process.cwd(),tests:i.needed.tests,indent:0,...s?{columns:s-n.length}:{}}),...U(i.needed.noStartPage,{indent:0})];for(let a of d)t.push(`${n}${p.dim(a)}`)}let c=Re(e.lines,i?.lines??[],r);if(c.length>0){t.push("");let d=a=>s&&!a.startsWith(" kane-cli ")?oe(a,s):a;for(let a of c)t.push(a.tone==="warning"?p.hex(I.amber)(d(a.text)):a.tone==="detail"?p.dim(a.command?$e(a.text,s):a.text):d(a.text));(e.support||i?.support)&&t.push(`if this keeps failing, share this id with support: ${W(e.support?"refused_TEST_MANAGER":"refused_TEST_FILES")}`)}return t}function $e(e,n){let s=e.indexOf("run: kane-cli ");if(!n||e.length<=n||s<0)return e;let i=e.match(/^ */)[0];return`${e.slice(0,s+4)}
|
|
4
|
+
${i} ${e.slice(s+5)}`}function Re(e,n,s){if(n.length===0)return e;if(e.length===0)return n;let i=c=>c.text.startsWith("next: "),r=e.findIndex(i),t=n.findIndex(i);return s!==null&&r>=0&&t>=0?[...e.slice(0,r),...n.slice(0,t),{text:s,tone:"plain"},...e.slice(r+1),...n.slice(t+2)]:[...e,{text:"",tone:"plain"},...n]}async function T(e,n,s,i,r,t,c,d=!1){e.onProgress({kind:"save",sid:e.sid,phase:"saving"}),d&&!i&&r(f.savedBefore);let a=o=>{i||r(d?`finishing test cases in Test Manager\u2026 ${o}`:`saving\u2026 ${o}`)};try{c();let o=await e.person.land(e.sid,n.generation),l=n.verb==="design"||n.verb==="reconcile"||n.verb==="evolve"?await fe({person:e.person,projectId:n.projectId,landing:o,cwd:process.cwd()}):null,g=o.testManager?.notCovered?.length?await ue({person:e.person,projectId:n.projectId,landing:o}):void 0;e.trace?.line("save_landed",Ne(e.sid,o,l));let m=B(s),{stillStale:u,repins:R}=await ge(e,n),{changes:M,approves:j,archives:E,removes:F}=s,v=O(x(n.verb,s),R);if(e.onProgress({kind:"save",sid:e.sid,phase:"saved",landed:o.landed,...m>0?{heldChanges:m}:{},...M?{changes:M}:{},...j?{approves:j}:{},...E?{archives:E}:{},...F?{removes:F}:{},...v.replaces?{replaces:v.replaces}:{},...v.keeps?{keeps:v.keeps}:{},...s.uncounted?{uncounted:s.uncounted}:{},...o.testManager!==void 0?{testManager:o.testManager}:{},...g?{sessionUseCases:[...g]}:{},...l!==null?{testFiles:l}:{},...u>0?{stillStale:u}:{}}),!i){let y=ne(o.testManager,e.sid,e.projectName,g,ee(l)),N=l===null?null:te(l,e.sid,d,{testManager:o.testManager});if(d){let h=y.receipt===null&&y.lines.length===0;a(o.testManager?.error?"stopped":h?"nothing left to do":"done"),(y.receipt!==null||N?.line)&&r("")}else{a("saved"),r("");let h=H(v);r(p.green(`\u2714 saved to "${e.projectName}"${h?` \u2014 ${h}`:""}`));for(let he of K(v))r(p.dim(` ${he}`))}for(let h of we(y,"",void 0,N,se(o.testManager,N,e.projectName)))r(h);if(u>0)for(let h of ie.stillOutOfDate(u))r(h);r("")}return 0}catch(o){if(!(o instanceof w))throw o;if(o.retryable)return a("failed"),i||r(""),t(f.saveUnconfirmed(),2);if(o.code==="SESSION_NOT_FINISHED")return a("failed"),i||r(""),t(f.notFinished(e.sid,P(n.verb==="design"||n.verb==="evolve"?"design":"extract",e.sid,i)),2);if(o.code==="SCOPE_BEHIND_HEAD"){let g={kind:"save",sid:e.sid,phase:"behind"},m=await pe(o.extra.conflict,e.person,e.projectId,C("remote-save")),u=Y(n);if(i){let R=u.length>0?{cmd:`${X(u)} --mode agent`,why:"start again from the latest, adding this session's documents again"}:{cmd:_(n,e.mode),why:"start again from the latest"};return e.emit({...ae(g),...m?{conflict:m}:{},next:[R]}),2}return e.onProgress(g),a("failed"),r(""),t(m?me(m,s,_(n,e.mode),u):f.projectChanged(e.projectName,s,_(n,e.mode),u),2)}let l=o.code==="SCOPE_RECORD_REFUSED";return l&&C("remote-save")(`session ${e.sid}: the save was refused: ${k(o)}`),e.onProgress({kind:"save",sid:e.sid,phase:"failed",reason:"not_accepted",...l?{code:"SCOPE_RECORD_REFUSED"}:{}}),i?1:(a("failed"),r(""),t(f.saveFailed(Q(s)),1))}}function Ne(e,n,s){return{sid:e,landed:n.landed,...n.testManager!==void 0?{test_manager:n.testManager===null?null:{error:n.testManager.error??null}}:{},...s!==null?{test_files:s==="unread"?"unread":{written:s.wrote.length,refused:s.refused.length}}:{}}}export{pe as a,me as b,ke as c,Ke as d,we as e,Ne as f};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{dirname as o,basename as s,join as r}from"path";function g(t){let n=s(t);return n.endsWith("_test.md")?n.slice(0,-8):n.endsWith("_module.md")?n.slice(0,-10):n.endsWith(".md")?n.slice(0,-3):n}function e(t){return r(o(t),`output-${g(t)}`)}function m(t){return r(e(t),"Result.md")}function u(t){return r(e(t),".internal")}function d(t){return r(u(t),"meta.json")}function f(t){return r(u(t),"execution.json")}function a(t,n,i){return r(e(t),`${n}-${i}-code`)}function x(t){return r(e(t),"generated-code")}function l(t){return e(t)+".staging"}function p(t){return r(u(t),"steps")}function D(t,n,i){return r(p(t),`${n}-${i}`)}export{g as a,e as b,m as c,u as d,d as e,f,a as g,x as h,l as i,p as j,D as k};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as l}from"./chunk-RZ4F3BHX.js";import{a as s,b as o,e as c}from"./chunk-D36V5OX6.js";import{readFileSync as f,writeFileSync as d,mkdirSync as g,realpathSync as h}from"fs";import{join as y}from"path";var C="npm install -g @testmuai/kane-cli@latest",b="brew upgrade lambdatest/kane/kane-cli";function N(){try{let t=process.argv[1];if(t&&h(t).includes("/Cellar/"))return b}catch{}return C}var m=y(o,"version-check.json"),w=1440*60*1e3;function A(){try{let t=JSON.parse(f(m,"utf-8"));if(Date.now()-t.checkedAt<w)return t}catch{}return null}function k(t){try{g(o,{recursive:!0}),d(m,JSON.stringify({latest:t,checkedAt:Date.now()}))}catch{}}function u(t,e){let n=t.split(".").map(Number),r=e.split(".").map(Number);for(let i=0;i<3;i++){let a=(r[i]??0)-(n[i]??0);if(a!==0)return a}return 0}function p(t,e){let n=t.split(".").map(Number),r=e.split(".").map(Number);return(r[0]??0)!==(n[0]??0)?"major":(r[1]??0)!==(n[1]??0)?"minor":"patch"}async function T(){try{let t=A();if(t)return u(s,t.latest)>0?{current:s,latest:t.latest,severity:p(s,t.latest)}:null;let e=new AbortController,n=setTimeout(()=>e.abort(),5e3),r=await l(c,{headers:{Accept:"application/json"},signal:e.signal});if(clearTimeout(n),!r.ok)return null;let a=(await r.json())["dist-tags"]?.latest;return a?(k(a),u(s,a)>0?{current:s,latest:a,severity:p(s,a)}:null):null}catch{return null}}async function v(t=5e3){let e=new AbortController,n=setTimeout(()=>e.abort(),t);try{let r=await l(c,{headers:{Accept:"application/json"},signal:e.signal});return r.ok?(await r.json())["dist-tags"]?.latest??null:null}catch{return null}finally{clearTimeout(n)}}export{N as a,u as b,p as c,T as d,v as e};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as Ee,b as te}from"./chunk-GFLB2SHW.js";import{a as ee}from"./chunk-2TVPA3LL.js";import{c as G}from"./chunk-22PIMG52.js";import{a as v,b as be,d as B,e as Te}from"./chunk-I2MC6VVX.js";import{a as z}from"./chunk-RPRXRKKR.js";import{a as M}from"./chunk-QXQ7KVEN.js";import{a as Se}from"./chunk-7AET4JKQ.js";import{b as we,c as ye,d as Re,e as Z,f as $e}from"./chunk-DJC7NTLA.js";import{na as ve,oa as P}from"./chunk-UEE3RZN4.js";import{g as fe}from"./chunk-NC7D7GOM.js";import{basename as wt,relative as ce}from"path";function Vt(e){return e.scope?.state==="finalized"?"saved":e.scope?.state==="discarded"?"discarded":e.ended==="complete"?"ready_to_save":e.ended==="failed"||e.status==="failed"?"failed":e.status==="paused"||e.status==="needs_attention"?"paused":"running"}var ne=["useCases","criteria","scenarios","tests","openQuestions","sources","styleNotes"],H=new Set(["sources","styleNotes"]);function xe(e){return ne.reduce((t,n)=>t+(H.has(n)?0:e[n]??0),0)}var nt=new Set(["NO_CASE","CASE_BROKEN","TEST_FILE_STALE","CASE_ARCHIVED"]),D=e=>typeof e=="string"?e:null;function st(e){let t=e.extra;switch(e.code){case"CASE_BROKEN":return{code:"CASE_BROKEN",session:D(t.session),caseId:D(t.caseId)??"",reason:t.reason==="moved"?"moved":"deleted"};case"CASE_ARCHIVED":return{code:"CASE_ARCHIVED",caseId:D(t.caseId)??"",internalId:D(t.internalId)??""};default:return{code:e.code,session:D(t.session),useCase:D(t.useCase)}}}function Jt(e){return(Array.isArray(e.nodes)?e.nodes:[]).filter(n=>typeof n.cid=="string"&&typeof n.label=="string").map(n=>({cid:n.cid,label:n.label,content:typeof n.content=="object"&&n.content!==null?n.content:{}}))}function qt(e){return(Array.isArray(e.names)?e.names:[]).filter(n=>typeof n.cid=="string"&&typeof n.slug=="string").map(n=>({cid:n.cid,slug:n.slug}))}function Kt(e){return(Array.isArray(e.supersessions)?e.supersessions:[]).filter(n=>n.kind==="node"&&typeof n.old=="string").map(n=>({old:n.old,new:typeof n.new=="string"?n.new:null}))}function Yt(e){let{request:t,exchange:n}=B(e),o=(s,r)=>`/v1/projects/${encodeURIComponent(s)}/uploads/${r}`,d=s=>`/v1/sessions/${encodeURIComponent(s)}`,a=async(s,r=null)=>{let l=[],m=r;do{let c=await t("GET",`${s}${m===null?"":`&after=${encodeURIComponent(m)}`}`);l.push(...c.items),m=c.next}while(m!==null);return l},i=async(s,r)=>{let l=await t("GET",`/v1/projects/${encodeURIComponent(s)}/sessions/${encodeURIComponent(r)}`),{proposes:m,heldChanges:c,changes:p,approves:u,archives:g,removes:w,chatTurns:h,uncounted:f}=l.drafts;return{proposes:m,heldChanges:c??0,changes:p??{},approves:u??{},archives:g??{},removes:w??{},chatTurns:h??0,uncounted:typeof f=="number"?f:null}};return{async*projects(){for(let s=1;s!==null;){let r=await t("GET",`/v1/projects?page=${s}`);r.items.length>0&&(yield r.items.map(({projectId:l,name:m,marked:c})=>({projectId:l,name:m,marked:c}))),s=r.next}},async project(s){let l=(await t("GET",`/v1/projects?projectId=${encodeURIComponent(s)}`)).items.find(m=>m.projectId===s);return l===void 0?null:{projectId:s,marked:l.marked===!0,mainPosition:l.context?.mainPosition??null}},async testCase(s,r,l){try{let m=await t("GET",`/v1/projects/${encodeURIComponent(s)}/tests/${encodeURIComponent(r)}/case?base=${encodeURIComponent(l)}`),{test:c,scenario:p,useCase:u,caseId:g,internalId:w,title:h,current:f,counts:$,canAttach:S}=m;return{linked:{test:c,scenario:p,useCase:u,caseId:g,internalId:w,title:h,current:f,counts:$,canAttach:S}}}catch(m){if(m instanceof v&&m.status===409&&nt.has(m.code))return{refused:st(m)};throw m}},async createSession(s){return(await t("POST","/v1/sessions",s)).session},async sources(s){let r=[],l=null;do{let m=`limit=1000${l===null?"":`&after=${encodeURIComponent(l)}`}`,c=await t("GET",`/v1/internal/projects/${encodeURIComponent(s)}/sources?${m}`);r.push(...c.items.map(({sourceId:p,head:u,completeness:g,origin:w,media:h})=>({sourceId:p,head:u,completeness:g,...w!==void 0?{origin:w}:{},...h!==void 0?{media:h}:{}}))),l=c.next}while(l!==null);return r},async mainRecord(s,r){let l=await t("GET",`/v1/internal/projects/${encodeURIComponent(s)}/positions/${r}`);return{position:l.position,record:l.record}},async mainNode(s,r){let l=await t("GET",`/v1/internal/projects/${encodeURIComponent(s)}/nodes/${encodeURIComponent(r)}`);return{cid:l.cid,name:l.name,label:l.label,content:l.content??{},supersededBy:l.supersededBy??null,edgesOut:(l.edgesOut??[]).map(({type:m,dst:c,other:p})=>({type:m,dst:c,other:p??null}))}},nodes:(s,r)=>a(`/v1/internal/projects/${encodeURIComponent(s)}/nodes?label=${encodeURIComponent(r)}&limit=1000`),async testsWithContent(s){let r=`/v1/internal/projects/${encodeURIComponent(s)}/nodes?label=test&content=1&limit=200`,l;try{l=await t("GET",r)}catch(c){if(c instanceof v&&c.status===400&&c.code==="BAD_REQUEST"&&c.message.includes('Unrecognized key: "content"'))return null;throw c}let m=l.next===null?[]:await a(r,l.next);return[...l.items,...m].map(c=>({...c,content:c.content??{}}))},edges:(s,r)=>a(`/v1/internal/projects/${encodeURIComponent(s)}/edges?type=${encodeURIComponent(r)}&limit=1000`),stale:s=>a(`/v1/internal/projects/${encodeURIComponent(s)}/stale?limit=1000`),async listSessions(s,r={}){let l=[],m=null,c=`${r.sourceId?`&sourceId=${encodeURIComponent(r.sourceId)}`:""}${r.useCase?`&useCase=${encodeURIComponent(r.useCase)}`:""}`;do{let p=`projectId=${encodeURIComponent(s)}${c}${m===null?"":`&after=${encodeURIComponent(m)}`}`,u=await t("GET",`/v1/sessions?${p}`);l.push(...u.items),m=u.next}while(m!==null);return l},getSession:s=>t("GET",d(s)),setStatus:(s,r)=>t("PATCH",d(s),{status:r}),land:(s,r)=>t("POST",`${d(s)}/land`,{generation:r}),discard:(s,r)=>t("POST",`${d(s)}/discard`,r===void 0?{}:{generation:r}),proposes:async(s,r)=>(await i(s,r)).proposes,counts:i,openUpload:(s,r)=>t("POST",`/v1/projects/${encodeURIComponent(s)}/uploads`,r),putUpload:async(s,r,l,m)=>{let{response:c,bytes:p}=await n("PUT",s,l,{headers:r,route:"PUT upload",...m?{onSend:m}:{}}),u=c.headers.get("etag");if(p.length>0)try{let g=JSON.parse(p.toString("utf8"));typeof g.etag=="string"&&(u=g.etag)}catch{}if(!u)throw new v(c.status,"BAD_RESPONSE","the upload's store answered no etag");return{etag:u}},completeUpload:(s,r,l)=>t("POST",`${o(s,r)}/complete`,{etag:l}),getUpload:(s,r)=>t("GET",o(s,r)),uploadResult:(s,r,l)=>t("POST",`${o(s,r)}/result`,l),async projectCoverage(s){let{state:r,doc:l}=await t("GET",`/v1/projects/${encodeURIComponent(s)}/coverage`);return{state:r,doc:l}},async coverageRun(s,r){return{pack:(await t("POST",`/v1/projects/${encodeURIComponent(s)}/coverage/run`,r)).pack}}}}import{isMainThread as lt}from"worker_threads";import{createHash as dt}from"crypto";function se(e){return e instanceof Error?e.message:String(e)}var ke="SUPERSEDED_WRITER",en="LEASE_LAPSED";function tn(e){let t=`/v1/sessions/${encodeURIComponent(e.sessionId)}/host`,{exchange:n,request:o}=B(e),d=i=>i===null?"limit=1000":`after=${encodeURIComponent(i)}&limit=1000`,a=i=>i===void 0?t:`${t}/children/${encodeURIComponent(i)}`;return{claim:()=>o("POST",`${t}/claim`,{forms:1}),session:()=>o("GET",t),renewLease:i=>o("POST",`${t}/lease`,{generation:i}),save:i=>o("PATCH",t,i),checkpointRows:i=>o("GET",`${a(i)}/checkpoints`,void 0,!0),async readCheckpointRow(i,s){return(await o("GET",`${a(s)}/checkpoints/${i}`,void 0,!0)).text},async writeCheckpointRow(i,s,r,{ifAbsent:l=!1,childId:m}={}){let c=`${a(m)}/checkpoints/${s}${l?"?ifAbsent=true":""}`;return(await o("PUT",c,{generation:i,text:r})).stored},async removeCheckpointRow(i,s,r){await o("DELETE",`${a(r)}/checkpoints/${s}?generation=${i}`)},registerChild:(i,s,r)=>o("POST",`${t}/children`,{generation:i,childId:s,...r?{useCase:r}:{}}),async sessionSide(){return(await o("GET",`${t}/side`)).text},async putSessionSide(i,s){await o("PUT",`${t}/side`,{generation:i,text:s})},saveChildPointer:(i,s,r,l)=>o("PATCH",a(s),{generation:i,checkpoint:r,state:l}),async sessionState(i){let{text:s}=await o("GET",`${a(i)}/state`);return s===null?null:JSON.parse(s)},async putSessionState(i,s,r){await o("PUT",`${a(r)}/state`,{generation:i,text:JSON.stringify(s)})},scope:()=>o("GET",`${t}/scope`),draftsPage:i=>o("GET",`${t}/scope/drafts?${d(i)}`,void 0,!0),appendDraft:(i,s)=>o("POST",`${t}/scope/drafts`,{generation:i,...s}),mainNodes:(i,s)=>o("POST",`${t}/main/nodes`,{position:i,cids:s}),async mainHistory(){let{response:i,bytes:s}=await n("GET",`${t}/main/history`,void 0,{headers:{"accept-encoding":"gzip"},bulk:!0}),r=Number(i.headers.get("lattice-history-position")),l=i.headers.get("lattice-history-hash");if(!Number.isInteger(r)||r<0||!l)throw new v(i.status,"UNEXPECTED_ANSWER",`GET ${t}/main/history answered without its Lattice-History-Position and Lattice-History-Hash headers`);return{position:r,hash:l,forms:be(i,"lattice-history-forms"),json:s}},async getBlob(i){try{return(await n("GET",`${t}/blobs/${encodeURIComponent(i)}`,void 0,{bulk:!0})).bytes}catch(s){if(s instanceof v&&s.code==="NOT_FOUND")return null;throw s}},putBlob:(i,s)=>o("PUT",`${t}/blobs?generation=${i}`,s),async files(i){return(await o("GET",`${t}/files?prefix=${encodeURIComponent(i)}`)).items},async readFile(i){try{let{response:s,bytes:r}=await n("GET",`${t}/file?name=${encodeURIComponent(i)}`,void 0,{bulk:!0}),l=Number(s.headers.get("lattice-file-version"));if(!Number.isInteger(l)||l<1)throw new v(s.status,"UNEXPECTED_ANSWER",`GET ${t}/file answered ${i} without a Lattice-File-Version header`);return{text:r.toString("utf8"),version:l}}catch(s){if(s instanceof v&&s.code==="NOT_FOUND")return null;throw s}},async embeddings(i,s){let r=`alias=${encodeURIComponent(i)}&purpose=${encodeURIComponent(s)}`,{bytes:l}=await n("GET",`${t}/embeddings?${r}`,void 0,{headers:{"accept-encoding":"gzip"},bulk:!0});return JSON.parse(l.toString("utf8"))},putEmbeddings:(i,s)=>o("POST",`${t}/embeddings`,{generation:i,...s}),putFile:(i,s,r,l)=>o("PUT",`${t}/file?name=${encodeURIComponent(s)}&generation=${i}&version=${r}`,l),appendEvents:(i,s)=>o("POST",`${t}/events`,{generation:i,events:s}),async eventsAfter(i){let s=[],r=null;do{let l=r===null?`after=${i}&limit=1000`:`after=${encodeURIComponent(r)}&limit=1000`,m=await o("GET",`${t}/events?${l}`);s.push(...m.items),r=m.next}while(r!==null);return s}}}var re="the session cannot go on: the project's context is being imported; it is served once an import of it completes",ot=5*6e4,Ce=2e3,it=15e3;function _e(e){return e instanceof v&&e.code==="CONTEXT_IMPORTING"}function Ie(){return new v(409,"CONTEXT_IMPORTING",re)}function on(e={}){let t=e.sleep??(a=>new Promise(i=>setTimeout(i,a))),n=e.budgetMs??ot,o=0,d=Ce;return{async wait(){let a=n-o;if(a<=0)return!1;let i=Math.min(d,a);return await t(i),o+=i,d=Math.min(d*2,it),!0},answered(){o=0,d=Ce}}}var R={scope:"store.scope",mainNodes:"store.mainNodes",mainNodesAhead:"store.mainNodesAhead",mainHistory:"store.mainHistory",drafts:"store.drafts",appendDraft:"store.appendDraft",vectorsRead:"store.vectorsRead",vectorsWrite:"store.vectorsWrite",getBlob:"store.getBlob",putBlob:"store.putBlob",chainRead:"chain.read",chainList:"chain.list",chainWrite:"chain.write",chainWriteIfAbsent:"chain.writeIfAbsent",chainRemove:"chain.remove",filesRead:"files.read",filesList:"files.list",filesWrite:"files.write",pointer:"session.pointer",stateGet:"session.stateGet",statePut:"session.statePut",acknowledge:"session.acknowledge",registerChild:"session.registerChild",children:"session.children",sideGet:"session.sideGet",sideSave:"session.sideSave"};var Pe=3e4,L=class extends Error{constructor(n,o,d,a=null){super(`Lattice refused ${n} (${o}): ${d}`);this.op=n;this.code=o;this.requestId=a;this.name="StepRefusedError"}};function ct(e){return e.status!==0?"not_ready":/no answer within/.test(e.message)?"timeout":"unreachable"}var Oe=new Set([ke,"SESSION_ENDED","PROJECT_NOT_MARKED"]);function fn(e,t){let n=t.sleep??(c=>new Promise(p=>setTimeout(p,c))),o=t.retryDeadlineMs??12e4,d=new Map((t.children??[]).map(c=>[c.childId,c.checkpoint?.pointer??null]));async function a(c,p){let u=Te(o,n,t.now);for(;;)try{let g=await p();return t.imports?.answered(),g}catch(g){if(!(g instanceof v))throw g;if(_e(g)&&t.imports){if(await t.imports.wait())continue;throw t.onStopped?.(Ie()),te(new Error(`Lattice refused ${c}: ${re}`),g)}if(Oe.has(g.code)&&t.onStopped?.(g),!g.retryable)throw new L(c,g.code,g.message,g.requestId);let w=h=>t.onRetry?.({op:c,attempt:u.attempt,nextInMs:h,giveUpAt:u.endsAt()??0,cause:ct(g)});if(!await u.again(w))throw t.onStopped?.(new v(g.status,g.code,`Lattice did not take ${c} within ${o/1e3} s: ${g.message}`,null,null,{},g.requestId)),te(new Error(`Lattice refused ${c} (${g.code}, still after ${o/1e3} s): ${g.message}`),g)}}async function i(c,p){try{return await p()}catch(u){throw u instanceof v?(Oe.has(u.code)&&t.onStopped?.(u),new L(c,u.code,u.message,u.requestId)):u}}async function s(c,p){let u=R.acknowledge,g=t.log;if(!g)throw new Error("the checkpoint barrier needs the session log, and this host gave it none");let w=Date.now()+Pe;for(;g.lastSeq()<c.eventSeq;){if(Date.now()>w)throw new Error(`the session log reached event ${g.lastSeq()}, not ${c.eventSeq}, within ${Pe/1e3} s; the checkpoint is not acknowledged`);await n(5)}await ut(g.flush(),o),await a(u,()=>e.writeCheckpointRow(t.generation,`side-${c.pointer.seq}.json`,JSON.stringify(c.side),{childId:p}));let h={pointer:c.pointer,covers:{eventSeq:c.eventSeq,scope:c.scope}},f=JSON.stringify(c.state);p===void 0?await a(u,()=>e.save({generation:t.generation,checkpoint:h,state:f})):d.set(p,(await a(u,()=>e.saveChildPointer(t.generation,p,h,f))).checkpoint.pointer)}async function r(){let c=await a(R.mainHistory,()=>e.mainHistory()),p=dt("sha256").update(c.json).digest("hex");if(p!==c.hash)throw new Error(`main's history from Lattice hashes to ${p}, not to ${c.hash}, the hash Lattice gave for it`);if(t.historyForms!==void 0&&c.forms!==t.historyForms){let u=`main's history pack was built at engine forms ${c.forms??"none named"}, not at ${t.historyForms}, the forms of the Lattice that took this host's claim: another Lattice served it`;throw t.onStopped?.(new v(409,"HISTORY_FORMS_MISMATCH",u)),new Error(u)}return c.json.toString("utf8")}let l=new Map,m=c=>`${Number(c.position)}:${c.cids.join(",")}`;return async(c,p)=>{let u=p??{},g=u.after??null,w=typeof u.childId=="string"?u.childId:void 0;switch(c){case R.scope:return await a(c,()=>e.scope());case R.mainHistory:return{json:await r()};case R.mainNodesAhead:{let h=e.mainNodes(Number(u.position),u.cids);return h.catch(()=>{}),l.set(m(u),h),null}case R.mainNodes:{let h=l.get(m(u));if(l.delete(m(u)),h)try{return await h}catch{}return await a(c,()=>e.mainNodes(Number(u.position),u.cids))}case R.drafts:return await a(c,()=>e.draftsPage(g));case R.appendDraft:{let h={eventId:u.eventId??null,record:u.record??null,envelope:u.envelope??null};return await a(c,()=>e.appendDraft(t.generation,h))}case R.filesRead:return(await a(c,()=>e.readFile(W(u.name))))?.text??null;case R.filesList:{let h=`${W(u.folder)}/`;return(await a(c,()=>e.files(h))).map($=>$.name.slice(h.length)).filter($=>!$.includes("/"))}case R.filesWrite:{if(!String(u.name).startsWith("rationale/"))throw new Error(`the host writes only test rationales; ${W(u.name)} is a configuration file, written by an operator`);try{return await a(c,()=>e.putFile(t.generation,W(u.name),0,Buffer.from(String(u.text),"utf8"))),{written:!0}}catch(h){if(/\(FILE_CHANGED\)/.test(se(h)))return{written:!1,message:se(h)};throw h}}case R.vectorsRead:return await i(c,()=>e.embeddings(String(u.alias),String(u.purpose)));case R.vectorsWrite:{let h={alias:String(u.alias),purpose:String(u.purpose),dims:Number(u.dims),vectors:u.vectors??{}};return await i(c,()=>e.putEmbeddings(t.generation,h))}case R.getBlob:{let h=await a(c,()=>e.getBlob(String(u.fingerprint)));return{bytes:h===null?null:h.toString("base64")}}case R.putBlob:return await a(c,()=>e.putBlob(t.generation,Buffer.from(String(u.bytes),"base64")));case R.chainRead:return await a(c,()=>e.readCheckpointRow(String(u.name),w));case R.chainList:return await a(c,()=>e.checkpointRows(w));case R.chainWrite:return await a(c,()=>e.writeCheckpointRow(t.generation,String(u.name),String(u.text),{childId:w})),null;case R.chainWriteIfAbsent:return await a(c,()=>e.writeCheckpointRow(t.generation,String(u.name),String(u.text),{ifAbsent:!0,childId:w}));case R.chainRemove:return await a(c,()=>e.removeCheckpointRow(t.generation,String(u.name),w)),null;case R.pointer:return w!==void 0?d.get(w)??null:(await a(c,()=>e.session())).checkpoint?.pointer??null;case R.stateGet:return await a(c,()=>e.sessionState(w));case R.statePut:return await a(c,()=>e.putSessionState(t.generation,u.state??null,w)),null;case R.acknowledge:return await s(u,w),null;case R.children:return[...(t.children??[]).map(h=>h.childId)];case R.sideGet:return await a(c,()=>e.sessionSide());case R.sideSave:return await a(c,()=>e.putSessionSide(t.generation,String(u.text))),{saved:!0};case R.registerChild:{let h=typeof u.useCase=="string"?u.useCase:void 0,f=await a(c,async()=>{try{return await e.registerChild(t.generation,String(u.childId),h)}catch($){throw $ instanceof v&&$.code==="SESSION_CLASH"?new Ee($.message,$.code,{heldBy:$.extra.heldBy??null},$.requestId):$}});return d.set(f.childId,f.checkpoint?.pointer??null),null}default:throw new Error(`the session thread asked for ${c}, which the main thread does not answer`)}}}function W(e){return`design/${String(e)}`}async function ut(e,t){let n,o=new Promise((d,a)=>{n=setTimeout(()=>a(new Error(`the session's events were not stored within ${t/1e3} s; the checkpoint is not acknowledged`)),t)});try{await Promise.race([e,o])}finally{clearTimeout(n)}}var x={verb:"remote",mode:"interactive"},oe=null,Ne=new Set;function Tn(e){x={...x,...e}}function V(e,t){return Ae(e,t),z()}function Ae(e,t){if(!(!Z()||Ne.has(e))){Ne.add(e);try{oe??=$e({verb:x.verb,mode:x.mode,contextRoot:null,env:Re(),sessionId:z(),errorsOnly:!0}),Object.assign(oe.ids,{...x.projectId?{project_id:x.projectId}:{},...x.latticeSessionId?{lattice_session_id:x.latticeSessionId}:{}}),oe.spoolError(e,t?{request_id:t}:{})}catch{}}}function gt(e){return e instanceof v||e instanceof L?`lattice_${e.code}`:"cli_crash"}function mt(e){let t=e?.requestId;return typeof t=="string"&&t?t:null}async function ht(){!Z()||!lt||await Promise.race([fe(ye()).catch(()=>{}),new Promise(e=>setTimeout(e,we).unref())])}async function xn(e,t){return e instanceof v&&Ae(gt(e),mt(e)),await ht(),t}import{isAbsolute as pt,relative as Le}from"path";var k=e=>" ".repeat(e);function ft(e){return e.length<2?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`}var J=e=>e===1?"this test runs":"these tests run";function De(e,t,n){if(n===void 0||t+e.length<=n)return[k(t)+e];let o=[],d="";for(let a of e.split(" "))d&&t+d.length+1+a.length>n?(o.push(k(t)+d),d=a):d=d?`${d} ${a}`:a;return[...o,k(t)+d]}function _n(e,t){let n=e.variables.length;if(n===0)return[];let o=n===1?`\u2692 1 variable needs a value before ${J(t.tests)}; fill it in:`:`\u2692 ${n} variables need values before ${J(t.tests)}; fill them in:`,d=[k(t.indent)+o,k(t.indent+4)+(Le(t.cwd,e.file)||e.file)],a=e.variables.filter(i=>i.start_page).map(i=>i.name);return a.length===1?d.push(...De(`${a[0]} is the page ${t.tests===1?"it starts":"they start"} on`,t.indent+4,t.columns)):a.length>1&&d.push(...De(`${ft(a)} are the pages they start on`,t.indent+4,t.columns)),d}function Ue(e,t){let n=t.cwd??process.cwd(),o=s=>pt(s)&&Le(n,s)||s,d=e.length;if(d===0)return[];let a=d===1?"\u2692 1 test has no start page yet, so it can't run as it is:":`\u2692 ${d} tests have no start page yet, so they can't run as they are:`,i=d===1?"name the page in its first step, or run it with --url <the page>":"name the page in each one's first step, or run them with --url <the page>";return[k(t.indent)+a,...e.map(s=>k(t.indent+4)+(s.file?o(s.file):`${s.test} ${s.title}`)),k(t.indent+4)+i]}function je(e,t){let n=e.variables.length,o=e.noStartPage.length;return[...n===0?[]:[n===1?`1 variable needs a value before ${J(t.tests)}`:`${n} variables need values before ${J(t.tests)}`],...o===0?[]:[o===1?"1 test has no start page yet":`${o} tests have no start page yet`]]}function Bn(e,t="--mode agent"){if(!e.next)return e.remedy?{remedy:e.remedy}:{};let n=(e.remedy??"").split(`
|
|
3
|
+
`).filter(o=>!/^\s+kane-cli /.test(o)).join(" ").replace(/(, run)?:$/,"").replace(/[,;]\s*(then\s+)?run:\s*kane-cli\b.*$/,"").trim();return{...n?{remedy:n}:{},next:e.next.map(o=>({cmd:`${o.cmd} ${t}`,why:o.why}))}}function Gn(e){let t=e;return!t||typeof t.sessionId!="string"||typeof t.verb!="string"?null:{sessionId:t.sessionId,verb:t.verb,useCase:typeof t.useCase=="string"?t.useCase:null,mine:t.mine===!0,status:typeof t.status=="string"?t.status:"running"}}var Hn=e=>({sid:e.sessionId,verb:e.verb,use_case:e.useCase,mine:e.mine,status:e.status}),yt={useCases:["use-case","use-cases"],criteria:["acceptance criterion","acceptance criteria"],scenarios:["scenario","scenarios"],tests:["test","tests"],openQuestions:["open question","open questions"],sources:["source","sources"],styleNotes:["style note","style notes"]},ue=ne.map(e=>[e,...yt[e]]),X=(e,t=H)=>{let n=ue.filter(([d])=>(e[d]??0)>0),o=n.filter(([d])=>!t.has(d));return o.length>0?o:n},Rt=new Set(["styleNotes"]),le=e=>e?ue.filter(([t])=>(e[t]??0)>0).map(([t,n,o])=>`${e[t]} ${e[t]===1?n:o}`):[];function $t(e){let t=o=>o?I(X(o).map(([d,a,i])=>`${o[d]} ${o[d]===1?a:i}`)):"",n=[[t(e),"added"],...Ve.map(({key:o,done:d})=>[t(e[o]),o==="changes"?"changed":d])].filter(([o])=>o!=="").map(([o,d])=>`${o} ${d}`);return N(e)>0&&n.push(Ke(N(e))),n.length>0?n.join(", "):null}function Wn(e){let t=$t(e.counts),n=[G(e.durS),...t?[t]:[],...e.credits!==void 0?[`${e.credits.toFixed(1)} credits`]:[]].join(" \xB7 "),o=e.title?`"${e.title}"`:P(e.id??"");return t||(e.counts.uncounted??0)>0?`\u25CF updated ${o} \u2014 ${n}`:`\u25CF nothing changed in ${o} \u2014 ${n}`}function Vn(e){let t=e.title?`"${e.title}"`:P(e.id??""),n=[G(e.durS),`${e.tests} ${e.tests===1?"test":"tests"}`,...e.credits!==void 0?[`${e.credits.toFixed(1)} credits`]:[]];return`\u25CF designed ${t} \u2014 ${n.join(" \xB7 ")}`}function Jn(e){return`\u25CF finished ${e.title?`"${e.title}"`:P(e.id??"")} \u2014 ${[G(e.durS),...e.credits!==void 0?[`${e.credits.toFixed(1)} credits`]:[]].join(" \xB7 ")}`}var I=e=>e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`,Ve=[{key:"changes",row:"updates",done:"updated",saving:"updates"},{key:"approves",row:"approves",done:"approved",saving:"approves"},{key:"archives",row:"archives",done:"archived",saving:"archives"},{key:"replaces",row:"replaces",done:"replaced",saving:"replaces"},{key:"removes",row:"removes",done:"removed",saving:"removes"}],Q=e=>Ve.filter(({key:t})=>j(e[t])),Je=e=>Q(e).length>0,ge=e=>e===1?"1 test":`${e} tests`,vt=e=>[...Q(e).map(({key:t,done:n})=>`${I(le(e[t]))} ${n}`),...e.keeps?[`${ge(e.keeps)} marked up to date`]:[]],qn=e=>[...Q(e).map(({key:t,saving:n})=>`saving it ${n} ${I(le(e[t]))}${t==="removes"?" from the project":""}`),...e.keeps?[`saving it marks ${ge(e.keeps)} up to date`]:[]],Kn=e=>[...vt(e),...N(e)>0?[Ye(N(e))]:[]],Yn=e=>ue.reduce((t,[n])=>t+(H.has(n)?0:e.changes?.[n]??0),0),Xn=e=>xe(e),bt=e=>F(e)!==""||j(e.changes)||j(e.approves)||j(e.archives),St="this session's work",Qn=e=>F(e)?"throw away what this session added":me(e)?"throw away this session's chat":"throw away this session's work",zn="already discarded \u2014 nothing was saved",Zn=e=>bt(e)?"your team can see it now":me(e)?Et:xt(e)?St:"",Et="this session's chat";function es(e,t){let n=t.removes;if(e==="extract"||!n||!((n.scenarios??0)>0||(n.tests??0)>0))return t;let o={...(n.scenarios??0)>0?{scenarios:n.scenarios}:{},...(n.tests??0)>0?{tests:n.tests}:{}},{scenarios:d,tests:a,...i}=n,{removes:s,...r}=t;return{...r,replaces:o,...j(i)?{removes:i}:{}}}function ts(e){let t=new Map;for(let n of e){if(n.kind!=="evolve_diff")continue;let o=n.payload??n.body;if(typeof o?.use_case!="string")continue;let d=o.repinned?.tests;typeof d=="number"&&d>0?t.set(o.use_case,d):t.delete(o.use_case)}return t}function ns(e,t){let n=[...t.values()].reduce((i,s)=>i+s,0);if(n===0)return e;let o=Math.max(0,(e.uncounted??0)-t.size),{uncounted:d,...a}=e;return{...a,keeps:n,...o>0?{uncounted:o}:{}}}var Tt=["changes","approves","archives","removes"],N=e=>e.heldChanges??0,j=e=>Object.values(e??{}).some(t=>(t??0)>0),qe=e=>!(e.adds??F(e))&&!Je(e)&&N(e)===0&&(e.keeps??0)===0,me=e=>qe(e)&&(e.chatTurns??0)>0&&(e.uncounted??0)===0,xt=e=>qe(e)&&!me(e);async function ss(e,t,n){let o=await e.counts(t,n),{proposes:d,heldChanges:a,chatTurns:i,uncounted:s}=o;return{...d,...a>0?{heldChanges:a}:{},...Object.fromEntries(Tt.flatMap(r=>j(o[r])?[[r,o[r]]]:[])),...i&&i>0?{chatTurns:i}:{},...typeof s=="number"?{exact:!0}:{},...typeof s=="number"&&s>0?{uncounted:s}:{}}}function Ke(e){return e===1?"1 change to an existing use-case":`${e} changes to existing use-cases`}function Ye(e){return`${Ke(e)}, saved but not applied`}var kt=e=>F(e)!==""||Je(e)||N(e)>0||(e.keeps??0)>0||(e.chatTurns??0)>0||(e.uncounted??0)>0,rs=(e,t)=>e.exact?kt(e):t;function os(e,t){let n=F(e),o=N(e),d=[];n&&d.push(["adds",n]);for(let{key:s,row:r}of Q(e))d.push([r,le(e[s]).join(", ")]);e.keeps&&d.push(["keeps",`${ge(e.keeps)}, marked up to date`]),o>0&&d.push(["held",Ye(o)]);let a=(e.chatTurns??0)>0;((e.uncounted??0)>0||!e.exact&&d.length===0&&!a)&&d.push(["other","work not counted here"]),a&&d.push(["chat","saved with the session; your team can read it"]),d.push(["project",t?"changed since this session started":"no changes since this session started"]);let i=s=>(s?.scenarios??0)+(s?.tests??0);return i(e)+i(e.changes)>0&&d.push(["then","its test cases are created or updated in Test Manager"]),d}function F(e){return X(e,Rt).map(([t,n,o])=>`${e[t]} ${e[t]===1?n:o}`).join(", ")}function is(e){let t=X(e);if(t.length!==1)return"your work is";let[n,o,d]=t[0];return e[n]===1?`your ${o} is`:`your ${e[n]} ${d} are`}function Ct(e,t=[]){return t.length>0?`start a new session from the latest project, adding this session's documents again; run:
|
|
4
|
+
${Xe(t)}`:`${e.startsWith("kane-cli design tests")?"to design it again from the latest project":"to start a new session from the latest project"}, run:
|
|
5
|
+
${e}`}var Xe=e=>`kane-cli context ingest ${e.map(Y).join(" ")}`;function as(e,t){return e.length>0?[...new Set(e)]:_t(t)}function _t(e){return[...new Set((e.uploads??[]).filter(t=>t.outcome==="created"&&t.filename).map(t=>t.filename))]}function It(e){let t=X(e);if(t.length!==1)return"its work";let[n,o,d]=t[0];return e[n]===1?`its ${o}`:`its ${e[n]} ${d}`}function ds(e){return e.replace(/\s*\([^()]*→[^()]*\)/g,"")}function cs(e,t,n){return`kane-cli ${e==="design"?"design tests":"context extract"} --resume ${t}${n?" --mode agent":""}`}var Me=e=>`updating kane-cli won't help \u2014 share this id with support: ${V(`refused_${e}`)}`,q="in a folder linked to a shared project",U="check the file, then run the command again",ie=e=>[`${e} has more inside it than kane-cli can read`,"save a smaller copy, or a PDF of it, then run the command again"],Pt={PDF_ENCRYPTED:e=>[`${e} is password-protected`,"remove the password, then run the command again"],PDF_NO_TEXT_LAYER:e=>[`${e} has no text to read; scanned PDFs aren't supported yet`,"use a PDF with text in it, then run the command again"],PDF_UNREADABLE:e=>[`${e} can't be read as a PDF`,U],DOCX_UNREADABLE:e=>[`${e} can't be read as a Word document`,U],DOCX_NOT_WORDPROCESSING:e=>[`${e} can't be read as a Word document`,U],DOCX_NO_TEXT:e=>[`${e} has no text to add`,U],DOCX_ENCRYPTED_OR_LEGACY:e=>[`${e} is password-protected or in the old Word format`,"save it as a .docx without a password, then run the command again"],DOCX_PART_TOO_LARGE:ie,DOCX_TOO_MANY_PARTS:ie,DOCX_BOMB:ie,SOURCE_ID_OWNED:e=>[`${e} can't become a version of that source: a source plugin reads it`,"add it under another id with --as <id>, then run the command again"]},Ot={changed_both_sides:"it was changed in Test Manager too; choose there which steps to keep",not_pushable:"its steps can't be changed from here; change them in Test Manager",archived:"it's archived in Test Manager; restore it there first",busy:"a test run is using it; wait until the run ends",not_accepted:"Test Manager has different steps for it; choose there which to keep"},O=e=>`${e} ${e===1?"test case":"test cases"}`,Fe={test_on_older_version:"it changed after its test was designed",test_unreadable:"its test can't be read",test_has_no_steps:"its test has no steps"},Qe=e=>ve.test(e)?e.toLowerCase():e,ze=e=>Object.hasOwn(Fe,e)?Fe[e]:void 0,Ze=e=>e.useCase&&ze(e.reason)!==void 0&&e.reason!=="test_unreadable"?Qe(e.useCase):null;function us(e){if(!e||e==="unread")return;let t=new Map([...e.wrote,...e.unchanged??[]].map(n=>[n.id.toLowerCase(),n.path]));for(let n of e.refused)n.file&&t.set(n.id.toLowerCase(),n.file);return n=>t.get(n.toLowerCase())}var de=e=>e.reason==="test_unreadable";function Nt(e,t){let n=ze(e.reason);if(n===void 0)return[{text:" it can't be sent to Test Manager yet",tone:"detail"}];if(e.reason==="test_unreadable"){let d=t?.(e.test);return[{text:` ${n}${d?`: ${pe(d)}`:""}`,tone:"detail"}]}let o=Ze(e);return o===null?[{text:` ${n}`,tone:"detail"}]:[{text:` ${n}; to design its tests again, run:`,tone:"detail"},{text:` kane-cli design tests --use-case ${o}`,tone:"detail",command:!0}]}var K=(e,t)=>t===void 0||typeof e.useCase!="string"||t.has(Qe(e.useCase));function At(e,t,n){let o=e===1,d=`to see ${o?"its use-case":"their use-cases"}, run: kane-cli context list --stale`,a=o?"1 scenario of another use-case":`${e} scenarios of other use-cases`;return n?[{text:` ${a} ${o?"isn't":"aren't"} in Test Manager either`,tone:"detail"},{text:` ${d}`,tone:"detail"}]:[{text:`${a} in ${y(t)} ${o?"isn't":"aren't"} in Test Manager`,tone:"detail"},{text:` ${d}`,tone:"detail"}]}var C="some test cases may not be there yet";function he(e,t){switch(e){case"TEST_MANAGER_TIMEOUT":return{why:`Test Manager took too long, so ${C}`,lead:`Test Manager took too long; ${C}`,next:"to finish them (nothing is saved twice), run:",remedy:!1,support:!1,agentCode:"TEST_MANAGER_TIMED_OUT"};case"FORGE_UNAVAILABLE":return{why:`Test Manager couldn't be reached, so ${C}`,lead:`Test Manager couldn't be reached; ${C}`,next:"to finish them (nothing is saved twice), run:",remedy:!1,support:!0,agentCode:"TEST_MANAGER_UNREACHABLE"};case"FORGE_REFUSED":return{why:`Test Manager refused your account, so ${C}`,lead:`Test Manager refused your account; ${C}`,next:"ask a Test Manager admin to grant your account access, then run:",remedy:!0,support:!1,agentCode:"PROJECT_NO_ACCESS"};case"PROJECT_NOT_MARKED":return{why:`assurance is now off for "${t}", so ${C}`,lead:`assurance is now off for "${t}"; ${C}`,next:"to try them again later (nothing is saved twice), run:",remedy:!0,support:!1,agentCode:"ASSURANCE_OFF"};default:return{why:"some test cases couldn't be created or updated in Test Manager",lead:"some test cases couldn't be created or updated in Test Manager",next:"to try them again (nothing is saved twice), run:",remedy:!1,support:!0,agentCode:"TEST_MANAGER_FAILED"}}}function ls(e,t,n,o,d){let a={receipt:null,summary:null,lines:[],support:!1};if(!e)return a;let{made:i,updated:s,waiting:r,error:l}=e,m=e.nextRun??[],c=e.notCovered??[],p=c.filter(b=>K(b,o)),u=c.length-p.length;if(i===0&&s===0&&r===0&&l===null&&m.length===0&&c.length===0)return a;let g=i>0&&s>0?`${O(i)} created and ${s} updated in Test Manager`:i>0?`${O(i)} created in Test Manager`:s>0?`${O(s)} updated in Test Manager`:null,w={text:` kane-cli context sessions save ${t}`,tone:"plain"},h=b=>b===1?"wasn't":"weren't",f=[];if(m.length>0){let b=m.length===1;f.push({text:`${O(m.length)} in Test Manager ${b?"updates on its":"update on their"} next kane-cli run:`,tone:"plain"});for(let A of m)f.push({text:` "${A.title}"`,tone:"detail"});(r>0||l!==null||c.length>0)&&f.push({text:"",tone:"plain"})}if(r>0){f.push({text:`warning: ${O(r)} in Test Manager ${h(r)} updated`,tone:"warning"});for(let b of e.waitingOn)f.push({text:` "${b.title}"`,tone:"detail"},{text:` ${Ot[b.reason]}`,tone:"detail"})}if(p.length>0){let b=p.length;f.push({text:`warning: ${b} ${b===1?"scenario wasn't":"scenarios weren't"} sent to Test Manager`,tone:"warning"});for(let A of p)f.push({text:` "${A.title}"`,tone:"detail"},...Nt(A,d))}u>0&&f.push(...At(u,n,p.length>0));let $=l===null?null:he(l.code,n);$&&f.push({text:`warning: the session was saved, but ${$.why}`,tone:"warning"});let S=$?$.remedy||r===0?$.next:"then, to finish them (nothing is saved twice), run:":r>0?`then, to update ${r===1?"it":"them"} (nothing is saved twice), run:`:null;S!==null&&f.push({text:`next: ${S}`,tone:"plain"},w);let E=[];if(g!==null&&E.push(g),r>0&&E.push(g!==null?`${r} ${h(r)} updated yet`:`${O(r)} in Test Manager ${h(r)} updated yet`),p.length>0){let b=p.length;E.push(`${E.length>0?b:`${b} ${b===1?"scenario":"scenarios"}`} ${b===1?"wasn't":"weren't"} sent to Test Manager`)}return $&&E.push(E.length>0?"some may not be there yet":$.lead),{receipt:g,summary:E.length>0?E.join("; "):null,...m.length>0?{nextRunSummary:`${O(m.length)} ${m.length===1?"updates on its":"update on their"} next kane-cli run`}:{},lines:f,support:($?.support??!1)||p.some(de)}}function gs(e,t,n,o){if(!e)return;let d=e.notCovered??[],a=[...new Set(d.flatMap(s=>{let r=K(s,n)?Ze(s):null;return r===null?[]:[r]}))],i=[...e.error!==null?[{cmd:`kane-cli context sessions save ${t} --mode agent`,why:"finishes the test cases that may not be there yet"}]:[],...a.map(s=>({cmd:`kane-cli design tests --use-case ${s} --force --mode agent`,why:"designs the use case's tests again, so its scenarios reach Test Manager"}))];return{total:e.total,created:e.made,updated:e.updated,already_there:e.linked,waiting:e.waiting,waiting_on:e.waitingOn.map(({scenario:s,title:r,reason:l})=>({scenario:s,title:r,reason:l})),next_run:(e.nextRun??[]).map(({scenario:s,title:r})=>({scenario:s,title:r})),...d.length>0?{not_covered:d.map(s=>{let r=de(s)?o?.(s.test):void 0;return{scenario:s.scenario,title:s.title,test:s.test,reason:s.reason,in_session:K(s,n),...r?{file:pe(r)}:{}}})}:{},...e.error!==null?{error:he(e.error.code,"").agentCode}:{},...d.some(s=>K(s,n)&&de(s))?{support_id:V("refused_TEST_UNREADABLE")}:{},...i.length>0?{next:i}:{}}}var Be=new Set(["duplicate","unwritable"]),et=e=>Be.has(e.kind)||e.kind==="import"&&e.via!==void 0&&Be.has(e.via),Dt=new Set(["unreadable","unresolved"]);function Lt(e,t){return!e||e.variables.length===0&&e.noStartPage.length===0?{}:{needed:{...e,tests:t},neededFacts:je(e,{tests:t})}}function Ut(e){if(!e||e.length===0)return{};let t=e.length===1?"1 test file here was replaced and won't run any more":`${e.length} test files here were replaced and won't run any more`;return{replacedHead:`\u2692 ${t}:`,replaced:e.map(n=>({file:ce(process.cwd(),n.file)||n.file,by:n.replacedBy.map(o=>wt(o))})),replacedSummary:t}}function jt(e){return e!=null&&e.error===null}var tt=(e,t)=>{if(!jt(t)||t.waitingOn.length>0)return[];let n=new Set((t.notCovered??[]).map(o=>o.test.toLowerCase()));return e.filter(o=>o.file&&!n.has(o.id.toLowerCase()))},pe=e=>M(ce(process.cwd(),e)||e);function ms(e,t,n,o={}){let d={text:` kane-cli context sessions save ${t}`,tone:"plain"};if(e==="unread")return{line:null,lines:[{text:"warning: the session was saved, but its test files couldn't be written here",tone:"warning"},{text:"next: to write them (nothing is saved twice), run:",tone:"plain"},d],support:!0,summary:"its test files aren't written here yet",kept:null,again:"all"};let a=e.wrote.length,i=e.refused.length,s=a+(e.unchanged?.length??0),r=s+i,l=e.saved?new Set(e.saved):null,m=l?e.wrote.filter(S=>!l.has(S.id)).length:0,c=S=>`${m} ${m===1?"test":"tests"} ${S?"it imports":"they import"}`,p=a===0?null:n||i===0&&s>a?`\u2692 wrote ${a===1?"1 test file that was":`${a} test files that were`} missing or out of date here`:i>0?`\u2692 wrote ${a} of the ${r} test files`:m>0?`\u2692 wrote ${a} test files, for ${a-m===1?`the saved test and ${c(!0)}`:`${a-m} saved tests and ${c(!1)}`}`:a===1?"\u2692 wrote 1 test file, for the saved test":`\u2692 wrote ${a} test files, one for each saved test`,u={...Ut(e.replaced),...Lt(e.needed,e.saved?.length??r)};if(i===0)return{line:p,lines:[],support:!1,summary:null,kept:null,again:0,...u};let w=[{text:`warning: ${i===r?`${i===1?"1 test file wasn't":`${i} test files weren't`} written`:`${i} of the ${r} test files ${i===1?"wasn't":"weren't"} written`}`,tone:"warning"}];for(let S of e.refused)w.push({text:S.title?` "${S.title}"`:" a test with no title",tone:"detail"},{text:` ${ee(S)}`,tone:"detail"});let h=e.refused.filter(et).length;h>0&&w.push({text:`next: then, to write ${h===1?"it":"them"} (nothing is saved twice), run:`,tone:"plain"},d);let f=e.refused.filter(S=>S.kind==="edited");if(f.length>0){let S=f.length===1,E=tt(f,o.testManager);if(E.length>0){w.push({text:E.length===1?"next: to send your edit to its test case in Test Manager, run:":"next: to send your edits to their test cases in Test Manager, run:",tone:"plain"});for(let A of E)w.push({text:` kane-cli testmd run ${pe(A.file)}`,tone:"plain"})}let b=`${E.length>0?"or, to":"next: to"} get the project's ${S?"version, move it":"versions, move them"} out of this folder`;h>0?w.push({text:`${b} and save again`,tone:"plain"}):w.push({text:`${b}, then run:`,tone:"plain"},d)}let $=i-f.length;return{line:p,lines:w,support:e.refused.some(S=>Dt.has(S.kind)),summary:s>0?`${s} of the ${r} test files written here`:$===0?null:f.length>0?`${$} of the ${r} test files ${$===1?"isn't":"aren't"} written here yet`:r===1?"its test file isn't written here yet":"its test files aren't written here yet",kept:f.length===0?null:f.length>1?`${f.length} test files here keep your edits`:r===1?"its test file here keeps your edit":"1 test file here keeps your edit",again:h,...u}}function hs(e,t,n){if(!e||!t||t.again===0)return null;let o=`write ${t.again===1?"the test file":"the test files"}`;return e.error!==null?he(e.error.code,n).remedy?null:`next: to finish them and ${o} (nothing is saved twice), run:`:e.waiting>0?`next: then, to update ${e.waiting===1?"the test case":"the test cases"} and ${o} (nothing is saved twice), run:`:null}function ps(e,t,n={}){let o=`kane-cli context sessions save ${t} --mode agent`;if(e==="unread")return{written:[],refused:[],error:"TEST_FILES_NOT_WRITTEN",next:[{cmd:o,why:"writes the test files here"}]};let d=e.refused.some(et),a=e.refused.filter(r=>r.kind==="edited"),i=a.length===0?"":a.length===1?", and the project's version of a kept file once it's moved out of its folder":", and the project's version of the kept files once they're moved out of their folder",s=[...d?[{cmd:o,why:`writes the test files not written here${i}`}]:[],...tt(a,n.testManager).map(r=>({cmd:`kane-cli testmd run ${M(r.file)} --agent`,why:"sends your edit to its test case in Test Manager"})),...a.length>0&&!d?[{cmd:o,why:"writes the project's version, once the file is moved out of its folder"}]:[]];return{written:e.wrote.map(r=>r.path),refused:e.refused.map(r=>({test:r.id,title:r.title,reason:ee(r),...r.kind==="edited"&&r.file?{file:r.file}:{}})),...e.replaced?.length?{replaced:e.replaced.map(r=>({test:r.test,file:r.file,replaced_by:r.replacedBy}))}:{},...e.needed?.variables.length?{variables_needed:{file:e.needed.file,variables:e.needed.variables}}:{},...e.needed?.noStartPage.length?{no_start_page:e.needed.noStartPage.map(r=>({test:r.test,...r.file?{file:r.file}:{}}))}:{},...s.length>0?{next:s}:{}}}var Mt={ac:"an acceptance criterion",scenario:"a scenario",test:"a test",gap:"an open question",source:"a source",stylenote:"a style note"},T=(e,t)=>e?`"${e}"`:P(t),Ge=(e,t,n)=>`${e} ${e===1?t:n}`,fs={trusted:"approved",derived:"proposed",archived:"archived"},ws={yes:"yes",source_changed:"no: its source changed",source_removed:"no: its source was removed",tests_out_of_date:"no: its tests are out of date",designed_from_changed:"no: what it was designed from changed",archived:"-"},ys={source_changed:"its source changed",source_removed:"its source was removed",tests_out_of_date:"changed after its tests were designed"},y=e=>e?`"${e}"`:"this session's project",_=(e,t)=>`kane-cli design tests --use-case ${e}${t}`,ae=e=>e?"its source's change was put off in an earlier review; to take it up":"to review its source's change",He=e=>e.split(`
|
|
6
|
+
`).map(t=>({text:` ${t.trim()}`,dim:!0})),Rs={nothingChanged:(e,t)=>({code:"NOTHING_CHANGED",message:`${T(e,t)} hasn't changed since its tests were designed`,remedy:`to design them again anyway, run:
|
|
7
|
+
${_(t,"")}`,next:[{cmd:_(t," --mode agent"),why:"designs its tests again anyway"}]}),noTests:(e,t)=>({code:"NO_TESTS_YET",message:`${T(e,t)} has no tests yet, so there's nothing to update`,remedy:`to design them, run:
|
|
8
|
+
${_(t,"")}`,next:[{cmd:_(t," --mode agent"),why:"designs its tests"}]}),unreviewed:(e,t)=>({code:"UC_UNREVIEWED",message:We.unapproved(e,t,!0).message,remedy:`to design its tests again anyway, run:
|
|
9
|
+
${_(t," --allow-unreviewed")}`,next:[{cmd:_(t," --force --allow-unreviewed --mode agent"),why:"designs its tests again anyway"}]}),archived:(e,t,n)=>({code:"UC_ARCHIVED",message:We.archived(e,t,n).message}),unknownRef:(e,t)=>({message:`${y(t)} has no ${Ft[Bt(e)]??"item"} ${e}`}),ambiguousRef:(e,t)=>({message:`${e} names more than one item in ${y(t)}; run the command again with more of its id`}),notInUseCase:e=>({message:`${e} isn't part of a use case whose tests can be updated`}),held:(e,t,n)=>[{text:` \u2717 the tests of "${t}" can't be updated now: ${e?"you're designing them in another session":"someone else is designing them"}`},{text:" to update them later, run:",dim:!0},{text:` kane-cli maintain evolve ${n}`,dim:!0}],later:e=>[{text:"next: to update them later, run:"},{text:` kane-cli maintain evolve ${e}`}],changedCount:e=>e===1?"1 use-case changed after its tests were designed":`${e} use-cases changed after their tests were designed`,cantUpdate:(e,t)=>[{text:` \u2717 the tests of "${e}" can't be updated: it isn't approved yet`},{text:" to design its tests again anyway, run:",dim:!0},{text:` kane-cli design tests --use-case ${t} --allow-unreviewed`,dim:!0}],upToDate:e=>`everything in ${y(e)} is up to date, so there's nothing to update`,resumingBatch:(e,t)=>`\u25CF resuming the update of ${e===1?"1 use-case":`${e} use-cases`} \u2014 ${t} updated, ${e-t} to go`,resumingOne:(e,t,n)=>`\u25CF resuming the update of "${e}" \u2014 ${t} of ${n} phases done`,upToDateNow:e=>({text:` "${e}" is up to date now, so it's left out`,dim:!0}),upToDateNothing:e=>({text:` "${e}" is up to date now, so there's nothing to update`,dim:!0}),moreAnswers:e=>e===1?"1 more use-case needs your answer before the update goes on":`${e} more use-cases need your answers before the update goes on`,stillOutOfDate:e=>[e===1?"next: 1 use-case still isn't up to date; to update it, run:":`next: ${e} use-cases still aren't up to date; to update them, run:`," kane-cli maintain evolve --from-stale"],nothingToSave:"nothing to save \u2014 this session changed nothing",notYet:e=>`${I(e.map(t=>`"${t}"`))} ${e.length===1?"wasn't":"weren't"} updated`,notUpdatedNext:e=>[`next: to update ${e.length===1?"the use-case":`the ${e.length} use-cases`} this didn't, run:`,...e.map(t=>` kane-cli maintain evolve ${t}`)],notUpdated:e=>I(e.map(t=>`"${t}"`)),reviewSource:(e,t,n=!1)=>e!==null?`${ae(n)}, run:
|
|
10
|
+
${e}`:`${ae(n)}, run this with that source's file:
|
|
11
|
+
kane-cli maintain reconcile --from <file> --source-id ${t}`,reviewSourceAgent:(e=!1)=>ae(e),sourceChanged:(e,t,n)=>({message:`${T(e,t)} is out of date because its source changed, and an update can't change that`,...n}),leftOutSourceChanged:(e,t,n)=>[{text:`${T(e,t)} is left out: it's out of date because its source changed`},...He(n)],stillSourceChanged:e=>He(e),listNext:(e,t)=>[`next: for ${P(e)} "${t}", run:`,` kane-cli maintain evolve ${e}`],listAgentNext:e=>[{cmd:`kane-cli maintain evolve ${e} --mode agent`,why:"update its tests"}]},Ft={uc:"use case",sc:"scenario",ac:"acceptance criterion",t:"test",gap:"open question",sty:"style note"},Bt=e=>/^([a-z]+)-\d+$/i.exec(e)?.[1]?.toLowerCase()??"",We={unapproved:(e,t,n)=>({code:"UC_UNREVIEWED",message:`${T(e,t)} isn't approved yet`,next:{lead:"to design its tests anyway, run:",cmd:_(t,`${n?" --mode agent":""} --allow-unreviewed`),why:"designs its tests though it isn't approved yet"}}),archived:(e,t,n)=>({code:"UC_ARCHIVED",message:`${T(e,t)} is archived in ${y(n)}, so its tests can't be designed`}),designed:(e,t,n)=>({message:n?`${T(e,t)} changed after its tests were designed; --force designs them again, replacing the ones it has`:`${T(e,t)} already has tests; --force designs them again, replacing the ones it has`,next:{lead:"to design them again, run:",cmd:_(t," --force --mode agent"),why:"designs its tests again, replacing the ones it has"},...n?{more:[{cmd:`kane-cli maintain evolve ${t} --mode agent`,why:"updates only the tests its change touches"}]}:{}}),wallUpdate:e=>`next: to update only what its change touches, run:
|
|
12
|
+
kane-cli maintain evolve ${e}`,wallHead:(e,t,n,o=2)=>n?`${T(e,t)} changed after its ${o===1?"test was":"tests were"} designed`:`${T(e,t)} already has ${o===1?"a test":"tests"}`,wallAgain:e=>e===1?" 1. design it again \u2014 replaces it if it no longer fits; you'll be asked why":` 1. design them again \u2014 ${e>0?"replaces any that no longer fit; ":""}you'll be asked why`,wallStop:" 2. stop here \u2014 nothing is started",wallWhy:e=>e===1?"why design it again? ":"why design them again? ",wallStopped:"nothing was started",wallNoReason:"nothing was started: designing them again needs a reason",unknown:(e,t,n)=>({message:`${y(t)} has no use case ${e}`,...n.length>0?{next:{lead:`its use cases include ${I(n)}; run the command again with one of them`}}:{}}),removed:(e,t)=>({message:`${e} was removed from ${y(t)}, so it has no tests to design`}),notUseCase:(e,t)=>{let n=t!==void 0?Mt[t]:void 0;return{message:n?`${e} is ${n}, not a use case`:`${e} isn't a use case`}}},Gt=new Set(["CHECKPOINT_PROTOCOL","SESSION_KEPT_NOTHING","SESSION_MISSING"]),$s=e=>{let t=/^error: ([A-Z_]+): /.exec(e)?.[1];return t!==void 0&&Gt.has(t)},Y=e=>{let t=e.startsWith("-")?`./${e}`:e;return/^[A-Za-z0-9_./:@%+=,\\-]+$/.test(t)?t:`'${t.replace(/'/g,"'\\''")}'`};function vs(e,t){let n=g=>e.tests.filter(w=>w.outcome===g).length,[o,d,a,i]=[n("new"),n("updated"),n("unchanged"),n("kept")],s=o+d+a,r=[],l=[o?`${o} new`:"",d?`${d} updated`:"",a?`${a} already up to date`:""].filter(Boolean);s>0&&r.push(`\u2713 "${t.project}": ${s} test${s===1?"":"s"} here \u2014 ${l.join(", ")}`);for(let g of e.tests)g.outcome==="new"?r.push(` new ${g.file}${g.imported?" (a test above uses it)":""}`):g.outcome==="updated"?r.push(` updated ${g.file}`):g.outcome==="kept"?r.push(` kept ${g.file} \u2014 you changed it here`):g.outcome==="replaced"&&r.push(` replaced ${g.file} \u2014 your changes were replaced with the project's`);let m=e.tests.filter(g=>g.outcome==="not_written");if(m.length>0){r.push(`warning: ${m.length===1?"1 test file wasn't":`${m.length} test files weren't`} written`);for(let g of m)r.push(g.title?` "${g.title}"`:" a test with no title",` ${g.reason??""}`)}let c=e.tests.filter(g=>g.outcome!=="not_written"&&g.file!==void 0).length,p=e.tests.filter(g=>g.outcome!=="not_written"&&g.firstRun).length;p===1?r.push("1 of these tests hasn't run in this folder yet: its first run writes its steps in a real browser, which takes a few minutes and uses more credits; later runs replay it"):p>1&&r.push(`${p} of these tests haven't run in this folder yet: the first run of each writes its steps in a real browser, which takes a few minutes and uses more credits; later runs replay them`);let u=e.needed;if(u&&u.variables.length>0){let g=u.variables.length,w=c===1?"this test runs":"these tests run";r.push(`\u2692 ${g===1?"1 variable needs a value":`${g} variables need values`} before ${w}: ${I(u.variables.map(f=>f.name))}`),r.push(` add ${g===1?"it":"them"} to ${ce(t.cwd,u.file)||u.file}`);let h=u.variables.filter(f=>f.start_page).map(f=>f.name);h.length===1?r.push(` ${h[0]} is the page ${c===1?"it starts":"they start"} on`):h.length>1&&r.push(` ${I(h)} are the pages they start on`)}return u&&u.noStartPage.length>0&&r.push(...Ue(u.noStartPage,{indent:0,cwd:t.cwd})),c>0&&r.push(`next: to run ${c===1?"it":"them"}, run:`," kane-cli testrun run"),i>0&&r.push(`next: to replace ${i===1?"it":"them"} with the project's ${i===1?"version":"versions"}, run:`,` kane-cli context pull --overwrite${t.useCase?` --use-case ${t.useCase}`:""}`),r}var Ht={savedBefore:"this session was already saved",pullLocationLinked:e=>({code:"PULL_LOCATION_LINKED",message:`this folder takes its tests from "${e}", not from a location`,remedy:`to bring the project's tests here, run:
|
|
13
|
+
kane-cli context pull`}),pullFlagsMixed:()=>({code:"PULL_FLAGS_MIXED",message:"--project, --use-case and --overwrite bring a shared project's tests; a location name, --rebase, --yes and --answer take work from a location",remedy:"use one or the other"}),pullFlagsLinkedOnly:()=>({code:"PULL_FLAGS_LINKED_ONLY",message:"--use-case and --overwrite work in a folder linked to a shared project",remedy:`to take the new work shared at a location, run:
|
|
14
|
+
kane-cli context pull [name]`}),useCaseUnknown:(e,t)=>({code:"USE_CASE_UNKNOWN",message:`"${e}" has no use-case ${t}`,remedy:`to see its use-cases, run:
|
|
15
|
+
kane-cli context list`}),pullFailed:e=>({code:"PULL_FAILED",message:`the tests of "${e}" couldn't be read, so none was written`,remedy:`to try again, run:
|
|
16
|
+
kane-cli context pull`,support:!0}),noTestsYet:e=>[`"${e}" has no tests yet`,"next: to see which use-cases need tests designed, run:"," kane-cli cover"],notYet:e=>({code:"REMOTE_UNSUPPORTED",message:`kane-cli ${e} isn't available yet ${q}`,remedy:"run it in a folder that isn't linked to a project"}),sessionsLocalOnly:e=>({code:"REMOTE_UNSUPPORTED",message:`kane-cli context sessions ${e} isn't available yet ${q}`,remedy:"to see this project's sessions, run: kane-cli context sessions"}),overrideWithProject:e=>({code:"REMOTE_UNSUPPORTED",message:"--mode override isn't available yet with a shared project",remedy:`to use this folder's own context instead, run:
|
|
17
|
+
kane-cli context ingest ${e.map(Y).join(" ")} --local --mode override`}),answerNeedsResume:()=>({code:"STRUCTURED_FLAGS_USAGE",message:"--answer needs --resume: it answers a paused session's questions",remedy:"to see this project's sessions, run: kane-cli context sessions"}),answerAgentOnly:(e,t)=>({code:"STRUCTURED_FLAGS_USAGE",message:"--answer works with --mode agent only",remedy:`to answer in the session instead, run: kane-cli ${e} --resume ${M(t)}`}),answerParse:e=>({code:"STRUCTURED_FLAGS_USAGE",message:e}),fromContextNotYet:(e,t,n=[])=>{let o=`--from-context isn't available yet ${q}`;if(t===null)return{code:"REMOTE_UNSUPPORTED",message:o,remedy:"name the test files instead, for example: kane-cli testrun run .testmuai/tests/<file>_test.md"};let d=e.length===1&&t.length===1?`${e[0]}'s test file`:"their test files",a=`kane-cli testrun run ${[...t,...n].map(M).join(" ")}`;return{code:"REMOTE_UNSUPPORTED",message:o,remedy:`to run ${d}, run:
|
|
18
|
+
${a}`,next:[{cmd:a,why:`runs ${d}`}]}},optionNotYet:e=>({code:"REMOTE_UNSUPPORTED",message:`${e} isn't available yet ${q}`,remedy:"run it in a folder that isn't linked to a project"}),reviewVersionAdded:(e,t)=>`added ${e} to this session \u2014 a new version of "${t}"`,reviewPageAdded:e=>`added ${e} to this session \u2014 its new version`,reviewWaits:(e,t)=>`added a new version of ${e} to session ${t}, not saved yet`,reviewResume:e=>`review: kane-cli context extract --resume ${e}`,nothingToReview:(e,t)=>`${e} is already in ${y(t)}, unchanged, so there's nothing to review`,reviewBehind:(e,t,n)=>`${e} is already in ${y(t)}, but ${n===1?"1 use-case was":`${n} use-cases were`} made from an older version of it`,reviewUnread:(e,t)=>`${e} is already in ${y(t)}, but its current version adds what no use-case was made from yet`,reconcileSourceMissing:e=>{let t=`kane-cli context ingest ${Y(e.path)}`,n=e.removed?"to add it again as a new source":"to add it as a new source",o=`to see the sources ${y(e.project)} holds, run:`;return{code:e.removed?"SOURCE_REMOVED":"SOURCE_UNKNOWN",message:e.removed?`"${e.source}" was removed from ${y(e.project)}, so there's nothing to compare ${e.file} with`:`"${e.source}" isn't in ${y(e.project)} yet, so there's nothing to compare ${e.file} with`,remedy:e.agent?`${n}, run: ${t} --mode agent; or, ${o} kane-cli context list --type source --mode agent`:`${n}, run:
|
|
19
|
+
${t}
|
|
20
|
+
or, ${o}
|
|
21
|
+
kane-cli context list --type source`}},reconcileOriginUnknown:(e,t)=>({code:"SOURCE_ORIGIN_UNKNOWN",message:`this folder holds no record of the file source '${e}' was read from`,remedy:t?`pass the file: kane-cli maintain reconcile --from <file> --source-id ${e} --mode agent`:`pass the file:
|
|
22
|
+
kane-cli maintain reconcile --from <file> --source-id ${e}`}),reconcileRefUnrouted:(e,t,n,o)=>({code:"SOURCE_REF_UNROUTED",message:`source '${e}' was read by plugin ${t} from '${n}', which this build routes to ${o===null?"no plugin":`plugin ${o}`}`,remedy:`reconcile it with a build whose plugin ${t} claims that reference`}),reconcileRefOtherId:(e,t,n,o)=>({code:"SOURCE_ID_MISMATCH",message:`--source-id '${e}' does not match the source plugin ${t} reads '${n}' as, '${o}'`,remedy:`re-run with --source-id ${o}`}),reconcileNeeds:(e,t)=>({code:"REMOTE_UNSUPPORTED",message:"kane-cli maintain reconcile needs --from <file> and --source-id <id>",remedy:t?`to see the sources ${y(e)} holds, run: kane-cli context list --type source --mode agent`:`to see the sources ${y(e)} holds, run:
|
|
23
|
+
kane-cli context list --type source`}),listHeadline:(e,t)=>{let n=(d,a,i)=>d===void 0?null:Ge(d,t.proposed?`proposed ${a}`:a,t.proposed?`proposed ${i}`:i),o=[t.sources!==void 0?Ge(t.sources,"source","sources"):null,n(t.useCases,"use-case","use-cases"),n(t.scenarios,"scenario","scenarios"),n(t.tests,"test","tests")].filter(d=>d!==null);return`${y(e)} holds ${o.length>1?`${o.slice(0,-1).join(", ")} and ${o[o.length-1]}`:o[0]??""}`},listStaleHeadline:(e,t,n)=>n===1?`the 1 use-case in ${y(e)} isn't up to date`:`${t} of the ${n} use-cases in ${y(e)} ${t===1?"isn't":"aren't"} up to date`,listNothing:(e,t)=>t?`everything in ${y(e)} is up to date`:`nothing in ${y(e)} matches`,listReadFailed:()=>({code:"LIST_FAILED",message:"couldn't load this project's list",remedy:"run the command again",support:!0}),coverComputing:e=>`coverage: ${y(e)} is still working it out; run the command again in a moment`,coverReadFailed:e=>({code:"COVERAGE_FAILED",message:`couldn't load ${y(e)}'s coverage`,remedy:"run the command again",support:!0}),assuranceOff:e=>({code:"ASSURANCE_OFF",message:`assurance isn't available for ${y(e)}`,remedy:"run the command in a folder that isn't linked to a project"}),noAccess:e=>({code:"PROJECT_NO_ACCESS",message:e===""?"you don't have access to this session's project":`you don't have access to "${e}", the project this folder is linked to`,remedy:"ask a Test Manager admin to grant your account access, then run the command again"}),bothStores:e=>({code:"BOTH_STORES",message:`this folder has its own context store and is also linked to ${e===null?"a project":`"${e}"`}`,remedy:"to work locally, remove .testmuai/assurance.json; to work in the project, move the context store (.context) out of this folder"}),linkUnreadable:()=>({code:"PROJECT_FILE_UNREADABLE",message:"this folder's link to its project could not be read",remedy:"remove .testmuai/assurance.json, then choose the project again with: kane-cli context extract"}),markRefused:(e,t)=>({code:"PERMISSION_REQUIRED",message:`you can't start the first session in ${y(e)}: it needs permission to create test cases`,remedy:t?"ask a Test Manager admin for that permission, or run the command again and pick another project":"ask a Test Manager admin for that permission, or someone who has it to start the first session; then run the command again"}),confirmRequired:e=>({code:"CONFIRM_REQUIRED",message:"refusing to save this session without --yes (no terminal to confirm)",remedy:"add --yes",...e?{next:[{cmd:`kane-cli context sessions save ${e} --yes`,why:"save it to the project"}]}:{}}),noConnectionAtStart:()=>({code:"CONNECTION_FAILED",message:"couldn't connect for 2 minutes, so nothing was started",remedy:"check your connection, then run the command again",support:!0}),folderFlagsBoth:()=>({code:"FOLDER_USAGE",message:"--project and --local can't be used together",remedy:"use one: --project <id> to share this folder's work, or --local to keep it here"}),folderFlagWithResume:e=>({code:"FOLDER_USAGE",message:`${e} can't be used with --resume; a session stays where it started`,remedy:`run it again without ${e}`}),projectIdUnknown:(e,t)=>({code:"PROJECT_NO_ACCESS",message:`you don't have a project with the id "${e}"`,remedy:t?"to find a project's id, run: kane-cli projects list --search <name> --agent":`to find a project's id, run:
|
|
24
|
+
kane-cli projects list --search <name>`}),projectFileUnwritable:e=>({code:"PROJECT_FILE_UNWRITABLE",message:"this folder's link to its project could not be written",remedy:e?"move the file named .testmuai out of this folder, then run the command again":"check that you can write to this folder, then run the command again"}),folderWorksLocally:()=>({code:"FOLDER_CHOSEN",message:"this folder works locally, so --project can't link it to a project",remedy:"run it without --project; to share instead, move the context store (.context) out of this folder first"}),folderLinkedElsewhere:e=>({code:"FOLDER_CHOSEN",message:`this folder is linked to ${y(e)}, not to the project given`,remedy:"run it without --project; to link it to another project, remove .testmuai/assurance.json first"}),folderLinkedNotLocal:e=>({code:"FOLDER_CHOSEN",message:`this folder is linked to ${y(e)}, so --local can't keep it local`,remedy:"run it without --local; to work locally, remove .testmuai/assurance.json first"}),noConnection:()=>({code:"CONNECTION_FAILED",message:"couldn't connect, so nothing was started",remedy:"check your connection, then run the command again",support:!0}),credentialsMissing:()=>({code:"CREDENTIALS_MISSING",message:"you're not logged in",remedy:"in a terminal, log in with: kane-cli login"}),loginUnconfirmed:()=>({code:"CREDENTIALS_MISSING",message:"couldn't confirm your login for shared projects",remedy:"run the command again; if this keeps failing, log in with your username and access key: kane-cli login --username <user> --access-key <key>"}),credentialsRejected:()=>({code:"CREDENTIALS_REJECTED",message:"your credentials were rejected",remedy:"in a terminal, log in again with: kane-cli login"}),noSuchSession:e=>({code:"SESSION_NOT_FOUND",message:`no session ${e} of yours`,remedy:"to see your sessions, run: kane-cli context sessions"}),sessionFinished:e=>({code:"SESSION_FINISHED",message:`session ${e} is finished, so it can't be resumed`,remedy:`to save what it added, run: kane-cli context sessions save ${e}`,next:[{cmd:`kane-cli context sessions save ${e} --yes`,why:"save what it added"}]}),sessionFailed:e=>({code:"SESSION_FAILED",message:`session ${e} ended with an error, so it can't be resumed or saved`,remedy:"start a new session with: kane-cli context extract",support:!0}),resumeUnreadable:(e,t,n,o)=>({code:e,message:`session ${t} can't be resumed, because its last step can't be read`,remedy:`start a new session with: ${n==="design"&&o?`kane-cli design tests --use-case ${o}`:"kane-cli context extract"}`,support:!0}),reviewOnlyFiles:(e,t,n)=>{let o=`${Xe([e])}${n?` --as ${Y(n)}`:""}`;return{code:"REMOTE_UNSUPPORTED",message:"--from takes only a file yet in a folder linked to a shared project",remedy:t?`to add the page's new version, run: ${o} --mode agent`:`to add the page's new version, run:
|
|
25
|
+
${o}`}},ingestTooLarge:(e,t,n)=>({code:"FILE_TOO_LARGE",message:`${e} is too large \u2014 ${t}; the limit is ${n}`,remedy:"use a smaller file, then run the command again"}),ingestUnsupported:e=>({code:"UNSUPPORTED_MEDIA",message:e,remedy:"use one of those file types, then run the command again"}),ingestTextTooLarge:e=>({code:"PROJECTION_TOO_LARGE",message:`${e}'s text is too large to add`,remedy:"shorten the document, then run the command again"}),ingestUnreadable:(e,t)=>({code:e,message:t,remedy:"check the file, then run the command again"}),conversionRefused:(e,t)=>{let n=Pt[t]?.(e);return n?{code:t,message:n[0],remedy:n[1]}:{code:t,message:`${e} couldn't be added`,remedy:U,support:!0}},ingestBadSourceId:e=>({code:"BAD_SOURCE_ID",message:`${e} isn't a source id: use letters, digits, ".", "_" or "-", and start with a letter or digit`,remedy:"pick another id, then run the command again"}),ingestNoFile:e=>({code:"FILE_NOT_FOUND",message:`there's no file at ${e}`,remedy:"check the path, then run the command again"}),ingestNotItsType:(e,t)=>({code:"MEDIA_SNIFF_MISMATCH",message:`${e}'s content doesn't match its .${t} name`,remedy:U}),ingestCantOpen:e=>({code:"FILE_UNREADABLE",message:`${e} can't be read`,remedy:"check that you can open the file, then run the command again"}),ingestNoSourceId:e=>({code:"BAD_SOURCE_ID",message:`${e} can't be added: its name needs at least one letter a-z or digit`,remedy:"rename the file, then run the command again"}),uploadStalled:e=>({code:"UPLOAD_STALLED",message:`the upload of ${e} stopped, so nothing was added`,remedy:"check your connection, then run the command again",support:!0}),uploadDropped:e=>({code:"CONNECTION_FAILED",message:`the connection dropped while uploading ${e}, so nothing was added`,remedy:"check your connection, then run the command again"}),uploadExpired:e=>({code:"UPLOAD_EXPIRED",message:`the upload of ${e} took too long, so nothing was added`,remedy:"run the command again"}),uploadNotTaken:e=>({code:"UPLOAD_NOT_TAKEN",message:`the shared project couldn't take ${e}, so nothing was added`,remedy:"run the command again",support:!0}),resultRefused:e=>({code:"RESULT_REFUSED",message:`the shared project didn't take ${e}, so nothing was added`,remedy:"run the command again",support:!0}),alreadySaved:()=>({code:"ALREADY_SAVED",message:"this session was already saved, so there's nothing to discard"}),savedOrDiscarded:()=>({code:"ALREADY_ENDED",message:"this session was already saved or discarded; there's nothing to discard"}),goingOnElsewhere:e=>({code:"SESSION_ELSEWHERE",message:"this session goes on in another terminal, so it can't be discarded now",remedy:`stop it there, or wait 3 minutes if that terminal was closed; then run: kane-cli context sessions discard ${e}`,next:[{cmd:`kane-cli context sessions discard ${e} --yes`,why:"throw away what this session added"}]}),discardFailed:()=>({code:"DISCARD_FAILED",message:"couldn't discard this session, so it's kept as it is",remedy:"run the command again",support:!0}),discardUnconfirmed:()=>({code:"CONNECTION_FAILED",message:"the connection dropped during the discard, so it couldn't be confirmed",remedy:"check your connection, then run the command again; it's safe to repeat",support:!0}),confirmDiscardRequired:e=>({code:"CONFIRM_REQUIRED",message:"refusing to discard this session without --yes (no terminal to confirm)",remedy:"add --yes",...e?{next:[{cmd:`kane-cli context sessions discard ${e} --yes`,why:"throw away what this session added"}]}:{}}),notFinished:(e,t)=>({code:"SESSION_NOT_FINISHED",message:`session ${e} isn't finished yet, and only a finished session can be saved`,remedy:`resume it and finish it first: ${t}`}),versionCliOlder:()=>({code:"VERSION_MISMATCH",message:"this version of kane-cli is too old to work with shared projects",remedy:`to update kane-cli, run: ${Se()}`}),versionServiceOlder:()=>({code:"VERSION_MISMATCH",message:"shared projects don't support this version of kane-cli yet",remedy:Me("VERSION_MISMATCH")}),openFailed:()=>({code:"SESSION_OPEN_FAILED",message:"the session couldn't be opened",remedy:"run the command again",support:!0}),projectBusy:e=>{let t=y(e.project),n=e.held,o=e.useCase??n.useCase,d=e.title?`"${e.title}"`:o?P(o):"this use case",a=e.agent?"wait for it to finish, then run the command again":`wait for it to finish, then run the command again; to see the project's sessions, run:
|
|
26
|
+
kane-cli context sessions`,i=l=>e.agent?`to go on with it here (the other terminal then stops), run: ${l} --mode agent`:`to go on with it here (the other terminal then stops), run:
|
|
27
|
+
${l}`,s=n.verb==="design"||n.verb==="evolve",r=s?n.mine?`you're already designing tests for ${d} in another session`:`someone else is designing tests for ${d} right now`:`${n.mine?e.verb==="extract"?"your other":"your":"someone else's"} extract is ${n.status==="queued"?"about to start":"running"} in ${t}`;return e.resume?{code:"PROJECT_BUSY",message:`${r}, so this session can't go on yet; it stays as it was`,remedy:"wait for it to finish, then run the command again",heldBy:n}:s?n.mine?{code:"PROJECT_BUSY",message:r,remedy:i(`kane-cli design tests --resume ${n.sessionId}`),heldBy:n}:{code:"PROJECT_BUSY",message:`${r}, so this design can't start`,remedy:a,heldBy:n}:e.verb==="design"?{code:"PROJECT_BUSY",message:`${r}, so a design can't start until it finishes`,remedy:a,heldBy:n}:n.mine?{code:"PROJECT_BUSY",message:`${r}, so this one can't start`,remedy:i(`kane-cli context extract --resume ${n.sessionId}`),heldBy:n}:{code:"PROJECT_BUSY",message:`${r}, so this one can't start`,remedy:a,heldBy:n}},nothingNewInSession:"nothing new to extract: every source is already in a session",nothingNewRead:["nothing new to extract: every source is already read","next: to add more, run:"," kane-cli context ingest <files>"],testCaseMissing:e=>({ownLine:!0,code:"TEST_CASE_MISSING",message:"this test isn't in Test Manager yet, so it can't run",remedy:e?`save the session that designed it, then run the test again; to save the session (nothing is saved twice), run: kane-cli context sessions save ${e}`:"save the session that designed it, then run the test again; to find it, run: kane-cli context sessions"}),testCaseGone:e=>({ownLine:!0,code:"TEST_CASE_GONE",message:"this test's test case was deleted or moved to another project in Test Manager, so it can't run",remedy:e?`save the session that designed it, then run the test again; to save the session (it makes a new test case), run: kane-cli context sessions save ${e}`:"save the session that designed it, then run the test again; to find it, run: kane-cli context sessions"}),testCaseArchived:()=>({code:"TEST_CASE_ARCHIVED",message:"this test's test case is archived in Test Manager, so it can't run",remedy:"restore it in Test Manager, then run the test again"}),testNotInProject:(e,t)=>({ownLine:!0,code:"TEST_NOT_IN_PROJECT",message:`this test isn't in ${y(e)}, and the session that designed it can't be saved anymore`,remedy:t?`design the test again, then save that session; to start, run: kane-cli design tests --use-case ${t}`:"find its use case on the project's page in Test Manager, then design the test again and save it; to start, run: kane-cli design tests --use-case <use-case>"}),testProjectHasNoWork:e=>({ownLine:!0,code:"TEST_NOT_IN_PROJECT",message:`this test isn't in ${y(e)}, which has no use cases or tests yet`,remedy:"run it in the folder linked to the project it was designed in; or, to start this project's work, run: kane-cli context ingest <files>"}),testManagerOutdated:()=>({code:"TEST_MANAGER_OUTDATED",message:"Test Manager can't add this test's runs to its test case yet, so the run didn't start",remedy:"run the test again once Test Manager is updated",support:!0}),testManagerMadeItsOwn:()=>({code:"TEST_MANAGER_OUTDATED",message:"Test Manager made a test case of its own for this run instead of using this test's, so the run stopped",remedy:"you can delete that test case in Test Manager; run the test again once Test Manager is updated",support:!0}),testRunNotSaved:(e,t,n)=>({ownLine:!0,code:"TEST_RUN_NOT_SAVED",message:`Test Manager couldn't save this run, so ${e??"its test case"} doesn't have it yet; the test itself ${t?"passed":"failed"}`,remedy:`the test's next run tries again; to try now, run: kane-cli testmd run ${n}`,support:!0}),remoteKaneNotPublished:()=>({code:"REMOTE_KANE_NOT_PUBLISHED",message:"tests linked to Test Manager need a published kane-cli on the grid, and this one isn't, so nothing was sent",remedy:`run the command with kane-cli installed from npm, or add one of these:
|
|
28
|
+
--kane-version <version> a published version for the grid to install
|
|
29
|
+
--kane-dist <dir> this build, sent with the tests`}),dispatchStopped:e=>`error: ${e} ${e===1?"test":"tests"} can't run yet, so nothing was sent to the grid`,dispatchNext:e=>`next: then run the command again, or leave ${e===1?"it":"them"} out with --match or --tags`,dispatchTestManagerOutdated:()=>({code:"TEST_MANAGER_OUTDATED",message:"Test Manager can't add these tests' runs to their test cases yet, so nothing was sent to the grid",remedy:"run the command again once Test Manager is updated",support:!0}),dispatchProjectHasNoWork:e=>({ownLine:!0,code:"TEST_NOT_IN_PROJECT",message:`these tests aren't in ${y(e)}, which has no use cases or tests yet, so nothing was sent to the grid`,remedy:"run them in the folder linked to the project they were designed in; or, to start this project's work, run: kane-cli context ingest <files>"}),testCaseAttachFailed:()=>({code:"TEST_CASE_ATTACH_FAILED",message:"Test Manager couldn't add this test to its test case, so the run didn't start",remedy:"run the test again",support:!0}),preflight:e=>{switch(e){case"unreachable":return{code:"PREFLIGHT",message:"couldn't connect, so nothing was started",remedy:"check your connection, then run the command again",support:!0};case"login_unchecked":return{code:"PREFLIGHT",message:"couldn't confirm your login, so nothing was started",remedy:"run the command again; if this keeps failing, in a terminal, log in again with: kane-cli login",support:!0};case"rejected":return{code:"PREFLIGHT",message:"your credentials were rejected",remedy:"in a terminal, log in again with: kane-cli login"};case"unsupported":return{code:"PREFLIGHT",message:"assurance sessions aren't available here yet, so nothing was started",remedy:Me("PREFLIGHT")}}},nothingToSave:"nothing to save \u2014 this session added nothing",assuranceOffOr:(e,t,n)=>e?.code==="PROJECT_NOT_MARKED"?Ht.assuranceOff(t):n,projectChanged:(e,t,n,o=[])=>({code:"PROJECT_CHANGED",message:`not saved \u2014 "${e}" changed after this session started`,detail:`this session can't be saved now, so ${It(t)} won't reach the project`,remedy:Ct(n,o)}),saveFailed:e=>({code:"SAVE_FAILED",message:`not saved \u2014 something in this session can't be saved to the project; ${e} still in this session`,remedy:`saving again won't help \u2014 share this id with support: ${V("refused_SAVE_FAILED")}`}),listFailed:()=>({code:"LIST_FAILED",message:"couldn't load this project's sessions",remedy:"run the command again",support:!0}),noConnectionToSave:()=>({code:"CONNECTION_FAILED",message:"couldn't connect, so nothing was saved",remedy:"check your connection, then run the command again",support:!0}),saveUnconfirmed:()=>({code:"CONNECTION_FAILED",message:"the connection dropped during the save, so it couldn't be confirmed",remedy:"check your connection, then run the command again; nothing is saved twice",support:!0}),stepRefused:"the shared project didn't take this step; the work so far is kept in the session",runStopped:e=>`${e==="reconcile"?"the review":e==="evolve"?"the update":e} stopped before it finished; the work so far is kept in the session`};export{Vt as a,xe as b,Jt as c,qt as d,Kt as e,Yt as f,se as g,ke as h,en as i,tn as j,_e as k,Ie as l,on as m,R as n,L as o,ct as p,fn as q,Tn as r,V as s,Ae as t,gt as u,mt as v,ht as w,xn as x,_n as y,Ue as z,je as A,Bn as B,Gn as C,Hn as D,$t as E,Wn as F,Vn as G,Jn as H,I,Je as J,vt as K,qn as L,Kn as M,Yn as N,Xn as O,bt as P,St as Q,Qn as R,zn as S,Zn as T,Et as U,es as V,ts as W,ns as X,Tt as Y,N as Z,j as _,me as $,xt as aa,ss as ba,Ke as ca,Ye as da,kt as ea,rs as fa,os as ga,F as ha,is as ia,Ct as ja,Xe as ka,as as la,_t as ma,It as na,ds as oa,cs as pa,us as qa,ls as ra,gs as sa,jt as ta,ms as ua,hs as va,ps as wa,fs as xa,ws as ya,ys as za,y as Aa,Rs as Ba,We as Ca,Gt as Da,$s as Ea,Y as Fa,vs as Ga,Ht as Ha};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{m as d}from"./chunk-4I7YN6YY.js";function a(n,e){return n.trust.get(e)}function c(n,e){return a(n,e)==="derived"?"unreviewed":void 0}function u(n,e){let t=n.resolve(e);if(!t)return{ok:!1,code:"UNKNOWN_REF",detail:`${e} names nothing in the graph`};let r=t.tip,i=a(n,r),o=d(),s=o.command("next.review_use_case",{use_case:e});return i==="archived"?{ok:!1,code:"UC_ARCHIVED",detail:`${e} is archived (previously rejected by the owner) \u2014 re-approve it before designing`,ref:e,...s!==null?{reviewCmd:s}:{}}:i==="derived"?{ok:!1,code:"UC_UNREVIEWED",detail:o.text("UC_UNREVIEWED",{use_case:e}),ref:e,...s!==null?{reviewCmd:s}:{}}:{ok:!0}}function g(n,e){if(!e.useCase||e.allowUnreviewed||e.resuming&&e.sessionUseCase===e.useCase)return null;let t=u(n,e.useCase);return!t.ok&&(t.code==="UC_UNREVIEWED"||t.code==="UC_ARCHIVED")?t:null}function p(n){return n.code==="UC_UNREVIEWED"}function v(n,e){return a(n,e)==="derived"?"quarantine":"evidence-attach"}async function f(n,e){let t={id:"trust-gate",header:"unreviewed use-case",text:`design: ${e.detail??"this use-case is unreviewed"} \u2014 design against it anyway?`,risk:"high",rationale:e.reviewCmd?`approve it first: ${e.reviewCmd}`:"",options:[{label:"no \u2014 approve it first",detail:e.reviewCmd??"review it before designing"},{label:"design against it anyway",detail:"the design will build on an unreviewed use-case"}],recommended_index:0,allow_free_text:!1},r=await n([t]);return Array.isArray(r)?r.find(i=>i.id==="trust-gate")?.selected_index===1:!1}export{a,c as b,u as c,g as d,p as e,v as f,f as g};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as i}from"./chunk-
|
|
2
|
+
import{b as i}from"./chunk-HQ2E2XCU.js";function c(t){let o=[];t.executionId&&o.push({label:"execution",kind:"execution",packPath:i(t.executionId,t.cwd),status:t.executionStatus??"passed"});for(let e of t.authored)e.executionId&&o.push({label:e.relPath,kind:"authored",packPath:i(e.executionId,t.cwd),status:e.overallStatus,...e.testId?{testId:e.testId}:{},...e.commitId?{commitId:e.commitId}:{},...e.sourceExecutionId?{sourceExecutionId:e.sourceExecutionId}:{}});return o}function s(t){return t.map(o=>`kane-cli evidence serve ${o.packPath} # ${o.kind==="authored"?`${o.label} (authored)`:o.label}`)}export{c as a,s as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{K as $,s as p}from"./chunk-7HMSMAUG.js";import{a as f}from"./chunk-QXQ7KVEN.js";import{oa as u}from"./chunk-UEE3RZN4.js";var w=e=>e===1?"1 change":`${e} changes`,v=e=>e===1?"waits":"wait";function c(e){let t=/^(\S+-\d+) · (.+)$/.exec(e.title);return t?`${u(t[1])} "${t[2]}"`:`"${e.title}"`}var y=e=>typeof e=="string"?`"${e}"`:e.bare,d=y,j=e=>typeof e=="string"?e:e.bare;function D(e,t){return t.page?{...e,page:t.page}:null}var m=e=>e.page?.bare?{bare:e.page.shown}:e.page?.shown??e.source,O={header:e=>`reviewing what changed in ${d(e)}`,held:(e,t)=>{let n=t.filter(s=>s==="ADD").length,i=t.filter(s=>s==="ARCHIVE").length,r=t.length-n-i,o=[n>0?`${n} new ${n===1?"use-case":"use-cases"}`:null,r>0?`${r} changed`:null,i>0?`${i} no longer in it`:null].filter(s=>s!==null);return`${w(t.length)} from ${d(e)} ${v(t.length)} for your review: ${o.join(", ")}`},waiting:(e,t)=>`${w(t)} from ${d(e)} ${v(t)} for your review`,reviewRow:(e,t)=>`review ${w(t)} from ${d(e)}`,finishForNow:{label:"finish for now",detail:"the review waits in this session"},adjust:"adjust \u2014 tell me what to change",reviewed:(e,t)=>{let n=t.approved+t.rejected+t.deferred,i=[t.approved>0?`${t.approved} approved`:null,t.rejected>0?t.rejected===1?"1 kept as it was":`${t.rejected} kept as they were`:null,t.deferred>0?`${t.deferred} left for later`:null].filter(r=>r!==null);return`reviewed ${n===1?"the change":`the ${n} changes`} from ${d(e)}: ${i.join(" \xB7 ")}`},finishSession:"finish the session",diffTitle:e=>c(e),receipt:(e,t)=>{let n=c(e),i=e.kind==="ADD",r="nothing is saved for this change, and it may be suggested again";return t==="approve"?{line:i?`added ${n} to this session`:e.kind==="ARCHIVE"?`archived ${n} in this session`:`approved the change to ${n} in this session`}:t==="reject"?{line:i?`left ${n} out of this session`:`kept ${n} as it is`,note:r}:{line:i?`left ${n} out for now, as an open question`:`left ${n} as it is for now, as an open question`}},refused:(e,t,n)=>t==="TARGET_RETIRED"?{line:`${c(e)} was archived while you were reviewing, so nothing changed`}:t==="SOURCE_MOVED"?{line:`${d(m(n))} changed again while you were reviewing, so this change wasn't taken`,next:["next: to review the latest version, run:",n.page?` kane-cli context ingest ${f(n.page.address)}${n.page.as?` --as ${f(n.page.as)}`:""}`:` kane-cli maintain reconcile --from ${n.file} --source-id ${n.source}`]}:t==="SOURCE_UNRESOLVED"?{line:`${d(m(n))} was removed while you were reviewing, so this change can't be taken`}:t==="ARCHIVE_UNRESOLVED"?{line:`${c(e)} changed while you were reviewing, so it can't be archived`,moveOn:!0}:t==="CONCURRENT_APPEND"?{line:"that didn't go through: the project was busy; try the card again"}:t==="ALREADY_VERDICTED"||t==="CARD_GONE"||t==="HOLD_GONE"?{line:"that change isn't in this review anymore, so nothing was done"}:{line:"that change can't be taken, so nothing was done",next:[`if this keeps failing, share this id with support: ${p(`refused_${t}`)}`]},chatRefused:e=>{let t=[];for(let n of e){let i=n.ref?`${u(n.ref)}${n.title?` "${n.title}"`:""}`:null;n.code==="EXPECTED_CID_MOVED"&&i?n.moved?t.push(`${i} changed after the agent read it, so this edit wasn't made`,"continue, and the agent works from its latest version"):t.push(`the agent's edit to ${i} didn't match it as it is now, so it wasn't made`,"continue, and the agent reads it again"):t.push("continue, and the agent tries again",`if this keeps failing, share this id with support: ${p(`refused_${n.code}`)}`)}return[...new Set(t)]},approveRefused:e=>{let t=e.find(n=>n.code==="EXPECTED_CID_MOVED"&&n.ref);return t?{line:`${`${u(t.ref)}${t.title?` "${t.title}"`:""}`} changed after it was shown to you, so nothing was approved`,notes:['view what was added to see it as it is now, then pick "looks good" again']}:{line:"that didn't go through, so nothing was approved",notes:['pick "looks good" again',`if this keeps failing, share this id with support: ${p(`refused_${e[0]?.code??"APPROVE"}`)}`]}},diffSummary:e=>{let t=e.filter(s=>s.field==="criteria"),n=Math.max(t.filter(s=>s.op==="+").length,t.filter(s=>s.op==="-").length),i=[...new Set(e.filter(s=>s.field!=="criteria").map(s=>s.field))],r=i.length>0?`its ${i.join(" and ")}`:null,o=n>0?`${n} acceptance ${n===1?"criterion":"criteria"} changed`:null;return o&&r?`${o}, and ${r}`:o??`${r} changed`},steering:"reading the change again, with your words",steerNothing:"your words left nothing to review",steerFailed:"that didn't go through; the changes wait as they were",offerAsks:e=>e>0?"design its tests again?":"design its tests?",notLanded:"that didn't go through; try the card again",offer:(e,t)=>t>0?{headline:t===1?`the test of "${e}" was designed for its old version`:`the ${t} tests of "${e}" were designed for its old version`,rows:[{key:"run",label:t===1?"design it again now":"design them again now",detail:t===1?"replaces it if it no longer fits":"replaces any that no longer fit"},{key:"later",label:"later",detail:`kane-cli context list --stale lists ${t===1?"it":"them"}`}]}:{headline:`"${e}" has no tests yet`,rows:[{key:"run",label:"design its tests now"},{key:"later",label:"later",detail:"design them after you save"}]},childOpen:(e,t)=>`designing the tests of "${t}"${e==="evolve"?" again":""}`,childClosed:(e,t,n)=>[`designed the tests of "${t}"${e==="evolve"?" again":""}`,n.join(" \xB7 ")].filter(Boolean).join(" \u2014 "),childTests:(e,t)=>`${l(t)}${e==="evolve"?"":" added"}`,back:e=>`back to the review \u2014 ${l(e)} added in this session`,againBack:e=>{let t=(a,h)=>a===1?`its test ${h}`:`its ${a} tests ${h}`,i=[e.replaced.scenarios+e.replaced.tests>0&&"replaced",e.updated>0&&"updated",e.kept>0&&"kept"].filter(a=>a!==!1);if(i.length===0)return null;let r=`${[...e.replaced.scenarios>0?[k(e.replaced.scenarios)]:[],...e.replaced.tests>0?[l(e.replaced.tests)]:[]].join(" and ")} replaced`;if(i.length===1)return`back to the review \u2014 ${i[0]==="replaced"?e.replaced.scenarios===0?t(e.replaced.tests,"replaced"):r:i[0]==="updated"?t(e.updated,"updated"):e.kept===1?"its test kept as it was":`its ${e.kept} tests kept as they were`}`;let o=[],s=0;return i.forEach((a,h)=>{let b=h===i.length-1;if(a==="replaced"){o.push(r),s+=e.replaced.tests;return}let g=a==="updated"?e.updated:e.kept;b?o.push(s>0?`the other ${g===1?"test":`${g} tests`} ${a}`:t(g,a)):(o.push(`${l(g)} ${a}`),s+=g)}),`back to the review \u2014 ${o.join(", ")}`},childUnfinished:e=>e==="evolve"?"designing its tests again didn't finish":"designing its tests didn't finish",childFailed:(e,t)=>`couldn't design the tests of "${t}"${e==="evolve"?" again":""}`,childFailedNext:(e,t)=>t==="evolve"?["next: to update them later, run:",` kane-cli maintain evolve ${e}`]:["next: to design its tests later, run:",` kane-cli design tests --use-case ${e}`],childFailedNew:"its tests can be designed after you save this session",updateOpen:(e,t)=>`updating the tests of "${e}"${t?" \u2014 its use-case changed":""}`,updateClosed:(e,t)=>[`updated the tests of "${e}"`,t.join(" \xB7 ")].filter(Boolean).join(" \u2014 "),updateTests:e=>[...e.added>0?[`${l(e.added)} added`]:[],...$({changes:{tests:e.updated}})].join(", ")||null,updateUnfinished:e=>`updating the tests of "${e}" didn't finish`,updateFinishing:"finishing the update\u2026",updateFailed:e=>`couldn't update the tests of "${e}"`,updateUntouched:e=>`finished here: the tests of "${e}" weren't changed`,childHeld:(e,t)=>[{text:` \u2717 its tests can't be designed again now: ${e?"you're designing them in another session":"someone else is designing them"}`},{text:" the change stays approved in this session; to update its tests later, run:",dim:!0},{text:` kane-cli maintain evolve ${t}`,dim:!0}]},l=e=>e===1?"1 test":`${e} tests`,k=e=>e===1?"1 scenario":`${e} scenarios`;function S(e){return/^\S+-\d+ · (.+)$/.exec(e.title)?.[1]??e.title}export{c as a,y as b,j as c,D as d,m as e,O as f,S as g};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as d}from"./chunk-73ZFOJOK.js";import{a as m}from"./chunk-EF47KRUK.js";import{da as u}from"./chunk-UEE3RZN4.js";function h(e,r){return`${e}:hold:${r}`}function g(e,r){let n=[],o=[];for(let i of e.use_cases){let c=i.matches_existing;c?.cid&&r.hasNode(c.cid)?n.push({ref:c.cid,expectedTip:r.tipOf(c.cid)}):o.push({tempRef:i.temp_ref,title:String(i.title??""),probeText:String(i.title??"")})}return{verb:"extract",ucTargets:n,newBuCandidates:o,sourcePins:[{source_id:e.source.source_id,source_cid:e.source.source_cid}],readBasis:e.read_basis??null}}async function b(e){let r=d(e.proposal),n=t=>r.passthrough.use_cases.filter(a=>{let l=a.matches_existing?.cid,s=l?t.resolve(l):null,p=s?t.tipOf(s.cid):null;return p!=null&&(e.matchUnreviewed===!0||(t.trust.get(p)??null)!=="derived")}),o=n(e.graph),i=new Set(o.map(t=>t.temp_ref));return{ok:(await m(e.ctx,{...g({...r.passthrough,use_cases:o},e.graph),eventIds:[h(e.sid,e.proposalId)]},t=>{let a={...r.passthrough,use_cases:n(t.graph).filter(p=>i.has(p.temp_ref))},l=new Map(a.use_cases.map(p=>[p.temp_ref,{resolution:"approved"}])),s=u({store:e.store,graph:t.graph,scope:t.scope,proposal:a,proposalId:e.proposalId,verdicts:l,by:e.by,autoName:!0,allowStaleBasis:!0,eventIds:t.eventIds("extract",1),...e.durable?{sid:t.sid}:{},probeHits:t.probeHits,...e.matchUnreviewed?{matchUnreviewed:!0}:{}});return s.errors!==null?{errors:s.errors}:{result:s,record:s.record}})).ok,skippedAttach:r.passthrough.use_cases.length-o.length}}export{h as a,g as b,b as c};
|