@testmuai/kane-cli 0.10.0 → 0.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ChatSurface-Z26BOE5U.js +2 -0
- package/dist/{ChromeProfilePicker-FWPUDKD6.js → ChromeProfilePicker-ODRIAXL3.js} +1 -1
- package/dist/{CliFeedbackPrompt-D5L2DO6A.js → CliFeedbackPrompt-JWCTMIGI.js} +1 -1
- package/dist/{CliUploadProgress-HQX57WE6.js → CliUploadProgress-XFRRFRL4.js} +1 -1
- package/dist/{ConfigView-DGQXKEON.js → ConfigView-6JF4DOJN.js} +1 -1
- package/dist/EvidenceViewOffer-6344EX74.js +2 -0
- package/dist/FolderPicker-4PCYHE75.js +2 -0
- package/dist/InfoBox-NJ2DL7YC.js +2 -0
- package/dist/{LinksBox-WZ4RAMSH.js → LinksBox-HNDNFVUT.js} +1 -1
- package/dist/{ProfilesView-AGRNPGSW.js → ProfilesView-DEJKJOHY.js} +1 -1
- package/dist/ProjectPicker-DTWMWOH7.js +2 -0
- package/dist/SaveSessionPrompt-3GCLB3ZT.js +2 -0
- package/dist/SingleShotApp-HMOXO5DW.js +2 -0
- package/dist/{SummaryBox-XQJUZBAN.js → SummaryBox-7PPDMSSM.js} +1 -1
- package/dist/TestMdRunView-QLKRUU4V.js +2 -0
- package/dist/TestrunEvidenceTable-T2JUB4TE.js +2 -0
- package/dist/{WhoamiView-JQCURK2M.js → WhoamiView-H7JNLLCY.js} +1 -1
- package/dist/{app-download-OU6AGH2X.js → app-download-GKRF2EIM.js} +1 -1
- package/dist/{assurance-job-ZI3L6I4F.js → assurance-job-F4L3T4VJ.js} +1 -1
- package/dist/{auth-7Z54TMQQ.js → auth-WBIEHHDS.js} +1 -1
- package/dist/{binary-S5YL5GJD.js → binary-K3XMILST.js} +1 -1
- package/dist/{bind-LIV72SEZ.js → bind-SSHAZAB3.js} +1 -1
- package/dist/{bootstrap-3V6TOO6I.js → bootstrap-XGKU4WXB.js} +1 -1
- package/dist/bridge-2UHJOVLX.js +2 -0
- package/dist/{catalog-I3PC6LT6.js → catalog-YCU6OHNV.js} +1 -1
- package/dist/{catalog-client-WKYG3JN6.js → catalog-client-MVEEHTG2.js} +1 -1
- package/dist/{changelog-IHNWFYWY.js → changelog-5UB3AQT6.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-ZTAZ2R5Z.js → chunk-23DKB2MT.js} +1 -1
- package/dist/{chunk-UX2CDUPE.js → chunk-2JFRN62I.js} +2 -2
- package/dist/chunk-2RBMQTYS.js +26 -0
- package/dist/{chunk-VVCZRCRD.js → chunk-2TK4MDF2.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-4523YDTG.js → chunk-35WUYKGO.js} +1 -1
- package/dist/{chunk-KDR662D2.js → chunk-3KY7HHQU.js} +1 -1
- package/dist/{chunk-UNWPBMVM.js → chunk-3MD2XLE7.js} +2 -2
- package/dist/{chunk-YKL5H4K6.js → chunk-3NWUXRSI.js} +1 -1
- package/dist/{chunk-QQI6N3FO.js → chunk-3RO2YGKH.js} +1 -1
- package/dist/{chunk-AGXAJ2II.js → chunk-3ZC7GSMM.js} +1 -1
- package/dist/{chunk-I2MC6VVX.js → chunk-4C7WVQOD.js} +1 -1
- package/dist/{chunk-VQZOKTJ2.js → chunk-4CJQ7XZP.js} +1 -1
- package/dist/{chunk-7KX2BHKG.js → chunk-4KCYNP2K.js} +1 -1
- package/dist/{chunk-AUBSLPJZ.js → chunk-4KL3TSTT.js} +5 -5
- package/dist/{chunk-AG5XJWEV.js → chunk-4UX5N7YI.js} +1 -1
- package/dist/{chunk-WERIGVOH.js → chunk-5F5IVART.js} +1 -1
- package/dist/{chunk-RFEON5GN.js → chunk-5XVWT6UK.js} +1 -1
- package/dist/{chunk-FBQ7PQJV.js → chunk-5YYCCM6K.js} +1 -1
- package/dist/{chunk-SBR6D6GS.js → chunk-6FFX4S7N.js} +1 -1
- package/dist/{chunk-DHYGCHKB.js → chunk-6HRNG4CK.js} +1 -1
- package/dist/{chunk-HBVHIEPB.js → chunk-6QCCTZO3.js} +1 -1
- package/dist/{chunk-GI2JPIX5.js → chunk-6QH75BPJ.js} +1 -1
- package/dist/{chunk-5R3ODQHH.js → chunk-6SD4XTYC.js} +1 -1
- package/dist/{chunk-J4LQAT5P.js → chunk-7LYLJ75Z.js} +1 -1
- package/dist/{chunk-Y3YULFCK.js → chunk-7RELCXRW.js} +1 -1
- package/dist/{chunk-GXMD23XB.js → chunk-7SU53QGU.js} +1 -1
- package/dist/{chunk-DTYT6KBO.js → chunk-7Y55CO42.js} +1 -1
- package/dist/{chunk-2L3A5NKZ.js → chunk-7YV2FCN4.js} +1 -1
- package/dist/{chunk-ULGBK4NS.js → chunk-A2DODRHG.js} +1 -1
- package/dist/{chunk-EVZLINBN.js → chunk-AHT2ORJT.js} +1 -1
- package/dist/{chunk-RDH3E25Q.js → chunk-AT7AT3AR.js} +2 -2
- package/dist/{chunk-ZI3X7DI2.js → chunk-AVLYSNEG.js} +1 -1
- package/dist/{chunk-GET4DINR.js → chunk-BBJAKSA7.js} +1 -1
- package/dist/{chunk-CBVHP7JB.js → chunk-BJO6J5X2.js} +1 -1
- package/dist/{chunk-G3CYFCSR.js → chunk-BLVDV3QQ.js} +1 -1
- package/dist/{chunk-2N75WO7Y.js → chunk-C4KAPGBS.js} +1 -1
- package/dist/{chunk-XLQ4F6BI.js → chunk-CB2BWDHG.js} +2 -2
- package/dist/chunk-CB344EDO.js +2 -0
- package/dist/chunk-CCOD4GQJ.js +2 -0
- package/dist/{chunk-JSLKCCD2.js → chunk-CNHKZE4F.js} +1 -1
- package/dist/{chunk-CJE7PKRV.js → chunk-CQDCNP7V.js} +1 -1
- package/dist/{chunk-3OVFKUXV.js → chunk-CTHUX7O4.js} +1 -1
- package/dist/{chunk-4JWJH6TB.js → chunk-DC5F2ADJ.js} +1 -1
- package/dist/chunk-DIOK3SER.js +34 -0
- package/dist/{chunk-EQWMOGLO.js → chunk-DQXQJJOP.js} +2 -2
- package/dist/{chunk-EH43VWVR.js → chunk-DXIQVBMI.js} +1 -1
- package/dist/{chunk-WZLDFEWR.js → chunk-E4GIGM5V.js} +1 -1
- package/dist/{chunk-K3OSK6PB.js → chunk-EBJW6POT.js} +1 -1
- package/dist/{chunk-MYZHOBS4.js → chunk-EHB55V23.js} +1 -1
- package/dist/{chunk-RARD6TC6.js → chunk-EJGCIGQY.js} +1 -1
- package/dist/{chunk-OR2B6T3B.js → chunk-ENRFXGID.js} +1 -1
- package/dist/{chunk-3ZPEQDXZ.js → chunk-ERRIDBE7.js} +1 -1
- package/dist/{chunk-HGVM2OZU.js → chunk-EZMRWXRT.js} +1 -1
- package/dist/chunk-F2F257PU.js +6 -0
- package/dist/{chunk-AUJSC7PU.js → chunk-FNUGDPTS.js} +1 -1
- package/dist/{chunk-MPEIMWQI.js → chunk-FOLUB336.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-PL3SG3M2.js → chunk-GJXO6FF7.js} +1 -1
- package/dist/{chunk-252GEI3H.js → chunk-GLM5UGTF.js} +1 -1
- package/dist/{chunk-JOCEZK2M.js → chunk-GQAWZEA4.js} +1 -1
- package/dist/{chunk-45URQUAK.js → chunk-GXQYFOBD.js} +1 -1
- package/dist/{chunk-PBWYQR5I.js → chunk-HBLHKQR7.js} +1 -1
- package/dist/chunk-HC6VLPUB.js +5 -0
- package/dist/{chunk-K2PLULJD.js → chunk-HRIDAK6Y.js} +1 -1
- package/dist/{chunk-D6CS62O7.js → chunk-HV2CDY4K.js} +1 -1
- package/dist/{chunk-P2LDAW3C.js → chunk-HVOXMCKE.js} +1 -1
- package/dist/{chunk-4I7YN6YY.js → chunk-HYJVYYAZ.js} +2 -2
- package/dist/{chunk-GYDJO32R.js → chunk-IEHJG6J4.js} +1 -1
- package/dist/{chunk-GGS3ATPB.js → chunk-IZ66FKPC.js} +1 -1
- package/dist/{chunk-QMOGBKJM.js → chunk-J4FIESTB.js} +1 -1
- package/dist/{chunk-436FZ4KG.js → chunk-JBKHX5ES.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-5IO5ZC4S.js → chunk-KBGMQYMD.js} +1 -1
- package/dist/{chunk-WX4VGH5Q.js → chunk-KCXLRR3Q.js} +1 -1
- package/dist/{chunk-4R4YUOVY.js → chunk-KKLCXRW6.js} +1 -1
- package/dist/{chunk-YGMQXS2J.js → chunk-KL7XFNSD.js} +1 -1
- package/dist/{chunk-MJKRJGER.js → chunk-KQ4XKTIZ.js} +1 -1
- package/dist/{chunk-I2VU2DTS.js → chunk-L3BUPFAQ.js} +4 -4
- package/dist/{chunk-ZZNQIFFI.js → chunk-LHJSIHLC.js} +1 -1
- package/dist/{chunk-2GE5X2A5.js → chunk-LLQWEGXD.js} +1 -1
- package/dist/{chunk-PQXYHI5W.js → chunk-LPJKNX6D.js} +1 -1
- package/dist/{chunk-ZGQM6KWN.js → chunk-LRNUGKYH.js} +1 -1
- package/dist/chunk-LTPOMMAB.js +2 -0
- package/dist/{chunk-MHB6DMKZ.js → chunk-LUA25RYS.js} +1 -1
- package/dist/{chunk-2PZKMT3I.js → chunk-LV7224DG.js} +1 -1
- package/dist/{chunk-X3J4CC27.js → chunk-LXK4B2FE.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-4BUEOKFV.js → chunk-M2E5CPPV.js} +1 -1
- package/dist/{chunk-65BG6GAE.js → chunk-M7A66MSK.js} +1 -1
- package/dist/{chunk-JX5NVKTV.js → chunk-MD3RABID.js} +1 -1
- package/dist/{chunk-QECTIQAC.js → chunk-MEBEVHGP.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-HJLMH7ZM.js → chunk-MUX2A37P.js} +1 -1
- package/dist/{chunk-YKOEABP2.js → chunk-N7IWR45S.js} +1 -1
- package/dist/{chunk-WQR2GYP7.js → chunk-ND6OP3O2.js} +1 -1
- package/dist/{chunk-URAYFJGM.js → chunk-NHGPMYM3.js} +1 -1
- package/dist/{chunk-ZKPY3AXW.js → chunk-NI3TIAD7.js} +1 -1
- package/dist/{chunk-JCSVBD4F.js → chunk-NPAUSUNM.js} +1 -1
- package/dist/{chunk-XMALVGH7.js → chunk-NRAPCFI2.js} +2 -2
- package/dist/{chunk-567D5ZTO.js → chunk-NZJSGINB.js} +16 -16
- package/dist/{chunk-A4BB6GLN.js → chunk-OBNVGD5H.js} +1 -1
- package/dist/{chunk-BRVIK3BU.js → chunk-OCMPWCKQ.js} +1 -1
- package/dist/{chunk-4SJAOAYY.js → chunk-OCVDMZWB.js} +1 -1
- package/dist/{chunk-JRSEAXFE.js → chunk-OHGL4GEJ.js} +1 -1
- package/dist/{chunk-YYVBE6W2.js → chunk-OOGKX4Y6.js} +1 -1
- package/dist/{chunk-QWZJ5QDO.js → chunk-OTMHCHH6.js} +2 -2
- package/dist/{chunk-Z5BFCTHI.js → chunk-OZNYQONA.js} +2 -2
- package/dist/{chunk-EPJ5SJL2.js → chunk-PB6RXDWQ.js} +2 -2
- package/dist/{chunk-TZVPDGJD.js → chunk-PCQK62MP.js} +1 -1
- package/dist/{chunk-Z777GGHB.js → chunk-PI7OXS62.js} +1 -1
- package/dist/{chunk-MW2WNYJO.js → chunk-PRBWZXFA.js} +2 -2
- package/dist/{chunk-2SY2NCOP.js → chunk-PTLOOVV4.js} +1 -1
- package/dist/{chunk-EC5IP5HZ.js → chunk-Q4ALB7SH.js} +1 -1
- package/dist/{chunk-FYCD765R.js → chunk-Q4JV4U65.js} +58 -58
- package/dist/{chunk-CJQUVHHS.js → chunk-Q4SMITTV.js} +1 -1
- package/dist/{chunk-NJCN6LP5.js → chunk-QE4AWNOV.js} +6 -6
- package/dist/{chunk-BY2B4YJN.js → chunk-QEM5ZRDN.js} +1 -1
- package/dist/{chunk-VA3BSIUQ.js → chunk-QHH42RH5.js} +1 -1
- package/dist/{chunk-FPPVNF53.js → chunk-R6TFRAMZ.js} +1 -1
- package/dist/{chunk-3T2TYDPT.js → chunk-RNHSULQM.js} +1 -1
- package/dist/{chunk-32Y6QVFG.js → chunk-SALZ6WSF.js} +1 -1
- package/dist/chunk-SB26HQO7.js +2 -0
- package/dist/{chunk-4NUSW4A2.js → chunk-SIHX5FW5.js} +1 -1
- package/dist/{chunk-LHQUCRCH.js → chunk-SJQTTEXQ.js} +1 -1
- package/dist/{chunk-W3NWHWK2.js → chunk-SMGRXKXX.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-7ZJWUWSN.js → chunk-SXBPUUQ5.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-VZA7BPCK.js → chunk-TM45NPWL.js} +1 -1
- package/dist/{chunk-ZY65IZJR.js → chunk-TM6VLC6V.js} +1 -1
- package/dist/{chunk-COJINPOK.js → chunk-TU2KPOW2.js} +2 -2
- package/dist/{chunk-JTJ7IPNI.js → chunk-TUSG7DIL.js} +1 -1
- package/dist/{chunk-3BSYOCSW.js → chunk-U2VYTVKV.js} +1 -1
- package/dist/{chunk-JQ7ZZQXC.js → chunk-UJ37XGSP.js} +3 -3
- package/dist/chunk-ULIIYKZB.js +7 -0
- package/dist/{chunk-LNHBZEDC.js → chunk-UWPG5MWM.js} +1 -1
- package/dist/{chunk-UUWSULIM.js → chunk-UXGMKRS4.js} +61 -60
- package/dist/{chunk-6DZ7LVOG.js → chunk-VCVEZEVS.js} +1 -1
- package/dist/{chunk-ZRDX2ARO.js → chunk-VKVYT6KZ.js} +2 -2
- package/dist/{chunk-B2WFW74J.js → chunk-VO2NNXKR.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-TLOYTGVT.js → chunk-WE7HRAGO.js} +1 -1
- package/dist/{chunk-GRO6DLN3.js → chunk-WEJR2V7R.js} +1 -1
- package/dist/{chunk-YI4ESDAX.js → chunk-WIVKLNIO.js} +1 -1
- package/dist/chunk-WLEWXE6L.js +2 -0
- package/dist/{chunk-DBTMKBHU.js → chunk-X2MDL6S4.js} +1 -1
- package/dist/{chunk-MKPDF26Q.js → chunk-X45RZIAJ.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-FVYIV36L.js → chunk-XKOVEMVZ.js} +1 -1
- package/dist/{chunk-3UHPVQLU.js → chunk-Y2HQMJGS.js} +1 -1
- package/dist/{chunk-4MNSP4EO.js → chunk-Y3RJHWNK.js} +1 -1
- package/dist/{chunk-A3TCFSCK.js → chunk-YCVEI7BT.js} +1 -1
- package/dist/{chunk-JGRXMTME.js → chunk-YDB72F4K.js} +1 -1
- package/dist/{chunk-7C4IEL5V.js → chunk-YILRYMMG.js} +1 -1
- package/dist/{chunk-7DFBOVUB.js → chunk-YJAQZMJT.js} +1 -1
- package/dist/{chunk-JGLADDRH.js → chunk-YNDELIXL.js} +1 -1
- package/dist/{chunk-WKZLK57W.js → chunk-YPGZ5E4I.js} +1 -1
- package/dist/{chunk-NTXFPNAP.js → chunk-YQZ736IQ.js} +1 -1
- package/dist/{chunk-FPVGA6XT.js → chunk-YVVFXBT5.js} +1 -1
- package/dist/{chunk-JT6WLJSV.js → chunk-YWWVF5OU.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-JFBEHCJN.js → chunk-Z47ZEFH7.js} +1 -1
- package/dist/{chunk-6NFOH4AC.js → chunk-ZAQGIC33.js} +1 -1
- package/dist/{chunk-GGV336P5.js → chunk-ZCBOHWN3.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-6TNLITJO.js → chunk-ZHAMVLQZ.js} +1 -1
- package/dist/{chunk-FLOQ5NZL.js → chunk-ZIHQ5JGB.js} +4 -4
- package/dist/{chunk-PTISAIZW.js → chunk-ZMIKNNO6.js} +1 -1
- package/dist/{chunk-H4KPNGY4.js → chunk-ZMWTRXFH.js} +1 -1
- package/dist/{chunk-ONZ2CSTZ.js → chunk-ZPU3WAC4.js} +1 -1
- package/dist/commands-JBFLLT7A.js +2 -0
- package/dist/{committer-26UZDYSA.js → committer-UO3B3S5Y.js} +1 -1
- package/dist/{config-B472DZSR.js → config-7WTZPMAH.js} +1 -1
- package/dist/cover-cmd-DU6ZYJFL.js +2 -0
- package/dist/{credentials-TLT3RQOO.js → credentials-5WIFF5DG.js} +1 -1
- package/dist/{deps-bundle-CMTIWBS5.js → deps-bundle-BLLJ2BQ4.js} +1 -1
- package/dist/{deps-resolve-XLFZK74A.js → deps-resolve-WQ6J6RLI.js} +1 -1
- package/dist/{design-chat-I7X3QDDY.js → design-chat-ZICGVYIH.js} +1 -1
- package/dist/design-committer-7YIPFKMO.js +2 -0
- package/dist/design-headless-HYWZIIDS.js +2 -0
- package/dist/{design-remote-UDC5FP45.js → design-remote-HPX4VZ63.js} +2 -2
- package/dist/device-env-4P4GUVBW.js +2 -0
- package/dist/dispatch-BV6XMCN3.js +2 -0
- package/dist/{doctor-UHFCIM4B.js → doctor-Z2YQ2DBX.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-BJIID6VT.js +2 -0
- package/dist/evidence-presentation-LSFOZGLH.js +2 -0
- package/dist/evolve-cmd-GZCUSCEK.js +2 -0
- package/dist/evolve-remote-LILOAHYH.js +2 -0
- package/dist/{explain-cmd-R67B4YR3.js → explain-cmd-KNDORU2D.js} +1 -1
- package/dist/{explain-cmd-235TY7QX.js → explain-cmd-LXIVHGN7.js} +1 -1
- package/dist/explore-SA2P3SGX.js +2 -0
- package/dist/{explore-context-tty-YXEFT32U.js → explore-context-tty-PERKIWXD.js} +1 -1
- package/dist/{explore-entry-V6L5FSP4.js → explore-entry-E6EY3VV3.js} +4 -4
- package/dist/{explore-live-N5VBLBUI.js → explore-live-XIWWUV52.js} +1 -1
- package/dist/{explore-run-tty-ZZQ33GNA.js → explore-run-tty-M56I23IF.js} +2 -2
- package/dist/{extract-bind-BTINHHE5.js → extract-bind-LZ22VFKB.js} +3 -3
- package/dist/extract-chat-Z64LEAJ5.js +2 -0
- package/dist/{extract-cmd-45OZETCM.js → extract-cmd-46E2XDWZ.js} +2 -2
- package/dist/extract-headless-XLS56LMN.js +2 -0
- package/dist/{feeder-L55TH2NC.js → feeder-NGWIPZ26.js} +1 -1
- package/dist/folder-flags-ZIDJVDKX.js +2 -0
- package/dist/gaps-cmd-XYOBJVTO.js +3 -0
- package/dist/gate-AK44VDHC.js +2 -0
- package/dist/gate-NB5CJMTN.js +2 -0
- package/dist/{generate-headless-DAH3HHRQ.js → generate-headless-HXAVEAEZ.js} +2 -2
- package/dist/hold-passthrough-JGHWMYDM.js +2 -0
- package/dist/{impact-cmd-3VFJAKYK.js → impact-cmd-TJTUFAFO.js} +2 -2
- package/dist/index.js +4159 -190
- package/dist/ingest-ZHHHBUXR.js +2 -0
- package/dist/{ingest-cmd-YSEH5EPU.js → ingest-cmd-OJSKTSQK.js} +3 -3
- package/dist/ingest-remote-2WM6PYUW.js +2 -0
- package/dist/install-JBWBF3WX.js +2 -0
- package/dist/{interactive-bind-P3GTFIZM.js → interactive-bind-SOD7VTAY.js} +4 -4
- package/dist/{interactive-remote-PBRQHTAF.js → interactive-remote-7ZSTI66T.js} +1 -1
- package/dist/lane-CNGO7LH5.js +2 -0
- package/dist/lattice-auth-UQPFQSG7.js +2 -0
- package/dist/{lifecycle-cmd-PUNFWKV5.js → lifecycle-cmd-DGIO3VAO.js} +1 -1
- package/dist/{list-cmd-RD7YBF4S.js → list-cmd-HQIN3HX4.js} +1 -1
- package/dist/{list-commands-UZELZAB3.js → list-commands-OFRRBU3D.js} +1 -1
- package/dist/{list-remote-KGKXPCQA.js → list-remote-EFCET42K.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-SYKXXDLH.js +2 -0
- package/dist/{maintenance-cmd-WRWBCP3R.js → maintenance-cmd-X5247RSJ.js} +1 -1
- package/dist/{mobile-prompts-Z7NQHRGP.js → mobile-prompts-I66ENBDW.js} +1 -1
- package/dist/{objective-variable-gate-3Z7DNVVC.js → objective-variable-gate-V5HHFOUS.js} +1 -1
- package/dist/{onboarding-ZP4XDYEO.js → onboarding-6HIP3KW6.js} +1 -1
- package/dist/open-provider-XDJKT3W3.js +2 -0
- package/dist/pdf-convert-YB6PJFMI.js +2 -0
- package/dist/persist-recorded-session-RSSMTVF3.js +3 -0
- package/dist/phase-seed-ZZSJME7M.js +2 -0
- package/dist/pipeline-NTJDH5TC.js +2 -0
- package/dist/{policy-commands-TY6WOR73.js → policy-commands-4PUGESCW.js} +1 -1
- package/dist/{prepare-target-EVL2QSXA.js → prepare-target-AI3GGZF6.js} +1 -1
- package/dist/{pull-cmd-QJQANBAW.js → pull-cmd-NRVB5ZN7.js} +1 -1
- package/dist/{pull-route-AIOTLA3D.js → pull-route-FWCZW76M.js} +1 -1
- package/dist/readmodel-TRV4E3MW.js +2 -0
- package/dist/real-device-run-NQ7RNH7C.js +2 -0
- package/dist/{reconcile-cmd-IJTQAJZX.js → reconcile-cmd-7B7THAFJ.js} +4 -4
- package/dist/reconcile-deps-UDQBWSLE.js +2 -0
- package/dist/{reconcile-remote-23D6SXXT.js → reconcile-remote-3W6ZTO3G.js} +2 -2
- package/dist/{recording-banner-MNRMMEX4.js → recording-banner-WVDTWTSE.js} +1 -1
- package/dist/registry-PFOSXOIH.js +2 -0
- package/dist/remote-entry-BZU4NFNS.js +2 -0
- package/dist/{remote-mode-AFNCN6EE.js → remote-mode-NXUKDUXG.js} +1 -1
- package/dist/{remote-words-RCNFI2TQ.js → remote-words-JRDDNOZ6.js} +1 -1
- package/dist/{require-project-folder-7UH43GHI.js → require-project-folder-3DTI2CVB.js} +1 -1
- package/dist/{resolve-run-intent-XEWFYMGN.js → resolve-run-intent-QCL7QXIB.js} +1 -1
- package/dist/{resolver-QMPX6RBR.js → resolver-CDF7QKVD.js} +1 -1
- package/dist/revert-QKHPCRT6.js +2 -0
- package/dist/{review-cmd-2OECKNL5.js → review-cmd-XBK3TGRE.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-SFR3F2T5.js +2 -0
- package/dist/{run-startup-gate-USQFSW47.js → run-startup-gate-QSFJRYUY.js} +1 -1
- package/dist/run-test-md-ZSREINDQ.js +20 -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-TLUITRG5.js} +2 -2
- package/dist/{sessions-remote-H7CQST42.js → sessions-remote-INO7AWKB.js} +1 -1
- package/dist/{skill-installer-LKYY6XFJ.js → skill-installer-7JH5QCJF.js} +1 -1
- package/dist/spawner-MQ4XEHIX.js +2 -0
- package/dist/{store-KM5MG3XB.js → store-X4UK4AP7.js} +1 -1
- package/dist/store-choice-27HDIFTU.js +2 -0
- package/dist/{store-guard-34GG2TW2.js → store-guard-ZXKB5DQH.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-2PCO7LZA.js +2 -0
- package/dist/{sync-setup-QQXYO6R4.js → sync-setup-5WQO73Y5.js} +1 -1
- package/dist/tcg-generate-DGJD5KSM.js +2 -0
- package/dist/testmd-actions-XE2JPQHB.js +2 -0
- package/dist/{testmd-sync-PQ4GFKHB.js → testmd-sync-LYHEXWCT.js} +1 -1
- package/dist/{tms-client-XWCR7O7J.js → tms-client-J4OCD3EP.js} +1 -1
- package/dist/token-refresh-E4FTJVHY.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-66XDPA3S.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-SHNVYTMU.js} +1 -1
- package/dist/{view-cmd-QDKBBNIU.js → view-cmd-QOB3O6YW.js} +1 -1
- package/dist/{walk-session-BAYYPIKN.js → walk-session-WIEROYOT.js} +1 -1
- package/dist/with-telemetry-T2PWI5CY.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-2EVP636F.js +0 -26
- package/dist/chunk-34R7BNZ2.js +0 -2
- package/dist/chunk-5T6II7VN.js +0 -7
- package/dist/chunk-6K5BEEAJ.js +0 -2
- package/dist/chunk-HMQ5M4JJ.js +0 -34
- package/dist/chunk-KF4DKXSS.js +0 -2
- package/dist/chunk-NOFJXCYP.js +0 -5
- package/dist/chunk-SB6P5EQH.js +0 -2
- package/dist/chunk-Y6Y6RAY4.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 C}from"./chunk-
|
|
2
|
+
import{b as C}from"./chunk-6SD4XTYC.js";import{b}from"./chunk-BY65QAAN.js";import{R as V,S as B,T as H,U as F,V as O}from"./chunk-OZNYQONA.js";import"./chunk-7Y55CO42.js";import"./chunk-YILRYMMG.js";import"./chunk-BSRSXYDZ.js";import"./chunk-CB4ARIHR.js";import{a as S}from"./chunk-HVOXMCKE.js";import"./chunk-WMGKUERB.js";import"./chunk-UWPG5MWM.js";import{a as h}from"./chunk-73Y6T2UK.js";import{d as A}from"./chunk-XMPTFXPW.js";import"./chunk-SMXABALN.js";import"./chunk-WN5VKKJ3.js";import{g as Y}from"./chunk-47WQBG5I.js";import{a as q}from"./chunk-KM3YCIDV.js";import{i as $}from"./chunk-X52YIWGG.js";import"./chunk-R6TFRAMZ.js";import"./chunk-WEJR2V7R.js";import"./chunk-5F5IVART.js";import"./chunk-IZ66FKPC.js";import"./chunk-GLM5UGTF.js";import"./chunk-VZJ6LUXX.js";import"./chunk-DXIQVBMI.js";import"./chunk-MUX2A37P.js";import"./chunk-W5HFUBXD.js";import{a as N}from"./chunk-35BG2EMW.js";import"./chunk-63EKRZKI.js";import"./chunk-3JLEDSG5.js";import"./chunk-T77LTLAD.js";import"./chunk-73ZFOJOK.js";import"./chunk-EZMRWXRT.js";import"./chunk-3KY7HHQU.js";import"./chunk-Z55KBMYV.js";import"./chunk-LD5B3QFW.js";import"./chunk-32HED7X2.js";import{a as U}from"./chunk-YNDELIXL.js";import"./chunk-ZHAMVLQZ.js";import"./chunk-SIHX5FW5.js";import"./chunk-X7S7IGCV.js";import"./chunk-2RUSXQ3O.js";import{f as G}from"./chunk-CB344EDO.js";import"./chunk-FNUGDPTS.js";import"./chunk-ZDCXWEQG.js";import"./chunk-L3BUPFAQ.js";import{c as M}from"./chunk-GBQ4K25P.js";import"./chunk-PGESS7BW.js";import"./chunk-FWGUISUG.js";import"./chunk-Z24SD2EJ.js";import"./chunk-AQ2OG2EF.js";import"./chunk-23DKB2MT.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-GJXO6FF7.js";import"./chunk-LLQWEGXD.js";import"./chunk-ZCIWQHCO.js";import"./chunk-XB6BJPDL.js";import"./chunk-CQDCNP7V.js";import"./chunk-TD6GCEIK.js";import"./chunk-7V34ZMMS.js";import"./chunk-B7ZX5HEN.js";import{b as P}from"./chunk-EBJW6POT.js";import"./chunk-PVN64537.js";import"./chunk-22PIMG52.js";import"./chunk-4C7WVQOD.js";import{d as j,f as T}from"./chunk-7YV2FCN4.js";import"./chunk-QSCXXNC2.js";import"./chunk-6PIIUAZF.js";import"./chunk-PI7OXS62.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-7V4BQSSV.js";import"./chunk-ZAQGIC33.js";import"./chunk-VO66KP2W.js";import"./chunk-G4K3TP2I.js";import"./chunk-YJAQZMJT.js";import"./chunk-HYJVYYAZ.js";import"./chunk-VZ7KXRXB.js";import"./chunk-GMTHZUZ3.js";import"./chunk-UJLULWSR.js";import"./chunk-ZCRZFAOT.js";import"./chunk-ZCBOHWN3.js";import"./chunk-RZ4F3BHX.js";import"./chunk-A7RJQJNT.js";import"./chunk-TM45NPWL.js";import"./chunk-HCBYKLMW.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-J4FIESTB.js";import"./chunk-UR6MHSHU.js";import{existsSync as z}from"fs";async function ee(e){let[{render:n},a,{QuestionBatchPrompt:s}]=await Promise.all([import("./build-5ZN47FAT.js"),import("./react-QWOAB3TB.js"),import("./ui-SNV3FD2G.js")]),l=a.default??a;return new Promise(m=>{let f=n(l.createElement(s,{questions:e,onSubmit:t=>{f.unmount(),m(t)}}))})}async function te(e,n){let[{render:a},s,{ReviewChecklist:l}]=await Promise.all([import("./build-5ZN47FAT.js"),import("./react-QWOAB3TB.js"),import("./ui-SNV3FD2G.js")]),m=s.default??s;return new Promise(f=>{let t=a(m.createElement(l,{items:e.map(c=>{let o=n.get(c.temp_ref);return{uc:c,dedupWith:o&&!o.archived?o.cid:void 0,archivedMatch:o?.archived?{cid:o.cid,reason:o.reason}:void 0}}),onSubmit:c=>{t.unmount(),f(c)}}))})}async function re(e){let{createInterface:n}=await import("readline/promises"),a=n({input:process.stdin,output:process.stdout});try{let s=await a.question(`${e} [y/N] `);return/^y(es)?$/i.test(s.trim())}finally{a.close()}}async function ye(e){let n=h(process.cwd()),a=S(n),s=T({verb:"extract",mode:e.plan?"cli":"interactive",contextRoot:n,env:j(),resumeSid:e.resume,write:!0,longSession:!0});await V(n,d=>process.stderr.write(d+`
|
|
3
3
|
`));{let d=z(n)?F(n):null;if(d)return process.stderr.write(`error: ${d.text}
|
|
4
4
|
next: ${d.remedy}
|
|
5
5
|
`),await s.end({exit_code:2}),2}let m={...await G(P),...s.spawnEnv()},f=await M(m);if(!f.ok)return process.stderr.write((f.message??"error: turn-endpoint preflight failed")+`
|
|
@@ -7,8 +7,8 @@ next: ${d.remedy}
|
|
|
7
7
|
`),s.error("preflight_auth"),await s.end({exit_code:2}),2;let t=async()=>f;if(e.plan){let d=await $(e,{store:a,pendingReconcilePlan:p=>Y(n,p),agent:C,tracePath:U,credentials:P,onIngestRefusal:q,preflightTurn:t,ask:ee,review:te,confirmStale:re,out:p=>process.stdout.write(p+`
|
|
8
8
|
`),progress:p=>process.stderr.write(p+`
|
|
9
9
|
`),isTTY:A(),auth:m,telemetry:s});return d===1&&process.stderr.write(s.supportFooter()+`
|
|
10
|
-
`),await s.end({exit_code:d}),d}let[{render:c},o,{ScrollbackProvider:g},{ChatSurface:y},{ScrollbackTap:w},{setInkExit:k},{buildExtractChat:x}]=await Promise.all([import("./build-5ZN47FAT.js"),import("./react-QWOAB3TB.js"),import("./scrollback-GGNBDFQV.js"),import("./ChatSurface-
|
|
10
|
+
`),await s.end({exit_code:d}),d}let[{render:c},o,{ScrollbackProvider:g},{ChatSurface:y},{ScrollbackTap:w},{setInkExit:k},{buildExtractChat:x}]=await Promise.all([import("./build-5ZN47FAT.js"),import("./react-QWOAB3TB.js"),import("./scrollback-GGNBDFQV.js"),import("./ChatSurface-Z26BOE5U.js"),import("./ScrollbackTap-4SPXGFMU.js"),import("./exit-manager-EGWAZHCR.js"),import("./extract-chat-Z64LEAJ5.js")]),r=o.default??o,{controller:i,chain:u,inspect:W,reconcile:J,runDeps:K}=await x({site:N(n,a),store:a,credentials:P,agent:C,auth:m,preflight:t,...e.changeContext?{changeContext:e.changeContext}:{}}),I={current:null},v=null,D=0,R=null,E=!1,L=()=>{if(D+=1,D>=2){try{_.unmount()}catch{}b({state:"interrupted",reason:"ctrl+c \xD72",facts:["forced quit \u2014 anything already committed is safe in the store"]}),process.exit(130)}i.requestPause(),R=setTimeout(()=>{E||(E=!0,(async()=>{i.finalizeForExit(),await I.current?.flush();try{_.unmount()}catch{}b({state:"interrupted",facts:["the agent did not confirm the pause within 5s \u2014 nothing new was saved"]}),process.exit(130)})())},5e3)},X={verb:"extract",sid:e.resume??s.ids.session_id,env:j(),...e.source?{subject:e.source}:{}},_=c(r.createElement(g,null,r.createElement(w,{into:I}),r.createElement(y,{controller:i,verb:"extract",onCtrlC:L,chain:u,inspect:W,reconcile:J,meta:X})),{exitOnCtrlC:!1});k(()=>_.unmount());let Q=null;try{let d=$(e,K({isTTY:A(),onSummary:Z=>{v=Z},telemetry:s}));d.finally(()=>{E=!0});let p=await d;return Q=p,p===1&&process.stderr.write(s.supportFooter()+`
|
|
11
11
|
`),await s.end({exit_code:p}),p}catch(d){throw v||(v={state:"crashed",facts:[`the session ended unexpectedly \u2014 ${d instanceof Error?d.name:"error"}`]}),d}finally{E=!0,R&&clearTimeout(R),i.finalizeForExit(),await I.current?.flush();try{_.unmount()}catch{}v?b(v):Q===1&&b({state:"interrupted",facts:["the session ended without saving \u2014 see the error above"]})}}async function ve(e){let n=T({verb:"extract",mode:e.mode,contextRoot:h(process.cwd()),env:j(),resumeSid:e.resume,write:!0,longSession:!0}),{makeHeadlessIO:a,resolveEncoding:s,guardedChannels:l}=await import("./headless-io-FFM5T6KL.js"),{withStructuredNext:m,prepareStructuredResume:f}=await import("./structured-answers-EQ2AP3F7.js"),t=m(a(s(e.mode,e.json===!0),"extract")),c=await B(h(process.cwd()));c&&(s(e.mode,e.json===!0)==="ndjson"?t.event(H(c)):t.progress(c.text));for(let r of e.landed??[]){let i=r;t.event({type:"ingested",source_id:r.source_id,status:r.status,cid:r.source_cid,...i.warnings?.length?{warnings:i.warnings}:{},...i.media?{media:i.media}:{},...i.duplicate_of?{duplicate_of:i.duplicate_of}:{},...i.lineage_candidate?{lineage_candidate:i.lineage_candidate}:{}})}{let r=z(h(process.cwd()))?F(h(process.cwd())):null;if(r)return s(e.mode,e.json===!0)==="ndjson"?t.event(O(r)):t.progress(`error: ${r.text}
|
|
12
12
|
next: ${r.remedy}`),await n.end({exit_code:2}),t.done(2,"refused")}let o;try{o=f({opts:e,reader:S(h(process.cwd())).sessions(),verb:"extract"})}catch(r){let i=r instanceof Error?r.message:String(r);return t.out(`error: ${i}`),e.mode==="agent"&&t.event({type:"error",message:i}),await n.end({exit_code:1}),e.mode==="agent"?t.done(1,"error"):1}if(o.kind==="refuse")return t.out(o.error),e.mode==="agent"&&t.event({type:"error",message:o.error,code:o.code}),await n.end({exit_code:2}),e.mode==="agent"?t.done(2,"refused"):2;let g=e;if(o.kind==="apply"){for(let r of o.notes)t.out(r);if(o.matchedQids.length>0){t.out(`applying ${o.matchedQids.length} structured answer(s) from --answer to the paused session's pending questions`);for(let r of o.matchedQids)t.event({type:"panel_resolved",id:r,by:"user",via:"flag"})}o.statement&&(g={...e,message:[e.message,o.statement].filter(Boolean).join(`
|
|
13
13
|
|
|
14
|
-
`)})}let{makeInterruptGuard:y}=await import("./interrupt-guard-QETBPINI.js"),w=y(C,r=>t.out(r)),x=l(t,()=>w.interrupted(),/^error: (agent failed|repair run failed|agent ended)/);try{let{headlessExtract:r}=await import("./extract-headless-
|
|
14
|
+
`)})}let{makeInterruptGuard:y}=await import("./interrupt-guard-QETBPINI.js"),w=y(C,r=>t.out(r)),x=l(t,()=>w.interrupted(),/^error: (agent failed|repair run failed|agent ended)/);try{let{headlessExtract:r}=await import("./extract-headless-XLS56LMN.js"),i=h(process.cwd()),u=await r(g,N(i,S(i)),{emit:x.emit,out:x.out,progress:t.progress,channel:s(e.mode,e.json===!0)==="ndjson"},{agent:w.agent,telemetry:n});return w.interrupted()&&u!==3?(t.out("interrupted \u2014 no session saved"),await n.end({exit_code:130}),t.done(130)):(u===1&&t.out(n.supportFooter()),await n.end({exit_code:u}),t.done(u))}catch(r){return t.event({type:"error",message:`error: extract failed: ${r instanceof Error?r.message:String(r)}`}),t.out(`error: extract failed: ${r instanceof Error?r.message:String(r)}`),t.out('hint: the full trace is in the file named on the "trace:" line at the start of this run'),t.done(1)}finally{w.dispose()}}async function be(e,n,a="agent"){let[{makeHeadlessIO:s,agentRefusal:l,UsageRefused:m,resolveEncoding:f},{withStructuredNext:t}]=await Promise.all([import("./headless-io-FFM5T6KL.js"),import("./structured-answers-EQ2AP3F7.js")]),c=t(s(f(a,e.json===!0),"extract"),{atQuestionsOnly:!0});n.onboarded&&c.event({type:"folder_linked",project_id:n.projectId,project:n.projectName});let{answerGate:o}=await import("./gate-AK44VDHC.js"),g=o({...e,mode:a},"context extract");if(g!==null)return l(c,g.message,g.code,g.remedy);let{latticeBasicAuth:y}=await import("./lattice-auth-UQPFQSG7.js"),w;try{w=await y()}catch(u){if(u instanceof m)return l(c,u.message,u.code,u.remedy);throw u}let{runRemote:k,controllerCheck:x}=await import("./run-remote-SFR3F2T5.js"),{rememberUser:r}=await import("./store-choice-27HDIFTU.js"),i=await k({verb:"extract",mode:"agent",choice:n,basicAuth:w,start:e.resume?{kind:"resume",sessionId:e.resume}:{kind:"new",body:{projectId:n.projectId,verb:"extract",mode:"agent",...e.source?{sourceId:e.source}:{}}},run:{...e.source!==void 0?{source:e.source}:{},...e.message!==void 0?{message:e.message}:{},...e.force!==void 0?{force:e.force}:{},...e.trust!==void 0?{trust:e.trust}:{},...e.answer?.length?{answer:e.answer}:{},...a==="override"?{override:!0}:{}},io:c,check:x,onProgress:()=>{},onOpened:u=>r(process.cwd(),u.userId),signals:!0});return c.done(i)}async function ke(e,n){let{answerGate:a,printPair:s}=await import("./gate-AK44VDHC.js"),l=a(e,"context extract");if(l!==null)return s(l),2;let{runInteractiveRemote:m}=await import("./interactive-remote-7ZSTI66T.js");return m({verb:"extract",choice:n,start:e.resume?{kind:"resume",sessionId:e.resume}:{kind:"new",body:{projectId:n.projectId,verb:"extract",mode:"interactive",...e.source?{sourceId:e.source}:{}}},run:{...e.source!==void 0?{source:e.source}:{},...e.message!==void 0?{message:e.message}:{},...e.force!==void 0?{force:e.force}:{},...e.trust!==void 0?{trust:e.trust}:{}},...e.source?{subject:e.source}:{}})}export{ve as bindExtractHeadless,ye as bindExtractInteractive,be as bindExtractRemote,ke as bindExtractRemoteInteractive};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{g as f}from"./chunk-47WQBG5I.js";import{a as d}from"./chunk-KM3YCIDV.js";import{g}from"./chunk-X52YIWGG.js";import"./chunk-R6TFRAMZ.js";import"./chunk-WEJR2V7R.js";import"./chunk-5F5IVART.js";import"./chunk-IZ66FKPC.js";import"./chunk-GLM5UGTF.js";import"./chunk-VZJ6LUXX.js";import"./chunk-DXIQVBMI.js";import"./chunk-MUX2A37P.js";import"./chunk-W5HFUBXD.js";import{i as x}from"./chunk-LTPOMMAB.js";import"./chunk-E4GIGM5V.js";import"./chunk-63EKRZKI.js";import"./chunk-3JLEDSG5.js";import"./chunk-T77LTLAD.js";import"./chunk-73ZFOJOK.js";import"./chunk-EZMRWXRT.js";import"./chunk-3KY7HHQU.js";import"./chunk-Z55KBMYV.js";import"./chunk-LD5B3QFW.js";import"./chunk-32HED7X2.js";import{a as h}from"./chunk-YNDELIXL.js";import"./chunk-ZHAMVLQZ.js";import"./chunk-SIHX5FW5.js";import"./chunk-X7S7IGCV.js";import"./chunk-2RUSXQ3O.js";import"./chunk-CB344EDO.js";import"./chunk-FNUGDPTS.js";import"./chunk-ZDCXWEQG.js";import"./chunk-L3BUPFAQ.js";import"./chunk-GBQ4K25P.js";import"./chunk-PGESS7BW.js";import"./chunk-FWGUISUG.js";import"./chunk-Z24SD2EJ.js";import"./chunk-AQ2OG2EF.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-LLQWEGXD.js";import"./chunk-ZCIWQHCO.js";import"./chunk-XB6BJPDL.js";import"./chunk-CQDCNP7V.js";import"./chunk-TD6GCEIK.js";import"./chunk-22PIMG52.js";import"./chunk-4C7WVQOD.js";import"./chunk-7YV2FCN4.js";import"./chunk-QSCXXNC2.js";import"./chunk-6PIIUAZF.js";import"./chunk-PI7OXS62.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-7V4BQSSV.js";import"./chunk-ZAQGIC33.js";import"./chunk-VO66KP2W.js";import"./chunk-G4K3TP2I.js";import"./chunk-YJAQZMJT.js";import"./chunk-HYJVYYAZ.js";import"./chunk-GMTHZUZ3.js";import"./chunk-UJLULWSR.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-J4FIESTB.js";import"./chunk-UR6MHSHU.js";async function M(e){let{site:i,store:c}=e,[{makeChatController:k},{commitChatTurn:C},{topologyDescriptor:y},{explain:D},b,{testDefinitionOf:w}]=await Promise.all([import("./chat-controller-FXRJXUG3.js"),import("./chat-committer-ZKEKJA2R.js"),import("./descriptor-7T32VRMB.js"),import("./explain-DGJ5T6V5.js"),import("./dossier-5XKNAK6Q.js"),import("./test-definition-53XNBEDE.js")]),s=k({commitChatTurn:t=>C({...t,store:c,definitionOf:w}),descriptor:y(),store:c,refreshGraph:()=>i.graph(),graph:i.graph(),explain:D,by:{kind:"human",id:"owner"},dedupFlags:t=>g(t,i.graph()),...e.onRender?{onRender:e.onRender}:{},...e.addedBefore?{addedBefore:e.addedBefore}:{},...e.resumedCheckIn?{resumedCheckIn:e.resumedCheckIn}:{}}),S=t=>{try{return b.buildDossier(i.graph(),t)}catch{return null}},T={listUcs:()=>{let t=i.graph(),r=new Set(s.state.turns.flatMap(a=>(a.items??[]).map(n=>n.title.toLowerCase()))),o={high:0,med:1,low:2};return t.byLabel("usecase").filter(a=>!t.superseded.has(a.cid)).map((a,n)=>{let l=a.content,p=String(l.title??a.cid.slice(0,12)),m=x(t,a.cid);return{key:a.cid,title:p,badge:m==="current"?"designed":m==="stale"?"designed \xB7 stale":r.has(p.toLowerCase())?"drafted this session":"existing",designed:m,risk:l.risk,i:n}}).sort((a,n)=>(o[a.risk??"zz"]??3)-(o[n.risk??"zz"]??3)||a.i-n.i).map(({key:a,title:n,badge:l,designed:p})=>({key:a,title:n,badge:l,designed:p}))},runDesignChild:async(t,r=!1,o="design")=>{let{launchDesignChild:a}=await import("./child-JHYENXE7.js");return a({ucRef:t,force:r,verb:o},s,{store:c,projectDir:process.cwd(),agent:e.agent,tracePath:h,credentials:e.credentials,onIngestRefusal:d,preflightTurn:e.preflight,auth:e.auth})}},{makeReconcileDeps:R}=await import("./reconcile-deps-UDQBWSLE.js"),{emitWalkSignal:E,walkSignal:P}=await import("./reconcile-cmd-7B7THAFJ.js"),u=null,j=R({credentials:e.credentials,onIngestRefusal:d,store:c,parentLock:()=>u,agent:e.agent,...e.reviewChildren?.auth?{auth:e.reviewChildren.auth}:{},...e.reviewChildren?.preflightTurn?{preflightTurn:e.reviewChildren.preflightTurn}:{},...e.changeContext?{changeContext:e.changeContext}:{},...e.probe?{probe:e.probe}:{},...e.matchUnreviewed?{matchUnreviewed:!0}:{},note:t=>s.note(t),emitWalkSignal:(t,r,o)=>i.dir===null?c.signals().append(P(t,r,o)):E(i.dir,t,r,o)});return{controller:s,chain:T,inspect:S,reconcile:j,runDeps:t=>({store:c,onExtractLock:r=>{u=r},pendingReconcilePlan:r=>i.dir===null?null:f(i.dir,r),agent:e.agent,tracePath:h,credentials:e.credentials,onIngestRefusal:d,preflightTurn:e.preflight,...e.probe?{probe:e.probe}:{},...e.matchUnreviewed?{matchUnreviewed:!0}:{},...t.onSummary?{onSummary:t.onSummary}:{},ask:r=>s.ask(r),review:async r=>new Map(r.map(o=>[o.temp_ref,{resolution:"skipped"}])),confirmStale:async()=>!0,out:r=>s.note(r),progress:()=>{},isTTY:t.isTTY,auth:e.auth,chat:s,...t.telemetry?{telemetry:t.telemetry}:{}})}}export{M as buildExtractChat};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
2
|
import{a as c}from"./chunk-73Y6T2UK.js";import"./chunk-UR6MHSHU.js";import{existsSync as l}from"fs";async function f(e){if(e.mode!=null&&!["interactive","agent","ci","override"].includes(e.mode)){let{makeHeadlessIO:t,agentRefusal:r}=await import("./headless-io-FFM5T6KL.js");return r(t("ndjson","extract"),`extract: --mode must be interactive | agent | ci | override, got '${e.mode}'`,"MODE_USAGE")}{let{jsonModeRefusal:t}=await import("./headless-io-FFM5T6KL.js"),r=t("extract",e.mode,e.json);if(r!==null)return process.stderr.write(`${r}
|
|
3
3
|
`),2}let i=async(t,r)=>{if(e.mode!=="agent")return process.stderr.write(t+`
|
|
4
|
-
`),2;let{makeHeadlessIO:n,agentRefusal:s}=await import("./headless-io-FFM5T6KL.js");return s(n("ndjson","extract"),t,r)};if(e.apply)return i("extract: --apply is not implemented yet \u2014 coming with the plan\u2192apply workflow (run without --apply, or use --plan to preview)");{let{validateResumeMessage:t}=await import("./headless-io-FFM5T6KL.js"),r=t(e,"extract");if(r)return i(r)}{let{linkedAnswerRefused:t}=await import("./gate-
|
|
4
|
+
`),2;let{makeHeadlessIO:n,agentRefusal:s}=await import("./headless-io-FFM5T6KL.js");return s(n("ndjson","extract"),t,r)};if(e.apply)return i("extract: --apply is not implemented yet \u2014 coming with the plan\u2192apply workflow (run without --apply, or use --plan to preview)");{let{validateResumeMessage:t}=await import("./headless-io-FFM5T6KL.js"),r=t(e,"extract");if(r)return i(r)}{let{linkedAnswerRefused:t}=await import("./gate-AK44VDHC.js"),r=t(e,"context extract");if(r!==null)return r;let{gateStructuredFlags:n}=await import("./structured-answers-EQ2AP3F7.js"),s=n(e,"extract");if(s)return i(s,"STRUCTURED_FLAGS_USAGE")}if(e.withSource&&!e.resume)return i("extract: --with-source pairs with --resume \u2014 it lands the source and sets the resumed session's pending questions aside");if(e.queued)return i("extract: --queued is gone \u2014 extract sweeps every pending source by default (just run kane-cli context extract)");{let{remoteEntry:t}=await import("./remote-entry-BZU4NFNS.js"),{folderFlagsOf:r}=await import("./folder-flags-ZIDJVDKX.js"),n=await t("context extract",e.mode==="agent"||e.json===!0,e.resume,{onboard:e.mode!=="ci"&&e.mode!=="override",...r(e)});if(n!==null){if("exit"in n)return n.exit;let{remoteMode:s}=await import("./remote-mode-NXUKDUXG.js"),o=s("extract",e.mode,"context extract");if(typeof o=="object")return o.exit;if(o==="agent"||o==="override"){let{bindExtractRemote:m}=await import("./extract-bind-LZ22VFKB.js");return m(e,n.choice,o)}let{bindExtractRemoteInteractive:u}=await import("./extract-bind-LZ22VFKB.js");return u(e,n.choice)}}if(!l(c(process.cwd())))return i("error: no context store here (run `kane-cli context ingest <files>` first)","NO_STORE");if(!e.mode&&!process.stdin.isTTY)return process.stderr.write(`extract: no TTY \u2014 pass an explicit --mode agent|ci|override to run headless
|
|
5
5
|
`),2;let a=e.mode??"interactive";if(a==="interactive"){if(!process.stdin.isTTY||!process.stdout.isTTY)return process.stderr.write(`extract: --mode interactive needs a TTY on stdin and stdout (use --mode agent|ci|override headless)
|
|
6
|
-
`),2;let{bindExtractInteractive:t}=await import("./extract-bind-
|
|
6
|
+
`),2;let{bindExtractInteractive:t}=await import("./extract-bind-LZ22VFKB.js");return t(e)}let{bindExtractHeadless:d}=await import("./extract-bind-LZ22VFKB.js");return d({...e,mode:a})}export{f as extractCommand};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a}from"./chunk-6QCCTZO3.js";import"./chunk-47WQBG5I.js";import"./chunk-KM3YCIDV.js";import"./chunk-X52YIWGG.js";import"./chunk-R6TFRAMZ.js";import"./chunk-WEJR2V7R.js";import"./chunk-5F5IVART.js";import"./chunk-IZ66FKPC.js";import"./chunk-GLM5UGTF.js";import"./chunk-VZJ6LUXX.js";import"./chunk-DXIQVBMI.js";import"./chunk-MUX2A37P.js";import"./chunk-W5HFUBXD.js";import"./chunk-63EKRZKI.js";import"./chunk-3JLEDSG5.js";import"./chunk-T77LTLAD.js";import"./chunk-73ZFOJOK.js";import"./chunk-EZMRWXRT.js";import"./chunk-3KY7HHQU.js";import"./chunk-Z55KBMYV.js";import"./chunk-LD5B3QFW.js";import"./chunk-32HED7X2.js";import"./chunk-YNDELIXL.js";import"./chunk-ZHAMVLQZ.js";import"./chunk-SIHX5FW5.js";import"./chunk-X7S7IGCV.js";import"./chunk-2RUSXQ3O.js";import"./chunk-CB344EDO.js";import"./chunk-FNUGDPTS.js";import"./chunk-ZDCXWEQG.js";import"./chunk-L3BUPFAQ.js";import"./chunk-GBQ4K25P.js";import"./chunk-PGESS7BW.js";import"./chunk-FWGUISUG.js";import"./chunk-Z24SD2EJ.js";import"./chunk-AQ2OG2EF.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-LLQWEGXD.js";import"./chunk-ZCIWQHCO.js";import"./chunk-XB6BJPDL.js";import"./chunk-CQDCNP7V.js";import"./chunk-TD6GCEIK.js";import"./chunk-EBJW6POT.js";import"./chunk-PVN64537.js";import"./chunk-22PIMG52.js";import"./chunk-4C7WVQOD.js";import"./chunk-7YV2FCN4.js";import"./chunk-QSCXXNC2.js";import"./chunk-6PIIUAZF.js";import"./chunk-PI7OXS62.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-7V4BQSSV.js";import"./chunk-ZAQGIC33.js";import"./chunk-VO66KP2W.js";import"./chunk-G4K3TP2I.js";import"./chunk-YJAQZMJT.js";import"./chunk-HYJVYYAZ.js";import"./chunk-GMTHZUZ3.js";import"./chunk-UJLULWSR.js";import"./chunk-ZCRZFAOT.js";import"./chunk-ZCBOHWN3.js";import"./chunk-RZ4F3BHX.js";import"./chunk-TM45NPWL.js";import"./chunk-J4FIESTB.js";import"./chunk-UR6MHSHU.js";export{a as headlessExtract};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d}from"./chunk-
|
|
2
|
+
import{a,b,c,d}from"./chunk-LZGAFKYH.js";import"./chunk-LX2I4JEH.js";import"./chunk-XB6BJPDL.js";import"./chunk-VJGWVBZR.js";import"./chunk-PI7OXS62.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-7V4BQSSV.js";import"./chunk-ZAQGIC33.js";import"./chunk-YJAQZMJT.js";import"./chunk-HYJVYYAZ.js";import"./chunk-UR6MHSHU.js";export{a as archiveImpact,b as heldArchiveScan,c as reviewCards,d as reviewCounts};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b}from"./chunk-GQAWZEA4.js";import"./chunk-XMPTFXPW.js";import"./chunk-SB26HQO7.js";import"./chunk-3G2LSTK5.js";import"./chunk-WE7HRAGO.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import"./chunk-RQKMSNEU.js";import"./chunk-4C7WVQOD.js";import"./chunk-QXQ7KVEN.js";import"./chunk-Z47ZEFH7.js";import"./chunk-7YV2FCN4.js";import"./chunk-QSCXXNC2.js";import"./chunk-6PIIUAZF.js";import"./chunk-PI7OXS62.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-7V4BQSSV.js";import"./chunk-ZAQGIC33.js";import"./chunk-VO66KP2W.js";import"./chunk-G4K3TP2I.js";import"./chunk-YJAQZMJT.js";import"./chunk-HYJVYYAZ.js";import"./chunk-UJLULWSR.js";import"./chunk-ZCRZFAOT.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-J4FIESTB.js";import"./chunk-UR6MHSHU.js";export{a as decideFolderFlags,b as folderFlagsOf};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{N as j,O as we,Q as Re}from"./chunk-OZNYQONA.js";import"./chunk-7Y55CO42.js";import"./chunk-YILRYMMG.js";import"./chunk-BSRSXYDZ.js";import"./chunk-CB4ARIHR.js";import{a as W,h as D,i as H,k as z,l as ge,m as fe,n as F,o as J,p as q,q as me,r as he}from"./chunk-MEMXFTLD.js";import"./chunk-UWPG5MWM.js";import"./chunk-73Y6T2UK.js";import"./chunk-XMPTFXPW.js";import{f as se}from"./chunk-Z36KVIRR.js";import"./chunk-Q4JV4U65.js";import"./chunk-SMXABALN.js";import"./chunk-WN5VKKJ3.js";import{b as xe,c as _e}from"./chunk-23DKB2MT.js";import{c as be}from"./chunk-VRIZDOO5.js";import{a as ye}from"./chunk-ZHWU6L2G.js";import{a as U,b as de,c as N,d as pe}from"./chunk-FOLUB336.js";import{d as ve}from"./chunk-CQDCNP7V.js";import"./chunk-7V34ZMMS.js";import"./chunk-B7ZX5HEN.js";import"./chunk-6PIIUAZF.js";import{T as ae,U as le,vb as ue}from"./chunk-PI7OXS62.js";import{c as re,e as oe,g as ie,n as ce}from"./chunk-DBMW3VUN.js";import{f as $,g as G}from"./chunk-KU3YHPWZ.js";import"./chunk-7V4BQSSV.js";import"./chunk-ZAQGIC33.js";import"./chunk-G4K3TP2I.js";import"./chunk-YJAQZMJT.js";import"./chunk-HYJVYYAZ.js";import"./chunk-VZ7KXRXB.js";import"./chunk-UJLULWSR.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-A7RJQJNT.js";import"./chunk-HCBYKLMW.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-J4FIESTB.js";import"./chunk-UR6MHSHU.js";function ke(e){let t=e.byLabel($.USECASE).filter(({cid:u})=>U(e,u)),n=new Map(t.map(({cid:u})=>[u,[]]));for(let{cid:u}of e.byLabel($.AC)){if(!U(e,u))continue;let d=N(e,u),c=d?n.get(d):void 0;c&&c.push({designed:de(e,u),stale:e.stale(u)!=="fresh"})}let s={},i=0,m=0,a=0,f=0,x=new Set;for(let{cid:u}of e.byLabel($.SCENARIO))if(U(e,u))for(let d of e.edgesFrom(u))d.type===G.BELONGS_TO&&x.add(e.tipOf(d.dst));for(let{cid:u}of t){let d=n.get(u);m+=d.length;let c=d.filter(p=>p.designed).length;i+=c;let v=d.filter(p=>p.stale).length,o=x.has(u);o||f++;let l=d.length===0||c===0?"undesigned":c===d.length&&v===0&&o?"complete":"partial";l==="complete"&&a++,s[e.displayNameOf(u)??u]={status:l,staleAcs:v}}return{acs_designed:`${i}/${m}`,usecases_complete:`${a}/${t.length}`,ucs_needing_scenarios:f,perUc:s,config:{criterion:"live_verifies_edge",freshness:"not_discounted"}}}var De={[$.USECASE]:"use case",[$.AC]:"criterion",[$.SCENARIO]:"scenario",[$.TEST]:"test"},X=e=>{let t=ye(e);return t===null?null:t.replace(/\|/g,"/")};function Ne(e,t){let n=e.tipOf(t);return U(e,n)?n:null}function $e(e,t,n){let s=[],i=[...e.heads.entries()].filter(u=>typeof u[1]=="string").sort(([u],[d])=>u<d?-1:u>d?1:0),m=null,a=u=>{if(m===null){m=new Map;for(let{cid:d}of e.byLabel($.AC)){if(!U(e,d))continue;let c=N(e,d);c!==null&&m.set(c,[...m.get(c)??[],d])}}return m.get(u)??[]},f=(u,d)=>{if(d===$.USECASE)return a(u);if(d===$.AC)return[u];let c=d===$.SCENARIO?G.EXERCISES:d===$.TEST?G.VERIFIES:null;return c===null?[]:e.edgesFrom(u).filter(o=>o.type===c).map(o=>Ne(e,o.dst)).filter(o=>o!==null&&e.nodeLabel.get(o)===$.AC)},x=[];for(let u of[$.USECASE,$.AC,$.SCENARIO,$.TEST])for(let{cid:d}of e.byLabel(u)){if(!U(e,d))continue;let c=new Map;for(let v of e.derivesInto(d)){let o=v.props.source_id;typeof o=="string"&&c.set(o,[...c.get(o)??[],v])}c.size>0&&x.push({cid:d,label:u,name:e.displayNameOf(d)??d,bySource:c})}x.sort((u,d)=>u.name<d.name?-1:u.name>d.name?1:0);for(let[u,d]of i){let c=e.mediaOf(d)?.plugin;if(c===void 0||typeof c.index!="string")continue;let v=ce(t(c.index));if(v===null)continue;let o=v.units.filter(_=>_.id!==re),l=o.map(_=>_.id),p=be(t,c,l),g=p===null?l:p.expected,b=new Map((p?.groups??[]).flatMap(_=>_.units.map(S=>[S,_.name]))),h=oe(d,_=>e.mediaOf(_)?.plugin),y=new Map;for(let _ of x){let S=_.bySource.get(u);if(S===void 0)continue;let M=new Set(S.flatMap(T=>Array.isArray(T.props.units)?T.props.units:[]));if(M.size===0)continue;let I=new Set(h===null?M:ie(S,h).failing);for(let T of M)y.set(T,[...y.get(T)??[],{item:_,fresh:!I.has(T)}])}let w=e.extractionCompleteness.get(u),E=w?.source_cid===d&&(w.completeness==="complete"||w.completeness==="partial")?w.completeness:"none",C=new Map(o.map(_=>[_.id,_.label])),r=g.map(_=>{let S=y.get(_)??[],M=[...new Set(S.flatMap(({item:k})=>f(k.cid,k.label)))],I=M.filter(k=>J(e,k).length>0),T=k=>n?.perAc[e.nameOf.get(k)??k]?.state??"not_run",O=I.filter(k=>T(k)==="proven"||T(k)==="failing").length,B=I.filter(k=>T(k)==="proven").length;return{unit:_,cited:S.map(({item:k,fresh:Y})=>({item:k.name,kind:De[k.label],fresh:Y})),criteria:M.length,designed:I.length,run:O,passed:B,gap:S.length===0?"uncited":I.length===0?"untested":null,forPeople:{label:X(C.get(_)),group:X(b.get(_))}}}),R=(p?.groups??[]).map(_=>X(_.name)).filter(_=>_!==null);s.push({sourceId:u,plugin:c.id,units:l.length,plan:p===null?"every":"plugin",expected:g.length,extraction:E,rows:r,forPeople:{groups:R}})}return s}function Q(e){let t=e.flatMap(n=>n.rows);return{expected:t.length,tested:t.filter(n=>n.designed>0).length,proven:t.filter(n=>n.designed>0&&n.passed===n.designed).length}}var We=["failing","blocked","needs-refresh","needs-tests","needs-scenarios","happy-only","possible-duplicate","not-yet-run"],je={failing:"failing",blocked:"blocked","needs-refresh":"needs refresh","needs-tests":"needs tests","needs-scenarios":"needs scenarios","happy-only":"happy path only","possible-duplicate":"possible duplicate","not-yet-run":"not yet run"},P={high:0,med:1,low:2};function A(e){if(!e||/^sha256:/.test(e))return"(unnamed)";let t=/^(uc|ac|sc|t)-(\d+)$/.exec(e);return t?`${t[1].toUpperCase()}-${t[2]}`:e}function Le(e,t=5){let n=e.trim().split(/\s+/);return n.slice(0,t).join(" ")+(n.length>t?"\u2026":"")}function Pe(e,t){let n=e.resolve(t),s=n?e.getNode(e.tipOf(n.cid))?.content:null;return String(s?.title??s?.text??"")}function Ce(e,t){let n=e.resolve(t);return{id:n?e.displayNameOf(e.tipOf(n.cid))??e.displayNameOf(n.cid):null,title:Le(Pe(e,t),8)}}function Fe(e,t){let n=e.resolve(t);if(!n)return null;let s=e.tipOf(n.cid);if(!U(e,s))return null;let i=e.nodeLabel.get(s);if(i===$.USECASE)return s;if(i===$.AC)return N(e,s);if(i===$.TEST){let m=e.edgesFrom(s).find(f=>f.type===G.VERIFIES&&U(e,f.dst));if(m)return N(e,m.dst);let a=e.edgesFrom(s).find(f=>f.type===G.AUTOMATES&&U(e,f.dst));if(a){let f=e.edgesFrom(a.dst).find(x=>x.type===G.BELONGS_TO&&U(e,x.dst));return f?f.dst:null}}return null}function Z(e){if(e.tag==="reuse-candidate"&&e.stage==="design")return"possible-duplicate";switch(e.kind){case"no-verifies":return"needs-tests";case"zero-scenario":return"needs-scenarios";case"happy-only":return"happy-only";case"stale-ac":case"stale-test":return"needs-refresh";case"execution-failed":return"failing";case"execution-blocked":return"blocked";case"covered-not-run":return"not-yet-run";default:return"other"}}function Be(e,t){let n=e.resolve(t),s=n?e.getNode(e.tipOf(n.cid))?.content.risk:null;return s==="high"||s==="med"||s==="low"?s:"med"}function te(e,t,n){let s=new Map;for(let[i,m]of Object.entries(t.perAc)){if(m.state!=="failing"&&m.state!=="not_run")continue;let a=e.resolve(i);if(!a)continue;let f=e.tipOf(a.cid),x=J(e,f);if(m.state==="failing"){let d=c=>q(e,n,f,[c]).some(v=>v.executionId===m.deciding_run&&v.verdict==="failed");s.set(i,{state:"failing",...m.deciding_run?{executionId:m.deciding_run}:{},viaTests:x.filter(d).map(c=>F(e,c))});continue}let u=me(q(e,n,f,x));s.set(i,u?{state:"blocked",executionId:u.executionId,viaTests:[]}:{state:"not_run",viaTests:[]})}return s}function Oe(e,t,n,s,i){let m=i.servePaths??new Map,a=i.work??te(e,s,z(e)),f=s.note!=="nothing_run_yet"||[...a.values()].some(o=>o.state==="blocked"),x=new Map(ge(e).inScope.map(o=>[F(e,o),o])),u=new Map([...x.values()].map(o=>[o,[]])),d=[];for(let o of t){if(o.stage!=="design")continue;let l={...o,...Ce(e,o.ref)},p=Fe(e,o.ref),g=p?u.get(p):void 0;g&&Z(o)!=="other"?g.push(l):d.push(l)}let c=new Map;for(let o of Object.values(s.perAc))o.state!=="not_designed"&&c.set(o.uc,(c.get(o.uc)??0)+1);for(let[o,l]of a){let p=u.get(x.get(s.perAc[o].uc)??"");if(!p)continue;let{id:g,title:b}=Ce(e,o),h={ref:o,id:g,title:b,risk:Be(e,o),stage:"cover"},y=l.executionId!==void 0?m.get(l.executionId):void 0,w={ready_command:y!==void 0?`kane-cli evidence serve ${y}`:"kane-cli testrun run",...l.executionId!==void 0?{execution_id:l.executionId}:{},...y!==void 0?{servePath:y}:{}};l.state==="failing"?p.push({...h,kind:"execution-failed",tag:"evolve",why:"covering test failed against this AC",...w,via_tests:l.viaTests,...i.testFiles?{viaFiles:l.viaTests.map(E=>i.testFiles.get(E)??null)}:{}}):l.state==="blocked"?p.push({...h,kind:"execution-blocked",tag:"reuse-candidate",why:"its test ran, but every run broke or was skipped, so none counts",...w}):f&&p.push({...h,kind:"covered-not-run",tag:"reuse-candidate",why:"a covering test exists but has not run yet",ready_command:"kane-cli testrun run"})}let v=[];for(let o of s.perUc){let l=x.get(o.id);if(l===void 0)continue;let p=n.perUc[o.id]??{status:"undesigned",staleAcs:0},g=u.get(l)??[],b=new Set(g.filter(y=>Z(y)==="needs-refresh").map(y=>y.ref)),h=[];for(let y of We){let w=g.filter(C=>Z(C)===y);if(y==="needs-tests"&&(w=w.filter(C=>!b.has(C.ref))),w.length===0)continue;w.sort((C,r)=>(P[C.risk]??3)-(P[r.risk]??3)||W(C.ref,r.ref));let E=y==="failing"||y==="blocked"||w.length<=2||new Set(w.map(C=>C.ready_command)).size>1;h.push({key:y,label:je[y],...y==="needs-refresh"?{suffix:"source moved since these were designed"}:{},rows:w,...E?{}:{rosterCommand:w[0].ready_command}})}v.push({slug:o.id,title:o.title,risk:o.risk,cov:o,designed:c.get(o.id)??0,des:p,groups:h})}return v.sort((o,l)=>(P[o.risk]??3)-(P[l.risk]??3)||W(o.slug,l.slug)),d.sort((o,l)=>(P[o.risk]??3)-(P[l.risk]??3)||W(o.ref,l.ref)),{stage:i.stage,top:i.top,dc:n,coverage:s,ran:f,ucs:v,other:d,...i.units&&i.units.length>0?{units:i.units}:{}}}function ee(e,t){return e==="all"||t.stage===e}function L(e,t){return e.length<=t?e:t<=1?e.slice(0,t):e.slice(0,t-1)+"\u2026"}var Ye={failing:"failing",blocked:"blocked","needs-refresh":"stale","needs-tests":"needs test","needs-scenarios":"no scenario","happy-only":"happy only","possible-duplicate":"duplicate?","not-yet-run":"to run"},ze=["failing","blocked","needs-refresh","needs-tests","needs-scenarios","happy-only","possible-duplicate"];function Je(e,t,n){return(t.get("failing")??[]).length?0:(t.get("blocked")??[]).length?1:(t.get("needs-tests")??[]).length||(t.get("needs-scenarios")??[]).length?2:(t.get("needs-refresh")??[]).length?3:(t.get("not-yet-run")??[]).length>0||n&&e.cov.state==="not_run"?4:5}function Ue(e,t){let n=new Map;for(let c of t.groups)c.rows.length&&n.set(c.key,c.rows);let s=new Map;for(let c of t.groups){let v=c.rows.filter(o=>ee(e.stage,o));v.length&&s.set(c.key,v)}let i=[],m=[],a=[],f=new Set;for(let c of ze){let v=s.get(c);if(v){for(let o of v){let l=c==="failing"&&o.via_tests?.length?` \xB7 via ${o.via_tests.map(p=>A(p)).join(", ")}`:"";i.push({id:o.ref===t.slug?"\u2014":A(o.id??o.ref),cls:Ye[c],risk:o.ref===t.slug?"\u2014":o.risk,title:(o.ref===t.slug?o.why:o.title)+l})}if(c==="failing"||c==="blocked")for(let o of v)o.servePath&&f.add(`kane-cli evidence serve ${o.servePath}`);for(let o of v)o.ready_command&&!o.ready_command.startsWith("kane-cli evidence serve")&&o.ready_command!=="kane-cli testrun run"&&f.add(o.ready_command)}}let x=[...f].sort((c,v)=>Number(v.startsWith("kane-cli evidence serve"))-Number(c.startsWith("kane-cli evidence serve")));m.push(...x.map(c=>`\u21B3 ${c}`));let u=n.get("not-yet-run")??[],d=e.ran?u.length:t.designed;return e.ran&&d>0&&a.push(`${d} to run`),{uc:t,rows:i,spans:m,tails:a,toRun:d,severity:Je(t,n,e.ran)}}var Ke=e=>`${e} use-case${e===1?"":"s"}`,Ee=e=>`${e} ${e===1?"criterion":"criteria"}`;function Ve(e,t){let n=t!==void 0?`"${t}"'s`:"this folder's",s=e.note==="nothing_run_yet"?" \xB7 nothing run yet":"";return`coverage: ${Math.round(e.pct)}% across ${n} ${Ke(e.usecases.total)}${s} \xB7 ${H(e)} of ${e.usecases.total} designed`}var He={proven:"\x1B[32m",partial:"\x1B[33m",not_run:"\x1B[33m",failing:"\x1B[31m",not_designed:"\x1B[31m",no_criteria:"\x1B[2m"};function Se(e){return`${Math.round(e.pct)}% ${D[e.state]}`}function Ae(e,t){let{dc:n,coverage:s}=e,i=Math.max(80,Math.min(t.width,100)),m=r=>t.color?`\x1B[2m${r}\x1B[22m`:r,a=[Ve(s,t.project)],f=e.units??[];if(f.length>0){let r=Q(f);a.push(`units ${r.tested}/${r.expected} expected units have a test \xB7 ${r.proven} proven`)}a.push("");let x=e.ucs.map(r=>Ue(e,r));x.sort((r,R)=>r.severity-R.severity||W(r.uc.slug,R.uc.slug));let u=x.some(r=>r.rows.length||r.spans.length||r.tails.length||e.ran&&r.toRun>0),d=r=>{let[R,_]=r.split("/").map(Number);return _>0&&R===_},c=s.criteria.total>0&&s.criteria.proven===s.criteria.total,v=f.some(r=>r.rows.some(R=>R.gap!==null));if(!u&&!v&&d(n.acs_designed)&&(!e.ran||c)){let r=e.ucs.length,R=`use-case${r===1?"":"s"}`;return a.push(e.ran?`no gaps \u2014 all ${r} ${R} designed and proven`:`no gaps \u2014 all ${r} ${R} designed \xB7 nothing run yet`),f.length>0&&a.push("",...K(f,i)),a.push(m("inspect a use-case: kane-cli cover gaps <uc-id>")),a}let o=(r,R)=>r.groups.filter(_=>R.includes(_.key)).reduce((_,S)=>_+S.rows.length,0),l=x.map(r=>({band:r,failing:o(r.uc,["failing"]),blocked:o(r.uc,["blocked"]),stale:o(r.uc,["needs-refresh"]),design:o(r.uc,["needs-tests","needs-scenarios"]),run:r.toRun})),p=[];l.some(r=>r.failing)&&p.push({hdr:"FAILING",get:r=>r.failing}),l.some(r=>r.blocked)&&p.push({hdr:"BLOCKED",get:r=>r.blocked}),l.some(r=>r.stale)&&p.push({hdr:"STALE",get:r=>r.stale}),l.some(r=>r.design)&&p.push({hdr:"TO DESIGN",get:r=>r.design}),l.some(r=>r.run)&&p.push({hdr:"TO RUN",get:r=>r.run}),i<100&&(p.length=0);let g=r=>r.cov.criteria===0?"\u2014":`${r.designed} of ${r.cov.criteria}`,b=Math.min(16,Math.max(4,...x.map(r=>A(r.uc.slug).length))),h=Math.max(8,...x.map(r=>g(r.uc).length)),y=Math.max(8,...x.map(r=>Se(r.uc.cov).length)),w=p.map(r=>r.hdr.length+2),E=i-b-2-3-h-3-y-w.reduce((r,R)=>r+R,0)-2,C=`${" ".repeat(b+2)}${"USE CASE".padEnd(E+3)}${"DESIGNED".padEnd(h)} ${"COVERAGE".padEnd(y)}`+p.map((r,R)=>r.hdr.padStart(w[R])).join("");a.push(m(C.trimEnd().slice(0,i)));for(let r of l){let R=r.band.uc,_=Se(R.cov).padEnd(y),S=t.color?`${He[R.cov.state]}${_}${R.cov.state==="no_criteria"?"\x1B[22m":"\x1B[39m"}`:_,M=p.map((I,T)=>String(I.get(r)||"\u2014").padStart(w[T])).join("");a.push(`${L(A(R.slug),b).padEnd(b)} ${L(R.title,E).padEnd(E)} ${g(R).padEnd(h)} ${S}${M}`)}return a.push(""),f.length>0&&a.push(...K(f,i)),a.push(m("inspect a use-case: kane-cli cover gaps <uc-id>")),a}var Me=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`;function qe(e){let t=e.cited.map(n=>`${A(n.item)} (${n.fresh?"fresh":"stale"})`).join(", ");return e.gap==="uncited"?"no test \xB7 no use case cites this unit":e.gap==="untested"?`no test \xB7 cited by ${t}; no test verifies it`:`${Me(e.criteria,"criterion","criteria")} \xB7 ${e.designed} designed \xB7 ${e.run} run \xB7 ${e.passed} passed \xB7 cited by ${t}`}function K(e,t){let n=[];for(let s of e){let i=s.rows.filter(c=>c.designed>0).length,m=s.extraction==="none"?"no extraction recorded for this version":`this version's extraction is recorded ${s.extraction}`;n.push(L(`units of ${s.sourceId} (plugin ${s.plugin}) \xB7 ${i}/${s.expected} expected units have a test`,t)),n.push(` ${m}`),s.plan==="every"?n.push(" every unit is expected: the plugin gives no coverage plan"):s.expected<s.units&&n.push(` the plugin ${s.plugin} expects tests for ${s.expected} of ${Me(s.units,"unit")}`);let a=Math.min(24,Math.max(4,...s.rows.map(c=>c.unit.length))),f=Math.min(40,Math.max(0,...s.rows.map(c=>(c.forPeople.label??"").length))),x=(c,v)=>`${v}${L(c.unit,a).padEnd(a)} ${f>0?`${L(c.forPeople.label??"",f).padEnd(f)} `:""}${qe(c)}`,u=new Map(s.forPeople.groups.map(c=>[c,[]])),d=[];for(let c of s.rows)c.forPeople.group===null?d.push(c):u.set(c.forPeople.group,[...u.get(c.forPeople.group)??[],c]);for(let[c,v]of u)if(v.length!==0){n.push(L(` ${c}`,t));for(let o of v)n.push(x(o," "))}for(let c of d)n.push(x(c,u.size>0?" ":" "));n.push("")}return n}function Ie(e,t,n,s){let i=Math.max(80,Math.min(s.width,100)),m=l=>s.color?`\x1B[2m${l}\x1B[22m`:l,a=[],f=e.ucs.find(l=>l.slug===t);a.push(f?`${A(t)} "${f.title}": ${Math.round(f.cov.pct)}%, ${D[f.cov.state]}`:A(t));let x=Math.min(16,Math.max(4,...n.map(l=>A(l.id).length))),u=Math.max(0,...n.map(l=>l.state.length)),d=Math.min(Math.max(20,i-2-x-2-2-u),Math.max(0,...n.map(l=>l.text.length))),c=l=>{if(!s.color)return l;let p=l==="proven"?"\x1B[32m":l==="failing"||l==="not designed"?"\x1B[31m":"\x1B[2m";return`${p}${l}${p==="\x1B[2m"?"\x1B[22m":"\x1B[39m"}`};for(let l of n){let p=[],g="";for(let b of l.text.split(/\s+/))g&&g.length+1+b.length>d?(p.push(g),g=b):g=g?`${g} ${b}`:b;p.push(g),p.forEach((b,h)=>{h===0?a.push(` ${L(A(l.id),x).padEnd(x)} ${b.padEnd(d)} ${c(l.state)}`):a.push(` ${" ".repeat(x+2)}${b}`)})}let v=[],o=f?Ue(e,f):null;if(o){for(let p of o.spans){let g=p.replace(/^↳ /,"");if(g.startsWith("kane-cli evidence serve")){let b=n.filter(h=>h.blocked||h.state===D.failing).map(h=>A(h.id)).join(" \xB7 ");v.push({label:"see why",cmd:g,...b?{note:`(explains ${b})`}:{}})}else v.push({label:"design",cmd:g})}let l=n.filter(p=>p.state===D.not_run&&!p.blocked).length;if(l>0){let g=n.some(b=>b.state===D.failing)?"(review evidence first \u2014 a re-run may heal over failures)":v.some(b=>b.label==="see why")?`(${Ee(l)} not run \u2014 see why first)`:`(${Ee(l)} not run)`;v.push({label:"first run",cmd:"kane-cli testrun run",note:g})}}if(v.length){a.push(""),a.push("next");let l=Math.max(...v.map(g=>g.label.length))+2,p=g=>s.color?`\x1B[36m${g}\x1B[39m`:g;for(let g of v){let b=` ${g.label.padEnd(l)}`;if(b.length+g.cmd.length>i){let h=g.cmd.lastIndexOf(" ",i-b.length),y=h>0?g.cmd.slice(0,h):g.cmd.slice(0,i-b.length),w=h>0?g.cmd.slice(h+1):g.cmd.slice(i-b.length);a.push(`${b}${p(y)}`),a.push(`${" ".repeat(b.length)}${p(w)}`),g.note&&a.push(m(`${" ".repeat(b.length)}${g.note}`))}else g.note&&b.length+g.cmd.length+3+g.note.length<=i?a.push(`${b}${p(g.cmd)} ${m(g.note)}`):(a.push(`${b}${p(g.cmd)}`),g.note&&a.push(m(`${" ".repeat(b.length)}${g.note}`)))}}return a.push(""),a.push(m("all use-cases: kane-cli cover gaps")),a}function ne(e){let{dc:t,coverage:n}=e,s=i=>e.top!==void 0?i.slice(0,e.top):i;return{stage:e.stage,rollup_version:2,coverage:{pct:n.pct,usecases:n.usecases,criteria:n.criteria,...n.note?{note:n.note}:{}},designed:{usecases:H(n),of:n.usecases.total},design_completeness:{acs_designed:t.acs_designed,usecases_complete:t.usecases_complete,ucs_needing_scenarios:t.ucs_needing_scenarios,config:t.config},usecases:e.ucs.map(i=>({id:/^sha256:/.test(i.slug)?null:i.slug,title:i.title,risk:i.risk,coverage:{pct:i.cov.pct,state:i.cov.state,criteria:i.cov.criteria,proven:i.cov.proven},designed:{criteria:i.designed,of:i.cov.criteria},design_completeness:{status:i.des.status},stale_acs:i.des.staleAcs,pending:s(i.groups.flatMap(m=>m.rows).filter(m=>ee(e.stage,m))).map(Te)})),other:e.other.filter(i=>ee(e.stage,i)).map(Te),...e.units&&e.units.length>0?{units:Xe(e.units)}:{}}}function Xe(e){return{rollup:Q(e),sources:e.map(t=>{let n=new Map(t.forPeople.groups.map((s,i)=>[s,i+1]));return{source_id:t.sourceId,plugin:t.plugin,units:t.units,plan:t.plan,expected:t.expected,extraction:t.extraction,rows:t.rows.map(s=>({unit:s.unit,group:s.forPeople.group===null?null:n.get(s.forPeople.group),criteria:s.criteria,designed:s.designed,run:s.run,passed:s.passed,gap:s.gap,cited:s.cited.map(i=>({item:i.item,kind:i.kind,fresh:i.fresh}))}))}})}}function Te(e){let{servePath:t,viaFiles:n,meta:s,...i}=e;return{...i}}var V="--rollup no longer changes the figure, and goes in a later release";async function Qe(e,t,n=Re(),s=process.cwd()){if(t.mode!==void 0&&t.mode!=="agent"&&t.mode!=="ci"&&t.mode!=="interactive")return j(n,`--mode must be interactive | agent | ci, got '${t.mode}'`),2;if(t.mode==="agent"||t.mode==="ci"){let{makeHeadlessIO:h,agentRefusal:y}=await import("./headless-io-FFM5T6KL.js"),{parsesAgainstGrammar:w}=await import("./next-O6SUSX3R.js"),E=h("ndjson","gaps",{stdout:O=>n.out(O.replace(/\n$/,"")),stderr:O=>(n.err??n.out)(O.replace(/\n$/,""))}),C=[],r=[],R={out:O=>C.push(O),err:O=>r.push(O),confirm:async()=>!1,isTTY:!1};if(await Qe(e,{...t,json:!0,mode:void 0},R,s)!==0)return y(E,r.join("; ")||"cover gaps refused");let S=JSON.parse(C.join(`
|
|
3
|
+
`));t.rollup!==void 0&&E.event({type:"warning",code:"ROLLUP_IGNORED",message:V}),E.event({type:"gaps",...S});let M=[],I=new Set,T=(O,B)=>{if(Array.isArray(O)){for(let k of O)T(k,B);return}if(O&&typeof O=="object"){let k=O,Y=typeof k.why=="string"?k.why:B;typeof k.ready_command=="string"&&k.ready_command.startsWith("kane-cli ")&&w(k.ready_command)&&!I.has(k.ready_command)&&(I.add(k.ready_command),M.push({cmd:k.ready_command,why:Y||"close the gap"}));for(let Ge of Object.values(k))T(Ge,Y)}};return T(S,"close the gap"),E.done(0,void 0,M.slice(0,4))}let i=t.stage??"all";if(i!=="design"&&i!=="cover"&&i!=="all")return j(n,`--stage must be design | cover | all, got '${i}'`),2;if(t.top!==void 0&&(!Number.isInteger(t.top)||t.top<1))return j(n,"--top must be a positive integer"),2;if(t.rollup!==void 0&&t.rollup!=="lenient"&&t.rollup!=="strict")return j(n,`--rollup must be lenient | strict, got '${t.rollup}'`),2;let m=we(s,n);if(!m)return 2;let a=ue(m);if(e!==void 0){let h=le(a,e);if(h!==null)return j(n,h),2;e=ae(a,e)}let f=ke(a),x=z(a),u=he({graph:a,runs:x}),d=te(a,u,x),c=await pe(a,"design"),v=new Map;for(let h of d.values()){if(!h.executionId||v.has(h.executionId))continue;let y=await se(h.executionId,s);y&&v.set(h.executionId,Ze(y,s))}let o=new Map;for(let[h,y]of _e(xe(s)))y.length===1&&o.set(h,y[0].split("/").pop());let l=$e(a,h=>ve(m,h),u),p=Oe(a,c,f,u,{stage:i,top:t.top,servePaths:v,testFiles:o,work:d,units:l}),g=()=>{t.rollup!==void 0&&(t.json?n.err?.(`note: ${V}`):n.out(n.isTTY?`\x1B[2mnote: ${V}\x1B[22m`:`note: ${V}`))};if(e!==void 0){let h=a.resolve(e),y=h?a.tipOf(h.cid):null;if(!y||a.nodeLabel.get(y)!==$.USECASE||!U(a,y))return j(n,`no use-case '${e}' in the graph`),2;let w=a.displayNameOf(y)??y;if(g(),t.json){let r=ne(p);return n.out(JSON.stringify({...r,usecases:r.usecases.filter(R=>R.id===w),other:[]},null,2)),0}if(!p.ucs.some(r=>r.slug===w)){let r=String(a.getNode(y)?.content.title??"");return n.out(`${A(w)} "${r}" isn't counted: every source it came from was removed`),n.out(""),n.out(n.isTTY?"\x1B[2mall use-cases: kane-cli cover gaps\x1B[22m":"all use-cases: kane-cli cover gaps"),0}let E=et(a,y,u,d),C=n.isTTY&&process.stdout.columns?process.stdout.columns:100;for(let r of Ie(p,w,E,{width:C,color:n.isTTY}))n.out(r);return 0}if(g(),t.json)return n.out(JSON.stringify(ne(p),null,2)),0;if(u.usecases.total===0){if(n.out("nothing to measure yet \u2014 no live use-cases in the graph"),l.length>0)for(let h of["",...K(l,100)].slice(0,-1))n.out(h);return 0}let b=n.isTTY&&process.stdout.columns?process.stdout.columns:100;for(let h of Ae(p,{width:b,color:n.isTTY}))n.out(h);return 0}function Ze(e,t){let n=t.endsWith("/")?t:t+"/";return e.startsWith(n)?e.slice(n.length):e}function et(e,t,n,s){let i=[];for(let m of fe(e,new Set([t])).get(t)??[]){let a=F(e,m),f=e.getNode(m)?.content??{};i.push({id:a,state:D[n.perAc[a]?.state??"not_designed"],text:String(f.text??f.title??""),...s.get(a)?.state==="blocked"?{blocked:!0}:{}})}return i.sort((m,a)=>W(m.id,a.id)),i}export{Qe as gapsCommand};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"./chunk-4CJQ7XZP.js";import"./chunk-3RO2YGKH.js";import"./chunk-73Y6T2UK.js";import"./chunk-XMPTFXPW.js";import"./chunk-REKHAN53.js";import"./chunk-WE7HRAGO.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import"./chunk-RQKMSNEU.js";import"./chunk-4C7WVQOD.js";import"./chunk-QXQ7KVEN.js";import"./chunk-Z47ZEFH7.js";import"./chunk-7YV2FCN4.js";import"./chunk-QSCXXNC2.js";import"./chunk-6PIIUAZF.js";import"./chunk-PI7OXS62.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-7V4BQSSV.js";import"./chunk-ZAQGIC33.js";import"./chunk-VO66KP2W.js";import"./chunk-G4K3TP2I.js";import"./chunk-YJAQZMJT.js";import"./chunk-HYJVYYAZ.js";import"./chunk-UJLULWSR.js";import"./chunk-ZCRZFAOT.js";import"./chunk-ZCBOHWN3.js";import"./chunk-RZ4F3BHX.js";import"./chunk-TM45NPWL.js";import"./chunk-FOJHSG5M.js";import"./chunk-J4FIESTB.js";import"./chunk-UR6MHSHU.js";export{d as ASSURANCE_GROUPS,b as ONBOARDING_VERBS,a as REMOTE_VERBS,c as TEST_RUN_VERBS,m as agentAsked,h as answerGate,n as installRemoteGate,i as linkedAnswerRefused,j as linkedLines,k as printPair,g as printReadFailure,f as printRefusal,e as remoteGate,l as wrap};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{h as a,i as b,j as c}from"./chunk-LTPOMMAB.js";import"./chunk-E4GIGM5V.js";import"./chunk-LD5B3QFW.js";import"./chunk-ZHAMVLQZ.js";import"./chunk-ZCIWQHCO.js";import"./chunk-PI7OXS62.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-7V4BQSSV.js";import"./chunk-ZAQGIC33.js";import"./chunk-YJAQZMJT.js";import"./chunk-HYJVYYAZ.js";import"./chunk-UR6MHSHU.js";export{a as designFactFor,c as designGate,b as designedState};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as P,f as $,g as G,h as N,j as M,k as B,l as L,m as I,n as U,o as F,p as z,r as O,s as C,t as _,u as K,v as J}from"./chunk-
|
|
2
|
+
import{a as P,f as $,g as G,h as N,j as M,k as B,l as L,m as I,n as U,o as F,p as z,r as O,s as C,t as _,u as K,v as J}from"./chunk-OBNVGD5H.js";import{a as k}from"./chunk-Q4SMITTV.js";import{d as x}from"./chunk-ZIHQ5JGB.js";import"./chunk-72KYMWQ5.js";import"./chunk-CCOD4GQJ.js";import"./chunk-JQ64X2TO.js";import"./chunk-ULIIYKZB.js";import"./chunk-TDPWFYTJ.js";import"./chunk-X45RZIAJ.js";import{b as A}from"./chunk-LV7224DG.js";import{h as H}from"./chunk-BBJAKSA7.js";import"./chunk-VE3SUJMA.js";import"./chunk-5D7ENQTQ.js";import"./chunk-SB26HQO7.js";import"./chunk-C4KAPGBS.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-NRAPCFI2.js";import"./chunk-Z7S3IWUX.js";import"./chunk-4JOD47QI.js";import"./chunk-KCXLRR3Q.js";import"./chunk-PCQK62MP.js";import"./chunk-FCD3NYOM.js";import"./chunk-3G2LSTK5.js";import"./chunk-TD6GCEIK.js";import"./chunk-PVN64537.js";import{d as T}from"./chunk-Z47ZEFH7.js";import"./chunk-HYJVYYAZ.js";import"./chunk-VZ7KXRXB.js";import"./chunk-GMTHZUZ3.js";import{n as E,o as q}from"./chunk-UJLULWSR.js";import"./chunk-ZCRZFAOT.js";import{a as R}from"./chunk-ZCBOHWN3.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-2XW33VOK.js";import"./chunk-7HO4NX5W.js";import"./chunk-A7RJQJNT.js";import{a as j}from"./chunk-TM45NPWL.js";import"./chunk-J4FIESTB.js";import"./chunk-UR6MHSHU.js";import{join as se}from"path";async function V(t){let e=t.projectId,n=t.folderId,r=null;if(!e&&t.autoResolve){let l=await t.resolver.resolve();if(!l)throw new G("unauthorized; run `kane-cli login`");let u=await H({creds:t.autoResolve.creds,config:t.autoResolve.config,profile:t.autoResolve.profile,env:t.autoResolve.envName,tmsCreds:{username:l.username,access_key:l.access_key},isLocal:!1,log:t.log});u.status==="ok"&&(e=u.projectId,n=n??u.folderId,u.autoDefaulted&&(r={projectId:u.autoDefaulted.projectId,projectName:u.autoDefaulted.projectName,folderId:u.autoDefaulted.folderId,folderName:u.autoDefaulted.folderName}))}return{baseUrl:`${t.env.testGeneratorBaseUrl}/test-generator/api/v2`,tmsBaseUrl:t.env.tmsBaseUrl,authResolver:t.resolver,projectId:e,folderId:n,suiteName:t.suiteName,autoDefaulted:r,log:t.log}}function Z(t){return t.reduce((e,n)=>e+(n.test_cases?.length??0),0)}var y=class{constructor(e=n=>process.stdout.write(n)){this.write=e}emit(e){this.write(JSON.stringify(e)+`
|
|
3
3
|
`)}onStart(e){this.emit({type:"generate_start",request_id:e.requestId,objective_chars:e.objectiveChars,scenario_limit:e.scenarioLimit,per_scenario_limit:e.perScenarioLimit,is_refine:e.isRefine})}onUpload(e){this.emit({type:"generate_upload",file:e.file,index:e.index,total:e.total,status:e.status})}onThinking(e){this.emit({type:"generate_thinking",took_ms:e.tookMs})}onProgress(e){this.emit({type:"generate_progress",pct:e})}onSnapshot(e){this.emit({type:"generate_snapshot",scenario_count:e.scenarios.length,case_count:Z(e.scenarios),scenarios:e.scenarios})}onClarification(e){this.emit({type:"generate_clarification",text:e})}onChat(e){this.emit({type:"generate_chat",text:e})}onError(e){this.emit({type:"error",message:e})}onSaveResult(e){this.emit({type:"generate_save_result",suite_dir:e.suiteDir,saved:e.saved,fell_back:e.fellBack,...e.warning?{warning:e.warning}:{}})}onDone(e){this.emit({type:"generate_done",request_id:e.requestId,status:e.status,scenario_count:e.scenarioCount,case_count:e.caseCount,refine_hint:e.refineHint,save_hint:e.saveHint,...e.suiteDir?{suite_dir:e.suiteDir}:{}})}onUpdateAvailable(e){this.emit({type:"update_available",current:e.current,latest:e.latest,severity:e.severity})}},S=class{constructor(e=n=>process.stdout.write(n)){this.write=e}onStart(e){let n=e.isRefine?"Refining":"Generating";this.write(`${n} (request ${e.requestId})\u2026
|
|
4
4
|
`)}onUpload(e){e.status==="uploading"&&this.write(` uploading ${e.file} (${e.index}/${e.total})
|
|
5
5
|
`)}onThinking(e){let n=e.tookMs?` (${Math.round(e.tookMs/1e3)}s)`:"";this.write(` thinking${n}
|
|
@@ -16,6 +16,6 @@ import{a as P,f as $,g as G,h as N,j as M,k as B,l as L,m as I,n as U,o as F,p a
|
|
|
16
16
|
`),this.write(` Save: ${e.saveHint}
|
|
17
17
|
`),e.suiteDir&&this.write(` Saved: ${e.suiteDir}
|
|
18
18
|
`)}onUpdateAvailable(e){this.write(`(update available: ${e.current} \u2192 ${e.latest})
|
|
19
|
-
`)}};import{createHash as ee}from"crypto";function te(t){return ee("sha1").update(JSON.stringify({t:t.title,p:t.preconditions,m:t.manual_steps})).digest("hex")}function re(t){let e=[];for(let n of t.scenarios)for(let r of n.test_cases??[])I(r)&&r.manual_steps!=null&&e.push(r);return e}async function ne(t,e,n){let r=new Array(t.length),l=0,u=Array.from({length:Math.min(e,t.length)},async()=>{for(;;){let d=l++;if(d>=t.length)return;try{r[d]={ok:!0,value:await n(t[d])}}catch{r[d]={ok:!1}}}});return await Promise.all(u),r}async function Y(t,e,n){let r=re(t),l=n.run??(async(c,s)=>{let m=await n.resolveAuth(),o=F({objective:c,model:n.model,sessionId:n.sessionId,auth:m});return z(o,n.spawnOpts,s)}),u=r.map(te),d=[...new Set(u)],g=new Map;d.forEach(c=>{g.set(c,r[u.indexOf(c)])});let p=d.map(c=>g.get(c)),v=await ne(p,n.concurrency??3,c=>l(U(c))),i=new Map;d.forEach((c,s)=>{let m=v[s];m.ok&&i.set(c,m.value)});let f=new Map;r.forEach((c,s)=>{f.set(c.id,i.get(u[s]))});let a=0;for(let c of t.scenarios)for(let s of c.test_cases??[])I(s)&&!f.get(s.id)&&a++;let w=c=>{let s=f.get(c.id);return s?M(s,c):B(c)};return{...await L(t,e,{suiteName:n.suiteName,redirectBareCwd:!1},w),fellBack:a}}function Pe(t,e){let n=!!t.agent||!!t.refine||!!t.save||!e,r=t.agent?"agent":"plain";return{headless:n,mode:r}}function $e(t){return t.refine&&t.save?{error:"use --refine or --save, not both"}:t.save?t.objective?{error:"--save takes no objective; use --refine to add to a request"}:t.req?{op:"save"}:{error:"--save requires --req <id>"}:t.refine?t.req?t.objective?t.out?{error:"--out is only valid with --save"}:{op:"refine"}:{error:"--refine needs a refinement objective"}:{error:"--refine requires --req <id>"}:t.req?{error:"--req requires --refine or --save"}:t.out?{error:"--out is only valid with --save"}:t.objective?{op:"new"}:{error:"provide an objective, or use --refine/--save with --req"}}function ie(){return se(process.cwd(),".testmuai","tests")}function Ge(t){if(typeof t!="string")return;let e=t.split(",").map(n=>n.trim()).filter(Boolean);return e.length?e:void 0}var X="tcg-generate-headless";function Q(t){return{refineHint:`kane-cli generate "<refinement>" --refine --req ${t}`,saveHint:`kane-cli generate --save --req ${t}`}}function W(t){return t.scenarios.reduce((e,n)=>e+(n.test_cases?.length??0),0)}function oe(t){return t==="completed"?0:t==="stopped"?3:1}async function Ne(t,e){let n=e.write??(i=>process.stdout.write(i)),r=e.sink??(e.mode==="agent"?new y(n):new S(n)),l,u,d=null;try{let i=await e.makeClient();l=i.client,u=i.conn,d=i.autoDefaulted}catch(i){return r.onError(i.message),2}if(e.mode==="agent"&&d){let{buildAutoDefaultedNdjson:i}=await import("./require-project-folder-
|
|
19
|
+
`)}};import{createHash as ee}from"crypto";function te(t){return ee("sha1").update(JSON.stringify({t:t.title,p:t.preconditions,m:t.manual_steps})).digest("hex")}function re(t){let e=[];for(let n of t.scenarios)for(let r of n.test_cases??[])I(r)&&r.manual_steps!=null&&e.push(r);return e}async function ne(t,e,n){let r=new Array(t.length),l=0,u=Array.from({length:Math.min(e,t.length)},async()=>{for(;;){let d=l++;if(d>=t.length)return;try{r[d]={ok:!0,value:await n(t[d])}}catch{r[d]={ok:!1}}}});return await Promise.all(u),r}async function Y(t,e,n){let r=re(t),l=n.run??(async(c,s)=>{let m=await n.resolveAuth(),o=F({objective:c,model:n.model,sessionId:n.sessionId,auth:m});return z(o,n.spawnOpts,s)}),u=r.map(te),d=[...new Set(u)],g=new Map;d.forEach(c=>{g.set(c,r[u.indexOf(c)])});let p=d.map(c=>g.get(c)),v=await ne(p,n.concurrency??3,c=>l(U(c))),i=new Map;d.forEach((c,s)=>{let m=v[s];m.ok&&i.set(c,m.value)});let f=new Map;r.forEach((c,s)=>{f.set(c.id,i.get(u[s]))});let a=0;for(let c of t.scenarios)for(let s of c.test_cases??[])I(s)&&!f.get(s.id)&&a++;let w=c=>{let s=f.get(c.id);return s?M(s,c):B(c)};return{...await L(t,e,{suiteName:n.suiteName,redirectBareCwd:!1},w),fellBack:a}}function Pe(t,e){let n=!!t.agent||!!t.refine||!!t.save||!e,r=t.agent?"agent":"plain";return{headless:n,mode:r}}function $e(t){return t.refine&&t.save?{error:"use --refine or --save, not both"}:t.save?t.objective?{error:"--save takes no objective; use --refine to add to a request"}:t.req?{op:"save"}:{error:"--save requires --req <id>"}:t.refine?t.req?t.objective?t.out?{error:"--out is only valid with --save"}:{op:"refine"}:{error:"--refine needs a refinement objective"}:{error:"--refine requires --req <id>"}:t.req?{error:"--req requires --refine or --save"}:t.out?{error:"--out is only valid with --save"}:t.objective?{op:"new"}:{error:"provide an objective, or use --refine/--save with --req"}}function ie(){return se(process.cwd(),".testmuai","tests")}function Ge(t){if(typeof t!="string")return;let e=t.split(",").map(n=>n.trim()).filter(Boolean);return e.length?e:void 0}var X="tcg-generate-headless";function Q(t){return{refineHint:`kane-cli generate "<refinement>" --refine --req ${t}`,saveHint:`kane-cli generate --save --req ${t}`}}function W(t){return t.scenarios.reduce((e,n)=>e+(n.test_cases?.length??0),0)}function oe(t){return t==="completed"?0:t==="stopped"?3:1}async function Ne(t,e){let n=e.write??(i=>process.stdout.write(i)),r=e.sink??(e.mode==="agent"?new y(n):new S(n)),l,u,d=null;try{let i=await e.makeClient();l=i.client,u=i.conn,d=i.autoDefaulted}catch(i){return r.onError(i.message),2}if(e.mode==="agent"&&d){let{buildAutoDefaultedNdjson:i}=await import("./require-project-folder-3DTI2CVB.js");n(i(d))}try{let i=await(e.checkUpdate??T)();i&&r.onUpdateAvailable(i)}catch{}let g=t.reqId??null;E(X,()=>{g&&l.cancel(g).catch(()=>{})});let p=process.cwd(),v={validate:e.validate??O,upload:e.upload??K,buildMappings:J,onUpload:i=>r.onUpload(i)};try{if(t.op==="save"){let s;try{s=(await l.attach(t.reqId)).state}catch(D){return r.onError(D.message),2}g=s.requestId,r.onSnapshot(s);let m=t.outDir??ie(),o=await e.materialize(s,m,t.suiteName);r.onSaveResult({suiteDir:o.suiteDir,saved:o.paths.length,fellBack:o.fellBack,warning:o.warning});let h=Q(s.requestId);return r.onDone({requestId:s.requestId,status:"completed",scenarioCount:s.scenarios.length,caseCount:W(s),refineHint:h.refineHint,saveHint:h.saveHint,suiteDir:o.suiteDir}),0}let i=t.op==="refine",f,a;if(i){let s;try{s=await l.attach(t.reqId)}catch(o){return r.onError(o.message),2}if(a=s.state,g=a.requestId,a.error)return r.onError(a.error),2;let m;try{m=await _({promptText:t.objective,filePaths:t.files??[],cwd:p,scenarios:a.scenarios,isRefine:!0,conn:u,deps:v})}catch(o){if(o instanceof C){for(let h of o.errors)r.onError(h);return 2}return r.onError(o.message),2}for(let o of m.warnings)process.stderr.write(`warning: ${o}
|
|
20
20
|
`);r.onStart({requestId:a.requestId,objectiveChars:m.promptText.length,scenarioLimit:t.scenarioLimit,perScenarioLimit:t.perScenarioLimit,isRefine:!0});try{await l.chat(t.reqId,m.promptText,{mappings:m.mappings,attachments:m.attachments})}catch(o){return r.onError(o.message),2}f=s.events}else{let s;try{s=await _({promptText:t.objective,filePaths:t.files??[],cwd:p,scenarios:[],isRefine:!1,conn:u,deps:v})}catch(o){if(o instanceof C){for(let h of o.errors)r.onError(h);return 2}return r.onError(o.message),2}for(let o of s.warnings)process.stderr.write(`warning: ${o}
|
|
21
21
|
`);let m;try{m=await l.start({prompt:s.promptText,attachments:s.attachments,scenarioLimit:t.scenarioLimit,perScenarioLimit:t.perScenarioLimit,memoryEnhancement:t.memory})}catch(o){return r.onError(o.message),2}a=m.state,g=a.requestId,r.onStart({requestId:a.requestId,objectiveChars:s.promptText.length,scenarioLimit:t.scenarioLimit,perScenarioLimit:t.perScenarioLimit,isRefine:!1}),f=m.events}let w="";for await(let s of f){switch(a=$(a,s),s.type){case"thinking_done":r.onThinking({tookMs:s.tookMs});break;case"progress":r.onProgress(s.pct);break;case"clarification":r.onClarification(s.text);break;case"chat":r.onChat(s.text);break;case"error":r.onError(s.message);break;case"done":w=s.status;break;default:break}if(s.type==="done"||s.type!=="thinking"&&a.status&&P(a.status))break}r.onSnapshot(a);let b=w||a.status||"completed",c=Q(a.requestId);return r.onDone({requestId:a.requestId,status:b,scenarioCount:a.scenarios.length,caseCount:W(a),refineHint:c.refineHint,saveHint:c.saveHint,suiteDir:void 0}),oe(b)}finally{q(X)}}var ae=()=>{};async function Me(t){let e=new j,n=new A,r=e.getActiveProfile()??"default",l=t.env??e.getDefaultEnv()??"prod",u=R(l),d=new x;t.name&&d.setSessionName(t.name);let g=n.load().model,p=async()=>{let i=await k({creds:e,env:l,usernameFlag:t.username,accessKeyFlag:t.accessKey,log:()=>{}}),f=await V({resolver:i.resolver,env:u,log:ae,projectId:t.projectId,folderId:t.folderId,autoResolve:t.projectId?void 0:{creds:e,config:n,profile:r,envName:l}});return{client:N(f),conn:f,autoDefaulted:f.autoDefaulted??null}},v=async()=>{let i=await k({creds:e,env:l,usernameFlag:t.username,accessKeyFlag:t.accessKey,log:()=>{}});return i.basicAuth?{username:i.basicAuth.username,access_key:i.basicAuth.access_key}:i.token?{auth:{type:"bearer",token:i.token}}:{}};return{mode:t.mode,makeClient:p,materialize:(i,f,a)=>Y(i,f,{model:g,sessionId:d.sessionId,resolveAuth:v,spawnOpts:{environment:l},suiteName:a})}}export{Me as buildHeadlessDeps,Pe as decideGenerateMode,ie as defaultOutDir,Ge as parseFilesFlag,$e as resolveGenerateOp,Ne as runGenerateHeadless};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c}from"./chunk-T77LTLAD.js";import"./chunk-73ZFOJOK.js";import"./chunk-EZMRWXRT.js";import"./chunk-3KY7HHQU.js";import"./chunk-PI7OXS62.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-7V4BQSSV.js";import"./chunk-ZAQGIC33.js";import"./chunk-YJAQZMJT.js";import"./chunk-HYJVYYAZ.js";import"./chunk-UR6MHSHU.js";export{b as extractIntentOf,a as holdEventId,c as landHoldPassthrough};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as ke}from"./chunk-
|
|
2
|
+
import{b as ke}from"./chunk-6SD4XTYC.js";import{d as be}from"./chunk-6HRNG4CK.js";import"./chunk-JBKHX5ES.js";import{Q as ye}from"./chunk-OZNYQONA.js";import"./chunk-7Y55CO42.js";import"./chunk-YILRYMMG.js";import"./chunk-BSRSXYDZ.js";import"./chunk-CB4ARIHR.js";import{k as ee,l as he}from"./chunk-4CJQ7XZP.js";import{a as fe,i as ge}from"./chunk-IEHJG6J4.js";import{a as K}from"./chunk-TAY7J5VS.js";import"./chunk-UWPG5MWM.js";import"./chunk-3RO2YGKH.js";import"./chunk-73Y6T2UK.js";import{e as pe}from"./chunk-NI3TIAD7.js";import{e as le,i as ue}from"./chunk-XMPTFXPW.js";import"./chunk-SMXABALN.js";import"./chunk-WN5VKKJ3.js";import"./chunk-CB344EDO.js";import"./chunk-FNUGDPTS.js";import{b as we,c as _e}from"./chunk-23DKB2MT.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-REKHAN53.js";import"./chunk-CQDCNP7V.js";import"./chunk-TD6GCEIK.js";import"./chunk-7V34ZMMS.js";import"./chunk-B7ZX5HEN.js";import"./chunk-EBJW6POT.js";import"./chunk-PVN64537.js";import{B as me,Ha as V,f as ce,t as de,x as Z}from"./chunk-WE7HRAGO.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import{a as ae}from"./chunk-RQKMSNEU.js";import{a as S}from"./chunk-4C7WVQOD.js";import"./chunk-QXQ7KVEN.js";import"./chunk-Z47ZEFH7.js";import"./chunk-7YV2FCN4.js";import"./chunk-QSCXXNC2.js";import"./chunk-6PIIUAZF.js";import"./chunk-PI7OXS62.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-7V4BQSSV.js";import"./chunk-ZAQGIC33.js";import"./chunk-VO66KP2W.js";import"./chunk-G4K3TP2I.js";import"./chunk-YJAQZMJT.js";import"./chunk-HYJVYYAZ.js";import"./chunk-VZ7KXRXB.js";import"./chunk-UJLULWSR.js";import"./chunk-ZCRZFAOT.js";import"./chunk-ZCBOHWN3.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-A7RJQJNT.js";import"./chunk-TM45NPWL.js";import"./chunk-HCBYKLMW.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-J4FIESTB.js";import"./chunk-UR6MHSHU.js";import{readFileSync as Ge}from"fs";import{relative as Tt,resolve as Nt}from"path";var Je=/^diff --git a\/(.*) b\/(.*)$/,Ve=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@ ?(.*)$/,Ke=/^Binary files (.+) and (.+) differ$/,qe=/^\s{0,3}(#{1,6})\s+(.*?)\s*#*\s*$/,ze=/^\s*(?:[-*+]|\d+[.)])\s+(.*)$/,Qe=/^\s{0,3}(`{3,}|~{3,})/,Ze=/^(index |--- |\+\+\+ |new file mode|deleted file mode|old mode|new mode|similarity index|dissimilarity index|rename from|rename to|copy from|copy to)/;function j(e){let t=e.trim().replace(/^"|"$/g,"");return t==="/dev/null"?null:t.replace(/^[ab]\//,"")}function Y(e,t=79){let n=e.split(`
|
|
3
3
|
`)[0].trim();if(n.length<=t)return n;let s=n.slice(0,t-1),r=s.lastIndexOf(" ");return`${(r>=s.length/2?s.slice(0,r):s).trimEnd()}\u2026`}function et(e,t){return e.length+t.length<=79?`${e}${t}`:`${Y(e.replace(/…$/,""),79-t.length)}${t}`}function tt(e,t){let n=new Map;for(let r of e)n.set(r.label,(n.get(r.label)??0)+1);let s=new Map;e.forEach((r,o)=>{if(n.get(r.label)<2)return;let f=`${r.label}
|
|
4
4
|
${t[o]}`,d=(s.get(f)??0)+1;s.set(f,d),r.label=et(r.label,d===1?` (line ${t[o]})`:` (line ${t[o]}, ${d})`)})}function nt(e){let t=s=>e.find(r=>r.startsWith(s))?.slice(s.length).trim(),n=[];return t("rename from ")!==void 0&&n.push(`renamed from ${t("rename from ")}`),t("copy from ")!==void 0&&n.push(`copied from ${t("copy from ")}`),t("new file mode")!==void 0&&n.push("new empty file"),t("deleted file mode")!==void 0&&n.push("deleted"),t("old mode ")!==void 0&&t("new mode ")!==void 0&&n.push(`mode ${t("old mode ")} to ${t("new mode ")}`),n.length>0?n.join(", "):"changed"}function Ie(e){let t=[],n=[],s=!1,r=(o,f,d,u,m)=>{if(t.length>=2e3){s=!0;return}t.push({id:`c${t.length+1}`,kind:o,file:f,label:d,text:u}),n.push(m)};for(let o of e)st(o.text,r);return tt(t,n),{parts:t,truncated:s}}function st(e,t){let n=e.split(/\r?\n/),s=!1,r=null,o=null,f=0,d=!1,u=null,m="",g=0,w=0,a=0,l=[],i=0,h=[],c=null,I=!0,y=null,_=v=>{let k=[...c!==null?[c]:[],...h.map(L=>L.text)];return c=null,k.length>0?`${k.join(" / ")}: ${v}`:v},A=(v,k,L)=>{let P=_(k);t(v,null,Y(P),P,L)},b=(v,k)=>{l.length===0&&(i=k),l.push(v)},x=()=>{u!==null&&(t("diff_hunk",r,m,u.join(`
|
|
5
5
|
`),g),d=!0),u=null},C=()=>{x(),o!==null&&!d&&t("diff_hunk",r,Y(`${r??"diff"}: ${nt(o)}`),o.join(`
|
|
6
6
|
`),f),o=null},M=()=>{let v=l.join(`
|
|
7
7
|
`).trim();v!==""&&A("text",v,i),l=[]},W=()=>{M(),h=[],c=null,s=!0};for(let v=0;v<n.length;v++){let k=n[v],L=I;if(k.trim()!==""&&(I=!1),y===null){let $=Je.exec(k);if($){W(),C(),r=j(`b/${$[2]}`)??j(`a/${$[1]}`),o=[],f=v+1,d=!1;continue}if(!s&&k.startsWith("--- ")&&n[v+1]?.startsWith("+++ ")){W(),r=j(n[v+1].slice(4))??j(k.slice(4)),v++;continue}}if(s){let $=Ve.exec(k);if($){x(),u=[k];let T=$[5].trim();g=Number($[3])>0?Number($[3]):Number($[1]),m=Y(`${r??"diff"}: ${T!==""?T:`line ${g}`}`),w=$[2]===void 0?1:Number($[2]),a=$[4]===void 0?1:Number($[4]);continue}if(k.startsWith("--- ")&&n[v+1]?.startsWith("+++ ")){x(),r=j(n[v+1].slice(4))??j(k.slice(4))??r,v++;continue}if(u!==null&&(w>0||a>0)&&/^[ +\-\\]/.test(k)){let T=k[0];T!=="\\"&&u.push(k),(T===" "||T==="-")&&w--,(T===" "||T==="+")&&a--;continue}let O=Ke.exec(k);if(O){x();let T=j(O[2])??j(O[1]);t("diff_hunk",T,Y(`${T??"diff"}: binary file`),k,v+1),d=!0;continue}if(u===null&&Ze.test(k)){o!==null&&!/^(index |--- |\+\+\+ )/.test(k)&&o.push(k);continue}if(u!==null&&k===""&&(w>0||a>0)){u.push(""),w--,a--;continue}C(),s=!1}let P=Qe.exec(k);if(P&&(y===null||P[1][0]===y[0])){y=y===null?P[1]:null;continue}if(y!==null){b(k,v+1);continue}if(k.trim()===""){M();continue}let X=qe.exec(k);if(X){M();let $=X[1].length,O=X[2].trim();if(L&&$===1){c=O===""?null:O;continue}h=h.filter(T=>T.level<$),O!==""&&h.push({level:$,text:O});continue}let U=ze.exec(k);if(U){M(),U[1].trim()!==""&&A("changelog",U[1].trim(),v+1);continue}b(k,v+1)}C(),M()}var rt=["usecase","ac","scenario"],ot=["verifies","scoped_to","belongs_to","exercises","automates"],it=4,at=1e3;async function xe(e,t){let n;try{n=await Promise.all([Promise.all(rt.map(c=>e.nodes(t,c))),ct(e,t),Promise.all(ot.map(c=>e.edges(t,c)))])}catch(c){if(c instanceof S&&(c.code==="NO_CONTEXT"||c.code==="NOT_FOUND"))return null;throw c}let[s,r,o]=n,f=[...s.flat().map(c=>te(c,c.title??"")),...r],d=new Map(f.map(c=>[c.cid,c])),u=new Map,m=c=>{let I=u.get(c);if(I)return I;let y=e.mainNode(t,c).catch(_=>{if(_ instanceof S&&_.code==="NOT_FOUND")return null;throw u.delete(c),_});return u.set(c,y),y},g=new Map,w=async c=>{let I=c;for(let y=0;y<at&&!d.has(I);y++){let _=await m(I);if(_===null||_.supersededBy===null||_.supersededBy===""){g.set(c,null);return}I=_.supersededBy}g.set(c,d.has(I)?I:null)},a=o.flat();await q([...new Set(a.flatMap(c=>[c.src,c.dst]).filter(c=>!d.has(c)))],w);let l=c=>d.has(c)?c:g.get(c)??null,i=[],h=new Set;for(let c of a){let I=l(c.src),y=l(c.dst);if(I===null||y===null||d.get(I).trust==="archived"||d.get(y).trust==="archived")continue;let _=`${c.type} ${I} ${y}`;h.has(_)||(h.add(_),i.push({type:c.type,src:I,dst:y}))}return{nodes:f,edges:i}}async function ct(e,t){let n=await e.testsWithContent(t);return n===null?(await e.nodes(t,"test")).map(s=>te(s,"")):n.map(s=>te(s,ne(s.content)))}function ve(e){let t=new Map(e.nodes.map(s=>[s.cid,s])),n=new Map;for(let s of e.edges){let r=s.type==="automates"?t.get(s.dst):void 0;r?.label==="scenario"&&n.set(s.src,[...n.get(s.src)??[],r.name??r.cid])}return n}var ne=e=>B(e.test_md_blob)??B(e.objectives_blob)??"",B=e=>typeof e=="string"&&e.trim()!==""?e:null;function Ce(e,t){let n=new Map,s=r=>e.mainNode(t,r).then(o=>o.content,o=>{if(o instanceof S&&o.code==="NOT_FOUND")return{};throw o});return r=>{let o=n.get(r);if(o)return o;let f=s(r).catch(d=>{if(d instanceof S&&d.retryable)return s(r);throw d});return f.catch(()=>n.delete(r)),n.set(r,f),f}}function Ae(e){let t=0,n=s=>(...r)=>(t++,s(...r));return{client:{nodes:n(e.nodes.bind(e)),testsWithContent:n(e.testsWithContent.bind(e)),edges:n(e.edges.bind(e)),mainNode:n(e.mainNode.bind(e)),testCases:n(e.testCases.bind(e))},reads:()=>t}}function te(e,t){return{cid:e.cid,name:e.name,label:e.label,title:e.title,text:t,trust:e.trust,freshness:e.freshness}}async function q(e,t){let n=0,s=async r=>{try{await t(r)}catch(o){if(o instanceof S&&o.retryable)return t(r);throw o}};await Promise.all(Array.from({length:Math.min(it,e.length)},async()=>{for(let r=n++;r<e.length;r=n++)await s(e[r])}))}var lt=e=>e.trust!=="archived"&&e.freshness!=="superseded"&&e.freshness!=="orphaned",$e=new WeakMap;function z(e){let t=$e.get(e);if(t)return t;let n=e.nodes.filter(lt),s=new Map(n.map(u=>[u.cid,u])),r=new Map(n.map((u,m)=>[u.cid,m])),o=new Map,f=(u,m)=>{o.set(u,[...o.get(u)??[],m])};for(let u of e.edges)!s.has(u.src)||!s.has(u.dst)||(f(`${u.type}<${u.dst}`,u.src),f(`${u.type}>${u.src}`,u.dst));let d={byCid:s,from:(u,m)=>o.get(`${u}<${m}`)??[],to:(u,m)=>o.get(`${u}>${m}`)??[],labelled:(u,m)=>u.filter(g=>s.get(g).label===m),inOrder:u=>[...new Set(u)].sort((m,g)=>r.get(m)-r.get(g))};return $e.set(e,d),d}function ut(e,t){let{byCid:n,from:s,to:r,labelled:o,inOrder:f}=z(e),d=n.get(t);if(!d)return[];let u=new Map,m=(a,l)=>{u.set(a,[...u.get(a)??[],...l])},g=(a,l)=>{for(let i of o(s("verifies",a),"test"))m(i,[...l,a])},w=(a,l)=>{for(let i of o(s("automates",a),"test"))m(i,[...l,a]);for(let i of o([...r("exercises",a),...s("scoped_to",a)],"ac"))g(i,[...l,a])};if(d.label==="test"&&m(d.cid,[]),d.label==="ac"&&g(d.cid,[]),d.label==="scenario"&&w(d.cid,[]),d.label==="usecase"){for(let a of o(s("belongs_to",d.cid),"scenario"))w(a,[d.cid]);for(let a of o(s("scoped_to",d.cid),"ac"))g(a,[d.cid])}return f(u.keys()).map(a=>({test:a,through:f(u.get(a))}))}function se(e,t){let{byCid:n,from:s,to:r,labelled:o,inOrder:f}=z(e);if(n.get(t)?.label!=="test")return{useCases:[],scenarios:[],criteria:[]};let d=o(r("verifies",t),"ac"),u=[...o(r("automates",t),"scenario")];for(let g of d)u.push(...o([...s("exercises",g),...r("scoped_to",g)],"scenario"));let m=[];for(let g of d)m.push(...o(r("scoped_to",g),"usecase"));for(let g of u)m.push(...o(r("belongs_to",g),"usecase"));return{useCases:f(m),scenarios:f(u),criteria:f(d)}}function Re(e){let{byCid:t}=z(e);return[...t.values()].filter(n=>n.label==="test"&&se(e,n.cid).useCases.length===0).map(n=>n.cid)}function Te(e,t){let{byCid:n,from:s,to:r,labelled:o,inOrder:f}=z(e);if(n.get(t)?.label!=="usecase")return{criteria:[],scenarios:[],tests:[]};let d=o(s("belongs_to",t),"scenario"),u=[...o(s("scoped_to",t),"ac")];for(let m of d)u.push(...o([...r("exercises",m),...s("scoped_to",m)],"ac"));return{criteria:f(u),scenarios:f(d),tests:ut(e,t).map(m=>m.test)}}var Pe=60*1024,dt=8*1024,mt=300,N="no-use-case",H="Tests under no use case",pt=300,Ne=10,Ee=20,Me=2*1024,ft=e=>e.trust!=="archived"&&e.freshness!=="superseded"&&e.freshness!=="orphaned",E=e=>e.name??e.cid,Oe=(e,t)=>e.name===null!=(t.name===null)?e.name===null?1:-1:E(e).localeCompare(E(t),"en",{numeric:!0}),J=e=>Buffer.byteLength(JSON.stringify(e),"utf8");function Se(e,t){if(J(e)<=t)return{text:e,cut:!1};let n=e;for(;J(n)>t;)n=n.slice(0,Math.floor(n.length*t/J(n))-1);return{text:/[\uD800-\uDBFF]$/.test(n)?n.slice(0,-1):n,cut:!0}}function gt(e,t){let n=e.replace(/\s+/g," ").trim();if(n.length<=t)return n;let s=n.slice(0,t-1),r=s.lastIndexOf(" ");return`${r>t/2?s.slice(0,r):s}\u2026`}function je(e,t){let n=e.nodes.filter(ft),s=new Map(n.map(a=>[a.cid,a])),r=new Map;for(let a of n)a.name&&(a.label==="usecase"||a.label==="test")&&r.set(`${a.label} ${a.name.toLowerCase()}`,a);let o=n.filter(a=>a.label==="usecase").sort(Oe),f=n.filter(a=>a.label==="test"),d=new Map,u=a=>{let l=d.get(a);return l||d.set(a,l=Te(e,a)),l},m=Re(e),g=new Map,w=a=>{let{criteria:l,scenarios:i,tests:h}=u(a.cid);return{id:E(a),title:a.title??"",description:g.get(a.cid)??"",criteria:l.length,scenarios:i.length,tests:h.length}};return{graph:e,useCases:o,tests:f,noUseCase:m,find(a,l){if(typeof a!="string"||a.trim()==="")return null;let i=s.get(a)??r.get(`${l} ${a.trim().toLowerCase()}`);return i&&i.label===l?i:null},under:u,async index(a){let l=o.slice(a,a+mt);await q(l.filter(h=>!g.has(h.cid)),async h=>{let c=await t(h.cid).catch(()=>({}));g.set(h.cid,gt(Le(c),pt))});let i=l.map(w);return a===0&&m.length>0&&i.push({id:N,title:H,description:"",criteria:0,scenarios:0,tests:m.length}),i},useCaseOf(a,l){let i=se(e,a).useCases.map(c=>s.get(c)).filter(c=>c!==void 0).sort(Oe),h=i.find(c=>l?.has(E(c)))??i[0];return h?{id:E(h),title:h.title??""}:m.includes(a)?{id:N,title:H}:null},known:{use_cases:[...o.map(a=>({id:E(a),cid:a.cid})),...m.length>0?[{id:N,cid:null}]:[]],tests:f.map(a=>({id:E(a),cid:a.cid}))}}}var Le=e=>B(e.description)??B(e.summary)??"";function ht(e){let t=[B(e.description),B(e.intent)].filter(n=>n!==null);return[...new Set(t.map(n=>n.trim()))].join(`
|
|
8
|
-
`)}function Ue(e,t,n){let s={useCases:new Set,tests:new Set,listed:new Set},r=(w,a)=>({answer:{ok:!1,error:{code:w,message:a}},opened:null}),o=new Map(e.graph.nodes.map(w=>[w.cid,w])),f=w=>o.get(w),d=(w,a)=>Array.isArray(w.ids)&&w.ids.length>=1&&w.ids.length<=a&&w.ids.every(l=>typeof l=="string"&&l.trim()!=="")?[...new Set(w.ids.map(l=>l.trim()))]:null,u=async w=>{let a=w.map(b=>b.toLowerCase()===N?N:e.find(b,"usecase")),l=w.filter((b,x)=>a[x]===null),i=[...new Map(a.filter(b=>b!==null).map(b=>[b===N?N:b.cid,b])).values()];if(i.length===0)return r("not_found",`no use case ${l.join(", ")} in this project`);let h=[...new Set(i.flatMap(b=>b===N?[]:e.under(b.cid).scenarios))],c=new Map;await q(h,async b=>{c.set(b,ht(await n(b)))});let I=await Promise.all(i.map(async b=>{if(b===N)return{id:N,title:H,description:"",criteria:[],scenarios:[],tests:e.noUseCase.map(m)};let x=e.under(b.cid);return{id:E(b),title:b.title??"",description:Le(await n(b.cid)),criteria:x.criteria.map(C=>f(C)).filter(C=>C!==void 0).map(C=>({id:E(C),text:C.text||(C.title??"")})),scenarios:x.scenarios.map(C=>f(C)).filter(C=>C!==void 0).map(C=>({id:E(C),title:C.title??"",text:c.get(C.cid)??""})),tests:x.tests.map(m)}})),{kept:y,left:_,cut:A}=re(I,b=>b.id,wt);for(let b of y){s.useCases.add(b.id);for(let x of b.tests)s.listed.add(x.id)}return{answer:{ok:!0,result:{use_cases:y,not_found:l,not_included:_,cut:A}},opened:{what:"use_cases",ids:y.map(b=>b.id)}}},m=w=>{let a=f(w);return{id:a?E(a):w,title:a?.title??""}},g=async w=>{let a=w.map(_=>e.find(_,"test")),l=w.filter((_,A)=>a[A]===null),i=[...new Map(a.filter(_=>_!==null).map(_=>[_.cid,_])).values()];if(i.length===0)return r("not_found",`no test ${l.join(", ")} in this project`);let h=await Promise.all(i.map(async _=>{let A=Se(_.text||ne(await n(_.cid)),dt);return{id:E(_),title:_.title??"",use_case:e.useCaseOf(_.cid),steps:A.text,cut:A.cut}})),{kept:c,left:I,cut:y}=re(h,_=>_.id);for(let _ of c)s.tests.add(_.id);return{answer:{ok:!0,result:{tests:c,not_found:l,not_included:I,cut:y}},opened:{what:"tests",ids:c.map(_=>_.id)}}};return{opened:s,async answer(w,a){try{if(w==="impact_open_use_cases"){let l=d(a,Ne);return l?await u(l):r("bad_params",`impact_open_use_cases takes { ids: 1 to ${Ne} use case ids }`)}if(w==="impact_open_tests"){let l=d(a,Ee);return l?await g(l):r("bad_params",`impact_open_tests takes { ids: 1 to ${Ee} test ids }`)}if(w==="impact_change"){if(typeof a.part!="string")return r("bad_params","impact_change takes { part }");let l=t.find(h=>h.id.toLowerCase()===a.part.trim().toLowerCase());if(!l)return r("not_found",`no part ${a.part} in this change`);let i=Se(l.text,Pe-Me);return{answer:{ok:!0,result:{id:l.id,kind:l.kind,file:l.file,label:l.label,text:i.text,cut:i.cut}},opened:{what:"parts",ids:[l.id]}}}if(w==="impact_use_cases"){let l=a.offset??0;if(typeof l!="number"||!Number.isInteger(l)||l<0)return r("bad_params","impact_use_cases takes { offset: a whole number from 0 }");let{kept:i}=re(await e.index(l),c=>c.id),h=l+i.filter(c=>c.id!==N).length;return{answer:{ok:!0,result:{use_cases:i,offset:l,next_offset:h<e.useCases.length?h:null}},opened:{what:"use_case_index",ids:[]}}}}catch{return r("unavailable","the shared project couldn't be read just now: ask again")}return r("unknown_method",`${w} isn't an impact tool`)}}}function re(e,t,n){let s=Pe-Me,r=[],o=[],f=0,d=!1;for(let u of e){let m=u;if(r.length===0&&o.length===0)for(;m!==null&&J(m)>s;)m=n?n(m):null,d=!0;let g=m===null?1/0:J(m)+1;m!==null&&o.length===0&&f+g<=s?(r.push(m),f+=g):(o.push(t(u)),d=!0)}return{kept:r,left:o,cut:d}}function wt(e){let t=e,n=t.criteria.length>=t.scenarios.length&&t.criteria.length>0?"criteria":t.scenarios.length>0?"scenarios":t.tests.length>0?"tests":null;return n===null?null:{...t,[n]:t[n].slice(0,-1)}}var De=4e3,_t=1e3,yt=200,bt=160,kt=100,It=10*6e4,xt=["high","medium","low"],vt={turn_cap:"turn_cap",invalid_answer:"invalid_answer",unreachable:"unreachable"};async function Fe(e,t={}){let n=t.trace??K("context-impact"),s;try{s=await(t.check??Ct)()}catch{return n("review: the controller check failed"),{ok:!1,cause:"unreachable"}}if(!s.preflight.ok){let u=s.preflight.cause??"unknown";return n(`review: the controller check refused (${u})`),{ok:!1,cause:u==="unreachable"||u==="login_unchecked"?"unreachable":"stopped"}}let r;try{r=(t.agent??ke)($t(e),{auth:s.auth,onWarn:()=>n("review: the agent warned"),onStderr:u=>At(u,t.onTurn)})}catch{return n("review: the agent couldn't be started"),{ok:!1,cause:"stopped"}}t.onStart?.();let o={ok:!1,cause:"stopped"},f=!1,d=setTimeout(()=>{f=!0,n("review: the agent ran past its time"),r.kill()},t.timeoutMs??It);try{for await(let u of r.events){let m=u;if(m.type==="graph_query"){let g=String(m.method),w=Date.now(),{answer:a,opened:l}=await e.tools.answer(g,m.params??{}),i=a.ok?{type:"graph_result",id:String(m.id),ok:!0,result:a.result}:{type:"graph_result",id:String(m.id),ok:!1,error:`${a.error.code}: ${a.error.message}`};r.send(i);let h={name:g,ms:Date.now()-w,bytes:Buffer.byteLength(JSON.stringify(i),"utf8"),ok:a.ok};n(`review: ${g} ${a.ok?"answered":`refused (${a.error.code})`} in ${h.ms} ms, ${h.bytes} bytes`),t.onTool?.(h),l&&t.onOpened?.(l)}else if(m.type==="impact"){let g=Rt(m.impact,e);n(g?`review: answered ${g.tests.length} tests, ${g.notAffected.length} not affected`:"review: its answer didn't hold"),o=g?{ok:!0,answer:g}:{ok:!1,cause:"invalid_answer"}}else if(m.type==="error"){let g=typeof m.code=="string"?m.code:null;n(`review: the agent stopped (${g??"no code"})`),o.ok||(o={ok:!1,cause:g&&vt[g]||"stopped"});break}else if(m.type==="ask_user"){n("review: the agent asked a question");break}else if(m.type==="done"||m.type==="session_paused")break}}catch{n("review: the agent's stream failed"),o.ok||(o={ok:!1,cause:"stopped"})}finally{clearTimeout(d),await r.kill()}return f?{ok:!1,cause:"timeout"}:o}var Ct=async()=>(await import("./run-remote-
|
|
8
|
+
`)}function Ue(e,t,n){let s={useCases:new Set,tests:new Set,listed:new Set},r=(w,a)=>({answer:{ok:!1,error:{code:w,message:a}},opened:null}),o=new Map(e.graph.nodes.map(w=>[w.cid,w])),f=w=>o.get(w),d=(w,a)=>Array.isArray(w.ids)&&w.ids.length>=1&&w.ids.length<=a&&w.ids.every(l=>typeof l=="string"&&l.trim()!=="")?[...new Set(w.ids.map(l=>l.trim()))]:null,u=async w=>{let a=w.map(b=>b.toLowerCase()===N?N:e.find(b,"usecase")),l=w.filter((b,x)=>a[x]===null),i=[...new Map(a.filter(b=>b!==null).map(b=>[b===N?N:b.cid,b])).values()];if(i.length===0)return r("not_found",`no use case ${l.join(", ")} in this project`);let h=[...new Set(i.flatMap(b=>b===N?[]:e.under(b.cid).scenarios))],c=new Map;await q(h,async b=>{c.set(b,ht(await n(b)))});let I=await Promise.all(i.map(async b=>{if(b===N)return{id:N,title:H,description:"",criteria:[],scenarios:[],tests:e.noUseCase.map(m)};let x=e.under(b.cid);return{id:E(b),title:b.title??"",description:Le(await n(b.cid)),criteria:x.criteria.map(C=>f(C)).filter(C=>C!==void 0).map(C=>({id:E(C),text:C.text||(C.title??"")})),scenarios:x.scenarios.map(C=>f(C)).filter(C=>C!==void 0).map(C=>({id:E(C),title:C.title??"",text:c.get(C.cid)??""})),tests:x.tests.map(m)}})),{kept:y,left:_,cut:A}=re(I,b=>b.id,wt);for(let b of y){s.useCases.add(b.id);for(let x of b.tests)s.listed.add(x.id)}return{answer:{ok:!0,result:{use_cases:y,not_found:l,not_included:_,cut:A}},opened:{what:"use_cases",ids:y.map(b=>b.id)}}},m=w=>{let a=f(w);return{id:a?E(a):w,title:a?.title??""}},g=async w=>{let a=w.map(_=>e.find(_,"test")),l=w.filter((_,A)=>a[A]===null),i=[...new Map(a.filter(_=>_!==null).map(_=>[_.cid,_])).values()];if(i.length===0)return r("not_found",`no test ${l.join(", ")} in this project`);let h=await Promise.all(i.map(async _=>{let A=Se(_.text||ne(await n(_.cid)),dt);return{id:E(_),title:_.title??"",use_case:e.useCaseOf(_.cid),steps:A.text,cut:A.cut}})),{kept:c,left:I,cut:y}=re(h,_=>_.id);for(let _ of c)s.tests.add(_.id);return{answer:{ok:!0,result:{tests:c,not_found:l,not_included:I,cut:y}},opened:{what:"tests",ids:c.map(_=>_.id)}}};return{opened:s,async answer(w,a){try{if(w==="impact_open_use_cases"){let l=d(a,Ne);return l?await u(l):r("bad_params",`impact_open_use_cases takes { ids: 1 to ${Ne} use case ids }`)}if(w==="impact_open_tests"){let l=d(a,Ee);return l?await g(l):r("bad_params",`impact_open_tests takes { ids: 1 to ${Ee} test ids }`)}if(w==="impact_change"){if(typeof a.part!="string")return r("bad_params","impact_change takes { part }");let l=t.find(h=>h.id.toLowerCase()===a.part.trim().toLowerCase());if(!l)return r("not_found",`no part ${a.part} in this change`);let i=Se(l.text,Pe-Me);return{answer:{ok:!0,result:{id:l.id,kind:l.kind,file:l.file,label:l.label,text:i.text,cut:i.cut}},opened:{what:"parts",ids:[l.id]}}}if(w==="impact_use_cases"){let l=a.offset??0;if(typeof l!="number"||!Number.isInteger(l)||l<0)return r("bad_params","impact_use_cases takes { offset: a whole number from 0 }");let{kept:i}=re(await e.index(l),c=>c.id),h=l+i.filter(c=>c.id!==N).length;return{answer:{ok:!0,result:{use_cases:i,offset:l,next_offset:h<e.useCases.length?h:null}},opened:{what:"use_case_index",ids:[]}}}}catch{return r("unavailable","the shared project couldn't be read just now: ask again")}return r("unknown_method",`${w} isn't an impact tool`)}}}function re(e,t,n){let s=Pe-Me,r=[],o=[],f=0,d=!1;for(let u of e){let m=u;if(r.length===0&&o.length===0)for(;m!==null&&J(m)>s;)m=n?n(m):null,d=!0;let g=m===null?1/0:J(m)+1;m!==null&&o.length===0&&f+g<=s?(r.push(m),f+=g):(o.push(t(u)),d=!0)}return{kept:r,left:o,cut:d}}function wt(e){let t=e,n=t.criteria.length>=t.scenarios.length&&t.criteria.length>0?"criteria":t.scenarios.length>0?"scenarios":t.tests.length>0?"tests":null;return n===null?null:{...t,[n]:t[n].slice(0,-1)}}var De=4e3,_t=1e3,yt=200,bt=160,kt=100,It=10*6e4,xt=["high","medium","low"],vt={turn_cap:"turn_cap",invalid_answer:"invalid_answer",unreachable:"unreachable"};async function Fe(e,t={}){let n=t.trace??K("context-impact"),s;try{s=await(t.check??Ct)()}catch{return n("review: the controller check failed"),{ok:!1,cause:"unreachable"}}if(!s.preflight.ok){let u=s.preflight.cause??"unknown";return n(`review: the controller check refused (${u})`),{ok:!1,cause:u==="unreachable"||u==="login_unchecked"?"unreachable":"stopped"}}let r;try{r=(t.agent??ke)($t(e),{auth:s.auth,onWarn:()=>n("review: the agent warned"),onStderr:u=>At(u,t.onTurn)})}catch{return n("review: the agent couldn't be started"),{ok:!1,cause:"stopped"}}t.onStart?.();let o={ok:!1,cause:"stopped"},f=!1,d=setTimeout(()=>{f=!0,n("review: the agent ran past its time"),r.kill()},t.timeoutMs??It);try{for await(let u of r.events){let m=u;if(m.type==="graph_query"){let g=String(m.method),w=Date.now(),{answer:a,opened:l}=await e.tools.answer(g,m.params??{}),i=a.ok?{type:"graph_result",id:String(m.id),ok:!0,result:a.result}:{type:"graph_result",id:String(m.id),ok:!1,error:`${a.error.code}: ${a.error.message}`};r.send(i);let h={name:g,ms:Date.now()-w,bytes:Buffer.byteLength(JSON.stringify(i),"utf8"),ok:a.ok};n(`review: ${g} ${a.ok?"answered":`refused (${a.error.code})`} in ${h.ms} ms, ${h.bytes} bytes`),t.onTool?.(h),l&&t.onOpened?.(l)}else if(m.type==="impact"){let g=Rt(m.impact,e);n(g?`review: answered ${g.tests.length} tests, ${g.notAffected.length} not affected`:"review: its answer didn't hold"),o=g?{ok:!0,answer:g}:{ok:!1,cause:"invalid_answer"}}else if(m.type==="error"){let g=typeof m.code=="string"?m.code:null;n(`review: the agent stopped (${g??"no code"})`),o.ok||(o={ok:!1,cause:g&&vt[g]||"stopped"});break}else if(m.type==="ask_user"){n("review: the agent asked a question");break}else if(m.type==="done"||m.type==="session_paused")break}}catch{n("review: the agent's stream failed"),o.ok||(o={ok:!1,cause:"stopped"})}finally{clearTimeout(d),await r.kill()}return f?{ok:!1,cause:"timeout"}:o}var Ct=async()=>(await import("./run-remote-SFR3F2T5.js")).controllerCheck();function At(e,t){if(!(!t||!e.includes("turn_timing")))try{let n=JSON.parse(e);if(n.event!=="turn_timing"||typeof n.ms!="number")return;t({turn:typeof n.turn=="number"?n.turn:0,ms:n.ms,status:typeof n.status=="string"?n.status:"unknown",sentAtMs:typeof n.sent_at_ms=="number"?n.sent_at_ms:null})}catch{}}function $t(e){let t={project_id:e.projectId,parts:e.parts.map(n=>({id:n.id,kind:n.kind,file:n.file,label:n.label,text:n.text.slice(0,De),cut:n.text.length>De})),truncated:e.truncated,use_cases:e.index,use_cases_total:e.project.useCases.length,known:e.project.known};return{type:"run_config",version:1,session_id:ae(),mode:"agent",verb:"impact",graph_reads:!0,max_free_text_rounds:0,existing_use_cases:[],read_basis:null,source:{source_id:"impact",source_cid:"",kind:"impact_input",numbered_text:JSON.stringify(t)}}}function Rt(e,t){if(typeof e!="object"||e===null)return null;let n=e;if(typeof n.rationale!="string"||!Array.isArray(n.use_cases)||!Array.isArray(n.tests)||!Array.isArray(n.not_affected))return null;let{project:s,tools:r}=t,o=(l,i)=>typeof l=="string"&&l.trim()!==""?l.trim().slice(0,i):null,f=l=>{if(typeof l=="string"&&l.trim().toLowerCase()===N)return N;let i=s.find(l,"usecase");return i?i.name??i.cid:null},d=l=>{let i=s.find(l,"test");return i?i.name??i.cid:null},u=new Map(t.parts.map(l=>[l.id.toLowerCase(),l.id])),m=o(n.rationale,_t);if(m===null)return null;let g=[];for(let l of n.use_cases){let i=f(l?.id),h=o(l?.reason,yt);if(!i||!h)return null;g.some(c=>c.id===i)||g.push({id:i,reason:h})}let w=[];for(let l of n.tests){let i=d(l?.id),h=o(l?.reason,bt),c=xt.find(y=>y===l?.confidence);if(!i||!h||!c||w.some(y=>y.id===i)||!r.opened.tests.has(i)&&!r.opened.listed.has(i))return null;let I=Array.isArray(l.parts)?l.parts.map(y=>typeof y=="string"?u.get(y.trim().toLowerCase()):void 0):[];if(I.some(y=>y===void 0))return null;w.push({id:i,confidence:c,parts:[...new Set(I)],reason:h})}let a=[];for(let l of n.not_affected){let i=d(l?.id),h=o(l?.reason,kt);if(!i||!h)return null;(r.opened.tests.has(i)||r.opened.listed.has(i))&&!w.some(I=>I.id===i)&&!a.some(I=>I.id===i)&&a.push({id:i,reason:h})}return{rationale:m,useCases:g,tests:w,notAffected:a}}var Et="No shared work in this project yet: nothing to trace",Ot="The input holds no change: nothing to trace",St="Reviewing the change with AI (this can take a few minutes)\u2026",Pt=1e4,Be={high:0,medium:1,low:2},Mt={high:"High",medium:"Medium",low:"Low"},jt=3,Lt={turn_cap:"the AI review ran out of turns before it answered",unreachable:"the AI review couldn't be reached",invalid_answer:"the AI review didn't give a usable answer",timeout:"the AI review didn't answer within 10 minutes",stopped:"the AI review stopped before it answered"},Ut=async e=>ce({url:e,basicAuth:await pe()}),Dt=()=>({code:"IMPACT_LINKED_ONLY",message:"kane-cli context impact reads a shared project's tests: run it in a folder linked to one",remedy:`to link this folder to the shared project and bring its tests, run:
|
|
9
9
|
kane-cli context pull --project <id>`,next:[{cmd:"kane-cli context pull --project <id>",why:"link this folder to the shared project and bring its tests"}]}),Ft=e=>({code:"USAGE",message:`--input ${e} couldn't be read`,remedy:"check the file's path, then run the command again"}),Gt=e=>({code:"IMPACT_FAILED",message:`the tests of "${e}" couldn't be read, so nothing was traced`,remedy:"run the command again",support:!0}),Bt=e=>({code:"IMPACT_REVIEW_FAILED",message:`${Lt[e]}, so no tests were picked`,remedy:"run the command again",support:!0});async function $n(e,t=ye(),n=process.cwd(),s={}){let r=e.mode==="agent"||e.mode==="ci",o=s.now??Date.now,f=o(),d=()=>o()-f,u=t.err??t.out,m=le("ndjson","impact",{stdout:p=>t.out(p.replace(/\n$/,"")),stderr:p=>u(p.replace(/\n$/,""))}),g=(p,R)=>r?(m.event({type:"error",code:p.code,message:p.message,...me(p)}),m.done(R)):(ee(p),R),w={part:p=>p,useCase:p=>p,width:s.width??process.stderr.columns},a=(p,R={})=>{r?m.event({type:"impact_progress",stage:p,...R,elapsed_ms:d()}):u(Ht(p,R,d(),w))},l=[];for(let p of e.input)try{l.push({name:p,text:p==="-"?(s.stdin??(()=>Ge(0,"utf8")))():Ge(Nt(n,p),"utf8")})}catch{return g(Ft(p),2)}let i=await(s.entry??be)("context impact",r);if(i!==null&&"exit"in i)return i.exit;if(i===null)return g(Dt(),2);let{choice:h}=i,c={read_change_ms:null,read_project_ms:null,reads:null,agent_start_ms:null,turns:[],tools:[],review_ms:null,print_ms:null,total_ms:null,parts:null,use_cases:null,tests:null,use_cases_opened:0,tests_opened:0,cases_ms:null,cases_found:null,outcome:"started"},I=s.trace??K("context-impact"),y=p=>(c.total_ms=d(),I(`impact: timing ${JSON.stringify(c)}`),s.telemetry?.event("ASR_IMPACT_TIMING",Yt(c)),p),_=o(),{parts:A,truncated:b}=Ie(l);w.part=p=>A.find(R=>R.id===p)?.label??p,c.read_change_ms=o()-_,c.parts=A.length,a("reading_change",{parts:A.length}),_=o();let x,C,M,W=()=>0,v,k=new Map;try{let p=Ae(await(s.person??Ut)(h.latticeUrl));W=p.reads,v=p.client,C=Ce(p.client,h.projectId);let R=await xe(p.client,h.projectId);x=R===null?null:je(R,C),R!==null&&(k=ve(R)),M=x===null?[]:await x.index(0)}catch(p){return c.reads=W(),c.outcome="read_failed",y(await Z(p,g(...Kt(p,h.projectName))))}c.read_project_ms=o()-_,w.useCase=p=>p===N?H:x?.find(p,"usecase")?.title||p,c.reads=W(),c.use_cases=x?.useCases.length??0,c.tests=x?.tests.length??0,a("reading_project",{use_cases:c.use_cases,tests:c.tests});let L=[..._e(we(n))],P=p=>{let R=L.filter(([G])=>G.toLowerCase()===p.toLowerCase()).flatMap(([,G])=>G);return R.length===1?Tt(n,R[0]):null},X={id:h.projectId,name:h.projectName};if(x===null||x.tests.length===0||A.length===0){let p=x===null||x.tests.length===0?Et:Ot;return c.outcome="nothing",_=o(),r?(m.event(We(X,p,A,{rationale:p,useCases:[],tests:[],notAffected:[]},x,P,()=>null)),m.event({type:"done",status:"complete",exit_code:0,next:[]})):t.out(p),c.print_ms=o()-_,y(0)}let U=Ue(x,A,C),$=Vt(v,h.projectId,o);a("reviewing");let O=setInterval(()=>a("waiting"),s.waitingMs??Pt);O.unref?.();let T=null;_=o();let D=await(s.review??Fe)({projectId:h.projectId,parts:A,truncated:b,project:x,index:M,tools:U},{trace:I,onStart:()=>{T=Date.now()},onOpened:p=>a("opened",{what:p.what,ids:p.ids}),onTool:p=>{c.tools.push({name:p.name,ms:p.ms,bytes:p.bytes})},onTurn:p=>{c.turns.length===0&&T!==null&&p.sentAtMs!==null&&(c.agent_start_ms=Math.max(0,p.sentAtMs-T)),c.turns.push({turn:p.turn,ms:p.ms,status:p.status})}}).finally(()=>clearInterval(O));if(c.review_ms=o()-_,c.use_cases_opened=U.opened.useCases.size,c.tests_opened=U.opened.tests.size,!D.ok){c.outcome=`failed_${D.cause}`,de(`impact_review_${D.cause}`);let p=Bt(D.cause);return r?(m.event({type:"error",code:p.code,cause:D.cause,message:p.message}),m.event({type:"done",status:"failed",exit_code:1,next:[]})):ee(p),y(await Z(null,1))}let F=await $.within(s.caseBudgetMs??fe);c.cases_ms=F.ms,c.cases_found="cases"in F?[...F.cases.values()].filter(p=>p!==null).length:null,"why"in F&&I(`impact: case numbers not read (${F.why}): every test_case is null`);let He="cases"in F?F.cases:new Map,Ye=p=>{let R=x.find(p,"test");return(R&&k.get(R.cid)?.map(G=>He.get(G)??null).find(G=>G!==null))??null};_=o();let Q=We(X,D.answer.rationale,A,D.answer,x,P,Ye),ie=Jt(Q.run,e.input);return r?(m.event(Q),m.event({type:"done",status:"complete",exit_code:0,next:ie.map(p=>({cmd:`${p.cmd} ${p.agentFlag}`,why:p.why}))})):Wt(t,Q,A,b,ie),c.print_ms=o()-_,c.outcome="complete",y(0)}function We(e,t,n,s,r,o,f){let d=new Map(n.map(i=>[i.id.toLowerCase(),i.label])),u=i=>i.replace(/\bc\d+\b/gi,h=>d.get(h.toLowerCase())??h),m=new Set(s.useCases.map(i=>i.id)),g=i=>r?.find(i,"test")?.title??"",w=s.tests.map((i,h)=>({t:i,order:h})).sort((i,h)=>Be[i.t.confidence]-Be[h.t.confidence]||i.order-h.order).map(({t:i})=>{let h=r?.find(i.id,"test")??null;return{id:i.id,test_case:f(i.id),title:h?.title??"",path:o(i.id),use_case:h&&r?r.useCaseOf(h.cid,m):null,confidence:i.confidence,parts:i.parts,reason:u(i.reason)}}),a=new Set(w.flatMap(i=>i.parts)),l=i=>w.filter(h=>h.confidence===i).length;return{type:"impact_result",v:2,project:e,summary:{run:w.length,high:l("high"),medium:l("medium"),low:l("low"),not_affected:s.notAffected.length,parts:n.length},why:u(t),parts:n.filter(i=>a.has(i.id)).map(i=>({id:i.id,kind:i.kind,file:i.file,label:i.label})),use_cases:s.useCases.map(i=>({id:i.id,title:i.id===N?H:r?.find(i.id,"usecase")?.title??"",reason:u(i.reason)})),run:w,not_affected:s.notAffected.map(i=>({id:i.id,test_case:f(i.id),title:g(i.id),path:o(i.id),reason:u(i.reason)})),paths:[...new Set(w.map(i=>i.path).filter(i=>i!==null))]}}function Wt(e,t,n,s,r){let o=process.stdout.columns,f=(d,u="")=>(o?he(d,o-u.length):d).split(`
|
|
10
10
|
`).map(m=>u+m).join(`
|
|
11
11
|
`);if(e.out(`Affected tests: ${t.run.length} (from ${Xt(n)})`),s&&e.out(`Only the first ${n.length} parts of the change were read`),e.out(f(`Why: ${t.why}`)),t.use_cases.length>0&&(e.out(""),e.out(f(`Use cases: ${t.use_cases.map(d=>d.title||d.id).join("; ")}`))),t.run.length>0){e.out(""),e.out(t.run.length===1?"Run this test":`Run these ${t.run.length} tests`);let d=Math.max(...t.run.map(g=>g.id.length)),u=Math.max(0,...t.run.map(g=>g.test_case?.length??0)),m=g=>u===0?"":`${(g??"").padEnd(u)} `;for(let g of["high","medium","low"]){let w=t.run.filter(a=>a.confidence===g);if(w.length!==0){e.out(` ${Mt[g]} (${w.length})`);for(let a of w)e.out(` ${a.id.padEnd(d)} ${m(a.test_case)}${a.title}`),e.out(f(a.reason," ".repeat(6+d+m(null).length)))}}}if(e.out(`Not affected: ${t.not_affected.length} (of the tests the AI checked)`),r.length!==0){if(r[0].cmd.startsWith("kane-cli testrun run")){e.out("Run them:"),e.out(" kane-cli testrun run \\"),t.paths.forEach((d,u)=>e.out(` ${oe(d)}${u<t.paths.length-1?" \\":""}`));return}e.out("Run them: first bring the project's tests into this folder");for(let d of r)e.out(`next: ${d.cmd}`),d.note&&e.out(` ${d.note}`)}}function Xt(e){let t=`${e.length} ${e.length===1?"part":"parts"}`,n=[...new Set(e.map(f=>f.file).filter(f=>f!==null))],s=n.slice(0,jt),r=n.length-s.length,o=[...s,...r>0?[`${r} more ${r===1?"file":"files"}`]:[],...e.some(f=>f.file===null)?["the text"]:[]];return n.length===0?`${t} of the text`:`${t} of the change in ${o.length===1?o[0]:`${o.slice(0,-1).join(", ")} and ${o.at(-1)}`}`}function Ht(e,t,n,s){let r=f=>typeof t[f]=="number"?t[f]:0,o=Array.isArray(t.ids)?t.ids:[];return e==="reading_change"?`Reading the change: ${r("parts")} ${r("parts")===1?"part":"parts"}`:e==="reading_project"?`Reading the project: ${r("use_cases")} use ${r("use_cases")===1?"case":"cases"}, ${r("tests")} ${r("tests")===1?"test":"tests"}`:e==="reviewing"?St:e==="waiting"?`Still reviewing (${Math.round(n/1e3)} s)\u2026`:t.what==="use_cases"?Xe("Checking use cases: ",o.map(s.useCase),"; ",s.width,f=>` and ${f} more`):t.what==="tests"?Xe(`Checking ${o.length} ${o.length===1?"test":"tests"}: `,o,", ",s.width,()=>", \u2026"):t.what==="parts"?`Reading in full: ${o.map(s.part).join("; ")}`:"Reading more use cases"}function Xe(e,t,n,s,r){let o=e+t.join(n);if(!s||o.length<=s)return o;for(let f=t.length-1;f>1;f--){let d=e+t.slice(0,f).join(n)+r(t.length-f);if(d.length<=s)return d}return e+t[0]+(t.length>1?r(t.length-1):"")}function Yt(e){let t=s=>s.reduce((r,o)=>r+o,0),n={read_change_ms:e.read_change_ms,read_project_ms:e.read_project_ms,reads:e.reads,agent_start_ms:e.agent_start_ms,turns:e.turns.length,turn_ms_total:t(e.turns.map(s=>s.ms)),turn_ms_max:Math.max(0,...e.turns.map(s=>s.ms)),tool_calls:e.tools.length,tool_ms_total:t(e.tools.map(s=>s.ms)),tool_bytes_total:t(e.tools.map(s=>s.bytes)),review_ms:e.review_ms,print_ms:e.print_ms,total_ms:e.total_ms,parts:e.parts,use_cases:e.use_cases,tests:e.tests,use_cases_opened:e.use_cases_opened,tests_opened:e.tests_opened,cases_ms:e.cases_ms,cases_found:e.cases_found,outcome:e.outcome};return Object.fromEntries(Object.entries(n).filter(([,s])=>s!==null))}function Jt(e,t){if(e.length===0)return[];let n=[...new Set(e.map(s=>s.path))];if(n.includes(null)){let s=t.includes("-"),r=s?"trace again with the tests in place: pass the same change on stdin again":"trace again with the tests in place";return[{cmd:"kane-cli context pull",why:"bring the project's tests into this folder",agentFlag:"--mode agent"},{cmd:`kane-cli context impact --input ${t.map(oe).join(" ")}`,why:r,agentFlag:"--mode agent",...s?{note:r}:{}}]}return[{cmd:`kane-cli testrun run ${n.map(oe).join(" ")}`,why:"run the affected tests",agentFlag:"--agent"}]}function Vt(e,t,n){let s=n(),r=e.testCases(t).then(o=>({cases:o,ms:n()-s}),o=>({why:o instanceof S?`${o.status} ${o.code}`:o instanceof Error?o.name:"failed",ms:n()-s}));return{within:o=>ge(r,o).catch(()=>({why:`late, over ${o} ms`,ms:n()-s}))}}var oe=e=>/^[\w./:=@%+-]+$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`;function Kt(e,t){return e instanceof ue?[{code:e.code,message:e.message,...e.remedy?{remedy:e.remedy}:{}},2]:e instanceof S&&e.retryable?[V.noConnection(),2]:e instanceof S&&e.status===401?[V.credentialsRejected(),2]:e instanceof S&&(e.code==="NOT_FOUND"||e.status===403||e.status===404)?[V.noAccess(t),2]:[Gt(t),1]}export{Et as NOTHING_SHARED,Ot as NO_CHANGE,St as REVIEWING,$n as runImpact};
|