@testmuai/kane-cli 0.6.11 → 0.7.1
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-D66CACLX.js +8 -0
- package/dist/{ChromeProfilePicker-54CAJDUF.js → ChromeProfilePicker-4CDSPBWL.js} +1 -1
- package/dist/{CliFeedbackPrompt-TCAH4AHL.js → CliFeedbackPrompt-TLRVBA4E.js} +1 -1
- package/dist/{CliUploadProgress-UURZ63VQ.js → CliUploadProgress-WGGFLUSF.js} +1 -1
- package/dist/{ConfigView-5QGB7MUS.js → ConfigView-DBANTBXC.js} +1 -1
- package/dist/EvidenceViewOffer-DNCQ3A6R.js +2 -0
- package/dist/{FolderPicker-Y5MAYFIJ.js → FolderPicker-W7RCIFEL.js} +1 -1
- package/dist/{HelpView-S3GJGSCE.js → HelpView-FBCX32U7.js} +1 -1
- package/dist/{InfoBox-LYTNNMVJ.js → InfoBox-KK2ICVS4.js} +1 -1
- package/dist/{LinksBox-5MSEKNSV.js → LinksBox-KKRANMR3.js} +1 -1
- package/dist/{ProfilesView-LTHE5UIO.js → ProfilesView-DGPXSAQN.js} +1 -1
- package/dist/{ProjectPicker-XMXIGHSE.js → ProjectPicker-ESQSL4TT.js} +1 -1
- package/dist/{SaveSessionPrompt-VQDEA4WA.js → SaveSessionPrompt-AQGP5W6E.js} +1 -1
- package/dist/SingleShotApp-SMCAIKCE.js +2 -0
- package/dist/{SummaryBox-WWF3G263.js → SummaryBox-BFZJW2KK.js} +1 -1
- package/dist/TestMdRunView-FMKZJ3A3.js +2 -0
- package/dist/{WhoamiView-PDURYP7E.js → WhoamiView-JABY3I5Q.js} +1 -1
- package/dist/{auth-I4RB4KO3.js → auth-76LVI6B5.js} +1 -1
- package/dist/bind-AACBTSAA.js +12 -0
- package/dist/bootstrap-CNOZ5VRB.js +2 -0
- package/dist/bridge-T4HL4TG7.js +2 -0
- package/dist/{changelog-OKYH4F7I.js → changelog-PSWPPOAF.js} +1 -1
- package/dist/chat-committer-4BQBOKI4.js +2 -0
- package/dist/chat-controller-NNTMKEPG.js +2 -0
- package/dist/{chunk-NUQ423YE.js → chunk-2KBD6JZX.js} +1 -1
- package/dist/chunk-2SREGETM.js +4 -0
- package/dist/chunk-2XGDWUJ5.js +2 -0
- package/dist/{chunk-MJBCBQC2.js → chunk-322JEJEH.js} +1 -1
- package/dist/{chunk-SURF5Z7Y.js → chunk-323MLBYA.js} +1 -1
- package/dist/{chunk-HOQEMPMQ.js → chunk-33QXD75Y.js} +2 -2
- package/dist/{chunk-K7USHLVZ.js → chunk-36OC3TFE.js} +1 -1
- package/dist/{chunk-ZNHXIRCM.js → chunk-3FN5VJMV.js} +2 -2
- package/dist/chunk-3LWTUMDG.js +2 -0
- package/dist/chunk-3STZLM5J.js +4 -0
- package/dist/{chunk-KXUSG5ZI.js → chunk-4OPQJ7PE.js} +1 -1
- package/dist/chunk-5JTUL6XL.js +2 -0
- package/dist/{chunk-FMR2KPSK.js → chunk-5KFS3GAZ.js} +1 -1
- package/dist/{chunk-XZRIQ3GF.js → chunk-6HEGD6H2.js} +1 -1
- package/dist/{chunk-XWSAKVEY.js → chunk-6UJDOAYR.js} +2 -2
- package/dist/{chunk-QJIJC3KC.js → chunk-73C4PRYU.js} +1 -1
- package/dist/chunk-AAONIIQV.js +6 -0
- package/dist/chunk-AH7ZZIZY.js +2 -0
- package/dist/chunk-AM5S4KG4.js +6 -0
- package/dist/{chunk-7MRBMDZ5.js → chunk-APAIWBIH.js} +1 -1
- package/dist/{chunk-HMM5FJJO.js → chunk-BAL64WSI.js} +1 -1
- package/dist/chunk-BB2W35TW.js +2 -0
- package/dist/chunk-BQHKBOSF.js +11 -0
- package/dist/chunk-C4G7RVJ6.js +2 -0
- package/dist/{chunk-NTGYFYBP.js → chunk-CDQX6HGJ.js} +1 -1
- package/dist/{chunk-KSZ72BSC.js → chunk-CSQ46PJ7.js} +1 -1
- package/dist/chunk-DQ54MH7F.js +13 -0
- package/dist/{chunk-3AZTXJY4.js → chunk-DXV6MBTD.js} +1 -1
- package/dist/chunk-DYW5C6II.js +2 -0
- package/dist/{chunk-LHDNJJGE.js → chunk-F6ZOJXYU.js} +1 -1
- package/dist/chunk-GVIPTX6T.js +6 -0
- package/dist/chunk-GW5DWAXY.js +2 -0
- package/dist/chunk-HJERKSBK.js +349 -0
- package/dist/{chunk-POYZ6SAI.js → chunk-HPMS5KO6.js} +2 -2
- package/dist/{chunk-3RZ63RBO.js → chunk-IBNC444G.js} +1 -1
- package/dist/{chunk-73OQDAXF.js → chunk-IQDWBTRJ.js} +1 -1
- package/dist/chunk-IXVOXJP6.js +6 -0
- package/dist/{chunk-IQODWB32.js → chunk-JEUA4UWK.js} +1 -1
- package/dist/{chunk-GLA6QL3T.js → chunk-JKTFTF24.js} +1 -1
- package/dist/{chunk-KHJXOFDM.js → chunk-JRMDGLLT.js} +1 -1
- package/dist/{chunk-GIMTSDNC.js → chunk-KNDSQ4PS.js} +1 -1
- package/dist/chunk-KRXSXQBU.js +12 -0
- package/dist/{chunk-4CJ55EUY.js → chunk-KT6G7AF2.js} +1 -1
- package/dist/chunk-KVQOBPAZ.js +2 -0
- package/dist/chunk-L2TV4G56.js +4 -0
- package/dist/{chunk-6HYW5RFX.js → chunk-L4JIMNKW.js} +1 -1
- package/dist/{chunk-FSB3FTIQ.js → chunk-L7VREJTG.js} +1 -1
- package/dist/{chunk-MRP54NCJ.js → chunk-LQZ2BU7Q.js} +1 -1
- package/dist/{chunk-EAUUULJQ.js → chunk-LR5XO2KD.js} +1 -1
- package/dist/chunk-M7WQM4UA.js +4 -0
- package/dist/{chunk-KHQHVSZ6.js → chunk-NAC7SFBE.js} +1 -1
- package/dist/{chunk-DSOA6L73.js → chunk-NAE7MBR2.js} +3 -3
- package/dist/{chunk-NTNAHN25.js → chunk-NBKQT7LJ.js} +1 -1
- package/dist/{chunk-7NLQ3QQD.js → chunk-NJPTOKW5.js} +1 -1
- package/dist/{chunk-RFJAYURU.js → chunk-NOCIMJSN.js} +1 -1
- package/dist/chunk-NRC2G4Y5.js +5 -0
- package/dist/{chunk-H2W2UNTN.js → chunk-NRTHYROA.js} +1 -1
- package/dist/chunk-O56PUUNL.js +9 -0
- package/dist/chunk-OHRS3H7Z.js +5 -0
- package/dist/{chunk-FCHTL74E.js → chunk-PMHJRT3A.js} +1 -1
- package/dist/{chunk-GRB66C5S.js → chunk-QROUKGKU.js} +1 -1
- package/dist/{chunk-XXMNUJX4.js → chunk-R2RGSO4B.js} +1 -1
- package/dist/{chunk-MFOH7EYR.js → chunk-RNSSM2BK.js} +1 -1
- package/dist/chunk-SE6WNCYU.js +4 -0
- package/dist/{chunk-ICGHBZFZ.js → chunk-SRDHPKJT.js} +1 -1
- package/dist/chunk-SWESH2J7.js +10 -0
- package/dist/chunk-SY3HLQMV.js +4 -0
- package/dist/chunk-T63R6QT4.js +4 -0
- package/dist/{chunk-ZP4S5WGW.js → chunk-UBFKZEX3.js} +2 -2
- package/dist/chunk-UI7KULSI.js +7 -0
- package/dist/chunk-UPPEOQJQ.js +3 -0
- package/dist/chunk-URQUQWGW.js +62 -0
- package/dist/chunk-UX2B7L6K.js +2 -0
- package/dist/{chunk-XSKLH2MC.js → chunk-V36ATG7A.js} +2 -2
- package/dist/chunk-VGFTNLQQ.js +2 -0
- package/dist/{chunk-RGJIRS3B.js → chunk-W5DOU2DV.js} +1 -1
- package/dist/chunk-W6VD2XFO.js +19 -0
- package/dist/chunk-WJ5HDEVH.js +6 -0
- package/dist/chunk-WWNSD6FA.js +6 -0
- package/dist/{chunk-ZPCU6546.js → chunk-X3ICV5M5.js} +1 -1
- package/dist/chunk-XDHZMCTA.js +4 -0
- package/dist/{chunk-2WKX3RMA.js → chunk-XVDJ423L.js} +1 -1
- package/dist/chunk-ZLCZDAEX.js +6 -0
- package/dist/{chunk-NJAHRITS.js → chunk-ZM5PVRJK.js} +1 -1
- package/dist/committer-2EJPVVCQ.js +2 -0
- package/dist/{config-QISRENF5.js → config-R3GF2FZA.js} +1 -1
- package/dist/cover-cmd-TXICWHUU.js +3 -0
- package/dist/{credentials-OGLK7MPV.js → credentials-XN4ROCQ3.js} +1 -1
- package/dist/design-committer-BQUWD6AC.js +2 -0
- package/dist/docx-convert-ZBVQO2LG.js +1 -1
- package/dist/dossier-QZV74XOS.js +3 -0
- package/dist/evidence-V23FPVXQ.js +2 -0
- package/dist/evolve-cmd-PZCPXDMR.js +2 -0
- package/dist/{exit-manager-MXUD7GQ7.js → exit-manager-HNFATGSM.js} +1 -1
- package/dist/explain-UE4IACQH.js +2 -0
- package/dist/{explain-cmd-NWIYH5MI.js → explain-cmd-RZW6QJYM.js} +1 -1
- package/dist/{explain-cmd-DBUTPZHA.js → explain-cmd-X7JZLSZZ.js} +1 -1
- package/dist/extract-bind-BFY7IRL4.js +10 -0
- package/dist/extract-cmd-U3MGK2LP.js +6 -0
- package/dist/feeder-XGTFV7TZ.js +2 -0
- package/dist/gaps-cmd-BWCRLLBK.js +3 -0
- package/dist/{gate-B6C6KLFA.js → gate-YHBPWEM5.js} +1 -1
- package/dist/{generate-headless-TUA3HGRX.js → generate-headless-BSTDLZZY.js} +2 -2
- package/dist/{headless-io-PWW6YKH2.js → headless-io-BL3TEAX5.js} +1 -1
- package/dist/index.js +67 -68
- package/dist/ingest-AL6CABJT.js +2 -0
- package/dist/ingest-cmd-O6OWWZT4.js +2 -0
- package/dist/interactive-bind-43HGDF5K.js +24 -0
- package/dist/lifecycle-cmd-D6TVTYRK.js +2 -0
- package/dist/list-cmd-XCAV2FKA.js +3 -0
- package/dist/{list-commands-F53ZNYOZ.js → list-commands-747UTUSS.js} +1 -1
- package/dist/locks-cmd-QAULI5LV.js +2 -0
- package/dist/logical-ids-4G4FAHNJ.js +2 -0
- package/dist/login-flow-CV76ENHV.js +2 -0
- package/dist/maintenance-cmd-ZRB4NTGG.js +2 -0
- package/dist/next-TRSKMBO5.js +2 -0
- package/dist/paths-JCYX6UWL.js +2 -0
- package/dist/{persist-recorded-session-5ZFS5SMZ.js → persist-recorded-session-MDPWWUA7.js} +1 -1
- package/dist/phase-seed-52LRE3LH.js +2 -0
- package/dist/pipeline-LM5JAK7F.js +2 -0
- package/dist/readmodel-X7L7W2BA.js +2 -0
- package/dist/reconcile-cmd-DGCSDML6.js +2 -0
- package/dist/{recording-banner-ZZUF2MGT.js → recording-banner-TALO7PUR.js} +1 -1
- package/dist/records-5SVUXJBW.js +2 -0
- package/dist/{require-project-folder-NQBZFUPF.js → require-project-folder-R347LFDQ.js} +1 -1
- package/dist/revert-DXXYXJGN.js +2 -0
- package/dist/review-cmd-2QF5HTI7.js +4 -0
- package/dist/run-52UIBPXD.js +2 -0
- package/dist/run-VRVH4VO3.js +2 -0
- package/dist/{run-test-md-XOSCYVSS.js → run-test-md-DFNIGYB7.js} +2 -2
- package/dist/sessions-BLXZVK5U.js +2 -0
- package/dist/sessions-cmd-AQWLL5ZN.js +25 -0
- package/dist/{skill-installer-VYIIWAK7.js → skill-installer-ANXTCXQV.js} +1 -1
- package/dist/spawner-AH5FTUYU.js +2 -0
- package/dist/structured-answers-QHFGZPSS.js +5 -0
- package/dist/tcg-generate-WKCBBKI5.js +2 -0
- package/dist/testmd-actions-RPYG6TJG.js +2 -0
- package/dist/token-refresh-NIDUOTRM.js +2 -0
- package/dist/trust-gate-EX7R2P4Y.js +2 -0
- package/dist/{validate-basic-LP3S5PK7.js → validate-basic-O2DP2XJL.js} +1 -1
- package/dist/verdicts-TJH3O5UW.js +2 -0
- package/dist/{version-check-XP62HWLJ.js → version-check-RNR3JCQ5.js} +1 -1
- package/dist/{view-cmd-GQBFCPDL.js → view-cmd-YSEGA5PI.js} +1 -1
- package/dist/walk-session-HXW4OSA2.js +2 -0
- package/dist/with-telemetry-PNP6CAVM.js +2 -0
- package/package.json +6 -6
- package/dist/ChatSurface-TZ554O4U.js +0 -8
- package/dist/EvidenceViewOffer-SSAM4RRP.js +0 -2
- package/dist/SingleShotApp-A6PCNPLM.js +0 -2
- package/dist/TestMdRunView-MQ7ZPFN2.js +0 -2
- package/dist/bind-QJT726NE.js +0 -6
- package/dist/bootstrap-566PPFCC.js +0 -2
- package/dist/bridge-QCMEOQDD.js +0 -2
- package/dist/chat-committer-OS7ULZMH.js +0 -2
- package/dist/chat-controller-QLORQWJZ.js +0 -2
- package/dist/chunk-3C5GMAM4.js +0 -2
- package/dist/chunk-54IB6CXK.js +0 -5
- package/dist/chunk-54VQ46U2.js +0 -14
- package/dist/chunk-55Y65VPA.js +0 -347
- package/dist/chunk-6W6AIDLJ.js +0 -4
- package/dist/chunk-7E24OCGX.js +0 -2
- package/dist/chunk-7YPK6EDR.js +0 -4
- package/dist/chunk-FHKDTM5L.js +0 -6
- package/dist/chunk-FRBYGSGJ.js +0 -4
- package/dist/chunk-GG43HSU2.js +0 -3
- package/dist/chunk-HLRLP6TQ.js +0 -2
- package/dist/chunk-J2KSZUOO.js +0 -4
- package/dist/chunk-J44RN3FB.js +0 -2
- package/dist/chunk-JXKRO2ZJ.js +0 -13
- package/dist/chunk-M5PJQ5Y3.js +0 -6
- package/dist/chunk-MMPFU2YC.js +0 -2
- package/dist/chunk-MR7CX5VT.js +0 -9
- package/dist/chunk-MTNUZEO7.js +0 -12
- package/dist/chunk-OGWC3J3C.js +0 -4
- package/dist/chunk-RN4OSVTG.js +0 -6
- package/dist/chunk-RZJVQUBA.js +0 -61
- package/dist/chunk-V3UE6RJP.js +0 -2
- package/dist/chunk-Y5RNCJAN.js +0 -19
- package/dist/chunk-YSSTGJ7O.js +0 -7
- package/dist/chunk-Z2JSEL3I.js +0 -4
- package/dist/cover-cmd-SV3I23UM.js +0 -2
- package/dist/dossier-KJSJPWOW.js +0 -3
- package/dist/evidence-HDD7T7DX.js +0 -2
- package/dist/evolve-cmd-UE2BIMXK.js +0 -2
- package/dist/explain-EBVIUS2X.js +0 -2
- package/dist/extract-bind-6MQYKN3G.js +0 -8
- package/dist/extract-cmd-2RUIWFZG.js +0 -6
- package/dist/gaps-cmd-CKCHH3HQ.js +0 -2
- package/dist/ingest-FIIO67ZN.js +0 -2
- package/dist/ingest-cmd-CRMY46YC.js +0 -7
- package/dist/interactive-bind-53FCRK34.js +0 -10
- package/dist/lifecycle-cmd-32LG364Q.js +0 -2
- package/dist/list-cmd-UTZ2PQUK.js +0 -3
- package/dist/logical-ids-I7B3VJEH.js +0 -2
- package/dist/login-flow-D7KBR7XR.js +0 -2
- package/dist/maintenance-cmd-BZAGSYGI.js +0 -2
- package/dist/pipeline-MX3ZR5B3.js +0 -2
- package/dist/readmodel-S5RAQH3F.js +0 -2
- package/dist/reconcile-cmd-4377PWF5.js +0 -2
- package/dist/revert-RQJE56HF.js +0 -2
- package/dist/review-cmd-7LXGYHHQ.js +0 -4
- package/dist/run-2AIQUJ55.js +0 -2
- package/dist/run-YH5SCBYD.js +0 -2
- package/dist/sessions-cmd-DTQYDZNT.js +0 -23
- package/dist/spawner-7KXVKAD5.js +0 -2
- package/dist/tcg-generate-U6OCCS2E.js +0 -2
- package/dist/testmd-actions-RPALXRZK.js +0 -2
- package/dist/token-refresh-S7CYBZTE.js +0 -2
- package/dist/walk-session-YIKHE6PT.js +0 -2
- /package/dist/{chunk-BC7UVJJB.js → chunk-CH273NAE.js} +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as u}from"./chunk-JEUA4UWK.js";import"./chunk-3STZLM5J.js";import"./chunk-L4JIMNKW.js";import"./chunk-M7WQM4UA.js";import"./chunk-WWNSD6FA.js";import"./chunk-IAHKTEET.js";import"./chunk-5YPBPZUR.js";import"./chunk-UR6MHSHU.js";var q=i=>`cite ${i.source_id??"?"} ${i.anchor??""}${i.quote?` \u2014 "${i.quote}"`:""}`;function I(i,_){let l=i.resolve(_);if(!l)return null;let c=l.tip,y=i.nodeLabel.get(c);if(!y)return null;let h=i.getNode(c);if(!h)return null;let s=h.content,f=i.displayNameOf(c)??_,d=[],o=(e,t,n=!1)=>{d.push({text:`${e.padEnd(12)} ${t}`,dim:n})},L=i.trust.get(c)??"derived";o("status",`${L}${i.superseded.has(c)?" \xB7 superseded":""}`,!0);let k=typeof s.risk=="string"?s.risk:null;k&&o("risk",k);for(let[e,t]of[["title",null],["description","description"],["value","value"],["summary","summary"],["statement","statement"],["text","text"],["intent","intent"],["case_type","case type"],["technique_notes","technique"],["kind","kind"],["change_note","change"]]){if(!t)continue;let n=s[e];typeof n=="string"&&n&&o(t,n)}let p=[];{let e=l.cid,t=new Set;for(;!t.has(e);){t.add(e),p.push(e);let n=i.superseded.get(e);if(typeof n!="string")break;e=n}}let g=p.flatMap(e=>i.edgesInto(e)).filter(e=>e.type==="DERIVES"),x=e=>{if(!e.source_cid||!e.anchor)return;let t=/^L(\d+)-L(\d+)$/.exec(e.anchor);if(!t)return;let n=i.getNode(e.source_cid)?.content?.text_blob;if(typeof n!="string")return;let r=n.split(`
|
|
3
|
+
`).slice(Number(t[1])-1,Number(t[2])).join(" ").trim();return r?r.length>120?`${r.slice(0,119)}\u2026`:r:void 0},m=new Map,b=new Set;for(let e of g){let t=e.props;if(!t.claim)continue;let n=`${t.claim}|${t.source_id??"?"}|${t.source_cid??"?"}|${t.anchor??"?"}`;if(b.has(n))continue;b.add(n);let r=m.get(t.claim)??[];r.push({source_id:t.source_id,anchor:t.anchor,quote:x(t)}),m.set(t.claim,r)}let D=Array.isArray(s.criteria)?s.criteria:[];for(let[e,t]of D.entries()){o(e===0?"criteria":"",`${e+1}. ${t}`);for(let n of m.get(t)??[])d.push({text:` ${q(n)}`,dim:!0})}let v=g.find(e=>!e.props.claim);if(v){let e=v.props;d.push({text:` ${q({...e,quote:x(e)})}`,dim:!0})}let a=s.check;a?.kind&&o("check",`${a.kind}${a.verified_against?` vs ${u(String(a.verified_against))}`:""}`);let $=s.expected_answer;$?.operator&&o("expects",`${$.operator} \xB7 ${String($.operand??"")}`);let S=new Set,w=!0;for(let e of g){let t=e.props,n=`${t.source_id??"?"}@${t.source_cid??e.src}`;S.has(n)||(S.add(n),o(w?"provenance":"",`${t.source_id??"?"} @ ${String(t.source_cid??e.src).slice(7,15)}`,!0),w=!1)}let N=p.flatMap(e=>i.edgesFrom(e)).filter(e=>e.type==="depends_on");for(let[e,t]of N.entries()){let n=String(i.getNode(i.tipOf(t.dst))?.content?.title??""),r=i.displayNameOf(t.dst);o(e===0?"depends on":"",`${r?u(r):t.dst.slice(0,12)}${n?` ${n}`:""}`)}return{id:u(f),rawId:f,title:String(s.title??s.text??s.statement??f),label:y,lines:d}}export{I as buildDossier};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{$ as fa,A as J,B as K,C as L,D as M,E as N,F as O,G as P,H as Q,L as R,M as S,N as T,O as U,P as V,Q as W,R as X,S as Y,T as Z,U as _,V as $,W as aa,X as ba,Y as ca,Z as da,_ as ea,a,aa as ga,b,ba as ha,c,ca as ia,d,e,f,g,h,i,j,k as t,l as u,m as v,n as w,o as x,p as y,q as z,r as A,s as B,t as C,u as D,v as E,w as F,x as G,y as H,z as I}from"./chunk-DQ54MH7F.js";import"./chunk-FCMLIK7P.js";import{a as n,b as o,c as p,e as q,f as r,g as s}from"./chunk-CJJXT5DO.js";import"./chunk-QM4S2APK.js";import"./chunk-ZPDM6FO7.js";import{a as k,b as l,c as m}from"./chunk-EHN5HTUD.js";import"./chunk-NVGBE2DR.js";import"./chunk-CH273NAE.js";import"./chunk-L5LI2JF4.js";import"./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"./chunk-5YPBPZUR.js";import"./chunk-JRMDGLLT.js";import"./chunk-C4G7RVJ6.js";import"./chunk-UR6MHSHU.js";export{P as EvidenceSession,C as appendExecutionPointer,M as assembleExecutionEnv,i as buildEnvironment,j as buildEvidenceRunConfig,g as buildExternalId,z as buildLogsMetaYaml,y as buildResultYaml,t as buildRunYaml,O as createCdpBrowserCapture,u as createRunningPack,v as createRunningPackRoot,H as declareLogsFromDir,J as diagnostics,x as discardPack,ba as ensureAuteurExecution,N as fetchCdpBrowserString,L as finalizeEvidencePack,U as finalizeInlineEvidence,K as finalizeMemberTestLogs,da as flattenAuteurLeafIds,ca as flattenAuteurLeaves,T as inlineEvidenceBlock,q as listPacks,p as newExecutionId,h as normalizeOs,S as noteInlineSpawn,$ as offerEvidenceView,o as packPath,I as packTestLogsDir,V as parseRange,D as readExecutionPointers,ia as readPackLeafIds,ha as readPackLeaves,s as recoverStore,fa as remapReplayActionIds,r as resolvePack,ga as resolveReplayResultSteps,F as rollupTestStatus,aa as runEvidenceMerge,_ as runEvidenceServe,E as runEvidenceValidate,Q as runStartupRecovery,l as sealPack,w as sealPackById,Z as serveHint,d as shortHash,c as slugify,W as startEvidenceLocalServer,R as startInlineEvidence,n as storeDir,m as sweepStore,ea as synthesizeSkippedTail,f as testIdForInline,e as testIdForTestmd,k as validatePack,a as verdictFromResultCode,X as viewerBaseFor,Y as viewerUrlFor,b as worstOf,G as worstResultCode,B as writeLogsMeta,A as writeResult};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d,e,f,g}from"./chunk-3LWTUMDG.js";import"./chunk-QROUKGKU.js";import"./chunk-OHRS3H7Z.js";import"./chunk-5JTUL6XL.js";import"./chunk-JFAFKHDX.js";import"./chunk-ZLCZDAEX.js";import"./chunk-DNNZ353O.js";import"./chunk-NVGBE2DR.js";import"./chunk-CH273NAE.js";import"./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"./chunk-5YPBPZUR.js";import"./chunk-UR6MHSHU.js";export{b as designStateOf,g as evolveCommand,c as evolveOneUc,f as liveRunDesignForUc,a as resolveParentUc,e as runEvolveCommand,d as staleTargets};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{g as a,h as b,i as c,j as d,k as e,l as f,m as g,n as h,o as i,p as j,q as k,r as l,s as m,t as n}from"./chunk-
|
|
2
|
+
import{g as a,h as b,i as c,j as d,k as e,l as f,m as g,n as h,o as i,p as j,q as k,r as l,s as m,t as n}from"./chunk-W6VD2XFO.js";import"./chunk-5EOX4MEY.js";import"./chunk-UR6MHSHU.js";export{n as _reset,i as cleanup,h as deregister,e as getRemoteLogger,b as getSupportContext,m as installHandlers,f as isShuttingDown,d as logOrBufferRemote,g as register,k as setInkExit,c as setRemoteLogger,a as setSupportContext,l as setTerminalRestore,j as shutdown};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a}from"./chunk-PMHJRT3A.js";import"./chunk-M7WQM4UA.js";import"./chunk-WWNSD6FA.js";import"./chunk-IAHKTEET.js";import"./chunk-5YPBPZUR.js";import"./chunk-UR6MHSHU.js";export{a as explain};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as a}from"./chunk-
|
|
2
|
+
import{b as a}from"./chunk-QROUKGKU.js";import{a as i}from"./chunk-PMHJRT3A.js";import"./chunk-ZLCZDAEX.js";import"./chunk-CH273NAE.js";import{a as n}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"./chunk-5YPBPZUR.js";import"./chunk-UR6MHSHU.js";async function f(s,p){let o=a(process.cwd(),{out:r=>process.stdout.write(r+`
|
|
3
3
|
`),err:r=>process.stderr.write(r+`
|
|
4
4
|
`),confirm:async()=>!1,isTTY:!!process.stdout.isTTY});if(!o)return 2;let c=n(o),t=i(o,c,s);if(p.json)return process.stdout.write(JSON.stringify(t)+`
|
|
5
5
|
`),t.target?0:1;if(!t.target)return process.stdout.write(`error: ${s} names nothing in the graph
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{
|
|
2
|
+
import{b as E}from"./chunk-KHU7C6EE.js";import{a as x}from"./chunk-PMHJRT3A.js";import{a as k}from"./chunk-CH273NAE.js";import"./chunk-L5LI2JF4.js";import{a as h}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,e as g}from"./chunk-5YPBPZUR.js";import"./chunk-UR6MHSHU.js";async function _(f,$={}){let m=$.contextDir??k(process.cwd()),e=$.out??(c=>process.stdout.write(c+`
|
|
3
3
|
`)),o=h(m),u=o.resolve(f);if(!u){let c=[...o.names.keys()].filter(n=>/^(t|sc|ac|gap)-/.test(n)).sort();return e(`no design rationale recorded for ${f} (exists: ${c.slice(0,12).join(", ")||"(no designed items)"})`),1}let a=u.tip,s=o.nodeLabel.get(a),r=o.getNode(a),l=o.nameOf.get(a)??a.slice(0,19);if(s===d.TEST){let c=String(r?.content.definitionId??""),n=c?E(m,c):null;if(!n){let i=null;for(let S of o.edgesFrom(a))if(S.type===g.VERIFIES){for(let p of o.edgesFrom(S.dst))if(p.type===g.SCOPED_TO){i=o.nameOf.get(p.dst)??p.dst.slice(0,19);break}if(i)break}return e(`no design rationale recorded for ${f} (exists: test ${l}, but its sidecar is missing \u2014 re-run: kane-cli design tests${i?` --use-case ${i}`:""} --force)`),1}e(`${l} \u2014 ${String(r?.content.title??"")}`),e(`technique: ${n.technique}`),e(`profile family: ${n.profile_family}`),e(`anchored to: ${n.anchor}`),e(`expected how: ${n.expected_how}`),e(`combinatorial: strength ${n.combinatorial.strength} \u2014 ${n.combinatorial.reason}`),e(`surface: ${n.surface_state} \xB7 deferred bindings: ${n.deferred_bindings}`);let t=r?.content.check;t&&e(`check: ${String(t.kind)} ${String(t.operator)} ${String(t.operand??t.within??"")} \u2014 verified against ${String(t.verified_against)}`);for(let i of o.edgesFrom(a))i.type===g.AUTOMATES&&e(`automates: ${o.nameOf.get(i.dst)??i.dst.slice(0,19)}`),i.type===g.VERIFIES&&e(`verifies: ${o.nameOf.get(i.dst)??i.dst.slice(0,19)}`),i.type===g.REUSES&&e(`imports: ${o.nameOf.get(i.dst)??i.dst.slice(0,19)}`);return 0}if(s===d.SCENARIO||s===d.AC||s===d.GAP){let n=x(m,o,f).entries.filter(t=>t.kind==="judgement"||t.kind==="review");if(e(`${l} \u2014 ${String(r?.content.title??r?.content.text??"")}`),s===d.SCENARIO&&(e(`case type: ${String(r?.content.case_type??"")} \xB7 intent: ${String(r?.content.intent??"")}`),e(`technique: ${String(r?.content.technique_notes??"")}`)),s===d.AC){let t=r?.content.expected_answer;e(`kind: ${String(r?.content.kind??"")}${t?` \xB7 oracle: ${String(t.operator)} ${String(t.operand??"")}`:""}`)}n.length===0&&e("(no recorded judgements yet \u2014 approvals and design-time judgements land here)");for(let t of n)e(t.kind==="judgement"?`judgement: ${t.rationale??t.detail}`:`review: ${t.detail}`);return 0}return e(`no design rationale recorded for ${f} (exists: ${s??"nothing"} ${l} \u2014 design explains tests, scenarios, ACs, and gaps)`),1}export{_ as designExplainCommand};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as T}from"./chunk-WJ5HDEVH.js";import{a as q}from"./chunk-5JTUL6XL.js";import{f as Y,g as A}from"./chunk-KRXSXQBU.js";import"./chunk-UPPEOQJQ.js";import"./chunk-36OC3TFE.js";import"./chunk-O56PUUNL.js";import"./chunk-NRC2G4Y5.js";import"./chunk-BQHKBOSF.js";import"./chunk-2XGDWUJ5.js";import"./chunk-BB2W35TW.js";import"./chunk-VGFTNLQQ.js";import"./chunk-L2TV4G56.js";import"./chunk-JFAFKHDX.js";import"./chunk-5KFS3GAZ.js";import"./chunk-EV3EHXEI.js";import"./chunk-F7WKDMX7.js";import"./chunk-VOHQA2SP.js";import{d as Q}from"./chunk-UX2B7L6K.js";import"./chunk-XDHZMCTA.js";import"./chunk-AAONIIQV.js";import{c as $}from"./chunk-YKTYVJBN.js";import"./chunk-CVOGP253.js";import"./chunk-427OQS2N.js";import{c as U}from"./chunk-ZLCZDAEX.js";import"./chunk-SE6WNCYU.js";import"./chunk-DNNZ353O.js";import"./chunk-Q2F5QB2W.js";import{a as N,b as j}from"./chunk-IQDWBTRJ.js";import"./chunk-GVIPTX6T.js";import"./chunk-BKM2LWU2.js";import"./chunk-2XMJ6YAE.js";import"./chunk-NVGBE2DR.js";import{a as b}from"./chunk-CH273NAE.js";import"./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"./chunk-5YPBPZUR.js";import"./chunk-W6VD2XFO.js";import"./chunk-5EOX4MEY.js";import"./chunk-RZ4F3BHX.js";import"./chunk-C4G7RVJ6.js";import"./chunk-UR6MHSHU.js";async function J(n){let[{render:t},s,{QuestionBatchPrompt:f}]=await Promise.all([import("./build-JIKYOZUH.js"),import("./react-QWOAB3TB.js"),import("./ui-JEJGTURD.js")]),l=s.default??s;return new Promise(g=>{let h=t(l.createElement(f,{questions:n,onSubmit:y=>{h.unmount(),g(y)}}))})}async function K(n,t){let[{render:s},f,{ReviewChecklist:l}]=await Promise.all([import("./build-JIKYOZUH.js"),import("./react-QWOAB3TB.js"),import("./ui-JEJGTURD.js")]),g=f.default??f;return new Promise(h=>{let y=s(g.createElement(l,{items:n.map(e=>{let o=t.get(e.temp_ref);return{uc:e,dedupWith:o&&!o.archived?o.cid:void 0,archivedMatch:o?.archived?{cid:o.cid,reason:o.reason}:void 0}}),onSubmit:e=>{y.unmount(),h(e)}}))})}async function X(n){let{createInterface:t}=await import("readline/promises"),s=t({input:process.stdin,output:process.stdout});try{let f=await s.question(`${n} [y/N] `);return/^y(es)?$/i.test(f.trim())}finally{s.close()}}async function ae(n){let t=b(process.cwd()),s=j({verb:"extract",mode:n.plan?"cli":"interactive",contextRoot:t,env:N(),resumeSid:n.resume,write:!0,longSession:!0}),l={...await Q(),...s.spawnEnv()},g=await $(l);if(!g.ok)return process.stderr.write((g.message??"error: turn-endpoint preflight failed")+`
|
|
3
|
+
`),process.stderr.write(s.supportFooter()+`
|
|
4
|
+
`),s.error("preflight_auth"),await s.end({exit_code:2}),2;let h=async()=>g;if(n.plan){let a=await A(n,{contextDir:t,agent:T,preflightTurn:h,ask:J,review:K,confirmStale:X,out:d=>process.stdout.write(d+`
|
|
5
|
+
`),progress:d=>process.stderr.write(d+`
|
|
6
|
+
`),isTTY:U(),auth:l,telemetry:s});return a===1&&process.stderr.write(s.supportFooter()+`
|
|
7
|
+
`),await s.end({exit_code:a}),a}let[{render:y},e,{ScrollbackProvider:o},{ChatSurface:E},{ScrollbackTap:D},{makeChatController:k},{setInkExit:G},P]=await Promise.all([import("./build-JIKYOZUH.js"),import("./react-QWOAB3TB.js"),import("./scrollback-JLPJR25X.js"),import("./ChatSurface-D66CACLX.js"),import("./ScrollbackTap-Q3IOKNMS.js"),import("./chat-controller-NNTMKEPG.js"),import("./exit-manager-HNFATGSM.js"),Promise.all([import("./chat-committer-4BQBOKI4.js"),import("./descriptor-KXDJ4XYD.js"),import("./explain-UE4IACQH.js"),import("./readmodel-X7L7W2BA.js")])]),[{commitChatTurn:r},{topologyDescriptor:F},{explain:R},{openGraph:v}]=P,V=e.default??e,c=k({commitChatTurn:r,descriptor:F(),contextDir:t,refreshGraph:()=>v(t),graph:v(t),explain:R,by:{kind:"human",id:"owner"},dedupFlags:a=>Y(a,v(t))}),I={current:null},H=0,M=null,C=!1,z=()=>{if(H+=1,H>=2){try{_.unmount()}catch{}process.exit(130)}c.requestPause(),M=setTimeout(()=>{C||(C=!0,(async()=>{c.ledger({kind:"interrupted",detail:"the agent did not confirm the pause within 5s"}),await I.current?.flush();try{_.unmount()}catch{}process.exit(130)})())},5e3)},O=await import("./dossier-QZV74XOS.js"),B=a=>{try{return O.buildDossier(v(t),a)}catch{return null}},L={listUcs:()=>{let a=v(t),d=new Set(c.state.turns.flatMap(i=>(i.items??[]).map(u=>u.title.toLowerCase()))),p={high:0,med:1,low:2};return a.byLabel("usecase").filter(i=>!a.superseded.has(i.cid)).map((i,u)=>{let m=i.content,x=String(m.title??i.cid.slice(0,12)),w=q(a,i.cid),S=w?w.designed_at_cid===i.cid?"current":"stale":void 0;return{key:i.cid,title:x,badge:S==="current"?"designed":S==="stale"?"designed \xB7 stale":d.has(x.toLowerCase())?"drafted this session":"existing",designed:S,risk:m.risk,i:u}}).sort((i,u)=>(p[i.risk??"zz"]??3)-(p[u.risk??"zz"]??3)||i.i-u.i).map(({key:i,title:u,badge:m,designed:x})=>({key:i,title:u,badge:m,designed:x}))},runDesignChild:async(a,d=!1)=>{try{let{designEntryCheck:m,confirmUnreviewedViaAsk:x}=await import("./trust-gate-EX7R2P4Y.js"),w=m(v(t),a);if(!w.ok&&(w.code==="UC_UNREVIEWED"||w.code==="UC_ARCHIVED")&&!await x(W=>c.ask(W),w))return c.note(`design child refused \u2014 approve it first: ${w.reviewCmd}`),2}catch{}let[{runDesign:p}]=await Promise.all([import("./run-52UIBPXD.js")]),i="",u=await p({useCase:a,force:d,mode:"interactive"},{contextDir:t,agent:T,preflightTurn:h,ask:m=>c.ask(m),chat:c,nested:!0,out:m=>{i=m},progress:()=>{},isTTY:!0,auth:l});return u!==0&&i&&c.note(i),u}},_=y(V.createElement(o,null,V.createElement(D,{into:I}),V.createElement(E,{controller:c,verb:"extract",onCtrlC:z,chain:L,inspect:B})),{exitOnCtrlC:!1});G(()=>_.unmount()),c.ledger({kind:"banner",text:"kane-cli context \xB7 extract \xB7 interactive"});try{let a=A(n,{contextDir:t,agent:T,preflightTurn:h,ask:p=>c.ask(p),review:async p=>new Map(p.map(i=>[i.temp_ref,{resolution:"skipped"}])),confirmStale:async()=>!0,out:p=>c.note(p),progress:()=>{},isTTY:U(),auth:l,chat:c,telemetry:s});a.finally(()=>{C=!0});let d=await a;return d===1&&process.stderr.write(s.supportFooter()+`
|
|
8
|
+
`),await s.end({exit_code:d}),d}finally{C=!0,M&&clearTimeout(M),await I.current?.flush();try{_.unmount()}catch{}}}async function ce(n){let t=j({verb:"extract",mode:n.mode,contextRoot:b(process.cwd()),env:N(),resumeSid:n.resume,write:!0,longSession:!0}),s={...await Q(),...t.spawnEnv()},{makeHeadlessIO:f,resolveEncoding:l,guardedChannels:g}=await import("./headless-io-BL3TEAX5.js"),{withStructuredNext:h,prepareStructuredResume:y}=await import("./structured-answers-QHFGZPSS.js"),e=h(f(l(n.mode),"extract"));for(let r of n.landed??[])e.event({type:"ingested",source_id:r.source_id,status:r.status,cid:r.source_cid});let o=y({opts:n,contextDir:b(process.cwd()),verb:"extract"});if(o.kind==="refuse")return e.out(o.error),n.mode==="agent"&&e.event({type:"error",message:o.error,code:o.code}),await t.end({exit_code:2}),n.mode==="agent"?e.done(2,"refused"):2;let E=n;if(o.kind==="apply"){for(let r of o.notes)e.out(r);if(o.matchedQids.length>0){e.out(`applying ${o.matchedQids.length} structured answer(s) from --answer to the paused session's pending questions`);for(let r of o.matchedQids)e.event({type:"panel_resolved",id:r,by:"user",via:"flag"})}o.statement&&(E={...n,message:[n.message,o.statement].filter(Boolean).join(`
|
|
9
|
+
|
|
10
|
+
`)})}let{makeInterruptGuard:D}=await import("./interrupt-guard-UREUWNRL.js"),k=D(T,r=>e.out(r)),P=g(e,()=>k.interrupted(),/^error: (agent failed|repair run failed|agent ended)/);try{let r=await A(E,{contextDir:b(process.cwd()),agent:k.agent,preflightTurn:()=>$(s),ask:async()=>[],review:async F=>new Map(F.map(R=>[R.temp_ref,{resolution:"skipped"}])),confirmStale:async()=>!1,out:P.out,emit:P.emit,progress:e.progress,isTTY:!1,auth:s,telemetry:t});return k.interrupted()&&r!==3?(e.out("interrupted \u2014 no session saved"),await t.end({exit_code:130}),e.done(130)):(r===1&&e.out(t.supportFooter()),await t.end({exit_code:r}),e.done(r))}catch(r){return e.event({type:"error",message:`error: extract failed: ${r instanceof Error?r.message:String(r)}`}),e.out(`error: extract failed: ${r instanceof Error?r.message:String(r)}`),e.out('hint: the full trace is in the file named on the "trace:" line at the start of this run'),e.done(1)}finally{k.dispose()}}export{ce as bindExtractHeadless,ae as bindExtractInteractive};
|
|
@@ -0,0 +1,6 @@
|
|
|
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))return process.stderr.write(`extract: --mode must be interactive | agent | ci | override, got '${e.mode}'
|
|
3
|
+
`),2;let n=async(r,t)=>{if(process.stderr.write(r+`
|
|
4
|
+
`),e.mode!=="agent")return 2;let{makeHeadlessIO:o,agentRefusal:c}=await import("./headless-io-BL3TEAX5.js");return c(o("ndjson","extract"),r,t)};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:r}=await import("./headless-io-BL3TEAX5.js"),t=r(e,"extract");if(t)return n(t)}{let{gateStructuredFlags:r}=await import("./structured-answers-QHFGZPSS.js"),t=r(e,"extract");if(t)return n(t,"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
|
|
5
|
+
`),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)
|
|
6
|
+
`),2;let{bindExtractInteractive:r}=await import("./extract-bind-BFY7IRL4.js");return r(e)}let{bindExtractHeadless:a}=await import("./extract-bind-BFY7IRL4.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-AH7ZZIZY.js";import"./chunk-AAONIIQV.js";import"./chunk-M7WQM4UA.js";import"./chunk-WWNSD6FA.js";import"./chunk-IAHKTEET.js";import"./chunk-5YPBPZUR.js";import"./chunk-UR6MHSHU.js";export{a as archiveImpact,b as heldArchiveScan,c as reviewCards,d as reviewCounts};
|
|
@@ -0,0 +1,3 @@
|
|
|
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(`
|
|
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-5JTUL6XL.js";import"./chunk-5YPBPZUR.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-UBFKZEX3.js";import{d as J}from"./chunk-322JEJEH.js";import{b as k}from"./chunk-ZM5PVRJK.js";import{c as E}from"./chunk-3FN5VJMV.js";import"./chunk-L5LI2JF4.js";import"./chunk-UI7KULSI.js";import"./chunk-TDPWFYTJ.js";import{a as q}from"./chunk-DXV6MBTD.js";import"./chunk-6HEGD6H2.js";import"./chunk-KT6G7AF2.js";import"./chunk-FPFOW6BS.js";import"./chunk-WAOCHXJ5.js";import{m as x,n as A}from"./chunk-W6VD2XFO.js";import"./chunk-5EOX4MEY.js";import{h as H}from"./chunk-HPMS5KO6.js";import"./chunk-2WVKOZ6W.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import{a as R}from"./chunk-JRMDGLLT.js";import"./chunk-VE3SUJMA.js";import{a as j}from"./chunk-F6ZOJXYU.js";import"./chunk-C4G7RVJ6.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-R347LFDQ.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-ZLCZDAEX.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};
|