@testmuai/kane-cli 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ChatSurface-E7QKI4LA.js +8 -0
- package/dist/{ChromeProfilePicker-4CDSPBWL.js → ChromeProfilePicker-DGDWGCZD.js} +1 -1
- package/dist/{CliFeedbackPrompt-TLRVBA4E.js → CliFeedbackPrompt-SYCZXSME.js} +1 -1
- package/dist/{CliUploadProgress-WGGFLUSF.js → CliUploadProgress-VDEAKXJY.js} +1 -1
- package/dist/{ConfigView-DBANTBXC.js → ConfigView-HPKRQXMC.js} +1 -1
- package/dist/EvidenceViewOffer-F5YG54OC.js +2 -0
- package/dist/{FolderPicker-W7RCIFEL.js → FolderPicker-4NSDXQY5.js} +1 -1
- package/dist/{HelpView-FBCX32U7.js → HelpView-ON6BFGJM.js} +1 -1
- package/dist/{InfoBox-KK2ICVS4.js → InfoBox-B23NZ6IG.js} +1 -1
- package/dist/{LinksBox-KKRANMR3.js → LinksBox-TI26VFFH.js} +1 -1
- package/dist/{ProfilesView-DGPXSAQN.js → ProfilesView-CRO5AH3H.js} +1 -1
- package/dist/{ProjectPicker-ESQSL4TT.js → ProjectPicker-3N7LJOXU.js} +1 -1
- package/dist/{SaveSessionPrompt-AQGP5W6E.js → SaveSessionPrompt-UTOEC5AW.js} +1 -1
- package/dist/SingleShotApp-Y3YDFQSD.js +2 -0
- package/dist/{SummaryBox-BFZJW2KK.js → SummaryBox-JK64EKC2.js} +1 -1
- package/dist/TestMdRunView-O6JTHV5W.js +2 -0
- package/dist/{WhoamiView-JABY3I5Q.js → WhoamiView-6QSLPNF6.js} +1 -1
- package/dist/{auth-76LVI6B5.js → auth-IKFVW3NX.js} +1 -1
- package/dist/bind-KCUSVJXG.js +12 -0
- package/dist/bootstrap-NFYYRGGR.js +2 -0
- package/dist/bridge-JSKEO4N3.js +2 -0
- package/dist/{changelog-PSWPPOAF.js → changelog-AAH2ZBYO.js} +1 -1
- package/dist/chat-committer-UUC6JTRJ.js +2 -0
- package/dist/chat-controller-T2FAI55V.js +2 -0
- package/dist/{chunk-NAE7MBR2.js → chunk-23VPUWBD.js} +3 -3
- package/dist/chunk-2UIHS2FH.js +2 -0
- package/dist/chunk-2WFZIQ62.js +2 -0
- package/dist/chunk-2WRBTLFN.js +13 -0
- package/dist/chunk-2YEHV2CX.js +2 -0
- package/dist/{chunk-KVQOBPAZ.js → chunk-3Q6WAK6P.js} +1 -1
- package/dist/{chunk-6HEGD6H2.js → chunk-4LTXE3IX.js} +1 -1
- package/dist/{chunk-KT6G7AF2.js → chunk-4NFCAGRK.js} +1 -1
- package/dist/chunk-53IBTIL3.js +12 -0
- package/dist/{chunk-FCMLIK7P.js → chunk-5DBK6QNS.js} +1 -1
- package/dist/chunk-5DT7PIGB.js +5 -0
- package/dist/{chunk-XDHZMCTA.js → chunk-5FJJJNJK.js} +2 -2
- package/dist/{chunk-XVDJ423L.js → chunk-5SXMV66P.js} +1 -1
- package/dist/{chunk-6UJDOAYR.js → chunk-5WXGMXGA.js} +2 -2
- package/dist/chunk-5ZQZOVWY.js +4 -0
- package/dist/{chunk-5KFS3GAZ.js → chunk-6KPPGMO2.js} +1 -1
- package/dist/{chunk-RNSSM2BK.js → chunk-74HTO7K3.js} +1 -1
- package/dist/{chunk-PMHJRT3A.js → chunk-7KORP5FF.js} +1 -1
- package/dist/chunk-7OYZR6JA.js +3 -0
- package/dist/chunk-7QJ75SYR.js +8 -0
- package/dist/{chunk-DXV6MBTD.js → chunk-AECMF3T2.js} +1 -1
- package/dist/{chunk-3LWTUMDG.js → chunk-AFBKGZFG.js} +1 -1
- package/dist/{chunk-AM5S4KG4.js → chunk-AFPHLUQ5.js} +1 -1
- package/dist/chunk-AJ56AMT6.js +9 -0
- package/dist/{chunk-NJPTOKW5.js → chunk-APPYQZFK.js} +1 -1
- package/dist/{chunk-CSQ46PJ7.js → chunk-AXTGYOMK.js} +1 -1
- package/dist/{chunk-HPMS5KO6.js → chunk-B5RS2XZU.js} +2 -2
- package/dist/chunk-BKHXPBWN.js +2 -0
- package/dist/{chunk-SRDHPKJT.js → chunk-BXYWX4J3.js} +1 -1
- package/dist/chunk-C3T7TKAC.js +349 -0
- package/dist/{chunk-JEUA4UWK.js → chunk-CLGC7VEO.js} +1 -1
- package/dist/{chunk-L4JIMNKW.js → chunk-CUM23TLF.js} +1 -1
- package/dist/chunk-DBIBROYW.js +5 -0
- package/dist/chunk-DBKNJRJG.js +2 -0
- package/dist/{chunk-M7WQM4UA.js → chunk-DUAXZYAD.js} +1 -1
- package/dist/chunk-DZPGG4S6.js +7 -0
- package/dist/{chunk-2KBD6JZX.js → chunk-EOLFTMWF.js} +1 -1
- package/dist/{chunk-2XGDWUJ5.js → chunk-F7ISS545.js} +1 -1
- package/dist/{chunk-JKTFTF24.js → chunk-FBHRBFHP.js} +1 -1
- package/dist/{chunk-L7VREJTG.js → chunk-FDIPQRX4.js} +1 -1
- package/dist/{chunk-AAONIIQV.js → chunk-GFKCTYCA.js} +1 -1
- package/dist/{chunk-73C4PRYU.js → chunk-GYNTNKNB.js} +1 -1
- package/dist/{chunk-KNDSQ4PS.js → chunk-H32GM5G4.js} +1 -1
- package/dist/{chunk-323MLBYA.js → chunk-HYSFJSIG.js} +1 -1
- package/dist/chunk-I7TIGB7K.js +2 -0
- package/dist/chunk-IDX3TOPY.js +6 -0
- package/dist/{chunk-CVOGP253.js → chunk-IMR64OCZ.js} +1 -1
- package/dist/{chunk-IBNC444G.js → chunk-IOD3HQVW.js} +1 -1
- package/dist/{chunk-URQUQWGW.js → chunk-J5FBU425.js} +40 -40
- package/dist/chunk-JKM2PUHI.js +4 -0
- package/dist/{chunk-ZM5PVRJK.js → chunk-JPWLGHPM.js} +1 -1
- package/dist/{chunk-5JTUL6XL.js → chunk-JZ26R6UL.js} +1 -1
- package/dist/chunk-KBM3XHAM.js +2 -0
- package/dist/{chunk-SY3HLQMV.js → chunk-KCCSWEGA.js} +1 -1
- package/dist/{chunk-APAIWBIH.js → chunk-KQZA2QSC.js} +1 -1
- package/dist/{chunk-X3ICV5M5.js → chunk-KWIK22R6.js} +1 -1
- package/dist/{chunk-33QXD75Y.js → chunk-M6FKJKC6.js} +2 -2
- package/dist/{chunk-IXVOXJP6.js → chunk-MK7JUOYV.js} +1 -1
- package/dist/chunk-N2P4MI32.js +2 -0
- package/dist/{chunk-JRMDGLLT.js → chunk-O75ZHGJG.js} +1 -1
- package/dist/chunk-OR6MCL6Z.js +2 -0
- package/dist/chunk-ORQNKZ2Z.js +5 -0
- package/dist/{chunk-QROUKGKU.js → chunk-OS4VSIHT.js} +1 -1
- package/dist/{chunk-UI7KULSI.js → chunk-OUJQVBUT.js} +3 -3
- package/dist/{chunk-UBFKZEX3.js → chunk-PLOWZLG5.js} +1 -1
- package/dist/chunk-QIGPXYMF.js +19 -0
- package/dist/chunk-QOFZSHSC.js +47 -0
- package/dist/{chunk-2XMJ6YAE.js → chunk-R5T4RLF5.js} +1 -1
- package/dist/chunk-R7QAS6LZ.js +4 -0
- package/dist/{chunk-CDQX6HGJ.js → chunk-RDNFVZEB.js} +1 -1
- package/dist/{chunk-NRTHYROA.js → chunk-SFII7HPP.js} +1 -1
- package/dist/{chunk-3FN5VJMV.js → chunk-SL6PCVM2.js} +1 -1
- package/dist/{chunk-LQZ2BU7Q.js → chunk-STVP2XHO.js} +1 -1
- package/dist/chunk-TH47OOBV.js +4 -0
- package/dist/{chunk-OHRS3H7Z.js → chunk-TRJUD3XJ.js} +1 -1
- package/dist/{chunk-BAL64WSI.js → chunk-UC7MNPIN.js} +1 -1
- package/dist/chunk-UD7KKHPW.js +5 -0
- package/dist/chunk-VAYBKR76.js +4 -0
- package/dist/chunk-VFII6C46.js +2 -0
- package/dist/{chunk-R2RGSO4B.js → chunk-VHZ4S57N.js} +1 -1
- package/dist/{chunk-WJ5HDEVH.js → chunk-VLWMMOMF.js} +1 -1
- package/dist/chunk-VMM4LC4V.js +10 -0
- package/dist/{chunk-322JEJEH.js → chunk-VOOPWFHW.js} +1 -1
- package/dist/{chunk-4OPQJ7PE.js → chunk-VRLUNZAK.js} +1 -1
- package/dist/{chunk-AH7ZZIZY.js → chunk-VRVFPMCR.js} +1 -1
- package/dist/{chunk-F6ZOJXYU.js → chunk-VT54ARGE.js} +1 -1
- package/dist/{chunk-NBKQT7LJ.js → chunk-VWKVUOXU.js} +1 -1
- package/dist/chunk-W4B5LOEX.js +4 -0
- package/dist/{chunk-36OC3TFE.js → chunk-W5TTF7GB.js} +2 -2
- package/dist/chunk-WXHQYYD5.js +2 -0
- package/dist/{chunk-NOCIMJSN.js → chunk-XUS4WKDS.js} +1 -1
- package/dist/chunk-XWKUZJCP.js +2 -0
- package/dist/chunk-YTHQNN2L.js +3 -0
- package/dist/{chunk-V36ATG7A.js → chunk-ZBOWFJB2.js} +2 -2
- package/dist/chunk-ZMNJBUAO.js +2 -0
- package/dist/{chunk-LR5XO2KD.js → chunk-ZRASQ63J.js} +1 -1
- package/dist/{chunk-C4G7RVJ6.js → chunk-ZUGCHQFC.js} +1 -1
- package/dist/committer-SWEWEYNX.js +2 -0
- package/dist/{config-R3GF2FZA.js → config-CWZV6XPT.js} +1 -1
- package/dist/{cover-cmd-TXICWHUU.js → cover-cmd-NWIRJY5Z.js} +1 -1
- package/dist/{credentials-XN4ROCQ3.js → credentials-YHTJGKEO.js} +1 -1
- package/dist/descriptor-OEUZZCOK.js +2 -0
- package/dist/design-committer-VYT6NU3T.js +2 -0
- package/dist/dispatch-WVNXB7AD.js +2 -0
- package/dist/docx-convert-CHLJUTFH.js +2 -0
- package/dist/{dossier-QZV74XOS.js → dossier-KTLTGT2X.js} +1 -1
- package/dist/{evidence-V23FPVXQ.js → evidence-IVDNXWPL.js} +1 -1
- package/dist/evolve-cmd-XBX4SX5H.js +2 -0
- package/dist/{exit-manager-HNFATGSM.js → exit-manager-XZL4KIJU.js} +1 -1
- package/dist/explain-UAAQWHYR.js +2 -0
- package/dist/{explain-cmd-RZW6QJYM.js → explain-cmd-75MCF2ZV.js} +1 -1
- package/dist/{explain-cmd-X7JZLSZZ.js → explain-cmd-IZEHWZV5.js} +1 -1
- package/dist/extract-bind-5OWELRME.js +10 -0
- package/dist/extract-cmd-ZRYMJ6IC.js +5 -0
- package/dist/feeder-C3TOJPKK.js +2 -0
- package/dist/{gaps-cmd-BWCRLLBK.js → gaps-cmd-XBRXKXDL.js} +1 -1
- package/dist/{gate-YHBPWEM5.js → gate-54BRAE7N.js} +1 -1
- package/dist/{generate-headless-BSTDLZZY.js → generate-headless-D6BISWDC.js} +2 -2
- package/dist/{headless-io-BL3TEAX5.js → headless-io-66RG5NN5.js} +1 -1
- package/dist/identity-ADZ4PAJF.js +2 -0
- package/dist/index.js +43 -43
- package/dist/ingest-EX72IEQT.js +2 -0
- package/dist/ingest-cmd-YTGOICTC.js +2 -0
- package/dist/{interactive-bind-43HGDF5K.js → interactive-bind-XSRD36MO.js} +7 -6
- package/dist/{lifecycle-cmd-D6TVTYRK.js → lifecycle-cmd-EQSFAZG6.js} +1 -1
- package/dist/{list-cmd-XCAV2FKA.js → list-cmd-IRJSUCM5.js} +1 -1
- package/dist/{list-commands-747UTUSS.js → list-commands-RCYHJ5Y3.js} +1 -1
- package/dist/locks-cmd-CSVSWY2Y.js +2 -0
- package/dist/logical-ids-TEBCQJGO.js +2 -0
- package/dist/login-flow-PYAPYCPY.js +2 -0
- package/dist/maintenance-cmd-MVFA6H74.js +2 -0
- package/dist/pdf-convert-OZIRUADA.js +2 -0
- package/dist/{persist-recorded-session-MDPWWUA7.js → persist-recorded-session-DTYCLXTQ.js} +1 -1
- package/dist/phase-seed-DIRETNU6.js +2 -0
- package/dist/pipeline-MXFOD6ES.js +2 -0
- package/dist/readmodel-XOYGGQ3S.js +2 -0
- package/dist/reconcile-cmd-EG6BOU3A.js +2 -0
- package/dist/reconcile-deps-HTT6IPHT.js +4 -0
- package/dist/reconcile-engine-JQNXALNY.js +2 -0
- package/dist/{recording-banner-TALO7PUR.js → recording-banner-76GCIPUN.js} +1 -1
- package/dist/records-IOZTZUZV.js +2 -0
- package/dist/{require-project-folder-R347LFDQ.js → require-project-folder-ACRDP5ZB.js} +1 -1
- package/dist/{resolver-IDCGRPFJ.js → resolver-SRPCFW7P.js} +1 -1
- package/dist/revert-NQ7GEVSE.js +2 -0
- package/dist/review-cmd-L3V5UP5T.js +4 -0
- package/dist/run-GMZCDRDD.js +2 -0
- package/dist/run-TFRWPGXP.js +2 -0
- package/dist/run-channel-RGH4WIQX.js +2 -0
- package/dist/{run-test-md-DFNIGYB7.js → run-test-md-KEHSRMCM.js} +2 -2
- package/dist/sessions-GIEXOCE4.js +2 -0
- package/dist/{sessions-cmd-AQWLL5ZN.js → sessions-cmd-ZVYGSRJ3.js} +4 -4
- package/dist/{skill-installer-ANXTCXQV.js → skill-installer-HBN3A35K.js} +1 -1
- package/dist/spawner-GC5CFAJ7.js +2 -0
- package/dist/structured-answers-A43Q25CZ.js +5 -0
- package/dist/tcg-generate-V7YFNC5O.js +2 -0
- package/dist/testmd-actions-MNDOO76O.js +2 -0
- package/dist/token-refresh-3UYMCYG3.js +2 -0
- package/dist/{validate-basic-O2DP2XJL.js → validate-basic-ZGWPBYB6.js} +1 -1
- package/dist/verdicts-SCETLY5J.js +2 -0
- package/dist/{version-check-RNR3JCQ5.js → version-check-CJWKDAXV.js} +1 -1
- package/dist/{view-cmd-YSEGA5PI.js → view-cmd-SOVM64L2.js} +1 -1
- package/dist/walk-session-YUYRULPY.js +2 -0
- package/dist/with-telemetry-E7QWPGL6.js +2 -0
- package/package.json +6 -6
- package/dist/ChatSurface-D66CACLX.js +0 -8
- package/dist/EvidenceViewOffer-DNCQ3A6R.js +0 -2
- package/dist/SingleShotApp-SMCAIKCE.js +0 -2
- package/dist/TestMdRunView-FMKZJ3A3.js +0 -2
- package/dist/bind-AACBTSAA.js +0 -12
- package/dist/bootstrap-CNOZ5VRB.js +0 -2
- package/dist/bridge-T4HL4TG7.js +0 -2
- package/dist/chat-committer-4BQBOKI4.js +0 -2
- package/dist/chat-controller-NNTMKEPG.js +0 -2
- package/dist/chunk-2SREGETM.js +0 -4
- package/dist/chunk-3STZLM5J.js +0 -4
- package/dist/chunk-5YPBPZUR.js +0 -2
- package/dist/chunk-BQHKBOSF.js +0 -11
- package/dist/chunk-DQ54MH7F.js +0 -13
- package/dist/chunk-EV3EHXEI.js +0 -4
- package/dist/chunk-F7WKDMX7.js +0 -47
- package/dist/chunk-FPFOW6BS.js +0 -2
- package/dist/chunk-GVIPTX6T.js +0 -6
- package/dist/chunk-GW5DWAXY.js +0 -2
- package/dist/chunk-HJERKSBK.js +0 -349
- package/dist/chunk-IQDWBTRJ.js +0 -3
- package/dist/chunk-KRXSXQBU.js +0 -12
- package/dist/chunk-NAC7SFBE.js +0 -5
- package/dist/chunk-NRC2G4Y5.js +0 -5
- package/dist/chunk-O56PUUNL.js +0 -9
- package/dist/chunk-QM4S2APK.js +0 -2
- package/dist/chunk-SE6WNCYU.js +0 -4
- package/dist/chunk-SWESH2J7.js +0 -10
- package/dist/chunk-T63R6QT4.js +0 -4
- package/dist/chunk-UPPEOQJQ.js +0 -3
- package/dist/chunk-UX2B7L6K.js +0 -2
- package/dist/chunk-VOHQA2SP.js +0 -2
- package/dist/chunk-W5DOU2DV.js +0 -2
- package/dist/chunk-W6VD2XFO.js +0 -19
- package/dist/chunk-WWNSD6FA.js +0 -6
- package/dist/chunk-ZLCZDAEX.js +0 -6
- package/dist/committer-2EJPVVCQ.js +0 -2
- package/dist/descriptor-KXDJ4XYD.js +0 -2
- package/dist/design-committer-BQUWD6AC.js +0 -2
- package/dist/docx-convert-ZBVQO2LG.js +0 -2
- package/dist/evolve-cmd-PZCPXDMR.js +0 -2
- package/dist/explain-UE4IACQH.js +0 -2
- package/dist/extract-bind-BFY7IRL4.js +0 -10
- package/dist/extract-cmd-U3MGK2LP.js +0 -6
- package/dist/feeder-XGTFV7TZ.js +0 -2
- package/dist/ingest-AL6CABJT.js +0 -2
- package/dist/ingest-cmd-O6OWWZT4.js +0 -2
- package/dist/locks-cmd-QAULI5LV.js +0 -2
- package/dist/logical-ids-4G4FAHNJ.js +0 -2
- package/dist/login-flow-CV76ENHV.js +0 -2
- package/dist/maintenance-cmd-ZRB4NTGG.js +0 -2
- package/dist/pdf-convert-S7VYE6AV.js +0 -2
- package/dist/phase-seed-52LRE3LH.js +0 -2
- package/dist/pipeline-LM5JAK7F.js +0 -2
- package/dist/readmodel-X7L7W2BA.js +0 -2
- package/dist/reconcile-cmd-DGCSDML6.js +0 -2
- package/dist/records-5SVUXJBW.js +0 -2
- package/dist/revert-DXXYXJGN.js +0 -2
- package/dist/review-cmd-2QF5HTI7.js +0 -4
- package/dist/run-52UIBPXD.js +0 -2
- package/dist/run-VRVH4VO3.js +0 -2
- package/dist/sessions-BLXZVK5U.js +0 -2
- package/dist/spawner-AH5FTUYU.js +0 -2
- package/dist/structured-answers-QHFGZPSS.js +0 -5
- package/dist/tcg-generate-WKCBBKI5.js +0 -2
- package/dist/testmd-actions-RPYG6TJG.js +0 -2
- package/dist/token-refresh-NIDUOTRM.js +0 -2
- package/dist/verdicts-TJH3O5UW.js +0 -2
- package/dist/walk-session-HXW4OSA2.js +0 -2
- package/dist/with-telemetry-PNP6CAVM.js +0 -2
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as i}from"./chunk-CH273NAE.js";import"./chunk-UR6MHSHU.js";import{existsSync as u}from"fs";async function g(e){if(e.mode!=null&&!["interactive","agent","ci","override"].includes(e.mode)){let{makeHeadlessIO:t,agentRefusal:r}=await import("./headless-io-66RG5NN5.js");return r(t("ndjson","extract"),`extract: --mode must be interactive | agent | ci | override, got '${e.mode}'`,"MODE_USAGE")}let n=async(t,r)=>{if(e.mode!=="agent")return process.stderr.write(t+`
|
|
3
|
+
`),2;let{makeHeadlessIO:o,agentRefusal:c}=await import("./headless-io-66RG5NN5.js");return c(o("ndjson","extract"),t,r)};if(e.apply)return n("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-66RG5NN5.js"),r=t(e,"extract");if(r)return n(r)}{let{gateStructuredFlags:t}=await import("./structured-answers-A43Q25CZ.js"),r=t(e,"extract");if(r)return n(r,"STRUCTURED_FLAGS_USAGE")}if(e.withSource&&!e.resume)return n("extract: --with-source pairs with --resume \u2014 it lands the source and sets the resumed session's pending questions aside");if(e.queued)return n("extract: --queued is gone \u2014 extract sweeps every pending source by default (just run kane-cli context extract)");if(!u(i(process.cwd())))return n("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
|
|
4
|
+
`),2;let s=e.mode??"interactive";if(s==="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)
|
|
5
|
+
`),2;let{bindExtractInteractive:t}=await import("./extract-bind-5OWELRME.js");return t(e)}let{bindExtractHeadless:a}=await import("./extract-bind-5OWELRME.js");return a({...e,mode:s})}export{g as extractCommand};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d}from"./chunk-VRVFPMCR.js";import"./chunk-GFKCTYCA.js";import"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-UR6MHSHU.js";export{a as archiveImpact,b as heldArchiveScan,c as reviewCards,d as reviewCounts};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as R,b as H,d as ae}from"./chunk-QROUKGKU.js";import{a as ie,b as ce}from"./chunk-IBNC444G.js";import"./chunk-ZLCZDAEX.js";import{a as ee,b as te,c as ne,d as se,e as re,f as oe}from"./chunk-FCMLIK7P.js";import{e as X,f as J}from"./chunk-CJJXT5DO.js";import{a as C,b as Z,c as F,d as q}from"./chunk-QM4S2APK.js";import"./chunk-ZPDM6FO7.js";import{e as Q}from"./chunk-EHN5HTUD.js";import"./chunk-CH273NAE.js";import{a as W}from"./chunk-L5LI2JF4.js";import{a as K}from"./chunk-GW5DWAXY.js";import"./chunk-T63R6QT4.js";import"./chunk-3STZLM5J.js";import"./chunk-L4JIMNKW.js";import"./chunk-M7WQM4UA.js";import"./chunk-WWNSD6FA.js";import"./chunk-IAHKTEET.js";import{d as G,e as M}from"./chunk-5YPBPZUR.js";import"./chunk-UR6MHSHU.js";import{basename as B}from"path";import{statSync as Se}from"fs";function ye(e,t){return e.length===0?"not_run":ne(e,t).verified?"proven":te(e,t).some(n=>n.verdict==="failed")?"failing":"blocked"}function le(e,t){let s=null;for(let{cid:f}of e.byLabel(G.TEST))for(let o of e.execHistory(f))(!s||String(o.started_at)>s.started_at)&&(s={execution_id:String(o.execution_id),started_at:String(o.started_at)});if(!s)return null;let n=ee[t],r=oe(e),c=se(r).aspects[t],i={},d={},l=0,g=0,a=0;for(let f of r.usecases){let o=[];for(let b of f.acceptance_criteria){let u=b.executions??[],_=ye(u,n);o.push(_),_==="failing"?l++:_==="blocked"?g++:_==="not_run"&&a++;let S=[],k;if(_==="failing"){let w=null;for(let O of b.covered_by){let T=e.execHistory(O).map($=>({verdict:String($.per_ac?.find(y=>y.ac_ref===b.id)?.verdict??$.verdict),oracle_mode:String($.oracle_mode),ts:String($.started_at),execution_id:String($.execution_id)})).filter($=>n.counted_verdicts.includes($.verdict)&&n.accepted_oracle_modes.includes($.oracle_mode)),I=T[T.length-1];I?.verdict==="failed"&&(S.push(O),(!w||I.ts>w.ts)&&(w={ts:I.ts,execution_id:I.execution_id}))}k=w?.execution_id}else _==="blocked"&&(k=u[u.length-1]?.execution_id);i[b.id]={state:_,viaTests:S,...k?{executionId:k}:{}}}let m=o.some(b=>b!=="not_run"),p=c.usecases[f.id],v=m?p.status==="covered"?"proven":p.status==="partial"?"partial":o.includes("failing")?"failing":o.includes("blocked")?"blocked":"not_run":"not_run";d[f.id]={pct:p.pct,status:v}}return{aspect:t,pct:c.summary.coverage_pct,acs_proven:c.summary.acs_verified,failing:l,blocked:g,not_run:a,latest_run:s,perUc:d,perAc:i,config:{...n,source:"graph_execution_facts",denominator:"current_live_acs"}}}var be=["failing","blocked","needs-refresh","needs-tests","needs-scenarios","happy-only","possible-duplicate","not-yet-run"],_e={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"},E={high:0,med:1,low:2};function Y(e,t){let s=/^(.*?)(\d+)$/.exec(e),n=/^(.*?)(\d+)$/.exec(t);return s&&n&&s[1]===n[1]?Number(s[2])-Number(n[2]):e<t?-1:e>t?1:0}function D(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 fe(e,t=5){let s=e.trim().split(/\s+/);return s.slice(0,t).join(" ")+(s.length>t?"\u2026":"")}function ke(e,t){let s=e.resolve(t),n=s?e.getNode(e.tipOf(s.cid))?.content:null;return String(n?.title??n?.text??"")}function ue(e,t){let s=e.resolve(t);return{id:s?e.displayNameOf(e.tipOf(s.cid))??e.displayNameOf(s.cid):null,title:fe(ke(e,t),8)}}function $e(e,t){let s=e.resolve(t);if(!s)return null;let n=e.tipOf(s.cid);if(!C(e,n))return null;let r=e.nodeLabel.get(n);if(r===G.USECASE)return n;if(r===G.AC)return F(e,n);if(r===G.TEST){let c=e.edgesFrom(n).find(d=>d.type===M.VERIFIES&&C(e,d.dst));if(c)return F(e,c.dst);let i=e.edgesFrom(n).find(d=>d.type===M.AUTOMATES&&C(e,d.dst));if(i){let d=e.edgesFrom(i.dst).find(l=>l.type===M.BELONGS_TO&&C(e,l.dst));return d?d.dst:null}}return null}function j(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 xe(e,t){let s=e.resolve(t),n=s?e.getNode(e.tipOf(s.cid))?.content.risk:null;return n==="high"||n==="med"||n==="low"?n:"med"}function ge(e,t,s,n,r){let c=r.servePaths??new Map,i=e.byLabel(G.USECASE).filter(({cid:o})=>C(e,o)),d=new Map(i.map(o=>[o.cid,o])),l=new Map(i.map(({cid:o})=>[o,[]])),g=[];for(let o of t){if(o.stage!=="design")continue;let m={...o,...ue(e,o.ref)},p=$e(e,o.ref),v=p?l.get(p):void 0;v&&j(o)!=="other"?v.push(m):g.push(m)}let a=new Map(i.map(({cid:o})=>[o,{total:0,designed:0}]));for(let{cid:o}of e.byLabel(G.AC)){if(!C(e,o))continue;let m=F(e,o),p=m?a.get(m):void 0;if(!p)continue;p.total++;let v=Z(e,o);if(v&&p.designed++,!n)continue;let b=e.nameOf.get(o)??o,u=n.perAc[b];if(!u)continue;let{id:_,title:S}=ue(e,b),k={ref:e.displayNameOf(o)??o,id:_,title:S,risk:xe(e,b),stage:"cover"},w=l.get(m);u.state==="failing"?w.push({...k,kind:"execution-failed",tag:"evolve",why:"covering test failed against this AC",ready_command:u.executionId&&c.has(u.executionId)?`kane-cli evidence serve ${c.get(u.executionId)}`:"kane-cli testrun run",via_tests:u.viaTests,...u.executionId?{execution_id:u.executionId}:{},...u.executionId&&c.has(u.executionId)?{servePath:c.get(u.executionId)}:{},...r.testFiles?{viaFiles:u.viaTests.map(O=>r.testFiles.get(O)??null)}:{}}):u.state==="blocked"?w.push({...k,kind:"execution-blocked",tag:"reuse-candidate",why:"the formula could count no run \u2014 broken/skipped or an unaccepted oracle",ready_command:u.executionId&&c.has(u.executionId)?`kane-cli evidence serve ${c.get(u.executionId)}`:"kane-cli testrun run",...u.executionId?{execution_id:u.executionId}:{},...u.executionId&&c.has(u.executionId)?{servePath:c.get(u.executionId)}:{}}):u.state==="not_run"&&v&&w.push({...k,kind:"covered-not-run",tag:"reuse-candidate",why:"a covering test exists but has not run yet",ready_command:"kane-cli testrun run"})}let f=[];for(let{cid:o,content:m}of i){let p=e.displayNameOf(o)??o,v=e.nameOf.get(o)??o,b=s.perUc[p]??{pct:0,status:"undesigned",staleAcs:0},u=n?n.perUc[v]??{pct:0,status:"not_run"}:null,_=n!==null&&(u===null||u.status==="not_run"),S=a.get(o),k=l.get(o)??[],w=new Set(k.filter(h=>j(h)==="needs-refresh").map(h=>h.ref)),O=k.some(h=>j(h)==="needs-tests"&&w.has(h.ref)),T=[];for(let h of be){let A=k.filter(P=>j(P)===h);if(h==="needs-tests"&&(A=A.filter(P=>!w.has(P.ref))),A.length===0)continue;A.sort((P,V)=>(E[P.risk]??3)-(E[V.risk]??3)||Y(P.ref,V.ref));let ve=h==="failing"||h==="blocked"||A.length<=2||new Set(A.map(P=>P.ready_command)).size>1;T.push({key:h,label:_e[h],...h==="needs-refresh"?{suffix:"source moved since these were designed"}:{},alsoNeedsTests:h==="needs-refresh"&&O,rows:A,...ve?{}:{rosterCommand:A[0].ready_command}})}let I=T.some(h=>h.key==="failing"),$=T.some(h=>h.key==="blocked"),y=b.pct===100&&(n===null||u?.pct===100)&&T.length===0,U=u!==null&&u.pct>0,x=I?"\u2717":$?"\u23F8":y?"\u2714":b.pct===0&&!U?"\u2716":"\u25D0";f.push({slug:p,title:String(m.title??""),risk:String(m.risk??""),des:b,prov:u,provAbsent:_,acTotal:S.total,acDesigned:S.designed,mark:x,collapse:y,groups:T})}return f.sort((o,m)=>(E[o.risk]??3)-(E[m.risk]??3)||Y(o.slug,m.slug)),g.sort((o,m)=>(E[o.risk]??3)-(E[m.risk]??3)||Y(o.ref,m.ref)),{stage:r.stage,aspect:r.aspect,top:r.top,dc:s,pa:n,ucs:f,other:g}}function N(e,t){let s=Math.round(e/100*t);return"\u2588".repeat(s)+"\u2591".repeat(t-s)}function z(e){return e===100?"\u2714":e>0?"\u25D0":"\u2716"}function L(e,t){return e==="all"||t.stage===e}function me(e,t){let{dc:s,pa:n}=e,r=Math.max(80,Math.min(t.width,120)),c=l=>t.color?`\x1B[2m${l}\x1B[22m`:l,i=[];if(n){i.push(`coverage \u2014 designed \xD7 proven \xB7 live graph \xB7 aspect ${n.aspect}`),i.push("");let l=s.ucs_needing_scenarios;i.push(` designed ${z(s.pct)} ${N(s.pct,10)} ${String(s.pct).padStart(3)}% \u2014 ${s.acs_designed} ACs have verifying tests`+(l>0?` \xB7 scenario debt: ${l} UC${l>1?"s":""}`:""));let g=[n.failing>0?`${n.failing} failing`:null,n.blocked>0?`${n.blocked} blocked`:null,n.not_run>0?`${n.not_run} not yet run`:null].filter(Boolean);i.push(` proven ${z(n.pct)} ${N(n.pct,10)} ${String(n.pct).padStart(3)}% \u2014 ${n.acs_proven} proven by execution`+(g.length?` \xB7 ${g.join(" \xB7 ")}`:""))}else i.push("AC design completeness \u2014 live graph (what design owes; execution proof not shown)"),i.push(""),i.push(` designed ${z(s.pct)} ${N(s.pct,10)} ${String(s.pct).padStart(3)}% \u2014 ${s.acs_designed} ACs have verifying tests \xB7 ${s.usecases_complete} UCs complete`),s.ucs_needing_scenarios>0&&i.push(` scenario debt: ${s.ucs_needing_scenarios} use-case${s.ucs_needing_scenarios>1?"s":""} need scenarios`),i.push(" proven \u2014 no runs recorded yet \xB7 run tests, then re-run");i.push("");let d=!1;for(let l of e.ucs){if(i.push(we(l,n!==null,r)),l.collapse)continue;let g=e.top??1/0;for(let a of l.groups){let f=a.rows.filter(v=>L(e.stage,v));if(f.length===0)continue;if(d=!0,g<=0){i.push(c(` \u2026 +${f.length} more ${a.label}`));continue}let o=f.slice(0,g),m=f.length-o.length;if(g-=o.length,(a.key==="needs-scenarios"||a.key==="happy-only")&&o.length===1&&o[0].ref===l.slug){i.push(` ${a.label}${a.key==="needs-scenarios"?" \u2014 design from scratch":""}`),i.push(c(` \u2192 ${o[0].ready_command}`));continue}let p=(a.suffix?` \u2014 ${a.suffix}`:"")+(a.alsoNeedsTests?" \u2014 also needs tests":"");if(i.push(` ${a.label} (${f.length})${p}`),a.rosterCommand&&a.key!=="failing"&&a.key!=="blocked")Re(i,o,r),i.push(c(` \u2192 ${a.rosterCommand}`));else for(let v of o)Te(i,v,a.key,c);m>0&&i.push(c(` \u2026 +${m} more ${a.label}`))}}return!d&&e.ucs.every(l=>l.groups.every(g=>g.rows.filter(a=>L(e.stage,a)).length===0))&&i.push(" nothing owed \u2014 design and execution are square"),i.push(""),i.push(c(" metric: live verifies edges \xB7 high \xD73 \xB7 staleness shown, not discounted")),n?i.push(c(` proven: graph execution facts \xB7 latest run ${n.latest_run?.started_at??"\u2014"} \xB7 ${n.aspect} formula verbatim`)):i.push(c(" proof: no runs recorded yet \u2014 run tests, then re-run")),i}function we(e,t,s){let n=D(e.slug);if(!t){let l=e.acTotal===0?"no scenarios yet":e.collapse||e.des.status==="complete"?`${e.acTotal} ACs \xB7 complete`:e.des.staleAcs>0?`${e.acTotal} ACs \xB7 ${e.des.staleAcs} stale`:`${e.acTotal} ACs \xB7 ${e.acTotal-e.acDesigned} unverified`,g=` ${e.mark} ${N(e.des.pct,10)} ${String(e.des.pct).padStart(3)}% ${n} `,a=Math.max(0,s-g.length-l.length-2);return`${g}${de(e.title,a).padEnd(a)} ${l}`}let r=e.provAbsent?"prov \xB7 not run":`prov ${N(e.prov?.pct??0,8)} ${String(e.prov?.pct??0).padStart(3)}%`,c=`des ${N(e.des.pct,8)} ${String(e.des.pct).padStart(3)}% \xB7 ${r}`,i=` ${e.mark} ${n} `,d=Math.max(0,s-i.length-c.length-2);return`${i}${de(e.title,d).padEnd(d)} ${c}`}function de(e,t){return e.length<=t?e:t<=1?e.slice(0,t):e.slice(0,t-1)+"\u2026"}function Te(e,t,s,n){let r=D(t.id??t.ref);if(s==="failing"){let c=(t.via_tests??[]).map((d,l)=>`${D(d)}${t.viaFiles?.[l]?` ${t.viaFiles[l]}`:""}`).join(", ");e.push(` \u2717 ${r} ${t.title} \u2014 failed${c?` \xB7 via ${c}`:""}`),t.servePath&&e.push(n(` \u2192 kane-cli evidence serve ${t.servePath} (see why it failed)`));let i=(t.viaFiles??[]).filter(d=>d!==null);i.length===1?e.push(n(` re-run after fixing: kane-cli testmd run ${i[0]} (heals on failure \u2014 fix the app first, or the test may re-author)`)):i.length>1&&e.push(n(" re-run after fixing: kane-cli testrun run (heals on failure \u2014 fix the app first, or the tests may re-author)"));return}if(s==="blocked"){e.push(` \u23F8 ${r} ${t.title} \u2014 (blocked \u2014 see why)`),t.servePath&&e.push(n(` \u2192 kane-cli evidence serve ${t.servePath} (see why)`));return}e.push(` ${r} ${t.title} \u2014 ${t.why}`),e.push(n(` \u2192 ${t.ready_command}`))}function Re(e,t,s){let n=t.map(c=>`${D(c.id??c.ref)} ${fe(c.title,4)}`),r=" ";for(let c of n){let i=r.trim().length?" \xB7 ":"";r.length+i.length+c.length>s&&r.trim().length?(e.push(r),r=" "+c):r+=i+c}r.trim().length&&e.push(r)}function he(e){let{dc:t,pa:s}=e,n=r=>e.top!==void 0?r.slice(0,e.top):r;return{stage:e.stage,rollup_version:1,design_completeness:{pct:t.pct,acs_designed:t.acs_designed,usecases_complete:t.usecases_complete,ucs_needing_scenarios:t.ucs_needing_scenarios,config:t.config},...s?{proven:{aspect:s.aspect,pct:s.pct,acs_proven:s.acs_proven,failing:s.failing,blocked:s.blocked,not_run:s.not_run,latest_run:s.latest_run,config:s.config}}:{},usecases:e.ucs.map(r=>({id:/^sha256:/.test(r.slug)?null:r.slug,title:r.title,risk:r.risk,design_completeness:{pct:r.des.pct,status:r.des.status},stale_acs:r.des.staleAcs,...s?{proven:r.prov??{pct:0,status:"not_run"}}:{},pending:n(r.groups.flatMap(c=>c.rows).filter(c=>L(e.stage,c))).map(pe)})),other:e.other.filter(r=>L(e.stage,r)).map(pe)}}function pe(e){let{servePath:t,viaFiles:s,meta:n,...r}=e;return{...r}}async function Ae(e){let t=await X(e);return t.length===0?null:t.map(s=>({p:s,m:Se(s).mtimeMs})).sort((s,n)=>n.m-s.m)[0].p}async function Oe(e,t=ae(),s=process.cwd()){if(e.mode!==void 0&&e.mode!=="agent"&&e.mode!=="ci"&&e.mode!=="interactive")return R(t,`--mode must be interactive | agent | ci, got '${e.mode}'`),2;if(e.mode==="agent"||e.mode==="ci"){let{makeHeadlessIO:p,agentRefusal:v}=await import("./headless-io-BL3TEAX5.js"),{parsesAgainstGrammar:b}=await import("./next-TRSKMBO5.js"),u=p("ndjson","gaps",{stdout:y=>t.out(y.replace(/\n$/,"")),stderr:y=>(t.err??t.out)(y.replace(/\n$/,""))}),_=[],S=[],k={out:y=>_.push(y),err:y=>S.push(y),confirm:async()=>!1,isTTY:!1};if(await Oe({...e,json:!0,mode:void 0},k,s)!==0)return v(u,S.join("; ")||"cover gaps refused");let O=JSON.parse(_.join(`
|
|
2
|
+
import{a as R,b as H,d as ae}from"./chunk-OS4VSIHT.js";import{a as ie,b as ce}from"./chunk-IOD3HQVW.js";import"./chunk-5DT7PIGB.js";import{a as ee,b as te,c as ne,d as se,e as re,f as oe}from"./chunk-5DBK6QNS.js";import{e as X,f as J}from"./chunk-CJJXT5DO.js";import{a as C,b as Z,c as F,d as q}from"./chunk-XWKUZJCP.js";import"./chunk-ZPDM6FO7.js";import{e as Q}from"./chunk-EHN5HTUD.js";import{a as W}from"./chunk-L5LI2JF4.js";import{A as K}from"./chunk-TH47OOBV.js";import"./chunk-VAYBKR76.js";import"./chunk-CUM23TLF.js";import"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import{d as G,e as M}from"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-CH273NAE.js";import"./chunk-UR6MHSHU.js";import{basename as B}from"path";import{statSync as Se}from"fs";function ye(e,t){return e.length===0?"not_run":ne(e,t).verified?"proven":te(e,t).some(n=>n.verdict==="failed")?"failing":"blocked"}function le(e,t){let s=null;for(let{cid:f}of e.byLabel(G.TEST))for(let o of e.execHistory(f))(!s||String(o.started_at)>s.started_at)&&(s={execution_id:String(o.execution_id),started_at:String(o.started_at)});if(!s)return null;let n=ee[t],r=oe(e),c=se(r).aspects[t],i={},d={},l=0,g=0,a=0;for(let f of r.usecases){let o=[];for(let b of f.acceptance_criteria){let u=b.executions??[],_=ye(u,n);o.push(_),_==="failing"?l++:_==="blocked"?g++:_==="not_run"&&a++;let S=[],k;if(_==="failing"){let w=null;for(let O of b.covered_by){let T=e.execHistory(O).map($=>({verdict:String($.per_ac?.find(y=>y.ac_ref===b.id)?.verdict??$.verdict),oracle_mode:String($.oracle_mode),ts:String($.started_at),execution_id:String($.execution_id)})).filter($=>n.counted_verdicts.includes($.verdict)&&n.accepted_oracle_modes.includes($.oracle_mode)),I=T[T.length-1];I?.verdict==="failed"&&(S.push(O),(!w||I.ts>w.ts)&&(w={ts:I.ts,execution_id:I.execution_id}))}k=w?.execution_id}else _==="blocked"&&(k=u[u.length-1]?.execution_id);i[b.id]={state:_,viaTests:S,...k?{executionId:k}:{}}}let m=o.some(b=>b!=="not_run"),p=c.usecases[f.id],v=m?p.status==="covered"?"proven":p.status==="partial"?"partial":o.includes("failing")?"failing":o.includes("blocked")?"blocked":"not_run":"not_run";d[f.id]={pct:p.pct,status:v}}return{aspect:t,pct:c.summary.coverage_pct,acs_proven:c.summary.acs_verified,failing:l,blocked:g,not_run:a,latest_run:s,perUc:d,perAc:i,config:{...n,source:"graph_execution_facts",denominator:"current_live_acs"}}}var be=["failing","blocked","needs-refresh","needs-tests","needs-scenarios","happy-only","possible-duplicate","not-yet-run"],_e={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"},E={high:0,med:1,low:2};function Y(e,t){let s=/^(.*?)(\d+)$/.exec(e),n=/^(.*?)(\d+)$/.exec(t);return s&&n&&s[1]===n[1]?Number(s[2])-Number(n[2]):e<t?-1:e>t?1:0}function D(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 fe(e,t=5){let s=e.trim().split(/\s+/);return s.slice(0,t).join(" ")+(s.length>t?"\u2026":"")}function ke(e,t){let s=e.resolve(t),n=s?e.getNode(e.tipOf(s.cid))?.content:null;return String(n?.title??n?.text??"")}function ue(e,t){let s=e.resolve(t);return{id:s?e.displayNameOf(e.tipOf(s.cid))??e.displayNameOf(s.cid):null,title:fe(ke(e,t),8)}}function $e(e,t){let s=e.resolve(t);if(!s)return null;let n=e.tipOf(s.cid);if(!C(e,n))return null;let r=e.nodeLabel.get(n);if(r===G.USECASE)return n;if(r===G.AC)return F(e,n);if(r===G.TEST){let c=e.edgesFrom(n).find(d=>d.type===M.VERIFIES&&C(e,d.dst));if(c)return F(e,c.dst);let i=e.edgesFrom(n).find(d=>d.type===M.AUTOMATES&&C(e,d.dst));if(i){let d=e.edgesFrom(i.dst).find(l=>l.type===M.BELONGS_TO&&C(e,l.dst));return d?d.dst:null}}return null}function j(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 xe(e,t){let s=e.resolve(t),n=s?e.getNode(e.tipOf(s.cid))?.content.risk:null;return n==="high"||n==="med"||n==="low"?n:"med"}function ge(e,t,s,n,r){let c=r.servePaths??new Map,i=e.byLabel(G.USECASE).filter(({cid:o})=>C(e,o)),d=new Map(i.map(o=>[o.cid,o])),l=new Map(i.map(({cid:o})=>[o,[]])),g=[];for(let o of t){if(o.stage!=="design")continue;let m={...o,...ue(e,o.ref)},p=$e(e,o.ref),v=p?l.get(p):void 0;v&&j(o)!=="other"?v.push(m):g.push(m)}let a=new Map(i.map(({cid:o})=>[o,{total:0,designed:0}]));for(let{cid:o}of e.byLabel(G.AC)){if(!C(e,o))continue;let m=F(e,o),p=m?a.get(m):void 0;if(!p)continue;p.total++;let v=Z(e,o);if(v&&p.designed++,!n)continue;let b=e.nameOf.get(o)??o,u=n.perAc[b];if(!u)continue;let{id:_,title:S}=ue(e,b),k={ref:e.displayNameOf(o)??o,id:_,title:S,risk:xe(e,b),stage:"cover"},w=l.get(m);u.state==="failing"?w.push({...k,kind:"execution-failed",tag:"evolve",why:"covering test failed against this AC",ready_command:u.executionId&&c.has(u.executionId)?`kane-cli evidence serve ${c.get(u.executionId)}`:"kane-cli testrun run",via_tests:u.viaTests,...u.executionId?{execution_id:u.executionId}:{},...u.executionId&&c.has(u.executionId)?{servePath:c.get(u.executionId)}:{},...r.testFiles?{viaFiles:u.viaTests.map(O=>r.testFiles.get(O)??null)}:{}}):u.state==="blocked"?w.push({...k,kind:"execution-blocked",tag:"reuse-candidate",why:"the formula could count no run \u2014 broken/skipped or an unaccepted oracle",ready_command:u.executionId&&c.has(u.executionId)?`kane-cli evidence serve ${c.get(u.executionId)}`:"kane-cli testrun run",...u.executionId?{execution_id:u.executionId}:{},...u.executionId&&c.has(u.executionId)?{servePath:c.get(u.executionId)}:{}}):u.state==="not_run"&&v&&w.push({...k,kind:"covered-not-run",tag:"reuse-candidate",why:"a covering test exists but has not run yet",ready_command:"kane-cli testrun run"})}let f=[];for(let{cid:o,content:m}of i){let p=e.displayNameOf(o)??o,v=e.nameOf.get(o)??o,b=s.perUc[p]??{pct:0,status:"undesigned",staleAcs:0},u=n?n.perUc[v]??{pct:0,status:"not_run"}:null,_=n!==null&&(u===null||u.status==="not_run"),S=a.get(o),k=l.get(o)??[],w=new Set(k.filter(h=>j(h)==="needs-refresh").map(h=>h.ref)),O=k.some(h=>j(h)==="needs-tests"&&w.has(h.ref)),T=[];for(let h of be){let A=k.filter(P=>j(P)===h);if(h==="needs-tests"&&(A=A.filter(P=>!w.has(P.ref))),A.length===0)continue;A.sort((P,V)=>(E[P.risk]??3)-(E[V.risk]??3)||Y(P.ref,V.ref));let ve=h==="failing"||h==="blocked"||A.length<=2||new Set(A.map(P=>P.ready_command)).size>1;T.push({key:h,label:_e[h],...h==="needs-refresh"?{suffix:"source moved since these were designed"}:{},alsoNeedsTests:h==="needs-refresh"&&O,rows:A,...ve?{}:{rosterCommand:A[0].ready_command}})}let I=T.some(h=>h.key==="failing"),$=T.some(h=>h.key==="blocked"),y=b.pct===100&&(n===null||u?.pct===100)&&T.length===0,U=u!==null&&u.pct>0,x=I?"\u2717":$?"\u23F8":y?"\u2714":b.pct===0&&!U?"\u2716":"\u25D0";f.push({slug:p,title:String(m.title??""),risk:String(m.risk??""),des:b,prov:u,provAbsent:_,acTotal:S.total,acDesigned:S.designed,mark:x,collapse:y,groups:T})}return f.sort((o,m)=>(E[o.risk]??3)-(E[m.risk]??3)||Y(o.slug,m.slug)),g.sort((o,m)=>(E[o.risk]??3)-(E[m.risk]??3)||Y(o.ref,m.ref)),{stage:r.stage,aspect:r.aspect,top:r.top,dc:s,pa:n,ucs:f,other:g}}function N(e,t){let s=Math.round(e/100*t);return"\u2588".repeat(s)+"\u2591".repeat(t-s)}function z(e){return e===100?"\u2714":e>0?"\u25D0":"\u2716"}function L(e,t){return e==="all"||t.stage===e}function me(e,t){let{dc:s,pa:n}=e,r=Math.max(80,Math.min(t.width,120)),c=l=>t.color?`\x1B[2m${l}\x1B[22m`:l,i=[];if(n){i.push(`coverage \u2014 designed \xD7 proven \xB7 live graph \xB7 aspect ${n.aspect}`),i.push("");let l=s.ucs_needing_scenarios;i.push(` designed ${z(s.pct)} ${N(s.pct,10)} ${String(s.pct).padStart(3)}% \u2014 ${s.acs_designed} ACs have verifying tests`+(l>0?` \xB7 scenario debt: ${l} UC${l>1?"s":""}`:""));let g=[n.failing>0?`${n.failing} failing`:null,n.blocked>0?`${n.blocked} blocked`:null,n.not_run>0?`${n.not_run} not yet run`:null].filter(Boolean);i.push(` proven ${z(n.pct)} ${N(n.pct,10)} ${String(n.pct).padStart(3)}% \u2014 ${n.acs_proven} proven by execution`+(g.length?` \xB7 ${g.join(" \xB7 ")}`:""))}else i.push("AC design completeness \u2014 live graph (what design owes; execution proof not shown)"),i.push(""),i.push(` designed ${z(s.pct)} ${N(s.pct,10)} ${String(s.pct).padStart(3)}% \u2014 ${s.acs_designed} ACs have verifying tests \xB7 ${s.usecases_complete} UCs complete`),s.ucs_needing_scenarios>0&&i.push(` scenario debt: ${s.ucs_needing_scenarios} use-case${s.ucs_needing_scenarios>1?"s":""} need scenarios`),i.push(" proven \u2014 no runs recorded yet \xB7 run tests, then re-run");i.push("");let d=!1;for(let l of e.ucs){if(i.push(we(l,n!==null,r)),l.collapse)continue;let g=e.top??1/0;for(let a of l.groups){let f=a.rows.filter(v=>L(e.stage,v));if(f.length===0)continue;if(d=!0,g<=0){i.push(c(` \u2026 +${f.length} more ${a.label}`));continue}let o=f.slice(0,g),m=f.length-o.length;if(g-=o.length,(a.key==="needs-scenarios"||a.key==="happy-only")&&o.length===1&&o[0].ref===l.slug){i.push(` ${a.label}${a.key==="needs-scenarios"?" \u2014 design from scratch":""}`),i.push(c(` \u2192 ${o[0].ready_command}`));continue}let p=(a.suffix?` \u2014 ${a.suffix}`:"")+(a.alsoNeedsTests?" \u2014 also needs tests":"");if(i.push(` ${a.label} (${f.length})${p}`),a.rosterCommand&&a.key!=="failing"&&a.key!=="blocked")Re(i,o,r),i.push(c(` \u2192 ${a.rosterCommand}`));else for(let v of o)Te(i,v,a.key,c);m>0&&i.push(c(` \u2026 +${m} more ${a.label}`))}}return!d&&e.ucs.every(l=>l.groups.every(g=>g.rows.filter(a=>L(e.stage,a)).length===0))&&i.push(" nothing owed \u2014 design and execution are square"),i.push(""),i.push(c(" metric: live verifies edges \xB7 high \xD73 \xB7 staleness shown, not discounted")),n?i.push(c(` proven: graph execution facts \xB7 latest run ${n.latest_run?.started_at??"\u2014"} \xB7 ${n.aspect} formula verbatim`)):i.push(c(" proof: no runs recorded yet \u2014 run tests, then re-run")),i}function we(e,t,s){let n=D(e.slug);if(!t){let l=e.acTotal===0?"no scenarios yet":e.collapse||e.des.status==="complete"?`${e.acTotal} ACs \xB7 complete`:e.des.staleAcs>0?`${e.acTotal} ACs \xB7 ${e.des.staleAcs} stale`:`${e.acTotal} ACs \xB7 ${e.acTotal-e.acDesigned} unverified`,g=` ${e.mark} ${N(e.des.pct,10)} ${String(e.des.pct).padStart(3)}% ${n} `,a=Math.max(0,s-g.length-l.length-2);return`${g}${de(e.title,a).padEnd(a)} ${l}`}let r=e.provAbsent?"prov \xB7 not run":`prov ${N(e.prov?.pct??0,8)} ${String(e.prov?.pct??0).padStart(3)}%`,c=`des ${N(e.des.pct,8)} ${String(e.des.pct).padStart(3)}% \xB7 ${r}`,i=` ${e.mark} ${n} `,d=Math.max(0,s-i.length-c.length-2);return`${i}${de(e.title,d).padEnd(d)} ${c}`}function de(e,t){return e.length<=t?e:t<=1?e.slice(0,t):e.slice(0,t-1)+"\u2026"}function Te(e,t,s,n){let r=D(t.id??t.ref);if(s==="failing"){let c=(t.via_tests??[]).map((d,l)=>`${D(d)}${t.viaFiles?.[l]?` ${t.viaFiles[l]}`:""}`).join(", ");e.push(` \u2717 ${r} ${t.title} \u2014 failed${c?` \xB7 via ${c}`:""}`),t.servePath&&e.push(n(` \u2192 kane-cli evidence serve ${t.servePath} (see why it failed)`));let i=(t.viaFiles??[]).filter(d=>d!==null);i.length===1?e.push(n(` re-run after fixing: kane-cli testmd run ${i[0]} (heals on failure \u2014 fix the app first, or the test may re-author)`)):i.length>1&&e.push(n(" re-run after fixing: kane-cli testrun run (heals on failure \u2014 fix the app first, or the tests may re-author)"));return}if(s==="blocked"){e.push(` \u23F8 ${r} ${t.title} \u2014 (blocked \u2014 see why)`),t.servePath&&e.push(n(` \u2192 kane-cli evidence serve ${t.servePath} (see why)`));return}e.push(` ${r} ${t.title} \u2014 ${t.why}`),e.push(n(` \u2192 ${t.ready_command}`))}function Re(e,t,s){let n=t.map(c=>`${D(c.id??c.ref)} ${fe(c.title,4)}`),r=" ";for(let c of n){let i=r.trim().length?" \xB7 ":"";r.length+i.length+c.length>s&&r.trim().length?(e.push(r),r=" "+c):r+=i+c}r.trim().length&&e.push(r)}function he(e){let{dc:t,pa:s}=e,n=r=>e.top!==void 0?r.slice(0,e.top):r;return{stage:e.stage,rollup_version:1,design_completeness:{pct:t.pct,acs_designed:t.acs_designed,usecases_complete:t.usecases_complete,ucs_needing_scenarios:t.ucs_needing_scenarios,config:t.config},...s?{proven:{aspect:s.aspect,pct:s.pct,acs_proven:s.acs_proven,failing:s.failing,blocked:s.blocked,not_run:s.not_run,latest_run:s.latest_run,config:s.config}}:{},usecases:e.ucs.map(r=>({id:/^sha256:/.test(r.slug)?null:r.slug,title:r.title,risk:r.risk,design_completeness:{pct:r.des.pct,status:r.des.status},stale_acs:r.des.staleAcs,...s?{proven:r.prov??{pct:0,status:"not_run"}}:{},pending:n(r.groups.flatMap(c=>c.rows).filter(c=>L(e.stage,c))).map(pe)})),other:e.other.filter(r=>L(e.stage,r)).map(pe)}}function pe(e){let{servePath:t,viaFiles:s,meta:n,...r}=e;return{...r}}async function Ae(e){let t=await X(e);return t.length===0?null:t.map(s=>({p:s,m:Se(s).mtimeMs})).sort((s,n)=>n.m-s.m)[0].p}async function Oe(e,t=ae(),s=process.cwd()){if(e.mode!==void 0&&e.mode!=="agent"&&e.mode!=="ci"&&e.mode!=="interactive")return R(t,`--mode must be interactive | agent | ci, got '${e.mode}'`),2;if(e.mode==="agent"||e.mode==="ci"){let{makeHeadlessIO:p,agentRefusal:v}=await import("./headless-io-66RG5NN5.js"),{parsesAgainstGrammar:b}=await import("./next-TRSKMBO5.js"),u=p("ndjson","gaps",{stdout:y=>t.out(y.replace(/\n$/,"")),stderr:y=>(t.err??t.out)(y.replace(/\n$/,""))}),_=[],S=[],k={out:y=>_.push(y),err:y=>S.push(y),confirm:async()=>!1,isTTY:!1};if(await Oe({...e,json:!0,mode:void 0},k,s)!==0)return v(u,S.join("; ")||"cover gaps refused");let O=JSON.parse(_.join(`
|
|
3
3
|
`));u.event({type:"gaps",...O});let T=[],I=new Set,$=(y,U)=>{if(Array.isArray(y)){for(let x of y)$(x,U);return}if(y&&typeof y=="object"){let x=y,h=typeof x.why=="string"?x.why:U;typeof x.ready_command=="string"&&x.ready_command.startsWith("kane-cli ")&&b(x.ready_command)&&!I.has(x.ready_command)&&(I.add(x.ready_command),T.push({cmd:x.ready_command,why:h||"close the gap"}));for(let A of Object.values(x))$(A,h)}};return $(O,"close the gap"),u.done(0,void 0,T.slice(0,4))}if(e.flat)return Ie(e,t,s);let n=e.stage??"all";if(n!=="design"&&n!=="cover"&&n!=="all")return R(t,`--stage must be design | cover | all, got '${n}'`),2;if(e.top!==void 0&&(!Number.isInteger(e.top)||e.top<1))return R(t,"--top must be a positive integer"),2;let r=e.aspect??"lenient";if(r!=="lenient"&&r!=="strict")return R(t,`--aspect must be lenient | strict, got '${r}'`),2;if(e.from)return R(t,"the tree reads the live graph \u2014 for a specific run's view use: kane-cli cover --from <pack> (legacy worklist: add --flat)"),2;let c=H(s,t);if(!c)return 2;let i=K(c),d=re(i),l=le(i,r),g=await q(i,"design"),a=new Map;if(l)for(let p of Object.values(l.perAc)){if(!p.executionId||a.has(p.executionId))continue;let v=await J(p.executionId,s);v&&a.set(p.executionId,v)}let f=new Map;for(let[p,v]of ce(ie(s)))v.length===1&&f.set(p,B(v[0]));let o=ge(i,g,d,l,{stage:n,top:e.top,aspect:r,servePaths:a,testFiles:f});if(e.json)return t.out(JSON.stringify(he(o),null,2)),0;if(d.usecases_complete==="0/0")return t.out("nothing to measure yet \u2014 no live use-cases in the graph"),0;let m=t.isTTY&&process.stdout.columns?process.stdout.columns:100;for(let p of me(o,{width:m,color:t.isTTY}))t.out(p);return 0}async function Ie(e,t,s){let n=e.stage??"design";if(n!=="design"&&n!=="cover"&&n!=="all")return R(t,`--stage must be design | cover | all, got '${n}'`),2;if(e.top!==void 0&&(!Number.isInteger(e.top)||e.top<1))return R(t,"--top must be a positive integer"),2;let r=H(s,t);if(!r)return 2;let c,i;if(n!=="design"){let a=e.from?await J(e.from,s):await Ae(s);if(!a)return R(t,e.from?`no evidence pack at '${e.from}'`:`--stage ${n} needs an evidence pack \u2014 run a test first, or pass --from <pack> (live view: drop --flat)`),2;let f=await Q(a,"coverage/usecases.yaml");if(f==null)return R(t,`${B(a)} carries no coverage/usecases.yaml \u2014 re-run the tests to produce a coverage-bearing pack`),2;let o=W(f);if(!o||!Array.isArray(o.usecases))return R(t,`${B(a)}: coverage/usecases.yaml is not a usecases document`),2;c=o,i=B(a)}let d=K(r),l=await q(d,n,void 0,c),g=l.length;if(e.top!==void 0&&(l=l.slice(0,e.top)),e.json){let a=l.map(f=>Pe(d,f));return t.out(JSON.stringify({stage:n,...i?{pack:i}:{},total:g,rows:a},null,2)),0}return t.out(`gaps \u2014 stage ${n}${i?` \xB7 pack ${i}`:""} (${l.length}${l.length<g?` of ${g}`:""})`),l.length===0&&t.out(" nothing owed \u2014 design and execution are square"),l.forEach((a,f)=>{t.out(` ${String(f+1).padStart(2)}. [${a.risk}] ${a.tag} ${a.ref} \u2014 ${a.why}`),t.out(` \u2192 ${a.ready_command}`)}),0}function Pe(e,t){let s=e.resolve(t.ref),n=s?e.tipOf(s.cid):null,r=n?e.getNode(n)?.content:null;return{...t,id:n?e.displayNameOf(n)??e.displayNameOf(s.cid):null,title:String(r?.title??r?.text??"")}}export{Oe as gapsCommand};
|
|
@@ -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-JZ26R6UL.js";import"./chunk-WXHQYYD5.js";import"./chunk-UR6MHSHU.js";export{a as designFactFor,b as designGate};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as T,f as P,g as $,h as G,j as N,k as M,l as B,m as I,n as L,o as U,p as F,r as z,s as C,t as _,u as O,v as K}from"./chunk-
|
|
2
|
+
import{a as T,f as P,g as $,h as G,j as N,k as M,l as B,m as I,n as L,o as U,p as F,r as z,s as C,t as _,u as O,v as K}from"./chunk-PLOWZLG5.js";import{b as k}from"./chunk-JPWLGHPM.js";import{d as J}from"./chunk-VOOPWFHW.js";import{c as E}from"./chunk-SL6PCVM2.js";import"./chunk-OUJQVBUT.js";import"./chunk-TDPWFYTJ.js";import{a as q}from"./chunk-AECMF3T2.js";import"./chunk-OR6MCL6Z.js";import"./chunk-L5LI2JF4.js";import"./chunk-4LTXE3IX.js";import"./chunk-4NFCAGRK.js";import"./chunk-WAOCHXJ5.js";import{m as x,n as A}from"./chunk-QIGPXYMF.js";import"./chunk-5EOX4MEY.js";import{h as H}from"./chunk-B5RS2XZU.js";import"./chunk-2WVKOZ6W.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import{a as R}from"./chunk-O75ZHGJG.js";import"./chunk-VE3SUJMA.js";import{a as j}from"./chunk-VT54ARGE.js";import"./chunk-ZUGCHQFC.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 $("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 T,f as P,g as $,h as G,j as N,k as M,l as B,m as I,n as L,o as U,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=U({objective:c,model:n.model,sessionId:n.sessionId,auth:m});return F(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(L(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?N(s,c):M(c)};return{...await B(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=U({objective:c,model:n.model,sessionId:n.sessionId,auth:m});return F(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(L(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?N(s,c):M(c)};return{...await B(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-ACRDP5ZB.js");n(i(d))}try{let i=await(e.checkUpdate??J)();i&&r.onUpdateAvailable(i)}catch{}let g=t.reqId??null;x(X,()=>{g&&l.cancel(g).catch(()=>{})});let p=process.cwd(),v={validate:e.validate??z,upload:e.upload??O,buildMappings:K,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=P(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&&T(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{A(X)}}var ae=()=>{};async function Me(t){let e=new j,n=new q,r=e.getActiveProfile()??"default",l=t.env??e.getDefaultEnv()??"prod",u=R(l),d=new E;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:G(f),conn:f,autoDefaulted:f.autoDefaulted??null}},v=async()=>{let i=await k({creds:e,env:l,usernameFlag:t.username,accessKeyFlag:t.accessKey,log:()=>{}});return i.basicAuth?{username:i.basicAuth.username,access_key:i.basicAuth.access_key}:i.token?{auth:{type:"bearer",token:i.token}}:{}};return{mode:t.mode,makeClient:p,materialize:(i,f,a)=>Y(i,f,{model:g,sessionId:d.sessionId,resolveAuth:v,spawnOpts:{environment:l},suiteName:a})}}export{Me as buildHeadlessDeps,Pe as decideGenerateMode,ie as defaultOutDir,Ge as parseFilesFlag,$e as resolveGenerateOp,Ne as runGenerateHeadless};
|
|
@@ -1,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}from"./chunk-
|
|
2
|
+
import{a,b,c,d,e,f,g,h}from"./chunk-5DT7PIGB.js";import"./chunk-UR6MHSHU.js";export{a as EVENT_SCHEMA_VERSION,e as MAX_MESSAGE_BYTES,g as agentRefusal,c as bothTTY,h as guardedChannels,d as makeHeadlessIO,b as resolveEncoding,f as validateResumeMessage};
|