@testmuai/kane-cli 0.8.11 → 0.8.12
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-YFJDAXOG.js → ChatSurface-DALSIICW.js} +1 -1
- package/dist/{ChromeProfilePicker-PUCZN6WU.js → ChromeProfilePicker-ZMVZH3AK.js} +1 -1
- package/dist/{CliFeedbackPrompt-JAIB5MHS.js → CliFeedbackPrompt-K66H7YE6.js} +1 -1
- package/dist/{CliUploadProgress-53LQMQJD.js → CliUploadProgress-5DZHZY4M.js} +1 -1
- package/dist/{ConfigView-7HFP4OXS.js → ConfigView-S5KBV62S.js} +1 -1
- package/dist/EvidenceViewOffer-UACWB3YJ.js +2 -0
- package/dist/FolderPicker-YH5TKMX3.js +2 -0
- package/dist/{InfoBox-62YG3YNQ.js → InfoBox-7PAM2FQH.js} +1 -1
- package/dist/{LinksBox-6NS3GHWO.js → LinksBox-2NVZ3FHJ.js} +1 -1
- package/dist/{ProfilesView-HIKK2HPC.js → ProfilesView-SIUBF7IU.js} +1 -1
- package/dist/{ProjectPicker-2CJMO5TD.js → ProjectPicker-5NI554X3.js} +1 -1
- package/dist/{SaveSessionPrompt-4DTPZSXD.js → SaveSessionPrompt-5OULBV5N.js} +1 -1
- package/dist/SingleShotApp-LA3EMPUK.js +2 -0
- package/dist/{SummaryBox-A6LKKQXJ.js → SummaryBox-GTGF3CBO.js} +1 -1
- package/dist/TestMdRunView-5MNKJJMS.js +2 -0
- package/dist/{TestrunEvidenceTable-7SCCTZPH.js → TestrunEvidenceTable-7WBCOGYW.js} +1 -1
- package/dist/{WhoamiView-PDMQ6F5N.js → WhoamiView-E2SVBHLC.js} +1 -1
- package/dist/{app-download-K2ELUXWR.js → app-download-SAXSYXIV.js} +1 -1
- package/dist/{auth-5WJSFLCP.js → auth-3LLVDHOJ.js} +1 -1
- package/dist/{binary-QVQRWQFK.js → binary-WSMIRJNC.js} +1 -1
- package/dist/{bind-5WELCZ4S.js → bind-A3M4PV4V.js} +3 -3
- package/dist/{bootstrap-3LNHRDQH.js → bootstrap-QTVHGL45.js} +1 -1
- package/dist/bridge-E2C5VV3H.js +2 -0
- package/dist/{changelog-TK6DWFVW.js → changelog-CNYWOB2V.js} +1 -1
- package/dist/{chat-committer-MAW25ICC.js → chat-committer-RAOIL2T6.js} +1 -1
- package/dist/chat-controller-YJCNU76T.js +2 -0
- package/dist/{chunk-5LEO463W.js → chunk-24QPDHRD.js} +1 -1
- package/dist/{chunk-DLJIML73.js → chunk-2LXJ2ZM3.js} +1 -1
- package/dist/{chunk-GSNGC7HI.js → chunk-2MTAXT2U.js} +1 -1
- package/dist/{chunk-5NBT5IVT.js → chunk-3CCD434H.js} +1 -1
- package/dist/{chunk-K6BWPGBO.js → chunk-3G3LY6BM.js} +1 -1
- package/dist/{chunk-2E55VQYA.js → chunk-3N2YOHD6.js} +1 -1
- package/dist/{chunk-OC7TJTQG.js → chunk-3OU2F34I.js} +1 -1
- package/dist/{chunk-DHWS7SLT.js → chunk-3XWKKSIM.js} +2 -2
- package/dist/{chunk-TB2CCKL7.js → chunk-43DM2I6Q.js} +1 -1
- package/dist/{chunk-WRVDIZAI.js → chunk-4ASRA7CD.js} +2 -2
- package/dist/{chunk-ZMJD3CI7.js → chunk-4E4GJPEM.js} +1 -1
- package/dist/{chunk-CABRAZOL.js → chunk-4O6XBS5G.js} +1 -1
- package/dist/{chunk-DJJO4IHY.js → chunk-4T35SA2O.js} +1 -1
- package/dist/{chunk-YSNBXUM6.js → chunk-4TZSEC2C.js} +1 -1
- package/dist/{chunk-3D7VYEDP.js → chunk-54JZ6VEW.js} +1 -1
- package/dist/{chunk-FIODM24X.js → chunk-5A4QG7ZM.js} +1 -1
- package/dist/{chunk-A76UL3EN.js → chunk-5AHOVOWV.js} +1 -1
- package/dist/{chunk-6DOS5CJ5.js → chunk-5FYO3PFG.js} +1 -1
- package/dist/{chunk-QHSF2CXK.js → chunk-5G22NOZK.js} +1 -1
- package/dist/{chunk-47WY2637.js → chunk-5KLDW3ZW.js} +58 -57
- package/dist/{chunk-7P3JGF2X.js → chunk-6A47PRDS.js} +1 -1
- package/dist/{chunk-FYLMTZ3J.js → chunk-6FCPS2VT.js} +1 -1
- package/dist/{chunk-A4BDLZOD.js → chunk-75HF3GPO.js} +1 -1
- package/dist/{chunk-BE4FBVKY.js → chunk-7KAPHA56.js} +1 -1
- package/dist/{chunk-3FJNTRAS.js → chunk-7NXHVC7G.js} +1 -1
- package/dist/{chunk-Y4ODYIOP.js → chunk-7R5K4IGS.js} +1 -1
- package/dist/{chunk-JJJREAFQ.js → chunk-7RFGO3TH.js} +1 -1
- package/dist/{chunk-NVRXDLJN.js → chunk-AFNDJK2A.js} +1 -1
- package/dist/{chunk-X6WB2QTT.js → chunk-AHRL4E3M.js} +1 -1
- package/dist/{chunk-7KRCBN6X.js → chunk-APZCLVZD.js} +1 -1
- package/dist/{chunk-4VZRBBLF.js → chunk-ASYWKYTQ.js} +1 -1
- package/dist/{chunk-QIRZBOKA.js → chunk-COVIEKZN.js} +1 -1
- package/dist/{chunk-HJBORIFP.js → chunk-CQ3ZQ5UK.js} +3 -3
- package/dist/{chunk-4FXSDPQW.js → chunk-DYXYNH6X.js} +1 -1
- package/dist/{chunk-OKBEMFAW.js → chunk-EEFZXZTZ.js} +1 -1
- package/dist/{chunk-DP7GPS6S.js → chunk-EV64VI66.js} +1 -1
- package/dist/{chunk-7HUJVIMO.js → chunk-F2CET54H.js} +2 -2
- package/dist/{chunk-NYUMJDCE.js → chunk-FAREJ4P2.js} +1 -1
- package/dist/{chunk-CRPBARFG.js → chunk-FBYB3SRE.js} +1 -1
- package/dist/{chunk-TSW5A7W3.js → chunk-FHYG3QLL.js} +1 -1
- package/dist/{chunk-NLSR2IFN.js → chunk-G2Q2TP3O.js} +1 -1
- package/dist/{chunk-F7R6A6P5.js → chunk-G52YPXKT.js} +1 -1
- package/dist/{chunk-XB7EMX6J.js → chunk-GNAPBOAJ.js} +1 -1
- package/dist/chunk-GRDYYYIQ.js +2 -0
- package/dist/{chunk-2ZBY2GME.js → chunk-H6NHARB4.js} +1 -1
- package/dist/chunk-H6VS5RYO.js +11 -0
- package/dist/{chunk-3PMEHGH3.js → chunk-HPUQJRDX.js} +1 -1
- package/dist/{chunk-GV5BX2IQ.js → chunk-HWHLKBUT.js} +1 -1
- package/dist/{chunk-VGLY4HWA.js → chunk-I57TM22L.js} +1 -1
- package/dist/{chunk-OGJ6ZSLC.js → chunk-IE4BCGUE.js} +1 -1
- package/dist/{chunk-M3Q7IQMS.js → chunk-IGW77FMB.js} +1 -1
- package/dist/{chunk-B7K5WOOU.js → chunk-IVQX3AKL.js} +1 -1
- package/dist/{chunk-ZES42R57.js → chunk-IWVA37B6.js} +1 -1
- package/dist/{chunk-CQKKDIKA.js → chunk-JDGBRACP.js} +1 -1
- package/dist/{chunk-Z6GMZOVL.js → chunk-JOATASPP.js} +3 -3
- package/dist/{chunk-S63XGGBE.js → chunk-KAZGHWGK.js} +1 -1
- package/dist/{chunk-Z4QLCWLB.js → chunk-KGKJU27A.js} +1 -1
- package/dist/{chunk-JAO7TZBV.js → chunk-L2BCQQLJ.js} +1 -1
- package/dist/{chunk-OKCULEBD.js → chunk-L7GAZQYL.js} +1 -1
- package/dist/{chunk-7B7OSHPX.js → chunk-LLY7TQSI.js} +1 -1
- package/dist/{chunk-CBLUNSF4.js → chunk-M4WSRYRA.js} +1 -1
- package/dist/{chunk-FQRWYXFG.js → chunk-MMQLVGUJ.js} +1 -1
- package/dist/{chunk-6GH4DRKR.js → chunk-N7Z7BQYO.js} +1 -1
- package/dist/{chunk-DEUDRSU7.js → chunk-NJJQL54J.js} +1 -1
- package/dist/{chunk-GMXM4WHF.js → chunk-NSD2H67E.js} +1 -1
- package/dist/{chunk-YELGHSVH.js → chunk-O5U6EAL3.js} +1 -1
- package/dist/{chunk-4VYWTTT4.js → chunk-O7U5BVX5.js} +2 -2
- package/dist/{chunk-4AZ7IG2A.js → chunk-QZRHXGNI.js} +1 -1
- package/dist/{chunk-SNKFWPEM.js → chunk-RV7Q4RUV.js} +2 -2
- package/dist/{chunk-IX4FH5W6.js → chunk-SA6EDKUF.js} +1 -1
- package/dist/{chunk-O7RB4X6I.js → chunk-SACCB44S.js} +2 -2
- package/dist/{chunk-2QSG5ZG6.js → chunk-TLFNUXKS.js} +1 -1
- package/dist/chunk-U27OWZPW.js +368 -0
- package/dist/{chunk-HFRMJP2P.js → chunk-U2CIXGZR.js} +1 -1
- package/dist/{chunk-G5ZGEZCA.js → chunk-UDFDTFBL.js} +1 -1
- package/dist/{chunk-TYRTD5DD.js → chunk-UH2ZTX4E.js} +1 -1
- package/dist/{chunk-CL3AMEK6.js → chunk-UZXCCO7V.js} +1 -1
- package/dist/{chunk-YQ4MRF57.js → chunk-VDM3TWF6.js} +4 -4
- package/dist/{chunk-ASK4AZFC.js → chunk-VG7BTA5G.js} +1 -1
- package/dist/{chunk-R4EGL7VM.js → chunk-W3Z7AZNT.js} +1 -1
- package/dist/{chunk-VUOAFV27.js → chunk-WHYEXCTG.js} +1 -1
- package/dist/{chunk-HULEZ3D3.js → chunk-WIAZN7G4.js} +1 -1
- package/dist/{chunk-M7CGNE2D.js → chunk-WMVPJWWA.js} +1 -1
- package/dist/{chunk-4SXJKDHO.js → chunk-X6APRDUM.js} +2 -2
- package/dist/{chunk-OXHMUZJV.js → chunk-XMTSHHYQ.js} +1 -1
- package/dist/{chunk-B7TJIUKZ.js → chunk-XWO5MDEU.js} +1 -1
- package/dist/{chunk-AXW3WDFO.js → chunk-YF26DH4Z.js} +1 -1
- package/dist/{chunk-W7NI6JCF.js → chunk-YTAAF62A.js} +1 -1
- package/dist/{chunk-XYSFPVJX.js → chunk-ZVJGHQNG.js} +1 -1
- package/dist/{chunk-NGASEXVA.js → chunk-ZVZHE7KH.js} +2 -2
- package/dist/{chunk-W4IRHQGO.js → chunk-ZXN67F4U.js} +1 -1
- package/dist/{chunk-URLZULC7.js → chunk-ZZI4Y3CX.js} +1 -1
- package/dist/{committer-42AFWMEX.js → committer-C6UCDYMC.js} +1 -1
- package/dist/{config-KU2UICMC.js → config-HUK7V364.js} +1 -1
- package/dist/{cover-cmd-HAOBK2IC.js → cover-cmd-5LPHIOSI.js} +1 -1
- package/dist/{credentials-BEC4I5SE.js → credentials-6DP4KAMJ.js} +1 -1
- package/dist/{deps-bundle-EY5T7OH3.js → deps-bundle-PZNXSKLC.js} +1 -1
- package/dist/{deps-resolve-MPLFFCZZ.js → deps-resolve-62XK3LKV.js} +1 -1
- package/dist/design-committer-UPC6NZUF.js +2 -0
- package/dist/dispatch-7JCKGQVC.js +2 -0
- package/dist/{doctor-JBXA6WNL.js → doctor-ZQQ4VMPY.js} +1 -1
- package/dist/docx-convert-BIV5T7F5.js +1 -1
- package/dist/{dossier-WSWXZAPL.js → dossier-Y6TJWFZU.js} +1 -1
- package/dist/{evidence-MJV3PY2J.js → evidence-YAXIWZ6A.js} +1 -1
- package/dist/evolve-cmd-5ACHYQPE.js +2 -0
- package/dist/explain-3HAZY7Q6.js +2 -0
- package/dist/{explain-cmd-BXFR5DB6.js → explain-cmd-RMJPXD4U.js} +1 -1
- package/dist/{explain-cmd-IRQ2YX5L.js → explain-cmd-XCRO4AS6.js} +1 -1
- package/dist/{extract-bind-PPMY4FFA.js → extract-bind-BF2G6AS6.js} +3 -3
- package/dist/{extract-cmd-RHVLPNQB.js → extract-cmd-IPBCCR3T.js} +2 -2
- package/dist/{feeder-52VBZY3R.js → feeder-IOR3XRNF.js} +1 -1
- package/dist/{gaps-cmd-MSDGU6OU.js → gaps-cmd-3WXL6PAW.js} +1 -1
- package/dist/{generate-headless-NSK32S53.js → generate-headless-CLMSXEAS.js} +2 -2
- package/dist/index.js +115 -110
- package/dist/ingest-TTUQ7UDK.js +2 -0
- package/dist/ingest-cmd-KP5M6XTA.js +2 -0
- package/dist/install-5VWCH5GW.js +2 -0
- package/dist/{interactive-bind-4FNW3OYT.js → interactive-bind-MOV2VWHJ.js} +4 -4
- package/dist/{lifecycle-cmd-HYNG5KH6.js → lifecycle-cmd-KSMETBPP.js} +1 -1
- package/dist/{list-cmd-Y4WEOT3E.js → list-cmd-V3HJ5K4O.js} +1 -1
- package/dist/{list-commands-CJCEW7MQ.js → list-commands-KUDSKVP5.js} +1 -1
- package/dist/{logical-ids-N3UZACB4.js → logical-ids-MLXAH45L.js} +1 -1
- package/dist/login-flow-GZ3XHVCS.js +2 -0
- package/dist/{maintenance-cmd-UJNH47SG.js → maintenance-cmd-VFYGKY3X.js} +1 -1
- package/dist/{mobile-prompts-SJZVJWSB.js → mobile-prompts-WJVFBWW5.js} +1 -1
- package/dist/objective-variable-gate-GCQYYM77.js +2 -0
- package/dist/{persist-recorded-session-FWBAOQEF.js → persist-recorded-session-MHLD4A32.js} +1 -1
- package/dist/{phase-seed-2WI7KUYO.js → phase-seed-BMOSAA74.js} +1 -1
- package/dist/pipeline-G7KWRK2G.js +2 -0
- package/dist/prepare-target-SQ5IGKXD.js +2 -0
- package/dist/readmodel-TDRFVDVI.js +2 -0
- package/dist/reconcile-cmd-NI3AYU3Y.js +2 -0
- package/dist/{reconcile-deps-GMQA6ULT.js → reconcile-deps-DCHUFIEC.js} +2 -2
- package/dist/{reconcile-engine-XLLYS5ZB.js → reconcile-engine-QXUKUKSL.js} +1 -1
- package/dist/{recording-banner-CQBXZMT3.js → recording-banner-4H4AL6YN.js} +1 -1
- package/dist/{records-EW4PIJ5W.js → records-JLS63SDI.js} +1 -1
- package/dist/registry-R6QNPI5E.js +2 -0
- package/dist/{require-project-folder-K3E3QIOZ.js → require-project-folder-G2G4WKWW.js} +1 -1
- package/dist/{resolve-run-intent-3CENNCF3.js → resolve-run-intent-MZRPYN4V.js} +1 -1
- package/dist/{resolver-PSNP72H4.js → resolver-X5NHNX5O.js} +1 -1
- package/dist/{revert-RXHWWUMQ.js → revert-PRR3D4XM.js} +1 -1
- package/dist/{review-cmd-JUOWTME4.js → review-cmd-SAGIKWEW.js} +1 -1
- package/dist/run-PBS2J4N4.js +2 -0
- package/dist/run-VTUYLPSG.js +2 -0
- package/dist/{run-test-md-XBM6RMCI.js → run-test-md-4VRH7FU5.js} +2 -2
- package/dist/{sessions-cmd-PGE6LP2W.js → sessions-cmd-VDQGRBEM.js} +1 -1
- package/dist/{skill-installer-FBOPYFYS.js → skill-installer-WPW6NDCR.js} +1 -1
- package/dist/{spawner-URQ5OAY7.js → spawner-R3XOP3GP.js} +1 -1
- package/dist/{structured-answers-BZWJUX22.js → structured-answers-YAVW65G4.js} +1 -1
- package/dist/tcg-generate-HIC5AA3L.js +2 -0
- package/dist/testmd-actions-VOSP7L74.js +2 -0
- package/dist/{testmd-sync-TPUBEORI.js → testmd-sync-GNCDKPQN.js} +1 -1
- package/dist/token-refresh-GSFVJ6GU.js +2 -0
- package/dist/{validate-basic-BXBHTTTO.js → validate-basic-YNGP5JFB.js} +1 -1
- package/dist/variable-receipt-2VCUG7NN.js +2 -0
- package/dist/verdicts-PRXUKSDV.js +2 -0
- package/dist/{version-check-BGHE3LAK.js → version-check-GUGRBTIH.js} +1 -1
- package/dist/{view-cmd-XD5ENSML.js → view-cmd-SXXNDZIC.js} +1 -1
- package/dist/{walk-session-EYBUURRA.js → walk-session-G3DLBR24.js} +1 -1
- package/dist/{with-telemetry-L3SO6J3L.js → with-telemetry-5Y2CVPXK.js} +1 -1
- package/package.json +11 -11
- package/dist/EvidenceViewOffer-2T2ZGHIF.js +0 -2
- package/dist/FolderPicker-LTQW4YNR.js +0 -2
- package/dist/SingleShotApp-KXZF5ZJM.js +0 -2
- package/dist/TestMdRunView-6X6W5YAP.js +0 -2
- package/dist/bridge-WFSSMJ57.js +0 -2
- package/dist/chat-controller-6GW2HSJP.js +0 -2
- package/dist/chunk-2KQF6WLX.js +0 -363
- package/dist/design-committer-2BQVZPO4.js +0 -2
- package/dist/dispatch-NE35HS5F.js +0 -2
- package/dist/evolve-cmd-I4Z6IPIM.js +0 -2
- package/dist/explain-O3A2HZWD.js +0 -2
- package/dist/ingest-WTPY2VLS.js +0 -2
- package/dist/ingest-cmd-GOPW3SNF.js +0 -2
- package/dist/install-BDHZVEY4.js +0 -2
- package/dist/login-flow-DLG2WHSZ.js +0 -2
- package/dist/pipeline-B2TYZBMB.js +0 -2
- package/dist/prepare-target-JGVB7OKC.js +0 -2
- package/dist/readmodel-YDLGQDMH.js +0 -2
- package/dist/reconcile-cmd-6ILIXD3U.js +0 -2
- package/dist/registry-AA5YIO5Y.js +0 -2
- package/dist/run-6CMGGU2W.js +0 -2
- package/dist/run-PZIYMD35.js +0 -2
- package/dist/tcg-generate-BPLQ7WJ5.js +0 -2
- package/dist/testmd-actions-WJS2YM7B.js +0 -2
- package/dist/token-refresh-IT4LVE2H.js +0 -2
- package/dist/verdicts-J5MJHUGG.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as wn,b as me,c as It,d as $n,e as Dt,g as rt,h as it,i as Cn,j as Rn,l as Sn,m as Bt,n as In}from"./chunk-2QSG5ZG6.js";import{a as le,b as Oe,c as vn}from"./chunk-6J5T5FEY.js";import{b as Rt}from"./chunk-UJZZDPDY.js";import{a as yn}from"./chunk-YELGHSVH.js";import{a as tt}from"./chunk-ZES42R57.js";import{a as xn,b as kn,c as bn}from"./chunk-AXTPNZPX.js";import"./chunk-L2TV4G56.js";import"./chunk-B7K5WOOU.js";import{a as nt,d as _e,e as Tn,f as St}from"./chunk-RKXHVP2Z.js";import{a as gn,b as hn,c as pn}from"./chunk-FQRWYXFG.js";import"./chunk-NVGBE2DR.js";import{a as dn}from"./chunk-5Y2G4NC7.js";import"./chunk-R4EGL7VM.js";import"./chunk-JQW2QFSX.js";import"./chunk-FYLMTZ3J.js";import"./chunk-TYRTD5DD.js";import"./chunk-OXHMUZJV.js";import"./chunk-DBIBROYW.js";import"./chunk-IAHKTEET.js";import"./chunk-AKX4VRRR.js";import"./chunk-UD7KKHPW.js";import{a as et}from"./chunk-YCCUBQY4.js";import{a as mn}from"./chunk-A76UL3EN.js";import{x as r}from"./chunk-DEUDRSU7.js";import{b as fn}from"./chunk-DFS4RMVP.js";import{a as Q}from"./chunk-HCBYKLMW.js";import{a as k,b as n,k as Ze}from"./chunk-C44QQJR4.js";import{a as Mr}from"./chunk-6YGTRKDT.js";import{e as V}from"./chunk-UR6MHSHU.js";var m=V(Mr(),1);var a=V(Q(),1),Ar=60,Lr=100;function Et(t,o){let l=t.options.length,u=l,g=t.multi_select?u++:null,x=t.allow_free_text?u++:null,f=o?u++:null;return{optionCount:l,doneIdx:g,freeIdx:x,batchIdx:f,maxSel:u-1}}var Or="\xA0",_r={high:{text:`\u203C${Or}high`,color:r.red},med:{text:"med",color:"yellow"},low:{text:"low",color:r.dim}};function Pr(t){let o=(t.header??t.text.split(/\s+/).slice(0,3).join(" ")).trim();return o.length>16?`${o.slice(0,15)}\u2026`:o}function qr(t,o,l){let u=p=>t[p].length+6,g=u(o),x=o,f=o;for(;;){let p=f+1<t.length?u(f+1):1/0,C=x-1>=0?u(x-1):1/0;if(p===1/0&&C===1/0)break;if(p<=C){if(g+p>l)break;g+=p,f+=1}else{if(g+C>l)break;g+=C,x-=1}}return{lo:x,hi:f}}function Dn({batch:t,qView:o,sel:l=0,focused:u=!1,freeText:g=null,optionText:x=null,attach:f=null,multiSelFor:p,childPrefix:C}){let{stdout:M}=Ze(),v=M?.columns??80,T=v<Ar,W=Math.min(v-1,Lr),$=Math.max(0,Math.min(t.questions.length-1,o??(t.cursor<0?0:t.cursor))),I=t.questions[$],N=t.resolution[$],L=t.resolution.filter(D=>!D).length,B=t.questions.length-L,P=tt(t),O=Et(I,P!==""),H=p?p($):[],K=_r[I.risk],re=D=>u&&l===D?(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"}):" ",S=`? ${C??""}the agent needs ${L===1?"one answer":`${L} answers`}`,$e=t.questions.length>1?` \xB7 ${$+1} of ${t.questions.length} \xB7 ${B} answered`:"",z=(0,a.jsxs)(k,{flexDirection:"column",children:[(0,a.jsx)(k,{paddingLeft:2,children:(0,a.jsxs)(n,{bold:!0,children:[I.text,K?(0,a.jsx)(n,{color:K.color,bold:!1,children:` ${K.text}`}):null]})}),(0,a.jsx)(k,{paddingLeft:2,children:(0,a.jsx)(n,{color:r.dim,children:I.rationale})}),(0,a.jsx)(n,{children:" "}),I.options.map((D,w)=>{let X=u&&l===w;return x&&x.optionIndex===w?(0,a.jsx)(k,{flexDirection:"column",children:(0,a.jsxs)(k,{children:[(0,a.jsxs)(n,{children:[(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"})," ",(0,a.jsx)(n,{color:r.assuranceAccent,children:`${w+1}. ${D.label}`}),(0,a.jsx)(n,{color:r.dim,children:" \u270E "})]}),(0,a.jsx)(et,{value:x.value,onChange:x.onChange,onSubmit:x.onSubmit,onCancel:x.onCancel,placeholder:D.detail||"type your answer"})]})},`o-${w}`):(0,a.jsxs)(k,{flexDirection:"column",children:[(0,a.jsxs)(n,{children:[re(w)," ",I.multi_select?(0,a.jsx)(n,{color:H.includes(w)?r.green:r.dim,children:H.includes(w)?"[x] ":"[ ] "}):null,(0,a.jsx)(n,{color:X?r.assuranceAccent:void 0,children:`${w+1}. ${D.label}`}),w===I.recommended_index?(0,a.jsx)(n,{color:r.dim,children:" (recommended)"}):null,N?.selected_index===w?(0,a.jsx)(n,{color:r.dim,children:" (current)"}):null]}),D.detail?(0,a.jsx)(k,{paddingLeft:5,children:(0,a.jsx)(n,{color:r.dim,children:D.detail})}):null]},`o-${w}`)}),I.multi_select&&O.doneIdx!=null?(0,a.jsxs)(n,{children:[re(O.doneIdx)," ",(0,a.jsx)(n,{color:r.green,children:"\u2714"}),(0,a.jsx)(n,{color:u&&l===O.doneIdx?r.assuranceAccent:void 0,children:" done \u2014 confirm selection"})]}):null,I.allow_free_text?(0,a.jsx)(n,{children:" "}):null,I.allow_free_text?g?(0,a.jsxs)(k,{children:[(0,a.jsxs)(n,{children:[(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"})," ",(0,a.jsx)(n,{color:r.dim,children:"\u270E "})]}),(0,a.jsx)(et,{value:g.value,onChange:g.onChange,onSubmit:g.onSubmit,onCancel:g.onCancel,placeholder:"Tell me what to do"})]}):(0,a.jsxs)(n,{children:[O.freeIdx!=null?re(O.freeIdx):" "," ",(0,a.jsx)(n,{color:u&&O.freeIdx!=null&&l===O.freeIdx?r.assuranceAccent:r.dim,children:"\u270E Tell me what to do"})]}):null,f?(0,a.jsxs)(k,{flexDirection:"column",marginTop:1,children:[(0,a.jsxs)(k,{children:[(0,a.jsxs)(n,{children:[(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"})," ",(0,a.jsx)(n,{color:r.assuranceAccent,children:"@ attach a file or URL"}),(0,a.jsx)(n,{color:r.dim,children:" \u270E "})]}),(0,a.jsx)(et,{value:f.value,onChange:f.onChange,onSubmit:f.onSubmit,onCancel:f.onCancel,placeholder:"path or URL"})]}),(0,a.jsx)(k,{paddingLeft:2,children:(0,a.jsx)(n,{color:r.dim,children:"the questions are set aside \u2014 the agent reads the source and re-asks what's still open"})})]}):null]}),j=P!==""?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n,{children:" "}),(0,a.jsxs)(n,{children:[u&&O.batchIdx!=null&&l===O.batchIdx?(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"}):" "," ",(0,a.jsx)(n,{color:r.assuranceAccent,children:"\xBB"}),(0,a.jsx)(n,{bold:!0,color:u&&O.batchIdx!=null&&l===O.batchIdx?r.assuranceAccent:void 0,children:" Go with recommendations"}),L>=5?(0,a.jsx)(n,{color:r.dim,children:` \u2014 resolves all ${L} open`}):null,(0,a.jsx)(n,{color:r.dim,children:" (tab)"})]})]}):null;if(T)return(0,a.jsxs)(k,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,a.jsx)(n,{color:r.assuranceAccent,bold:!0,children:S}),t.questions.length>1?(0,a.jsx)(n,{color:r.dim,children:$e.replace(/^ · /,"")}):null,(0,a.jsx)(n,{children:" "}),z,j]});let h=t.questions.map(D=>Pr(D)),ce=t.questions.length>1?qr(h,$,W-8):null;return(0,a.jsxs)(k,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,a.jsxs)(n,{color:r.assuranceAccent,children:[(0,a.jsx)(n,{bold:!0,children:S}),$e?(0,a.jsx)(n,{color:r.dim,children:$e}):null]}),ce?(0,a.jsx)(k,{marginTop:1,children:(0,a.jsxs)(n,{children:[ce.lo>0?(0,a.jsx)(n,{color:r.dim,children:"\u25C0 "}):" ",t.questions.slice(ce.lo,ce.hi+1).map((D,w)=>{let X=ce.lo+w,Pe=w>0?" ":"";return X===$?(0,a.jsxs)(n,{children:[Pe,(0,a.jsx)(n,{backgroundColor:r.assuranceAccent,color:"#0d1117",bold:!0,children:` ${h[X]} `})]},D.id):(0,a.jsxs)(n,{children:[Pe,t.resolution[X]?(0,a.jsxs)(n,{children:[(0,a.jsx)(n,{color:r.green,children:"\u2713 "}),(0,a.jsx)(n,{color:r.dim,children:h[X]})]}):(0,a.jsx)(n,{color:r.dim,children:`\u25CB ${h[X]}`})]},D.id)}),ce.hi<t.questions.length-1?(0,a.jsx)(n,{color:r.dim,children:" \u25B6"}):null]})}):null,(0,a.jsx)(n,{children:" "}),z,j]})}var A=V(Q(),1),Bn={high:0,med:1,low:2},jr={high:r.red,med:"yellow",low:r.dim};function Fr(t){return t.map((o,l)=>({r:o,i:l})).sort((o,l)=>(Bn[o.r.risk??"zz"]??3)-(Bn[l.r.risk??"zz"]??3)||o.i-l.i).map(({r:o})=>o)}function En({rows:t,width:o=120,badgeHeader:l="risk"}){if(t.length===0)return null;let u=Fr(t),g=B=>B.staged||!B.id?"(staged)":yn(B.id),x=Math.max(2,...u.map(B=>g(B).length)),f=Math.max(l.length,...u.map(B=>(B.badge??"").length)),p=o>=84&&u.some(B=>B.summary),M=o-(p?13:10)-x-f,v=Math.max(...u.map(B=>Math.max(B.title.length,(B.marker??"").length)),5),T=Math.max(5,p?Math.min(v,Math.max(16,Math.floor(M*.5))):Math.min(v,M)),W=p?Math.max(7,M-T):0,$=(B,P,O,H)=>vn(B,P,O,H.map(K=>K.length)),I=(B,P,O,H)=>[Oe(le(B,x),x),Oe(le(P,T),T),Oe(le(O,f),f),...p?[Oe(le(H,W),W)]:[]],N=I("id","title",l,"summary"),L=[];L.push((0,A.jsx)(n,{color:r.dim,children:$("\u250C","\u252C","\u2510",N)},"t")),L.push((0,A.jsxs)(n,{children:[N.map((B,P)=>(0,A.jsxs)(n,{children:[(0,A.jsx)(n,{color:r.dim,children:P===0?"\u2502 ":" \u2502 "}),(0,A.jsx)(n,{bold:!0,children:B})]},P)),(0,A.jsx)(n,{color:r.dim,children:" \u2502"})]},"h")),L.push((0,A.jsx)(n,{color:r.dim,children:$("\u251C","\u253C","\u2524",N)},"m"));for(let[B,P]of u.entries()){let O=I(g(P),le(P.title,T),le(P.badge??"",f),le(P.summary??"",W)),H=P.badgeColor??jr[P.badge??""]??r.dim;if(L.push((0,A.jsxs)(n,{children:[(0,A.jsx)(n,{color:r.dim,children:"\u2502 "}),(0,A.jsx)(n,{color:r.assuranceAccent,children:O[0]}),(0,A.jsx)(n,{color:r.dim,children:" \u2502 "}),O[1],(0,A.jsx)(n,{color:r.dim,children:" \u2502 "}),(0,A.jsx)(n,{color:H,children:O[2]}),p?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(n,{color:r.dim,children:" \u2502 "}),O[3]]}):null,(0,A.jsx)(n,{color:r.dim,children:" \u2502"})]},`r-${B}`)),P.marker){let K=I("",le(P.marker,T),"","");L.push((0,A.jsx)(n,{color:r.dim,children:`\u2502 ${K.join(" \u2502 ")} \u2502`},`mk-${B}`))}}return L.push((0,A.jsx)(n,{color:r.dim,children:$("\u2514","\u2534","\u2518",N)},"b")),(0,A.jsx)(A.Fragment,{children:L})}var y=V(Q(),1);function Wr(t){let o=t.form==="assumed"?" (assumed)":t.form==="deferred"?"":" (you)",l=t.note?` \u2014 ${t.note}`:"";return t.form==="deferred"?`\u21B3 deferred q${t.qNum} ${t.stub}${l}`:t.form==="changed"?`\u21B3 changed q${t.qNum} ${t.stub}: ${t.prev??"?"} \u2192 ${t.choice??"?"}${o}${l}`:`\u21B3 ${t.form} q${t.qNum} ${t.stub}: ${t.choice??"?"}${o}${l}`}var Vr=()=>(process.stdout?.columns??100)-12;function Mn({block:t,annotations:o}){let l=t.era??0,u=Nr(t,o??null);return l>0?(0,y.jsx)(k,{marginLeft:l*2,children:u}):u}function Nr(t,o){switch(t.kind){case"banner":return(0,y.jsx)(k,{marginTop:1,children:(0,y.jsx)(n,{bold:!0,color:r.assuranceAccent,children:` ${t.text}`})});case"user":return(0,y.jsxs)(k,{marginTop:1,children:[(0,y.jsx)(n,{color:r.orange,children:"\u276F "}),(0,y.jsx)(n,{children:t.text})]});case"note":return(0,y.jsx)(n,{color:r.dim,children:` ${t.text}`});case"agent":return(0,y.jsx)(k,{marginTop:1,children:(0,y.jsx)(hn,{text:t.text,accent:r.assuranceAccent})});case"worked":return(0,y.jsx)(k,{marginTop:1,children:(0,y.jsx)(n,{color:r.dim,children:` \u2699 ${bn(t.durS,t.toolCalls,t.tools)}`})});case"usage":return(0,y.jsx)(n,{color:r.dim,children:` \xB7 ${t.credits.toFixed(1)} credits \u2014 total ${t.total.toFixed(1)}`});case"turn":{let l=o,u=l?l.fresh:t.items.map((v,T)=>({item:v,num:T+1,updated:!1})),g={usecase:"risk","use-case":"risk",ac:"check",scenario:"kind",test:"check",gap:"severity",stylenote:"kind"},x=v=>v.kind??"use-case",f=new Map;for(let v of u){let T=v.item,W=x(v.item),$=T.risk==="high"||T.risk==="med"||T.risk==="low"?T.risk:void 0,I={id:T.logical_id??"",staged:!T.logical_id,title:T.title,badge:T.badge??T.risk??"",summary:T.why??T.summary??T.description??"",...$?{risk:$}:{},...v.updated?{marker:"\u21B3 changed"}:{}},N=f.get(W)??[];N.push(I),f.set(W,N)}let p=u.some(v=>!!v.item.kind),C=(l?.unchanged??[]).reduce((v,T)=>v+T.count,0),M=l?.headerStats?` \u2014 ${l.headerStats}${C>0?` (${C} unchanged)`:""}`:"";return(0,y.jsxs)(k,{flexDirection:"column",marginLeft:2,children:[(0,y.jsxs)(n,{bold:!0,children:[p?"design":t.heading,M?(0,y.jsx)(n,{bold:!1,color:r.dim,children:M}):null]}),[...f.entries()].map(([v,T])=>(0,y.jsxs)(k,{flexDirection:"column",children:[f.size>1?(0,y.jsx)(n,{color:r.dim,children:`${nt(v)} \xB7 ${T.length}`}):null,(0,y.jsx)(En,{rows:T,width:Vr(),badgeHeader:g[v]??"info"})]},v)),l&&l.unchanged.length>0&&(0,y.jsx)(n,{color:r.dim,children:` \u22EE unchanged: ${l.unchanged.map(v=>`${v.count} ${v.label}`).join(" \xB7 ")}`})]})}case"answer":return(0,y.jsx)(n,{color:r.dim,children:Wr(t.receipt)});case"continued":return(0,y.jsx)(n,{color:r.dim,children:"\u21B3 continued"});case"childOpen":{let{ing:l}=Rt(t.verb);return(0,y.jsx)(k,{marginTop:1,children:(0,y.jsxs)(n,{color:r.assuranceAccent,children:[`\u25CF ${l} ${t.subject}`,t.sid?(0,y.jsx)(n,{color:r.dim,children:` \u2014 ${t.sid}`}):null,t.note?(0,y.jsx)(n,{color:r.dim,children:` ${t.note}`}):null]})})}case"childClose":{let{ed:l}=Rt(t.verb);if(!t.ok)return(0,y.jsxs)(n,{color:r.red,children:[`\u25CF ${t.verb} failed \u2014 ${t.exitCode!=null?`exited ${t.exitCode}`:"error"}`,t.fixCmd?(0,y.jsx)(n,{color:r.dim,children:` \xB7 ${t.fixCmd}`}):null]});let u=[kn(t.durS),...t.results?[t.results]:[],...t.credits!==void 0?[`${t.credits.toFixed(1)} credits`]:[]].join(" \xB7 ");return(0,y.jsx)(n,{color:r.green,children:`\u25CF ${l} ${t.subject} \u2014 ${u}`})}case"childBack":return(0,y.jsx)(n,{color:r.dim,children:`back with ${t.parentVerb} \u2014 ${t.context}`});case"commit":return(0,y.jsxs)(k,{flexDirection:"column",children:[(0,y.jsx)(n,{color:t.ok?r.green:r.red,children:` ${t.ok?"\u2714":"\u2717"} ${t.line}`}),(t.warnings??[]).map((l,u)=>(0,y.jsx)(n,{color:r.dim,children:` \u26A0 ${l}`},`w-${u}`))]});case"error":return(0,y.jsxs)(mn,{variant:"error",paddingX:1,children:[(0,y.jsx)(n,{color:r.red,children:t.title}),t.detail.map((l,u)=>(0,y.jsx)(n,{color:r.dim,children:l},`d-${u}`))]})}}var Te=V(Q(),1);function An({item:t}){return(0,Te.jsxs)(k,{flexDirection:"column",marginLeft:2,children:[(t.cite??[]).map((o,l)=>(0,Te.jsx)(n,{dimColor:!0,children:`cite ${o.anchor??"conv"} \u2014 "${o.quote??""}"`},`cite-${l}`)),(t.depends_on_hint??[]).length>0&&(0,Te.jsx)(n,{dimColor:!0,children:`depends on: ${(t.depends_on_hint??[]).join(", ")}`}),Object.entries(t.extra??{}).map(([o,l])=>(0,Te.jsx)(n,{dimColor:!0,children:`${o}: ${l}`},`extra-${o}`))]})}var R=V(Q(),1),Mt=(t,o)=>Math.max(0,Math.min(o,t));function ot(t,o,l){switch(o.type){case"move":return t.level==="detail"?{...t,scroll:Math.max(0,(t.scroll??0)+o.delta)}:{...t,cursor:Mt(t.cursor+o.delta,Math.max(0,l-1))};case"enter":return t.level==="list"?{...t,level:"detail",scroll:0}:t;case"back":return t.level==="detail"?{...t,level:"list",scroll:0}:null}}var On={"use-case":"use-cases",ac:"acs",scenario:"scenarios",test:"tests",gap:"gaps"};function _n(t,o){if(t.level==="detail")return{level:"detail",cursor:Mt(t.num-1,Math.max(0,o.entries.length-1))};if(t.section){let l=o.entries.findIndex(u=>On[u.kind]===t.section);if(l>=0)return{level:"list",cursor:l}}return{level:"list",cursor:0}}function Kr(t){let o=[];for(let l of t.entries){let u=o.find(g=>g.kind===l.kind);u?u.entries.push(l):o.push({kind:l.kind,entries:[l]})}return o}var Ln=3;function Ur({items:t,cursor:o,verb:l,more:u}){let g=`view \xB7 ${l} so far \xB7 ${t.counts.map(f=>`${f.count} ${f.count===1?f.label.replace(/s$/,""):f.label}`).join(" \xB7 ")}`,x=t.entries[o];return(0,R.jsxs)(k,{flexDirection:"column",children:[(0,R.jsx)(n,{bold:!0,color:r.assuranceAccent,children:g}),Kr(t).map(({kind:f,entries:p})=>{let C=x?.kind===f,M=C?p.findIndex($=>$.ref===x.ref):-1,v=C?Mt(M-1,Math.max(0,p.length-Ln)):0,T=p.slice(v,v+(C?Ln:1)),W=p.length-T.length;return(0,R.jsxs)(k,{flexDirection:"column",children:[(0,R.jsx)(n,{color:r.dim,children:`${On[f]??nt(f)} \xB7 ${p.length}`}),T.map($=>{let I=C&&$.ref===x.ref,N=$.item.badge;return(0,R.jsxs)(n,{children:[(0,R.jsx)(n,{color:r.assuranceAccent,children:I?"\u203A ":" "}),(0,R.jsx)(n,{children:`${$.num} \xB7 ${$.item.title}`}),N?(0,R.jsx)(n,{color:r.dim,children:` \xB7 ${N}`}):null]},`${$.kind}:${$.ref}`)}),W>0&&(0,R.jsx)(n,{color:r.dim,children:` \u22EE ${W} more`})]},f)}),u?(0,R.jsxs)(n,{children:[(0,R.jsx)(n,{color:r.assuranceAccent,children:o===t.entries.length?"\u203A ":" "}),(0,R.jsx)(n,{color:r.dim,children:`\u22EF show all \u2014 ${u.hidden} more from earlier turns`})]}):null]})}var st=14;function Qr({items:t,cursor:o,explain:l,grandTotal:u,dossier:g,scroll:x=0}){let f=t.entries[o];if(!f)return(0,R.jsx)(n,{color:r.dim,children:"nothing to show"});if(g){let C=Math.max(0,Math.min(x,Math.max(0,g.lines.length-st))),M=g.lines.slice(C,C+st);return(0,R.jsxs)(k,{flexDirection:"column",children:[(0,R.jsxs)(n,{bold:!0,children:[`view \xB7 ${g.id}`,g.id.toLowerCase()!==g.rawId?(0,R.jsx)(n,{bold:!1,color:r.dim,children:` \xB7 ${g.rawId}`}):null]}),(0,R.jsx)(n,{bold:!0,children:g.title}),C>0?(0,R.jsx)(n,{color:r.muted,children:`\u22EE ${C} above`}):null,M.map((v,T)=>(0,R.jsx)(n,{color:v.dim?r.dim:void 0,children:v.text},`dl-${T}`)),g.lines.length>C+st?(0,R.jsx)(n,{color:r.muted,children:`\u22EE ${g.lines.length-C-st} more`}):null]})}let p=f.item;return(0,R.jsxs)(k,{flexDirection:"column",children:[(0,R.jsx)(n,{bold:!0,children:`view \xB7 ${f.kind} ${f.num} of ${u??t.entries.length}`}),(0,R.jsx)(n,{children:f.item.title}),p.badge?(0,R.jsx)(n,{color:r.dim,children:`kind: ${p.badge}`}):null,p.why?(0,R.jsx)(n,{color:r.dim,children:p.why}):null,(0,R.jsx)(An,{item:f.item}),l?.map((C,M)=>(0,R.jsx)(n,{color:r.dim,children:C},`ex-${M}`)),(0,R.jsx)(n,{color:r.dim,children:"view-only \u2014 approvals happen in chat"})]})}function Pn({items:t,state:o,verb:l,more:u,explain:g,grandTotal:x,dossier:f=null}){return o.level==="list"?(0,R.jsx)(Ur,{items:t,cursor:o.cursor,verb:l,more:u}):(0,R.jsx)(Qr,{items:t,cursor:o.cursor,explain:g,grandTotal:x,dossier:f,scroll:o.scroll??0})}var J=V(Q(),1),At=14;function Hr(t){let o=[],l=null;for(let u of t)u.field!==l&&(l=u.field,o.push({kind:"field",field:l})),o.push({kind:"line",field:l,line:u});return o}function qn({title:t,lines:o,offset:l=0}){let u=Hr(o),g=Math.max(0,Math.min(l,Math.max(0,u.length-At))),x=u.slice(g,g+At),f=g,p=Math.max(0,u.length-g-At),C=`view \xB7 diff \xB7 ${t} \xB7 current \u2192 proposed`;return(0,J.jsxs)(k,{flexDirection:"column",children:[(0,J.jsx)(n,{bold:!0,color:r.assuranceAccent,children:C}),f>0?(0,J.jsx)(k,{paddingLeft:2,children:(0,J.jsx)(n,{color:r.dim,children:`\u22EE ${f} above`})}):null,x.map((M,v)=>M.kind==="field"?(0,J.jsx)(k,{paddingLeft:2,children:(0,J.jsx)(n,{color:r.dim,children:M.field==="criteria"?"criteria":M.field})},`r-${g+v}`):(0,J.jsx)(k,{paddingLeft:4,children:(0,J.jsx)(n,{color:M.line.op==="-"?"red":"green",children:`${M.line.op==="-"?"\u2212":"+"} ${M.line.text}`})},`r-${g+v}`)),p>0?(0,J.jsx)(k,{paddingLeft:2,children:(0,J.jsx)(n,{color:r.dim,children:`\u22EE ${p} more`})}):null]})}var zr={"use-cases":"use-cases",usecases:"use-cases","use-case":"use-cases",acs:"acs",ac:"acs",scenarios:"scenarios",scenario:"scenarios",tests:"tests",test:"tests",gaps:"gaps",gap:"gaps"};function jn(t){let o=(t??"").trim().toLowerCase();if(!o)return{level:"list"};if(/^\d+$/.test(o)){let u=parseInt(o,10);return u>=1?{level:"detail",num:u}:{error:"items are numbered from 1 \u2014 /view 1"}}let l=zr[o];return l?{level:"list",section:l}:{error:"try /view, /view <number>, or /view acs|scenarios|tests"}}var E=V(Q(),1),Xr=6,Fn=12;function Gr(t,o,l){let u=Math.max(20,o),g=[];for(let f of t.split(`
|
|
2
|
+
import{a as le,b as Oe,c as vn}from"./chunk-6J5T5FEY.js";import{a as wn,b as me,c as It,d as $n,e as Dt,g as rt,h as it,i as Cn,j as Rn,l as Sn,m as Bt,n as In}from"./chunk-TLFNUXKS.js";import{b as Rt}from"./chunk-UJZZDPDY.js";import{a as yn}from"./chunk-O5U6EAL3.js";import{a as tt}from"./chunk-IWVA37B6.js";import{a as xn,b as kn,c as bn}from"./chunk-AXTPNZPX.js";import"./chunk-L2TV4G56.js";import"./chunk-IVQX3AKL.js";import{a as nt,d as _e,e as Tn,f as St}from"./chunk-RKXHVP2Z.js";import{a as gn,b as hn,c as pn}from"./chunk-MMQLVGUJ.js";import"./chunk-NVGBE2DR.js";import{a as dn}from"./chunk-5Y2G4NC7.js";import"./chunk-W3Z7AZNT.js";import"./chunk-JQW2QFSX.js";import"./chunk-6FCPS2VT.js";import"./chunk-UH2ZTX4E.js";import"./chunk-XMTSHHYQ.js";import"./chunk-DBIBROYW.js";import"./chunk-AKX4VRRR.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import{a as et}from"./chunk-YCCUBQY4.js";import{a as mn}from"./chunk-5AHOVOWV.js";import{x as r}from"./chunk-NJJQL54J.js";import{b as fn}from"./chunk-DFS4RMVP.js";import{a as Q}from"./chunk-HCBYKLMW.js";import{a as k,b as n,k as Ze}from"./chunk-C44QQJR4.js";import{a as Mr}from"./chunk-6YGTRKDT.js";import{e as V}from"./chunk-UR6MHSHU.js";var m=V(Mr(),1);var a=V(Q(),1),Ar=60,Lr=100;function Et(t,o){let l=t.options.length,u=l,g=t.multi_select?u++:null,x=t.allow_free_text?u++:null,f=o?u++:null;return{optionCount:l,doneIdx:g,freeIdx:x,batchIdx:f,maxSel:u-1}}var Or="\xA0",_r={high:{text:`\u203C${Or}high`,color:r.red},med:{text:"med",color:"yellow"},low:{text:"low",color:r.dim}};function Pr(t){let o=(t.header??t.text.split(/\s+/).slice(0,3).join(" ")).trim();return o.length>16?`${o.slice(0,15)}\u2026`:o}function qr(t,o,l){let u=p=>t[p].length+6,g=u(o),x=o,f=o;for(;;){let p=f+1<t.length?u(f+1):1/0,C=x-1>=0?u(x-1):1/0;if(p===1/0&&C===1/0)break;if(p<=C){if(g+p>l)break;g+=p,f+=1}else{if(g+C>l)break;g+=C,x-=1}}return{lo:x,hi:f}}function Dn({batch:t,qView:o,sel:l=0,focused:u=!1,freeText:g=null,optionText:x=null,attach:f=null,multiSelFor:p,childPrefix:C}){let{stdout:M}=Ze(),v=M?.columns??80,T=v<Ar,W=Math.min(v-1,Lr),$=Math.max(0,Math.min(t.questions.length-1,o??(t.cursor<0?0:t.cursor))),I=t.questions[$],N=t.resolution[$],L=t.resolution.filter(D=>!D).length,B=t.questions.length-L,P=tt(t),O=Et(I,P!==""),H=p?p($):[],K=_r[I.risk],re=D=>u&&l===D?(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"}):" ",S=`? ${C??""}the agent needs ${L===1?"one answer":`${L} answers`}`,$e=t.questions.length>1?` \xB7 ${$+1} of ${t.questions.length} \xB7 ${B} answered`:"",z=(0,a.jsxs)(k,{flexDirection:"column",children:[(0,a.jsx)(k,{paddingLeft:2,children:(0,a.jsxs)(n,{bold:!0,children:[I.text,K?(0,a.jsx)(n,{color:K.color,bold:!1,children:` ${K.text}`}):null]})}),(0,a.jsx)(k,{paddingLeft:2,children:(0,a.jsx)(n,{color:r.dim,children:I.rationale})}),(0,a.jsx)(n,{children:" "}),I.options.map((D,w)=>{let X=u&&l===w;return x&&x.optionIndex===w?(0,a.jsx)(k,{flexDirection:"column",children:(0,a.jsxs)(k,{children:[(0,a.jsxs)(n,{children:[(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"})," ",(0,a.jsx)(n,{color:r.assuranceAccent,children:`${w+1}. ${D.label}`}),(0,a.jsx)(n,{color:r.dim,children:" \u270E "})]}),(0,a.jsx)(et,{value:x.value,onChange:x.onChange,onSubmit:x.onSubmit,onCancel:x.onCancel,placeholder:D.detail||"type your answer"})]})},`o-${w}`):(0,a.jsxs)(k,{flexDirection:"column",children:[(0,a.jsxs)(n,{children:[re(w)," ",I.multi_select?(0,a.jsx)(n,{color:H.includes(w)?r.green:r.dim,children:H.includes(w)?"[x] ":"[ ] "}):null,(0,a.jsx)(n,{color:X?r.assuranceAccent:void 0,children:`${w+1}. ${D.label}`}),w===I.recommended_index?(0,a.jsx)(n,{color:r.dim,children:" (recommended)"}):null,N?.selected_index===w?(0,a.jsx)(n,{color:r.dim,children:" (current)"}):null]}),D.detail?(0,a.jsx)(k,{paddingLeft:5,children:(0,a.jsx)(n,{color:r.dim,children:D.detail})}):null]},`o-${w}`)}),I.multi_select&&O.doneIdx!=null?(0,a.jsxs)(n,{children:[re(O.doneIdx)," ",(0,a.jsx)(n,{color:r.green,children:"\u2714"}),(0,a.jsx)(n,{color:u&&l===O.doneIdx?r.assuranceAccent:void 0,children:" done \u2014 confirm selection"})]}):null,I.allow_free_text?(0,a.jsx)(n,{children:" "}):null,I.allow_free_text?g?(0,a.jsxs)(k,{children:[(0,a.jsxs)(n,{children:[(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"})," ",(0,a.jsx)(n,{color:r.dim,children:"\u270E "})]}),(0,a.jsx)(et,{value:g.value,onChange:g.onChange,onSubmit:g.onSubmit,onCancel:g.onCancel,placeholder:"Tell me what to do"})]}):(0,a.jsxs)(n,{children:[O.freeIdx!=null?re(O.freeIdx):" "," ",(0,a.jsx)(n,{color:u&&O.freeIdx!=null&&l===O.freeIdx?r.assuranceAccent:r.dim,children:"\u270E Tell me what to do"})]}):null,f?(0,a.jsxs)(k,{flexDirection:"column",marginTop:1,children:[(0,a.jsxs)(k,{children:[(0,a.jsxs)(n,{children:[(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"})," ",(0,a.jsx)(n,{color:r.assuranceAccent,children:"@ attach a file or URL"}),(0,a.jsx)(n,{color:r.dim,children:" \u270E "})]}),(0,a.jsx)(et,{value:f.value,onChange:f.onChange,onSubmit:f.onSubmit,onCancel:f.onCancel,placeholder:"path or URL"})]}),(0,a.jsx)(k,{paddingLeft:2,children:(0,a.jsx)(n,{color:r.dim,children:"the questions are set aside \u2014 the agent reads the source and re-asks what's still open"})})]}):null]}),j=P!==""?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n,{children:" "}),(0,a.jsxs)(n,{children:[u&&O.batchIdx!=null&&l===O.batchIdx?(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"}):" "," ",(0,a.jsx)(n,{color:r.assuranceAccent,children:"\xBB"}),(0,a.jsx)(n,{bold:!0,color:u&&O.batchIdx!=null&&l===O.batchIdx?r.assuranceAccent:void 0,children:" Go with recommendations"}),L>=5?(0,a.jsx)(n,{color:r.dim,children:` \u2014 resolves all ${L} open`}):null,(0,a.jsx)(n,{color:r.dim,children:" (tab)"})]})]}):null;if(T)return(0,a.jsxs)(k,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,a.jsx)(n,{color:r.assuranceAccent,bold:!0,children:S}),t.questions.length>1?(0,a.jsx)(n,{color:r.dim,children:$e.replace(/^ · /,"")}):null,(0,a.jsx)(n,{children:" "}),z,j]});let h=t.questions.map(D=>Pr(D)),ce=t.questions.length>1?qr(h,$,W-8):null;return(0,a.jsxs)(k,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,a.jsxs)(n,{color:r.assuranceAccent,children:[(0,a.jsx)(n,{bold:!0,children:S}),$e?(0,a.jsx)(n,{color:r.dim,children:$e}):null]}),ce?(0,a.jsx)(k,{marginTop:1,children:(0,a.jsxs)(n,{children:[ce.lo>0?(0,a.jsx)(n,{color:r.dim,children:"\u25C0 "}):" ",t.questions.slice(ce.lo,ce.hi+1).map((D,w)=>{let X=ce.lo+w,Pe=w>0?" ":"";return X===$?(0,a.jsxs)(n,{children:[Pe,(0,a.jsx)(n,{backgroundColor:r.assuranceAccent,color:"#0d1117",bold:!0,children:` ${h[X]} `})]},D.id):(0,a.jsxs)(n,{children:[Pe,t.resolution[X]?(0,a.jsxs)(n,{children:[(0,a.jsx)(n,{color:r.green,children:"\u2713 "}),(0,a.jsx)(n,{color:r.dim,children:h[X]})]}):(0,a.jsx)(n,{color:r.dim,children:`\u25CB ${h[X]}`})]},D.id)}),ce.hi<t.questions.length-1?(0,a.jsx)(n,{color:r.dim,children:" \u25B6"}):null]})}):null,(0,a.jsx)(n,{children:" "}),z,j]})}var A=V(Q(),1),Bn={high:0,med:1,low:2},jr={high:r.red,med:"yellow",low:r.dim};function Fr(t){return t.map((o,l)=>({r:o,i:l})).sort((o,l)=>(Bn[o.r.risk??"zz"]??3)-(Bn[l.r.risk??"zz"]??3)||o.i-l.i).map(({r:o})=>o)}function En({rows:t,width:o=120,badgeHeader:l="risk"}){if(t.length===0)return null;let u=Fr(t),g=B=>B.staged||!B.id?"(staged)":yn(B.id),x=Math.max(2,...u.map(B=>g(B).length)),f=Math.max(l.length,...u.map(B=>(B.badge??"").length)),p=o>=84&&u.some(B=>B.summary),M=o-(p?13:10)-x-f,v=Math.max(...u.map(B=>Math.max(B.title.length,(B.marker??"").length)),5),T=Math.max(5,p?Math.min(v,Math.max(16,Math.floor(M*.5))):Math.min(v,M)),W=p?Math.max(7,M-T):0,$=(B,P,O,H)=>vn(B,P,O,H.map(K=>K.length)),I=(B,P,O,H)=>[Oe(le(B,x),x),Oe(le(P,T),T),Oe(le(O,f),f),...p?[Oe(le(H,W),W)]:[]],N=I("id","title",l,"summary"),L=[];L.push((0,A.jsx)(n,{color:r.dim,children:$("\u250C","\u252C","\u2510",N)},"t")),L.push((0,A.jsxs)(n,{children:[N.map((B,P)=>(0,A.jsxs)(n,{children:[(0,A.jsx)(n,{color:r.dim,children:P===0?"\u2502 ":" \u2502 "}),(0,A.jsx)(n,{bold:!0,children:B})]},P)),(0,A.jsx)(n,{color:r.dim,children:" \u2502"})]},"h")),L.push((0,A.jsx)(n,{color:r.dim,children:$("\u251C","\u253C","\u2524",N)},"m"));for(let[B,P]of u.entries()){let O=I(g(P),le(P.title,T),le(P.badge??"",f),le(P.summary??"",W)),H=P.badgeColor??jr[P.badge??""]??r.dim;if(L.push((0,A.jsxs)(n,{children:[(0,A.jsx)(n,{color:r.dim,children:"\u2502 "}),(0,A.jsx)(n,{color:r.assuranceAccent,children:O[0]}),(0,A.jsx)(n,{color:r.dim,children:" \u2502 "}),O[1],(0,A.jsx)(n,{color:r.dim,children:" \u2502 "}),(0,A.jsx)(n,{color:H,children:O[2]}),p?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(n,{color:r.dim,children:" \u2502 "}),O[3]]}):null,(0,A.jsx)(n,{color:r.dim,children:" \u2502"})]},`r-${B}`)),P.marker){let K=I("",le(P.marker,T),"","");L.push((0,A.jsx)(n,{color:r.dim,children:`\u2502 ${K.join(" \u2502 ")} \u2502`},`mk-${B}`))}}return L.push((0,A.jsx)(n,{color:r.dim,children:$("\u2514","\u2534","\u2518",N)},"b")),(0,A.jsx)(A.Fragment,{children:L})}var y=V(Q(),1);function Wr(t){let o=t.form==="assumed"?" (assumed)":t.form==="deferred"?"":" (you)",l=t.note?` \u2014 ${t.note}`:"";return t.form==="deferred"?`\u21B3 deferred q${t.qNum} ${t.stub}${l}`:t.form==="changed"?`\u21B3 changed q${t.qNum} ${t.stub}: ${t.prev??"?"} \u2192 ${t.choice??"?"}${o}${l}`:`\u21B3 ${t.form} q${t.qNum} ${t.stub}: ${t.choice??"?"}${o}${l}`}var Vr=()=>(process.stdout?.columns??100)-12;function Mn({block:t,annotations:o}){let l=t.era??0,u=Nr(t,o??null);return l>0?(0,y.jsx)(k,{marginLeft:l*2,children:u}):u}function Nr(t,o){switch(t.kind){case"banner":return(0,y.jsx)(k,{marginTop:1,children:(0,y.jsx)(n,{bold:!0,color:r.assuranceAccent,children:` ${t.text}`})});case"user":return(0,y.jsxs)(k,{marginTop:1,children:[(0,y.jsx)(n,{color:r.orange,children:"\u276F "}),(0,y.jsx)(n,{children:t.text})]});case"note":return(0,y.jsx)(n,{color:r.dim,children:` ${t.text}`});case"agent":return(0,y.jsx)(k,{marginTop:1,children:(0,y.jsx)(hn,{text:t.text,accent:r.assuranceAccent})});case"worked":return(0,y.jsx)(k,{marginTop:1,children:(0,y.jsx)(n,{color:r.dim,children:` \u2699 ${bn(t.durS,t.toolCalls,t.tools)}`})});case"usage":return(0,y.jsx)(n,{color:r.dim,children:` \xB7 ${t.credits.toFixed(1)} credits \u2014 total ${t.total.toFixed(1)}`});case"turn":{let l=o,u=l?l.fresh:t.items.map((v,T)=>({item:v,num:T+1,updated:!1})),g={usecase:"risk","use-case":"risk",ac:"check",scenario:"kind",test:"check",gap:"severity",stylenote:"kind"},x=v=>v.kind??"use-case",f=new Map;for(let v of u){let T=v.item,W=x(v.item),$=T.risk==="high"||T.risk==="med"||T.risk==="low"?T.risk:void 0,I={id:T.logical_id??"",staged:!T.logical_id,title:T.title,badge:T.badge??T.risk??"",summary:T.why??T.summary??T.description??"",...$?{risk:$}:{},...v.updated?{marker:"\u21B3 changed"}:{}},N=f.get(W)??[];N.push(I),f.set(W,N)}let p=u.some(v=>!!v.item.kind),C=(l?.unchanged??[]).reduce((v,T)=>v+T.count,0),M=l?.headerStats?` \u2014 ${l.headerStats}${C>0?` (${C} unchanged)`:""}`:"";return(0,y.jsxs)(k,{flexDirection:"column",marginLeft:2,children:[(0,y.jsxs)(n,{bold:!0,children:[p?"design":t.heading,M?(0,y.jsx)(n,{bold:!1,color:r.dim,children:M}):null]}),[...f.entries()].map(([v,T])=>(0,y.jsxs)(k,{flexDirection:"column",children:[f.size>1?(0,y.jsx)(n,{color:r.dim,children:`${nt(v)} \xB7 ${T.length}`}):null,(0,y.jsx)(En,{rows:T,width:Vr(),badgeHeader:g[v]??"info"})]},v)),l&&l.unchanged.length>0&&(0,y.jsx)(n,{color:r.dim,children:` \u22EE unchanged: ${l.unchanged.map(v=>`${v.count} ${v.label}`).join(" \xB7 ")}`})]})}case"answer":return(0,y.jsx)(n,{color:r.dim,children:Wr(t.receipt)});case"continued":return(0,y.jsx)(n,{color:r.dim,children:"\u21B3 continued"});case"childOpen":{let{ing:l}=Rt(t.verb);return(0,y.jsx)(k,{marginTop:1,children:(0,y.jsxs)(n,{color:r.assuranceAccent,children:[`\u25CF ${l} ${t.subject}`,t.sid?(0,y.jsx)(n,{color:r.dim,children:` \u2014 ${t.sid}`}):null,t.note?(0,y.jsx)(n,{color:r.dim,children:` ${t.note}`}):null]})})}case"childClose":{let{ed:l}=Rt(t.verb);if(!t.ok)return(0,y.jsxs)(n,{color:r.red,children:[`\u25CF ${t.verb} failed \u2014 ${t.exitCode!=null?`exited ${t.exitCode}`:"error"}`,t.fixCmd?(0,y.jsx)(n,{color:r.dim,children:` \xB7 ${t.fixCmd}`}):null]});let u=[kn(t.durS),...t.results?[t.results]:[],...t.credits!==void 0?[`${t.credits.toFixed(1)} credits`]:[]].join(" \xB7 ");return(0,y.jsx)(n,{color:r.green,children:`\u25CF ${l} ${t.subject} \u2014 ${u}`})}case"childBack":return(0,y.jsx)(n,{color:r.dim,children:`back with ${t.parentVerb} \u2014 ${t.context}`});case"commit":return(0,y.jsxs)(k,{flexDirection:"column",children:[(0,y.jsx)(n,{color:t.ok?r.green:r.red,children:` ${t.ok?"\u2714":"\u2717"} ${t.line}`}),(t.warnings??[]).map((l,u)=>(0,y.jsx)(n,{color:r.dim,children:` \u26A0 ${l}`},`w-${u}`))]});case"error":return(0,y.jsxs)(mn,{variant:"error",paddingX:1,children:[(0,y.jsx)(n,{color:r.red,children:t.title}),t.detail.map((l,u)=>(0,y.jsx)(n,{color:r.dim,children:l},`d-${u}`))]})}}var Te=V(Q(),1);function An({item:t}){return(0,Te.jsxs)(k,{flexDirection:"column",marginLeft:2,children:[(t.cite??[]).map((o,l)=>(0,Te.jsx)(n,{dimColor:!0,children:`cite ${o.anchor??"conv"} \u2014 "${o.quote??""}"`},`cite-${l}`)),(t.depends_on_hint??[]).length>0&&(0,Te.jsx)(n,{dimColor:!0,children:`depends on: ${(t.depends_on_hint??[]).join(", ")}`}),Object.entries(t.extra??{}).map(([o,l])=>(0,Te.jsx)(n,{dimColor:!0,children:`${o}: ${l}`},`extra-${o}`))]})}var R=V(Q(),1),Mt=(t,o)=>Math.max(0,Math.min(o,t));function ot(t,o,l){switch(o.type){case"move":return t.level==="detail"?{...t,scroll:Math.max(0,(t.scroll??0)+o.delta)}:{...t,cursor:Mt(t.cursor+o.delta,Math.max(0,l-1))};case"enter":return t.level==="list"?{...t,level:"detail",scroll:0}:t;case"back":return t.level==="detail"?{...t,level:"list",scroll:0}:null}}var On={"use-case":"use-cases",ac:"acs",scenario:"scenarios",test:"tests",gap:"gaps"};function _n(t,o){if(t.level==="detail")return{level:"detail",cursor:Mt(t.num-1,Math.max(0,o.entries.length-1))};if(t.section){let l=o.entries.findIndex(u=>On[u.kind]===t.section);if(l>=0)return{level:"list",cursor:l}}return{level:"list",cursor:0}}function Kr(t){let o=[];for(let l of t.entries){let u=o.find(g=>g.kind===l.kind);u?u.entries.push(l):o.push({kind:l.kind,entries:[l]})}return o}var Ln=3;function Ur({items:t,cursor:o,verb:l,more:u}){let g=`view \xB7 ${l} so far \xB7 ${t.counts.map(f=>`${f.count} ${f.count===1?f.label.replace(/s$/,""):f.label}`).join(" \xB7 ")}`,x=t.entries[o];return(0,R.jsxs)(k,{flexDirection:"column",children:[(0,R.jsx)(n,{bold:!0,color:r.assuranceAccent,children:g}),Kr(t).map(({kind:f,entries:p})=>{let C=x?.kind===f,M=C?p.findIndex($=>$.ref===x.ref):-1,v=C?Mt(M-1,Math.max(0,p.length-Ln)):0,T=p.slice(v,v+(C?Ln:1)),W=p.length-T.length;return(0,R.jsxs)(k,{flexDirection:"column",children:[(0,R.jsx)(n,{color:r.dim,children:`${On[f]??nt(f)} \xB7 ${p.length}`}),T.map($=>{let I=C&&$.ref===x.ref,N=$.item.badge;return(0,R.jsxs)(n,{children:[(0,R.jsx)(n,{color:r.assuranceAccent,children:I?"\u203A ":" "}),(0,R.jsx)(n,{children:`${$.num} \xB7 ${$.item.title}`}),N?(0,R.jsx)(n,{color:r.dim,children:` \xB7 ${N}`}):null]},`${$.kind}:${$.ref}`)}),W>0&&(0,R.jsx)(n,{color:r.dim,children:` \u22EE ${W} more`})]},f)}),u?(0,R.jsxs)(n,{children:[(0,R.jsx)(n,{color:r.assuranceAccent,children:o===t.entries.length?"\u203A ":" "}),(0,R.jsx)(n,{color:r.dim,children:`\u22EF show all \u2014 ${u.hidden} more from earlier turns`})]}):null]})}var st=14;function Qr({items:t,cursor:o,explain:l,grandTotal:u,dossier:g,scroll:x=0}){let f=t.entries[o];if(!f)return(0,R.jsx)(n,{color:r.dim,children:"nothing to show"});if(g){let C=Math.max(0,Math.min(x,Math.max(0,g.lines.length-st))),M=g.lines.slice(C,C+st);return(0,R.jsxs)(k,{flexDirection:"column",children:[(0,R.jsxs)(n,{bold:!0,children:[`view \xB7 ${g.id}`,g.id.toLowerCase()!==g.rawId?(0,R.jsx)(n,{bold:!1,color:r.dim,children:` \xB7 ${g.rawId}`}):null]}),(0,R.jsx)(n,{bold:!0,children:g.title}),C>0?(0,R.jsx)(n,{color:r.muted,children:`\u22EE ${C} above`}):null,M.map((v,T)=>(0,R.jsx)(n,{color:v.dim?r.dim:void 0,children:v.text},`dl-${T}`)),g.lines.length>C+st?(0,R.jsx)(n,{color:r.muted,children:`\u22EE ${g.lines.length-C-st} more`}):null]})}let p=f.item;return(0,R.jsxs)(k,{flexDirection:"column",children:[(0,R.jsx)(n,{bold:!0,children:`view \xB7 ${f.kind} ${f.num} of ${u??t.entries.length}`}),(0,R.jsx)(n,{children:f.item.title}),p.badge?(0,R.jsx)(n,{color:r.dim,children:`kind: ${p.badge}`}):null,p.why?(0,R.jsx)(n,{color:r.dim,children:p.why}):null,(0,R.jsx)(An,{item:f.item}),l?.map((C,M)=>(0,R.jsx)(n,{color:r.dim,children:C},`ex-${M}`)),(0,R.jsx)(n,{color:r.dim,children:"view-only \u2014 approvals happen in chat"})]})}function Pn({items:t,state:o,verb:l,more:u,explain:g,grandTotal:x,dossier:f=null}){return o.level==="list"?(0,R.jsx)(Ur,{items:t,cursor:o.cursor,verb:l,more:u}):(0,R.jsx)(Qr,{items:t,cursor:o.cursor,explain:g,grandTotal:x,dossier:f,scroll:o.scroll??0})}var J=V(Q(),1),At=14;function Hr(t){let o=[],l=null;for(let u of t)u.field!==l&&(l=u.field,o.push({kind:"field",field:l})),o.push({kind:"line",field:l,line:u});return o}function qn({title:t,lines:o,offset:l=0}){let u=Hr(o),g=Math.max(0,Math.min(l,Math.max(0,u.length-At))),x=u.slice(g,g+At),f=g,p=Math.max(0,u.length-g-At),C=`view \xB7 diff \xB7 ${t} \xB7 current \u2192 proposed`;return(0,J.jsxs)(k,{flexDirection:"column",children:[(0,J.jsx)(n,{bold:!0,color:r.assuranceAccent,children:C}),f>0?(0,J.jsx)(k,{paddingLeft:2,children:(0,J.jsx)(n,{color:r.dim,children:`\u22EE ${f} above`})}):null,x.map((M,v)=>M.kind==="field"?(0,J.jsx)(k,{paddingLeft:2,children:(0,J.jsx)(n,{color:r.dim,children:M.field==="criteria"?"criteria":M.field})},`r-${g+v}`):(0,J.jsx)(k,{paddingLeft:4,children:(0,J.jsx)(n,{color:M.line.op==="-"?"red":"green",children:`${M.line.op==="-"?"\u2212":"+"} ${M.line.text}`})},`r-${g+v}`)),p>0?(0,J.jsx)(k,{paddingLeft:2,children:(0,J.jsx)(n,{color:r.dim,children:`\u22EE ${p} more`})}):null]})}var zr={"use-cases":"use-cases",usecases:"use-cases","use-case":"use-cases",acs:"acs",ac:"acs",scenarios:"scenarios",scenario:"scenarios",tests:"tests",test:"tests",gaps:"gaps",gap:"gaps"};function jn(t){let o=(t??"").trim().toLowerCase();if(!o)return{level:"list"};if(/^\d+$/.test(o)){let u=parseInt(o,10);return u>=1?{level:"detail",num:u}:{error:"items are numbered from 1 \u2014 /view 1"}}let l=zr[o];return l?{level:"list",section:l}:{error:"try /view, /view <number>, or /view acs|scenarios|tests"}}var E=V(Q(),1),Xr=6,Fn=12;function Gr(t,o,l){let u=Math.max(20,o),g=[];for(let f of t.split(`
|
|
3
3
|
`)){if(f.length<=u){g.push(f);continue}let p="";for(let C of f.split(" "))p&&p.length+1+C.length>u?(g.push(p),p=C):p=p?`${p} ${C}`:C;g.push(p)}let x=Math.max(0,g.length-l);return{body:g.slice(-l).join(`
|
|
4
4
|
`),hidden:x}}function Wn(t){let o={key:"redesign",label:"re-design from scratch",detail:"replaces the current design"},l={key:"keep",label:"keep the existing design",detail:"back to the list"};return t.designed==="stale"?[{...o,detail:"the use-case changed since it was designed"},l]:[l,o]}function Xi({controller:t,verb:o="extract",onCtrlC:l,chain:u=null,inspect:g=null,reconcile:x=null,autoReview:f=!1,onReviewExit:p,meta:C=null}){let[,M]=(0,m.useState)(0),[v,T]=(0,m.useState)(!1),[W,$]=(0,m.useState)(null),[I,N]=(0,m.useState)(null),L=(0,m.useRef)(null),[B,P]=(0,m.useState)(null),O=(0,m.useRef)(null),H=e=>{O.current=e,P(e)},K=e=>{L.current=e,N(e),e===null&&H(null)},re=(0,m.useRef)([]),[S,$e]=(0,m.useState)(null),z=(0,m.useRef)(null),j=e=>{z.current=e,$e(e)},[h,ce]=(0,m.useState)(null),D=(0,m.useRef)(null),w=e=>{D.current=e,ce(e)},[X,Pe]=(0,m.useState)(null),Lt=(0,m.useRef)(null),he=e=>{Lt.current=e,Pe(e)},lt=(0,m.useRef)({approved:0,rejected:0,deferred:0}),Ce=(0,m.useRef)(!1),ae=(0,m.useRef)(null),Ot=fn(),{stdout:Vn}=Ze(),Nn=Vn?.columns??80,_t=(0,m.useRef)(0),ct=(0,m.useRef)(0);(0,m.useEffect)(()=>{let e=()=>{let i=t.state.ledger;for(let c=_t.current;c<i.length;c++){let d=i[c],b=d.kind==="turn"?Tn(t.state.turns,d.turnIndex):void 0;Ot.append((0,E.jsx)(Mn,{block:d,annotations:b},`lg-${c}`))}_t.current=i.length};e();let s=t.subscribe(()=>{e();let i=t.state;L.current&&(i.pending||i.status==="pausing")&&(K(null),i.pending&&$("questions arrived \u2014 back to chat")),M(c=>c+1)});return M(i=>i+1),s},[t,Ot]);let{thinking:ue,status:de,pending:_,confirm:qe,ledger:ie,activeTurn:Pt,stream:Kn,notice:je}=t.state,qt=(Kn?.text??"").trimEnd(),jt=qt.length>0,Un=v&&(ue.liveThinking.length>0||ue.thinkingLog.length>0),Qn=Gr(ue.liveThinking||ue.thinkingLog.map(e=>e.text).join(`
|
|
5
5
|
`),Nn-6,Fn),Ft=jt?qt.split(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c}from"./chunk-
|
|
2
|
+
import{a,b,c}from"./chunk-HWHLKBUT.js";import"./chunk-3CCD434H.js";import"./chunk-NJJQL54J.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{c as ChromeProfilePicker,b as formatChromeProfileLine,a as listChromeProfiles};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as r}from"./chunk-
|
|
2
|
+
import{a as r}from"./chunk-LLY7TQSI.js";import"./chunk-3CCD434H.js";import"./chunk-NJJQL54J.js";import"./chunk-HCBYKLMW.js";import{c as e}from"./chunk-C44QQJR4.js";import{a as i}from"./chunk-6YGTRKDT.js";import{e as m}from"./chunk-UR6MHSHU.js";var t=m(i(),1);async function d(){return new Promise(o=>{let c=e(t.default.createElement(r,{onSubmit:n=>{c.unmount(),o(n)}}),{stdout:process.stderr,exitOnCtrlC:!1})})}export{d as renderFeedbackPrompt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as P,b as g,c as f}from"./chunk-
|
|
2
|
+
import{a as P,b as g,c as f}from"./chunk-24QPDHRD.js";import"./chunk-75HF3GPO.js";import"./chunk-5Y2G4NC7.js";import"./chunk-NJJQL54J.js";import{a as c}from"./chunk-HCBYKLMW.js";import{c as d}from"./chunk-C44QQJR4.js";import{a as h}from"./chunk-6YGTRKDT.js";import{e as p}from"./chunk-UR6MHSHU.js";var e=p(h(),1);var m=p(c(),1);function w({pipeline:t,buildShareUrl:r,onDone:o}){let[n,i]=(0,e.useState)(P()),[S,l]=(0,e.useState)("uploading"),[U,R]=(0,e.useState)(),[C,E]=(0,e.useState)();return(0,e.useEffect)(()=>{let x=t.config.onProgress;t.config.onProgress=(s,u,a)=>{x(s,u,a),i(y=>g(y,s,u,a))},t.execute().then(s=>{s.success?(R(r?.(s)),l("success")):(E(s.error),l("failed")),setTimeout(()=>o(s),1500)})},[]),(0,m.jsx)(f,{steps:n,status:S,testUrl:U,error:C})}async function O(t,r){return new Promise(o=>{let n=d(e.default.createElement(w,{pipeline:t,buildShareUrl:r,onDone:i=>{n.unmount(),o(i)}}),{stdout:process.stderr,exitOnCtrlC:!1})})}export{O as renderUploadProgress};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as C,b as l,c as o}from"./chunk-
|
|
2
|
+
import{a as C,b as l,c as o}from"./chunk-5AHOVOWV.js";import{x as n}from"./chunk-NJJQL54J.js";import{a as b}from"./chunk-HCBYKLMW.js";import{a as u,j as p}from"./chunk-C44QQJR4.js";import{a as y}from"./chunk-6YGTRKDT.js";import{e as a}from"./chunk-UR6MHSHU.js";var x=a(y(),1);var e=a(b(),1);function T({model:w,authLabel:B,profile:h,env:D,defaultUrl:s,projectId:i,projectName:d,folderId:t,folderName:f,windowSize:P,chromeProfile:R,target:r,deviceName:m,osVersion:v,appLabel:g}){let V=i?d?`${d} (${i})`:i:"(none)",$=t?f?`${f} (${t})`:t:"(none)",{exit:c}=p();return(0,x.useEffect)(()=>{let S=setTimeout(()=>c(),50);return()=>clearTimeout(S)},[c]),(0,e.jsx)(u,{flexDirection:"column",children:(0,e.jsx)(C,{title:"Configuration",children:(0,e.jsxs)(u,{flexDirection:"column",paddingY:1,children:[(0,e.jsx)(o,{label:"Auth"}),(0,e.jsx)(l,{label:" method",value:B}),(0,e.jsx)(l,{label:" profile",value:h}),(0,e.jsx)(l,{label:" env",value:D}),(0,e.jsx)(o,{label:"Defaults"}),(0,e.jsx)(l,{label:" url",value:s??"(none)",valueColor:s?n.orange:n.dim}),(0,e.jsx)(l,{label:" model",value:w}),(0,e.jsx)(l,{label:" window",value:P}),(0,e.jsx)(l,{label:" project",value:V}),(0,e.jsx)(l,{label:" folder",value:$}),r!==void 0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l,{label:" target",value:r}),r!=="desktop"&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l,{label:" device_name",value:m??"(not set)",valueColor:m?void 0:n.dim}),(0,e.jsx)(l,{label:" os_version",value:v??"(not set)",valueColor:v?void 0:n.dim}),(0,e.jsx)(l,{label:" app",value:g??"(not set)",valueColor:g?void 0:n.dim})]})]}),(0,e.jsx)(o,{label:"Paths"}),(0,e.jsx)(l,{label:" chrome",value:R,valueColor:n.dim})]})})})}export{T as ConfigView};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a}from"./chunk-VG7BTA5G.js";import"./chunk-SACCB44S.js";import"./chunk-QQ5MHSSY.js";import"./chunk-5GUD3CIH.js";import"./chunk-DYXYNH6X.js";import"./chunk-YMLC55J4.js";import"./chunk-NP3VGFZM.js";import"./chunk-NVGBE2DR.js";import"./chunk-EHN5HTUD.js";import"./chunk-CH273NAE.js";import"./chunk-KRL2BDI5.js";import"./chunk-VZ7KXRXB.js";import"./chunk-P7YZ3PU3.js";import"./chunk-W3Z7AZNT.js";import"./chunk-JQW2QFSX.js";import"./chunk-6FCPS2VT.js";import"./chunk-UH2ZTX4E.js";import"./chunk-XMTSHHYQ.js";import"./chunk-DBIBROYW.js";import"./chunk-AKX4VRRR.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-HPUQJRDX.js";import"./chunk-RFHMDQXZ.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-O7U5BVX5.js";import"./chunk-MSGW4JDG.js";import"./chunk-RSSOJ3L2.js";import"./chunk-5EOX4MEY.js";import"./chunk-4JOD47QI.js";import"./chunk-7KAPHA56.js";import"./chunk-RZ4F3BHX.js";import"./chunk-EYOCNMUM.js";import"./chunk-NJJQL54J.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as EvidenceViewOffer};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b}from"./chunk-IGW77FMB.js";import"./chunk-YCCUBQY4.js";import"./chunk-5A4QG7ZM.js";import"./chunk-BPMSNGXQ.js";import"./chunk-3CCD434H.js";import"./chunk-7KAPHA56.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-NJJQL54J.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{b as FolderPicker,a as formatFolderLine};
|
|
@@ -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-5FYO3PFG.js";import"./chunk-5AHOVOWV.js";import"./chunk-NJJQL54J.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as InfoBox};
|
|
@@ -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-QZRHXGNI.js";import"./chunk-NJJQL54J.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as LinksBox};
|
|
@@ -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-4TZSEC2C.js";import"./chunk-3CCD434H.js";import"./chunk-NJJQL54J.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{b as ProfilesView,a as formatProfileLine};
|
|
@@ -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-I57TM22L.js";import"./chunk-YCCUBQY4.js";import"./chunk-5A4QG7ZM.js";import"./chunk-BPMSNGXQ.js";import"./chunk-3CCD434H.js";import"./chunk-7KAPHA56.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-NJJQL54J.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{b as ProjectPicker,a as formatProjectLine};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c}from"./chunk-
|
|
2
|
+
import{a,b,c}from"./chunk-YTAAF62A.js";import"./chunk-S3DAAAE5.js";import"./chunk-5FYO3PFG.js";import"./chunk-5AHOVOWV.js";import"./chunk-NJJQL54J.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as SaveSessionPrompt,b as defaultSessionTimestamp,c as renderSavePrompt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a}from"./chunk-FAREJ4P2.js";import"./chunk-3OU2F34I.js";import"./chunk-M4WSRYRA.js";import"./chunk-ZXN67F4U.js";import"./chunk-VZ7KXRXB.js";import"./chunk-TDPWFYTJ.js";import"./chunk-APZCLVZD.js";import"./chunk-FBYB3SRE.js";import"./chunk-I57TM22L.js";import"./chunk-IGW77FMB.js";import"./chunk-YCCUBQY4.js";import"./chunk-5A4QG7ZM.js";import"./chunk-BPMSNGXQ.js";import"./chunk-VE3SUJMA.js";import"./chunk-TZXXJWHA.js";import"./chunk-RSSOJ3L2.js";import"./chunk-5EOX4MEY.js";import"./chunk-7NXHVC7G.js";import"./chunk-TAOHYWEO.js";import"./chunk-3CCD434H.js";import"./chunk-Z7S3IWUX.js";import"./chunk-GNAPBOAJ.js";import"./chunk-7KAPHA56.js";import"./chunk-DPUV6OSP.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-EYOCNMUM.js";import"./chunk-AFNDJK2A.js";import"./chunk-NJJQL54J.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as SingleShotApp};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d}from"./chunk-
|
|
2
|
+
import{a,b,c,d}from"./chunk-43DM2I6Q.js";import"./chunk-5FYO3PFG.js";import"./chunk-5AHOVOWV.js";import"./chunk-NJJQL54J.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{d as AutoExitSummaryBox,c as SummaryBox,b as buildSummaryEvent,a as buildSummaryRendered};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{g as a}from"./chunk-NSD2H67E.js";import"./chunk-7R5K4IGS.js";import"./chunk-YF26DH4Z.js";import"./chunk-75HF3GPO.js";import"./chunk-5Y2G4NC7.js";import"./chunk-P7YZ3PU3.js";import"./chunk-TDPWFYTJ.js";import"./chunk-APZCLVZD.js";import"./chunk-ASYWKYTQ.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-O7U5BVX5.js";import"./chunk-MSGW4JDG.js";import"./chunk-RSSOJ3L2.js";import"./chunk-5EOX4MEY.js";import"./chunk-Z7S3IWUX.js";import"./chunk-4JOD47QI.js";import"./chunk-7KAPHA56.js";import"./chunk-RZ4F3BHX.js";import"./chunk-EYOCNMUM.js";import"./chunk-5FYO3PFG.js";import"./chunk-5AHOVOWV.js";import"./chunk-NJJQL54J.js";import"./chunk-DFS4RMVP.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as TestMdRunView};
|
|
@@ -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-FHYG3QLL.js";import"./chunk-DYXYNH6X.js";import"./chunk-RFHMDQXZ.js";import"./chunk-7KAPHA56.js";import"./chunk-5AHOVOWV.js";import"./chunk-NJJQL54J.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as buildServeMap,b as renderTestrunEvidenceTable};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as b,b as r}from"./chunk-
|
|
2
|
+
import{a as b,b as r}from"./chunk-5AHOVOWV.js";import{x as o}from"./chunk-NJJQL54J.js";import{a as p}from"./chunk-HCBYKLMW.js";import{a as i,b as l,j as s}from"./chunk-C44QQJR4.js";import{a as T}from"./chunk-6YGTRKDT.js";import{e as a}from"./chunk-UR6MHSHU.js";var f=a(T(),1);var e=a(p(),1);function V({profile:g,env:v,authenticated:n,authMethod:h,username:c,tokenStatus:t,expiresAt:d,serverStatus:u,detail:m}){let{exit:x}=s();return(0,f.useEffect)(()=>{let B=setTimeout(()=>x(),50);return()=>clearTimeout(B)},[x]),(0,e.jsx)(i,{flexDirection:"column",children:(0,e.jsx)(b,{title:"Identity",variant:n?"success":"warning",children:(0,e.jsxs)(i,{flexDirection:"column",paddingY:1,children:[(0,e.jsx)(i,{children:u==="rejected"?(0,e.jsx)(l,{color:o.red,bold:!0,children:"\u2717 Not authenticated"}):u==="unreachable"?(0,e.jsx)(l,{color:o.orange,bold:!0,children:"\u26A0 Couldn't verify"}):n?(0,e.jsx)(l,{color:o.green,bold:!0,children:"\u2713 Authenticated"}):(0,e.jsx)(l,{color:o.orange,bold:!0,children:"\u26A0 Not logged in"})}),(0,e.jsxs)(i,{flexDirection:"column",marginTop:1,children:[(0,e.jsx)(r,{label:"Profile",value:g}),(0,e.jsx)(r,{label:"Environment",value:v}),(0,e.jsx)(r,{label:"Method",value:h}),c&&(0,e.jsx)(r,{label:"User",value:c}),t&&(0,e.jsx)(r,{label:"Token",value:t,valueColor:t==="valid"?o.green:t==="expired"?o.red:o.dim}),d&&(0,e.jsx)(r,{label:"Expires",value:d}),m&&(0,e.jsx)(r,{label:"Detail",value:m})]})]})})})}export{V as WhoamiView};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as a,c as b}from"./chunk-
|
|
2
|
+
import{b as a,c as b}from"./chunk-7NXHVC7G.js";import"./chunk-TAOHYWEO.js";import"./chunk-RZ4F3BHX.js";import"./chunk-NJJQL54J.js";import"./chunk-UR6MHSHU.js";export{a as isAppId,b as resolveCloudApp};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import"./chunk-UR6MHSHU.js";async function i(e){try{let[{CredentialsManager:n},{AuthResolver:a},{getEnvironment:s}]=await Promise.all([import("./credentials-
|
|
2
|
+
import"./chunk-UR6MHSHU.js";async function i(e){try{let[{CredentialsManager:n},{AuthResolver:a},{getEnvironment:s}]=await Promise.all([import("./credentials-6DP4KAMJ.js"),import("./resolver-X5NHNX5O.js"),import("./config-HUK7V364.js")]),t=new n,o=t.getActiveProfile()??"default",c=t.loadCredentials(o,e);if(typeof c?.access_token!="string")return null;let r=await new a(s(e).controllerBaseUrl,async()=>c.access_token,null).resolve();return typeof r?.username!="string"||!r.username||typeof r.access_key!="string"||!r.access_key?null:Buffer.from(`${r.username}:${r.access_key}`,"utf8").toString("base64")}catch{return null}}async function u(e={}){let n=e.env??process.env,s=await(e.resolveBase??(async()=>(await import("./spawner-R3XOP3GP.js")).resolveAgentAuthEnv()))();if(s.TESTMUAI_BASIC_AUTH||n.TESTMUAI_BASIC_AUTH)return s;let t=n.TESTMUAI_ENV==="stage"?"stage":"prod",o=await(e.exchange??i)(t);return o?{...s,TESTMUAI_BASIC_AUTH:o}:s}export{u as resolveLisAuthEnv};
|
|
@@ -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-L2BCQQLJ.js";import"./chunk-4E4GJPEM.js";import"./chunk-NJJQL54J.js";import"./chunk-UR6MHSHU.js";export{b as ensureHyperexecuteBinary,a as hyperexecuteDownloadUrl};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as _}from"./chunk-
|
|
3
|
-
`),2;let{makeHeadlessIO:s,agentRefusal:d}=await import("./headless-io-66RG5NN5.js");return d(s("ndjson","design"),t,r)};if(e.mode!=null&&!["interactive","agent","ci","override"].includes(e.mode)){let{makeHeadlessIO:t,agentRefusal:r}=await import("./headless-io-66RG5NN5.js");return r(t("ndjson","design"),`design: --mode must be interactive | agent | ci | override, got '${e.mode}'`,"MODE_USAGE")}let T=H(e);if("error"in T)return p(T.error);let o=T;{let{validateResumeMessage:t}=await import("./headless-io-66RG5NN5.js"),r=t(o,"design");if(r)return p(r)}{let{gateStructuredFlags:t}=await import("./structured-answers-
|
|
2
|
+
import{a as _}from"./chunk-U27OWZPW.js";import"./chunk-ZKSN2SJ7.js";import"./chunk-N7Z7BQYO.js";import"./chunk-KGKJU27A.js";import"./chunk-G2Q2TP3O.js";import"./chunk-RV7Q4RUV.js";import"./chunk-5G22NOZK.js";import"./chunk-2LXJ2ZM3.js";import"./chunk-BZAGVBCX.js";import"./chunk-BB2W35TW.js";import"./chunk-GX3FPJUG.js";import"./chunk-427OQS2N.js";import"./chunk-JUJ4SAGH.js";import"./chunk-AXTPNZPX.js";import"./chunk-L2TV4G56.js";import"./chunk-IVQX3AKL.js";import"./chunk-R7QAS6LZ.js";import"./chunk-XS2LZFCH.js";import"./chunk-BKHXPBWN.js";import"./chunk-F2CET54H.js";import"./chunk-VDM3TWF6.js";import"./chunk-54JZ6VEW.js";import"./chunk-DNNZ353O.js";import"./chunk-2UIHS2FH.js";import"./chunk-Q2F5QB2W.js";import"./chunk-N2P4MI32.js";import"./chunk-YKTYVJBN.js";import"./chunk-EV64VI66.js";import"./chunk-JDGBRACP.js";import"./chunk-5DT7PIGB.js";import"./chunk-GRDYYYIQ.js";import"./chunk-NP3VGFZM.js";import"./chunk-NVGBE2DR.js";import{a as m}from"./chunk-CH273NAE.js";import"./chunk-KRL2BDI5.js";import"./chunk-VZ7KXRXB.js";import"./chunk-IDX3TOPY.js";import"./chunk-W3Z7AZNT.js";import"./chunk-JQW2QFSX.js";import"./chunk-6FCPS2VT.js";import"./chunk-UH2ZTX4E.js";import"./chunk-XMTSHHYQ.js";import"./chunk-DBIBROYW.js";import"./chunk-AKX4VRRR.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-MSGW4JDG.js";import"./chunk-5EOX4MEY.js";import"./chunk-EYOCNMUM.js";import"./chunk-NJJQL54J.js";import"./chunk-UR6MHSHU.js";import{existsSync as O}from"fs";var P=new Set(["interactive","agent","ci","override"]);function H(e){return e.mode!=null&&!P.has(e.mode)?{error:`design: --mode must be interactive | agent | ci | override, got '${e.mode}'`}:e.strength!=null&&e.strength!=="pairwise"&&e.strength!=="3-wise"?{error:`design: --strength must be pairwise | 3-wise, got '${e.strength}'`}:e.max!=null&&(!Number.isInteger(e.max)||e.max<1)?{error:"design: --max must be a positive integer"}:!e.useCase&&!e.resume?{error:"design: --use-case is required (or --resume <sid> \u2014 the session remembers its use-case)"}:{useCase:e.useCase,max:e.max,strength:e.strength,mode:e.mode,force:e.force,resume:e.resume,plan:e.plan,message:e.message,phase:e.phase,allowUnreviewed:e.allowUnreviewed,because:e.because,changeDelta:e.changeDelta,priorDesign:e.priorDesign}}async function B(e){let p=async(t,r)=>{if(e.mode!=="agent")return process.stderr.write(t+`
|
|
3
|
+
`),2;let{makeHeadlessIO:s,agentRefusal:d}=await import("./headless-io-66RG5NN5.js");return d(s("ndjson","design"),t,r)};if(e.mode!=null&&!["interactive","agent","ci","override"].includes(e.mode)){let{makeHeadlessIO:t,agentRefusal:r}=await import("./headless-io-66RG5NN5.js");return r(t("ndjson","design"),`design: --mode must be interactive | agent | ci | override, got '${e.mode}'`,"MODE_USAGE")}let T=H(e);if("error"in T)return p(T.error);let o=T;{let{validateResumeMessage:t}=await import("./headless-io-66RG5NN5.js"),r=t(o,"design");if(r)return p(r)}{let{gateStructuredFlags:t}=await import("./structured-answers-YAVW65G4.js"),r=t(e,"design");if(r)return p(r,"STRUCTURED_FLAGS_USAGE")}if(!O(m(process.cwd())))return p("error: no context store here (run `kane-cli context ingest` + `kane-cli context extract` first)","NO_STORE");let y=!!o.resume;if(o.useCase&&o.resume&&!e.allowUnreviewed)try{let{peekSession:t}=await import("./sessions-GIEXOCE4.js"),r=t(m(process.cwd()),o.resume);y=!!(r&&r.use_case===o.useCase)}catch{y=!1}if(o.useCase&&!y&&!e.allowUnreviewed)try{let[{openGraph:t},{designEntryCheck:r}]=await Promise.all([import("./readmodel-TDRFVDVI.js"),import("./trust-gate-EX7R2P4Y.js")]),s=r(t(m(process.cwd())),o.useCase);if(!s.ok&&(s.code==="UC_UNREVIEWED"||s.code==="UC_ARCHIVED"))if((o.mode??"interactive")==="interactive"&&process.stdin.isTTY&&process.stdout.isTTY){let{createInterface:l}=await import("readline/promises"),c=l({input:process.stdin,output:process.stderr}),f=(await c.question(`design: ${s.detail}
|
|
4
4
|
Design against it anyway? (y/N) `)).trim().toLowerCase();if(c.close(),f!=="y"&&f!=="yes")return process.stderr.write(`aborted \u2014 approve it first: ${s.reviewCmd}
|
|
5
5
|
`),2}else if(e.mode==="agent"){let{makeHeadlessIO:l}=await import("./headless-io-66RG5NN5.js"),c=l("ndjson","design");return c.event({type:"error",code:s.code,message:`design: ${s.detail}`,next:[s.reviewCmd]}),c.event({type:"done",status:"refused",exit_code:2,next:[s.reviewCmd,`kane-cli design tests --use-case ${o.useCase} --mode agent --allow-unreviewed`]}),2}else return process.stderr.write(`design: ${s.detail} (${s.reviewCmd})
|
|
6
6
|
`),2}catch(t){process.env.KANE_DEBUG&&process.stderr.write(`trust gate skipped: ${String(t)}
|
|
7
7
|
`)}let i=null,x=null;try{if(!o.mode&&!process.stdin.isTTY)return process.stderr.write(`design: no TTY \u2014 pass an explicit --mode agent|ci|override to run headless
|
|
8
8
|
`),2;let t=o.mode??"interactive";if(t==="interactive"){if(!process.stdin.isTTY||!process.stdout.isTTY)return process.stderr.write(`design: --mode interactive needs a TTY on stdin and stdout (use --mode agent|ci|override headless)
|
|
9
|
-
`),2;let{bindDesignInteractive:n}=await import("./interactive-bind-
|
|
9
|
+
`),2;let{bindDesignInteractive:n}=await import("./interactive-bind-MOV2VWHJ.js");return await n(o)}let{resolveAgentAuthEnv:r}=await import("./spawner-R3XOP3GP.js"),{runAgent:s}=await import("./bridge-E2C5VV3H.js"),{preflightTurn:d}=await import("./turn-preflight-JGYT7LXP.js"),{makeInterruptGuard:l}=await import("./interrupt-guard-UREUWNRL.js"),{baseUrlAdvisory:c}=await import("./turn-preflight-JGYT7LXP.js"),{makeHeadlessIO:f,resolveEncoding:D,guardedChannels:R}=await import("./headless-io-66RG5NN5.js"),{withStructuredNext:A,prepareStructuredResume:U}=await import("./structured-answers-YAVW65G4.js");i=A(f(D(t),"design"));let{runWithChannel:$}=await import("./run-channel-RGH4WIQX.js"),w=i,I=D(t)==="ndjson"?n=>$({event:g=>w.event(g)},n):n=>n(),E=n=>{w.out(n),w.event({type:"note",text:n})},{telemetryBootstrap:N,telemetryEnvName:G}=await import("./bootstrap-QTVHGL45.js"),u=N({verb:"design",mode:t,contextRoot:m(process.cwd()),env:G(),resumeSid:o.resume,write:!0,longSession:!0});x=n=>u.end(n);let a=U({opts:e,contextDir:m(process.cwd()),verb:"design"});if(a.kind==="refuse")return i.out(a.error),t==="agent"&&i.event({type:"error",message:a.error,code:a.code}),await u.end({exit_code:2}),t==="agent"?i.done(2,"refused"):2;let C;if(a.kind==="apply"){for(let n of a.notes)E(n);if(a.matchedQids.length>0){E(`applying ${a.matchedQids.length} structured answer(s) from --answer to the paused session's pending questions`);for(let n of a.matchedQids)i.event({type:"panel_resolved",id:n,by:"user",via:"flag"})}a.statement&&(C=[o.message,a.statement].filter(Boolean).join(`
|
|
10
10
|
|
|
11
11
|
`))}let b=c();b&&E(b);let v=l(s,n=>i.out(n)),k=R(i,()=>v.interrupted(),/^error: (design agent failed|the design agent ended)/);try{let n=t==="interactive"&&process.stdin.isTTY&&process.stdout.isTTY?async h=>{let{createInterface:Y}=await import("readline/promises"),S=Y({input:process.stdin,output:process.stdout});try{return/^y(es)?$/i.test((await S.question(`${h} [y/N] `)).trim())}finally{S.close()}}:void 0,g=await I(async()=>{let h={...await r(),...u.spawnEnv()};return _({...o,mode:t,...C!==void 0?{message:C}:{},...n?{confirmRetarget:n}:{}},{contextDir:m(process.cwd()),agent:v.agent,preflightTurn:()=>d(h),ask:async()=>[],out:k.out,emit:k.emit,progress:w.progress,isTTY:!1,auth:h,telemetry:u})});return v.interrupted()&&g!==3?(i.out("interrupted \u2014 no session saved"),await u.end({exit_code:130}),i.done(130)):(g===1&&i.out(u.supportFooter()),await u.end({exit_code:g}),i.done(g))}finally{v.dispose()}}catch(t){x&&await x({exit_code:1}).catch(()=>{});let r=t instanceof Error?t.message:String(t);i?.event({type:"error",message:`error: design failed: ${r}`});let s=i?d=>i.out(d):d=>process.stderr.write(d+`
|
|
12
12
|
`);return s(`error: design failed: ${r}`),(process.env.ASSURANCE_LOG_LEVEL??"").toLowerCase()==="debug"&&t instanceof Error&&t.stack&&s(t.stack),s('hint: the full trace is in the file named on the "trace:" line at the start of this run'),i?i.done(1):1}}export{B as designTestsCommand};
|
|
@@ -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-2MTAXT2U.js";import"./chunk-4PMZ5FCD.js";import"./chunk-KBM3XHAM.js";import"./chunk-2YEHV2CX.js";import"./chunk-IDX3TOPY.js";import"./chunk-BKM2LWU2.js";import"./chunk-RSSOJ3L2.js";import"./chunk-5EOX4MEY.js";import"./chunk-RZ4F3BHX.js";import"./chunk-NJJQL54J.js";import"./chunk-UR6MHSHU.js";export{b as telemetryBootstrap,a as telemetryEnvName};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a}from"./chunk-WHYEXCTG.js";import"./chunk-UDFDTFBL.js";import"./chunk-F2CET54H.js";import"./chunk-UD7KKHPW.js";import"./chunk-NJJQL54J.js";import"./chunk-UR6MHSHU.js";export{a as runAgent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as l}from"./chunk-RZ4F3BHX.js";import{b as i,f as c}from"./chunk-
|
|
2
|
+
import{a as l}from"./chunk-RZ4F3BHX.js";import{b as i,f as c}from"./chunk-NJJQL54J.js";import"./chunk-UR6MHSHU.js";import{readFileSync as u,writeFileSync as g,mkdirSync as d}from"fs";import{join as f}from"path";var h=f(i,"changelog-cache.json"),p=3600*1e3;function y(){try{let e=JSON.parse(u(h,"utf-8"));if(Date.now()-e.cachedAt<p)return e}catch{}return null}function m(e){try{d(i,{recursive:!0}),g(h,JSON.stringify({entries:e,cachedAt:Date.now()}))}catch{}}async function A(e){try{let t=y();if(t){let r=t.entries;return e?.all?r:r.slice(0,5)}let n=new AbortController,o=setTimeout(()=>n.abort(),5e3),a=await l(`${c}?per_page=30`,{headers:{Accept:"application/vnd.github+json"},signal:n.signal});if(clearTimeout(o),!a.ok)return[];let s=(await a.json()).map(r=>({version:r.tag_name.replace(/^v/,""),date:r.published_at?r.published_at.slice(0,10):"",body:r.body??""}));return m(s),e?.all?s:s.slice(0,5)}catch{return[]}}function v(e){if(e.length===0)return"Could not fetch changelog. Visit https://github.com/LambdaTest/kane-cli/releases";let t=["kane-cli Changelog","\u2500".repeat(40),""];for(let n of e){if(t.push(`v${n.version} (${n.date})`),n.body){let o=n.body.split(`
|
|
3
3
|
`).filter(a=>a.trim());for(let a of o)t.push(` ${a}`)}t.push("")}return t.join(`
|
|
4
4
|
`)}export{A as fetchChangelog,v as formatChangelog};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as P,c as fe}from"./chunk-BZAGVBCX.js";import{a as L,b as ge}from"./chunk-B7K5WOOU.js";import{a as he}from"./chunk-427OQS2N.js";import{d as ue}from"./chunk-NVGBE2DR.js";import{B as ae,C as le,E as pe,e as oe,f as re,h as ce,p as A}from"./chunk-R4EGL7VM.js";import{a as de}from"./chunk-JQW2QFSX.js";import"./chunk-FYLMTZ3J.js";import{a as _,b as x}from"./chunk-TYRTD5DD.js";import{g as ie,j as se}from"./chunk-OXHMUZJV.js";import"./chunk-DBIBROYW.js";import"./chunk-IAHKTEET.js";import{e as k,f as D,g as ne,h as H}from"./chunk-AKX4VRRR.js";import"./chunk-UD7KKHPW.js";import"./chunk-UR6MHSHU.js";var Ie=new Set(["approve","edit","reject"]);function Ae($){let{contextDir:m,graph:s,ops:me,by:f}=$,F=$.mintable??he(),j=ie(m);if(s.latestHash!==j)return{record:null,errors:[{code:"STALE_BASIS",detail:`graph opened at ${String(s.latestHash)} but chain head is ${String(j)} \u2014 re-open and retry`}]};let U=[],y=[],Y=new Set;for(let e of me){if(s.appliedEvents.has(e.eventId)||Y.has(e.eventId)){U.push(e.eventId);continue}Y.add(e.eventId),y.push(e)}if(y.length===0)return{record:null,errors:null,applied:[],skipped:U,minted:[],staleDelta:[]};let o=[],M=[],I=[],C=[],v=[],G=[],B=[...$.judgements??[]],V=[],J=new Map,z=new Set,Q=[],T=new Set,ve=new Set(F),X=new Set;for(let e of y){if(!Ie.has(e.kind))continue;let n=e.target,t=s.resolve(n),i=t?s.tipOf(t.cid):n;X.has(i)&&o.push({code:"MULTIPLE_TERMINAL_OPS",detail:`${n} has more than one terminal op in this turn \u2014 normalize latest-wins first`}),X.add(i)}let R=(e,n,t)=>{let i=s.resolve(n);if(!i)return o.push({code:"UNKNOWN_NODE",detail:`${e}: ${n} names nothing in the graph`}),null;let d=s.tipOf(i.cid);return d!==t||s.superseded.has(t)?(o.push({code:"EXPECTED_CID_MOVED",detail:`${e}: ${n} moved or was archived since it was displayed`,data:{tip:d}}),null):t},K=e=>new Set(pe(s,s.tipOf(e))),S=[],E=new Set,Z=e=>({code:"RETRACT_FORBIDDEN",detail:`retract ${e}: provenance edges cannot be retracted \u2014 DERIVES is historical evidence; reject or edit the node instead`});for(let e of y){if(e.kind!=="retract"){S.push(e);continue}let n=R("retract",e.target,e.expectedCid);if(!n)continue;let t=new Map;for(let d of K(n))for(let a of[...s.edgesFrom(d),...s.edgesInto(d)])t.set(a.ecid,a);let i;if(e.edgeEcid!==void 0){if(s.superseded.has(e.edgeEcid)){o.push({code:"UNKNOWN_EDGE",detail:`retract ${e.target}: ${e.edgeEcid} is already retracted`});continue}if(i=t.get(e.edgeEcid),!i){o.push({code:"UNKNOWN_EDGE",detail:`retract ${e.target}: ${e.edgeEcid} is not a live edge touching ${e.target} (checked the full version chain)`});continue}}else if(e.edgeRef!==void 0){let d=e.edgeRef;if(d.type===k.DERIVES){o.push(Z(e.target));continue}let a=(r,c)=>{let N=A(s,c);if(N)return N;let b=s.resolve(c)!==null;return o.push(b?{code:"TOMBSTONED_REF",detail:`retract ${e.target}: ${d.type} ${r} '${c}' is tombstoned (retired with no live successor) \u2014 pick a live node`}:{code:"UNKNOWN_REF",detail:`retract ${e.target}: ${d.type} ${r} got (unknown) for '${c}' \u2014 not a committed node (a node added in this same turn has no id yet: commit the add first)`}),null},g=a("dst",d.dst);if(!g)continue;let l=K(g.cid),p=null;if(d.src!==void 0){let r=a("src",d.src);if(!r)continue;p=K(r.cid)}let h=[...t.values()].filter(r=>r.type===d.type&&l.has(r.dst)&&(p===null||p.has(r.src)));if(h.length===0){o.push({code:"UNKNOWN_EDGE",detail:`retract ${e.target}: no live ${d.type} edge onto ${d.dst}${d.src!==void 0?` from ${d.src}`:""} touches ${e.target} (checked the full version chain)`});continue}if(h.length>1){let r=h.map(c=>`${c.type} ${s.displayNameOf(c.src)??c.src} \u2192 ${s.displayNameOf(c.dst)??c.dst} (${c.ecid})`).join("; ");o.push({code:"AMBIGUOUS_RETRACT",detail:`retract ${e.target}: ${h.length} live ${d.type} edges match \u2014 ${r} \u2014 add src to disambiguate`});continue}i=h[0]}else{o.push({code:"INVALID_RETRACT",detail:`retract ${e.target}: neither edge_ecid nor edge {type, dst, src?} was given`});continue}if(i.type===k.DERIVES){o.push(Z(e.target));continue}if(E.has(i.ecid)){o.push({code:"EDGE_RETRACTED",detail:`retract ${e.target}: ${i.ecid} was retracted earlier in this turn`});continue}E.add(i.ecid),S.push({kind:"retract",target:e.target,expectedCid:e.expectedCid,edgeEcid:i.ecid,reason:e.reason,eventId:e.eventId})}let w=new Map;for(let e of S){if(e.kind!=="edit")continue;let n=s.resolve(e.target);if(!n||s.tipOf(n.cid)!==e.expectedCid||s.superseded.has(e.expectedCid))continue;let t=s.getNode(e.expectedCid);if(!t)continue;let i={...t.content};for(let[a,g]of Object.entries(e.edit))g!==void 0&&(i[a]=g);if(typeof i.title=="string"&&!i.title.trim()||D(t.label,i).length>0)continue;let d=_(t.label,i);d!==e.expectedCid&&w.set(e.expectedCid,d)}for(let e of S)if(e.kind==="approve"){let n=R("approve",e.target,e.expectedCid);n&&C.push({id:n,kind:"review-item",resolution:"approved",edit:null,reason:null,by:f})}else if(e.kind==="reject"){let n=R("reject",e.target,e.expectedCid);if(!n)continue;if(C.push({id:n,kind:"review-item",resolution:"rejected",edit:null,reason:e.reason,by:f}),e.redirectTo!==void 0){let t=s.resolve(e.redirectTo);if(!t||t.superseded){o.push({code:"UNKNOWN_NODE",detail:`reject.redirectTo: ${e.redirectTo} is not a live node`});continue}v.push({kind:"node",old:n,new:t.cid,reason:e.reason,by:f})}}else if(e.kind==="edit"){let n=R("edit",e.target,e.expectedCid);if(!n)continue;let t=s.getNode(n);if(!t){o.push({code:"UNKNOWN_NODE",detail:`edit: ${e.target} node file unreadable`});continue}let i={...t.content};for(let[l,p]of Object.entries(e.edit))p!==void 0&&(i[l]=p);if(typeof i.title=="string"&&!i.title.trim()){o.push({code:"EMPTY_TITLE",detail:`edit: ${e.target} edited title is empty`});continue}let d=D(t.label,i);if(d.length>0){for(let l of d)o.push({code:l.code,detail:`edit ${e.target}: ${l.detail}`});continue}let a=_(t.label,i);if(a===n){C.push({id:n,kind:"review-item",resolution:"approved",edit:null,reason:null,by:f});continue}if(oe(s,n,a)){o.push({code:"SUPERSEDE_CYCLE",detail:`edit ${e.target}: edit reproduces an already-superseded version (supersession cycle guard) \u2014 re-edit forward or redesign`});continue}let g=re({graph:s,oldTip:n,newCid:a,newLabel:t.label,by:f,reason:`re-blessed onto ${a} (edited in chat)`,skipEcids:E,dstRedirect:w});if(g.errors.length>0){for(let l of g.errors)o.push({code:"REBLESS_REFUSED",detail:`edit ${e.target}: ${l}`});continue}M.push({cid:a,label:t.label,content:i}),I.push(...g.edges),v.push({kind:"node",old:n,new:a,reason:e.reason??"edited in chat",by:f}),v.push(...g.supersessions),C.push({id:a,kind:"review-item",resolution:"edited",edit:{...e.edit},reason:null,by:f})}else if(e.kind==="enhance"){if(!R("enhance",e.target,e.expectedCid))continue;for(let t of e.edges){let i=A(s,t.src),d=A(s,t.dst);if(!i||!d){let[u,W]=i?["dst",t.dst]:["src",t.src],ye=s.resolve(W)!==null;o.push(ye?{code:"TOMBSTONED_REF",detail:`enhance ${e.target}: ${t.type} ${u} '${W}' is tombstoned (retired with no live successor) \u2014 pick a live node`}:{code:"UNKNOWN_REF",detail:`enhance ${e.target}: ${t.type} ${u} got (unknown) for '${W}' \u2014 not a committed node (a node added in this same turn has no id yet: commit the add first)`});continue}let a=s.nodeLabel.get(i.cid)??"(unknown)",g=s.nodeLabel.get(d.cid)??"(unknown)";for(let u of H(t.type,a,g,t.props))o.push({code:u.code,detail:`enhance ${e.target}: ${u.detail}`});let l=x(t.type,i.cid,d.cid,t.props),p=w.get(i.cid)??i.cid,h=w.get(d.cid)??d.cid,r=x(t.type,p,h,t.props);if(s.superseded.has(l)||E.has(l)||s.superseded.has(r)){let u=s.superseded.has(l)||E.has(l)?l:r;o.push({code:"EDGE_RETRACTED",detail:`enhance ${e.target}: this ${t.type} edge was retracted (${u}) \u2014 re-adding a retracted edge is refused (revival unsupported)`});continue}if(s.edgesFrom(i.cid).some(u=>u.ecid===l)||I.some(u=>u.ecid===r))continue;let c=ce(s,t.type,i.cid,d.cid,Q);c&&o.push(c);let N=de(s,{type:t.type,src:i.cid,dst:d.cid},{pending:[],retracted:E},`enhance ${e.target}`);N&&o.push(N);let b=ne(t.type)?.cardinality;if(b==="one-live-per-src"||b==="one-live-per-src-and-dst"){let u=`${t.type}|${i.cid}`;T.has(u)&&o.push({code:"CARDINALITY_VIOLATION",detail:`${t.type} from ${i.cid}: two one-live edges in one turn`}),T.add(u)}if(b==="one-live-per-src-and-dst"){let u=`${t.type}|dst|${d.cid}`;T.has(u)&&o.push({code:"CARDINALITY_VIOLATION",detail:`${t.type} onto ${d.cid}: two one-live edges in one turn (strict 1:1)`}),T.add(u)}I.push({ecid:r,type:t.type,src:p,dst:h,props:t.props}),Q.push({src:i.cid,dst:d.cid,type:t.type})}}else if(e.kind==="retract")v.push({kind:"edge",ecid:e.edgeEcid,reason:e.reason,by:f});else if(e.kind==="add"){if(!ve.has(e.label)){o.push({code:"GATED_LABEL",detail:`add: ${e.label} is not mintable in v1 (gate: ${F.join("|")})`,data:{gate:[...F]}});continue}let n=s.heads.get(e.convSourceId),t=s.convChains.get(e.convSourceId);if(typeof n!="string"||!t){o.push({code:"CONV_SOURCE_MISSING",detail:`add: ${e.convSourceId} is not a live conversation source`});continue}let i=s.getNode(n)?.content?.blob,d=typeof i=="string"?ue(m,i)?.toString("utf8")??"":"",a=ge(d,e.cite.turn);if(a===null){o.push({code:"BAD_ANCHOR",detail:`add: ${L(e.cite.turn)} does not resolve in ${e.convSourceId}`});continue}if(!a.includes(e.cite.quote)){o.push({code:"QUOTE_MISMATCH",detail:`add: quote is not verbatim within ${L(e.cite.turn)}`});continue}let g={...e.content,derived:!0},l=D(e.label,g);if(l.length>0){for(let c of l)o.push({code:c.code,detail:`add: ${c.detail}`});continue}let p=_(e.label,g),h={source_id:e.convSourceId,source_cid:n,anchor:L(e.cite.turn),quote:e.cite.quote};for(let c of H(k.DERIVES,"source",e.label,h))o.push({code:c.code,detail:`add: ${c.detail}`});M.push({cid:p,label:e.label,content:g}),I.push({ecid:x("DERIVES",n,p,h),type:k.DERIVES,src:n,dst:p,props:h}),e.rationale&&B.push({about:p,rationale:e.rationale,by:f});let r=ae(e.label,c=>z.has(c),s.names.keys());r!==null&&(z.add(r),G.push({cid:p,slug:r,by:f})),V.push({cid:p,...r!==null?{slug:r}:{}}),J.set(e.eventId,p)}if(o.length)return{record:null,errors:o};let ee=new Date().toISOString();for(let e of S){if(e.kind==="add"){let n=J.get(e.eventId);n&&P(m,{ts:ee,command:"extract-chat",id:n,verdict:"add",polarity:"preference",tag:e.label,by:f,event_id:e.eventId,target:n});continue}for(let n of fe(e,{ts:ee,command:"extract-chat",by:f}))P(m,n)}let te=y.map(e=>e.eventId).sort(),Ee=se(m,{ts:new Date().toISOString(),proposal_id:null,nodes:M,edges:I,review:C,supersessions:v,...G.length>0?{names:G}:{},...B.length>0?{judgements:B}:{},event_ids:te,...$.sid?{sid:$.sid}:{},source_head_moves:{}},{expectPrev:j}),q=le(m),O=new Set;for(let e of v)if(e.kind==="node"){O.add(e.old);for(let n of q.edgesInto(e.old))O.add(n.src)}for(let e of V)O.add(e.cid);let $e=[...O].map(e=>({cid:e,state:q.stale(q.tipOf(e))})).filter(e=>e.state!=="fresh");return{record:Ee.record,errors:null,applied:te,skipped:U,minted:V,staleDelta:$e}}export{Ae as commitChatTurn};
|
|
2
|
+
import{a as P,c as fe}from"./chunk-BZAGVBCX.js";import{a as he}from"./chunk-427OQS2N.js";import{a as L,b as ge}from"./chunk-IVQX3AKL.js";import{d as ue}from"./chunk-NVGBE2DR.js";import{B as ae,C as le,E as pe,e as oe,f as re,h as ce,p as A}from"./chunk-W3Z7AZNT.js";import{a as de}from"./chunk-JQW2QFSX.js";import"./chunk-6FCPS2VT.js";import{a as _,b as x}from"./chunk-UH2ZTX4E.js";import{g as ie,j as se}from"./chunk-XMTSHHYQ.js";import"./chunk-DBIBROYW.js";import{e as k,f as D,g as ne,h as H}from"./chunk-AKX4VRRR.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-UR6MHSHU.js";var Ie=new Set(["approve","edit","reject"]);function Ae($){let{contextDir:m,graph:s,ops:me,by:f}=$,F=$.mintable??he(),j=ie(m);if(s.latestHash!==j)return{record:null,errors:[{code:"STALE_BASIS",detail:`graph opened at ${String(s.latestHash)} but chain head is ${String(j)} \u2014 re-open and retry`}]};let U=[],y=[],Y=new Set;for(let e of me){if(s.appliedEvents.has(e.eventId)||Y.has(e.eventId)){U.push(e.eventId);continue}Y.add(e.eventId),y.push(e)}if(y.length===0)return{record:null,errors:null,applied:[],skipped:U,minted:[],staleDelta:[]};let o=[],M=[],I=[],C=[],v=[],G=[],B=[...$.judgements??[]],V=[],J=new Map,z=new Set,Q=[],T=new Set,ve=new Set(F),X=new Set;for(let e of y){if(!Ie.has(e.kind))continue;let n=e.target,t=s.resolve(n),i=t?s.tipOf(t.cid):n;X.has(i)&&o.push({code:"MULTIPLE_TERMINAL_OPS",detail:`${n} has more than one terminal op in this turn \u2014 normalize latest-wins first`}),X.add(i)}let R=(e,n,t)=>{let i=s.resolve(n);if(!i)return o.push({code:"UNKNOWN_NODE",detail:`${e}: ${n} names nothing in the graph`}),null;let d=s.tipOf(i.cid);return d!==t||s.superseded.has(t)?(o.push({code:"EXPECTED_CID_MOVED",detail:`${e}: ${n} moved or was archived since it was displayed`,data:{tip:d}}),null):t},K=e=>new Set(pe(s,s.tipOf(e))),S=[],E=new Set,Z=e=>({code:"RETRACT_FORBIDDEN",detail:`retract ${e}: provenance edges cannot be retracted \u2014 DERIVES is historical evidence; reject or edit the node instead`});for(let e of y){if(e.kind!=="retract"){S.push(e);continue}let n=R("retract",e.target,e.expectedCid);if(!n)continue;let t=new Map;for(let d of K(n))for(let a of[...s.edgesFrom(d),...s.edgesInto(d)])t.set(a.ecid,a);let i;if(e.edgeEcid!==void 0){if(s.superseded.has(e.edgeEcid)){o.push({code:"UNKNOWN_EDGE",detail:`retract ${e.target}: ${e.edgeEcid} is already retracted`});continue}if(i=t.get(e.edgeEcid),!i){o.push({code:"UNKNOWN_EDGE",detail:`retract ${e.target}: ${e.edgeEcid} is not a live edge touching ${e.target} (checked the full version chain)`});continue}}else if(e.edgeRef!==void 0){let d=e.edgeRef;if(d.type===k.DERIVES){o.push(Z(e.target));continue}let a=(r,c)=>{let N=A(s,c);if(N)return N;let b=s.resolve(c)!==null;return o.push(b?{code:"TOMBSTONED_REF",detail:`retract ${e.target}: ${d.type} ${r} '${c}' is tombstoned (retired with no live successor) \u2014 pick a live node`}:{code:"UNKNOWN_REF",detail:`retract ${e.target}: ${d.type} ${r} got (unknown) for '${c}' \u2014 not a committed node (a node added in this same turn has no id yet: commit the add first)`}),null},g=a("dst",d.dst);if(!g)continue;let l=K(g.cid),p=null;if(d.src!==void 0){let r=a("src",d.src);if(!r)continue;p=K(r.cid)}let h=[...t.values()].filter(r=>r.type===d.type&&l.has(r.dst)&&(p===null||p.has(r.src)));if(h.length===0){o.push({code:"UNKNOWN_EDGE",detail:`retract ${e.target}: no live ${d.type} edge onto ${d.dst}${d.src!==void 0?` from ${d.src}`:""} touches ${e.target} (checked the full version chain)`});continue}if(h.length>1){let r=h.map(c=>`${c.type} ${s.displayNameOf(c.src)??c.src} \u2192 ${s.displayNameOf(c.dst)??c.dst} (${c.ecid})`).join("; ");o.push({code:"AMBIGUOUS_RETRACT",detail:`retract ${e.target}: ${h.length} live ${d.type} edges match \u2014 ${r} \u2014 add src to disambiguate`});continue}i=h[0]}else{o.push({code:"INVALID_RETRACT",detail:`retract ${e.target}: neither edge_ecid nor edge {type, dst, src?} was given`});continue}if(i.type===k.DERIVES){o.push(Z(e.target));continue}if(E.has(i.ecid)){o.push({code:"EDGE_RETRACTED",detail:`retract ${e.target}: ${i.ecid} was retracted earlier in this turn`});continue}E.add(i.ecid),S.push({kind:"retract",target:e.target,expectedCid:e.expectedCid,edgeEcid:i.ecid,reason:e.reason,eventId:e.eventId})}let w=new Map;for(let e of S){if(e.kind!=="edit")continue;let n=s.resolve(e.target);if(!n||s.tipOf(n.cid)!==e.expectedCid||s.superseded.has(e.expectedCid))continue;let t=s.getNode(e.expectedCid);if(!t)continue;let i={...t.content};for(let[a,g]of Object.entries(e.edit))g!==void 0&&(i[a]=g);if(typeof i.title=="string"&&!i.title.trim()||D(t.label,i).length>0)continue;let d=_(t.label,i);d!==e.expectedCid&&w.set(e.expectedCid,d)}for(let e of S)if(e.kind==="approve"){let n=R("approve",e.target,e.expectedCid);n&&C.push({id:n,kind:"review-item",resolution:"approved",edit:null,reason:null,by:f})}else if(e.kind==="reject"){let n=R("reject",e.target,e.expectedCid);if(!n)continue;if(C.push({id:n,kind:"review-item",resolution:"rejected",edit:null,reason:e.reason,by:f}),e.redirectTo!==void 0){let t=s.resolve(e.redirectTo);if(!t||t.superseded){o.push({code:"UNKNOWN_NODE",detail:`reject.redirectTo: ${e.redirectTo} is not a live node`});continue}v.push({kind:"node",old:n,new:t.cid,reason:e.reason,by:f})}}else if(e.kind==="edit"){let n=R("edit",e.target,e.expectedCid);if(!n)continue;let t=s.getNode(n);if(!t){o.push({code:"UNKNOWN_NODE",detail:`edit: ${e.target} node file unreadable`});continue}let i={...t.content};for(let[l,p]of Object.entries(e.edit))p!==void 0&&(i[l]=p);if(typeof i.title=="string"&&!i.title.trim()){o.push({code:"EMPTY_TITLE",detail:`edit: ${e.target} edited title is empty`});continue}let d=D(t.label,i);if(d.length>0){for(let l of d)o.push({code:l.code,detail:`edit ${e.target}: ${l.detail}`});continue}let a=_(t.label,i);if(a===n){C.push({id:n,kind:"review-item",resolution:"approved",edit:null,reason:null,by:f});continue}if(oe(s,n,a)){o.push({code:"SUPERSEDE_CYCLE",detail:`edit ${e.target}: edit reproduces an already-superseded version (supersession cycle guard) \u2014 re-edit forward or redesign`});continue}let g=re({graph:s,oldTip:n,newCid:a,newLabel:t.label,by:f,reason:`re-blessed onto ${a} (edited in chat)`,skipEcids:E,dstRedirect:w});if(g.errors.length>0){for(let l of g.errors)o.push({code:"REBLESS_REFUSED",detail:`edit ${e.target}: ${l}`});continue}M.push({cid:a,label:t.label,content:i}),I.push(...g.edges),v.push({kind:"node",old:n,new:a,reason:e.reason??"edited in chat",by:f}),v.push(...g.supersessions),C.push({id:a,kind:"review-item",resolution:"edited",edit:{...e.edit},reason:null,by:f})}else if(e.kind==="enhance"){if(!R("enhance",e.target,e.expectedCid))continue;for(let t of e.edges){let i=A(s,t.src),d=A(s,t.dst);if(!i||!d){let[u,W]=i?["dst",t.dst]:["src",t.src],ye=s.resolve(W)!==null;o.push(ye?{code:"TOMBSTONED_REF",detail:`enhance ${e.target}: ${t.type} ${u} '${W}' is tombstoned (retired with no live successor) \u2014 pick a live node`}:{code:"UNKNOWN_REF",detail:`enhance ${e.target}: ${t.type} ${u} got (unknown) for '${W}' \u2014 not a committed node (a node added in this same turn has no id yet: commit the add first)`});continue}let a=s.nodeLabel.get(i.cid)??"(unknown)",g=s.nodeLabel.get(d.cid)??"(unknown)";for(let u of H(t.type,a,g,t.props))o.push({code:u.code,detail:`enhance ${e.target}: ${u.detail}`});let l=x(t.type,i.cid,d.cid,t.props),p=w.get(i.cid)??i.cid,h=w.get(d.cid)??d.cid,r=x(t.type,p,h,t.props);if(s.superseded.has(l)||E.has(l)||s.superseded.has(r)){let u=s.superseded.has(l)||E.has(l)?l:r;o.push({code:"EDGE_RETRACTED",detail:`enhance ${e.target}: this ${t.type} edge was retracted (${u}) \u2014 re-adding a retracted edge is refused (revival unsupported)`});continue}if(s.edgesFrom(i.cid).some(u=>u.ecid===l)||I.some(u=>u.ecid===r))continue;let c=ce(s,t.type,i.cid,d.cid,Q);c&&o.push(c);let N=de(s,{type:t.type,src:i.cid,dst:d.cid},{pending:[],retracted:E},`enhance ${e.target}`);N&&o.push(N);let b=ne(t.type)?.cardinality;if(b==="one-live-per-src"||b==="one-live-per-src-and-dst"){let u=`${t.type}|${i.cid}`;T.has(u)&&o.push({code:"CARDINALITY_VIOLATION",detail:`${t.type} from ${i.cid}: two one-live edges in one turn`}),T.add(u)}if(b==="one-live-per-src-and-dst"){let u=`${t.type}|dst|${d.cid}`;T.has(u)&&o.push({code:"CARDINALITY_VIOLATION",detail:`${t.type} onto ${d.cid}: two one-live edges in one turn (strict 1:1)`}),T.add(u)}I.push({ecid:r,type:t.type,src:p,dst:h,props:t.props}),Q.push({src:i.cid,dst:d.cid,type:t.type})}}else if(e.kind==="retract")v.push({kind:"edge",ecid:e.edgeEcid,reason:e.reason,by:f});else if(e.kind==="add"){if(!ve.has(e.label)){o.push({code:"GATED_LABEL",detail:`add: ${e.label} is not mintable in v1 (gate: ${F.join("|")})`,data:{gate:[...F]}});continue}let n=s.heads.get(e.convSourceId),t=s.convChains.get(e.convSourceId);if(typeof n!="string"||!t){o.push({code:"CONV_SOURCE_MISSING",detail:`add: ${e.convSourceId} is not a live conversation source`});continue}let i=s.getNode(n)?.content?.blob,d=typeof i=="string"?ue(m,i)?.toString("utf8")??"":"",a=ge(d,e.cite.turn);if(a===null){o.push({code:"BAD_ANCHOR",detail:`add: ${L(e.cite.turn)} does not resolve in ${e.convSourceId}`});continue}if(!a.includes(e.cite.quote)){o.push({code:"QUOTE_MISMATCH",detail:`add: quote is not verbatim within ${L(e.cite.turn)}`});continue}let g={...e.content,derived:!0},l=D(e.label,g);if(l.length>0){for(let c of l)o.push({code:c.code,detail:`add: ${c.detail}`});continue}let p=_(e.label,g),h={source_id:e.convSourceId,source_cid:n,anchor:L(e.cite.turn),quote:e.cite.quote};for(let c of H(k.DERIVES,"source",e.label,h))o.push({code:c.code,detail:`add: ${c.detail}`});M.push({cid:p,label:e.label,content:g}),I.push({ecid:x("DERIVES",n,p,h),type:k.DERIVES,src:n,dst:p,props:h}),e.rationale&&B.push({about:p,rationale:e.rationale,by:f});let r=ae(e.label,c=>z.has(c),s.names.keys());r!==null&&(z.add(r),G.push({cid:p,slug:r,by:f})),V.push({cid:p,...r!==null?{slug:r}:{}}),J.set(e.eventId,p)}if(o.length)return{record:null,errors:o};let ee=new Date().toISOString();for(let e of S){if(e.kind==="add"){let n=J.get(e.eventId);n&&P(m,{ts:ee,command:"extract-chat",id:n,verdict:"add",polarity:"preference",tag:e.label,by:f,event_id:e.eventId,target:n});continue}for(let n of fe(e,{ts:ee,command:"extract-chat",by:f}))P(m,n)}let te=y.map(e=>e.eventId).sort(),Ee=se(m,{ts:new Date().toISOString(),proposal_id:null,nodes:M,edges:I,review:C,supersessions:v,...G.length>0?{names:G}:{},...B.length>0?{judgements:B}:{},event_ids:te,...$.sid?{sid:$.sid}:{},source_head_moves:{}},{expectPrev:j}),q=le(m),O=new Set;for(let e of v)if(e.kind==="node"){O.add(e.old);for(let n of q.edgesInto(e.old))O.add(n.src)}for(let e of V)O.add(e.cid);let $e=[...O].map(e=>({cid:e,state:q.stale(q.tipOf(e))})).filter(e=>e.state!=="fresh");return{record:Ee.record,errors:null,applied:te,skipped:U,minted:V,staleDelta:$e}}export{Ae as commitChatTurn};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c}from"./chunk-IWVA37B6.js";import"./chunk-AXTPNZPX.js";import"./chunk-L2TV4G56.js";import"./chunk-IVQX3AKL.js";import"./chunk-NVGBE2DR.js";import"./chunk-UH2ZTX4E.js";import"./chunk-XMTSHHYQ.js";import"./chunk-DBIBROYW.js";import"./chunk-AKX4VRRR.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-UR6MHSHU.js";export{c as makeChatController,b as questionStub,a as recommendationPicks};
|
|
@@ -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-75HF3GPO.js";import{x as t}from"./chunk-NJJQL54J.js";import{a as x}from"./chunk-HCBYKLMW.js";import{a,b as n}from"./chunk-C44QQJR4.js";import{a as R}from"./chunk-6YGTRKDT.js";import{e as c}from"./chunk-UR6MHSHU.js";var p=c(R(),1);var e=c(x(),1);function v(){return[{name:"convert",label:"Converting session data",status:"pending"},{name:"zip",label:"Compressing artifacts",status:"pending"},{name:"presign",label:"Requesting upload URLs",status:"pending"},{name:"upload",label:"Uploading to KaneAI",status:"pending"},{name:"atomic_replace",label:"Replacing local output",status:"pending"},{name:"commit_lock",label:"Committing to TMS",status:"pending"},{name:"finalize",label:"Finalizing test case",status:"pending"},{name:"code_export",label:"Downloading test code",status:"pending"}]}function U(s,o,d,i){return s.map(l=>l.name===o?{...l,status:d,detail:i}:l)}function D(s){let o=s/1e3;if(o<60)return`${o.toFixed(1)}s`;let d=Math.floor(o/60),i=Math.round(o%60);return`${d}m ${i}s`}function w(s){let[o,d]=(0,p.useState)(0),i=p.default.useRef(Date.now());return(0,p.useEffect)(()=>{if(!s)return;i.current=Date.now();let l=setInterval(()=>{d(Date.now()-i.current)},100);return()=>clearInterval(l)},[s]),o}function h({steps:s,status:o,testUrl:d,error:i}){let l=w(o==="uploading");return o==="uploading"?(0,e.jsxs)(a,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,e.jsxs)(a,{children:[(0,e.jsx)(n,{color:t.orange,children:"\u2601 "}),(0,e.jsx)(n,{color:t.orange,bold:!0,children:"Saving to KaneAI"}),(0,e.jsxs)(n,{color:t.dim,children:[" ",D(l)]})]}),(0,e.jsx)(a,{flexDirection:"column",marginTop:1,children:s.filter(r=>r.status!=="skipped"||r.detail).map((r,S,T)=>{let b=S===T.length-1?"\u2514\u2500":"\u251C\u2500",u=r.status==="done",m=r.status==="running",g=r.status==="failed",B=r.status==="skipped";return(0,e.jsxs)(a,{children:[(0,e.jsxs)(n,{color:t.dim,children:[" ",b," "]}),(0,e.jsx)(a,{width:3,children:m?(0,e.jsx)(f,{}):u?(0,e.jsx)(n,{color:t.green,children:"\u2713"}):g?(0,e.jsx)(n,{color:t.red,children:"\u2717"}):B?(0,e.jsx)(n,{color:t.muted,children:"\u2013"}):(0,e.jsx)(n,{color:t.muted,children:"\u25CB"})}),(0,e.jsx)(n,{color:u?t.dim:m?void 0:g?t.red:t.muted,children:r.label}),r.detail&&(0,e.jsxs)(n,{color:t.dim,children:[" ",r.detail]})]},r.name)})}),(0,e.jsx)(a,{marginTop:1,children:(0,e.jsx)(n,{color:t.muted,children:" press Ctrl+C twice to force exit"})})]}):o==="success"?(0,e.jsx)(e.Fragment,{}):(0,e.jsxs)(a,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,e.jsxs)(a,{children:[(0,e.jsx)(n,{color:t.red,children:"\u2601 "}),(0,e.jsx)(n,{color:t.red,bold:!0,children:"Save failed"})]}),i&&(0,e.jsxs)(a,{marginTop:0,children:[(0,e.jsx)(n,{color:t.dim,children:" "}),(0,e.jsx)(n,{color:t.dim,children:i})]})]})}export{v as a,U as b,h as c};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as X}from"./chunk-BB2W35TW.js";import{a as $}from"./chunk-YKTYVJBN.js";import{C as T,n as z,o as Y,p as H}from"./chunk-
|
|
2
|
+
import{d as X}from"./chunk-BB2W35TW.js";import{a as $}from"./chunk-YKTYVJBN.js";import{C as T,n as z,o as Y,p as H}from"./chunk-W3Z7AZNT.js";import{b as q,h as N}from"./chunk-XMTSHHYQ.js";import{a as W,d as S,f as L}from"./chunk-DBIBROYW.js";import{c as C}from"./chunk-UD7KKHPW.js";import{a as K,b as J}from"./chunk-NJJQL54J.js";var ce=3,de=1e4,Q=()=>new Promise(r=>setTimeout(r,25+Math.floor(Math.random()*50))),Z=r=>r==="design"||r==="maintain"?"session":r==="revert"||r==="shape-op"?"exclusive":"commit";function le(r,e,o){for(let s of r){for(let t of s.supersessions)if(t.kind==="node"&&(o.has(t.old)||t.new!==null&&o.has(t.new)))return!0;for(let t of s.nodes)if(t.label==="usecase"&&e.newBuCandidates.length>0||o.has(t.cid))return!0;if(s.design_generation&&e.generationTicket&&s.design_generation.uc_root===e.generationTicket.uc_root)return!0;for(let t of e.sourcePins)if(Object.prototype.hasOwnProperty.call(s.source_head_moves,t.source_id))return!0}return!1}async function De(r,e,o){let{contextDir:s,locks:t,probe:a}=r,m=r.sid??r.rootSid,f=e.newBuCandidates.map(b=>({tempRef:b.tempRef,probeText:b.probeText})),k=0,g=!0,p={hits:[],degraded:!1,probeBasis:null};for(;;){g&&(f.length>0&&(p=await a.batchSimilar(T(s),f)),g=!1);let b=T(s),_={seq:b.lastSeq,hash:b.latestHash},P=new Map,w=[],v=[],R=new Set;for(let d of e.ucTargets){let c=H(b,d.ref);if(c===null)return{ok:!1,kind:"validation",errors:[{code:"UNKNOWN_REF",detail:`${d.ref}: names no living node (unknown or tombstoned chain)`}]};d.expectedTip!==void 0&&d.expectedTip!==c.cid&&P.set(d.expectedTip,c.cid),R.add(c.cid),v.push(L(b,d.ref).key)}(e.verb==="revert"||e.verb==="shape-op")&&(v.length=0,v.push({kind:"context",mode:"exclusive"}));let y;try{y=t.acquire(S(v),{hold:Z(e.verb),verb:e.verb})}catch(d){if(d instanceof W&&(d.code==="UC_HELD"||d.code==="CONTEXT_HELD"))return{ok:!1,kind:"contended",err:d};throw d}let V=!1,M=!1;try{let d=await t.withKeySerialized(v,async()=>{let c=T(s),O=_.hash===c.latestHash?[]:N(s,_.seq,_.hash).records;for(let n of e.ucTargets){let i=H(c,n.ref);if(i===null){w.push({kind:"supersession",ref:n.ref,detail:`${n.ref} was retired while this commit staged \u2014 re-ground or abandon`});continue}for(let l of R)c.superseded.has(l)&&c.tipOf(l)===i.cid&&P.set(l,i.cid)}for(let n of e.sourcePins){let i=c.heads.get(n.source_id);i!=null&&i!==n.source_cid&&w.push({kind:"pin",ref:n.source_id,detail:`source '${n.source_id}' moved (pinned ${n.source_cid.slice(0,19)}, head ${i.slice(0,19)}) \u2014 re-ground or abandon`})}if(w.length>0)return{ok:!1,kind:"drifted",asks:w};if(e.generationTicket){let n=X(c,e.generationTicket);if(n!==null)return{ok:!1,kind:"validation",errors:[n]}}if(f.length>0&&O.length>0){let n=new Set(p.hits.map(u=>u.candidateCid)),i=a.recheckLocal(c,f,p.probeBasis,O);if(i.hits.some(u=>!n.has(u.candidateCid))||i.uncachedNewNodes.length>0)return M=!0,"restart"}if(e.verb!=="revert"&&e.verb!=="shape-op"){let n=S(e.ucTargets.map(u=>L(c,u.ref).key)),i=S(v);if(!(n.length===i.length&&n.every((u,h)=>JSON.stringify(u)===JSON.stringify(i[h]))))return"restart"}if(e.eventIds&&e.eventIds.length>0&&e.eventIds.every(n=>c.appliedEvents.has(n)))return{ok:!0,skipped:"already-applied"};let ae=Date.now()+de,j=c.latestHash,E=c;for(;;){let n={graph:E,expectPrev:j,redirects:P,probeHits:p.hits,degradedProbe:p.degraded,sid:m,eventIds:(l,u)=>{if(e.eventIds&&e.eventIds.length>0)return e.eventIds.slice(0,u);let h=Y(E,r.rootSid,l,u),U=r.reservedEventIds??[];if(U.length===0)return h;let D=`${r.rootSid}:${l}:`,A=0;for(let F of U){if(!F.startsWith(D))continue;let x=F.slice(D.length);/^\d+$/.test(x)&&(A=Math.max(A,Number.parseInt(x,10)))}if(A===0)return h;let G=Number.parseInt(h[0].slice(D.length),10);return!Number.isInteger(G)||G>A?h:Array.from({length:u},(F,x)=>z(r.rootSid,l,A+1+x))},assertLocks:()=>y.assertHeld()};if(r.revalidate){let l=r.revalidate(n);if(l.length>0)return{ok:!1,kind:"validation",errors:l}}y.assertHeld();let i;try{i=o(n)}catch(l){if(l instanceof q){let u=T(s),h=N(s,E.lastSeq,E.latestHash).records;if(!le(h,e,R)&&Date.now()<ae){await Q(),E=u,j=u.latestHash;continue}return"restart"}throw l}return"errors"in i?{ok:!1,kind:"validation",errors:i.errors}:(Z(e.verb)==="session"&&y.touch(),{ok:!0,result:i.result,record:i.record})}});if(d==="restart")V=!0;else return d}finally{y.release()}if(V){if(k+=1,k>=ce)return{ok:!1,kind:"unsettled",attempts:k};M&&(g=!0),await Q();continue}}}import{readFileSync as ue,writeFileSync as fe,renameSync as me,mkdirSync as pe}from"fs";import{dirname as he,join as ge}from"path";var B=1,be=720*60*1e3;function I(r){return ge(J,"embeddings",`alias-${r}.json`)}function ee(r,e=Date.now()){return r!==null&&e-r.fetchedAt<be}function re(r){try{let e=JSON.parse(ue(r,"utf-8"));return e.wrapperVersion!==B||typeof e.purposes!="object"||e.purposes===null?null:{wrapperVersion:B,writtenByVersion:String(e.writtenByVersion??""),purposes:e.purposes}}catch{return null}}function te(r,e,o=I(r)){let t=re(o)?.purposes?.[e];return!t||typeof t.alias!="string"||typeof t.dims!="number"||typeof t.fetchedAt!="number"?null:{alias:t.alias,dims:t.dims,fetchedAt:t.fetchedAt}}function se(r,e,o,s=I(r)){try{pe(he(s),{recursive:!0});let a=re(s)?.purposes??{};a[e]={alias:o.alias,dims:o.dims,fetchedAt:Date.now()};let m={wrapperVersion:B,writtenByVersion:K,purposes:a},f=`${s}.tmp`;fe(f,JSON.stringify(m,null,2)+`
|
|
3
3
|
`),me(f,s)}catch(t){C(`[embed] Failed to save alias cache: ${t instanceof Error?t.message:String(t)}`,"EMBED_CACHE_WRITE_FAILED")}}function ve(r){return r.TESTMUAI_ENV==="stage"?"stage":"prod"}function oe(r){let e=r.env??process.env,o=r.auth?.TESTMUAI_BASIC_AUTH||e.TESTMUAI_BASIC_AUTH;if(o)return{authorization:`Basic ${o}`};let s=r.auth?.TESTMUAI_API_KEY||e.TESTMUAI_API_KEY;return s?{authorization:`Bearer ${s}`}:{}}async function Oe(r,e={}){let o=e.env??process.env,s=ve(o),t=e.aliasCacheFile??I(s),a=e.now??Date.now,m=te(s,r,t);if(ee(m,a()))return{alias:m.alias,dims:m.dims};let k=`${$(o)}/assurance/embed/alias?purpose=${encodeURIComponent(r)}`,g=await(e.fetchImpl??fetch)(k,{method:"GET",headers:oe(e)});if(!g.ok)throw new Error(`embed alias resolve failed: ${g.status}`);let p=await g.json();return se(s,r,{alias:p.alias,dims:p.dims},t),{alias:p.alias,dims:p.dims}}async function je(r,e,o={}){let s=o.env??process.env,t=$(s),a=await(o.fetchImpl??fetch)(`${t}/assurance/embed`,{method:"POST",headers:{...oe(o),"content-type":"application/json"},body:JSON.stringify({purpose:r,input:e})});if(!a.ok)throw new Error(`embed failed: ${a.status}`);return await a.json()}import{readFileSync as ke,writeFileSync as ye,renameSync as Ee,mkdirSync as Ae}from"fs";import{dirname as Te,join as ne}from"path";function we(r){return ne(r,"embeddings")}function xe(r){let e=r.indexOf(":");return e>=0?r.slice(e+1):r}function ie(r,e,o){let s=xe(o);return ne(we(r),e,s.slice(0,2),`${s.slice(2)}.f32`)}function We(r,e,o){try{let s=ke(ie(r,e,o)),t=new Float32Array(Math.floor(s.length/4));for(let a=0;a<t.length;a++)t[a]=s.readFloatLE(a*4);return t}catch{return null}}function qe(r,e,o,s){try{let t=ie(r,e,o);Ae(Te(t),{recursive:!0});let a=Buffer.alloc(s.length*4);for(let f=0;f<s.length;f++)a.writeFloatLE(s[f],f*4);let m=`${t}.tmp`;ye(m,a),Ee(m,t)}catch(t){C(`[embed] Failed to cache vector: ${t instanceof Error?t.message:String(t)}`,"EMBED_CACHE_WRITE_FAILED")}}export{De as a,Oe as b,je as c,We as d,qe as e};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as w,b as O}from"./chunk-4PMZ5FCD.js";import{a as I}from"./chunk-KBM3XHAM.js";import{e as L}from"./chunk-IDX3TOPY.js";import{a as N,b as k}from"./chunk-BKM2LWU2.js";import{a as R,b as y,c as T,d as m,e as A,g as b,h as r}from"./chunk-RSSOJ3L2.js";import{b as x}from"./chunk-5EOX4MEY.js";import{a as E}from"./chunk-RZ4F3BHX.js";import{a as g,i as v}from"./chunk-
|
|
2
|
+
import{a as w,b as O}from"./chunk-4PMZ5FCD.js";import{a as I}from"./chunk-KBM3XHAM.js";import{e as L}from"./chunk-IDX3TOPY.js";import{a as N,b as k}from"./chunk-BKM2LWU2.js";import{a as R,b as y,c as T,d as m,e as A,g as b,h as r}from"./chunk-RSSOJ3L2.js";import{b as x}from"./chunk-5EOX4MEY.js";import{a as E}from"./chunk-RZ4F3BHX.js";import{a as g,i as v}from"./chunk-NJJQL54J.js";import{platform as X,arch as Y}from"os";import P from"fs";import M from"fs";import D from"path";var V=1e3,d=0,j=new Set([130,3]),a=class t{ids;logger;opts;ended=!1;createdAt=Date.now();errorState;constructor(e,n={emitted:!1}){this.ids=e.envelope,this.logger=e.logger,this.opts=e,this.errorState=n}get enabled(){return this.logger!==null}event(e,n={}){if(!this.logger)return;e==="ASR_ERROR"&&(this.errorState.emitted=!0);let i=m(this.ids,e,n);this.logger.log(R[e],e,e,C(i))}error(e,n={}){this.logger&&(this.logger.escalate(d),this.event("ASR_ERROR",{...n,error_code:e}))}child(e,n){return new t({...this.opts,envelope:{...this.ids,operation_id:n,parent_operation_id:this.ids.operation_id,verb:"design"}},this.errorState)}async lateBindContext(e){if(!(!this.logger||this.ids.context_instance_id))try{let{ensureStoreIds:n}=await import("./store-id-EOSGEKVK.js"),{ids:i,cloned:s}=n(e);this.ids.context_lineage_id=i.context_lineage_id,this.ids.context_instance_id=i.context_instance_id,s&&this.event("ASR_CONTEXT_CLONED")}catch{}}agentSession(e){this.ids.agent_session_id=e}spawnEnv(){if(!this.opts.telemetryEnabled)return{};let e={TESTMUAI_USER_SESSION_ID:this.ids.session_id,TESTMUAI_OPERATION_ID:this.ids.operation_id,TESTMUAI_CLIENT_VERSION:this.opts.clientVersion,TESTMUAI_TELEMETRY_PROXY_URL:this.opts.proxyUrl};return this.ids.context_instance_id&&(e.TESTMUAI_CONTEXT_INSTANCE_ID=this.ids.context_instance_id),e}traceTee(){return e=>{if(!this.logger)return;let n=typeof e.kind=="string"?e.kind.slice(0,64):"trace",i={...C(m(this.ids,"ASR_CMD_START",{})),trace_kind:n};typeof e.code=="string"&&(i.trace_code=e.code.slice(0,64)),delete i.event,this.logger.logStep(d,`trace_${n}`,n,i)}}wireTrace(e,n,i){if(!this.logger)return;i&&this.agentSession(i);let s=n&&typeof n=="object"?n:{};switch(e){case"spawn":this.event("ASR_AGENT_SPAWN",{tier:s.tier});break;case"session_paused":this.event("ASR_SESSION_PAUSED",s);break;case"commit":this.event("ASR_COMMIT",s);break;default:this.traceTee()({kind:e,code:typeof s.code=="string"?s.code:void 0})}}banner(){return`session: ${this.ids.session_id}`}supportFooter(){return`if this keeps failing, share this id with support: ${this.ids.session_id}`}async end(e){if(!this.ended){if(this.ended=!0,e.duration_ms===void 0&&(e={...e,duration_ms:Date.now()-this.createdAt}),this.logger)if(e.exit_code===0?this.logger.discardSteps(d):this.logger.escalate(d),e.exit_code>0&&!j.has(e.exit_code)&&!this.errorState.emitted&&this.event("ASR_ERROR",{error_code:e.exit_code===2?"usage_exit_unattributed":`exit_${e.exit_code}_unattributed`,exit_code:e.exit_code}),this.event("ASR_CMD_END",e),this.opts.longSession)await this.logger.shutdown();else{let n=await this.logger.flushOnce(V);(n==="failed"||n==="timeout")&&A(this.logger.drainBuffer())}this.logger&&this.writeManifestLine(e.exit_code),r(null)}}writeManifestLine(e){try{let n=x(this.ids.context_instance_id??null);M.mkdirSync(D.dirname(n),{recursive:!0});let i={ts:new Date().toISOString(),session_id:this.ids.session_id,operation_id:this.ids.operation_id,agent_session_id:this.ids.agent_session_id,verb:this.ids.verb,mode:this.ids.mode,exit_code:e};M.appendFileSync(n,JSON.stringify(i)+`
|
|
3
3
|
`,{flag:"a",mode:384})}catch{}}};function C(t){let e={event:t.event,session_id:t.session_id,operation_id:t.operation_id,verb:t.verb,mode:t.mode,component:t.component,seq:t.seq,context_lineage_id:t.context_lineage_id,context_instance_id:t.context_instance_id};t.parent_operation_id&&(e.parent_operation_id=t.parent_operation_id),t.agent_session_id&&(e.agent_session_id=t.agent_session_id);for(let[n,i]of Object.entries(t.context))e[n]=i;return e}var u=process.env.KANE_TELEMETRY_URL||v;function B(){return process.env.TESTMUAI_BASE_URL?"custom":process.env.TESTMUAI_ENV==="stage"?"stage":"prod"}function _e(t){let e=process.env.KANE_TELEMETRY!=="0"&&(!process.env.VITEST||process.env.KANE_TELEMETRY==="1"),n=t.env??B(),i=null;if(t.resumeSid&&t.contextRoot)try{let o=L(t.contextRoot,t.resumeSid);o?.user_session_id&&(i=o.user_session_id)}catch{}if(!i&&t.applyPlanPath)try{let o=JSON.parse(P.readFileSync(t.applyPlanPath,"utf8"));o.telemetry?.user_session_id&&(i=o.telemetry.user_session_id)}catch{}let s=i!==null;i||(i=y());let l=null,c=null,f=!1;if(t.contextRoot&&P.existsSync(t.contextRoot))if(t.write&&e){let o=k(t.contextRoot);l=o.ids.context_lineage_id,c=o.ids.context_instance_id,f=o.cloned}else{let o=N(t.contextRoot);l=o?.context_lineage_id??null,c=o?.context_instance_id??null}let h={session_id:i,operation_id:T(),context_lineage_id:l,context_instance_id:c,verb:t.verb,mode:t.mode,component:"kane-cli"},_=null;if(e){let o=I(n),S={org_id:o.org_id??"",user_id:o.user_id??"",machine_id:o.machine_id,email:null,email_domain:"",user_type:o.user_type??"unknown",env:o.env,plan:o.plan??"unknown"},U=t.mode==="interactive"||t.mode==="cli"?"cli":"agent";_=new w({proxyUrl:u,sessionId:i,identity:S,device:{cli_version:g,platform:X(),arch:Y(),host_agent:O(),invocation_mode:U},getToken:async()=>null}),t.longSession&&_.start()}let p=new a({envelope:h,logger:_,longSession:!!t.longSession,proxyUrl:u,clientVersion:`kane-cli/${g}`,telemetryEnabled:e});return e&&(r(h),p.event("ASR_CMD_START",{resumed:s,applied_plan:!!t.applyPlanPath}),f&&p.event("ASR_CONTEXT_CLONED"),b(async o=>{try{return(await E(u,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})).ok}catch{return!1}}).catch(()=>{})),p}export{B as a,_e as b};
|
|
@@ -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-NJJQL54J.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,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as t}from"./chunk-
|
|
2
|
+
import{a as t}from"./chunk-GNAPBOAJ.js";async function l(e){let o=e.credentials.expires_at,i=e.thresholdSeconds??300;if(o-Date.now()/1e3>=i)return null;let r=e.creds.loadClient(e.profile,e.env);if(!r)return null;let n=await new t(e.env).refreshToken(e.credentials.refresh_token,r.client_id),s=Math.floor(Date.now()/1e3)+n.expires_in;return e.creds.saveCredentials(e.profile,e.env,{access_token:n.access_token,refresh_token:n.refresh_token,expires_at:s,scope:n.scope}),{accessToken:n.access_token,refreshToken:n.refresh_token,expiresAt:s,scope:n.scope}}export{l as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as l}from"./chunk-
|
|
2
|
+
import{b as l}from"./chunk-UZXCCO7V.js";import{a as m}from"./chunk-7KAPHA56.js";import{a as p}from"./chunk-RZ4F3BHX.js";import{a as f}from"./chunk-AFNDJK2A.js";import{a as c,b as s,h as a,w as u}from"./chunk-NJJQL54J.js";var v="/public/skills/kane-cli";function C(){try{let n=new f().getDefaultEnv();if(n in u)return n}catch{}return"prod"}function k(){return`${m(C()).controllerBaseUrl}${v}`}import{readFileSync as S,writeFileSync as E,mkdirSync as g}from"fs";import{join as d}from"path";var h=d(s,"skill-check.json"),y=3600*1e3;function V(){try{let n=JSON.parse(S(h,"utf-8"));if(Date.now()-n.checkedAt<y)return n}catch{}return null}function A(n){try{g(s,{recursive:!0}),E(h,JSON.stringify({map:n,checkedAt:Date.now()}))}catch{}}function I(){for(let{dir:n}of a)try{let t=S(d(n,"VERSION"),"utf-8").trim();if(t)return t}catch{}return null}function M(n,t){let i=Object.keys(n.versions??{});if(i.length===0)return null;let o=i.slice().sort((r,e)=>l(r,e));for(let r of o){let e=n.versions[r]?.kaneCliMinVersion;if(!e||l(t,e)<=0)return r}return null}async function U(){try{let n=V()?.map;if(!n){let o=new AbortController,r=setTimeout(()=>o.abort(),5e3),e=await p(k(),{headers:{Accept:"application/json"},signal:o.signal});if(clearTimeout(r),!e.ok)return null;n=await e.json(),A(n)}let t=M(n,c);if(!t)return null;let i=I();return i===null?{current:null,latestCompatible:t}:l(i,t)>0?{current:i,latestCompatible:t}:null}catch{return null}}export{k as a,M as b,U as c};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as Ve}from"./chunk-
|
|
2
|
+
import{a as Ve}from"./chunk-APZCLVZD.js";import{a as Ye}from"./chunk-FBYB3SRE.js";import{a as We}from"./chunk-YCCUBQY4.js";import{a as qe}from"./chunk-VE3SUJMA.js";import{a as be}from"./chunk-3CCD434H.js";import{a as Ge}from"./chunk-GNAPBOAJ.js";import{a as He}from"./chunk-7KAPHA56.js";import{b as Le,x as u}from"./chunk-NJJQL54J.js";import{a as re}from"./chunk-HCBYKLMW.js";import{a as h,b as f,h as Fe,i as Se,k as Ne}from"./chunk-C44QQJR4.js";import{a as we}from"./chunk-6YGTRKDT.js";import{e as $}from"./chunk-UR6MHSHU.js";var je=$(we(),1);import{readFileSync as ct,writeFileSync as ut,mkdirSync as ft}from"fs";import{dirname as dt,join as ze}from"path";var mt=ze(Le,"command-history.json"),Dt=ze(Le,"generate-history.json"),ht=200,De=class{entries;filePath;max;constructor(t=mt,e=ht){this.filePath=t,this.max=e,this.entries=this._load()}push(t){this.entries.length>0&&this.entries[this.entries.length-1]===t||(this.entries.push(t),this.entries.length>this.max&&(this.entries=this.entries.slice(this.entries.length-this.max)),this._save())}getAll(){return[...this.entries]}search(t){let e=t.toLowerCase(),o=[];for(let s=this.entries.length-1;s>=0;s--)this.entries[s].toLowerCase().includes(e)&&o.push(this.entries[s]);return o}_load(){if(this.filePath===null)return[];try{let t=ct(this.filePath,"utf-8"),e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}}_save(){if(this.filePath!==null)try{ft(dt(this.filePath),{recursive:!0}),ut(this.filePath,JSON.stringify(this.entries)+`
|
|
3
3
|
`)}catch{}}};function kt(n){let t=(0,je.useRef)(null);return t.current||(t.current=new De(n)),t.current}var D=$(we(),1);var ke=$(we(),1);var Z=$(re(),1);function Xe({history:n,onSelect:t,onClose:e}){let[o,s]=(0,ke.useState)(""),[l,m]=(0,ke.useState)(0),v=o?n.search(o).slice(0,8):[];return Se((b,d)=>{if(d.escape){e();return}if(d.return){v.length>0&&v[l]?t(v[l]):e();return}if(d.upArrow){m(S=>Math.max(0,S-1));return}if(d.downArrow){m(S=>Math.min(v.length-1,S+1));return}if(d.backspace||d.delete){s(S=>S.slice(0,-1)),m(0);return}b&&!d.ctrl&&!d.meta&&(s(S=>S+b),m(0))}),(0,Z.jsxs)(h,{flexDirection:"column",marginLeft:2,borderStyle:"single",paddingX:1,children:[(0,Z.jsx)(f,{color:u.muted,bold:!0,children:"reverse search"}),(0,Z.jsxs)(h,{gap:1,children:[(0,Z.jsx)(f,{color:u.dim,children:"search:"}),(0,Z.jsx)(f,{children:o}),(0,Z.jsx)(f,{color:u.orange,children:"\u2588"})]}),v.length>0&&(0,Z.jsx)(f,{children:" "}),v.map((b,d)=>(0,Z.jsx)(h,{marginLeft:2,children:(0,Z.jsxs)(f,{color:d===l?u.orange:u.dim,bold:d===l,children:[d===l?"\u25B8 ":" ",b]})},`${d}-${b}`))]})}var X=$(re(),1);function Je({commands:n,selectedIndex:t}){return n.length===0?null:(0,X.jsx)(h,{flexDirection:"column",marginBottom:0,children:n.map((e,o)=>{let s=o===t;return e.disabled?(0,X.jsxs)(h,{children:[(0,X.jsx)(f,{color:u.dim,children:s?"\u276F ":" "}),(0,X.jsxs)(f,{color:u.dim,children:["/",e.name]}),(0,X.jsxs)(f,{color:u.dim,children:[" ",e.disabledReason??e.description]})]},e.name):(0,X.jsxs)(h,{children:[(0,X.jsx)(f,{color:s?u.orange:u.dim,children:s?"\u276F ":" "}),(0,X.jsxs)(f,{color:s?u.orange:void 0,bold:s,children:["/",e.name]}),e.args&&(0,X.jsxs)(f,{color:u.dim,children:[" ",e.args]}),(0,X.jsxs)(f,{color:u.dim,children:[" ",e.description]})]},e.name)})})}var Ze=$(we(),1);var q=$(re(),1),et={scenario:"Scenarios",case:"Test Cases",file:"Files",artifact:"Artifact candidates",installed:"Installed on device"};function Qe(n){let t={scenario:0,case:0,file:0,artifact:0,installed:0};for(let e of n)t[e.kind]++;return["scenario","case","file","artifact","installed"].filter(e=>t[e]>0).map(e=>`${t[e]} ${et[e]}`).join(" \xB7 ")}var Pe=7;function tt({items:n,selectedIndex:t,accent:e=u.orange}){let o=n.length;if(o===0)return null;let s=Math.floor(Pe/2),l=o<=Pe?0:Math.max(0,Math.min(t-s,o-Pe)),m=Math.min(o,l+Pe),v=l,b=o-m;return(0,q.jsxs)(h,{flexDirection:"column",marginBottom:0,children:[v>0&&(0,q.jsx)(h,{children:(0,q.jsx)(f,{color:u.dim,children:` \u22EF ${v} above \u2014 ${Qe(n.slice(0,l))}`})}),n.slice(l,m).map((d,S)=>{let U=l+S,F=d.selectable!==!1,E=U===t&&F,R=S===0||n[U-1].kind!==d.kind;return(0,q.jsxs)(Ze.default.Fragment,{children:[R&&(0,q.jsx)(h,{children:(0,q.jsx)(f,{color:u.dim,children:et[d.kind]})}),(0,q.jsxs)(h,{children:[(0,q.jsx)(f,{color:E?e:u.dim,children:E?"\u276F ":" "}),(0,q.jsxs)(f,{color:E?e:F?void 0:u.dim,bold:E,children:[d.label,d.reason?` \u2014 ${d.reason}`:""]})]})]},`${d.kind}:${d.value}:${U}`)}),b>0&&(0,q.jsx)(h,{children:(0,q.jsx)(f,{color:u.dim,children:` \u22EF ${b} more \u2014 ${Qe(n.slice(m))}`})})]})}var Be=$(we(),1);var gt=27,pt=127,xt=11;function bt(n){return n>=64&&n<=126}function Tt(n,t){n===xt&&t({killToEnd:!0,ctrl:!0,raw:String.fromCharCode(n)})}function vt(n,t){n===pt&&t({backspace:!0,meta:!0,raw:"\x1B\x7F"})}function wt(n,t){let e=n.map(s=>String.fromCharCode(s)).join(""),o=/^\[1;([0-9]+)([A-D])$/.exec(e);if(o){let s=parseInt(o[1],10),l=o[2],m={raw:"\x1B"+e};if(s===2)m.shift=!0;else if(s===3)m.meta=!0;else if(s===5)m.ctrl=!0;else return;l==="A"?m.arrowUp=!0:l==="B"?m.arrowDown=!0:l==="C"?m.arrowRight=!0:l==="D"&&(m.arrowLeft=!0),t(m);return}if(e==="[H"||e==="[1~"||e==="[7~"){t({home:!0,raw:"\x1B"+e});return}if(e==="[F"||e==="[4~"||e==="[8~"){t({end:!0,raw:"\x1B"+e});return}if(e==="[3;5~"){t({delete:!0,ctrl:!0,raw:"\x1B"+e});return}if(e==="[3;3~"){t({delete:!0,meta:!0,raw:"\x1B"+e});return}}function St(n,t){n===72?t({home:!0,raw:"\x1BO"+String.fromCharCode(n)}):n===70&&t({end:!0,raw:"\x1BO"+String.fromCharCode(n)})}function Et(){let n="IDLE",t=[];function e(){n="IDLE",t=[]}return{feed(o,s){for(let l of o)n==="IDLE"?l===gt?(n="ESC",t=[]):Tt(l,s):n==="ESC"?l===91?(n="CSI",t=[]):l===79?(n="SS3",t=[]):(vt(l,s),e()):n==="CSI"?(t.push(l),bt(l)&&(wt([91,...t],s),e())):n==="SS3"&&(St(l,s),e())},flushIdle(o){n==="ESC"&&t.length===0&&o({raw:"\x1B"}),e()}}}function nt(n,t={}){let e=(0,Be.useRef)(n);e.current=n;let{stdin:o}=Fe();(0,Be.useEffect)(()=>{if(t.isActive===!1||!o)return;let s=Et(),l=null,m=v=>{l&&(clearTimeout(l),l=null);let b=Buffer.isBuffer(v)?v:Buffer.from(v,"binary");s.feed(b,d=>e.current(d)),l=setTimeout(()=>{s.flushIdle(d=>e.current(d)),l=null},50)};return o.on("data",m),()=>{o.removeListener("data",m),l&&clearTimeout(l)}},[t.isActive,o])}var w=$(re(),1);function yt(n,t){let e=t-1;for(;e>=0&&n[e]!=="@"&&n[e]!==" "&&n[e]!==`
|
|
4
4
|
`;)e--;return e<0||n[e]!=="@"||e>0&&n[e-1]!==" "&&n[e-1]!==`
|
|
5
5
|
`?null:{at:e,query:n.slice(e+1,t).join("")}}function rt(n,t,e){for(let o=t+e;o>=0&&o<n.length;o+=e)if(n[o]?.selectable!==!1)return o;return t}function At(n){let t=n.findIndex(e=>e.selectable!==!1);return t===-1?0:t}var Oe=10;function Rt(n){return n.replace(/\x1b?\[200~/g,"").replace(/\x1b?\[201~/g,"").replace(/\r\n/g,`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as k}from"./chunk-
|
|
2
|
+
import{a as k}from"./chunk-FBYB3SRE.js";import{a as m}from"./chunk-BPMSNGXQ.js";import{r as a}from"./chunk-RSSOJ3L2.js";import{a as y}from"./chunk-7KAPHA56.js";import{a as h}from"./chunk-AFNDJK2A.js";var $=10,u=200,N=1e4,S=1e6;function T(t,e,r="streaming"){let n=r==="full-fetch"?S:N,o=$,i=0;if(t!==void 0){let s=Number(t);if(!Number.isInteger(s)||s<1||s>u)return{error:`--limit must be an integer in [1, ${u}] (got "${t}")`};o=s}if(e!==void 0){let s=Number(e);if(!Number.isInteger(s)||s<0||s>n)return{error:`--offset must be an integer in [0, ${n}] (got "${e}")`};i=s}return{limit:o,offset:i}}function C(t,e){if(!e)return t;let r=e.toLowerCase();return t.filter(n=>n.name.toLowerCase().includes(r))}function j(t,{limit:e,offset:r}){let n=t.slice(r,r+e),o=t.length>r+e;return{slice:n,hasMore:o}}function v(t,e,r=n=>process.stdout.write(`${n}
|
|
3
3
|
`)){for(let n of t)r(JSON.stringify(n));r(JSON.stringify({_meta:"page",limit:e.limit,offset:e.offset,returned:t.length,has_more:e.has_more}))}function b(t,e,r=n=>process.stdout.write(`${n}
|
|
4
|
-
`)){if(t.length===0){r("(no results)");return}let n=Math.max(2,...t.map(s=>s.id.length)),o=`${"ID".padEnd(n)} NAME`;r(o),r(`${"-".repeat(n)} ----`);for(let s of t)r(`${s.id.padEnd(n)} ${s.name}`);r("");let i=e.offset+t.length;if(e.hasMore){let s=e.totalIsLowerBound?`${e.total}+`:`${e.total}`;r(`${i} of ${s} \u2014 next: --offset ${e.offset+e.limit}`)}else r(`${t.length} shown (${e.total} total)`)}async function B(t,e,r){if(r.username&&r.accessKey)return{ok:!0,creds:{username:r.username,access_key:r.accessKey}};let n=new h,o=n.loadBasicAuth(t,e);if(o)return{ok:!0,creds:{username:o.username,access_key:o.access_key}};let i=n.loadCredentials(t,e);if(!i)return{ok:!1,reason:"no_credentials"};let s=i.access_token;try{let{refreshOAuthToken:d}=await import("./token-refresh-
|
|
4
|
+
`)){if(t.length===0){r("(no results)");return}let n=Math.max(2,...t.map(s=>s.id.length)),o=`${"ID".padEnd(n)} NAME`;r(o),r(`${"-".repeat(n)} ----`);for(let s of t)r(`${s.id.padEnd(n)} ${s.name}`);r("");let i=e.offset+t.length;if(e.hasMore){let s=e.totalIsLowerBound?`${e.total}+`:`${e.total}`;r(`${i} of ${s} \u2014 next: --offset ${e.offset+e.limit}`)}else r(`${t.length} shown (${e.total} total)`)}async function B(t,e,r){if(r.username&&r.accessKey)return{ok:!0,creds:{username:r.username,access_key:r.accessKey}};let n=new h,o=n.loadBasicAuth(t,e);if(o)return{ok:!0,creds:{username:o.username,access_key:o.access_key}};let i=n.loadCredentials(t,e);if(!i)return{ok:!1,reason:"no_credentials"};let s=i.access_token;try{let{refreshOAuthToken:d}=await import("./token-refresh-GSFVJ6GU.js"),w=await d({creds:n,profile:t,env:e,credentials:i});w&&(s=w.accessToken)}catch(d){return{ok:!1,reason:"refresh_failed",detail:d instanceof Error?d.message:String(d)}}let c=y(e),f=await new k(c.controllerBaseUrl,async()=>s,null).resolve();return f?{ok:!0,creds:{username:f.username,access_key:f.access_key}}:{ok:!1,reason:"exchange_failed"}}function E(t,e,r){switch(r.reason){case"no_credentials":return{message:`error: no credentials for profile "${t}" [${e}]. Run \`kane-cli login\` or pass --username/--access-key.
|
|
5
5
|
`,exitCode:2};case"refresh_failed":return{message:`error: OAuth token refresh failed for profile "${t}" [${e}]${r.detail?`: ${r.detail}`:""}. Run \`kane-cli login\` to re-auth.
|
|
6
6
|
`,exitCode:2};case"exchange_failed":return{message:`error: TMS credential exchange failed for profile "${t}" [${e}]. Token may be revoked \u2014 try \`kane-cli login\`; if the problem persists, TMS may be down.
|
|
7
7
|
`,exitCode:2}}}function O(t){return{id:t.project_id,name:t.name}}function M(t){return{id:t.id,name:t.name}}async function P(t,e,r,n){let o=r+n+1,i=[],s=!0;for await(let c of t.listProjectsStream({name:e})){if(i.push(...c.projects),c.done){s=!0;break}if(i.length>=o){s=!1;break}}return{items:i,doneStreaming:s}}function g(t){return!!t.agent||!process.stdin.isTTY||!process.stdout.isTTY}function _(t,e=r=>process.stdout.write(`${r}
|