@testmuai/kane-cli 0.10.0 → 0.10.2
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-FIYDTZSI.js +2 -0
- package/dist/{ChromeProfilePicker-FWPUDKD6.js → ChromeProfilePicker-Q6FIGVYU.js} +1 -1
- package/dist/{CliFeedbackPrompt-D5L2DO6A.js → CliFeedbackPrompt-2NV2G65E.js} +1 -1
- package/dist/{CliUploadProgress-HQX57WE6.js → CliUploadProgress-JZ5FXODE.js} +1 -1
- package/dist/{ConfigView-DGQXKEON.js → ConfigView-TZ4YINOE.js} +1 -1
- package/dist/EvidenceViewOffer-LKPN5BHX.js +2 -0
- package/dist/FolderPicker-H5K74PCH.js +2 -0
- package/dist/InfoBox-DNSOAK5L.js +2 -0
- package/dist/{LinksBox-WZ4RAMSH.js → LinksBox-32TZOANP.js} +1 -1
- package/dist/{ProfilesView-AGRNPGSW.js → ProfilesView-UC4MPM54.js} +1 -1
- package/dist/ProjectPicker-ZJ5RW6XL.js +2 -0
- package/dist/SaveSessionPrompt-F327WC7A.js +2 -0
- package/dist/SingleShotApp-OMLRYOSI.js +2 -0
- package/dist/{SummaryBox-XQJUZBAN.js → SummaryBox-XGFO5X76.js} +1 -1
- package/dist/TestMdRunView-ZZ77QTAQ.js +2 -0
- package/dist/TestrunEvidenceTable-G7MPF55X.js +2 -0
- package/dist/{WhoamiView-JQCURK2M.js → WhoamiView-4XIJXMTU.js} +1 -1
- package/dist/{app-download-OU6AGH2X.js → app-download-XEDO3EMV.js} +1 -1
- package/dist/{assurance-job-ZI3L6I4F.js → assurance-job-MD65GQLC.js} +1 -1
- package/dist/{auth-7Z54TMQQ.js → auth-WBIEHHDS.js} +1 -1
- package/dist/{binary-S5YL5GJD.js → binary-NVYLR36K.js} +1 -1
- package/dist/{bind-LIV72SEZ.js → bind-H3ALI2NG.js} +1 -1
- package/dist/{bootstrap-3V6TOO6I.js → bootstrap-JEVSVPQ2.js} +1 -1
- package/dist/bridge-2UHJOVLX.js +2 -0
- package/dist/{catalog-I3PC6LT6.js → catalog-5UYBWA4W.js} +1 -1
- package/dist/{catalog-client-WKYG3JN6.js → catalog-client-VVKV4JKW.js} +1 -1
- package/dist/{changelog-IHNWFYWY.js → changelog-FPWJXERY.js} +1 -1
- package/dist/chat-committer-ZKEKJA2R.js +2 -0
- package/dist/chat-controller-FXRJXUG3.js +2 -0
- package/dist/child-JHYENXE7.js +2 -0
- package/dist/{chunk-URAYFJGM.js → chunk-226AGYHB.js} +1 -1
- package/dist/{chunk-ZTAZ2R5Z.js → chunk-23DKB2MT.js} +1 -1
- package/dist/{chunk-JGLADDRH.js → chunk-2COXO5LQ.js} +1 -1
- package/dist/{chunk-TZVPDGJD.js → chunk-2GEAKFAV.js} +1 -1
- package/dist/{chunk-45URQUAK.js → chunk-2QKBXRLI.js} +1 -1
- package/dist/{chunk-AG5XJWEV.js → chunk-2ULYGALF.js} +1 -1
- package/dist/{chunk-G3J4XY3Z.js → chunk-32HED7X2.js} +1 -1
- package/dist/{chunk-GRURFGBP.js → chunk-32MFECUA.js} +1 -1
- package/dist/{chunk-N3KTLWJL.js → chunk-35BG2EMW.js} +1 -1
- package/dist/{chunk-KDR662D2.js → chunk-3KY7HHQU.js} +1 -1
- package/dist/{chunk-ZGQM6KWN.js → chunk-3V4J65GN.js} +1 -1
- package/dist/{chunk-DBTMKBHU.js → chunk-3YIA3DSL.js} +1 -1
- package/dist/{chunk-VVCZRCRD.js → chunk-44SIFDNY.js} +1 -1
- package/dist/{chunk-Z5BFCTHI.js → chunk-45NM23EQ.js} +2 -2
- package/dist/{chunk-I2MC6VVX.js → chunk-4C7WVQOD.js} +1 -1
- package/dist/{chunk-3UHPVQLU.js → chunk-4HARMERK.js} +1 -1
- package/dist/{chunk-A3TCFSCK.js → chunk-4HYPMGDF.js} +1 -1
- package/dist/{chunk-7KX2BHKG.js → chunk-4KCYNP2K.js} +1 -1
- package/dist/{chunk-FVYIV36L.js → chunk-4LGQHTXM.js} +1 -1
- package/dist/{chunk-WKZLK57W.js → chunk-4NEPHIAO.js} +1 -1
- package/dist/{chunk-YYVBE6W2.js → chunk-54NJJVG5.js} +1 -1
- package/dist/{chunk-3OVFKUXV.js → chunk-5F44KH3R.js} +1 -1
- package/dist/{chunk-WERIGVOH.js → chunk-5F5IVART.js} +1 -1
- package/dist/{chunk-FBQ7PQJV.js → chunk-5KJU4MG4.js} +1 -1
- package/dist/{chunk-D6CS62O7.js → chunk-5MFPQYW3.js} +1 -1
- package/dist/{chunk-ZI3X7DI2.js → chunk-5WLXAQ4H.js} +1 -1
- package/dist/{chunk-RFEON5GN.js → chunk-5XVWT6UK.js} +1 -1
- package/dist/{chunk-5IO5ZC4S.js → chunk-6CS23F3E.js} +1 -1
- package/dist/{chunk-DTYT6KBO.js → chunk-6JUS2ULI.js} +1 -1
- package/dist/{chunk-HMQ5M4JJ.js → chunk-6LEHGRRG.js} +1 -1
- package/dist/{chunk-5R3ODQHH.js → chunk-6SD4XTYC.js} +1 -1
- package/dist/{chunk-Y3YULFCK.js → chunk-6SWHEBPR.js} +1 -1
- package/dist/{chunk-BY2B4YJN.js → chunk-6YBH3WUW.js} +1 -1
- package/dist/{chunk-X3J4CC27.js → chunk-73HMW2WA.js} +1 -1
- package/dist/{chunk-PQXYHI5W.js → chunk-75FF7J5R.js} +1 -1
- package/dist/{chunk-JTJ7IPNI.js → chunk-7DLDADQR.js} +1 -1
- package/dist/{chunk-J4LQAT5P.js → chunk-7LYLJ75Z.js} +1 -1
- package/dist/{chunk-XLQ4F6BI.js → chunk-7O2FIZB7.js} +2 -2
- package/dist/{chunk-UUWSULIM.js → chunk-7PCLHURF.js} +3 -3
- package/dist/{chunk-FLOQ5NZL.js → chunk-7XJNYLQW.js} +1 -1
- package/dist/{chunk-3ZPEQDXZ.js → chunk-7ZR5CQY3.js} +1 -1
- package/dist/{chunk-CJQUVHHS.js → chunk-A474TUCE.js} +1 -1
- package/dist/chunk-A4ZV2SHL.js +5 -0
- package/dist/{chunk-RDH3E25Q.js → chunk-A7IMHUFY.js} +2 -2
- package/dist/{chunk-EVZLINBN.js → chunk-ABMM37L2.js} +1 -1
- package/dist/{chunk-QECTIQAC.js → chunk-AUSLHNXQ.js} +1 -1
- package/dist/{chunk-4MNSP4EO.js → chunk-B226SFOV.js} +1 -1
- package/dist/{chunk-2L3A5NKZ.js → chunk-B57ZRHEQ.js} +1 -1
- package/dist/{chunk-2PZKMT3I.js → chunk-BHQIH2FE.js} +1 -1
- package/dist/{chunk-4SJAOAYY.js → chunk-BJT6PZXL.js} +1 -1
- package/dist/{chunk-YKOEABP2.js → chunk-C6P6YUCR.js} +1 -1
- package/dist/chunk-CB344EDO.js +2 -0
- package/dist/chunk-CCOD4GQJ.js +2 -0
- package/dist/{chunk-CJE7PKRV.js → chunk-CQDCNP7V.js} +1 -1
- package/dist/{chunk-EPJ5SJL2.js → chunk-D4QXYAYA.js} +2 -2
- package/dist/{chunk-CBVHP7JB.js → chunk-DLP5S3TO.js} +1 -1
- package/dist/{chunk-EH43VWVR.js → chunk-DXIQVBMI.js} +1 -1
- package/dist/chunk-DXLZCJH5.js +7 -0
- package/dist/{chunk-WZLDFEWR.js → chunk-E4GIGM5V.js} +1 -1
- package/dist/{chunk-JOCEZK2M.js → chunk-EAWU2TOG.js} +1 -1
- package/dist/{chunk-G3CYFCSR.js → chunk-EEOAU43D.js} +1 -1
- package/dist/{chunk-MYZHOBS4.js → chunk-EHB55V23.js} +1 -1
- package/dist/{chunk-OR2B6T3B.js → chunk-ENRFXGID.js} +1 -1
- package/dist/{chunk-JT6WLJSV.js → chunk-ET5EK2CM.js} +1 -1
- package/dist/{chunk-HGVM2OZU.js → chunk-EZMRWXRT.js} +1 -1
- package/dist/{chunk-QMOGBKJM.js → chunk-FAMQ4DHU.js} +1 -1
- package/dist/{chunk-GGV336P5.js → chunk-FI2DVNRT.js} +1 -1
- package/dist/{chunk-AUJSC7PU.js → chunk-FNUGDPTS.js} +1 -1
- package/dist/{chunk-MPEIMWQI.js → chunk-FOLUB336.js} +1 -1
- package/dist/{chunk-4JWJH6TB.js → chunk-FYPIF3BE.js} +1 -1
- package/dist/{chunk-HHW6MRU3.js → chunk-G4K3TP2I.js} +1 -1
- package/dist/{chunk-P2ZQDQDB.js → chunk-GAKBHNC4.js} +1 -1
- package/dist/{chunk-DPGOAFKF.js → chunk-GBQ4K25P.js} +1 -1
- package/dist/{chunk-PCDIEYV6.js → chunk-GEZVC4S3.js} +1 -1
- package/dist/{chunk-UX2CDUPE.js → chunk-GJ7MO2FW.js} +2 -2
- package/dist/{chunk-PL3SG3M2.js → chunk-GJXO6FF7.js} +1 -1
- package/dist/{chunk-252GEI3H.js → chunk-GLM5UGTF.js} +1 -1
- package/dist/{chunk-JCSVBD4F.js → chunk-GQARXS6F.js} +1 -1
- package/dist/{chunk-NTXFPNAP.js → chunk-GT3JDX5H.js} +1 -1
- package/dist/{chunk-RARD6TC6.js → chunk-GZQAETB2.js} +1 -1
- package/dist/{chunk-TLOYTGVT.js → chunk-H4TIVILC.js} +1 -1
- package/dist/{chunk-7C4IEL5V.js → chunk-HG2ILWCE.js} +1 -1
- package/dist/{chunk-2SY2NCOP.js → chunk-HHOVANJ7.js} +1 -1
- package/dist/{chunk-DHYGCHKB.js → chunk-HM6LZ2KM.js} +1 -1
- package/dist/{chunk-NJCN6LP5.js → chunk-HNF3PWF3.js} +6 -6
- package/dist/{chunk-P2LDAW3C.js → chunk-HVOXMCKE.js} +1 -1
- package/dist/{chunk-JSLKCCD2.js → chunk-HWPWCCEV.js} +1 -1
- package/dist/{chunk-XMALVGH7.js → chunk-HX5OLRKU.js} +2 -2
- package/dist/{chunk-4I7YN6YY.js → chunk-HYJVYYAZ.js} +2 -2
- package/dist/{chunk-2N75WO7Y.js → chunk-I52NWH4U.js} +1 -1
- package/dist/{chunk-3T2TYDPT.js → chunk-IB5WG5YY.js} +1 -1
- package/dist/{chunk-6DZ7LVOG.js → chunk-IH73ZCBB.js} +1 -1
- package/dist/{chunk-SBR6D6GS.js → chunk-IT5JVCZN.js} +1 -1
- package/dist/{chunk-GGS3ATPB.js → chunk-IZ66FKPC.js} +1 -1
- package/dist/{chunk-EX6ORR7P.js → chunk-JNPFEBUR.js} +1 -1
- package/dist/{chunk-AU26ZZTX.js → chunk-JTNEF5ZP.js} +1 -1
- package/dist/{chunk-K2PLULJD.js → chunk-JUVY6PHY.js} +1 -1
- package/dist/{chunk-JQ7ZZQXC.js → chunk-K4K2BGQC.js} +3 -3
- package/dist/{chunk-VZA7BPCK.js → chunk-K75WIRI5.js} +1 -1
- package/dist/{chunk-4R4YUOVY.js → chunk-KKLCXRW6.js} +1 -1
- package/dist/{chunk-YGMQXS2J.js → chunk-KN7GZWKK.js} +1 -1
- package/dist/{chunk-I2VU2DTS.js → chunk-L3BUPFAQ.js} +4 -4
- package/dist/{chunk-2GE5X2A5.js → chunk-LLQWEGXD.js} +1 -1
- package/dist/chunk-LTPOMMAB.js +2 -0
- package/dist/{chunk-AUBSLPJZ.js → chunk-LWCP4GLY.js} +1 -1
- package/dist/{chunk-VQZOKTJ2.js → chunk-LXCTV75T.js} +1 -1
- package/dist/{chunk-YH4VZVHJ.js → chunk-LZGAFKYH.js} +1 -1
- package/dist/{chunk-3QICDXY5.js → chunk-LZPYIFHZ.js} +1 -1
- package/dist/{chunk-WQR2GYP7.js → chunk-M3TFOFUQ.js} +1 -1
- package/dist/{chunk-MKPDF26Q.js → chunk-M7Y5GGVJ.js} +1 -1
- package/dist/{chunk-52VCA4K2.js → chunk-MEMXFTLD.js} +1 -1
- package/dist/{chunk-U7NRZBB5.js → chunk-MINDIQET.js} +1 -1
- package/dist/{chunk-JX5NVKTV.js → chunk-MP6NCJFE.js} +1 -1
- package/dist/{chunk-VA3BSIUQ.js → chunk-MSYRAPDK.js} +1 -1
- package/dist/{chunk-HJLMH7ZM.js → chunk-MUX2A37P.js} +1 -1
- package/dist/{chunk-EQWMOGLO.js → chunk-NCP54AIQ.js} +2 -2
- package/dist/{chunk-QQI6N3FO.js → chunk-NVD2MXHQ.js} +1 -1
- package/dist/{chunk-2EVP636F.js → chunk-O2Y46A3G.js} +3 -3
- package/dist/{chunk-ONZ2CSTZ.js → chunk-O3TXAMFW.js} +1 -1
- package/dist/{chunk-YI4ESDAX.js → chunk-O5KTMDTH.js} +1 -1
- package/dist/{chunk-HBVHIEPB.js → chunk-OK6NLITG.js} +1 -1
- package/dist/{chunk-JFBEHCJN.js → chunk-OKA6FPJM.js} +1 -1
- package/dist/{chunk-65BG6GAE.js → chunk-OVNTCBNS.js} +1 -1
- package/dist/{chunk-4523YDTG.js → chunk-P4VFC6HO.js} +1 -1
- package/dist/{chunk-ULGBK4NS.js → chunk-PC22QRIY.js} +1 -1
- package/dist/{chunk-B2WFW74J.js → chunk-PEUIHME2.js} +1 -1
- package/dist/{chunk-Z777GGHB.js → chunk-PI7OXS62.js} +1 -1
- package/dist/{chunk-MHB6DMKZ.js → chunk-POA336CU.js} +1 -1
- package/dist/{chunk-ZZNQIFFI.js → chunk-PR5EGLEI.js} +1 -1
- package/dist/{chunk-MW2WNYJO.js → chunk-PRBWZXFA.js} +2 -2
- package/dist/{chunk-4BUEOKFV.js → chunk-PWNYTIVA.js} +1 -1
- package/dist/{chunk-FYCD765R.js → chunk-Q4JV4U65.js} +58 -58
- package/dist/{chunk-BRVIK3BU.js → chunk-Q5AKIQIE.js} +1 -1
- package/dist/{chunk-EC5IP5HZ.js → chunk-QB77LRF4.js} +1 -1
- package/dist/{chunk-AGXAJ2II.js → chunk-QUNIY6NN.js} +1 -1
- package/dist/{chunk-LHQUCRCH.js → chunk-QVMXL675.js} +1 -1
- package/dist/{chunk-FPPVNF53.js → chunk-R6TFRAMZ.js} +1 -1
- package/dist/{chunk-567D5ZTO.js → chunk-RAVAJZV2.js} +7 -7
- package/dist/{chunk-7ZJWUWSN.js → chunk-RDAIOJCR.js} +1 -1
- package/dist/{chunk-PBWYQR5I.js → chunk-RRKYHUOD.js} +1 -1
- package/dist/{chunk-GXMD23XB.js → chunk-S7XCOBYD.js} +1 -1
- package/dist/{chunk-32Y6QVFG.js → chunk-SALZ6WSF.js} +1 -1
- package/dist/{chunk-4NUSW4A2.js → chunk-SIHX5FW5.js} +1 -1
- package/dist/{chunk-USJ3LUAL.js → chunk-SSOUYKVG.js} +1 -1
- package/dist/{chunk-2B75UL7Y.js → chunk-SVIIUKJ2.js} +1 -1
- package/dist/{chunk-QVP4FSKT.js → chunk-T77LTLAD.js} +1 -1
- package/dist/{chunk-KRRZCY7U.js → chunk-TAY7J5VS.js} +1 -1
- package/dist/chunk-TD6GCEIK.js +2 -0
- package/dist/{chunk-ZY65IZJR.js → chunk-TM6VLC6V.js} +1 -1
- package/dist/{chunk-YKL5H4K6.js → chunk-TMH4TPMB.js} +1 -1
- package/dist/{chunk-COJINPOK.js → chunk-TU2KPOW2.js} +2 -2
- package/dist/{chunk-3BSYOCSW.js → chunk-U2VYTVKV.js} +1 -1
- package/dist/{chunk-W3NWHWK2.js → chunk-UCVP7ZY4.js} +1 -1
- package/dist/{chunk-436FZ4KG.js → chunk-UICJ2KLJ.js} +1 -1
- package/dist/{chunk-QWZJ5QDO.js → chunk-UMNCM4RJ.js} +1 -1
- package/dist/{chunk-LNHBZEDC.js → chunk-UWPG5MWM.js} +1 -1
- package/dist/{chunk-MJKRJGER.js → chunk-V3OZJO7Y.js} +1 -1
- package/dist/{chunk-ZKPY3AXW.js → chunk-VE4HLIGA.js} +1 -1
- package/dist/{chunk-K3OSK6PB.js → chunk-W2HRX3DR.js} +1 -1
- package/dist/{chunk-B7JLM3IX.js → chunk-W54BX6HC.js} +1 -1
- package/dist/{chunk-IZ65ZPWY.js → chunk-W5HFUBXD.js} +1 -1
- package/dist/{chunk-GRO6DLN3.js → chunk-WEJR2V7R.js} +1 -1
- package/dist/{chunk-A4BB6GLN.js → chunk-X3A4QPA3.js} +1 -1
- package/dist/{chunk-G2KTWFMU.js → chunk-X52YIWGG.js} +1 -1
- package/dist/{chunk-UEPJ26X2.js → chunk-X6FCXBXU.js} +1 -1
- package/dist/{chunk-LXM7VHYN.js → chunk-X7S7IGCV.js} +1 -1
- package/dist/{chunk-UNWPBMVM.js → chunk-XCUF5AVM.js} +1 -1
- package/dist/{chunk-FPVGA6XT.js → chunk-XHFU5TGS.js} +1 -1
- package/dist/{chunk-ZRDX2ARO.js → chunk-XNXJXGVB.js} +2 -2
- package/dist/{chunk-JRSEAXFE.js → chunk-XZ6J3Y2W.js} +1 -1
- package/dist/{chunk-JGRXMTME.js → chunk-YDB72F4K.js} +1 -1
- package/dist/{chunk-7DFBOVUB.js → chunk-YJAQZMJT.js} +1 -1
- package/dist/{chunk-GYDJO32R.js → chunk-YO6SNXBJ.js} +1 -1
- package/dist/{chunk-RLOJH5O6.js → chunk-Z24SD2EJ.js} +1 -1
- package/dist/{chunk-ENG2UTMX.js → chunk-Z36KVIRR.js} +1 -1
- package/dist/{chunk-PTISAIZW.js → chunk-Z6SI7YNV.js} +1 -1
- package/dist/{chunk-6NFOH4AC.js → chunk-ZAQGIC33.js} +1 -1
- package/dist/{chunk-AIGQCMGY.js → chunk-ZCL7XIVS.js} +1 -1
- package/dist/{chunk-ORNVIEUA.js → chunk-ZDCXWEQG.js} +1 -1
- package/dist/{chunk-WX4VGH5Q.js → chunk-ZDQYGLCZ.js} +1 -1
- package/dist/{chunk-6TNLITJO.js → chunk-ZHAMVLQZ.js} +1 -1
- package/dist/{chunk-H4KPNGY4.js → chunk-ZMWTRXFH.js} +1 -1
- package/dist/{chunk-GET4DINR.js → chunk-ZO3ZAMUU.js} +1 -1
- package/dist/{chunk-GI2JPIX5.js → chunk-ZZZGTDYE.js} +1 -1
- package/dist/commands-R5AYK6XM.js +2 -0
- package/dist/{committer-26UZDYSA.js → committer-UO3B3S5Y.js} +1 -1
- package/dist/{config-B472DZSR.js → config-YMHI3H3Y.js} +1 -1
- package/dist/cover-cmd-DVQIGFDY.js +2 -0
- package/dist/{credentials-TLT3RQOO.js → credentials-BCR73VGS.js} +1 -1
- package/dist/{deps-bundle-CMTIWBS5.js → deps-bundle-6WLX44OA.js} +1 -1
- package/dist/{deps-resolve-XLFZK74A.js → deps-resolve-DSAKPZ3T.js} +1 -1
- package/dist/{design-chat-I7X3QDDY.js → design-chat-YUI2JPO6.js} +1 -1
- package/dist/design-committer-7YIPFKMO.js +2 -0
- package/dist/design-headless-KIP6R7UV.js +2 -0
- package/dist/{design-remote-UDC5FP45.js → design-remote-XMSHDDUX.js} +2 -2
- package/dist/device-env-K7J5NN66.js +2 -0
- package/dist/dispatch-BV6XMCN3.js +2 -0
- package/dist/{doctor-UHFCIM4B.js → doctor-PGTNOMSP.js} +1 -1
- package/dist/{docx-convert-N4KMLLKO.js → docx-convert-DO5AQYD3.js} +1 -1
- package/dist/{dossier-6KMKEIXV.js → dossier-5XKNAK6Q.js} +1 -1
- package/dist/evidence-RO3RDZXO.js +2 -0
- package/dist/evidence-presentation-LSFOZGLH.js +2 -0
- package/dist/evolve-cmd-U2ALVGMT.js +2 -0
- package/dist/evolve-remote-K2MCCVMM.js +2 -0
- package/dist/{explain-cmd-R67B4YR3.js → explain-cmd-KNDORU2D.js} +1 -1
- package/dist/{explain-cmd-235TY7QX.js → explain-cmd-UWK5YVXG.js} +1 -1
- package/dist/explore-S2BGQUIF.js +2 -0
- package/dist/{explore-context-tty-YXEFT32U.js → explore-context-tty-WJHUSP3A.js} +1 -1
- package/dist/{explore-entry-V6L5FSP4.js → explore-entry-3EX2T3NS.js} +4 -4
- package/dist/{explore-live-N5VBLBUI.js → explore-live-TRY5A2ME.js} +1 -1
- package/dist/{explore-run-tty-ZZQ33GNA.js → explore-run-tty-ZV5XFKZA.js} +2 -2
- package/dist/{extract-bind-BTINHHE5.js → extract-bind-TXUBMK3T.js} +3 -3
- package/dist/extract-chat-VPYDGQKO.js +2 -0
- package/dist/{extract-cmd-45OZETCM.js → extract-cmd-YUOYMVF5.js} +2 -2
- package/dist/extract-headless-UWTAPOET.js +2 -0
- package/dist/{feeder-L55TH2NC.js → feeder-NGWIPZ26.js} +1 -1
- package/dist/folder-flags-WV7UV3JG.js +2 -0
- package/dist/gaps-cmd-PFV3FZCM.js +3 -0
- package/dist/gate-7ALXLCNB.js +2 -0
- package/dist/gate-NB5CJMTN.js +2 -0
- package/dist/{generate-headless-DAH3HHRQ.js → generate-headless-KMBBZTLS.js} +2 -2
- package/dist/hold-passthrough-JGHWMYDM.js +2 -0
- package/dist/{impact-cmd-3VFJAKYK.js → impact-cmd-PW33L5RF.js} +2 -2
- package/dist/index.js +4154 -190
- package/dist/ingest-ZHHHBUXR.js +2 -0
- package/dist/{ingest-cmd-YSEH5EPU.js → ingest-cmd-MXYILQLV.js} +3 -3
- package/dist/ingest-remote-2EEJP6ML.js +2 -0
- package/dist/install-7J34AYB6.js +2 -0
- package/dist/{interactive-bind-P3GTFIZM.js → interactive-bind-FDWJUTI6.js} +4 -4
- package/dist/{interactive-remote-PBRQHTAF.js → interactive-remote-O2Q2FNOH.js} +1 -1
- package/dist/lane-CNGO7LH5.js +2 -0
- package/dist/lattice-auth-TXNDLHM6.js +2 -0
- package/dist/{lifecycle-cmd-PUNFWKV5.js → lifecycle-cmd-GFHDBRXX.js} +1 -1
- package/dist/{list-cmd-RD7YBF4S.js → list-cmd-RR75PMPE.js} +1 -1
- package/dist/{list-commands-UZELZAB3.js → list-commands-3QGZWJ5P.js} +1 -1
- package/dist/{list-remote-KGKXPCQA.js → list-remote-AA3VSWOI.js} +1 -1
- package/dist/{locks-cmd-LXZ6I4QG.js → locks-cmd-AZKCSGHI.js} +1 -1
- package/dist/{logical-ids-D5PFYY4C.js → logical-ids-74PLU3VR.js} +1 -1
- package/dist/login-flow-ZQ6UFTS2.js +2 -0
- package/dist/{maintenance-cmd-WRWBCP3R.js → maintenance-cmd-OHGVARQ2.js} +1 -1
- package/dist/{mobile-prompts-Z7NQHRGP.js → mobile-prompts-FZRKLLTN.js} +1 -1
- package/dist/{objective-variable-gate-3Z7DNVVC.js → objective-variable-gate-V5HHFOUS.js} +1 -1
- package/dist/{onboarding-ZP4XDYEO.js → onboarding-NXGMV3VG.js} +1 -1
- package/dist/open-provider-XDJKT3W3.js +2 -0
- package/dist/pdf-convert-YB6PJFMI.js +2 -0
- package/dist/persist-recorded-session-INFN4JZT.js +3 -0
- package/dist/phase-seed-ZZSJME7M.js +2 -0
- package/dist/pipeline-MVZRI6YZ.js +2 -0
- package/dist/{policy-commands-TY6WOR73.js → policy-commands-3YJ6YCDN.js} +1 -1
- package/dist/{prepare-target-EVL2QSXA.js → prepare-target-DII5WZCX.js} +1 -1
- package/dist/{pull-cmd-QJQANBAW.js → pull-cmd-XZN53XFZ.js} +1 -1
- package/dist/{pull-route-AIOTLA3D.js → pull-route-R33BVADE.js} +1 -1
- package/dist/readmodel-TRV4E3MW.js +2 -0
- package/dist/real-device-run-DGENHGUV.js +2 -0
- package/dist/{reconcile-cmd-IJTQAJZX.js → reconcile-cmd-KFPRCCJB.js} +4 -4
- package/dist/reconcile-deps-UDQBWSLE.js +2 -0
- package/dist/{reconcile-remote-23D6SXXT.js → reconcile-remote-6WISFGRG.js} +2 -2
- package/dist/{recording-banner-MNRMMEX4.js → recording-banner-XOX2CDCF.js} +1 -1
- package/dist/registry-NV3EMDMK.js +2 -0
- package/dist/remote-entry-BCTFT643.js +2 -0
- package/dist/{remote-mode-AFNCN6EE.js → remote-mode-4HN27MD4.js} +1 -1
- package/dist/{remote-words-RCNFI2TQ.js → remote-words-LFDYKIZ7.js} +1 -1
- package/dist/{require-project-folder-7UH43GHI.js → require-project-folder-ZK4JJCDB.js} +1 -1
- package/dist/{resolve-run-intent-XEWFYMGN.js → resolve-run-intent-LYLVNNDZ.js} +1 -1
- package/dist/{resolver-QMPX6RBR.js → resolver-RMHGGYRP.js} +1 -1
- package/dist/revert-QKHPCRT6.js +2 -0
- package/dist/{review-cmd-2OECKNL5.js → review-cmd-UGF2FC5Y.js} +1 -1
- package/dist/run-CSYGVV3D.js +2 -0
- package/dist/run-YUHHD54J.js +2 -0
- package/dist/{run-channel-63SVP5OI.js → run-channel-IIIYXOIW.js} +1 -1
- package/dist/run-remote-BGKQDAOA.js +2 -0
- package/dist/{run-startup-gate-USQFSW47.js → run-startup-gate-4XE73OON.js} +1 -1
- package/dist/run-test-md-G6U3RU2Q.js +19 -0
- package/dist/session-worker.js +2 -2
- package/dist/{sessions-CFV7FOIT.js → sessions-NH2EG7BP.js} +1 -1
- package/dist/{sessions-cmd-LQ2LZQOC.js → sessions-cmd-CABAX7BO.js} +2 -2
- package/dist/{sessions-remote-H7CQST42.js → sessions-remote-Y4FTZL7Y.js} +1 -1
- package/dist/{skill-installer-LKYY6XFJ.js → skill-installer-FS2AV7GX.js} +1 -1
- package/dist/spawner-MQ4XEHIX.js +2 -0
- package/dist/{store-KM5MG3XB.js → store-PLKJZTGC.js} +1 -1
- package/dist/store-choice-UAB6Z4AL.js +2 -0
- package/dist/{store-guard-34GG2TW2.js → store-guard-DUN2X3SR.js} +1 -1
- package/dist/{store-site-ZSFINU6C.js → store-site-K5NHLI7D.js} +1 -1
- package/dist/stream-warnings-GM7YEOVG.js +2 -0
- package/dist/sync-cmd-AGTOGPYM.js +2 -0
- package/dist/{sync-setup-QQXYO6R4.js → sync-setup-4KIY3PDO.js} +1 -1
- package/dist/tcg-generate-CUY4AZ2V.js +2 -0
- package/dist/testmd-actions-UD6PAWUX.js +2 -0
- package/dist/{testmd-sync-PQ4GFKHB.js → testmd-sync-EEJ7GPLR.js} +1 -1
- package/dist/token-refresh-K6PVBBFE.js +2 -0
- package/dist/{trust-gate-AT2XBWN4.js → trust-gate-674C2NZS.js} +1 -1
- package/dist/{turn-preflight-LHYLRL7G.js → turn-preflight-R4PU6NYY.js} +1 -1
- package/dist/{use-case-ref-NA3IXGQW.js → use-case-ref-44BPIP4N.js} +1 -1
- package/dist/{validate-basic-3DX3MMC7.js → validate-basic-3JZRZL45.js} +1 -1
- package/dist/{variable-receipt-BXSZO36E.js → variable-receipt-7PRKDTRJ.js} +1 -1
- package/dist/verdicts-PVB7TV5S.js +2 -0
- package/dist/{version-check-OV6AOVED.js → version-check-IY3YSQIP.js} +1 -1
- package/dist/{view-cmd-QDKBBNIU.js → view-cmd-WUIGTRFX.js} +1 -1
- package/dist/{walk-session-BAYYPIKN.js → walk-session-EH7227WR.js} +1 -1
- package/dist/with-telemetry-7JMZUBUZ.js +2 -0
- package/package.json +16 -16
- package/dist/ChatSurface-XUV3EQPZ.js +0 -2
- package/dist/EvidenceViewOffer-EIANIYN7.js +0 -2
- package/dist/FolderPicker-XOA7FTHF.js +0 -2
- package/dist/InfoBox-OBH7SUGC.js +0 -2
- package/dist/ProjectPicker-6KRLKV4U.js +0 -2
- package/dist/SaveSessionPrompt-J2OPDEOO.js +0 -2
- package/dist/SingleShotApp-QI4B2TSL.js +0 -2
- package/dist/TestMdRunView-I4MV54FB.js +0 -2
- package/dist/TestrunEvidenceTable-WEIUSW3E.js +0 -2
- package/dist/bridge-SDEP7Y33.js +0 -2
- package/dist/chat-committer-FM5NG46O.js +0 -2
- package/dist/chat-controller-FWFQVZTB.js +0 -2
- package/dist/child-H2YSDFCG.js +0 -2
- package/dist/chunk-34R7BNZ2.js +0 -2
- package/dist/chunk-5T6II7VN.js +0 -7
- package/dist/chunk-KF4DKXSS.js +0 -2
- package/dist/chunk-NOFJXCYP.js +0 -5
- package/dist/chunk-SB6P5EQH.js +0 -2
- package/dist/commands-QOORPTSI.js +0 -2
- package/dist/cover-cmd-3VO6QC5Y.js +0 -2
- package/dist/design-committer-Y7R56RFZ.js +0 -2
- package/dist/design-headless-HUQOXLZB.js +0 -2
- package/dist/device-env-MMGISNHN.js +0 -2
- package/dist/dispatch-P2445PUU.js +0 -2
- package/dist/evidence-M3JTOJNL.js +0 -2
- package/dist/evidence-presentation-DV3DRB4S.js +0 -2
- package/dist/evolve-cmd-K3JXACMN.js +0 -2
- package/dist/evolve-remote-CUDVV2O2.js +0 -2
- package/dist/explore-UDD5FHXW.js +0 -2
- package/dist/extract-chat-ABZ5S7UU.js +0 -2
- package/dist/extract-headless-ALEFAMVS.js +0 -2
- package/dist/folder-flags-HTKJCXKB.js +0 -2
- package/dist/gaps-cmd-ROGQWK5X.js +0 -3
- package/dist/gate-QA5J7UZA.js +0 -2
- package/dist/gate-XFFFX5ZF.js +0 -2
- package/dist/hold-passthrough-K5PP26CP.js +0 -2
- package/dist/ingest-S5R736ZV.js +0 -2
- package/dist/ingest-remote-C6AP2Q7E.js +0 -2
- package/dist/install-B26Y2NU4.js +0 -2
- package/dist/lane-7IEAE6AC.js +0 -2
- package/dist/lattice-auth-7EL4ET3P.js +0 -2
- package/dist/login-flow-CHLGQGHK.js +0 -2
- package/dist/open-provider-U26BBVUE.js +0 -2
- package/dist/pdf-convert-LMKOKLXT.js +0 -2
- package/dist/persist-recorded-session-4IRYG5CJ.js +0 -3
- package/dist/phase-seed-2H6OXZXT.js +0 -2
- package/dist/pipeline-U7D25NST.js +0 -2
- package/dist/readmodel-KXCFPL2M.js +0 -2
- package/dist/real-device-run-QODMDUXF.js +0 -2
- package/dist/reconcile-deps-2CTIFXDR.js +0 -2
- package/dist/registry-MZYBLEW2.js +0 -2
- package/dist/remote-entry-DW2J56N4.js +0 -2
- package/dist/revert-37346WLE.js +0 -2
- package/dist/run-JWOHNWA3.js +0 -2
- package/dist/run-QFJ6ZRVD.js +0 -2
- package/dist/run-remote-66QTUQ2M.js +0 -2
- package/dist/run-test-md-7DRWCSQE.js +0 -19
- package/dist/spawner-C7NLLM4F.js +0 -2
- package/dist/store-choice-4J2NN6OQ.js +0 -2
- package/dist/stream-warnings-N4KVVWXV.js +0 -2
- package/dist/sync-cmd-3CHSWWWW.js +0 -2
- package/dist/tcg-generate-IPD5FQUW.js +0 -2
- package/dist/testmd-actions-V7P7BMKE.js +0 -2
- package/dist/token-refresh-LR33BKAB.js +0 -2
- package/dist/verdicts-7GKZEDHV.js +0 -2
- package/dist/with-telemetry-62LW4VFI.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as w,c as L,g as fe,j as ge}from"./chunk-ORNVIEUA.js";import{b as pe}from"./chunk-K3OSK6PB.js";import{d as X}from"./chunk-DBMW3VUN.js";import{a as Q}from"./chunk-7V4BQSSV.js";import{a as ue,b as le}from"./chunk-GGV336P5.js";import{a as de}from"./chunk-4QTH7VYE.js";var De={requestMs:3e4,requests:64,redirects:5,bodyBytes:X.contentBytes},Fe=new Set(["authorization","proxy-authorization","cookie","host"]),He=new Set(["set-cookie","set-cookie2","www-authenticate","proxy-authenticate"]);function he(e){try{let t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"?t.origin:null}catch{return null}}async function Je(e,t,n,r){let i=Number(e.headers.get("content-length"));if(Number.isFinite(i)&&i>t&&(await e.body?.cancel().catch(()=>{}),r(`${n} answered with ${i} bytes; a plugin's source may be at most ${t}`)),e.body===null)return new Uint8Array(0);let s=e.body.getReader(),u=[],c=0;for(;;){let{done:k,value:x}=await s.read();if(k)break;c+=x.byteLength,c>t&&(await s.cancel().catch(()=>{}),r(`${n} answered with more than ${t} bytes; a plugin's source may be at most ${t}`)),u.push(x)}let l=new Uint8Array(c),g=0;for(let k of u)l.set(k,g),g+=k.byteLength;return l}function xe(e){let{plugin:t}=e,n={...De,...e.limits},r=e.fetchImpl??fetch,i=new Set(e.allow.map(h=>he(h)).filter(h=>h!==null)),s=[...i].join(", ")||"no origin",u=0,c=null,l=!1,g=new Set,k=()=>{throw new L({code:"PLUGIN_CONNECTION_REFUSED",message:`the connection for plugin ${t} is closed: its fetch has ended`,plugin:t,hook:"fetch"})},x=(h,o)=>{let d=new L({code:h,message:o,plugin:t,hook:"fetch"});throw c??=d,d},$=h=>x("PLUGIN_CONNECTION_REFUSED",`plugin ${t} ${h}`),R=(h,o)=>{let d=he(h);return d===null&&$(`${o} ${JSON.stringify(h)}, which is not an http or https URL`),i.has(d)||$(`${o} ${h}, which is not an origin it may reach \u2014 it may reach ${s}`),new URL(h)};return{get breach(){return c},close(){l=!0;for(let h of g)h.abort();g.clear()},async request(h){l&&k();let o=h.method??"GET",d=o==="POST"?h.body:void 0;o!=="GET"&&o!=="POST"&&$(`asked for a ${JSON.stringify(o)} request; a plugin's connection makes GET and POST requests only`);let p={};for(let[m,O]of Object.entries(h.headers??{})){let E=m.toLowerCase();Fe.has(E)&&$(`set the ${E} header itself; the host adds its own credentials, and a plugin never sends any`),p[E]=String(O)}let a=R(h.url,"asked the connection for");for(let m=0;;m+=1){u+=1,u>n.requests&&$(`made more than ${n.requests} requests in one fetch`);let O={...p};for(let[C,T]of Object.entries(await e.authorize(a)))O[C.toLowerCase()]=String(T);l&&k();let E=new AbortController;g.add(E);let I=setTimeout(()=>E.abort(),n.requestMs),U;try{U=await r(a,{method:o,headers:O,redirect:"manual",signal:E.signal,...d!==void 0?{body:d}:{}})}catch(C){throw g.delete(E),clearTimeout(I),l&&k(),E.signal.aborted?new Error(`${a.origin} did not answer plugin ${t}'s request within ${n.requestMs/1e3} seconds`):new Error(`plugin ${t}'s request to ${a.origin} failed: ${C instanceof Error?C.message:String(C)}`)}try{let C=U.status>=300&&U.status<400?U.headers.get("location"):null;if(C!==null){await U.body?.cancel().catch(()=>{}),m>=n.redirects&&$(`was redirected more than ${n.redirects} times from ${h.url}`),a=R(new URL(C,a).href,"was redirected to"),(U.status===303||(U.status===301||U.status===302)&&o==="POST")&&(o="GET",d=void 0,delete p["content-type"],delete p["content-length"]);continue}let T=await Je(U,n.bodyBytes,a.href,M=>x("PLUGIN_CONTENT_TOO_LARGE",M)),H={};return U.headers.forEach((M,S)=>{He.has(S.toLowerCase())||(H[S.toLowerCase()]=M)}),{status:U.status,headers:H,body:T}}catch(C){throw l&&!(C instanceof L)&&k(),E.signal.aborted?new Error(`${a.origin} did not finish answering plugin ${t}'s request within ${n.requestMs/1e3} seconds`):C}finally{g.delete(E),clearTimeout(I)}}}}}var ee=()=>ue(le()).controllerBaseUrl,Me={explore:e=>[new URL(e).origin]};async function Xe(e){let t=await e.controller();if(t.basic)return{authorization:de(t.basic.username,t.basic.accessKey)};if(t.token)return{authorization:`Bearer ${t.token}`};throw new Error("no credentials for the controller: run `kane-cli login`, then try again")}var Ge="run `kane-cli login`, then run the command again";function qe(e,t){let n=null;return{get breach(){return t.breach??n},close:()=>t.close(),request:async r=>{if(n!==null)throw n;let i=await t.request(r);return i.status===401&&n===null&&(n=new L({code:"PLUGIN_REFUSED",message:`${new URL(r.url).origin} refused the credential this run holds (${i.status}) when plugin ${e} fetched`,plugin:e,hook:"fetch",remedy:Ge})),i}}}function Ve(e,t={}){let n=t.origins??Me;if(!Object.hasOwn(n,e))return;let r=n[e],i=t.credentials??pe;return qe(e,xe({plugin:e,allow:r((t.controller??ee)()),authorize:()=>Xe(i),...t.fetchImpl?{fetchImpl:t.fetchImpl}:{}}))}var we=e=>Ve(e);import{createHash as ze}from"crypto";var re="exploration-export/1",F="exploration-export/2",We=new Set([re,F]),ye="/exploration/{id}/assurance",W="explore",te=/^[0-9a-f]{8}-[0-9a-f]{4}-[47][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;function $e(e){let t=`${W}://`;if(!e.startsWith(t))return{ok:!1,why:`it does not start with ${t}`};let n=e.slice(t.length),r=n.indexOf("?"),i=r===-1?n:n.slice(0,r);if(!te.test(i))return{ok:!1,why:`${JSON.stringify(i)} is not an exploration id: a lowercase UUID, as kane-cli explore prints it`};if(r===-1)return{ok:!0,value:{exploration:i}};let s={exploration:i};for(let u of n.slice(r+1).split("&")){let c=/^(run|cut)=(.*)$/.exec(u);if(c===null)return{ok:!1,why:`after "?" only run=<run id> and cut=<N>|end may come; found ${JSON.stringify(u)}`};let[,l,g]=c;if(s[l]!==void 0)return{ok:!1,why:`${l} is given twice`};if(l==="run"){if(!te.test(g))return{ok:!1,why:`${JSON.stringify(g)} is not a run id: a lowercase UUID`};s.run=g}else if(g==="end")s.cut="end";else if(/^(0|[1-9]\d{0,8})$/.test(g))s.cut=Number(g);else return{ok:!1,why:`${JSON.stringify(g)} is not a cut: a whole number or end`}}return{ok:!0,value:s}}var me=e=>`explore-${e.exploration}`,Ee=e=>`${W}://${e.exploration}`,Be={junction:"junctions",control:"controls",flow:"flows",finding:"findings"},ne=/^[A-Za-z0-9][A-Za-z0-9._:/#-]{0,127}$/,y=e=>{throw new w(`the exploration export cannot be read: ${e}`,"the explorer answered an export this build does not understand; update kane-cli, or report it to the explorer's team")};function oe(e){if(typeof e!="string"||!We.has(e))throw new w(`exploration export version ${JSON.stringify(e)} is not supported by this build \u2014 update kane-cli`,"update kane-cli, then ingest it again")}var P=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),D=e=>typeof e=="number"&&Number.isSafeInteger(e)&&e>=0,Ke=(e,t)=>e.id<t.id?-1:e.id>t.id?1:0;function z(e,t){let n=Be[e];Array.isArray(t)||y(`${n} is not a list`);let r=new Set;return t.map((i,s)=>{P(i)||y(`${n}[${s}] is not an object`);let u=i;(typeof u.id!="string"||!ne.test(u.id))&&y(`${n}[${s}] has no id the explorer gives a ${e}`);let c=u.id;return r.has(c)&&y(`${n} names ${c} twice`),r.add(c),(u.fp===void 0||u.fp===null)&&y(`${n}[${s}] (${c}) has no fp, which its fingerprint is made of`),{id:c,fp:u.fp,text:P(u.text)?u.text:{},info:P(u.info)?u.info:{}}}).sort(Ke)}var Ye=new Set(["stopped","completed","paused","failed","cancelled"]),ie="x-export-digest",_e=(e,t)=>t===`sha256:${ze("sha256").update(e).digest("hex")}`;function B(e,t){P(e)||y(`${t} has no cursor`);let n=e;oe(n.export_version),(typeof n.run!="string"||n.run==="")&&y(`${t}'s cursor names no run`),D(n.run_version)||y(`${t}'s cursor has no whole run_version`),D(n.deltas)||y(`${t}'s cursor has no whole deltas`);let r={export_version:n.export_version,run:n.run,run_version:n.run_version,deltas:n.deltas};return r.export_version===F&&(n.cut!=="end"&&!D(n.cut)&&y(`${t}'s cursor has no cut (a whole number or end)`),typeof n.provisional!="boolean"&&y(`${t}'s cursor does not say whether it is provisional`),r.cut=n.cut,r.provisional=n.provisional),r}var se=e=>JSON.stringify(e.export_version===F?[e.export_version,e.run,e.run_version,e.deltas,e.cut??"end",e.provisional===!0]:[e.export_version,e.run,e.run_version,e.deltas]);function ke(e){let t;try{t=JSON.parse(e)}catch{return null}if(!Array.isArray(t)||t.length<4)return null;let[n,r,i,s,u,c]=t;return typeof n!="string"||typeof r!="string"||!D(i)||!D(s)?null:{export_version:n,run:r,run_version:i,deltas:s,...t.length>=6&&(u==="end"||D(u))?{cut:u,provisional:c===!0}:{}}}function be(e){let t;try{t=JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(e))}catch{y("it is not JSON")}P(t)||y("it is not a JSON object");let n=t;P(n.cursor)||y("the export has no cursor");let r=n.cursor;return n.cursor={export_version:r.export_version,...r.provisional!==void 0?{provisional:r.provisional}:{}},delete n.run_state,new TextEncoder().encode(JSON.stringify(n))}function Ze(e,t){if(P(e)&&e.run!==void 0)return B(e,t);P(e)||y(`${t} has no cursor`);let n=e;return oe(n.export_version),n.export_version===F&&typeof n.provisional!="boolean"&&y(`${t}'s cursor does not say whether it is provisional`),{export_version:n.export_version,...typeof n.provisional=="boolean"?{provisional:n.provisional}:{}}}function Se(e){return ve(e,B,!0)}function K(e){return ve(e,Ze,!1)}function ve(e,t,n){let r;try{r=JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(e))}catch{y("it is not JSON")}P(r)||y("it is not a JSON object");let i=r;oe(i.export_version),(typeof i.exploration_id!="string"||!te.test(i.exploration_id))&&y("exploration_id is not a lowercase UUID");let s=t(i.cursor,"the export");if(s.export_version!==i.export_version&&y(`its cursor is of ${s.export_version}, the export of ${String(i.export_version)}`),n&&s.provisional!==!0&&(typeof i.run_state!="string"||!Ye.has(i.run_state))){let x=s.run;throw new w(`the export of exploration ${i.exploration_id} is of ${x!==void 0?`run ${x}`:"a run"}, which has not ended (${JSON.stringify(i.run_state??null)}): the export is read once it ends`,"try again after the run ends; the current version is kept")}let u=x=>typeof i[x]=="string"?i[x]:null,c={junctions:z("junction",i.junctions),controls:z("control",i.controls),flows:z("flow",i.flows),findings:z("finding",i.findings)},l=new Set(Object.values(c).flatMap(x=>x.map($=>$.id))),g=i.redirects??{};P(g)||y("redirects is not an object");let k={};for(let[x,$]of Object.entries(g).sort(([R],[h])=>R<h?-1:R>h?1:0))(!ne.test(x)||typeof $!="string"||!ne.test($))&&y(`the redirect from ${JSON.stringify(x)} is not one explorer id to another`),Object.hasOwn(g,$)&&y(`the redirect from ${x} goes to ${$}, which is itself redirected: a redirect names the unit that took the id over`),l.has(x)&&y(`${x} is both a unit and redirected to ${$}`),l.has($)||y(`${x} is redirected to ${$}, which is not a unit of the export`),k[x]=$;return{export_version:i.export_version,exploration_id:i.exploration_id,project_id:u("project_id"),target_url:u("target_url"),cursor:s,run_state:u("run_state"),skipped:D(i.skipped)?i.skipped:0,...c,redirects:k}}import{createHash as Qe}from"crypto";var b={junction:"junction",control:"control",flow:"flow",retiredFlow:"flow.retired",finding:"finding",alias:"merged"},Re=/^[0-9a-f]{64}$/,j={junction:e=>`j:${e}`,control:e=>`c:${Re.test(e)?e.slice(0,16):e}`,flow:e=>`f:${e}`,finding:e=>`fd:${e}`},Oe=e=>Qe("sha256").update(Q(e),"utf8").digest().subarray(0,16).toString("base64url"),G=(e,t)=>Oe({kind:e,fp:t.fp}),et=(e,t)=>Oe({kind:"alias",survivor:e,fingerprint:t}),v=(e,t=200)=>{let n=(typeof e=="string"?e:Q(e??null)).replace(/\s+/g," ").trim();return n.length>t?`${n.slice(0,t-1)}\u2026`:n},N=e=>JSON.stringify(v(e??"")),Y=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),f=(e,t)=>Y(e)?e[t]:void 0,_=e=>typeof e=="string"&&e!==""?e:void 0,ae=e=>typeof e=="string"&&Re.test(e)?e.slice(0,12):v(e),tt=" (in flight at this cut: not citable yet)";function Z(e){let t=o=>e.cursor.provisional===!0&&o.info.settled===!1,n=o=>t(o)?tt:"",r=[],i=[],s=new Map,u=(o,d,p,a,m,O)=>{let E=s.get(o);if(E!==void 0)throw new w(`two units of exploration ${e.exploration_id} have the id ${o} (${E} and ${d}), so neither can be told apart`,"report it to kane's team: the unit id needs more of the explorer's id");s.set(o,d),i.push({id:o,ref:o,kind:p,lines:[a,r.length],fingerprint:m,...O!==void 0?{label:v(O,80)}:{}})},c=new Map;for(let o of["junction","control","flow","finding"])for(let d of e[`${o}s`])c.set(d.id,o);let l=o=>{if(typeof o!="string")return v(o);let d=c.get(e.redirects[o]??o);return d!==void 0?j[d](o):o};r.push(`Exploration ${e.exploration_id}${e.target_url!==null?` of ${v(e.target_url)}`:""}`),r.push(`Project: ${e.project_id??"none"}`),e.skipped>0&&r.push(`Left out by the explorer: ${e.skipped} item(s) whose ids cannot be cited`),r.push("Units: j: a screen, c: a control on it, f: a flow, fd: a finding. Cite the unit's id.");let g=new Map,k=new Set(e.junctions.map(o=>o.id)),x=new Map,$=[];for(let o of e.controls){let d=_(o.info.junction);d!==void 0&&k.has(d)?x.set(d,[...x.get(d)??[],o]):$.push(o)}let R=o=>{let{text:d,fp:p,info:a}=o,m=[_(d.container)?` in ${N(d.container)}`:"",_(f(p,"href_pattern"))?` to ${v(f(p,"href_pattern"))}`:"",a.disabled===!0?" disabled":"",f(p,"gated")===!0?" gated":""].join("");r.push(`${j.control(o.id)} ${v(_(d.role)??f(p,"role")??"control")} ${N(d.name??d.label)}${m}${n(o)}`);let O=G("control",o);g.set(o.id,O),t(o)||u(j.control(o.id),o.id,b.control,r.length,O)};r.push("","## Screens");for(let o of e.junctions){let d=j.junction(o.id),{text:p,fp:a,info:m}=o;r.push("");let O=r.length+1;r.push(`${d} screen ${N(p.name??p.heading??p.url_pattern??o.id)} at ${v(p.url_pattern??f(a,"url_pattern")??"?")}${n(o)}`),_(p.heading)&&p.heading!==p.name&&r.push(` heading: ${N(p.heading)}`);let E=f(a,"signatures");r.push(` kind ${v(f(a,"kind")??"?")}, ${Array.isArray(E)?E.length:0} version(s), current ${ae(m.current_signature??"none")}`);let I=G("junction",o);g.set(o.id,I),t(o)||u(d,o.id,b.junction,O,I,_(p.name));for(let U of x.get(o.id)??[])R(U)}if($.length>0){r.push("","## Controls on no screen of this export");for(let o of $)R(o)}r.push("","## Flows");for(let o of e.flows){let d=j.flow(o.id),{text:p,fp:a,info:m}=o;r.push("");let O=r.length+1,E=f(a,"exit")!==null&&f(a,"exit")!==void 0?l(f(a,"exit")):"(no exit)";r.push(`${d} flow ${N(p.name??o.id)}: ${l(f(a,"entry"))} to ${E}, ${v(m.status??"?")}${n(o)}`),r.push(` steps key: ${ae(f(a,"steps_key")??"none")}`);let I=Array.isArray(p.steps)?p.steps:[];for(let S of I)r.push(` step: ${v(f(S,"kind")??"step")} ${N(f(S,"label")??"")}`);let U=Array.isArray(p.assertions)?p.assertions:[];for(let S of U)r.push(` asserts ${ae(f(S,"id"))}: ${N(f(S,"text")??"")}`);let C=f(a,"assertions");Array.isArray(C)&&C.length!==U.length&&r.push(` assertions: ${C.length}`);let T=f(a,"stateful");(Y(T)||f(a,"state")===!0||_(f(a,"in_state")))&&r.push(` stateful${Y(T)?` ${v([T.type,T.role,T.kind].filter(S=>typeof S=="string").join(" "))}`:""}${f(a,"state")===!0?", sets state":""}${_(f(a,"in_state"))?`, needs ${N(f(a,"in_state"))}`:""}`),_(f(a,"after_flow"))&&r.push(` after: ${l(f(a,"after_flow"))}`);let H=_(f(a,"retired"));H!==void 0&&r.push(` retired: ${v(H)}${_(f(a,"superseded_by"))?`, superseded by ${l(f(a,"superseded_by"))}`:""}`);let M=Array.isArray(m.changes)?m.changes.filter(Y).slice(-3).reverse():[];for(let S of M){let Le=_(S.from_exit)||_(S.to_exit)?`: exit ${_(S.from_exit)?l(S.from_exit):"none"} to ${_(S.to_exit)?l(S.to_exit):"none"}`:"";r.push(` changed in run ${v(S.run_id??"?")}: ${v(S.kind??"a change")}${Le}`)}t(o)||u(d,o.id,H!==void 0?b.retiredFlow:b.flow,O,G("flow",o),_(p.name))}r.push("","## Findings");for(let o of e.findings){let d=j.finding(o.id),{text:p,fp:a,info:m}=o;r.push("");let O=r.length+1,E=(Array.isArray(m.junctions)?m.junctions:[]).map(l).join(", "),I=[_(f(a,"candidate"))?` at ${l(f(a,"candidate"))}`:"",E!==""?` on ${E}`:""].join("");r.push(`${d} finding ${v(f(a,"kind")??"?")}${_(f(a,"category"))?` (${v(f(a,"category"))})`:""}${I}${_(m.severity)?`, ${v(m.severity)}`:""}${n(o)}`),_(p.title)&&r.push(` ${N(p.title)}`),_(p.description)&&r.push(` ${N(p.description)}`),f(a,"blocked_by")!==null&&f(a,"blocked_by")!==void 0&&r.push(` blocked by: ${v(f(a,"blocked_by"))}`),t(o)||u(d,o.id,b.finding,O,G("finding",o),_(p.title))}let h=Object.entries(e.redirects);if(h.length>0){r.push("","## Merged");for(let[o,d]of h){let p=c.get(d),a=e[`${p}s`].find(m=>m.id===d);r.push(`${j[p](o)} merged into ${j[p](d)}${n(a)}`),t(a)||u(j[p](o),o,b.alias,r.length,et(d,g.get(d)??G(p,e[`${p}s`].find(m=>m.id===d))))}}return{text:r.join(`
|
|
2
|
+
import{b as w,c as L,g as fe,j as ge}from"./chunk-ZDCXWEQG.js";import{b as pe}from"./chunk-W2HRX3DR.js";import{d as X}from"./chunk-DBMW3VUN.js";import{a as Q}from"./chunk-7V4BQSSV.js";import{a as ue,b as le}from"./chunk-FI2DVNRT.js";import{a as de}from"./chunk-4QTH7VYE.js";var De={requestMs:3e4,requests:64,redirects:5,bodyBytes:X.contentBytes},Fe=new Set(["authorization","proxy-authorization","cookie","host"]),He=new Set(["set-cookie","set-cookie2","www-authenticate","proxy-authenticate"]);function he(e){try{let t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"?t.origin:null}catch{return null}}async function Je(e,t,n,r){let i=Number(e.headers.get("content-length"));if(Number.isFinite(i)&&i>t&&(await e.body?.cancel().catch(()=>{}),r(`${n} answered with ${i} bytes; a plugin's source may be at most ${t}`)),e.body===null)return new Uint8Array(0);let s=e.body.getReader(),u=[],c=0;for(;;){let{done:k,value:x}=await s.read();if(k)break;c+=x.byteLength,c>t&&(await s.cancel().catch(()=>{}),r(`${n} answered with more than ${t} bytes; a plugin's source may be at most ${t}`)),u.push(x)}let l=new Uint8Array(c),g=0;for(let k of u)l.set(k,g),g+=k.byteLength;return l}function xe(e){let{plugin:t}=e,n={...De,...e.limits},r=e.fetchImpl??fetch,i=new Set(e.allow.map(h=>he(h)).filter(h=>h!==null)),s=[...i].join(", ")||"no origin",u=0,c=null,l=!1,g=new Set,k=()=>{throw new L({code:"PLUGIN_CONNECTION_REFUSED",message:`the connection for plugin ${t} is closed: its fetch has ended`,plugin:t,hook:"fetch"})},x=(h,o)=>{let d=new L({code:h,message:o,plugin:t,hook:"fetch"});throw c??=d,d},$=h=>x("PLUGIN_CONNECTION_REFUSED",`plugin ${t} ${h}`),R=(h,o)=>{let d=he(h);return d===null&&$(`${o} ${JSON.stringify(h)}, which is not an http or https URL`),i.has(d)||$(`${o} ${h}, which is not an origin it may reach \u2014 it may reach ${s}`),new URL(h)};return{get breach(){return c},close(){l=!0;for(let h of g)h.abort();g.clear()},async request(h){l&&k();let o=h.method??"GET",d=o==="POST"?h.body:void 0;o!=="GET"&&o!=="POST"&&$(`asked for a ${JSON.stringify(o)} request; a plugin's connection makes GET and POST requests only`);let p={};for(let[m,O]of Object.entries(h.headers??{})){let E=m.toLowerCase();Fe.has(E)&&$(`set the ${E} header itself; the host adds its own credentials, and a plugin never sends any`),p[E]=String(O)}let a=R(h.url,"asked the connection for");for(let m=0;;m+=1){u+=1,u>n.requests&&$(`made more than ${n.requests} requests in one fetch`);let O={...p};for(let[C,T]of Object.entries(await e.authorize(a)))O[C.toLowerCase()]=String(T);l&&k();let E=new AbortController;g.add(E);let I=setTimeout(()=>E.abort(),n.requestMs),U;try{U=await r(a,{method:o,headers:O,redirect:"manual",signal:E.signal,...d!==void 0?{body:d}:{}})}catch(C){throw g.delete(E),clearTimeout(I),l&&k(),E.signal.aborted?new Error(`${a.origin} did not answer plugin ${t}'s request within ${n.requestMs/1e3} seconds`):new Error(`plugin ${t}'s request to ${a.origin} failed: ${C instanceof Error?C.message:String(C)}`)}try{let C=U.status>=300&&U.status<400?U.headers.get("location"):null;if(C!==null){await U.body?.cancel().catch(()=>{}),m>=n.redirects&&$(`was redirected more than ${n.redirects} times from ${h.url}`),a=R(new URL(C,a).href,"was redirected to"),(U.status===303||(U.status===301||U.status===302)&&o==="POST")&&(o="GET",d=void 0,delete p["content-type"],delete p["content-length"]);continue}let T=await Je(U,n.bodyBytes,a.href,M=>x("PLUGIN_CONTENT_TOO_LARGE",M)),H={};return U.headers.forEach((M,S)=>{He.has(S.toLowerCase())||(H[S.toLowerCase()]=M)}),{status:U.status,headers:H,body:T}}catch(C){throw l&&!(C instanceof L)&&k(),E.signal.aborted?new Error(`${a.origin} did not finish answering plugin ${t}'s request within ${n.requestMs/1e3} seconds`):C}finally{g.delete(E),clearTimeout(I)}}}}}var ee=()=>ue(le()).controllerBaseUrl,Me={explore:e=>[new URL(e).origin]};async function Xe(e){let t=await e.controller();if(t.basic)return{authorization:de(t.basic.username,t.basic.accessKey)};if(t.token)return{authorization:`Bearer ${t.token}`};throw new Error("no credentials for the controller: run `kane-cli login`, then try again")}var Ge="run `kane-cli login`, then run the command again";function qe(e,t){let n=null;return{get breach(){return t.breach??n},close:()=>t.close(),request:async r=>{if(n!==null)throw n;let i=await t.request(r);return i.status===401&&n===null&&(n=new L({code:"PLUGIN_REFUSED",message:`${new URL(r.url).origin} refused the credential this run holds (${i.status}) when plugin ${e} fetched`,plugin:e,hook:"fetch",remedy:Ge})),i}}}function Ve(e,t={}){let n=t.origins??Me;if(!Object.hasOwn(n,e))return;let r=n[e],i=t.credentials??pe;return qe(e,xe({plugin:e,allow:r((t.controller??ee)()),authorize:()=>Xe(i),...t.fetchImpl?{fetchImpl:t.fetchImpl}:{}}))}var we=e=>Ve(e);import{createHash as ze}from"crypto";var re="exploration-export/1",F="exploration-export/2",We=new Set([re,F]),ye="/exploration/{id}/assurance",W="explore",te=/^[0-9a-f]{8}-[0-9a-f]{4}-[47][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;function $e(e){let t=`${W}://`;if(!e.startsWith(t))return{ok:!1,why:`it does not start with ${t}`};let n=e.slice(t.length),r=n.indexOf("?"),i=r===-1?n:n.slice(0,r);if(!te.test(i))return{ok:!1,why:`${JSON.stringify(i)} is not an exploration id: a lowercase UUID, as kane-cli explore prints it`};if(r===-1)return{ok:!0,value:{exploration:i}};let s={exploration:i};for(let u of n.slice(r+1).split("&")){let c=/^(run|cut)=(.*)$/.exec(u);if(c===null)return{ok:!1,why:`after "?" only run=<run id> and cut=<N>|end may come; found ${JSON.stringify(u)}`};let[,l,g]=c;if(s[l]!==void 0)return{ok:!1,why:`${l} is given twice`};if(l==="run"){if(!te.test(g))return{ok:!1,why:`${JSON.stringify(g)} is not a run id: a lowercase UUID`};s.run=g}else if(g==="end")s.cut="end";else if(/^(0|[1-9]\d{0,8})$/.test(g))s.cut=Number(g);else return{ok:!1,why:`${JSON.stringify(g)} is not a cut: a whole number or end`}}return{ok:!0,value:s}}var me=e=>`explore-${e.exploration}`,Ee=e=>`${W}://${e.exploration}`,Be={junction:"junctions",control:"controls",flow:"flows",finding:"findings"},ne=/^[A-Za-z0-9][A-Za-z0-9._:/#-]{0,127}$/,y=e=>{throw new w(`the exploration export cannot be read: ${e}`,"the explorer answered an export this build does not understand; update kane-cli, or report it to the explorer's team")};function oe(e){if(typeof e!="string"||!We.has(e))throw new w(`exploration export version ${JSON.stringify(e)} is not supported by this build \u2014 update kane-cli`,"update kane-cli, then ingest it again")}var P=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),D=e=>typeof e=="number"&&Number.isSafeInteger(e)&&e>=0,Ke=(e,t)=>e.id<t.id?-1:e.id>t.id?1:0;function z(e,t){let n=Be[e];Array.isArray(t)||y(`${n} is not a list`);let r=new Set;return t.map((i,s)=>{P(i)||y(`${n}[${s}] is not an object`);let u=i;(typeof u.id!="string"||!ne.test(u.id))&&y(`${n}[${s}] has no id the explorer gives a ${e}`);let c=u.id;return r.has(c)&&y(`${n} names ${c} twice`),r.add(c),(u.fp===void 0||u.fp===null)&&y(`${n}[${s}] (${c}) has no fp, which its fingerprint is made of`),{id:c,fp:u.fp,text:P(u.text)?u.text:{},info:P(u.info)?u.info:{}}}).sort(Ke)}var Ye=new Set(["stopped","completed","paused","failed","cancelled"]),ie="x-export-digest",_e=(e,t)=>t===`sha256:${ze("sha256").update(e).digest("hex")}`;function B(e,t){P(e)||y(`${t} has no cursor`);let n=e;oe(n.export_version),(typeof n.run!="string"||n.run==="")&&y(`${t}'s cursor names no run`),D(n.run_version)||y(`${t}'s cursor has no whole run_version`),D(n.deltas)||y(`${t}'s cursor has no whole deltas`);let r={export_version:n.export_version,run:n.run,run_version:n.run_version,deltas:n.deltas};return r.export_version===F&&(n.cut!=="end"&&!D(n.cut)&&y(`${t}'s cursor has no cut (a whole number or end)`),typeof n.provisional!="boolean"&&y(`${t}'s cursor does not say whether it is provisional`),r.cut=n.cut,r.provisional=n.provisional),r}var se=e=>JSON.stringify(e.export_version===F?[e.export_version,e.run,e.run_version,e.deltas,e.cut??"end",e.provisional===!0]:[e.export_version,e.run,e.run_version,e.deltas]);function ke(e){let t;try{t=JSON.parse(e)}catch{return null}if(!Array.isArray(t)||t.length<4)return null;let[n,r,i,s,u,c]=t;return typeof n!="string"||typeof r!="string"||!D(i)||!D(s)?null:{export_version:n,run:r,run_version:i,deltas:s,...t.length>=6&&(u==="end"||D(u))?{cut:u,provisional:c===!0}:{}}}function be(e){let t;try{t=JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(e))}catch{y("it is not JSON")}P(t)||y("it is not a JSON object");let n=t;P(n.cursor)||y("the export has no cursor");let r=n.cursor;return n.cursor={export_version:r.export_version,...r.provisional!==void 0?{provisional:r.provisional}:{}},delete n.run_state,new TextEncoder().encode(JSON.stringify(n))}function Ze(e,t){if(P(e)&&e.run!==void 0)return B(e,t);P(e)||y(`${t} has no cursor`);let n=e;return oe(n.export_version),n.export_version===F&&typeof n.provisional!="boolean"&&y(`${t}'s cursor does not say whether it is provisional`),{export_version:n.export_version,...typeof n.provisional=="boolean"?{provisional:n.provisional}:{}}}function Se(e){return ve(e,B,!0)}function K(e){return ve(e,Ze,!1)}function ve(e,t,n){let r;try{r=JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(e))}catch{y("it is not JSON")}P(r)||y("it is not a JSON object");let i=r;oe(i.export_version),(typeof i.exploration_id!="string"||!te.test(i.exploration_id))&&y("exploration_id is not a lowercase UUID");let s=t(i.cursor,"the export");if(s.export_version!==i.export_version&&y(`its cursor is of ${s.export_version}, the export of ${String(i.export_version)}`),n&&s.provisional!==!0&&(typeof i.run_state!="string"||!Ye.has(i.run_state))){let x=s.run;throw new w(`the export of exploration ${i.exploration_id} is of ${x!==void 0?`run ${x}`:"a run"}, which has not ended (${JSON.stringify(i.run_state??null)}): the export is read once it ends`,"try again after the run ends; the current version is kept")}let u=x=>typeof i[x]=="string"?i[x]:null,c={junctions:z("junction",i.junctions),controls:z("control",i.controls),flows:z("flow",i.flows),findings:z("finding",i.findings)},l=new Set(Object.values(c).flatMap(x=>x.map($=>$.id))),g=i.redirects??{};P(g)||y("redirects is not an object");let k={};for(let[x,$]of Object.entries(g).sort(([R],[h])=>R<h?-1:R>h?1:0))(!ne.test(x)||typeof $!="string"||!ne.test($))&&y(`the redirect from ${JSON.stringify(x)} is not one explorer id to another`),Object.hasOwn(g,$)&&y(`the redirect from ${x} goes to ${$}, which is itself redirected: a redirect names the unit that took the id over`),l.has(x)&&y(`${x} is both a unit and redirected to ${$}`),l.has($)||y(`${x} is redirected to ${$}, which is not a unit of the export`),k[x]=$;return{export_version:i.export_version,exploration_id:i.exploration_id,project_id:u("project_id"),target_url:u("target_url"),cursor:s,run_state:u("run_state"),skipped:D(i.skipped)?i.skipped:0,...c,redirects:k}}import{createHash as Qe}from"crypto";var b={junction:"junction",control:"control",flow:"flow",retiredFlow:"flow.retired",finding:"finding",alias:"merged"},Re=/^[0-9a-f]{64}$/,j={junction:e=>`j:${e}`,control:e=>`c:${Re.test(e)?e.slice(0,16):e}`,flow:e=>`f:${e}`,finding:e=>`fd:${e}`},Oe=e=>Qe("sha256").update(Q(e),"utf8").digest().subarray(0,16).toString("base64url"),G=(e,t)=>Oe({kind:e,fp:t.fp}),et=(e,t)=>Oe({kind:"alias",survivor:e,fingerprint:t}),v=(e,t=200)=>{let n=(typeof e=="string"?e:Q(e??null)).replace(/\s+/g," ").trim();return n.length>t?`${n.slice(0,t-1)}\u2026`:n},N=e=>JSON.stringify(v(e??"")),Y=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),f=(e,t)=>Y(e)?e[t]:void 0,_=e=>typeof e=="string"&&e!==""?e:void 0,ae=e=>typeof e=="string"&&Re.test(e)?e.slice(0,12):v(e),tt=" (in flight at this cut: not citable yet)";function Z(e){let t=o=>e.cursor.provisional===!0&&o.info.settled===!1,n=o=>t(o)?tt:"",r=[],i=[],s=new Map,u=(o,d,p,a,m,O)=>{let E=s.get(o);if(E!==void 0)throw new w(`two units of exploration ${e.exploration_id} have the id ${o} (${E} and ${d}), so neither can be told apart`,"report it to kane's team: the unit id needs more of the explorer's id");s.set(o,d),i.push({id:o,ref:o,kind:p,lines:[a,r.length],fingerprint:m,...O!==void 0?{label:v(O,80)}:{}})},c=new Map;for(let o of["junction","control","flow","finding"])for(let d of e[`${o}s`])c.set(d.id,o);let l=o=>{if(typeof o!="string")return v(o);let d=c.get(e.redirects[o]??o);return d!==void 0?j[d](o):o};r.push(`Exploration ${e.exploration_id}${e.target_url!==null?` of ${v(e.target_url)}`:""}`),r.push(`Project: ${e.project_id??"none"}`),e.skipped>0&&r.push(`Left out by the explorer: ${e.skipped} item(s) whose ids cannot be cited`),r.push("Units: j: a screen, c: a control on it, f: a flow, fd: a finding. Cite the unit's id.");let g=new Map,k=new Set(e.junctions.map(o=>o.id)),x=new Map,$=[];for(let o of e.controls){let d=_(o.info.junction);d!==void 0&&k.has(d)?x.set(d,[...x.get(d)??[],o]):$.push(o)}let R=o=>{let{text:d,fp:p,info:a}=o,m=[_(d.container)?` in ${N(d.container)}`:"",_(f(p,"href_pattern"))?` to ${v(f(p,"href_pattern"))}`:"",a.disabled===!0?" disabled":"",f(p,"gated")===!0?" gated":""].join("");r.push(`${j.control(o.id)} ${v(_(d.role)??f(p,"role")??"control")} ${N(d.name??d.label)}${m}${n(o)}`);let O=G("control",o);g.set(o.id,O),t(o)||u(j.control(o.id),o.id,b.control,r.length,O)};r.push("","## Screens");for(let o of e.junctions){let d=j.junction(o.id),{text:p,fp:a,info:m}=o;r.push("");let O=r.length+1;r.push(`${d} screen ${N(p.name??p.heading??p.url_pattern??o.id)} at ${v(p.url_pattern??f(a,"url_pattern")??"?")}${n(o)}`),_(p.heading)&&p.heading!==p.name&&r.push(` heading: ${N(p.heading)}`);let E=f(a,"signatures");r.push(` kind ${v(f(a,"kind")??"?")}, ${Array.isArray(E)?E.length:0} version(s), current ${ae(m.current_signature??"none")}`);let I=G("junction",o);g.set(o.id,I),t(o)||u(d,o.id,b.junction,O,I,_(p.name));for(let U of x.get(o.id)??[])R(U)}if($.length>0){r.push("","## Controls on no screen of this export");for(let o of $)R(o)}r.push("","## Flows");for(let o of e.flows){let d=j.flow(o.id),{text:p,fp:a,info:m}=o;r.push("");let O=r.length+1,E=f(a,"exit")!==null&&f(a,"exit")!==void 0?l(f(a,"exit")):"(no exit)";r.push(`${d} flow ${N(p.name??o.id)}: ${l(f(a,"entry"))} to ${E}, ${v(m.status??"?")}${n(o)}`),r.push(` steps key: ${ae(f(a,"steps_key")??"none")}`);let I=Array.isArray(p.steps)?p.steps:[];for(let S of I)r.push(` step: ${v(f(S,"kind")??"step")} ${N(f(S,"label")??"")}`);let U=Array.isArray(p.assertions)?p.assertions:[];for(let S of U)r.push(` asserts ${ae(f(S,"id"))}: ${N(f(S,"text")??"")}`);let C=f(a,"assertions");Array.isArray(C)&&C.length!==U.length&&r.push(` assertions: ${C.length}`);let T=f(a,"stateful");(Y(T)||f(a,"state")===!0||_(f(a,"in_state")))&&r.push(` stateful${Y(T)?` ${v([T.type,T.role,T.kind].filter(S=>typeof S=="string").join(" "))}`:""}${f(a,"state")===!0?", sets state":""}${_(f(a,"in_state"))?`, needs ${N(f(a,"in_state"))}`:""}`),_(f(a,"after_flow"))&&r.push(` after: ${l(f(a,"after_flow"))}`);let H=_(f(a,"retired"));H!==void 0&&r.push(` retired: ${v(H)}${_(f(a,"superseded_by"))?`, superseded by ${l(f(a,"superseded_by"))}`:""}`);let M=Array.isArray(m.changes)?m.changes.filter(Y).slice(-3).reverse():[];for(let S of M){let Le=_(S.from_exit)||_(S.to_exit)?`: exit ${_(S.from_exit)?l(S.from_exit):"none"} to ${_(S.to_exit)?l(S.to_exit):"none"}`:"";r.push(` changed in run ${v(S.run_id??"?")}: ${v(S.kind??"a change")}${Le}`)}t(o)||u(d,o.id,H!==void 0?b.retiredFlow:b.flow,O,G("flow",o),_(p.name))}r.push("","## Findings");for(let o of e.findings){let d=j.finding(o.id),{text:p,fp:a,info:m}=o;r.push("");let O=r.length+1,E=(Array.isArray(m.junctions)?m.junctions:[]).map(l).join(", "),I=[_(f(a,"candidate"))?` at ${l(f(a,"candidate"))}`:"",E!==""?` on ${E}`:""].join("");r.push(`${d} finding ${v(f(a,"kind")??"?")}${_(f(a,"category"))?` (${v(f(a,"category"))})`:""}${I}${_(m.severity)?`, ${v(m.severity)}`:""}${n(o)}`),_(p.title)&&r.push(` ${N(p.title)}`),_(p.description)&&r.push(` ${N(p.description)}`),f(a,"blocked_by")!==null&&f(a,"blocked_by")!==void 0&&r.push(` blocked by: ${v(f(a,"blocked_by"))}`),t(o)||u(d,o.id,b.finding,O,G("finding",o),_(p.title))}let h=Object.entries(e.redirects);if(h.length>0){r.push("","## Merged");for(let[o,d]of h){let p=c.get(d),a=e[`${p}s`].find(m=>m.id===d);r.push(`${j[p](o)} merged into ${j[p](d)}${n(a)}`),t(a)||u(j[p](o),o,b.alias,r.length,et(d,g.get(d)??G(p,e[`${p}s`].find(m=>m.id===d))))}}return{text:r.join(`
|
|
3
3
|
`)+`
|
|
4
4
|
`,units:i}}var nt="explore",rt="exploration-export/1";function Ue(e,t,n){let r=ye.replace("{id}",t.exploration);return`${e.replace(/\/+$/,"")}${r}/${n}?cut=${t.cut??"end"}${t.run!==void 0?`&run=${t.run}`:""}`}function ot(e,t){let n=e.headers[ie];if(n===void 0)throw new w(`the export of exploration ${t.exploration} came with no digest (the ${ie} header)`,V);if(!_e(e.body,n))throw new w(`the export of exploration ${t.exploration} is not the bytes its digest names: it was changed on the way, or not served whole`,V);let r=Se(e.body);if(r.exploration_id!==t.exploration)throw new w(`the explorer answered the export of exploration ${r.exploration_id} when asked for ${t.exploration}`,"report it to the explorer's team");if(t.run!==void 0&&r.cursor.run!==t.run)throw new w(`the explorer answered the export as of run ${r.cursor.run} when asked for run ${t.run}`,"report it to the explorer's team");if(r.export_version!==F)throw new w(`the explorer answered ${r.export_version} when asked for a cut (export/2)`,"report it to the explorer's team");if((r.cursor.cut??"end")!==(t.cut??"end"))throw new w(`the explorer answered ${r.cursor.cut==="end"?"the end":`cut ${String(r.cursor.cut)}`} when asked for ${ce(t)}`,"report it to the explorer's team");return Z(r),r}var ce=e=>e.cut===void 0||e.cut==="end"?e.run!==void 0?`the end of run ${e.run}`:"its latest ended run":`cut ${e.cut}${e.run!==void 0?` of run ${e.run}`:""}`,Ce=e=>{let t=$e(e);if(!t.ok)throw new w(`${e} is not an exploration reference: ${t.why}`,"name it as explore://<exploration id>, with ?run=<run id> and/or cut=<N>|end to read one cut");return t.value},V="try again later; the current version is kept";function it(e){try{let t=JSON.parse(new TextDecoder().decode(e));return typeof t=="object"&&t!==null?t:{}}catch{return{}}}function Pe(e,t,n,r){let i=`exploration ${n.exploration}${n.run!==void 0?` at run ${n.run}`:""}`,s=it(t);throw e===409&&s.code==="CUT_SUPERSEDED"?new w(`${ce(n)} of exploration ${n.exploration} is superseded (CUT_SUPERSEDED): a later run's cuts are served now`,"nothing to do: a later cut covers it"):e===404&&s.code==="CUT_NOT_FOUND"?new w(`${ce(n)} of exploration ${n.exploration} was never taken (CUT_NOT_FOUND)`,"name a cut the controller took (a checkpoint or a sync), or cut=end"):e===409&&s.code==="RUN_ACTIVE"?new w(`a run of exploration ${n.exploration} is in progress${typeof s.active_run=="string"?` (run ${s.active_run})`:""}: the export is read once it ends`,"try again after the run ends; the current version is kept"):e===409&&s.code==="EXPLORATION_OUTDATED"?new w(`${i} can no longer be read (OUTDATED): re-explore`,"explore the site again, then ingest the new exploration"):e===404&&s.code==="NO_ENDED_RUN"?new w(`exploration ${n.exploration} has no ended run yet: the export is read once its first run ends`,"try again after the first run ends"):e===404?new w(`${i} was not found (404): the explorer has no such exploration${n.run!==void 0?" or run":""}, or it is not one of your organisation's`,"check the id, and that kane-cli is signed in to the controller the exploration ran on"):e===401||e===403?new w(`the controller refused kane-cli's credentials (${e}) for ${i}`,"sign in again with kane-cli login, then try again"):e===400?new w(`the explorer refused the request for the ${r} of ${i} (400)${typeof s.error=="string"?`: ${s.error.slice(0,200)}`:""}`,"report it to kane's team"):new w(`the explorer answered ${e} for the ${r} of ${i}`,V)}async function Ne(e,t,n){try{return await e.connection.request({url:t,headers:{accept:"application/json"}})}catch(r){throw r instanceof L?r:new w(`exploration ${n.exploration} could not be read: ${r instanceof Error?r.message:String(r)}`,V)}}function Te(e){return{manifest:{contract:1,id:nt,version:"0.1.0",rules:rt,capabilities:["remote","explain","context","coverage","cites-deep"],claims:{schemes:[W]}},claim(t){if(t.isFile)return null;let n=Ce(t.ref),r=Ee(n);return{sourceId:me(n),label:`Exploration ${n.exploration}`,...r!==t.ref?{recorded:r}:{}}},async fetch(t){let n=Ce(t.ref);if(t.cursor!==null){let s=await Ne(t,Ue(e.controller,n,"head"),n);s.status!==200&&Pe(s.status,s.body,n,"head");let u;try{u=JSON.parse(new TextDecoder().decode(s.body))}catch{throw new w(`the head of exploration ${n.exploration} is not JSON`,V)}let c=B(u?.cursor,"the head");if(n.run!==void 0&&c.run!==n.run)throw new w(`the explorer answered the head as of run ${c.run} when asked for run ${n.run}`,"report it to the explorer's team");if(se(c)===t.cursor)return{kind:"unchanged"};let l=ke(t.cursor);if(l!==null&&l.export_version===re&&c.export_version===F&&l.run_version===c.run_version&&l.deltas===c.deltas)return{kind:"unchanged"}}let r=await Ne(t,Ue(e.controller,n,"export"),n);r.status!==200&&Pe(r.status,r.body,n,"export");let i=ot(r,n);return{kind:"content",bytes:be(r.body),cursor:se(i.cursor)}},render(t){return{text:Z(K(t.bytes)).text}},index(t){return Z(K(t.bytes)).units},explain:at,context:ct,coverage:ut}}var Ie=e=>e.replace(/\n$/,"").split(`
|
|
5
5
|
`).slice(1).map(t=>t.trim()),A=e=>e.split(`
|
|
@@ -1,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{z as o}from"./chunk-
|
|
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{z as o}from"./chunk-FAMQ4DHU.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,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as Ee,b as te}from"./chunk-GFLB2SHW.js";import{a as ee}from"./chunk-2TVPA3LL.js";import{c as G}from"./chunk-22PIMG52.js";import{a as z}from"./chunk-RQKMSNEU.js";import{a as v,b as be,d as B,e as Te}from"./chunk-I2MC6VVX.js";import{a as M}from"./chunk-QXQ7KVEN.js";import{a as Se}from"./chunk-JFBEHCJN.js";import{b as we,c as ye,d as Re,e as Z,f as $e}from"./chunk-2L3A5NKZ.js";import{na as ve,oa as P}from"./chunk-Z777GGHB.js";import{g as fe}from"./chunk-UJLULWSR.js";import{basename as wt,relative as ce}from"path";function Vt(e){return e.scope?.state==="finalized"?"saved":e.scope?.state==="discarded"?"discarded":e.ended==="complete"?"ready_to_save":e.ended==="failed"||e.status==="failed"?"failed":e.status==="paused"||e.status==="needs_attention"?"paused":"running"}var ne=["useCases","criteria","scenarios","tests","openQuestions","sources","styleNotes"],H=new Set(["sources","styleNotes"]);function xe(e){return ne.reduce((t,n)=>t+(H.has(n)?0:e[n]??0),0)}var nt=new Set(["NO_CASE","CASE_BROKEN","TEST_FILE_STALE","CASE_ARCHIVED"]),U=e=>typeof e=="string"?e:null;function st(e){let t=e.extra;switch(e.code){case"CASE_BROKEN":return{code:"CASE_BROKEN",session:U(t.session),caseId:U(t.caseId)??"",reason:t.reason==="moved"?"moved":"deleted"};case"CASE_ARCHIVED":return{code:"CASE_ARCHIVED",caseId:U(t.caseId)??"",internalId:U(t.internalId)??""};default:return{code:e.code,session:U(t.session),useCase:U(t.useCase)}}}function Jt(e){return(Array.isArray(e.nodes)?e.nodes:[]).filter(n=>typeof n.cid=="string"&&typeof n.label=="string").map(n=>({cid:n.cid,label:n.label,content:typeof n.content=="object"&&n.content!==null?n.content:{}}))}function qt(e){return(Array.isArray(e.names)?e.names:[]).filter(n=>typeof n.cid=="string"&&typeof n.slug=="string").map(n=>({cid:n.cid,slug:n.slug}))}function Kt(e){return(Array.isArray(e.supersessions)?e.supersessions:[]).filter(n=>n.kind==="node"&&typeof n.old=="string").map(n=>({old:n.old,new:typeof n.new=="string"?n.new:null}))}function Yt(e){let{request:t,exchange:n}=B(e),o=(s,r)=>`/v1/projects/${encodeURIComponent(s)}/uploads/${r}`,d=s=>`/v1/sessions/${encodeURIComponent(s)}`,a=async(s,r=null)=>{let l=[],g=r;do{let c=await t("GET",`${s}${g===null?"":`&after=${encodeURIComponent(g)}`}`);l.push(...c.items),g=c.next}while(g!==null);return l},i=async(s,r)=>{let l=await t("GET",`/v1/projects/${encodeURIComponent(s)}/sessions/${encodeURIComponent(r)}`),{proposes:g,heldChanges:c,changes:p,approves:u,archives:m,removes:w,chatTurns:h,uncounted:f}=l.drafts;return{proposes:g,heldChanges:c??0,changes:p??{},approves:u??{},archives:m??{},removes:w??{},chatTurns:h??0,uncounted:typeof f=="number"?f:null}};return{async*projects(){for(let s=1;s!==null;){let r=await t("GET",`/v1/projects?page=${s}`);r.items.length>0&&(yield r.items.map(({projectId:l,name:g,marked:c})=>({projectId:l,name:g,marked:c}))),s=r.next}},async project(s){let l=(await t("GET",`/v1/projects?projectId=${encodeURIComponent(s)}`)).items.find(g=>g.projectId===s);return l===void 0?null:{projectId:s,marked:l.marked===!0,mainPosition:l.context?.mainPosition??null}},async testCase(s,r,l){try{let g=await t("GET",`/v1/projects/${encodeURIComponent(s)}/tests/${encodeURIComponent(r)}/case?base=${encodeURIComponent(l)}`),{test:c,scenario:p,useCase:u,caseId:m,internalId:w,title:h,current:f,counts:$,canAttach:S}=g;return{linked:{test:c,scenario:p,useCase:u,caseId:m,internalId:w,title:h,current:f,counts:$,canAttach:S}}}catch(g){if(g instanceof v&&g.status===409&&nt.has(g.code))return{refused:st(g)};throw g}},async testCases(s){let r=await t("GET",`/v1/projects/${encodeURIComponent(s)}/graph?project=1&types=testCase`),l=g=>g.linkState==="linked"&&typeof g.internalId=="string"&&/^TC-\d+$/.test(g.internalId)?g.internalId:null;return new Map(r.nodes.filter(g=>g.type==="testCase").map(g=>[g.id,l(g.data)]))},async createSession(s){return(await t("POST","/v1/sessions",s)).session},async sources(s){let r=[],l=null;do{let g=`limit=1000${l===null?"":`&after=${encodeURIComponent(l)}`}`,c=await t("GET",`/v1/internal/projects/${encodeURIComponent(s)}/sources?${g}`);r.push(...c.items.map(({sourceId:p,head:u,completeness:m,origin:w,media:h})=>({sourceId:p,head:u,completeness:m,...w!==void 0?{origin:w}:{},...h!==void 0?{media:h}:{}}))),l=c.next}while(l!==null);return r},async mainRecord(s,r){let l=await t("GET",`/v1/internal/projects/${encodeURIComponent(s)}/positions/${r}`);return{position:l.position,record:l.record}},async mainNode(s,r){let l=await t("GET",`/v1/internal/projects/${encodeURIComponent(s)}/nodes/${encodeURIComponent(r)}`);return{cid:l.cid,name:l.name,label:l.label,content:l.content??{},supersededBy:l.supersededBy??null,edgesOut:(l.edgesOut??[]).map(({type:g,dst:c,other:p})=>({type:g,dst:c,other:p??null}))}},nodes:(s,r)=>a(`/v1/internal/projects/${encodeURIComponent(s)}/nodes?label=${encodeURIComponent(r)}&limit=1000`),async testsWithContent(s){let r=`/v1/internal/projects/${encodeURIComponent(s)}/nodes?label=test&content=1&limit=200`,l;try{l=await t("GET",r)}catch(c){if(c instanceof v&&c.status===400&&c.code==="BAD_REQUEST"&&c.message.includes('Unrecognized key: "content"'))return null;throw c}let g=l.next===null?[]:await a(r,l.next);return[...l.items,...g].map(c=>({...c,content:c.content??{}}))},edges:(s,r)=>a(`/v1/internal/projects/${encodeURIComponent(s)}/edges?type=${encodeURIComponent(r)}&limit=1000`),stale:s=>a(`/v1/internal/projects/${encodeURIComponent(s)}/stale?limit=1000`),async listSessions(s,r={}){let l=[],g=null,c=`${r.sourceId?`&sourceId=${encodeURIComponent(r.sourceId)}`:""}${r.useCase?`&useCase=${encodeURIComponent(r.useCase)}`:""}`;do{let p=`projectId=${encodeURIComponent(s)}${c}${g===null?"":`&after=${encodeURIComponent(g)}`}`,u=await t("GET",`/v1/sessions?${p}`);l.push(...u.items),g=u.next}while(g!==null);return l},getSession:s=>t("GET",d(s)),setStatus:(s,r)=>t("PATCH",d(s),{status:r}),land:(s,r)=>t("POST",`${d(s)}/land`,{generation:r}),discard:(s,r)=>t("POST",`${d(s)}/discard`,r===void 0?{}:{generation:r}),proposes:async(s,r)=>(await i(s,r)).proposes,counts:i,openUpload:(s,r)=>t("POST",`/v1/projects/${encodeURIComponent(s)}/uploads`,r),putUpload:async(s,r,l,g)=>{let{response:c,bytes:p}=await n("PUT",s,l,{headers:r,route:"PUT upload",...g?{onSend:g}:{}}),u=c.headers.get("etag");if(p.length>0)try{let m=JSON.parse(p.toString("utf8"));typeof m.etag=="string"&&(u=m.etag)}catch{}if(!u)throw new v(c.status,"BAD_RESPONSE","the upload's store answered no etag");return{etag:u}},completeUpload:(s,r,l)=>t("POST",`${o(s,r)}/complete`,{etag:l}),getUpload:(s,r)=>t("GET",o(s,r)),uploadResult:(s,r,l)=>t("POST",`${o(s,r)}/result`,l),async projectCoverage(s){let{state:r,doc:l}=await t("GET",`/v1/projects/${encodeURIComponent(s)}/coverage`);return{state:r,doc:l}},async coverageRun(s,r){return{pack:(await t("POST",`/v1/projects/${encodeURIComponent(s)}/coverage/run`,r)).pack}}}}import{isMainThread as lt}from"worker_threads";import{createHash as dt}from"crypto";function se(e){return e instanceof Error?e.message:String(e)}var ke="SUPERSEDED_WRITER",en="LEASE_LAPSED";function tn(e){let t=`/v1/sessions/${encodeURIComponent(e.sessionId)}/host`,{exchange:n,request:o}=B(e),d=i=>i===null?"limit=1000":`after=${encodeURIComponent(i)}&limit=1000`,a=i=>i===void 0?t:`${t}/children/${encodeURIComponent(i)}`;return{claim:()=>o("POST",`${t}/claim`,{forms:1}),session:()=>o("GET",t),renewLease:i=>o("POST",`${t}/lease`,{generation:i}),save:i=>o("PATCH",t,i),checkpointRows:i=>o("GET",`${a(i)}/checkpoints`,void 0,!0),async readCheckpointRow(i,s){return(await o("GET",`${a(s)}/checkpoints/${i}`,void 0,!0)).text},async writeCheckpointRow(i,s,r,{ifAbsent:l=!1,childId:g}={}){let c=`${a(g)}/checkpoints/${s}${l?"?ifAbsent=true":""}`;return(await o("PUT",c,{generation:i,text:r})).stored},async removeCheckpointRow(i,s,r){await o("DELETE",`${a(r)}/checkpoints/${s}?generation=${i}`)},registerChild:(i,s,r)=>o("POST",`${t}/children`,{generation:i,childId:s,...r?{useCase:r}:{}}),async sessionSide(){return(await o("GET",`${t}/side`)).text},async putSessionSide(i,s){await o("PUT",`${t}/side`,{generation:i,text:s})},saveChildPointer:(i,s,r,l)=>o("PATCH",a(s),{generation:i,checkpoint:r,state:l}),async sessionState(i){let{text:s}=await o("GET",`${a(i)}/state`);return s===null?null:JSON.parse(s)},async putSessionState(i,s,r){await o("PUT",`${a(r)}/state`,{generation:i,text:JSON.stringify(s)})},scope:()=>o("GET",`${t}/scope`),draftsPage:i=>o("GET",`${t}/scope/drafts?${d(i)}`,void 0,!0),appendDraft:(i,s)=>o("POST",`${t}/scope/drafts`,{generation:i,...s}),mainNodes:(i,s)=>o("POST",`${t}/main/nodes`,{position:i,cids:s}),async mainHistory(){let{response:i,bytes:s}=await n("GET",`${t}/main/history`,void 0,{headers:{"accept-encoding":"gzip"},bulk:!0}),r=Number(i.headers.get("lattice-history-position")),l=i.headers.get("lattice-history-hash");if(!Number.isInteger(r)||r<0||!l)throw new v(i.status,"UNEXPECTED_ANSWER",`GET ${t}/main/history answered without its Lattice-History-Position and Lattice-History-Hash headers`);return{position:r,hash:l,forms:be(i,"lattice-history-forms"),json:s}},async getBlob(i){try{return(await n("GET",`${t}/blobs/${encodeURIComponent(i)}`,void 0,{bulk:!0})).bytes}catch(s){if(s instanceof v&&s.code==="NOT_FOUND")return null;throw s}},putBlob:(i,s)=>o("PUT",`${t}/blobs?generation=${i}`,s),async files(i){return(await o("GET",`${t}/files?prefix=${encodeURIComponent(i)}`)).items},async readFile(i){try{let{response:s,bytes:r}=await n("GET",`${t}/file?name=${encodeURIComponent(i)}`,void 0,{bulk:!0}),l=Number(s.headers.get("lattice-file-version"));if(!Number.isInteger(l)||l<1)throw new v(s.status,"UNEXPECTED_ANSWER",`GET ${t}/file answered ${i} without a Lattice-File-Version header`);return{text:r.toString("utf8"),version:l}}catch(s){if(s instanceof v&&s.code==="NOT_FOUND")return null;throw s}},async embeddings(i,s){let r=`alias=${encodeURIComponent(i)}&purpose=${encodeURIComponent(s)}`,{bytes:l}=await n("GET",`${t}/embeddings?${r}`,void 0,{headers:{"accept-encoding":"gzip"},bulk:!0});return JSON.parse(l.toString("utf8"))},putEmbeddings:(i,s)=>o("POST",`${t}/embeddings`,{generation:i,...s}),putFile:(i,s,r,l)=>o("PUT",`${t}/file?name=${encodeURIComponent(s)}&generation=${i}&version=${r}`,l),appendEvents:(i,s)=>o("POST",`${t}/events`,{generation:i,events:s}),async eventsAfter(i){let s=[],r=null;do{let l=r===null?`after=${i}&limit=1000`:`after=${encodeURIComponent(r)}&limit=1000`,g=await o("GET",`${t}/events?${l}`);s.push(...g.items),r=g.next}while(r!==null);return s}}}var re="the session cannot go on: the project's context is being imported; it is served once an import of it completes",ot=5*6e4,Ce=2e3,it=15e3;function _e(e){return e instanceof v&&e.code==="CONTEXT_IMPORTING"}function Ie(){return new v(409,"CONTEXT_IMPORTING",re)}function on(e={}){let t=e.sleep??(a=>new Promise(i=>setTimeout(i,a))),n=e.budgetMs??ot,o=0,d=Ce;return{async wait(){let a=n-o;if(a<=0)return!1;let i=Math.min(d,a);return await t(i),o+=i,d=Math.min(d*2,it),!0},answered(){o=0,d=Ce}}}var R={scope:"store.scope",mainNodes:"store.mainNodes",mainNodesAhead:"store.mainNodesAhead",mainHistory:"store.mainHistory",drafts:"store.drafts",appendDraft:"store.appendDraft",vectorsRead:"store.vectorsRead",vectorsWrite:"store.vectorsWrite",getBlob:"store.getBlob",putBlob:"store.putBlob",chainRead:"chain.read",chainList:"chain.list",chainWrite:"chain.write",chainWriteIfAbsent:"chain.writeIfAbsent",chainRemove:"chain.remove",filesRead:"files.read",filesList:"files.list",filesWrite:"files.write",pointer:"session.pointer",stateGet:"session.stateGet",statePut:"session.statePut",acknowledge:"session.acknowledge",registerChild:"session.registerChild",children:"session.children",sideGet:"session.sideGet",sideSave:"session.sideSave"};var Pe=3e4,D=class extends Error{constructor(n,o,d,a=null){super(`Lattice refused ${n} (${o}): ${d}`);this.op=n;this.code=o;this.requestId=a;this.name="StepRefusedError"}};function ct(e){return e.status!==0?"not_ready":/no answer within/.test(e.message)?"timeout":"unreachable"}var Oe=new Set([ke,"SESSION_ENDED","PROJECT_NOT_MARKED"]);function fn(e,t){let n=t.sleep??(c=>new Promise(p=>setTimeout(p,c))),o=t.retryDeadlineMs??12e4,d=new Map((t.children??[]).map(c=>[c.childId,c.checkpoint?.pointer??null]));async function a(c,p){let u=Te(o,n,t.now);for(;;)try{let m=await p();return t.imports?.answered(),m}catch(m){if(!(m instanceof v))throw m;if(_e(m)&&t.imports){if(await t.imports.wait())continue;throw t.onStopped?.(Ie()),te(new Error(`Lattice refused ${c}: ${re}`),m)}if(Oe.has(m.code)&&t.onStopped?.(m),!m.retryable)throw new D(c,m.code,m.message,m.requestId);let w=h=>t.onRetry?.({op:c,attempt:u.attempt,nextInMs:h,giveUpAt:u.endsAt()??0,cause:ct(m)});if(!await u.again(w))throw t.onStopped?.(new v(m.status,m.code,`Lattice did not take ${c} within ${o/1e3} s: ${m.message}`,null,null,{},m.requestId)),te(new Error(`Lattice refused ${c} (${m.code}, still after ${o/1e3} s): ${m.message}`),m)}}async function i(c,p){try{return await p()}catch(u){throw u instanceof v?(Oe.has(u.code)&&t.onStopped?.(u),new D(c,u.code,u.message,u.requestId)):u}}async function s(c,p){let u=R.acknowledge,m=t.log;if(!m)throw new Error("the checkpoint barrier needs the session log, and this host gave it none");let w=Date.now()+Pe;for(;m.lastSeq()<c.eventSeq;){if(Date.now()>w)throw new Error(`the session log reached event ${m.lastSeq()}, not ${c.eventSeq}, within ${Pe/1e3} s; the checkpoint is not acknowledged`);await n(5)}await ut(m.flush(),o),await a(u,()=>e.writeCheckpointRow(t.generation,`side-${c.pointer.seq}.json`,JSON.stringify(c.side),{childId:p}));let h={pointer:c.pointer,covers:{eventSeq:c.eventSeq,scope:c.scope}},f=JSON.stringify(c.state);p===void 0?await a(u,()=>e.save({generation:t.generation,checkpoint:h,state:f})):d.set(p,(await a(u,()=>e.saveChildPointer(t.generation,p,h,f))).checkpoint.pointer)}async function r(){let c=await a(R.mainHistory,()=>e.mainHistory()),p=dt("sha256").update(c.json).digest("hex");if(p!==c.hash)throw new Error(`main's history from Lattice hashes to ${p}, not to ${c.hash}, the hash Lattice gave for it`);if(t.historyForms!==void 0&&c.forms!==t.historyForms){let u=`main's history pack was built at engine forms ${c.forms??"none named"}, not at ${t.historyForms}, the forms of the Lattice that took this host's claim: another Lattice served it`;throw t.onStopped?.(new v(409,"HISTORY_FORMS_MISMATCH",u)),new Error(u)}return c.json.toString("utf8")}let l=new Map,g=c=>`${Number(c.position)}:${c.cids.join(",")}`;return async(c,p)=>{let u=p??{},m=u.after??null,w=typeof u.childId=="string"?u.childId:void 0;switch(c){case R.scope:return await a(c,()=>e.scope());case R.mainHistory:return{json:await r()};case R.mainNodesAhead:{let h=e.mainNodes(Number(u.position),u.cids);return h.catch(()=>{}),l.set(g(u),h),null}case R.mainNodes:{let h=l.get(g(u));if(l.delete(g(u)),h)try{return await h}catch{}return await a(c,()=>e.mainNodes(Number(u.position),u.cids))}case R.drafts:return await a(c,()=>e.draftsPage(m));case R.appendDraft:{let h={eventId:u.eventId??null,record:u.record??null,envelope:u.envelope??null};return await a(c,()=>e.appendDraft(t.generation,h))}case R.filesRead:return(await a(c,()=>e.readFile(W(u.name))))?.text??null;case R.filesList:{let h=`${W(u.folder)}/`;return(await a(c,()=>e.files(h))).map($=>$.name.slice(h.length)).filter($=>!$.includes("/"))}case R.filesWrite:{if(!String(u.name).startsWith("rationale/"))throw new Error(`the host writes only test rationales; ${W(u.name)} is a configuration file, written by an operator`);try{return await a(c,()=>e.putFile(t.generation,W(u.name),0,Buffer.from(String(u.text),"utf8"))),{written:!0}}catch(h){if(/\(FILE_CHANGED\)/.test(se(h)))return{written:!1,message:se(h)};throw h}}case R.vectorsRead:return await i(c,()=>e.embeddings(String(u.alias),String(u.purpose)));case R.vectorsWrite:{let h={alias:String(u.alias),purpose:String(u.purpose),dims:Number(u.dims),vectors:u.vectors??{}};return await i(c,()=>e.putEmbeddings(t.generation,h))}case R.getBlob:{let h=await a(c,()=>e.getBlob(String(u.fingerprint)));return{bytes:h===null?null:h.toString("base64")}}case R.putBlob:return await a(c,()=>e.putBlob(t.generation,Buffer.from(String(u.bytes),"base64")));case R.chainRead:return await a(c,()=>e.readCheckpointRow(String(u.name),w));case R.chainList:return await a(c,()=>e.checkpointRows(w));case R.chainWrite:return await a(c,()=>e.writeCheckpointRow(t.generation,String(u.name),String(u.text),{childId:w})),null;case R.chainWriteIfAbsent:return await a(c,()=>e.writeCheckpointRow(t.generation,String(u.name),String(u.text),{ifAbsent:!0,childId:w}));case R.chainRemove:return await a(c,()=>e.removeCheckpointRow(t.generation,String(u.name),w)),null;case R.pointer:return w!==void 0?d.get(w)??null:(await a(c,()=>e.session())).checkpoint?.pointer??null;case R.stateGet:return await a(c,()=>e.sessionState(w));case R.statePut:return await a(c,()=>e.putSessionState(t.generation,u.state??null,w)),null;case R.acknowledge:return await s(u,w),null;case R.children:return[...(t.children??[]).map(h=>h.childId)];case R.sideGet:return await a(c,()=>e.sessionSide());case R.sideSave:return await a(c,()=>e.putSessionSide(t.generation,String(u.text))),{saved:!0};case R.registerChild:{let h=typeof u.useCase=="string"?u.useCase:void 0,f=await a(c,async()=>{try{return await e.registerChild(t.generation,String(u.childId),h)}catch($){throw $ instanceof v&&$.code==="SESSION_CLASH"?new Ee($.message,$.code,{heldBy:$.extra.heldBy??null},$.requestId):$}});return d.set(f.childId,f.checkpoint?.pointer??null),null}default:throw new Error(`the session thread asked for ${c}, which the main thread does not answer`)}}}function W(e){return`design/${String(e)}`}async function ut(e,t){let n,o=new Promise((d,a)=>{n=setTimeout(()=>a(new Error(`the session's events were not stored within ${t/1e3} s; the checkpoint is not acknowledged`)),t)});try{await Promise.race([e,o])}finally{clearTimeout(n)}}var x={verb:"remote",mode:"interactive"},oe=null,Ne=new Set;function Tn(e){x={...x,...e}}function V(e,t){return Ae(e,t),z()}function Ae(e,t){if(!(!Z()||Ne.has(e))){Ne.add(e);try{oe??=$e({verb:x.verb,mode:x.mode,contextRoot:null,env:Re(),sessionId:z(),errorsOnly:!0}),Object.assign(oe.ids,{...x.projectId?{project_id:x.projectId}:{},...x.latticeSessionId?{lattice_session_id:x.latticeSessionId}:{}}),oe.spoolError(e,t?{request_id:t}:{})}catch{}}}function gt(e){return e instanceof v||e instanceof D?`lattice_${e.code}`:"cli_crash"}function mt(e){let t=e?.requestId;return typeof t=="string"&&t?t:null}async function ht(){!Z()||!lt||await Promise.race([fe(ye()).catch(()=>{}),new Promise(e=>setTimeout(e,we).unref())])}async function xn(e,t){return e instanceof v&&Ae(gt(e),mt(e)),await ht(),t}import{isAbsolute as pt,relative as De}from"path";var k=e=>" ".repeat(e);function ft(e){return e.length<2?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`}var J=e=>e===1?"this test runs":"these tests run";function Ue(e,t,n){if(n===void 0||t+e.length<=n)return[k(t)+e];let o=[],d="";for(let a of e.split(" "))d&&t+d.length+1+a.length>n?(o.push(k(t)+d),d=a):d=d?`${d} ${a}`:a;return[...o,k(t)+d]}function _n(e,t){let n=e.variables.length;if(n===0)return[];let o=n===1?`\u2692 1 variable needs a value before ${J(t.tests)}; fill it in:`:`\u2692 ${n} variables need values before ${J(t.tests)}; fill them in:`,d=[k(t.indent)+o,k(t.indent+4)+(De(t.cwd,e.file)||e.file)],a=e.variables.filter(i=>i.start_page).map(i=>i.name);return a.length===1?d.push(...Ue(`${a[0]} is the page ${t.tests===1?"it starts":"they start"} on`,t.indent+4,t.columns)):a.length>1&&d.push(...Ue(`${ft(a)} are the pages they start on`,t.indent+4,t.columns)),d}function Le(e,t){let n=t.cwd??process.cwd(),o=s=>pt(s)&&De(n,s)||s,d=e.length;if(d===0)return[];let a=d===1?"\u2692 1 test has no start page yet, so it can't run as it is:":`\u2692 ${d} tests have no start page yet, so they can't run as they are:`,i=d===1?"name the page in its first step, or run it with --url <the page>":"name the page in each one's first step, or run them with --url <the page>";return[k(t.indent)+a,...e.map(s=>k(t.indent+4)+(s.file?o(s.file):`${s.test} ${s.title}`)),k(t.indent+4)+i]}function je(e,t){let n=e.variables.length,o=e.noStartPage.length;return[...n===0?[]:[n===1?`1 variable needs a value before ${J(t.tests)}`:`${n} variables need values before ${J(t.tests)}`],...o===0?[]:[o===1?"1 test has no start page yet":`${o} tests have no start page yet`]]}function Bn(e,t="--mode agent"){if(!e.next)return e.remedy?{remedy:e.remedy}:{};let n=(e.remedy??"").split(`
|
|
2
|
+
import{a as Ee,b as te}from"./chunk-GFLB2SHW.js";import{a as ee}from"./chunk-2TVPA3LL.js";import{c as G}from"./chunk-22PIMG52.js";import{a as z}from"./chunk-RQKMSNEU.js";import{a as v,b as be,d as B,e as Te}from"./chunk-4C7WVQOD.js";import{a as M}from"./chunk-QXQ7KVEN.js";import{a as Se}from"./chunk-OKA6FPJM.js";import{b as we,c as ye,d as Re,e as Z,f as $e}from"./chunk-B57ZRHEQ.js";import{na as ve,oa as P}from"./chunk-PI7OXS62.js";import{g as fe}from"./chunk-UJLULWSR.js";import{basename as wt,relative as ce}from"path";function Vt(e){return e.scope?.state==="finalized"?"saved":e.scope?.state==="discarded"?"discarded":e.ended==="complete"?"ready_to_save":e.ended==="failed"||e.status==="failed"?"failed":e.status==="paused"||e.status==="needs_attention"?"paused":"running"}var ne=["useCases","criteria","scenarios","tests","openQuestions","sources","styleNotes"],H=new Set(["sources","styleNotes"]);function xe(e){return ne.reduce((t,n)=>t+(H.has(n)?0:e[n]??0),0)}var nt=new Set(["NO_CASE","CASE_BROKEN","TEST_FILE_STALE","CASE_ARCHIVED"]),U=e=>typeof e=="string"?e:null;function st(e){let t=e.extra;switch(e.code){case"CASE_BROKEN":return{code:"CASE_BROKEN",session:U(t.session),caseId:U(t.caseId)??"",reason:t.reason==="moved"?"moved":"deleted"};case"CASE_ARCHIVED":return{code:"CASE_ARCHIVED",caseId:U(t.caseId)??"",internalId:U(t.internalId)??""};default:return{code:e.code,session:U(t.session),useCase:U(t.useCase)}}}function Jt(e){return(Array.isArray(e.nodes)?e.nodes:[]).filter(n=>typeof n.cid=="string"&&typeof n.label=="string").map(n=>({cid:n.cid,label:n.label,content:typeof n.content=="object"&&n.content!==null?n.content:{}}))}function qt(e){return(Array.isArray(e.names)?e.names:[]).filter(n=>typeof n.cid=="string"&&typeof n.slug=="string").map(n=>({cid:n.cid,slug:n.slug}))}function Kt(e){return(Array.isArray(e.supersessions)?e.supersessions:[]).filter(n=>n.kind==="node"&&typeof n.old=="string").map(n=>({old:n.old,new:typeof n.new=="string"?n.new:null}))}function Yt(e){let{request:t,exchange:n}=B(e),o=(s,r)=>`/v1/projects/${encodeURIComponent(s)}/uploads/${r}`,d=s=>`/v1/sessions/${encodeURIComponent(s)}`,a=async(s,r=null)=>{let l=[],g=r;do{let c=await t("GET",`${s}${g===null?"":`&after=${encodeURIComponent(g)}`}`);l.push(...c.items),g=c.next}while(g!==null);return l},i=async(s,r)=>{let l=await t("GET",`/v1/projects/${encodeURIComponent(s)}/sessions/${encodeURIComponent(r)}`),{proposes:g,heldChanges:c,changes:p,approves:u,archives:m,removes:w,chatTurns:h,uncounted:f}=l.drafts;return{proposes:g,heldChanges:c??0,changes:p??{},approves:u??{},archives:m??{},removes:w??{},chatTurns:h??0,uncounted:typeof f=="number"?f:null}};return{async*projects(){for(let s=1;s!==null;){let r=await t("GET",`/v1/projects?page=${s}`);r.items.length>0&&(yield r.items.map(({projectId:l,name:g,marked:c})=>({projectId:l,name:g,marked:c}))),s=r.next}},async project(s){let l=(await t("GET",`/v1/projects?projectId=${encodeURIComponent(s)}`)).items.find(g=>g.projectId===s);return l===void 0?null:{projectId:s,marked:l.marked===!0,mainPosition:l.context?.mainPosition??null}},async testCase(s,r,l){try{let g=await t("GET",`/v1/projects/${encodeURIComponent(s)}/tests/${encodeURIComponent(r)}/case?base=${encodeURIComponent(l)}`),{test:c,scenario:p,useCase:u,caseId:m,internalId:w,title:h,current:f,counts:$,canAttach:S}=g;return{linked:{test:c,scenario:p,useCase:u,caseId:m,internalId:w,title:h,current:f,counts:$,canAttach:S}}}catch(g){if(g instanceof v&&g.status===409&&nt.has(g.code))return{refused:st(g)};throw g}},async testCases(s){let r=await t("GET",`/v1/projects/${encodeURIComponent(s)}/graph?project=1&types=testCase`),l=g=>g.linkState==="linked"&&typeof g.internalId=="string"&&/^TC-\d+$/.test(g.internalId)?g.internalId:null;return new Map(r.nodes.filter(g=>g.type==="testCase").map(g=>[g.id,l(g.data)]))},async createSession(s){return(await t("POST","/v1/sessions",s)).session},async sources(s){let r=[],l=null;do{let g=`limit=1000${l===null?"":`&after=${encodeURIComponent(l)}`}`,c=await t("GET",`/v1/internal/projects/${encodeURIComponent(s)}/sources?${g}`);r.push(...c.items.map(({sourceId:p,head:u,completeness:m,origin:w,media:h})=>({sourceId:p,head:u,completeness:m,...w!==void 0?{origin:w}:{},...h!==void 0?{media:h}:{}}))),l=c.next}while(l!==null);return r},async mainRecord(s,r){let l=await t("GET",`/v1/internal/projects/${encodeURIComponent(s)}/positions/${r}`);return{position:l.position,record:l.record}},async mainNode(s,r){let l=await t("GET",`/v1/internal/projects/${encodeURIComponent(s)}/nodes/${encodeURIComponent(r)}`);return{cid:l.cid,name:l.name,label:l.label,content:l.content??{},supersededBy:l.supersededBy??null,edgesOut:(l.edgesOut??[]).map(({type:g,dst:c,other:p})=>({type:g,dst:c,other:p??null}))}},nodes:(s,r)=>a(`/v1/internal/projects/${encodeURIComponent(s)}/nodes?label=${encodeURIComponent(r)}&limit=1000`),async testsWithContent(s){let r=`/v1/internal/projects/${encodeURIComponent(s)}/nodes?label=test&content=1&limit=200`,l;try{l=await t("GET",r)}catch(c){if(c instanceof v&&c.status===400&&c.code==="BAD_REQUEST"&&c.message.includes('Unrecognized key: "content"'))return null;throw c}let g=l.next===null?[]:await a(r,l.next);return[...l.items,...g].map(c=>({...c,content:c.content??{}}))},edges:(s,r)=>a(`/v1/internal/projects/${encodeURIComponent(s)}/edges?type=${encodeURIComponent(r)}&limit=1000`),stale:s=>a(`/v1/internal/projects/${encodeURIComponent(s)}/stale?limit=1000`),async listSessions(s,r={}){let l=[],g=null,c=`${r.sourceId?`&sourceId=${encodeURIComponent(r.sourceId)}`:""}${r.useCase?`&useCase=${encodeURIComponent(r.useCase)}`:""}`;do{let p=`projectId=${encodeURIComponent(s)}${c}${g===null?"":`&after=${encodeURIComponent(g)}`}`,u=await t("GET",`/v1/sessions?${p}`);l.push(...u.items),g=u.next}while(g!==null);return l},getSession:s=>t("GET",d(s)),setStatus:(s,r)=>t("PATCH",d(s),{status:r}),land:(s,r)=>t("POST",`${d(s)}/land`,{generation:r}),discard:(s,r)=>t("POST",`${d(s)}/discard`,r===void 0?{}:{generation:r}),proposes:async(s,r)=>(await i(s,r)).proposes,counts:i,openUpload:(s,r)=>t("POST",`/v1/projects/${encodeURIComponent(s)}/uploads`,r),putUpload:async(s,r,l,g)=>{let{response:c,bytes:p}=await n("PUT",s,l,{headers:r,route:"PUT upload",...g?{onSend:g}:{}}),u=c.headers.get("etag");if(p.length>0)try{let m=JSON.parse(p.toString("utf8"));typeof m.etag=="string"&&(u=m.etag)}catch{}if(!u)throw new v(c.status,"BAD_RESPONSE","the upload's store answered no etag");return{etag:u}},completeUpload:(s,r,l)=>t("POST",`${o(s,r)}/complete`,{etag:l}),getUpload:(s,r)=>t("GET",o(s,r)),uploadResult:(s,r,l)=>t("POST",`${o(s,r)}/result`,l),async projectCoverage(s){let{state:r,doc:l}=await t("GET",`/v1/projects/${encodeURIComponent(s)}/coverage`);return{state:r,doc:l}},async coverageRun(s,r){return{pack:(await t("POST",`/v1/projects/${encodeURIComponent(s)}/coverage/run`,r)).pack}}}}import{isMainThread as lt}from"worker_threads";import{createHash as dt}from"crypto";function se(e){return e instanceof Error?e.message:String(e)}var ke="SUPERSEDED_WRITER",en="LEASE_LAPSED";function tn(e){let t=`/v1/sessions/${encodeURIComponent(e.sessionId)}/host`,{exchange:n,request:o}=B(e),d=i=>i===null?"limit=1000":`after=${encodeURIComponent(i)}&limit=1000`,a=i=>i===void 0?t:`${t}/children/${encodeURIComponent(i)}`;return{claim:()=>o("POST",`${t}/claim`,{forms:1}),session:()=>o("GET",t),renewLease:i=>o("POST",`${t}/lease`,{generation:i}),save:i=>o("PATCH",t,i),checkpointRows:i=>o("GET",`${a(i)}/checkpoints`,void 0,!0),async readCheckpointRow(i,s){return(await o("GET",`${a(s)}/checkpoints/${i}`,void 0,!0)).text},async writeCheckpointRow(i,s,r,{ifAbsent:l=!1,childId:g}={}){let c=`${a(g)}/checkpoints/${s}${l?"?ifAbsent=true":""}`;return(await o("PUT",c,{generation:i,text:r})).stored},async removeCheckpointRow(i,s,r){await o("DELETE",`${a(r)}/checkpoints/${s}?generation=${i}`)},registerChild:(i,s,r)=>o("POST",`${t}/children`,{generation:i,childId:s,...r?{useCase:r}:{}}),async sessionSide(){return(await o("GET",`${t}/side`)).text},async putSessionSide(i,s){await o("PUT",`${t}/side`,{generation:i,text:s})},saveChildPointer:(i,s,r,l)=>o("PATCH",a(s),{generation:i,checkpoint:r,state:l}),async sessionState(i){let{text:s}=await o("GET",`${a(i)}/state`);return s===null?null:JSON.parse(s)},async putSessionState(i,s,r){await o("PUT",`${a(r)}/state`,{generation:i,text:JSON.stringify(s)})},scope:()=>o("GET",`${t}/scope`),draftsPage:i=>o("GET",`${t}/scope/drafts?${d(i)}`,void 0,!0),appendDraft:(i,s)=>o("POST",`${t}/scope/drafts`,{generation:i,...s}),mainNodes:(i,s)=>o("POST",`${t}/main/nodes`,{position:i,cids:s}),async mainHistory(){let{response:i,bytes:s}=await n("GET",`${t}/main/history`,void 0,{headers:{"accept-encoding":"gzip"},bulk:!0}),r=Number(i.headers.get("lattice-history-position")),l=i.headers.get("lattice-history-hash");if(!Number.isInteger(r)||r<0||!l)throw new v(i.status,"UNEXPECTED_ANSWER",`GET ${t}/main/history answered without its Lattice-History-Position and Lattice-History-Hash headers`);return{position:r,hash:l,forms:be(i,"lattice-history-forms"),json:s}},async getBlob(i){try{return(await n("GET",`${t}/blobs/${encodeURIComponent(i)}`,void 0,{bulk:!0})).bytes}catch(s){if(s instanceof v&&s.code==="NOT_FOUND")return null;throw s}},putBlob:(i,s)=>o("PUT",`${t}/blobs?generation=${i}`,s),async files(i){return(await o("GET",`${t}/files?prefix=${encodeURIComponent(i)}`)).items},async readFile(i){try{let{response:s,bytes:r}=await n("GET",`${t}/file?name=${encodeURIComponent(i)}`,void 0,{bulk:!0}),l=Number(s.headers.get("lattice-file-version"));if(!Number.isInteger(l)||l<1)throw new v(s.status,"UNEXPECTED_ANSWER",`GET ${t}/file answered ${i} without a Lattice-File-Version header`);return{text:r.toString("utf8"),version:l}}catch(s){if(s instanceof v&&s.code==="NOT_FOUND")return null;throw s}},async embeddings(i,s){let r=`alias=${encodeURIComponent(i)}&purpose=${encodeURIComponent(s)}`,{bytes:l}=await n("GET",`${t}/embeddings?${r}`,void 0,{headers:{"accept-encoding":"gzip"},bulk:!0});return JSON.parse(l.toString("utf8"))},putEmbeddings:(i,s)=>o("POST",`${t}/embeddings`,{generation:i,...s}),putFile:(i,s,r,l)=>o("PUT",`${t}/file?name=${encodeURIComponent(s)}&generation=${i}&version=${r}`,l),appendEvents:(i,s)=>o("POST",`${t}/events`,{generation:i,events:s}),async eventsAfter(i){let s=[],r=null;do{let l=r===null?`after=${i}&limit=1000`:`after=${encodeURIComponent(r)}&limit=1000`,g=await o("GET",`${t}/events?${l}`);s.push(...g.items),r=g.next}while(r!==null);return s}}}var re="the session cannot go on: the project's context is being imported; it is served once an import of it completes",ot=5*6e4,Ce=2e3,it=15e3;function _e(e){return e instanceof v&&e.code==="CONTEXT_IMPORTING"}function Ie(){return new v(409,"CONTEXT_IMPORTING",re)}function on(e={}){let t=e.sleep??(a=>new Promise(i=>setTimeout(i,a))),n=e.budgetMs??ot,o=0,d=Ce;return{async wait(){let a=n-o;if(a<=0)return!1;let i=Math.min(d,a);return await t(i),o+=i,d=Math.min(d*2,it),!0},answered(){o=0,d=Ce}}}var R={scope:"store.scope",mainNodes:"store.mainNodes",mainNodesAhead:"store.mainNodesAhead",mainHistory:"store.mainHistory",drafts:"store.drafts",appendDraft:"store.appendDraft",vectorsRead:"store.vectorsRead",vectorsWrite:"store.vectorsWrite",getBlob:"store.getBlob",putBlob:"store.putBlob",chainRead:"chain.read",chainList:"chain.list",chainWrite:"chain.write",chainWriteIfAbsent:"chain.writeIfAbsent",chainRemove:"chain.remove",filesRead:"files.read",filesList:"files.list",filesWrite:"files.write",pointer:"session.pointer",stateGet:"session.stateGet",statePut:"session.statePut",acknowledge:"session.acknowledge",registerChild:"session.registerChild",children:"session.children",sideGet:"session.sideGet",sideSave:"session.sideSave"};var Pe=3e4,D=class extends Error{constructor(n,o,d,a=null){super(`Lattice refused ${n} (${o}): ${d}`);this.op=n;this.code=o;this.requestId=a;this.name="StepRefusedError"}};function ct(e){return e.status!==0?"not_ready":/no answer within/.test(e.message)?"timeout":"unreachable"}var Oe=new Set([ke,"SESSION_ENDED","PROJECT_NOT_MARKED"]);function fn(e,t){let n=t.sleep??(c=>new Promise(p=>setTimeout(p,c))),o=t.retryDeadlineMs??12e4,d=new Map((t.children??[]).map(c=>[c.childId,c.checkpoint?.pointer??null]));async function a(c,p){let u=Te(o,n,t.now);for(;;)try{let m=await p();return t.imports?.answered(),m}catch(m){if(!(m instanceof v))throw m;if(_e(m)&&t.imports){if(await t.imports.wait())continue;throw t.onStopped?.(Ie()),te(new Error(`Lattice refused ${c}: ${re}`),m)}if(Oe.has(m.code)&&t.onStopped?.(m),!m.retryable)throw new D(c,m.code,m.message,m.requestId);let w=h=>t.onRetry?.({op:c,attempt:u.attempt,nextInMs:h,giveUpAt:u.endsAt()??0,cause:ct(m)});if(!await u.again(w))throw t.onStopped?.(new v(m.status,m.code,`Lattice did not take ${c} within ${o/1e3} s: ${m.message}`,null,null,{},m.requestId)),te(new Error(`Lattice refused ${c} (${m.code}, still after ${o/1e3} s): ${m.message}`),m)}}async function i(c,p){try{return await p()}catch(u){throw u instanceof v?(Oe.has(u.code)&&t.onStopped?.(u),new D(c,u.code,u.message,u.requestId)):u}}async function s(c,p){let u=R.acknowledge,m=t.log;if(!m)throw new Error("the checkpoint barrier needs the session log, and this host gave it none");let w=Date.now()+Pe;for(;m.lastSeq()<c.eventSeq;){if(Date.now()>w)throw new Error(`the session log reached event ${m.lastSeq()}, not ${c.eventSeq}, within ${Pe/1e3} s; the checkpoint is not acknowledged`);await n(5)}await ut(m.flush(),o),await a(u,()=>e.writeCheckpointRow(t.generation,`side-${c.pointer.seq}.json`,JSON.stringify(c.side),{childId:p}));let h={pointer:c.pointer,covers:{eventSeq:c.eventSeq,scope:c.scope}},f=JSON.stringify(c.state);p===void 0?await a(u,()=>e.save({generation:t.generation,checkpoint:h,state:f})):d.set(p,(await a(u,()=>e.saveChildPointer(t.generation,p,h,f))).checkpoint.pointer)}async function r(){let c=await a(R.mainHistory,()=>e.mainHistory()),p=dt("sha256").update(c.json).digest("hex");if(p!==c.hash)throw new Error(`main's history from Lattice hashes to ${p}, not to ${c.hash}, the hash Lattice gave for it`);if(t.historyForms!==void 0&&c.forms!==t.historyForms){let u=`main's history pack was built at engine forms ${c.forms??"none named"}, not at ${t.historyForms}, the forms of the Lattice that took this host's claim: another Lattice served it`;throw t.onStopped?.(new v(409,"HISTORY_FORMS_MISMATCH",u)),new Error(u)}return c.json.toString("utf8")}let l=new Map,g=c=>`${Number(c.position)}:${c.cids.join(",")}`;return async(c,p)=>{let u=p??{},m=u.after??null,w=typeof u.childId=="string"?u.childId:void 0;switch(c){case R.scope:return await a(c,()=>e.scope());case R.mainHistory:return{json:await r()};case R.mainNodesAhead:{let h=e.mainNodes(Number(u.position),u.cids);return h.catch(()=>{}),l.set(g(u),h),null}case R.mainNodes:{let h=l.get(g(u));if(l.delete(g(u)),h)try{return await h}catch{}return await a(c,()=>e.mainNodes(Number(u.position),u.cids))}case R.drafts:return await a(c,()=>e.draftsPage(m));case R.appendDraft:{let h={eventId:u.eventId??null,record:u.record??null,envelope:u.envelope??null};return await a(c,()=>e.appendDraft(t.generation,h))}case R.filesRead:return(await a(c,()=>e.readFile(W(u.name))))?.text??null;case R.filesList:{let h=`${W(u.folder)}/`;return(await a(c,()=>e.files(h))).map($=>$.name.slice(h.length)).filter($=>!$.includes("/"))}case R.filesWrite:{if(!String(u.name).startsWith("rationale/"))throw new Error(`the host writes only test rationales; ${W(u.name)} is a configuration file, written by an operator`);try{return await a(c,()=>e.putFile(t.generation,W(u.name),0,Buffer.from(String(u.text),"utf8"))),{written:!0}}catch(h){if(/\(FILE_CHANGED\)/.test(se(h)))return{written:!1,message:se(h)};throw h}}case R.vectorsRead:return await i(c,()=>e.embeddings(String(u.alias),String(u.purpose)));case R.vectorsWrite:{let h={alias:String(u.alias),purpose:String(u.purpose),dims:Number(u.dims),vectors:u.vectors??{}};return await i(c,()=>e.putEmbeddings(t.generation,h))}case R.getBlob:{let h=await a(c,()=>e.getBlob(String(u.fingerprint)));return{bytes:h===null?null:h.toString("base64")}}case R.putBlob:return await a(c,()=>e.putBlob(t.generation,Buffer.from(String(u.bytes),"base64")));case R.chainRead:return await a(c,()=>e.readCheckpointRow(String(u.name),w));case R.chainList:return await a(c,()=>e.checkpointRows(w));case R.chainWrite:return await a(c,()=>e.writeCheckpointRow(t.generation,String(u.name),String(u.text),{childId:w})),null;case R.chainWriteIfAbsent:return await a(c,()=>e.writeCheckpointRow(t.generation,String(u.name),String(u.text),{ifAbsent:!0,childId:w}));case R.chainRemove:return await a(c,()=>e.removeCheckpointRow(t.generation,String(u.name),w)),null;case R.pointer:return w!==void 0?d.get(w)??null:(await a(c,()=>e.session())).checkpoint?.pointer??null;case R.stateGet:return await a(c,()=>e.sessionState(w));case R.statePut:return await a(c,()=>e.putSessionState(t.generation,u.state??null,w)),null;case R.acknowledge:return await s(u,w),null;case R.children:return[...(t.children??[]).map(h=>h.childId)];case R.sideGet:return await a(c,()=>e.sessionSide());case R.sideSave:return await a(c,()=>e.putSessionSide(t.generation,String(u.text))),{saved:!0};case R.registerChild:{let h=typeof u.useCase=="string"?u.useCase:void 0,f=await a(c,async()=>{try{return await e.registerChild(t.generation,String(u.childId),h)}catch($){throw $ instanceof v&&$.code==="SESSION_CLASH"?new Ee($.message,$.code,{heldBy:$.extra.heldBy??null},$.requestId):$}});return d.set(f.childId,f.checkpoint?.pointer??null),null}default:throw new Error(`the session thread asked for ${c}, which the main thread does not answer`)}}}function W(e){return`design/${String(e)}`}async function ut(e,t){let n,o=new Promise((d,a)=>{n=setTimeout(()=>a(new Error(`the session's events were not stored within ${t/1e3} s; the checkpoint is not acknowledged`)),t)});try{await Promise.race([e,o])}finally{clearTimeout(n)}}var x={verb:"remote",mode:"interactive"},oe=null,Ne=new Set;function Tn(e){x={...x,...e}}function V(e,t){return Ae(e,t),z()}function Ae(e,t){if(!(!Z()||Ne.has(e))){Ne.add(e);try{oe??=$e({verb:x.verb,mode:x.mode,contextRoot:null,env:Re(),sessionId:z(),errorsOnly:!0}),Object.assign(oe.ids,{...x.projectId?{project_id:x.projectId}:{},...x.latticeSessionId?{lattice_session_id:x.latticeSessionId}:{}}),oe.spoolError(e,t?{request_id:t}:{})}catch{}}}function gt(e){return e instanceof v||e instanceof D?`lattice_${e.code}`:"cli_crash"}function mt(e){let t=e?.requestId;return typeof t=="string"&&t?t:null}async function ht(){!Z()||!lt||await Promise.race([fe(ye()).catch(()=>{}),new Promise(e=>setTimeout(e,we).unref())])}async function xn(e,t){return e instanceof v&&Ae(gt(e),mt(e)),await ht(),t}import{isAbsolute as pt,relative as De}from"path";var k=e=>" ".repeat(e);function ft(e){return e.length<2?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`}var J=e=>e===1?"this test runs":"these tests run";function Ue(e,t,n){if(n===void 0||t+e.length<=n)return[k(t)+e];let o=[],d="";for(let a of e.split(" "))d&&t+d.length+1+a.length>n?(o.push(k(t)+d),d=a):d=d?`${d} ${a}`:a;return[...o,k(t)+d]}function _n(e,t){let n=e.variables.length;if(n===0)return[];let o=n===1?`\u2692 1 variable needs a value before ${J(t.tests)}; fill it in:`:`\u2692 ${n} variables need values before ${J(t.tests)}; fill them in:`,d=[k(t.indent)+o,k(t.indent+4)+(De(t.cwd,e.file)||e.file)],a=e.variables.filter(i=>i.start_page).map(i=>i.name);return a.length===1?d.push(...Ue(`${a[0]} is the page ${t.tests===1?"it starts":"they start"} on`,t.indent+4,t.columns)):a.length>1&&d.push(...Ue(`${ft(a)} are the pages they start on`,t.indent+4,t.columns)),d}function Le(e,t){let n=t.cwd??process.cwd(),o=s=>pt(s)&&De(n,s)||s,d=e.length;if(d===0)return[];let a=d===1?"\u2692 1 test has no start page yet, so it can't run as it is:":`\u2692 ${d} tests have no start page yet, so they can't run as they are:`,i=d===1?"name the page in its first step, or run it with --url <the page>":"name the page in each one's first step, or run them with --url <the page>";return[k(t.indent)+a,...e.map(s=>k(t.indent+4)+(s.file?o(s.file):`${s.test} ${s.title}`)),k(t.indent+4)+i]}function je(e,t){let n=e.variables.length,o=e.noStartPage.length;return[...n===0?[]:[n===1?`1 variable needs a value before ${J(t.tests)}`:`${n} variables need values before ${J(t.tests)}`],...o===0?[]:[o===1?"1 test has no start page yet":`${o} tests have no start page yet`]]}function Bn(e,t="--mode agent"){if(!e.next)return e.remedy?{remedy:e.remedy}:{};let n=(e.remedy??"").split(`
|
|
3
3
|
`).filter(o=>!/^\s+kane-cli /.test(o)).join(" ").replace(/(, run)?:$/,"").replace(/[,;]\s*(then\s+)?run:\s*kane-cli\b.*$/,"").trim();return{...n?{remedy:n}:{},next:e.next.map(o=>({cmd:`${o.cmd} ${t}`,why:o.why}))}}function Gn(e){let t=e;return!t||typeof t.sessionId!="string"||typeof t.verb!="string"?null:{sessionId:t.sessionId,verb:t.verb,useCase:typeof t.useCase=="string"?t.useCase:null,mine:t.mine===!0,status:typeof t.status=="string"?t.status:"running"}}var Hn=e=>({sid:e.sessionId,verb:e.verb,use_case:e.useCase,mine:e.mine,status:e.status}),yt={useCases:["use-case","use-cases"],criteria:["acceptance criterion","acceptance criteria"],scenarios:["scenario","scenarios"],tests:["test","tests"],openQuestions:["open question","open questions"],sources:["source","sources"],styleNotes:["style note","style notes"]},ue=ne.map(e=>[e,...yt[e]]),X=(e,t=H)=>{let n=ue.filter(([d])=>(e[d]??0)>0),o=n.filter(([d])=>!t.has(d));return o.length>0?o:n},Rt=new Set(["styleNotes"]),le=e=>e?ue.filter(([t])=>(e[t]??0)>0).map(([t,n,o])=>`${e[t]} ${e[t]===1?n:o}`):[];function $t(e){let t=o=>o?I(X(o).map(([d,a,i])=>`${o[d]} ${o[d]===1?a:i}`)):"",n=[[t(e),"added"],...Ve.map(({key:o,done:d})=>[t(e[o]),o==="changes"?"changed":d])].filter(([o])=>o!=="").map(([o,d])=>`${o} ${d}`);return N(e)>0&&n.push(Ke(N(e))),n.length>0?n.join(", "):null}function Wn(e){let t=$t(e.counts),n=[G(e.durS),...t?[t]:[],...e.credits!==void 0?[`${e.credits.toFixed(1)} credits`]:[]].join(" \xB7 "),o=e.title?`"${e.title}"`:P(e.id??"");return t||(e.counts.uncounted??0)>0?`\u25CF updated ${o} \u2014 ${n}`:`\u25CF nothing changed in ${o} \u2014 ${n}`}function Vn(e){let t=e.title?`"${e.title}"`:P(e.id??""),n=[G(e.durS),`${e.tests} ${e.tests===1?"test":"tests"}`,...e.credits!==void 0?[`${e.credits.toFixed(1)} credits`]:[]];return`\u25CF designed ${t} \u2014 ${n.join(" \xB7 ")}`}function Jn(e){return`\u25CF finished ${e.title?`"${e.title}"`:P(e.id??"")} \u2014 ${[G(e.durS),...e.credits!==void 0?[`${e.credits.toFixed(1)} credits`]:[]].join(" \xB7 ")}`}var I=e=>e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`,Ve=[{key:"changes",row:"updates",done:"updated",saving:"updates"},{key:"approves",row:"approves",done:"approved",saving:"approves"},{key:"archives",row:"archives",done:"archived",saving:"archives"},{key:"replaces",row:"replaces",done:"replaced",saving:"replaces"},{key:"removes",row:"removes",done:"removed",saving:"removes"}],Q=e=>Ve.filter(({key:t})=>j(e[t])),Je=e=>Q(e).length>0,ge=e=>e===1?"1 test":`${e} tests`,vt=e=>[...Q(e).map(({key:t,done:n})=>`${I(le(e[t]))} ${n}`),...e.keeps?[`${ge(e.keeps)} marked up to date`]:[]],qn=e=>[...Q(e).map(({key:t,saving:n})=>`saving it ${n} ${I(le(e[t]))}${t==="removes"?" from the project":""}`),...e.keeps?[`saving it marks ${ge(e.keeps)} up to date`]:[]],Kn=e=>[...vt(e),...N(e)>0?[Ye(N(e))]:[]],Yn=e=>ue.reduce((t,[n])=>t+(H.has(n)?0:e.changes?.[n]??0),0),Xn=e=>xe(e),bt=e=>F(e)!==""||j(e.changes)||j(e.approves)||j(e.archives),St="this session's work",Qn=e=>F(e)?"throw away what this session added":me(e)?"throw away this session's chat":"throw away this session's work",zn="already discarded \u2014 nothing was saved",Zn=e=>bt(e)?"your team can see it now":me(e)?Et:xt(e)?St:"",Et="this session's chat";function es(e,t){let n=t.removes;if(e==="extract"||!n||!((n.scenarios??0)>0||(n.tests??0)>0))return t;let o={...(n.scenarios??0)>0?{scenarios:n.scenarios}:{},...(n.tests??0)>0?{tests:n.tests}:{}},{scenarios:d,tests:a,...i}=n,{removes:s,...r}=t;return{...r,replaces:o,...j(i)?{removes:i}:{}}}function ts(e){let t=new Map;for(let n of e){if(n.kind!=="evolve_diff")continue;let o=n.payload??n.body;if(typeof o?.use_case!="string")continue;let d=o.repinned?.tests;typeof d=="number"&&d>0?t.set(o.use_case,d):t.delete(o.use_case)}return t}function ns(e,t){let n=[...t.values()].reduce((i,s)=>i+s,0);if(n===0)return e;let o=Math.max(0,(e.uncounted??0)-t.size),{uncounted:d,...a}=e;return{...a,keeps:n,...o>0?{uncounted:o}:{}}}var Tt=["changes","approves","archives","removes"],N=e=>e.heldChanges??0,j=e=>Object.values(e??{}).some(t=>(t??0)>0),qe=e=>!(e.adds??F(e))&&!Je(e)&&N(e)===0&&(e.keeps??0)===0,me=e=>qe(e)&&(e.chatTurns??0)>0&&(e.uncounted??0)===0,xt=e=>qe(e)&&!me(e);async function ss(e,t,n){let o=await e.counts(t,n),{proposes:d,heldChanges:a,chatTurns:i,uncounted:s}=o;return{...d,...a>0?{heldChanges:a}:{},...Object.fromEntries(Tt.flatMap(r=>j(o[r])?[[r,o[r]]]:[])),...i&&i>0?{chatTurns:i}:{},...typeof s=="number"?{exact:!0}:{},...typeof s=="number"&&s>0?{uncounted:s}:{}}}function Ke(e){return e===1?"1 change to an existing use-case":`${e} changes to existing use-cases`}function Ye(e){return`${Ke(e)}, saved but not applied`}var kt=e=>F(e)!==""||Je(e)||N(e)>0||(e.keeps??0)>0||(e.chatTurns??0)>0||(e.uncounted??0)>0,rs=(e,t)=>e.exact?kt(e):t;function os(e,t){let n=F(e),o=N(e),d=[];n&&d.push(["adds",n]);for(let{key:s,row:r}of Q(e))d.push([r,le(e[s]).join(", ")]);e.keeps&&d.push(["keeps",`${ge(e.keeps)}, marked up to date`]),o>0&&d.push(["held",Ye(o)]);let a=(e.chatTurns??0)>0;((e.uncounted??0)>0||!e.exact&&d.length===0&&!a)&&d.push(["other","work not counted here"]),a&&d.push(["chat","saved with the session; your team can read it"]),d.push(["project",t?"changed since this session started":"no changes since this session started"]);let i=s=>(s?.scenarios??0)+(s?.tests??0);return i(e)+i(e.changes)>0&&d.push(["then","its test cases are created or updated in Test Manager"]),d}function F(e){return X(e,Rt).map(([t,n,o])=>`${e[t]} ${e[t]===1?n:o}`).join(", ")}function is(e){let t=X(e);if(t.length!==1)return"your work is";let[n,o,d]=t[0];return e[n]===1?`your ${o} is`:`your ${e[n]} ${d} are`}function Ct(e,t=[]){return t.length>0?`start a new session from the latest project, adding this session's documents again; run:
|
|
4
4
|
${Xe(t)}`:`${e.startsWith("kane-cli design tests")?"to design it again from the latest project":"to start a new session from the latest project"}, run:
|
|
5
5
|
${e}`}var Xe=e=>`kane-cli context ingest ${e.map(Y).join(" ")}`;function as(e,t){return e.length>0?[...new Set(e)]:_t(t)}function _t(e){return[...new Set((e.uploads??[]).filter(t=>t.outcome==="created"&&t.filename).map(t=>t.filename))]}function It(e){let t=X(e);if(t.length!==1)return"its work";let[n,o,d]=t[0];return e[n]===1?`its ${o}`:`its ${e[n]} ${d}`}function ds(e){return e.replace(/\s*\([^()]*→[^()]*\)/g,"")}function cs(e,t,n){return`kane-cli ${e==="design"?"design tests":"context extract"} --resume ${t}${n?" --mode agent":""}`}var Me=e=>`updating kane-cli won't help \u2014 share this id with support: ${V(`refused_${e}`)}`,q="in a folder linked to a shared project",L="check the file, then run the command again",ie=e=>[`${e} has more inside it than kane-cli can read`,"save a smaller copy, or a PDF of it, then run the command again"],Pt={PDF_ENCRYPTED:e=>[`${e} is password-protected`,"remove the password, then run the command again"],PDF_NO_TEXT_LAYER:e=>[`${e} has no text to read; scanned PDFs aren't supported yet`,"use a PDF with text in it, then run the command again"],PDF_UNREADABLE:e=>[`${e} can't be read as a PDF`,L],DOCX_UNREADABLE:e=>[`${e} can't be read as a Word document`,L],DOCX_NOT_WORDPROCESSING:e=>[`${e} can't be read as a Word document`,L],DOCX_NO_TEXT:e=>[`${e} has no text to add`,L],DOCX_ENCRYPTED_OR_LEGACY:e=>[`${e} is password-protected or in the old Word format`,"save it as a .docx without a password, then run the command again"],DOCX_PART_TOO_LARGE:ie,DOCX_TOO_MANY_PARTS:ie,DOCX_BOMB:ie,SOURCE_ID_OWNED:e=>[`${e} can't become a version of that source: a source plugin reads it`,"add it under another id with --as <id>, then run the command again"]},Ot={changed_both_sides:"it was changed in Test Manager too; choose there which steps to keep",not_pushable:"its steps can't be changed from here; change them in Test Manager",archived:"it's archived in Test Manager; restore it there first",busy:"a test run is using it; wait until the run ends",not_accepted:"Test Manager has different steps for it; choose there which to keep"},O=e=>`${e} ${e===1?"test case":"test cases"}`,Fe={test_on_older_version:"it changed after its test was designed",test_unreadable:"its test can't be read",test_has_no_steps:"its test has no steps"},Qe=e=>ve.test(e)?e.toLowerCase():e,ze=e=>Object.hasOwn(Fe,e)?Fe[e]:void 0,Ze=e=>e.useCase&&ze(e.reason)!==void 0&&e.reason!=="test_unreadable"?Qe(e.useCase):null;function us(e){if(!e||e==="unread")return;let t=new Map([...e.wrote,...e.unchanged??[]].map(n=>[n.id.toLowerCase(),n.path]));for(let n of e.refused)n.file&&t.set(n.id.toLowerCase(),n.file);return n=>t.get(n.toLowerCase())}var de=e=>e.reason==="test_unreadable";function Nt(e,t){let n=ze(e.reason);if(n===void 0)return[{text:" it can't be sent to Test Manager yet",tone:"detail"}];if(e.reason==="test_unreadable"){let d=t?.(e.test);return[{text:` ${n}${d?`: ${pe(d)}`:""}`,tone:"detail"}]}let o=Ze(e);return o===null?[{text:` ${n}`,tone:"detail"}]:[{text:` ${n}; to design its tests again, run:`,tone:"detail"},{text:` kane-cli design tests --use-case ${o}`,tone:"detail",command:!0}]}var K=(e,t)=>t===void 0||typeof e.useCase!="string"||t.has(Qe(e.useCase));function At(e,t,n){let o=e===1,d=`to see ${o?"its use-case":"their use-cases"}, run: kane-cli context list --stale`,a=o?"1 scenario of another use-case":`${e} scenarios of other use-cases`;return n?[{text:` ${a} ${o?"isn't":"aren't"} in Test Manager either`,tone:"detail"},{text:` ${d}`,tone:"detail"}]:[{text:`${a} in ${y(t)} ${o?"isn't":"aren't"} in Test Manager`,tone:"detail"},{text:` ${d}`,tone:"detail"}]}var C="some test cases may not be there yet";function he(e,t){switch(e){case"TEST_MANAGER_TIMEOUT":return{why:`Test Manager took too long, so ${C}`,lead:`Test Manager took too long; ${C}`,next:"to finish them (nothing is saved twice), run:",remedy:!1,support:!1,agentCode:"TEST_MANAGER_TIMED_OUT"};case"FORGE_UNAVAILABLE":return{why:`Test Manager couldn't be reached, so ${C}`,lead:`Test Manager couldn't be reached; ${C}`,next:"to finish them (nothing is saved twice), run:",remedy:!1,support:!0,agentCode:"TEST_MANAGER_UNREACHABLE"};case"FORGE_REFUSED":return{why:`Test Manager refused your account, so ${C}`,lead:`Test Manager refused your account; ${C}`,next:"ask a Test Manager admin to grant your account access, then run:",remedy:!0,support:!1,agentCode:"PROJECT_NO_ACCESS"};case"PROJECT_NOT_MARKED":return{why:`assurance is now off for "${t}", so ${C}`,lead:`assurance is now off for "${t}"; ${C}`,next:"to try them again later (nothing is saved twice), run:",remedy:!0,support:!1,agentCode:"ASSURANCE_OFF"};default:return{why:"some test cases couldn't be created or updated in Test Manager",lead:"some test cases couldn't be created or updated in Test Manager",next:"to try them again (nothing is saved twice), run:",remedy:!1,support:!0,agentCode:"TEST_MANAGER_FAILED"}}}function ls(e,t,n,o,d){let a={receipt:null,summary:null,lines:[],support:!1};if(!e)return a;let{made:i,updated:s,waiting:r,error:l}=e,g=e.nextRun??[],c=e.notCovered??[],p=c.filter(b=>K(b,o)),u=c.length-p.length;if(i===0&&s===0&&r===0&&l===null&&g.length===0&&c.length===0)return a;let m=i>0&&s>0?`${O(i)} created and ${s} updated in Test Manager`:i>0?`${O(i)} created in Test Manager`:s>0?`${O(s)} updated in Test Manager`:null,w={text:` kane-cli context sessions save ${t}`,tone:"plain"},h=b=>b===1?"wasn't":"weren't",f=[];if(g.length>0){let b=g.length===1;f.push({text:`${O(g.length)} in Test Manager ${b?"updates on its":"update on their"} next kane-cli run:`,tone:"plain"});for(let A of g)f.push({text:` "${A.title}"`,tone:"detail"});(r>0||l!==null||c.length>0)&&f.push({text:"",tone:"plain"})}if(r>0){f.push({text:`warning: ${O(r)} in Test Manager ${h(r)} updated`,tone:"warning"});for(let b of e.waitingOn)f.push({text:` "${b.title}"`,tone:"detail"},{text:` ${Ot[b.reason]}`,tone:"detail"})}if(p.length>0){let b=p.length;f.push({text:`warning: ${b} ${b===1?"scenario wasn't":"scenarios weren't"} sent to Test Manager`,tone:"warning"});for(let A of p)f.push({text:` "${A.title}"`,tone:"detail"},...Nt(A,d))}u>0&&f.push(...At(u,n,p.length>0));let $=l===null?null:he(l.code,n);$&&f.push({text:`warning: the session was saved, but ${$.why}`,tone:"warning"});let S=$?$.remedy||r===0?$.next:"then, to finish them (nothing is saved twice), run:":r>0?`then, to update ${r===1?"it":"them"} (nothing is saved twice), run:`:null;S!==null&&f.push({text:`next: ${S}`,tone:"plain"},w);let E=[];if(m!==null&&E.push(m),r>0&&E.push(m!==null?`${r} ${h(r)} updated yet`:`${O(r)} in Test Manager ${h(r)} updated yet`),p.length>0){let b=p.length;E.push(`${E.length>0?b:`${b} ${b===1?"scenario":"scenarios"}`} ${b===1?"wasn't":"weren't"} sent to Test Manager`)}return $&&E.push(E.length>0?"some may not be there yet":$.lead),{receipt:m,summary:E.length>0?E.join("; "):null,...g.length>0?{nextRunSummary:`${O(g.length)} ${g.length===1?"updates on its":"update on their"} next kane-cli run`}:{},lines:f,support:($?.support??!1)||p.some(de)}}function gs(e,t,n,o){if(!e)return;let d=e.notCovered??[],a=[...new Set(d.flatMap(s=>{let r=K(s,n)?Ze(s):null;return r===null?[]:[r]}))],i=[...e.error!==null?[{cmd:`kane-cli context sessions save ${t} --mode agent`,why:"finishes the test cases that may not be there yet"}]:[],...a.map(s=>({cmd:`kane-cli design tests --use-case ${s} --force --mode agent`,why:"designs the use case's tests again, so its scenarios reach Test Manager"}))];return{total:e.total,created:e.made,updated:e.updated,already_there:e.linked,waiting:e.waiting,waiting_on:e.waitingOn.map(({scenario:s,title:r,reason:l})=>({scenario:s,title:r,reason:l})),next_run:(e.nextRun??[]).map(({scenario:s,title:r})=>({scenario:s,title:r})),...d.length>0?{not_covered:d.map(s=>{let r=de(s)?o?.(s.test):void 0;return{scenario:s.scenario,title:s.title,test:s.test,reason:s.reason,in_session:K(s,n),...r?{file:pe(r)}:{}}})}:{},...e.error!==null?{error:he(e.error.code,"").agentCode}:{},...d.some(s=>K(s,n)&&de(s))?{support_id:V("refused_TEST_UNREADABLE")}:{},...i.length>0?{next:i}:{}}}var Be=new Set(["duplicate","unwritable"]),et=e=>Be.has(e.kind)||e.kind==="import"&&e.via!==void 0&&Be.has(e.via),Ut=new Set(["unreadable","unresolved"]);function Dt(e,t){return!e||e.variables.length===0&&e.noStartPage.length===0?{}:{needed:{...e,tests:t},neededFacts:je(e,{tests:t})}}function Lt(e){if(!e||e.length===0)return{};let t=e.length===1?"1 test file here was replaced and won't run any more":`${e.length} test files here were replaced and won't run any more`;return{replacedHead:`\u2692 ${t}:`,replaced:e.map(n=>({file:ce(process.cwd(),n.file)||n.file,by:n.replacedBy.map(o=>wt(o))})),replacedSummary:t}}function jt(e){return e!=null&&e.error===null}var tt=(e,t)=>{if(!jt(t)||t.waitingOn.length>0)return[];let n=new Set((t.notCovered??[]).map(o=>o.test.toLowerCase()));return e.filter(o=>o.file&&!n.has(o.id.toLowerCase()))},pe=e=>M(ce(process.cwd(),e)||e);function ms(e,t,n,o={}){let d={text:` kane-cli context sessions save ${t}`,tone:"plain"};if(e==="unread")return{line:null,lines:[{text:"warning: the session was saved, but its test files couldn't be written here",tone:"warning"},{text:"next: to write them (nothing is saved twice), run:",tone:"plain"},d],support:!0,summary:"its test files aren't written here yet",kept:null,again:"all"};let a=e.wrote.length,i=e.refused.length,s=a+(e.unchanged?.length??0),r=s+i,l=e.saved?new Set(e.saved):null,g=l?e.wrote.filter(S=>!l.has(S.id)).length:0,c=S=>`${g} ${g===1?"test":"tests"} ${S?"it imports":"they import"}`,p=a===0?null:n||i===0&&s>a?`\u2692 wrote ${a===1?"1 test file that was":`${a} test files that were`} missing or out of date here`:i>0?`\u2692 wrote ${a} of the ${r} test files`:g>0?`\u2692 wrote ${a} test files, for ${a-g===1?`the saved test and ${c(!0)}`:`${a-g} saved tests and ${c(!1)}`}`:a===1?"\u2692 wrote 1 test file, for the saved test":`\u2692 wrote ${a} test files, one for each saved test`,u={...Lt(e.replaced),...Dt(e.needed,e.saved?.length??r)};if(i===0)return{line:p,lines:[],support:!1,summary:null,kept:null,again:0,...u};let w=[{text:`warning: ${i===r?`${i===1?"1 test file wasn't":`${i} test files weren't`} written`:`${i} of the ${r} test files ${i===1?"wasn't":"weren't"} written`}`,tone:"warning"}];for(let S of e.refused)w.push({text:S.title?` "${S.title}"`:" a test with no title",tone:"detail"},{text:` ${ee(S)}`,tone:"detail"});let h=e.refused.filter(et).length;h>0&&w.push({text:`next: then, to write ${h===1?"it":"them"} (nothing is saved twice), run:`,tone:"plain"},d);let f=e.refused.filter(S=>S.kind==="edited");if(f.length>0){let S=f.length===1,E=tt(f,o.testManager);if(E.length>0){w.push({text:E.length===1?"next: to send your edit to its test case in Test Manager, run:":"next: to send your edits to their test cases in Test Manager, run:",tone:"plain"});for(let A of E)w.push({text:` kane-cli testmd run ${pe(A.file)}`,tone:"plain"})}let b=`${E.length>0?"or, to":"next: to"} get the project's ${S?"version, move it":"versions, move them"} out of this folder`;h>0?w.push({text:`${b} and save again`,tone:"plain"}):w.push({text:`${b}, then run:`,tone:"plain"},d)}let $=i-f.length;return{line:p,lines:w,support:e.refused.some(S=>Ut.has(S.kind)),summary:s>0?`${s} of the ${r} test files written here`:$===0?null:f.length>0?`${$} of the ${r} test files ${$===1?"isn't":"aren't"} written here yet`:r===1?"its test file isn't written here yet":"its test files aren't written here yet",kept:f.length===0?null:f.length>1?`${f.length} test files here keep your edits`:r===1?"its test file here keeps your edit":"1 test file here keeps your edit",again:h,...u}}function hs(e,t,n){if(!e||!t||t.again===0)return null;let o=`write ${t.again===1?"the test file":"the test files"}`;return e.error!==null?he(e.error.code,n).remedy?null:`next: to finish them and ${o} (nothing is saved twice), run:`:e.waiting>0?`next: then, to update ${e.waiting===1?"the test case":"the test cases"} and ${o} (nothing is saved twice), run:`:null}function ps(e,t,n={}){let o=`kane-cli context sessions save ${t} --mode agent`;if(e==="unread")return{written:[],refused:[],error:"TEST_FILES_NOT_WRITTEN",next:[{cmd:o,why:"writes the test files here"}]};let d=e.refused.some(et),a=e.refused.filter(r=>r.kind==="edited"),i=a.length===0?"":a.length===1?", and the project's version of a kept file once it's moved out of its folder":", and the project's version of the kept files once they're moved out of their folder",s=[...d?[{cmd:o,why:`writes the test files not written here${i}`}]:[],...tt(a,n.testManager).map(r=>({cmd:`kane-cli testmd run ${M(r.file)} --agent`,why:"sends your edit to its test case in Test Manager"})),...a.length>0&&!d?[{cmd:o,why:"writes the project's version, once the file is moved out of its folder"}]:[]];return{written:e.wrote.map(r=>r.path),refused:e.refused.map(r=>({test:r.id,title:r.title,reason:ee(r),...r.kind==="edited"&&r.file?{file:r.file}:{}})),...e.replaced?.length?{replaced:e.replaced.map(r=>({test:r.test,file:r.file,replaced_by:r.replacedBy}))}:{},...e.needed?.variables.length?{variables_needed:{file:e.needed.file,variables:e.needed.variables}}:{},...e.needed?.noStartPage.length?{no_start_page:e.needed.noStartPage.map(r=>({test:r.test,...r.file?{file:r.file}:{}}))}:{},...s.length>0?{next:s}:{}}}var Mt={ac:"an acceptance criterion",scenario:"a scenario",test:"a test",gap:"an open question",source:"a source",stylenote:"a style note"},T=(e,t)=>e?`"${e}"`:P(t),Ge=(e,t,n)=>`${e} ${e===1?t:n}`,fs={trusted:"approved",derived:"proposed",archived:"archived"},ws={yes:"yes",source_changed:"no: its source changed",source_removed:"no: its source was removed",tests_out_of_date:"no: its tests are out of date",designed_from_changed:"no: what it was designed from changed",archived:"-"},ys={source_changed:"its source changed",source_removed:"its source was removed",tests_out_of_date:"changed after its tests were designed"},y=e=>e?`"${e}"`:"this session's project",_=(e,t)=>`kane-cli design tests --use-case ${e}${t}`,ae=e=>e?"its source's change was put off in an earlier review; to take it up":"to review its source's change",He=e=>e.split(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c as h,d as P}from"./chunk-SMXABALN.js";import{a as $}from"./chunk-HCBYKLMW.js";import{a as i,b as t,k as O}from"./chunk-33DWJV67.js";import{z as l}from"./chunk-
|
|
2
|
+
import{c as h,d as P}from"./chunk-SMXABALN.js";import{a as $}from"./chunk-HCBYKLMW.js";import{a as i,b as t,k as O}from"./chunk-33DWJV67.js";import{z as l}from"./chunk-FAMQ4DHU.js";import{e as y}from"./chunk-UR6MHSHU.js";var o=y($(),1);function L(a){let c=a.findIndex(m=>m.free);return c>=0?c:null}var v=60,A=100;function N({headline:a,ask:c=!1,rows:m,sel:u,focused:x,freeText:n=null,freeTextNote:d,sublines:B=[],gapAbove:p=!0,accent:s=l.assuranceAccent}){let{stdout:C}=O(),b=C?.columns??80,S=b<v,F=Math.min(b-1,A),f=e=>x&&u===e?(0,o.jsx)(t,{color:s,children:"\u276F"}):" ",T=c?`? ${a}`:a,g=Math.max(4,F-3),R=B.map((e,r)=>(0,o.jsx)(t,{color:l.dim,children:` ${e.length>g?`${e.slice(0,g-1)}\u2026`:e}`},`sub-${r}`)),k=0,w=m.map((e,r)=>e.free?n?(0,o.jsxs)(i,{flexDirection:"column",children:[(0,o.jsxs)(i,{children:[(0,o.jsxs)(t,{children:[(0,o.jsx)(t,{color:s,children:"\u276F"})," ",(0,o.jsx)(t,{color:l.dim,children:"\u270E "})]}),n.keysFromPanel?(0,o.jsx)(P,{value:n.value,placeholder:e.label}):(0,o.jsx)(h,{value:n.value,onChange:n.onChange,onSubmit:n.onSubmit,onCancel:n.onCancel,placeholder:e.label})]}),d?(0,o.jsx)(t,{color:l.muted,children:` ${d}`}):null]},e.key):(0,o.jsxs)(t,{children:[f(r)," ",(0,o.jsx)(t,{color:l.dim,children:`\u270E ${e.label}`})]},e.key):(k+=1,(0,o.jsxs)(t,{bold:x&&u===r,children:[f(r),` ${k}. ${e.label}`,e.detail?(0,o.jsx)(t,{color:l.dim,bold:!1,children:` \u2014 ${e.detail}`}):null]},e.key)));return S?(0,o.jsxs)(i,{marginTop:p?1:0,marginBottom:1,flexDirection:"column",children:[(0,o.jsx)(t,{bold:!0,color:s,children:T}),R,w]}):(0,o.jsxs)(i,{marginTop:p?1:0,marginBottom:1,flexDirection:"column",children:[(0,o.jsx)(t,{bold:!0,color:s,children:T}),R,(0,o.jsx)(t,{children:" "}),w]})}export{L as a,N as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as t}from"./chunk-
|
|
2
|
+
import{b as t}from"./chunk-FAMQ4DHU.js";import{join as i}from"path";function e(n=t){return i(n,"plugins")}function g(n,r=t){return i(e(r),n)}function c(n,r,o=t){return i(g(n,o),r)}function f(n,r=t){return i(g(n,r),"current")}function x(n,r=t){return i(g(n,r),"config.json")}function l(n,r=t){return i(g(n,r),".jobs")}function s(n=t){return i(n,"bin")}function h(n=t){return i(s(n),"hyperexecute")}export{e as a,g as b,c,f as d,x as e,l as f,s as g,h};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as B}from"./chunk-
|
|
2
|
+
import{a as B}from"./chunk-UICJ2KLJ.js";import{b as N,f as d}from"./chunk-LXCTV75T.js";import{a as g,b as E}from"./chunk-TAY7J5VS.js";import{b as F,f as U,g as v}from"./chunk-NVD2MXHQ.js";import{e as y,f as _}from"./chunk-VE4HLIGA.js";import{d as C,e as O,i as x}from"./chunk-XMPTFXPW.js";import{C as h,Ha as c,f as R,r as P,w as S}from"./chunk-H4TIVILC.js";import{a as w}from"./chunk-4C7WVQOD.js";async function I(e,r){let o=await r.project(e);return o===null?"no_access":o.marked?"marked":"unmarked"}var M=5e3;async function D(e,r=()=>!0){try{for(;;){if(!r())return{found:!1,failed:!0};let o=await e.next();if(o.done)return{found:!1};if(o.value.length>0)return{found:!0,rows:o.value}}}catch{return{found:!1,failed:!0}}}async function j(e,r={}){let o=await L(e,r.budgetMs??M);return o.state==="unknown"&&G(`shared projects weren't checked, so this folder goes on locally: ${o.reason}`),o}async function L(e,r){let o;try{o=await y()}catch(a){return a instanceof x?{state:"unknown",reason:"not signed in",signedOut:!0}:{state:"unknown",reason:"the credentials couldn't be read"}}let t,n=!1,s=new Promise(a=>{t=setTimeout(()=>{n=!0,a({state:"unknown",reason:`the project list took over ${r} ms`})},r)}),l=(async()=>{let a=R({url:e,basicAuth:o}).projects(),i=await D(a,()=>!n);return i.found?{state:"rolled_out",first:{rows:i.rows,more:a}}:i.failed?{state:"unknown",reason:"the project list couldn't be read"}:{state:"not_rolled_out"}})();try{return await Promise.race([l,s])}finally{clearTimeout(t)}}var G=g("remote-check");var T=e=>({code:e.code,message:e.message,...e.remedy?{remedy:e.remedy}:{}});async function A(e,r=_(e.latticeUrl)){let o;try{o=await I(e.projectId,r)}catch(t){if(t instanceof x)return T(t);if(t instanceof w&&t.retryable)return c.noConnection();if(t instanceof w&&t.status===401)return c.credentialsRejected();throw t}return o==="no_access"?c.noAccess(e.projectName):null}function H(e,r,o,t){if(e instanceof w){if(e.code==="SESSION_CLASH"&&t!==void 0&&h(e.extra.heldBy)!==null)return{...c.projectBusy({project:r.projectName,verb:t.verb==="evolve"?"design":t.verb,resume:o!==null,held:h(e.extra.heldBy),...t.useCase?{useCase:t.useCase}:{},...t.title!==void 0?{title:t.title}:{},...t.agent?{agent:!0}:{}}),exit:2};if(e.code==="MARK_REFUSED")return{...c.markRefused(r.projectName,r.onboarded===!0),exit:2};if(e.code==="PROJECT_NOT_MARKED")return{...c.assuranceOff(r.projectName),exit:2};if(e.retryable)return{...c.noConnectionAtStart(),exit:2};if(e.status===401)return{...c.credentialsRejected(),exit:2};if(e.code==="SESSION_ENDED")return{...$(e,o??""),exit:2};if(e.code==="NOT_FOUND"&&o!==null)return{...c.noSuchSession(o),exit:2};if(e.code==="FORMS_REFUSED")return{...J(e.extra)?c.versionCliOlder():c.versionServiceOlder(),exit:2}}else if(e instanceof B)return{...e.side==="cli_older"?c.versionCliOlder():c.versionServiceOlder(),exit:2};return{...c.openFailed(),exit:1}}function $(e,r){return e.extra.ended==="failed"?c.sessionFailed(r):c.sessionFinished(r)}function J(e){let r=typeof e.claimed=="number"?e.claimed:null;return r===null?!1:typeof e.oldestRead=="number"&&r<e.oldestRead?!0:typeof e.highestWriter=="number"&&e.highestWriter>r}async function fe(e,r,o,t={}){P({verb:e,mode:r?"agent":"interactive"});let n=await K(e,r,o,t);return n!==null&&"exit"in n&&await S(),n}async function K(e,r,o,t){let n=F(process.cwd()),s=e.split(" ").at(-1);if(t.project!==void 0||t.local===!0){let i=await W(n,e,s,r,{...t,...o!==void 0?{resume:o}:{}});if(i!=="undecided")return i}if(n.kind==="refuse")return{exit:d(n.refusal,s,r)};let l=n;if(n.kind==="pick"){if(o===void 0){if(!N.has(e)||!(!r&&C()&&t.onboard!==!1))return null;let u=await j(n.latticeUrl);if(u.state==="unknown"&&u.signedOut&&e==="context ingest"){let{signIn:m}=await import("./onboarding-NXGMV3VG.js");if(await m()!=="signed_in")return null;u=await j(n.latticeUrl)}if(u.state!=="rolled_out")return null;let{onboard:k}=await import("./onboarding-NXGMV3VG.js"),p=e==="context extract"?"context extract":"context ingest",f=await k(n,{first:u.first,verb:p});return"exit"in f?f:"local"in f?p==="context extract"&&f.made?{exit:0}:null:{choice:f.choice}}if((await j(n.latticeUrl)).state!=="rolled_out")return null;try{l=await V(n,o,await y())}catch(i){return i instanceof x?{exit:d(T(i),s,r)}:{exit:d(H(i,{kind:"remote",latticeUrl:n.latticeUrl,projectId:"",projectName:""},o),s,r)}}}if(l.kind!=="remote")return null;let a=await A(l);return a?{exit:d(a,s,r)}:{choice:l}}async function W(e,r,o,t,n){let[{decideFolderFlags:s},{personTms:l,workLocally:a}]=await Promise.all([import("./folder-flags-WV7UV3JG.js"),import("./onboarding-NXGMV3VG.js")]),i=await s(e,{...n,agent:t},{getProject:async m=>(await l()).getProject(m)});if(i.kind==="none")return"undecided";if(i.kind==="refuse")return{exit:d(i.refusal,o,t)};let u=r==="context extract"?"context extract":"context ingest";if(i.kind==="local"){let m=a(u,{print:!t});if(!m.made)return null;if(t){let b=O("ndjson","extract");if(b.event({type:"folder_local",gitignore:m.gitignore}),u==="context extract")return{exit:b.done(0)}}return u==="context extract"?{exit:0}:null}if(n.notBuilt)return{exit:d(n.notBuilt,o,t)};let k=e;try{v(process.cwd(),{projectId:i.projectId,projectName:i.projectName,writtenBy:"kane-cli"})}catch(m){return g("remote-check")(`the folder's link couldn't be written: ${E(m)}`),{exit:d(c.projectFileUnwritable(U(process.cwd())),o,t)}}let p={kind:"remote",latticeUrl:k.latticeUrl,projectId:i.projectId,projectName:i.projectName,onboarded:!0},f=await A(p);return f?{exit:d(f,o,t)}:{choice:p}}async function V(e,r,o,t){let n=R({url:e.latticeUrl,basicAuth:o,...t?{fetch:t}:{}}),s=await n.getSession(r),l="";for await(let a of n.projects()){let i=a.find(u=>u.projectId===s.projectId);if(i){l=i.name;break}}return{kind:"remote",latticeUrl:e.latticeUrl,projectId:s.projectId,projectName:l}}export{A as a,H as b,$ as c,fe as d,V as e};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{S as G,T as I,U as O,V as _}from"./chunk-
|
|
2
|
+
import{S as G,T as I,U as O,V as _}from"./chunk-45NM23EQ.js";import{a as S}from"./chunk-HVOXMCKE.js";import{a as u}from"./chunk-73Y6T2UK.js";import{Ia as N}from"./chunk-PI7OXS62.js";import{existsSync as M}from"fs";var q=new Set(["interactive","agent","ci","override"]);function B(t){return t.mode!=null&&!q.has(t.mode)?{error:`design: --mode must be interactive | agent | ci | override, got '${t.mode}'`}:t.strength!=null&&t.strength!=="pairwise"&&t.strength!=="3-wise"?{error:`design: --strength must be pairwise | 3-wise, got '${t.strength}'`}:t.max!=null&&(!Number.isInteger(t.max)||t.max<1)?{error:"design: --max must be a positive integer"}:!t.useCase&&!t.resume?{error:"design: --use-case is required (or --resume <sid> \u2014 the session remembers its use-case)"}:{useCase:t.useCase,max:t.max,strength:t.strength,mode:t.mode,force:t.force,resume:t.resume,plan:t.plan,message:t.message,phase:t.phase,allowUnreviewed:t.allowUnreviewed,because:t.because,changeDelta:t.changeDelta,priorDesign:t.priorDesign,...t.repinsKept?{repinsKept:!0}:{},statement:t.statement}}async function Z(t){let p=async(e,r)=>{if(t.mode!=="agent")return process.stderr.write(e+`
|
|
3
3
|
`),2;let{makeHeadlessIO:i,agentRefusal:d}=await import("./headless-io-FFM5T6KL.js");return d(i("ndjson","design"),e,r)};if(t.mode!=null&&!["interactive","agent","ci","override"].includes(t.mode)){let{makeHeadlessIO:e,agentRefusal:r}=await import("./headless-io-FFM5T6KL.js");return r(e("ndjson","design"),`design: --mode must be interactive | agent | ci | override, got '${t.mode}'`,"MODE_USAGE")}let l=t.json===!0;{let{jsonModeRefusal:e}=await import("./headless-io-FFM5T6KL.js"),r=e("design",t.mode,l);if(r!==null)return process.stderr.write(`${r}
|
|
4
|
-
`),2}let h=B(t);if("error"in h)return p(h.error);let s=h;if(s.useCase?.startsWith("sha256:"))try{let[{openGraph:e},{expandUseCaseRef:r}]=await Promise.all([import("./readmodel-
|
|
5
|
-
next: ${e.remedy}`,e.code);let{makeHeadlessIO:r}=await import("./headless-io-FFM5T6KL.js"),i=r("ndjson","design");return i.event(_(e)),i.done(2,"refused")}}if(s.useCase&&!t.allowUnreviewed)try{let[{openGraph:e},{consentCanStart:r,designEntryGate:i},{peekSession:d}]=await Promise.all([import("./readmodel-
|
|
4
|
+
`),2}let h=B(t);if("error"in h)return p(h.error);let s=h;if(s.useCase?.startsWith("sha256:"))try{let[{openGraph:e},{expandUseCaseRef:r}]=await Promise.all([import("./readmodel-TRV4E3MW.js"),import("./use-case-ref-44BPIP4N.js")]);s.useCase=r(e(u(process.cwd())),s.useCase)}catch{}{let{validateResumeMessage:e}=await import("./headless-io-FFM5T6KL.js"),r=e(s,"design");if(r)return p(r)}{let{gateStructuredFlags:e}=await import("./structured-answers-EQ2AP3F7.js"),r=e(t,"design");if(r)return p(r,"STRUCTURED_FLAGS_USAGE")}if(!M(u(process.cwd())))return p("error: no context store here (run `kane-cli context ingest` + `kane-cli context extract` first)","NO_STORE");{let e=O(u(process.cwd()));if(e){if(t.mode!=="agent")return p(`error: ${e.text}
|
|
5
|
+
next: ${e.remedy}`,e.code);let{makeHeadlessIO:r}=await import("./headless-io-FFM5T6KL.js"),i=r("ndjson","design");return i.event(_(e)),i.done(2,"refused")}}if(s.useCase&&!t.allowUnreviewed)try{let[{openGraph:e},{consentCanStart:r,designEntryGate:i},{peekSession:d}]=await Promise.all([import("./readmodel-TRV4E3MW.js"),import("./trust-gate-674C2NZS.js"),import("./sessions-NH2EG7BP.js")]),y;try{y=s.resume?d(u(process.cwd()),s.resume)?.use_case:void 0}catch{y=void 0}let o=i(e(u(process.cwd())),{useCase:s.useCase,resuming:!!s.resume,sessionUseCase:y});if(o){let b=r(o),T=s.mode??"interactive";if(b&&T==="interactive"&&process.stdin.isTTY&&process.stdout.isTTY){let{createInterface:x}=await import("readline/promises"),m=x({input:process.stdin,output:process.stderr}),g=(await m.question(`design: ${o.detail}
|
|
6
6
|
Design against it anyway? (y/N) `)).trim().toLowerCase();if(m.close(),g!=="y"&&g!=="yes")return process.stderr.write(`aborted \u2014 approve it first: ${o.reviewCmd}
|
|
7
7
|
`),2;s.allowUnreviewed=!0}else if(t.mode==="agent"){let{makeHeadlessIO:x}=await import("./headless-io-FFM5T6KL.js"),m=x("ndjson","design");m.event({type:"error",code:o.code,message:`design: ${o.detail}`,next:[o.reviewCmd]});let g=`kane-cli design tests --use-case ${s.useCase} --mode agent --allow-unreviewed`;return m.event({type:"done",status:"refused",exit_code:2,next:b?[o.reviewCmd,g]:[o.reviewCmd]}),2}else return process.stderr.write(`design: ${o.detail} (${o.reviewCmd})
|
|
8
8
|
`),2}}catch(e){process.env.KANE_DEBUG&&process.stderr.write(`trust gate skipped: ${String(e)}
|
|
9
9
|
`)}let n=null,f=null;try{if(!s.mode&&!process.stdin.isTTY)return process.stderr.write(`design: no TTY \u2014 pass an explicit --mode agent|ci|override to run headless
|
|
10
10
|
`),2;let e=s.mode??"interactive";if(e==="interactive"){if(!process.stdin.isTTY||!process.stdout.isTTY)return process.stderr.write(`design: --mode interactive needs a TTY on stdin and stdout (use --mode agent|ci|override headless)
|
|
11
|
-
`),2;let{bindDesignInteractive:a}=await import("./interactive-bind-
|
|
11
|
+
`),2;let{bindDesignInteractive:a}=await import("./interactive-bind-FDWJUTI6.js");return await a(s)}let{runAgent:r}=await import("./bridge-2UHJOVLX.js"),{makeInterruptGuard:i}=await import("./interrupt-guard-QETBPINI.js"),{baseUrlAdvisory:d}=await import("./turn-preflight-R4PU6NYY.js"),{makeHeadlessIO:y,resolveEncoding:o,guardedChannels:b}=await import("./headless-io-FFM5T6KL.js"),{withStructuredNext:T,prepareStructuredResume:x}=await import("./structured-answers-EQ2AP3F7.js");n=T(y(o(e,l),"design"));let m=await G(u(process.cwd()));m&&(o(e,l)==="ndjson"?n.event(I(m)):n.progress(m.text));let g=n,k=a=>{g.out(a),g.event({type:"note",text:a})},{telemetryBootstrap:Y,telemetryEnvName:H}=await import("./bootstrap-JEVSVPQ2.js"),v=Y({verb:"design",mode:e,contextRoot:u(process.cwd()),env:H(),resumeSid:s.resume,write:!0,longSession:!0});f=a=>v.end(a);let c=x({opts:t,reader:S(u(process.cwd())).sessions(),verb:"design"});if(c.kind==="refuse")return n.out(c.error),e==="agent"&&n.event({type:"error",message:c.error,code:c.code}),await v.end({exit_code:2}),e==="agent"?n.done(2,"refused"):2;let D;if(c.kind==="apply"){for(let a of c.notes)k(a);if(c.matchedQids.length>0){k(`applying ${c.matchedQids.length} structured answer(s) from --answer to the paused session's pending questions`);for(let a of c.matchedQids)n.event({type:"panel_resolved",id:a,by:"user",via:"flag"})}c.statement&&(D=[s.message,c.statement].filter(Boolean).join(`
|
|
12
12
|
|
|
13
|
-
`))}let R=d();R&&k(R);let C=i(r,a=>n.out(a)),j=b(n,()=>C.interrupted(),/^error: (design agent failed|the design agent ended)/);try{let a=e==="interactive"&&process.stdin.isTTY&&process.stdout.isTTY?async E=>{let{createInterface:L}=await import("readline/promises"),A=L({input:process.stdin,output:process.stdout});try{return/^y(es)?$/i.test((await A.question(`${E} [y/N] `)).trim())}finally{A.close()}}:void 0,{headlessDesign:P}=await import("./design-headless-
|
|
13
|
+
`))}let R=d();R&&k(R);let C=i(r,a=>n.out(a)),j=b(n,()=>C.interrupted(),/^error: (design agent failed|the design agent ended)/);try{let a=e==="interactive"&&process.stdin.isTTY&&process.stdout.isTTY?async E=>{let{createInterface:L}=await import("readline/promises"),A=L({input:process.stdin,output:process.stdout});try{return/^y(es)?$/i.test((await A.question(`${E} [y/N] `)).trim())}finally{A.close()}}:void 0,{headlessDesign:P}=await import("./design-headless-KIP6R7UV.js"),{localSite:K}=await import("./store-site-K5NHLI7D.js"),$=u(process.cwd()),w=await P({...s,mode:e,...D!==void 0?{message:D}:{},...a?{confirmRetarget:a}:{}},K($,S($)),{out:j.out,emit:E=>{t.onEvent?.(E),j.emit(E)},progress:g.progress,channel:o(e,l)==="ndjson"},{agent:C.agent,telemetry:v});if(C.interrupted()&&w!==3)return n.out("interrupted \u2014 no session saved"),await v.end({exit_code:130}),n.done(130);if(w===1&&n.out(v.supportFooter()),await v.end({exit_code:w}),w!==0)return n.done(w);let U=await z($,s.useCase,s.resume);return U.length>0?n.done(w,void 0,U):n.done(w)}finally{C.dispose()}}catch(e){if(e instanceof N)return f&&await f({exit_code:2}).catch(()=>{}),n?(n.event(_({code:e.code,text:e.message,remedy:e.remedy})),n.done(2,"refused")):(process.stderr.write(`error: ${e.message}
|
|
14
14
|
next: ${e.remedy}
|
|
15
15
|
`),2);f&&await f({exit_code:1}).catch(()=>{});let r=e instanceof Error?e.message:String(e);n?.event({type:"error",message:`error: design failed: ${r}`});let i=n?d=>n.out(d):d=>process.stderr.write(d+`
|
|
16
|
-
`);return i(`error: design failed: ${r}`),(process.env.ASSURANCE_LOG_LEVEL??"").toLowerCase()==="debug"&&e instanceof Error&&e.stack&&i(e.stack),i('hint: the full trace is in the file named on the "trace:" line at the start of this run'),n?n.done(1):1}}async function z(t,p,l){try{let[{openGraph:h},{peekSession:s},{awaitingOfUseCase:n},{shellArg:f}]=await Promise.all([import("./readmodel-
|
|
16
|
+
`);return i(`error: design failed: ${r}`),(process.env.ASSURANCE_LOG_LEVEL??"").toLowerCase()==="debug"&&e instanceof Error&&e.stack&&i(e.stack),i('hint: the full trace is in the file named on the "trace:" line at the start of this run'),n?n.done(1):1}}async function z(t,p,l){try{let[{openGraph:h},{peekSession:s},{awaitingOfUseCase:n},{shellArg:f}]=await Promise.all([import("./readmodel-TRV4E3MW.js"),import("./sessions-NH2EG7BP.js"),import("./stream-warnings-GM7YEOVG.js"),import("./shell-arg-FN3MT5U7.js")]),e=p??(l?s(t,l)?.use_case:void 0);if(!e)return[];let r=h(t);return[...n(r,e)].map(([i,d])=>({cmd:`kane-cli context review --approve ${f(r.displayNameOf(i)??i.slice(0,19))} --mode agent`,why:`approves the criterion ${d.size===1?"1 test checks":`${d.size} tests check`}`}))}catch{return[]}}export{B as a,Z as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as ne}from"./chunk-WMGKUERB.js";import{a as y,b as ie,c as oe,d as le,e as ae}from"./chunk-
|
|
2
|
+
import{b as ne}from"./chunk-WMGKUERB.js";import{a as y,b as ie,c as oe,d as le,e as ae}from"./chunk-UWPG5MWM.js";import{a as F,b as x,c as D,d as ee,f as re,h as de,i as pe}from"./chunk-GJXO6FF7.js";import{a as se,d as te}from"./chunk-ZCIWQHCO.js";import{a as X,c as Y,d as Z}from"./chunk-CQDCNP7V.js";import{Ba as B,Ea as v,Ja as Q,Pa as w,Va as U,Xa as $,Ya as O,Za as b,_a as G,ab as J,fb as H,i as _,jb as z,kb as W,mb as R,nb as K,ob as T,t as I}from"./chunk-PI7OXS62.js";import{a as C}from"./chunk-YJAQZMJT.js";import{existsSync as Se,readFileSync as Ee}from"fs";import{join as Me}from"path";import{mkdirSync as be,readFileSync as Re,renameSync as Fe,writeFileSync as Ae}from"fs";import{dirname as A,join as M}from"path";function E(r,o){be(A(r),{recursive:!0});let s=M(A(r),`.${process.pid}.tmp`);Ae(s,o),Fe(s,r)}function ue(r){try{return JSON.parse(Re(r,"utf8"))}catch{return null}}function ce(r){let o=s=>M(A(y(r,s)),"verdicts.json");return{read:s=>ue(y(r,s)),write:(s,i)=>E(y(r,s),JSON.stringify(i,null,2)+`
|
|
3
3
|
`),writeReview:(s,i)=>E(M(A(y(r,s)),"review.json"),JSON.stringify(i,null,2)+`
|
|
4
4
|
`),verdicts:s=>ue(o(s))??{verdicts:{}},saveVerdicts:(s,i)=>E(o(s),JSON.stringify(i,null,2)+`
|
|
5
5
|
`)}}import{appendFileSync as fe,closeSync as qe,existsSync as V,openSync as Pe,readdirSync as Oe,readFileSync as ge,renameSync as Te,writeFileSync as he}from"fs";import{join as q}from"path";var me=".pending-facts.bad";function ye(r){let o=q(r,ie);return{quarantinePath:q(r,me),park:(s,i)=>{let l=null;try{l=w(r,{deadlineMs:i.deadlineMs})}catch{l=null}try{if(l)return fe(o,s+`
|
|
@@ -1,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-P4VFC6HO.js";import{c as L}from"./chunk-RFHMDQXZ.js";import{n as P,o as R}from"./chunk-UJLULWSR.js";import{a as y}from"./chunk-HCBYKLMW.js";import{a as E,b as o,i as h}from"./chunk-33DWJV67.js";import{a as B}from"./chunk-6YGTRKDT.js";import{z as s}from"./chunk-FAMQ4DHU.js";import{e as d}from"./chunk-UR6MHSHU.js";var n=d(B(),1);import{basename as D}from"path";var r=d(y(),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&&(R(U),await e.close())},v=()=>{u.current||(u.current=!0,V())};return h((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,P(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)(E,{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,6 +1,6 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as U,e as F}from"./chunk-4JOD47QI.js";import{d as W}from"./chunk-GMTHZUZ3.js";import{a as H}from"./chunk-
|
|
3
|
-
`));this.deviceClass=s;this.name="DepsInstallRequiredError"}};function _(i){return i>=1024*1024?`${Math.ceil(i/(1024*1024))} MB`:`${i} bytes`}function at(i){let t=i/1048576;return t>=10?`${Math.round(t)} MB/s`:t>=1?`${t.toFixed(1)} MB/s`:`${Math.max(1,Math.round(i/1024))} KB/s`}function lt(i){let t=Math.max(1,Math.round(i));return t<60?`~${t}s left`:`~${Math.floor(t/60)}m ${t%60}s left`}var K=8*1024*1024,ct=8;function ut(i){if(!Number.isFinite(i)||i<2*K)return null;let t=Math.min(ct,Math.floor(i/K)),s=Math.ceil(i/t),e=[];for(let n=0;n<i;n+=s)e.push({start:n,end:Math.min(n+s,i)-1});return e}async function L(i,t){let s=i.body;if(!s||typeof s.getReader!="function"){let c=new Uint8Array(await i.arrayBuffer());return t?.(c.length),c}let e=s.getReader(),n=[],r=0;for(;;){let{done:c,value:h}=await e.read();if(c)break;h&&(n.push(h),r+=h.length,t?.(h.length))}let o=new Uint8Array(r),a=0;for(let c of n)o.set(c,a),a+=c.length;return o}var z=3,dt=3e4,k=class extends Error{};async function pt(i,t,s,e,n,r=dt){let o=new Uint8Array(s),a=0,c=new AbortController,h=null,b=!1;try{await Promise.all(e.map(async(f,M)=>{let P=0,V=d=>{P+=d,a+=d,n?.(a)},T=()=>{a=Math.max(0,a-P),P=0},R=null;for(let d=0;d<z;d+=1){if(c.signal.aborted)return;let u=new AbortController,m=()=>u.abort();c.signal.addEventListener("abort",m,{once:!0});let w=!1,g=null,$=()=>{g&&clearTimeout(g),g=setTimeout(()=>{w=!0,u.abort()},r)};try{$();let p=await i(t,{headers:{Range:`bytes=${f.start}-${f.end}`},signal:u.signal});if(typeof p.body?.getReader!="function"&&g&&(clearTimeout(g),g=null),!p.ok)throw new k(`Could not download ${t}: HTTP ${p.status}`);if(p.status!==206){b=!0,M===0?h=await L(p,I=>{$(),V(I)}):await(p.body?.cancel().catch(()=>{})??Promise.resolve());return}let D=f.end-f.start+1,E=await L(p,I=>{$(),V(I)});if(E.length!==D)throw new Error(`range ${f.start}-${f.end} returned ${E.length} bytes (expected ${D})`);o.set(E,f.start);return}catch(p){if(p instanceof k)throw p;if(c.signal.aborted)return;T(),R=w?new Error(`no data for ${Math.round(r/1e3)}s`):p instanceof Error?p:new Error(String(p))}finally{g&&clearTimeout(g),c.signal.removeEventListener("abort",m)}}throw new Error(`Could not download ${t}: range ${f.start}-${f.end} failed after ${z} attempts (${R?.message??"unknown error"}) \u2014 check your network and rerun \`kane-cli doctor --target <emulator|simulator> --install\`.`)}))}catch(f){throw c.abort(),f}return h||(b?null:o)}async function ht(i,t,s,e,n){let r=ut(s);if(r){let c=await pt(i,t,s,r,e,n?.stallMs);if(c)return c}let o=await i(t);if(!o.ok)throw new Error(`Could not download ${t}: HTTP ${o.status}`);let a=0;return L(o,e&&(c=>{a+=c,e(a)}))}function ft(i){return Y("sha256").update(i).digest("hex")}function mt(i,t){let s=X(i,t);return s!==""&&!s.startsWith(`..${it}`)&&s!==".."&&!nt(s)}async function A(i){try{return await Q(i),!0}catch{return!1}}function wt(){return{home:tt(),os:st,arch:et,cliVersion:H,nodeModuleVersion:process.versions.modules,fetch,resolveBundle:async i=>(await import("./deps-resolve-
|
|
2
|
+
import{d as U,e as F}from"./chunk-4JOD47QI.js";import{d as W}from"./chunk-GMTHZUZ3.js";import{a as H}from"./chunk-FAMQ4DHU.js";import{createHash as Y}from"crypto";import{access as Q,mkdir as S,mkdtemp as Z,readdir as O,readFile as y,rename as N,rm as v,writeFile as x}from"fs/promises";import{homedir as tt}from"os";import{arch as et,platform as st}from"process";import{dirname as C,isAbsolute as nt,join as l,relative as X,resolve as rt,sep as it}from"path";var q=1,ot={emulator:"emulator",simulator:"simulator"};function Pt(i){return ot[i.kind]??null}var j=class extends Error{constructor(s,e,n){super([`Managed mobile dependencies for ${s} are not installed.`,`- kaneai-mobile-deps ${s} ${e.bundleVersion}: ${e.url} (${_(e.bytes)})`,`Destination: ${n}`,`Run \`kane-cli doctor --target ${s} --install\` to download it.`].join(`
|
|
3
|
+
`));this.deviceClass=s;this.name="DepsInstallRequiredError"}};function _(i){return i>=1024*1024?`${Math.ceil(i/(1024*1024))} MB`:`${i} bytes`}function at(i){let t=i/1048576;return t>=10?`${Math.round(t)} MB/s`:t>=1?`${t.toFixed(1)} MB/s`:`${Math.max(1,Math.round(i/1024))} KB/s`}function lt(i){let t=Math.max(1,Math.round(i));return t<60?`~${t}s left`:`~${Math.floor(t/60)}m ${t%60}s left`}var K=8*1024*1024,ct=8;function ut(i){if(!Number.isFinite(i)||i<2*K)return null;let t=Math.min(ct,Math.floor(i/K)),s=Math.ceil(i/t),e=[];for(let n=0;n<i;n+=s)e.push({start:n,end:Math.min(n+s,i)-1});return e}async function L(i,t){let s=i.body;if(!s||typeof s.getReader!="function"){let c=new Uint8Array(await i.arrayBuffer());return t?.(c.length),c}let e=s.getReader(),n=[],r=0;for(;;){let{done:c,value:h}=await e.read();if(c)break;h&&(n.push(h),r+=h.length,t?.(h.length))}let o=new Uint8Array(r),a=0;for(let c of n)o.set(c,a),a+=c.length;return o}var z=3,dt=3e4,k=class extends Error{};async function pt(i,t,s,e,n,r=dt){let o=new Uint8Array(s),a=0,c=new AbortController,h=null,b=!1;try{await Promise.all(e.map(async(f,M)=>{let P=0,V=d=>{P+=d,a+=d,n?.(a)},T=()=>{a=Math.max(0,a-P),P=0},R=null;for(let d=0;d<z;d+=1){if(c.signal.aborted)return;let u=new AbortController,m=()=>u.abort();c.signal.addEventListener("abort",m,{once:!0});let w=!1,g=null,$=()=>{g&&clearTimeout(g),g=setTimeout(()=>{w=!0,u.abort()},r)};try{$();let p=await i(t,{headers:{Range:`bytes=${f.start}-${f.end}`},signal:u.signal});if(typeof p.body?.getReader!="function"&&g&&(clearTimeout(g),g=null),!p.ok)throw new k(`Could not download ${t}: HTTP ${p.status}`);if(p.status!==206){b=!0,M===0?h=await L(p,I=>{$(),V(I)}):await(p.body?.cancel().catch(()=>{})??Promise.resolve());return}let D=f.end-f.start+1,E=await L(p,I=>{$(),V(I)});if(E.length!==D)throw new Error(`range ${f.start}-${f.end} returned ${E.length} bytes (expected ${D})`);o.set(E,f.start);return}catch(p){if(p instanceof k)throw p;if(c.signal.aborted)return;T(),R=w?new Error(`no data for ${Math.round(r/1e3)}s`):p instanceof Error?p:new Error(String(p))}finally{g&&clearTimeout(g),c.signal.removeEventListener("abort",m)}}throw new Error(`Could not download ${t}: range ${f.start}-${f.end} failed after ${z} attempts (${R?.message??"unknown error"}) \u2014 check your network and rerun \`kane-cli doctor --target <emulator|simulator> --install\`.`)}))}catch(f){throw c.abort(),f}return h||(b?null:o)}async function ht(i,t,s,e,n){let r=ut(s);if(r){let c=await pt(i,t,s,r,e,n?.stallMs);if(c)return c}let o=await i(t);if(!o.ok)throw new Error(`Could not download ${t}: HTTP ${o.status}`);let a=0;return L(o,e&&(c=>{a+=c,e(a)}))}function ft(i){return Y("sha256").update(i).digest("hex")}function mt(i,t){let s=X(i,t);return s!==""&&!s.startsWith(`..${it}`)&&s!==".."&&!nt(s)}async function A(i){try{return await Q(i),!0}catch{return!1}}function wt(){return{home:tt(),os:st,arch:et,cliVersion:H,nodeModuleVersion:process.versions.modules,fetch,resolveBundle:async i=>(await import("./deps-resolve-DSAKPZ3T.js")).controllerResolveBundle()(i),exec:U,now:()=>new Date,wait:F,processAlive:i=>{try{return process.kill(i,0),!0}catch{return!1}}}}var B=class extends Error{constructor(s,e,n){super(`No managed mobile dependencies are published for ${s} (kane-cli ${e}).
|
|
4
4
|
This is a packaging gap, not something to install locally \u2014 report it, or pass --appium-url to use an Appium server you manage yourself.`);this.coordinate=s;this.cause=n;this.name="NoPublishedBundleError"}},J=class i{deps;constructor(t={}){this.deps={...wt(),...t}}mobileRoot(){return l(this.deps.home,".testmuai","kaneai","mobile")}depsRoot(){return l(this.mobileRoot(),"deps")}classRoot(t,s){return l(this.depsRoot(),s,t)}resolveCacheFile(){return l(this.depsRoot(),"resolve-cache.json")}resolveCacheKey(t){return`${this.deps.cliVersion}|${this.deps.os}-${this.deps.arch}-${t}`}static RESOLVE_CACHE_TTL_MS=1440*60*1e3;async readCachedWantedVersion(t){try{let e=JSON.parse(await y(this.resolveCacheFile(),"utf8"))[this.resolveCacheKey(t)];if(!e?.bundleVersion||!e.fetchedAt)return null;let n=this.deps.now().getTime()-new Date(e.fetchedAt).getTime();return n>=0&&n<i.RESOLVE_CACHE_TTL_MS?e.bundleVersion:null}catch{return null}}async writeResolveCache(t,s){try{let e={};try{e=JSON.parse(await y(this.resolveCacheFile(),"utf8"))}catch{}e[this.resolveCacheKey(t)]={bundleVersion:s,fetchedAt:this.deps.now().toISOString()},await S(this.depsRoot(),{recursive:!0}),await x(this.resolveCacheFile(),`${JSON.stringify(e,null,2)}
|
|
5
5
|
`)}catch{}}async warmResolveCache(t){if(await this.readCachedWantedVersion(t)===null)try{await this.resolveOrExplain(t)}catch{}}paths(t,s){let e=this.classRoot(t,s);return{root:e,appium:l(e,"appium"),appiumHome:l(e,"appium-home"),platformTools:l(e,"platform-tools"),wdaDir:l(e,"wda","Build","Products","Debug-iphonesimulator"),iwdpBinDir:l(e,"bin"),installManifest:l(e,"install-manifest.json")}}async status(t,s){s||(s=await this.readCachedWantedVersion(t)??void 0);let e=[];try{e=await O(this.depsRoot())}catch{}s&&(e=e.filter(c=>c===s));let n=null;for(let c of e){let h=this.classRoot(t,c),b=null;try{b=JSON.parse(await y(l(h,"install-manifest.json"),"utf8"))}catch{continue}b.schemaVersion===q&&(!s&&b.cliVersion!==this.deps.cliVersion||(!n||b.installedAt>n.manifest.installedAt)&&(n={manifest:b,root:h}))}if(!n)return{class:t,installed:!1};let r=this.paths(t,n.manifest.bundleVersion),o=[l(r.appium,"node_modules","appium","index.js")];t==="emulator"&&o.push(l(r.platformTools,this.deps.os==="win32"?"adb.exe":"adb")),t==="simulator"&&o.push(l(r.wdaDir,"WebDriverAgentRunner-Runner.app"));for(let c of o)if(!await A(c))return{class:t,installed:!1,version:n.manifest.bundleVersion,root:n.root,corrupt:`a bundle component is missing from disk (${X(n.root,c)})`};let a=await this.postInstallDrifted(r);return{class:t,installed:!0,version:n.manifest.bundleVersion,root:n.root,...a?{needsRepair:a}:{}}}async postInstallDrifted(t){let s=l(t.appiumHome,"node_modules",".cache","appium","extensions.yaml");if(!await A(s))return!1;let e=await y(s,"utf8");for(let n of e.split(`
|
|
6
6
|
`)){let r=/^\s*installPath:\s*(.+?)\s*$/.exec(n);if(r&&!r[1].startsWith(t.appiumHome))return!0}return!1}async environment(t){let s=await this.status(t);if(!s.installed||!s.version)return{dirs:[]};let e=this.paths(t,s.version),n=[],r={dirs:n,appiumHome:e.appiumHome};return t!=="simulator"&&(n.push(e.platformTools),r.platformToolsDir=e.platformTools),n.push(l(e.appium,"node_modules",".bin")),t==="simulator"&&(n.push(e.iwdpBinDir),r.wdaDir=e.wdaDir,r.wdaRoot=l(e.root,"wda"),r.iwdpBinDir=e.iwdpBinDir),r}async ensure(t,s){let e,n;try{e=await this.resolveOrExplain(t)}catch(a){n=a}let r=await this.status(t,e?.bundleVersion);if(r.installed&&!r.needsRepair)return e&&r.version&&await this.adoptInstall(t,r.version),r;if(!e)throw n;if(r.installed&&r.needsRepair&&r.version){let a=this.paths(t,r.version);return await this.withInstallLock(async()=>{await this.postInstall(a.root,a,s.onProgress)}),await this.adoptInstall(t,r.version),this.status(t,e.bundleVersion)}let o=e;if(!s.automatic&&!s.approved)throw new j(t,o,this.classRoot(t,o.bundleVersion));return await this.withInstallLock(async()=>{(await this.status(t,o.bundleVersion)).installed||await this.install(t,o,s.onProgress)}),this.status(t,o.bundleVersion)}async adoptInstall(t,s){try{let e=this.paths(t,s).installManifest,n=JSON.parse(await y(e,"utf8"));if(n.cliVersion===this.deps.cliVersion)return;n.cliVersion=this.deps.cliVersion;let r=l(C(e),`install-manifest-${process.pid}.json`);await x(r,`${JSON.stringify(n,null,2)}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
function l(e){return{command:(t,n)=>e.commands[t](n),text:(t,n)=>e.texts[t](n)}}function
|
|
3
|
-
hint: check the network connection and the sign-in`,"note.assurance_unsupported":()=>"error: this environment does not support assurance sessions yet (404) \u2014 contact support if the problem persists","note.credentials_rejected":({env:e})=>`error: your credentials were rejected (401) \u2014 sign in again (active environment: ${e})`,"note.key_recycled":({source_id:e,what:t})=>`source '${e}' was ingested from a different ${t} that used this key \u2014 the key was recycled; ${g}`,"note.kind_taken":({source_id:e,backing:t,kind:n})=>`source '${e}' is already backed by ${t}, not ${n} \u2014 ${g}`,"note.site_moved":({source_id:e,previous:t,site:n})=>`source '${e}' was ingested from ${t}, but this read serves ${n} \u2014 ${g}`,"note.web_url_changed":({source_id:e,previous:t})=>`source '${e}' was ingested from ${t} \u2014 adopt the new URL as its next version, or add it under another id`,"note.web_id_taken":({url:e})=>`skipped ${e} \u2014 add it under another id to keep both pages`,"note.web_login":()=>"your credentials were rejected \u2014 sign in again and retry","note.web_projection_unknown":({kind:e})=>`unknown web projection kind '${e}' \u2014 this source needs a newer engine to read it`,LIS_AUTH:()=>"credentials rejected \u2014 sign in again and retry",MULTI_SOURCE_RESUME:({sid:e,sources:t})=>`error: session ${e} spans ${t} sources \u2014 multi-source resume isn't supported yet; committed work is preserved (extract anything remaining again)`,CHANGE_BASIS_MOVED:({source_id:e,sid:t})=>`error: ${e} moved while this reconcile extraction was paused \u2014 its recorded change context no longer matches; review the current version instead (session ${t} is defunct and can be ignored)`,PROPOSAL_UNREADABLE:({proposal:e})=>`proposal ${e} is unreadable \u2014 review the source's changes again`,SOURCE_UNRESOLVED:({source_id:e})=>`the source ${e} no longer resolves \u2014 cannot verify this changeset is current; review the source's changes again`,SOURCE_MOVED:({source_id:e})=>`the source ${e} moved again while this review was open \u2014 review its changes again to refresh the changeset`,ARCHIVE_UNRESOLVED:({use_case:e})=>`its archive op no longer resolves to ${e} \u2014 review the source's changes again`,POSTURE_IN_CHAT:({sid:e})=>`error: session ${e} is a held reconcile review \u2014 resumed in the chat its changes would commit without verdicts; give its cards their verdicts in the review`,SOURCE_MISSING:({sid:e,sources:t})=>`error: resumed session's paused source (${t}) is no longer in the corpus \u2014 add it again and resume session ${e}, or abandon that session`,BLOB_MISSING:({source_id:e})=>`error: ${e}: its stored content is missing \u2014 add the file again [BLOB_MISSING]`,"AGENT_FAILED.invalid_proposal":({source_id:e})=>`error: the agent could not produce a valid proposal for ${e} \u2014 extract it again to retry`,UC_UNREVIEWED:({use_case:e})=>`${e} is unreviewed \u2014 approve it first, or design it unreviewed`,"UC_UNREVIEWED.merge_target":({temp_ref:e,target:t})=>`${e}: merge target ${t} is unreviewed (derived) \u2014 approve it first and re-propose the merge`,UC_HELD:({use_case:e,owner_sid:t,stopped:n})=>`design: ${e} is being designed by another session`+(n?` \u2014 that session looks stopped; resume session ${t??"<session>"}`:"")+" \u2014 pick another use-case or wait for it to finish",GENERATION_LIVE:({use_case:e,gen:t})=>`${e} already has a live design generation (gen ${t}) \u2014 redesign it, with a reason, to supersede it`,MESSAGE_TOO_LARGE:({bytes:e,max:t})=>`error: the opening statement is ${e} bytes and the agent takes at most ${t} per message (it would drop it silently) \u2014 give a shorter reason (it replaces the generated stale reason)`,REASON_TOO_LARGE:()=>"nothing was started: that reason is too long; run it again with a sentence or two",SESSION_V1:({sid:e})=>`session ${e} predates durable checkpoints \u2014 this build cannot resume it; abandon it and start a fresh run (committed work is untouched)`,WRONG_VERB:({sid:e,verb:t})=>`error: session ${e} is a ${t} session \u2014 resume it as one`,"HELD_CITES_STALE.moved":()=>`the source moved after this plan staged \u2014 its quotes no longer verify against the current head; ${h}`,"HELD_CITES_STALE.predates_images":({where:e,anchor:t})=>`${e}: this plan predates image-part staging \u2014 ${t} cannot be verified against the version it staged under; ${h}`,"HELD_CITES_STALE.no_image":({where:e,anchor:t})=>`${e}: ${t} names no decodable image of the staged version \u2014 ${h}`,"HELD_CITES_STALE.image_moved":({where:e,anchor:t,gone:n})=>`${e}: the image behind ${t} is ${n?"no longer in":"ambiguous in"} the current head \u2014 ${h}`}});var
|
|
2
|
+
function l(e){return{command:(t,n)=>e.commands[t](n),text:(t,n)=>e.texts[t](n)}}function w(e,t,n){let s=n?(i,a)=>n[i](a):e.header;return{command:e.command,text:(i,a)=>{let u=t[i];return u?u(a):e.text(i,a)},...s?{header:s}:{}}}function x(e,t){let n=e.command("next.resume_session",t),s=e.command("next.resume_with_message",t);return{...n!==null?{resume:n}:{},...s!==null?{resumeMessage:s}:{}}}function y(e,t,n,s){let i=e.command(t,n);return i!==null?{cmd:i,...s}:{code:t,facts:n,...s}}import{getEnvironmentData as _,setEnvironmentData as v}from"worker_threads";var d=(e,t)=>e?`${e} ${t}${e>1?"s":""}`:null,p={"chat.added_use_cases":({minted:e,matched:t})=>e===0&&t>0?`all ${t} matched existing \u2014 nothing new to save`:`saved ${e} use-case${e===1?"":"s"} as drafts`+(t>0?` \xB7 ${t} matched existing`:""),"chat.added_design":({acs:e,scenarios:t,tests:n,gaps:s})=>`saved ${[d(e,"AC"),d(t,"scenario"),d(n,"test"),d(s,"gap")].filter(Boolean).join(" \xB7 ")||"judgements/wiring"} as drafts`,"chat.proposal_refused":()=>"proposal failed validation \u2014 nothing landed","chat.commit_failed":()=>"commit failed \u2014 nothing landed","chat.approved":({count:e})=>`${e} change${e===1?"":"s"} applied`,"chat.stales":({count:e})=>`stales ${e}`,"chat.held_degraded":({held:e})=>`held ${e} item(s) for review \u2014 semantic dedup ran degraded (embeddings unavailable); nothing saved this turn`,"chat.child_back":({drafts:e})=>`${e} draft${e===1?"":"s"} saved`,"chat.refine_hint":()=>'chat to refine ("looks good" approves; /done finishes)',"chat.repair_sent":()=>"that couldn't be saved as it was \u2014 the agent is fixing it","chat.updates_held":({count:e})=>`${e} update(s) held for review`,"note.dedup_reduced":()=>"note: duplicate detection is running in a reduced mode this run \u2014 new items will be held for your review instead of committed","note.chain_recovered":({sid:e})=>`session ${e}: checkpoint chain present with no pointer \u2014 recovering from the chain`,"note.chain_truncated":({sid:e,at:t,lost:n})=>`session ${e}: chain truncated to checkpoint ${t} \u2014 ${n} turn(s) lost to a corrupt record`,"note.turns_unrecorded":({detail:e})=>`this chat's turns are not being saved to its conversation (${e}) \u2014 your messages still reach the agent, but a resume cannot send them again`,"note.receipt_unbuilt":({detail:e})=>`a saved change's receipt for the agent could not be built (${e}) \u2014 the change is saved, but the agent is not told what it saved`,"note.tests_await_approval":({tests:e,criteria:t,criterion:n})=>{let s=e===1?"1 test checks":`${e} tests check`;return t===1&&n!==null?`note: ${s} a criterion not approved yet \u2014 say "approve ${n}"`:`note: ${s} criteria not approved yet \u2014 say "approve the criteria"`},"note.phase_unchanged":()=>"this phase matched what's already there \u2014 nothing new added","warning.variables_unwritten":({message:e})=>`warning: the design was saved, but its variable stubs could not be written (${e})`};var r=()=>null,c=e=>`resume session ${e}, which holds it`,h="review the current version again",g="retire it first, or add this under another id",m=l({commands:{"next.resume_session":r,"next.resume_with_message":r,"next.resume_child":r,"next.design_use_case":r,"next.review_use_case":r,"next.design_unreviewed":r,"next.view_design":r,"next.evolve_design":r,"next.redesign":r,"next.design_phase":r,"next.answer_evolve":r,"next.abandon_session":r,"next.review_held_changeset":r,"next.show_session":r,"next.review_source":r},texts:{...p,"note.paused":({sid:e})=>`paused: session ${e} saved and can be resumed`,"note.crashed":({sid:e,seq:t})=>`agent crashed \u2014 session ${e} can be resumed from its checkpoint ${t} (at most the in-flight turn lost)`,"note.model_unavailable_kept":({sid:e,detail:t})=>`the model service did not answer (${t}) \u2014 session ${e} is kept and can be resumed once it answers`,"note.model_retry":({seconds:e})=>`the model service is not answering; trying again in ${e}s`,"note.held_for_review":({sid:e,held:t})=>`paused: ${t} held item(s) await review in session ${e}`,"note.already_extracted":({source_id:e})=>`${e} already extracted \u2014 skipped`,"note.conversation_source_skipped":({source_id:e})=>`skipped ${e} \u2014 a conversation source is extracted only when it is named`,"note.reconcile_plan_pending":({source_id:e,pending:t})=>`note: a reconcile plan for ${e} is pending (${t} item(s))`,"note.nothing_to_extract":({sources:e,count:t})=>`extract: nothing to do \u2014 ${e} ${t===1?"is":"are all"} already extracted at the current snapshot`,"note.only_conversation_sources":()=>"extract: nothing to do \u2014 only conversation sources here, and each is extracted only when it is named","note.all_extracted":()=>"extract: nothing to do \u2014 every ingested source is already extracted","note.changeset_held_for_review":({sid:e,held:t})=>`paused: ${t} held change(s) await your verdicts in session ${e}`,"note.session_kept":({sid:e,seq:t,ts:n})=>`session ${e} kept its last checkpoint (seq ${t}, ${n}) and can be resumed`,"note.assumed_defaults":({sid:e,count:t})=>`note: ${t} default(s) were assumed while you were away \u2014 session ${e} lists them`,"note.landed_changed":({source_id:e})=>`note: ${e} changed after it was added \u2014 skipping its extraction this run; extract it again to pick up the newer version`,"note.landed_older_queued":({source_id:e})=>`note: an older version of ${e} is already queued this run \u2014 the newly landed version is not extracted; extract it again to pick it up`,"note.reingest_binary":({source_id:e,kind:t})=>`skipping ${e}: binary ${t} ingested before image support \u2014 add it again to extract from it`,"note.schedule_refused":()=>"this run holds items for review, so its extraction is not scheduled \u2014 it runs after the review","note.not_reached":()=>"run ended before its turn \u2014 extracting again runs it","note.nothing_committed":({source_id:e,remaining:t})=>`done \u2014 nothing committed for ${e} (no finalize before the session ended)`+(t>0?`; stopping here \u2014 ${t} remaining source(s) not extracted (extract them again to continue)`:""),"note.landed_not_extracted":({count:e,sources:t})=>`note: ${e} source(s) landed this session (${t}) were not extracted \u2014 the session ended first; extracting again runs them`,"note.evidence_not_attached":({count:e})=>`note: ${e} unchanged match(es) target unreviewed (or no-longer-resolving) item(s) \u2014 evidence not attached (review them; a later reconcile attaches)`,"note.sources_failed":({failed:e,total:t,sources:n})=>`${e} of ${t} source(s) failed \u2014 extract them again to retry (${n})`,"note.already_designed":({use_case:e,version:t})=>`'${e}' is already designed @ v${t} \u2014 current; redesign it to replace that design`,"note.design_stale":({use_case:e,designed:t,current:n})=>`'${e}' was designed @ ${t} \u2014 the use-case is now @ v${n} (STALE); evolve or redesign it`,"note.view_design":({use_case:e})=>`view the existing design of ${e}`,"note.evolve_first":({use_case:e})=>`refresh it first: evolve ${e}`,"note.nothing_executed":()=>"nothing executed","note.tests_await_approval_command":({tests:e,criteria:t,criterion:n})=>{let s=e===1?"1 test checks":`${e} tests check`;return t===1&&n!==null?`note: ${s} a criterion not approved yet; approve ${n}`:`note: ${s} criteria not approved yet; approve them`},"note.links_await_approval":({count:e})=>`warning: ${e} test link(s) refer to items still awaiting approval \u2014 saved anyway; review and approve those items`,"note.no_design_skipped":({use_case:e})=>`note: ${e} has no design output \u2014 nothing to evolve; design it first`,"note.no_design":({use_case:e})=>`nothing to evolve \u2014 design ${e} first (no design output)`,"note.design_paused":({use_case:e})=>`design session for ${e} paused \u2014 resume it, then evolve again for the diff`,"note.nothing_changed":({ref:e})=>`nothing changed underneath ${e} \u2014 its sources and requirements are current; give a reason to re-design anyway`,"note.source_changed_skipped":({use_case:e})=>`${e} is left out: it's out of date because its source changed \u2014 review its source's change first`,"note.source_changed":({use_case:e})=>`${e} is out of date because its source changed, and an update can't change that \u2014 review its source's change first`,"note.source_changed_after":({use_case:e})=>`${e} is still out of date because its source changed \u2014 review its source's change`,"note.checkpoint_not_saved":({error:e,chain_unverified:t})=>`warning: couldn't save the session checkpoint \u2014 ${e}; asking the agent to pause`+(t?". The store's record chain fails verification.":""),"note.held_no_event_id":({sid:e})=>`this held row has no durable event id \u2014 ${c(e)}, to drop it`,"note.held_no_provenance":({sid:e})=>`this held row carries no committable provenance \u2014 ${c(e)}, to apply it`,"note.held_no_citable_text":({sid:e,source_id:t,source_cid:n})=>`the pinned source ${t} (${n.slice(0,19)}) has no citable text to verify this held row against \u2014 ${c(e)}`,"note.held_unverified":({sid:e,errors:t})=>`held provenance does not verify against the pinned source (${t}) \u2014 ${c(e)}`,"note.controller_unreachable":({base:e,error:t})=>`error: cannot reach the controller at ${e} (${t})
|
|
3
|
+
hint: check the network connection and the sign-in`,"note.assurance_unsupported":()=>"error: this environment does not support assurance sessions yet (404) \u2014 contact support if the problem persists","note.credentials_rejected":({env:e})=>`error: your credentials were rejected (401) \u2014 sign in again (active environment: ${e})`,"note.key_recycled":({source_id:e,what:t})=>`source '${e}' was ingested from a different ${t} that used this key \u2014 the key was recycled; ${g}`,"note.kind_taken":({source_id:e,backing:t,kind:n})=>`source '${e}' is already backed by ${t}, not ${n} \u2014 ${g}`,"note.site_moved":({source_id:e,previous:t,site:n})=>`source '${e}' was ingested from ${t}, but this read serves ${n} \u2014 ${g}`,"note.web_url_changed":({source_id:e,previous:t})=>`source '${e}' was ingested from ${t} \u2014 adopt the new URL as its next version, or add it under another id`,"note.web_id_taken":({url:e})=>`skipped ${e} \u2014 add it under another id to keep both pages`,"note.web_login":()=>"your credentials were rejected \u2014 sign in again and retry","note.web_projection_unknown":({kind:e})=>`unknown web projection kind '${e}' \u2014 this source needs a newer engine to read it`,LIS_AUTH:()=>"credentials rejected \u2014 sign in again and retry",MULTI_SOURCE_RESUME:({sid:e,sources:t})=>`error: session ${e} spans ${t} sources \u2014 multi-source resume isn't supported yet; committed work is preserved (extract anything remaining again)`,CHANGE_BASIS_MOVED:({source_id:e,sid:t})=>`error: ${e} moved while this reconcile extraction was paused \u2014 its recorded change context no longer matches; review the current version instead (session ${t} is defunct and can be ignored)`,PROPOSAL_UNREADABLE:({proposal:e})=>`proposal ${e} is unreadable \u2014 review the source's changes again`,SOURCE_UNRESOLVED:({source_id:e})=>`the source ${e} no longer resolves \u2014 cannot verify this changeset is current; review the source's changes again`,SOURCE_MOVED:({source_id:e})=>`the source ${e} moved again while this review was open \u2014 review its changes again to refresh the changeset`,ARCHIVE_UNRESOLVED:({use_case:e})=>`its archive op no longer resolves to ${e} \u2014 review the source's changes again`,POSTURE_IN_CHAT:({sid:e})=>`error: session ${e} is a held reconcile review \u2014 resumed in the chat its changes would commit without verdicts; give its cards their verdicts in the review`,SOURCE_MISSING:({sid:e,sources:t})=>`error: resumed session's paused source (${t}) is no longer in the corpus \u2014 add it again and resume session ${e}, or abandon that session`,BLOB_MISSING:({source_id:e})=>`error: ${e}: its stored content is missing \u2014 add the file again [BLOB_MISSING]`,"AGENT_FAILED.invalid_proposal":({source_id:e})=>`error: the agent could not produce a valid proposal for ${e} \u2014 extract it again to retry`,UC_UNREVIEWED:({use_case:e})=>`${e} is unreviewed \u2014 approve it first, or design it unreviewed`,"UC_UNREVIEWED.merge_target":({temp_ref:e,target:t})=>`${e}: merge target ${t} is unreviewed (derived) \u2014 approve it first and re-propose the merge`,UC_HELD:({use_case:e,owner_sid:t,stopped:n})=>`design: ${e} is being designed by another session`+(n?` \u2014 that session looks stopped; resume session ${t??"<session>"}`:"")+" \u2014 pick another use-case or wait for it to finish",GENERATION_LIVE:({use_case:e,gen:t})=>`${e} already has a live design generation (gen ${t}) \u2014 redesign it, with a reason, to supersede it`,MESSAGE_TOO_LARGE:({bytes:e,max:t})=>`error: the opening statement is ${e} bytes and the agent takes at most ${t} per message (it would drop it silently) \u2014 give a shorter reason (it replaces the generated stale reason)`,REASON_TOO_LARGE:()=>"nothing was started: that reason is too long; run it again with a sentence or two",SESSION_V1:({sid:e})=>`session ${e} predates durable checkpoints \u2014 this build cannot resume it; abandon it and start a fresh run (committed work is untouched)`,WRONG_VERB:({sid:e,verb:t})=>`error: session ${e} is a ${t} session \u2014 resume it as one`,"HELD_CITES_STALE.moved":()=>`the source moved after this plan staged \u2014 its quotes no longer verify against the current head; ${h}`,"HELD_CITES_STALE.predates_images":({where:e,anchor:t})=>`${e}: this plan predates image-part staging \u2014 ${t} cannot be verified against the version it staged under; ${h}`,"HELD_CITES_STALE.no_image":({where:e,anchor:t})=>`${e}: ${t} names no decodable image of the staged version \u2014 ${h}`,"HELD_CITES_STALE.image_moved":({where:e,anchor:t,gone:n})=>`${e}: the image behind ${t} is ${n?"no longer in":"ambiguous in"} the current head \u2014 ${h}`}});var f="kane-context:flushToDisk",o=null;function A(e){o=e,e.flushToDisk!==void 0&&v(f,e.flushToDisk)}function I(){if(!o)throw new Error("engine config not set; the host must call setEngineConfig before any engine call");return o}function O(){return o?.writersFenced===!0}function L(){return(o?.flushToDisk??_(f))!==!1}function H(){return o?.warn}function W(){return o?.userSessionId?.()??null}var $="kane-context:pythonTrustFile";function R(e){v($,e??void 0)}function D(){let e=_($);return typeof e=="string"?e:null}function F(){return o?.version??null}function N(){return o?.wording??m}export{l as a,w as b,x as c,y as d,p as e,A as f,I as g,O as h,L as i,H as j,W as k,R as l,D as m,F as n,N as o};
|