@testmuai/kane-cli 0.5.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ChatSurface-R55VO3VW.js +9 -0
- package/dist/{ChromeProfilePicker-PIWZY4WH.js → ChromeProfilePicker-BZKLIO2T.js} +1 -1
- package/dist/{CliFeedbackPrompt-URXCHBZ5.js → CliFeedbackPrompt-3HYRBMXS.js} +1 -1
- package/dist/CliUploadProgress-OAPMO5I3.js +2 -0
- package/dist/{ConfigView-NWNDNTKW.js → ConfigView-YIAAISLE.js} +1 -1
- package/dist/EvidenceViewOffer-DBMZQ34Z.js +2 -0
- package/dist/FolderPicker-ILK4AIKL.js +2 -0
- package/dist/HelpView-HBQX64VR.js +2 -0
- package/dist/{InfoBox-FPAWQZGQ.js → InfoBox-DKJO73HM.js} +1 -1
- package/dist/{LinksBox-O5ZFYSK2.js → LinksBox-44WCVBT4.js} +1 -1
- package/dist/{ProfilesView-SPECXHZE.js → ProfilesView-NVEDYU3H.js} +1 -1
- package/dist/{ProjectPicker-ANJ6NGNY.js → ProjectPicker-COBY7TCY.js} +1 -1
- package/dist/{SaveSessionPrompt-W2GWELOP.js → SaveSessionPrompt-O4ENMYHP.js} +1 -1
- package/dist/ScrollbackTap-Q3IOKNMS.js +2 -0
- package/dist/SingleShotApp-NA6A2S6I.js +2 -0
- package/dist/{SummaryBox-DJUDYML7.js → SummaryBox-ROV7TNK4.js} +1 -1
- package/dist/TestMdRunView-U5YTNLY6.js +2 -0
- package/dist/{WhoamiView-DH25ZD4C.js → WhoamiView-4QV3DPN2.js} +1 -1
- package/dist/archive-committer-3NI773TP.js +2 -0
- package/dist/bind-RDTZZ6ZI.js +6 -0
- package/dist/bridge-VY2Q3HQU.js +2 -0
- package/dist/{changelog-RCKUVBFL.js → changelog-JMFGVNEU.js} +1 -1
- package/dist/chat-committer-RTJCKQMM.js +2 -0
- package/dist/chat-controller-OTBYHB4Y.js +3 -0
- package/dist/chunk-22A2ECA2.js +2 -0
- package/dist/{chunk-T4PKTWZ6.js → chunk-2PDWMY2B.js} +1 -1
- package/dist/{chunk-I4B2KY4X.js → chunk-2T4JPBB5.js} +1 -1
- package/dist/{chunk-AM5WZPPY.js → chunk-37CI4EJX.js} +1 -1
- package/dist/chunk-427OQS2N.js +2 -0
- package/dist/chunk-47RNFG2V.js +23 -0
- package/dist/{chunk-IECUFWIZ.js → chunk-4CRKK5WV.js} +1 -1
- package/dist/chunk-5446YVGQ.js +4 -0
- package/dist/{chunk-TJWU7DOO.js → chunk-5FD6ZXB5.js} +1 -1
- package/dist/chunk-5ILXUQIX.js +2 -0
- package/dist/chunk-5UXL6RNG.js +2 -0
- package/dist/chunk-5Y2G4NC7.js +2 -0
- package/dist/chunk-6PS65QFF.js +2 -0
- package/dist/chunk-7DBQEOFL.js +9 -0
- package/dist/{chunk-R5RHRG65.js → chunk-7SUKUJO2.js} +1 -1
- package/dist/{chunk-LOQV5GME.js → chunk-AAWRKFE4.js} +1 -1
- package/dist/chunk-AD46OCZ4.js +4 -0
- package/dist/chunk-AE6SS34N.js +4 -0
- package/dist/chunk-B2PZAB7J.js +4 -0
- package/dist/chunk-BC7UVJJB.js +2 -0
- package/dist/{chunk-DTM4ZMMJ.js → chunk-BMSWIYYK.js} +1 -1
- package/dist/{chunk-YSIYPC4R.js → chunk-CB3TEWZJ.js} +1 -1
- package/dist/chunk-CE664P73.js +2 -0
- package/dist/chunk-CP4XCWAJ.js +5 -0
- package/dist/chunk-D5T4ARTB.js +2 -0
- package/dist/chunk-DFS4RMVP.js +2 -0
- package/dist/chunk-DM2GL24Z.js +3 -0
- package/dist/{chunk-HZ46P2GR.js → chunk-FAIH2K2U.js} +1 -1
- package/dist/chunk-FS4YJM22.js +2 -0
- package/dist/chunk-FXPPQL4D.js +6 -0
- package/dist/chunk-FYOCF7DY.js +2 -0
- package/dist/chunk-GIGD4M7V.js +5 -0
- package/dist/chunk-GIRXJOJI.js +2 -0
- package/dist/chunk-HGL3RM7P.js +8 -0
- package/dist/{chunk-HFXQU7UZ.js → chunk-HMGNPFXP.js} +1 -1
- package/dist/chunk-I2S6KNZW.js +2 -0
- package/dist/chunk-IACKIGPX.js +2 -0
- package/dist/{chunk-C4LYBQT3.js → chunk-IRDMEYJB.js} +2 -2
- package/dist/{chunk-4IOOBSNB.js → chunk-ISAE457F.js} +1 -1
- package/dist/{chunk-AFCEFOIK.js → chunk-J5BUMF3G.js} +1 -1
- package/dist/chunk-JFAFKHDX.js +4 -0
- package/dist/{chunk-6E5UYAEB.js → chunk-KFAYCOTB.js} +1 -1
- package/dist/{chunk-UOGJUJCF.js → chunk-KGP7NSXH.js} +1 -1
- package/dist/chunk-KHDUQ33H.js +2 -0
- package/dist/chunk-KHU7C6EE.js +2 -0
- package/dist/chunk-LMJTY32X.js +6 -0
- package/dist/chunk-M5JQXOCE.js +12 -0
- package/dist/chunk-MJFYMMX2.js +2 -0
- package/dist/chunk-MMI3VSCA.js +6 -0
- package/dist/{chunk-NLIOFVMP.js → chunk-MZ2PXBKK.js} +1 -1
- package/dist/chunk-N2ZW5635.js +6 -0
- package/dist/chunk-NNZV5RCE.js +2 -0
- package/dist/{chunk-7IBNOVML.js → chunk-NSSKSXCT.js} +1 -1
- package/dist/{chunk-PISZLYS5.js → chunk-O4O4KL6Z.js} +1 -1
- package/dist/{chunk-QO6PAA7Q.js → chunk-OBBXDBEE.js} +2 -2
- package/dist/chunk-Q4P2L7DY.js +2 -0
- package/dist/chunk-Q4PUOA46.js +61 -0
- package/dist/chunk-QPZRHAYK.js +4 -0
- package/dist/chunk-QZWQCHXK.js +11 -0
- package/dist/{chunk-7AEC572G.js → chunk-R2K2SGGE.js} +1 -1
- package/dist/{chunk-3FN66LTP.js → chunk-RFHMDQXZ.js} +1 -1
- package/dist/chunk-RGEAEAZB.js +20 -0
- package/dist/{chunk-GEAWRRR7.js → chunk-RH2OAIJI.js} +1 -1
- package/dist/chunk-RKWJG3WW.js +19 -0
- package/dist/{chunk-IU53F4ZV.js → chunk-ROPXE7TF.js} +1 -1
- package/dist/chunk-RY4OOGSC.js +14 -0
- package/dist/chunk-S74MQRDN.js +2 -0
- package/dist/{chunk-ZWAZ4QU4.js → chunk-SB6MBQKR.js} +1 -1
- package/dist/{chunk-XDERMCAU.js → chunk-SQJWMOJQ.js} +1 -1
- package/dist/{chunk-ELBPBHTE.js → chunk-SUDAFBVD.js} +2 -2
- package/dist/chunk-VJUIW2ES.js +4 -0
- package/dist/chunk-VXD5667K.js +7 -0
- package/dist/chunk-WAGJLR5X.js +356 -0
- package/dist/chunk-WGG5XURS.js +13 -0
- package/dist/chunk-WRHZCHZY.js +2 -0
- package/dist/chunk-XDW2RGIL.js +7 -0
- package/dist/chunk-YANCBRER.js +3 -0
- package/dist/{chunk-THEZSXZM.js → chunk-YJ6AQ2KP.js} +1 -1
- package/dist/chunk-Z56AWGVY.js +2 -0
- package/dist/{chunk-PTP3WS3N.js → chunk-ZA67EBYF.js} +1 -1
- package/dist/chunk-ZKYYZ5NO.js +6 -0
- package/dist/{chunk-TPG2T5GH.js → chunk-ZNANAARA.js} +1 -1
- package/dist/cover-cmd-Y5L4O4Q3.js +2 -0
- package/dist/{credentials-52QRPGET.js → credentials-L63BBW2S.js} +1 -1
- package/dist/descriptor-SL5A7RQE.js +2 -0
- package/dist/distill-cmd-EYCCCFL3.js +2 -0
- package/dist/evidence-UAFPTHQX.js +2 -0
- package/dist/evolve-cmd-2SPNVTT4.js +2 -0
- package/dist/{exit-manager-IUHAXFJ6.js → exit-manager-VCSIUYBR.js} +1 -1
- package/dist/explain-JIXUWEFJ.js +2 -0
- package/dist/explain-cmd-55WRDIMW.js +9 -0
- package/dist/explain-cmd-RIDEMDMY.js +3 -0
- package/dist/extract-bind-DS4UP23P.js +5 -0
- package/dist/extract-cmd-PMZHMMU7.js +6 -0
- package/dist/gaps-cmd-P2DRK6FW.js +2 -0
- package/dist/gate-FACZRGOC.js +2 -0
- package/dist/{generate-headless-WG6ZPINI.js → generate-headless-C3UZKDS5.js} +2 -2
- package/dist/headless-io-GXHKDPHB.js +2 -0
- package/dist/index.js +55 -54
- package/dist/ingest-4CGBXC2L.js +2 -0
- package/dist/ingest-cmd-FJ3SLTT4.js +3 -0
- package/dist/interactive-bind-SJLDJULN.js +7 -0
- package/dist/interrupt-guard-UREUWNRL.js +2 -0
- package/dist/lifecycle-cmd-56OZT4LY.js +2 -0
- package/dist/list-cmd-JB2ABACD.js +3 -0
- package/dist/list-commands-PGAX5HRB.js +2 -0
- package/dist/logical-ids-QRRUXV5E.js +2 -0
- package/dist/login-flow-4OJ34VDP.js +2 -0
- package/dist/maintenance-cmd-E3HEEVQW.js +2 -0
- package/dist/open-MQLQKFAW.js +2 -0
- package/dist/{persist-recorded-session-XKPZX7HW.js → persist-recorded-session-WFU4M4SQ.js} +1 -1
- package/dist/pipeline-EYQUM27P.js +2 -0
- package/dist/readmodel-MPTENJ2R.js +2 -0
- package/dist/reconcile-cmd-TFFYCTCY.js +8 -0
- package/dist/{recording-banner-2TNKQHP2.js → recording-banner-PH2NND2X.js} +1 -1
- package/dist/{require-project-folder-SJG5FQY6.js → require-project-folder-RD2UAB7E.js} +1 -1
- package/dist/revert-3TKLOYQA.js +2 -0
- package/dist/review-cmd-SL52N4TM.js +4 -0
- package/dist/run-NODOSQUL.js +2 -0
- package/dist/run-test-md-I6O4H7B2.js +17 -0
- package/dist/{scrollback-6GINSTL2.js → scrollback-JLPJR25X.js} +1 -1
- package/dist/sessions-cmd-STHKGDX4.js +23 -0
- package/dist/signals-cmd-LXHZQLXZ.js +2 -0
- package/dist/{skill-installer-M6AREQQW.js → skill-installer-BJLHH3DW.js} +1 -1
- package/dist/spawner-UDCF35OA.js +2 -0
- package/dist/tcg-generate-E7H4LF7Y.js +2 -0
- package/dist/testmd-actions-FMVUXZGX.js +2 -0
- package/dist/token-refresh-OGBTJGZ2.js +2 -0
- package/dist/turn-preflight-I5SM4UIZ.js +2 -0
- package/dist/ui-JEJGTURD.js +4 -0
- package/dist/{validate-basic-FO7C2URG.js → validate-basic-WILRWRRP.js} +1 -1
- package/dist/{version-check-PHZX5WS7.js → version-check-TXTCVX2N.js} +1 -1
- package/dist/view-cmd-QE2FS3GB.js +436 -0
- package/package.json +6 -6
- package/dist/CliUploadProgress-DMH3C3UZ.js +0 -2
- package/dist/EvidenceViewOffer-HEBQ7C4H.js +0 -2
- package/dist/FolderPicker-5S23OTSY.js +0 -2
- package/dist/HelpView-YYKTP4JH.js +0 -2
- package/dist/SingleShotApp-5TYM356H.js +0 -2
- package/dist/TestMdRunView-BIVXQE54.js +0 -2
- package/dist/chunk-54TKNWXF.js +0 -5
- package/dist/chunk-5MTRNUAK.js +0 -2
- package/dist/chunk-7KDNH6JP.js +0 -10
- package/dist/chunk-7YRNLGUT.js +0 -11
- package/dist/chunk-C6S4IEBC.js +0 -2
- package/dist/chunk-DJL47DYJ.js +0 -8
- package/dist/chunk-H6QJ4YU7.js +0 -2
- package/dist/chunk-J75KVNX5.js +0 -18
- package/dist/chunk-MUPHP5W6.js +0 -27
- package/dist/chunk-NAYAVVTP.js +0 -6
- package/dist/chunk-P5XBCJYQ.js +0 -7
- package/dist/chunk-Q2I65L2W.js +0 -6
- package/dist/chunk-QCEWUUE6.js +0 -55
- package/dist/chunk-V2GYBVSM.js +0 -2
- package/dist/chunk-Y44AETOW.js +0 -2
- package/dist/chunk-YCNCW4O4.js +0 -8
- package/dist/evidence-O4AON5FU.js +0 -2
- package/dist/list-commands-VJAL4J3O.js +0 -2
- package/dist/login-flow-VZ2MITFA.js +0 -2
- package/dist/pipeline-CADTHPDV.js +0 -2
- package/dist/run-test-md-INJKPE2I.js +0 -13
- package/dist/tcg-generate-VKFXR5JT.js +0 -2
- package/dist/testmd-actions-4QLHD74A.js +0 -2
- package/dist/token-refresh-2HKIYD4Y.js +0 -2
package/dist/chunk-QCEWUUE6.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c as We,d as xt,e as Br,f as Vr}from"./chunk-J75KVNX5.js";import{a as Hr,b as Pt,c as Tt,d as Dt,e as Gr}from"./chunk-P5XBCJYQ.js";import{a as ke,b as ne,c as Nr,e as Ce,f as Et,j as Mr,k as At,p as Ee}from"./chunk-Q2I65L2W.js";import{a as Ae,b as Kr}from"./chunk-C5UNZ6ZY.js";import{c as qr}from"./chunk-S3DAAAE5.js";import{c as zr}from"./chunk-54TKNWXF.js";import{d as $r}from"./chunk-2YQ6TW77.js";import{D as xr,H as Pr,I as Tr,J as Dr,L as Lr,M as Or,_ as jr,da as Ur,ea as Fr,j as ze}from"./chunk-DJL47DYJ.js";import{b as he}from"./chunk-T4PKTWZ6.js";import{a as Ie}from"./chunk-WAOCHXJ5.js";import{a as Ge,b as Ct}from"./chunk-PISZLYS5.js";import{a as Ar,b as kt}from"./chunk-NAYAVVTP.js";import{a as _r,c as _t,d as It,e as qe,f as Ir,g as kr}from"./chunk-7KDNH6JP.js";import{g as Cr,h as Er}from"./chunk-QO6PAA7Q.js";import{a as Ke}from"./chunk-2WVKOZ6W.js";import{a as He,b as wr}from"./chunk-NLCCBXXV.js";import{a as X}from"./chunk-UOGJUJCF.js";import{a as N}from"./chunk-RZ4F3BHX.js";import{a as Sr}from"./chunk-E47GFYXA.js";import{a as Be,c as St,i as Rr,j as Ve,k as Rt,l as wt}from"./chunk-HFXQU7UZ.js";import{join as ae,basename as ss}from"path";import{existsSync as os,readFileSync as as}from"fs";import{existsSync as Lt}from"fs";import{join as Ye,basename as Wr}from"path";function Yr(e,t){if(!t||!Lt(t))return e.steps.map(()=>({kind:"author",reason:"no-result-md"}));let r=Tt(t),n=[],s=new Set,o=new Map;function a(i){let l=Ee(i),b=Ye(l,"Result.md");if(o.has(b))return o.get(b);let g=Lt(b)?Tt(b):null;return o.set(b,g),g}function m(i){for(let l=1;l<i.trace.length;l++){let g=i.trace[l-1].file===e.rootPath?r:a(i.trace.slice(0,l));if(!g)return{kind:"author",reason:"no-result-md"};let _=i.trace[l-1].stepIndex,R=g.steps[_-1];if(!R)return{kind:"author",reason:"no-result-md"};if(R.kind!=="import")return{kind:"author",reason:"structure-mismatch"};let k=Wr(R.importPath),w=Wr(i.trace[l].file);if(k!==w)return{kind:"author",reason:"structure-mismatch"};if(R.status!=="passed")return{kind:"author",reason:"recorded-failed"}}return null}for(let i of e.steps){let l=i.trace[i.trace.length-1].file,b=i.trace[i.trace.length-1].stepIndex,g=s.has(l);for(let w=0;w<i.trace.length-1&&!g;w++)s.has(i.trace[w].file)&&(g=!0);if(g){n.push({kind:"author",reason:"downstream-of-divergence"});continue}let _=m(i);if(_){n.push(_);for(let w=0;w<i.trace.length;w++)s.add(i.trace[w].file);continue}let R=l===e.rootPath?r:a(i.trace),k=ws(i,R,b);if(n.push(k),k.kind==="author"){s.add(l);for(let w=0;w<i.trace.length-1;w++)s.add(i.trace[w].file)}}return n}function ws(e,t,r){if(!t)return{kind:"author",reason:"no-result-md"};let n=t.steps[r-1];if(!n)return{kind:"author",reason:"no-result-md"};if(n.kind!=="objective")return{kind:"author",reason:"structure-mismatch"};if(n.status!=="passed")return{kind:"author",reason:"recorded-failed"};let s=Hr(e);if(s!==n.md5)return{kind:"author",reason:"md5-mismatch"};let o=e.trace.length===1?Mr(e.trace[0].file,r,s.slice(0,8)):Ye(Ee(e.trace),".internal","steps",`${r}-${s.slice(0,8)}`),a=Ye(o,"flows","0","actions.ndjson");return Lt(a)?{kind:"replay",recordingDir:o}:{kind:"author",reason:"missing-recording"}}function Qe(e){return e.some(t=>t.kind==="author")}function Je(e){for(let t=0;t<e.length;t++)if(e[t].kind==="author")return t;return e.length}function Qr(e){return Ye(e.recordingDir,"flows","0","actions.ndjson")}function Jr(e,t){if(process.env.KANE_REPLAY_TRACE==="1")for(let r=0;r<e.steps.length;r++){let n=e.steps[r],s=t[r],o=" ".repeat(n.trace.length-1),a=`step ${n.flatIndex}`;s.kind==="replay"?process.stderr.write(`[replay-trace] ${o}${a}: REPLAY (would skip; v1 always authors)
|
|
3
|
-
`):process.stderr.write(`[replay-trace] ${o}${a}: AUTHOR (${s.reason})
|
|
4
|
-
`)}}function be(e){process.env.KANE_REPLAY_TRACE==="1"&&process.stderr.write(e)}function Zr(e,t){let r=e===0?"(none)":`0..${e-1}`,n=e>=t?"(none)":`${e}..${t-1}`;be(`[replay-trace] phase: replay ${r}, author ${n}
|
|
5
|
-
`)}function Xr(e,t){be(`[replay-trace] step ${e}: REPLAY ${t==="ok"?"OK":"FAILED"}
|
|
6
|
-
`)}function en(e,t,r){be(`[replay-trace] shrink ${e}/${t} \u2192 new boundary ${r}
|
|
7
|
-
`)}function tn(e,t){be(`[replay-trace] complete-reauthor (${e} shrinks exhausted of ${t})
|
|
8
|
-
`)}function Ot(){be(`[replay-trace] force-author (--author) \u2014 walker bypassed
|
|
9
|
-
`)}function rn(e){be(`[replay-trace] cancelled at step ${e}
|
|
10
|
-
`)}import{join as nn}from"path";function jt(e){let t={objective:e.step.objective,model:"v16-alpha",width:e.windowSize.width,height:e.windowSize.height,session_id:e.sessionId,run_index:e.runIndex,stream:!0,mode:"replay",replay:{recording_path:Qr(e.decision),step_label:e.step.objective,...e.investigationAsync?{investigation:"async"}:{}},screenshot_dir:e.evidence?nn(e.sessionDir,"scratch",String(e.runIndex)):nn(e.sessionDir,"runs",String(e.runIndex)),run_id:"run",test_id:"test"};return e.forceNavigateUrl&&(t.url=e.forceNavigateUrl),e.chrome.wsEndpoint?t.ws_endpoint=e.chrome.wsEndpoint:e.chrome.cdpEndpoint&&(t.cdp_endpoint=e.chrome.cdpEndpoint),e.auth.basicAuth?(t.username=e.auth.basicAuth.username,t.access_key=e.auth.basicAuth.access_key):e.auth.token&&(t.auth={type:"bearer",token:e.auth.token}),e.variables&&Object.keys(e.variables).length>0&&(t.variables=e.variables),e.sessionContext&&(t.session_context=e.sessionContext),e.evidence&&(t.evidence=ze(e.evidence.packTestDir,e.evidence.ordinalOffset)),t}async function sn(e){let t=e.forceAuthor?0:Je(e.decisions),r=0,n=!1;for(;;){let s=e.session.snapshot(),o=e.accumulator.snapshot(),a=await e.runReplayPhase(t);if(a.cancelled)return n=!0,rn(a.failedAt??0),{authorBoundary:t,cancelledInPhase:n,shrinkCount:r};if(a.failedAt===null)return{authorBoundary:t,cancelledInPhase:n,shrinkCount:r};let m=Kr({failedAt:a.failedAt,shrinkCount:r,hasRetry:e.hasRetry,maxShrinks:e.maxShrinks});if(m.kind==="fail")return{authorBoundary:-1,cancelledInPhase:n,shrinkCount:r};if(e.acquireLockIfNeeded&&!await e.acquireLockIfNeeded())return{authorBoundary:-1,cancelledInPhase:n,shrinkCount:r};if(e.session.rollback(s),e.accumulator.rollback(o),m.kind==="complete-reauthor")return tn(r+1,e.maxShrinks),{authorBoundary:0,cancelledInPhase:n,shrinkCount:r};r++,en(r,Ae.maxShrinks,m.newAuthorBoundary),t=m.newAuthorBoundary}}var _s=15e3,Ut=3,on=[500,1e3];async function Ft(e){if(process.env.KANE_LOCK_CONFLICT_SIMULATE==="1")return{ok:!1,reason:"concurrent",httpStatus:409,message:"simulated contention (KANE_LOCK_CONFLICT_SIMULATE=1)"};let t=`${e.baseUrl}/test/${encodeURIComponent(e.testId)}/playground`,r=await Ze(t,{from_commit_id:e.fromCommitId,new_commit_id:e.newCommitId},e.auth);return r.ok?{ok:!0,sessionExpiresAt:M(r.body,"session_expires_at")??""}:{ok:!1,...Is(r)}}function Is(e){let t=M(e.body,"error")??M(e.body,"code")??"",r=M(e.body,"message")??M(e.body,"detail")??e.text??`HTTP ${e.status}`,n;return e.status===0?n="network":e.status===401||e.status===403?n="auth":e.status===409&&t==="PlaygroundBaseCommitMismatch"?n="base_mismatch":e.status===409?n="concurrent":e.status===422?n="disabled":e.status===400&&/no committed/i.test(r)?n="no_commits":e.status===400?n="missing_field":e.status>=500||e.status===408||e.status===429?n="network":n="other",{reason:n,httpStatus:e.status,message:r}}async function ln(e){let t=`${e.baseUrl}/test/${encodeURIComponent(e.testId)}/playground/reserve`,r=await Ze(t,void 0,e.auth);return r.ok?{ok:!0,sessionExpiresAt:M(r.body,"session_expires_at")??""}:{ok:!1,expired:r.status===404,httpStatus:r.status,message:M(r.body,"message")??M(r.body,"detail")??r.text??`HTTP ${r.status}`}}async function cn(e){let t=`${e.baseUrl}/test/${encodeURIComponent(e.testId)}/commit`,r={commit_id:e.body.commitId,from_commit_id:e.body.fromCommitId,commit_message:e.body.commitMessage,total_steps:e.body.totalSteps};e.body.timeTaken!==void 0&&(r.time_taken=e.body.timeTaken),e.body.objectives!==void 0&&(r.objectives=e.body.objectives);let n=await Ze(t,r,e.auth);return n.ok?{ok:!0,testId:M(n.body,"test_id")??e.testId,testcaseId:M(n.body,"testcase_id")??"",projectId:M(n.body,"project_id"),isTestCaseDeleted:typeof n.body?.is_test_case_deleted=="boolean"?n.body.is_test_case_deleted:void 0}:{ok:!1,...ks(n)}}function ks(e){let t=M(e.body,"error")??M(e.body,"code")??"",r=M(e.body,"message")??M(e.body,"detail")??e.text??`HTTP ${e.status}`,n;return e.status===0?n="network":e.status===401||e.status===403?n="auth":e.status===409&&t==="PlaygroundBaseCommitMismatch"?n="base_mismatch":e.status===409&&t==="PlaygroundCommitLockMismatch"?n="lock_mismatch":e.status===409?n="expired":e.status===422?n="not_found":e.status>=500||e.status===408||e.status===429?n="network":n="other",{reason:n,httpStatus:e.status,message:r}}async function dn(e){let t=`${e.baseUrl}/test/${encodeURIComponent(e.testId)}/commit`,r={discard:!0,commit_id:e.body.commitId,from_commit_id:e.body.fromCommitId,commit_message:"(discarded)",total_steps:1},n=await Ze(t,r,e.auth);return n.ok?{ok:!0}:{ok:!1,reason:M(n.body,"error")??"other",httpStatus:n.status,message:M(n.body,"message")??M(n.body,"detail")??n.text??`HTTP ${n.status}`}}async function Ze(e,t,r){let n=null;for(let s=1;s<=Ut;s++){let o=new AbortController,a=setTimeout(()=>o.abort(),_s);try{let m=await N(e,{method:"POST",headers:{Authorization:He(r.username,r.accessKey),"Content-Type":"application/json",Accept:"application/json"},...t!==void 0?{body:JSON.stringify(t)}:{},signal:o.signal});clearTimeout(a);let i=await m.text(),l=null;if(i)try{l=JSON.parse(i)}catch{}let b=m.status>=500||m.status===408||m.status===429;if(m.ok||!b)return{ok:m.ok,status:m.status,body:l,text:i};if(s<Ut){await an(on[s-1]??1e3);continue}return{ok:!1,status:m.status,body:l,text:i}}catch(m){if(clearTimeout(a),n=m,s<Ut){await an(on[s-1]??1e3);continue}}}return{ok:!1,status:0,body:null,text:n?.message??"exhausted retries"}}function an(e){return new Promise(t=>setTimeout(t,e))}function M(e,t){if(typeof e!="object"||e===null)return;let r=e[t];return typeof r=="string"?r:void 0}var Cs=60*1e3,un="lock-heartbeat",ye=null,Nt=null,mn={register:(e,t)=>qe(e,t),deregister:e=>Ir(e),cleanup:(e,t)=>kr(e,t),remoteLogger:null};function pn(){ye!==null&&(clearInterval(ye),ye=null)}function Mt(e){if(ye!==null)return;let t=e.lifecycle??mn;Nt=t,ye=setInterval(async()=>{let r=await ln({baseUrl:e.baseUrl,testId:e.testId,auth:e.auth});if(!r.ok){let n=r.expired?"session expired":r.message;process.stderr.write(`[lock] heartbeat failed: ${n}; continuing run
|
|
11
|
-
`)}},Cs),t.register(un,()=>pn())}function $t(){ye!==null&&(pn(),(Nt??mn).deregister(un),Nt=null)}import{readFileSync as fn,readdirSync as gn,existsSync as fe,promises as hn}from"fs";import{join as ee}from"path";async function Es(e,t){let r=ee(e,"steps",`${t.ordinal}-${t.id}`),n;try{n=await hn.readFile(ee(r,"screenshot.png"))}catch{return null}let s=null;try{s=JSON.parse(await hn.readFile(ee(r,"step.json"),"utf8")).action_id??null}catch{}return{png:n,actionId:s}}function ri(){let e=[];return{track:t=>{e.push(t.catch(()=>{}))},settle:async()=>{await Promise.all(e)}}}async function bn(e,t,r,n){try{let s=await Es(e,t);if(!s){n("warn","SCREENSHOT_SKIP","Pack step folder or screenshot not found",{ordinal:t.ordinal,id:t.id,reason:"pack_step_not_found"});return}if(!s.actionId){n("warn","SCREENSHOT_SKIP","No action_id in step.json",{ordinal:t.ordinal,id:t.id,reason:"no_action_id"});return}r.enqueue(s.actionId,s.png),n("info","SCREENSHOT_ENQUEUED","Screenshot enqueued",{ordinal:t.ordinal,id:t.id,action_id:s.actionId,size:s.png.length})}catch(s){n("error","SCREENSHOT_DISPATCH_ERROR","Screenshot dispatch error",{ordinal:t.ordinal,id:t.id,error:s instanceof Error?s.message:String(s)})}}function yn(e,t,r,n,s,o){try{let a=ee(e,"runs",String(t),"run-test");if(!fe(a)){s("warn","SCREENSHOT_SKIP","Runs dir not found",{step_index:r,reason:"runsDir_not_found",path:a});return}let m=a;if(o){let w=ee(a,`child-${o}`);if(!fe(w)){s("warn","SCREENSHOT_SKIP","Child dir not found",{step_index:r,child_id:o,reason:"child_dir_not_found",path:w});return}let x=gn(w).filter(c=>fe(ee(w,c,"screenshots")));if(x.length===0){s("warn","SCREENSHOT_SKIP","No screenshots dir under child",{step_index:r,child_id:o,reason:"no_child_screenshots_dir"});return}m=ee(w,x[0])}else if(!fe(ee(a,"screenshots"))){let w=gn(a).filter(x=>fe(ee(a,x,"screenshots")));if(w.length===0){s("warn","SCREENSHOT_SKIP","No screenshots dir found",{step_index:r,reason:"no_screenshots_dir"});return}m=ee(a,w[0])}let i=ee(m,"screenshots",`step_${String(r).padStart(3,"0")}.png`);if(!fe(i)){s("warn","SCREENSHOT_SKIP","Screenshot not found",{step_index:r,child_id:o,reason:"screenshot_not_found",path:i});return}let l=ee(a,"actions.ndjson");if(!fe(l)){s("warn","SCREENSHOT_SKIP","NDJSON not found",{step_index:r,reason:"ndjson_not_found"});return}let b=fn(l,"utf-8").trim().split(`
|
|
12
|
-
`),g=b[b.length-1];if(!g){s("warn","SCREENSHOT_SKIP","NDJSON empty",{step_index:r,reason:"ndjson_empty"});return}let R=JSON.parse(g).action_id;if(!R){s("warn","SCREENSHOT_SKIP","No action_id in NDJSON",{step_index:r,reason:"no_action_id"});return}let k=fn(i);n.enqueue(R,k),s("info","SCREENSHOT_ENQUEUED","Screenshot enqueued",{step_index:r,child_id:o,action_id:R,size:k.length})}catch(a){s("error","SCREENSHOT_DISPATCH_ERROR","Screenshot dispatch error",{step_index:r,error:a instanceof Error?a.message:String(a)})}}import{dirname as As,join as xs}from"path";function vn(e,t,r){let n=e.total_runs??1,s=e.run_dir,o,a;if(n>1&&s){let m=As(s);o=Array.from({length:n},(i,l)=>xs(m,String(t+l))),r&&r.length===n&&(a=r)}return{allRunDirs:o,flowObjectives:a}}function Sn(e,t,r,n){return{index:r,objective:t,summary:e.summary,oneLiner:e.one_liner,status:e.status,resultCode:e.result_code,reasonCode:e.reason_code,perFlowMetadata:e.per_flow_metadata,context:e.context??{memory:{},variables:{},pointer:""},run_dir:e.run_dir,run_dirs:n.allRunDirs,flow_objectives:n.flowObjectives}}var Xe=class{constructor(t){this.resolved=t;this.outcomes=t.rootSteps.map(r=>({rootStepIndex:r.index,status:"skipped"}))}outcomes;skipRoot=null;overallHalted=!1;shouldRunFlatStep(t){if(this.overallHalted)return!1;let r=t.trace[0].stepIndex;return!(this.skipRoot!==null&&r===this.skipRoot)}recordStep(t,r){let n=t.trace[0].stepIndex,s=this.outcomes.find(i=>i.rootStepIndex===n),o=this.resolved.rootSteps.find(i=>i.index===n),a=o.body.kind!=="objective";return a&&(s.refKind="import",s.refLabel=o.body.path,s.inlinedCount=(s.inlinedCount??0)+1,s.duration_s=(s.duration_s??0)+r.duration_s),r.status==="passed"?(a?s.status!=="failed"&&(s.status="passed"):(s.status="passed",s.duration_s=r.duration_s),{continueOverall:!0}):t.optional?(s.softFailures=s.softFailures??[],s.softFailures.push({subStepIndex:t.trace[t.trace.length-1].stepIndex,reason:r.reason}),{continueOverall:!0}):(s.status="failed",s.duration_s=a?s.duration_s:r.duration_s,s.failedSubStepIndex=a?t.trace.slice(1).map(i=>i.stepIndex):void 0,s.reason=r.reason,this.skipRoot=n,o.optional??!1?(s.softFailed=!0,{continueOverall:!0}):(this.overallHalted=!0,{continueOverall:!1}))}snapshotOutcomes(){return[...this.outcomes]}snapshot(){return{outcomes:this.outcomes.map(t=>({...t,softFailures:t.softFailures?[...t.softFailures]:void 0})),skipRoot:this.skipRoot,overallHalted:this.overallHalted}}rollback(t){this.outcomes=t.outcomes.map(r=>({...r,softFailures:r.softFailures?[...r.softFailures]:void 0})),this.skipRoot=t.skipRoot,this.overallHalted=t.overallHalted}finalize(){let t=this.outcomes.some(n=>n.status==="failed"&&!n.softFailed)?"failed":"passed",r=this.outcomes.reduce((n,s)=>n+(s.duration_s??0),0);return{overallStatus:t,outcomes:this.outcomes,totalDurationS:r}}};function Bt(e){if(!e)return null;let t=e.trim();return t?/^https?:\/\//i.test(t)?t:`https://${t}`:null}function Rn(e){return Bt(e.flag)??Bt(e.frontmatter)??(e.configDefault&&e.configDefault!==Ve?Bt(e.configDefault):null)}function wn(e){return e.resolvedUrl!==null?!1:!((!!e.local||!!e.allowMissingUrl)&&!e.isTTY)}import{spawn as Ps}from"child_process";async function _n(e,t,r=100){let n=`${e.replace(/\/+$/,"")}/json/version`,s=await N(n);if(!s.ok)throw new Error(`CDP /json/version returned ${s.status}`);let o=await s.json();if(!o.webSocketDebuggerUrl)throw new Error("CDP /json/version missing webSocketDebuggerUrl");let a=new Sr(o.webSocketDebuggerUrl);await new Promise((f,I)=>{a.once("open",f),a.once("error",I)});let m=1,i=new Map;a.on("message",f=>{let I;try{I=JSON.parse(f.toString())}catch{return}if(I.id==null)return;let L=i.get(I.id);L&&(i.delete(I.id),I.error?L.reject(new Error(I.error.message)):L.resolve(I.result))});function l(f,I){let L=m++;return new Promise((Y,Q)=>{i.set(L,{resolve:Oe=>Y(Oe),reject:Q});let de={id:L,method:f};I&&(de.params=I),a.send(JSON.stringify(de))})}let g=(await l("Target.getTargets")).targetInfos.find(f=>f.type==="page");if(!g)throw a.close(),new Error("CDP: no page target found");let R=(await l("Browser.getWindowForTarget",{targetId:g.targetId})).windowId,k="",w=!1,x=null,c=!1;a.on("close",()=>{c=!0}),a.on("error",()=>{c=!0});async function j(){if(!w){if(c){w=!0;return}try{let I=(await l("Browser.getWindowBounds",{windowId:R})).bounds,L=`${I.left}:${I.top}:${I.width}:${I.height}`;L!==k&&(k=L,t({left:I.left,top:I.top,width:I.width,height:I.height}))}catch{}w||(x=setTimeout(j,r))}}return j(),{stop(){if(!w){w=!0,x&&clearTimeout(x);try{a.close()}catch{}}}}}var Ts=new Set(["1","true","yes"]);function In(e){if(e?.headless)return null;let t=process.env.KANE_CLI_DISABLE_MARKER;if(t!=null&&Ts.has(t.toLowerCase()))return null;let r=Ar();if(!r)return null;let n=[...r.args,"overlay"];e?.text&&n.push(e.text);let s;try{s=Ps(r.cmd,n,{cwd:r.cwd,stdio:["pipe","ignore","ignore"],detached:!1,windowsHide:!0})}catch{return null}s.stdin?.on("error",()=>{});let o=!1;s.on("exit",()=>{o=!0}),s.on("error",()=>{o=!0});function a(l){if(!(o||!s.stdin||s.stdin.destroyed))try{s.stdin.write(JSON.stringify(l)+`
|
|
13
|
-
`)}catch{}}e?.chromePid&&e.chromePid>0&&a({type:"chrome_pid",pid:e.chromePid});let m=null;e?.cdpEndpoint&&_n(e.cdpEndpoint,l=>a({type:"bounds",...l})).then(l=>{m=l.stop}).catch(()=>{});let i=!1;return{setRunActive(l){i||a({type:"run_active",active:l})},setStepText(l){if(i)return;let b=l.trim();b&&a({type:"step_text",text:b})},setStepComplete(){i||a({type:"step_complete"})},kill(){if(!i){i=!0,m?.();try{s.stdin?.end()}catch{}try{s.kill("SIGTERM")}catch{}}}}}function kn(e,t,r){return`${e}/projects/${t}/test-cases/${r}`}function et(e,t,r,n){return`${kn(e,t,r)}/dashboard/share/${n}?type=summary&agentView=true&fqdn=summary-page`}function Cn(e,t,r,n){if(!(!t||!r||!n))return et(e,t,r,n)}function En(e,t,r){return`${kn(e,t,r)}/dashboard?type=summary&agentView=true&fqdn=summary-page`}import{mkdtempSync as qs,rmSync as Gs}from"fs";import{join as zs}from"path";import{tmpdir as Ws}from"os";import{spawn as Pn,spawnSync as Ds}from"child_process";import{existsSync as Vt}from"fs";import{createConnection as Ls}from"net";import{homedir as xe,platform as De}from"os";import{join as Pe}from"path";var Os=new Set(["1","true","yes"]),tt=class extends Error{constructor(t){super(t),this.name="ChromeNotFoundError"}};function ki(e){return e instanceof tt?e.message:`Chrome failed: ${e instanceof Error?e.message:String(e)}`}var rt={darwin:["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",Pe(xe(),"Applications/Google Chrome.app/Contents/MacOS/Google Chrome"),"/Applications/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing",Pe(xe(),"Applications/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing"),"/Applications/Chromium.app/Contents/MacOS/Chromium"],linux:["/usr/bin/google-chrome","/usr/bin/google-chrome-stable","/usr/bin/google-chrome-for-testing","/usr/local/bin/google-chrome-for-testing",Pe(xe(),"chrome-for-testing/chrome-linux64/chrome"),"/usr/bin/chromium","/usr/bin/chromium-browser","/snap/bin/chromium"],win32:["C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe","C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",Pe(xe(),"AppData\\Local\\Google\\Chrome\\Application\\chrome.exe"),"C:\\chrome-for-testing\\chrome-win64\\chrome.exe",Pe(xe(),"AppData\\Local\\chrome-for-testing\\chrome-win64\\chrome.exe")]};function js(){if(process.env.KANE_CLI_CHROME_PATH)return process.env.KANE_CLI_CHROME_PATH;let e=De(),t=rt[e]??rt.linux;for(let r of t)if(Vt(r))return r;return e==="win32"?"chrome.exe":"google-chrome"}function Us(){if(process.env.KANE_CLI_CHROME_PATH)return Vt(process.env.KANE_CLI_CHROME_PATH);let e=De();if((rt[e]??rt.linux).some(s=>Vt(s)))return!0;let r=e==="win32"?"chrome.exe":"google-chrome",n=e==="win32"?"where":"which";try{return Ds(n,[r],{stdio:"ignore"}).status===0}catch{return!1}}function Fs(){let e=De();return e==="darwin"?["Google Chrome is required but was not found at any standard path.","","Install via Homebrew (recommended):"," brew install --cask google-chrome","","Or download:"," https://www.google.com/chrome/","","Then re-run your command. Set KANE_CLI_CHROME_PATH=/path/to/chrome","to point at a non-standard install."].join(`
|
|
14
|
-
`):e==="linux"?["Google Chrome is required but was not found at /usr/bin/google-chrome.","(amd64 / x86_64 only \u2014 Google does not ship Chrome for Linux ARM.)","","Debian / Ubuntu (any version):"," wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb"," sudo apt install -y ./google-chrome-stable_current_amd64.deb","","Fedora / RHEL / AlmaLinux / Rocky:"," sudo dnf install -y https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm","","Then re-run your command. Set KANE_CLI_CHROME_PATH=/path/to/chrome","to point at a non-standard install."].join(`
|
|
15
|
-
`):e==="win32"?["Google Chrome is required but was not found in Program Files or AppData.","","Install via winget (Windows 10 1809+):"," winget install --id Google.Chrome -e --silent","","Or download:"," https://www.google.com/chrome/","","Then re-run your command. Set KANE_CLI_CHROME_PATH=C:\\path\\to\\chrome.exe","to point at a non-standard install."].join(`
|
|
16
|
-
`):["Google Chrome is required.","Install from https://www.google.com/chrome/","(Note: no official Chrome builds for BSD or Alpine/musl Linux.)"].join(`
|
|
17
|
-
`)}function Ns(e){let t=De(),r=[`--remote-debugging-port=${e.port}`,`--user-data-dir=${e.userDataDir}`,`--window-size=${e.width},${e.height}`,"--no-first-run","--no-default-browser-check","--disable-blink-features=AutomationControlled","--disable-features=DownloadBubble,DownloadBubbleV2","--safebrowsing-disable-download-protection","--disable-popup-blocking","--disable-notifications","--disable-infobars","--disable-translate","--disable-prompt-on-repost","--disable-background-networking","--disable-client-side-phishing-detection","--disable-default-apps","--disable-hang-monitor","--disable-sync","--metrics-recording-only","--safebrowsing-disable-auto-update","--disable-backgrounding-occluded-windows","--disable-background-timer-throttling","--test-type=webdriver","--allow-pre-commit-input","--enable-logging","--v=1"];return t==="linux"&&(r.push("--no-sandbox"),r.push("--disable-dev-shm-usage"),r.push("--password-store=basic")),t==="darwin"&&r.push("--use-mock-keychain"),e.headless&&r.push("--headless=new"),r}function Ms(e){return new Promise(t=>{let r=Ls({port:e,host:"127.0.0.1"});r.setTimeout(1e3),r.on("connect",()=>{r.destroy(),t(!0)}),r.on("timeout",()=>{r.destroy(),t(!1)}),r.on("error",()=>{r.destroy(),t(!1)})})}async function $s(){for(let e=Rt;e<=wt;e++)if(!await Ms(e))return e;throw new Error(`All CDP ports ${Rt}-${wt} are in use. Close other Chrome instances.`)}var Te=class extends Error{constructor(t){super(t),this.name="CdpReadinessError"}};async function Bs(e,t){let r=Date.now(),n=`http://127.0.0.1:${e}/json/version`;for(;Date.now()-r<t;){try{if((await N(n)).ok)return`http://127.0.0.1:${e}`}catch{}await new Promise(s=>setTimeout(s,200))}throw new Te(`Chrome CDP not ready after ${t}ms on port ${e}`)}var Vs=3e4,Hs=2;function An(e,t,r){let n=process.env[e];if(n==null||n.trim()==="")return t;let s=Number(n);return!Number.isInteger(s)||s<r?t:s}function Ks(e){return Math.min(500*e,3e3)}function xn(e,t){try{if(e.pid)if(t==="win32")Pn("taskkill",["/pid",String(e.pid),"/T","/F"],{stdio:"ignore"});else try{process.kill(-e.pid,"SIGKILL")}catch{e.kill("SIGKILL")}else e.kill("SIGKILL")}catch{}}async function Tn(e){let t=process.env.KANE_CLI_SKIP_BROWSER_DOWNLOAD;if(!(t!=null&&Os.has(t.toLowerCase()))&&!Us())throw _t()?.log("error","CHROME_NOT_FOUND","Startup gate: Chrome unavailable at standard system paths",{platform:process.platform,kane_cli_chrome_path:process.env.KANE_CLI_CHROME_PATH??null,skip_browser_download:process.env.KANE_CLI_SKIP_BROWSER_DOWNLOAD??null}),new tt(Fs());let n=De(),s=js(),o=An("KANE_CLI_CDP_TIMEOUT_MS",Vs,1),m=An("KANE_CLI_CDP_RETRIES",Hs,0)+1,i;for(let l=1;l<=m;l++){let b=await $s(),g=Ns({port:b,...e});e.startUrl&&g.push(e.startUrl);let _=Pn(s,g,{stdio:"ignore",detached:!0});_.unref();try{let R=await new Promise((k,w)=>{_.on("error",x=>{w(new Error(`Failed to launch Chrome: ${x.message}. Is Chrome installed at ${s}?`))}),_.on("close",x=>{x!==null&&x!==0&&w(new Te(`Chrome exited during startup with code ${x}`))}),Bs(b,o).then(k,w)});return{process:_,port:b,cdpEndpoint:R,kill(){xn(_,n)}}}catch(R){if(i=R,!(R instanceof Te))throw R;xn(_,n),_t()?.log("warn","CHROME_CDP_LAUNCH_RETRY",`Chrome CDP launch attempt ${l}/${m} failed`,{attempt:l,max_attempts:m,port:b,timeout_ms:o,headless:e.headless??!1,error:R.message}),l<m&&await new Promise(k=>setTimeout(k,Ks(l)))}}throw i??new Error("Chrome launch failed after retries")}async function Dn(e){if(e.cft)return{instance:null,tempDir:null};if(e.wsEndpoint)return{wsEndpoint:e.wsEndpoint,instance:null,tempDir:null};if(e.cdpEndpoint){let s=await N(`${e.cdpEndpoint}/json/version`);if(!s.ok)throw new Error(`CDP endpoint not reachable: ${e.cdpEndpoint} (${s.status})`);return{cdpEndpoint:e.cdpEndpoint,instance:null,tempDir:null}}let t,r=null;if(e.config.chrome_profile_path)t=e.config.chrome_profile_path.replace("~",process.env.HOME??"~");else{r=qs(zs(Ws(),"kane-clean-")),t=r;let s=r;qe("tempDir",()=>{try{Gs(s,{recursive:!0,force:!0})}catch{}})}let n=await Tn({userDataDir:t,width:e.config.window_size.width,height:e.config.window_size.height,startUrl:e.startUrl,headless:e.headless});return{cdpEndpoint:n.cdpEndpoint,instance:n,tempDir:r}}function Ln(e){let t={objective:e.objective,model:e.model,width:e.windowSize.width,height:e.windowSize.height,session_id:e.sessionId,run_index:e.runIndex,stream:!0,max_steps:e.maxSteps??30,headless:e.headless??!1};return e.url&&(t.url=e.url),e.requireStartUrl&&(t.require_start_url=!0),e.chrome.wsEndpoint?t.ws_endpoint=e.chrome.wsEndpoint:e.chrome.cdpEndpoint&&(t.cdp_endpoint=e.chrome.cdpEndpoint),e.auth.basicAuth?(t.username=e.auth.basicAuth.username,t.access_key=e.auth.basicAuth.access_key):e.auth.token&&(t.auth={type:"bearer",token:e.auth.token}),e.disableAskUser&&(t.disable_ask_user=!0),e.enableTaskSkills&&(t.enable_task_skills=!0),e.networkWs&&(t.network_ws=!0),e.networkSse&&(t.network_sse=!0),(e.bugDetection==="stop"||e.bugDetection==="continue")&&(t.bug_detection=e.bugDetection),e.variables&&Object.keys(e.variables).length>0&&(t.variables=e.variables),e.globalContext&&(t.global_context=e.globalContext),e.localContext&&(t.local_context=e.localContext),e.sessionContext&&(t.session_context=e.sessionContext),e.evidence&&(t.evidence=ze(e.evidence.packTestDir,e.evidence.ordinalOffset)),t}import{readdirSync as Ys,readFileSync as jn,existsSync as Un}from"fs";import{join as Qs}from"path";function On(e,t){if(!Un(e))return{};let r={},n;try{n=Ys(e).filter(s=>s.endsWith(".json")).sort()}catch{return{}}for(let s of n)try{let o=jn(Qs(e,s),"utf-8"),a=JSON.parse(o);if(a&&typeof a=="object"){for(let[m,i]of Object.entries(a))if(i&&typeof i=="object"&&"value"in i){let l=i;r[m]={value:l.value,secret:l.secret??!1,syntax:l.syntax??`{{${m}}}`}}}}catch{t?t("warn","VARIABLE_PARSE_FAILED","Skipping invalid variables file",{file:s}):process.stderr.write(`[variables] Warning: skipping invalid variables file: ${s}
|
|
18
|
-
`)}return r}function Fn(e){if(!Un(e))throw new Error(`Variables file not found: ${e}`);let t=jn(e,"utf-8"),r=JSON.parse(t),n={};if(r&&typeof r=="object"){for(let[s,o]of Object.entries(r))if(o&&typeof o=="object"&&"value"in o){let a=o;n[s]={value:a.value,secret:a.secret??!1,syntax:a.syntax??`{{${s}}}`}}}return n}function Nn(e){let t;try{t=JSON.parse(e)}catch{throw new Error("Invalid --variables JSON")}let r={};if(t&&typeof t=="object"){for(let[n,s]of Object.entries(t))if(s&&typeof s=="object"&&"value"in s){let o=s;r[n]={value:o.value,secret:o.secret??!1,syntax:o.syntax??`{{${n}}}`}}}return r}function Mn(e,t,r){let n=On(e,r),s=On(t,r);return{...n,...s}}var ve=class{constructor(t){this.baseUrl=t}async pushSecret(t){let r=He(t.username,t.accessKey),n=await N(`${this.baseUrl}/logistics/v1.0/secrets/create`,{method:"PUT",headers:{Authorization:r,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({secretKey:t.secretKey,secretValue:t.secretValue,orgId:t.orgId,username:t.username,scope:"user",type:"user",accessKey:t.accessKey})});if(!n.ok)throw new Error(`Push secret failed: ${n.status} ${await n.text()}`)}static extractVariableKeys(t){let r=t.matchAll(/\{\{([a-zA-Z_][a-zA-Z0-9_]*)\}\}/g),n=new Set;for(let s of r)n.add(s[1]);return[...n]}};var Se=class extends wr{constructor(t,r,n){super(t,{username:r,accessKey:n})}async upsertVariable(t){let r=t.environmentId??0,n=await N(`${this.baseUrl}/v1/variables`,{method:"POST",headers:this.headers(),body:JSON.stringify({name:t.name,value:String(t.value),type:"variable",value_type:"string",is_persist:t.isPersist??!1,environment_id:r})});if(n.ok)return{id:(await n.json()).id??0};if(n.status!==409&&n.status!==422)return{id:0};if(!(await N(`${this.baseUrl}/v1/variables/name/${encodeURIComponent(t.name)}`,{method:"PUT",headers:this.headers(),body:JSON.stringify({value:String(t.value),value_type:"string",type:"variable",environment_id:r})})).ok)return{id:0};let o=await N(`${this.baseUrl}/v1/variables/${encodeURIComponent(t.name)}?environment_id=${r}`,{method:"GET",headers:this.headers()});return o.ok?{id:(await o.json()).data?.id??0}:{id:0}}};function $n(e,t){if(Object.keys(e).length===0)return{};let r={};for(let[n,s]of Object.entries(e)){let o=s.syntax??`{{${n}}}`;t.includes(o)&&(r[n]=s)}return r}function Bn(e){let t=Mn(e.globalDir,e.localDir,e.onLoadError),r=e.file?Fn(e.file):{},n=e.inline?Nn(e.inline):{},s={...t,...r,...n},o=Object.keys(s).length>0,{variables:a,objective:m}=o?he(s,e.objective):{variables:{},objective:e.objective},i=Object.entries(s).filter(([,b])=>b.secret),l=Object.entries(s).filter(([,b])=>!b.secret);return{raw:s,auteur:a,auteurObjective:m,secretEntries:i,nonSecretEntries:l}}async function Vn(e){if(e.localMode)return{};let t=X(e.env);if(e.variables.secretEntries.length>0){let n=new ve(t.secretsBaseUrl);for(let[s,o]of e.variables.secretEntries)n.pushSecret({secretKey:s,secretValue:o.value,username:e.auth.username,accessKey:e.auth.access_key,orgId:e.orgId}).then(()=>e.log("info","SECRET_PUSH_OK","Secret pushed",{key:s})).catch(a=>e.log("error","SECRET_PUSH_FAILED","Secret push failed",{key:s,error:String(a)}))}let r={};if(e.variables.nonSecretEntries.length>0){let n=new Se(t.tmsBaseUrl,e.auth.username,e.auth.access_key);for(let[s,o]of e.variables.nonSecretEntries)try{let a=await n.upsertVariable({name:s,value:o.value});r[s]=a.id,e.log("info","VAR_PUSH_OK","Variable pushed",{name:s,id:a.id})}catch(a){e.log("error","VAR_PUSH_FAILED","Variable push failed",{name:s,error:String(a)})}}return r}import{readFileSync as Js,existsSync as Zs}from"fs";function Ht(e){if(!Zs(e))return null;try{return Js(e,"utf-8").trim()||null}catch{return null}}var Xs=()=>{};async function Hn(e,t,r){let n=t.log??Xs,s=e.session.testId??null,o=null,a=null,m=null;if(!r.localMode&&t.performUpload)try{o=await t.performUpload(),o?.success&&(o.testId&&(s=o.testId),o.testcaseId&&e.session.setTestcaseId(o.testcaseId))}catch(i){n("error","FINALIZE_UPLOAD_ERROR","Upload pipeline threw",{error:String(i)})}if(t.renderFeedbackPrompt)try{a=await t.renderFeedbackPrompt(),a&&s&&t.submitFeedback&&t.submitFeedback(s,a).catch(i=>{n("error","FINALIZE_FEEDBACK_SUBMIT_ERROR","Feedback submit failed",{error:String(i)})})}catch(i){n("error","FINALIZE_FEEDBACK_RENDER_ERROR","Feedback prompt threw",{error:String(i)})}if(e.session.flushRecorder(),r.skipLocalWrites)n("info","FINALIZE_SKIP_LOCAL_WRITES","Skipping local writes (testmd flow handles via staging)");else if(r.sourcePath&&r.rootSteps&&r.outcomes){try{m=Pt({sourcePath:r.sourcePath,title:r.title,rootSteps:r.rootSteps,outcomes:r.outcomes,overallStatus:r.overallStatus,startedISO:r.startedISO,durationS:r.durationS,sessionId:e.session.sessionId})}catch(i){n("error","FINALIZE_RESULT_MD_ERROR","_Result.md write failed",{error:String(i)})}try{xt({sourcePath:r.sourcePath,commitId:e.session.sessionId,testId:s??void 0,testcaseId:e.session.testcaseId??void 0,projectId:e.tuiConfig.project_id??void 0,folderId:e.tuiConfig.folder_id??void 0,orgId:e.session.orgId??void 0,sessionName:e.session.sessionName??ke(r.sourcePath),plan:e.session.plan??void 0})}catch(i){n("error","FINALIZE_META_WRITE_ERROR","meta.json write failed",{error:String(i)})}if(o?.codeExportDir)try{let i=e.tuiConfig.code_export?.language??"python";Dt(o.codeExportDir,Et(r.sourcePath,"playwright",i))}catch(i){n("error","FINALIZE_CODE_COPY_ERROR","code-export copy failed",{error:String(i)})}}else if(e.session.recorder?.lastWrittenPath){let i=e.session.recorder.lastWrittenPath,l=e.session.getFlows(),b=l.map((R,k)=>({index:k+1,heading:`Step ${k+1}`,headingLine:0,body:{kind:"objective",text:R.objective}})),g=l.map((R,k)=>({rootStepIndex:k+1,status:R.status==="passed"?"passed":R.status==="failed"?"failed":"skipped",duration_s:R.duration,reason:R.reason})),_=g.some(R=>R.status==="failed")?"failed":"passed";try{m=Pt({sourcePath:i,title:e.session.sessionName??"Session",rootSteps:b,outcomes:g,overallStatus:_,startedISO:e.session.startedAt,durationS:g.reduce((R,k)=>R+(k.duration_s??0),0),sessionId:e.session.sessionId})}catch(R){n("error","FINALIZE_TUI_RESULT_MD_ERROR","TUI _Result.md write failed",{error:String(R)})}try{xt({sourcePath:i,commitId:e.session.sessionId,testId:s??void 0,testcaseId:e.session.testcaseId??void 0,sessionName:e.session.sessionName??void 0,projectId:e.tuiConfig.project_id??void 0,folderId:e.tuiConfig.folder_id??void 0,plan:e.session.plan??void 0})}catch(R){n("error","FINALIZE_TUI_META_WRITE_ERROR","TUI meta.json write failed",{error:String(R)})}if(o?.codeExportDir)try{let R=e.tuiConfig.code_export?.language??"python";Dt(o.codeExportDir,Et(i,"playwright",R))}catch(R){n("error","FINALIZE_TUI_CODE_COPY_ERROR","TUI code-export copy failed",{error:String(R)})}e.session.recorder.lastCollisionSuffixed&&process.stderr.write(`Saved to ${i} (renamed: ${e.session.sessionName}_test.md already existed)
|
|
19
|
-
`)}try{t.runCleanup?.()}catch(i){n("error","FINALIZE_CLEANUP_ERROR","Cleanup hook threw",{error:String(i)})}try{await e.session.finish("complete")}catch(i){n("error","FINALIZE_SESSION_FINISH_ERROR","session.finish threw",{error:String(i)})}return{uploadResult:o,feedbackChoice:a,resultMdPath:m}}import{readFileSync as qn,writeFileSync as Gn,existsSync as zn}from"fs";function Kn(e,t,r){if(r.forceAuthor)return"re-recorded from scratch";if(r.retryTriggered)return"re-recorded after retry";if(t.length>0&&t.every(a=>a.kind==="author"&&a.reason==="no-result-md"))return"initial recording";if(t.length>0&&t.every(a=>a.kind==="replay"))return r.wantsPush?"re-recorded (no source changes)":"no changes";let n=[];for(let a=0;a<t.length;a++){let m=t[a];if(!m||m.kind!=="author"||m.reason==="downstream-of-divergence"||m.reason==="no-result-md")continue;let i=eo(e,e.steps[a]);switch(m.reason){case"structure-mismatch":n.push(`added/removed: ${i}`);break;case"md5-mismatch":n.push(`modified: ${i}`);break;case"missing-recording":n.push(`re-recorded: ${i}`);break;case"recorded-failed":n.push(`re-authored after failure: ${i}`);break}}if(n.length===0)return"automated commit";let s=n.filter((a,m)=>m===0||n[m-1]!==a),o=s.slice(0,3).join("; ");return s.length>3?`${o}; +${s.length-3} more`:o}function eo(e,t){if(!t)return"unknown step";let r=t.trace[0]?.stepIndex;if(r==null)return"unknown step";let s=e.rootSteps[r-1]?.heading?.trim()??"";return t.trace.length>1?s?`imported step in "${s}"`:`imported step ${r}`:s||`step ${r}`}function to(e){if(!(!e.shouldReplaceLocalOutput||!e.resolvedTest||!e.sourcePath||!e.stepRunRecords||!e.outcomes||!e.overallStatus))return async()=>{await Gr({resolvedTest:e.resolvedTest,sessionDir:e.session.sessionDir,stepRunRecords:e.stepRunRecords,outcomes:e.outcomes,overallStatus:e.overallStatus,startedISO:e.startedISO??new Date().toISOString(),durationS:e.durationS??0,sessionId:e.session.sessionId,commitId:e.fromCommitId??"",tmsIds:e.tmsIds??{},codeExportDir:e.codeExportDir,packTestDir:e.evidence?.packTestDir??e.evidenceRead?.packTestDir}),At(ne(e.sourcePath));let t=new Set;for(let r of e.resolvedTest.steps)if(r.trace.length>1){let n=Ee(r.trace);if(t.has(n))continue;t.add(n),zn(`${n}.staging`)&&At(n)}}}function ro(e){if(!(!e.shouldCommit||e.isFirstRun||!e.tmsBaseUrl||!e.testId||!e.fromCommitId||!e.newCommitId||!e.basicAuth||!e.resolvedTest||!e.decisions))return async()=>{let t=Kn(e.resolvedTest,e.decisions,{wantsPush:e.wantsPush??!1,retryTriggered:e.retryTriggered??!1,forceAuthor:e.forceAuthor??!1}),r=e.resolvedTest.steps.map(s=>s.objective).filter(s=>typeof s=="string"&&s.length>0).slice(0,50),n=await cn({baseUrl:`${e.tmsBaseUrl}/kane-cli/v1`,testId:e.testId,body:{commitId:e.newCommitId,fromCommitId:e.fromCommitId,commitMessage:t,totalSteps:e.resolvedTest.steps.length,timeTaken:Math.round(e.durationS??0),objectives:r},auth:{username:e.basicAuth.username,accessKey:e.basicAuth.access_key}});if(n.ok&&e.sourcePath){let s=Ce(e.sourcePath);try{let o=JSON.parse(qn(s,"utf8"));o.commit_id=e.newCommitId,Gn(s,JSON.stringify(o,null,2)+`
|
|
20
|
-
`,"utf8")}catch(o){process.stderr.write(`warn: failed to update meta.json commit_id: ${o.message}
|
|
21
|
-
`)}}return n}}function no(e){if(!(!e.isFirstRun||!e.sourcePath))return async t=>{if(!e.sourcePath)return;let r=Ce(e.sourcePath);try{let n=zn(r)?JSON.parse(qn(r,"utf8")):{};e.session.sessionId&&(n.commit_id=e.session.sessionId),t&&(n.testcase_id=t),e.tmsIds?.testId&&(n.test_id=e.tmsIds.testId),e.tmsIds?.projectId&&(n.project_id=e.tmsIds.projectId),e.tmsIds?.folderId&&(n.folder_id=e.tmsIds.folderId),e.tmsIds?.orgId&&(n.org_id=e.tmsIds.orgId),e.tmsIds?.sessionName&&(n.session_name=e.tmsIds.sessionName),Gn(r,JSON.stringify(n,null,2)+`
|
|
22
|
-
`,"utf8")}catch(n){process.stderr.write(`warn: failed to update meta.json after endTest: ${n.message}
|
|
23
|
-
`)}}}function Wn(e){let t=X(e.env),{session:r,auth:n}=e,s=n.basicAuth?{username:n.basicAuth.username,accessKey:n.basicAuth.access_key}:n.token,o=n.resolvedCreds?.username??n.basicAuth?.username??"",a=n.resolvedCreds?.access_key??n.basicAuth?.access_key??"",m=n.resolvedCreds?.org_id??0,i=n.resolvedCreds?.user_id??0,l=[];for(let k of Object.keys(r.auteurVariables))k.startsWith("secrets.user.")&&l.push({key_name:k.replace("secrets.user.",""),scope:"user"});let g=r.getContext().prior_runs.map(k=>k.status),_=r.auteurVariables,R=Object.keys(_).length>0;return{controllerBaseUrl:t.controllerBaseUrl,tmsBaseUrl:t.tmsBaseUrl,auth:s,authResolver:n.resolver,sessionId:r.sessionId,sessionDir:r.sessionDir,testId:r.testId,commitId:r.sessionId,projectId:e.projectId,folderId:e.folderId,firstObjective:r.firstObjective??"KaneAI Test",firstUrl:r.firstUrl??"",runDirs:r.getRunDirs(),runObjectives:r.getRunObjectives(),runMetadata:r.getRunMetadata(),startedAt:r.startedAt,endedAt:new Date().toISOString(),totalSteps:e.totalSteps,totalDuration:e.totalDuration,runStatuses:g,orgId:m,userId:i,tmsUsername:o,tmsAccessKey:a,screenshotBaseUrl:r.screenshotBaseUrl,screenshotExtMap:e.screenshotExtMap,shareApiBaseUrl:t.shareApiBaseUrl,variables:R?_:void 0,variableIds:e.variableIds,secrets:l,codeExport:e.codeExport,onProgress:e.onProgress,log:e.log,shouldUploadArtifacts:e.shouldUploadArtifacts,shouldReplaceLocalOutput:e.shouldReplaceLocalOutput,shouldCommit:e.shouldCommit,isFirstRun:e.isFirstRun,onAtomicReplace:to(e),onCommitLock:ro(e),onFinalizeSuccess:no(e),evidence:e.evidence,evidenceRead:e.evidenceRead,authoredExecutionPath:e.authoredExecutionPath}}var Yn=["python","javascript"];function so(e){if(e!==void 0){if(!Yn.includes(e))throw new Error(`--code-language must be one of: ${Yn.join(", ")} (got "${e}")`);return e}}function Qn(e,t){let r=so(e.codeLanguage);return{enabled:e.codeExport??t.enabled,language:r??t.language,skipValidation:e.skipCodeValidation??t.skip_validation}}async function Jn(e){try{let r=await new Ke(e.tmsBaseUrl,e.auth.username,e.auth.access_key).createAtmTest({objective:e.objective.slice(0,100),creation_mode:"KANECLI",playground_disabled:e.hasCustomProfile,testURL:e.url,project_id:e.projectId,folder_id:e.folderId,authoring_version:4});return e.log("info","ATM_CREATE_OK","Test created",{test_id:r}),r}catch(t){return e.log("error","ATM_CREATE_FAILED","Test creation failed",{error:t instanceof Error?t.message:String(t)}),null}}var oo=null,io=()=>oo??=import("sharp").then(e=>e.default??e).catch(()=>null),nt=class{maxWorkers;maxRetries=2;queue=[];activeCount=0;drainResolvers=[];sas;log;uploadedExt=new Map;constructor(t,r=3,n){this.sas=t,this.maxWorkers=r,this.log=n}updateSas(t){this.sas=t}enqueue(t,r){this.queue.push({operationId:t,buffer:r}),this.pump()}async drain(t=3e4){if(!(this.queue.length===0&&this.activeCount===0))return new Promise(r=>{this.drainResolvers.push(r),setTimeout(()=>{r()},t)})}pump(){for(;this.activeCount<this.maxWorkers&&this.queue.length>0;){let t=this.queue.shift();this.activeCount++,this.processJob(t).finally(()=>{if(this.activeCount--,this.pump(),this.queue.length===0&&this.activeCount===0){for(let r of this.drainResolvers)r();this.drainResolvers=[]}})}}async processJob(t){let r,n="image/webp",s=await io();if(s)try{let i=await s(t.buffer).webp({quality:80}).toBuffer();r=new Uint8Array(i)}catch(i){r=new Uint8Array(t.buffer),n="image/png",this.log?.("warn","SCREENSHOT_CONVERT_FAILED","WebP conversion failed, using PNG",{operation_id:t.operationId,error:i instanceof Error?i.message:String(i)})}else r=new Uint8Array(t.buffer),n="image/png";let o=n==="image/webp"?"webp":"png",a=`test_screenshots/untagged_screenshot/${t.operationId}.${o}`,m=`${this.sas.base_url}/${this.sas.container}/${a}?${this.sas.sas_token}`;for(let i=0;i<=this.maxRetries;i++)try{let l=await N(m,{method:"PUT",headers:{"Content-Type":n,"x-ms-blob-type":"BlockBlob"},body:r});if(l.ok){this.uploadedExt.set(t.operationId,o);return}if(i<this.maxRetries){await this.backoff(i);continue}this.log?.("warn","SCREENSHOT_UPLOAD_FAILED","Screenshot upload failed after retries",{operation_id:t.operationId,status:l.status,attempts:this.maxRetries+1})}catch{if(i<this.maxRetries){await this.backoff(i);continue}this.log?.("warn","SCREENSHOT_UPLOAD_FAILED","Screenshot upload failed (network error)",{operation_id:t.operationId,error:"network",attempts:this.maxRetries+1})}}backoff(t){let r=t===0?1e3:3e3;return new Promise(n=>setTimeout(n,r))}getExt(t){return this.uploadedExt.get(t)??"png"}getExtMap(){return this.uploadedExt}isNearExpiry(){if(!this.sas.expiry)return!1;let t=new Date(this.sas.expiry).getTime();return Date.now()>t-5*6e4}};var Le=class{config;buffer=[];stepBuffer=new Map;flushTimer=null;currentRunIndex=null;stopped=!1;_droppedBatches=0;_droppedEntries=0;constructor(t){this.config=t}start(){if(this.flushTimer)return;let t=this.config.flushIntervalMs??5e3;this.flushTimer=setInterval(()=>{this.flush().catch(()=>{})},t),this.flushTimer.unref&&this.flushTimer.unref()}setRunIndex(t){this.currentRunIndex=t}log(t,r,n,s={}){if(this.stopped)return;let o=this.buildEntry(t,r,n,s);this.buffer.push(o)}logStep(t,r,n,s={}){if(this.stopped)return;let o=this.buildEntry("debug",r,n,s);o.run_index=t,this.stepBuffer.has(t)||this.stepBuffer.set(t,[]),this.stepBuffer.get(t).push(o)}escalate(t){let r=this.stepBuffer.get(t);r&&r.length>0&&this.buffer.push(...r),this.stepBuffer.delete(t)}discardSteps(t){this.stepBuffer.delete(t)}async flush(){if(this.buffer.length===0)return;let t=this.buffer.splice(0),r=null;try{r=await this.config.getToken()}catch{this.buffer.unshift(...t);return}let n={"Content-Type":"application/json"};r&&(n.Authorization=`Bearer ${r}`);let s=JSON.stringify(t);for(let o=0;o<3;o++){try{let a=new AbortController,m=setTimeout(()=>a.abort(),1e4),i=await N(this.config.proxyUrl,{method:"POST",headers:n,body:s,signal:a.signal});if(clearTimeout(m),i.ok)return}catch{}o<2&&await new Promise(a=>setTimeout(a,1e3*Math.pow(2,o)))}this._droppedBatches++,this._droppedEntries+=t.length}get droppedBatches(){return this._droppedBatches}get droppedEntries(){return this._droppedEntries}async shutdown(){this._droppedBatches>0&&this.log("warn","LOG_DROPS",`Dropped ${this._droppedEntries} entries in ${this._droppedBatches} batches`,{dropped_batches:this._droppedBatches,dropped_entries:this._droppedEntries}),this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null),await this.flush()}shutdownSync(){this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null)}get bufferSize(){return this.buffer.length}stepBufferSize(t){return this.stepBuffer.get(t)?.length??0}buildEntry(t,r,n,s){return{hostname:"kane-cli",service:"kane-cli",ddsource:"kane-cli",ddtags:`version:${this.config.device.cli_version}`,level:t,event:r,message:n,session_id:this.config.sessionId,run_index:r.startsWith("tcg_")?null:this.currentRunIndex,identity:this.config.identity,device:this.config.device,context:s,timestamp:new Date().toISOString()}}};import{platform as lo,arch as co}from"os";function Kt(e=process.env){try{let t=e.KANE_CLI_USER_AGENT;return t&&t.trim()?ao(t):e.CLAUDECODE==="1"||e.CLAUDE_CODE_ENTRYPOINT?"claude-code":e.CURSOR_TRACE_ID||e.TERM_PROGRAM==="cursor"?"cursor":e.TERM_PROGRAM==="vscode"||e.VSCODE_PID?"vscode":e.CI==="true"||e.GITHUB_ACTIONS==="true"||e.GITLAB_CI==="true"||e.CIRCLECI==="true"||e.BUILDKITE==="true"?"ci":"unknown"}catch{return"unknown"}}function ao(e){return e.toLowerCase().replace(/[^a-z0-9_-]/g,"-").slice(0,40)}function Zn(e){let t={proxyUrl:Rr,sessionId:e.sessionId,identity:e.identity,device:{cli_version:Be,platform:lo(),arch:co(),host_agent:Kt(),invocation_mode:e.invocationMode},getToken:e.getToken};return new Le(t)}import{execSync as uo}from"child_process";import{readFileSync as mo}from"fs";import{createHash as po}from"crypto";import{hostname as fo,platform as go,arch as ho}from"os";var st=null;function Xn(){return st||(st=bo(),st)}function bo(){let e=go();if(e==="darwin")try{let n=uo("ioreg -rd1 -c IOPlatformExpertDevice",{encoding:"utf-8",timeout:5e3}).match(/"IOPlatformUUID"\s*=\s*"([^"]+)"/);if(n?.[1])return n[1]}catch{}if(e==="linux")try{let r=mo("/etc/machine-id","utf-8").trim();if(r)return r}catch{}let t=`${fo()}:${e}:${ho()}`;return po("sha256").update(t).digest("hex").slice(0,32)}async function yo(e){try{let t=X(e.env),n=await new Ie(t.controllerBaseUrl,e.auth).getScreenshotSas();return e.session.setScreenshotSas(n),e.log("info","SCREENSHOT_SAS_OK","Screenshot SAS fetched",{base_url:n.base_url,container:n.container,expiry:n.expiry}),new nt(n,3,e.log)}catch(t){return e.log("warn","SCREENSHOT_SAS_FAIL","Screenshot SAS fetch failed",{error:t instanceof Error?t.message:String(t)}),null}}async function vo(e){if(e.session.hasRemoteLogger||!e.tmsCreds)return null;let t=e.tmsCreds,r=Zn({sessionId:e.session.sessionId,identity:{org_id:String(t.org_id??""),user_id:String(t.user_id??""),machine_id:Xn(),email:t.email??null,email_domain:t.email_domain??"unknown",user_type:t.user_type??"unknown",env:e.env,plan:t.plan??"unknown"},invocationMode:e.invocationMode,getToken:e.getToken});return e.session.setRemoteLogger(r),r.start(),r}async function Wt(e){let[t,r]=await Promise.allSettled([e.skipScreenshotQueue?Promise.resolve(null):yo({env:e.env,auth:e.auth,session:e.session,log:e.log}),vo({env:e.env,tmsCreds:e.tmsCreds,getToken:e.getToken,session:e.session,invocationMode:e.invocationMode})]);return{resolver:e.resolver,screenshotQueue:t.status==="fulfilled"?t.value:null,remoteLogger:r.status==="fulfilled"?r.value:null}}async function qt(e){await Promise.allSettled([e.screenshotQueue?.drain(),e.remoteLogger?.shutdown()])}async function Ma(e,t){switch(e.kind){case"boot":{if(t.state.identityServicesRef.current)return t.state.identityServicesRef.current;let r=t.auth.initResolver(e.env);r.prime(e.tmsCreds),t.state.setTmsCredsCache(e.tmsCreds);let n=await Gt(e.env,e.tmsCreds,r,t);return zt(n,t),n}case"login":case"switch":{let r=t.state.identityServicesRef.current;r&&(await qt(r),r.resolver.revoke()),t.state.identityServicesRef.current=null,t.state.screenshotQueueRef.current=null,t.state.setTmsCredsCache(null);let n=t.auth.initResolver(e.env),s=await n.resolve(!0).catch(()=>null);if(!s)return t.log("warn","IDENTITY_VALIDATE_FAILED","Identity validation failed",{kind:e.kind,env:e.env}),null;t.state.setTmsCredsCache(s);let o=await Gt(e.env,s,n,t);return zt(o,t),o}case"logout":{let r=t.state.identityServicesRef.current;return r&&(await qt(r),r.resolver.revoke()),t.state.identityServicesRef.current=null,t.state.screenshotQueueRef.current=null,t.state.setTmsCredsCache(null),null}case"resessionize":{let r=t.state.identityServicesRef.current;r&&await qt(r),t.state.identityServicesRef.current=null,t.state.screenshotQueueRef.current=null;let n=t.state.getTmsCredsCache(),s=t.auth.getResolver(),o=s??t.auth.initResolver(e.env);!s&&n&&o.prime(n);let a=await Gt(e.env,n,o,t);return zt(a,t),a}}}async function Gt(e,t,r,n){let s=n.auth.getBasicAuth(),o=s?null:await n.auth.getToken(),a=s?{username:s.username,accessKey:s.access_key}:o??null;return a===null?{resolver:r,screenshotQueue:null,remoteLogger:null}:Wt({env:e,tmsCreds:t,resolver:r,auth:a,getToken:()=>n.auth.getToken(),session:n.getSession(),log:n.log,skipScreenshotQueue:n.options?.skipScreenshotQueue,invocationMode:"tui"})}function zt(e,t){t.state.identityServicesRef.current=e,t.state.screenshotQueueRef.current=e.screenshotQueue,e.remoteLogger&&(t.exit.registerCleanup("remote-logger",()=>e.remoteLogger.shutdownSync()),t.exit.setExitRemoteLogger(e.remoteLogger))}import{relative as Ro}from"path";import{readFile as So}from"fs/promises";function es(e){return e.shouldUploadArtifacts&&!e.lockHeld&&!e.isFirstRun&&e.sealed&&!!e.testId}var Yt=e=>e instanceof Error?e.message:String(e);async function ts(e){let{controller:t,tms:r,testId:n,sessionId:s,executionId:o,sealedPackPath:a,projectId:m}=e,i;try{let l={key:"evidence",content_type:"application/zip",filename:`${o}.evidence`},g=(await t.getPresignedUrls(n,s,[l])).urls?.evidence?.upload_url;if(!g)return{ok:!1,stage:"presign",error:"presign response missing evidence upload_url"};i=g}catch(l){return{ok:!1,stage:"presign",error:Yt(l)}}try{let l=await So(a);await $r(i,l,"application/zip")}catch(l){return{ok:!1,stage:"upload",error:Yt(l)}}try{await r.ingestEvidence(o,m)}catch(l){return{ok:!1,stage:"ingest",error:Yt(l)}}return{ok:!0}}function rs(e){return e.isFirstRun||Qe(e.decisions)||e.push===!0||e.author===!0}function ns(e,t){return{projectId:e?.project_id??t.project_id??null,folderId:e?.folder_id??t.folder_id??null}}function Qt(e){return e?"author":"replay"}function wo(e,t){return e?{session:e,ownsLifecycle:!1}:{session:t,ownsLifecycle:!0}}function Jt(e,t){return e?.total_runs??t?.length??1}function _o(e){let t=(e?.per_flow_metadata??[]).map(r=>({resultCode:r?.result_code!=null?Number(r.result_code):null}));return{resultCode:e?.result_code!=null?Number(e.result_code):null,...t.length?{perFlow:t}:{}}}var ot=["target","chrome_profile","cdp_endpoint","ws_endpoint","headless"];async function Nl(e,t,r){let{path:n,cwd:s,opts:o,isAgent:a,disableAskUser:m,resolved:i,resolvedAuth:l,cliOverrides:b,environment:g,envConfig:_,profile:R,model:k,creds:w,configStore:x,session:c}=e,j=!1,f=await Eo(n,i,o,{resolvedAuth:l,tmsBaseUrl:_.tmsBaseUrl},c.sessionId,r);if(f.abort)return{overallStatus:"failed",exitCode:f.abort.exitCode,outputDir:ne(n),durationS:0,uploadResult:null};let I=f.lockAcquired,L=!1,Y=!1,Q=!1;I&&t.onLockState({phase:"acquired",scope:"preemptive"}),c.start({model:k,environment:g,profile:R}),c.setRecordingEnabled(!1);let de=0,Oe=l.basicAuth?{username:l.basicAuth.username,accessKey:l.basicAuth.access_key}:l.token??null,we=null;if(Oe!==null){let d=await Wt({env:g,tmsCreds:l.resolvedCreds??null,resolver:l.resolver,auth:Oe,getToken:async()=>l.token??null,session:c,log:(u,v,p,y)=>c.log(u,v,p,y),skipScreenshotQueue:!!o.local||!l.basicAuth,invocationMode:a?"agent":"cli"});we=d.screenshotQueue,d.remoteLogger&&(r.register("remote-logger",()=>d.remoteLogger.shutdownSync()),r.remoteLogger=d.remoteLogger,e.skipGlobalRemoteLogger||_r(d.remoteLogger))}if(o.name){try{qr(o.name)}catch(d){return process.stderr.write(`error: ${d.message}
|
|
24
|
-
`),{overallStatus:"failed",exitCode:2,outputDir:ne(n),durationS:0,uploadResult:null}}c.setSessionName(o.name)}let lt={};for(let[d,u]of Object.entries(i.rootGlobal))ot.includes(d)||(lt[d]=u);for(let[d,u]of Object.entries(b))ot.includes(d)||u!==void 0&&(lt[d]=u);let Z={...i.chrome};for(let d of ot){let u=b[d];u!==void 0&&(Z[d]=u)}let cs={...lt,...Z};c.setResolvedGlobal(cs);let Zt=w.getActiveProfile()??"default",Xt=w.getDefaultEnv(),{rehydrateIfStale:ds}=await import("./profile-sync-DTTRRIVP.js");ds(w,x,Zt,Xt);let U=x.load(),er=(b.assertion_mode??U.assertion_mode)==="dom"?"dom":"visual",$=U.project_id??null,le=U.folder_id??null,tr=rs({isFirstRun:f.isFirstRun,decisions:f.decisions,push:o.push===!0,author:o.author===!0});if(tr){if(l.basicAuth){let d=await Er({creds:w,config:x,profile:Zt,env:Xt,tmsCreds:l.basicAuth,isLocal:!!o.local,log:(u,v,p,y)=>c.log(u,v,p,y),onAnnounce:e.onAnnounce,onFatalExit:e.onFatalExit});if(d.status==="ok"){$=d.projectId,le=d.folderId,U=x.load();let u=We(n);u?.project_id&&($=u.project_id,le=u.folder_id??le),a&&d.autoDefaulted&&t.onAgentEvent(Cr(d.autoDefaulted))}else if(d.status==="cancelled"){process.stderr.write(`error: project/folder configuration failed. See remediation above, or use --local.
|
|
25
|
-
`);let{shutdown:u}=await import("./exit-manager-IUHAXFJ6.js");return u(2,"project/folder gate failed"),{}}}}else{let d=We(n);({projectId:$,folderId:le}=ns(d,{project_id:U.project_id??null,folder_id:U.folder_id??null})),c.log("info","GATE_SKIP_REPLAY","Project/folder gate skipped (planned pure replay)",{meta_project:!!d?.project_id,config_project:!!U.project_id})}let se;try{se=await Dn({config:{chrome_profile_path:Z.chrome_profile??null,window_size:{width:1920,height:1080}},startUrl:Ve,headless:Z.headless??!1,wsEndpoint:Z.ws_endpoint,cdpEndpoint:Z.cdp_endpoint})}catch(d){return process.stderr.write(`error: Chrome launch failed: ${d.message}
|
|
26
|
-
`),await c.finish("complete"),{overallStatus:"failed",exitCode:2,outputDir:ne(n),durationS:0,uploadResult:null}}let je=se.instance;je&&r.register("chrome",()=>{try{je.kill()}catch{}});let rr=Lr(se.cdpEndpoint),q=null,nr=se.cdpEndpoint??Z.cdp_endpoint;if(nr&&!Z.ws_endpoint&&!Z.headless&&!e.isAgent)try{q=In({headless:Z.headless??!1,cdpEndpoint:nr,chromePid:je?.process.pid}),q&&r.register("marker-overlay",()=>q.kill())}catch(d){c.log("warn","OVERLAY_SPAWN_FAILED","Marker overlay spawn failed",{error:String(d)})}l.resolvedCreds?.org_id!==void 0&&c.setOrgId(String(l.resolvedCreds.org_id)),c.setUserIdentity(l.resolvedCreds?.username??null,l.resolvedCreds?.email??null);let ue=Bn({objective:"",globalDir:ae(St,"variables"),localDir:ae(s,".testmuai","variables"),file:o.variablesFile,inline:o.variables}),us=i.rootGlobal.variables??{},J=Io(ue.raw,us);c.setAuteurVariables(J.auteur);let sr=Ht(ae(St,"global-memory.md"))??void 0,or=Ht(ae(s,".testmuai","context.md"))??void 0;o.local?process.stderr.write(`info: --local \u2014 KaneAI upload skipped
|
|
27
|
-
`):l.basicAuth?$||(tr?process.stderr.write(`warn: KaneAI upload skipped \u2014 no project configured.
|
|
28
|
-
`):process.stderr.write(`warn: evidence publish will be skipped \u2014 no project_id in meta.json or config.
|
|
29
|
-
`)):process.stderr.write(`warn: KaneAI upload skipped \u2014 TMS credentials could not be resolved.
|
|
30
|
-
Run 'kane-cli login' (OAuth) or 'kane-cli config set-username/set-access-key' (basic auth).
|
|
31
|
-
`);let ge=!o.local&&!!l.basicAuth&&$!=null;if(c.log("info","PIPELINE_GATE_STATE","Initial gate state (run-start)",{phase:"run-start",shouldUploadArtifacts:ge,lockHeld:I,isFirstRun:f.isFirstRun,hasAuth:f.hasAuth}),ge&&f.testId==null){let d=X(g);try{let u=await Jn({tmsBaseUrl:d.tmsBaseUrl,auth:l.basicAuth,objective:i.steps[0].objective,url:"",projectId:$,folderId:le??"",hasCustomProfile:!!Z.chrome_profile,log:(v,p,y,h)=>c.log(v,p,y,h)});u&&c.setTestId(u)}catch(u){process.stderr.write(`warn: ATM test creation failed: ${u.message}
|
|
32
|
-
`)}}else f.testId&&c.setTestId(f.testId);let Ue={};if(l.basicAuth&&!o.local&&(J.secretEntries.length>0||J.nonSecretEntries.length>0))try{Ue=await Vn({variables:J,auth:l.basicAuth,orgId:String(l.resolvedCreds?.org_id??""),env:g,localMode:!!o.local,log:(d,u,v,p)=>c.log(d,u,v,p)})}catch(d){process.stderr.write(`warn: variable/secret push failed: ${d.message}
|
|
33
|
-
`)}let ct=new Map;for(let[d,u]of J.nonSecretEntries)ct.set(d,u.value);let dt=new Map;for(let[d,u]of J.secretEntries)dt.set(d,u.value);async function ut(d){if(!l.basicAuth||o.local)return;let u=[],v=[];for(let[y,h]of Object.entries(d))if(h.secret){if(dt.get(y)===h.value)continue;v.push([y,h])}else{if(ct.get(y)===h.value)continue;u.push([y,h])}if(u.length===0&&v.length===0)return;let p=X(g);if(u.length>0){let y=new Se(p.tmsBaseUrl,l.basicAuth.username,l.basicAuth.access_key);for(let[h,E]of u)try{let P=await y.upsertVariable({name:h,value:E.value});Ue[h]=P.id,ct.set(h,E.value),c.log("info","VAR_PUSH_STEP","Variable updated mid-run",{name:h})}catch(P){c.log("warn","VAR_PUSH_STEP_FAILED","Mid-run variable push failed",{name:h,error:String(P)})}}if(v.length>0){let y=new ve(p.secretsBaseUrl);for(let[h,E]of v)try{await y.pushSecret({secretKey:h,secretValue:E.value,username:l.basicAuth.username,accessKey:l.basicAuth.access_key,orgId:String(l.resolvedCreds?.org_id??"")}),dt.set(h,E.value),c.log("info","SECRET_PUSH_STEP","Secret updated mid-run",{name:h})}catch(P){c.log("warn","SECRET_PUSH_STEP_FAILED","Mid-run secret push failed",{name:h,error:String(P)})}}}let _e=we?(d,u,v,p)=>{if(!(I||f.isFirstRun))return;if(D&&p){bn(D.packTestDir,p,we,(h,E,P,V)=>c.log(h,E,P,V));return}let y=de+u;yn(c.sessionDir,y,d,we,(h,E,P,V)=>c.log(h,E,P,V),v)}:void 0,ir=i.rootTitle??i.rootSteps[0]?.heading??ss(n),ms=Object.keys(J.raw).length>0?he(J.raw,ir).objective:ir,me=Rn({flag:o.url,frontmatter:i.rootGlobal?.url,configDefault:x.load().default_url}),ps=wn({resolvedUrl:me,local:!!o.local,allowMissingUrl:!!o.allowMissingUrl,isTTY:!!process.stdin.isTTY});c.setFirstRun(ms,me??"");let ce=new Xe(i),Fe=new Date().toISOString(),ar=Date.now(),mt=e.evidenceAttach?null:new Or({origin:"testmd",runKind:"author",pid:process.pid,title:i.rootTitle??ss(n),started:Fe,producerVersion:Be,surfaces:me?[me]:void 0,testmdRelPath:Ro(s,n),definition:{path:"test.md",content:as(n,"utf8")},cwd:s,packRootDir:ae(c.sessionDir,"evidence")}),oe=wo(e.evidenceAttach,mt),te=oe.session,D=null;if(e.evidenceAttach)D={executionId:e.evidenceAttach.id,testId:e.evidenceAttach.test,packTestDir:e.evidenceAttach.packTestDir};else if(mt)try{D=await mt.start()}catch(d){c.log("warn","EVIDENCE_START_FAILED","Evidence pack creation failed",{error:String(d)})}let Ne=[],pt=[],lr,ft=(d,u,v,p)=>{if(!D)return;te.noteSpawn(d),d.resolution&&(lr=d.resolution),Ne.push(_o(u));let y=Jt(u,p);for(let h=0;h<y;h++)pt.push(v+h)},gt=()=>D?{packTestDir:D.packTestDir,ordinalOffset:te.nextOrdinalOffset()}:void 0,fs=typeof o.maxSteps=="string"&&o.maxSteps!==""?parseInt(o.maxSteps,10):void 0;function cr(d,u){let v=i.steps[d],p=is(v.config,b),y=Re(ue.raw,p.variables,v.objective);return Ln({objective:y.objective,url:d===0?me??void 0:void 0,requireStartUrl:d===0&&ps,model:k,chrome:se,auth:l,sessionId:c.sessionId,runIndex:u,windowSize:{width:1920,height:1080},maxSteps:p.max_steps??fs??30,headless:Z.headless??!1,disableAskUser:m,variables:Object.keys(y.variables).length>0?y.variables:void 0,globalContext:p.global_context??sr,localContext:p.local_context??or,sessionContext:c.getContext(),bugDetection:o.bugDetection??U.bug_detection,evidence:gt()})}function dr(d){let v=i.steps[d].trace[0].stepIndex,p=i.rootSteps.find(h=>h.index===v);i.steps.slice(0,d).some(h=>h.trace[0].stepIndex===v)||t.onAgentEvent({type:"test_md_step_start",step_index:v,heading:p.heading,ref:p.body.kind==="import_ref"?{kind:"import",label:p.body.path}:null})}function ht(d,u,v,p,y,h){let E=i.steps[d],P=E.trace[0].stepIndex,V=!i.steps.slice(d+1).some(T=>T.trace[0].stepIndex===P),B=v?.status==="passed"?"passed":"failed",O=v?.reason??y??void 0,F=v?.duration??h,C=v?.verdict;if(C&&typeof C=="object"){let T=typeof C.one_liner=="string"?C.one_liner:"",A=typeof C.bug_title=="string"&&C.bug_title?C.bug_title:T;if(A&&B==="failed"){let K=[C.family,C.category].filter(Boolean).join("/"),re=typeof C.confidence=="number"?`, confidence ${C.confidence.toFixed(2)}`:"";O=`${O??"failed"} \u2014 bug verdict: ${A}${K?` [${K}${re}]`:""}`}let S=typeof C.category_proposal=="string"?C.category_proposal:"";S&&B==="failed"&&(O=`${O??"failed"}; category proposal: ${S} \u2014 consider adding to taxonomy`),t.onAgentEvent({type:"test_md_bug_verdict",step_index:E.trace[0].stepIndex,confirmed:C.confirmed===!0,bug_title:A||null,family:C.family??null,category:C.category??null,category_proposal:S||null,severity:C.severity??null,confidence:typeof C.confidence=="number"?C.confidence:null,one_liner:T||null})}let{continueOverall:H}=ce.recordStep(E,{status:B,duration_s:F,reason:O}),z=is(E.config,b),W=Re(ue.raw,z.variables,E.objective).objective;if(v){let T=vn(v,u,p);c.addRunResult(Sn(v,W,u,T),v.total_runs)}else c.addRunResult({index:u,objective:W,status:B,summary:"",context:{memory:{},variables:{},pointer:""}},1);if(V||!H){let T=ce.snapshotOutcomes().find(A=>A.rootStepIndex===P);t.onAgentEvent({type:"test_md_step_end",step_index:P,status:T.status,duration_s:T.duration_s??0,ref_kind:T.refKind??null,inlined_count:T.inlinedCount??null,failed_sub_step_index:T.failedSubStepIndex??null})}return H}let bt=[];async function gs(d){Zr(d,i.steps.length);for(let u=0;u<d;u++){if(j||e.signal?.aborted)return{failedAt:u,cancelled:!0};let v=i.steps[u],p=f.decisions[u];if(p.kind!=="replay")return process.stderr.write(`error: runReplayPhase invoked on a non-replay decision at step ${u}
|
|
34
|
-
`),{failedAt:u,cancelled:!1};let y=c.nextRunIndex();de=y;let h=u===0?me??void 0:void 0,E={width:U.window_size.width,height:U.window_size.height},P=Re(ue.raw,v.config.variables,v.objective),V=jt({step:v,decision:p,chrome:se,auth:l,sessionId:c.sessionId,runIndex:y,sessionDir:c.sessionDir,windowSize:E,forceNavigateUrl:h,sessionContext:c.getContext(),variables:Object.keys(P.variables).length>0?P.variables:void 0,evidence:gt(),investigationAsync:!oe.ownsLifecycle});await ut(P.raw),dr(u);let B=Date.now(),O=null,F=null,C=Ge();try{let T=kt(V,{environment:g});r.register("runner",()=>{(It()||e.signal?.aborted)&&(j=!0);try{T.cancel()}catch{}}),q?.setRunActive(!0);try{for await(let A of T.events){if(t.onAgentEvent(A),C=Ct(C,A),A.type==="step_event"&&A.event==="reasoning"?q?.setStepText(A.detail):A.type==="step_end"&&(A.status==="passed"&&q?.setStepComplete(),_e&&_e(A.index,0,A.child_id,typeof A.ordinal=="number"&&A.id?{ordinal:A.ordinal,id:A.id}:void 0)),A.type==="run_end"){O=A;break}if(A.type==="error"){F=A.message??"runner error";break}}if(!oe.ownsLifecycle&&O?.status==="failed")r.deregister("runner"),bt.push({exited:T.exited.then(()=>{}).catch(()=>{}),cancel:()=>{try{T.cancel()}catch{}}});else try{T.cancel()}catch{}if(!O&&!F){let{code:A}=await T.exited;A!==0&&(F=`runner exited with code ${A}`)}}finally{q?.setRunActive(!1),r.cleanup("runner","Replay step complete")}}catch(T){F=T.message}if(j)return{failedAt:u,cancelled:!0};let H=Math.round((Date.now()-B)/1e3),z=ht(u,y,O,null,F,H);c.recordStepRun({testmdStepIndex:i.steps[u].flatIndex,runIndex:y,totalRunDirs:1}),ft(C,O,y);let W=!!F||O?.status==="failed";if(Xr(u,W?"failed":"ok"),W||!z)return{failedAt:u,cancelled:!1}}return{failedAt:null,cancelled:!1}}let ur=async()=>{if(I)return!0;let d=l.basicAuth;if(!d){let y=await l.resolver.resolve(!0);y?.username&&y?.access_key&&(d={username:y.username,access_key:y.access_key},l.basicAuth=d)}if(!f.testId||!f.fromCommitId||!d)return process.stderr.write(`error: cannot acquire lock \u2014 missing required state
|
|
35
|
-
`),!1;let u=c.sessionId,v=o.onLockConflict??i.rootGlobal.on_lock_conflict??"readonly",p=await ls({tmsBaseUrl:_.tmsBaseUrl,testId:f.testId,fromCommitId:f.fromCommitId,newCommitId:u,basicAuth:d,onLockConflict:v});return p==="ok"?(I=!0,f.newCommitId=u,c.log("info","MID_RUN_LOCK_ACQUIRED","Mid-run lock acquired",{test_id:f.testId}),a&&t.onLockState({phase:"acquired",scope:"mid_run"}),Mt({baseUrl:it(_.tmsBaseUrl),testId:f.testId,auth:at(d),lifecycle:r}),!0):(c.log("error","MID_RUN_LOCK_CONFLICT","Mid-run lock acquisition failed",{reason:p}),a&&t.onLockState({phase:"conflict",scope:"mid_run",reason:p}),process.stderr.write(`error: mid-run lock acquisition failed (${p})
|
|
36
|
-
`),!1)};if(a){let d=o.author===!0;d&&(Ot(),c.log("info","FORCE_AUTHOR_RUN","--author flag set; walker bypassed"));let{authorBoundary:u,cancelledInPhase:v,shrinkCount:p}=await sn({decisions:f.decisions,forceAuthor:d,hasRetry:o.retry===!0||o.retryCount!==void 0,maxShrinks:o.retryCount!==void 0?parseInt(o.retryCount,10):Ae.maxShrinks,runReplayPhase:gs,session:c,accumulator:ce,acquireLockIfNeeded:ur});if(Q=p>0,p>0&&(c.log("info","RETRY_TRIGGERED","Retry loop triggered",{shrink_count:p,final_author_boundary:u}),t.onRetryAttempt({shrink_count:p,final_author_boundary:u,complete_reauthor:u===0})),u===0&&p>0&&c.log("info","COMPLETE_REAUTHOR_TRIGGERED","Complete reauthor fallback",{shrink_count:p}),!v&&u>=0)for(let y=u;y<i.steps.length&&!e.signal?.aborted;y++){let h=i.steps[y];if(!ce.shouldRunFlatStep(h))continue;dr(y),L=!0;let E=c.nextRunIndex();de=E,await ut(Re(ue.raw,h.config.variables,h.objective).raw);let P=cr(y,E),V=Date.now(),B=null,O=null,F=null,C=!1,H=0,z=Ge();try{let A=kt(P,{environment:g,assertionMode:er});r.register("runner",()=>{(It()||e.signal?.aborted)&&(j=!0);try{A.cancel()}catch{}}),q?.setRunActive(!0);try{for await(let S of A.events){if(t.onAgentEvent(S),z=Ct(z,S),S.type==="bifurcation"){let K=S.count??S.flows?.length??0;(S.is_single_flow??K<=1)||(F=S.flows??null,C=!0,H=0)}else if(S.type==="run_start"&&C)H++;else if(S.type==="step_event"&&S.event==="reasoning")q?.setStepText(S.detail);else if(S.type==="step_end"&&(S.status==="passed"&&q?.setStepComplete(),_e)){let K=C?Math.max(0,H-1):0;_e(S.index,K,S.child_id,typeof S.ordinal=="number"&&S.id?{ordinal:S.ordinal,id:S.id}:void 0)}if(S.type==="run_end"){B=S;break}if(S.type==="error"){O=S.message??"runner error";break}}try{A.cancel()}catch{}}finally{q?.setRunActive(!1),r.cleanup("runner","Step complete")}}catch(A){O=A.message}let W=Math.round((Date.now()-V)/1e3),T=ht(y,E,B,F,O,W);if(c.recordStepRun({testmdStepIndex:i.steps[y].flatIndex,runIndex:E,totalRunDirs:Jt(B,F)}),ft(z,B,E,F),!T||j||e.signal?.aborted)break}}else{let{effectiveDecisions:d}=await import("./effective-decisions-DRM3JSR4.js"),{decideRetry:u}=await import("./replay-policy-6USQBT3E.js"),v=o.retry===!0||o.retryCount!==void 0,p=o.retryCount!==void 0?parseInt(o.retryCount,10):Ae.maxShrinks,y=o.author===!0;y&&(Ot(),c.log("info","FORCE_AUTHOR_RUN","--author flag set; walker bypassed"));let h=y?0:Je(f.decisions),E=0,P=null,V=f.decisions.filter(C=>C.kind==="replay").length,B=f.decisions.length-V,O=[];o.push&&O.push("--push"),v&&O.push("--retry"),o.retryCount!==void 0&&O.push(`--retry-count=${o.retryCount}`),y&&O.push("--author");let F={source:n,steps:{total:f.decisions.length,replay:V,author:B},model:k,viewport:{width:U.window_size.width,height:U.window_size.height},chrome:se.cdpEndpoint??se.wsEndpoint??"managed",session:c.sessionName??"ephemeral",variables:{count:Object.keys(J.raw).length,secrets:Object.values(J.raw).filter(C=>C.secret).length,names:Object.keys(J.raw)},flags:O,mode:b.mode??"testing"};for(;;){let C=c.snapshot(),H=ce.snapshot(),z=d(f.decisions,h,y);if(E>=1){let S=h===0?`\u21BB Complete re-author \u2014 retry budget exhausted (${E}/${p})`:`\u21BB Retry ${E}/${p} \u2014 replay 0..${h-1}, author ${h}..${f.decisions.length-1}
|
|
37
|
-
reason: replay miss at step ${(P??0)+1}`;process.stderr.write(S+`
|
|
38
|
-
`)}let W=E>=1&&h>0&&P!==null?{startIdx:0,endIdx:P,count:P}:void 0;q?.setRunActive(!0);let T=await Po({decisions:z,resolved:i,session:c,accumulator:ce,tuiConfig:U,globalConfig:F,buildStepConfigAt:cr,buildReplayConfig:S=>{let K=f.decisions[S];if(K.kind!=="replay")throw new Error("expected replay decision at index "+S);let re=i.steps[S];return jt({step:re,decision:K,chrome:se,auth:l,sessionId:c.sessionId,runIndex:c.nextRunIndex(),sessionDir:c.sessionDir,windowSize:{width:U.window_size.width,height:U.window_size.height},forceNavigateUrl:S===0?me??void 0:void 0,sessionContext:c.getContext(),variables:ko(ue.raw,re.config.variables,re.objective),evidence:gt()})},onAnyAuthorStep:()=>{L=!0},onCancel:()=>{Y=!0},topBannerModel:k,topBannerAuth:`${w.getActiveProfile()??"no profile"}/${g}`,spawnOpts:{environment:g,mode:b.mode??"testing",assertionMode:er,log:(S,K,re,vt)=>c.log(S,K,re,vt)},priorAttemptRollup:W,pushStepLevelDelta:(S,K)=>ut(Re(ue.raw,S,K).raw),onSequencerStepEnd:(S,K,re,vt)=>{let vs=Math.round((Date.now()-vt)/1e3),Ss=S.hadError?S.reason??"runner error":null,Rs=ht(K,re,S.runEnd,S.bifurcationFlows??null,Ss,vs);return c.recordStepRun({testmdStepIndex:i.steps[K].flatIndex,runIndex:re,totalRunDirs:Jt(S.runEnd,S.bifurcationFlows)}),ft(S.evidence??Ge(),S.runEnd,re,S.bifurcationFlows),Rs},screenshotDispatcher:_e,onReasoning:S=>q?.setStepText(S),onStepComplete:()=>q?.setStepComplete(),onSpawnStart:S=>{de=S},host:t});if(q?.setRunActive(!1),T.cancelled){r.cleanup("marker-overlay","user cancelled run"),r.cleanup("chrome","user cancelled run");break}if(T.failedAt===null)break;let A=u({failedAt:T.failedAt,shrinkCount:E,hasRetry:v,maxShrinks:p});if(A.kind==="fail"||!I&&!await ur())break;c.rollback(C),ce.rollback(H),A.kind==="complete-reauthor"?h=0:h=A.newAuthorBoundary,E++,Q=!0,c.log("info","RETRY_TRIGGERED","Retry loop triggered (TTY)",{shrink_count:E,failed_at:P}),h===0&&c.log("info","COMPLETE_REAUTHOR_TRIGGERED","Complete reauthor fallback (TTY)",{shrink_count:E}),P=T.failedAt}}let G=ce.finalize(),pe=Math.round((Date.now()-ar)/1e3),hs={session:c,resolvedAuth:l,chromeResult:se,chromeInstance:je??null,testId:c.testId??null,preparedVariables:J,variableIds:Ue,globalContext:sr,localContext:or,tuiConfig:U,env:g,localMode:!!o.local},mr=!1,pr=!1,fr=async(d={})=>{if(!D)return!1;if(oe.ownsLifecycle?mr:pr)return!0;try{let u=await rr(),v=Qt(L)==="replay",p=ae(ne(n),".internal","execution.json"),y=ae(c.sessionDir,"execution.json"),h=jr(D.packTestDir,v?[p,y]:[y,p],(C,H,z,W)=>c.log(C,H,z,W)),{ids:E,linear:P}=h?Fr(D.packTestDir):{ids:[],linear:!0},{steps:V,tail:B,unjoined:O}=Ur(te.steps,E,v,P);h?O?c.log("warn","SKIPPED_TAIL_UNJOINED","Executed records don't align with the authored blob \u2014 skipped tail withheld",{executed:te.steps.length,leaves:E.length}):B.length>0&&c.log("info","SKIPPED_TAIL_APPENDED","Unexecuted authored actions recorded as skipped",{count:B.length}):c.log("warn","SKIPPED_TAIL_NO_BLOB","No auteur blob in pack \u2014 unexecuted actions cannot be recorded as skipped",{});let F=await te.writeResult({steps:[...V,...B],spawns:Ne.length?Ne:[{resultCode:null}],tags:i.rootGlobal.tags,externalIdInput:{execution_id:D.executionId,session_id:c.sessionId,commit_id:c.sessionId,test_id:f.testId??c.testId??void 0,testcase_id:d.testcaseId??f.testcaseId??c.testcaseId??void 0,project_id:$??void 0,folder_id:le??void 0,org_id:c.orgId!=null?String(c.orgId):void 0,session_name:c.sessionName??ke(n),user_name:c.userName??void 0,user_email:c.userEmail??void 0,sharable_link:Cn(X(g).testManagerUiUrl,$,d.testcaseId??f.testcaseId??c.testcaseId,d.shareId)},runnerEnv:Dr({cdpBrowser:u,resolution:lr}),intentEnv:{model:k,platform:"Desktop",platform_type:"web",...oe.ownsLifecycle?{}:{run_kind:Qt(L)}},durationMs:Date.now()-ar,log:(C,H,z,W)=>c.log(C,H,z,W)});return oe.ownsLifecycle?(await Tr({executionId:D.executionId,testId:D.testId,saved:!0,runKind:Qt(L),verdict:F,outputStemDir:ne(n),cwd:s,packDir:te.pack,tuiLogPath:ae(c.sessionDir,"tui.log"),expectStatusDisagrees:(o.bugDetection??U.bug_detection)==="continue",log:(C,H,z,W)=>c.log(C,H,z,W),surface:"testmd"}),mr=!0,c.log("info","EVIDENCE_SEALED","Evidence pack sealed",{execution_id:D.executionId,verdict:F}),!0):(await Pr(te.pack,D.testId,ae(c.sessionDir,"tui.log")),pr=!0,c.log("info","EVIDENCE_RESULT_WRITTEN","Member result.yaml written",{execution_id:D.executionId,verdict:F}),!0)}catch(u){return c.log("warn","EVIDENCE_SEAL_FAILED","Evidence pack seal failed",{error:String(u)}),!1}},yt=ge&&(I||f.isFirstRun),bs=async()=>{if(!l.basicAuth)return null;let d=X(g),u=(L||o.push===!0)&&!Y,v=(I||f.isFirstRun)&&!Y&&G.overallStatus==="passed";c.log("info","PIPELINE_GATE_STATE","Derived gate state (finalize)",{phase:"finalize",shouldUploadArtifacts:ge,shouldUploadPipeline:yt,shouldReplaceLocalOutput:u,shouldCommit:v,lockHeld:I,anyAuthorStepRan:L,cancelled:Y,overallStatus:G.overallStatus});let p=Wn({session:c,env:g,auth:l,variables:J,variableIds:Ue,projectId:$,folderId:le,totalSteps:G.outcomes.length,totalDuration:pe,screenshotExtMap:we?.getExtMap(),codeExport:Qn({codeExport:o.codeExport,codeLanguage:o.codeLanguage,skipCodeValidation:o.skipCodeValidation},U.code_export),onProgress:()=>{},log:(h,E,P,V)=>c.log(h,E,P,V),shouldUploadArtifacts:yt,shouldReplaceLocalOutput:u,shouldCommit:v,isFirstRun:f.isFirstRun,resolvedTest:i,sourcePath:n,stepRunRecords:c.getStepRunRecords(),outcomes:G.outcomes,overallStatus:G.overallStatus,fromCommitId:f.fromCommitId,startedISO:Fe,durationS:pe,tmsIds:{testId:f.testId??c.testId??void 0,testcaseId:f.testcaseId??c.testcaseId??void 0,projectId:$??void 0,folderId:le??void 0,orgId:c.orgId??void 0,sessionName:c.sessionName??ke(n)},tmsBaseUrl:_.tmsBaseUrl,testId:f.testId??void 0,newCommitId:f.newCommitId??void 0,basicAuth:l.basicAuth??void 0,decisions:f.decisions,wantsPush:o.push===!0,retryTriggered:Q,forceAuthor:o.author===!0,evidence:D&&oe.ownsLifecycle?{executionId:D.executionId,packTestDir:D.packTestDir,sealedPackPath:te.pack,cwd:s,runIndices:pt,sealFn:fr}:void 0,evidenceRead:D&&!oe.ownsLifecycle?{packTestDir:D.packTestDir,runIndices:pt}:void 0,authoredExecutionPath:L?void 0:ae(ne(n),".internal","execution.json")});f.newCommitId!=null&&(p.skipTmsFinalize=!0);let y=new zr(p);return a?await y.execute():await t.runUpload(y,h=>{if(h.testcaseId&&h.shareId&&$)return et(d.testManagerUiUrl,$,h.testcaseId,h.shareId)})};D&&await rr();let ie=await Hn(hs,{performUpload:bs,runCleanup:()=>{r.cleanup("chrome","test.md run complete")},log:(d,u,v,p)=>c.log(d,u,v,p)},{overallStatus:G.overallStatus,outcomes:G.outcomes,sourcePath:n,title:i.rootTitle,rootSteps:i.rootSteps,startedISO:Fe,durationS:pe,localMode:!!o.local,skipLocalWrites:!0}),gr=await fr({testcaseId:ie.uploadResult?.testcaseId,shareId:ie.uploadResult?.shareId}),hr=o.evidencePublish===!1,br=oe.ownsLifecycle&&!!D&&!!l.basicAuth&&es({shouldUploadArtifacts:ge,lockHeld:I,isFirstRun:f.isFirstRun,sealed:gr,testId:f.testId});if(br&&hr)c.log("info","EVIDENCE_PUBLISH_SKIPPED","Replay evidence publish skipped (--no-evidence-publish)",{execution_id:D.executionId}),process.stderr.write(`info: evidence publish skipped (--no-evidence-publish)
|
|
39
|
-
`);else if(hr&&(I||f.isFirstRun))process.stderr.write(`note: --no-evidence-publish has no effect on author/commit runs
|
|
40
|
-
`);else if(br){let d=l.basicAuth,u=D,v=$,p=await ts({controller:new Ie(_.controllerBaseUrl,{username:d.username,accessKey:d.access_key}),tms:new Ke(_.tmsBaseUrl,l.resolvedCreds?.username??d.username,l.resolvedCreds?.access_key??d.access_key),testId:f.testId,sessionId:c.sessionId,executionId:u.executionId,sealedPackPath:te.pack,projectId:v});p.ok?c.log("info","EVIDENCE_INGESTED","Replay evidence uploaded and ingested",{execution_id:u.executionId,project_id:v}):(c.log("warn","EVIDENCE_PUBLISH_FAILED","Replay evidence publish failed",{execution_id:u.executionId,stage:p.stage,error:p.error}),process.stderr.write(` \u26A0 evidence publish failed (${p.stage}): ${p.error}
|
|
41
|
-
`)),t.onAgentEvent({type:"test_md_evidence_ingest",status:p.ok?"ok":"failed",evidence_id:u.executionId,...p.ok?{}:{stage:p.stage}})}await Ao(n,f,c,G.outcomes,G.overallStatus,Fe,pe,ie.uploadResult,U,o,{resolvedAuth:l,tmsBaseUrl:_.tmsBaseUrl},I,Y);try{let d=We(n);if(Vr({shouldUploadPipeline:yt,uploadSucceeded:!!ie.uploadResult?.success,metaCommitId:d?.commit_id,metaTestId:d?.test_id})){let u=await Br({sourcePath:n,testId:d.test_id,sessionId:c.sessionId,commitId:d.commit_id,controller:new Ie(_.controllerBaseUrl,{username:l.basicAuth.username,accessKey:l.basicAuth.access_key})});u.ok?c.log("info","BUNDLE_SYNC_OK","testmd bundle pushed",{commit_id:d.commit_id,bytes:u.bytes}):(c.log("warn","BUNDLE_SYNC_FAILED","testmd bundle sync failed",{commit_id:d.commit_id,stage:u.stage,error:u.error}),process.stderr.write(` \u26A0 bundle sync failed (${u.stage}): ${u.error}
|
|
42
|
-
`)),t.onAgentEvent({type:"test_md_bundle_sync",status:u.ok?"ok":"failed",commit_id:d.commit_id,...u.ok?{bytes:u.bytes}:{stage:u.stage}})}}catch(d){c.log("warn","BUNDLE_SYNC_FAILED","testmd bundle sync threw",{error:d instanceof Error?d.message:String(d)})}let yr=X(g),Me=ie.uploadResult?.testcaseId,$e=Me&&ie.uploadResult?.shareId&&$?et(yr.testManagerUiUrl,$,Me,ie.uploadResult.shareId):void 0,vr={overallStatus:G.overallStatus,durationS:pe,decisions:f.decisions,outcomes:G.outcomes,cancelled:Y,retryTriggered:Q,lockHeld:I,anyAuthorStepRan:L,isFirstRun:f.isFirstRun,wantsPush:o.push===!0,uploadResult:ie.uploadResult,shouldUploadArtifacts:ge,shouldReplaceLocalOutput:L&&!Y,shouldCommit:(I||f.isFirstRun)&&!Y&&G.overallStatus==="passed",shareUrl:$e},{buildSummaryEvent:ys}=await import("./SummaryBox-DJUDYML7.js");if(a?t.onAgentEvent(ys(vr)):await t.onSummary(vr),!a){let d=Me&&$?En(yr.testManagerUiUrl,$,Me):void 0;await t.onLinks({recordedTestPath:n,outputDir:ne(n),shareableLink:$e,testCaseLink:d,codeExportDir:ie.uploadResult?.codeExportDir})}if(oe.ownsLifecycle&&te&&gr){let{offerEvidenceView:d}=await import("./evidence-O4AON5FU.js");await d({packPath:te.pack,env:g,isTTY:!a&&!Y&&!!process.stdin.isTTY&&!!process.stderr.isTTY,log:u=>process.stderr.write(u+`
|
|
43
|
-
`)})}return t.onAgentEvent({type:"test_md_done",overall_status:G.overallStatus,duration_s:pe,session_id:c.sessionId,...$e?{share_url:$e}:{}}),{overallStatus:G.overallStatus,exitCode:G.overallStatus==="passed"?0:1,outputDir:ne(n),durationS:pe,uploadResult:ie.uploadResult,anyAuthorStepRan:L,resultCode:xr(Ne),...bt.length?{pendingInvestigations:bt}:{}}}function Io(e,t){let r={...e,...t},n=Object.keys(r).length>0?he(r,""):{variables:{},objective:"",keyMap:{}};return{raw:r,auteur:n.variables,auteurObjective:"",secretEntries:Object.entries(r).filter(([,s])=>s.secret),nonSecretEntries:Object.entries(r).filter(([,s])=>!s.secret)}}function Re(e,t,r){let n={...e,...t??{}};if(Object.keys(n).length===0)return{raw:n,variables:{},objective:r};let s=he(n,r);return{raw:n,variables:$n(s.variables,s.objective),objective:s.objective}}function ko(e,t,r){let n=Re(e,t,r).variables;return Object.keys(n).length>0?n:void 0}function is(e,t){let r=new Set(ot),n={...e};for(let[s,o]of Object.entries(t))r.has(s)||s!=="variables"&&o!==void 0&&e[s]===void 0&&(n[s]=o);return n}function Co(e,t){return e.length<=t?e:e.slice(0,t-1)+"\u2026"}async function Eo(e,t,r,n,s,o){let a=Nr(e),m=Yr(t,os(a)?a:null);Jr(t,m);let i=Ce(e),l=os(i)?JSON.parse(as(i,"utf8")):null,b=l?.testcase_id,g=l?.test_id,_=l?.commit_id,R=r.push===!0,k=r.retry===!0||r.retryCount!==void 0,w=r.author===!0;R&&!b&&process.stderr.write(`[--push] no meta.json yet \u2014 flag is a no-op on first run
|
|
44
|
-
`),w&&(b=void 0,g=void 0,_=void 0);let x=n.resolvedAuth.basicAuth;if(!x){let Q=await n.resolvedAuth.resolver.resolve(!0);Q?.username&&Q?.access_key&&(x={username:Q.username,access_key:Q.access_key},n.resolvedAuth.basicAuth=x)}let c=!!x,j=!r.local&&c&&g!=null&&_!=null&&b!=null,f=j&&(Qe(m)||R);if(R&&!j)return process.stderr.write(`error: --push requires authenticated credentials for the lock API. Run 'kane-cli login' (OAuth) or pass --username/--access-key inline.
|
|
45
|
-
`),{resolved:t,decisions:m,testId:g,testcaseId:b,fromCommitId:_,newCommitId:null,isFirstRun:!1,hasAuth:c,canLock:j,lockAcquired:!1,abort:{exitCode:2}};if(k&&!j)return process.stderr.write(`error: --retry requires authenticated credentials for the lock API. Run 'kane-cli login' (OAuth) or pass --username/--access-key inline.
|
|
46
|
-
`),{resolved:t,decisions:m,testId:g,testcaseId:b,fromCommitId:_,newCommitId:null,isFirstRun:!1,hasAuth:c,canLock:j,lockAcquired:!1,abort:{exitCode:2}};if(w&&!c)return process.stderr.write(`error: --author requires authenticated credentials for the TMS API. Run 'kane-cli login' (OAuth) or pass --username/--access-key inline.
|
|
47
|
-
`),{resolved:t,decisions:m,testId:g,testcaseId:b,fromCommitId:_,newCommitId:null,isFirstRun:!1,hasAuth:c,canLock:j,lockAcquired:!1,abort:{exitCode:2}};let I=null,L=!1;if(f){I=s;let Y=r.onLockConflict??t.rootGlobal.on_lock_conflict??"readonly",Q=await ls({tmsBaseUrl:n.tmsBaseUrl,testId:g,fromCommitId:_,newCommitId:I,basicAuth:x,onLockConflict:Y});if(Q==="ok")L=!0,Mt({baseUrl:it(n.tmsBaseUrl),testId:g,auth:at(x),lifecycle:o});else{if(Q==="abort")return{resolved:t,decisions:m,testId:g,testcaseId:b,fromCommitId:_,newCommitId:null,isFirstRun:!1,hasAuth:c,canLock:j,lockAcquired:!1,abort:{exitCode:2}};I=null}}return{resolved:t,decisions:m,testId:g,testcaseId:b,fromCommitId:_,newCommitId:I,isFirstRun:b==null,hasAuth:c,canLock:j,lockAcquired:L}}function it(e){return`${e}/kane-cli/v1`}function at(e){return{username:e.username,accessKey:e.access_key}}async function ls(e){let t=it(e.tmsBaseUrl),r=at(e.basicAuth),n={baseUrl:t,testId:e.testId,fromCommitId:e.fromCommitId,newCommitId:e.newCommitId,auth:r},s=await Ft(n);if(s.ok)return"ok";if(!(s.reason==="concurrent"||s.reason==="base_mismatch"))return process.stderr.write(`[lock] acquire failed: ${s.reason} (HTTP ${s.httpStatus}): ${s.message}
|
|
48
|
-
`),"abort";let a=s.reason==="concurrent"?"concurrent session":"base commit mismatch (pull latest)";if(e.onLockConflict==="fail")return process.stderr.write(`[lock] ${a}; aborting (--on-lock-conflict fail)
|
|
49
|
-
`),"abort";if(e.onLockConflict==="wait"){if(s.reason==="base_mismatch")return process.stderr.write(`[lock] base commit mismatch \u2014 pull latest; aborting
|
|
50
|
-
`),"abort";for(;;){process.stderr.write(`[lock] waiting (concurrent session)...
|
|
51
|
-
`),await new Promise(i=>setTimeout(i,3e4));let m=await Ft(n);if(m.ok)return"ok";if(m.reason!=="concurrent")return process.stderr.write(`[lock] wait drifted to ${m.reason} (HTTP ${m.httpStatus}): ${m.message}; aborting
|
|
52
|
-
`),"abort"}}return process.stderr.write(`[lock] ${a} \u2014 running in readonly mode (no commit)
|
|
53
|
-
`),"readonly"}async function Ao(e,t,r,n,s,o,a,m,i,l,b,g,_){let{decisions:R,testId:k,testcaseId:w,fromCommitId:x,newCommitId:c}=t;if((!(s==="passed")||_)&&g&&k&&x&&c){let f=_?"cancelled":s;process.stderr.write(`[lock] run not committed (${f}); discarding playground lock
|
|
54
|
-
`),await xo(b,k,x,c),$t();return}$t()}async function xo(e,t,r,n){let s=e.resolvedAuth.basicAuth;if(!s){let a=await e.resolvedAuth.resolver.resolve(!0);a?.username&&a?.access_key&&(s={username:a.username,access_key:a.access_key},e.resolvedAuth.basicAuth=s)}if(!s)return;let o=await dn({baseUrl:it(e.tmsBaseUrl),testId:t,body:{commitId:n,fromCommitId:r},auth:at(s)});o.ok||process.stderr.write(`warn: discardLock failed: ${o.reason} (HTTP ${o.httpStatus}): ${o.message}
|
|
55
|
-
`)}async function Po(e){let t=null,r=!1,n=0,s=-1,o=-1,a=0,m=async i=>{if(i&&i.status==="failed")return n>0&&e.decisions[n-1].kind==="replay"&&(t=n-1),null;for(;n<e.decisions.length&&!e.accumulator.shouldRunFlatStep(e.resolved.steps[n]);)n++;if(n>=e.decisions.length)return null;let l=e.decisions[n],b=e.resolved.steps[n],g=n;n++;let _=e.session.nextRunIndex();s=g,o=_,a=Date.now(),e.onSpawnStart?.(_),l.kind==="author"&&e.onAnyAuthorStep(),await e.pushStepLevelDelta(b.config.variables,b.objective);let R=l.kind==="replay"?e.buildReplayConfig(g):e.buildStepConfigAt(g,_),k=l.kind==="replay"?"md5-match":l.reason,w=b.config??{},x={};for(let[c,j]of Object.entries(w))j!=null&&c!=="variables"&&(x[c]=j);return{config:R,banner:{stepLabel:`Step ${g+1}/${e.decisions.length}`,objective:Co(b.objective,100)},mode:l.kind,modeReason:k,perStepOverrides:Object.keys(x).length>0?x:void 0}};return await e.host.runSteps({topBanner:{model:e.topBannerModel,auth:e.topBannerAuth},globalConfig:e.globalConfig,getNextStep:m,onStepEnd:i=>(i.status==="failed"&&s>=0&&e.decisions[s]?.kind==="replay"&&(t=s),e.onSequencerStepEnd(i,s,o,a)),onAllComplete:()=>{},onCancel:()=>{r=!0,e.onCancel()},spawnOpts:e.spawnOpts,priorAttemptRollup:e.priorAttemptRollup,screenshotDispatcher:e.screenshotDispatcher,onReasoning:e.onReasoning,onStepComplete:e.onStepComplete}),{failedAt:t,cancelled:r}}export{vn as a,Sn as b,tt as c,ki as d,Tn as e,In as f,ri as g,bn as h,yn as i,Bt as j,Rn as k,wn as l,et as m,Cn as n,En as o,Dn as p,Ln as q,$n as r,Bn as s,Vn as t,Ht as u,Wn as v,Qn as w,Jn as x,Zn as y,Xn as z,Wt as A,Ma as B,ts as C,Qt as D,Nl as E,Io as F,Re as G,ko as H,is as I};
|
package/dist/chunk-V2GYBVSM.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{x as a}from"./chunk-HFXQU7UZ.js";import{a as c}from"./chunk-HCBYKLMW.js";import{b as u}from"./chunk-C44QQJR4.js";import{a as l}from"./chunk-6YGTRKDT.js";import{e as n}from"./chunk-UR6MHSHU.js";var s=n(l(),1);var o=n(l(),1);function f(r,e){let t=(0,o.useRef)(r);t.current=r,(0,o.useEffect)(()=>{if(e===null)return;let i=setInterval(()=>t.current(),e);return()=>clearInterval(i)},[e])}var p=n(c(),1),m=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function I({active:r=!0}){let[e,t]=(0,s.useState)(0);return f(()=>{t(i=>(i+1)%m.length)},r?80:null),(0,p.jsx)(u,{color:a.orange,children:r?m[e]:"\u25CF"})}export{f as a,I as b};
|
package/dist/chunk-Y44AETOW.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as L}from"./chunk-3FN66LTP.js";import{T as O,V as S}from"./chunk-DJL47DYJ.js";import{e as P,f as R}from"./chunk-7KDNH6JP.js";import{x as s}from"./chunk-HFXQU7UZ.js";import{a as y}from"./chunk-HCBYKLMW.js";import{a as E,b as o,i as h}from"./chunk-C44QQJR4.js";import{a as B}from"./chunk-6YGTRKDT.js";import{e as d}from"./chunk-UR6MHSHU.js";var n=d(B(),1);import{basename as D}from"path";var r=d(y(),1),U="evidence-view-server";function Q({packPath:m,viewerBase:w,onDone:V,openUrl:k}){let[t,a]=(0,n.useState)("ask"),[g,b]=(0,n.useState)(null),[l,p]=(0,n.useState)(null),f=(0,n.useRef)(null),u=(0,n.useRef)(!1),x=async()=>{let e=f.current;f.current=null,e&&(R(U),await e.close())},v=()=>{u.current||(u.current=!0,V())};return h((e,i)=>{u.current||(t==="ask"?e==="y"||e==="Y"?a("starting"):(e==="n"||e==="N"||i.return||i.escape)&&v():t==="serving"&&(e==="q"||e==="Q"||i.escape)&&x().then(v))}),(0,n.useEffect)(()=>{if(t!=="starting")return;let e=!1;return(async()=>{try{let i=D(m),c=await O({packs:new Map([[i,m]]),allowedOrigins:[new URL(w).origin]});if(e){await c.close();return}f.current=c,P(U,()=>{c.close()});let T=S(c.urlFor(i),w);b(T);try{await(k??(q=>L(q)))(T)}catch{p("could not open browser \u2014 open the URL manually")}a("serving")}catch(i){p(`evidence view failed \u2014 ${i.message}`),a("failed")}})(),()=>{e=!0}},[t]),(0,n.useEffect)(()=>{if(t!=="failed")return;let e=setTimeout(v,0);return()=>clearTimeout(e)},[t]),(0,n.useEffect)(()=>()=>{x()},[]),t==="ask"?(0,r.jsxs)(o,{children:["View evidence in browser? ",(0,r.jsx)(o,{color:s.dim,children:"(y/N)"})]}):t==="serving"||t==="starting"?(0,r.jsxs)(E,{flexDirection:"column",children:[g?(0,r.jsxs)(o,{children:["viewer ",(0,r.jsx)(o,{color:s.orange,children:g})]}):(0,r.jsx)(o,{color:s.dim,children:"starting\u2026"}),l?(0,r.jsx)(o,{color:"yellow",children:l}):null,t==="serving"?(0,r.jsx)(o,{color:s.dim,children:"Press q when done"}):null]}):l?(0,r.jsx)(o,{color:"yellow",children:l}):null}export{Q as a};
|
package/dist/chunk-YCNCW4O4.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as a,j as l}from"./chunk-HFXQU7UZ.js";import{readFileSync as g,writeFileSync as o,mkdirSync as i,existsSync as p}from"fs";import{dirname as s}from"path";var n={window_size:{width:1920,height:1080},chrome_profile_path:"",default_url:l,model:"v16-alpha",project_id:null,project_name:null,folder_id:null,folder_name:null,mode:"testing",assertion_mode:"visual",network_ws:!1,network_sse:!1,bug_detection:"off",code_export:{enabled:!0,language:"python",skip_validation:!0},generate:{scenario_limit:2,per_scenario_limit:3,memory_enabled:!1},last_seen_version:"",hints_enabled:!0},c=class{constructor(r=a){this.path=r}exists(){return p(this.path)}load(){try{let r=g(this.path,"utf-8"),e=JSON.parse(r);return{...n,...e,code_export:{...n.code_export,...e.code_export??{}},generate:{...n.generate,...e.generate??{}}}}catch{return{...n,code_export:{...n.code_export},generate:{...n.generate}}}}set(r,e){try{let t=this.load();t[r]=e,i(s(this.path),{recursive:!0}),o(this.path,JSON.stringify(t,null,2)+`
|
|
3
|
-
`)}catch(t){let d=t instanceof Error?t.message:String(t);process.stderr.write(`[config] Failed to save config: ${d}
|
|
4
|
-
`)}}save(r){try{let t={...this.load(),...r};i(s(this.path),{recursive:!0}),o(this.path,JSON.stringify(t,null,2)+`
|
|
5
|
-
`)}catch(e){let t=e instanceof Error?e.message:String(e);process.stderr.write(`[config] Failed to save config: ${t}
|
|
6
|
-
`)}}writeRaw(r){try{i(s(this.path),{recursive:!0}),o(this.path,JSON.stringify(r,null,2)+`
|
|
7
|
-
`)}catch(e){let t=e instanceof Error?e.message:String(e);process.stderr.write(`[config] Failed to save config: ${t}
|
|
8
|
-
`)}}};export{c as a};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{$ as ca,A as D,B as E,C as F,D as G,E as H,F as I,G as J,H as K,I as L,J as M,K as N,L as O,M as P,N as Q,O as R,P as S,Q as T,R as U,S as V,T as W,U as X,V as Y,W as Z,X as _,Y as $,Z as aa,_ as ba,a,aa as da,b,ba as ea,c,ca as fa,d,da as ga,e,ea as ha,f,fa as ia,g,h,i,j,k as n,l as o,m as p,n as q,o as r,p as s,q as t,r as u,s as v,t as w,u as x,v as y,w as z,x as A,y as B,z as C}from"./chunk-DJL47DYJ.js";import{a as k,b as l,c as m}from"./chunk-NFOBDHZK.js";import"./chunk-L5LI2JF4.js";import"./chunk-UOGJUJCF.js";import"./chunk-HFXQU7UZ.js";import"./chunk-UR6MHSHU.js";export{P as EvidenceSession,C as appendExecutionPointer,M as assembleExecutionEnv,i as buildEnvironment,j as buildEvidenceRunConfig,g as buildExternalId,z as buildLogsMetaYaml,y as buildResultYaml,t as buildRunYaml,O as createCdpBrowserCapture,u as createRunningPack,v as createRunningPackRoot,H as declareLogsFromDir,J as diagnostics,x as discardPack,ba as ensureAuteurExecution,N as fetchCdpBrowserString,L as finalizeEvidencePack,U as finalizeInlineEvidence,K as finalizeMemberTestLogs,da as flattenAuteurLeafIds,ca as flattenAuteurLeaves,T as inlineEvidenceBlock,q as listPacks,p as newExecutionId,h as normalizeOs,S as noteInlineSpawn,$ as offerEvidenceView,o as packPath,I as packTestLogsDir,V as parseRange,D as readExecutionPointers,ia as readPackLeafIds,ha as readPackLeaves,s as recoverStore,fa as remapReplayActionIds,r as resolvePack,ga as resolveReplayResultSteps,F as rollupTestStatus,aa as runEvidenceMerge,_ as runEvidenceServe,E as runEvidenceValidate,Q as runStartupRecovery,l as sealPack,w as sealPackById,Z as serveHint,d as shortHash,c as slugify,W as startEvidenceLocalServer,R as startInlineEvidence,n as storeDir,m as sweepStore,ea as synthesizeSkippedTail,f as testIdForInline,e as testIdForTestmd,k as validatePack,a as verdictFromResultCode,X as viewerBaseFor,Y as viewerUrlFor,b as worstOf,G as worstResultCode,B as writeLogsMeta,A as writeResult};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d,e,f,g,h,i}from"./chunk-C4LYBQT3.js";import"./chunk-FPFOW6BS.js";import"./chunk-WAOCHXJ5.js";import"./chunk-7KDNH6JP.js";import"./chunk-2WVKOZ6W.js";import"./chunk-NLCCBXXV.js";import"./chunk-UOGJUJCF.js";import"./chunk-RZ4F3BHX.js";import"./chunk-IECUFWIZ.js";import"./chunk-HFXQU7UZ.js";import"./chunk-UR6MHSHU.js";export{d as emitNdjson,b as filterByName,g as formatAuthResolutionError,c as paginate,a as parsePagination,i as registerListCommands,e as renderTable,f as resolveTmsBasicAuth,h as validateCreateName};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a}from"./chunk-DTM4ZMMJ.js";import"./chunk-3FN66LTP.js";import"./chunk-GEAWRRR7.js";import"./chunk-UOGJUJCF.js";import"./chunk-RZ4F3BHX.js";import"./chunk-IECUFWIZ.js";import"./chunk-HFXQU7UZ.js";import"./chunk-UR6MHSHU.js";export{a as LoginFlow};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c}from"./chunk-54TKNWXF.js";import"./chunk-2YQ6TW77.js";import"./chunk-DJL47DYJ.js";import"./chunk-NFOBDHZK.js";import"./chunk-WAOCHXJ5.js";import"./chunk-L5LI2JF4.js";import"./chunk-2WVKOZ6W.js";import"./chunk-NLCCBXXV.js";import"./chunk-UOGJUJCF.js";import"./chunk-RZ4F3BHX.js";import"./chunk-HFXQU7UZ.js";import"./chunk-UR6MHSHU.js";export{c as UploadPipeline,b as packPresignEntry,a as readPackForUpload};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as A}from"./chunk-I4B2KY4X.js";import{E as M,F as K,G as H,H as V,I as Y}from"./chunk-QCEWUUE6.js";import{a as k,b as L}from"./chunk-J75KVNX5.js";import{a as h,b as E}from"./chunk-TPG2T5GH.js";import"./chunk-P5XBCJYQ.js";import{o as _}from"./chunk-Q2I65L2W.js";import"./chunk-C5UNZ6ZY.js";import"./chunk-S3DAAAE5.js";import"./chunk-54TKNWXF.js";import"./chunk-2YQ6TW77.js";import"./chunk-DJL47DYJ.js";import"./chunk-NFOBDHZK.js";import{c as R}from"./chunk-T4PKTWZ6.js";import{a as x}from"./chunk-YCNCW4O4.js";import"./chunk-FPFOW6BS.js";import"./chunk-WAOCHXJ5.js";import"./chunk-L5LI2JF4.js";import"./chunk-PISZLYS5.js";import"./chunk-NAYAVVTP.js";import{e as b,f as T,g as S}from"./chunk-7KDNH6JP.js";import"./chunk-QO6PAA7Q.js";import"./chunk-2WVKOZ6W.js";import"./chunk-NLCCBXXV.js";import"./chunk-VE3SUJMA.js";import"./chunk-4IOOBSNB.js";import"./chunk-GEAWRRR7.js";import{a as C}from"./chunk-UOGJUJCF.js";import"./chunk-RZ4F3BHX.js";import"./chunk-E47GFYXA.js";import{a as v}from"./chunk-IECUFWIZ.js";import"./chunk-HFXQU7UZ.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";import{resolve as U}from"path";import{existsSync as D}from"fs";function O(){return{register:(n,r)=>b(n,r),deregister:n=>T(n),cleanup:(n,r)=>S(n,r),remoteLogger:null}}async function le(n,r){let t=U(n);if(!D(t))return process.stderr.write(`error: file not found: ${t}
|
|
3
|
-
`),2;k(t);let i=!process.stdin.isTTY||!!r.agent,c=O(),a;try{a=_(t)}catch(e){return process.stderr.write(`error: ${e.message}
|
|
4
|
-
`),2}if(a.steps.length===0)return process.stderr.write(`info: no steps in ${t}; nothing to run.
|
|
5
|
-
`),0;let s;try{s=G(r)}catch(e){if(e instanceof m)return process.stderr.write(e.message),e.exitCode;throw e}let o=new v,l=new x,u=!!(r.username&&r.accessKey);await L({isInteractive:!!process.stdin.isTTY&&!r.agent&&!u,creds:o,config:l});let I=o.getActiveProfile()??"default",f=r.env??void 0??o.getDefaultEnv()??"prod",N=C(f),j="v16-alpha",p;try{p=await E({creds:o,env:f,usernameFlag:r.username,accessKeyFlag:r.accessKey,log:()=>{}})}catch(e){return e instanceof h&&e.code==="not_authenticated"?process.stderr.write(`error: Not authenticated. Choose one:
|
|
6
|
-
\u2022 Pass credentials inline: --username <user> --access-key <key>
|
|
7
|
-
\u2022 Run 'kane-cli login --oauth' (browser-based)
|
|
8
|
-
\u2022 Run 'kane-cli login --username <user> --access-key <key>'
|
|
9
|
-
`):e instanceof h&&e.code==="refresh_failed"?process.stderr.write(`error: Token refresh failed. Run 'kane-cli login' to re-authenticate.
|
|
10
|
-
`):process.stderr.write(`error: auth resolution failed: ${e.message}
|
|
11
|
-
`),2}let y=String(p.resolvedCreds?.org_id??"");if(!y)return process.stderr.write("error: TMS did not return an org_id. Run `kane-cli login` again.\n"),2;{let{readMetaIfExists:e,assertOrgMatchOrExit:g}=await import("./testmd-actions-4QLHD74A.js"),d=g(e(t),y);if(d!==null)return d}let w=new R,F=A({isAgent:i,log:(e,g,d,$)=>w.log(e,g,d,$)}),P={path:t,cwd:process.cwd(),opts:r,isAgent:i,disableAskUser:!process.stdin.isTTY,resolved:a,resolvedAuth:p,cliOverrides:s,environment:f,envConfig:N,profile:I,model:j,creds:o,configStore:l,session:w};try{return(await M(P,F,c)).exitCode}catch(e){return process.stderr.write(`error: ${e.message}
|
|
12
|
-
`),2}}var m=class extends Error{constructor(t,i){super(t);this.exitCode=i;this.name="CliArgError"}};function G(n){let r={mode:"mode",assertionMode:"assertion_mode",maxSteps:"max_steps",timeout:"timeout",globalContext:"global_context",localContext:"local_context",codeExport:"code_export",codeLanguage:"code_language",headless:"headless",cdpEndpoint:"cdp_endpoint",wsEndpoint:"ws_endpoint"},t=new Set(["max_steps","timeout"]),i={};for(let[c,a]of Object.entries(r)){let s=n[c];if(s===void 0||s==="")continue;let o=s;if(t.has(a)&&(o=Number(s),Number.isNaN(o))){let l="--"+c.replace(/[A-Z]/g,u=>"-"+u.toLowerCase());throw new m(`error: ${l} must be a number
|
|
13
|
-
`,2)}i[a]=o}return i}export{Y as applyCliStepConfig,H as buildStepRunVariables,K as buildTestLevelVariables,V as replayVariablesForStep,le as runTestMdFile};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as a}from"./chunk-MUPHP5W6.js";import"./chunk-3MSXQU2C.js";import"./chunk-PTP3WS3N.js";import"./chunk-7AEC572G.js";import"./chunk-ELBPBHTE.js";import"./chunk-LOQV5GME.js";import"./chunk-THEZSXZM.js";import"./chunk-H6QJ4YU7.js";import"./chunk-NLIOFVMP.js";import"./chunk-QCEWUUE6.js";import"./chunk-J75KVNX5.js";import"./chunk-TPG2T5GH.js";import"./chunk-P5XBCJYQ.js";import"./chunk-Q2I65L2W.js";import"./chunk-C5UNZ6ZY.js";import"./chunk-S3DAAAE5.js";import"./chunk-54TKNWXF.js";import"./chunk-2YQ6TW77.js";import"./chunk-DTM4ZMMJ.js";import"./chunk-Y44AETOW.js";import"./chunk-3FN66LTP.js";import"./chunk-DJL47DYJ.js";import"./chunk-NFOBDHZK.js";import"./chunk-7YRNLGUT.js";import"./chunk-T4PKTWZ6.js";import"./chunk-YCNCW4O4.js";import"./chunk-FPFOW6BS.js";import"./chunk-WAOCHXJ5.js";import"./chunk-L5LI2JF4.js";import"./chunk-AFCEFOIK.js";import"./chunk-V2GYBVSM.js";import"./chunk-PISZLYS5.js";import"./chunk-NAYAVVTP.js";import"./chunk-IU53F4ZV.js";import"./chunk-6E5UYAEB.js";import"./chunk-XDERMCAU.js";import"./chunk-YCCUBQY4.js";import"./chunk-AM5WZPPY.js";import"./chunk-7KDNH6JP.js";import"./chunk-QO6PAA7Q.js";import"./chunk-2WVKOZ6W.js";import"./chunk-NLCCBXXV.js";import"./chunk-VE3SUJMA.js";import"./chunk-4IOOBSNB.js";import"./chunk-GEAWRRR7.js";import"./chunk-UOGJUJCF.js";import"./chunk-RZ4F3BHX.js";import"./chunk-E47GFYXA.js";import"./chunk-IECUFWIZ.js";import"./chunk-ZWAZ4QU4.js";import"./chunk-7IBNOVML.js";import{a as o}from"./chunk-C6S4IEBC.js";import"./chunk-HZ46P2GR.js";import"./chunk-YSIYPC4R.js";import"./chunk-HFXQU7UZ.js";import{a as t}from"./chunk-HCBYKLMW.js";import{c as n}from"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import{e as r}from"./chunk-UR6MHSHU.js";var e=r(t(),1);async function p(i){let c=i.scenarioLimit!==void 0||i.perScenarioLimit!==void 0?{scenarioLimit:i.scenarioLimit,perScenarioLimit:i.perScenarioLimit}:void 0,{waitUntilExit:m}=n((0,e.jsx)(o,{children:(0,e.jsx)(a,{initialChatMode:"generate",initialObjective:i.objective,initialGenerateLimits:c})}),{exitOnCtrlC:!1});await m()}export{p as runGenerate};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{e as a,f as b,g as c,h as d,i as e,j as f,k as g,l as h,m as i,n as j,o as k,p as l,q as m}from"./chunk-ELBPBHTE.js";import"./chunk-J75KVNX5.js";import"./chunk-TPG2T5GH.js";import"./chunk-Q2I65L2W.js";import"./chunk-2YQ6TW77.js";import"./chunk-YCNCW4O4.js";import"./chunk-FPFOW6BS.js";import"./chunk-WAOCHXJ5.js";import"./chunk-L5LI2JF4.js";import"./chunk-AM5WZPPY.js";import"./chunk-7KDNH6JP.js";import"./chunk-NLCCBXXV.js";import"./chunk-4IOOBSNB.js";import"./chunk-GEAWRRR7.js";import"./chunk-UOGJUJCF.js";import"./chunk-RZ4F3BHX.js";import"./chunk-IECUFWIZ.js";import"./chunk-YSIYPC4R.js";import"./chunk-HFXQU7UZ.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{i as ExportError,c as assertOrgMatchOrExit,j as exportTestmd,b as metaMatchesOrg,a as readMetaIfExists,d as resolveCurrentOrgId,l as resolveSyncAuth,h as runDeleteAction,k as runExportAction,e as runListAction,f as runListTui,g as runStatusAction,m as runSyncAction};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a}from"./chunk-4IOOBSNB.js";import"./chunk-GEAWRRR7.js";import"./chunk-UOGJUJCF.js";import"./chunk-RZ4F3BHX.js";import"./chunk-HFXQU7UZ.js";import"./chunk-UR6MHSHU.js";export{a as refreshOAuthToken};
|