@testmuai/kane-cli 0.8.12 → 0.8.13
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-DALSIICW.js → ChatSurface-B6ZIO3JL.js} +1 -1
- package/dist/{ChromeProfilePicker-ZMVZH3AK.js → ChromeProfilePicker-QSICCUMV.js} +1 -1
- package/dist/{CliFeedbackPrompt-K66H7YE6.js → CliFeedbackPrompt-LLLNSKW2.js} +1 -1
- package/dist/{CliUploadProgress-5DZHZY4M.js → CliUploadProgress-N5IY66T2.js} +1 -1
- package/dist/{ConfigView-S5KBV62S.js → ConfigView-UQIRPENS.js} +1 -1
- package/dist/{EvidenceViewOffer-UACWB3YJ.js → EvidenceViewOffer-AZRAILJQ.js} +1 -1
- package/dist/FolderPicker-OJFR7AKZ.js +2 -0
- package/dist/{InfoBox-7PAM2FQH.js → InfoBox-ZGSLEOPE.js} +1 -1
- package/dist/{LinksBox-2NVZ3FHJ.js → LinksBox-JFT44YUK.js} +1 -1
- package/dist/{ProfilesView-SIUBF7IU.js → ProfilesView-WZSPK3HF.js} +1 -1
- package/dist/{ProjectPicker-5NI554X3.js → ProjectPicker-SBBGVF4L.js} +1 -1
- package/dist/{SaveSessionPrompt-5OULBV5N.js → SaveSessionPrompt-F3563T3C.js} +1 -1
- package/dist/SingleShotApp-72D5VVLE.js +2 -0
- package/dist/{SummaryBox-GTGF3CBO.js → SummaryBox-6N6NESLI.js} +1 -1
- package/dist/TestMdRunView-4OA52DA2.js +2 -0
- package/dist/{TestrunEvidenceTable-7WBCOGYW.js → TestrunEvidenceTable-JLJBJ76Q.js} +1 -1
- package/dist/{WhoamiView-E2SVBHLC.js → WhoamiView-PNVUCWLB.js} +1 -1
- package/dist/{app-download-SAXSYXIV.js → app-download-NNB52ZRJ.js} +1 -1
- package/dist/{auth-3LLVDHOJ.js → auth-JIDDELKY.js} +1 -1
- package/dist/{binary-WSMIRJNC.js → binary-LXYAW7WQ.js} +1 -1
- package/dist/{bind-A3M4PV4V.js → bind-F36JFHUK.js} +2 -2
- package/dist/{bootstrap-QTVHGL45.js → bootstrap-THOC3SS7.js} +1 -1
- package/dist/bridge-KMDML2NB.js +2 -0
- package/dist/{changelog-CNYWOB2V.js → changelog-BSMZXLTG.js} +1 -1
- package/dist/chunk-2X3TANEV.js +2 -0
- package/dist/chunk-33GXXC2L.js +2 -0
- package/dist/{chunk-AHRL4E3M.js → chunk-3FXNQTCE.js} +1 -1
- package/dist/{chunk-AFNDJK2A.js → chunk-3M2D7UUI.js} +1 -1
- package/dist/{chunk-4ASRA7CD.js → chunk-3SP4JVDN.js} +2 -2
- package/dist/{chunk-75HF3GPO.js → chunk-477DYMXZ.js} +1 -1
- package/dist/{chunk-H6NHARB4.js → chunk-4PARDPK2.js} +1 -1
- package/dist/{chunk-T4OJX2GZ.js → chunk-4WOVHRI2.js} +1 -1
- package/dist/{chunk-U2CIXGZR.js → chunk-6AZNGOLH.js} +1 -1
- package/dist/{chunk-G2Q2TP3O.js → chunk-6IAA644J.js} +1 -1
- package/dist/{chunk-4O6XBS5G.js → chunk-6J635CRI.js} +1 -1
- package/dist/{chunk-HPUQJRDX.js → chunk-7GUFVQOQ.js} +1 -1
- package/dist/{chunk-IGW77FMB.js → chunk-7KIIM6H7.js} +1 -1
- package/dist/{chunk-6A47PRDS.js → chunk-AGRUULPT.js} +1 -1
- package/dist/{chunk-2MTAXT2U.js → chunk-AIVOYTYQ.js} +1 -1
- package/dist/{chunk-5AHOVOWV.js → chunk-AQWTK6IN.js} +1 -1
- package/dist/{chunk-3CCD434H.js → chunk-ARU6KAGY.js} +1 -1
- package/dist/{chunk-ZVJGHQNG.js → chunk-BJAHVN2F.js} +1 -1
- package/dist/{chunk-XWO5MDEU.js → chunk-BTBUIL4Q.js} +1 -1
- package/dist/{chunk-OZMYKG6E.js → chunk-BZTWTYQQ.js} +1 -1
- package/dist/{chunk-YF26DH4Z.js → chunk-CAO3XRA2.js} +1 -1
- package/dist/{chunk-TLFNUXKS.js → chunk-CUSTYILP.js} +1 -1
- package/dist/{chunk-QZRHXGNI.js → chunk-D4G3SEBU.js} +1 -1
- package/dist/chunk-DHJSM5DT.js +2 -0
- package/dist/chunk-DIM5X2FR.js +52 -0
- package/dist/{chunk-ZZI4Y3CX.js → chunk-DMLYUTS4.js} +1 -1
- package/dist/{chunk-43DM2I6Q.js → chunk-DXFMELKC.js} +1 -1
- package/dist/{chunk-M4WSRYRA.js → chunk-EXLXV5OU.js} +1 -1
- package/dist/{chunk-X6APRDUM.js → chunk-F5AI3UVS.js} +2 -2
- package/dist/{chunk-FAREJ4P2.js → chunk-FE6XRABM.js} +1 -1
- package/dist/{chunk-CQ3ZQ5UK.js → chunk-FNIL4G3V.js} +3 -3
- package/dist/{chunk-ASYWKYTQ.js → chunk-FUP4AP6J.js} +12 -12
- package/dist/{chunk-24QPDHRD.js → chunk-GILD6RGH.js} +1 -1
- package/dist/{chunk-RV7Q4RUV.js → chunk-I27YRAGO.js} +2 -2
- package/dist/{chunk-3OU2F34I.js → chunk-I75FRXKE.js} +1 -1
- package/dist/{chunk-ZXN67F4U.js → chunk-IZU5ND2C.js} +1 -1
- package/dist/{chunk-UDFDTFBL.js → chunk-J2UN2AHO.js} +1 -1
- package/dist/{chunk-GRDYYYIQ.js → chunk-J3Q63NFG.js} +1 -1
- package/dist/{chunk-3N2YOHD6.js → chunk-JX2CAVX6.js} +1 -1
- package/dist/{chunk-DYXYNH6X.js → chunk-K2UEVCIJ.js} +1 -1
- package/dist/{chunk-VG7BTA5G.js → chunk-K4SULRBL.js} +1 -1
- package/dist/{chunk-JOATASPP.js → chunk-K6RAOZHP.js} +3 -3
- package/dist/{chunk-NP3VGFZM.js → chunk-KO3FL2XW.js} +1 -1
- package/dist/{chunk-WHYEXCTG.js → chunk-KSLJOUH4.js} +1 -1
- package/dist/{chunk-3XWKKSIM.js → chunk-KV5BOFPK.js} +2 -2
- package/dist/{chunk-YTAAF62A.js → chunk-KXUTO5WC.js} +1 -1
- package/dist/{chunk-JDGBRACP.js → chunk-L32DKFRQ.js} +1 -1
- package/dist/{chunk-GNAPBOAJ.js → chunk-LAQBCZ5A.js} +1 -1
- package/dist/{chunk-SACCB44S.js → chunk-LPDBTGO5.js} +2 -2
- package/dist/{chunk-G52YPXKT.js → chunk-LWQNRZH3.js} +1 -1
- package/dist/{chunk-COVIEKZN.js → chunk-MCKBJIBB.js} +1 -1
- package/dist/{chunk-U27OWZPW.js → chunk-MXDWS7S4.js} +1 -1
- package/dist/{chunk-IE4BCGUE.js → chunk-N2I23ANS.js} +1 -1
- package/dist/{chunk-5A4QG7ZM.js → chunk-NM76SG3S.js} +1 -1
- package/dist/{chunk-O7U5BVX5.js → chunk-NU45ROHH.js} +2 -2
- package/dist/{chunk-7KAPHA56.js → chunk-NUWOQS6L.js} +1 -1
- package/dist/{chunk-4TZSEC2C.js → chunk-OHK6V7JX.js} +1 -1
- package/dist/{chunk-KRL2BDI5.js → chunk-OTMAFCZK.js} +2 -2
- package/dist/{chunk-5KLDW3ZW.js → chunk-P5MJMM3X.js} +2 -2
- package/dist/{chunk-UZXCCO7V.js → chunk-PUM5J56E.js} +1 -1
- package/dist/{chunk-7NXHVC7G.js → chunk-PWRIG6UB.js} +1 -1
- package/dist/{chunk-7R5K4IGS.js → chunk-PYQS5ST6.js} +1 -1
- package/dist/{chunk-HWHLKBUT.js → chunk-Q4YAJJPP.js} +1 -1
- package/dist/{chunk-I57TM22L.js → chunk-QD2BUO5M.js} +1 -1
- package/dist/{chunk-SA6EDKUF.js → chunk-RN5ERSV2.js} +1 -1
- package/dist/{chunk-5FYO3PFG.js → chunk-SEKJZOKW.js} +1 -1
- package/dist/{chunk-VDM3TWF6.js → chunk-T7DGNWI2.js} +4 -4
- package/dist/{chunk-3G3LY6BM.js → chunk-TDNM22BQ.js} +1 -1
- package/dist/{chunk-F2CET54H.js → chunk-TMRLBSIA.js} +1 -1
- package/dist/{chunk-MMQLVGUJ.js → chunk-TXZ66K4Q.js} +1 -1
- package/dist/{chunk-NSD2H67E.js → chunk-UF4JZXEE.js} +1 -1
- package/dist/{chunk-L2BCQQLJ.js → chunk-UZCSVEWP.js} +1 -1
- package/dist/{chunk-LLY7TQSI.js → chunk-VJ3ES3RR.js} +1 -1
- package/dist/{chunk-FBYB3SRE.js → chunk-VYMMGWVO.js} +1 -1
- package/dist/chunk-W2UYUV47.js +27 -0
- package/dist/{chunk-H6VS5RYO.js → chunk-WUV3FJ7C.js} +1 -1
- package/dist/{chunk-4T35SA2O.js → chunk-XAM5E27U.js} +1 -1
- package/dist/{chunk-L7GAZQYL.js → chunk-XH2KDLZO.js} +1 -1
- package/dist/{chunk-FHYG3QLL.js → chunk-XL6HDWM3.js} +1 -1
- package/dist/{chunk-4E4GJPEM.js → chunk-XS3HIVNS.js} +1 -1
- package/dist/{chunk-2LXJ2ZM3.js → chunk-YEZYO5QH.js} +1 -1
- package/dist/{chunk-APZCLVZD.js → chunk-ZOSY2PJM.js} +1 -1
- package/dist/{config-HUK7V364.js → config-BCGD2FEX.js} +1 -1
- package/dist/{controller-client-OB4WD2C4.js → controller-client-ZF5IXRUV.js} +1 -1
- package/dist/{credentials-6DP4KAMJ.js → credentials-YNH5BU2Z.js} +1 -1
- package/dist/{deps-bundle-PZNXSKLC.js → deps-bundle-LOFI4DAJ.js} +1 -1
- package/dist/{deps-resolve-62XK3LKV.js → deps-resolve-GA6IPHVZ.js} +1 -1
- package/dist/{dispatch-7JCKGQVC.js → dispatch-FRCPK3AZ.js} +1 -1
- package/dist/{doctor-ZQQ4VMPY.js → doctor-W5TQBYB5.js} +1 -1
- package/dist/{evidence-YAXIWZ6A.js → evidence-FHO36EEV.js} +1 -1
- package/dist/{evolve-cmd-5ACHYQPE.js → evolve-cmd-6RXLKERE.js} +1 -1
- package/dist/{extract-bind-BF2G6AS6.js → extract-bind-BFJPRNPQ.js} +2 -2
- package/dist/{extract-cmd-IPBCCR3T.js → extract-cmd-7FKQJNS7.js} +1 -1
- package/dist/{gaps-cmd-3WXL6PAW.js → gaps-cmd-FDJ3PT4C.js} +1 -1
- package/dist/{generate-headless-CLMSXEAS.js → generate-headless-OBMB5CSB.js} +2 -2
- package/dist/index.js +188 -129
- package/dist/{ingest-cmd-KP5M6XTA.js → ingest-cmd-AV66Q5LC.js} +1 -1
- package/dist/install-SFJ2FFQ6.js +2 -0
- package/dist/{interactive-bind-MOV2VWHJ.js → interactive-bind-N5AQB26T.js} +3 -3
- package/dist/list-commands-SH4HPFI4.js +2 -0
- package/dist/login-flow-ODVWEPRU.js +2 -0
- package/dist/{mobile-prompts-WJVFBWW5.js → mobile-prompts-UZTRJ3L7.js} +1 -1
- package/dist/{objective-variable-gate-GCQYYM77.js → objective-variable-gate-3VUXNDCZ.js} +1 -1
- package/dist/{persist-recorded-session-MHLD4A32.js → persist-recorded-session-QMRY4DOF.js} +1 -1
- package/dist/pipeline-5FHWZAXK.js +2 -0
- package/dist/prepare-target-UJEY2FSR.js +2 -0
- package/dist/{reconcile-cmd-NI3AYU3Y.js → reconcile-cmd-2QHZML2L.js} +1 -1
- package/dist/{reconcile-deps-DCHUFIEC.js → reconcile-deps-ZBWUY3SM.js} +2 -2
- package/dist/{reconcile-engine-QXUKUKSL.js → reconcile-engine-YC4RQYF2.js} +1 -1
- package/dist/{recording-banner-4H4AL6YN.js → recording-banner-7E75ERQJ.js} +1 -1
- package/dist/registry-JJTRUPH7.js +2 -0
- package/dist/{require-project-folder-G2G4WKWW.js → require-project-folder-LBUYWQOF.js} +1 -1
- package/dist/{resolve-run-intent-MZRPYN4V.js → resolve-run-intent-GHISMXLZ.js} +1 -1
- package/dist/{resolver-X5NHNX5O.js → resolver-7JC5VZ4S.js} +1 -1
- package/dist/{run-PBS2J4N4.js → run-43ACVPJK.js} +1 -1
- package/dist/{run-VTUYLPSG.js → run-EOTOXNQO.js} +1 -1
- package/dist/{run-test-md-4VRH7FU5.js → run-test-md-5LPCKCW7.js} +2 -2
- package/dist/{skill-installer-WPW6NDCR.js → skill-installer-YQPZZB7I.js} +1 -1
- package/dist/{spawner-R3XOP3GP.js → spawner-X2FOOONV.js} +1 -1
- package/dist/tcg-generate-V4QRNEZV.js +2 -0
- package/dist/testmd-actions-2UMU3QMV.js +2 -0
- package/dist/testmd-sync-UBXDLWYD.js +2 -0
- package/dist/token-refresh-NL5AM446.js +2 -0
- package/dist/{validate-basic-YNGP5JFB.js → validate-basic-GTSVZFQI.js} +1 -1
- package/dist/{variable-receipt-2VCUG7NN.js → variable-receipt-IHQAYWMZ.js} +1 -1
- package/dist/{verdicts-PRXUKSDV.js → verdicts-QU6W3TUF.js} +1 -1
- package/dist/{version-check-GUGRBTIH.js → version-check-IPEPJZDX.js} +1 -1
- package/dist/{walk-session-G3DLBR24.js → walk-session-7JVB4Z5S.js} +1 -1
- package/dist/{with-telemetry-5Y2CVPXK.js → with-telemetry-LRI7H6DH.js} +1 -1
- package/package.json +11 -11
- package/dist/FolderPicker-YH5TKMX3.js +0 -2
- package/dist/SingleShotApp-LA3EMPUK.js +0 -2
- package/dist/TestMdRunView-5MNKJJMS.js +0 -2
- package/dist/bridge-E2C5VV3H.js +0 -2
- package/dist/chunk-7RFGO3TH.js +0 -2
- package/dist/chunk-DPUV6OSP.js +0 -2
- package/dist/chunk-NJJQL54J.js +0 -2
- package/dist/chunk-WMVPJWWA.js +0 -37
- package/dist/chunk-ZVZHE7KH.js +0 -27
- package/dist/install-5VWCH5GW.js +0 -2
- package/dist/list-commands-KUDSKVP5.js +0 -2
- package/dist/login-flow-GZ3XHVCS.js +0 -2
- package/dist/pipeline-G7KWRK2G.js +0 -2
- package/dist/prepare-target-SQ5IGKXD.js +0 -2
- package/dist/registry-R6QNPI5E.js +0 -2
- package/dist/tcg-generate-HIC5AA3L.js +0 -2
- package/dist/testmd-actions-VOSP7L74.js +0 -2
- package/dist/testmd-sync-GNCDKPQN.js +0 -2
- package/dist/token-refresh-GSFVJ6GU.js +0 -2
|
@@ -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-SEKJZOKW.js";import{y as o}from"./chunk-33GXXC2L.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(l=>l.kind==="replay").length,s=e.decisions.filter(l=>l.kind==="author").length,d=e.outcomes.filter(l=>l.status==="passed").length,f=e.outcomes.filter(l=>l.status==="failed").length,h=e.outcomes.filter(l=>l.status==="skipped").length,a=o.green,u;e.cancelled||e.overallStatus==="interrupted"?(a=o.orange,u="CANCELLED"):e.overallStatus==="failed"?(a=o.red,u="FAILED"):u="PASSED";let r=`${u} \xB7 ${e.durationS}s \xB7 ${e.outcomes.length} steps (${d} passed, ${f} failed, ${h} skipped)`,T=`${t} replay \xB7 ${s} author`,C=e.retryTriggered,_="yes \u2014 healed after a replay miss",n,p=o.dim;if(e.cancelled)n="\u2013 not committed (cancellation)";else if(e.overallStatus==="failed")n="\u2013 not committed (run failed)",p=o.red;else if(!e.shouldCommit)e.isFirstRun?n="\u2013 not committed (first run skipped commit)":e.lockHeld?n="\u2013 not committed":n="\u2013 not committed (readonly fallback / no lock)";else if(e.committed===!1&&!e.uploadResult?.testcaseId)n="\u2013 not committed (commit did not land)",p=o.red;else{let l=e.uploadResult?.testcaseId;n=l?`\u2713 pushed (testcase=${l})`:"\u2713 pushed",p=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:r},breakdown:T,showRetries:C,retriesText:_,commitText:n,commitColor:p,artifactsText:v,uploadText:m,uploadColor:g}}function I(e){let t=e.decisions.filter(r=>r.kind==="replay").length,s=e.decisions.filter(r=>r.kind==="author").length,d=e.outcomes.filter(r=>r.status==="passed").length,f=e.outcomes.filter(r=>r.status==="failed").length,h=e.outcomes.filter(r=>r.status==="skipped").length,a,u=!1;return e.cancelled?a="cancellation":e.overallStatus==="failed"?a="run_failed":e.shouldCommit&&(e.committed===!0||e.uploadResult?.testcaseId)?(a="ok",u=!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:d,failed:f,skipped:h,replay_decisions:t,author_decisions:s},adaptive_heal:{triggered:e.retryTriggered},commit:{committed:u,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),s=[{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&&s.push({label:"adaptive heal",value:(0,i.jsx)(c,{color:o.orange,children:t.retriesText})}),s.push({label:"commit",value:(0,i.jsx)(c,{color:t.commitColor,children:t.commitText})}),s.push({label:"artifacts",value:(0,i.jsx)(c,{color:o.dim,children:t.artifactsText})}),s.push({label:"upload",value:(0,i.jsx)(c,{color:t.uploadColor,children:t.uploadText})}),(0,i.jsx)(S,{title:"Run summary",titleColor:"#ff9500",rows:s})}function O({data:e}){let{exit:t}=x();return(0,k.useEffect)(()=>{let s=setTimeout(()=>t(),50);return()=>clearTimeout(s)},[t]),(0,i.jsx)(y,{flexDirection:"column",children:(0,i.jsx)(D,{data:e})})}export{A as a,I as b,D as c,O as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as f}from"./chunk-
|
|
2
|
+
import{a as f}from"./chunk-ARU6KAGY.js";import{y as r}from"./chunk-33GXXC2L.js";import{a as g}from"./chunk-HCBYKLMW.js";import{a as i,b as n,i as p}from"./chunk-C44QQJR4.js";import{a as x}from"./chunk-6YGTRKDT.js";import{e as d}from"./chunk-UR6MHSHU.js";var b=d(x(),1);var e=d(g(),1),v=[{value:"desktop",label:"Desktop",hint:"Chrome on this machine"},{value:"emulator",label:"Emulator",hint:"a virtual Android device"},{value:"simulator",label:"Simulator",hint:"a virtual iOS device"}];function T(a){return a==="all"?v:v.filter(l=>l.value!=="desktop")}function B({mode:a="all",onSelect:l,onCancel:c}){let u=T(a),[h,m]=(0,b.useState)(0);return p((s,o)=>{if(o.escape&&c){c();return}o.upArrow&&m(t=>Math.max(0,t-1)),o.downArrow&&m(t=>Math.min(u.length-1,t+1)),o.return&&l(u[h].value)}),(0,e.jsxs)(i,{flexDirection:"column",borderStyle:"round",borderColor:r.orange,paddingX:2,paddingY:1,children:[(0,e.jsx)(n,{color:r.orange,bold:!0,children:a==="all"?"Where should tests run?":"Which kind of device?"}),(0,e.jsx)(i,{marginTop:1,flexDirection:"column",children:u.map((s,o)=>{let t=o===h;return(0,e.jsxs)(i,{children:[(0,e.jsxs)(n,{color:t?r.orange:void 0,children:[t?"\u276F ":" ",s.label]}),(0,e.jsxs)(n,{color:r.dim,children:[" ",s.hint]})]},s.value)})}),(0,e.jsx)(i,{marginTop:1,children:(0,e.jsx)(n,{color:r.dim,children:"You can change this any time with /desktop or /mobile."})}),(0,e.jsx)(f,{bindings:[{keys:"\u2191\u2193",label:"navigate"},{keys:"\u21B5",label:"select"}],suppressEscBack:!c,escBackLabel:"skip"})]})}export{B as a};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as K}from"./chunk-
|
|
2
|
+
import{b as K}from"./chunk-6AZNGOLH.js";import{a as B,b as U,c as Y}from"./chunk-KGKJU27A.js";import{a as j}from"./chunk-DNNZ353O.js";import{d as F}from"./chunk-YMLC55J4.js";import{C as k,a as L,b as V,m as G,q as N}from"./chunk-W3Z7AZNT.js";import{e as I}from"./chunk-XMTSHHYQ.js";import{d as v,e as x,g as H}from"./chunk-AKX4VRRR.js";function ee(t,e,n,i,s){let f=n.rows.filter(u=>{let d=i.get(u.temp_ref);return d!==void 0&&d!=="reject"});if(f.length===0)return{record:null,errors:null};let o={version:1,read_basis:e.latestHash,source:{source_id:n.source_id,source_cid:e.heads.get(n.source_id)??""},use_cases:f.map(u=>u.uc)},p=new Map;for(let u of f){let d=i.get(u.temp_ref);typeof d=="object"?p.set(u.temp_ref,{resolution:"edited",edit:d.edited}):p.set(u.temp_ref,{resolution:u.uc.matches_existing&&u.uc.changed?"edited":"approved"})}let g=Y(o,e,n.staged_source_cid);if(g.errors!==null)return{record:null,errors:g.errors};let r=g.proposal,l=o.source.source_cid?D(t,e,o.source.source_cid):null;if(l!==null){r=U(r,l);let u=G(r,B(l),e);if(u.length>0)return{record:null,errors:[{code:"HELD_CITES_STALE",detail:"the source moved after this plan staged \u2014 its quotes no longer verify against the current head; re-run kane-cli maintain reconcile to re-stage"},...u]}}let m=`held-${(e.latestHash??"root").slice(-12)}-${f.length}`;return N({contextDir:t,graph:e,proposal:r,proposalId:m,verdicts:p,by:s,autoName:!0})}function W(t,e,n=[]){let i=K(t,e),s=new Set,f=[],o=l=>{!l||s.has(l)||(s.add(l),f.push(y(t,l)))};for(let l of i.pairs)o(l.scenario),o(l.test);for(let[l,m]of i.verifies){o(l);for(let u of m)o(u)}if(n.length===0)return{stale_refs:f};let p=l=>`${String(l.props.source_id)}\0${String(l.props.anchor)}`,g=new Set;for(let{cid:l}of t.byLabel(v.USECASE))if(t.tipOf(l)===e)for(let m of t.edgesInto(l)){if(m.type!==x.DERIVES)continue;let u=m.props.claim;typeof u=="string"&&n.includes(u)&&g.add(p(m))}if(g.size===0)return{stale_refs:f};let r=new Set;for(let[l,m]of i.verifies)if(t.edgesInto(l).some(d=>d.type===x.DERIVES&&g.has(p(d)))){r.add(y(t,l));for(let d of m)r.add(y(t,d))}return{stale_refs:f,...r.size>0?{direct_refs:[...r]}:{}}}var q="this release plans changes only \u2014 blast-radius impact and drift meaning-checks are not measured, and REMOVE rows are never executed automatically",te="suite untouched; graph updated";function M(t,e){return!t.superseded.has(e)&&t.trust.get(e)!=="archived"}function y(t,e,n=new Set){let i=t.nameOf.get(e);if(i!==void 0)return i;if(n.has(e))return e;n.add(e);for(let[s,f]of t.superseded){if(f!==e)continue;let o=y(t,s,n);if(o!==s)return o}return e}function C(t){return String(t).slice(0,19)}function A(t,e,n){let i=t.edgesFrom(e).find(s=>s.type===n);return i?t.tipOf(i.dst):null}function X(t,e){let n=t.nodeLabel.get(e);if(n===v.USECASE)return e;if(n===v.SCENARIO)return A(t,e,x.BELONGS_TO);if(n===v.AC){let i=A(t,e,x.SCOPED_TO);return i?t.nodeLabel.get(i)===v.USECASE?i:A(t,i,x.BELONGS_TO):null}if(n===v.TEST){let i=A(t,e,x.AUTOMATES);return i?A(t,i,x.BELONGS_TO):null}return null}function z(t,e){let n=[],i=new Map;for(let s of t.derivesInto(e))i.set(String(s.props.source_id),s);for(let[s,f]of i){let o=t.heads.get(s);if(o==null){n.push(`DERIVES pin ${s} @ ${C(f.props.source_cid)} \u2014 source retired`);continue}if(o!==f.props.source_cid){let p=t.convChains.get(s)?.chain;if(p&&p.includes(String(f.props.source_cid)))continue;n.push(`DERIVES pin ${s} @ ${C(f.props.source_cid)} \u2014 source head moved to ${C(o)}`)}}for(let s of t.edgesFrom(e))H(s.type)?.pin?.comparesTo==="dst_tip"&&t.superseded.has(s.dst)&&n.push(`${s.type} pin \u2192 ${y(t,s.dst)} \u2014 target superseded`);return n.join("; ")||"structural pin broken"}var ne=new Set([v.USECASE,v.SCENARIO,v.AC,v.TEST]);function $(t,e){return t.ref<e.ref?-1:t.ref>e.ref?1:0}function D(t,e,n){let i=j(t,e,n);return i===null?null:i.toString("utf8")}function se(t,e,n,i,s){let f=n.props.quote;if(typeof f=="string"&&f.length>0)return i.includes(f);let o=String(n.props.source_cid);s.has(o)||s.set(o,D(t,e,o));let p=s.get(o);if(p===null)return!1;let g=V(p,String(n.props.anchor));return g===null?!1:g.split(`
|
|
3
3
|
`).some(r=>r.trim().length>0&&i.includes(r.trim()))}function oe(t,e,n){let i=L(String(e.props.anchor));if(i?.kind!=="img-part")return!1;let f=(t.mediaOf(String(e.props.source_cid)).images??[]).find(r=>r.ref===i.ref),o=f?.blob;if(o===void 0)return!1;let p=t.mediaOf(n).images??[];if(p.some(r=>r.blob===o))return!0;let g=f?.appearance;return g!==void 0&&p.filter(r=>r.appearance===g).length===1}var J=128*1024,Q=64*1024;function re(t,e){let n=t.split(`
|
|
4
4
|
`),i=e.split(`
|
|
5
5
|
`),s=0;for(;s<n.length&&s<i.length&&n[s]===i[s];)s++;let f=n.length,o=i.length;for(;f>s&&o>s&&n[f-1]===i[o-1];)f--,o--;if(f===s&&o===s)return"";let p=n.slice(s,f),g=i.slice(s,o),l=ie(p,g,2e3),m=[];if(l===null)m.push(`@@ old L${s+1}-L${f} \u2192 new L${s+1}-L${o} @@`,...p.map(u=>`- ${u}`),...g.map(u=>`+ ${u}`));else{let u=l.map((a,h)=>a.op==="="?-1:h).filter(a=>a>=0),d=0;for(;d<u.length;){let a=d;for(;a+1<u.length&&u[a+1]-u[a]<=3;)a++;let h=Math.max(u[d]-1,0),R=Math.min(u[a]+1,l.length-1),b=l.slice(h,R+1),S=s+(b[0].ai??0)+1,_=s+(b[0].bi??0)+1,c=b.filter(E=>E.op!=="+").length,w=b.filter(E=>E.op!=="-").length;m.push(`@@ old L${S}-L${S+Math.max(c-1,0)} \u2192 new L${_}-L${_+Math.max(w-1,0)} @@`);for(let E of b)m.push(E.op==="="?` ${E.line}`:`${E.op} ${E.line}`);d=a+1}}return m.join(`
|
|
6
6
|
`)}function ie(t,e,n){let i=t.length,s=e.length,f=Math.min(i+s,n),o=new Map([[1,0]]),p=[],g=!1;for(let u=0;u<=f&&!g;u++){p.push(new Map(o));for(let d=-u;d<=u;d+=2){let a=d===-u||d!==u&&(o.get(d-1)??0)<(o.get(d+1)??0)?o.get(d+1)??0:(o.get(d-1)??0)+1,h=a-d;for(;a<i&&h<s&&t[a]===e[h];)a++,h++;if(o.set(d,a),a>=i&&h>=s){g=!0;break}}}if(!g)return null;let r=i,l=s,m=[];for(let u=p.length-1;u>0;u--){let d=p[u],a=r-l,h=a===-u||a!==u&&(d.get(a-1)??0)<(d.get(a+1)??0)?a+1:a-1,R=d.get(h)??0,b=R-h;for(;r>R&&l>b;)m.push({op:"=",line:t[r-1],ai:r-1,bi:l-1}),r--,l--;u>0&&(r===R?(m.push({op:"+",line:e[l-1],ai:r,bi:l-1}),l--):(m.push({op:"-",line:t[r-1],ai:r-1,bi:l}),r--))}for(;r>0&&l>0;)m.push({op:"=",line:t[r-1],ai:r-1,bi:l-1}),r--,l--;for(;r>0;)m.push({op:"-",line:t[r-1],ai:r-1,bi:0}),r--;for(;l>0;)m.push({op:"+",line:e[l-1],ai:0,bi:l-1}),l--;return m.reverse()}function ce(t){let e=Buffer.byteLength(t,"utf8");if(e<=J+Q)return{diff:t,truncated:!1};let n=Buffer.from(t,"utf8"),i=J;for(;i>0&&(n[i]&192)===128;)i--;let s=e-Q;for(;s<e&&(n[s]&192)===128;)s++;let f=n.subarray(0,i).toString("utf8"),o=n.subarray(s).toString("utf8");return{diff:`${f}
|
|
7
7
|
\u2026 [diff truncated: ${e-i-(e-s)} bytes omitted] \u2026
|
|
8
|
-
${o}`,truncated:!0}}function ae(t,e){let n=k(t),i=n.heads.get(e);if(typeof i!="string")return null;let s=[];for(let d of I(t).records){let a=d.source_head_moves?.[e];a!==void 0&&a!==s[s.length-1]&&s.push(a)}let f=s.lastIndexOf(i),o=f>0?s[f-1]:null;if(typeof o!="string"||o===i)return null;let p=D(t,n,o),g=D(t,n,i);if(p===null||g===null)return null;let{diff:r,truncated:l}=ce(re(p,g)),m=new Set,u=[];for(let d of n.edgesFrom(o))d.type!==x.DERIVES||n.nodeLabel.get(d.dst)!==v.USECASE||m.has(d.dst)||(m.add(d.dst),u.push({id:d.dst,title:String(n.getNode(d.dst)?.content.title??"")}));return{source_id:e,old_head:o,new_head:i,diff:r,...l?{truncated:!0}:{},prior_ucs:u}}function de(t,e,n){let i=t.getNode(e)?.content??{},s=t.getNode(n)?.content??{},o=[...new Set([...Object.keys(i),...Object.keys(s)])].sort().filter(p=>JSON.stringify(i[p])!==JSON.stringify(s[p]));return o.length>0?`updated: ${o.join(", ")}`:"updated"}function le(t,e,n,i,s,f,o){let p=new Set((o?.rows??[]).map(a=>a.matched_cid).filter(a=>!!a)),g=[];for(let[a,h]of n.superseded)h===null||a===h||e.superseded.has(a)||n.nodeLabel.get(a)===v.USECASE&&g.push({kind:"MODIFY",ref:y(n,a),old_cid:a,new_cid:h,summary:de(n,a,h)});let r=f.map(a=>({kind:"ADD",ref:y(n,a),cid:a}));for(let a of o?.rows??[])a.kind==="MODIFY"&&a.matched_cid?g.push({kind:"MODIFY",ref:y(n,a.matched_cid),old_cid:a.matched_cid,new_cid:null,summary:`${a.why} (staged)`}):a.kind==="ADD"&&r.push({kind:"ADD",ref:a.title,cid:null});let l=[],m=D(t,n,s),u=new Map;for(let{cid:a}of n.byLabel(v.USECASE)){if(!M(n,a)||p.has(a))continue;let h=n.derivesInto(a),R=h.filter(_=>String(_.props.source_id)===i);R.length===0||R.some(_=>_.props.source_cid===s)||R.some(_=>{let c=String(_.props.anchor),w=L(c);return w?.kind==="img-whole"?!1:w?.kind==="img-part"?oe(n,_,s):m!==null&&se(t,n,_,m,u)})||h.some(_=>{let c=String(_.props.source_id);if(c===i)return!1;let w=n.heads.get(c);return w!=null})||l.push({kind:"ARCHIVE",ref:y(n,a),cid:a,why:`evidence decayed: no quote from ${i} relocates into @${C(s)}, no other live source, no fresh evidence this run`,impact:W(n,n.tipOf(a))})}let d=(a,h)=>a.ref<h.ref?-1:a.ref>h.ref?1:0;return[...g.sort(d),...r.sort(d),...l.sort(d)]}function Ee(t,e,n,i,s){let f=e.rows.find(d=>d.temp_ref===n);if(!f)return{ok:!1,message:`held item ${n} missing from the plan artifact`};let o=f,p=k(t);if(o.matched_cid){let d=p.tipOf(o.matched_cid);if(p.superseded.get(d)===null)return{ok:!1,message:`use-case for "${o.title}" was retired meanwhile \u2014 nothing to update`};d!==o.matched_cid&&(o={...o,matched_cid:d,uc:{...o.uc,matches_existing:{cid:d}}})}let g=s?{edited:s}:"approve",r=ee(t,p,{source_id:e.source_id,...e.staged_source_cid!==void 0?{staged_source_cid:e.staged_source_cid}:{},rows:[o]},new Map([[o.temp_ref,g]]),i);if(r.errors)return{ok:!1,message:r.errors.map(d=>`${d.code}: ${d.detail}`).join("; ")};let l=k(t),m=o.matched_cid?l.tipOf(o.matched_cid):r.record?.nodes.find(d=>d.label==="usecase")?.cid??r.record?.review[0]?.id;return{ok:!0,ref:m?y(l,m):o.title,kind:o.kind}}async function Re(t,e,n,i={}){let s=k(t),f=s.heads.get(e)??null,o=new Set(s.staleList().filter(c=>c.state==="stale").map(c=>c.cid)),p=await n.reingest(e);if(p.status==="unchanged"&&!i.resumeHeld)return{source_id:e,changed:!1,head:{status:p.status,before:f,after:p.cid},note:`nothing to reconcile \u2014 ${e} is unchanged`,skipped_arms:q,changeset:[],rows:[]};let g=i.resumeHeld?{minted:[],matched:[],held:i.resumeHeld}:await n.reextract(e),r=k(t),l=g.minted.map(c=>{let w=y(r,c);return{kind:"ADD",origin:"content-change",ref:w,reason:`new use-case extracted from ${e}`,provenance:`extraction commit \u2014 DERIVES ${e} @ ${C(p.cid)}`,action:`kane-cli design tests --use-case ${w}`}}),m=r.staleList().filter(c=>c.state==="stale"&&!o.has(c.cid)&&M(r,c.cid)).map(c=>c.cid),u=m.map(c=>{let w=y(r,c),E=ne.has(r.nodeLabel.get(c)??"");return{kind:"MODIFY",origin:"structural-stale",ref:w,reason:"stale (structural)",provenance:z(r,c),action:E?`kane-cli maintain evolve ${w}`:`kane-cli design explain ${w}`}}),d=[],a=[];for(let c of g.held?.rows??[])if(c.kind==="ADD")d.push({kind:"ADD",origin:"content-change",ref:c.title,held_ref:c.temp_ref,reason:`${c.why} (staged \u2014 commits on approval)`,provenance:`staged extraction of ${e} @ ${C(p.cid)}`,action:"approve to commit + design"});else{let w=c.matched_cid?r.tipOf(c.matched_cid):null,E=w?r.getNode(w)?.content.criteria??[]:[],T=(c.uc.updated?.criteria??[]).map(O=>typeof O=="string"?O:O.text),Z=[...T.filter(O=>!E.includes(O)),...c.uc.updated?.criteria!==void 0?E.filter(O=>!T.includes(O)):[]],P=w?W(r,w,Z):void 0;a.push({kind:"MODIFY",origin:"content-change",ref:c.matched_cid?y(r,c.matched_cid):c.title,held_ref:c.temp_ref,reason:`${c.why} (staged \u2014 commits on approval)`,provenance:`staged extraction of ${e} @ ${C(p.cid)}`,action:"approve to commit the updated version (old\u2192new redirect)",...P?{impact:P}:{}})}let h=new Set;for(let c of[...g.minted,...g.matched])h.add(r.tipOf(c));for(let c of g.held?.rows??[])c.matched_cid&&h.add(r.tipOf(c.matched_cid));for(let c of m){let w=X(r,r.tipOf(c));w&&r.nodeLabel.get(w)===v.USECASE&&h.add(r.tipOf(w))}let R=[];for(let c of await F(r,"design")){if(c.kind!=="no-verifies")continue;let w=r.resolve(c.ref);if(!w)continue;let E=X(r,w.tip);!E||!h.has(r.tipOf(E))||R.push({kind:"ADD",origin:"content-change",ref:c.ref,reason:c.why,provenance:`gaps engine (design) \u2014 uncovered AC of touched use-case ${y(r,E)}`,action:c.ready_command})}let b=[];for(let{cid:c}of r.byLabel(v.USECASE))M(r,c)&&r.stale(c)==="orphaned"&&b.push({kind:"REMOVE",ref:y(r,c),reason:"orphaned \u2014 no live source evidences this use-case",provenance:z(r,c),action:"plan-only \u2014 REMOVE is not executed in this release"});let S=new Set,_=[...l.sort($),...d.sort($),...R.sort($),...a.sort($),...u.sort($),...b.sort($)].filter(c=>{let w=`${c.kind}\0${c.ref}`;return S.has(w)?!1:(S.add(w),!0)});return{source_id:e,changed:!0,head:{status:p.status,before:f,after:p.cid},note:te,skipped_arms:q,changeset:le(t,s,r,e,p.cid,g.minted,g.held),rows:_,...g.held?{held:g.held}:{}}}function ye(t,e){return async n=>{let{ingestFile:i}=await import("./ingest-TTUQ7UDK.js"),{convertPdf:s}=await import("./pdf-convert-OZIRUADA.js"),{convertDocx:f}=await import("./docx-convert-BIV5T7F5.js"),o=await i({contextDir:t,filePath:e,asId:n,converters:{pdf:s,docx:f}});return{status:o.status,cid:o.cid}}}function be(t,e,n,i){return async()=>{let f=(i??(await import("./dispatch-
|
|
8
|
+
${o}`,truncated:!0}}function ae(t,e){let n=k(t),i=n.heads.get(e);if(typeof i!="string")return null;let s=[];for(let d of I(t).records){let a=d.source_head_moves?.[e];a!==void 0&&a!==s[s.length-1]&&s.push(a)}let f=s.lastIndexOf(i),o=f>0?s[f-1]:null;if(typeof o!="string"||o===i)return null;let p=D(t,n,o),g=D(t,n,i);if(p===null||g===null)return null;let{diff:r,truncated:l}=ce(re(p,g)),m=new Set,u=[];for(let d of n.edgesFrom(o))d.type!==x.DERIVES||n.nodeLabel.get(d.dst)!==v.USECASE||m.has(d.dst)||(m.add(d.dst),u.push({id:d.dst,title:String(n.getNode(d.dst)?.content.title??"")}));return{source_id:e,old_head:o,new_head:i,diff:r,...l?{truncated:!0}:{},prior_ucs:u}}function de(t,e,n){let i=t.getNode(e)?.content??{},s=t.getNode(n)?.content??{},o=[...new Set([...Object.keys(i),...Object.keys(s)])].sort().filter(p=>JSON.stringify(i[p])!==JSON.stringify(s[p]));return o.length>0?`updated: ${o.join(", ")}`:"updated"}function le(t,e,n,i,s,f,o){let p=new Set((o?.rows??[]).map(a=>a.matched_cid).filter(a=>!!a)),g=[];for(let[a,h]of n.superseded)h===null||a===h||e.superseded.has(a)||n.nodeLabel.get(a)===v.USECASE&&g.push({kind:"MODIFY",ref:y(n,a),old_cid:a,new_cid:h,summary:de(n,a,h)});let r=f.map(a=>({kind:"ADD",ref:y(n,a),cid:a}));for(let a of o?.rows??[])a.kind==="MODIFY"&&a.matched_cid?g.push({kind:"MODIFY",ref:y(n,a.matched_cid),old_cid:a.matched_cid,new_cid:null,summary:`${a.why} (staged)`}):a.kind==="ADD"&&r.push({kind:"ADD",ref:a.title,cid:null});let l=[],m=D(t,n,s),u=new Map;for(let{cid:a}of n.byLabel(v.USECASE)){if(!M(n,a)||p.has(a))continue;let h=n.derivesInto(a),R=h.filter(_=>String(_.props.source_id)===i);R.length===0||R.some(_=>_.props.source_cid===s)||R.some(_=>{let c=String(_.props.anchor),w=L(c);return w?.kind==="img-whole"?!1:w?.kind==="img-part"?oe(n,_,s):m!==null&&se(t,n,_,m,u)})||h.some(_=>{let c=String(_.props.source_id);if(c===i)return!1;let w=n.heads.get(c);return w!=null})||l.push({kind:"ARCHIVE",ref:y(n,a),cid:a,why:`evidence decayed: no quote from ${i} relocates into @${C(s)}, no other live source, no fresh evidence this run`,impact:W(n,n.tipOf(a))})}let d=(a,h)=>a.ref<h.ref?-1:a.ref>h.ref?1:0;return[...g.sort(d),...r.sort(d),...l.sort(d)]}function Ee(t,e,n,i,s){let f=e.rows.find(d=>d.temp_ref===n);if(!f)return{ok:!1,message:`held item ${n} missing from the plan artifact`};let o=f,p=k(t);if(o.matched_cid){let d=p.tipOf(o.matched_cid);if(p.superseded.get(d)===null)return{ok:!1,message:`use-case for "${o.title}" was retired meanwhile \u2014 nothing to update`};d!==o.matched_cid&&(o={...o,matched_cid:d,uc:{...o.uc,matches_existing:{cid:d}}})}let g=s?{edited:s}:"approve",r=ee(t,p,{source_id:e.source_id,...e.staged_source_cid!==void 0?{staged_source_cid:e.staged_source_cid}:{},rows:[o]},new Map([[o.temp_ref,g]]),i);if(r.errors)return{ok:!1,message:r.errors.map(d=>`${d.code}: ${d.detail}`).join("; ")};let l=k(t),m=o.matched_cid?l.tipOf(o.matched_cid):r.record?.nodes.find(d=>d.label==="usecase")?.cid??r.record?.review[0]?.id;return{ok:!0,ref:m?y(l,m):o.title,kind:o.kind}}async function Re(t,e,n,i={}){let s=k(t),f=s.heads.get(e)??null,o=new Set(s.staleList().filter(c=>c.state==="stale").map(c=>c.cid)),p=await n.reingest(e);if(p.status==="unchanged"&&!i.resumeHeld)return{source_id:e,changed:!1,head:{status:p.status,before:f,after:p.cid},note:`nothing to reconcile \u2014 ${e} is unchanged`,skipped_arms:q,changeset:[],rows:[]};let g=i.resumeHeld?{minted:[],matched:[],held:i.resumeHeld}:await n.reextract(e),r=k(t),l=g.minted.map(c=>{let w=y(r,c);return{kind:"ADD",origin:"content-change",ref:w,reason:`new use-case extracted from ${e}`,provenance:`extraction commit \u2014 DERIVES ${e} @ ${C(p.cid)}`,action:`kane-cli design tests --use-case ${w}`}}),m=r.staleList().filter(c=>c.state==="stale"&&!o.has(c.cid)&&M(r,c.cid)).map(c=>c.cid),u=m.map(c=>{let w=y(r,c),E=ne.has(r.nodeLabel.get(c)??"");return{kind:"MODIFY",origin:"structural-stale",ref:w,reason:"stale (structural)",provenance:z(r,c),action:E?`kane-cli maintain evolve ${w}`:`kane-cli design explain ${w}`}}),d=[],a=[];for(let c of g.held?.rows??[])if(c.kind==="ADD")d.push({kind:"ADD",origin:"content-change",ref:c.title,held_ref:c.temp_ref,reason:`${c.why} (staged \u2014 commits on approval)`,provenance:`staged extraction of ${e} @ ${C(p.cid)}`,action:"approve to commit + design"});else{let w=c.matched_cid?r.tipOf(c.matched_cid):null,E=w?r.getNode(w)?.content.criteria??[]:[],T=(c.uc.updated?.criteria??[]).map(O=>typeof O=="string"?O:O.text),Z=[...T.filter(O=>!E.includes(O)),...c.uc.updated?.criteria!==void 0?E.filter(O=>!T.includes(O)):[]],P=w?W(r,w,Z):void 0;a.push({kind:"MODIFY",origin:"content-change",ref:c.matched_cid?y(r,c.matched_cid):c.title,held_ref:c.temp_ref,reason:`${c.why} (staged \u2014 commits on approval)`,provenance:`staged extraction of ${e} @ ${C(p.cid)}`,action:"approve to commit the updated version (old\u2192new redirect)",...P?{impact:P}:{}})}let h=new Set;for(let c of[...g.minted,...g.matched])h.add(r.tipOf(c));for(let c of g.held?.rows??[])c.matched_cid&&h.add(r.tipOf(c.matched_cid));for(let c of m){let w=X(r,r.tipOf(c));w&&r.nodeLabel.get(w)===v.USECASE&&h.add(r.tipOf(w))}let R=[];for(let c of await F(r,"design")){if(c.kind!=="no-verifies")continue;let w=r.resolve(c.ref);if(!w)continue;let E=X(r,w.tip);!E||!h.has(r.tipOf(E))||R.push({kind:"ADD",origin:"content-change",ref:c.ref,reason:c.why,provenance:`gaps engine (design) \u2014 uncovered AC of touched use-case ${y(r,E)}`,action:c.ready_command})}let b=[];for(let{cid:c}of r.byLabel(v.USECASE))M(r,c)&&r.stale(c)==="orphaned"&&b.push({kind:"REMOVE",ref:y(r,c),reason:"orphaned \u2014 no live source evidences this use-case",provenance:z(r,c),action:"plan-only \u2014 REMOVE is not executed in this release"});let S=new Set,_=[...l.sort($),...d.sort($),...R.sort($),...a.sort($),...u.sort($),...b.sort($)].filter(c=>{let w=`${c.kind}\0${c.ref}`;return S.has(w)?!1:(S.add(w),!0)});return{source_id:e,changed:!0,head:{status:p.status,before:f,after:p.cid},note:te,skipped_arms:q,changeset:le(t,s,r,e,p.cid,g.minted,g.held),rows:_,...g.held?{held:g.held}:{}}}function ye(t,e){return async n=>{let{ingestFile:i}=await import("./ingest-TTUQ7UDK.js"),{convertPdf:s}=await import("./pdf-convert-OZIRUADA.js"),{convertDocx:f}=await import("./docx-convert-BIV5T7F5.js"),o=await i({contextDir:t,filePath:e,asId:n,converters:{pdf:s,docx:f}});return{status:o.status,cid:o.cid}}}function be(t,e,n,i){return async()=>{let f=(i??(await import("./dispatch-FRCPK3AZ.js")).findProvider)(e);if(!f)throw new Error(`the remote re-ingest failed \u2014 no provider matches '${e}'`);let o=await f.ingest(e,void 0,{out:n.out,err:n.err,confirm:async()=>!0,isTTY:!1},t,void 0);if(o.code!==0||!o.result)throw new Error("the remote re-ingest failed \u2014 fix the reported problem and re-run");return{status:o.result.status,cid:o.result.source_cid}}}function xe(t,e={}){return async n=>{let i=[],[{runExtract:s},{resolveAgentAuthEnv:f},{runAgent:o},{preflightTurn:p}]=await Promise.all([import("./run-EOTOXNQO.js"),import("./spawner-X2FOOONV.js"),import("./bridge-KMDML2NB.js"),import("./turn-preflight-JGYT7LXP.js")]),g=await f(),r=new Set(k(t).byLabel(v.USECASE).map(S=>S.cid)),l=ae(t,n)??void 0,m=0,u=await s({mode:"override",source:n,...l?{changeContext:l}:{}},{contextDir:t,agent:o,preflightTurn:()=>p(g),ask:async()=>[],review:async S=>{if(!e.stage)return new Map(S.map(c=>[c.temp_ref,{resolution:c.matches_existing&&c.changed?"edited":"skipped"}]));let _=new Map;for(let c of S){if(c.matches_existing&&!c.changed){_.set(c.temp_ref,{resolution:"skipped"});continue}i.push({kind:c.matches_existing?"MODIFY":"ADD",temp_ref:c.temp_ref,title:c.title,why:c.matches_existing?`updated: ${Object.keys(c.updated??{}).join(", ")||"content"}`:`newly extracted from ${n}`,...c.matches_existing?{matched_cid:c.matches_existing.cid,updated:c.updated}:{},uc:c}),_.set(c.temp_ref,{resolution:"rejected"})}return _},confirmStale:async()=>!1,out:S=>e.hostOut?.(S),progress:S=>e.hostProgress?.(S),emit:S=>{S.type==="commit"&&typeof S.assumed=="number"&&(m+=S.assumed),e.hostEmit?.(S)},isTTY:!1,auth:g});if(u!==0)throw new Error(`reconcile: re-extract of ${n} failed (exit ${u})`);let d=k(t),a=d.heads.get(n),h=[],R=[];if(typeof a=="string"){let S=new Set;for(let _ of d.edgesFrom(a))_.type!==x.DERIVES||d.nodeLabel.get(_.dst)!==v.USECASE||S.has(_.dst)||(S.add(_.dst),!(e.stage&&d.trust.get(_.dst)==="archived")&&(r.has(_.dst)?R:h).push(_.dst))}let b=k(t).heads.get(n);return{minted:h,matched:R,defaultsTaken:m,...e.stage?{held:{source_id:n,...b!=null?{staged_source_cid:b}:{},rows:i}}:{}}}}export{ee as a,W as b,q as c,te as d,M as e,X as f,ne as g,re as h,ce as i,ae as j,Ee as k,Re as l,ye as m,be as n,xe as o};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as V,c as H,d as W,e as ie,f as se}from"./chunk-
|
|
2
|
+
import{b as V,c as H,d as W,e as ie,f as se}from"./chunk-I75FRXKE.js";import{a as le}from"./chunk-EXLXV5OU.js";import{c as te}from"./chunk-IZU5ND2C.js";import{a as oe}from"./chunk-ZOSY2PJM.js";import{a as re}from"./chunk-VYMMGWVO.js";import{b as Z}from"./chunk-QD2BUO5M.js";import{b as ee}from"./chunk-7KIIM6H7.js";import{a as I}from"./chunk-BPMSNGXQ.js";import{a as T,b as j,d as ne}from"./chunk-VE3SUJMA.js";import{b as Q}from"./chunk-TZXXJWHA.js";import{r as C}from"./chunk-RSSOJ3L2.js";import{b as Y}from"./chunk-PWRIG6UB.js";import{i as J}from"./chunk-Z7S3IWUX.js";import{a as D}from"./chunk-NUWOQS6L.js";import{a as B,e as K}from"./chunk-EYOCNMUM.js";import{a as z}from"./chunk-3M2D7UUI.js";import{a as q}from"./chunk-HCBYKLMW.js";import{a as c,b as u,i as L,j as G}from"./chunk-C44QQJR4.js";import{a as ve}from"./chunk-6YGTRKDT.js";import{e as F}from"./chunk-UR6MHSHU.js";var s=F(ve(),1);import{basename as he}from"path";var n=F(q(),1);function Ge({resultRef:x,mode:g="singleshot",loginCompleteRef:d}){let{exit:m}=G(),A=(0,s.useRef)(new z),E=(0,s.useRef)(new oe),v=(0,s.useRef)(new te),o=A.current,l=E.current,O=v.current,ae=V(),[h,f]=(0,s.useState)(g==="login"?"login":"gate"),[M,ce]=(0,s.useState)(null),[Pe,R]=(0,s.useState)(null),[we,$]=(0,s.useState)(null),[X,ue]=(0,s.useState)(null),[N,_]=(0,s.useState)([]),P=(0,s.useCallback)((e,t,i,r)=>O.log(e,t,i,r),[O]),be=(0,s.useCallback)((e,t)=>{e?T(o,l,e,t):l.save({project_id:null,project_name:null,folder_id:null,folder_name:null})},[o,l]),y=(0,s.useCallback)(()=>{if(g==="login")d&&(d.current=!0),m();else{let e=l.load().mobile,t=B(e?.tui_target,e?.default_target?.kind),i=(t.kind==="unset"||t.kind==="choose-mobile")&&Q();f(i?"target":"input")}},[g,m,d,l]),S=(0,s.useCallback)((e,t)=>{let i=T(o,l,e,t);if(g==="login"){f("ensure-project");return}ne(i)?y():i.projectId?f("ensure-folder"):f("ensure-project")},[o,l,y,g]);L((e,t)=>{t.ctrl&&e==="c"&&C(0,"Ctrl+C exit")});let U=(0,s.useRef)(!1);s.default.useEffect(()=>{U.current||(U.current=!0,g!=="login"&&se(o,P).then(e=>{ce(e),e.status==="authenticated"?S(e.result.profile,e.result.env):e.status==="needs_pick"?f("pick"):(R(e.profile??null),$(e.env??null),f("login"))}).catch(e=>{ue(`Auth check failed: ${e instanceof Error?e.message:String(e)}`)}))},[o,P]);let fe=(0,s.useCallback)(e=>{x.current={objective:e},m()},[x,m]),de=(0,s.useCallback)(async(e,t)=>{o.setActiveProfile(e),o.setDefaultEnv(t),(await ie(o,e,t,P)).status==="authenticated"?S(e,t):(R(e),$(t),f("login"))},[o,P,S]),w=(0,s.useCallback)(()=>{let e=o.getActiveProfile(),t=o.getDefaultEnv();if(!e)return null;let i=D(t),r=o.loadBasicAuth(e,t);return new re(i.controllerBaseUrl,async()=>o.loadCredentials(e,t)?.access_token??null,r,P)},[o,P]),ge=(0,s.useCallback)(async()=>{let e=w();if(!e)return null;let t=e.cached??await e.resolve();if(!t)return null;let i=D(o.getDefaultEnv()),r=new I(i.tmsBaseUrl,t.username,t.access_key);try{let p=(await r.listProjects()).find(k=>k.name==="KaneAI Generated");if(p)return{id:p.project_id,name:p.name};let b=await r.createProject("KaneAI Generated");return{id:b.id,name:b.name}}catch{return null}},[w,o]),pe=(0,s.useCallback)(async e=>{let t=w();if(!t)return null;let i=t.cached??await t.resolve();if(!i)return null;let r=D(o.getDefaultEnv()),a=new I(r.tmsBaseUrl,i.username,i.access_key);try{let b=(await a.listFolders(e)).find(me=>me.name==="Untitled");if(b)return{id:b.id,name:b.name};let k=await a.createFolder(e,"Untitled");return{id:k.id,name:k.name}}catch{return null}},[w,o]);if(h==="gate")return(0,n.jsx)(c,{paddingX:1,children:(0,n.jsx)(u,{color:"yellow",children:"Checking authentication..."})});if(X)return(0,n.jsxs)(c,{flexDirection:"column",paddingX:1,children:[(0,n.jsx)(u,{color:"red",children:X}),(0,n.jsx)(u,{color:"gray",children:"Press Ctrl+C to exit."})]});if(h==="pick"&&M?.status==="needs_pick")return(0,n.jsx)(xe,{profiles:M.profiles,onSelect:de});if(h==="login")return(0,n.jsx)(W,{devMode:process.env.KANE_DEV_MODE==="1",profiles:o.listProfiles(),onBasicLogin:async(e,t,i,r)=>{let{validateBasicAuth:a}=await import("./validate-basic-GTSVZFQI.js");await a(t,i,r),o.saveBasicAuth(e,t,{username:i,access_key:r}),o.setActiveProfile(e),o.setDefaultEnv(t)},onOAuthLogin:async(e,t)=>{let{LoginFlow:i}=await import("./login-flow-ODVWEPRU.js");o.setDefaultEnv(t),o.setActiveProfile(e),await new i(e,t,o).login()},onComplete:(e,t)=>{R(e),$(t),o.setActiveProfile(e),o.setDefaultEnv(t),S(e,t)},onCancel:()=>{C(0,"Login cancelled")}});if(h==="ensure-project"){let e=o.getActiveProfile()??"default",t=o.getDefaultEnv(),i=()=>{if(g==="login"){f("ensure-folder");return}T(o,l,e,t).folderId?y():f("ensure-folder")};return(0,n.jsxs)(c,{flexDirection:"column",children:[(0,n.jsx)(c,{paddingX:1,marginBottom:1,children:(0,n.jsx)(u,{color:"yellow",children:"Project & folder are required to save tests \xB7 Esc to use defaults \xB7 Ctrl+C to exit"})}),(0,n.jsx)(Z,{resolver:w(),currentProjectId:l.load().project_id,env:t,onSelect:(r,a)=>{j(o,l,e,t,{projectId:r,projectName:a}),_(p=>[...p,`\u2713 Project: ${a} (${r})`]),i()},onCancel:async()=>{let r=await ge();r&&(j(o,l,e,t,{projectId:r.id,projectName:r.name}),_(a=>[...a,`\u2713 Default project: ${r.name} (${r.id})`]),i())}})]})}if(h==="ensure-folder"){let e=o.getActiveProfile()??"default",t=o.getDefaultEnv(),i=o.loadProfileConfig(e,t);return(0,n.jsxs)(c,{flexDirection:"column",children:[(0,n.jsx)(c,{paddingX:1,marginBottom:1,children:(0,n.jsx)(u,{color:"yellow",children:"Project & folder are required to save tests \xB7 Esc to use defaults \xB7 Ctrl+C to exit"})}),(0,n.jsx)(ee,{resolver:w(),projectId:i?.project_id??"",currentFolderId:l.load().folder_id,env:t,onSelect:(r,a)=>{j(o,l,e,t,{folderId:r,folderName:a}),_(p=>[...p,`\u2713 Folder: ${a} (${r})`]),y()},onCancel:async()=>{if(!i?.project_id)return;let r=await pe(i.project_id);r&&(j(o,l,e,t,{folderId:r.id,folderName:r.name}),_(a=>[...a,`\u2713 Default folder: ${r.name} (${r.id})`]),y())}})]})}if(h==="target"){let e=B(l.load().mobile?.tui_target,l.load().mobile?.default_target?.kind).kind==="choose-mobile";return(0,n.jsx)(c,{paddingX:1,children:(0,n.jsx)(le,{mode:e?"mobile-only":"all",onSelect:t=>{l.setMobile({tui_target:t}),f("input")},onCancel:()=>f("input")})})}if(h==="input"){let e=l.load().mobile,t=B(e?.tui_target,e?.default_target?.kind),i=(()=>{if(t.kind==="emulator"||t.kind==="simulator"){let r=J(e?.default_target)??"(no device)",a=e?.default_app?Y(e.default_app)?e.default_app:he(e.default_app):"(no app)";return`Config: ${K(t.kind)} \xB7 ${r} \xB7 ${a}`}return"Config: Desktop \xB7 Chrome"})();return(0,n.jsxs)(c,{flexDirection:"column",children:[N.length>0&&(0,n.jsx)(c,{flexDirection:"column",paddingX:1,marginBottom:1,children:N.map((r,a)=>(0,n.jsx)(u,{color:"green",children:r},a))}),(0,n.jsx)(c,{paddingX:1,children:(0,n.jsx)(u,{color:"gray",children:i})}),(0,n.jsx)(H,{onSubmit:fe,onEscape:()=>C(0,"User pressed Escape"),history:ae,placeholder:"Type an objective..."})]})}return(0,n.jsx)(n.Fragment,{})}function xe({profiles:x,onSelect:g}){let[d,m]=(0,s.useState)(0),[A,E]=(0,s.useState)(!1);return L((v,o)=>{if(!A){if(o.escape){C(0,"Profile picker cancelled");return}if(o.upArrow&&d>0&&m(l=>l-1),o.downArrow&&d<x.length-1&&m(l=>l+1),o.return){E(!0);let l=x[d];g(l.profile,l.env).catch(()=>E(!1))}}}),(0,n.jsxs)(c,{flexDirection:"column",paddingX:1,children:[(0,n.jsx)(u,{color:"#ff9500",bold:!0,children:"Select a profile:"}),(0,n.jsx)(c,{marginTop:1,flexDirection:"column",children:x.map((v,o)=>(0,n.jsxs)(u,{children:[o===d?"\u276F ":" ",(0,n.jsx)(u,{color:o===d?"#ff9500":"white",bold:o===d,children:v.profile}),(0,n.jsxs)(u,{color:"gray",children:[" [",v.env,"]"]})]},`${v.profile}-${v.env}`))}),A&&(0,n.jsx)(c,{marginTop:1,children:(0,n.jsx)(u,{color:"yellow",children:"Validating credentials..."})})]})}export{Ge as a};
|