@testmuai/kane-cli 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ChatSurface-B3ULYDYC.js +8 -0
- package/dist/{ChromeProfilePicker-AUU7JF6F.js → ChromeProfilePicker-T77E7ZSC.js} +1 -1
- package/dist/{CliFeedbackPrompt-4W74Y3UF.js → CliFeedbackPrompt-FQ2XV5DZ.js} +1 -1
- package/dist/{CliUploadProgress-6HL7WTEX.js → CliUploadProgress-TZ55LONO.js} +1 -1
- package/dist/{ConfigView-6BSCZP5Y.js → ConfigView-WWQMH36G.js} +1 -1
- package/dist/EvidenceViewOffer-L5FVBQNK.js +2 -0
- package/dist/FolderPicker-6Z3CYSHF.js +2 -0
- package/dist/{HelpView-TU7ED43J.js → HelpView-XXPCPJNF.js} +1 -1
- package/dist/{InfoBox-JLTMKVDE.js → InfoBox-SHBRHQX5.js} +1 -1
- package/dist/{LinksBox-LREUUJDV.js → LinksBox-ENNF7TDJ.js} +1 -1
- package/dist/{ProfilesView-W3GX2N2E.js → ProfilesView-CNF2FXF3.js} +1 -1
- package/dist/{ProjectPicker-SYQUJK2J.js → ProjectPicker-PVPLS642.js} +1 -1
- package/dist/{SaveSessionPrompt-MR5NJMRP.js → SaveSessionPrompt-4QP4GNGO.js} +1 -1
- package/dist/SingleShotApp-M3HNSUMZ.js +2 -0
- package/dist/{SummaryBox-UAYSVFB7.js → SummaryBox-HYNINDNN.js} +1 -1
- package/dist/TestMdRunView-ISOVQ7YP.js +2 -0
- package/dist/{WhoamiView-2YU76ASQ.js → WhoamiView-NN2HOK6H.js} +1 -1
- package/dist/app-client-ZCCNE3RV.js +2 -0
- package/dist/{app-download-AEEFQ63M.js → app-download-5UJMXPF3.js} +1 -1
- package/dist/{auth-HET3TBRI.js → auth-QKBTOWQX.js} +1 -1
- package/dist/{bind-STKXOUYI.js → bind-LVGP5KHO.js} +2 -2
- package/dist/bootstrap-RUJBMB2P.js +2 -0
- package/dist/bridge-QDPBIIOW.js +2 -0
- package/dist/{changelog-7OWRHFHZ.js → changelog-HBPBPR2O.js} +1 -1
- package/dist/{chat-controller-T2FAI55V.js → chat-controller-R4THYYPU.js} +1 -1
- package/dist/chunk-2E3ZWGIK.js +12 -0
- package/dist/{chunk-ZVHCQMJ6.js → chunk-2KH2JUGL.js} +2 -2
- package/dist/{chunk-ZIUAOEUC.js → chunk-2TYCUPCN.js} +1 -1
- package/dist/{chunk-FEJXWJ3L.js → chunk-2ZZDNPFN.js} +1 -1
- package/dist/{chunk-KFSUPQAG.js → chunk-3654GK6O.js} +43 -43
- package/dist/{chunk-RFR4ZKIC.js → chunk-3NHO5R4P.js} +2 -2
- package/dist/{chunk-3LJWYRAA.js → chunk-4II6VDXG.js} +1 -1
- package/dist/chunk-4J6DQFPC.js +4 -0
- package/dist/{chunk-SDPRO2LE.js → chunk-4U4OSOA4.js} +1 -1
- package/dist/chunk-5NIYYD7O.js +2 -0
- package/dist/{chunk-L7MXYCD7.js → chunk-5SNT2MK5.js} +1 -1
- package/dist/chunk-6J5T5FEY.js +2 -0
- package/dist/chunk-6N726QLP.js +349 -0
- package/dist/chunk-7F2ZV46B.js +2 -0
- package/dist/{chunk-BRHNRCEZ.js → chunk-7S3JZ6FQ.js} +1 -1
- package/dist/chunk-A2SQD2AY.js +4 -0
- package/dist/{chunk-AW2XUHH4.js → chunk-AJQT4IWZ.js} +1 -1
- package/dist/{chunk-6XX4LEVJ.js → chunk-AN2ZPHCE.js} +1 -1
- package/dist/{chunk-3POR47RC.js → chunk-ATGRRKEV.js} +2 -2
- package/dist/chunk-AXTPNZPX.js +2 -0
- package/dist/{chunk-RC52N7PC.js → chunk-BKVDAZEJ.js} +1 -1
- package/dist/{chunk-2WVKOZ6W.js → chunk-BPMSNGXQ.js} +1 -1
- package/dist/{chunk-UV462FZR.js → chunk-BSYX225I.js} +1 -1
- package/dist/{chunk-DZGCXKKI.js → chunk-CAMO26QU.js} +1 -1
- package/dist/chunk-ECZMYPLJ.js +19 -0
- package/dist/{chunk-65ZTD5SJ.js → chunk-FNS2EAA5.js} +2 -2
- package/dist/{chunk-7BZSCUPP.js → chunk-GNIFMQNK.js} +3 -3
- package/dist/chunk-GUVM6SZF.js +2 -0
- package/dist/{chunk-2BGUUWNF.js → chunk-HFFPPCZO.js} +2 -2
- package/dist/{chunk-T5Y6MOLM.js → chunk-HRZOFTV7.js} +1 -1
- package/dist/chunk-HWH3UYD6.js +4 -0
- package/dist/{chunk-EDSZJZFG.js → chunk-I7RQS65W.js} +1 -1
- package/dist/chunk-IUEEFGEW.js +11 -0
- package/dist/{chunk-DO5HAO3H.js → chunk-IV76ZXCY.js} +1 -1
- package/dist/{chunk-UXDL4XDL.js → chunk-IZ2FJYHG.js} +1 -1
- package/dist/{chunk-766WGMBU.js → chunk-J7KT44IC.js} +1 -1
- package/dist/{chunk-QW6EZC53.js → chunk-JEDLXUO5.js} +1 -1
- package/dist/chunk-JGOZUAMC.js +2 -0
- package/dist/{chunk-XO5ZH3ZR.js → chunk-JHKM7W5X.js} +1 -1
- package/dist/{chunk-IOFZSQAA.js → chunk-JJN76EXE.js} +1 -1
- package/dist/{chunk-YFYCCTSL.js → chunk-JUVQQP42.js} +1 -1
- package/dist/chunk-KKRNTSLL.js +6 -0
- package/dist/{chunk-IP2O264K.js → chunk-LDCLZR2U.js} +1 -1
- package/dist/chunk-LQQXPY5B.js +4 -0
- package/dist/{chunk-FMRSMN34.js → chunk-LVCY5IYI.js} +1 -1
- package/dist/{chunk-G7VQCS4J.js → chunk-LVN6VHFN.js} +1 -1
- package/dist/chunk-MMBBQ4OZ.js +2 -0
- package/dist/{chunk-QSDH5P7C.js → chunk-MTIC65NK.js} +1 -1
- package/dist/chunk-NHBYZCSX.js +4 -0
- package/dist/{chunk-GZPK6FRP.js → chunk-NRUD56FY.js} +1 -1
- package/dist/{chunk-GKYPNSQP.js → chunk-NXFAEDHV.js} +2 -2
- package/dist/{chunk-ELM6MXGJ.js → chunk-NXXJ56QA.js} +1 -1
- package/dist/{chunk-JJHG3BWO.js → chunk-O3AHFP3K.js} +1 -1
- package/dist/{chunk-FQLIW3LM.js → chunk-OAVPM6YJ.js} +1 -1
- package/dist/{chunk-QRZRSAZH.js → chunk-OJTCIZDK.js} +1 -1
- package/dist/{chunk-YJELGSKJ.js → chunk-OOEPLMKA.js} +1 -1
- package/dist/{chunk-6O3DDOP2.js → chunk-PXCMEI73.js} +1 -1
- package/dist/{chunk-C7HSWZP6.js → chunk-R4UCBA5R.js} +1 -1
- package/dist/chunk-RKXHVP2Z.js +2 -0
- package/dist/{chunk-KU6IXFGZ.js → chunk-RN4PKQFR.js} +1 -1
- package/dist/chunk-RUCSRS4C.js +5 -0
- package/dist/chunk-TAOHYWEO.js +2 -0
- package/dist/{chunk-TFPPEOAK.js → chunk-U5GHOGLM.js} +1 -1
- package/dist/chunk-UJZZDPDY.js +2 -0
- package/dist/{chunk-EWCAFKLX.js → chunk-UODLRQQ4.js} +1 -1
- package/dist/chunk-VK3NU742.js +21 -0
- package/dist/{chunk-DCY6R5DP.js → chunk-VPRNGWIY.js} +1 -1
- package/dist/{chunk-NX7TM662.js → chunk-WOEQDUJ6.js} +1 -1
- package/dist/{chunk-OMQCD3KR.js → chunk-WQPQNL4S.js} +1 -1
- package/dist/{chunk-HMYMSRA4.js → chunk-WV27D55O.js} +1 -1
- package/dist/{chunk-GCBKDX2J.js → chunk-WVCH66YH.js} +1 -1
- package/dist/{chunk-7JWKHKFU.js → chunk-YCLG3T5E.js} +1 -1
- package/dist/chunk-YGMC3FGJ.js +26 -0
- package/dist/{chunk-TKGUT425.js → chunk-YHYTCENI.js} +1 -1
- package/dist/{chunk-UDIQOJEL.js → chunk-YSSYT5F5.js} +1 -1
- package/dist/{chunk-OTTGS2TE.js → chunk-YTDSQAYN.js} +1 -1
- package/dist/{chunk-HCKH44I2.js → chunk-ZEDAPY7M.js} +1 -1
- package/dist/chunk-ZI6UIJUN.js +11 -0
- package/dist/{config-RS47F5SC.js → config-RLDXM5ZH.js} +1 -1
- package/dist/{credentials-OH6AVI6N.js → credentials-CALNKQMN.js} +1 -1
- package/dist/deps-bundle-GVHIMZ5E.js +2 -0
- package/dist/{deps-resolve-XC5S53DG.js → deps-resolve-T6P4EACP.js} +1 -1
- package/dist/{dispatch-SE5GY3Z2.js → dispatch-ECUEAMXS.js} +1 -1
- package/dist/doctor-SIBHJVGC.js +2 -0
- package/dist/evidence-ZVQHPELX.js +2 -0
- package/dist/evolve-cmd-JGCFTXWA.js +2 -0
- package/dist/extract-bind-EXW32RUY.js +10 -0
- package/dist/{extract-cmd-UZMEZMGP.js → extract-cmd-7IOLJJCL.js} +1 -1
- package/dist/gaps-cmd-WPCJPLGB.js +3 -0
- package/dist/{generate-headless-D3SVQ2AI.js → generate-headless-U4GTG234.js} +2 -2
- package/dist/index.js +61 -60
- package/dist/{ingest-cmd-EAE7N5RC.js → ingest-cmd-YYNAKI2U.js} +1 -1
- package/dist/interactive-bind-Y65XV4Y5.js +25 -0
- package/dist/{list-commands-MRXL5HGS.js → list-commands-3EROWJWV.js} +1 -1
- package/dist/login-flow-TRINUSBB.js +2 -0
- package/dist/mobile-prompts-TP3ODM5M.js +2 -0
- package/dist/{persist-recorded-session-TLDQ5HKP.js → persist-recorded-session-EHYT3PVN.js} +1 -1
- package/dist/{phase-seed-VFHIH6FL.js → phase-seed-DIRETNU6.js} +1 -1
- package/dist/{pipeline-UOM4LNAI.js → pipeline-5GOS2KV2.js} +1 -1
- package/dist/prepare-target-BUEOZVJV.js +2 -0
- package/dist/reconcile-cmd-TY3MWZL3.js +2 -0
- package/dist/reconcile-deps-6KTJHBMJ.js +4 -0
- package/dist/reconcile-engine-O7QEZVX6.js +2 -0
- package/dist/{recording-banner-4M7XHVGI.js → recording-banner-BWWFOJCR.js} +1 -1
- package/dist/registry-KXEDLM6X.js +2 -0
- package/dist/{require-project-folder-4UPQNEBJ.js → require-project-folder-CXDRRWEQ.js} +1 -1
- package/dist/resolve-run-intent-PZXEQTHC.js +7 -0
- package/dist/{resolver-UBOZLFFE.js → resolver-FTU5KO7H.js} +1 -1
- package/dist/{run-URPGHOQM.js → run-CMFBSYWF.js} +1 -1
- package/dist/run-WKHPVWUN.js +2 -0
- package/dist/{run-test-md-76ZPKXO6.js → run-test-md-7HGOZJSU.js} +2 -2
- package/dist/session-items-2ATN7VXG.js +2 -0
- package/dist/{skill-installer-CIS6GAYF.js → skill-installer-QNUDLGPD.js} +1 -1
- package/dist/{spawner-J67QR4QP.js → spawner-DQZRJIE6.js} +1 -1
- package/dist/tcg-generate-XKSTMCOG.js +2 -0
- package/dist/{testmd-actions-77ELR5UU.js → testmd-actions-IFRW7NGG.js} +1 -1
- package/dist/{tms-client-VD3B3SMU.js → tms-client-V3TR4QW3.js} +1 -1
- package/dist/token-refresh-FP6JFLXB.js +2 -0
- package/dist/{validate-basic-2GVSQ2R5.js → validate-basic-3CNUDDH7.js} +1 -1
- package/dist/{verdicts-TRSTJLCL.js → verdicts-NYCSBWUC.js} +1 -1
- package/dist/{version-check-O6PYTI4T.js → version-check-7TSAVA6V.js} +1 -1
- package/dist/walk-session-AINBHZKB.js +2 -0
- package/dist/with-telemetry-3DL7ZEZL.js +2 -0
- package/package.json +11 -11
- package/dist/ChatSurface-U37VZDCW.js +0 -8
- package/dist/EvidenceViewOffer-62XHEEGW.js +0 -2
- package/dist/FolderPicker-S7U2EN2M.js +0 -2
- package/dist/SingleShotApp-XOKVOM7C.js +0 -2
- package/dist/TestMdRunView-7UVSDAF4.js +0 -2
- package/dist/app-client-OEXESV4U.js +0 -2
- package/dist/bootstrap-44YKVWWE.js +0 -2
- package/dist/bridge-5Z3BIB77.js +0 -2
- package/dist/chunk-27U4PLPX.js +0 -2
- package/dist/chunk-2KDGIZED.js +0 -4
- package/dist/chunk-3PECJD6S.js +0 -11
- package/dist/chunk-7Q6M6P4X.js +0 -26
- package/dist/chunk-CTW2VQKS.js +0 -6
- package/dist/chunk-FNH55WSR.js +0 -19
- package/dist/chunk-GPG3FIN3.js +0 -21
- package/dist/chunk-HEAIJCGZ.js +0 -2
- package/dist/chunk-KCCSWEGA.js +0 -4
- package/dist/chunk-MA34UWKX.js +0 -4
- package/dist/chunk-MBF3FP5P.js +0 -5
- package/dist/chunk-MXHHMIO2.js +0 -349
- package/dist/chunk-QGKPLOUI.js +0 -2
- package/dist/chunk-RLRNLIRS.js +0 -2
- package/dist/chunk-TYLYFERW.js +0 -10
- package/dist/chunk-V2R3LCA3.js +0 -12
- package/dist/chunk-VGFTNLQQ.js +0 -2
- package/dist/chunk-W2JFDDIB.js +0 -2
- package/dist/chunk-YRFMPIU2.js +0 -4
- package/dist/doctor-FSECFZUU.js +0 -2
- package/dist/evidence-OYPHZUKI.js +0 -2
- package/dist/evolve-cmd-BCPNXAMV.js +0 -2
- package/dist/extract-bind-LLEASZAK.js +0 -10
- package/dist/gaps-cmd-IVXFPFAQ.js +0 -3
- package/dist/interactive-bind-ORMN2REX.js +0 -25
- package/dist/login-flow-QJQM3RHT.js +0 -2
- package/dist/mobile-prompts-TOX35ER6.js +0 -2
- package/dist/prepare-target-QYWIJIVQ.js +0 -2
- package/dist/reconcile-cmd-3H34KVVD.js +0 -2
- package/dist/reconcile-deps-XIH75ZLY.js +0 -4
- package/dist/reconcile-engine-UKWPG2LV.js +0 -2
- package/dist/registry-PYOTKZYZ.js +0 -2
- package/dist/resolve-run-intent-X72V3KJA.js +0 -7
- package/dist/run-2COODVX2.js +0 -2
- package/dist/tcg-generate-BDTRKY2A.js +0 -2
- package/dist/token-refresh-4BPAPXKK.js +0 -2
- package/dist/walk-session-CHJXHZMO.js +0 -2
- package/dist/with-telemetry-CQCWLVOC.js +0 -2
- /package/dist/{lifecycle-cmd-O2324GN6.js → lifecycle-cmd-HO5VL7AM.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as ot,g as st}from"./chunk-5DBK6QNS.js";import{b as w,c as ne,d as Ze,f as ie,g as oe}from"./chunk-CJJXT5DO.js";import{a as Qe,e as P,f as j,g as et,h as U,i as L,j as tt}from"./chunk-ZPDM6FO7.js";import{a as M,b as T,d as qe}from"./chunk-EHN5HTUD.js";import{d as at}from"./chunk-NVGBE2DR.js";import{a as W}from"./chunk-CH273NAE.js";import{a as R,b as _}from"./chunk-L5LI2JF4.js";import{a as te,c as We,d as Je,e as Xe,f as re}from"./chunk-6IA6QMPH.js";import{A as x}from"./chunk-TH47OOBV.js";import{b as K}from"./chunk-VAYBKR76.js";import{a as nt}from"./chunk-CUM23TLF.js";import{b as it,f as G,i as Y}from"./chunk-DUAXZYAD.js";import{d as se,f as rt}from"./chunk-WXHQYYD5.js";import{a as Ye,b as Ke}from"./chunk-
|
|
2
|
+
import{d as ot,g as st}from"./chunk-5DBK6QNS.js";import{b as w,c as ne,d as Ze,f as ie,g as oe}from"./chunk-CJJXT5DO.js";import{a as Qe,e as P,f as j,g as et,h as U,i as L,j as tt}from"./chunk-ZPDM6FO7.js";import{a as M,b as T,d as qe}from"./chunk-EHN5HTUD.js";import{d as at}from"./chunk-NVGBE2DR.js";import{a as W}from"./chunk-CH273NAE.js";import{a as R,b as _}from"./chunk-L5LI2JF4.js";import{a as te,c as We,d as Je,e as Xe,f as re}from"./chunk-6IA6QMPH.js";import{A as x}from"./chunk-TH47OOBV.js";import{b as K}from"./chunk-VAYBKR76.js";import{a as nt}from"./chunk-CUM23TLF.js";import{b as it,f as G,i as Y}from"./chunk-DUAXZYAD.js";import{d as se,f as rt}from"./chunk-WXHQYYD5.js";import{a as Ye,b as Ke}from"./chunk-NHBYZCSX.js";import{a as Ge}from"./chunk-LVN6VHFN.js";import{a as Ue}from"./chunk-7F2ZV46B.js";function C(t){if(t===null)return"broken";let e=Math.floor(t/100);return e===1?"passed":e===7?"failed":e===2?"skipped":"broken"}var A={failed:3,broken:2,passed:1,skipped:0};function ae(t){let e="skipped";for(let r of t)A[r]>A[e]&&(e=r);return e}import{createHash as Vt}from"crypto";import{basename as Bt}from"path";function ce(t){let e=t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40);return e.length>0?e:"session"}function de(t){return Vt("sha256").update(t).digest("hex").slice(0,8)}function ue(t){let e=Bt(t).replace(/_test\.md$/i,"").replace(/\.md$/i,"");return`${ce(e)}-${de(t)}`}function le(t,e){return`${ce(t)}-${de(e)}`}function pe(t){let e={};for(let[r,n]of Object.entries(t))typeof n=="string"&&n.length>0&&(e[r]=n);return e}function Ht(t,e){return{pack_test_dir:t,ordinal_offset:e}}import{promises as k}from"fs";import{join as E}from"path";function fe(t){let e={evidence:"0.1",run_id:t.execution_id,status:"running",title:t.title,started:t.started,environment:{producer:{name:"kane-cli",version:t.producerVersion},...t.surfaces?{surfaces:t.surfaces}:{},run_kind:t.run_kind,origin:t.origin,pid:t.pid},...t.credits!==void 0?{metrics:{credits:{value:t.credits,type:"count"}}}:{}};return _(e,{lineWidth:-1})}async function me(t,e,r,n=process.cwd(),i){let o=i??w(t.execution_id,n),s=E(o,"tests",e);return await k.mkdir(E(o,"coverage"),{recursive:!0}),await k.writeFile(E(o,"coverage",".keep"),""),await k.mkdir(s,{recursive:!0}),await k.writeFile(E(o,"run.yaml"),fe(t)),r&&await k.writeFile(E(s,r.path),r.content),o}async function zt(t,e=process.cwd()){let r=w(t.execution_id,e);await k.mkdir(E(r,"coverage"),{recursive:!0}),await k.writeFile(E(r,"coverage",".keep"),"");let n=R(fe(t));return n.environment&&delete n.environment.run_kind,await k.writeFile(E(r,"run.yaml"),_(n,{lineWidth:-1})),r}async function Ut(t,e=process.cwd()){return T(w(t,e),new Date().toISOString())}async function ge(t,e=process.cwd()){await k.rm(w(t,e),{recursive:!0,force:!0})}import{promises as he}from"fs";import{join as ve}from"path";function J(t){let e={evidence:"0.1",test:t.testId,status:t.status,...t.durationMs!==void 0?{duration_ms:t.durationMs}:{},...t.attempts&&t.attempts.length?{attempts:t.attempts}:{},...t.flaky!==void 0?{flaky:t.flaky}:{},...t.definitionPath?{definition:{path:t.definitionPath}}:{},...t.definitionId?{definition_id:t.definitionId}:{},...t.assuranceId?{assurance_id:t.assuranceId}:{},...Object.keys(t.externalId).length?{external_id:t.externalId}:{},...t.tags&&t.tags.length?{tags:t.tags}:{},...Object.keys(t.environment).length?{environment:t.environment}:{},steps:t.steps};return _(e,{lineWidth:-1})}function ye(t){return _({logs:t},{lineWidth:-1})}async function we(t,e,r){await he.writeFile(ve(t,"tests",e,"result.yaml"),r)}async function _e(t,e,r){let n=ve(t,"tests",e,"logs");await he.mkdir(n,{recursive:!0}),await he.writeFile(ve(n,"meta.yaml"),r)}import{promises as X}from"fs";import{join as ct}from"path";function dt(t){return ct(t,".internal","meta.json")}async function ut(t){let e;try{e=await X.readFile(dt(t),"utf8")}catch(n){if(n?.code==="ENOENT")return null;throw n}let r=JSON.parse(e);if(!r||typeof r!="object"||Array.isArray(r))throw new Error("meta.json is not a JSON object");return r}async function xe(t,e){let r;try{r=await ut(t)??{}}catch(s){console.warn(`evidence: meta.json at ${t} unreadable \u2014 skipping execution-pointer append to preserve identity`,s);return}let n=Array.isArray(r.executions)?r.executions:[];n.push(e),r.executions=n,await X.mkdir(ct(t,".internal"),{recursive:!0});let i=dt(t),o=`${i}.tmp-${process.pid}-${Date.now()}`;await X.writeFile(o,JSON.stringify(r,null,2)+`
|
|
3
3
|
`),await X.rename(o,i)}async function Gt(t){try{let e=await ut(t);return e&&Array.isArray(e.executions)?e.executions:[]}catch{return[]}}async function Yt(t,e,r=process.cwd()){let n=await ie(t,r);if(!n){let o=`evidence: no pack found for "${t}"`;return e.json?console.log(JSON.stringify({valid:!1,error:"not_found",target:t})):console.error(o),2}let i=await M(n,e.profile??"L1");return e.json?console.log(JSON.stringify({valid:i.valid,status:i.status,diagnostics:i.diagnostics})):console.log(`evidence: ${i.valid?"valid":"INVALID"} (${e.profile??"L1"}, status ${i.status})`),i.valid?0:1}function ke(t){let e=[];for(let r of t){let n=r.perFlow&&r.perFlow.length?r.perFlow.map(i=>i.resultCode):[r.resultCode];for(let i of n)e.push(C(i))}return ae(e)}function Kt(t){let e=null;for(let r of t){let n=r.perFlow&&r.perFlow.length?r.perFlow.map(i=>i.resultCode):[r.resultCode];for(let i of n)i!=null&&(e==null||A[C(i)]>A[C(e)]||A[C(i)]===A[C(e)]&&i>e)&&(e=i)}return e}import{promises as Wt}from"fs";import{extname as lt,basename as Jt}from"path";var Xt={".ndjson":"ndjson",".log":"log",".json":"json",".har":"har"};async function be(t){let e;try{e=await Wt.readdir(t)}catch{return[]}return e.filter(r=>r!=="meta.yaml").sort().map(r=>({name:Jt(r,lt(r)),file:r,format:Xt[lt(r)]??"txt"}))}import{mkdirSync as qt,appendFileSync as Zt}from"fs";import{join as pt}from"path";function Se(t,e){return pt(t,"tests",e,"logs")}function Ee(t,e,r,n={},i){try{i?.(e,r,r,n)}catch{}if(t)try{qt(t,{recursive:!0});let o=JSON.stringify({ts:new Date().toISOString(),level:e,event:r,...n})+`
|
|
4
4
|
`;Zt(pt(t,"diagnostics.ndjson"),o)}catch{}}import{promises as I}from"fs";import{dirname as ar,join as D}from"path";import{statSync as Qt}from"fs";import{promises as Ie}from"fs";import{basename as er,join as tr}from"path";var rr=1e6,nr=2e6;function ir(){return Ye.map(t=>Ke(t))}function ft(t=ir()){return t.map(e=>{let r=0;try{r=Qt(e).size}catch{}return{path:e,offset:r}})}var or=/\x1b\[[0-9;]*[A-Za-z]/g;async function sr(t,e,r){let n;try{n=await Ie.open(t,"r");let i=(await n.stat()).size,o=e<=i?e:0,s=i-o;if(s<=0)return null;let a=s>r?i-r:o,c=Buffer.alloc(Math.min(s,r));return await n.read(c,0,c.length,a),c.toString("utf8")}catch{return null}finally{await n?.close().catch(()=>{})}}async function mt(t,e){let r=e.caps?.stderr??rr,n=e.caps?.appium??nr,i=[];e.runnerStderrPath&&i.push({src:e.runnerStderrPath,from:0,cap:r});for(let o of e.appiumMarks??[])i.push({src:o.path,from:o.offset,cap:n});for(let o of i){let s=await sr(o.src,o.from,o.cap);if(s===null)continue;let a=s.replace(or,"");if(a!=="")try{await Ie.mkdir(t,{recursive:!0}),await Ie.writeFile(tr(t,er(o.src)),a)}catch{}}}async function cr(t){try{let e=D(t,"tests"),r=await I.readdir(e).catch(()=>[]);for(let n of r){let i=D(e,n,"steps"),o=await I.readdir(i).catch(()=>[]);for(let s of o){let a=await I.readFile(D(i,s,"failure.yaml"),"utf8").catch(()=>null);if(a!=null)try{let c=R(a);if(c&&typeof c=="object"&&c.triage)return!0}catch{}}}}catch{}return!1}async function gt(t,e,r,n={}){let i=D(t,"tests",e,"logs");if(r)try{await I.mkdir(i,{recursive:!0}),await I.copyFile(r,D(i,"tui.log"))}catch{}await mt(i,{runnerStderrPath:r?D(ar(r),"runner-stderr.log"):void 0,appiumMarks:n.appiumMarks});let o=await be(i);if(!o.length&&n.requireRealLog)throw new Error(`evidence test ${e} has no real log to declare`);o.length&&await _e(t,e,ye(o))}async function Re(t){let e=t.cwd??process.cwd(),r=t.packDir??w(t.executionId,e);if(!t.saved&&!t.packDir)return await ge(t.executionId,e),{sealed:!1};await gt(r,t.testId,t.tuiLogPath,{requireRealLog:t.requireRealLog,appiumMarks:t.appiumMarks});let n=D(r,"run.yaml"),i=R(await I.readFile(n,"utf8"));i.environment={...i.environment??{},saved:t.saved,run_kind:t.runKind},await I.writeFile(n,_(i,{lineWidth:-1}));let o=await I.open(n,"r+");try{await o.sync()}finally{await o.close()}let s=await cr(r);await T(r,new Date().toISOString());let a;try{let d=await M(r,"L1");a=d.valid;let u=(d.diagnostics??[]).filter(p=>String(p?.code??"").includes("failure.status_disagrees"));if(u.length>0)if(t.expectStatusDisagrees||s){let p=t.expectStatusDisagrees?"expected under --bug-detection continue":"self-explained by triaged failure record(s)";console.warn(`evidence: ${u.length} status_disagrees advisory(ies) \u2014 ${p}`)}else console.warn(`evidence: ${u.length} status_disagrees advisory(ies) \u2014 step verdicts disagree with their failure records`,u);if(!d.valid){console.warn(`evidence: sealed pack ${t.executionId} failed L1 validation`,d.diagnostics);let p=String(d.diagnostics?.[0]?.code??"");Ee(Se(r,t.testId),"warn","EVIDENCE_INVALID",{execution_id:t.executionId,first_code:p,surface:t.surface??"testmd"},t.log)}}catch(d){console.warn(`evidence: validation error for ${t.executionId}`,d)}let c;if(t.saved&&t.packDir)try{c=await Ze(r,t.executionId,e)}catch(d){console.warn(`evidence: store install failed for ${t.executionId}`,d)}if(t.outputStemDir)try{await xe(t.outputStemDir,{execution_id:t.executionId,run_kind:t.runKind,status:t.verdict,valid:a,at:new Date().toISOString()})}catch(d){console.warn(`evidence: execution-pointer append failed for ${t.executionId} (pack is sealed)`,d)}return{sealed:!0,valid:a,storePath:c}}import{release as ht}from"os";import{execFileSync as dr}from"child_process";var vt=!1,q;function ur(){if(!vt)if(vt=!0,process.platform==="darwin")try{q=dr("sw_vers",["-productVersion"],{timeout:2e3}).toString().trim()||void 0}catch{q=ht()||void 0}else q=ht()||void 0;return q}function Pe(t){let e={os:te(process.platform)},r=ur();if(r&&(e.os_version=r),t.cdpBrowser){let n=/^([A-Za-z]+)\/(\d+)/.exec(t.cdpBrowser);n&&(e.browser=n[1].replace(/^Headless/,""),e.browser_version=n[2])}return t.resolution&&(e.resolution=t.resolution),Je(e,t.runnerEnvironment)}async function yt(t){if(t)try{let e=await fetch(`${t}/json/version`,{signal:AbortSignal.timeout(2e3)});if(!e.ok)return;let r=await e.json();return typeof r.Browser=="string"?r.Browser:void 0}catch{return}}function lr(t){let e;return()=>(e||(e=yt(t)),e)}import{promises as $,existsSync as O,readFileSync as gr}from"fs";import{basename as hr,join as h}from"path";import{readFileSync as pr}from"fs";import{dirname as fr,resolve as mr}from"path";function wt(t,e){let r=mr(t),n=pr(r,"utf8");return P(e?j(n,U(fr(r),e)):n)}var N=class t{constructor(e){this.opts=e}executionId;testId;definitionPath=null;definitionContent=null;accumulatedSteps=[];maxOrdinal=0;_attempts=[];_packDirOverride;_attached=!1;appiumMarks=ft();get attached(){return this._attached}static async attach(e){let r=hr(e.packDir).replace(/\.evidence$/,""),n=new t({origin:"testrun",runKind:"author",pid:process.pid,title:e.testId,started:new Date().toISOString(),producerVersion:Ue,cwd:e.cwd});n.executionId=r,n.testId=e.testId,n._packDirOverride=e.packDir,n._attached=!0;let i=h(e.packDir,"tests",e.testId);return await $.mkdir(i,{recursive:!0}),e.definition&&(await $.writeFile(h(i,e.definition.path),e.definition.content),n.definitionPath=e.definition.path,n.definitionContent=e.definition.content),n}async start(){if(this._attached)throw new Error("attach-mode session is already started");this.executionId=ne(),this.testId=this.opts.testmdRelPath?ue(this.opts.testmdRelPath):le(this.opts.objectiveOrName??"session",this.opts.sessionId??this.executionId);let e=this.opts.definition??null;return await me({execution_id:this.executionId,title:this.opts.title,started:this.opts.started,producerVersion:this.opts.producerVersion,surfaces:this.opts.surfaces,run_kind:this.opts.runKind,origin:this.opts.origin,pid:this.opts.pid,...this.opts.credits!==void 0?{credits:this.opts.credits}:{}},this.testId,e,this.opts.cwd,this.opts.packRootDir?this.pack:void 0),e&&(this.definitionPath=e.path,this.definitionContent=e.content),{executionId:this.executionId,testId:this.testId,packTestDir:this.packTestDir}}get pack(){return this._packDirOverride?this._packDirOverride:this.opts.packRootDir?h(this.opts.packRootDir,`${this.executionId}.evidence`):w(this.executionId,this.opts.cwd)}get packTestDir(){return h(this.pack,"tests",this.testId)}async writeDefinition(e,r="test.md"){await $.writeFile(h(this.packTestDir,r),e),this.definitionPath=r,this.definitionContent=e}computeAssuranceId(){try{if(this.opts.testmdRelPath&&this.opts.cwd){let e=h(this.opts.cwd,this.opts.testmdRelPath);if(O(e))return L(gr(e,"utf8"))?.id}}catch{}}computeDefinitionId(){try{if(this.opts.testmdRelPath&&this.opts.cwd){let e=h(this.opts.cwd,this.opts.testmdRelPath),r=h(this.opts.cwd,".context"),n=O(r)?x(r):void 0;if(O(e))return wt(e,n)}if(this.definitionContent!=null)return P(this.definitionContent)}catch{}}noteSpawn(e){this.accumulatedSteps.push(...e.steps),this.maxOrdinal=Math.max(this.maxOrdinal,e.maxOrdinal)}nextOrdinalOffset(){return this.maxOrdinal}get steps(){return this.accumulatedSteps}get attempts(){return this._attempts}async archiveAttempt(e,r){let n=this._attempts.length+1,i=h(this.packTestDir,String(n));try{await $.mkdir(i,{recursive:!0});for(let o of["steps","logs","v16-trajectory"]){let s=h(this.packTestDir,o);O(s)&&await $.rename(s,h(i,o))}this.definitionPath&&O(h(this.packTestDir,this.definitionPath))&&await $.copyFile(h(this.packTestDir,this.definitionPath),h(i,this.definitionPath))}catch{}return this._attempts.push({n,status:e,steps:this.accumulatedSteps,...r!==void 0?{durationMs:r}:{}}),this.accumulatedSteps=[],this.maxOrdinal=0,n}async writeResult(e){let r=ke(e.spawns),n=this._attempts.length?[...this._attempts.map(u=>({status:u.status,...u.durationMs!==void 0?{duration_ms:u.durationMs}:{}})),{status:r,...e.durationMs!==void 0?{duration_ms:e.durationMs}:{}}]:void 0,i=n?new Set(n.map(u=>u.status)).size>1:void 0,o=this.pack,s=pe(e.externalIdInput),a=re(e.runnerEnv,e.intentEnv),c=this.computeDefinitionId(),d=this.computeAssuranceId();await we(o,this.testId,J({testId:this.testId,status:r,durationMs:e.durationMs,definitionPath:this.definitionPath,definitionId:c,assuranceId:d,externalId:s,environment:a,steps:e.steps,tags:e.tags,attempts:n,flaky:i}));for(let u of this._attempts){let p=h(this.packTestDir,String(u.n));O(p)&&await $.writeFile(h(p,"result.yaml"),J({testId:this.testId,status:u.status,durationMs:u.durationMs,definitionPath:this.definitionPath,definitionId:c,assuranceId:d,externalId:s,environment:a,steps:u.steps,tags:e.tags}))}let l=e.externalIdInput;return e.log&&(l.commit_id||l.test_id||l.testcase_id)&&e.log("info","EVIDENCE_EXTERNAL_ID","Evidence external-id mapping",{execution_id:this.executionId,commit_id:l.commit_id??null,test_id:l.test_id??null,testcase_id:l.testcase_id??null,project_id:l.project_id??null,session_id:l.session_id??null,session_name:l.session_name??null}),r}get id(){return this.executionId}get test(){return this.testId}};async function vr(t,e,r=oe){try{let n=await r(t);if(n.aborted.length>0||n.removed.length>0)try{e?.("info","EVIDENCE_RECOVERY","Startup evidence recovery swept incomplete packs",{aborted:n.aborted,removed:n.removed,origin:"startup"})}catch{}return n}catch(n){return console.warn("evidence: startup recovery failed",n),{aborted:[],removed:[]}}}import{promises as jr}from"fs";import{existsSync as De,mkdirSync as Dr,readdirSync as $r,readFileSync as Lr,rmSync as Or,statSync as Fr,writeFileSync as Mr}from"fs";import{join as F}from"path";import{mkdirSync as yr,renameSync as wr,rmSync as _r,writeFileSync as xr}from"fs";import{join as _t}from"path";var kr=5e6;function xt(t,e,r){let n=_t(t,"coverage","sources"),i=new Map,o=!1;try{for(let s of r.usecases)for(let a of s.sources){if(i.has(a.id)){a.file=i.get(a.id);continue}if(!a.cid)continue;let c=at(e,a.cid);if(c===null||c.byteLength>kr)continue;o||(yr(n,{recursive:!0}),o=!0);let d=_t(n,a.id),l=`${d}.tmp-${process.pid}`;xr(l,c),wr(l,d);let u=`coverage/sources/${a.id}`;i.set(a.id,u),a.file=u}}catch{for(let s of r.usecases)for(let a of s.sources)delete a.file;if(o)try{_r(n,{recursive:!0,force:!0})}catch{}}}import{existsSync as Ce,readFileSync as V,renameSync as Ir,writeFileSync as Rr}from"fs";import{dirname as It,isAbsolute as Rt,resolve as Pt}from"path";var br=new Set(["inline","testmd","testrun"]),Sr=new Set(["inferred","authored","runtime-derived"]),Ae=new Set(["passed","failed","broken","skipped"]);function kt(t,e,r){if(r.facts.length===0)return{record:null,errors:[{code:"EMPTY_EXECUTIONS",detail:"a run with no designed units attaches no facts \u2014 skip the call"}]};let n=e;for(let i=0;;i++){let o=G(t);if(n.latestHash!==o){if(i>=3)return{record:null,errors:[{code:"STALE_BASIS",detail:`graph opened at ${String(n.latestHash)} but chain head is ${String(o)} \u2014 retry budget exhausted`}]};n=x(t);continue}let s=Er(t,n,r);if(s!=="cas")return s;if(i>=3)return{record:null,errors:[{code:"STALE_BASIS",detail:"concurrent appends kept moving the head \u2014 retry budget exhausted"}]};n=x(t)}}function Er(t,e,r){let n=[],i=[];for(let s of r.facts){let a=`executions[${s.ref}]`,c=e.resolve(s.ref),d=c?e.tipOf(c.cid):null;if(!c||!d||e.superseded.has(d)){n.push({code:"UNKNOWN_REF",detail:`${a}: '${s.ref}' is not a live committed node`});continue}if(e.nodeLabel.get(d)!==se.TEST){n.push({code:"ILLEGAL_TARGET",detail:`${a}: execution facts attach to tests \u2014 '${s.ref}' is a ${e.nodeLabel.get(d)}`});continue}if(!br.has(s.mode)){n.push({code:"BAD_MODE",detail:`${a}: mode '${s.mode}' not in inline|testmd|testrun`});continue}if(!Ae.has(s.verdict)){n.push({code:"BAD_VERDICT",detail:`${a}: verdict '${s.verdict}' not in ${[...Ae].join("|")}`});continue}if(!Sr.has(s.oracle_mode)){n.push({code:"BAD_ORACLE_MODE",detail:`${a}: oracle_mode '${s.oracle_mode}' not in inferred|authored|runtime-derived`});continue}if(typeof s.drift_flag!="boolean"||typeof s.stale_at_run!="boolean"){n.push({code:"MISSING_FIELD",detail:`${a}: drift_flag and stale_at_run are required booleans`});continue}if(!s.execution_id||!s.started_at||!s.definition_id_at_run){n.push({code:"MISSING_FIELD",detail:`${a}: execution_id, started_at and definition_id_at_run are required`});continue}let l=[];for(let u of s.per_ac??[]){let p=e.resolve(u.ac_ref),f=p?e.tipOf(p.cid):null;if(!p||!f||e.superseded.has(f)||e.nodeLabel.get(f)!==se.AC){n.push({code:"UNKNOWN_REF",detail:`${a}.per_ac: '${u.ac_ref}' is not a live AC`});continue}if(!Ae.has(u.verdict)){n.push({code:"BAD_VERDICT",detail:`${a}.per_ac['${u.ac_ref}']: verdict '${u.verdict}'`});continue}l.push({ac_ref:e.nameOf.get(f)??f,verdict:u.verdict})}i.push({about:d,definition_id_at_run:s.definition_id_at_run,verdict:s.verdict,...l.length?{per_ac:l}:{},drift_flag:s.drift_flag,oracle_mode:s.oracle_mode,stale_at_run:s.stale_at_run,...s.unresolved_acs?.length?{unresolved_acs:s.unresolved_acs}:{},execution_id:s.execution_id,...s.evidence_id?{evidence_id:s.evidence_id}:{},...s.duration_ms!==void 0?{duration_ms:s.duration_ms}:{},started_at:s.started_at,mode:s.mode,local:s.local,...s.via_parent?{via_parent:s.via_parent}:{}})}if(n.length>0)return{record:null,errors:n};let o;try{o=Y(t,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:[],supersessions:[],executions:i,...r.eventIds&&r.eventIds.length>0?{event_ids:r.eventIds}:{},source_head_moves:{}},{expectPrev:e.latestHash})}catch(s){if(s instanceof it)return"cas";throw s}return K(t),{record:o.record,errors:null}}function At(t){let e={failed:3,broken:2,skipped:1,passed:0},r=new Map;for(let n of t)for(let i of n.verifies??[]){let o=r.get(i);(o===void 0||(e[n.status]??0)>(e[o]??0))&&r.set(i,n.status)}return[...r.entries()].map(([n,i])=>({ref:n,verdict:i}))}function Ct(t){let e=[],r=W(t.cwd);if(!Ce(r))return{synced:0,superseded:0,skipped:"no-context",warnings:e};let n=t.by??{kind:"ai",id:"exec-sync"},i=x(r),o=[],s=0,a=new Set;for(let d of t.members){let l=Rt(d.path)?d.path:Pt(t.cwd,d.path);for(let u of Pr(l)){if(a.has(u.path))continue;a.add(u.path);let p=u.path===l?void 0:L(V(l,"utf8"))?.id,f=V(u.path,"utf8"),m=L(f);if(!m?.id)continue;let g=i.resolve(m.id),b=g?i.tipOf(g.cid):null;if(!g||!b||i.superseded.has(b)){e.push(`sync: ${m.id} does not resolve to a live test \u2014 skipped (foreign store?)`);continue}let S=P(j(f,U(It(u.path),i))),v=String(i.getNode(b)?.content.test_md_blob??""),H=P(j(v,et(i))),z=!1,ee=b;if(S===H)m.base!==H&&Et(u.path,f,H,e);else if(m.base===H){let y=Ar(r,i,b,f,S,n);y.error?(e.push(`sync: could not supersede ${m.id}: ${y.error}`),z=!0):(s++,ee=y.newCid,z=y.oracleTier,Et(u.path,V(u.path,"utf8"),S,e),i=x(r))}else z=!0,e.push(m.base?`sync: ${m.id} was edited from an older version \u2014 graph kept; reconcile via a redesign or maintain`:`sync: ${m.id} carries no base pin (hand-copied file?) \u2014 fact attached with drift flag`);let Ve=i.getNode(ee)?.content.check,Be=u.path===l?d.acs??[]:[],He=Be.filter(y=>bt(i,y.ref)),ze=Be.filter(y=>!bt(i,y.ref)).map(y=>y.ref);o.push({ref:m.id,definition_id_at_run:S,verdict:d.verdict,...He.length?{per_ac:He.map(y=>({ac_ref:y.ref,verdict:y.verdict}))}:{},drift_flag:z,oracle_mode:Ve?.expected_mode??(Qe(Ve?.operand)?"runtime-derived":"inferred"),stale_at_run:i.stale(ee)!=="fresh",...ze.length?{unresolved_acs:ze}:{},execution_id:d.executionId,...d.evidenceId?{evidence_id:d.evidenceId}:{},...d.durationMs!==void 0?{duration_ms:d.durationMs}:{},started_at:d.startedAt,mode:d.mode,local:d.local,...p?{via_parent:p}:{}})}}if(o.length===0)return{synced:0,superseded:s,warnings:e};let c=kt(r,x(r),{facts:o,by:n});return c.errors?(e.push(...c.errors.map(d=>`sync facts: ${d.code}: ${d.detail}`)),{synced:0,superseded:s,warnings:e}):{synced:o.length,superseded:s,warnings:e}}function Pr(t){let e=[],r=new Set,n=i=>{if(r.has(i)||!Ce(i))return;r.add(i);let o=V(i,"utf8");for(let s of o.split(`
|
|
5
5
|
`)){let a=/^@import\s+(\S+)\s*$/.exec(s.trim());if(!a)continue;let c=Rt(a[1])?a[1]:Pt(It(i),a[1]);Ce(c)&&L(V(c,"utf8"))?.id&&n(c)}e.push({path:i})};return n(t),e}function bt(t,e){let r=t.resolve(e),n=r?t.tipOf(r.cid):null;return!!(r&&n&&!t.superseded.has(n)&&t.nodeLabel.get(n)==="ac")}function Ar(t,e,r,n,i,o){let s=e.getNode(r);if(!s)return{oracleTier:!1,error:"tip unreadable"};let a=tt(n),c=String(s.content.test_md_blob??""),d=/^#\s+(.+?)\s*$/m.exec(a)?.[1]??String(s.content.title??""),l={...s.content,test_md_blob:a,definitionId:i,title:d},u=rt("test",l);if(u.length>0)return{oracleTier:!1,error:u.map(g=>g.detail).join("; ")};let p=nt("test",l);if(p===r)return{newCid:r,oracleTier:!1};let f=St(c)!==St(a),m=G(t);if(e.latestHash!==m)return{oracleTier:f,error:`store advanced under the sync (basis ${String(e.latestHash)} vs head ${String(m)}) \u2014 re-run to retry`};try{Y(t,{ts:new Date().toISOString(),proposal_id:null,nodes:[{cid:p,label:"test",content:l}],edges:[],review:[{id:p,kind:"review-item",resolution:"edited",edit:null,reason:"edited on disk (run sync)",by:o}],supersessions:[{kind:"node",old:r,new:p,reason:"edited on disk (run sync)",by:o}],source_head_moves:{}},{expectPrev:m})}catch(g){return{oracleTier:f,error:g instanceof Error?g.message:String(g)}}return K(t),{newCid:p,oracleTier:f}}var Cr=/\s@verifies\s+(ac-[\w.:\/-]+(?:\s*,\s*ac-[\w.:\/-]+)*)\s*$/;function St(t){let e=[],r=t.split(`
|
|
@@ -8,6 +8,6 @@ import{d as ot,g as st}from"./chunk-5DBK6QNS.js";import{b as w,c as ne,d as Ze,f
|
|
|
8
8
|
`),o=-1;if(i[0]?.trim()==="---"){for(let c=1;c<i.length;c++)if(i[c].trim()==="---"){o=c;break}}if(o<0)return;let s=!1;for(let c=1;c<o;c++){if(/^\s+base:\s*sha256:[0-9a-f]+\s*$/.test(i[c])){i[c]=i[c].replace(/sha256:[0-9a-f]+/,r),s=!0;break}if(/^assurance:\s*$/.test(i[c])&&!i.slice(c,Math.min(c+3,o)).some(d=>/^\s+base:/.test(d))){i.splice(c+2,0,` base: ${r}`),s=!0;break}}if(!s)return;let a=`${t}.tmp-sync`;Rr(a,i.join(`
|
|
9
9
|
`)),Ir(a,t)}catch(i){n.push(`sync: pin refresh failed for ${t} (${i instanceof Error?i.message:String(i)}) \u2014 next run self-heals`)}}var Tr={passed:"passed",failed:"failed",broken:"blocked",skipped:"not-run"},Dt=(t,e)=>{try{if(!De(e))return{status:"skipped",reason:"no context store at the project root"};let r=F(t,"tests");if(!De(r))return{status:"skipped",reason:"pack has no tests/"};let n=new Map;for(let a of $r(r)){let c=F(r,a,"result.yaml");if(!De(c)||!Fr(F(r,a)).isDirectory())continue;let d=R(Lr(c,"utf8"));if(!d?.definition_id&&!d?.assurance_id)continue;let l=At(d.steps??[]),u={testShortId:String(d.test??a),execution:Tr[String(d.status)]??"not-run",...l.length?{acs:l}:{}};d.assurance_id&&n.set(`id:${d.assurance_id}`,u),d.definition_id&&n.set(`def:${d.definition_id}`,u)}let i=st(x(e),n,{scope:"run"}),o=ot(i);xt(t,e,i);let s=_({...i,rollup:o},{lineWidth:-1});return Dr(F(t,"coverage"),{recursive:!0}),Mr(F(t,"coverage","usecases.yaml"),s),{status:"written"}}catch(r){try{Or(F(t,"coverage","sources"),{recursive:!0,force:!0})}catch{}return{status:"skipped",reason:r instanceof Error?r.message:String(r)}}};async function Nr(t){try{let e=new N({origin:"inline",runKind:"author",pid:t.pid,title:t.title,started:new Date().toISOString(),producerVersion:t.producerVersion,surfaces:t.surfaces,objectiveOrName:t.objectiveOrName,sessionId:t.sessionId,cwd:t.cwd,packRootDir:t.packRootDir}),r=await e.start();return{session:e,...r,packDir:e.pack,spawns:[],startedAtMs:Date.now(),cwd:t.cwd}}catch(e){return console.warn("evidence: inline pack creation failed",e),null}}function Vr(t,e,r){if(!t)return;t.session.noteSpawn(e),e.resolution&&(t.resolution=e.resolution),t.runnerEnvironment=We(t.runnerEnvironment,e.runnerEnvironment);let n=(r?.per_flow_metadata??[]).map(i=>({resultCode:i?.result_code!=null?Number(i.result_code):null}));t.spawns.push({resultCode:r?.result_code!=null?Number(r.result_code):null,...n.length?{perFlow:n}:{}})}function Br(t){if(t)return{packTestDir:t.packTestDir,ordinalOffset:t.session.nextOrdinalOffset()}}async function Hr(t,e){if(!t)return null;if(t.finalized)return t.finalized;let r=(n,i,o)=>e.log?e.log("warn",n,i,o):console.warn(`evidence: ${i}`,o??"");try{if(e.recordedTestPath)try{await t.session.writeDefinition(await jr.readFile(e.recordedTestPath,"utf8"))}catch(s){r("EVIDENCE_DEFINITION_FAILED","could not attach synthesized test.md",{error:String(s)})}let n=e.cdpBrowserCapture?await e.cdpBrowserCapture():void 0,i=await t.session.writeResult({steps:t.session.steps,spawns:t.spawns.length?t.spawns:[{resultCode:null}],externalIdInput:{...e.externalIdInput,execution_id:t.executionId},runnerEnv:Pe({cdpBrowser:n,resolution:t.resolution,runnerEnvironment:t.runnerEnvironment}),intentEnv:Xe(e.model,t.runnerEnvironment),durationMs:e.durationMs??Date.now()-t.startedAtMs,log:e.log});try{if(e.recordedTestPath){let s=Ct({cwd:e.cwd??t.cwd??process.cwd(),members:[{path:e.recordedTestPath,verdict:i,executionId:t.executionId,startedAt:new Date(t.startedAtMs).toISOString(),mode:"inline",local:e.local??!1}]});for(let a of s.warnings)r("EXEC_SYNC",a)}}catch(s){r("EXEC_SYNC","exec-sync failed",{error:String(s)})}try{let s=(e.coverageWriter??Dt)(t.packDir,W(e.cwd??t.cwd??process.cwd()));s.status==="skipped"&&r("EVIDENCE_COVERAGE_SKIPPED",`coverage/usecases.yaml not written: ${s.reason}`)}catch(s){r("EVIDENCE_COVERAGE_SKIPPED","coverage writer threw",{error:String(s)})}let o=await Re({executionId:t.executionId,testId:t.testId,saved:e.saved,runKind:"author",verdict:i,cwd:e.cwd??t.cwd,packDir:t.packDir,tuiLogPath:e.tuiLogPath,log:e.log,surface:"inline",requireRealLog:!!t.runnerEnvironment?.native_platform,appiumMarks:t.session.appiumMarks});return t.finalized=o,e.log?.("info","EVIDENCE_SEALED","Inline pack sealed",{execution_id:t.executionId,verdict:i,valid:o.valid,pack:t.packDir,store_copy:o.storePath??null}),o}catch(n){return r("EVIDENCE_SEAL_FAILED","inline pack finalize failed",{error:String(n)}),null}}import{statSync as Wr,openSync as Jr,readSync as Xr,closeSync as qr}from"fs";import{basename as Zr,resolve as Qr}from"path";import{createServer as zr}from"http";import{createReadStream as Ur,promises as Gr}from"fs";import{randomBytes as Yr}from"crypto";var Z="127.0.0.1";function $t(t,e){if(!t)return null;let r=/^bytes=(\d*)-(\d*)$/.exec(t.trim());if(!r)return null;let[,n,i]=r;if(n===""&&i==="")return null;if(n===""){let a=Number(i);return a===0||e===0?"unsatisfiable":{start:Math.max(0,e-a),end:e-1}}let o=Number(n);if(o>=e)return"unsatisfiable";let s=i===""?e-1:Math.min(Number(i),e-1);return s<o?null:{start:o,end:s}}async function $e(t){let e=Yr(16).toString("hex"),r=zr((i,o)=>{Kr(i,o,t,e).catch(()=>o.destroy())});await new Promise((i,o)=>{r.once("error",o),r.listen(t.port??0,Z,()=>{r.removeListener("error",o),i()})});let n=r.address().port;return{port:n,urlFor:i=>`http://${Z}:${n}/${e}/${encodeURIComponent(i)}`,close:()=>new Promise(i=>{r.close(()=>i()),r.closeAllConnections()})}}async function Kr(t,e,r,n){let i=t.url??"/",o=v=>{try{r.log?.("warn","EVIDENCE_SERVE_DENIED",{reason:v,path:i})}catch{}};if(t.headers.host!==`${Z}:${t.socket.localPort}`){o("host_mismatch"),e.writeHead(403).end();return}let s=t.headers.origin;if(s!==void 0&&!r.allowedOrigins.includes(s)){o("origin_denied"),e.writeHead(403).end();return}let a=s?{"Access-Control-Allow-Origin":s,Vary:"Origin","Access-Control-Expose-Headers":"Content-Range, Content-Length"}:{};if(t.method==="OPTIONS"){let v={...a,"Access-Control-Allow-Methods":"GET, HEAD, OPTIONS","Access-Control-Allow-Headers":"range","Access-Control-Max-Age":"86400"};t.headers["access-control-request-private-network"]==="true"&&(v["Access-Control-Allow-Private-Network"]="true"),e.writeHead(204,v).end();return}if(t.method!=="GET"&&t.method!=="HEAD"){e.writeHead(405,a).end();return}let c;try{let v=new URL(t.url??"/",`http://${Z}`).pathname.split("/");if(v.length!==3||v[1]!==n){o("bad_token"),e.writeHead(404,a).end();return}c=decodeURIComponent(v[2])}catch{o("not_found"),e.writeHead(404,a).end();return}let d=r.packs.get(c);if(!d){o("not_found"),e.writeHead(404,a).end();return}let l;try{let v=await Gr.stat(d);if(!v.isFile())throw new Error("not a file");l=v.size}catch{o("not_found"),e.writeHead(404,a).end();return}let u={...a,"Accept-Ranges":"bytes","Content-Type":"application/zip","Cache-Control":"no-store"};if(t.method==="HEAD"){e.writeHead(200,{...u,"Content-Length":String(l)}).end();return}let p=$t(t.headers.range,l);if(p==="unsatisfiable"){o("unsatisfiable"),e.writeHead(416,{...a,"Content-Range":`bytes */${l}`}).end();return}let[f,m,g]=p===null?[0,l-1,200]:[p.start,p.end,206],b={...u,"Content-Length":String(m-f+1)};if(g===206&&(b["Content-Range"]=`bytes ${f}-${m}/${l}`),e.writeHead(g,b),l===0){e.end();return}let S=Ur(d,{start:f,end:m});S.on("error",()=>e.destroy()),e.on("close",()=>S.destroy()),S.pipe(e)}function B(t,e){return(e??Ge(t).evidenceViewerUrl).replace(/\/+$/,"")}function Le(t,e){return`${e}/?pack=${encodeURIComponent(t)}`}function Oe(t){return`evidence: view locally with \`kane-cli evidence serve ${t}\``}async function en(t,e,r={}){let n=r.out??(l=>process.stdout.write(l+`
|
|
10
10
|
`)),i=l=>(n(`error: ${l}`),2);if(e.env!=="prod"&&e.env!=="stage")return i(`invalid --env: ${String(e.env)}`);if(e.port!==void 0&&(!Number.isInteger(e.port)||e.port<1||e.port>65535))return i("invalid --port: expected an integer 1-65535");let o;try{o=B(e.env,e.viewerUrl),new URL(o)}catch{return i(`invalid --viewer-url: ${e.viewerUrl}`)}if(t.length===0)return i("no pack paths given");let s=new Map;for(let l of t){let u=Qr(l),p;try{p=Wr(u)}catch{return i(`${l}: not found`)}if(p.isDirectory())return i(`${l}: is a directory \u2014 packs must be sealed .evidence files (run the execution to completion, or seal it, first)`);if(!p.isFile())return i(`${l}: not a regular file`);let f=Buffer.alloc(2),m=Jr(u,"r");try{Xr(m,f,0,2,0)}finally{qr(m)}if(f.toString("latin1")!=="PK")return i(`${l}: not a sealed evidence pack (zip magic missing)`);let g=Zr(u);if(s.has(g))return i(`duplicate pack basename: ${g} (URL names collide \u2014 rename one)`);s.set(g,u)}let a=r.log??((l,u,p)=>process.stderr.write(`warn: ${u} reason=${p.reason} path=${p.path}
|
|
11
|
-
`)),c;try{c=await $e({packs:s,allowedOrigins:[new URL(o).origin],port:e.port,log:a})}catch(l){return i(`could not bind 127.0.0.1${e.port?`:${e.port}`:""} \u2014 ${l.message}`)}n(`serving ${s.size} pack${s.size===1?"":"s"} on http://127.0.0.1:${c.port}`);for(let l of s.keys()){let u=c.urlFor(l);n(l),n(` pack ${u}`),n(` viewer ${Le(u,o)}`)}return n("press Ctrl-C to stop"),await(r.hold??tn)(),await c.close(),0}function tn(){return new Promise(t=>{let e=process.listeners("SIGINT");process.removeAllListeners("SIGINT"),process.once("SIGINT",()=>{for(let r of e)process.on("SIGINT",r);t()})})}import{promises as Q}from"fs";import{tmpdir as sn}from"os";import{join as Ft,resolve as Me}from"path";var rn=["error","prefer_first","prefer_latest","discard"],nn=["external_id.commit_id","external_id.test_id"];function Lt(t){let e=t.replace(/-/g,"_");return rn.includes(e)?e:null}function Ot(t){let e=t==="discard"?{on_collision:"discard"}:{on_collision:"error",identity:{keys:[...nn],on_same:t??"nest",on_different:t?"error":"split"}};return _({packs:{require_status:"finalized",require_valid:"L1",on_ineligible:"abort"},tests:e,rules:[{file:"run.yaml",key:"run_id",must:"different",on_violation:"skip"},{file:"result.yaml",key:"external_id.project_id",must:"same",on_violation:"error"},{file:"result.yaml",key:"external_id.org_id",must:"same",on_violation:"error"}]},{lineWidth:-1})}async function Fe(t){try{if(!t.isTTY){t.log(Oe(t.packPath));return}let e=B(t.env);await(t.renderPrompt??on)(t.packPath,e)}catch(e){try{t.log(`evidence view failed \u2014 ${e.message}`)}catch{}}}async function on(t,e){let r=await import("./react-QWOAB3TB.js"),{render:n}=await import("./build-JIKYOZUH.js"),{EvidenceViewOffer:i}=await import("./EvidenceViewOffer-
|
|
11
|
+
`)),c;try{c=await $e({packs:s,allowedOrigins:[new URL(o).origin],port:e.port,log:a})}catch(l){return i(`could not bind 127.0.0.1${e.port?`:${e.port}`:""} \u2014 ${l.message}`)}n(`serving ${s.size} pack${s.size===1?"":"s"} on http://127.0.0.1:${c.port}`);for(let l of s.keys()){let u=c.urlFor(l);n(l),n(` pack ${u}`),n(` viewer ${Le(u,o)}`)}return n("press Ctrl-C to stop"),await(r.hold??tn)(),await c.close(),0}function tn(){return new Promise(t=>{let e=process.listeners("SIGINT");process.removeAllListeners("SIGINT"),process.once("SIGINT",()=>{for(let r of e)process.on("SIGINT",r);t()})})}import{promises as Q}from"fs";import{tmpdir as sn}from"os";import{join as Ft,resolve as Me}from"path";var rn=["error","prefer_first","prefer_latest","discard"],nn=["external_id.commit_id","external_id.test_id"];function Lt(t){let e=t.replace(/-/g,"_");return rn.includes(e)?e:null}function Ot(t){let e=t==="discard"?{on_collision:"discard"}:{on_collision:"error",identity:{keys:[...nn],on_same:t??"nest",on_different:t?"error":"split"}};return _({packs:{require_status:"finalized",require_valid:"L1",on_ineligible:"abort"},tests:e,rules:[{file:"run.yaml",key:"run_id",must:"different",on_violation:"skip"},{file:"result.yaml",key:"external_id.project_id",must:"same",on_violation:"error"},{file:"result.yaml",key:"external_id.org_id",must:"same",on_violation:"error"}]},{lineWidth:-1})}async function Fe(t){try{if(!t.isTTY){t.log(Oe(t.packPath));return}let e=B(t.env);await(t.renderPrompt??on)(t.packPath,e)}catch(e){try{t.log(`evidence view failed \u2014 ${e.message}`)}catch{}}}async function on(t,e){let r=await import("./react-QWOAB3TB.js"),{render:n}=await import("./build-JIKYOZUH.js"),{EvidenceViewOffer:i}=await import("./EvidenceViewOffer-L5FVBQNK.js");await new Promise(o=>{let s=n(r.default.createElement(i,{packPath:t,viewerBase:e,onDone:()=>{s.unmount(),o()}}),{stdout:process.stderr,exitOnCtrlC:!1})})}async function an(t,e,r=process.cwd(),n={}){let i=n.out??(p=>process.stdout.write(p+`
|
|
12
12
|
`)),o=n.err??(p=>process.stderr.write(p+`
|
|
13
13
|
`)),s=p=>(o(`evidence merge: ${p}`),2);if(!e.runId)return s("--run-id is required (merged identity is the caller's fact)");if(e.rules&&e.onCollision)return s("--rules and --on-collision are mutually exclusive");let a;if(e.onCollision!==void 0){let p=Lt(e.onCollision);if(!p)return s(`invalid --on-collision: ${e.onCollision} (expected error | prefer-first | prefer-latest | discard)`);a=p}let c=[];for(let p of t){let f=await cn(p,r);if(!f)return s(`no pack found for "${p}"`);c.push(f)}let d=e.out?Me(r,e.out):w(e.runId,r),l=null,u;e.rules?u=Me(r,e.rules):(l=await Q.mkdtemp(Ft(sn(),"kane-merge-rules-")),u=Ft(l,"merge-rules.yaml"),await Q.writeFile(u,Ot(a)));try{let p=await(n.mergeFn??qe)(c,{runId:e.runId,out:d,rulesPath:u,title:e.title,finalize:e.finalize});return e.json?i(JSON.stringify(p)):dn(i,p),p.output.finalized&&!e.json&&await(n.offer??Fe)({packPath:d,env:e.env,isTTY:n.isTTY??(!!process.stdin.isTTY&&!!process.stderr.isTTY),log:o}),0}catch(p){let f=p instanceof Error?p.message:String(p);return p?.code==="ABORT"?(o(`evidence merge: aborted \u2014 ${f}`),1):s(f)}finally{l&&await Q.rm(l,{recursive:!0,force:!0}).catch(()=>{})}}async function cn(t,e){let r=Me(e,t);if(await Mt(r))return r;let n=w(t,e);return await Mt(n)?n:null}async function Mt(t){try{return await Q.stat(t),!0}catch{return!1}}function dn(t,e){let{packs:r,tests:n,output:i}=e;t(`evidence: merged ${n.merged} tests from ${r.eligible.length} packs -> ${i.path} (${i.finalized?"sealed":"live"})`);for(let o of r.skipped)t(` skipped ${o.runId}: ${o.rule} \u2014 ${o.reason}`);for(let o of n.collisions){let s;o.action==="nest"?s=`nested into ${o.folder}, latest ${o.winner}`:o.action==="split"?s=`split into ${o.folder}`:s=`winner ${o.winner}`,t(` collision ${o.test}: ${s} (${o.rule})`)}for(let o of n.discarded)t(` discarded ${o}`)}import{copyFileSync as un,existsSync as Te,mkdirSync as ln}from"fs";import{join as Tt}from"path";function pn(t,e,r){try{let n=Tt(t,"auteur","execution.json");if(Te(n))return!0;for(let i of e)if(!(!i||!Te(i)))return ln(Tt(t,"auteur"),{recursive:!0}),un(i,n),!0}catch(n){try{r?.("debug","EVIDENCE_BLOB_COPY_FAILED","auteur execution blob copy failed",{operation:"ensureAuteurExecution",source:e.find(i=>i&&Te(i))??null,error:n instanceof Error?n.message:String(n)})}catch{}}return!1}import{readFileSync as fn}from"fs";import{join as mn}from"path";function Ne(t){let e=[],r=!0,n=o=>{if(o===null||typeof o!="object")return;let s=o;if(Array.isArray(s.operations))for(let a of s.operations){let c=a?.operation_id;typeof c=="string"&&c&&e.push(c)}if(Array.isArray(s.children)){s.content_type!=="generative_block"&&(r=!1);for(let a of s.children)n(a)}if(Array.isArray(s.branches)){r=!1;for(let a of s.branches){let c=a?.children;if(Array.isArray(c))for(let d of c)n(d)}}},i=t?.instructions;if(Array.isArray(i))for(let o of i)n(o);return{ids:e,linear:r}}function gn(t){return Ne(t).ids}function je(t,e){let r=new Set(e.map(a=>a.action_id).filter(Boolean)),n=-1;for(let a of r){let c=t.indexOf(a);c>n&&(n=c)}let i=e.reduce((a,c)=>Math.max(a,c.ordinal),0),o=new Set,s=[];for(let a of t.slice(n+1))r.has(a)||o.has(a)||(o.add(a),s.push({id:a,ordinal:++i,status:"skipped",action_id:a}));return s}function jt(t,e){let r=new Set(e),n=t.filter(o=>o.action_id);if(n.some(o=>r.has(o.action_id))||n.length>e.length)return null;let i=0;return t.map(o=>o.action_id?{...o,action_id:e[i++]}:o)}function hn(t,e){if(t.length>e.length)return!1;for(let r=0;r<t.length;r++)if(e[r]!==t[r].action_id)return!1;return!0}function vn(t,e,r,n=!0){if(e.length===0)return{steps:t,tail:[]};let i=(r&&n?jt(t,e):null)??t,o=i.filter(a=>a.action_id),s=new Set(e);return o.length>0&&o.every(a=>s.has(a.action_id))?{steps:i,tail:je(e,i)}:o.length>0&&!hn(o,e)?{steps:i,tail:[],unjoined:!0}:{steps:i,tail:je(e,i)}}function Nt(t){try{let e=fn(mn(t,"auteur","execution.json"),"utf8");return Ne(JSON.parse(e))}catch{return{ids:[],linear:!0}}}function yn(t){return Nt(t).ids}export{C as a,ae as b,ce as c,de as d,ue as e,le as f,pe as g,Ht as h,fe as i,me as j,zt as k,Ut as l,ge as m,J as n,ye as o,we as p,_e as q,xe as r,Gt as s,Yt as t,ke as u,Kt as v,be as w,Se as x,Ee as y,gt as z,Re as A,Pe as B,yt as C,lr as D,N as E,vr as F,At as G,Ct as H,Dt as I,Nr as J,Vr as K,Br as L,Hr as M,$t as N,$e as O,B as P,Le as Q,Oe as R,en as S,Fe as T,an as U,pn as V,Ne as W,gn as X,je as Y,jt as Z,vn as _,Nt as $,yn as aa};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{e as $e}from"./chunk-
|
|
2
|
+
import{e as $e}from"./chunk-KKRNTSLL.js";import{a as te}from"./chunk-UODLRQQ4.js";import{a as K}from"./chunk-5Y2G4NC7.js";import{a as Be}from"./chunk-YSSYT5F5.js";import{a as ve}from"./chunk-2ZZDNPFN.js";import{y as i}from"./chunk-7F2ZV46B.js";import{b as ye}from"./chunk-DFS4RMVP.js";import{a as k}from"./chunk-HCBYKLMW.js";import{a as s,b as o,i as Se,j as Te,k as ee}from"./chunk-C44QQJR4.js";import{a as V}from"./chunk-6YGTRKDT.js";import{e as R}from"./chunk-UR6MHSHU.js";var A=R(V(),1);var C=R(V(),1);function de(e){let t=e.flatMap(u=>[u,...u.children??[]]),n=t.filter(u=>u.status==="passed").length,l=t.filter(u=>u.status==="failed").length,a=t.filter(u=>u.status==="passed"||u.status==="failed").length;return{passed:n,failed:l,total:a}}function we(e){let t=$e(e.screenshotDispatcher,e.stepLogger,e.onReasoning,e.onStepComplete),[n,l]=(0,C.useState)(0),[a,u]=(0,C.useState)("idle"),c=(0,C.useRef)("idle"),v=(0,C.useRef)(0),S=(0,C.useRef)(!1),T=(0,C.useRef)(null),d=(0,C.useRef)(null),L=(0,C.useCallback)(h=>{c.current=h,u(h)},[]),O=(0,C.useCallback)(async h=>{let b=await e.getNextConfig(h);if(!b){L("done"),e.onAllComplete?.();return}let B=h?v.current+1:0;v.current=B,l(B),e.onStepStart?.(b,B),T.current=null,d.current=null,L("running"),await t.startRun(b,e.spawnOpts)},[t,e,L]);(0,C.useEffect)(()=>{S.current||(S.current=!0,O(null))},[]),(0,C.useEffect)(()=>{if(!t.lastRunEnd||t.lastRunEnd===T.current||c.current!=="running")return;T.current=t.lastRunEnd,c.current="transitioning",u("transitioning");let h=t.lastRunEnd,b=de(t.steps),B=t.bifurcationInfo,F={status:h.status==="passed"?"passed":"failed",duration_s:h.duration??0,reason:h.reason,runEnd:h,hadError:!1,stepsPassed:b.passed,stepsFailed:b.failed,stepsTotal:b.total,bifurcationFlows:B&&!B.isSingleFlow?B.flows:null,evidence:t.getEvidenceState()};if(!(e.onStepEnd?.(F,v.current)??!0)){L("done"),e.onAllComplete?.();return}O(F)},[t.lastRunEnd]),(0,C.useEffect)(()=>{if(!t.runError||t.runError===d.current||t.lastRunEnd||c.current!=="running")return;d.current=t.runError,c.current="transitioning",u("transitioning");let h=de(t.steps),b={status:"failed",duration_s:0,reason:t.runError,runEnd:null,hadError:!0,stepsPassed:h.passed,stepsFailed:h.failed,stepsTotal:h.total,bifurcationFlows:null,evidence:t.getEvidenceState()};if(!(e.onStepEnd?.(b,v.current)??!0)){L("done"),e.onAllComplete?.();return}O(b)},[t.runError,t.lastRunEnd]);let y=(0,C.useCallback)(()=>{t.cancelRun()},[t]);return{runner:t,currentStepIndex:n,phase:a,cancel:y}}var pe=R(V(),1);var ne=R(k(),1),Ee=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function ke({label:e,hasBifurcation:t=!1}){let[n,l]=(0,pe.useState)(0),[a,u]=(0,pe.useState)(0);K(()=>{l(v=>(v+1)%Ee.length)},80),K(()=>{u(v=>(v+1)%4)},400);let c=e??(t?"Planning approach":"Analyzing objective");return(0,ne.jsxs)(s,{marginLeft:1,children:[(0,ne.jsxs)(o,{color:i.orange,children:[Ee[n]," "]}),(0,ne.jsxs)(o,{color:i.dim,children:[c,".".repeat(a+1)]})]})}function Ie(e){if(!e.isRunning||e.replayInfo)return null;let t=e.bifurcationInfo;if(t&&!t.isSingleFlow){let n=e.steps.findIndex(a=>a.status==="running");return(n===-1?e.cmInitCounts.length===0:n>=e.cmInitCounts.length)?{label:n>0?`Planning flow ${n+1}`:void 0,hasBifurcation:!0}:null}return e.cmInitCounts.length>0||e.steps.some(n=>n.children?.length)?null:{hasBifurcation:!!t}}var I=R(V(),1);var Ce=R(V(),1);var re=R(k(),1),He="#ffc580",Ue="#ffd9a8",Le="#ffffff";function oe({text:e,active:t=!0}){let[n,l]=(0,Ce.useState)(0),a=4;if(K(()=>{l(c=>(c+1)%(e.length+a*2))},t?80:null),!t)return(0,re.jsx)(o,{color:Le,children:e});let u=e.split("").map((c,v)=>{let S=n-a,T=Math.abs(v-S-a/2),d;return T<=a/2?d=He:T<=a?d=Ue:d=Le,(0,re.jsx)(o,{color:d,children:c},v)});return(0,re.jsx)(o,{children:u})}var _=R(k(),1),We={starting:i.orange,running:i.orange,passed:i.green,failed:i.red,cancelled:i.dim,timed_out:i.orange};function ie({currentStep:e,maxSteps:t,elapsed:n,status:l}){let a=We[l]??i.orange,u=n<60?`${n.toFixed(1)}s`:`${Math.floor(n/60)}m ${Math.round(n%60)}s`;return(0,_.jsxs)(s,{marginLeft:3,children:[(0,_.jsx)(o,{color:i.dim,children:"Steps "}),(0,_.jsx)(o,{bold:!0,children:e}),(0,_.jsxs)(o,{color:i.dim,children:["/",t]}),(0,_.jsx)(o,{children:" "}),(0,_.jsx)(o,{color:i.dim,children:"Elapsed "}),(0,_.jsx)(o,{bold:!0,children:u}),(0,_.jsx)(o,{children:" "}),(0,_.jsx)(o,{color:i.dim,children:"Status "}),(0,_.jsx)(o,{bold:!0,color:a,children:l})]})}var Ve={click:"\u25CF",type:"\u229E",scroll:"\u2195",navigate:"\u2192",analyze:"\u25CE",assert:"\u25C8","if-else":"\u2442",select:"\u25BC",press_key:"\u21B5",wait:"\u2026",tool_call:"\u2299"};function Oe(e){return Ve[e]??"\u25CF"}var q=R(k(),1);function fe({steps:e,flows:t,cmInitCounts:n,renderStep:l}){return(0,q.jsxs)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:[(0,q.jsxs)(o,{color:i.dim,children:["\u2501\u2501 Bifurcated into ",t?.length??e.length," flows \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"]}),e.map((a,u)=>(0,q.jsxs)(s,{flexDirection:"column",marginTop:u>0?1:0,children:[(0,q.jsxs)(o,{color:i.orange,children:["Flow ",u+1,": ",t?.[u]??a.objective]}),n&&n[u]!=null&&(0,q.jsxs)(o,{color:i.dim,children:[" \u25AA Generated task with ",n[u]," checkpoints"]}),a.children&&a.children.length>0?a.children.map(c=>{let v=!!c.branchObjective,S=`f${u}-${c.childId??"p"}-${c.index}`;return v?(0,q.jsxs)(s,{flexDirection:"column",children:[l({...c,children:void 0},S),(c.children??[]).map(T=>(0,q.jsx)(s,{marginLeft:2,children:l(T,`${S}-${T.childId??"p"}-${T.index}`)},`${S}-${T.childId??"p"}-${T.index}`))]},`${S}-host`):l(c,S)}):a.status==="pending"&&(0,q.jsx)(o,{color:i.dim,children:" \u25CB Waiting..."})]},u))]})}var H=R(k(),1);function Pe({label:e,shimmer:t=!1}){return(0,H.jsxs)(s,{marginLeft:6,children:[(0,H.jsx)(te,{}),(0,H.jsx)(o,{children:" "}),t?(0,H.jsx)(oe,{text:e,active:!0}):(0,H.jsx)(o,{color:i.dim,children:e})]})}var De=R(V(),1);var me=R(k(),1);function ze(e,t){let n=[];for(let l of e.split(`
|
|
3
3
|
`)){if(l===""){n.push("");continue}let a="";for(let u of l.split(" ")){let c=u;for(;c.length>t;)a&&(n.push(a),a=""),n.push(c.slice(0,t)),c=c.slice(t);a===""?a=c:a.length+1+c.length<=t?a+=" "+c:(n.push(a),a=c)}n.push(a)}return n}function je({text:e,maxLines:t=3}){let{stdout:n}=ee(),l=Math.max(20,(n?.columns??80)-7),a=!e.trim(),[u,c]=(0,De.useState)(!0);K(()=>c(T=>!T),500);let v=(a?"Thinking\u2026":e)+(u?"\u258C":" "),S=ze(v,l).slice(-t);for(;S.length<t;)S.push("");return(0,me.jsx)(s,{borderStyle:"round",borderColor:i.muted,paddingX:1,marginLeft:3,flexDirection:"column",children:S.map((T,d)=>(0,me.jsx)(o,{color:a?i.dim:i.secondary,wrap:"truncate-end",children:T.length?T:" "},d))})}var U=R(k(),1);function se({activity:e,describe:t,describeVisible:n}){return(0,U.jsxs)(U.Fragment,{children:[e?(0,U.jsx)(Pe,{label:e.label,shimmer:e.shimmer}):null,n?(0,U.jsx)(je,{text:t??""}):null]})}var r=R(k(),1);function le(e){for(let t of e){if(t.children&&t.children.length>0){let n=le(t.children);if(n)return n}if(t.status==="running")return t}}function z(e){return e.status==="running"&&!e.branchObjective&&(!e.children||e.children.length===0)}function Fe(e){let t=[];for(let n of e)z(n)||(n.children&&n.children.length>0?t.push({...n,children:Fe(n.children)}):t.push(n));return t}function ge(e,t){if(!e)return null;let n=e.objective??"";return n.length>0&&!/^Step \d+$/.test(n)?{label:n+"\u2026",shimmer:!1}:{label:t?"Looking at the screen\u2026":"Deciding next action\u2026",shimmer:!0}}function P({step:e,indent:t=2}){let n=e.actionType?Oe(e.actionType):null,l=e.status==="running",a=e.status==="passed",u=e.status==="failed",c=e.status==="pending"||e.status==="stopped",{stdout:v}=ee(),S=v?.columns??80,T=Math.max(20,S-t-21),d=e.objective??"",L=d.length>T?d.slice(0,T-1)+"\u2026":d,O=(e.duration??0)*1e3,y=e.duration!=null?O<1e3?`${Math.round(O)}ms`:`${(O/1e3).toFixed(1)}s`:"";return(0,r.jsxs)(s,{flexDirection:"column",children:[(0,r.jsxs)(s,{marginLeft:t,children:[(0,r.jsx)(s,{width:4,children:(0,r.jsxs)(o,{color:i.muted,children:[String(e.index).padStart(2," ")," "]})}),(0,r.jsx)(s,{width:3,children:l?(0,r.jsx)(te,{}):a?(0,r.jsx)(o,{color:i.green,bold:!0,children:"\u2713"}):u?(0,r.jsx)(o,{color:i.red,bold:!0,children:"\u2717"}):(0,r.jsx)(o,{color:i.muted,children:"\u25CB"})}),(0,r.jsx)(s,{flexGrow:1,children:l?(0,r.jsx)(oe,{text:L,active:!0}):u?(0,r.jsx)(o,{color:i.red,children:L}):c?(0,r.jsx)(o,{color:i.dim,children:L}):(0,r.jsx)(o,{color:i.dim,children:L})}),(a||u)&&n?(0,r.jsx)(s,{width:3,marginLeft:1,children:(0,r.jsx)(o,{color:i.muted,children:n})}):(0,r.jsx)(s,{width:3,marginLeft:1}),(0,r.jsx)(s,{width:7,justifyContent:"flex-end",children:(0,r.jsx)(o,{color:i.dim,children:y})})]}),e.children&&e.children.length>0&&(0,r.jsx)(s,{flexDirection:"column",children:e.children.map((h,b)=>(0,r.jsx)(P,{step:h,indent:t+2},`child-${b}`))})]})}function Xe(e){return e.type==="cm_init"?(0,r.jsx)(s,{marginLeft:2,paddingLeft:1,children:(0,r.jsxs)(o,{color:i.dim,children:["\u25AA Generated task with ",e.count," checkpoints"]})}):(0,r.jsx)(s,{marginLeft:2,paddingLeft:1,children:(0,r.jsx)(P,{step:e.step})})}function _e({steps:e,bifurcated:t,flows:n,cmInitCounts:l,maxSteps:a=50,staticSteps:u=!1,onStepCommit:c,describe:v,describeVisible:S,describeRevealing:T}){let d=(0,I.useRef)(new Set),L=(0,I.useRef)(!1),O=(0,I.useRef)(new Set),y=(0,I.useRef)(!1),h=(0,I.useRef)(new Set),b=(0,I.useRef)(0);(0,I.useEffect)(()=>{e.length===0&&b.current>0&&(d.current.clear(),L.current=!1,O.current.clear(),y.current=!1,h.current.clear()),b.current=e.length},[e.length]);let B=e.flatMap(p=>[p,...p.children??[]]),F=B.some(p=>p.status==="running"),M=B.some(p=>p.status==="failed"),X=B.length===0||B.every(p=>p.status==="pending"),Y=B.filter(p=>p.status==="passed"||p.status==="failed").length,N;X?N="starting":F?N="running":M?N="failed":N="passed";let J=(0,I.useRef)(null),[ce,he]=(0,I.useState)(0);(0,I.useEffect)(()=>{B.length===0||X?(J.current=null,he(0)):F&&J.current==null&&(J.current=Date.now())},[F,X,B.length]),(0,I.useEffect)(()=>{if(!F)return;let p=setInterval(()=>{J.current!=null&&he((Date.now()-J.current)/1e3)},500);return()=>clearInterval(p)},[F]);let ae=(0,I.useRef)(new Set),[,xe]=(0,I.useState)(0),be=(0,I.useRef)(!1);(0,I.useEffect)(()=>{if(!c||!u||t)return;let p=[];!be.current&&l&&l[0]!=null&&(be.current=!0,l[0]>0&&p.push({key:"cm_init_0",type:"cm_init",count:l[0]}));for(let g of e)(g.status==="passed"||g.status==="failed")&&!ae.current.has(g.index)&&(ae.current.add(g.index),p.push({key:`step_${g.index}`,type:"step",step:{...g,children:g.children?[...g.children]:void 0}}));if(p.length>0){for(let g of p)c(Xe(g));xe(g=>g+1)}},[e,t,l,u,c]),(0,I.useEffect)(()=>{if(!c||u)return;let p=d.current.size;if(!t&&!y.current&&l&&l[0]!=null&&(y.current=!0,l[0]>0&&c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsxs)(o,{color:i.dim,children:["\u25A0 Generated task with ",l[0]," checkpoints"]})}))),t&&n&&!L.current&&(L.current=!0,c((0,r.jsx)(o,{color:i.purple,children:"\u2501\u2501 Bifurcated into "+n.length+" flows \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"}))),t){let g=e.flatMap((x,f)=>{let m=x.children??[];return!O.current.has(f)&&m.length>0&&(O.current.add(f),c((0,r.jsx)(o,{color:i.purple,children:" Flow "+(f+1)+": "+(n?.[f]??"")})),l?.[f]!=null&&l[f]>0&&!h.current.has(f)&&(h.current.add(f),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsxs)(o,{color:i.dim,children:[" \u25AA Generated task with ",l[f]," checkpoints"]})})))),l?.[f]!=null&&l[f]>0&&O.current.has(f)&&!h.current.has(f)&&(h.current.add(f),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsxs)(o,{color:i.dim,children:[" \u25AA Generated task with ",l[f]," checkpoints"]})}))),m});for(let x of g){let f=`${x.childId??"p"}-${x.index}-${x.objective}`;if(!!x.branchObjective){d.current.has(f)||(d.current.add(f),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:{...x,children:void 0}})})));for(let $ of x.children??[]){let w=`child-${x.childId??"p"}-${x.index}-${$.childId??"p"}-${$.index}-${$.objective}`;d.current.has(w)||($.status==="passed"||$.status==="failed"||$.status==="stopped")&&(d.current.add(w),c((0,r.jsx)(s,{marginLeft:4,children:(0,r.jsx)(P,{step:$})})))}continue}d.current.has(f)||(x.status==="passed"||x.status==="failed"||x.status==="stopped")&&(d.current.add(f),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:x})})))}}else for(let g of e){let x=`${g.index}-${g.objective}`,f=!!g.branchObjective;f&&!d.current.has(x)&&(d.current.add(x),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:{...g,children:void 0}})})));for(let m of g.children??[]){let $=`child-${g.index}-${m.childId??"p"}-${m.index}-${m.objective}`;d.current.has($)||(m.status==="passed"||m.status==="failed"||m.status==="stopped")&&(d.current.add($),c((0,r.jsx)(s,{marginLeft:4,children:(0,r.jsx)(P,{step:m})})))}!f&&!d.current.has(x)&&(g.status==="passed"||g.status==="failed"||g.status==="stopped")&&(d.current.add(x),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:{...g,children:void 0}})})))}d.current.size>p&&xe(g=>g+1)},[e,c,t,n,l]);let G=[];if(u&&!t)for(let p of e)ae.current.has(p.index)||G.push(p);else if(c&&!u)if(t)for(let p of e){let g=p.children??[],x=[];for(let f of g){let m=`${f.childId??"p"}-${f.index}-${f.objective}`,$=d.current.has(m);if(f.branchObjective){let w=(f.children??[]).filter(Q=>{let ue=`child-${f.childId??"p"}-${f.index}-${Q.childId??"p"}-${Q.index}-${Q.objective}`;return!d.current.has(ue)});(!$||w.length>0)&&x.push({...f,children:w})}else $||x.push(f)}x.length>0&&G.push({...p,children:x})}else for(let p of e){let g=`${p.index}-${p.objective}`,x=d.current.has(g),f=(p.children??[]).filter(m=>{let $=`child-${p.index}-${m.childId??"p"}-${m.index}-${m.objective}`;return!d.current.has($)});x?f.length>0&&G.push({...p,children:f}):G.push({...p,children:f})}if(!u){let p=c?G:e,g=le(p),x=ge(g,T);return(0,r.jsxs)(s,{flexDirection:"column",children:[t?c?p.length>0?(0,r.jsx)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:p.map((m,$)=>(0,r.jsx)(s,{flexDirection:"column",marginTop:$>0?1:0,children:m.children&&m.children.length>0?m.children.map(w=>{if(z(w))return null;let Q=!!w.branchObjective,ue=`${w.childId??"p"}-${w.index}-${w.objective}`,Ke=d.current.has(ue);return Q?(0,r.jsxs)(s,{flexDirection:"column",children:[!Ke&&(0,r.jsx)(P,{step:{...w,children:void 0}}),(w.children??[]).filter(Z=>!z(Z)).map(Z=>(0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:Z})},`f${$}-${w.index}-${Z.childId??"p"}-${Z.index}`))]},`f${$}-host-${w.childId??"p"}-${w.index}`):(0,r.jsx)(P,{step:w},`f${$}-${w.childId??"p"}-${w.index}`)}):m.status==="pending"&&(0,r.jsx)(o,{color:i.dim,children:" \u25CB Waiting..."})},$))}):null:(0,r.jsx)(fe,{steps:e,flows:n,cmInitCounts:l,renderStep:(m,$)=>z(m)?null:(0,r.jsx)(P,{step:m},$)}):(0,r.jsxs)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:[!c&&l&&l[0]!=null&&(0,r.jsxs)(o,{color:i.dim,children:["\u25AA Generated task with ",l[0]," checkpoints"]}),p.filter(m=>!(m.status==="running"&&(!m.children||m.children.length===0))).map(m=>{let $=`${m.index}-${m.objective}`;return c&&d.current.has($)?(0,r.jsx)(s,{flexDirection:"column",children:(m.children??[]).filter(w=>!z(w)).map(w=>(0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:w})},`${w.childId??"p"}-${w.index}`))},`branch-children-${m.index}`):(0,r.jsx)(P,{step:m},m.index)})]}),(0,r.jsx)(se,{activity:x,describe:v,describeVisible:S}),B.length>0&&(0,r.jsx)(ie,{currentStep:Y,maxSteps:a,elapsed:ce,status:N})]})}if(t){let p=le(e),g=ge(p,T);return(0,r.jsxs)(s,{flexDirection:"column",children:[(0,r.jsx)(fe,{steps:e,flows:n,cmInitCounts:l,renderStep:(x,f)=>z(x)?null:(0,r.jsx)(P,{step:x},f)}),(0,r.jsx)(se,{activity:g,describe:v,describeVisible:S}),B.length>0&&(0,r.jsx)(ie,{currentStep:Y,maxSteps:a,elapsed:ce,status:N})]})}let Ne=le(G),Ge=ge(Ne,T),Re=Fe(G);return(0,r.jsxs)(s,{flexDirection:"column",children:[Re.length>0&&(0,r.jsx)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:Re.map(p=>(0,r.jsx)(P,{step:p},p.index))}),(0,r.jsx)(se,{activity:Ge,describe:v,describeVisible:S}),B.length>0&&(0,r.jsx)(ie,{currentStep:Y,maxSteps:a,elapsed:ce,status:N})]})}var W=R(k(),1);function Ae({runner:e,runKey:t,onStepCommit:n}){let l=Ie({isRunning:e.isRunning,bifurcationInfo:e.bifurcationInfo,steps:e.steps,cmInitCounts:e.cmInitCounts,replayInfo:e.replayInfo});return(0,W.jsxs)(W.Fragment,{children:[l&&(0,W.jsx)(ke,{label:l.label,hasBifurcation:l.hasBifurcation}),e.isRunning&&e.steps.length>0&&(0,W.jsx)(_e,{steps:e.steps,bifurcated:!!e.bifurcationInfo&&!e.bifurcationInfo.isSingleFlow,flows:e.bifurcationInfo?.flows,cmInitCounts:e.cmInitCounts,maxSteps:e.maxSteps,onStepCommit:n},`run-${t}`)]})}var D=R(k(),1),Ye=64;function Je(e){return e.split(`
|
|
4
4
|
`).map(t=>t.replace(/^[-–•]\s*/,"").trim()).filter(t=>t.length>0)}function qe({status:e,summary:t,duration:n,steps:l,stepsPassed:a,stepsFailed:u,reason:c,creditsConsumed:v}){let S=e==="passed",T=S?i.green:i.red,d=S?"\u2713":"\u2717",L=e.toUpperCase(),O=a??(S?l:Math.max(0,l-1)),y=u??(S?0:1),h=y>0?`${l} steps (${O} passed, ${y} failed)`:`${l} steps`,b=n<60?`${n.toFixed(1)}s`:`${Math.floor(n/60)}m ${Math.round(n%60)}s`,B=Je(t);return(0,D.jsx)(s,{flexDirection:"column",marginTop:1,children:(0,D.jsxs)(s,{borderStyle:"round",borderColor:T,flexDirection:"column",paddingX:2,paddingY:1,width:Ye+6,children:[(0,D.jsxs)(s,{flexDirection:"column",children:[(0,D.jsxs)(o,{bold:!0,color:T,children:[d," ",L]}),(0,D.jsxs)(o,{color:i.dim,wrap:"wrap",children:[h," \xB7 ",b,typeof v=="number"&&v>0?` \xB7 ${parseFloat(v.toFixed(4))} credits`:""]})]}),B.length>0&&(0,D.jsx)(s,{flexDirection:"column",marginTop:1,marginLeft:1,children:B.map((F,M)=>(0,D.jsxs)(s,{marginBottom:M<B.length-1?1:0,children:[(0,D.jsx)(o,{color:i.orange,children:"\u25CF "}),(0,D.jsx)(s,{flexShrink:1,children:(0,D.jsx)(o,{wrap:"wrap",children:F})})]},M))}),c&&!S&&(0,D.jsx)(s,{marginTop:1,children:(0,D.jsxs)(o,{color:i.red,wrap:"wrap",children:["Reason: ",c]})})]})})}var j=R(k(),1);function Me({message:e,code:t,remediation:n,docsUrl:l}){return(0,j.jsx)(ve,{title:"Error",variant:"error",children:(0,j.jsxs)(s,{flexDirection:"column",paddingY:1,children:[(0,j.jsxs)(o,{color:i.red,bold:!0,children:[" \u2717 ",e]}),t&&(0,j.jsxs)(s,{marginTop:0,marginLeft:5,children:[(0,j.jsx)(o,{color:i.muted,children:"Code: "}),(0,j.jsx)(o,{color:i.dim,children:t})]}),n&&(0,j.jsxs)(s,{flexDirection:"column",marginTop:1,marginLeft:5,children:[(0,j.jsx)(o,{color:i.green,bold:!0,children:"Fix:"}),(0,j.jsxs)(o,{color:i.orange,children:["$ ",n]})]}),l&&(0,j.jsxs)(s,{marginTop:1,marginLeft:5,children:[(0,j.jsx)(o,{color:i.muted,children:"Docs: "}),(0,j.jsx)(o,{color:i.orange,underline:!0,children:l})]})]})})}var E=R(k(),1);function un(e){let{exit:t}=Te(),{append:n}=ye(),l=(0,A.useRef)(!1);(0,A.useEffect)(()=>{l.current||(l.current=!0,n((0,E.jsx)(s,{flexDirection:"column",marginBottom:1,children:(0,E.jsxs)(s,{borderStyle:"round",borderColor:"#dc4e08",paddingX:2,children:[(0,E.jsx)(o,{color:"#ff9500",bold:!0,children:"KaneAI CLI"}),(0,E.jsx)(o,{color:i.dim,children:" \u2502 "}),(0,E.jsx)(o,{color:i.orange,children:e.topBanner.model}),(0,E.jsx)(o,{color:i.dim,children:" \u2502 "}),(0,E.jsx)(o,{color:i.dim,children:e.topBanner.auth})]})})),n((0,E.jsx)(Qe,{data:e.globalConfig})),e.priorAttemptRollup&&n((0,E.jsx)(o,{color:i.dim,children:` \u21B3 replayed ${e.priorAttemptRollup.startIdx}..${e.priorAttemptRollup.endIdx-1} (${e.priorAttemptRollup.count} steps, from prior attempt)`})))},[]);let a=(0,A.useRef)(null),u=(0,A.useCallback)(async y=>{let h=await e.getNextStep(y);return h?(a.current=h,h.config):(a.current=null,null)},[e]),c=(0,A.useCallback)((y,h)=>{let b=a.current;if(!b)return;let B=b.mode==="replay"?"cyan":"#dc4e08",F=b.modeReason?` (${b.modeReason})`:"",M=b.perStepOverrides?Object.entries(b.perStepOverrides):[];n((0,E.jsxs)(s,{flexDirection:"column",marginBottom:0,children:[(0,E.jsxs)(o,{children:[(0,E.jsxs)(o,{color:i.dim,children:[b.banner.stepLabel," "]}),(0,E.jsxs)(o,{color:B,children:["[",b.mode,"]"]}),(0,E.jsx)(o,{color:i.dim,children:F})]}),(0,E.jsx)(o,{color:i.dim,children:b.banner.objective}),M.length>0&&(0,E.jsxs)(o,{color:i.dim,children:["overrides: ",M.map(([X,Y])=>`${X}=${Y}`).join(", ")]})]}))},[n]),v=(0,A.useRef)(0),S=(0,A.useRef)(!1),T=(0,A.useCallback)((y,h)=>(y.hadError?n((0,E.jsx)(Me,{message:y.reason??"Runner error",code:"RUNNER_ERROR"})):n((0,E.jsx)(s,{flexDirection:"column",marginBottom:1,children:(0,E.jsx)(qe,{status:y.status,summary:y.runEnd?.summary??"",duration:y.runEnd?.duration??0,steps:y.stepsTotal,stepsPassed:y.stepsPassed,stepsFailed:y.stepsFailed,reason:y.runEnd?.reason,creditsConsumed:y.runEnd?.credits_consumed})})),e.onStepEnd?.(y,h)??!0),[n,e]),d=we({getNextConfig:u,onStepStart:c,onStepEnd:T,onAllComplete:()=>{e.onAllComplete(),e.exitOnComplete!==!1&&setImmediate(()=>t())},screenshotDispatcher:e.screenshotDispatcher,stepLogger:e.stepLogger,onReasoning:e.onReasoning,onStepComplete:e.onStepComplete,spawnOpts:e.spawnOpts}),L=250,O=5e3;return Se((y,h)=>{if(h.ctrl&&y==="c"){let b=Date.now(),B=b-v.current;if(B<L)return;S.current&&B<O?(d.cancel(),e.onCancel?.(),e.exitOnComplete!==!1&&setImmediate(()=>t())):(S.current=!0,n((0,E.jsx)(o,{color:"yellow",children:"press Ctrl+C again to cancel run"}))),v.current=b}}),(0,E.jsx)(s,{flexDirection:"column",children:d.phase!=="done"&&(0,E.jsx)(Ae,{runner:d.runner,runKey:d.currentStepIndex,onStepCommit:n})})}function Qe({data:e}){return(0,E.jsx)(Be,{title:"test.md run",titleColor:"#ff9500",borderColor:i.dim,rows:[{label:"source",value:e.source},{label:"steps",value:`${e.steps.total} (${e.steps.replay} replay, ${e.steps.author} author per walker)`},{label:"model",value:e.model},{label:"viewport",value:`${e.viewport.width} x ${e.viewport.height}`},{label:"chrome",value:e.chrome},{label:"session",value:e.session},{label:"variables",value:`${e.variables.count} (${e.variables.secrets} secret)`},{label:"flags",value:e.flags.length>0?e.flags.join(" "):"(none)"}]})}export{_e as a,ke as b,Ie as c,de as d,qe as e,Me as f,un as g};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{y as o}from"./chunk-
|
|
2
|
+
import{y as o}from"./chunk-7F2ZV46B.js";import{a as m}from"./chunk-HCBYKLMW.js";import{a as e,b as i}from"./chunk-C44QQJR4.js";import{e as d}from"./chunk-UR6MHSHU.js";var r=d(m(),1),s={default:o.muted,error:o.red,success:o.green,info:o.orange,warning:o.orange};function h({title:t,titleColor:a,borderColor:l,variant:n="default",children:c,width:u,paddingX:x=2,paddingY:g=0,marginBottom:f=0}){let p=l??s[n],B=a??(n==="default"?o.orange:s[n]);return(0,r.jsxs)(e,{flexDirection:"column",marginBottom:f,children:[t&&(0,r.jsx)(e,{marginBottom:0,children:(0,r.jsxs)(i,{color:B,bold:!0,children:[" ",t]})}),(0,r.jsx)(e,{borderStyle:"round",borderColor:p,flexDirection:"column",paddingX:x,paddingY:g,width:u,children:c})]})}function k({label:t,value:a,labelColor:l=o.dim,valueColor:n,labelWidth:c=14}){return(0,r.jsxs)(e,{children:[(0,r.jsx)(e,{width:c,flexShrink:0,children:(0,r.jsx)(i,{color:l,children:t})}),(0,r.jsx)(e,{flexShrink:1,children:(0,r.jsx)(i,{color:n,wrap:"wrap",children:a})})]})}function I({label:t}){return(0,r.jsx)(e,{marginTop:1,marginBottom:0,children:(0,r.jsx)(i,{bold:!0,children:t})})}export{h as a,k as b,I as c};
|