@testmuai/kane-cli 0.10.0-rc.1 → 0.10.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ChatSurface-VPD5G67Q.js → ChatSurface-6NZGMNHL.js} +1 -1
- package/dist/{ChromeProfilePicker-CRKQEFYD.js → ChromeProfilePicker-M4WXOB5O.js} +1 -1
- package/dist/{CliFeedbackPrompt-M7BMWLKK.js → CliFeedbackPrompt-6MJA7DF6.js} +1 -1
- package/dist/{CliUploadProgress-OP7DXMC2.js → CliUploadProgress-6NLS7XHH.js} +1 -1
- package/dist/{ConfigView-XI74BCCH.js → ConfigView-O4WKZ5PU.js} +1 -1
- package/dist/{EvidenceViewOffer-HAAK6DS5.js → EvidenceViewOffer-WIEWCZUP.js} +1 -1
- package/dist/FolderPicker-AF7ZMV3M.js +2 -0
- package/dist/InfoBox-D7GGZJU4.js +2 -0
- package/dist/{LinksBox-PNSESNCU.js → LinksBox-DXP66H3H.js} +1 -1
- package/dist/{ProfilesView-PYDZZHKO.js → ProfilesView-TWOY5PVC.js} +1 -1
- package/dist/ProjectPicker-OBYHJJLU.js +2 -0
- package/dist/SaveSessionPrompt-7XSHS4NL.js +2 -0
- package/dist/SingleShotApp-XQUDR36R.js +2 -0
- package/dist/{SummaryBox-FALOODAQ.js → SummaryBox-IA2KS6GT.js} +1 -1
- package/dist/TestMdRunView-LS2QUFWR.js +2 -0
- package/dist/TestrunEvidenceTable-HNDVJDIF.js +2 -0
- package/dist/{WhoamiView-6WXGRANY.js → WhoamiView-SNL75TEF.js} +1 -1
- package/dist/{app-download-RXVZB6MM.js → app-download-UI4ABEIX.js} +1 -1
- package/dist/{assurance-job-C3TXZGLL.js → assurance-job-FFSSS4XV.js} +1 -1
- package/dist/{binary-DJCDMGPX.js → binary-THPLXCOD.js} +1 -1
- package/dist/{bind-XVO4CQYV.js → bind-4XWK3DG2.js} +1 -1
- package/dist/{bootstrap-TY5RANJ7.js → bootstrap-6ACT4ALI.js} +1 -1
- package/dist/{catalog-RRQF4TCA.js → catalog-MYPS2BXY.js} +1 -1
- package/dist/{changelog-GBEVIUFJ.js → changelog-SU674BVE.js} +1 -1
- package/dist/{chunk-AA674WLL.js → chunk-2DYHAP4E.js} +1 -1
- package/dist/{chunk-VG44B5JD.js → chunk-36N3EHW5.js} +1 -1
- package/dist/{chunk-P7MSVLAH.js → chunk-3E4ZO73O.js} +1 -1
- package/dist/{chunk-NWD54VV5.js → chunk-3F5FMH76.js} +1 -1
- package/dist/{chunk-I5NSJBOZ.js → chunk-3OQW2GTA.js} +1 -1
- package/dist/{chunk-LRS5MGBY.js → chunk-3RJHXOZH.js} +1 -1
- package/dist/{chunk-DDJNYQBH.js → chunk-3YTCKCBG.js} +1 -1
- package/dist/{chunk-252FWF2G.js → chunk-457Y5TEC.js} +1 -1
- package/dist/{chunk-DD5TULWQ.js → chunk-4QFTHUJA.js} +1 -1
- package/dist/{chunk-672CQECV.js → chunk-4YW767UV.js} +7 -7
- package/dist/{chunk-7LKCWO2R.js → chunk-5AKJPYUW.js} +3 -3
- package/dist/{chunk-VQLH63X7.js → chunk-6DZX5HLZ.js} +1 -1
- package/dist/{chunk-QHRUBG7J.js → chunk-6EB5VRAN.js} +1 -1
- package/dist/{chunk-QS5ZJFGF.js → chunk-734ORT6O.js} +1 -1
- package/dist/{chunk-57MDWTON.js → chunk-7AET4JKQ.js} +1 -1
- package/dist/{chunk-W3OVSDBN.js → chunk-7HMSMAUG.js} +1 -1
- package/dist/{chunk-FFL55I2M.js → chunk-7NPTL66J.js} +1 -1
- package/dist/{chunk-T7H4LBFK.js → chunk-7SY34IIL.js} +1 -1
- package/dist/{chunk-RFIIM33J.js → chunk-7YT4TTKL.js} +1 -1
- package/dist/{chunk-CPBBYNL7.js → chunk-ACMBMZDQ.js} +1 -1
- package/dist/{chunk-UALJTPSA.js → chunk-AEWNWAXW.js} +1 -1
- package/dist/{chunk-V7S6S5W3.js → chunk-AVSMXDTX.js} +1 -1
- package/dist/{chunk-MGNRNLBE.js → chunk-C2RUDJ46.js} +1 -1
- package/dist/{chunk-QQ4TKLWP.js → chunk-C62QWG4B.js} +1 -1
- package/dist/{chunk-OEWYXCTA.js → chunk-CCP4X75B.js} +1 -1
- package/dist/{chunk-LRXBJTD4.js → chunk-CGITGJ3I.js} +1 -1
- package/dist/{chunk-QCKA665H.js → chunk-CM4CHYSN.js} +1 -1
- package/dist/{chunk-2OOFURWD.js → chunk-CUXY6KQ2.js} +1 -1
- package/dist/{chunk-I6OQISK4.js → chunk-D36V5OX6.js} +1 -1
- package/dist/{chunk-LNNWCBPQ.js → chunk-D7TKE7LK.js} +1 -1
- package/dist/{chunk-2IZRPMZN.js → chunk-D7U2M26S.js} +1 -1
- package/dist/{chunk-SONMD3W5.js → chunk-DDZLCAEO.js} +1 -1
- package/dist/{chunk-NWBLYMH7.js → chunk-DJC7NTLA.js} +1 -1
- package/dist/{chunk-TW63WWEN.js → chunk-DZOYYWOW.js} +1 -1
- package/dist/{chunk-UAWWLLTI.js → chunk-EBPRPNSA.js} +1 -1
- package/dist/{chunk-T3HEJASG.js → chunk-ECPFI75W.js} +1 -1
- package/dist/{chunk-JQSLUGD4.js → chunk-EECDDDSB.js} +1 -1
- package/dist/{chunk-7EXDYXXD.js → chunk-ETZMFRD6.js} +1 -1
- package/dist/{chunk-5BUIIFLC.js → chunk-F22K3RRX.js} +1 -1
- package/dist/{chunk-BJJUKB5K.js → chunk-F5NHG7VB.js} +1 -1
- package/dist/{chunk-B2HXPGIZ.js → chunk-FWDUVFS6.js} +3 -3
- package/dist/{chunk-T4AVLJCW.js → chunk-FWUPJORV.js} +1 -1
- package/dist/{chunk-VYHT2IET.js → chunk-GQRU3B54.js} +1 -1
- package/dist/{chunk-AIXJYMSP.js → chunk-GXKY5A46.js} +1 -1
- package/dist/{chunk-QTZBVDPR.js → chunk-HCJ2N3XB.js} +1 -1
- package/dist/{chunk-XBEYWXPV.js → chunk-HJMCXSUJ.js} +1 -1
- package/dist/{chunk-ZZP5SHUV.js → chunk-HK62JVQM.js} +1 -1
- package/dist/{chunk-3UVSAAES.js → chunk-I4RVVBG3.js} +1 -1
- package/dist/{chunk-JPYW6U4D.js → chunk-I4WXALQR.js} +1 -1
- package/dist/{chunk-OVNRRI4E.js → chunk-ICLUC44J.js} +1 -1
- package/dist/{chunk-DHQ4SQWA.js → chunk-IGEAET7M.js} +1 -1
- package/dist/{chunk-IXW7FOGX.js → chunk-IJ2AHSWW.js} +1 -1
- package/dist/{chunk-2S3W2JT3.js → chunk-IUQOG7Z5.js} +1 -1
- package/dist/{chunk-IBBD36FQ.js → chunk-JZP3Y4ZM.js} +1 -1
- package/dist/{chunk-NDEI7R4K.js → chunk-KODJVOCN.js} +1 -1
- package/dist/{chunk-IMDMRJQ6.js → chunk-KXHJMAZU.js} +1 -1
- package/dist/{chunk-OQ5G773E.js → chunk-L5DALV5N.js} +1 -1
- package/dist/{chunk-S53AQU7R.js → chunk-LAOTVZHV.js} +1 -1
- package/dist/{chunk-NQTYWHPB.js → chunk-LIGTP3A3.js} +1 -1
- package/dist/{chunk-7RPKHKA3.js → chunk-LQQNPMOD.js} +1 -1
- package/dist/{chunk-OZNBTSW5.js → chunk-LUR7JFPP.js} +1 -1
- package/dist/{chunk-QNLVC5ZB.js → chunk-LUZBGTYB.js} +1 -1
- package/dist/{chunk-N3TCNZSX.js → chunk-M43WH5DQ.js} +1 -1
- package/dist/{chunk-432ZOE42.js → chunk-MEKPGQAM.js} +1 -1
- package/dist/{chunk-GZFLJORM.js → chunk-NIVFEACM.js} +1 -1
- package/dist/{chunk-SA6IKFFD.js → chunk-NXAJBSIF.js} +1 -1
- package/dist/{chunk-MII3JOO3.js → chunk-NZ6AV2TA.js} +1 -1
- package/dist/{chunk-2SWSVJUP.js → chunk-OCDBTAYS.js} +1 -1
- package/dist/{chunk-SLKYD44Y.js → chunk-OGFU4YY4.js} +1 -1
- package/dist/{chunk-4LPX2OLV.js → chunk-P3JXJ4BW.js} +1 -1
- package/dist/{chunk-Y4T4SLDO.js → chunk-PAWQ4AKN.js} +1 -1
- package/dist/{chunk-6NWT2TEJ.js → chunk-QBYENBMB.js} +1 -1
- package/dist/{chunk-XIPKSXRQ.js → chunk-QDXKEOKI.js} +3 -3
- package/dist/{chunk-T6K2MEWP.js → chunk-QENCC2ZS.js} +1 -1
- package/dist/{chunk-SWMTXMKB.js → chunk-RF37IJNN.js} +1 -1
- package/dist/{chunk-XJ7HCXKW.js → chunk-RHGW7B5Q.js} +1 -1
- package/dist/{chunk-H3HHSTEK.js → chunk-RTVHJ23A.js} +1 -1
- package/dist/{chunk-OAKYUBD3.js → chunk-SGPAM5DZ.js} +1 -1
- package/dist/{chunk-RG372DON.js → chunk-TU42YZOJ.js} +1 -1
- package/dist/{chunk-V5JGXOV7.js → chunk-TU7TVFBK.js} +1 -1
- package/dist/{chunk-AJQZ3ST5.js → chunk-TW5AA5A7.js} +1 -1
- package/dist/{chunk-WI7K6VKQ.js → chunk-URH4FX3H.js} +1 -1
- package/dist/{chunk-BVO4C5F2.js → chunk-V7USCQWO.js} +1 -1
- package/dist/{chunk-4D5PC6QE.js → chunk-VSVWNRI2.js} +1 -1
- package/dist/{chunk-BZVNI44O.js → chunk-VUFIL5VR.js} +2 -2
- package/dist/{chunk-74W4AOT2.js → chunk-VX657KIK.js} +1 -1
- package/dist/{chunk-A6TJOZ24.js → chunk-VXGN3IV7.js} +1 -1
- package/dist/{chunk-2OSFI33O.js → chunk-VZ4A6WMK.js} +3 -3
- package/dist/{chunk-M6MBMRFR.js → chunk-W4QSZNMB.js} +1 -1
- package/dist/{chunk-EXFDIVNI.js → chunk-W54OT2FU.js} +2 -2
- package/dist/{chunk-NFRA64NU.js → chunk-W6HZF56M.js} +1 -1
- package/dist/{chunk-MZOIHUVX.js → chunk-W72ACCFL.js} +2 -2
- package/dist/{chunk-JD52IXON.js → chunk-WAOUE7MP.js} +1 -1
- package/dist/{chunk-WYSZ6TPW.js → chunk-WEIPY3CI.js} +10 -9
- package/dist/{chunk-I2KOGINW.js → chunk-WXJCJL5L.js} +1 -1
- package/dist/{chunk-LWJRSUE2.js → chunk-WZXPF3BI.js} +1 -1
- package/dist/{chunk-OF7WPCTQ.js → chunk-XLEGGC4Y.js} +1 -1
- package/dist/{chunk-6LIC2R22.js → chunk-XQMWHPZI.js} +1 -1
- package/dist/{chunk-D4FFXCX6.js → chunk-XRNQSXOM.js} +2 -2
- package/dist/{chunk-RW3Z2HMB.js → chunk-XZGEN4NU.js} +1 -1
- package/dist/{chunk-DNGOT65K.js → chunk-Y7E5L42F.js} +1 -1
- package/dist/{chunk-K45BKGB5.js → chunk-YAW6JW6D.js} +1 -1
- package/dist/{chunk-ENL4XTQ2.js → chunk-YGRULEZY.js} +1 -1
- package/dist/{chunk-F3U6T4YD.js → chunk-YHFZFV3A.js} +2 -2
- package/dist/{chunk-RX47NRSM.js → chunk-YLXWAY7D.js} +1 -1
- package/dist/{chunk-WEM3MOAL.js → chunk-YPFQ4UGF.js} +1 -1
- package/dist/{chunk-6U7ID777.js → chunk-YQ5C6UDG.js} +1 -1
- package/dist/{chunk-HFJSP4KD.js → chunk-ZAFJQ3SM.js} +1 -1
- package/dist/{chunk-2NFS4KE4.js → chunk-ZTRRFG52.js} +1 -1
- package/dist/{chunk-L4UVUFL6.js → chunk-ZU4W2QGM.js} +1 -1
- package/dist/{config-5ZOALGKE.js → config-754B73XK.js} +1 -1
- package/dist/{cover-cmd-UA2SVIZZ.js → cover-cmd-NBNZCR6C.js} +1 -1
- package/dist/{credentials-MRG452Y6.js → credentials-F7DYLVWY.js} +1 -1
- package/dist/{deps-bundle-FWINW4XM.js → deps-bundle-PW3WEQJ7.js} +1 -1
- package/dist/{deps-resolve-IET4KIBO.js → deps-resolve-SQYVN76L.js} +1 -1
- package/dist/{design-chat-MM5PJD2N.js → design-chat-F3OEZPNJ.js} +1 -1
- package/dist/{design-headless-FZONCKHW.js → design-headless-OTHYOX3E.js} +1 -1
- package/dist/{design-remote-SPVRIY2H.js → design-remote-2BEGCVCX.js} +2 -2
- package/dist/device-env-CHFRRV6W.js +2 -0
- package/dist/{doctor-VAX2BWQF.js → doctor-XY26Z35T.js} +1 -1
- package/dist/{evidence-LVVK7ROT.js → evidence-P6FFKC7B.js} +1 -1
- package/dist/{evolve-cmd-AGRKG7T3.js → evolve-cmd-WWOB3QJR.js} +1 -1
- package/dist/{evolve-remote-BGHULJTL.js → evolve-remote-WLVY3QID.js} +1 -1
- package/dist/{explain-cmd-WOBGS6KX.js → explain-cmd-OP5I5W3O.js} +1 -1
- package/dist/explore-K5YBGHK6.js +2 -0
- package/dist/{explore-context-tty-JTZVZFOE.js → explore-context-tty-RZ7D2TBV.js} +1 -1
- package/dist/{explore-entry-5OGNLFAU.js → explore-entry-EKXJ67BD.js} +4 -4
- package/dist/{explore-live-2XZHUYFS.js → explore-live-2YVRAQZO.js} +1 -1
- package/dist/{explore-run-tty-LGTIK2NA.js → explore-run-tty-D47FGPX7.js} +2 -2
- package/dist/{extract-bind-NM2BBK4I.js → extract-bind-W2NET364.js} +3 -3
- package/dist/{extract-chat-HLQMJJIC.js → extract-chat-M65NWGUK.js} +1 -1
- package/dist/{extract-cmd-T2TSAC3N.js → extract-cmd-FTFLETOP.js} +2 -2
- package/dist/{extract-headless-OQTQ3FJK.js → extract-headless-G6W6JQ27.js} +1 -1
- package/dist/{folder-flags-WXUR6OPJ.js → folder-flags-KKIH654K.js} +1 -1
- package/dist/{gaps-cmd-PTSKPTF7.js → gaps-cmd-OIDDLRYL.js} +1 -1
- package/dist/{gate-P57VP4E5.js → gate-7AKRPRMK.js} +1 -1
- package/dist/{generate-headless-JYZP6VXZ.js → generate-headless-RURIEKVS.js} +2 -2
- package/dist/index.js +19 -19
- package/dist/{ingest-cmd-LHCBMO4Z.js → ingest-cmd-4G2AK4Y2.js} +3 -3
- package/dist/{ingest-remote-D5TO5JQP.js → ingest-remote-SSLUHQVG.js} +1 -1
- package/dist/install-ZVBHPXGP.js +2 -0
- package/dist/{interactive-bind-5EJQUGKI.js → interactive-bind-SI2ZS55Q.js} +2 -2
- package/dist/{interactive-remote-D77ULJGL.js → interactive-remote-J56EWJGA.js} +1 -1
- package/dist/{lattice-auth-74XGF77Y.js → lattice-auth-6FEVSR7E.js} +1 -1
- package/dist/{lifecycle-cmd-7SM6UCMH.js → lifecycle-cmd-HJ37LTXE.js} +1 -1
- package/dist/{list-cmd-Z6FZXMFU.js → list-cmd-6XL2FYLQ.js} +1 -1
- package/dist/{list-commands-CZYZ7GIG.js → list-commands-5DCCKU3L.js} +1 -1
- package/dist/{list-remote-WOPOC6KK.js → list-remote-LXPQNXYN.js} +1 -1
- package/dist/login-flow-WEK3E476.js +2 -0
- package/dist/{maintenance-cmd-VRTGZVRE.js → maintenance-cmd-BXXHP36K.js} +1 -1
- package/dist/{mobile-prompts-KNAHU64X.js → mobile-prompts-CECJ5UY2.js} +1 -1
- package/dist/{onboarding-LGT6PMDZ.js → onboarding-PDVYMTY5.js} +1 -1
- package/dist/{persist-recorded-session-BX7II5P7.js → persist-recorded-session-A3ID7JFA.js} +1 -1
- package/dist/{pipeline-IXVTVRS5.js → pipeline-GX3LKPI5.js} +1 -1
- package/dist/{prepare-target-ULMKVKMC.js → prepare-target-FMT6QFHZ.js} +1 -1
- package/dist/{pull-cmd-6AL2WYHB.js → pull-cmd-UPFQYUND.js} +1 -1
- package/dist/{pull-route-TTVARJMV.js → pull-route-FWBXJMR7.js} +1 -1
- package/dist/real-device-run-X7JJWOIK.js +2 -0
- package/dist/{reconcile-cmd-R6H37SQR.js → reconcile-cmd-JBH365JL.js} +4 -4
- package/dist/{reconcile-remote-GWDV5CUT.js → reconcile-remote-BCX6SWFC.js} +2 -2
- package/dist/{recording-banner-ACC67Q2U.js → recording-banner-YKBAL6UB.js} +1 -1
- package/dist/registry-VQC757MJ.js +2 -0
- package/dist/remote-entry-X6JMPC2K.js +2 -0
- package/dist/{remote-mode-7G6PLJCW.js → remote-mode-FDPA7EWG.js} +1 -1
- package/dist/{remote-words-45USLRVN.js → remote-words-YVB66R3F.js} +1 -1
- package/dist/{require-project-folder-A3UDRELU.js → require-project-folder-MLMEQJYP.js} +1 -1
- package/dist/{resolve-run-intent-ZGPSUBXV.js → resolve-run-intent-PC7TQZUL.js} +1 -1
- package/dist/{resolver-IPM6R7U4.js → resolver-EID34LQE.js} +1 -1
- package/dist/{review-cmd-NNT5C5RZ.js → review-cmd-EUHFLFMY.js} +1 -1
- package/dist/{run-remote-3AYYVPKX.js → run-remote-SJCRTL7O.js} +1 -1
- package/dist/{run-startup-gate-NKRMKYBB.js → run-startup-gate-YO66G6LS.js} +1 -1
- package/dist/{run-test-md-HE6DUWQR.js → run-test-md-BLNBK4MH.js} +2 -2
- package/dist/session-worker.js +2 -2
- package/dist/{sessions-cmd-GYMETJHG.js → sessions-cmd-S7WZBUCN.js} +1 -1
- package/dist/{sessions-remote-GI7GOBMH.js → sessions-remote-IWHWIQ2T.js} +1 -1
- package/dist/{skill-installer-3QAVQGDH.js → skill-installer-MAVQY6GW.js} +1 -1
- package/dist/{store-X6XPFSKF.js → store-MSA7KASS.js} +1 -1
- package/dist/{store-choice-RT73HAI7.js → store-choice-3OJCV26J.js} +1 -1
- package/dist/{store-guard-SNWKLHQV.js → store-guard-OOSDLMEC.js} +1 -1
- package/dist/{sync-cmd-NBPPDG3B.js → sync-cmd-RDFDMVKQ.js} +1 -1
- package/dist/{sync-setup-5NUCH6N3.js → sync-setup-RBRDUV7Q.js} +1 -1
- package/dist/tcg-generate-KIECTZ2C.js +2 -0
- package/dist/{testmd-actions-GH5BW5V5.js → testmd-actions-CMAG6HWI.js} +1 -1
- package/dist/{testmd-sync-ACKCIOL3.js → testmd-sync-UPAA5UMD.js} +1 -1
- package/dist/token-refresh-KP3AYMYK.js +2 -0
- package/dist/{validate-basic-RE2WLIGQ.js → validate-basic-M5JHHNZA.js} +1 -1
- package/dist/{version-check-4FJVZP3K.js → version-check-Q737BE65.js} +1 -1
- package/dist/{view-cmd-N47BQZPD.js → view-cmd-XSNL5DGI.js} +1 -1
- package/dist/{walk-session-DA7QWXSW.js → walk-session-SHGYLFRB.js} +1 -1
- package/dist/{with-telemetry-7V4LY2BG.js → with-telemetry-PM2HVN2B.js} +1 -1
- package/package.json +11 -11
- package/dist/FolderPicker-W5S6RFCP.js +0 -2
- package/dist/InfoBox-OWUEHV2D.js +0 -2
- package/dist/ProjectPicker-BGFCUGT5.js +0 -2
- package/dist/SaveSessionPrompt-SUJE54GS.js +0 -2
- package/dist/SingleShotApp-4TDXZEUA.js +0 -2
- package/dist/TestMdRunView-4GPRWHEU.js +0 -2
- package/dist/TestrunEvidenceTable-OBVQJ6IO.js +0 -2
- package/dist/device-env-LXJ65AVF.js +0 -2
- package/dist/explore-LOKNOVNP.js +0 -2
- package/dist/install-Z6K2D2VY.js +0 -2
- package/dist/login-flow-2FZEOVHM.js +0 -2
- package/dist/real-device-run-2LFS5WE2.js +0 -2
- package/dist/registry-6IJYQXQC.js +0 -2
- package/dist/remote-entry-YL7O2NJQ.js +0 -2
- package/dist/tcg-generate-Z23CUISY.js +0 -2
- package/dist/token-refresh-4UCYAG6A.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-LSDJOVWW.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-
|
|
2
|
+
import{b as C}from"./chunk-LSDJOVWW.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-MEKPGQAM.js";import"./chunk-DZOYYWOW.js";import"./chunk-VXGN3IV7.js";import"./chunk-CB4ARIHR.js";import"./chunk-BSRSXYDZ.js";import{a as S}from"./chunk-R7KXAISS.js";import"./chunk-WMGKUERB.js";import"./chunk-WOSANGV6.js";import{d as A}from"./chunk-XMPTFXPW.js";import{a as h}from"./chunk-73Y6T2UK.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-AVI5H4UM.js";import"./chunk-LCSJ7GOG.js";import"./chunk-HAW5WEKT.js";import"./chunk-HJLMH7ZM.js";import"./chunk-E6KSRQXL.js";import"./chunk-54XA5MZH.js";import"./chunk-QDFY5GGO.js";import"./chunk-VZJ6LUXX.js";import"./chunk-35ECWCCK.js";import"./chunk-IZ65ZPWY.js";import"./chunk-7RWP4Y3H.js";import"./chunk-73ZFOJOK.js";import"./chunk-EF47KRUK.js";import"./chunk-3GXN6VF6.js";import"./chunk-Z55KBMYV.js";import"./chunk-LD5B3QFW.js";import{a as N}from"./chunk-MYVKUJGS.js";import{a as U}from"./chunk-EECDDDSB.js";import"./chunk-63EKRZKI.js";import"./chunk-3JLEDSG5.js";import"./chunk-42PALMW2.js";import"./chunk-ZFMRQ57Y.js";import"./chunk-PZA3BSOE.js";import"./chunk-2RUSXQ3O.js";import{f as G}from"./chunk-KF4DKXSS.js";import"./chunk-AUJSC7PU.js";import"./chunk-JNSWKGTB.js";import"./chunk-UUJIGOEO.js";import"./chunk-ZTHYAHDN.js";import"./chunk-PGESS7BW.js";import"./chunk-FWGUISUG.js";import"./chunk-AZLNLHUA.js";import"./chunk-AQ2OG2EF.js";import{c as M}from"./chunk-DPGOAFKF.js";import"./chunk-MNBGG4H3.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-EZN7CF45.js";import"./chunk-7XBNMOH4.js";import"./chunk-ZCIWQHCO.js";import"./chunk-XB6BJPDL.js";import"./chunk-ZFM77AQU.js";import{b as P}from"./chunk-RF37IJNN.js";import"./chunk-XZYA7DNH.js";import"./chunk-22PIMG52.js";import"./chunk-I2MC6VVX.js";import{d as j,f as T}from"./chunk-DJC7NTLA.js";import"./chunk-QSCXXNC2.js";import"./chunk-UEE3RZN4.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-6NFOH4AC.js";import"./chunk-PUVMC4PX.js";import"./chunk-B7ZX5HEN.js";import"./chunk-VZ7KXRXB.js";import"./chunk-7V4BQSSV.js";import"./chunk-VO66KP2W.js";import"./chunk-HHW6MRU3.js";import"./chunk-7DFBOVUB.js";import"./chunk-4I7YN6YY.js";import"./chunk-6PIIUAZF.js";import"./chunk-GMTHZUZ3.js";import"./chunk-NC7D7GOM.js";import"./chunk-ZCRZFAOT.js";import"./chunk-C2RUDJ46.js";import"./chunk-RZ4F3BHX.js";import"./chunk-A7RJQJNT.js";import"./chunk-HJMCXSUJ.js";import"./chunk-HCBYKLMW.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-D36V5OX6.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-6NZGMNHL.js"),import("./ScrollbackTap-4SPXGFMU.js"),import("./exit-manager-EDHCETUN.js"),import("./extract-chat-M65NWGUK.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-G6W6JQ27.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-7AKRPRMK.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-6FEVSR7E.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-SJCRTL7O.js"),{rememberUser:r}=await import("./store-choice-3OJCV26J.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-7AKRPRMK.js"),l=a(e,"context extract");if(l!==null)return s(l),2;let{runInteractiveRemote:m}=await import("./interactive-remote-J56EWJGA.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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
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{i as x}from"./chunk-R4JUKTDO.js";import"./chunk-OJ33Q6DU.js";import{g}from"./chunk-AVI5H4UM.js";import"./chunk-LCSJ7GOG.js";import"./chunk-HAW5WEKT.js";import"./chunk-HJLMH7ZM.js";import"./chunk-E6KSRQXL.js";import"./chunk-54XA5MZH.js";import"./chunk-QDFY5GGO.js";import"./chunk-VZJ6LUXX.js";import"./chunk-35ECWCCK.js";import"./chunk-IZ65ZPWY.js";import"./chunk-7RWP4Y3H.js";import"./chunk-73ZFOJOK.js";import"./chunk-EF47KRUK.js";import"./chunk-3GXN6VF6.js";import"./chunk-Z55KBMYV.js";import"./chunk-LD5B3QFW.js";import{a as h}from"./chunk-
|
|
2
|
+
import{g as f}from"./chunk-47WQBG5I.js";import{a as d}from"./chunk-KM3YCIDV.js";import{i as x}from"./chunk-R4JUKTDO.js";import"./chunk-OJ33Q6DU.js";import{g}from"./chunk-AVI5H4UM.js";import"./chunk-LCSJ7GOG.js";import"./chunk-HAW5WEKT.js";import"./chunk-HJLMH7ZM.js";import"./chunk-E6KSRQXL.js";import"./chunk-54XA5MZH.js";import"./chunk-QDFY5GGO.js";import"./chunk-VZJ6LUXX.js";import"./chunk-35ECWCCK.js";import"./chunk-IZ65ZPWY.js";import"./chunk-7RWP4Y3H.js";import"./chunk-73ZFOJOK.js";import"./chunk-EF47KRUK.js";import"./chunk-3GXN6VF6.js";import"./chunk-Z55KBMYV.js";import"./chunk-LD5B3QFW.js";import{a as h}from"./chunk-EECDDDSB.js";import"./chunk-63EKRZKI.js";import"./chunk-3JLEDSG5.js";import"./chunk-42PALMW2.js";import"./chunk-ZFMRQ57Y.js";import"./chunk-PZA3BSOE.js";import"./chunk-2RUSXQ3O.js";import"./chunk-KF4DKXSS.js";import"./chunk-AUJSC7PU.js";import"./chunk-JNSWKGTB.js";import"./chunk-UUJIGOEO.js";import"./chunk-ZTHYAHDN.js";import"./chunk-PGESS7BW.js";import"./chunk-FWGUISUG.js";import"./chunk-AZLNLHUA.js";import"./chunk-AQ2OG2EF.js";import"./chunk-DPGOAFKF.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-7XBNMOH4.js";import"./chunk-ZCIWQHCO.js";import"./chunk-XB6BJPDL.js";import"./chunk-ZFM77AQU.js";import"./chunk-22PIMG52.js";import"./chunk-I2MC6VVX.js";import"./chunk-DJC7NTLA.js";import"./chunk-QSCXXNC2.js";import"./chunk-UEE3RZN4.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-6NFOH4AC.js";import"./chunk-7V4BQSSV.js";import"./chunk-VO66KP2W.js";import"./chunk-HHW6MRU3.js";import"./chunk-7DFBOVUB.js";import"./chunk-4I7YN6YY.js";import"./chunk-6PIIUAZF.js";import"./chunk-GMTHZUZ3.js";import"./chunk-NC7D7GOM.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-D36V5OX6.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-XINCDH6Z.js"),import("./chat-committer-ZCSRJEUB.js"),import("./descriptor-7T32VRMB.js"),import("./explain-DGJ5T6V5.js"),import("./dossier-NROC2MCY.js"),import("./test-definition-VRI4YIYL.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-G2GCW73X.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-TWJ3FTSU.js"),{emitWalkSignal:E,walkSignal:P}=await import("./reconcile-cmd-JBH365JL.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-7AKRPRMK.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-X6JMPC2K.js"),{folderFlagsOf:r}=await import("./folder-flags-KKIH654K.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-FDPA7EWG.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-W2NET364.js");return m(e,n.choice,o)}let{bindExtractRemoteInteractive:u}=await import("./extract-bind-W2NET364.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-W2NET364.js");return t(e)}let{bindExtractHeadless:d}=await import("./extract-bind-W2NET364.js");return d({...e,mode:a})}export{f as extractCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a}from"./chunk-
|
|
2
|
+
import{a}from"./chunk-PAWQ4AKN.js";import"./chunk-47WQBG5I.js";import"./chunk-KM3YCIDV.js";import"./chunk-AVI5H4UM.js";import"./chunk-LCSJ7GOG.js";import"./chunk-HAW5WEKT.js";import"./chunk-HJLMH7ZM.js";import"./chunk-E6KSRQXL.js";import"./chunk-54XA5MZH.js";import"./chunk-QDFY5GGO.js";import"./chunk-VZJ6LUXX.js";import"./chunk-35ECWCCK.js";import"./chunk-IZ65ZPWY.js";import"./chunk-7RWP4Y3H.js";import"./chunk-73ZFOJOK.js";import"./chunk-EF47KRUK.js";import"./chunk-3GXN6VF6.js";import"./chunk-Z55KBMYV.js";import"./chunk-LD5B3QFW.js";import"./chunk-EECDDDSB.js";import"./chunk-63EKRZKI.js";import"./chunk-3JLEDSG5.js";import"./chunk-42PALMW2.js";import"./chunk-ZFMRQ57Y.js";import"./chunk-PZA3BSOE.js";import"./chunk-2RUSXQ3O.js";import"./chunk-KF4DKXSS.js";import"./chunk-AUJSC7PU.js";import"./chunk-JNSWKGTB.js";import"./chunk-UUJIGOEO.js";import"./chunk-ZTHYAHDN.js";import"./chunk-PGESS7BW.js";import"./chunk-FWGUISUG.js";import"./chunk-AZLNLHUA.js";import"./chunk-AQ2OG2EF.js";import"./chunk-DPGOAFKF.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-7XBNMOH4.js";import"./chunk-ZCIWQHCO.js";import"./chunk-XB6BJPDL.js";import"./chunk-ZFM77AQU.js";import"./chunk-RF37IJNN.js";import"./chunk-XZYA7DNH.js";import"./chunk-22PIMG52.js";import"./chunk-I2MC6VVX.js";import"./chunk-DJC7NTLA.js";import"./chunk-QSCXXNC2.js";import"./chunk-UEE3RZN4.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-6NFOH4AC.js";import"./chunk-7V4BQSSV.js";import"./chunk-VO66KP2W.js";import"./chunk-HHW6MRU3.js";import"./chunk-7DFBOVUB.js";import"./chunk-4I7YN6YY.js";import"./chunk-6PIIUAZF.js";import"./chunk-GMTHZUZ3.js";import"./chunk-NC7D7GOM.js";import"./chunk-ZCRZFAOT.js";import"./chunk-C2RUDJ46.js";import"./chunk-RZ4F3BHX.js";import"./chunk-HJMCXSUJ.js";import"./chunk-D36V5OX6.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}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-I4WXALQR.js";import"./chunk-XMPTFXPW.js";import"./chunk-C6HI6Y3S.js";import"./chunk-3G2LSTK5.js";import"./chunk-7HMSMAUG.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import"./chunk-I2MC6VVX.js";import"./chunk-RPRXRKKR.js";import"./chunk-QXQ7KVEN.js";import"./chunk-7AET4JKQ.js";import"./chunk-DJC7NTLA.js";import"./chunk-QSCXXNC2.js";import"./chunk-UEE3RZN4.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-6NFOH4AC.js";import"./chunk-7V4BQSSV.js";import"./chunk-VO66KP2W.js";import"./chunk-HHW6MRU3.js";import"./chunk-7DFBOVUB.js";import"./chunk-4I7YN6YY.js";import"./chunk-6PIIUAZF.js";import"./chunk-NC7D7GOM.js";import"./chunk-ZCRZFAOT.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-D36V5OX6.js";import"./chunk-UR6MHSHU.js";export{a as decideFolderFlags,b as folderFlagsOf};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{N as j,O as we,Q as Re}from"./chunk-432ZOE42.js";import"./chunk-TW63WWEN.js";import"./chunk-A6TJOZ24.js";import"./chunk-CB4ARIHR.js";import"./chunk-BSRSXYDZ.js";import{f as se}from"./chunk-HQ2E2XCU.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-SMTBOSEJ.js";import"./chunk-WOSANGV6.js";import"./chunk-65VANXOF.js";import"./chunk-34R7BNZ2.js";import"./chunk-XMPTFXPW.js";import"./chunk-73Y6T2UK.js";import"./chunk-SMXABALN.js";import"./chunk-WN5VKKJ3.js";import{b as xe,c as _e}from"./chunk-MNBGG4H3.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-VLDCHFXF.js";import{d as ve}from"./chunk-ZFM77AQU.js";import{T as ae,U as le,vb as ue}from"./chunk-UEE3RZN4.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-6NFOH4AC.js";import"./chunk-PUVMC4PX.js";import"./chunk-B7ZX5HEN.js";import"./chunk-VZ7KXRXB.js";import"./chunk-7V4BQSSV.js";import"./chunk-HHW6MRU3.js";import"./chunk-7DFBOVUB.js";import"./chunk-4I7YN6YY.js";import"./chunk-6PIIUAZF.js";import"./chunk-NC7D7GOM.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-I6OQISK4.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(`
|
|
2
|
+
import{N as j,O as we,Q as Re}from"./chunk-MEKPGQAM.js";import"./chunk-DZOYYWOW.js";import"./chunk-VXGN3IV7.js";import"./chunk-CB4ARIHR.js";import"./chunk-BSRSXYDZ.js";import{f as se}from"./chunk-HQ2E2XCU.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-SMTBOSEJ.js";import"./chunk-WOSANGV6.js";import"./chunk-65VANXOF.js";import"./chunk-34R7BNZ2.js";import"./chunk-XMPTFXPW.js";import"./chunk-73Y6T2UK.js";import"./chunk-SMXABALN.js";import"./chunk-WN5VKKJ3.js";import{b as xe,c as _e}from"./chunk-MNBGG4H3.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-VLDCHFXF.js";import{d as ve}from"./chunk-ZFM77AQU.js";import{T as ae,U as le,vb as ue}from"./chunk-UEE3RZN4.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-6NFOH4AC.js";import"./chunk-PUVMC4PX.js";import"./chunk-B7ZX5HEN.js";import"./chunk-VZ7KXRXB.js";import"./chunk-7V4BQSSV.js";import"./chunk-HHW6MRU3.js";import"./chunk-7DFBOVUB.js";import"./chunk-4I7YN6YY.js";import"./chunk-6PIIUAZF.js";import"./chunk-NC7D7GOM.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-D36V5OX6.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
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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
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-
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"./chunk-HCJ2N3XB.js";import"./chunk-XMPTFXPW.js";import"./chunk-ZU4W2QGM.js";import"./chunk-73Y6T2UK.js";import"./chunk-REKHAN53.js";import"./chunk-7HMSMAUG.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import"./chunk-I2MC6VVX.js";import"./chunk-RPRXRKKR.js";import"./chunk-QXQ7KVEN.js";import"./chunk-7AET4JKQ.js";import"./chunk-DJC7NTLA.js";import"./chunk-QSCXXNC2.js";import"./chunk-UEE3RZN4.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-6NFOH4AC.js";import"./chunk-7V4BQSSV.js";import"./chunk-VO66KP2W.js";import"./chunk-HHW6MRU3.js";import"./chunk-7DFBOVUB.js";import"./chunk-4I7YN6YY.js";import"./chunk-6PIIUAZF.js";import"./chunk-NC7D7GOM.js";import"./chunk-ZCRZFAOT.js";import"./chunk-C2RUDJ46.js";import"./chunk-RZ4F3BHX.js";import"./chunk-HJMCXSUJ.js";import"./chunk-FOJHSG5M.js";import"./chunk-D36V5OX6.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};
|
|
@@ -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-F5NHG7VB.js";import{a as k}from"./chunk-2DYHAP4E.js";import{d as x}from"./chunk-AEWNWAXW.js";import"./chunk-72KYMWQ5.js";import"./chunk-JQ64X2TO.js";import"./chunk-WXJCJL5L.js";import"./chunk-TDPWFYTJ.js";import"./chunk-34R7BNZ2.js";import"./chunk-V7USCQWO.js";import{b as A}from"./chunk-CGITGJ3I.js";import{h as H}from"./chunk-KXHJMAZU.js";import"./chunk-VE3SUJMA.js";import"./chunk-5D7ENQTQ.js";import"./chunk-C6HI6Y3S.js";import"./chunk-CUXY6KQ2.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-XRNQSXOM.js";import"./chunk-Z7S3IWUX.js";import"./chunk-4JOD47QI.js";import"./chunk-SGPAM5DZ.js";import"./chunk-LUR7JFPP.js";import"./chunk-FCD3NYOM.js";import"./chunk-3G2LSTK5.js";import"./chunk-XZYA7DNH.js";import{d as T}from"./chunk-7AET4JKQ.js";import"./chunk-VZ7KXRXB.js";import"./chunk-GMTHZUZ3.js";import{n as E,o as q}from"./chunk-NC7D7GOM.js";import"./chunk-ZCRZFAOT.js";import{a as R}from"./chunk-C2RUDJ46.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-HJMCXSUJ.js";import"./chunk-D36V5OX6.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-MLMEQJYP.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};
|