@testmuai/kane-cli 0.6.3 → 0.6.4
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-VXYU6KFW.js +8 -0
- package/dist/{ChromeProfilePicker-UUGUMJPI.js → ChromeProfilePicker-QWTM7DK6.js} +1 -1
- package/dist/{CliFeedbackPrompt-JZWESL7Z.js → CliFeedbackPrompt-6NVWMONO.js} +1 -1
- package/dist/{CliUploadProgress-62U3LAUU.js → CliUploadProgress-2YRQLECI.js} +1 -1
- package/dist/{ConfigView-WHEFCVHR.js → ConfigView-I4R5M7BO.js} +1 -1
- package/dist/EvidenceViewOffer-54GEARRX.js +2 -0
- package/dist/{FolderPicker-HJUUHQEI.js → FolderPicker-5VWBYTAK.js} +1 -1
- package/dist/{HelpView-EWHP7LSJ.js → HelpView-OJZW4XWX.js} +1 -1
- package/dist/{InfoBox-GQQJVTI5.js → InfoBox-TGELGCBR.js} +1 -1
- package/dist/{LinksBox-EWCPAZFN.js → LinksBox-B5EBRY26.js} +1 -1
- package/dist/{ProfilesView-5FJNQMUW.js → ProfilesView-3SJRIBHQ.js} +1 -1
- package/dist/{ProjectPicker-IN7GFN7I.js → ProjectPicker-72HKMBEY.js} +1 -1
- package/dist/{SaveSessionPrompt-ISODGFP7.js → SaveSessionPrompt-CK5SGNRO.js} +1 -1
- package/dist/SingleShotApp-AJBIWW74.js +2 -0
- package/dist/{SummaryBox-R6WHU7VD.js → SummaryBox-ABB7ST26.js} +1 -1
- package/dist/TestMdRunView-5PMLLLFT.js +2 -0
- package/dist/{WhoamiView-YRQNOSOH.js → WhoamiView-OF354UGC.js} +1 -1
- package/dist/bind-BWILBZGR.js +6 -0
- package/dist/{bridge-7UMWMIJJ.js → bridge-LNDJS3HH.js} +1 -1
- package/dist/{changelog-YQC2QDCO.js → changelog-BWCEZQ23.js} +1 -1
- package/dist/{chat-committer-GHDZY5XF.js → chat-committer-ADJJTDUT.js} +1 -1
- package/dist/{chat-controller-QXFAB2DK.js → chat-controller-VAC57IEV.js} +1 -1
- package/dist/{chunk-F66SSA4C.js → chunk-2K4XOHVK.js} +1 -1
- package/dist/{chunk-KHDUQ33H.js → chunk-2PQXEEVY.js} +1 -1
- package/dist/{chunk-NNZV5RCE.js → chunk-3C5GMAM4.js} +1 -1
- package/dist/{chunk-7YQW4TFI.js → chunk-3HEPW6SN.js} +1 -1
- package/dist/{chunk-WFRL54GK.js → chunk-3WJJ43MT.js} +1 -1
- package/dist/{chunk-SL7AJ7JQ.js → chunk-4MUHS3UL.js} +1 -1
- package/dist/{chunk-2TVRHXRK.js → chunk-5CTMOJG4.js} +1 -1
- package/dist/{chunk-OGVIHL5G.js → chunk-5KSB5MOF.js} +1 -1
- package/dist/chunk-5YPBPZUR.js +2 -0
- package/dist/chunk-64LC36AF.js +2 -0
- package/dist/{chunk-CIW2KP4C.js → chunk-64QURIT6.js} +1 -1
- package/dist/{chunk-326XAPMW.js → chunk-652FEDL4.js} +2 -2
- package/dist/{chunk-Z56AWGVY.js → chunk-6AYUSR7X.js} +1 -1
- package/dist/{chunk-VJUIW2ES.js → chunk-6GTOYTCQ.js} +1 -1
- package/dist/chunk-6LRKYF67.js +14 -0
- package/dist/{chunk-AE6SS34N.js → chunk-74RUSHIB.js} +1 -1
- package/dist/chunk-ACEODVSC.js +14 -0
- package/dist/{chunk-FFL2TQEJ.js → chunk-ADOXYGZE.js} +1 -1
- package/dist/chunk-ANIVHX3P.js +5 -0
- package/dist/{chunk-B5LJCGAY.js → chunk-AXABTFCD.js} +1 -1
- package/dist/{chunk-7LFCSSPX.js → chunk-BNN6ZDJW.js} +1 -1
- package/dist/{chunk-TZZYRDCF.js → chunk-BOO7YXAV.js} +1 -1
- package/dist/{chunk-Y6LMHBLE.js → chunk-BYUARJE7.js} +1 -1
- package/dist/{chunk-FYOCF7DY.js → chunk-CJJXT5DO.js} +1 -1
- package/dist/{chunk-F2K3XFFH.js → chunk-CLTANA4L.js} +2 -2
- package/dist/{chunk-YZSYXNMB.js → chunk-CT2I5KUM.js} +1 -1
- package/dist/{chunk-RZFINU7J.js → chunk-CY5NDMO7.js} +1 -1
- package/dist/{chunk-RLG5NUTE.js → chunk-DNOBOZPO.js} +1 -1
- package/dist/chunk-DXK55KGR.js +9 -0
- package/dist/{chunk-Q4HLQOJI.js → chunk-E3BO7OVR.js} +1 -1
- package/dist/chunk-EHN5HTUD.js +147 -0
- package/dist/{chunk-RGEAEAZB.js → chunk-FJTWJ243.js} +1 -1
- package/dist/{chunk-G6AF2JUA.js → chunk-FV4LLU3T.js} +1 -1
- package/dist/{chunk-CE664P73.js → chunk-GBBVP2JW.js} +1 -1
- package/dist/{chunk-AD46OCZ4.js → chunk-GRB66C5S.js} +1 -1
- package/dist/{chunk-22A2ECA2.js → chunk-GYW7LVVL.js} +1 -1
- package/dist/{chunk-E4OYR32M.js → chunk-HJGUEZLW.js} +1 -1
- package/dist/{chunk-DEEBPSJN.js → chunk-HNE4TDOZ.js} +1 -1
- package/dist/{chunk-7MV5UF6O.js → chunk-I2JUBAPU.js} +1 -1
- package/dist/chunk-IJPFAWBH.js +5 -0
- package/dist/{chunk-53VDR5DN.js → chunk-IOTJZTHX.js} +3 -3
- package/dist/{chunk-SHSV64GX.js → chunk-IRRGSC7B.js} +1 -1
- package/dist/{chunk-BFFCGEUH.js → chunk-IXVR66NS.js} +1 -1
- package/dist/chunk-K5JGCJ2K.js +6 -0
- package/dist/{chunk-D5T4ARTB.js → chunk-MCQXRJGH.js} +1 -1
- package/dist/{chunk-UXJPCWGW.js → chunk-MK2G7VIF.js} +1 -1
- package/dist/{chunk-P46TIMGQ.js → chunk-MVF4KRHA.js} +1 -1
- package/dist/{chunk-ARS72637.js → chunk-O66EU5UV.js} +1 -1
- package/dist/{chunk-Y7KW5AEN.js → chunk-OB6CKLEL.js} +1 -1
- package/dist/{chunk-2S4S2XJC.js → chunk-OLXOZJ7X.js} +1 -1
- package/dist/{chunk-YZKPZXHY.js → chunk-PICCLJSO.js} +1 -1
- package/dist/{chunk-EWFFJBAM.js → chunk-POI6DCP6.js} +1 -1
- package/dist/{chunk-C5POEXSX.js → chunk-PYB2EXRE.js} +2 -2
- package/dist/{chunk-OE7TVGNB.js → chunk-QNNBNIR7.js} +3 -3
- package/dist/{chunk-TTSYHJLX.js → chunk-QZI43UNV.js} +1 -1
- package/dist/{chunk-LMJTY32X.js → chunk-RHNKYNNZ.js} +1 -1
- package/dist/{chunk-ZKYYZ5NO.js → chunk-RN4OSVTG.js} +2 -2
- package/dist/chunk-SJ2KQKOV.js +3 -0
- package/dist/{chunk-BGGNBWAJ.js → chunk-STH6I3UB.js} +1 -1
- package/dist/{chunk-PJDOXRLB.js → chunk-UZSG54OY.js} +1 -1
- package/dist/{chunk-XBE7PGVY.js → chunk-W36P7S5W.js} +1 -1
- package/dist/{chunk-EEO4XWY6.js → chunk-WE57PD6K.js} +1 -1
- package/dist/{chunk-NFGG5DA2.js → chunk-WFEGGQJ4.js} +1 -1
- package/dist/chunk-WIA7TPK3.js +2 -0
- package/dist/{chunk-SQFNMZJ2.js → chunk-WT3SMSY5.js} +1 -1
- package/dist/{chunk-AV5SUGRY.js → chunk-XUJ5EPVW.js} +1 -1
- package/dist/{chunk-BO3JA2GS.js → chunk-YI4XULHR.js} +2 -2
- package/dist/{chunk-VXGOWBET.js → chunk-YMSN25DX.js} +1 -1
- package/dist/{chunk-B2PZAB7J.js → chunk-ZG2V2ODK.js} +1 -1
- package/dist/{chunk-ME5QSYWX.js → chunk-ZQP3MCZW.js} +1 -1
- package/dist/{chunk-GIRXJOJI.js → chunk-ZZLR3O5A.js} +1 -1
- package/dist/{config-5OOP2BO3.js → config-OJF53CHL.js} +1 -1
- package/dist/{cover-cmd-Y5L4O4Q3.js → cover-cmd-K3LCXHAQ.js} +1 -1
- package/dist/{credentials-XCP6DJZZ.js → credentials-NLJHSVBY.js} +1 -1
- package/dist/descriptor-EHK3DRCZ.js +2 -0
- package/dist/{evidence-AX67Q6RN.js → evidence-UPOFW3XC.js} +1 -1
- package/dist/evolve-cmd-MVALOB3G.js +2 -0
- package/dist/explain-VFIZTHFN.js +2 -0
- package/dist/{explain-cmd-RIDEMDMY.js → explain-cmd-KV5YUXKB.js} +1 -1
- package/dist/{explain-cmd-55WRDIMW.js → explain-cmd-U367SD4N.js} +1 -1
- package/dist/{extract-bind-ZDAXRQUS.js → extract-bind-SSTKQGTV.js} +2 -2
- package/dist/{extract-cmd-5GGI6LAM.js → extract-cmd-GO4UV7ER.js} +2 -2
- package/dist/{gaps-cmd-P2DRK6FW.js → gaps-cmd-DTVDIOED.js} +1 -1
- package/dist/{gate-FACZRGOC.js → gate-B6C6KLFA.js} +1 -1
- package/dist/{generate-headless-DRDE46ON.js → generate-headless-2HYMSVN5.js} +2 -2
- package/dist/{headless-io-GXHKDPHB.js → headless-io-PWW6YKH2.js} +1 -1
- package/dist/index.js +43 -43
- package/dist/ingest-C5ANIN7S.js +2 -0
- package/dist/ingest-cmd-LLC5CDQ5.js +3 -0
- package/dist/interactive-bind-Q5TQFQ6N.js +7 -0
- package/dist/{lifecycle-cmd-55NZL3UO.js → lifecycle-cmd-BXE5IMFN.js} +1 -1
- package/dist/{list-cmd-JB2ABACD.js → list-cmd-KBWPYJMV.js} +1 -1
- package/dist/{list-commands-UDAL3SBY.js → list-commands-6WDXAECV.js} +1 -1
- package/dist/{logical-ids-ATVR6PF2.js → logical-ids-3Y6RX5C2.js} +1 -1
- package/dist/login-flow-XQMJFC4H.js +2 -0
- package/dist/{maintenance-cmd-E3HEEVQW.js → maintenance-cmd-VS3APIUN.js} +1 -1
- package/dist/{persist-recorded-session-BW3YSFMP.js → persist-recorded-session-KHIMN4A3.js} +1 -1
- package/dist/pipeline-2HRAWT5U.js +2 -0
- package/dist/readmodel-XOGOELUP.js +2 -0
- package/dist/reconcile-cmd-DH4VV6PG.js +2 -0
- package/dist/{recording-banner-6FVTCUWQ.js → recording-banner-SADVYNEP.js} +1 -1
- package/dist/{require-project-folder-AQUVEEJB.js → require-project-folder-LP7V26IU.js} +1 -1
- package/dist/{revert-3TKLOYQA.js → revert-AQQ2VHRM.js} +1 -1
- package/dist/{review-cmd-RXPPC5GK.js → review-cmd-4WZUUOE4.js} +1 -1
- package/dist/run-RT2VMPTQ.js +2 -0
- package/dist/run-XAZMT7WO.js +2 -0
- package/dist/{run-test-md-AUK7NGLL.js → run-test-md-ATB2HZRG.js} +2 -2
- package/dist/{skill-installer-2MNPCPRD.js → skill-installer-DE2LSSKU.js} +1 -1
- package/dist/{spawner-XCOMTJJC.js → spawner-GOTVIFR5.js} +1 -1
- package/dist/tcg-generate-7PUXJ5R4.js +2 -0
- package/dist/{testmd-actions-TU4KTO32.js → testmd-actions-RYQHBX4K.js} +1 -1
- package/dist/token-refresh-F5KRV7ER.js +2 -0
- package/dist/{validate-basic-IYMPP7C7.js → validate-basic-6BQ2L7TT.js} +1 -1
- package/dist/{version-check-MUPSKONS.js → version-check-YW3FUWDH.js} +1 -1
- package/dist/{view-cmd-QE2FS3GB.js → view-cmd-FRMQF76B.js} +1 -1
- package/dist/walk-session-O4TMVORI.js +2 -0
- package/package.json +7 -7
- package/dist/ChatSurface-J777M5WC.js +0 -8
- package/dist/EvidenceViewOffer-JQDEAE2T.js +0 -2
- package/dist/SingleShotApp-QANGFAPO.js +0 -2
- package/dist/TestMdRunView-74A3LCNE.js +0 -2
- package/dist/archive-committer-3NI773TP.js +0 -2
- package/dist/bind-FZ4X4SOK.js +0 -6
- package/dist/chunk-6RQAUK5F.js +0 -5
- package/dist/chunk-FTD3B7QA.js +0 -2
- package/dist/chunk-GIGD4M7V.js +0 -5
- package/dist/chunk-I2S6KNZW.js +0 -2
- package/dist/chunk-IACKIGPX.js +0 -2
- package/dist/chunk-NFOBDHZK.js +0 -147
- package/dist/chunk-SGU72YLH.js +0 -9
- package/dist/chunk-TY5LWU6I.js +0 -14
- package/dist/chunk-YANCBRER.js +0 -3
- package/dist/descriptor-SL5A7RQE.js +0 -2
- package/dist/distill-cmd-EYCCCFL3.js +0 -2
- package/dist/evolve-cmd-HR25DRTC.js +0 -2
- package/dist/explain-JIXUWEFJ.js +0 -2
- package/dist/ingest-4CGBXC2L.js +0 -2
- package/dist/ingest-cmd-X7BWGIN7.js +0 -3
- package/dist/interactive-bind-T6OBLZCT.js +0 -7
- package/dist/login-flow-LJ4BH3OS.js +0 -2
- package/dist/pipeline-TZJ652NT.js +0 -2
- package/dist/readmodel-MPTENJ2R.js +0 -2
- package/dist/reconcile-cmd-242S7XNO.js +0 -8
- package/dist/run-UGAOGR3B.js +0 -2
- package/dist/signals-cmd-LXHZQLXZ.js +0 -2
- package/dist/tcg-generate-E5X23RVP.js +0 -2
- package/dist/token-refresh-GGLARJV4.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{x as m}from"./chunk-
|
|
2
|
+
import{x as m}from"./chunk-HJGUEZLW.js";import{a as x}from"./chunk-HCBYKLMW.js";import{a as u,b as a,j as g}from"./chunk-C44QQJR4.js";import{a as b}from"./chunk-6YGTRKDT.js";import{e as f}from"./chunk-UR6MHSHU.js";var T=f(b(),1);function k(i,n){if(!n)return i;let l=i.trim()||n;return`\x1B]8;;${n}\x07${l}\x1B]8;;\x07`}var r=f(x(),1);function $({shareableLink:i,testCaseLink:n,codeExportDir:l,recordedTestPath:s,outputDir:o,autoExit:p=!0}){let{exit:c}=g();(0,T.useEffect)(()=>{if(!p)return;let t=setTimeout(()=>c(),100);return()=>clearTimeout(t)},[c,p]);let e=[];return s&&e.push({label:"Test",url:s,linkUrl:`file://${s}`}),o&&e.push({label:"Output",url:o,linkUrl:`file://${o}`}),i&&e.push({label:"ShareLink",url:i}),n&&e.push({label:"TestCase",url:n}),l&&!o&&e.push({label:"CodeExport",url:l,linkUrl:`file://${l}`}),e.length===0?(0,r.jsx)(r.Fragment,{}):(0,r.jsx)(u,{flexDirection:"column",marginTop:1,marginLeft:1,children:e.map(t=>(0,r.jsxs)(u,{flexDirection:"column",marginBottom:1,children:[(0,r.jsxs)(a,{color:m.orange,children:[t.label,":"]}),(0,r.jsx)(a,{color:m.dim,children:k(t.url,t.linkUrl??t.url)})]},t.label))})}export{$ as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as F}from"./chunk-QPZRHAYK.js";import{a as U,b as T,d as B}from"./chunk-ZZLR3O5A.js";import{e as W,g as P}from"./chunk-ZG2V2ODK.js";import{d as A,e as D,f as L,g as q,h as H}from"./chunk-5YPBPZUR.js";var G=/^[a-z0-9][a-z0-9-]{1,63}$/;function z(f,d,t,e){if(!d)return{error:{code:"SUPERSEDE_TARGET_MISSING",detail:"supersede verdict needs a target (slug or cid)"}};let n=f.resolve(d);return n?n.superseded||e.has(n.cid)?{error:{code:"ALREADY_SUPERSEDED",detail:`${d} is already superseded (tip: ${n.tip})`}}:n.cid===t?{error:{code:"SELF_SUPERSEDE",detail:"a node cannot supersede itself"}}:{targetCid:n.cid}:{error:{code:"UNKNOWN_SUPERSEDE_TARGET",detail:`${d} names nothing in the graph`}}}function X(f,d,t,e,n=[]){if(!q(d)?.acyclic)return null;if(t===e)return{code:"EDGE_CYCLE",detail:`${d} ${t} \u2192 itself`};let r=_=>[...f.edgesFrom(_).filter(E=>E.type===d).map(E=>E.dst),...n.filter(E=>E.type===d&&E.src===_).map(E=>E.dst)],c=new Set,p=[e];for(;p.length>0;){let _=p.pop();if(_===t)return{code:"EDGE_CYCLE",detail:`${d} ${t} \u2192 ${e} closes a cycle`};c.has(_)||(c.add(_),p.push(...r(_)))}return null}function de(f,d,t,e){let m=q(d)?.cardinality;if(m!=="one-live-per-src"&&m!=="one-live-per-src-and-dst")return null;let r=f.edgesFrom(t).filter(c=>c.type===d&&!f.superseded.has(c.dst));if(r.length>0)return{code:"CARDINALITY_VIOLATION",detail:`${d} from ${t} already has a live edge (${r[0].ecid}) \u2014 supersede it first`};if(m==="one-live-per-src-and-dst"&&e!==void 0){let c=f.edgesInto(e).filter(p=>p.type===d&&!f.superseded.has(p.src));if(c.length>0)return{code:"CARDINALITY_VIOLATION",detail:`${d} onto ${e} already has a live edge (${c[0].ecid}) \u2014 strict 1:1, supersede it first`}}return null}var K=new Set(["high","med","low"]);function ce(f,d,t){let e=[],n=t.mediaOf(f.source.source_cid),m=new Set;for(let r of f.use_cases){if(m.has(r.temp_ref)&&e.push({code:"DUP_TEMP_REF",detail:`duplicate temp_ref ${r.temp_ref}`}),m.add(r.temp_ref),(!r.title||!r.title.trim())&&e.push({code:"EMPTY_TITLE",detail:`${r.temp_ref}: title is empty`}),K.has(r.risk)||e.push({code:"BAD_RISK",detail:`${r.temp_ref}: risk ${JSON.stringify(r.risk)} not in high|med|low`}),!r.cite||!r.cite.anchor)e.push({code:"MISSING_CITE",detail:`${r.temp_ref}: every derived use-case must carry a cite`});else for(let c of F(n,r.cite,d))e.push({code:c.code,detail:`${r.temp_ref}: ${c.detail}`});r.matches_existing&&!t.hasNode(r.matches_existing.cid)&&e.push({code:"UNKNOWN_MATCH",detail:`${r.temp_ref}: matches_existing ${r.matches_existing.cid} is not in the graph`});for(let[c,p]of(r.criteria??[]).entries())if((!p.text||!p.text.trim())&&e.push({code:"EMPTY_CRITERION",detail:`${r.temp_ref}.criteria[${c}]: text is empty`}),!p.cite||!p.cite.anchor)e.push({code:"MISSING_CITE",detail:`${r.temp_ref}.criteria[${c}]: every criterion carries its own cite`});else for(let _ of F(n,p.cite,d))e.push({code:_.code,detail:`${r.temp_ref}.criteria[${c}]: ${_.detail}`});for(let[c,p]of(r.updated?.criteria??[]).entries())if((!p.text||!p.text.trim())&&e.push({code:"EMPTY_CRITERION",detail:`${r.temp_ref}.updated.criteria[${c}]: text is empty`}),!p.cite||!p.cite.anchor)e.push({code:"MISSING_CITE",detail:`${r.temp_ref}.updated.criteria[${c}]: every updated criterion carries its own cite`});else for(let _ of F(n,p.cite,d))e.push({code:_.code,detail:`${r.temp_ref}.updated.criteria[${c}]: ${_.detail}`})}return e}function ae(f){let{contextDir:d,graph:t,proposal:e,proposalId:n,verdicts:m,by:r,allowStaleBasis:c,extractorVersion:p,autoName:_}=f,E=W(d);if(!c&&e.read_basis!==E)return{record:null,errors:[{code:"STALE_BASIS",detail:`proposal read_basis ${String(e.read_basis)} != latest ${String(E)}`}]};if(!t.hasNode(e.source.source_cid))return{record:null,errors:[{code:"MISSING_SOURCE_NODE",detail:`source ${e.source.source_id} (${e.source.source_cid}) is not a committed node \u2014 ingest it first`}]};let l=[],g=t.mediaOf(e.source.source_cid),k=new Set,v=[],S=[],O=[],R=[],x=[],V=[],M=new Set,Y=new Set,j=(i,s,b)=>{let u=z(t,s.supersedeTarget,b,M);if("error"in u){l.push({code:u.error.code,detail:`${i}: ${u.error.detail}`});return}M.add(u.targetCid),x.push({kind:"node",old:u.targetCid,new:b,reason:s.reason??`superseded via review by ${r.id}`,by:r})};for(let i of e.use_cases){let s=m.get(i.temp_ref)??{resolution:"skipped"};if(k.has(i.temp_ref)&&l.push({code:"DUP_TEMP_REF",detail:`duplicate temp_ref ${i.temp_ref}`}),k.add(i.temp_ref),(!i.title||!i.title.trim())&&l.push({code:"EMPTY_TITLE",detail:`${i.temp_ref}: title is empty`}),K.has(i.risk)||l.push({code:"BAD_RISK",detail:`${i.temp_ref}: risk ${JSON.stringify(i.risk)} not in high|med|low`}),g.format==="image"){if(i.cite?.anchor!=="img#whole"){l.push({code:i.cite?.anchor?"CITE_ANCHOR_INVALID":"MISSING_CITE",detail:`${i.temp_ref}: image cites are anchor-only (img#whole)`});continue}}else if(!i.cite||!i.cite.anchor||!i.cite.quote){l.push({code:"MISSING_CITE",detail:`${i.temp_ref}: every derived use-case must cite anchor+quote`});continue}s.resolution==="edited"&&s.edit&&(s.edit.title!==void 0&&!s.edit.title.trim()&&l.push({code:"EMPTY_TITLE",detail:`${i.temp_ref}: edited title is empty`}),s.edit.risk!==void 0&&!K.has(s.edit.risk)&&l.push({code:"BAD_RISK",detail:`${i.temp_ref}: edited risk ${JSON.stringify(s.edit.risk)} invalid`}));let b=B({title:s.edit?.title??i.title,description:i.description,summary:s.edit?.summary??i.summary,actors:i.actors,value:i.value,risk:s.edit?.risk??i.risk,...i.criteria&&i.criteria.length>0?{criteria:i.criteria.map(o=>o.text)}:{}}),u=U("usecase",b),I={source_id:e.source.source_id,source_cid:e.source.source_cid,anchor:i.cite.anchor,...i.cite.quote?{quote:i.cite.quote}:{}};if(i.matches_existing&&!t.hasNode(i.matches_existing.cid)){l.push({code:"UNKNOWN_MATCH",detail:`${i.temp_ref}: matches_existing ${i.matches_existing.cid} is not in the graph`});continue}let N=i.matches_existing?.cid??(t.hasNode(u)?u:null);if(N&&t.superseded.has(N)){let o=t.tipOf(N);N=t.superseded.has(o)?null:o}if(N){if(i.changed&&(s.resolution==="approved"||s.resolution==="edited")){let o=i.updated;if(!o||Object.keys(o).length===0){l.push({code:"CHANGED_NEEDS_PAYLOAD",detail:`${i.temp_ref}: changed:true needs an updated{...} payload naming the moved fields`});continue}let h=t.getNode(N)?.content??{},$=(o.criteria??[]).map(a=>typeof a=="string"?{text:a,cite:void 0}:a),C=B({title:s.edit?.title??o.title??String(h.title??i.title),...o.description??h.description?{description:o.description??h.description}:{},...s.edit?.summary??o.summary??h.summary?{summary:s.edit?.summary??o.summary??h.summary}:{},...o.actors??h.actors?{actors:o.actors??h.actors}:{},...o.value??h.value?{value:o.value??h.value}:{},risk:s.edit?.risk??o.risk??String(h.risk??i.risk),...o.criteria?$.length>0?{criteria:$.map(a=>a.text)}:{}:h.criteria?{criteria:h.criteria}:{}}),w=U("usecase",C);if(w!==N){for(let a of L("usecase",C))l.push({code:a.code,detail:`${i.temp_ref}: ${a.detail}`});v.push({cid:w,label:A.USECASE,content:C}),S.push({ecid:T("DERIVES",I.source_cid,w,I),type:D.DERIVES,src:I.source_cid,dst:w,props:I});for(let a of $){if(!a.cite)continue;let y={source_id:e.source.source_id,source_cid:e.source.source_cid,anchor:a.cite.anchor,...a.cite.quote?{quote:a.cite.quote}:{},claim:a.text};S.push({ecid:T("DERIVES",y.source_cid,w,y),type:D.DERIVES,src:y.source_cid,dst:w,props:y})}j(i.temp_ref,{resolution:"supersede",supersedeTarget:N,reason:s.reason??`matches-but-changed: ${e.source.source_id} moved (${Object.keys(o).join(", ")})`},w),R.push({id:w,kind:"review-item",resolution:s.resolution,edit:s.resolution==="edited"?{...s.edit}:null,reason:null,by:r});continue}for(let a of $){if(!a.cite)continue;let y={source_id:e.source.source_id,source_cid:e.source.source_cid,anchor:a.cite.anchor,...a.cite.quote?{quote:a.cite.quote}:{},claim:a.text};S.push({ecid:T("DERIVES",y.source_cid,N,y),type:D.DERIVES,src:y.source_cid,dst:N,props:y})}}s.resolution!=="rejected"&&(S.push({ecid:T("DERIVES",I.source_cid,N,I),type:D.DERIVES,src:I.source_cid,dst:N,props:I}),(s.resolution==="approved"||s.resolution==="edited"||s.resolution==="supersede")&&R.push({id:N,kind:"review-item",resolution:"approved",edit:null,reason:null,by:r}),s.resolution==="supersede"&&j(i.temp_ref,s,N));continue}for(let o of L("usecase",b))l.push({code:o.code,detail:`${i.temp_ref}: ${o.detail}`});for(let o of H(D.DERIVES,"source","usecase",I))l.push({code:o.code,detail:`${i.temp_ref}: ${o.detail}`});v.push({cid:u,label:A.USECASE,content:b}),S.push({ecid:T("DERIVES",I.source_cid,u,I),type:D.DERIVES,src:I.source_cid,dst:u,props:I});for(let o of i.criteria??[]){let h={source_id:e.source.source_id,source_cid:e.source.source_cid,anchor:o.cite.anchor,...o.cite.quote?{quote:o.cite.quote}:{},claim:o.text};S.push({ecid:T("DERIVES",h.source_cid,u,h),type:D.DERIVES,src:h.source_cid,dst:u,props:h})}for(let o of i.depends_on_hint??[]){let h=a=>a.toLowerCase().trim().replace(/\s+/g," "),$=null,C=t.resolve(o);if(C&&!C.superseded&&t.nodeLabel.get(C.cid)===A.USECASE&&($=C.cid),!$){for(let{cid:a,content:y}of t.byLabel(A.USECASE))if(!t.superseded.has(a)&&h(String(y.title??""))===h(o)){$=a;break}}if(!$){let a=v.find(y=>y.label===A.USECASE&&h(String(y.content.title??""))===h(o));a&&($=a.cid)}!$||$===u||X(t,D.DEPENDS_ON,u,$,O)||O.some(a=>a.src===u&&a.dst===$)||(S.push({ecid:T(D.DEPENDS_ON,u,$,{reason:"extract hint"}),type:D.DEPENDS_ON,src:u,dst:$,props:{reason:"extract hint"}}),O.push({src:u,dst:$,type:D.DEPENDS_ON}))}if((s.resolution==="approved"||s.resolution==="edited"||s.resolution==="supersede")&&t.superseded.get(u)===null&&!M.has(u)&&x.push({kind:"node",old:u,new:u,reason:`re-minted after tombstone via review by ${r.id}`,by:r}),_){let o=J("usecase",s.edit?.title??i.title,h=>Y.has(h)||t.names.has(h)&&!t.superseded.has(t.names.get(h)));o!==null&&!t.nameOf.has(u)&&(Y.add(o),V.push({cid:u,slug:o,by:r}))}s.resolution==="approved"?R.push({id:u,kind:"review-item",resolution:"approved",edit:null,reason:null,by:r}):s.resolution==="edited"?R.push({id:u,kind:"review-item",resolution:"edited",edit:{...s.edit},reason:null,by:r}):s.resolution==="rejected"?R.push({id:u,kind:"review-item",resolution:"rejected",edit:null,reason:s.reason??null,by:r}):s.resolution==="supersede"&&(R.push({id:u,kind:"review-item",resolution:"approved",edit:null,reason:s.reason??null,by:r}),j(i.temp_ref,s,u))}return l.length?{record:null,errors:l}:{record:P(d,{ts:new Date().toISOString(),proposal_id:n,...n!=null?{extraction_of:e.source.source_cid}:{},...n!=null&&p?{extractor_version:p}:{},nodes:v,edges:S,review:R,supersessions:x,...V.length>0?{names:V}:{},...f.judgements&&f.judgements.length>0?{judgements:f.judgements}:{},source_head_moves:{}},{expectPrev:E}).record,errors:null}}function ue(f){let{contextDir:d,graph:t,verdicts:e,by:n}=f,m=[],r=[],c=[],p=[],_=new Set;for(let[l,g]of e){if(g.resolution==="skipped")continue;let k=t.resolve(l);if(!k){m.push({code:"UNKNOWN_NODE",detail:`${l} names nothing in the graph`});continue}if(k.superseded){m.push({code:"SUPERSEDED_TARGET",detail:`${l} is superseded \u2014 review the tip (${k.tip})`});continue}let v=k.cid;if(g.resolution==="approved")c.push({id:v,kind:"review-item",resolution:"approved",edit:null,reason:null,by:n});else if(g.resolution==="rejected")c.push({id:v,kind:"review-item",resolution:"rejected",edit:null,reason:g.reason??null,by:n});else if(g.resolution==="edited"){let S=t.getNode(v);if(!S){m.push({code:"UNKNOWN_NODE",detail:`${l}: node file unreadable`});continue}let O={...S.content,...g.edit?.title!==void 0?{title:g.edit.title}:{},...g.edit?.summary!==void 0?{summary:g.edit.summary}:{},...g.edit?.risk!==void 0?{risk:g.edit.risk}:{}},R=L(S.label,O);if(R.length>0){for(let V of R)m.push({code:V.code,detail:`${l}: ${V.detail}`});continue}let x=U(S.label,O);if(x===v){c.push({id:v,kind:"review-item",resolution:"approved",edit:null,reason:null,by:n});continue}r.push({cid:x,label:S.label,content:O}),_.add(v),p.push({kind:"node",old:v,new:x,reason:g.reason??"edited in review",by:n}),c.push({id:x,kind:"review-item",resolution:"edited",edit:{...g.edit},reason:null,by:n})}else if(g.resolution==="supersede"){let S=z(t,g.supersedeTarget,v,_);if("error"in S){m.push({code:S.error.code,detail:`${l}: ${S.error.detail}`});continue}_.add(S.targetCid),p.push({kind:"node",old:S.targetCid,new:v,reason:g.reason??`superseded via review by ${n.id}`,by:n}),c.push({id:v,kind:"review-item",resolution:"approved",edit:null,reason:g.reason??null,by:n})}}return m.length?{record:null,errors:m}:c.length===0&&p.length===0?{record:null,errors:[{code:"NO_VERDICTS",detail:"every item was skipped \u2014 nothing to commit"}]}:{record:P(d,{ts:new Date().toISOString(),proposal_id:null,nodes:r,edges:[],review:c,supersessions:p,source_head_moves:{}},{expectPrev:t.latestHash}).record,errors:null}}function le(f){let{contextDir:d,graph:t,assignments:e,by:n}=f,m=[],r=[],c=new Set;for(let{ref:_,slug:E}of e){if(!G.test(E)){m.push({code:"BAD_SLUG",detail:`${JSON.stringify(E)} \u2014 slugs are kebab-case ${String(G)}`});continue}let l=t.resolve(_);if(!l){m.push({code:"UNKNOWN_REF",detail:`${_} names nothing in the graph`});continue}if(l.superseded){m.push({code:"SUPERSEDED_TARGET",detail:`${_} is superseded \u2014 name the tip instead (${l.tip})`});continue}let g=t.names.get(E);if(g!==void 0&&!t.superseded.has(g)&&g!==l.cid||c.has(E)){m.push({code:"SLUG_TAKEN",detail:`${E} already names ${g??"another node in this record"}`});continue}c.add(E),r.push({cid:l.cid,slug:E,by:n})}return m.length?{record:null,errors:m}:r.length===0?{record:null,errors:[{code:"NO_ASSIGNMENTS",detail:"nothing to name"}]}:{record:P(d,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:[],supersessions:[],names:r,source_head_moves:{}},{expectPrev:t.latestHash}).record,errors:null}}function pe(f){let{contextDir:d,graph:t,sourceId:e,reason:n,by:m}=f,r=t.heads.get(e);return r===void 0?{record:null,errors:[{code:"UNKNOWN_SOURCE",detail:`no source ${e} in the graph`}]}:r===null?{record:null,errors:[{code:"ALREADY_RETIRED",detail:`source ${e} is already retired`}]}:{record:P(d,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:[],supersessions:[{kind:"node",old:r,new:null,reason:n??`retired source ${e}`,by:m}],source_head_moves:{[e]:null},names:[]},{expectPrev:t.latestHash}).record,errors:null}}function Q(f,d){let t=f.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");if(t.length>60){let n=t.lastIndexOf("-",60);t=(n>0?t.slice(0,n):t.slice(0,60)).replace(/-+$/g,"")}if(!G.test(t))return null;let e=t;for(let n=2;d(e);n++)e=`${t}-${n}`;return G.test(e)?e:null}var Z={source:"src",usecase:"uc",scenario:"sc",ac:"ac",test:"t",gap:"gap",stylenote:"sty"};function J(f,d,t){let e=Z[f];return Q(e?`${e} ${d}`:d,t)}export{Z as a,J as b,X as c,de as d,ce as e,ae as f,ue as g,le as h,pe as i};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as m}from"./chunk-
|
|
2
|
+
import{a as m}from"./chunk-XUJ5EPVW.js";import{x as t}from"./chunk-HJGUEZLW.js";import{a as p}from"./chunk-HCBYKLMW.js";import{a,b as r,i as u}from"./chunk-C44QQJR4.js";import{a as b}from"./chunk-6YGTRKDT.js";import{e as n}from"./chunk-UR6MHSHU.js";var c=n(b(),1);var e=n(p(),1);function R({onSubmit:l}){let[o,f]=(0,c.useState)(0),s=(0,c.useRef)(!1);return u((x,i)=>{s.current||(i.leftArrow||i.rightArrow?f(d=>d===0?1:0):i.return?(s.current=!0,l(o===0?"positive":"negative")):i.escape&&(s.current=!0,l(null)))}),(0,e.jsxs)(a,{flexDirection:"column",marginTop:1,children:[(0,e.jsxs)(a,{children:[(0,e.jsx)(r,{color:t.secondary,children:"Rate this session: "}),(0,e.jsx)(r,{color:o===0?t.orange:t.dim,children:o===0?"[ \u{1F44D} ]":" \u{1F44D} "}),(0,e.jsx)(r,{children:" "}),(0,e.jsx)(r,{color:o===1?t.orange:t.dim,children:o===1?"[ \u{1F44E} ]":" \u{1F44E} "})]}),(0,e.jsx)(m,{bindings:[{keys:"\u2190/\u2192",label:"select"},{keys:"\u21B5",label:"submit"}],escBackLabel:"skip"})]})}export{R as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{x as n}from"./chunk-
|
|
2
|
+
import{x as n}from"./chunk-HJGUEZLW.js";import{a as s}from"./chunk-HCBYKLMW.js";import{a,b as i}from"./chunk-C44QQJR4.js";import{e as r}from"./chunk-UR6MHSHU.js";var o=r(s(),1);function g({bindings:c,suppressEscBack:p=!1,escBackLabel:m="back to chat"}){let e=c.map(t=>`${t.keys} ${t.label}`);return p||e.push(`esc \xB7 ${m}`),(0,o.jsx)(a,{marginTop:1,children:(0,o.jsx)(i,{color:n.dim,children:e.join(" \xB7 ")})})}export{g as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c as sn}from"./chunk-
|
|
2
|
+
import{c as sn}from"./chunk-IJPFAWBH.js";import{c as Tt,d as Qr}from"./chunk-PYB2EXRE.js";import{d as Wr}from"./chunk-2YQ6TW77.js";import{a as Lt,b as Zr,c as et,d as tt,e as Xr,f as Dt,g as rn,h as nn}from"./chunk-RHNKYNNZ.js";import{a as Te,b as ne,e as _e,f as xt,k as Yr,p as he,q as Pt,t as Jr}from"./chunk-RKWJG3WW.js";import{b as Se}from"./chunk-I2JUBAPU.js";import{a as Ze,b as At}from"./chunk-ADOXYGZE.js";import{a as Or,b as Et}from"./chunk-E3BO7OVR.js";import{a as Le,b as en}from"./chunk-C5UNZ6ZY.js";import{c as tn}from"./chunk-S3DAAAE5.js";import{a as we}from"./chunk-WAOCHXJ5.js";import{B as jr,C as Fr,D as Nr,F as $r,G as Mr,I as Vr,J as Kr,K as Hr,X as qr,aa as Gr,ba as zr,j as Xe,x as Ur}from"./chunk-QNNBNIR7.js";import{a as Br}from"./chunk-BC7UVJJB.js";import{a as xr,c as kt,d as Ct,e as Qe,f as Pr,g as Tr}from"./chunk-M5JQXOCE.js";import{g as Lr,h as Dr}from"./chunk-64QURIT6.js";import{a as Je}from"./chunk-2WVKOZ6W.js";import{a as We,b as Ar}from"./chunk-NLCCBXXV.js";import{a as M}from"./chunk-RZ4F3BHX.js";import{a as re}from"./chunk-DNOBOZPO.js";import{a as Cr}from"./chunk-E47GFYXA.js";import{a as ze,c as _t,i as Er,j as Ye,k as It,l as Rt}from"./chunk-HJGUEZLW.js";import{join as le,basename as as}from"path";import{existsSync as Ro,readFileSync as cs}from"fs";function on(e,t){if(process.env.KANE_REPLAY_TRACE==="1")for(let r=0;r<e.steps.length;r++){let n=e.steps[r],s=t[r],o=" ".repeat(n.trace.length-1),i=`step ${n.flatIndex}`;s.kind==="replay"?process.stderr.write(`[replay-trace] ${o}${i}: REPLAY (would skip; v1 always authors)
|
|
3
3
|
`):process.stderr.write(`[replay-trace] ${o}${i}: AUTHOR (${s.reason})
|
|
4
4
|
`)}}function Ie(e){process.env.KANE_REPLAY_TRACE==="1"&&process.stderr.write(e)}function an(e,t){let r=e===0?"(none)":`0..${e-1}`,n=e>=t?"(none)":`${e}..${t-1}`;Ie(`[replay-trace] phase: replay ${r}, author ${n}
|
|
5
5
|
`)}function ln(e,t){Ie(`[replay-trace] step ${e}: REPLAY ${t==="ok"?"OK":"FAILED"}
|
|
@@ -44,7 +44,7 @@ import{c as sn}from"./chunk-GIGD4M7V.js";import{c as Tt,d as Qr}from"./chunk-C5P
|
|
|
44
44
|
`);else if(_r&&(_||m.isFirstRun))process.stderr.write(`note: --no-evidence-publish has no effect on author/commit runs
|
|
45
45
|
`);else if(Ir){let d=c.basicAuth,u=L,g=F,b=await ss({controller:new we(A.controllerBaseUrl,{username:d.username,accessKey:d.access_key}),tms:new Je(A.tmsBaseUrl,c.resolvedCreds?.username??d.username,c.resolvedCreds?.access_key??d.access_key),testId:m.testId,sessionId:l.sessionId,executionId:u.executionId,sealedPackPath:Z.pack,projectId:g});b.ok?l.log("info","EVIDENCE_INGESTED","Replay evidence uploaded and ingested",{execution_id:u.executionId,project_id:g}):(l.log("warn","EVIDENCE_PUBLISH_FAILED","Replay evidence publish failed",{execution_id:u.executionId,stage:b.stage,error:b.error}),process.stderr.write(` \u26A0 evidence publish failed (${b.stage}): ${b.error}
|
|
46
46
|
`)),t.onAgentEvent({type:"test_md_evidence_ingest",status:b.ok?"ok":"failed",evidence_id:u.executionId,...b.ok?{}:{stage:b.stage}})}await Lo(n,m,l,z.outcomes,z.overallStatus,Ve,ge,oe.uploadResult,j,o,{resolvedAuth:c,tmsBaseUrl:A.tmsBaseUrl},_,J);try{let d=he(n);if(Qr({shouldUploadPipeline:He,uploadSucceeded:!!oe.uploadResult?.success,metaCommitId:d?.commit_id,metaTestId:d?.test_id})){let u=await Tt({sourcePath:n,testId:d.test_id,sessionId:l.sessionId,commitId:d.commit_id,controller:new we(A.controllerBaseUrl,{username:c.basicAuth.username,accessKey:c.basicAuth.access_key})});u.ok?l.log("info","BUNDLE_SYNC_OK","testmd bundle pushed",{commit_id:d.commit_id,bytes:u.bytes}):(l.log("warn","BUNDLE_SYNC_FAILED","testmd bundle sync failed",{commit_id:d.commit_id,stage:u.stage,error:u.error}),process.stderr.write(` \u26A0 bundle sync failed (${u.stage}): ${u.error}
|
|
47
|
-
`)),t.onAgentEvent({type:"test_md_bundle_sync",status:u.ok?"ok":"failed",commit_id:d.commit_id,path:n,...u.ok?{bytes:u.bytes}:{stage:u.stage}})}}catch(d){l.log("warn","BUNDLE_SYNC_FAILED","testmd bundle sync threw",{error:d instanceof Error?d.message:String(d)})}if(He&&oe.uploadResult?.success)for(let d of m.unitLocks)try{let u=he(d.file);if(u?.commit_id!==l.sessionId||!u?.test_id)continue;let g=await Tt({sourcePath:d.file,testId:String(u.test_id),sessionId:l.sessionId,commitId:String(u.commit_id),controller:new we(A.controllerBaseUrl,{username:c.basicAuth.username,accessKey:c.basicAuth.access_key})});g.ok?l.log("info","BUNDLE_SYNC_OK","unit bundle pushed",{commit_id:u.commit_id,path:d.file,bytes:g.bytes}):l.log("warn","BUNDLE_SYNC_FAILED","unit bundle sync failed",{commit_id:u.commit_id,path:d.file,stage:g.stage,error:g.error}),t.onAgentEvent({type:"test_md_bundle_sync",status:g.ok?"ok":"failed",commit_id:u.commit_id,path:d.file,...g.ok?{bytes:g.bytes}:{stage:g.stage}})}catch(u){l.log("warn","BUNDLE_SYNC_FAILED","unit bundle sync threw",{path:d.file,error:u instanceof Error?u.message:String(u)})}let Rr=re(w),qe=oe.uploadResult?.testcaseId,Ge=qe&&oe.uploadResult?.shareId&&F?ot(Rr.testManagerUiUrl,F,qe,oe.uploadResult.shareId):void 0,Ss=a.unitFiles.filter(d=>d.file!==a.rootPath).map(d=>{let u=a.steps.filter(p=>p.owningFile===d.file),g=u.filter(p=>ce.has(p.flatIndex)).length,h=(d.kind==="test"?he(d.file):null)?.commit_id===l.sessionId;return{path:d.file,kind:d.kind,replayed:u.length-g,authored:g,committed:h,...h?{commit_id:l.sessionId}:{}}}),kr={overallStatus:z.overallStatus,durationS:ge,decisions:m.decisions,outcomes:z.outcomes,cancelled:J,retryTriggered:X,lockHeld:_,anyAuthorStepRan:D,isFirstRun:m.isFirstRun,wantsPush:o.push===!0,uploadResult:oe.uploadResult,shouldUploadArtifacts:ve,shouldReplaceLocalOutput:D&&!J,shouldCommit:(_||m.isFirstRun)&&!J&&z.overallStatus==="passed"&&!m.degradedReadonly,shareUrl:Ge,imports:Ss},{buildSummaryEvent:ws}=await import("./SummaryBox-
|
|
47
|
+
`)),t.onAgentEvent({type:"test_md_bundle_sync",status:u.ok?"ok":"failed",commit_id:d.commit_id,path:n,...u.ok?{bytes:u.bytes}:{stage:u.stage}})}}catch(d){l.log("warn","BUNDLE_SYNC_FAILED","testmd bundle sync threw",{error:d instanceof Error?d.message:String(d)})}if(He&&oe.uploadResult?.success)for(let d of m.unitLocks)try{let u=he(d.file);if(u?.commit_id!==l.sessionId||!u?.test_id)continue;let g=await Tt({sourcePath:d.file,testId:String(u.test_id),sessionId:l.sessionId,commitId:String(u.commit_id),controller:new we(A.controllerBaseUrl,{username:c.basicAuth.username,accessKey:c.basicAuth.access_key})});g.ok?l.log("info","BUNDLE_SYNC_OK","unit bundle pushed",{commit_id:u.commit_id,path:d.file,bytes:g.bytes}):l.log("warn","BUNDLE_SYNC_FAILED","unit bundle sync failed",{commit_id:u.commit_id,path:d.file,stage:g.stage,error:g.error}),t.onAgentEvent({type:"test_md_bundle_sync",status:g.ok?"ok":"failed",commit_id:u.commit_id,path:d.file,...g.ok?{bytes:g.bytes}:{stage:g.stage}})}catch(u){l.log("warn","BUNDLE_SYNC_FAILED","unit bundle sync threw",{path:d.file,error:u instanceof Error?u.message:String(u)})}let Rr=re(w),qe=oe.uploadResult?.testcaseId,Ge=qe&&oe.uploadResult?.shareId&&F?ot(Rr.testManagerUiUrl,F,qe,oe.uploadResult.shareId):void 0,Ss=a.unitFiles.filter(d=>d.file!==a.rootPath).map(d=>{let u=a.steps.filter(p=>p.owningFile===d.file),g=u.filter(p=>ce.has(p.flatIndex)).length,h=(d.kind==="test"?he(d.file):null)?.commit_id===l.sessionId;return{path:d.file,kind:d.kind,replayed:u.length-g,authored:g,committed:h,...h?{commit_id:l.sessionId}:{}}}),kr={overallStatus:z.overallStatus,durationS:ge,decisions:m.decisions,outcomes:z.outcomes,cancelled:J,retryTriggered:X,lockHeld:_,anyAuthorStepRan:D,isFirstRun:m.isFirstRun,wantsPush:o.push===!0,uploadResult:oe.uploadResult,shouldUploadArtifacts:ve,shouldReplaceLocalOutput:D&&!J,shouldCommit:(_||m.isFirstRun)&&!J&&z.overallStatus==="passed"&&!m.degradedReadonly,shareUrl:Ge,imports:Ss},{buildSummaryEvent:ws}=await import("./SummaryBox-ABB7ST26.js");if(i?t.onAgentEvent(ws(kr)):await t.onSummary(kr),!i){let d=qe&&F?Ln(Rr.testManagerUiUrl,F,qe):void 0;await t.onLinks({recordedTestPath:n,outputDir:ne(n),shareableLink:Ge,testCaseLink:d,codeExportDir:oe.uploadResult?.codeExportDir})}if(ae.ownsLifecycle&&Z&&wr){let{offerEvidenceView:d}=await import("./evidence-UPOFW3XC.js");await d({packPath:Z.pack,env:w,isTTY:!i&&!J&&!!process.stdin.isTTY&&!!process.stderr.isTTY,log:u=>process.stderr.write(u+`
|
|
48
48
|
`)})}return t.onAgentEvent({type:"test_md_done",overall_status:z.overallStatus,duration_s:ge,session_id:l.sessionId,...Ge?{share_url:Ge}:{}}),{overallStatus:z.overallStatus,exitCode:z.overallStatus==="passed"?0:1,outputDir:ne(n),durationS:ge,uploadResult:oe.uploadResult,anyAuthorStepRan:D,resultCode:Ur(Ke),...St.length?{pendingInvestigations:St}:{}}}function Ao(e,t){let r={...e,...t},n=Object.keys(r).length>0?Se(r,""):{variables:{},objective:"",keyMap:{}};return{raw:r,auteur:n.variables,auteurObjective:"",secretEntries:Object.entries(r).filter(([,s])=>s.secret),nonSecretEntries:Object.entries(r).filter(([,s])=>!s.secret)}}function Ce(e,t,r){let n={...e,...t??{}};if(Object.keys(n).length===0)return{raw:n,variables:{},objective:r};let s=Se(n,r);return{raw:n,variables:qn(s.variables,s.objective),objective:s.objective}}function xo(e,t,r){let n=Ce(e,t,r).variables;return Object.keys(n).length>0?n:void 0}function ls(e,t){let r=new Set(dt),n={...e};for(let[s,o]of Object.entries(t))r.has(s)||s!=="variables"&&o!==void 0&&e[s]===void 0&&(n[s]=o);return n}function Po(e,t){return e.length<=t?e:e.slice(0,t-1)+"\u2026"}async function To(e,t,r,n,s,o){let i=Zr(t);on(t,i);let f=_e(e),a=Ro(f)?JSON.parse(cs(f,"utf8")):null,c=a?.testcase_id,y=a?.test_id,w=a?.commit_id,A=r.push===!0,R=r.retry===!0||r.retryCount!==void 0,x=r.author===!0;A&&!c&&process.stderr.write(`[--push] no meta.json yet \u2014 flag is a no-op on first run
|
|
49
49
|
`),x&&(c=void 0,y=void 0,w=void 0);let k=n.resolvedAuth.basicAuth;if(!k){let N=await n.resolvedAuth.resolver.resolve(!0);N?.username&&N?.access_key&&(k={username:N.username,access_key:N.access_key},n.resolvedAuth.basicAuth=k)}let C=!!k,l=!r.local&&C&&y!=null&&w!=null&&c!=null,H=l&&(et(i)||A);if(A&&!l)return process.stderr.write(`error: --push requires authenticated credentials for the lock API. Run 'kane-cli login' (OAuth) or pass --username/--access-key inline.
|
|
50
50
|
`),{resolved:t,decisions:i,testId:y,testcaseId:c,fromCommitId:w,newCommitId:null,isFirstRun:!1,hasAuth:C,canLock:l,lockAcquired:!1,unitLocks:[],degradedReadonly:!1,abort:{exitCode:2}};if(R&&!l)return process.stderr.write(`error: --retry requires authenticated credentials for the lock API. Run 'kane-cli login' (OAuth) or pass --username/--access-key inline.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as $}from"./chunk-YCCUBQY4.js";import{a as U}from"./chunk-
|
|
2
|
+
import{a as $}from"./chunk-YCCUBQY4.js";import{a as U}from"./chunk-PICCLJSO.js";import{a as T}from"./chunk-2WVKOZ6W.js";import{a as k}from"./chunk-DNOBOZPO.js";import{a as _}from"./chunk-XUJ5EPVW.js";import{x as i}from"./chunk-HJGUEZLW.js";import{a as O}from"./chunk-HCBYKLMW.js";import{a as u,b as s}from"./chunk-C44QQJR4.js";import{a as K}from"./chunk-6YGTRKDT.js";import{e as S}from"./chunk-UR6MHSHU.js";var e=S(K(),1);var r=S(O(),1);function V(n,x,c){return{id:n,label:`${x} (${n})`,isActive:n===c}}function se({resolver:n,currentProjectId:x,env:c,onSelect:w,onCancel:C}){let[q,B]=(0,e.useState)([]),[D,l]=(0,e.useState)(!0),[H,m]=(0,e.useState)(!1),[J,g]=(0,e.useState)(!1),[Q,P]=(0,e.useState)(null),[d,p]=(0,e.useState)("list"),[v,R]=(0,e.useState)(""),[E,h]=(0,e.useState)(null),[I,X]=(0,e.useState)(""),b=(0,e.useRef)(!1),A=(0,e.useRef)(!0);(0,e.useEffect)(()=>{if(!n){P("Login first to browse projects"),l(!1);return}let o=new AbortController,a=I.trim();return A.current?l(!0):a&&g(!0),m(!0),P(null),(async()=>{try{let t=n.cached??await n.resolve();if(!t){P("Login first to browse projects"),l(!1),m(!1),g(!1);return}let L=k(c),F=new T(L.tmsBaseUrl,t.username,t.access_key),f=!0,N=0,G=a?{signal:o.signal,name:a,perPage:10}:{signal:o.signal,perPage:10};for await(let y of F.listProjectsStream(G)){if(f&&(l(!1),g(!1),A.current=!1,f=!1),y.totalLoaded===0&&y.done&&N===0&&!a){b.current=!0,p("naming"),m(!1);return}let M=y.projects.map(j=>V(j.project_id,j.name,x));B(N===0?M:j=>[...j,...M]),N+=y.projects.length,y.done&&m(!1)}f&&(l(!1),m(!1),g(!1))}catch(t){if(t?.name==="AbortError")return;P(t instanceof Error?t.message:String(t)),l(!1),m(!1),g(!1)}})(),()=>o.abort()},[n,x,c,I]);let Y=(0,e.useCallback)(o=>{let a=o.trim();if(!a){h("Name cannot be empty");return}h(null),p("creating"),(async()=>{try{if(!n)throw new Error("Not authenticated");let t=n.cached??await n.resolve();if(!t)throw new Error("Not authenticated");let L=k(c),f=await new T(L.tmsBaseUrl,t.username,t.access_key).createProject(a);w(f.id,f.name)}catch(t){h(t instanceof Error?t.message:String(t)),p("naming")}})()},[n,c,w]),z=(0,e.useCallback)(()=>{R(""),h(null),b.current?C():p("list")},[C]);return d==="naming"||d==="creating"?(0,r.jsxs)(u,{flexDirection:"column",borderStyle:"round",borderColor:i.orange,paddingX:2,paddingY:1,children:[(0,r.jsx)(s,{color:i.orange,bold:!0,children:"Create new project"}),b.current&&(0,r.jsx)(u,{marginTop:1,children:(0,r.jsx)(s,{color:i.dim,children:"No projects yet \u2014 let's create one."})}),(0,r.jsxs)(u,{marginTop:1,children:[(0,r.jsx)(s,{color:i.dim,children:"Name: "}),d==="naming"?(0,r.jsx)($,{value:v,onChange:o=>{R(o),E&&h(null)},onSubmit:Y,onCancel:z}):(0,r.jsx)(s,{children:v})]}),E&&(0,r.jsx)(u,{marginTop:1,children:(0,r.jsx)(s,{color:i.red,children:E})}),d==="creating"&&(0,r.jsx)(u,{marginTop:1,children:(0,r.jsx)(s,{color:i.dim,children:"Creating..."})}),d==="naming"&&(0,r.jsx)(_,{bindings:[{keys:"\u21B5",label:"create"}],escBackLabel:b.current?"cancel":"back"})]}):(0,r.jsx)(U,{title:"Projects",items:q,loading:D,loadingMore:H,searching:J,preserveSelectionById:!0,onSearch:X,error:Q,itemNoun:"projects",onTab:()=>{b.current=!1,p("naming")},extraHint:"tab to create new",onSelect:o=>{let a=o.label.replace(` (${o.id})`,"");w(o.id,a)},onCancel:C})}export{V as a,se as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as g}from"./chunk-
|
|
2
|
+
import{a as g}from"./chunk-5YPBPZUR.js";import{createHash as E}from"crypto";function w(e){if(e===null)return"null";let r=typeof e;if(r==="string")return JSON.stringify(e.normalize("NFC"));if(r==="boolean")return e?"true":"false";if(r==="number"){if(!Number.isFinite(e))throw new Error("non-finite number is not canonicalizable");return JSON.stringify(e)}if(Array.isArray(e))return"["+e.map(n=>n===void 0?"null":w(n)).join(",")+"]";if(r==="object"){let n=e,s=new Map;for(let t of Object.keys(n)){if(n[t]===void 0)continue;let c=t.normalize("NFC");if(s.has(c))throw new Error(`canonicalization collision: NFC-equivalent duplicate key ${JSON.stringify(c)}`);s.set(c,n[t])}return"{"+[...s.keys()].sort((t,c)=>Buffer.compare(Buffer.from(t,"utf8"),Buffer.from(c,"utf8"))).map(t=>JSON.stringify(t)+":"+w(s.get(t))).join(",")+"}"}throw new Error("unsupported type for canonicalization: "+r)}function k(e){return E("sha256").update(e).digest("hex")}import{closeSync as $,existsSync as O,fsyncSync as x,mkdirSync as b,openSync as S,readFileSync as R,readdirSync as j,renameSync as F,rmSync as J,writeFileSync as _}from"fs";import{join as f}from"path";var a=class extends Error{};function v(e,r){if(e.schema_version!==void 0&&e.schema_version!==g)throw new a(`record ${r} is stamped ${e.schema_version}, this build reads ${g} \u2014 migrate explicitly`);if(e.parents!==void 0&&!(e.prev_hash===null?e.parents.length===0:e.parents.length===1&&e.parents[0]===e.prev_hash))throw new a(`record ${r}: parents does not mirror prev_hash \u2014 multi-parent records need a DAG-aware reader`)}function z(e){b(e,{recursive:!0});let r=f(e,".lock"),n=Date.now()+2e3;for(;;)try{let s=S(r,"wx");return _(s,`${process.pid}
|
|
3
3
|
`),$(s),()=>{try{J(r)}catch{}}}catch(s){if(s.code!=="EEXIST")throw s;if(Date.now()>n)throw new a(`.context is locked by another process \u2014 remove ${r} if that process is gone`);Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,25)}}var A=/^\d{6}-[0-9a-f]{12}\.json$/,p=e=>f(e,"commits");function y(e){return"sha256:"+k(Buffer.from(w(e),"utf8"))}function q(e){let r=p(e);return O(r)?j(r).filter(n=>A.test(n)).sort():[]}function T(e){let r=q(e),n=[],s=[],i=null;return r.forEach((t,c)=>{let d=R(f(p(e),t),"utf8"),o;try{o=JSON.parse(d)}catch(l){throw new a(`corrupt commit record ${t}: ${String(l)}`)}if(o.seq!==c+1)throw new a(`sequence gap: expected seq ${c+1}, ${t} has ${o.seq}`);if(o.prev_hash!==i)throw new a(`broken chain at ${t}: prev_hash ${String(o.prev_hash)} != ${String(i)}`);v(o,t);let m=y(o),h=t.slice(7,19);if(!m.slice(7).startsWith(h))throw new a(`tampered record ${t}: content hash ${m} does not match filename`);n.push(o),s.push(m),i=m}),{records:n,hashes:s}}function N(e){let r=q(e);if(r.length===0)return null;let n=r[r.length-1],s=R(f(p(e),n),"utf8"),i;try{i=JSON.parse(s)}catch(c){throw new a(`corrupt tail record ${n}: ${String(c)}`)}v(i,n);let t=y(i);if(!t.slice(7).startsWith(n.slice(7,19)))throw new a(`tampered tail record ${n}: content hash ${t} does not match filename`);if(i.seq!==r.length)throw new a(`sequence gap at tail: ${r.length} record files but tail seq is ${i.seq}`);return{seq:i.seq,hash:t}}function G(e){return N(e)?.hash??null}function V(e,r,n){let s=q(e);if(s.length<r)throw new a(`derived state is ahead of the record log (applied seq ${r}, ${s.length} records) \u2014 run kane-cli context rebuild`);let i=[],t=[],c=n;for(let d=r;d<s.length;d++){let o=s[d],m=R(f(p(e),o),"utf8"),h;try{h=JSON.parse(m)}catch(u){throw new a(`corrupt commit record ${o}: ${String(u)}`)}if(h.seq!==d+1)throw new a(`sequence gap: expected seq ${d+1}, ${o} has ${h.seq}`);if(h.prev_hash!==c)throw new a(`broken chain at ${o}: prev_hash ${String(h.prev_hash)} != ${String(c)}`);v(h,o);let l=y(h);if(!l.slice(7).startsWith(o.slice(7,19)))throw new a(`tampered record ${o}: content hash ${l} does not match filename`);i.push(h),t.push(l),c=l}return{records:i,hashes:t}}function X(e,r,n={}){let s=z(e);try{return B(e,r,n)}finally{s()}}function B(e,r,n){let s=N(e),i=(s?.seq??0)+1,t=s?.hash??null;if(n.expectPrev!==void 0&&n.expectPrev!==t)throw new a(`concurrent append detected: validated against ${String(n.expectPrev)} but the chain head is ${String(t)} \u2014 re-open and retry`);let c={seq:i,prev_hash:t,...r,schema_version:g,parents:t===null?[]:[t]},d=y(c),o=p(e);b(o,{recursive:!0});let m=`${String(i).padStart(6,"0")}-${d.slice(7,19)}.json`,h=f(o,m),l=h+".tmp",u=S(l,"w");try{_(u,JSON.stringify(c)+`
|
|
4
4
|
`),x(u)}finally{$(u)}F(l,h);try{let C=S(o,"r");x(C),$(C)}catch{}return{seq:i,hash:d,file:h,record:c}}export{w as a,k as b,a as c,T as d,G as e,V as f,X as g};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as S}from"./chunk-
|
|
2
|
+
import{a as S}from"./chunk-POI6DCP6.js";import{x as o}from"./chunk-HJGUEZLW.js";import{a as R}from"./chunk-HCBYKLMW.js";import{a as y,b as c,j as x}from"./chunk-C44QQJR4.js";import{a as w}from"./chunk-6YGTRKDT.js";import{e as b}from"./chunk-UR6MHSHU.js";var k=b(w(),1);var i=b(R(),1);function A(e){let t=e.decisions.filter(r=>r.kind==="replay").length,l=e.decisions.filter(r=>r.kind==="author").length,p=e.outcomes.filter(r=>r.status==="passed").length,d=e.outcomes.filter(r=>r.status==="failed").length,f=e.outcomes.filter(r=>r.status==="skipped").length,a=o.green,n;e.cancelled||e.overallStatus==="interrupted"?(a=o.orange,n="CANCELLED"):e.overallStatus==="failed"?(a=o.red,n="FAILED"):n="PASSED";let s=`${n} \xB7 ${e.durationS}s \xB7 ${e.outcomes.length} steps (${p} passed, ${d} failed, ${f} skipped)`,T=`${t} replay \xB7 ${l} author`,C=e.retryTriggered,_="yes \u2014 run recovered after a replay miss",u,h=o.dim;if(e.cancelled)u="\u2013 not committed (cancellation)";else if(e.overallStatus==="failed")u="\u2013 not committed (run failed)",h=o.red;else if(!e.shouldCommit)e.isFirstRun?u="\u2013 not committed (first run skipped commit)":e.lockHeld?u="\u2013 not committed":u="\u2013 not committed (readonly fallback / no lock)";else{let r=e.uploadResult?.testcaseId;u=r?`\u2713 pushed (testcase=${r})`:"\u2713 pushed",h=o.green}let v=e.shouldReplaceLocalOutput?"output dir replaced":e.anyAuthorStepRan?"untouched (cancellation or no replace)":"untouched (replay-only)",m,g=o.dim;return e.shouldUploadArtifacts?e.uploadResult?.success?(m="\u2713 TMS",g=o.green):e.uploadResult?(m=`\u2717 failed${e.uploadResult.error?`: ${e.uploadResult.error}`:""}`,g=o.red):m="\u2013 not run":m="\u2013 skipped (--local or no auth)",{resultLine:{color:a,text:s},breakdown:T,showRetries:C,retriesText:_,commitText:u,commitColor:h,artifactsText:v,uploadText:m,uploadColor:g}}function O(e){let t=e.decisions.filter(s=>s.kind==="replay").length,l=e.decisions.filter(s=>s.kind==="author").length,p=e.outcomes.filter(s=>s.status==="passed").length,d=e.outcomes.filter(s=>s.status==="failed").length,f=e.outcomes.filter(s=>s.status==="skipped").length,a,n=!1;return e.cancelled?a="cancellation":e.overallStatus==="failed"?a="run_failed":e.shouldCommit&&e.uploadResult?.testcaseId?(a="ok",n=!0):!e.shouldCommit&&!e.lockHeld&&!e.isFirstRun?a="readonly_fallback":a="not_committed",{type:"test_md_summary",overall_status:e.overallStatus,duration_s:e.durationS,steps:{total:e.outcomes.length,passed:p,failed:d,skipped:f,replay_decisions:t,author_decisions:l},retries:{triggered:e.retryTriggered},commit:{committed:n,reason:a,...e.uploadResult?.testcaseId?{testcase_id:e.uploadResult.testcaseId}:{}},artifacts:{replaced:e.shouldReplaceLocalOutput},upload:{performed:e.shouldUploadArtifacts,...e.uploadResult?{succeeded:!!e.uploadResult.success}:{}},...e.shareUrl?{share_url:e.shareUrl}:{},cancelled:e.cancelled,...e.imports&&e.imports.length>0?{imports:e.imports}:{}}}function D({data:e}){let t=A(e),l=[{label:"result",value:(0,i.jsx)(c,{color:t.resultLine.color,bold:!0,children:t.resultLine.text})},{label:"breakdown",value:(0,i.jsx)(c,{color:o.dim,children:t.breakdown})}];return t.showRetries&&l.push({label:"retries",value:(0,i.jsx)(c,{color:o.orange,children:t.retriesText})}),l.push({label:"commit",value:(0,i.jsx)(c,{color:t.commitColor,children:t.commitText})}),l.push({label:"artifacts",value:(0,i.jsx)(c,{color:o.dim,children:t.artifactsText})}),l.push({label:"upload",value:(0,i.jsx)(c,{color:t.uploadColor,children:t.uploadText})}),(0,i.jsx)(S,{title:"Run summary",titleColor:"#ff9500",rows:l})}function I({data:e}){let{exit:t}=x();return(0,k.useEffect)(()=>{let l=setTimeout(()=>t(),50);return()=>clearTimeout(l)},[t]),(0,i.jsx)(y,{flexDirection:"column",children:(0,i.jsx)(D,{data:e})})}export{A as a,O as b,D as c,I as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as t,b as i}from"./chunk-
|
|
2
|
+
import{a as t,b as i}from"./chunk-ZG2V2ODK.js";import{i as s,j as e}from"./chunk-5YPBPZUR.js";function a(r,n){return"sha256:"+i(Buffer.from("assurance."+r+"\0"+t(s(r,n)),"utf8"))}function f(r,n,o,u){return"sha256:"+i(Buffer.from("assurance.edge\0"+t({type:r,src:n,dst:o,props:e(r,u)}),"utf8"))}function d(r,n){return{source_id:r,blob:n}}function p(r){return{...r,derived:!0}}export{a,f as b,d as c,p as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a}from"./chunk-
|
|
2
|
+
import{a}from"./chunk-DNOBOZPO.js";import"./chunk-HJGUEZLW.js";import"./chunk-UR6MHSHU.js";export{a as getEnvironment};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as x}from"./chunk-
|
|
2
|
+
import{a as x}from"./chunk-GBBVP2JW.js";import{a as d,b as $,d as w}from"./chunk-GRB66C5S.js";import"./chunk-RN4OSVTG.js";import{e as b,f as k}from"./chunk-CJJXT5DO.js";import"./chunk-BC7UVJJB.js";import{e as v}from"./chunk-EHN5HTUD.js";import{a as h}from"./chunk-L5LI2JF4.js";import{a as y}from"./chunk-MCQXRJGH.js";import"./chunk-74RUSHIB.js";import"./chunk-ZZLR3O5A.js";import"./chunk-ZG2V2ODK.js";import"./chunk-5YPBPZUR.js";import"./chunk-UR6MHSHU.js";import{basename as f}from"path";import{statSync as R}from"fs";function S(s,e){if(!s)return 1;let r=s.resolve(e);return!r||r.superseded?1:s.getNode(r.tip)?.content.risk==="high"?3:1}function C(s,e){return s.usecases.map(r=>{let n=r.acceptance_criteria??[],a=n.filter(o=>(o.covered_by??[]).length>0),u=n.filter(o=>o.execution==="passed"),c=n.filter(o=>o.execution==="failed"),p=n.filter(o=>o.execution==="blocked"),i=0,l=0;for(let o of n){let g=S(e,o.id);i+=g,o.execution==="passed"&&(l+=g)}let t=i===0?0:Math.round(100*l/i),m=a.length===0?"uncovered":n.length===u.length?"covered":p.length>0&&c.length===0?"blocked":"partial";return{id:r.id,title:r.title,status:m,pct:t,acs:{total:n.length,covered:a.length,passed:u.length,failed:c.length,blocked:p.length},stale:n.filter(o=>o.fresh==="stale").map(o=>o.id)}})}async function A(s){let e=await b(s);return e.length===0?null:e.map(r=>({p:r,m:R(r).mtimeMs})).sort((r,n)=>n.m-r.m)[0].p}var D={covered:"\u2714",partial:"\u25D0",uncovered:"\u2716",blocked:"\u23F8"};function G(s){let e=Math.round(s/10);return"\u2588".repeat(e)+"\u2591".repeat(10-e)}async function E(s,e=w(),r=process.cwd()){let n=$(r,e);if(!n)return 2;let a=s.from?await k(s.from,r):await A(r);if(!a)return d(e,s.from?`no evidence pack at '${s.from}'`:"no evidence pack in .testmuai/evidence \u2014 run a test first, or pass --from <pack>"),2;let u=await v(a,"coverage/usecases.yaml");if(u==null)return d(e,`${f(a)} carries no coverage/usecases.yaml \u2014 the pack predates coverage or its project had no .context at seal time`),2;let c=h(u);if(!c||!Array.isArray(c.usecases))return d(e,`${f(a)}: coverage/usecases.yaml is not a usecases document`),2;let p=y(n),i=C(c,p),l=await x(p,"design");if(s.json)return e.out(JSON.stringify({pack:a,depth:i,completeness:l},null,2)),0;e.out(`coverage \u2014 ${f(a)}`),e.out(""),e.out("depth (proven by the pack):");for(let t of i){let m=t.stale.length?` \xB7 ${t.stale.length} stale`:"";e.out(` ${D[t.status]} ${G(t.pct)} ${String(t.pct).padStart(3)}% ${t.id} \u2014 ${t.status} (${t.acs.passed}/${t.acs.total} ACs proven${t.acs.failed?`, ${t.acs.failed} failed`:""}${t.acs.blocked?`, ${t.acs.blocked} blocked`:""})${m}`)}e.out(""),e.out("completeness (live graph):"),l.length===0&&e.out(" no design gaps \u2014 every AC verified, every use-case scenarioed");for(let t of l)e.out(` [${t.risk}] ${t.tag} ${t.ref} \u2014 ${t.why}`),e.out(` \u2192 ${t.ready_command}`);return 0}export{E as coverCommand,C as depthRows};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a}from"./chunk-
|
|
2
|
+
import{a}from"./chunk-BOO7YXAV.js";import"./chunk-HJGUEZLW.js";import"./chunk-UR6MHSHU.js";export{a as CredentialsManager};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
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-
|
|
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-QNNBNIR7.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-FJTWJ243.js";import"./chunk-BC7UVJJB.js";import"./chunk-2PQXEEVY.js";import{a as k,b as l,c as m}from"./chunk-EHN5HTUD.js";import"./chunk-L5LI2JF4.js";import"./chunk-MCQXRJGH.js";import"./chunk-74RUSHIB.js";import"./chunk-ZZLR3O5A.js";import"./chunk-ZG2V2ODK.js";import"./chunk-5YPBPZUR.js";import"./chunk-DNOBOZPO.js";import"./chunk-HJGUEZLW.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-ANIVHX3P.js";import"./chunk-3C5GMAM4.js";import"./chunk-GRB66C5S.js";import"./chunk-JFAFKHDX.js";import"./chunk-QPZRHAYK.js";import"./chunk-RN4OSVTG.js";import"./chunk-BC7UVJJB.js";import"./chunk-2PQXEEVY.js";import"./chunk-MCQXRJGH.js";import"./chunk-74RUSHIB.js";import"./chunk-ZZLR3O5A.js";import"./chunk-ZG2V2ODK.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,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as E}from"./chunk-KHU7C6EE.js";import{a as x}from"./chunk-
|
|
2
|
+
import{b as E}from"./chunk-KHU7C6EE.js";import{a as x}from"./chunk-GYW7LVVL.js";import{a as k}from"./chunk-BC7UVJJB.js";import"./chunk-L5LI2JF4.js";import{a as h}from"./chunk-MCQXRJGH.js";import"./chunk-74RUSHIB.js";import"./chunk-ZZLR3O5A.js";import"./chunk-ZG2V2ODK.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};
|
|
@@ -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-GRB66C5S.js";import{a as i}from"./chunk-GYW7LVVL.js";import"./chunk-RN4OSVTG.js";import"./chunk-BC7UVJJB.js";import{a as n}from"./chunk-MCQXRJGH.js";import"./chunk-74RUSHIB.js";import"./chunk-ZZLR3O5A.js";import"./chunk-ZG2V2ODK.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,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as D,e as h}from"./chunk-
|
|
2
|
+
import{d as D,e as h}from"./chunk-ACEODVSC.js";import"./chunk-K5JGCJ2K.js";import"./chunk-DXK55KGR.js";import"./chunk-FXPPQL4D.js";import"./chunk-RE3BZVGE.js";import"./chunk-6PS65QFF.js";import"./chunk-JFAFKHDX.js";import"./chunk-WIA7TPK3.js";import"./chunk-QPZRHAYK.js";import"./chunk-6GTOYTCQ.js";import{c as A}from"./chunk-YKTYVJBN.js";import"./chunk-6AYUSR7X.js";import"./chunk-427OQS2N.js";import{a as y}from"./chunk-OLXOZJ7X.js";import{d as C}from"./chunk-CT2I5KUM.js";import{c as E}from"./chunk-RN4OSVTG.js";import{a as P}from"./chunk-BC7UVJJB.js";import"./chunk-2PQXEEVY.js";import"./chunk-MCQXRJGH.js";import"./chunk-74RUSHIB.js";import"./chunk-ZZLR3O5A.js";import"./chunk-ZG2V2ODK.js";import"./chunk-5YPBPZUR.js";import"./chunk-HJGUEZLW.js";import"./chunk-UR6MHSHU.js";async function j(n){let[{render:o},e,{QuestionBatchPrompt:i}]=await Promise.all([import("./build-JIKYOZUH.js"),import("./react-QWOAB3TB.js"),import("./ui-JEJGTURD.js")]),c=e.default??e;return new Promise(t=>{let p=o(c.createElement(i,{questions:n,onSubmit:a=>{p.unmount(),t(a)}}))})}async function F(n,o){let[{render:e},i,{ReviewChecklist:c}]=await Promise.all([import("./build-JIKYOZUH.js"),import("./react-QWOAB3TB.js"),import("./ui-JEJGTURD.js")]),t=i.default??i;return new Promise(p=>{let a=e(t.createElement(c,{items:n.map(u=>{let s=o.get(u.temp_ref);return{uc:u,dedupWith:s&&!s.archived?s.cid:void 0,archivedMatch:s?.archived?{cid:s.cid,reason:s.reason}:void 0}}),onSubmit:u=>{a.unmount(),p(u)}}))})}async function G(n){let{createInterface:o}=await import("readline/promises"),e=o({input:process.stdin,output:process.stdout});try{let i=await e.question(`${n} [y/N] `);return/^y(es)?$/i.test(i.trim())}finally{e.close()}}async function O(n){let o=await C(),e=P(process.cwd()),i=await A(o);if(!i.ok)return process.stderr.write((i.message??"error: turn-endpoint preflight failed")+`
|
|
3
3
|
`),2;let c=async()=>i;if(n.plan)return h(n,{contextDir:e,agent:y,preflightTurn:c,ask:j,review:F,confirmStale:G,out:l=>process.stdout.write(l+`
|
|
4
4
|
`),progress:l=>process.stderr.write(l+`
|
|
5
|
-
`),isTTY:E(),auth:o});let[{render:t},p,{ScrollbackProvider:a},{ChatSurface:u},{ScrollbackTap:s},{makeChatController:r},{setInkExit:w},x]=await Promise.all([import("./build-JIKYOZUH.js"),import("./react-QWOAB3TB.js"),import("./scrollback-JLPJR25X.js"),import("./ChatSurface-
|
|
5
|
+
`),isTTY:E(),auth:o});let[{render:t},p,{ScrollbackProvider:a},{ChatSurface:u},{ScrollbackTap:s},{makeChatController:r},{setInkExit:w},x]=await Promise.all([import("./build-JIKYOZUH.js"),import("./react-QWOAB3TB.js"),import("./scrollback-JLPJR25X.js"),import("./ChatSurface-VXYU6KFW.js"),import("./ScrollbackTap-Q3IOKNMS.js"),import("./chat-controller-VAC57IEV.js"),import("./exit-manager-VCSIUYBR.js"),Promise.all([import("./chat-committer-ADJJTDUT.js"),import("./descriptor-EHK3DRCZ.js"),import("./explain-VFIZTHFN.js"),import("./readmodel-XOGOELUP.js")])]),[{commitChatTurn:I},{topologyDescriptor:M},{explain:V},{openGraph:k}]=x,v=p.default??p,m=r({commitChatTurn:I,descriptor:M(),contextDir:e,refreshGraph:()=>k(e),graph:k(e),explain:V,by:{kind:"human",id:"owner"},dedupFlags:l=>D(l,k(e))}),T={current:null},S=0,b=null,f=!1,N=()=>{if(S+=1,S>=2){try{g.unmount()}catch{}process.exit(130)}m.requestPause(),b=setTimeout(()=>{f||(f=!0,(async()=>{m.ledger({kind:"interrupted",detail:"the agent did not confirm the pause within 5s"}),await T.current?.flush();try{g.unmount()}catch{}process.exit(130)})())},5e3)},g=t(v.createElement(a,null,v.createElement(s,{into:T}),v.createElement(u,{controller:m,verb:"extract",onCtrlC:N})),{exitOnCtrlC:!1});w(()=>g.unmount()),m.ledger({kind:"banner",text:"kane-cli context \xB7 extract \xB7 interactive"});try{let l=h(n,{contextDir:e,agent:y,preflightTurn:c,ask:d=>m.ask(d),review:async d=>new Map(d.map(R=>[R.temp_ref,{resolution:"skipped"}])),confirmStale:async()=>!0,out:d=>m.note(d),progress:()=>{},isTTY:E(),auth:o,chat:m});return l.finally(()=>{f=!0}),await l}finally{f=!0,b&&clearTimeout(b),await T.current?.flush();try{g.unmount()}catch{}}}async function U(n){let o=await C(),{makeHeadlessIO:e,resolveEncoding:i,guardedChannels:c}=await import("./headless-io-PWW6YKH2.js"),t=e(i(n.mode),"extract"),{makeInterruptGuard:p}=await import("./interrupt-guard-UREUWNRL.js"),a=p(y,r=>t.out(r)),s=c(t,()=>a.interrupted(),/^error: (agent failed|repair run failed|agent ended)/);try{let r=await h(n,{contextDir:P(process.cwd()),agent:a.agent,preflightTurn:()=>A(o),ask:async()=>[],review:async w=>new Map(w.map(x=>[x.temp_ref,{resolution:"skipped"}])),confirmStale:async()=>!1,out:s.out,emit:s.emit,progress:t.progress,isTTY:!1,auth:o});return a.interrupted()&&r!==3?(t.out("interrupted \u2014 no session saved"),t.done(130)):t.done(r)}catch(r){return t.event({type:"error",message:`error: extract failed: ${r instanceof Error?r.message:String(r)}`}),t.out(`error: extract failed: ${r instanceof Error?r.message:String(r)}`),t.out("hint: per-run trace logs live under .context/logs/ (extract-*.log)"),t.done(1)}finally{a.dispose()}}export{U as bindExtractHeadless,O as bindExtractInteractive};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
2
|
import{a as s}from"./chunk-BC7UVJJB.js";import"./chunk-UR6MHSHU.js";import{existsSync as d}from"fs";async function l(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
3
|
`),2;let n=async(r,t)=>{if(process.stderr.write(r+`
|
|
4
|
-
`),e.mode!=="agent")return 2;let{makeHeadlessIO:a,agentRefusal:c}=await import("./headless-io-
|
|
4
|
+
`),e.mode!=="agent")return 2;let{makeHeadlessIO:a,agentRefusal:c}=await import("./headless-io-PWW6YKH2.js");return c(a("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-PWW6YKH2.js"),t=r(e,"extract");if(t)return n(t)}if(!d(s(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
5
|
`),2;let i=e.mode??"interactive";if(i==="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-
|
|
6
|
+
`),2;let{bindExtractInteractive:r}=await import("./extract-bind-SSTKQGTV.js");return r(e)}let{bindExtractHeadless:o}=await import("./extract-bind-SSTKQGTV.js");return o({...e,mode:i})}export{l as extractCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as b}from"./chunk-
|
|
2
|
+
import{a as b}from"./chunk-GBBVP2JW.js";import{a as o,b as h,d as w}from"./chunk-GRB66C5S.js";import"./chunk-RN4OSVTG.js";import{e as $,f as y}from"./chunk-CJJXT5DO.js";import"./chunk-BC7UVJJB.js";import{e as l}from"./chunk-EHN5HTUD.js";import{a as g}from"./chunk-L5LI2JF4.js";import{a as k}from"./chunk-MCQXRJGH.js";import"./chunk-74RUSHIB.js";import"./chunk-ZZLR3O5A.js";import"./chunk-ZG2V2ODK.js";import"./chunk-5YPBPZUR.js";import"./chunk-UR6MHSHU.js";import{basename as p}from"path";import{statSync as O}from"fs";async function P(t){let e=await $(t);return e.length===0?null:e.map(a=>({p:a,m:O(a).mtimeMs})).sort((a,r)=>r.m-a.m)[0].p}async function U(t,e=w(),a=process.cwd()){let r=t.stage??"design";if(r!=="design"&&r!=="cover"&&r!=="all")return o(e,`--stage must be design | cover | all, got '${r}'`),2;if(t.top!==void 0&&(!Number.isInteger(t.top)||t.top<1))return o(e,"--top must be a positive integer"),2;let f=h(a,e);if(!f)return 2;let d,i;if(r!=="design"){let s=t.from?await y(t.from,a):await P(a);if(!s)return o(e,`--stage ${r} needs an evidence pack \u2014 run a test first, or pass --from <pack>`),2;let c=await l(s,"coverage/usecases.yaml");if(c==null)return o(e,`${p(s)} carries no coverage/usecases.yaml \u2014 re-run the tests to produce a coverage-bearing pack`),2;let u=g(c);if(!u||!Array.isArray(u.usecases))return o(e,`${p(s)}: coverage/usecases.yaml is not a usecases document`),2;d=u,i=p(s)}let v=k(f),n=await b(v,r,void 0,d),m=n.length;return t.top!==void 0&&(n=n.slice(0,t.top)),t.json?(e.out(JSON.stringify({stage:r,...i?{pack:i}:{},total:m,rows:n},null,2)),0):(e.out(`gaps \u2014 stage ${r}${i?` \xB7 pack ${i}`:""} (${n.length}${n.length<m?` of ${m}`:""})`),n.length===0&&e.out(" nothing owed \u2014 design and execution are square"),n.forEach((s,c)=>{e.out(` ${String(c+1).padStart(2)}. [${s.risk}] ${s.tag} ${s.ref} \u2014 ${s.why}`),e.out(` \u2192 ${s.ready_command}`)}),0)}export{U 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-3C5GMAM4.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-HNE4TDOZ.js";import{b as k}from"./chunk-BYUARJE7.js";import{d as J}from"./chunk-QZI43UNV.js";import{c as E}from"./chunk-I2JUBAPU.js";import"./chunk-E3BO7OVR.js";import{a as q}from"./chunk-W36P7S5W.js";import"./chunk-MVF4KRHA.js";import"./chunk-4MUHS3UL.js";import"./chunk-FPFOW6BS.js";import"./chunk-WAOCHXJ5.js";import"./chunk-L5LI2JF4.js";import{e as x,f as A}from"./chunk-M5JQXOCE.js";import{h as H}from"./chunk-64QURIT6.js";import"./chunk-2WVKOZ6W.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import{a as R}from"./chunk-DNOBOZPO.js";import"./chunk-VE3SUJMA.js";import{a as j}from"./chunk-BOO7YXAV.js";import"./chunk-HJGUEZLW.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-LP7V26IU.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-RN4OSVTG.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};
|