@testmuai/kane-cli 0.10.2 → 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-FIYDTZSI.js → ChatSurface-Z26BOE5U.js} +1 -1
- package/dist/{ChromeProfilePicker-Q6FIGVYU.js → ChromeProfilePicker-ODRIAXL3.js} +1 -1
- package/dist/{CliFeedbackPrompt-2NV2G65E.js → CliFeedbackPrompt-JWCTMIGI.js} +1 -1
- package/dist/{CliUploadProgress-JZ5FXODE.js → CliUploadProgress-XFRRFRL4.js} +1 -1
- package/dist/{ConfigView-TZ4YINOE.js → ConfigView-6JF4DOJN.js} +1 -1
- package/dist/{EvidenceViewOffer-LKPN5BHX.js → EvidenceViewOffer-6344EX74.js} +1 -1
- package/dist/FolderPicker-4PCYHE75.js +2 -0
- package/dist/InfoBox-NJ2DL7YC.js +2 -0
- package/dist/{LinksBox-32TZOANP.js → LinksBox-HNDNFVUT.js} +1 -1
- package/dist/{ProfilesView-UC4MPM54.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-XGFO5X76.js → SummaryBox-7PPDMSSM.js} +1 -1
- package/dist/TestMdRunView-QLKRUU4V.js +2 -0
- package/dist/TestrunEvidenceTable-T2JUB4TE.js +2 -0
- package/dist/{WhoamiView-4XIJXMTU.js → WhoamiView-H7JNLLCY.js} +1 -1
- package/dist/{app-download-XEDO3EMV.js → app-download-GKRF2EIM.js} +1 -1
- package/dist/{assurance-job-MD65GQLC.js → assurance-job-F4L3T4VJ.js} +1 -1
- package/dist/{binary-NVYLR36K.js → binary-K3XMILST.js} +1 -1
- package/dist/{bind-H3ALI2NG.js → bind-SSHAZAB3.js} +1 -1
- package/dist/{bootstrap-JEVSVPQ2.js → bootstrap-XGKU4WXB.js} +1 -1
- package/dist/{catalog-5UYBWA4W.js → catalog-YCU6OHNV.js} +1 -1
- package/dist/{catalog-client-VVKV4JKW.js → catalog-client-MVEEHTG2.js} +1 -1
- package/dist/{changelog-FPWJXERY.js → changelog-5UB3AQT6.js} +1 -1
- package/dist/{chunk-GJ7MO2FW.js → chunk-2JFRN62I.js} +2 -2
- package/dist/chunk-2RBMQTYS.js +26 -0
- package/dist/{chunk-44SIFDNY.js → chunk-2TK4MDF2.js} +1 -1
- package/dist/{chunk-P4VFC6HO.js → chunk-35WUYKGO.js} +1 -1
- package/dist/{chunk-XCUF5AVM.js → chunk-3MD2XLE7.js} +2 -2
- package/dist/{chunk-TMH4TPMB.js → chunk-3NWUXRSI.js} +1 -1
- package/dist/{chunk-NVD2MXHQ.js → chunk-3RO2YGKH.js} +1 -1
- package/dist/{chunk-QUNIY6NN.js → chunk-3ZC7GSMM.js} +1 -1
- package/dist/{chunk-LXCTV75T.js → chunk-4CJQ7XZP.js} +1 -1
- package/dist/{chunk-LWCP4GLY.js → chunk-4KL3TSTT.js} +5 -5
- package/dist/{chunk-2ULYGALF.js → chunk-4UX5N7YI.js} +1 -1
- package/dist/{chunk-5KJU4MG4.js → chunk-5YYCCM6K.js} +1 -1
- package/dist/{chunk-IT5JVCZN.js → chunk-6FFX4S7N.js} +1 -1
- package/dist/{chunk-HM6LZ2KM.js → chunk-6HRNG4CK.js} +1 -1
- package/dist/{chunk-OK6NLITG.js → chunk-6QCCTZO3.js} +1 -1
- package/dist/{chunk-ZZZGTDYE.js → chunk-6QH75BPJ.js} +1 -1
- package/dist/{chunk-6SWHEBPR.js → chunk-7RELCXRW.js} +1 -1
- package/dist/{chunk-S7XCOBYD.js → chunk-7SU53QGU.js} +1 -1
- package/dist/{chunk-6JUS2ULI.js → chunk-7Y55CO42.js} +1 -1
- package/dist/{chunk-B57ZRHEQ.js → chunk-7YV2FCN4.js} +1 -1
- package/dist/{chunk-PC22QRIY.js → chunk-A2DODRHG.js} +1 -1
- package/dist/{chunk-ABMM37L2.js → chunk-AHT2ORJT.js} +1 -1
- package/dist/{chunk-A7IMHUFY.js → chunk-AT7AT3AR.js} +2 -2
- package/dist/{chunk-5WLXAQ4H.js → chunk-AVLYSNEG.js} +1 -1
- package/dist/{chunk-ZO3ZAMUU.js → chunk-BBJAKSA7.js} +1 -1
- package/dist/{chunk-DLP5S3TO.js → chunk-BJO6J5X2.js} +1 -1
- package/dist/{chunk-EEOAU43D.js → chunk-BLVDV3QQ.js} +1 -1
- package/dist/{chunk-I52NWH4U.js → chunk-C4KAPGBS.js} +1 -1
- package/dist/{chunk-7O2FIZB7.js → chunk-CB2BWDHG.js} +2 -2
- package/dist/{chunk-HWPWCCEV.js → chunk-CNHKZE4F.js} +1 -1
- package/dist/{chunk-5F44KH3R.js → chunk-CTHUX7O4.js} +1 -1
- package/dist/{chunk-FYPIF3BE.js → chunk-DC5F2ADJ.js} +1 -1
- package/dist/chunk-DIOK3SER.js +34 -0
- package/dist/{chunk-NCP54AIQ.js → chunk-DQXQJJOP.js} +2 -2
- package/dist/{chunk-W2HRX3DR.js → chunk-EBJW6POT.js} +1 -1
- package/dist/{chunk-GZQAETB2.js → chunk-EJGCIGQY.js} +1 -1
- package/dist/{chunk-7ZR5CQY3.js → chunk-ERRIDBE7.js} +1 -1
- package/dist/chunk-F2F257PU.js +6 -0
- package/dist/{chunk-EAWU2TOG.js → chunk-GQAWZEA4.js} +1 -1
- package/dist/{chunk-2QKBXRLI.js → chunk-GXQYFOBD.js} +1 -1
- package/dist/{chunk-RRKYHUOD.js → chunk-HBLHKQR7.js} +1 -1
- package/dist/chunk-HC6VLPUB.js +5 -0
- package/dist/{chunk-JUVY6PHY.js → chunk-HRIDAK6Y.js} +1 -1
- package/dist/{chunk-5MFPQYW3.js → chunk-HV2CDY4K.js} +1 -1
- package/dist/{chunk-YO6SNXBJ.js → chunk-IEHJG6J4.js} +1 -1
- package/dist/{chunk-FAMQ4DHU.js → chunk-J4FIESTB.js} +1 -1
- package/dist/{chunk-UICJ2KLJ.js → chunk-JBKHX5ES.js} +1 -1
- package/dist/{chunk-6CS23F3E.js → chunk-KBGMQYMD.js} +1 -1
- package/dist/{chunk-ZDQYGLCZ.js → chunk-KCXLRR3Q.js} +1 -1
- package/dist/{chunk-KN7GZWKK.js → chunk-KL7XFNSD.js} +1 -1
- package/dist/{chunk-V3OZJO7Y.js → chunk-KQ4XKTIZ.js} +1 -1
- package/dist/{chunk-PR5EGLEI.js → chunk-LHJSIHLC.js} +1 -1
- package/dist/{chunk-75FF7J5R.js → chunk-LPJKNX6D.js} +1 -1
- package/dist/{chunk-3V4J65GN.js → chunk-LRNUGKYH.js} +1 -1
- package/dist/{chunk-POA336CU.js → chunk-LUA25RYS.js} +1 -1
- package/dist/{chunk-BHQIH2FE.js → chunk-LV7224DG.js} +1 -1
- package/dist/{chunk-73HMW2WA.js → chunk-LXK4B2FE.js} +1 -1
- package/dist/{chunk-PWNYTIVA.js → chunk-M2E5CPPV.js} +1 -1
- package/dist/{chunk-OVNTCBNS.js → chunk-M7A66MSK.js} +1 -1
- package/dist/{chunk-MP6NCJFE.js → chunk-MD3RABID.js} +1 -1
- package/dist/{chunk-AUSLHNXQ.js → chunk-MEBEVHGP.js} +1 -1
- package/dist/{chunk-C6P6YUCR.js → chunk-N7IWR45S.js} +1 -1
- package/dist/{chunk-M3TFOFUQ.js → chunk-ND6OP3O2.js} +1 -1
- package/dist/{chunk-226AGYHB.js → chunk-NHGPMYM3.js} +1 -1
- package/dist/{chunk-VE4HLIGA.js → chunk-NI3TIAD7.js} +1 -1
- package/dist/{chunk-GQARXS6F.js → chunk-NPAUSUNM.js} +1 -1
- package/dist/{chunk-HX5OLRKU.js → chunk-NRAPCFI2.js} +2 -2
- package/dist/{chunk-RAVAJZV2.js → chunk-NZJSGINB.js} +16 -16
- package/dist/{chunk-X3A4QPA3.js → chunk-OBNVGD5H.js} +1 -1
- package/dist/{chunk-Q5AKIQIE.js → chunk-OCMPWCKQ.js} +1 -1
- package/dist/{chunk-BJT6PZXL.js → chunk-OCVDMZWB.js} +1 -1
- package/dist/{chunk-XZ6J3Y2W.js → chunk-OHGL4GEJ.js} +1 -1
- package/dist/{chunk-54NJJVG5.js → chunk-OOGKX4Y6.js} +1 -1
- package/dist/{chunk-UMNCM4RJ.js → chunk-OTMHCHH6.js} +2 -2
- package/dist/{chunk-45NM23EQ.js → chunk-OZNYQONA.js} +1 -1
- package/dist/{chunk-D4QXYAYA.js → chunk-PB6RXDWQ.js} +2 -2
- package/dist/{chunk-2GEAKFAV.js → chunk-PCQK62MP.js} +1 -1
- package/dist/{chunk-HHOVANJ7.js → chunk-PTLOOVV4.js} +1 -1
- package/dist/{chunk-QB77LRF4.js → chunk-Q4ALB7SH.js} +1 -1
- package/dist/{chunk-A474TUCE.js → chunk-Q4SMITTV.js} +1 -1
- package/dist/{chunk-HNF3PWF3.js → chunk-QE4AWNOV.js} +3 -3
- package/dist/{chunk-6YBH3WUW.js → chunk-QEM5ZRDN.js} +1 -1
- package/dist/{chunk-MSYRAPDK.js → chunk-QHH42RH5.js} +1 -1
- package/dist/{chunk-IB5WG5YY.js → chunk-RNHSULQM.js} +1 -1
- package/dist/chunk-SB26HQO7.js +2 -0
- package/dist/{chunk-QVMXL675.js → chunk-SJQTTEXQ.js} +1 -1
- package/dist/{chunk-UCVP7ZY4.js → chunk-SMGRXKXX.js} +1 -1
- package/dist/{chunk-RDAIOJCR.js → chunk-SXBPUUQ5.js} +1 -1
- package/dist/{chunk-K75WIRI5.js → chunk-TM45NPWL.js} +1 -1
- package/dist/{chunk-7DLDADQR.js → chunk-TUSG7DIL.js} +1 -1
- package/dist/{chunk-K4K2BGQC.js → chunk-UJ37XGSP.js} +3 -3
- package/dist/{chunk-DXLZCJH5.js → chunk-ULIIYKZB.js} +1 -1
- package/dist/{chunk-7PCLHURF.js → chunk-UXGMKRS4.js} +61 -60
- package/dist/{chunk-IH73ZCBB.js → chunk-VCVEZEVS.js} +1 -1
- package/dist/{chunk-XNXJXGVB.js → chunk-VKVYT6KZ.js} +2 -2
- package/dist/{chunk-PEUIHME2.js → chunk-VO2NNXKR.js} +1 -1
- package/dist/{chunk-H4TIVILC.js → chunk-WE7HRAGO.js} +1 -1
- package/dist/{chunk-O5KTMDTH.js → chunk-WIVKLNIO.js} +1 -1
- package/dist/chunk-WLEWXE6L.js +2 -0
- package/dist/{chunk-3YIA3DSL.js → chunk-X2MDL6S4.js} +1 -1
- package/dist/{chunk-M7Y5GGVJ.js → chunk-X45RZIAJ.js} +1 -1
- package/dist/{chunk-4LGQHTXM.js → chunk-XKOVEMVZ.js} +1 -1
- package/dist/{chunk-4HARMERK.js → chunk-Y2HQMJGS.js} +1 -1
- package/dist/{chunk-B226SFOV.js → chunk-Y3RJHWNK.js} +1 -1
- package/dist/{chunk-4HYPMGDF.js → chunk-YCVEI7BT.js} +1 -1
- package/dist/{chunk-HG2ILWCE.js → chunk-YILRYMMG.js} +1 -1
- package/dist/{chunk-2COXO5LQ.js → chunk-YNDELIXL.js} +1 -1
- package/dist/{chunk-4NEPHIAO.js → chunk-YPGZ5E4I.js} +1 -1
- package/dist/{chunk-GT3JDX5H.js → chunk-YQZ736IQ.js} +1 -1
- package/dist/{chunk-XHFU5TGS.js → chunk-YVVFXBT5.js} +1 -1
- package/dist/{chunk-ET5EK2CM.js → chunk-YWWVF5OU.js} +1 -1
- package/dist/{chunk-OKA6FPJM.js → chunk-Z47ZEFH7.js} +1 -1
- package/dist/{chunk-FI2DVNRT.js → chunk-ZCBOHWN3.js} +1 -1
- package/dist/{chunk-7XJNYLQW.js → chunk-ZIHQ5JGB.js} +4 -4
- package/dist/{chunk-Z6SI7YNV.js → chunk-ZMIKNNO6.js} +1 -1
- package/dist/{chunk-O3TXAMFW.js → chunk-ZPU3WAC4.js} +1 -1
- package/dist/{commands-R5AYK6XM.js → commands-JBFLLT7A.js} +1 -1
- package/dist/{config-YMHI3H3Y.js → config-7WTZPMAH.js} +1 -1
- package/dist/{cover-cmd-DVQIGFDY.js → cover-cmd-DU6ZYJFL.js} +1 -1
- package/dist/{credentials-BCR73VGS.js → credentials-5WIFF5DG.js} +1 -1
- package/dist/{deps-bundle-6WLX44OA.js → deps-bundle-BLLJ2BQ4.js} +1 -1
- package/dist/{deps-resolve-DSAKPZ3T.js → deps-resolve-WQ6J6RLI.js} +1 -1
- package/dist/{design-chat-YUI2JPO6.js → design-chat-ZICGVYIH.js} +1 -1
- package/dist/{design-headless-KIP6R7UV.js → design-headless-HYWZIIDS.js} +1 -1
- package/dist/{design-remote-XMSHDDUX.js → design-remote-HPX4VZ63.js} +2 -2
- package/dist/device-env-4P4GUVBW.js +2 -0
- package/dist/{doctor-PGTNOMSP.js → doctor-Z2YQ2DBX.js} +1 -1
- package/dist/{evidence-RO3RDZXO.js → evidence-BJIID6VT.js} +1 -1
- package/dist/{evolve-cmd-U2ALVGMT.js → evolve-cmd-GZCUSCEK.js} +1 -1
- package/dist/{evolve-remote-K2MCCVMM.js → evolve-remote-LILOAHYH.js} +1 -1
- package/dist/{explain-cmd-UWK5YVXG.js → explain-cmd-LXIVHGN7.js} +1 -1
- package/dist/explore-SA2P3SGX.js +2 -0
- package/dist/{explore-context-tty-WJHUSP3A.js → explore-context-tty-PERKIWXD.js} +1 -1
- package/dist/{explore-entry-3EX2T3NS.js → explore-entry-E6EY3VV3.js} +4 -4
- package/dist/{explore-live-TRY5A2ME.js → explore-live-XIWWUV52.js} +1 -1
- package/dist/{explore-run-tty-ZV5XFKZA.js → explore-run-tty-M56I23IF.js} +2 -2
- package/dist/{extract-bind-TXUBMK3T.js → extract-bind-LZ22VFKB.js} +3 -3
- package/dist/{extract-chat-VPYDGQKO.js → extract-chat-Z64LEAJ5.js} +1 -1
- package/dist/{extract-cmd-YUOYMVF5.js → extract-cmd-46E2XDWZ.js} +2 -2
- package/dist/{extract-headless-UWTAPOET.js → extract-headless-XLS56LMN.js} +1 -1
- package/dist/{folder-flags-WV7UV3JG.js → folder-flags-ZIDJVDKX.js} +1 -1
- package/dist/{gaps-cmd-PFV3FZCM.js → gaps-cmd-XYOBJVTO.js} +1 -1
- package/dist/{gate-7ALXLCNB.js → gate-AK44VDHC.js} +1 -1
- package/dist/{generate-headless-KMBBZTLS.js → generate-headless-HXAVEAEZ.js} +2 -2
- package/dist/{impact-cmd-PW33L5RF.js → impact-cmd-TJTUFAFO.js} +2 -2
- package/dist/index.js +162 -157
- package/dist/{ingest-cmd-MXYILQLV.js → ingest-cmd-OJSKTSQK.js} +3 -3
- package/dist/{ingest-remote-2EEJP6ML.js → ingest-remote-2WM6PYUW.js} +1 -1
- package/dist/install-JBWBF3WX.js +2 -0
- package/dist/{interactive-bind-FDWJUTI6.js → interactive-bind-SOD7VTAY.js} +2 -2
- package/dist/{interactive-remote-O2Q2FNOH.js → interactive-remote-7ZSTI66T.js} +1 -1
- package/dist/{lattice-auth-TXNDLHM6.js → lattice-auth-UQPFQSG7.js} +1 -1
- package/dist/{lifecycle-cmd-GFHDBRXX.js → lifecycle-cmd-DGIO3VAO.js} +1 -1
- package/dist/{list-cmd-RR75PMPE.js → list-cmd-HQIN3HX4.js} +1 -1
- package/dist/{list-commands-3QGZWJ5P.js → list-commands-OFRRBU3D.js} +1 -1
- package/dist/{list-remote-AA3VSWOI.js → list-remote-EFCET42K.js} +1 -1
- package/dist/login-flow-SYKXXDLH.js +2 -0
- package/dist/{maintenance-cmd-OHGVARQ2.js → maintenance-cmd-X5247RSJ.js} +1 -1
- package/dist/{mobile-prompts-FZRKLLTN.js → mobile-prompts-I66ENBDW.js} +1 -1
- package/dist/{onboarding-NXGMV3VG.js → onboarding-6HIP3KW6.js} +1 -1
- package/dist/{persist-recorded-session-INFN4JZT.js → persist-recorded-session-RSSMTVF3.js} +1 -1
- package/dist/pipeline-NTJDH5TC.js +2 -0
- package/dist/{policy-commands-3YJ6YCDN.js → policy-commands-4PUGESCW.js} +1 -1
- package/dist/{prepare-target-DII5WZCX.js → prepare-target-AI3GGZF6.js} +1 -1
- package/dist/{pull-cmd-XZN53XFZ.js → pull-cmd-NRVB5ZN7.js} +1 -1
- package/dist/{pull-route-R33BVADE.js → pull-route-FWCZW76M.js} +1 -1
- package/dist/real-device-run-NQ7RNH7C.js +2 -0
- package/dist/{reconcile-cmd-KFPRCCJB.js → reconcile-cmd-7B7THAFJ.js} +4 -4
- package/dist/{reconcile-remote-6WISFGRG.js → reconcile-remote-3W6ZTO3G.js} +2 -2
- package/dist/{recording-banner-XOX2CDCF.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-4HN27MD4.js → remote-mode-NXUKDUXG.js} +1 -1
- package/dist/{remote-words-LFDYKIZ7.js → remote-words-JRDDNOZ6.js} +1 -1
- package/dist/{require-project-folder-ZK4JJCDB.js → require-project-folder-3DTI2CVB.js} +1 -1
- package/dist/{resolve-run-intent-LYLVNNDZ.js → resolve-run-intent-QCL7QXIB.js} +1 -1
- package/dist/{resolver-RMHGGYRP.js → resolver-CDF7QKVD.js} +1 -1
- package/dist/{review-cmd-UGF2FC5Y.js → review-cmd-XBK3TGRE.js} +1 -1
- package/dist/{run-remote-BGKQDAOA.js → run-remote-SFR3F2T5.js} +1 -1
- package/dist/{run-startup-gate-4XE73OON.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-cmd-CABAX7BO.js → sessions-cmd-TLUITRG5.js} +1 -1
- package/dist/{sessions-remote-Y4FTZL7Y.js → sessions-remote-INO7AWKB.js} +1 -1
- package/dist/{skill-installer-FS2AV7GX.js → skill-installer-7JH5QCJF.js} +1 -1
- package/dist/{store-PLKJZTGC.js → store-X4UK4AP7.js} +1 -1
- package/dist/{store-choice-UAB6Z4AL.js → store-choice-27HDIFTU.js} +1 -1
- package/dist/{store-guard-DUN2X3SR.js → store-guard-ZXKB5DQH.js} +1 -1
- package/dist/{sync-cmd-AGTOGPYM.js → sync-cmd-2PCO7LZA.js} +1 -1
- package/dist/{sync-setup-4KIY3PDO.js → sync-setup-5WQO73Y5.js} +1 -1
- package/dist/tcg-generate-DGJD5KSM.js +2 -0
- package/dist/{testmd-actions-UD6PAWUX.js → testmd-actions-XE2JPQHB.js} +1 -1
- package/dist/{testmd-sync-EEJ7GPLR.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/{validate-basic-3JZRZL45.js → validate-basic-66XDPA3S.js} +1 -1
- package/dist/{version-check-IY3YSQIP.js → version-check-SHNVYTMU.js} +1 -1
- package/dist/{view-cmd-WUIGTRFX.js → view-cmd-QOB3O6YW.js} +1 -1
- package/dist/{walk-session-EH7227WR.js → walk-session-WIEROYOT.js} +1 -1
- package/dist/{with-telemetry-7JMZUBUZ.js → with-telemetry-T2PWI5CY.js} +1 -1
- package/package.json +11 -11
- package/dist/FolderPicker-H5K74PCH.js +0 -2
- package/dist/InfoBox-DNSOAK5L.js +0 -2
- package/dist/ProjectPicker-ZJ5RW6XL.js +0 -2
- package/dist/SaveSessionPrompt-F327WC7A.js +0 -2
- package/dist/SingleShotApp-OMLRYOSI.js +0 -2
- package/dist/TestMdRunView-ZZ77QTAQ.js +0 -2
- package/dist/TestrunEvidenceTable-G7MPF55X.js +0 -2
- package/dist/chunk-6K5BEEAJ.js +0 -2
- package/dist/chunk-6LEHGRRG.js +0 -34
- package/dist/chunk-A4ZV2SHL.js +0 -5
- package/dist/chunk-O2Y46A3G.js +0 -26
- package/dist/chunk-Y6Y6RAY4.js +0 -2
- package/dist/device-env-K7J5NN66.js +0 -2
- package/dist/explore-S2BGQUIF.js +0 -2
- package/dist/install-7J34AYB6.js +0 -2
- package/dist/login-flow-ZQ6UFTS2.js +0 -2
- package/dist/pipeline-MVZRI6YZ.js +0 -2
- package/dist/real-device-run-DGENHGUV.js +0 -2
- package/dist/registry-NV3EMDMK.js +0 -2
- package/dist/remote-entry-BCTFT643.js +0 -2
- package/dist/run-test-md-G6U3RU2Q.js +0 -19
- package/dist/tcg-generate-CUY4AZ2V.js +0 -2
- package/dist/token-refresh-K6PVBBFE.js +0 -2
|
@@ -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};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as ke}from"./chunk-6SD4XTYC.js";import{d as be}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};
|