@testmuai/kane-cli 0.10.2 → 0.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ChatSurface-DN7VVN3Y.js +2 -0
- package/dist/ChromeProfilePicker-TVGWXTUU.js +2 -0
- package/dist/{CliFeedbackPrompt-2NV2G65E.js → CliFeedbackPrompt-L5ILK66U.js} +1 -1
- package/dist/{CliUploadProgress-JZ5FXODE.js → CliUploadProgress-IU6BQLMV.js} +1 -1
- package/dist/{ConfigView-TZ4YINOE.js → ConfigView-LU5IRRQU.js} +1 -1
- package/dist/EvidenceViewOffer-DNTARDEL.js +2 -0
- package/dist/FolderPicker-6E5GE2K2.js +2 -0
- package/dist/InfoBox-SFFPLWCV.js +2 -0
- package/dist/LinksBox-6YDTIO6I.js +2 -0
- package/dist/ProfilesView-6C5HJQ3Y.js +2 -0
- package/dist/ProjectPicker-YIQIVXGK.js +2 -0
- package/dist/SaveSessionPrompt-X3N6OGYB.js +2 -0
- package/dist/SingleShotApp-MXNJPU6A.js +2 -0
- package/dist/SummaryBox-T7PDXDKS.js +2 -0
- package/dist/TestMdRunView-HRJSBP2C.js +2 -0
- package/dist/TestrunEvidenceTable-OGMWTJQF.js +2 -0
- package/dist/{WhoamiView-4XIJXMTU.js → WhoamiView-WGCWD7GP.js} +1 -1
- package/dist/{app-client-U2YYF65L.js → app-client-2RR5ATI6.js} +1 -1
- package/dist/app-download-ZS6ZMX2Z.js +2 -0
- package/dist/{assurance-job-MD65GQLC.js → assurance-job-QO4VJJCL.js} +1 -1
- package/dist/{binary-NVYLR36K.js → binary-CCCTW3QQ.js} +1 -1
- package/dist/bind-JU4XPDN3.js +2 -0
- package/dist/bootstrap-BV7HAARR.js +2 -0
- package/dist/{bridge-2UHJOVLX.js → bridge-SPGIYAAG.js} +1 -1
- package/dist/{catalog-5UYBWA4W.js → catalog-ZAROGOJA.js} +1 -1
- package/dist/{catalog-client-VVKV4JKW.js → catalog-client-QLHCEPPZ.js} +1 -1
- package/dist/{changelog-FPWJXERY.js → changelog-6L7W76ZH.js} +1 -1
- package/dist/chat-committer-7E3TRZ6P.js +2 -0
- package/dist/chat-controller-5ZBG23L6.js +2 -0
- package/dist/child-MNLSG77W.js +2 -0
- package/dist/{chunk-3V4J65GN.js → chunk-2CJ75THZ.js} +1 -1
- package/dist/{chunk-UWPG5MWM.js → chunk-2EKLTUY2.js} +1 -1
- package/dist/{chunk-I52NWH4U.js → chunk-2KPJ62RZ.js} +3 -3
- package/dist/{chunk-UCVP7ZY4.js → chunk-2VLM4L3S.js} +1 -1
- package/dist/{chunk-ZHAMVLQZ.js → chunk-3A4KK22B.js} +1 -1
- package/dist/{chunk-L3BUPFAQ.js → chunk-3CFAE36M.js} +1 -1
- package/dist/{chunk-TU2KPOW2.js → chunk-3DFBFYTD.js} +2 -2
- package/dist/{chunk-IT5JVCZN.js → chunk-3HGKFRFL.js} +1 -1
- package/dist/{chunk-XNXJXGVB.js → chunk-3JATEWA5.js} +2 -2
- package/dist/{chunk-2QKBXRLI.js → chunk-3O2RPYPM.js} +1 -1
- package/dist/chunk-3UY4WPMQ.js +8 -0
- package/dist/{chunk-HM6LZ2KM.js → chunk-3VSAAB2W.js} +1 -1
- package/dist/{chunk-IB5WG5YY.js → chunk-454IWKHT.js} +1 -1
- package/dist/{chunk-ZMWTRXFH.js → chunk-4DRFMDAW.js} +1 -1
- package/dist/{chunk-JUVY6PHY.js → chunk-4FA44D6S.js} +1 -1
- package/dist/{chunk-XHFU5TGS.js → chunk-4G2T54FE.js} +1 -1
- package/dist/{chunk-C6P6YUCR.js → chunk-4KFSSETE.js} +1 -1
- package/dist/chunk-4QV2RL6P.js +34 -0
- package/dist/{chunk-7ZR5CQY3.js → chunk-4WFN23DE.js} +1 -1
- package/dist/{chunk-GQARXS6F.js → chunk-4WKFM72U.js} +1 -1
- package/dist/{chunk-EEOAU43D.js → chunk-55W3WAAL.js} +1 -1
- package/dist/{chunk-GT3JDX5H.js → chunk-56NUPYFG.js} +1 -1
- package/dist/{chunk-PI7OXS62.js → chunk-5EAJO372.js} +1 -1
- package/dist/{chunk-P4VFC6HO.js → chunk-5HJRYEOT.js} +1 -1
- package/dist/{chunk-B226SFOV.js → chunk-5OGYXLOR.js} +1 -1
- package/dist/{chunk-CQDCNP7V.js → chunk-5ORBAYTU.js} +1 -1
- package/dist/{chunk-KKLCXRW6.js → chunk-642LB5R2.js} +1 -1
- package/dist/{chunk-X3A4QPA3.js → chunk-662MCICY.js} +1 -1
- package/dist/{chunk-2GEAKFAV.js → chunk-6CMBA5SG.js} +1 -1
- package/dist/{chunk-X6FCXBXU.js → chunk-6FVGPKVX.js} +1 -1
- package/dist/{chunk-32HED7X2.js → chunk-6KUUSONE.js} +1 -1
- package/dist/{chunk-IH73ZCBB.js → chunk-6PURZLKM.js} +1 -1
- package/dist/{chunk-FI2DVNRT.js → chunk-73EHVDL5.js} +1 -1
- package/dist/{chunk-MSYRAPDK.js → chunk-7KASYSFM.js} +1 -1
- package/dist/{chunk-QVMXL675.js → chunk-7V6JPZBM.js} +1 -1
- package/dist/{chunk-H4TIVILC.js → chunk-7WWCIS2B.js} +1 -1
- package/dist/{chunk-OVNTCBNS.js → chunk-A74JRNNX.js} +1 -1
- package/dist/{chunk-ENRFXGID.js → chunk-ABAUIIPD.js} +1 -1
- package/dist/{chunk-HG2ILWCE.js → chunk-ABNQL3PQ.js} +1 -1
- package/dist/{chunk-EAWU2TOG.js → chunk-ACBNVGVJ.js} +1 -1
- package/dist/{chunk-4NEPHIAO.js → chunk-AFOP7DVG.js} +1 -1
- package/dist/{chunk-JTNEF5ZP.js → chunk-AL6IAMYV.js} +1 -1
- package/dist/chunk-APXJRWIJ.js +2 -0
- package/dist/{chunk-W2HRX3DR.js → chunk-ATCJ7EHL.js} +1 -1
- package/dist/{chunk-IZ66FKPC.js → chunk-BIGOLVK6.js} +1 -1
- package/dist/{chunk-PR5EGLEI.js → chunk-BIXABKSK.js} +1 -1
- package/dist/chunk-BK3LWNKB.js +102 -0
- package/dist/{chunk-3YIA3DSL.js → chunk-BPTWMV5L.js} +1 -1
- package/dist/{chunk-LXCTV75T.js → chunk-BV7NUIRT.js} +1 -1
- package/dist/{chunk-K4K2BGQC.js → chunk-BXAPTB2H.js} +3 -3
- package/dist/{chunk-X7S7IGCV.js → chunk-BXJNL22L.js} +1 -1
- package/dist/{chunk-Z24SD2EJ.js → chunk-C3DMMAFP.js} +1 -1
- package/dist/chunk-CBEMXSWF.js +2 -0
- package/dist/{chunk-YO6SNXBJ.js → chunk-CVVZ6NWR.js} +1 -1
- package/dist/{chunk-45NM23EQ.js → chunk-DAV4ONGS.js} +3 -3
- package/dist/{chunk-AUSLHNXQ.js → chunk-DBMDAWTA.js} +1 -1
- package/dist/{chunk-HWPWCCEV.js → chunk-DJ76NDW6.js} +1 -1
- package/dist/{chunk-O3TXAMFW.js → chunk-DRWHVVW6.js} +1 -1
- package/dist/{chunk-OKA6FPJM.js → chunk-DXXHCLFC.js} +1 -1
- package/dist/{chunk-35BG2EMW.js → chunk-E3C4OWSD.js} +1 -1
- package/dist/{chunk-V3OZJO7Y.js → chunk-ECPSBI2Z.js} +1 -1
- package/dist/{chunk-M7Y5GGVJ.js → chunk-EG3B52WU.js} +1 -1
- package/dist/{chunk-GZQAETB2.js → chunk-EOLMWSLX.js} +1 -1
- package/dist/{chunk-GAKBHNC4.js → chunk-EUGFABAS.js} +1 -1
- package/dist/{chunk-UMNCM4RJ.js → chunk-EWK3UPEN.js} +2 -2
- package/dist/{chunk-VE4HLIGA.js → chunk-EWSNJ3IX.js} +1 -1
- package/dist/chunk-F2F257PU.js +6 -0
- package/dist/{chunk-SALZ6WSF.js → chunk-F4XCCOWC.js} +1 -1
- package/dist/{chunk-2COXO5LQ.js → chunk-FH4FWIET.js} +1 -1
- package/dist/chunk-FQ2AMM3E.js +3 -0
- package/dist/{chunk-5KJU4MG4.js → chunk-FTP2K6RS.js} +1 -1
- package/dist/{chunk-UICJ2KLJ.js → chunk-GJYMR4RT.js} +1 -1
- package/dist/{chunk-226AGYHB.js → chunk-GMSWZIAS.js} +1 -1
- package/dist/{chunk-ABMM37L2.js → chunk-GPIVYCHQ.js} +1 -1
- package/dist/{chunk-ZDCXWEQG.js → chunk-GRQKMOKE.js} +1 -1
- package/dist/{chunk-E4GIGM5V.js → chunk-H6IPGZTP.js} +1 -1
- package/dist/{chunk-6JUS2ULI.js → chunk-H6QHG62O.js} +1 -1
- package/dist/{chunk-MINDIQET.js → chunk-HBGYEA3O.js} +1 -1
- package/dist/{chunk-PEUIHME2.js → chunk-HGKAUG7L.js} +1 -1
- package/dist/{chunk-A474TUCE.js → chunk-HMGM4KO6.js} +1 -1
- package/dist/{chunk-5F44KH3R.js → chunk-I3G3IUKY.js} +1 -1
- package/dist/{chunk-MP6NCJFE.js → chunk-IDWAG6L4.js} +1 -1
- package/dist/{chunk-TM6VLC6V.js → chunk-IPIARGHE.js} +1 -1
- package/dist/chunk-IQMJJN52.js +3 -0
- package/dist/{chunk-WEJR2V7R.js → chunk-J3XOEMKO.js} +1 -1
- package/dist/{chunk-GJXO6FF7.js → chunk-JBUKEIYL.js} +1 -1
- package/dist/{chunk-6SWHEBPR.js → chunk-JE5M5QIK.js} +1 -1
- package/dist/{chunk-6YBH3WUW.js → chunk-JJDD4HPX.js} +1 -1
- package/dist/{chunk-HX5OLRKU.js → chunk-JM45SLKV.js} +2 -2
- package/dist/{chunk-GEZVC4S3.js → chunk-JM6AKCN4.js} +1 -1
- package/dist/{chunk-3KY7HHQU.js → chunk-JSSM2TWY.js} +1 -1
- package/dist/{chunk-XCUF5AVM.js → chunk-JYSIPTX3.js} +10 -9
- package/dist/{chunk-5WLXAQ4H.js → chunk-KJZD2ADR.js} +1 -1
- package/dist/chunk-KLY6IQD5.js +26 -0
- package/dist/{chunk-LTPOMMAB.js → chunk-LB5NIDW6.js} +1 -1
- package/dist/{chunk-5MFPQYW3.js → chunk-LCBDNZL3.js} +1 -1
- package/dist/{chunk-SIHX5FW5.js → chunk-LJKTIKZY.js} +1 -1
- package/dist/{chunk-RDAIOJCR.js → chunk-LLDEAV3W.js} +1 -1
- package/dist/{chunk-HHOVANJ7.js → chunk-LV7OWLJK.js} +1 -1
- package/dist/{chunk-7DLDADQR.js → chunk-MNELOQ4J.js} +1 -1
- package/dist/{chunk-QUNIY6NN.js → chunk-MOAZZKIZ.js} +1 -1
- package/dist/{chunk-ET5EK2CM.js → chunk-MQU6EA44.js} +1 -1
- package/dist/chunk-MTMHB5LF.js +2 -0
- package/dist/{chunk-QB77LRF4.js → chunk-MWLRLQ27.js} +1 -1
- package/dist/{chunk-XZ6J3Y2W.js → chunk-MZ4GTIO2.js} +1 -1
- package/dist/chunk-NKJRAQ6L.js +6 -0
- package/dist/{chunk-75FF7J5R.js → chunk-NMCE7VR2.js} +1 -1
- package/dist/{chunk-7V34ZMMS.js → chunk-OKCVG7AG.js} +1 -1
- package/dist/{chunk-LZGAFKYH.js → chunk-OMCJD4LH.js} +1 -1
- package/dist/{chunk-54NJJVG5.js → chunk-OSEXVHEN.js} +1 -1
- package/dist/{chunk-EZMRWXRT.js → chunk-OVB5GVRB.js} +1 -1
- package/dist/{chunk-M3TFOFUQ.js → chunk-OX3ZAGCH.js} +1 -1
- package/dist/{chunk-73HMW2WA.js → chunk-P43YHCF3.js} +1 -1
- package/dist/{chunk-Z6SI7YNV.js → chunk-P7V24ZXP.js} +1 -1
- package/dist/{chunk-TMH4TPMB.js → chunk-PBVNX43X.js} +1 -1
- package/dist/{chunk-MEMXFTLD.js → chunk-PEHVBCXM.js} +1 -1
- package/dist/{chunk-2ULYGALF.js → chunk-PHKJIJ7D.js} +1 -1
- package/dist/{chunk-ZO3ZAMUU.js → chunk-PMYN3XMN.js} +2 -2
- package/dist/{chunk-R6TFRAMZ.js → chunk-PUNFWBRW.js} +1 -1
- package/dist/chunk-Q5B54TR5.js +2 -0
- package/dist/{chunk-ZDQYGLCZ.js → chunk-QEBVYQNC.js} +1 -1
- package/dist/{chunk-D4QXYAYA.js → chunk-QFA6JPVE.js} +2 -2
- package/dist/{chunk-TAY7J5VS.js → chunk-QLGQDNA3.js} +1 -1
- package/dist/{chunk-S7XCOBYD.js → chunk-QOXUGYEA.js} +1 -1
- package/dist/{chunk-BHQIH2FE.js → chunk-QXZGBYGQ.js} +1 -1
- package/dist/{chunk-LWCP4GLY.js → chunk-QYWWL7M7.js} +5 -5
- package/dist/{chunk-PWNYTIVA.js → chunk-RG3FNO37.js} +1 -1
- package/dist/{chunk-4HYPMGDF.js → chunk-RNKJXVG2.js} +1 -1
- package/dist/{chunk-RRKYHUOD.js → chunk-S5PIVHPC.js} +1 -1
- package/dist/{chunk-POA336CU.js → chunk-S74NLCFZ.js} +1 -1
- package/dist/chunk-SB26HQO7.js +2 -0
- package/dist/chunk-SBW3QVHN.js +7 -0
- package/dist/{chunk-44SIFDNY.js → chunk-SMSQVGLH.js} +1 -1
- package/dist/{chunk-4HARMERK.js → chunk-SO3IXFAJ.js} +1 -1
- package/dist/{chunk-T77LTLAD.js → chunk-SULRMI2J.js} +1 -1
- package/dist/{chunk-KN7GZWKK.js → chunk-SZQNYDST.js} +1 -1
- package/dist/chunk-T5FQRUI2.js +47 -0
- package/dist/{chunk-HVOXMCKE.js → chunk-TCK7WR3M.js} +1 -1
- package/dist/{chunk-Q5AKIQIE.js → chunk-TELSHQ3W.js} +1 -1
- package/dist/{chunk-FOLUB336.js → chunk-TFSWG7AS.js} +1 -1
- package/dist/{chunk-GJ7MO2FW.js → chunk-TLYFHPNM.js} +2 -2
- package/dist/{chunk-7O2FIZB7.js → chunk-TO2ROHIJ.js} +4 -4
- package/dist/{chunk-PRBWZXFA.js → chunk-TOOJTCON.js} +6 -6
- package/dist/{chunk-NCP54AIQ.js → chunk-TXRWH6HL.js} +2 -2
- package/dist/chunk-U5V3L5QH.js +2 -0
- package/dist/{chunk-O5KTMDTH.js → chunk-UVBPUZC4.js} +1 -1
- package/dist/{chunk-23DKB2MT.js → chunk-UVL6XQHU.js} +1 -1
- package/dist/{chunk-FYPIF3BE.js → chunk-UZKVV3LW.js} +1 -1
- package/dist/{chunk-YDB72F4K.js → chunk-V4SL74TK.js} +1 -1
- package/dist/chunk-V57R4X3O.js +5 -0
- package/dist/{chunk-LLQWEGXD.js → chunk-W5EDS4DF.js} +1 -1
- package/dist/{chunk-ZZZGTDYE.js → chunk-WB4JZ67W.js} +1 -1
- package/dist/{chunk-W54BX6HC.js → chunk-WCIRLITM.js} +1 -1
- package/dist/{chunk-BJT6PZXL.js → chunk-WHMCVH3T.js} +1 -1
- package/dist/chunk-WLEWXE6L.js +2 -0
- package/dist/{chunk-4LGQHTXM.js → chunk-WMIR4UXG.js} +1 -1
- package/dist/chunk-WMXBRC4B.js +21 -0
- package/dist/{chunk-RQKMSNEU.js → chunk-WTMCDYR3.js} +1 -1
- package/dist/{chunk-DXIQVBMI.js → chunk-WZ3FE5MT.js} +1 -1
- package/dist/{chunk-NVD2MXHQ.js → chunk-X3O4VGTM.js} +1 -1
- package/dist/{chunk-GLM5UGTF.js → chunk-X66NIHT4.js} +1 -1
- package/dist/{chunk-B7ZX5HEN.js → chunk-XDAFRUAJ.js} +1 -1
- package/dist/{chunk-JNPFEBUR.js → chunk-XDAHKZ4J.js} +1 -1
- package/dist/{chunk-ZCL7XIVS.js → chunk-XKJZG4GR.js} +1 -1
- package/dist/chunk-XTQUCCJH.js +2 -0
- package/dist/{chunk-SVIIUKJ2.js → chunk-Y7GSOKXS.js} +1 -1
- package/dist/chunk-YIBLZIXF.js +13 -0
- package/dist/{chunk-FAMQ4DHU.js → chunk-YKOZBFR3.js} +1 -1
- package/dist/{chunk-K75WIRI5.js → chunk-YWQNZRJG.js} +1 -1
- package/dist/chunk-YZP4F23B.js +18 -0
- package/dist/{chunk-HNF3PWF3.js → chunk-Z4O5HOFX.js} +6 -6
- package/dist/{chunk-6CS23F3E.js → chunk-ZFKR5I3J.js} +1 -1
- package/dist/{chunk-OK6NLITG.js → chunk-ZHENGHYZ.js} +1 -1
- package/dist/{chunk-SSOUYKVG.js → chunk-ZIRSTOEV.js} +1 -1
- package/dist/{chunk-A7IMHUFY.js → chunk-ZVSZ6DIQ.js} +5 -5
- package/dist/command-span-HZSKIZH7.js +2 -0
- package/dist/commands-X5T6YANK.js +2 -0
- package/dist/{committer-UO3B3S5Y.js → committer-L2HXEODA.js} +1 -1
- package/dist/{config-YMHI3H3Y.js → config-F5Q6QX27.js} +1 -1
- package/dist/cover-cmd-PWUZU4HK.js +2 -0
- package/dist/{credentials-BCR73VGS.js → credentials-D5KQMHCK.js} +1 -1
- package/dist/{deps-bundle-6WLX44OA.js → deps-bundle-R7FNIV4M.js} +1 -1
- package/dist/{deps-resolve-DSAKPZ3T.js → deps-resolve-IF6P6NWI.js} +1 -1
- package/dist/design-chat-HYK3HNIM.js +2 -0
- package/dist/{design-committer-7YIPFKMO.js → design-committer-ZKNW5LUS.js} +1 -1
- package/dist/design-headless-DR7WB37W.js +2 -0
- package/dist/design-remote-TGUNEWEM.js +3 -0
- package/dist/device-env-LZB3PKMA.js +2 -0
- package/dist/dispatch-BGH5PVZ4.js +2 -0
- package/dist/doctor-PLFEA2HM.js +2 -0
- package/dist/{docx-convert-DO5AQYD3.js → docx-convert-PA5S2S7P.js} +1 -1
- package/dist/{dossier-5XKNAK6Q.js → dossier-B6KBSRJY.js} +1 -1
- package/dist/evidence-SRWISQMQ.js +2 -0
- package/dist/evolve-cmd-2BALEYZU.js +2 -0
- package/dist/evolve-remote-OHOUWO65.js +2 -0
- package/dist/exit-manager-UZ7DGXS4.js +2 -0
- package/dist/{explain-cmd-KNDORU2D.js → explain-cmd-A5YMPXAJ.js} +1 -1
- package/dist/explain-cmd-VTDAMXAW.js +12 -0
- package/dist/explore-UZWQRJ7H.js +2 -0
- package/dist/explore-context-tty-PAKJVDJU.js +2 -0
- package/dist/explore-entry-ZOPO7DBZ.js +6 -0
- package/dist/{explore-live-TRY5A2ME.js → explore-live-RUAAZGX4.js} +1 -1
- package/dist/{explore-run-tty-ZV5XFKZA.js → explore-run-tty-DYLMHI7F.js} +2 -2
- package/dist/{extract-bind-TXUBMK3T.js → extract-bind-WPICR4IC.js} +3 -3
- package/dist/extract-chat-KVUB5HPM.js +2 -0
- package/dist/{extract-cmd-YUOYMVF5.js → extract-cmd-OJ7LXSKL.js} +2 -2
- package/dist/extract-headless-OQJSUSG4.js +2 -0
- package/dist/{feeder-NGWIPZ26.js → feeder-VAY4NYBX.js} +1 -1
- package/dist/folder-flags-MEZUAXTT.js +2 -0
- package/dist/gaps-cmd-2R4RMWN6.js +3 -0
- package/dist/gate-SM4HPJLA.js +2 -0
- package/dist/gate-VJ7W5QIH.js +2 -0
- package/dist/{generate-headless-KMBBZTLS.js → generate-headless-XR3RVULC.js} +3 -3
- package/dist/hold-passthrough-ZHOC2Q26.js +2 -0
- package/dist/identity-66TGWITQ.js +2 -0
- package/dist/{impact-cmd-PW33L5RF.js → impact-cmd-EL3QSOAF.js} +2 -2
- package/dist/index.js +185 -179
- package/dist/ingest-6UQGSQYU.js +2 -0
- package/dist/ingest-cmd-N3USC7TW.js +8 -0
- package/dist/ingest-remote-2VKWAFJZ.js +2 -0
- package/dist/install-3IEM3I3X.js +2 -0
- package/dist/{interactive-bind-FDWJUTI6.js → interactive-bind-F7QTQOKC.js} +4 -4
- package/dist/{interactive-remote-O2Q2FNOH.js → interactive-remote-A33J4KMP.js} +2 -2
- package/dist/lane-EHU4JRRU.js +2 -0
- package/dist/lattice-auth-IJT542IF.js +2 -0
- package/dist/lifecycle-cmd-OKUFZKEX.js +2 -0
- package/dist/list-cmd-7OTI66MQ.js +3 -0
- package/dist/list-commands-FZPVH76I.js +2 -0
- package/dist/{list-remote-AA3VSWOI.js → list-remote-BQ4NILCA.js} +1 -1
- package/dist/{locks-cmd-AZKCSGHI.js → locks-cmd-76IU4JB7.js} +1 -1
- package/dist/{logical-ids-74PLU3VR.js → logical-ids-YMNV2MDB.js} +1 -1
- package/dist/login-flow-BYQ7SYGB.js +2 -0
- package/dist/maintenance-cmd-BLV7K4RK.js +2 -0
- package/dist/mobile-prompts-5TGLJUBV.js +2 -0
- package/dist/onboarding-F4EIJ4GD.js +5 -0
- package/dist/open-provider-LXCPVNUU.js +2 -0
- package/dist/{pdf-convert-YB6PJFMI.js → pdf-convert-N2C3KB4Q.js} +1 -1
- package/dist/persist-recorded-session-WYMOHDTB.js +3 -0
- package/dist/phase-seed-G5JSYKSL.js +2 -0
- package/dist/pipeline-XYM6HIDZ.js +2 -0
- package/dist/{policy-commands-3YJ6YCDN.js → policy-commands-AOLVAZZD.js} +1 -1
- package/dist/prepare-target-P4AZWC37.js +2 -0
- package/dist/pull-cmd-C4HMYD4I.js +2 -0
- package/dist/pull-route-MHW5PWDW.js +2 -0
- package/dist/readmodel-FARAAPUU.js +2 -0
- package/dist/real-device-run-WAOWKEFJ.js +2 -0
- package/dist/reconcile-cmd-VXY737OT.js +5 -0
- package/dist/reconcile-deps-TILDRCHG.js +2 -0
- package/dist/{reconcile-remote-6WISFGRG.js → reconcile-remote-UGW2433E.js} +2 -2
- package/dist/recording-banner-EPOTSMYF.js +2 -0
- package/dist/registry-WTWTFRXD.js +2 -0
- package/dist/remote-entry-SPA4CSJJ.js +2 -0
- package/dist/remote-mode-QO6BDGXM.js +4 -0
- package/dist/remote-words-TAZT4YBT.js +2 -0
- package/dist/{require-project-folder-ZK4JJCDB.js → require-project-folder-WBCAVVMB.js} +1 -1
- package/dist/resolve-run-intent-RBOCIYEA.js +2 -0
- package/dist/{resolver-RMHGGYRP.js → resolver-3BGIXYYJ.js} +1 -1
- package/dist/revert-F6MKJ73M.js +2 -0
- package/dist/review-cmd-WE6I5XTY.js +5 -0
- package/dist/run-EABFRFOF.js +2 -0
- package/dist/run-LX3ARF53.js +2 -0
- package/dist/run-remote-6Y62RWMJ.js +2 -0
- package/dist/run-startup-gate-Q7FP2IRE.js +2 -0
- package/dist/run-test-md-24MBKBC6.js +20 -0
- package/dist/session-worker.js +2 -2
- package/dist/{sessions-cmd-CABAX7BO.js → sessions-cmd-5NS5P4CP.js} +2 -2
- package/dist/{sessions-remote-Y4FTZL7Y.js → sessions-remote-75PDRPOY.js} +1 -1
- package/dist/{skill-installer-FS2AV7GX.js → skill-installer-7PK64TZE.js} +1 -1
- package/dist/store-AVYBL5HB.js +2 -0
- package/dist/store-choice-ZWU3PDNL.js +2 -0
- package/dist/store-guard-ETUXXG7X.js +2 -0
- package/dist/{store-site-K5NHLI7D.js → store-site-AFXB6SBW.js} +1 -1
- package/dist/{stream-warnings-GM7YEOVG.js → stream-warnings-I5LUWVFU.js} +1 -1
- package/dist/support-id-RISKXA53.js +2 -0
- package/dist/sync-cmd-CSTMT6E6.js +2 -0
- package/dist/sync-setup-Y53K6TJ6.js +2 -0
- package/dist/tcg-generate-VQLI6NGK.js +2 -0
- package/dist/{test-definition-53XNBEDE.js → test-definition-GXEKFRRB.js} +1 -1
- package/dist/testmd-actions-BE4YJ6ZZ.js +2 -0
- package/dist/{testmd-sync-EEJ7GPLR.js → testmd-sync-QZWVWTZZ.js} +1 -1
- package/dist/{tms-client-XWCR7O7J.js → tms-client-J4OCD3EP.js} +1 -1
- package/dist/token-refresh-PZ3TOKAL.js +2 -0
- package/dist/{use-case-ref-44BPIP4N.js → use-case-ref-E3PJDHQB.js} +1 -1
- package/dist/{validate-basic-3JZRZL45.js → validate-basic-QWPESO74.js} +1 -1
- package/dist/verdicts-KB6YTIY6.js +2 -0
- package/dist/{version-check-IY3YSQIP.js → version-check-EOYWTY3Z.js} +1 -1
- package/dist/{view-cmd-WUIGTRFX.js → view-cmd-KG4HI334.js} +1 -1
- package/dist/walk-session-WM4S2JMV.js +2 -0
- package/dist/with-telemetry-RJM3JKL6.js +2 -0
- package/package.json +11 -11
- package/dist/ChatSurface-FIYDTZSI.js +0 -2
- package/dist/ChromeProfilePicker-Q6FIGVYU.js +0 -2
- package/dist/EvidenceViewOffer-LKPN5BHX.js +0 -2
- package/dist/FolderPicker-H5K74PCH.js +0 -2
- package/dist/InfoBox-DNSOAK5L.js +0 -2
- package/dist/LinksBox-32TZOANP.js +0 -2
- package/dist/ProfilesView-UC4MPM54.js +0 -2
- package/dist/ProjectPicker-ZJ5RW6XL.js +0 -2
- package/dist/SaveSessionPrompt-F327WC7A.js +0 -2
- package/dist/SingleShotApp-OMLRYOSI.js +0 -2
- package/dist/SummaryBox-XGFO5X76.js +0 -2
- package/dist/TestMdRunView-ZZ77QTAQ.js +0 -2
- package/dist/TestrunEvidenceTable-G7MPF55X.js +0 -2
- package/dist/app-download-XEDO3EMV.js +0 -2
- package/dist/bind-H3ALI2NG.js +0 -2
- package/dist/bootstrap-JEVSVPQ2.js +0 -2
- package/dist/chat-committer-ZKEKJA2R.js +0 -2
- package/dist/chat-controller-FXRJXUG3.js +0 -2
- package/dist/child-JHYENXE7.js +0 -2
- package/dist/chunk-5F5IVART.js +0 -8
- package/dist/chunk-6K5BEEAJ.js +0 -2
- package/dist/chunk-6LEHGRRG.js +0 -34
- package/dist/chunk-6SD4XTYC.js +0 -6
- package/dist/chunk-7PCLHURF.js +0 -101
- package/dist/chunk-7XJNYLQW.js +0 -18
- package/dist/chunk-A4ZV2SHL.js +0 -5
- package/dist/chunk-B57ZRHEQ.js +0 -3
- package/dist/chunk-DLP5S3TO.js +0 -3
- package/dist/chunk-DREQ3RAA.js +0 -2
- package/dist/chunk-DXLZCJH5.js +0 -7
- package/dist/chunk-O2Y46A3G.js +0 -26
- package/dist/chunk-PC22QRIY.js +0 -2
- package/dist/chunk-RAVAJZV2.js +0 -47
- package/dist/chunk-SXRHKXSE.js +0 -2
- package/dist/chunk-UJLULWSR.js +0 -21
- package/dist/chunk-VO66KP2W.js +0 -2
- package/dist/chunk-X52YIWGG.js +0 -13
- package/dist/chunk-Y6Y6RAY4.js +0 -2
- package/dist/commands-R5AYK6XM.js +0 -2
- package/dist/cover-cmd-DVQIGFDY.js +0 -2
- package/dist/design-chat-YUI2JPO6.js +0 -2
- package/dist/design-headless-KIP6R7UV.js +0 -2
- package/dist/design-remote-XMSHDDUX.js +0 -3
- package/dist/device-env-K7J5NN66.js +0 -2
- package/dist/dispatch-BV6XMCN3.js +0 -2
- package/dist/doctor-PGTNOMSP.js +0 -2
- package/dist/evidence-RO3RDZXO.js +0 -2
- package/dist/evolve-cmd-U2ALVGMT.js +0 -2
- package/dist/evolve-remote-K2MCCVMM.js +0 -2
- package/dist/exit-manager-EGWAZHCR.js +0 -2
- package/dist/explain-cmd-UWK5YVXG.js +0 -12
- package/dist/explore-S2BGQUIF.js +0 -2
- package/dist/explore-context-tty-WJHUSP3A.js +0 -2
- package/dist/explore-entry-3EX2T3NS.js +0 -6
- package/dist/extract-chat-VPYDGQKO.js +0 -2
- package/dist/extract-headless-UWTAPOET.js +0 -2
- package/dist/folder-flags-WV7UV3JG.js +0 -2
- package/dist/gaps-cmd-PFV3FZCM.js +0 -3
- package/dist/gate-7ALXLCNB.js +0 -2
- package/dist/gate-NB5CJMTN.js +0 -2
- package/dist/hold-passthrough-JGHWMYDM.js +0 -2
- package/dist/identity-HL5CJJXR.js +0 -2
- package/dist/ingest-ZHHHBUXR.js +0 -2
- package/dist/ingest-cmd-MXYILQLV.js +0 -8
- package/dist/ingest-remote-2EEJP6ML.js +0 -2
- package/dist/install-7J34AYB6.js +0 -2
- package/dist/lane-CNGO7LH5.js +0 -2
- package/dist/lattice-auth-TXNDLHM6.js +0 -2
- package/dist/lifecycle-cmd-GFHDBRXX.js +0 -2
- package/dist/list-cmd-RR75PMPE.js +0 -3
- package/dist/list-commands-3QGZWJ5P.js +0 -2
- package/dist/login-flow-ZQ6UFTS2.js +0 -2
- package/dist/maintenance-cmd-OHGVARQ2.js +0 -2
- package/dist/mobile-prompts-FZRKLLTN.js +0 -2
- package/dist/onboarding-NXGMV3VG.js +0 -5
- package/dist/open-provider-XDJKT3W3.js +0 -2
- package/dist/persist-recorded-session-INFN4JZT.js +0 -3
- package/dist/phase-seed-ZZSJME7M.js +0 -2
- package/dist/pipeline-MVZRI6YZ.js +0 -2
- package/dist/prepare-target-DII5WZCX.js +0 -2
- package/dist/pull-cmd-XZN53XFZ.js +0 -2
- package/dist/pull-route-R33BVADE.js +0 -2
- package/dist/readmodel-TRV4E3MW.js +0 -2
- package/dist/real-device-run-DGENHGUV.js +0 -2
- package/dist/reconcile-cmd-KFPRCCJB.js +0 -5
- package/dist/reconcile-deps-UDQBWSLE.js +0 -2
- package/dist/recording-banner-XOX2CDCF.js +0 -2
- package/dist/registry-NV3EMDMK.js +0 -2
- package/dist/remote-entry-BCTFT643.js +0 -2
- package/dist/remote-mode-4HN27MD4.js +0 -4
- package/dist/remote-words-LFDYKIZ7.js +0 -2
- package/dist/resolve-run-intent-LYLVNNDZ.js +0 -2
- package/dist/revert-QKHPCRT6.js +0 -2
- package/dist/review-cmd-UGF2FC5Y.js +0 -5
- package/dist/run-CSYGVV3D.js +0 -2
- package/dist/run-YUHHD54J.js +0 -2
- package/dist/run-remote-BGKQDAOA.js +0 -2
- package/dist/run-startup-gate-4XE73OON.js +0 -2
- package/dist/run-test-md-G6U3RU2Q.js +0 -19
- package/dist/store-PLKJZTGC.js +0 -2
- package/dist/store-choice-UAB6Z4AL.js +0 -2
- package/dist/store-guard-DUN2X3SR.js +0 -2
- package/dist/sync-cmd-AGTOGPYM.js +0 -2
- package/dist/sync-setup-4KIY3PDO.js +0 -2
- package/dist/tcg-generate-CUY4AZ2V.js +0 -2
- package/dist/testmd-actions-UD6PAWUX.js +0 -2
- package/dist/token-refresh-K6PVBBFE.js +0 -2
- package/dist/verdicts-PVB7TV5S.js +0 -2
- package/dist/walk-session-EH7227WR.js +0 -2
- package/dist/with-telemetry-7JMZUBUZ.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as vt}from"./chunk-2RUSXQ3O.js";import{a as Ot,b as Mt}from"./chunk-PGESS7BW.js";import{a as kt}from"./chunk-FWGUISUG.js";import{b as wt}from"./chunk-
|
|
2
|
+
import{a as vt}from"./chunk-2RUSXQ3O.js";import{a as Ot,b as Mt}from"./chunk-PGESS7BW.js";import{a as kt}from"./chunk-FWGUISUG.js";import{b as wt}from"./chunk-5ORBAYTU.js";import{a as Nt,b as Ft,c as St}from"./chunk-GMTHZUZ3.js";import{c as G,e as Rt}from"./chunk-UR6MHSHU.js";var Lt=G(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.CHAR=`
|
|
3
3
|
\r -\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}`;x.S=` \r
|
|
4
4
|
`;x.NAME_START_CHAR=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}";x.NAME_CHAR="-"+x.NAME_START_CHAR+".0-9\xB7\u0300-\u036F\u203F-\u2040";x.CHAR_RE=new RegExp("^["+x.CHAR+"]$","u");x.S_RE=new RegExp("^["+x.S+"]+$","u");x.NAME_START_CHAR_RE=new RegExp("^["+x.NAME_START_CHAR+"]$","u");x.NAME_CHAR_RE=new RegExp("^["+x.NAME_CHAR+"]$","u");x.NAME_RE=new RegExp("^["+x.NAME_START_CHAR+"]["+x.NAME_CHAR+"]*$","u");x.NMTOKEN_RE=new RegExp("^["+x.NAME_CHAR+"]+$","u");var tt=9,et=10,st=13,it=32;x.S_LIST=[it,et,st,tt];function Ne(e){return e>=it&&e<=55295||e===et||e===st||e===tt||e>=57344&&e<=65533||e>=65536&&e<=1114111}x.isChar=Ne;function Fe(e){return e===it||e===et||e===st||e===tt}x.isS=Fe;function Pt(e){return e>=65&&e<=90||e>=97&&e<=122||e===58||e===95||e===8204||e===8205||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}x.isNameStartChar=Pt;function Se(e){return Pt(e)||e>=48&&e<=57||e===45||e===46||e===183||e>=768&&e<=879||e>=8255&&e<=8256}x.isNameChar=Se});var Ht=G(f=>{"use strict";Object.defineProperty(f,"__esModule",{value:!0});f.CHAR="-\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}";f.RESTRICTED_CHAR="-\b\v\f-\x7F-\x84\x86-\x9F";f.S=` \r
|
|
5
5
|
`;f.NAME_START_CHAR=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}";f.NAME_CHAR="-"+f.NAME_START_CHAR+".0-9\xB7\u0300-\u036F\u203F-\u2040";f.CHAR_RE=new RegExp("^["+f.CHAR+"]$","u");f.RESTRICTED_CHAR_RE=new RegExp("^["+f.RESTRICTED_CHAR+"]$","u");f.S_RE=new RegExp("^["+f.S+"]+$","u");f.NAME_START_CHAR_RE=new RegExp("^["+f.NAME_START_CHAR+"]$","u");f.NAME_CHAR_RE=new RegExp("^["+f.NAME_CHAR+"]$","u");f.NAME_RE=new RegExp("^["+f.NAME_START_CHAR+"]["+f.NAME_CHAR+"]*$","u");f.NMTOKEN_RE=new RegExp("^["+f.NAME_CHAR+"]+$","u");var yt=9,It=10,Bt=13,Xt=32;f.S_LIST=[Xt,It,Bt,yt];function we(e){return e>=1&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111}f.isChar=we;function ke(e){return e>=1&&e<=8||e===11||e===12||e>=14&&e<=31||e>=127&&e<=132||e>=134&&e<=159}f.isRestrictedChar=ke;function ve(e){return e===9||e===10||e===13||e>31&&e<127||e===133||e>159&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111}f.isCharAndNotRestricted=ve;function Oe(e){return e===Xt||e===It||e===Bt||e===yt}f.isS=Oe;function $t(e){return e>=65&&e<=90||e>=97&&e<=122||e===58||e===95||e===8204||e===8205||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}f.isNameStartChar=$t;function Me(e){return $t(e)||e>=48&&e<=57||e===45||e===46||e===183||e>=768&&e<=879||e>=8255&&e<=8256}f.isNameChar=Me});var Ut=G(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.NC_NAME_START_CHAR="A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}";N.NC_NAME_CHAR="-"+N.NC_NAME_START_CHAR+".0-9\xB7\u0300-\u036F\u203F-\u2040";N.NC_NAME_START_CHAR_RE=new RegExp("^["+N.NC_NAME_START_CHAR+"]$","u");N.NC_NAME_CHAR_RE=new RegExp("^["+N.NC_NAME_CHAR+"]$","u");N.NC_NAME_RE=new RegExp("^["+N.NC_NAME_START_CHAR+"]["+N.NC_NAME_CHAR+"]*$","u");function Wt(e){return e>=65&&e<=90||e===95||e>=97&&e<=122||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}N.isNCNameStartChar=Wt;function Pe(e){return Wt(e)||e===45||e===46||e>=48&&e<=57||e===183||e>=768&&e<=879||e>=8255&&e<=8256}N.isNCNameChar=Pe});var Ct=G(B=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});B.SaxesParser=B.EVENTS=void 0;var X=Lt(),Le=Ht(),xt=Ut(),F=X.isS,ye=X.isChar,W=X.isNameStartChar,Vt=X.isNameChar,ne=X.S_LIST,Ie=X.NAME_RE,Be=Le.isChar,Xe=xt.isNCNameStartChar,$e=xt.isNCNameChar,He=xt.NC_NAME_RE,K="http://www.w3.org/XML/1998/namespace",I="http://www.w3.org/2000/xmlns/",We={__proto__:null,xml:K,xmlns:I},Ue={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},C=-1,k=-2,Gt=0,Ve=1,nt=2,Ge=3,P=4,qe=5,je=6,ze=7,rt=8,Ye=9,Qe=10,Ke=11,Ze=12,A=13,q=14,at=15,Je=16,ot=17,ts=18,es=19,ht=20,ss=21,is=22,ns=23,qt=24,lt=25,j=26,jt=27,rs=28,as=29,zt=30,os=31,hs=32,O=33,ls=34,ct=35,U=36,ut=37,cs=38,Yt=39,Qt=40,us=41,Kt=42,ds=43,fs=44,dt=9,w=10,ft=13,Zt=32,Jt=33,re=34,V=38,ae=39,z=45,Y=47,ps=59,v=60,L=61,D=62,T=63,oe=91,y=93,te=133,ee=8232,Q=e=>e===re||e===ae,he=[re,ae],ms=[...he,oe,D],gs=[...he,v,y],xs=[L,T,...ne],Cs=[...ne,D,V,v];function mt(e,t,s){switch(t){case"xml":s!==K&&e.fail(`xml prefix must be bound to ${K}.`);break;case"xmlns":s!==I&&e.fail(`xmlns prefix must be bound to ${I}.`);break;default:}switch(s){case I:e.fail(t===""?`the default namespace may not be set to ${s}.`:`may not assign a prefix (even "xmlns") to the URI ${I}.`);break;case K:switch(t){case"xml":break;case"":e.fail(`the default namespace may not be set to ${s}.`);break;default:e.fail("may not assign the xml namespace to another prefix.")}break;default:}}function _s(e,t){for(let s of Object.keys(t))mt(e,s,t[s])}var Es=e=>He.test(e),Ds=e=>Ie.test(e),M=0,se=1,pt=2;B.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];var ie={xmldecl:"xmldeclHandler",text:"textHandler",processinginstruction:"piHandler",doctype:"doctypeHandler",comment:"commentHandler",opentagstart:"openTagStartHandler",attribute:"attributeHandler",opentag:"openTagHandler",closetag:"closeTagHandler",cdata:"cdataHandler",error:"errorHandler",end:"endHandler",ready:"readyHandler"},gt=class{constructor(t){this.opt=t??{},this.fragmentOpt=!!this.opt.fragment;let s=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,s){this.nameStartCheck=Xe,this.nameCheck=$e,this.isName=Es,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},We);let i=this.opt.additionalNamespaces;i!=null&&(_s(this,i),Object.assign(this.ns,i))}else this.nameStartCheck=W,this.nameCheck=Vt,this.isName=Ds,this.processAttribs=this.processAttribsPlain,this.pushAttrib=this.pushAttribPlain;this.stateTable=[this.sBegin,this.sBeginWhitespace,this.sDoctype,this.sDoctypeQuote,this.sDTD,this.sDTDQuoted,this.sDTDOpenWaka,this.sDTDOpenWakaBang,this.sDTDComment,this.sDTDCommentEnding,this.sDTDCommentEnded,this.sDTDPI,this.sDTDPIEnding,this.sText,this.sEntity,this.sOpenWaka,this.sOpenWakaBang,this.sComment,this.sCommentEnding,this.sCommentEnded,this.sCData,this.sCDataEnding,this.sCDataEnding2,this.sPIFirstChar,this.sPIRest,this.sPIBody,this.sPIEnding,this.sXMLDeclNameStart,this.sXMLDeclName,this.sXMLDeclEq,this.sXMLDeclValueStart,this.sXMLDeclValue,this.sXMLDeclSeparator,this.sXMLDeclEnding,this.sOpenTag,this.sOpenTagSlash,this.sAttrib,this.sAttribName,this.sAttribNameSawWhite,this.sAttribValue,this.sAttribValueQuoted,this.sAttribValueClosed,this.sAttribValueUnquoted,this.sCloseTag,this.sCloseTagSawWhite],this._init()}get closed(){return this._closed}_init(){var t;this.openWakaBang="",this.text="",this.name="",this.piTarget="",this.entity="",this.q=null,this.tags=[],this.tag=null,this.topNS=null,this.chunk="",this.chunkPosition=0,this.i=0,this.prevI=0,this.carriedFromPrevious=void 0,this.forbiddenState=M,this.attribList=[];let{fragmentOpt:s}=this;this.state=s?A:Gt,this.reportedTextBeforeRoot=this.reportedTextAfterRoot=this.closedRoot=this.sawRoot=s,this.xmlDeclPossible=!s,this.xmlDeclExpects=["version"],this.entityReturnState=void 0;let{defaultXMLVersion:i}=this.opt;if(i===void 0){if(this.opt.forceXMLVersion===!0)throw new Error("forceXMLVersion set but defaultXMLVersion is not set");i="1.0"}this.setXMLVersion(i),this.positionAtNewLine=0,this.doctype=!1,this._closed=!1,this.xmlDecl={version:void 0,encoding:void 0,standalone:void 0},this.line=1,this.column=0,this.ENTITIES=Object.create(Ue),(t=this.readyHandler)===null||t===void 0||t.call(this)}get position(){return this.chunkPosition+this.i}get columnIndex(){return this.position-this.positionAtNewLine}on(t,s){this[ie[t]]=s}off(t){this[ie[t]]=void 0}makeError(t){var s;let i=(s=this.fileName)!==null&&s!==void 0?s:"";return this.trackPosition&&(i.length>0&&(i+=":"),i+=`${this.line}:${this.column}`),i.length>0&&(i+=": "),new Error(i+t)}fail(t){let s=this.makeError(t),i=this.errorHandler;if(i===void 0)throw s;return i(s),this}write(t){if(this.closed)return this.fail("cannot write after close; assign an onready handler.");let s=!1;t===null?(s=!0,t=""):typeof t=="object"&&(t=t.toString()),this.carriedFromPrevious!==void 0&&(t=`${this.carriedFromPrevious}${t}`,this.carriedFromPrevious=void 0);let i=t.length,n=t.charCodeAt(i-1);!s&&(n===ft||n>=55296&&n<=56319)&&(this.carriedFromPrevious=t[i-1],i--,t=t.slice(0,i));let{stateTable:r}=this;for(this.chunk=t,this.i=0;this.i<i;)r[this.state].call(this);return this.chunkPosition+=i,s?this.end():this}close(){return this.write(null)}getCode10(){let{chunk:t,i:s}=this;if(this.prevI=s,this.i=s+1,s>=t.length)return C;let i=t.charCodeAt(s);if(this.column++,i<55296){if(i>=Zt||i===dt)return i;switch(i){case w:return this.line++,this.column=0,this.positionAtNewLine=this.position,w;case ft:return t.charCodeAt(s+1)===w&&(this.i=s+2),this.line++,this.column=0,this.positionAtNewLine=this.position,k;default:return this.fail("disallowed character."),i}}if(i>56319)return i>=57344&&i<=65533||this.fail("disallowed character."),i;let n=65536+(i-55296)*1024+(t.charCodeAt(s+1)-56320);return this.i=s+2,n>1114111&&this.fail("disallowed character."),n}getCode11(){let{chunk:t,i:s}=this;if(this.prevI=s,this.i=s+1,s>=t.length)return C;let i=t.charCodeAt(s);if(this.column++,i<55296){if(i>31&&i<127||i>159&&i!==ee||i===dt)return i;switch(i){case w:return this.line++,this.column=0,this.positionAtNewLine=this.position,w;case ft:{let r=t.charCodeAt(s+1);(r===w||r===te)&&(this.i=s+2)}case te:case ee:return this.line++,this.column=0,this.positionAtNewLine=this.position,k;default:return this.fail("disallowed character."),i}}if(i>56319)return i>=57344&&i<=65533||this.fail("disallowed character."),i;let n=65536+(i-55296)*1024+(t.charCodeAt(s+1)-56320);return this.i=s+2,n>1114111&&this.fail("disallowed character."),n}getCodeNorm(){let t=this.getCode();return t===k?w:t}unget(){this.i=this.prevI,this.column--}captureTo(t){let{i:s}=this,{chunk:i}=this;for(;;){let n=this.getCode(),r=n===k,a=r?w:n;if(a===C||t.includes(a))return this.text+=i.slice(s,this.prevI),a;r&&(this.text+=`${i.slice(s,this.prevI)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as Ce}from"./chunk-AQ2OG2EF.js";import{b as Me,d as Le}from"./chunk-VRIZDOO5.js";import{c as ke,g as Oe}from"./chunk-ZHWU6L2G.js";import{b as F}from"./chunk-
|
|
2
|
+
import{a as Ce}from"./chunk-AQ2OG2EF.js";import{b as Me,d as Le}from"./chunk-VRIZDOO5.js";import{c as ke,g as Oe}from"./chunk-ZHWU6L2G.js";import{b as F}from"./chunk-5ORBAYTU.js";import{B as Ie,L as Ee,M as $e,Na as Be,a as ne,c as te,k as oe,r as we,x as re,y as se}from"./chunk-5EAJO372.js";import{d as L,j as he,k as be,l as ye,m as ve,n as ie,p as _e,q as j}from"./chunk-DBMW3VUN.js";import{f as ee,h as xe}from"./chunk-KU3YHPWZ.js";import{readFileSync as We}from"fs";import{basename as ue,extname as Ue}from"path";import{extname as Pe}from"path";var Fe={kind:"jira",media_type:"application/x-kane-jira-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},De={kind:"confluence",media_type:"application/x-kane-confluence-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},je={kind:"web",media_type:"application/x-kane-web-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},Te={kind:"linear",media_type:"application/x-kane-linear-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},Ge={kind:"linear-doc",media_type:"application/x-kane-linear-doc-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},Ke={kind:"plugin",media_type:"application/x-kane-plugin-envelope",extensions:[],cite:"verbatim",maxBytes:25*1024*1024},le=[{kind:"text",media_type:"text/plain",extensions:[".txt"],cite:"verbatim",maxBytes:2e6},{kind:"markdown",media_type:"text/markdown",extensions:[".md",".markdown"],cite:"verbatim",maxBytes:2e6},{kind:"image",media_type:"image/png",extensions:[".png"],cite:"anchor-only",maxBytes:5e6},{kind:"image",media_type:"image/jpeg",extensions:[".jpg",".jpeg"],cite:"anchor-only",maxBytes:5e6},{kind:"image",media_type:"image/webp",extensions:[".webp"],cite:"anchor-only",maxBytes:5e6},{kind:"text",media_type:"application/json",extensions:[".json"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"application/yaml",extensions:[".yaml",".yml"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"application/toml",extensions:[".toml"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"application/xml",extensions:[".xml"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"text/plain",extensions:[".log"],cite:"verbatim",maxBytes:2e6},{kind:"pdf",media_type:"application/pdf",extensions:[".pdf"],cite:"verbatim",maxBytes:25e6,sniff:e=>e.subarray(0,5).toString("latin1")==="%PDF-"},{kind:"docx",media_type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",extensions:[".docx"],cite:"verbatim",maxBytes:25e6,sniff:e=>e.length>=4&&e[0]===80&&e[1]===75&&e[2]===3&&e[3]===4,sniffFail:e=>e.length>=8&&e.subarray(0,8).equals(Ve)?"DOCX_ENCRYPTED_OR_LEGACY: password-protected Office file (or a legacy .doc renamed .docx) \u2014 remove the password / save as .docx and re-ingest":void 0},Fe,De,Te,Ge,Ke],Ve=Buffer.from([208,207,17,224,161,177,26,225]),ae={pdf:"pdf",docx:"docx",jira:"jira",confluence:"confluence",web:"web",linear:"linear","linear-doc":"linearDoc",plugin:"plugin"},en=new Set(Object.keys(ae));function Se(e){let i=Pe(e).toLowerCase(),n=le.find(o=>o.extensions.includes(i));return n?{ok:!0,media:n}:{ok:!1,code:"UNSUPPORTED_MEDIA",allowlist:le.flatMap(o=>o.extensions)}}function nn(e){return[...le,je].find(i=>i.media_type===e)??null}function K(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`}function Ne(e,i,n){if(n===void 0)return;let o=n!==null?[n]:e.byLabel(ee.SOURCE).filter(d=>d.content.source_id===i).map(d=>d.cid);if(o.length!==0){for(let d of o){let p=e.mediaOf(d);if(p.format==="plugin")return p.plugin?.id??""}return null}}function Xe(e,i,n,o){if(i===void 0||i===n)return;let d=o?"a retired source":"a source",p=i===null?`${d} of a built-in kind`:`${d} the ${i} plugin reads`,t=n===null?"a file or URL of a built-in kind":`a source the ${n} plugin reads`;return`SOURCE_ID_OWNED: '${e}' is ${p} \u2014 ${t} cannot become a version of it; ingest it under another id`}function Ye(e,i,n){return Ce({source_id:e,source_cid:"sha256:".padEnd(71,"0"),doc_kind:i,numbered_text:Ie(n)})}var Ae=2e3;function ze(e){let n=ue(e,Ue(e)).toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^[^a-z0-9]+/,"");return oe(n),n}function wn(e){let i=/^(.*?)[-_.]?v?\d+$/.exec(e);if(!i)return null;let n=(i[1]??"").replace(/[-_.]+$/,"");return n.length>0&&n!==e?n:null}async function In(e){let{store:i,filePath:n,asId:o,confirmSameSource:d,converters:p}=e,t=i.ensure(),s=We(n),g=Se(n);if(!g.ok)throw new Error(`${ue(n)} is a file type kane can't ingest (${Ue(n)||"no extension"}) \u2014 supported: ${g.allowlist.join(" ")} [UNSUPPORTED_MEDIA]`);if(s.byteLength>g.media.maxBytes)throw new Error(`${ue(n)} is too large \u2014 ${K(s.byteLength)}, the limit for ${g.media.media_type} is ${K(g.media.maxBytes)} [FILE_TOO_LARGE]`);if(g.media.sniff&&!g.media.sniff(s)){let w=g.media.sniffFail?.(s);throw new Error(w??`MEDIA_SNIFF_MISMATCH: ${n} does not look like ${g.media.media_type}`)}let C;o!==void 0?(oe(o),C=o):C=ze(n);let v=await He({store:i,bytes:s,media:g.media,sourceId:C,label:n,confirmSameSource:d,converters:p});return t.gitignore?{...v,gitignore:t.gitignore}:v}async function He(e){let{store:i,bytes:n,media:o,confirmSameSource:d,converters:p}=e,t=o.kind==="plugin"?e.plugin:void 0;if(o.kind==="plugin"&&!t)throw new Error("a source-plugin version needs the plugin it was read by");let s=e.sourceId,g=e.label??s,C=i.ensure();if(n.byteLength>o.maxBytes)throw new Error(`the content is too large \u2014 ${K(n.byteLength)}, the limit for ${o.media_type} is ${K(o.maxBytes)} [FILE_TOO_LARGE]`);let v=[],w=ae[o.kind];if(o.cite==="verbatim"&&!w){try{new TextDecoder("utf-8",{fatal:!0}).decode(n)}catch{throw new Error(`ENCODING_UNSUPPORTED: ${g} is not valid UTF-8 \u2014 re-save it as UTF-8 and re-ingest`)}n.toString("utf8").split(`
|
|
3
3
|
`).some(h=>h.length>Ae)&&v.push(`long line detected (> ${Ae} chars) \u2014 anchors lose granularity; consider pretty-printing before ingest`)}let k=F(n),O=new Map,I=null,_=null,m=null,B=new Map,R=!1;for(let h=0;;h++){let c=$e(i),u=c.heads.get(s),U=u!=null?c.getNode(u)?.content:void 0,b=Xe(s,Ne(c,s,u),t?t.id:null,u===null);if(b)throw new Error(b);if(u!=null&&U?.blob===k)return{status:"unchanged",source_id:s,cid:u,blob:k};if(u==null){for(let[r,E]of c.heads.entries())if(!(r===s||E==null)&&c.getNode(E)?.content.blob===k){if(Ne(c,r,E)!==(t?t.id:null))continue;let f;if(O.has(r)?f=O.get(r):h===0&&d?(f=await d(r),O.set(r,f)):(f=!1,O.set(r,f),h>0&&v.push(`same bytes already ingested as '${r}' \u2014 minted under '${s}' anyway (the twin appeared mid-commit; not prompted)`)),f)return{status:"unchanged",source_id:r,cid:E,blob:k};break}}let V=t?ne("source",te(s,k)):void 0,W=V!==void 0&&c.nodeLabel.has(V)?c.mediaOf(V):void 0,l=W?.format==="plugin"&&W.plugin?W:void 0,X=null;if(l){let r=[];if(l.text_blob&&i.getBlob(l.text_blob)===null&&r.push(`its text (${l.text_blob.slice(0,19)})`),l.plugin.index&&(X=ie(i.getBlob(l.plugin.index)),X===null&&r.push(`its unit index (${l.plugin.index.slice(0,19)})`)),l.plugin.notes&&i.getBlob(l.plugin.notes)===null&&r.push(`its notes (${l.plugin.notes.slice(0,19)})`),l.plugin.coverage&&i.getBlob(l.plugin.coverage)===null&&r.push(`its coverage plan (${l.plugin.coverage.slice(0,19)})`),r.length>0)throw new Error(`VERSION_BLOB_MISSING: this store has held these bytes of '${s}' before, and ${r.join(" and ")} from that ingest ${r.length>1?"are":"is"} not in the blob store \u2014 a version keeps what its first ingest stored, so it cannot be read again; restore the blobs from a copy of this store (kane-cli context fsck names what is missing)`)}if(!l&&m===null){let r={},E,f=null,A=null,M;if(w){let $=p?.[w];if(!$)throw new Error(`${w.toUpperCase()}_CONVERTER_MISSING: ${w} ingestion requires the converter \u2014 the command layer wires it`);let x=await $(n),y=re(x.projection);y.replaced>0&&v.push(se(s,y.replaced)),f=Buffer.from(y.text,"utf8");let D=Ye(s,o.kind,f),ge=()=>new Error(`PROJECTION_TOO_LARGE: serialized source payload ${D} bytes > ${4e5} \u2014 split the document and re-ingest`);if(D>4e5){if(!t)throw ge();if(f.byteLength>L.textBytes)throw new Error(`PLUGIN_TEXT_TOO_LARGE: plugin ${t.id} rendered ${s} to ${f.byteLength} bytes of text; a plugin's source may be at most ${L.textBytes} \u2014 split the source and ingest the parts`)}if(r={text_blob:F(f),...x.inventory.length>0?{images:x.inventory}:{},converter:x.converter},A=x.blobs,E={kind:o.kind,...x.pages!==void 0?{pages:x.pages}:{},delivered:x.delivered.length,omitted:x.inventory.length-x.delivered.length},t){let T=be(x.units,y.text);if(!T.ok)M={fault:T.fault};else{let me=ye(t.id,t.rules,T.units,y.text),G=ve(me);M=G.ok?{index:me,bytes:G.bytes,fp:F(G.bytes),given:T.units}:{fault:G.fault}}if(D>4e5&&(!("index"in M)||M.given.length===0))throw ge()}}else if(o.cite==="verbatim"){let $=re(n.toString("utf8"));$.replaced>0&&(v.push(se(s,$.replaced)),f=Buffer.from($.text,"utf8"),r={text_blob:F(f)})}let P=[...r.text_blob?[r.text_blob]:[],...A?A.keys():[]];m={derived:r,composite:E,projBytes:f,derivedBlobs:A,derivedFps:P,...M?{units:M}:{}}}let a=l?{derived:{...l.text_blob?{text_blob:l.text_blob}:{},...l.converter?{converter:l.converter}:{}},composite:{kind:o.kind,delivered:0,omitted:0},projBytes:null,derivedBlobs:null,derivedFps:l.text_blob?[l.text_blob]:[]}:m;if(l)i.putBlob(n);else if(!R){if(i.putBlob(n),a.projBytes!==null&&i.putBlob(a.projBytes),a.derivedBlobs!==null)for(let[,r]of a.derivedBlobs)i.putBlob(r);R=!0}let Y=te(s,k),z=xe("source",Y);if(z.length>0)throw new Error(`source node fails ${z[0].code}: ${z[0].detail}`);let H=ne("source",Y),S,N,J,q=[],Q=[],Z=[];if(t){let r=null,E;l?(E=l.plugin.index,r=X,N=r?{indexed:r.units.length}:{fault:{code:"UNIT_LIST_INVALID",detail:"this version was first stored without a unit index, and a version keeps what its first ingest stored"}}):a.units&&"index"in a.units?(i.putBlob(a.units.bytes),r=a.units.index,E=a.units.fp,N={indexed:r.units.length}):a.units&&(N={fault:a.units.fault});let f=u!=null?c.mediaOf(u):void 0,A=r&&f?.format==="plugin"&&f.plugin?.index?ie(i.getBlob(f.plugin.index)):null,M=r&&A&&A.plugin===r.plugin&&A.rules===r.rules?A:null,P=r&&M&&u!=null?_e(M,r):null;if(P!==null&&P.changed.length>0&&e.explain&&!l&&u!=null&&a.projBytes!==null){let y=B.get(u);if(y===void 0){let D=f?.text_blob?i.getBlob(f.text_blob):null;y=D===null?{reasons:{},warnings:[]}:await Qe({call:e.explain,ms:e.explainMs??L.explainMs,plugin:t.id,sourceId:s,changed:P.changed,before:{index:M,text:D.toString("utf8")},after:{index:r,text:a.projBytes.toString("utf8")}}),B.set(u,y)}q=y.warnings,Object.keys(y.reasons).length>0&&(J=y.reasons)}let $;if(l)$=l.plugin.notes;else if(t.notes!==void 0)$=t.notes;else if(e.context&&a.projBytes!==null){if(I===null){let y=a.units&&"index"in a.units?a.units.given:[];I=await Je({call:e.context,ms:e.contextMs??L.hookMs,plugin:t.id,sourceId:s,text:a.projBytes.toString("utf8"),units:y})}I.notes!==null&&(i.putBlob(I.notes.bytes),$=I.notes.fp),Q=I.warnings}let x;l?x=l.plugin.coverage:t.coverage!==void 0?x=t.coverage:e.coverage&&a.units&&"index"in a.units&&(_===null&&(_=await qe({call:e.coverage,ms:e.coverageMs??L.hookMs,plugin:t.id,sourceId:s,units:a.units.given})),_.plan!==null&&(i.putBlob(_.plan.bytes),x=_.plan.fp),Z=_.warnings),S={id:l?l.plugin.id:t.id,rules:l?l.plugin.rules:t.rules,...E?{index:E}:{},...$?{notes:$}:{},...x?{coverage:x}:{},...(l?l.plugin.cites_deep:t.citesDeep)===!0?{cites_deep:!0}:{},...P!==null&&u!=null?{changes:{from:u,...P,...J?{reasons:J}:{}}}:{},...t.fetch!==void 0?{fetch:{ref:t.fetch.ref,...t.fetch.cursor!==void 0?{cursor:t.fetch.cursor}:{}}}:{}}}let ce=N&&"fault"in N?[...v,`${s} is stored without a unit index: ${N.fault.detail} [${N.fault.code}] \u2014 everything that cites an earlier version of it reads stale`]:v,pe=q.length>0||Q.length>0||Z.length>0?[...ce,...q,...Q,...Z]:ce,Re=[...a.derivedFps,...S?.index?[S.index]:[],...S?.notes?[S.notes]:[],...S?.coverage?[S.coverage]:[]],fe={format:o.kind,media_type:o.media_type,anchors_supported:t?["L-L"]:w?["L-L","img#ref"]:o.cite==="verbatim"?["L-L"]:[],...a.derived,...S?{plugin:S}:{}};try{Ee(i,{ts:new Date().toISOString(),proposal_id:null,nodes:[{cid:H,label:ee.SOURCE,content:Y}],edges:[],review:[],supersessions:[],media:{[s]:fe},...e.eventIds&&e.eventIds.length>0?{event_ids:e.eventIds}:{},source_head_moves:{[s]:H}},{graph:c,expectPrev:c.latestHash,intent:{v:1,verb:"ingest",args:we({source_id:s,blob:k,label:g,media:fe,derived_blobs:Re,eventIds:e.eventIds??null}),pins:{prior_head:u??null}},provenance:e.provenance})}catch(r){if(r instanceof Be&&h<3)continue;throw r}return{status:u!=null?"versioned":"created",source_id:s,cid:H,blob:k,...pe.length?{warnings:pe}:{},...a.composite?{composite:a.composite}:{},...C.gitignore?{gitignore:C.gitignore}:{},...N?{units:N}:{}}}}async function Je(e){let i="the version, its units and what changed are stored as they are; only the notes are missing",n;try{n=await e.call({text:e.text,units:e.units},e.ms)}catch(t){let s=j(t instanceof Error?t.message:String(t))??"it failed";return{notes:null,warnings:[`plugin ${e.plugin} gave no notes for ${e.sourceId}: ${s} \u2014 ${i} [PLUGIN_CONTEXT_FAILED]`]}}let o=Oe(e.plugin,n,new Set(e.units.map(t=>t.id))),d=[];if(o.invalid!==void 0&&d.push(`plugin ${e.plugin} answered context for ${e.sourceId} with ${o.invalid} \u2014 ${i} [PLUGIN_NOTES_INVALID]`),o.dropped.length>0){let t=o.dropped.reduce((s,g)=>s+g.count,0);d.push(`${t} ${t===1?"note":"notes"} of plugin ${e.plugin} for ${e.sourceId} ${t===1?"is":"are"} not kept: ${o.dropped.map(s=>`${s.count} ${s.why}`).join("; ")} \u2014 the version, its units and what changed are stored as they are, with the notes that are kept [PLUGIN_NOTES_DROPPED]`)}if(o.notes===null)return{notes:null,warnings:d};let p=ke(o.notes);return{notes:{bytes:p,fp:F(p)},warnings:d}}async function qe(e){let i="the version, its units and what changed are stored as they are, with no coverage plan: every unit of it is expected to have tests",n;try{n=await e.call({units:e.units},e.ms)}catch(p){let t=j(p instanceof Error?p.message:String(p))??"it failed";return{plan:null,warnings:[`plugin ${e.plugin} gave no coverage plan for ${e.sourceId}: ${t} \u2014 ${i} [PLUGIN_COVERAGE_FAILED]`]}}let o=Le(e.plugin,n,e.units.map(p=>p.id));if(o.plan===null)return{plan:null,warnings:[`plugin ${e.plugin} gave no coverage plan for ${e.sourceId}: ${o.fault} \u2014 ${i} [PLUGIN_COVERAGE_FAILED]`]};let d=Me(o.plan);return{plan:{bytes:d,fp:F(d)},warnings:[]}}async function Qe(e){let i=m=>{let B=he(m.text),R=new Map(m.index.units.map(h=>[h.id,h]));return h=>{let c=R.get(h);if(c===void 0||c.lines===void 0)return null;let{text:u,segments:U,...b}=c;return{unit:{...b,lines:[c.lines[0],c.lines[1]]},text:B.slice(c.lines[0]-1,c.lines[1]).join(`
|
|
4
4
|
`)}}},n=i(e.before),o=i(e.after),d={},p=[],t=[],s=[],g="",C=0,v=[],w=[],k=Date.now();for(let m=0;m<e.changed.length;m++){let B=e.changed[m],R=n(B),h=o(B);if(R===null||h===null)continue;let c=e.ms-(Date.now()-k);if(c<=0){v=e.changed.slice(m).filter(b=>n(b)!==null&&o(b)!==null);break}let u;try{u=await e.call({sourceId:e.sourceId,before:R,after:h},c)}catch(b){p.push(B),g===""&&(g=b instanceof Error?b.message:String(b));continue}if(u==null)continue;let U=j(u);if(U===null){s.push(B);continue}if(U.length>L.reasonChars){t.push(B);continue}if(C+Buffer.byteLength(U,"utf8")>L.reasonsBytes){w=e.changed.slice(m).filter(b=>n(b)!==null&&o(b)!==null);break}C+=Buffer.byteLength(U,"utf8"),d[B]=U}let O=m=>`${m.length} changed ${m.length===1?"unit":"units"} of ${e.sourceId} (${m.slice(0,5).join(", ")}${m.length>5?`, and ${m.length-5} more`:""})`,I="the version, its units and what changed are stored as they are; only the wording is missing",_=[];return p.length>0&&_.push(`plugin ${e.plugin} gave no reason for ${O(p)}: ${j(g)??"it failed"} \u2014 ${I} [PLUGIN_EXPLAIN_FAILED]`),v.length>0&&_.push(`plugin ${e.plugin} was not asked for a reason for ${O(v)}: its answers took the ${Math.round(e.ms/1e3)} seconds a version's reasons may take \u2014 ${I} [PLUGIN_EXPLAIN_TIMEOUT]`),s.length>0&&_.push(`plugin ${e.plugin} answered with something that is not a line of text for ${O(s)} \u2014 ${I} [PLUGIN_REASON_INVALID]`),t.length>0&&_.push(`plugin ${e.plugin} gave a reason over ${L.reasonChars} characters for ${O(t)}; it is dropped \u2014 ${I} [PLUGIN_REASON_TOO_LONG]`),w.length>0&&_.push(`the reasons of plugin ${e.plugin} passed ${L.reasonsBytes} bytes for one version; none is kept for ${O(w)} \u2014 ${I} [PLUGIN_REASONS_OVER_LIMIT]`),{reasons:d,warnings:_}}export{Fe as a,De as b,je as c,Te as d,Ge as e,Ke as f,le as g,ae as h,en as i,Se as j,nn as k,Xe as l,Ye as m,ze as n,wn as o,In as p,He as q};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
var o=null,c=new Set(["run","testmd run","testrun run"]),m=(t,e,n)=>({testFailed:n??(e===1&&c.has(t.path))}),l=!1,a=null;function s(t){let e=[];for(let n=t;n!==null&&n.parent!==null;n=n.parent)e.unshift(n.name());return e.join(" ")}function g(){return o?.path??null}var i=null;function C(t){i=t}function h(){o&&(o.started=!0)}function b(t){a=t}function p(t,e){if(!o){o={path:t,mode:e,t0:Date.now(),started:!1,ended:!1,ctx:null};try{i?.()}catch{}l||(l=!0,process.once("exit",n=>x(typeof n=="number"?n:Number(process.exitCode??0))))}}function d(t){if(t.ctx)return t.ctx;if(t.started||!a)return null;try{return t.ctx=a(t.path,t.mode),t.ctx}catch{return null}}function f(){let t=o;if(!t||t.ended)return null;let e=!t.ctx,n=d(t);return n&&e&&n.startInterval(),n}function v(t,e={}){try{f()?.error(t,e)}catch{}}async function u(t,e={}){let n=o;if(!n||n.ended)return;n.ended=!0;let r=d(n);if(r)try{await r.end({exit_code:t,duration_ms:Date.now()-n.t0},m(n,t,e.testFailed))}catch{}}async function S(t){return await u(t),process.exit(t)}function x(t){let e=o;if(!e||e.ended)return;e.ended=!0;let n=d(e);if(n)try{n.endSync({exit_code:t},m(e,t))}catch{}}var y=t=>t.mode==="agent"||t.agent===!0?"agent":typeof t.mode=="string"&&t.mode?t.mode:"cli";function k(t,e){a=e,t.hook("preAction",(n,r)=>{p(s(r),y(r.opts()))}),t.hook("postAction",async()=>{await u(Number(process.exitCode??0))})}function w(){o=null,a=null,i=null}export{s as a,g as b,C as c,h as d,b as e,p as f,f as g,v as h,u as i,S as j,x as k,k as l,w as m};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as w,b as C}from"./chunk-
|
|
2
|
+
import{a as w,b as C}from"./chunk-QLGQDNA3.js";import{e as y}from"./chunk-EWSNJ3IX.js";import{a as j,b as I,e as x}from"./chunk-X3O4VGTM.js";import{i as k}from"./chunk-XMPTFXPW.js";import{Ha as i,f as h}from"./chunk-7WWCIS2B.js";import{a as l}from"./chunk-4C7WVQOD.js";import{o as g}from"./chunk-OKCVG7AG.js";import{c as m}from"./chunk-73EHVDL5.js";import{readFileSync as A}from"fs";import{basename as T,dirname as p,join as N}from"path";var S=5e3,O=w("assurance-case");function _(e,t={}){let s=p(e);if(T(s)!=="tests"||T(p(s))!==".testmuai")return null;let n=p(p(s)),a;try{a=g(A(e,"utf8"))}catch{return null}if(!a?.id)return null;let r=(c,u,d)=>({root:n,latticeUrl:c,projectId:u,projectName:d,test:a.id,base:a.base??null});if(t.grid){let c=x(N(n,j));return c===null?null:r("",c.projectId,c.projectName)}let o=I(n,t.address??m());return o.kind==="remote"?r(o.latticeUrl,o.projectId,o.projectName):null}function K(e,t={}){let s={};for(let n of e){let a=_(n,t);a?.base&&(s[n]={test:a.test,definitionId:a.base})}return s}async function V(e){let t=_(e.testFile,{address:e.address,grid:e.gridCase!==void 0});if(t===null)return{kind:"unlinked"};let s=t.base===null?null:{test:t.test,definitionId:t.base},n=e.metaCaseId===null;if(e.gridCase)return R(t,s,e.metaCaseId,{caseId:e.gridCase.caseId,internalId:e.gridCase.tc,canAttach:!0});if(s===null)return{kind:"stop",stop:{why:"not_in_project",useCase:null},projectName:t.projectName};let a;try{let r=e.auth??await y(),o=e.lookup??((c,u,d)=>h({url:t.latticeUrl,basicAuth:r}).testCase(c,u,d));a=await L(o(t.projectId,t.test,s.definitionId),e.budgetMs??S)}catch(r){return r instanceof l&&r.code==="NO_CONTEXT"?{kind:"stop",stop:{why:"no_work"},projectName:t.projectName}:(O(`the test case of ${t.test} wasn't checked: ${r instanceof f?r.message:C(r)}`),n?{kind:"stop",stop:{why:"lookup",refusal:v(r,t.projectName)},projectName:t.projectName}:{kind:"run",projectId:t.projectId,tc:null,stamp:s})}return"refused"in a?{kind:"stop",stop:E(a.refused),projectName:t.projectName}:R(t,s,e.metaCaseId,a.linked)}function R(e,t,s,n){return s===n.caseId?{kind:"run",projectId:e.projectId,tc:n.internalId,stamp:t}:n.canAttach?{kind:"attach",projectId:e.projectId,caseId:n.caseId,tc:n.internalId,stamp:t,rehome:s!==null}:{kind:"stop",stop:{why:"outdated"},projectName:e.projectName}}function X(e,t){switch(e.why){case"missing":return{refusal:i.testCaseMissing(e.session),exit:2};case"gone":return{refusal:i.testCaseGone(e.session),exit:2};case"archived":return{refusal:i.testCaseArchived(),exit:2};case"not_in_project":return{refusal:i.testNotInProject(t,e.useCase),exit:2};case"no_work":return{refusal:i.testProjectHasNoWork(t),exit:2};case"outdated":return{refusal:i.testManagerOutdated(),exit:1};case"lookup":return{refusal:e.refusal,exit:2}}}function b(e){switch(e.why){case"missing":return e.session?{reason:"it isn't in Test Manager yet; save the session that designed it:",cmd:`kane-cli context sessions save ${e.session}`}:{reason:"it isn't in Test Manager yet; find its session, then save it:",cmd:"kane-cli context sessions"};case"gone":return e.session?{reason:"its test case was deleted or moved; saving its session makes a new one:",cmd:`kane-cli context sessions save ${e.session}`}:{reason:"its test case was deleted or moved; find its session, then save it:",cmd:"kane-cli context sessions"};case"archived":return{reason:"its test case is archived in Test Manager; restore it there"};case"not_in_project":return{reason:"the session that designed it can't be saved anymore; design it again:",cmd:`kane-cli design tests --use-case ${e.useCase??"<use-case>"}`}}}function q(e){if(e.some(r=>r.stop.why==="outdated"))return{pair:i.dispatchTestManagerOutdated()};let t=e.find(r=>r.stop.why==="lookup")?.stop;if(t?.why==="lookup")return{pair:t.refusal};let s=e.find(r=>r.stop.why==="no_work");if(s)return{pair:i.dispatchProjectHasNoWork(s.projectName)};let n=[{text:i.dispatchStopped(e.length)}],a=new Set;for(let{relPath:r,stop:o}of e){if(o.why==="outdated"||o.why==="lookup"||o.why==="no_work")continue;let{reason:c,cmd:u}=b(o),d=u!==void 0&&a.has(u);n.push({text:` ${r}`,dim:!0},{text:` ${d?`${c.replace(/:$/,"")}, as above`:c}`,dim:!0}),u&&!d&&(a.add(u),n.push({text:` ${u}`}))}return n.push({text:i.dispatchNext(e.length)}),{lines:n}}function z(e){return{refusal:e.reason==="outdated"?i.testManagerMadeItsOwn():i.testCaseAttachFailed(),exit:1}}function E(e){switch(e.code){case"NO_CASE":return{why:"missing",session:e.session};case"CASE_BROKEN":return{why:"gone",session:e.session};case"CASE_ARCHIVED":return{why:"archived",internalId:e.internalId};case"TEST_FILE_STALE":return{why:"not_in_project",useCase:e.useCase}}}function v(e,t){return e instanceof k?{code:e.code,message:e.message,...e.remedy?{remedy:e.remedy}:{}}:e instanceof l&&e.status===401?i.credentialsRejected():e instanceof l&&e.code==="NOT_FOUND"?i.noAccess(t):e instanceof l&&e.code==="PROJECT_NOT_MARKED"?i.assuranceOff(t):i.noConnection()}var f=class extends Error{};async function L(e,t){let s,n=new Promise((a,r)=>{s=setTimeout(()=>r(new f(`Lattice took over ${t} ms`)),t)});try{return await Promise.race([e,n])}finally{clearTimeout(s)}}export{S as a,_ as b,K as c,V as d,X as e,q as f,z as g,f as h,L as i};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as P}from"./chunk-
|
|
2
|
+
import{a as P}from"./chunk-H6QHG62O.js";import{b as Le}from"./chunk-ABNQL3PQ.js";import{a as _t}from"./chunk-BSRSXYDZ.js";import{a as m,c as Nt,d as At,e as I,f as Ae,g as Ce,h as Ct,i as Te,j as Tt}from"./chunk-CB4ARIHR.js";import{a as Z,c as xt,e as It}from"./chunk-2EKLTUY2.js";import{a as Rt}from"./chunk-73Y6T2UK.js";import{d as Ot}from"./chunk-XMPTFXPW.js";import{a as nt}from"./chunk-WN5VKKJ3.js";import{a as ie}from"./chunk-HCBYKLMW.js";import{b as Pt,c as Ft}from"./chunk-UVL6XQHU.js";import{a as Lt}from"./chunk-VRIZDOO5.js";import{b as qe,d as qt}from"./chunk-ZHWU6L2G.js";import{a as vt,b as Ne,c as Et,d as de}from"./chunk-5ORBAYTU.js";import{Da as pt,Ea as S,Ga as ft,Ha as ht,Ia as mt,Ka as gt,Na as bt,Pa as W,Qa as L,Sa as ke,Ta as wt,Ua as yt,Va as C,Xa as Re,Ya as St,bb as ve,cb as Ee,eb as $,fb as w,gb as xe,h as at,hb as $t,ib as Ie,kb as Oe,l as ct,lb as kt,mb as _e,o as lt,ob as X,s as dt,xa as K,ya as ut}from"./chunk-5EAJO372.js";import{c as st,n as it}from"./chunk-DBMW3VUN.js";import{a as q}from"./chunk-KU3YHPWZ.js";import{a as ce,b as le}from"./chunk-7V4BQSSV.js";import{c as rt}from"./chunk-G4K3TP2I.js";import{a as ae}from"./chunk-YJAQZMJT.js";import{a as ot}from"./chunk-6PIIUAZF.js";import{z as A}from"./chunk-YKOZBFR3.js";import{r as et,s as tt}from"./chunk-WMXBRC4B.js";import{a as M,b as k,i as se}from"./chunk-33DWJV67.js";import{a as Nn}from"./chunk-6YGTRKDT.js";import{e as z}from"./chunk-UR6MHSHU.js";import{existsSync as co}from"fs";var D=z(Nn(),1);import{existsSync as re,mkdirSync as Sn,readdirSync as Lr,readFileSync as we,rmSync as yn,writeFileSync as Pr,renameSync as Fr}from"fs";import{randomBytes as Jr}from"crypto";import{basename as Br,join as ze}from"path";import{appendFileSync as he,closeSync as cr,existsSync as b,mkdirSync as T,openSync as lr,readdirSync as j,readFileSync as y,renameSync as ge,rmdirSync as dr,rmSync as _,realpathSync as ur,statfsSync as pr,statSync as on,writeFileSync as fr}from"fs";import{randomBytes as sn}from"crypto";import{basename as an,dirname as R,join as f,relative as Me}from"path";var An=/^sha256:[0-9a-f]{64}$/;function Q(t){let e=new Set,n=r=>{typeof r=="string"&&An.test(r)&&e.add(r)};for(let r of t.nodes??[])n(r.content?.blob);for(let r of Object.values(t.media??{})){n(r.text_blob);for(let o of r.images??[])n(o.blob);n(r.plugin?.index),n(r.plugin?.notes),n(r.plugin?.coverage)}return{blobs:[...e].sort(),proposalId:t.proposal_id??null}}function Pe(t){return"sha256:"+le(Buffer.from("assurance.proposal\0"+ce(JSON.parse(t)),"utf8"))}import{mkdirSync as Cn,readFileSync as Tn}from"fs";import{dirname as qn,join as Ln}from"path";var Jt="locations.json",Bt="state.json";function ue(t,e){return Ln(t,"sync",e)}function Ut(t){return Yt(ue(t,Jt),{version:1,locations:[]})}function $o(t,e){jt(ue(t,Jt),e)}function F(t){return Yt(ue(t,Bt),{version:1,entries:{}})}function Mt(t,e){jt(ue(t,Bt),e)}function Wt(t,e){let n=t.locations;if(n.length===0)throw new Error("no locations yet \u2014 add one with kane-cli context sync add <name> <descriptor>");if(e!==void 0){let o=n.find(i=>i.name===e);if(o)return o;throw new Error(`no location named ${e} \u2014 known locations: ${n.map(i=>i.name).join(", ")}`)}if(n.length===1)return n[0];let r=n.find(o=>o.name==="origin");if(r)return r;throw new Error(`name a location: ${n.map(o=>o.name).join(", ")}`)}var H=class extends Error{code="WITNESS_LOWERED"};function Ht(t,e,n){let r=t.entries[e];if(!r)throw new Error(`no sync state for ${e} \u2014 run kane-cli context sync add ${e} <descriptor> first`);let o=r.witness;if(o){if(n.seq<o.seq)throw new H(`${e} is behind what it already served: position ${o.seq} was seen there, now ${n.seq}`);if(n.seq===o.seq&&n.hash!==o.hash)throw new H(`${e} changed the record at position ${o.seq}: ${o.hash} was seen there, now ${n.hash}`)}r.witness=n}function ko(t,e,n){let r=t.locations.length,o=t.locations.filter(i=>i.name!==n);if(o.length===r){let i=r===0?"none":t.locations.map(s=>s.name).join(", ");throw new Error(`no location named ${n} \u2014 known locations: ${i}`)}return t.locations=o,e.entries[n]?.witness??null}function Yt(t,e){let n;try{n=Tn(t,"utf-8")}catch(o){if(o.code==="ENOENT")return e;throw new Error(`${t} could not be read: ${o instanceof Error?o.message:String(o)}`)}let r;try{r=JSON.parse(n)}catch(o){throw new Error(`${t} is not readable JSON: ${o instanceof Error?o.message:String(o)}`)}if(typeof r!="object"||r===null||!("version"in r)||r.version!==1)throw new Error(`${t} is not a version 1 sync file \u2014 this store was written by a newer kane-cli`);return r}function jt(t,e){Cn(qn(t),{recursive:!0}),$(t,JSON.stringify(e,null,2)+`
|
|
3
3
|
`)}import{closeSync as Yn,existsSync as Zt,linkSync as jn,mkdirSync as Vn,openSync as Gn,readFileSync as Dn,rmSync as Qt,writeFileSync as zn}from"fs";import{dirname as pe,join as en}from"path";import{existsSync as Un}from"fs";import{join as Mn}from"path";var Vt=1e3,Pn=999999999,Gt=/^assurance\/context@(\d+)$/,Fn=Number(Gt.exec(q)[1]);async function te(t,e){let n=await t.get(I(e));if(n===null)throw ee(`position ${e} is absent`);return{hash:Fe(e,n).hash,raw:n}}function Fe(t,e){let n=i=>new m("SYNC_OBJECT_CORRUPT",`the record at position ${t} on the storage is not usable: ${i}`,"the storage object needs a human look; nothing was changed"),r;try{r=JSON.parse(Buffer.from(e).toString("utf8"))}catch(i){throw n(`not JSON (${i instanceof Error?i.message:String(i)})`)}if(typeof r!="object"||r===null||Array.isArray(r)||r.seq!==t)throw n(`it says it is position ${String(r?.seq)}`);let o=r.schema_version===ve&&Ee(r);if(r.schema_version!==void 0&&r.schema_version!==q&&!o){let i=Gt.exec(r.schema_version);throw i&&Number(i[1])>Fn?new m("SYNC_CLIENT_TOO_OLD",`position ${t} is stamped ${r.schema_version}; this kane-cli reads ${q}`,`upgrade kane-cli to a release that reads ${r.schema_version}, then run the command again`):n(`it is stamped ${r.schema_version}, this build reads ${q}`)}if(r.schema_version===q&&Ee(r))throw n(`it carries a source-plugin fact and is stamped ${q}; such a record is stamped ${ve}`);if(r.parents!==void 0&&!(r.prev_hash===null?r.parents.length===0:r.parents.length===1&&r.parents[0]===r.prev_hash))throw n("parents does not mirror prev_hash");return{record:r,hash:L(r)}}async function J(t,e,n=0){let r=e,o=1,i;for(;;){let p=e+o;if(!await t.head(I(p))){i=p;break}r=p,o*=2}if(r===e&&e>0&&!await t.head(I(e)))return J(t,0);for(;i-r>1;){let p=r+Math.floor((i-r)/2);await t.head(I(p))?r=p:i=p}let s=r;if(s===0){if(await t.head(At))throw ee("meta.json exists but position 1 is gone");let p=(await t.list(Nt)).map(Ce).find(h=>h!==null);if(p!==void 0)throw ee(`position ${p} exists but position 1 is gone`);return{seq:0,hash:null,raw:null}}let a=[Ae(s),Ae(Math.min(s+Vt,Pn))];a[1]===a[0]&&a.pop();let c=new Set;for(let p of a)for(let h of await t.list(p)){let x=Ce(h);if(x!==null){if(x>s){if(await t.head(I(s+1))){if(n>=Jn)throw Bn(s);return J(t,s,n+1)}throw ee(`position ${x} exists above the tail at ${s}`)}c.add(x)}}let d=s-(s-1)%Vt;for(let p=d;p<=s;p++)if(!c.has(p))throw ee(`position ${p} is missing below the tail at ${s}`);let{hash:l,raw:u}=await te(t,s);return{seq:s,hash:l,raw:u}}var Jn=3;function Bn(t){return new m("SYNC_REMOTE_HOLE",`the storage kept growing while its tail was being found (last seen at ${t}); nothing was changed`,"run the command again in a moment")}function ee(t){return new m("SYNC_REMOTE_HOLE",`the storage has a hole: ${t} \u2014 a position was deleted below evidence of a later one`,"restore the missing position from a copy that holds it; nothing was changed")}function Dt(t,e){let n=St(t,e);if(n===null)throw new S(`no local record at position ${e} \u2014 run kane-cli context fsck`);if(!(n!==Re&&Un(Mn(t,"commits",`${String(e).padStart(6,"0")}-${n.slice(7,19)}.json`))))throw new m("SYNC_LOCAL_RECORD_CORRUPT",`the local record at position ${e} ${n===Re?"is unreadable":"does not hash to its file name"}`,"run kane-cli context fsck, then restore the record from a backup or a clone; nothing was changed");return n}async function zt(t,e,n){let r=C(t),o=await J(e,n?.seq??0),i=async u=>u===o.seq?o.hash:(await te(e,u)).hash;if(n&&(o.seq<n.seq||await i(n.seq)!==n.hash))throw new m("SYNC_REMOTE_ROLLED_BACK",`the storage was rolled back: position ${n.seq} was seen there with ${n.hash}, `+(o.seq<n.seq?`now its tail is ${o.seq}`:"now a different record sits there"),"restore the storage from a copy that holds the witnessed records, or remove and re-add the location after a human has decided it was rebuilt on purpose");let s=o.seq===0?null:{seq:o.seq,hash:o.hash};if(s===null)return{kind:"empty-storage",local:r,storage:s};if(r===null)return{kind:"empty-local",local:r,storage:s};if(Dt(t,1)!==await i(1))return{kind:"foreign-lineage",local:r,storage:s};let a=Math.min(r.seq,s.seq),c=async u=>(u===r.seq?r.hash:Dt(t,u))===await i(u);if(await c(a))return{kind:r.seq===s.seq?"up-to-date":r.seq<s.seq?"behind":"ahead",local:r,storage:s};let d=1,l=a;for(;l-d>1;){let u=d+Math.floor((l-d)/2);await c(u)?d=u:l=u}return{kind:"diverged",local:r,storage:s,at:l}}function Kt(t){let e=new Map;return{indexOf(n){if(!e.has(n)){let r=t(n);e.set(n,r===null?void 0:it(r))}return e.get(n)},notesBlob:n=>t(n),coverageBlob:n=>t(n)}}function Xt(t,e){for(let[n,r]of Object.entries(t??{})){let o=r?.plugin;if(o==null||typeof o!="object")continue;let i;if(typeof o.index=="string"){if(i=e.indexOf(o.index),i===null)return{code:"UNIT_INDEX_INVALID",sourceId:n,blob:o.index,detail:"that blob is not a unit index"};if(i!==void 0&&(i.plugin!==o.id||i.rules!==o.rules))return{code:"UNIT_INDEX_INVALID",sourceId:n,blob:o.index,detail:`that index was written by plugin ${JSON.stringify(i.plugin)} under rules ${JSON.stringify(i.rules)}, not by ${JSON.stringify(o.id)} under rules ${JSON.stringify(o.rules)} as the record says`}}if(typeof o.notes=="string"){let s=e.notesBlob(o.notes);if(s===null)continue;let a=qt(s);if(a===null)return{code:"NOTES_INVALID",sourceId:n,blob:o.notes,detail:`that blob is not the stored form of a version's notes${Hn(s)}`};if(a.plugin!==o.id)return{code:"NOTES_INVALID",sourceId:n,blob:o.notes,detail:`those notes were written by plugin ${JSON.stringify(a.plugin)}, not by ${JSON.stringify(o.id)} as the record says`};let c=new Set((i?.units??[]).map(l=>l.id).filter(l=>l!==st)),d=qe(a,c);if(d!==null)return{code:"NOTES_INVALID",sourceId:n,blob:o.notes,detail:d}}if(typeof o.coverage=="string"){let s=e.coverageBlob(o.coverage);if(s===null)continue;let a=Wn(s);if(a===void 0)return{code:"COVERAGE_INVALID",sourceId:n,blob:o.coverage,detail:"that blob is not the stored form of a coverage plan (it is not JSON)"};let c=(i?.units??[]).map(l=>l.id),d=Lt(a,c);if(d!==null)return{code:"COVERAGE_INVALID",sourceId:n,blob:o.coverage,detail:`that blob is not the stored form of a coverage plan of this version (${/^(expected|group \d|the unit|two groups)/.test(d)?d:`it ${d}`})`};if(ce(a)!==Buffer.from(s).toString("utf8"))return{code:"COVERAGE_INVALID",sourceId:n,blob:o.coverage,detail:"that blob is not the stored form of a coverage plan (its bytes are not the canonical form of what it holds)"};if(a.plugin!==o.id)return{code:"COVERAGE_INVALID",sourceId:n,blob:o.coverage,detail:`that coverage plan was written by plugin ${JSON.stringify(a.plugin)}, not by ${JSON.stringify(o.id)} as the record says`}}}return null}function Wn(t){try{return JSON.parse(Buffer.from(t).toString("utf8"))}catch{return}}function Hn(t){try{let e=qe(JSON.parse(Buffer.from(t).toString("utf8")));return e===null?" (its bytes are not the canonical form of what it holds)":e.startsWith("note ")?` (${e})`:` (it ${e})`}catch{return" (it is not JSON)"}}var Kn=2e3;async function rs(t,e,n,r,o){let i=F(t).entries[n]?.witness??null,s=await zt(t,e,i),a=s.local?.seq??0,c={imported:0,from:a,to:a,blobs:0,proposals:0};switch(s.kind){case"empty-storage":return r(`nothing to pull: ${n} is empty`),c;case"up-to-date":return r("up to date"),c;case"ahead":return o?.quietAhead||r(`nothing to pull; you are ahead of ${n} \u2014 run kane-cli context push ${n}`),c;case"diverged":throw new m("SYNC_DIVERGED",`you and ${n} both added work after position ${s.at-1}; nothing was pulled`,`run kane-cli context pull ${n} --rebase to save your local work, take the team version from ${n}, and then reapply yours`);case"foreign-lineage":throw new m("SYNC_FOREIGN_LINEAGE",`${n} holds a different history (its first record is not this store's)`,`to work on it, clone it: kane-cli context clone <descriptor of ${n}> <dir>; to share this store, add an empty location`);case"behind":case"empty-local":break}let d=s.storage.seq,l=await Be(t,e,s.local,s.storage,Xn(t,s.local),r);return Ue(t,l,s.local?.hash??null,n),X(t),Je(t,n,{seq:d,hash:l.records[l.records.length-1].hash}),{imported:l.records.length,from:a,to:d,blobs:l.blobs.size,proposals:l.proposals.size}}function Je(t,e,n,r){let o=r?.lockHeld?()=>{}:W(t,{deadlineMs:Kn});try{let i=F(t),s=i.entries[e]?.witness??null;if(r?.forwardOnly&&s&&s.seq>n.seq)return;try{Ht(i,e,n)}catch(a){throw a instanceof H?new m("SYNC_REMOTE_ROLLED_BACK",a.message,"restore the storage from a copy that holds the witnessed records, or remove and re-add the location after a human has decided it was rebuilt on purpose"):a}Mt(t,i)}finally{o()}}function Xn(t,e){let n=kt(t);return n&&n.applied.seq===(e?.seq??0)&&n.applied.hash===(e?.hash??null)?n:X(t)}async function Be(t,e,n,r,o,i=()=>{}){let s=await Qn(e,n?.seq??0,n?.hash??null,r.seq,r.hash),a=nr(s,o),c=await er(t,e,s);ir(t,s),ar(t,s,a);let d=await tr(t,e,s,i);return{records:s,blobs:c,proposals:d}}function Ue(t,e,n,r,o){for(let[a,c]of e.proposals){let[d,l]=a.split("/");Zn(en(pe(Z(t,d)),l),c)}let i=n,s=null;for(let a=0;a<e.records.length;a+=xe){let c=e.records.slice(a,a+xe),d=o?.lockHeld?()=>{}:W(t);try{$t(t,c.map(({seq:l,raw:u})=>({seq:l,raw:u})),i,{...o,lockHeld:!0})}catch(l){if(!(l instanceof bt))throw l;let u=`this store appended position ${C(t)?.seq??0} while the pull was`;throw new m("SYNC_LOCAL_MOVED",s===null?`${u} being prepared; nothing was imported`:`${u} landing; positions ${e.records[0].seq}..${s} were imported, a valid prefix, and nothing more`,`kane-cli context pull ${r}`)}finally{d()}i=c[c.length-1].hash,s=c[c.length-1].seq,o?.afterChunk?.(s)}}function Zn(t,e){Vn(pe(t),{recursive:!0});let n=`${t}.tmp-${process.pid}`,r=Gn(n,"w");try{zn(r,e),ae(r)}finally{Yn(r)}try{jn(n,t)}catch(o){if(o.code!=="EEXIST")throw Qt(n,{force:!0}),o}Qt(n,{force:!0}),w(pe(t))}async function Qn(t,e,n,r,o){let i=[],s=n;for(let a=e+1;a<=r;a++){let c=await t.get(I(a));if(c===null)throw new m("SYNC_REMOTE_HOLE",`the storage has a hole: position ${a} is missing below its tail at ${r}`,"restore the missing position from a copy that holds it; nothing was changed");let{record:d,hash:l}=Fe(a,c);if(d.prev_hash!==s)throw new m("SYNC_REMOTE_CHAIN_BROKEN",`position ${a} on the storage is sealed onto ${String(d.prev_hash)}, but position ${a-1} hashes ${String(s)}`,"the storage chain needs a human look; nothing was changed");if(a===r&&l!==o)throw new m("SYNC_REMOTE_CHAIN_BROKEN",`the tail at position ${r} changed while this pull ran: it hashed ${o}, now ${l}`,"run kane-cli context pull again");i.push({seq:a,hash:l,raw:Buffer.from(c).toString("utf8"),record:d}),s=l}return i}async function er(t,e,n){let r=new Set;for(let{seq:o,record:i}of n)for(let s of Q(i).blobs){if(r.has(s))continue;let a=de(t,s);if(a!==null&&Ne(a)===s)continue;let c=await e.get(Ct(s));if(c===null)throw new m("SYNC_REMOTE_HOLE",`the storage has a hole: position ${o} names blob ${s}, which the storage does not hold`,"restore the blob from a copy that holds it; nothing was changed");let d=Buffer.from(c);if(Ne(d)!==s)throw new m("SYNC_OBJECT_CORRUPT",`the blob ${s} on the storage does not hash to its name (named by position ${o})`,"the storage object needs a human look; nothing was changed");a===null?Et(t,d):$(vt(t,s),d),r.add(s)}return r}async function tr(t,e,n,r){let o=new Map,i=new Set;for(let{seq:s,record:a}of n){let c=Q(a).proposalId;if(c===null||i.has(c))continue;i.add(c);let d=Z(t,c),l=null;if(Zt(d))try{l=Pe(Dn(d,"utf8"))}catch{l=""}let u=await e.list(Tt(c));if(u.length===0)continue;if(u.length>1){r(`proposal ${c} (position ${s}) has ${u.length} payloads on the storage and the record names none of them; skipped`);continue}if(l!==null&&Te(c,l)===u[0])continue;let p=await e.get(u[0]);if(p===null)continue;let h=null;try{h=Pe(Buffer.from(p).toString("utf8"))}catch{h=null}if(h===null||Te(c,h)!==u[0]){r(`proposal ${c} (position ${s}) on the storage does not digest to its key ${u[0]}; skipped`);continue}if(l===null){o.set(`${c}/proposal.json`,Buffer.from(p));continue}let x=`${c}/proposal.${h.slice(7,19)}.json`;Zt(en(pe(d),x.slice(c.length+1)))||(r(`proposal ${c} (position ${s}) differs from the one here; the storage's payload is installed beside it as ${x}`),o.set(x,Buffer.from(p)))}return o}function nr(t,e){let n=structuredClone(e);for(let{seq:r,hash:o,record:i}of t)try{lt(n,i,o)}catch(s){throw s instanceof ct?new m("SYNC_REMOTE_ADMISSION_RED",`position ${r} would not pass this store's checks: ${s.message}`,`nothing was imported; ask whoever pushed position ${r} to run kane-cli context fsck on their store, or upgrade kane-cli if theirs is newer`):s}return n}var fe=t=>t.slice(0,19),rr=t=>t===null?"no units":`units [${t.join(", ")}]`,or=t=>t===null?"no units":`[${t.join(", ")}]`,sr=(t,e)=>`the record at position ${t} says citation ${fe(e.ecid)} is in ${rr(e.said)}; its lines ${e.anchor} of ${e.sourceId} fall in ${or(e.found)} \u2014 nothing was applied`;function ir(t,e){let n=Kt(r=>de(t,r));for(let{seq:r,record:o}of e){let i=Xt(o.media,n);if(i===null)continue;let s=i.code==="UNIT_INDEX_INVALID"?"unit index":i.code==="NOTES_INVALID"?"notes":"coverage plan";throw new m(i.code==="UNIT_INDEX_INVALID"?"SYNC_UNIT_INDEX_INVALID":i.code==="NOTES_INVALID"?"SYNC_NOTES_INVALID":"SYNC_COVERAGE_INVALID",`the record at position ${r} names blob ${fe(i.blob)} as the ${s} of ${i.sourceId}, and ${i.detail} \u2014 nothing was applied`,`this build cannot take that record. It was written by a kane-cli with a fault or was altered; tell whoever pushed position ${r}, and keep working from your own store`)}}function ar(t,e,n){let r={mediaOf:o=>Object.hasOwn(n.media,o)?n.media[o]:void 0,getBlob:o=>de(t,o)};for(let{seq:o,record:i}of e){let s=at(i.edges,r);if(s!==null)throw s.code==="UNIT_INDEX_MISSING"?new m("SYNC_UNIT_INDEX_MISSING",`the record at position ${o} cites ${s.anchor} of ${s.sourceId} at version ${fe(s.versionCid)}, and that version's unit index (blob ${fe(s.index??"")}) is not in this store's blob store, so the citation's units cannot be checked \u2014 nothing was applied`,"restore this store's blobs from a copy, or clone the location into a new folder (a clone fetches every blob); kane-cli context fsck names what is missing"):new m("SYNC_UNITS_MISMATCH",sr(o,s),`this build cannot take that record. It was written by a kane-cli with a fault or was altered; tell whoever pushed position ${o}, and keep working from your own store`)}}var hr=["pending-facts.ndjson","signals.ndjson","store.json"],mr=/^\d{6}-[0-9a-f]{12}\.json$/,tn=["staged","fenced","backed-up","trimmed","importing","imported","unfenced"],cn=2e3,gr=1440*60*1e3,br=(t,e)=>f(t,"sync","backups",`${e}-reset`),wr=()=>new Date().toISOString().replace(/[:.]/g,"-"),yr=t=>f(t,"sync","incoming"),v=t=>f(t,"sync","replay"),We=t=>an(t),ln=(t,e)=>f(v(t),`${We(e)}.receipt.json`),N=t=>f(t,"sync","journal.json"),O=t=>f(t,"commits"),ne=t=>f(O(t),ke),V=(t,e)=>f(yr(t),e),He=(t,e)=>`${String(t).padStart(6,"0")}-${e.slice(7,19)}.json`,Y=t=>"sha256:"+le(t),dn=()=>({pid:process.pid,nonce:sn(4).toString("hex")});async function vs(t,e,n,r,o,i={}){if(r.kind!=="diverged"||r.at===void 0)throw new Error(`reset needs a diverged relation, got ${r.kind}`);let s=r.at;if(b(N(t)))throw new m("SYNC_STORE_BUSY","a reset is already in progress","run kane-cli context sync doctor");rn(t),$r(t,n),Sr(t);let{records:a,hashes:c}=yt(t),d={seq:s-1,hash:c[s-2]},l=Oe();_e(t,l,a.slice(0,s-1),c.slice(0,s-1),{writeNodeFiles:!1});let u=await Be(t,e,d,r.storage,l),p=a.slice(s-1).map(U=>He(U.seq,c[U.seq-1])),h=Ar(t,a,c,s),x=fn(t,p,h);kr(t,Rr(u)+x.reduce((U,_n)=>U+on(_n.src).size,0));let Qe=i.ts??wr(),oe={nonce:sn(8).toString("hex"),state:"staged",name:n,holder:dn(),base:d,at:s,storage:r.storage,backup:br(t,Qe),ts:Qe,moved:p,testIds:h,counts:{records:u.records.length,blobs:u.blobs.size,proposals:u.proposals.size},manifest:[]};Er(t,oe.nonce,u);let On=W(t,{deadlineMs:cn});try{if(C(t)?.hash!==r.local?.hash)throw new m("SYNC_STORE_BUSY","the chain moved while the reset was being prepared",`run kane-cli context pull ${n} --rebase again`);return rn(t),Ye(t,oe,i.afterTransition),un(t,oe,o,i)}catch(U){throw b(N(t))||me(V(t,oe.nonce)),U}finally{On()}}async function Es(t,e,n=()=>{}){let r={state:"none",detail:"no reset in progress"},o=nn(t);if(o===null)return r;let i=W(t,{deadlineMs:cn});try{let s=nn(t);if(s===null||s.nonce!==o.nonce)return r;if(s.holder.pid!==process.pid&&K(s.holder.pid))throw new m("SYNC_STORE_BUSY",`a reset is running as pid ${s.holder.pid} \u2014 wait`,"wait for it to finish, then run the command again");if(s.holder=dn(),Ye(t,s),e==="resume"){let l=un(t,s,n,{});return{state:"resumed",detail:`finished the reset interrupted at '${s.state}': ${l.moved.length} records moved to ${l.backup}`,result:l}}if(B(s,"imported"))return{state:"refused",detail:`the shared records are already imported, so the reset can only finish (kane-cli context sync or kane-cli context pull finishes it); its receipt will be ${ln(t,s.backup)}`};let a=Nr(t,s),c=0;for(let{name:l,hash:u}of s.manifest){if(!l.startsWith("commits/")&&!l.startsWith("intents/"))continue;let p=f(t,l);try{if(b(p)){if(Y(y(p))!==u)throw new Error("the live file does not match the backup manifest");continue}let h=y(f(s.backup,l));if(Y(h)!==u)throw new Error("the backup copy does not match the manifest");T(R(p),{recursive:!0}),$(p,h),l.startsWith("commits/")&&c++}catch(h){throw new Error(`restore stopped at ${l}: ${h instanceof Error?h.message:String(h)}; re-run abort`)}}pn(t,s.nonce),_(Ie(t),{recursive:!0,force:!0});let d=`${s.backup}.aborted`;return b(s.backup)&&ge(s.backup,d),w(R(s.backup)),_(N(t),{force:!0}),w(R(N(t))),me(d),me(V(t,s.nonce)),{state:"aborted",detail:`aborted the reset at '${s.state}': ${a} imported records removed, ${c} records put back, the chain is as it was`}}finally{i()}}function nn(t){return b(N(t))?JSON.parse(y(N(t),"utf8")):null}var B=(t,e)=>tn.indexOf(t.state)>=tn.indexOf(e);function un(t,e,n,r){let o=l=>{e.state=l,Ye(t,e,r.afterTransition)},i=()=>{if(!je(t,e.nonce))throw new Error("sentinel missing \u2014 run kane-cli context sync doctor")};B(e,"fenced")||(vr(t,e.nonce),o("fenced")),B(e,"backed-up")||(i(),e.manifest=Ir(t,e),o("backed-up")),B(e,"trimmed")||(i(),Or(t,e),o("trimmed")),B(e,"importing")||(i(),o("importing")),B(e,"imported")||(i(),_(Ie(t),{recursive:!0,force:!0}),_r(t,e,xr(t,e.nonce),r.afterChunk),o("imported")),B(e,"unfenced")||(pn(t,e.nonce),o("unfenced"));let s=X(t),a=Cr(t,e),c=It(t,gr),d=Tr(t,f(v(t),We(e.backup)),new Set(Object.keys(s.nodeLabel)));T(v(t),{recursive:!0}),$(ln(t,e.backup),JSON.stringify({from:e.at,moved:e.moved,storageTail:e.storage,quarantinedTests:a,droppedPendingFacts:d,liveSideQueues:c},null,2)+`
|
|
4
4
|
`),w(v(t)),_(N(t),{force:!0}),w(R(N(t))),me(V(t,e.nonce)),Je(t,e.name,e.storage,{lockHeld:!0}),n(`saved ${e.moved.length} local record${e.moved.length===1?"":"s"} from position ${e.at} in ${e.backup}; ${e.name}'s records took their place`);for(let l of a)n(`quarantined test file ${l}: its test was minted by a moved record`);return{name:e.name,backup:e.backup,moved:e.moved,quarantinedTests:a,pulled:{imported:e.counts.records,from:e.base.seq,to:e.storage.seq,blobs:e.counts.blobs,proposals:e.counts.proposals}}}function rn(t){let e=new Date,n=f(t,"sessions");if(b(n))for(let r of j(n)){let o=f(n,r,".lock");if(!b(o))continue;let i;try{i=JSON.parse(y(o,"utf8"))}catch{continue}let s=e.getTime()-new Date(i.ts??0).getTime();if(typeof i.pid=="number"&&K(i.pid)&&s<rt)throw new m("SYNC_STORE_BUSY",`session ${r} is live (pid ${i.pid})`,"finish or pause that session, then run the reset again")}for(let{key:r,grant:o}of pt(t))if(!ut(o,e))throw new m("SYNC_STORE_BUSY",`lock ${r} is held by ${o.verb} (pid ${o.pid})`,"wait for that command to finish, then run the reset again")}function Sr(t){let e=gn(t);if(!e)return;let n=e.listHolds().length;throw new m("SYNC_REBASE_PENDING",`your last rebase still has ${n} unresolved decision${n===1?"":"s"}; no new rebase was started`,"run kane-cli context sync or kane-cli context pull again to continue. To discard the unresolved local changes instead, run kane-cli context sync doctor --abort")}function $r(t,e){let n=F(t).entries[e]?.binding,r=ot(t),o=ur(t),i=on(t),s=r!==null&&n?.instance_id===r.context_instance_id&&n.realpath===o;if(!(s&&n.dev===i.dev&&n.ino===i.ino))throw new m("SYNC_COPIED_STORE_UNRESOLVED",r===null?"this store has no store.json ids, so it cannot prove it is the one the location was added from":s?`this store's directory is not the one ${e} was bound from: same ids and path, but the .context inode changed \u2014 it was replaced in place by a copy`:`this store is not the one ${e} was added from (${n?`bound to ${n.realpath}`:"no binding"}; this is ${o})`,`re-run kane-cli context sync add ${e} <descriptor> from this directory to bind it`)}function kr(t,e){let n=pr(t),r=n.bavail*n.bsize;if(!(r>=2*e))throw new m("SYNC_DISK_LOW",`${r} bytes free, the reset needs ${2*e} (twice the staged suffix plus the backup)`,"free some disk space, then run the reset again")}function Rr(t){let e=0;for(let n of t.records)e+=Buffer.byteLength(n.raw);for(let n of t.proposals.values())e+=n.length;return e}function Ye(t,e,n){T(R(N(t)),{recursive:!0}),$(N(t),JSON.stringify(e,null,2)+`
|
|
5
5
|
`),n?.(e.state)}function vr(t,e){let n=ne(t);try{let r=lr(n,"wx");try{fr(r,wt(e)),ae(r)}finally{cr(r)}w(O(t))}catch(r){if(r.code!=="EEXIST")throw r;if(!je(t,e))throw new Error(`${n} belongs to another reset \u2014 run kane-cli context sync doctor`)}}function pn(t,e){if(b(ne(t))){if(!je(t,e))throw new Error(`${ne(t)} belongs to another reset \u2014 left in place`);_(ne(t)),w(O(t))}}function je(t,e){try{return JSON.parse(y(ne(t),"utf8")).kane?.nonce===e}catch{return!1}}function Er(t,e,n){let r=V(t,e);for(let o of["records","proposals"])T(f(r,o),{recursive:!0});for(let o of n.records)$(f(r,"records",`${o.seq}.json`),o.raw);for(let[o,i]of n.proposals)T(R(f(r,"proposals",o)),{recursive:!0}),$(f(r,"proposals",o),i)}function xr(t,e){let n=V(t,e),r=j(f(n,"records")).map(i=>Number(i.slice(0,-5))).sort((i,s)=>i-s).map(i=>{let s=y(f(n,"records",`${i}.json`),"utf8"),a=JSON.parse(s);return{seq:i,raw:s,record:a,hash:L(a)}}),o=new Map;for(let i of Ve(f(n,"proposals")))o.set(Me(f(n,"proposals"),i),y(i));return{records:r,blobs:new Set,proposals:o}}function me(t){_(t,{recursive:!0,force:!0});try{dr(R(t))}catch{}}function fn(t,e,n){let r=[],o=a=>{r.push({name:a,src:f(t,a)})},i=[];for(let a of e){o(`commits/${a}`);let c=JSON.parse(y(f(O(t),a),"utf8"));i.push(c);let d=dt(t,L(c));b(d)&&o(Me(t,d))}let s=f(t,"sessions");if(b(s))for(let a of Ve(s))o(Me(t,a));for(let a of hr)b(f(t,a))&&o(a);for(let a of j(t))xt.test(a)&&o(a);for(let a of i){let c=Q(a).proposalId;c!==null&&b(Z(t,c))&&o(`proposals/${c}/proposal.json`)}for(let a of mn(t,n))r.push({name:`tests/${an(a)}`,src:a});return r}function Ve(t){let e=[];for(let n of j(t,{withFileTypes:!0})){let r=f(t,n.name);n.isDirectory()?e.push(...Ve(r)):n.isFile()&&e.push(r)}return e}function Ir(t,e){let n=f(e.backup,"manifest.json");if(b(n))return JSON.parse(y(n,"utf8"));let r=[];T(e.backup,{recursive:!0}),w(R(e.backup)),w(R(R(e.backup)));let o=(i,s)=>{let a=f(e.backup,i);T(R(a),{recursive:!0}),$(a,s),r.push({name:i,hash:Y(s)})};for(let{name:i,src:s}of fn(t,e.moved,e.testIds??[]))o(i,y(s));return o("base-witness.json",Buffer.from(JSON.stringify({name:e.name,base:e.base,storage:e.storage,from:e.at},null,2)+`
|
|
@@ -16,6 +16,6 @@ import{a as P}from"./chunk-6JUS2ULI.js";import{b as Le}from"./chunk-HG2ILWCE.js"
|
|
|
16
16
|
`).filter(d=>d!=="").slice(a.length);return c.length>0&&he(r,c.join(`
|
|
17
17
|
`)+`
|
|
18
18
|
`),_(o),i.length}var qr=/^sha256:[0-9a-f]{64}$/,Ge=class t{m=new Map;get size(){return this.m.size}set(e,n){this.m.set(e,n)}get(e){return this.m.get(e)}rewrite(e){if(typeof e=="string")return qr.test(e)?this.m.get(e)??e:e;if(Array.isArray(e))return e.map(n=>this.rewrite(n));if(e!==null&&typeof e=="object"){let n={};for(let[r,o]of Object.entries(e))n[r]=this.rewrite(o);return n}return e}toJSON(){return Object.fromEntries(this.m)}static fromJSON(e){let n=new t;for(let[r,o]of Object.entries(e??{}))n.set(r,o);return n}},De=class t{m=new Map;set(e,n){this.m.set(e.hash,{orig:e,fate:n})}get(e){let n=this.m.get(e.hash);return n&&n.orig.seq===e.seq?n.fate:void 0}byHash(e){return this.m.get(e)?.fate}toJSON(){return[...this.m.values()]}static fromJSON(e){let n=new t;for(let r of e??[])n.set(r.orig,r.fate);return n}},bn=t=>({cid:t.cid.toJSON(),record:t.record.toJSON()}),wn=t=>({cid:Ge.fromJSON(t?.cid),record:De.fromJSON(t?.record)});var Ps=["keep-theirs","apply-mine","apply-mine-as-new"];function Ke(t,e,n){switch(e){case"keep-theirs":return t==="generation"?"the local design stays in the backup; after this rebase, run design again if you want both":"the local change stays in the backup";case"apply-mine":return t==="slug"?`the name moves to the local node; the node that holds it on ${n} is reached by its id again`:t==="head"?`retire the source as it is now, ${n}'s version included`:`the local version lands on top of ${n}'s`;case"apply-mine-as-new":return`a new node beside ${n}'s (duplicate check first)`;case"later":return"leaves the rebase open; kane-cli context sync or kane-cli context pull asks again"}}function Fs(t,e,n){return{rebase_id:t,decision_id:e.holdId,kind:e.kind,intent:e.verb,seq:e.orig.seq,label:e.label,location:n,mine:e.mine,theirs:e.theirs,answers:e.answers.map(r=>({answer:r,consequence:Ke(e.kind,r,n)}))}}function Js(t){return{from:(n,r)=>{let o=n===0?null:t.tokenAt(n);if(n>0&&o===null)throw new S(`the record log holds no record at position ${n} \u2014 run kane-cli context rebuild`);let i=t.recordsSince(o);if(i.length>0&&o!==null&&t.resolveToken(o)?.hash!==r)throw new S(`broken chain after position ${n}: it no longer continues ${String(r)}`);return{records:i,hashes:i.map(L)}},hashAt:n=>{let r=t.tokenAt(n);return r===null?null:t.resolveToken(r)?.hash??null}}}var Bs=t=>t.dirOrThrow(),be=(t,e)=>ze(v(t),`${e}.json`),Ur=(t,e)=>ze(v(t),`${e}.lock`),G=class t{constructor(e,n){this.contextDir=e;this.data=n;this.maps=wn(n.maps)}maps;static create(e,n,r,o,i){let s=Br(n);if(re(be(e,s)))throw new S(`rebase ${s} already has a ledger \u2014 run kane-cli context sync or kane-cli context pull to continue it, or kane-cli context sync doctor --abort to close it`);let a=new t(e,{version:1,backup:n,backupId:s,from:o,state:"open",...i?{location:i}:{},items:r.map(d=>({...d})),maps:{cid:{},record:[]},aliases:[]}),c=!re(v(e));return Sn(v(e),{recursive:!0}),c&&w(ze(e,"sync")),a.save(),a}static open(e,n){let r=be(e,n);if(!re(r))throw new S(`no rebase ${n} here \u2014 kane-cli context sync doctor lists the rebases this store has`);let o;try{o=JSON.parse(we(r,"utf8"))}catch{o=null}if(!ht(o)||typeof o.backup!="string")throw new S(Hr(n));return new t(e,o)}get backupId(){return this.data.backupId}get location(){return this.data.location??"the location"}get rev(){return this.data.rev??0}get backup(){return this.data.backup}get from(){return this.data.from}get state(){return this.data.state}get closedBy(){return this.data.closedBy}get items(){return this.data.items}get aliases(){return this.data.aliases}item(e){let n=this.data.items.find(r=>r.k===e);if(!n)throw new Error(`no replay item ${e}`);return n}itemAt(e){return this.data.items.find(n=>n.orig.seq===e||n.group?.some(r=>r.seq===e))}beginItem(e,n){this.assertOpen();let r=this.item(e);r.begin={expectPrev:n},delete r.outcome,this.save()}endItem(e,n){this.assertOpen(),this.item(e).outcome=n,this.save()}pendingItem(){return this.data.items.find(e=>e.begin!==void 0&&e.outcome===void 0)}reconcileAll(e,n){let r=this.item(e);if(!r.begin)return[];let o=r.origins??Object.fromEntries((r.group??[r.orig]).map(c=>[c.hash,c.seq])),{records:i,hashes:s}=n.from(r.begin.expectPrev.seq,r.begin.expectPrev.hash),a=[];return i.forEach((c,d)=>{let l=c.replayed_from===void 0?void 0:o[c.replayed_from.orig.hash];l!==void 0&&a.push({seq:c.seq,hash:s[d],member:l})}),a}reconcileFrom(e,n,r){let o=this.item(e),i=o.origins??Object.fromEntries((o.group??[o.orig]).map(d=>[d.hash,d.seq])),{records:s,hashes:a}=n.from(r.seq,r.hash),c=[];return s.forEach((d,l)=>{let u=d.replayed_from===void 0?void 0:i[d.replayed_from.orig.hash];u!==void 0&&c.push({seq:d.seq,hash:a[l],member:u})}),c}reconcile(e,n){let r=this.reconcileAll(e,n).at(-1);return r?{seq:r.seq,hash:r.hash}:void 0}lastAppliedInChain(e){for(let n of[...this.data.items].reverse()){let r=n.outcome;if(r&&"applied"in r)return e.hashAt(r.applied.newSeq)===r.applied.newHash;if(r&&"deduped"in r&&r.deduped.newSeq!==void 0)return e.hashAt(r.deduped.newSeq)===r.deduped.newHash}return!0}setMaps(e){this.maps=e,this.data.maps=bn(e),this.save()}addAlias(e){this.data.aliases.push(e),this.save()}listHolds(){return this.data.items.flatMap(e=>e.outcome&&"held"in e.outcome?[e.outcome.held]:[])}resolveHold(e,n){let r=this.heldItem(e);if(!r.outcome.held.answers.includes(n))throw new S(`${n} is not an answer ${e} accepts`);return r.answer=n,this.reopen(r)}reopenHold(e){let n=this.heldItem(e);return delete n.answer,this.reopen(n)}heldItem(e){this.assertOpen();let n=this.data.items.find(r=>r.outcome&&"held"in r.outcome&&r.outcome.held.holdId===e);if(!n)throw new S(`${e} is not an open decision \u2014 kane-cli context sync status lists them`);return n}reopen(e){return delete e.outcome,delete e.begin,this.save(),e}close(e){this.data.state="closed",this.data.closedBy=e,this.save()}toJSON(){return structuredClone(this.data)}assertOpen(){if(this.data.state!=="open")throw new S(`rebase ${this.data.backupId} is closed \u2014 kane-cli context sync doctor lists every rebase and what it reapplied`)}save(){let e=be(this.contextDir,this.data.backupId);if(re(e)){let n=0;try{n=JSON.parse(we(e,"utf8")).rev??0}catch{n=0}if(n>(this.data.rev??0))throw new S(`the replay ledger for ${this.data.backupId} changed on disk (rev ${n}, this process holds rev ${this.data.rev??0}) \u2014 another process is working on it; run the command again`)}this.data.rev=(this.data.rev??0)+1,$(e,JSON.stringify(this.data,null,2)+`
|
|
19
|
-
`)}};function Mr(t,e){let n=Ur(t,e);Sn(v(t),{recursive:!0});let r=Jr(6).toString("hex");for(;;)try{return Pr(n,JSON.stringify({pid:process.pid,nonce:r}),{flag:"wx"}),()=>{try{JSON.parse(we(n,"utf8")).nonce===r&&yn(n)}catch{}}}catch(o){if(o.code!=="EEXIST")throw o;let i={};try{i=JSON.parse(we(n,"utf8"))}catch{i={}}if(typeof i.pid=="number"&&K(i.pid))throw new S(`rebase ${e} is being worked on by pid ${i.pid} \u2014 wait for it to finish`);yn(n,{force:!0})}}var Us=(t,e,n,r,o)=>G.create(t,e,n,r,o),Wr=(t,e)=>G.open(t,e),Hr=t=>`rebase ${t} has a ledger this store cannot read (sync/replay/${t}.json) \u2014 ${ft}`,$n=t=>{let e=v(t);return re(e)?Lr(e).filter(n=>n.endsWith(".json")&&!n.endsWith(".receipt.json")).sort().reverse().map(n=>n.slice(0,-5)):[]};function Yr(t,e={}){let n=[];for(let r of $n(t))try{n.push(G.open(t,r))}catch(o){if(!e.tolerant)throw o}return n}function Ms(t){return $n(t).filter(e=>{try{return G.open(t,e),!1}catch{return!0}})}function Ws(t,e){let n=be(t,e),r=`${n}.unreadable`;return Fr(n,r),w(v(t)),r}function gn(t){return Yr(t).find(e=>e.state==="open")}function jr(t){let e=t.outcome;return e?"applied"in e?`reapplied \u2192 record ${e.applied.newSeq}`:"held"in e?`decision ${e.held.holdId} (${e.held.kind})`:"deduped"in e?`already present: ${e.deduped.as.slice(0,19)}`:`not reapplied: ${e.skipped.reason}`:t.begin?"pending":"waiting"}function Hs(t,e,n={}){let r=t.itemAt(e);if(!r)throw new S(`no moved record at position ${e} in rebase ${t.backupId}`);let o=r.label.startsWith(`${r.verb} `)||r.label===r.verb?r.label:`${r.verb} ${r.label}`,i=[`record ${r.orig.seq}: ${o}`,`origin ${r.orig.hash}`,`outcome: ${jr(r)}`];if(r.group&&i.push(`group: records ${r.group.map(s=>s.seq).join(", ")}`),r.outcome&&"held"in r.outcome){let s=r.outcome.held,a=Math.max(5,t.location.length)+1;i.push(`${"local:".padEnd(a+1)}${s.mine}`,`${`${t.location}:`.padEnd(a+1)}${s.theirs}`,`choose: ${s.answers.join(", ")}`),n.detail!==!1&&i.push(JSON.stringify(s.detail,null,2))}return i}function Ys(t,e){let n=Mr(t,e);try{let r=Wr(t,e);return r.state==="open"&&r.close("abort"),r}finally{n()}}var g=z(ie(),1);function kn(t,e,n){let r={"keep-theirs":`keep ${n}'s version`,"apply-mine":"apply the local version","apply-mine-as-new":"add the local version as new",later:"decide later"},o=t.answers.map(i=>({key:i,answer:i,label:r[i],detail:e(i)}));return o.push({key:"later",answer:"later",label:r.later,detail:e("later")}),o}function Rn({card:t,index:e,total:n,rebaseId:r,location:o,diff:i,rows:s,sel:a,focused:c,expanded:d}){let l=Math.max(...(i??[]).map(u=>Math.max(u.was.length,u.local.length,u.origin.length)),8);return(0,g.jsxs)(M,{flexDirection:"column",children:[(0,g.jsxs)(k,{bold:!0,children:[`decision ${e} of ${n}`,(0,g.jsx)(k,{color:A.dim,children:` \xB7 ${t.kind} on your ${t.verb} from record ${t.orig.seq}`})]}),i&&i.length>0?(0,g.jsxs)(M,{flexDirection:"column",children:[(0,g.jsx)(k,{color:A.dim,children:` ${"".padEnd(12)}${"was".padEnd(l+2)}${"local".padEnd(l+2)}${o}`}),i.map(u=>(0,g.jsxs)(k,{children:[(0,g.jsx)(k,{color:A.dim,children:` ${u.field.padEnd(12)}`}),u.was.padEnd(l+2),(0,g.jsx)(k,{color:A.assuranceAccent,children:u.local.padEnd(l+2)}),u.origin]},u.field))]}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(P,{label:"local",text:t.mine,accent:!0}),(0,g.jsx)(P,{label:o,text:t.theirs})]}),d?d.map((u,p)=>(0,g.jsx)(k,{color:A.dim,children:` ${u}`},`x-${p}`)):null,(0,g.jsx)(Le,{headline:`what should happen to the local ${t.verb} from record ${t.orig.seq}`,ask:!0,rows:s,sel:a,focused:c}),(0,g.jsx)(k,{color:A.dim,children:" \u2191\u2193 select \xB7 \u23CE confirm \xB7 1\u20139 jump \xB7 v full record \xB7 a decide everything later \xB7 ctrl+c pause"})]})}function vn({name:t,count:e,from:n,backupPath:r,taking:o,sel:i,focused:s}){let a=[{key:"continue",label:"continue",detail:"save, take, reapply"},{key:"not-now",label:"not now",detail:"nothing changes"}];return(0,g.jsxs)(M,{flexDirection:"column",children:[(0,g.jsx)(k,{bold:!0,children:`rebase from ${t}`}),(0,g.jsx)(P,{label:"local",text:`${e} record${e===1?"":"s"} from position ${n} saved to ${r}`}),(0,g.jsx)(P,{label:t,text:`records ${o.from}..${o.to} taken into this store`}),(0,g.jsx)(P,{label:"then",text:"the local records reapplied on top; a disagreement becomes a decision you answer"}),(0,g.jsx)(P,{label:"never",text:`history on ${t} rewritten`}),(0,g.jsx)(Le,{headline:"continue",ask:!0,rows:a,sel:i,focused:s}),(0,g.jsx)(k,{color:A.dim,children:" \u2191\u2193 select \xB7 \u23CE confirm \xB7 esc not now"})]})}var E=z(ie(),1);function Vr(t){let e=t.detail,n=c=>c&&typeof c=="object"&&!Array.isArray(c)?c:null,r=n(e.was),o=n(e.mine),i=n(e.theirs);if(!r||!o||!i)return[];let s=c=>c==null?"":typeof c=="string"?c:JSON.stringify(c);return[...new Set([...Object.keys(r),...Object.keys(o),...Object.keys(i)])].filter(c=>s(o[c])!==s(r[c])||s(i[c])!==s(r[c])).map(c=>({field:c,was:s(r[c]),local:s(o[c]),origin:s(i[c])}))}function oi(t,e,n,r){let o={"keep-theirs":`kept ${n}'s version`,"apply-mine":"applied the local version","apply-mine-as-new":"added the local version as new",later:"decided later","later-all":"decided later"},i=r&&"deduped"in r?`already present on ${n}`:r&&"skipped"in r&&e!=="keep-theirs"?`not reapplied (${r.skipped.reason})`:o[e];return`decision ${t.holdId}: ${i}`}var Xe=class{screen={kind:"idle"};version=0;interrupted=!1;scrollback={current:null};listeners=new Set;subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));set(e){this.screen=e,this.emit()}note(e){this.scrollback.current?.append((0,E.jsx)(k,{children:e}))}flush(){return this.scrollback.current?.flush()??Promise.resolve()}emit(){this.version+=1;for(let e of this.listeners)e()}};function Gr(t){return(0,D.useSyncExternalStore)(t.subscribe,()=>t.version),t.screen}function Dr({ask:t,rows:e,done:n}){let[r,o]=(0,D.useState)(0),[i,s]=(0,D.useState)(!1);se((c,d)=>{if(d.ctrl&&c==="c")return n("later-all");if(d.escape)return n("later");if(c==="a")return n("later-all");if(c==="v")return s(u=>!u);if(d.upArrow)return o(u=>Math.max(0,u-1));if(d.downArrow)return o(u=>Math.min(e.length-1,u+1));if(d.return)return n(e[r].answer);let l=Number(c);Number.isInteger(l)&&l>=1&&l<=e.length&&o(l-1)});let a=Vr(t.card);return(0,E.jsx)(Rn,{card:t.card,index:t.index,total:t.total,rebaseId:t.rebaseId,location:t.location,diff:a,rows:e,sel:r,focused:!0,expanded:i?t.record:void 0})}function zr({ask:t,done:e}){let[n,r]=(0,D.useState)(0);return se((o,i)=>{if(i.ctrl&&o==="c"||i.escape)return e(!1);if(i.upArrow)return r(0);if(i.downArrow)return r(1);if(o==="1")return r(0);if(o==="2")return r(1);if(i.return)return e(n===0)}),(0,E.jsx)(vn,{...t,sel:n,focused:!0})}function Kr({store:t}){return se((e,n)=>{n.ctrl&&e==="c"&&(t.interrupted=!0)}),null}function Xr({store:t}){let e=Gr(t);return e.kind==="decide"?(0,E.jsx)(Dr,{ask:e.ask,rows:e.rows,done:e.done},e.ask.card.holdId):e.kind==="confirm"?(0,E.jsx)(zr,{ask:e.ask,done:e.done}):(0,E.jsx)(Kr,{store:t})}function Zr({store:t}){return(0,E.jsxs)(et,{children:[(0,E.jsx)(_t,{into:t.scrollback}),(0,E.jsx)(M,{flexDirection:"column",children:(0,E.jsx)(Xr,{store:t})})]})}function Qr(t,e){return kn(t,n=>Ke(t.kind,n,e),e)}function En(){let t=new Xe,e=null,n=async()=>{if(e)return;let{render:o}=await import("./build-5ZN47FAT.js");e=o((0,E.jsx)(Zr,{store:t}),{exitOnCtrlC:!1}),tt(()=>e?.unmount())},r=async()=>{if(!e)return;let o=e;e=null,await t.flush();let i=o.waitUntilExit().catch(()=>{});o.unmount(),await i,nt()};return{async confirm(o){await n();let i=await new Promise(s=>t.set({kind:"confirm",ask:o,done:s}));return t.set({kind:"idle"}),await r(),i},async decide(o){await n();let i=await new Promise(s=>t.set({kind:"decide",ask:o,rows:Qr(o.card,o.location),done:s}));return t.set({kind:"idle"}),i},note(o){t.note(o)},close:r,interrupted:()=>t.interrupted}}import{resolve as eo}from"path";import{fileURLToPath as to,pathToFileURL as no}from"url";var ro="us-east-1",oo=/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//,$e="use file:///abs/path, an absolute or relative directory path, s3://<bucket>/<prefix>?endpoint=<url>®ion=<region>, or a GitHub HTTPS/SSH repository URL";function In(t,e){let n=t.trim();if(n==="")throw new Error(`a location is required \u2014 ${$e}`);if(/^(?:git\+)?https:\/\//i.test(n)||/^(?:git\+)?ssh:\/\//i.test(n)||/^[^/\s@:]+@[^/\s:]+:/.test(n)||n.startsWith("git+scp://"))return ao(n);if(!oo.test(n))return xn(eo(e,n));let r=new URL(n);switch(r.protocol){case"fake:":if(r.hostname==="")throw new Error(`fake:// needs a name \u2014 ${$e}`);return{kind:"fake",location:`fake://${r.hostname}`};case"file:":return xn(to(r));case"s3:":return so(r);default:throw new Error(`this release does not speak "${r.protocol}" \u2014 ${$e}`)}}function xn(t){return{kind:"dir",location:no(t).href,path:t}}function so(t){let e=t.hostname;if(e==="")throw new Error(`an s3 location needs a bucket \u2014 ${$e}`);let n=t.pathname.replace(/^\/+/,"").replace(/\/+$/,""),r=n===""?"":`${n}/`,o=t.searchParams.get("region")||ro;if(!/^[A-Za-z0-9-]{1,64}$/.test(o))throw new Error("the region must be letters, digits and dashes only, like us-east-1");let i=t.searchParams.get("endpoint"),s=i===null||i===""?null:io(i),a=s===null?`?region=${o}`:`?endpoint=${s}®ion=${o}`,c={kind:"s3",location:`s3://${e}/${r}${a}`,bucket:e,prefix:r,region:o};return s!==null&&(c.endpoint=s),c}function io(t){let e="the endpoint must be an http URL like http://127.0.0.1:9000",n;try{n=new URL(t)}catch{throw new Error(e)}if(n.protocol!=="http:"&&n.protocol!=="https:")throw new Error(e);if(n.username||n.password)throw new Error("an endpoint never carries a user name or password; pass credentials with --credential-env or --credential-file");if(n.search!==""||n.hash!==""||n.pathname!=="/")throw new Error(`the endpoint must be a host and port only, with no path or query \u2014 got ${n.origin}`);return`${n.protocol}//${n.host}`}var ye="Use a Git repository address with no dot or parent segments";function Se(t){return t.split("/").some(e=>e==="."||e==="..")}function ao(t){if(/[\x00-\x20\x7f]/.test(t))throw new Error("A Git location cannot contain whitespace or control characters");let e=t;if(e.startsWith("git+scp://")){let p=e.slice(10).replace(/[?#].*$/,"").replace(/^[^/]*/,"");if(Se(p.slice(1)))throw new Error(ye);let h=new URL(e);e=`${decodeURIComponent(h.username)}@${h.hostname}:${h.pathname.slice(1)}${h.search}${h.hash}`}else e=e.replace(/^git\+/,"");let n=e.indexOf("#"),r=n<0?"main":decodeURIComponent(e.slice(n+1)),o=n<0?e:e.slice(0,n),i=o.indexOf("?"),s=i<0?o:o.slice(0,i),a=new URLSearchParams(i<0?"":o.slice(i+1));for(let p of a.keys())if(p!=="prefix")throw new Error("https: and ssh: Git locations accept only the prefix query option; never put credentials in a location");if(a.getAll("prefix").length>1)throw new Error("Only one Git prefix may be supplied");let c=a.get("prefix")??"";if(c&&(!/^[a-zA-Z0-9_~./-]+$/.test(c)||c.split("/").some(p=>!p||p==="."||p===".."||p.toLowerCase()===".git")))throw new Error("Use a relative Git prefix with no empty, dot or parent segments");if(!/^[A-Za-z0-9][A-Za-z0-9._/-]*$/.test(r)||r.includes("..")||r.includes("//")||r.endsWith(".")||r.split("/").some(p=>!p||p.startsWith(".")||p.endsWith(".lock")))throw new Error("Use a valid Git branch name");let d=/^([^/@:]+)@([^/:]+):(.+)$/.exec(s),l;if(d){if(!/^[A-Za-z0-9._-]+$/.test(d[1])||!/^[A-Za-z0-9.-]+$/.test(d[2])||!/^[A-Za-z0-9_~./-]+$/.test(d[3]))throw new Error("Use a valid SSH repository address");if(Se(d[3]))throw new Error(ye);l=`git+scp://${d[1]}@${d[2]}/${d[3]}`}else{if(Se(s.replace(/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\/[^/]*/,"")))throw new Error(ye);let p=new URL(s);if(!["https:","ssh:"].includes(p.protocol)||!p.hostname||!p.pathname||p.pathname==="/"||p.password||p.protocol==="https:"&&p.username)throw new Error("Use a secret-free HTTPS or SSH repository URL; sign in through Git instead");if(/%(?:00|0a|0d)/i.test(p.pathname))throw new Error("Invalid repository path");if(Se(p.pathname))throw new Error(ye);s=p.href,l=`git+${p.href}`}let u=c?`?${new URLSearchParams({prefix:c})}`:"";return{kind:"git",gitUrl:s,branch:r,prefix:c,location:`${l}${u}#${encodeURIComponent(r)}`}}function ci(t){if(t.kind==="dir")return t.path;if(t.kind!=="git")return t.location;let e=t.prefix?`?${new URLSearchParams({prefix:t.prefix})}`:"",n=t.branch&&t.branch!=="main"?`#${encodeURIComponent(t.branch)}`:"";return`${t.gitUrl}${e}${n}`}function Ze(t,e){(t.err??t.out)(`error: ${e}`)}function Si(t,e){let n=Rt(t);return co(n)?n:(Ze(e,"no context store here (run `kane-cli context ingest <files>` first)"),null)}async function $i(t,e,n){return n?!0:t.isTTY?t.confirm(`${e}?`):(Ze(t,`refusing to ${e} without --yes (no TTY to confirm)`),!1)}function ki(){return{out:t=>process.stdout.write(t+`
|
|
19
|
+
`)}};function Mr(t,e){let n=Ur(t,e);Sn(v(t),{recursive:!0});let r=Jr(6).toString("hex");for(;;)try{return Pr(n,JSON.stringify({pid:process.pid,nonce:r}),{flag:"wx"}),()=>{try{JSON.parse(we(n,"utf8")).nonce===r&&yn(n)}catch{}}}catch(o){if(o.code!=="EEXIST")throw o;let i={};try{i=JSON.parse(we(n,"utf8"))}catch{i={}}if(typeof i.pid=="number"&&K(i.pid))throw new S(`rebase ${e} is being worked on by pid ${i.pid} \u2014 wait for it to finish`);yn(n,{force:!0})}}var Us=(t,e,n,r,o)=>G.create(t,e,n,r,o),Wr=(t,e)=>G.open(t,e),Hr=t=>`rebase ${t} has a ledger this store cannot read (sync/replay/${t}.json) \u2014 ${ft}`,$n=t=>{let e=v(t);return re(e)?Lr(e).filter(n=>n.endsWith(".json")&&!n.endsWith(".receipt.json")).sort().reverse().map(n=>n.slice(0,-5)):[]};function Yr(t,e={}){let n=[];for(let r of $n(t))try{n.push(G.open(t,r))}catch(o){if(!e.tolerant)throw o}return n}function Ms(t){return $n(t).filter(e=>{try{return G.open(t,e),!1}catch{return!0}})}function Ws(t,e){let n=be(t,e),r=`${n}.unreadable`;return Fr(n,r),w(v(t)),r}function gn(t){return Yr(t).find(e=>e.state==="open")}function jr(t){let e=t.outcome;return e?"applied"in e?`reapplied \u2192 record ${e.applied.newSeq}`:"held"in e?`decision ${e.held.holdId} (${e.held.kind})`:"deduped"in e?`already present: ${e.deduped.as.slice(0,19)}`:`not reapplied: ${e.skipped.reason}`:t.begin?"pending":"waiting"}function Hs(t,e,n={}){let r=t.itemAt(e);if(!r)throw new S(`no moved record at position ${e} in rebase ${t.backupId}`);let o=r.label.startsWith(`${r.verb} `)||r.label===r.verb?r.label:`${r.verb} ${r.label}`,i=[`record ${r.orig.seq}: ${o}`,`origin ${r.orig.hash}`,`outcome: ${jr(r)}`];if(r.group&&i.push(`group: records ${r.group.map(s=>s.seq).join(", ")}`),r.outcome&&"held"in r.outcome){let s=r.outcome.held,a=Math.max(5,t.location.length)+1;i.push(`${"local:".padEnd(a+1)}${s.mine}`,`${`${t.location}:`.padEnd(a+1)}${s.theirs}`,`choose: ${s.answers.join(", ")}`),n.detail!==!1&&i.push(JSON.stringify(s.detail,null,2))}return i}function Ys(t,e){let n=Mr(t,e);try{let r=Wr(t,e);return r.state==="open"&&r.close("abort"),r}finally{n()}}var g=z(ie(),1);function kn(t,e,n){let r={"keep-theirs":`keep ${n}'s version`,"apply-mine":"apply the local version","apply-mine-as-new":"add the local version as new",later:"decide later"},o=t.answers.map(i=>({key:i,answer:i,label:r[i],detail:e(i)}));return o.push({key:"later",answer:"later",label:r.later,detail:e("later")}),o}function Rn({card:t,index:e,total:n,rebaseId:r,location:o,diff:i,rows:s,sel:a,focused:c,expanded:d}){let l=Math.max(...(i??[]).map(u=>Math.max(u.was.length,u.local.length,u.origin.length)),8);return(0,g.jsxs)(M,{flexDirection:"column",children:[(0,g.jsxs)(k,{bold:!0,children:[`decision ${e} of ${n}`,(0,g.jsx)(k,{color:A.dim,children:` \xB7 ${t.kind} on your ${t.verb} from record ${t.orig.seq}`})]}),i&&i.length>0?(0,g.jsxs)(M,{flexDirection:"column",children:[(0,g.jsx)(k,{color:A.dim,children:` ${"".padEnd(12)}${"was".padEnd(l+2)}${"local".padEnd(l+2)}${o}`}),i.map(u=>(0,g.jsxs)(k,{children:[(0,g.jsx)(k,{color:A.dim,children:` ${u.field.padEnd(12)}`}),u.was.padEnd(l+2),(0,g.jsx)(k,{color:A.assuranceAccent,children:u.local.padEnd(l+2)}),u.origin]},u.field))]}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(P,{label:"local",text:t.mine,accent:!0}),(0,g.jsx)(P,{label:o,text:t.theirs})]}),d?d.map((u,p)=>(0,g.jsx)(k,{color:A.dim,children:` ${u}`},`x-${p}`)):null,(0,g.jsx)(Le,{headline:`what should happen to the local ${t.verb} from record ${t.orig.seq}`,ask:!0,rows:s,sel:a,focused:c}),(0,g.jsx)(k,{color:A.dim,children:" \u2191\u2193 select \xB7 \u23CE confirm \xB7 1\u20139 jump \xB7 v full record \xB7 a decide everything later \xB7 ctrl+c pause"})]})}function vn({name:t,count:e,from:n,backupPath:r,taking:o,sel:i,focused:s}){let a=[{key:"continue",label:"continue",detail:"save, take, reapply"},{key:"not-now",label:"not now",detail:"nothing changes"}];return(0,g.jsxs)(M,{flexDirection:"column",children:[(0,g.jsx)(k,{bold:!0,children:`rebase from ${t}`}),(0,g.jsx)(P,{label:"local",text:`${e} record${e===1?"":"s"} from position ${n} saved to ${r}`}),(0,g.jsx)(P,{label:t,text:`records ${o.from}..${o.to} taken into this store`}),(0,g.jsx)(P,{label:"then",text:"the local records reapplied on top; a disagreement becomes a decision you answer"}),(0,g.jsx)(P,{label:"never",text:`history on ${t} rewritten`}),(0,g.jsx)(Le,{headline:"continue",ask:!0,rows:a,sel:i,focused:s}),(0,g.jsx)(k,{color:A.dim,children:" \u2191\u2193 select \xB7 \u23CE confirm \xB7 esc not now"})]})}var E=z(ie(),1);function Vr(t){let e=t.detail,n=c=>c&&typeof c=="object"&&!Array.isArray(c)?c:null,r=n(e.was),o=n(e.mine),i=n(e.theirs);if(!r||!o||!i)return[];let s=c=>c==null?"":typeof c=="string"?c:JSON.stringify(c);return[...new Set([...Object.keys(r),...Object.keys(o),...Object.keys(i)])].filter(c=>s(o[c])!==s(r[c])||s(i[c])!==s(r[c])).map(c=>({field:c,was:s(r[c]),local:s(o[c]),origin:s(i[c])}))}function oi(t,e,n,r){let o={"keep-theirs":`kept ${n}'s version`,"apply-mine":"applied the local version","apply-mine-as-new":"added the local version as new",later:"decided later","later-all":"decided later"},i=r&&"deduped"in r?`already present on ${n}`:r&&"skipped"in r&&e!=="keep-theirs"?`not reapplied (${r.skipped.reason})`:o[e];return`decision ${t.holdId}: ${i}`}var Xe=class{screen={kind:"idle"};version=0;interrupted=!1;scrollback={current:null};listeners=new Set;subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));set(e){this.screen=e,this.emit()}note(e){this.scrollback.current?.append((0,E.jsx)(k,{children:e}))}flush(){return this.scrollback.current?.flush()??Promise.resolve()}emit(){this.version+=1;for(let e of this.listeners)e()}};function Gr(t){return(0,D.useSyncExternalStore)(t.subscribe,()=>t.version),t.screen}function Dr({ask:t,rows:e,done:n}){let[r,o]=(0,D.useState)(0),[i,s]=(0,D.useState)(!1);se((c,d)=>{if(d.ctrl&&c==="c")return n("later-all");if(d.escape)return n("later");if(c==="a")return n("later-all");if(c==="v")return s(u=>!u);if(d.upArrow)return o(u=>Math.max(0,u-1));if(d.downArrow)return o(u=>Math.min(e.length-1,u+1));if(d.return)return n(e[r].answer);let l=Number(c);Number.isInteger(l)&&l>=1&&l<=e.length&&o(l-1)});let a=Vr(t.card);return(0,E.jsx)(Rn,{card:t.card,index:t.index,total:t.total,rebaseId:t.rebaseId,location:t.location,diff:a,rows:e,sel:r,focused:!0,expanded:i?t.record:void 0})}function zr({ask:t,done:e}){let[n,r]=(0,D.useState)(0);return se((o,i)=>{if(i.ctrl&&o==="c"||i.escape)return e(!1);if(i.upArrow)return r(0);if(i.downArrow)return r(1);if(o==="1")return r(0);if(o==="2")return r(1);if(i.return)return e(n===0)}),(0,E.jsx)(vn,{...t,sel:n,focused:!0})}function Kr({store:t}){return se((e,n)=>{n.ctrl&&e==="c"&&(t.interrupted=!0)}),null}function Xr({store:t}){let e=Gr(t);return e.kind==="decide"?(0,E.jsx)(Dr,{ask:e.ask,rows:e.rows,done:e.done},e.ask.card.holdId):e.kind==="confirm"?(0,E.jsx)(zr,{ask:e.ask,done:e.done}):(0,E.jsx)(Kr,{store:t})}function Zr({store:t}){return(0,E.jsxs)(nt,{children:[(0,E.jsx)(_t,{into:t.scrollback}),(0,E.jsx)(M,{flexDirection:"column",children:(0,E.jsx)(Xr,{store:t})})]})}function Qr(t,e){return kn(t,n=>Ke(t.kind,n,e),e)}function En(){let t=new Xe,e=null,n=async()=>{if(e)return;let{render:o}=await import("./build-5ZN47FAT.js");e=o((0,E.jsx)(Zr,{store:t}),{exitOnCtrlC:!1}),et(()=>e?.unmount())},r=async()=>{if(!e)return;let o=e;e=null,await t.flush();let i=o.waitUntilExit().catch(()=>{});o.unmount(),await i,tt()};return{async confirm(o){await n();let i=await new Promise(s=>t.set({kind:"confirm",ask:o,done:s}));return t.set({kind:"idle"}),await r(),i},async decide(o){await n();let i=await new Promise(s=>t.set({kind:"decide",ask:o,rows:Qr(o.card,o.location),done:s}));return t.set({kind:"idle"}),i},note(o){t.note(o)},close:r,interrupted:()=>t.interrupted}}import{resolve as eo}from"path";import{fileURLToPath as to,pathToFileURL as no}from"url";var ro="us-east-1",oo=/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//,$e="use file:///abs/path, an absolute or relative directory path, s3://<bucket>/<prefix>?endpoint=<url>®ion=<region>, or a GitHub HTTPS/SSH repository URL";function In(t,e){let n=t.trim();if(n==="")throw new Error(`a location is required \u2014 ${$e}`);if(/^(?:git\+)?https:\/\//i.test(n)||/^(?:git\+)?ssh:\/\//i.test(n)||/^[^/\s@:]+@[^/\s:]+:/.test(n)||n.startsWith("git+scp://"))return ao(n);if(!oo.test(n))return xn(eo(e,n));let r=new URL(n);switch(r.protocol){case"fake:":if(r.hostname==="")throw new Error(`fake:// needs a name \u2014 ${$e}`);return{kind:"fake",location:`fake://${r.hostname}`};case"file:":return xn(to(r));case"s3:":return so(r);default:throw new Error(`this release does not speak "${r.protocol}" \u2014 ${$e}`)}}function xn(t){return{kind:"dir",location:no(t).href,path:t}}function so(t){let e=t.hostname;if(e==="")throw new Error(`an s3 location needs a bucket \u2014 ${$e}`);let n=t.pathname.replace(/^\/+/,"").replace(/\/+$/,""),r=n===""?"":`${n}/`,o=t.searchParams.get("region")||ro;if(!/^[A-Za-z0-9-]{1,64}$/.test(o))throw new Error("the region must be letters, digits and dashes only, like us-east-1");let i=t.searchParams.get("endpoint"),s=i===null||i===""?null:io(i),a=s===null?`?region=${o}`:`?endpoint=${s}®ion=${o}`,c={kind:"s3",location:`s3://${e}/${r}${a}`,bucket:e,prefix:r,region:o};return s!==null&&(c.endpoint=s),c}function io(t){let e="the endpoint must be an http URL like http://127.0.0.1:9000",n;try{n=new URL(t)}catch{throw new Error(e)}if(n.protocol!=="http:"&&n.protocol!=="https:")throw new Error(e);if(n.username||n.password)throw new Error("an endpoint never carries a user name or password; pass credentials with --credential-env or --credential-file");if(n.search!==""||n.hash!==""||n.pathname!=="/")throw new Error(`the endpoint must be a host and port only, with no path or query \u2014 got ${n.origin}`);return`${n.protocol}//${n.host}`}var ye="Use a Git repository address with no dot or parent segments";function Se(t){return t.split("/").some(e=>e==="."||e==="..")}function ao(t){if(/[\x00-\x20\x7f]/.test(t))throw new Error("A Git location cannot contain whitespace or control characters");let e=t;if(e.startsWith("git+scp://")){let p=e.slice(10).replace(/[?#].*$/,"").replace(/^[^/]*/,"");if(Se(p.slice(1)))throw new Error(ye);let h=new URL(e);e=`${decodeURIComponent(h.username)}@${h.hostname}:${h.pathname.slice(1)}${h.search}${h.hash}`}else e=e.replace(/^git\+/,"");let n=e.indexOf("#"),r=n<0?"main":decodeURIComponent(e.slice(n+1)),o=n<0?e:e.slice(0,n),i=o.indexOf("?"),s=i<0?o:o.slice(0,i),a=new URLSearchParams(i<0?"":o.slice(i+1));for(let p of a.keys())if(p!=="prefix")throw new Error("https: and ssh: Git locations accept only the prefix query option; never put credentials in a location");if(a.getAll("prefix").length>1)throw new Error("Only one Git prefix may be supplied");let c=a.get("prefix")??"";if(c&&(!/^[a-zA-Z0-9_~./-]+$/.test(c)||c.split("/").some(p=>!p||p==="."||p===".."||p.toLowerCase()===".git")))throw new Error("Use a relative Git prefix with no empty, dot or parent segments");if(!/^[A-Za-z0-9][A-Za-z0-9._/-]*$/.test(r)||r.includes("..")||r.includes("//")||r.endsWith(".")||r.split("/").some(p=>!p||p.startsWith(".")||p.endsWith(".lock")))throw new Error("Use a valid Git branch name");let d=/^([^/@:]+)@([^/:]+):(.+)$/.exec(s),l;if(d){if(!/^[A-Za-z0-9._-]+$/.test(d[1])||!/^[A-Za-z0-9.-]+$/.test(d[2])||!/^[A-Za-z0-9_~./-]+$/.test(d[3]))throw new Error("Use a valid SSH repository address");if(Se(d[3]))throw new Error(ye);l=`git+scp://${d[1]}@${d[2]}/${d[3]}`}else{if(Se(s.replace(/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\/[^/]*/,"")))throw new Error(ye);let p=new URL(s);if(!["https:","ssh:"].includes(p.protocol)||!p.hostname||!p.pathname||p.pathname==="/"||p.password||p.protocol==="https:"&&p.username)throw new Error("Use a secret-free HTTPS or SSH repository URL; sign in through Git instead");if(/%(?:00|0a|0d)/i.test(p.pathname))throw new Error("Invalid repository path");if(Se(p.pathname))throw new Error(ye);s=p.href,l=`git+${p.href}`}let u=c?`?${new URLSearchParams({prefix:c})}`:"";return{kind:"git",gitUrl:s,branch:r,prefix:c,location:`${l}${u}#${encodeURIComponent(r)}`}}function ci(t){if(t.kind==="dir")return t.path;if(t.kind!=="git")return t.location;let e=t.prefix?`?${new URLSearchParams({prefix:t.prefix})}`:"",n=t.branch&&t.branch!=="main"?`#${encodeURIComponent(t.branch)}`:"";return`${t.gitUrl}${e}${n}`}function Ze(t,e){(t.err??t.out)(`error: ${e}`)}function Si(t,e){let n=Rt(t);return co(n)?n:(Ze(e,"no context store here (run `kane-cli context ingest <files>` first)"),null)}async function $i(t,e,n){return n?!0:t.isTTY?t.confirm(`${e}?`):(Ze(t,`refusing to ${e} without --yes (no TTY to confirm)`),!1)}function ki(){return{out:t=>process.stdout.write(t+`
|
|
20
20
|
`),err:t=>process.stderr.write(t+`
|
|
21
|
-
`),isTTY:Ot(),walkUI:En,confirm:async t=>{let{createInterface:e}=await import("readline/promises"),n=e({input:process.stdin,output:process.stdout});try{let r=await n.question(`${t} [y/N] `);return/^y(es)?$/i.test(r.trim())}catch(r){if(r.name==="AbortError")return!1;throw r}finally{n.close()}},ask:async t=>{let{createInterface:e}=await import("readline/promises"),n=e({input:process.stdin,output:process.stdout});try{return await n.question(t)}finally{n.close()}}}}var lo=1500;function uo(t,e){return t==="behind"?`${e} has moved past this machine \u2014 run kane-cli context pull ${e}`:`this store and ${e} have diverged \u2014 run kane-cli context pull ${e} --rebase`}async function Ri(t,e,n){let r=await po(t,n);r&&e(r.text)}async function po(t,e){if(process.env.KANE_SYNC_GUARD==="0")return null;try{let n=Ut(t);if(n.locations.length===0)return null;let r=Wt(n),o=F(t).entries[r.name]?.witness;if(!o)return null;let{openProvider:i}=await import("./open-provider-
|
|
21
|
+
`),isTTY:Ot(),walkUI:En,confirm:async t=>{let{createInterface:e}=await import("readline/promises"),n=e({input:process.stdin,output:process.stdout});try{let r=await n.question(`${t} [y/N] `);return/^y(es)?$/i.test(r.trim())}catch(r){if(r.name==="AbortError")return!1;throw r}finally{n.close()}},ask:async t=>{let{createInterface:e}=await import("readline/promises"),n=e({input:process.stdin,output:process.stdout});try{return await n.question(t)}finally{n.close()}}}}var lo=1500;function uo(t,e){return t==="behind"?`${e} has moved past this machine \u2014 run kane-cli context pull ${e}`:`this store and ${e} have diverged \u2014 run kane-cli context pull ${e} --rebase`}async function Ri(t,e,n){let r=await po(t,n);r&&e(r.text)}async function po(t,e){if(process.env.KANE_SYNC_GUARD==="0")return null;try{let n=Ut(t);if(n.locations.length===0)return null;let r=Wt(n),o=F(t).entries[r.name]?.witness;if(!o)return null;let{openProvider:i}=await import("./open-provider-LXCPVNUU.js"),s=i(In(r.location,t),r.name,e),a=await Promise.race([fo(t,s,o),ho()]);return a?{text:uo(a.kind,r.name),name:r.name,localSeq:a.localSeq,storageSeq:a.storageSeq}:null}catch{return null}}function vi(t){return{type:"sync_behind",name:t.name,local_seq:t.localSeq,storage_seq:t.storageSeq,text:t.text}}async function fo(t,e,n){try{let r=C(t),o=r?.seq??0;return await e.head(I(n.seq+1))?{kind:"behind",localSeq:o,storageSeq:(await J(e,n.seq+1)).seq}:r===null||(await te(e,r.seq)).hash===r.hash?null:{kind:"diverged",localSeq:o,storageSeq:(await J(e,r.seq)).seq}}catch{return null}}function ho(){return new Promise(t=>{setTimeout(()=>t(null),lo).unref()})}function mo(t){try{return gt(t),null}catch(e){if(e instanceof mt)return{code:e.code,text:e.message,remedy:e.remedy};throw e}}function Ei(t){return{type:"sync_error",code:t.code,detail:t.text,remedy:t.remedy}}function xi(t,e){let n=mo(t);return n?(Ze(e,n.text),(e.err??e.out)(`next: ${n.remedy}`),!0):!1}export{Q as a,Pe as b,Ut as c,$o as d,F as e,Mt as f,Wt as g,ko as h,te as i,J as j,zt as k,rs as l,Je as m,br as n,wr as o,yr as p,v as q,We as r,ln as s,vs as t,Es as u,nn as v,xs as w,Ps as x,Fs as y,Js as z,Bs as A,Mr as B,Us as C,Wr as D,Yr as E,Ms as F,Ws as G,gn as H,Hs as I,Ys as J,oi as K,In as L,ci as M,Ze as N,Si as O,$i as P,ki as Q,Ri as R,po as S,vi as T,mo as U,Ei as V,xi as W};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{e as L}from"./chunk-
|
|
2
|
+
import{e as L}from"./chunk-BPTWMV5L.js";async function T(n,i,c){let[h,d,l,m,a]=await Promise.all([c.includes("source")?n.sources(i):Promise.resolve([]),c.includes("usecase")?n.nodes(i,"usecase"):Promise.resolve([]),c.includes("usecase")?n.stale(i):Promise.resolve([]),c.includes("scenario")?n.nodes(i,"scenario"):Promise.resolve([]),c.includes("test")?n.nodes(i,"test"):Promise.resolve([])]),o=new Set;for(let e of l.filter(s=>s.label==="scenario"&&(s.freshness==="stale"||s.freshness==="orphaned"))){let s=await n.mainNode(i,e.cid);for(let t of s.edgesOut)t.type==="belongs_to"&&t.other?.name&&(t.other.freshness==="superseded"||t.other.supersededBy)&&o.add(t.other.name)}let r=h.filter(e=>e.head!==null).map(e=>{let s=L(e.origin);return{id:e.sourceId,label:"source",title:e.sourceId,trust:"-",fresh:"fresh",upToDate:"yes",...s?{shown:s}:{}}}),R=d.map(e=>{let s=e.name??"-";if(e.trust==="archived")return{id:s,label:"usecase",title:e.title??"",trust:e.trust,fresh:"-",upToDate:"archived"};let t=e.name!==null&&o.has(e.name),u=e.freshness??"fresh",f=u==="stale"?"source_changed":u==="orphaned"?"source_removed":t?"tests_out_of_date":"yes";return{id:s,label:"usecase",title:e.title??"",trust:e.trust,fresh:u,...t?{testsFresh:"stale"}:{},upToDate:f}}),g=(e,s)=>e.map(t=>{let u=t.name??"-",f=t.title??"";if(t.trust==="archived")return{id:u,label:s,title:f,trust:t.trust,fresh:"-",upToDate:"archived"};let w=t.freshness??"fresh",b=w==="stale"?"designed_from_changed":w==="orphaned"?"source_removed":"yes";return{id:u,label:s,title:f,trust:t.trust,fresh:w,upToDate:b}}),y=g(m,"scenario"),_=g(a,"test"),v=e=>Number(/^[a-z]+-(\d+)$/i.exec(e.id)?.[1]??Number.MAX_SAFE_INTEGER),p=(e,s)=>v(e)-v(s)||e.title.localeCompare(s.title);return r.sort((e,s)=>e.id.localeCompare(s.id)),R.sort(p),y.sort(p),_.sort(p),[...r,...R,...y,..._]}async function P(n,i){let c=(await n.nodes(i,"test")).filter(a=>a.trust!=="archived"),h=new Set((await n.nodes(i,"scenario")).filter(a=>a.trust==="archived").map(a=>a.cid)),d=new Set;for(let a of c){let o=await n.mainNode(i,a.cid);for(let r of o.edgesOut)r.type==="automates"&&r.other!==null&&d.add(r.other.cid)}let l=new Set,m=new Set;for(let a of d){let o=await n.mainNode(i,a);for(let r=0;o.supersededBy!==null&&o.supersededBy!==""&&r<64;r++)o=await n.mainNode(i,o.supersededBy);if(!(o.supersededBy===""||m.has(o.cid))&&(m.add(o.cid),!h.has(o.cid)))for(let r of o.edgesOut)r.type==="belongs_to"&&r.other?.name&&l.add(r.other.name)}return l}export{T as a,P as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as O,d as S}from"./chunk-
|
|
2
|
+
import{b as O,d as S}from"./chunk-5HJRYEOT.js";import{c as L}from"./chunk-RFHMDQXZ.js";import{a as R}from"./chunk-HCBYKLMW.js";import{z as s}from"./chunk-YKOZBFR3.js";import{m as E,n as h}from"./chunk-WMXBRC4B.js";import{a as y,b as o,i as P}from"./chunk-33DWJV67.js";import{a as B}from"./chunk-6YGTRKDT.js";import{e as d}from"./chunk-UR6MHSHU.js";var n=d(B(),1);import{basename as D}from"path";var r=d(R(),1),U="evidence-view-server";function Q({packPath:m,viewerBase:w,onDone:V,openUrl:k}){let[t,a]=(0,n.useState)("ask"),[g,b]=(0,n.useState)(null),[l,p]=(0,n.useState)(null),f=(0,n.useRef)(null),u=(0,n.useRef)(!1),x=async()=>{let e=f.current;f.current=null,e&&(h(U),await e.close())},v=()=>{u.current||(u.current=!0,V())};return P((e,i)=>{u.current||(t==="ask"?e==="y"||e==="Y"?a("starting"):(e==="n"||e==="N"||i.return||i.escape)&&v():t==="serving"&&(e==="q"||e==="Q"||i.escape)&&x().then(v))}),(0,n.useEffect)(()=>{if(t!=="starting")return;let e=!1;return(async()=>{try{let i=D(m),c=await O({packs:new Map([[i,m]]),allowedOrigins:[new URL(w).origin]});if(e){await c.close();return}f.current=c,E(U,()=>{c.close()});let T=S(c.urlFor(i),w);b(T);try{await(k??(q=>L(q)))(T)}catch{p("could not open browser \u2014 open the URL manually")}a("serving")}catch(i){p(`evidence view failed \u2014 ${i.message}`),a("failed")}})(),()=>{e=!0}},[t]),(0,n.useEffect)(()=>{if(t!=="failed")return;let e=setTimeout(v,0);return()=>clearTimeout(e)},[t]),(0,n.useEffect)(()=>()=>{x()},[]),t==="ask"?(0,r.jsxs)(o,{children:["View evidence in browser? ",(0,r.jsx)(o,{color:s.dim,children:"(y/N)"})]}):t==="serving"||t==="starting"?(0,r.jsxs)(y,{flexDirection:"column",children:[g?(0,r.jsxs)(o,{children:["viewer ",(0,r.jsx)(o,{color:s.orange,children:g})]}):(0,r.jsx)(o,{color:s.dim,children:"starting\u2026"}),l?(0,r.jsx)(o,{color:"yellow",children:l}):null,t==="serving"?(0,r.jsx)(o,{color:s.dim,children:"Press q when done"}):null]}):l?(0,r.jsx)(o,{color:"yellow",children:l}):null}export{Q as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as te,b as E,d as ne,e as se}from"./chunk-
|
|
2
|
+
import{a as te,b as E,d as ne,e as se}from"./chunk-V4SL74TK.js";import{b as X,c as v,e as W,i as Y,j as Z,k as ee}from"./chunk-77ZZQJLX.js";import{f as z}from"./chunk-Q4JV4U65.js";import{a as Q}from"./chunk-XDAFRUAJ.js";import{d as q}from"./chunk-YKOZBFR3.js";import{copyFileSync as Re,cpSync as xe,existsSync as P,mkdirSync as Ie,readFileSync as ze,readdirSync as ke,rmSync as Qe,writeFileSync as Xe}from"fs";import{dirname as Ye,isAbsolute as Ze,join as x,relative as et,resolve as tt}from"path";import{writeFileSync as ve,mkdirSync as Pe,readFileSync as je}from"fs";import{dirname as De,basename as re}from"path";function oe(e){let t=e.outPath??v(e.sourcePath);Pe(De(t),{recursive:!0});let n=[];n.push("---"),n.push(`test: ../${re(e.sourcePath)}`),n.push(`status: ${e.overallStatus}`),n.push(`started: ${e.startedISO}`),n.push(`duration_s: ${e.durationS}`),n.push(`session_id: ${e.sessionId}`),n.push("---",""),n.push(`# ${e.title??re(e.sourcePath)} \u2014 Result`,"");for(let r=0;r<e.rootSteps.length;r++){let o=e.rootSteps[r],s=e.outcomes.find(d=>d.rootStepIndex===r+1);if(n.push($e(o,s)),s?.stepMd5&&n.push(`md5: ${s.stepMd5}`),s?.status==="failed"&&s.reason&&n.push(`Reason: ${s.reason}`),s?.softFailures?.length)for(let d of s.softFailures){let a=d.reason?`: ${d.reason}`:"";n.push(`\u26A0 optional sub-step ${d.subStepIndex} failed${a}`)}o.body.kind==="objective"&&s?.status!=="skipped"&&n.push(o.body.text),n.push("")}return ve(t,n.join(`
|
|
3
3
|
`),"utf8"),t}function $e(e,t){if(!t)return`## ${e.heading} (no outcome)`;let n=t.duration_s!=null?`${t.duration_s}s`:"\u2014";if(t.status==="skipped")return`## ${e.heading} \u23ED skipped`;let r=t.softFailed?" (optional)":"";if(t.refKind&&t.status==="passed"){let o=t.helperResultRelPath?` \u2192 ${t.helperResultRelPath}`:"";return`## ${e.heading} \u2713 passed (via @${t.refKind} ${t.refLabel} \u2014 ${t.inlinedCount} inlined steps, ${n}${o})`}if(t.refKind&&t.status==="failed"){let o=t.failedSubStepIndex&&t.failedSubStepIndex.length>0?` \u2014 at sub-step ${t.failedSubStepIndex.join(" \u2192 sub-step ")}`:"",s=t.helperResultRelPath?` \u2192 ${t.helperResultRelPath}`:"";return`## ${e.heading} \u2717 failed${r} (via @${t.refKind} ${t.refLabel}${o}, ${n}${s})`}return t.status==="passed"?`## ${e.heading} \u2713 passed (${n})`:`## ${e.heading} \u2717 failed${r} (${n})`}var Fe=/^##\s+(.+?)\s+(✓ passed|✗ failed(?:\s+\(optional\))?|⏭ skipped)(?:\s+\((.*)\))?\s*$/,Oe=/via\s+@\w+\s+(\S+).*?(?:→\s+(\S+))?\s*$/,_e=/^md5:\s+([a-f0-9]{32})\s*$/;function ie(e,t){for(let n=t;n<e.length&&!/^##\s/.test(e[n]);n++){if(e[n].trim()==="")continue;let r=_e.exec(e[n]);return r?r[1]:null}return null}function D(e){let n=je(e,"utf8").split(`
|
|
4
4
|
`),r="passed";if(n[0]?.trim()==="---")for(let s=1;s<n.length&&n[s].trim()!=="---";s++){let d=/^status:\s+(passed|failed|interrupted)\s*$/.exec(n[s]);d&&(r=d[1])}let o=[];for(let s=0;s<n.length;s++){let d=Fe.exec(n[s]);if(!d)continue;let a=d[1],i=d[2],u=d[3]??"",f=i.startsWith("\u2713")?"passed":i.startsWith("\u23ED")?"skipped":"failed";if(/via\s+@/.test(u)){let m=Oe.exec(u),w=m?.[1]??"",I=m?.[2]??null;o.push({kind:"import",heading:a,status:f,md5:ie(n,s+1),importPath:w,helperResultRelPath:I})}else o.push({kind:"objective",heading:a,status:f,md5:ie(n,s+1)})}return{overallStatus:r,steps:o}}import{copyFileSync as ae,existsSync as H,mkdirSync as Ae,writeFileSync as de,promises as dt}from"fs";import{join as $,dirname as le,basename as Te}from"path";async function pe(e){for(let t=0;t<e.totalRunDirs;t++){let n=e.runIndex+t,r=$(e.sessionDir,"runs",String(n)),o=$(e.stagingStepDir,"flows",String(t));Ae(o,{recursive:!0});let s=$(o,"actions.ndjson");if(e.packTestDir){let i=$(e.packTestDir,"logs",`${n}-actions.ndjson`);if(H(i)){ae(i,s);continue}let u=le(le(e.packTestDir)),f=Te(e.packTestDir),S=H(u)?await z(u,`tests/${f}/logs/${n}-actions.ndjson`).catch(()=>null):null;de(s,S??"");continue}let d=[$(r,"run-test","actions.ndjson"),$(r,"actions.ndjson")],a=!1;for(let i of d)if(H(i)){ae(i,s),a=!0;break}a||de(s,"")}}import{existsSync as ue,readFileSync as fe,readdirSync as Ne}from"fs";import{join as F}from"path";function Ee(e){if(e.action_type!=="upload_files")return null;let t=e.action_params?.media;if(!t||typeof t!="object")return null;let n=a=>typeof t[a]=="string"?t[a]:"",r=n("media_id"),o=n("name"),s=n("media_url");if(!r||!o||!s)return null;let d=n("type")||"doc";return{media_id:r,name:o,media_url:s,type:d,alias:n("alias")}}function Le(e){let t=e.action_params?.file_paths,n=Array.isArray(t)?t[0]:t;return typeof n=="string"&&n.length>0?n:null}function Ue(e){let t={};for(let[n,r]of Object.entries(e??{}))t[n]={...r,refs:[...r.refs??[]]};return t}function Ke(e,t){if(!t)return!1;let n=t.endsWith("/")?t:t+"/";return e.startsWith(n)}function ce(e,t,n,r={}){let o=Ue(e);for(let s of t){let d=Ee(s);if(!d)continue;let a=o[d.media_id]??={name:d.name,media_url:d.media_url,type:d.type,refs:[],recorded_at:n,...d.alias?{alias:d.alias}:{}};a.recorded_at=n;let i=Le(s);if(!(!i||Ke(i,r.ignoreAliasUnder))){for(let[u,f]of Object.entries(o))u!==d.media_id&&(f.refs=f.refs.filter(S=>S!==i));a.refs.includes(i)||a.refs.push(i)}}return o}function ut(e){let t=e?.media;if(!t||typeof t!="object")return[];let n=[];for(let[r,o]of Object.entries(t)){if(!r||!o||typeof o!="object")continue;let s=o;typeof s.name!="string"||!s.name||typeof s.media_url!="string"||!s.media_url||n.push({media_id:r,name:s.name,media_url:s.media_url,type:typeof s.type=="string"&&s.type?s.type:"doc",refs:Array.isArray(s.refs)?s.refs.filter(d=>typeof d=="string"&&d.length>0):[],...typeof s.alias=="string"&&s.alias?{alias:s.alias}:{}})}return n}function Ce(e){let t=[];for(let n of e){let r;try{r=fe(n,"utf8")}catch{continue}for(let o of r.split(`
|
|
5
5
|
`)){let s=o.trim();if(s)try{let d=JSON.parse(s);d&&typeof d=="object"&&t.push(d)}catch{}}}return t}function V(e){try{return Ne(e,{withFileTypes:!0}).filter(t=>t.isDirectory()).map(t=>t.name).sort((t,n)=>t.localeCompare(n,void 0,{numeric:!0}))}catch{return[]}}function St(e){if(!e)return[];let t=[];for(let n of V(F(e,"runs")))for(let r of[F(e,"runs",n,"run-test","actions.ndjson"),F(e,"runs",n,"actions.ndjson")])if(ue(r)){t.push(r);break}return t}function me(e){let t=[],n=F(e,".internal","steps");for(let r of V(n)){let o=F(n,r,"flows");for(let s of V(o)){let d=F(o,s,"actions.ndjson");ue(d)&&t.push(d)}}return t}function We(e){try{let n=JSON.parse(fe(e,"utf8"))?.media;return n&&typeof n=="object"?n:void 0}catch{return}}function ge(e){let t=We(e.priorMetaPath),n=Ce(e.recordFiles),r=ce(t,n,e.now??new Date().toISOString(),{ignoreAliasUnder:e.ignoreAliasUnder??q});return Object.keys(r).length>0?r:void 0}import{existsSync as L,readdirSync as He}from"fs";import{dirname as Ve,join as O,basename as B}from"path";function wt(e,t){let n=[];return e.steps.forEach((r,o)=>{let s=t[o];r.block||!r.replayOnly||!s||s.kind!=="author"||n.push({flatIndex:r.flatIndex,file:r.owningFile,heading:r.trace[r.trace.length-1].heading,kind:r.replayOnly,reason:s.reason})}),n}function vt(e){let t=[],n=new Set,r=new Map;function o(i){if(r.has(i))return r.get(i);let u=v(i),f=L(u)?D(u):null;return r.set(i,f),f}let s=new Map;function d(i){if(s.has(i))return s.get(i);let u=O(i,"Result.md"),f=L(u)?D(u):null;return s.set(i,f),f}function a(i){for(let u=1;u<i.trace.length;u++){let f=i.trace[u-1],S=o(f.file);if(!S)continue;let m=S.steps[f.stepIndex-1];if(m){if(m.kind!=="import")return{kind:"author",reason:"structure-mismatch"};if(B(m.importPath)!==B(i.trace[u].file))return{kind:"author",reason:"structure-mismatch"};if(m.md5!=null&&m.md5!==f.rowMd5)return{kind:"author",reason:"structure-mismatch"}}}return null}for(let i of e.steps){let u=i.trace[i.trace.length-1].stepIndex,f=i.replayOnly;if(i.block){let g=o(i.owningFile)?.steps[u-1],j=i.controlFlow!==void 0,T=g?.kind==="objective"&&g.status==="skipped";if(j||T){t.push({kind:"replay",recordingDir:"",flowCount:0,unrecorded:!0,...f?{replayOnly:f}:{}});continue}}let S=n.has(i.owningFile);for(let g=0;g<i.trace.length-1&&!S;g++)n.has(i.trace[g].file)&&(S=!0);if(S&&!f){t.push({kind:"author",reason:o(i.owningFile)===null?"no-result-md":"downstream-of-divergence"});continue}let m=a(i);if(m){for(let g=0;g<i.trace.length;g++)n.add(i.trace[g].file);if(!f){t.push(m);continue}}let w=o(i.owningFile),I;if(w===null&&i.trace.length>1){let g=J(i.trace);I=he(i,d(g),u,g)}else I=he(i,w,u);if(f&&I.kind==="replay"&&(I={...I,replayOnly:f}),t.push(I),I.kind==="author"){n.add(i.owningFile);for(let g=0;g<i.trace.length-1;g++)n.add(i.trace[g].file)}}return t}function he(e,t,n,r=null){if(!t)return{kind:"author",reason:"no-result-md"};let o=t.steps[n-1];if(!o)return{kind:"author",reason:"no-result-md"};if(o.kind!=="objective")return{kind:"author",reason:"structure-mismatch"};if(o.status!=="passed")return{kind:"author",reason:"recorded-failed"};let s=E(e);if(s!==o.md5)return{kind:"author",reason:"md5-mismatch"};let d=r===null?ee(e.owningFile,n,s.slice(0,8)):O(r,".internal","steps",`${n}-${s.slice(0,8)}`),a=Be(d);return a===0?{kind:"author",reason:"missing-recording"}:{kind:"replay",recordingDir:d,flowCount:a}}function Be(e){let t=O(e,"flows");if(!L(t))return 0;let n;try{n=He(t,{withFileTypes:!0}).filter(o=>o.isDirectory()&&/^\d+$/.test(o.name)).map(o=>parseInt(o.name,10))}catch{return 0}if(n.length===0)return 0;let r=Math.max(...n);for(let o=0;o<=r;o++)if(!L(O(t,String(o),"actions.ndjson")))return 0;return r+1}function Pt(e){return e.some(t=>t.kind==="author")}function jt(e){for(let t=0;t<e.length;t++)if(e[t].kind==="author")return t;return e.length}function J(e){let t=s=>{let d=B(s);return d.endsWith("_test.md")?d.slice(0,-8):d.endsWith(".md")?d.slice(0,-3):d},n=t(e[0].file),r=t(e[e.length-1].file),o=e.slice(0,-1).map(s=>String(s.stepIndex));return O(Ve(e[e.length-1].file),`helper-output-${r}-${n}-${o.join("-")}`)}function Dt(e){return Array.from({length:e.flowCount},(t,n)=>O(e.recordingDir,"flows",String(n),"actions.ndjson"))}import{existsSync as ye,mkdirSync as Je,rmSync as Ge,cpSync as qe}from"fs";function Se(e,t){ye(e)&&(ye(t)&&Ge(t,{recursive:!0,force:!0}),Je(t,{recursive:!0}),qe(e,t,{recursive:!0}))}async function Vt(e){let t=new Map;for(let a of e.stepRunRecords)t.set(a.testmdStepIndex,a);let n=e.authoredFlatIdx??new Set,r=[],o=[],s=new Map,d=a=>{if(s.has(a))return s.get(a);let i=x(a,"Result.md"),u=P(i)?D(i):null;return s.set(a,u),u};for(let a of e.resolvedTest.unitFiles){let i=a.file===e.resolvedTest.rootPath,u=Q(a.file,ze(a.file,"utf8")),f=v(a.file),S=P(f)?D(f):null,m=[],w=[],I=[],g=[];if(!i)for(let p of e.resolvedTest.steps){if(p.owningFile!==a.file||p.trace.length<2)continue;let l=J(p.trace);g.includes(l)||g.push(l)}let j=p=>{if(S!==null)return null;for(let l of g){let M=d(l)?.steps[p-1];if(M)return{row:M,dir:l}}return null},T=[],U=!1,G=!1,K=!1,N=!1;for(let p of u.steps){let l=p.index,c=S?.steps[l-1];if(p.body.kind==="objective"){let h=e.resolvedTest.steps.filter(y=>y.owningFile===a.file&&y.trace[y.trace.length-1].stepIndex===l&&t.has(y.flatIndex)),R=h.length>0?h[h.length-1]:null;if(R){U=!0,n.has(R.flatIndex)&&(G=!0);let y=E(R),k;i?k=e.outcomes.find(we=>we.rootStepIndex===l)??{rootStepIndex:l,status:"skipped"}:k={rootStepIndex:l,status:be(R,e.outcomes)},k.status==="failed"&&(K=!0),k.stepMd5==null&&(k.stepMd5=y),m.push(k),w.push({stepIndex:l,md5:y,rec:t.get(R.flatIndex)}),(!c||c.kind!=="objective"||c.status!==k.status||k.status==="passed"&&c.md5!==y)&&(N=!0)}else if(c&&c.kind==="objective")m.push({rootStepIndex:l,status:c.status,...c.md5?{stepMd5:c.md5}:{}}),I.push(l);else if(!i&&j(l)?.row.kind==="objective"){let y=j(l),k=y.row;m.push({rootStepIndex:l,status:k.status,...k.md5?{stepMd5:k.md5}:{}}),T.push({psIdx:l,dir:y.dir})}else i?m.push(e.outcomes.find(y=>y.rootStepIndex===l)??{rootStepIndex:l,status:"skipped"}):m.push({rootStepIndex:l,status:"skipped"});continue}let M=Ze(p.body.path)?p.body.path:tt(Ye(a.file),p.body.path),_=te({path:p.body.path,bindings:p.body.bindings,optional:p.optional??!1}),C=et(X(a.file),v(M)),A=e.resolvedTest.steps.filter(h=>h.trace.some((R,y)=>y<h.trace.length-1&&R.file===a.file&&R.stepIndex===l)&&t.has(h.flatIndex));if(A.length>0){U=!0;let h;if(i)h=e.outcomes.find(R=>R.rootStepIndex===l)??{rootStepIndex:l,status:"passed",refKind:"import",refLabel:p.body.path};else{let R=A.some(y=>be(y,e.outcomes)==="failed");h={rootStepIndex:l,status:R?"failed":"passed",refKind:"import",refLabel:p.body.path,inlinedCount:A.length}}h.status==="failed"&&(K=!0),h.stepMd5==null&&(h.stepMd5=_),h.helperResultRelPath==null&&(h.helperResultRelPath=C),m.push(h),(!c||c.kind!=="import"||c.status!==h.status||c.md5!==_)&&(N=!0)}else if(c&&c.kind==="import")m.push({rootStepIndex:l,status:c.status,refKind:"import",refLabel:c.importPath,...c.md5?{stepMd5:c.md5}:{},...c.helperResultRelPath?{helperResultRelPath:c.helperResultRelPath}:{}});else if(!i&&j(l)?.row.kind==="import"){let h=j(l).row;m.push({rootStepIndex:l,status:h.status,refKind:"import",refLabel:p.body.path})}else i?m.push(e.outcomes.find(h=>h.rootStepIndex===l)??{rootStepIndex:l,status:"skipped",refKind:"import",refLabel:p.body.path}):m.push({rootStepIndex:l,status:"skipped",refKind:"import",refLabel:p.body.path})}if(!(i||U&&(G||K||S===null||N)))continue;r.push(a.file);let b=Y(a.file);Ie(x(b,".internal"),{recursive:!0});for(let p of w){let l=x(b,".internal","steps",`${p.stepIndex}-${p.md5.slice(0,8)}`);Ie(l,{recursive:!0}),await pe({sessionDir:e.sessionDir,runIndex:p.rec.runIndex,totalRunDirs:p.rec.totalRunDirs,stagingStepDir:l,packTestDir:e.packTestDir})}if(I.length>0){let p=Z(a.file);if(P(p))for(let l of ke(p)){let c=parseInt(l.split("-")[0]??"",10);!Number.isNaN(c)&&I.includes(c)&&xe(x(p,l),x(b,".internal","steps",l),{recursive:!0})}}for(let p of T){let l=x(p.dir,".internal","steps");if(P(l))for(let c of ke(l))parseInt(c.split("-")[0]??"",10)===p.psIdx&&xe(x(l,c),x(b,".internal","steps",c),{recursive:!0})}let Me=m.some(p=>p.status==="failed");if(oe({sourcePath:a.file,title:u.title,rootSteps:u.steps,outcomes:m,overallStatus:i?e.overallStatus:Me?"failed":"passed",startedISO:e.startedISO,durationS:i?e.durationS:0,sessionId:e.sessionId,outPath:x(b,"Result.md")}),i){let p={};e.commitId&&(p.commit_id=e.commitId),e.tmsIds.testId&&(p.test_id=e.tmsIds.testId),e.tmsIds.testcaseId&&(p.testcase_id=e.tmsIds.testcaseId),e.tmsIds.projectId&&(p.project_id=e.tmsIds.projectId),e.tmsIds.folderId&&(p.folder_id=e.tmsIds.folderId),e.tmsIds.orgId&&(p.org_id=e.tmsIds.orgId),e.tmsIds.sessionName&&(p.session_name=e.tmsIds.sessionName);let l=ge({priorMetaPath:W(a.file),recordFiles:me(b)});l&&(p.media=l);let c=ne(a.file);c&&(p.tc_id=c);let M=se(a.file);M&&(p.environment_id=M),Xe(x(b,".internal","meta.json"),JSON.stringify(p,null,2)+`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as
|
|
2
|
+
import{a as s,b as o,e as c}from"./chunk-YKOZBFR3.js";import{a as l}from"./chunk-RZ4F3BHX.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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{M as r,vb as e}from"./chunk-
|
|
2
|
+
import{M as r,vb as e}from"./chunk-5EAJO372.js";function p(t,o){return{store:o,dir:t,graph:()=>e(t)}}function a(t){return{store:t,dir:null,graph:()=>r(t)}}export{p as a,a as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as h}from"./chunk-
|
|
2
|
+
import{a as h}from"./chunk-73EHVDL5.js";import{a as p}from"./chunk-RZ4F3BHX.js";function f(e,t){if(e===t)return 0;if(e.length===0)return t.length;if(t.length===0)return e.length;let n=new Array(t.length+1),o=new Array(t.length+1);for(let r=0;r<=t.length;r++)n[r]=r;for(let r=1;r<=e.length;r++){o[0]=r;for(let i=1;i<=t.length;i++){let s=e[r-1]===t[i-1]?0:1;o[i]=Math.min(n[i]+1,o[i-1]+1,n[i-1]+s)}[n,o]=[o,n]}return n[t.length]}function C(e){let t=e.indexOf(".");return t>=0?e.slice(0,t):e}function l(e){return e.toLowerCase().replace(/\+/g,"plus").replace(/[^a-z0-9]/g,"")}function u(e){return e==="ios"?{os:"iOS",device:"simulator",target:"simulator"}:{os:"Android",device:"emulator",target:"emulator"}}var x=.4,y=3;function _(e,t,n){let o=l(t);if(o==="")return[];let r=Math.max(1,Math.round(o.length*x)),i=[];for(let s of e.devices){if(n&&!s.osVersions.includes(n))continue;let a=Math.min(f(o,l(s.name)),s.configName?f(o,l(s.configName)):1/0);a<=r&&i.push({device:s,score:a})}return i.sort((s,a)=>s.score-a.score||s.device.name.localeCompare(a.device.name)),i.slice(0,y).map(s=>s.device)}function w(e,t){let n=Number.parseFloat(t);if(!Number.isFinite(n))return e.osVersions[e.osVersions.length-1];let o,r=1/0;for(let i of e.osVersions){let s=Math.abs(Number.parseFloat(i)-n);Number.isFinite(s)&&s<r&&(r=s,o=i)}return o??e.osVersions[e.osVersions.length-1]}function D(e){return` See all devices: kane-cli devices list --target ${u(e).target} --remote`}function N(e,t){let n=l(t);return e.devices.find(o=>l(o.name)===n||o.configName!==void 0&&l(o.configName)===n)}function k(e,t){return e.runson?.[C(t)]}function G(e,t,n){let o=u(e.platform),r=N(e,t);if(!r){let i=_(e,t,n),s=i.length?` Did you mean: ${i.map(a=>`${a.name} (${a.osVersions.join(", ")})`).join(`
|
|
3
3
|
`)}
|
|
4
4
|
`:"";return{ok:!1,code:"device_not_found",detail:`no ${o.device} device named "${t}"`+(n&&i.length?` running ${o.os} ${n}`:"")+`.
|
|
5
5
|
${s}${D(e.platform)}`}}if(!r.osVersions.includes(n)){let i=w(r,n);return{ok:!1,code:"device_os_version_unsupported",detail:`${r.name} does not run ${o.os} ${n}.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as l}from"./chunk-FCD3NYOM.js";import{a as c}from"./chunk-4QTH7VYE.js";import{a}from"./chunk-RZ4F3BHX.js";var h=class{constructor(e,t,r,s){this.controllerBaseUrl=e;this.getOAuthToken=t;this.directBasicAuth=r;this.log=s}_cached=null;_revoked=!1;_lastError=null;revoke(){this._revoked=!0,this._cached=null}prime(e){this._revoked||(this._cached=e)}get revoked(){return this._revoked}get cached(){return this._cached}get lastError(){return this._lastError}async resolve(e=!1){if(this._cached&&!e)return this._cached;try{let t;if(this.directBasicAuth)t=new l(this.controllerBaseUrl,{username:this.directBasicAuth.username,accessKey:this.directBasicAuth.access_key});else{let s=await this.getOAuthToken();if(!s)return null;t=new l(this.controllerBaseUrl,s)}let r=await t.getTmsCredentials();this.directBasicAuth&&!r.access_key&&(r.access_key=this.directBasicAuth.access_key),this._cached=r,this._lastError=null;try{let[{refreshIdentitySnapshot:s},{telemetryEnvName:n}]=await Promise.all([import("./identity-
|
|
2
|
+
import{a as l}from"./chunk-FCD3NYOM.js";import{a as c}from"./chunk-4QTH7VYE.js";import{a}from"./chunk-RZ4F3BHX.js";var h=class{constructor(e,t,r,s){this.controllerBaseUrl=e;this.getOAuthToken=t;this.directBasicAuth=r;this.log=s}_cached=null;_revoked=!1;_lastError=null;revoke(){this._revoked=!0,this._cached=null}prime(e){this._revoked||(this._cached=e)}get revoked(){return this._revoked}get cached(){return this._cached}get lastError(){return this._lastError}async resolve(e=!1){if(this._cached&&!e)return this._cached;try{let t;if(this.directBasicAuth)t=new l(this.controllerBaseUrl,{username:this.directBasicAuth.username,accessKey:this.directBasicAuth.access_key});else{let s=await this.getOAuthToken();if(!s)return null;t=new l(this.controllerBaseUrl,s)}let r=await t.getTmsCredentials();this.directBasicAuth&&!r.access_key&&(r.access_key=this.directBasicAuth.access_key),this._cached=r,this._lastError=null;try{let[{refreshIdentitySnapshot:s},{telemetryEnvName:n}]=await Promise.all([import("./identity-66TGWITQ.js"),import("./bootstrap-BV7HAARR.js")]);await s(n(),r)}catch{}return this.log?.("info","AUTH_RESOLVE_OK","Auth resolved",{username:r.username,org_id:r.org_id,user_id:r.user_id}),r}catch(t){return this._lastError=t instanceof Error?t:new Error(String(t)),this.log?.("warn","AUTH_RESOLVE_FAILED","Auth resolve failed",{error:this._lastError.message}),null}}async fetch(e,t={}){if(this._revoked)throw new Error("Resolver has been revoked \u2014 identity changed");let r=await this.resolve();if(!r)throw new Error("Not authenticated \u2014 no credentials resolved");let s=i=>({...t,headers:{...t.headers,Authorization:c(i.username,i.access_key)}}),n=await a(e,s(r));if(n.status===401){if(this._revoked)throw new Error("Resolver has been revoked \u2014 identity changed");this.log?.("warn","AUTH_RESOLVE_401","Got 401, re-resolving",{url:e});let i=await this.resolve(!0);if(!i)throw new Error("Re-authentication failed after 401");return a(e,s(i))}return n}};function _(o){if(!o)return"network";let e=/failed:\s*(\d{3})\b/.exec(o.message)?.[1];return e==="401"||e==="403"?"auth":e?"server":"network"}export{h as a,_ as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as B}from"./chunk-5Y2G4NC7.js";import{a as T}from"./chunk-HCBYKLMW.js";import{a as S,b as l,k as w}from"./chunk-33DWJV67.js";import{a as J}from"./chunk-6YGTRKDT.js";import{
|
|
2
|
+
import{a as B}from"./chunk-5Y2G4NC7.js";import{a as T}from"./chunk-HCBYKLMW.js";import{z as o}from"./chunk-YKOZBFR3.js";import{a as S,b as l,k as w}from"./chunk-33DWJV67.js";import{a as J}from"./chunk-6YGTRKDT.js";import{e as k}from"./chunk-UR6MHSHU.js";var y=k(J(),1);var r=k(T(),1),v=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function H(e){let n=e.replace(/…$/,"");return n&&n.charAt(0).toLowerCase()+n.slice(1)}function j(e,n){if(e.length<=n)return e;if(n<=1)return"\u2026";let p=Math.ceil((n-1)/2),b=Math.floor((n-1)/2);return`${e.slice(0,p)}\u2026${b>0?e.slice(-b):""}`}function K({status:e,meta:n,tallies:p,keys:b,child:d,cols:C,remote:A=!1,gapAbove:M=!1,accent:u=o.assuranceAccent}){let{stdout:R}=w(),m=C??R?.columns??80,L=e.kind==="working"||e.kind==="child-working",[E,O]=(0,y.useState)(0);B(()=>O(a=>a+1),L?120:null);let $=v[E%v.length],i,s;switch(e.kind){case"working":i=`${$} ${e.step}${e.elapsedS!==void 0?` \xB7 ${e.elapsedS}s`:""}`,s=u;break;case"waiting":i=`\u25CF waiting on you${e.pending?` \u2014 ${e.pending} question${e.pending===1?"":"s"}`:e.label?` \u2014 ${e.label}`:""}`,s=o.amber;break;case"retrying":i=`\u25CF ${e.text}`,s=o.amber;break;case"idle":i="\u25CF idle",s=u;break;case"card":i=`\u25CF card ${e.n} of ${e.m}`,s=o.amber;break;case"child-working":i=`${$} child: ${e.step}`,s=u;break;case"child-waiting":i="\u25CF child waiting on you",s=o.amber;break}let f=d?`${n.verb} \u25B8 ${d.verb}`:n.verb,F=d?.sid?n.sid?`${j(n.sid,14)} \u25B8 ${d.sid}`:d.sid:n.sid,h=n.env==="prod"?"":n.env,t=" \xB7 ",P=16,x=a=>i.length+t.length+[f,a,h].filter(Boolean).join(t).length,c=F,I=m-x(c)-t.length;A&&c&&(n.subject?I<Math.min(n.subject.length,P):x(c)>m)&&(c="");let N=[f,c,h].filter(Boolean),q=i.length+t.length+N.join(t).length,g=n.subject;if(g){let a=m-q-t.length;g=a>=8?j(g,a):void 0}let D=[f,...g?[g]:[],c,h].filter(Boolean).join(t);return(0,r.jsxs)(S,{flexDirection:"column",marginTop:M?1:0,children:[(0,r.jsx)(l,{color:o.muted,children:"\u2500".repeat(Math.max(1,m))}),(0,r.jsxs)(l,{children:[(0,r.jsx)(l,{color:s,children:i}),(0,r.jsx)(l,{color:o.dim,children:`${t}${D}`})]}),(0,r.jsx)(l,{color:o.dim,children:p.items.length>0?p.items.join(t):" "}),(0,r.jsx)(l,{color:o.muted,children:b.join(t)})]})}export{H as a,K as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as k,b as y}from"./chunk-U2VYTVKV.js";import{b as N,d as h,e as S,f as w}from"./chunk-32MFECUA.js";import{b as f,c as p,f as m}from"./chunk-EHB55V23.js";import{a as b}from"./chunk-
|
|
2
|
+
import{a as k,b as y}from"./chunk-U2VYTVKV.js";import{b as N,d as h,e as S,f as w}from"./chunk-32MFECUA.js";import{b as f,c as p,f as m}from"./chunk-EHB55V23.js";import{a as b}from"./chunk-XDAFRUAJ.js";import{existsSync as R,readFileSync as T}from"fs";var x=`kane-cli couldn't tell if this is a secret, so it's marked as one; set "secret": false if it isn't`;function O(e){let t=k(e.cwd),i=p(f(e.cwd)),n=j(t),o=[],c=new Set,u=[];for(let r of e.tests){let s=q(r);if(s===null)continue;let l=new Set;s.forEach((d,v)=>{let P=d===null?[]:N(d).filter(a=>!l.has(a));if(v===0&&d!==null)for(let a of h(d))c.add(a);for(let a of P)o.includes(a)||o.push(a);if(d!==null)for(let a of w(d))l.add(a)}),S({surfaceRequired:r.surfaceRequired===!0,firstStep:s[0],...r.target!==void 0?{target:r.target}:{}})&&u.push({test:r.test,title:r.title,...r.file?{file:r.file}:{}})}let g=o.filter(r=>i.get(r)?.has_value!==!0),_=[...g.filter(r=>c.has(r)),...g.filter(r=>!c.has(r))];return{file:t,variables:_.map(r=>{let s=E(n[r]),l=s!==void 0&&typeof s.secret=="boolean";return{name:r,...l?{secret:s.secret}:{secret:!0},...l?s.description!==void 0?{description:s.description}:{}:{description:s?.description?`${s.description}; ${x}`:x},...c.has(r)?{start_page:!0}:{}}}),noStartPage:u}}function J(e){let t=[];for(let i of e.ids){let n=e.graph.resolve(i),o=n?e.graph.getNode(n.tip):null;o?.label==="test"&&t.push(V(i,o.content))}return O({tests:t,cwd:e.cwd})}function V(e,t,i){let{title:n,test_md_blob:o,target:c}=t,u=t.check;return{test:e,title:typeof n=="string"?n:e,blob:typeof o=="string"?o:"",...i?{file:i}:{},...t.surface_required===!0||u?.surface_required===!0?{surfaceRequired:!0}:{},...typeof c=="string"?{target:c}:{}}}function D(e,t){let i=e.variables.filter(n=>m(n.name)===null);i.length!==0&&y({file:e.file,declarations:i.map(n=>({name:n.name,description:n.description??"",secret:n.secret===!0})),known:p(f(t))})}function q(e){try{return b(`${e.test}_test.md`,e.blob).steps.map(t=>t.body.kind==="objective"?t.body.text:null)}catch{return null}}function I(e){return e instanceof SyntaxError?"a variables file here isn't valid JSON":e instanceof Error?e.message:String(e)}function E(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function j(e){if(!R(e))return{};try{let t=JSON.parse(T(e,"utf8"));return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}export{O as a,J as b,V as c,D as d,I as e};
|