@testmuai/kane-cli 0.6.3 → 0.6.6
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/bin/kane-cli.cjs +91 -0
- package/bin/resolve-runtime.cjs +45 -0
- package/dist/ChatSurface-LV3KW6WN.js +8 -0
- package/dist/{ChromeProfilePicker-UUGUMJPI.js → ChromeProfilePicker-6PLUQ5TW.js} +1 -1
- package/dist/{CliFeedbackPrompt-JZWESL7Z.js → CliFeedbackPrompt-I4F56IVK.js} +1 -1
- package/dist/{CliUploadProgress-62U3LAUU.js → CliUploadProgress-ULRSPKY3.js} +1 -1
- package/dist/{ConfigView-WHEFCVHR.js → ConfigView-7NMYALEA.js} +1 -1
- package/dist/EvidenceViewOffer-KQKPTMXA.js +2 -0
- package/dist/{FolderPicker-HJUUHQEI.js → FolderPicker-4IOVDO2P.js} +1 -1
- package/dist/{HelpView-EWHP7LSJ.js → HelpView-SHMVMHNU.js} +1 -1
- package/dist/{InfoBox-GQQJVTI5.js → InfoBox-W2LZVGQS.js} +1 -1
- package/dist/{LinksBox-EWCPAZFN.js → LinksBox-ZS25VTBY.js} +1 -1
- package/dist/{ProfilesView-5FJNQMUW.js → ProfilesView-XBBRIQ3U.js} +1 -1
- package/dist/{ProjectPicker-IN7GFN7I.js → ProjectPicker-AUN47FXS.js} +1 -1
- package/dist/{SaveSessionPrompt-ISODGFP7.js → SaveSessionPrompt-Z2K225VN.js} +1 -1
- package/dist/SingleShotApp-M7R5PW4X.js +2 -0
- package/dist/{SummaryBox-R6WHU7VD.js → SummaryBox-4T545XRB.js} +1 -1
- package/dist/TestMdRunView-JXRXMACE.js +2 -0
- package/dist/{WhoamiView-YRQNOSOH.js → WhoamiView-GCVD35EX.js} +1 -1
- package/dist/bind-JLMT57Q3.js +6 -0
- package/dist/{bridge-7UMWMIJJ.js → bridge-PDJEOSAJ.js} +1 -1
- package/dist/{changelog-YQC2QDCO.js → changelog-D65HWZDM.js} +1 -1
- package/dist/{chat-committer-GHDZY5XF.js → chat-committer-ADJJTDUT.js} +1 -1
- package/dist/{chat-controller-QXFAB2DK.js → chat-controller-VAC57IEV.js} +1 -1
- package/dist/{chunk-B5LJCGAY.js → chunk-24OFJ7SE.js} +1 -1
- package/dist/{chunk-PJDOXRLB.js → chunk-24VYAMMK.js} +1 -1
- package/dist/chunk-262ES67I.js +14 -0
- package/dist/{chunk-CIW2KP4C.js → chunk-2BWRAY3Y.js} +1 -1
- package/dist/{chunk-KHDUQ33H.js → chunk-2PQXEEVY.js} +1 -1
- package/dist/{chunk-F66SSA4C.js → chunk-2WO7G2HO.js} +1 -1
- package/dist/{chunk-Y6LMHBLE.js → chunk-32GP7KTM.js} +1 -1
- package/dist/{chunk-NNZV5RCE.js → chunk-3C5GMAM4.js} +1 -1
- package/dist/{chunk-SHSV64GX.js → chunk-3Z3UIW5H.js} +1 -1
- package/dist/{chunk-OE7TVGNB.js → chunk-4A6BLXQN.js} +3 -3
- package/dist/chunk-4R2HOA7J.js +14 -0
- package/dist/{chunk-AV5SUGRY.js → chunk-4SXD6XWV.js} +1 -1
- package/dist/{chunk-FFL2TQEJ.js → chunk-5JJ245FW.js} +1 -1
- package/dist/chunk-5YPBPZUR.js +2 -0
- package/dist/chunk-64LC36AF.js +2 -0
- package/dist/{chunk-Z56AWGVY.js → chunk-6AYUSR7X.js} +1 -1
- package/dist/{chunk-Y7KW5AEN.js → chunk-6CZIEK6B.js} +1 -1
- package/dist/{chunk-VJUIW2ES.js → chunk-6GTOYTCQ.js} +1 -1
- package/dist/{chunk-EWFFJBAM.js → chunk-6NIV7AVZ.js} +1 -1
- package/dist/chunk-6SGPN76K.js +2 -0
- package/dist/{chunk-7MV5UF6O.js → chunk-6XHAXAL2.js} +1 -1
- package/dist/{chunk-AE6SS34N.js → chunk-74RUSHIB.js} +1 -1
- package/dist/{chunk-RLG5NUTE.js → chunk-AKHUNBQS.js} +1 -1
- package/dist/{chunk-53VDR5DN.js → chunk-BLSZ4H5W.js} +12 -12
- package/dist/{chunk-OGVIHL5G.js → chunk-BV5QKFMJ.js} +1 -1
- package/dist/{chunk-SL7AJ7JQ.js → chunk-C42WWO7Y.js} +1 -1
- package/dist/{chunk-FYOCF7DY.js → chunk-CJJXT5DO.js} +1 -1
- package/dist/chunk-D7L6UW5Z.js +7 -0
- package/dist/chunk-EHN5HTUD.js +147 -0
- package/dist/{chunk-P46TIMGQ.js → chunk-EOLQUB4Q.js} +1 -1
- package/dist/{chunk-C5POEXSX.js → chunk-EWTX7HSU.js} +2 -2
- package/dist/{chunk-RGEAEAZB.js → chunk-FJTWJ243.js} +1 -1
- package/dist/{chunk-CE664P73.js → chunk-GBBVP2JW.js} +1 -1
- package/dist/chunk-GLS46X7N.js +5 -0
- package/dist/{chunk-AD46OCZ4.js → chunk-GRB66C5S.js} +1 -1
- package/dist/{chunk-22A2ECA2.js → chunk-GYW7LVVL.js} +1 -1
- package/dist/{chunk-BO3JA2GS.js → chunk-HA5GE57Z.js} +15 -15
- package/dist/{chunk-VXGOWBET.js → chunk-HWA7WD44.js} +1 -1
- package/dist/{chunk-7YQW4TFI.js → chunk-JF7Q2I45.js} +1 -1
- package/dist/{chunk-TTSYHJLX.js → chunk-JTEY32TL.js} +1 -1
- package/dist/{chunk-DEEBPSJN.js → chunk-JU5KRCKD.js} +4 -4
- package/dist/chunk-JV356AYH.js +5 -0
- package/dist/chunk-K5JGCJ2K.js +6 -0
- package/dist/{chunk-UXJPCWGW.js → chunk-KI2DVQSA.js} +1 -1
- package/dist/chunk-KNCHEM6A.js +9 -0
- package/dist/{chunk-YZSYXNMB.js → chunk-KYHXDJN4.js} +1 -1
- package/dist/{chunk-326XAPMW.js → chunk-L26LU6TU.js} +2 -2
- package/dist/{chunk-WFRL54GK.js → chunk-LABIRPOT.js} +1 -1
- package/dist/{chunk-BFFCGEUH.js → chunk-LEQ2B3PR.js} +1 -1
- package/dist/{chunk-EEO4XWY6.js → chunk-LLS47HUA.js} +1 -1
- package/dist/{chunk-2S4S2XJC.js → chunk-LURGFJEE.js} +1 -1
- package/dist/{chunk-D5T4ARTB.js → chunk-MCQXRJGH.js} +1 -1
- package/dist/{chunk-2TVRHXRK.js → chunk-MSPZOEFB.js} +1 -1
- package/dist/{chunk-YZKPZXHY.js → chunk-MY32TBBR.js} +1 -1
- package/dist/{chunk-BGGNBWAJ.js → chunk-N6DO2LBH.js} +1 -1
- package/dist/{chunk-ARS72637.js → chunk-OFEOWKM3.js} +1 -1
- package/dist/{chunk-TZZYRDCF.js → chunk-P4HW2NTZ.js} +1 -1
- package/dist/{chunk-LMJTY32X.js → chunk-RHNKYNNZ.js} +1 -1
- package/dist/{chunk-RZFINU7J.js → chunk-RIMJDJWY.js} +1 -1
- package/dist/{chunk-ZKYYZ5NO.js → chunk-RN4OSVTG.js} +2 -2
- package/dist/{chunk-ME5QSYWX.js → chunk-RV2NXHIC.js} +1 -1
- package/dist/{chunk-SQFNMZJ2.js → chunk-S2C62SDY.js} +1 -1
- package/dist/chunk-SJ2KQKOV.js +3 -0
- package/dist/{chunk-G6AF2JUA.js → chunk-UZJ7MRBV.js} +1 -1
- package/dist/{chunk-XBE7PGVY.js → chunk-VBCE4U4B.js} +1 -1
- package/dist/chunk-WIA7TPK3.js +2 -0
- package/dist/{chunk-F2K3XFFH.js → chunk-WJGBXJT4.js} +2 -2
- package/dist/{chunk-7LFCSSPX.js → chunk-WWH7CW5R.js} +1 -1
- package/dist/{chunk-NFGG5DA2.js → chunk-XQL53VB7.js} +1 -1
- package/dist/{chunk-B2PZAB7J.js → chunk-ZG2V2ODK.js} +1 -1
- package/dist/{chunk-GIRXJOJI.js → chunk-ZZLR3O5A.js} +1 -1
- package/dist/{config-5OOP2BO3.js → config-6PAZZ7CR.js} +1 -1
- package/dist/{cover-cmd-Y5L4O4Q3.js → cover-cmd-K3LCXHAQ.js} +1 -1
- package/dist/{credentials-XCP6DJZZ.js → credentials-BJCIWQWA.js} +1 -1
- package/dist/descriptor-EHK3DRCZ.js +2 -0
- package/dist/{evidence-AX67Q6RN.js → evidence-7VE5EGEF.js} +1 -1
- package/dist/evolve-cmd-RUGUWKAG.js +2 -0
- package/dist/explain-VFIZTHFN.js +2 -0
- package/dist/{explain-cmd-RIDEMDMY.js → explain-cmd-KV5YUXKB.js} +1 -1
- package/dist/{explain-cmd-55WRDIMW.js → explain-cmd-U367SD4N.js} +1 -1
- package/dist/{extract-bind-ZDAXRQUS.js → extract-bind-YS7C4KZ3.js} +2 -2
- package/dist/{extract-cmd-5GGI6LAM.js → extract-cmd-Z4PMDIMZ.js} +2 -2
- package/dist/{gaps-cmd-P2DRK6FW.js → gaps-cmd-DTVDIOED.js} +1 -1
- package/dist/{gate-FACZRGOC.js → gate-B6C6KLFA.js} +1 -1
- package/dist/{generate-headless-DRDE46ON.js → generate-headless-IWY32HC4.js} +2 -2
- package/dist/{headless-io-GXHKDPHB.js → headless-io-PWW6YKH2.js} +1 -1
- package/dist/index.js +43 -43
- package/dist/ingest-C5ANIN7S.js +2 -0
- package/dist/ingest-cmd-LLC5CDQ5.js +3 -0
- package/dist/interactive-bind-ZIIJDRBU.js +7 -0
- package/dist/{lifecycle-cmd-55NZL3UO.js → lifecycle-cmd-BXE5IMFN.js} +1 -1
- package/dist/{list-cmd-JB2ABACD.js → list-cmd-KBWPYJMV.js} +1 -1
- package/dist/{list-commands-UDAL3SBY.js → list-commands-SSXJQGE7.js} +1 -1
- package/dist/{logical-ids-ATVR6PF2.js → logical-ids-3Y6RX5C2.js} +1 -1
- package/dist/login-flow-HRS6YACY.js +2 -0
- package/dist/{maintenance-cmd-E3HEEVQW.js → maintenance-cmd-VS3APIUN.js} +1 -1
- package/dist/{persist-recorded-session-BW3YSFMP.js → persist-recorded-session-3AOYZJT2.js} +1 -1
- package/dist/pipeline-IZSODNCC.js +2 -0
- package/dist/readmodel-XOGOELUP.js +2 -0
- package/dist/reconcile-cmd-6HVZJFG3.js +2 -0
- package/dist/{recording-banner-6FVTCUWQ.js → recording-banner-KKEUWS3N.js} +1 -1
- package/dist/{require-project-folder-AQUVEEJB.js → require-project-folder-NPTKR2AW.js} +1 -1
- package/dist/{revert-3TKLOYQA.js → revert-AQQ2VHRM.js} +1 -1
- package/dist/{review-cmd-RXPPC5GK.js → review-cmd-4WZUUOE4.js} +1 -1
- package/dist/run-2A7M7EJK.js +2 -0
- package/dist/run-6AFY35QW.js +2 -0
- package/dist/{run-test-md-AUK7NGLL.js → run-test-md-QNC6KDMN.js} +2 -2
- package/dist/{skill-installer-2MNPCPRD.js → skill-installer-ULFNSE6X.js} +1 -1
- package/dist/{spawner-XCOMTJJC.js → spawner-DWONVIPI.js} +1 -1
- package/dist/tcg-generate-IHHPRVNG.js +2 -0
- package/dist/{testmd-actions-TU4KTO32.js → testmd-actions-S3ZNOZEK.js} +1 -1
- package/dist/token-refresh-CFVOA62N.js +2 -0
- package/dist/{validate-basic-IYMPP7C7.js → validate-basic-4OLDKIA2.js} +1 -1
- package/dist/{version-check-MUPSKONS.js → version-check-UL4S6R4N.js} +1 -1
- package/dist/{view-cmd-QE2FS3GB.js → view-cmd-FRMQF76B.js} +1 -1
- package/dist/walk-session-N3BP57HK.js +2 -0
- package/package.json +16 -8
- package/bin/kane-cli.js +0 -2
- package/dist/ChatSurface-J777M5WC.js +0 -8
- package/dist/EvidenceViewOffer-JQDEAE2T.js +0 -2
- package/dist/SingleShotApp-QANGFAPO.js +0 -2
- package/dist/TestMdRunView-74A3LCNE.js +0 -2
- package/dist/archive-committer-3NI773TP.js +0 -2
- package/dist/bind-FZ4X4SOK.js +0 -6
- package/dist/chunk-6RQAUK5F.js +0 -5
- package/dist/chunk-E4OYR32M.js +0 -2
- package/dist/chunk-FTD3B7QA.js +0 -2
- package/dist/chunk-GIGD4M7V.js +0 -5
- package/dist/chunk-I2S6KNZW.js +0 -2
- package/dist/chunk-IACKIGPX.js +0 -2
- package/dist/chunk-NFOBDHZK.js +0 -147
- package/dist/chunk-Q4HLQOJI.js +0 -7
- package/dist/chunk-SGU72YLH.js +0 -9
- package/dist/chunk-TY5LWU6I.js +0 -14
- package/dist/chunk-YANCBRER.js +0 -3
- package/dist/descriptor-SL5A7RQE.js +0 -2
- package/dist/distill-cmd-EYCCCFL3.js +0 -2
- package/dist/evolve-cmd-HR25DRTC.js +0 -2
- package/dist/explain-JIXUWEFJ.js +0 -2
- package/dist/ingest-4CGBXC2L.js +0 -2
- package/dist/ingest-cmd-X7BWGIN7.js +0 -3
- package/dist/interactive-bind-T6OBLZCT.js +0 -7
- package/dist/login-flow-LJ4BH3OS.js +0 -2
- package/dist/pipeline-TZJ652NT.js +0 -2
- package/dist/readmodel-MPTENJ2R.js +0 -2
- package/dist/reconcile-cmd-242S7XNO.js +0 -8
- package/dist/run-UGAOGR3B.js +0 -2
- package/dist/signals-cmd-LXHZQLXZ.js +0 -2
- package/dist/tcg-generate-E5X23RVP.js +0 -2
- package/dist/token-refresh-GGLARJV4.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as t}from"./chunk-
|
|
2
|
+
import{a as t}from"./chunk-C42WWO7Y.js";async function l(e){let o=e.credentials.expires_at,i=e.thresholdSeconds??300;if(o-Date.now()/1e3>=i)return null;let r=e.creds.loadClient(e.profile,e.env);if(!r)return null;let n=await new t(e.env).refreshToken(e.credentials.refresh_token,r.client_id),s=Math.floor(Date.now()/1e3)+n.expires_in;return e.creds.saveCredentials(e.profile,e.env,{access_token:n.access_token,refresh_token:n.refresh_token,expires_at:s,scope:n.scope}),{accessToken:n.access_token,refreshToken:n.refresh_token,expiresAt:s,scope:n.scope}}export{l as a};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c as H,d as z}from"./chunk-2YQ6TW77.js";import{b as p,c as E,d as j,e as y,f as M,g as C,i as A,l as D,m as F,p as T,r as $,s as O}from"./chunk-RKWJG3WW.js";import{a as B}from"./chunk-
|
|
2
|
+
import{c as H,d as z}from"./chunk-2YQ6TW77.js";import{b as p,c as E,d as j,e as y,f as M,g as C,i as A,l as D,m as F,p as T,r as $,s as O}from"./chunk-RKWJG3WW.js";import{a as B}from"./chunk-VBCE4U4B.js";import{h as R,i as k}from"./chunk-M5JQXOCE.js";import{a as P}from"./chunk-6SGPN76K.js";import{e as q}from"./chunk-UR6MHSHU.js";import{existsSync as f,mkdirSync as V,readFileSync as Z,renameSync as N,writeFileSync as K}from"fs";import{join as Q}from"path";function fe(e){D(p(e));let t=p(e);if(!f(t))return;let n=Q(t,"meta.json"),r=y(e);if(f(n)&&!f(r))try{V(j(e),{recursive:!0}),N(n,r)}catch(o){process.stderr.write(`warn: meta.json migration failed: ${o.message}
|
|
3
3
|
`)}let i=C(e);if(f(i)){let o="python";try{let c=new B().load();c.code_export?.language&&(o=c.code_export.language)}catch{}let a=M(e,"playwright",o);if(!f(a))try{N(i,a)}catch(c){process.stderr.write(`warn: generated-code migration failed: ${c.message}
|
|
4
4
|
`)}}if(f(r))try{let o=JSON.parse(Z(r,"utf8"));"md5sum"in o&&(delete o.md5sum,K(r,JSON.stringify(o,null,2)+`
|
|
5
5
|
`,"utf8"))}catch(o){process.stderr.write(`warn: meta.json md5sum strip failed: ${o.message}
|
|
6
|
-
`)}}async function ye(e){if(!e.isInteractive)return{recovered:!1};if(W(e.creds))return{recovered:!1};let{SingleShotApp:t}=await import("./SingleShotApp-
|
|
6
|
+
`)}}async function ye(e){if(!e.isInteractive)return{recovered:!1};if(W(e.creds))return{recovered:!1};let{SingleShotApp:t}=await import("./SingleShotApp-M7R5PW4X.js"),{ScrollbackProvider:n}=await import("./scrollback-JLPJR25X.js"),{render:r}=await import("./build-JIKYOZUH.js"),i=await import("./react-QWOAB3TB.js"),o={current:null},a={current:!1},{waitUntilExit:c,unmount:l}=r(i.default.createElement(n,null,i.default.createElement(t,{resultRef:o,mode:"login",loginCompleteRef:a})),{exitOnCtrlC:!1});k(()=>l()),await c();try{process.stdin.setRawMode?.(!1)}catch{}return process.stdout.write("\x1B[?25h"),a.current?{recovered:!0}:(R(0,"Startup gate cancelled"),{recovered:!1})}function W(e){let t=e.getActiveProfile(),n=e.getDefaultEnv();if(!t||!!!(e.loadBasicAuth(t,n)||e.loadCredentials(t,n)))return!1;let i=e.loadProfileConfig(t,n)??{};return!!i.project_id&&!!i.folder_id}var J=q(H(),1);import{existsSync as v,readFileSync as U,readdirSync as X,statSync as Y}from"fs";import{dirname as ee,isAbsolute as te,join as g,relative as x,resolve as re,sep as h}from"path";import{createHash as ne}from"crypto";var S="testmd-bundle.json",d=class extends Error{constructor(t){super(t),this.name="BundleUsageError"}},_=e=>e.split(h).join("/");function I(e){if(!v(e))return[];let t=[];for(let n of X(e).sort()){let r=g(e,n);Y(r).isDirectory()?t.push(...I(r)):t.push(r)}return t}function se(e){let t=e.map(r=>ee(r).split(h)),n=t[0];for(let r of t.slice(1)){let i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;n=n.slice(0,i)}return n.join(h)||h}function ie(e){for(let t of e){let n=F(t,U(t,"utf8"));for(let r of n.steps)if(r.body.kind==="import_ref"&&te(r.body.path))throw new d(`bundle sync: absolute @import is not portable after unzip: ${t} step ${r.index} (@import ${r.body.path})`)}}function G(e){let t=re(e),n=T(t);if(!n?.commit_id||!n?.test_id)throw new d(`bundle sync: ${t} is not authored \u2014 run \`kane-cli testmd run\` first (output-<stem>/.internal/meta.json needs commit_id + test_id)`);let r;try{r=O(t)}catch(s){throw s instanceof $?new d(`bundle sync: ${s.message}`):s}let i=[t];for(let s of r.steps)for(let u of s.trace.slice(1))i.includes(u.file)||i.push(u.file);ie(i);let o=[];for(let s of r.unitFiles){if(s.file===t)continue;let u=p(s.file);o.includes(u)||o.push(u)}let a=[...i],c=s=>{v(s)&&a.push(s)};c(E(t)),a.push(y(t)),c(g(p(t),".internal","execution.json")),a.push(...I(A(t)));for(let s of o)c(g(s,"Result.md")),a.push(...I(g(s,".internal","steps")));let l=se(a);if(v(g(l,S)))throw new d(`bundle sync: a real file named ${S} exists at the zip root (${l}) \u2014 it would collide with the generated manifest`);let b=a.map(s=>{let u=U(s);return{abs:s,rel:_(x(l,s)),sha256:ne("sha256").update(u).digest("hex"),bytes:u.length}}).sort((s,u)=>s.rel<u.rel?-1:1),m=_(x(l,t)),L={schema_version:2,entry:m,commit_id:n.commit_id,test_id:n.test_id,testcase_id:n.testcase_id??null,project_id:n.project_id??null,folder_id:n.folder_id??null,org_id:n.org_id??null,created_at:new Date().toISOString(),producer:{name:"kane-cli",version:P},files:b.map(s=>({path:s.rel,sha256:s.sha256,bytes:s.bytes})),units:r.unitFiles.filter(s=>s.file!==t).map(s=>({path:_(x(l,s.file)),kind:s.kind}))};return{zipRoot:l,entry:m,files:b,manifest:L}}var w=e=>e instanceof Error?e.message:String(e);function oe(e){return new Promise((t,n)=>{let r=(0,J.default)("zip",{zlib:{level:6}}),i=[];r.on("data",o=>i.push(o)),r.on("error",n),r.on("end",()=>t(Buffer.concat(i))),r.append(JSON.stringify(e.manifest,null,2)+`
|
|
7
7
|
`,{name:S});for(let o of e.files)r.file(o.abs,{name:o.rel});r.finalize()})}async function ae(e){let{plan:t,controller:n,testId:r,sessionId:i,commitId:o}=e,a;try{a=await oe(t)}catch(l){return{ok:!1,stage:"zip",error:w(l)}}let c;try{let l={key:"testmd",content_type:"application/zip",filename:`${o}-testmd.zip`},m=(await n.getPresignedUrls(r,i,[l])).urls?.testmd?.upload_url;if(!m)return{ok:!1,stage:"presign",error:"presign response missing testmd upload_url"};c=m}catch(l){return{ok:!1,stage:"presign",error:w(l)}}try{await z(c,a,"application/zip")}catch(l){return{ok:!1,stage:"upload",error:w(l)}}return{ok:!0,bytes:a.length}}async function Ee(e){let t;try{t=G(e.sourcePath)}catch(n){return n instanceof d?{ok:!1,stage:"collect",error:n.message}:{ok:!1,stage:"collect",error:w(n)}}return ae({...e,plan:t})}function je(e){return e.shouldUploadPipeline&&e.uploadSucceeded&&!!e.metaCommitId&&!!e.metaTestId}export{fe as a,ye as b,Ee as c,je as d};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as p,b as d}from"./chunk-L5LI2JF4.js";import{b as f}from"./chunk-
|
|
2
|
+
import{a as p,b as d}from"./chunk-L5LI2JF4.js";import{b as f}from"./chunk-ZG2V2ODK.js";var m=new Set(["delta","state-transition"]),b=/^capture baseline:/i;function g(e){return typeof e=="string"?e:e.text}function h(e){return typeof e=="object"&&e.baseline===!0||b.test(g(e).trim())}function v(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&"derived"in e}function S(e,r){if(e.check_prose)return e.check_prose;let n=r.find(i=>i.ref===e.check.verified_against),t=n?.text?` \u2014 the stated promise: ${n.text}`:"",o=String(e.check.operand??e.check.within??e.check.metric??"");return e.check.kind==="forbidden-presence"?`Confirm '${o}' does NOT appear (forbidden-presence)${t}`:`Confirm ${e.check.kind} check: ${o} (${e.check.operator})${t}`}var y=/^## Step \d+ — assert\s*$/;function B(e,r){if(r.length===0)return e;let n=e.split(`
|
|
3
3
|
`);for(let t=n.length-1;t>=0;t--){if(/^## Step \d+ — assert @verifies /.test(n[t]))return e;if(y.test(n[t]))return n[t]=`${n[t].trimEnd()} @verifies ${r.join(", ")}`,n.join(`
|
|
4
4
|
`)}return e}function C(e,r){return r.size===0?e:e.split(`
|
|
5
5
|
`).map(n=>{let t=n.match(/^@import\s+(\S+)\s*$/);if(t&&r.has(t[1]))return`@import ${r.get(t[1])}`;let o=n.match(/^## Import: (\S+)\s*$/);return o&&r.has(o[1])?`## Import: ${r.get(o[1])}`:n}).join(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d,e as f}from"./chunk-
|
|
2
|
+
import{d,e as f}from"./chunk-5YPBPZUR.js";var G={high:3,med:2,low:1},R={create:0,evolve:1,"reuse-candidate":2},_=.75;function a(e,n){return!e.superseded.has(n)&&e.trust.get(n)!=="archived"}function m(e,n="med"){let t=e.risk;return t==="high"||t==="med"||t==="low"?t:n}function l(e,n){return e.nameOf.get(n)??n}function y(e,n){return`kane-cli design tests --use-case ${l(e,n)}`}function b(e,n){let t=e.edgesFrom(n).find(i=>i.type===f.SCOPED_TO&&a(e,i.dst));if(!t)return null;let s=e.nodeLabel.get(t.dst);if(s===d.USECASE)return t.dst;if(s===d.SCENARIO){let i=e.edgesFrom(t.dst).find(r=>r.type===f.BELONGS_TO&&a(e,r.dst));return i?i.dst:null}return null}function v(e,n){let t=b(e,n);return t?y(e,t):w(e,n)}function w(e,n){return`kane-cli design explain ${l(e,n)}`}function E(e,n){let t=e.edgesFrom(n).find(i=>i.type===f.AUTOMATES&&a(e,i.dst));if(!t)return null;let s=e.edgesFrom(t.dst).find(i=>i.type===f.BELONGS_TO&&a(e,i.dst));return s?s.dst:null}function S(e){let n=[];for(let{cid:t,content:s}of e.byLabel(d.AC))!a(e,t)||e.edgesInto(t).filter(r=>r.type===f.VERIFIES&&a(e,r.src)).length>0||n.push({ref:l(e,t),kind:"no-verifies",why:"no live test verifies this acceptance criterion",risk:m(s),stage:"design",tag:"create",ready_command:v(e,t)});return n}function h(e){let n=[];for(let{cid:t,content:s}of e.byLabel(d.USECASE)){if(!a(e,t))continue;let i=e.edgesInto(t).filter(o=>o.type===f.BELONGS_TO&&a(e,o.src));if(i.length===0){n.push({ref:l(e,t),kind:"zero-scenario",why:"use-case has no scenarios",risk:m(s),stage:"design",tag:"create",ready_command:y(e,t)});continue}i.every(o=>e.getNode(o.src)?.content.case_type==="happy")&&n.push({ref:l(e,t),kind:"happy-only",why:"use-case is exercised by happy-path scenarios only",risk:m(s),stage:"design",tag:"create",ready_command:y(e,t)})}return n}function x(e){let n=[];for(let{cid:t,content:s}of e.byLabel(d.GAP)){if(!a(e,t))continue;let i=s.ref,r=typeof i=="string"?e.resolve(i):null,o=r&&a(e,r.tip)?r.tip:null,u=o?e.nodeLabel.get(o):null,p=u===d.USECASE?y(e,o):u===d.AC?v(e,o):w(e,t),c=s.question&&typeof s.question=="object"?s.question:void 0,k=typeof s.text=="string"&&s.text||(c&&typeof c.header=="string"?c.header:"")||"design gap";n.push({ref:l(e,t),kind:String(s.kind),why:k,risk:m(s),stage:"design",tag:"create",ready_command:p,...typeof s.risk_rationale=="string"?{risk_rationale:s.risk_rationale}:{},...c?{question:c}:{}})}return n}function L(e){let n=[];for(let{cid:t,content:s}of e.byLabel(d.AC)){if(!a(e,t))continue;let i=e.stale(t);i==="fresh"||i==="superseded"||n.push({ref:l(e,t),kind:"stale-ac",why:`acceptance criterion is ${i} \u2014 its source moved since this was authored`,risk:m(s),stage:"design",tag:"evolve",ready_command:v(e,t)})}for(let{cid:t,content:s}of e.byLabel(d.TEST)){if(!a(e,t))continue;let i=e.stale(t);if(i==="fresh"||i==="superseded")continue;let r=e.edgesFrom(t).filter(g=>g.type===f.VERIFIES&&a(e,g.dst)),o=r.map(g=>m(e.getNode(g.dst)?.content??{})),u=o.includes("high")?"high":o.includes("med")?"med":o.includes("low")?"low":"med",p=r[0]?.dst??null,c=p?null:E(e,t),k=p?v(e,p):c?y(e,c):w(e,t);n.push({ref:l(e,t),kind:"stale-test",why:`test is ${i} \u2014 its source moved since this was authored`,risk:u,stage:"design",tag:"evolve",ready_command:k})}return n}async function C(e,n,t){for(let s of e)if(s.tag==="create"){if(!t){s.meta={embed_arm:"skipped"};continue}try{let i=n.resolve(s.ref),r=i?n.getNode(i.tip):null,o=r&&(String(r.content.title??"")||String(r.content.text??""))||s.why,u=r?.label===d.USECASE?"scenario":"test",c=(await t.searchSimilar(o,{label:u,k:1}))[0];c&&c.score>=_?(s.tag="reuse-candidate",s.meta={embed_arm:"used",near_hit:{ref:l(n,c.cid),score:c.score}}):s.meta={embed_arm:"used",near_hit:null}}catch{s.meta={embed_arm:"skipped"}}}}function O(e,n){let t=G[n.risk]-G[e.risk];if(t!==0)return t;let s=R[e.tag]-R[n.tag];return s!==0?s:e.ref<n.ref?-1:e.ref>n.ref?1:0}function A(e,n){let t=[],s=r=>{let o=e.resolve(r);return o&&!o.superseded?m(e.getNode(o.tip)?.content??{}):"med"},i=r=>{let o=e.resolve(r),u=o&&!o.superseded?b(e,o.tip):null;return u?l(e,u):r};for(let r of n.usecases??[])for(let o of r.acceptance_criteria??[])(o.covered_by??[]).length>0&&(o.execution==="failed"?t.push({ref:o.id,kind:"execution-failed",stage:"cover",tag:"evolve",risk:s(o.id),why:`covering test failed against this AC (tests: ${(o.covered_by??[]).join(", ")})`,ready_command:`kane-cli maintain evolve ${i(o.id)}`}):o.execution==="blocked"?t.push({ref:o.id,kind:"execution-blocked",stage:"cover",tag:"reuse-candidate",risk:s(o.id),why:"the oracle could not run (infrastructure) \u2014 the covering test exists and is reusable",ready_command:"kane-cli testrun run"}):o.execution==="not-run"&&t.push({ref:o.id,kind:"covered-not-run",stage:"cover",tag:"reuse-candidate",risk:s(o.id),why:"a covering test exists but never joined this pack \u2014 run it",ready_command:"kane-cli testrun run"}));return t}async function I(e,n,t,s){if(n!=="design"&&!s)throw new Error(`gaps-engine: stage "${n}" requires a pack's usecases doc`);let i=[];return(n==="design"||n==="all")&&i.push(...S(e),...h(e),...x(e),...L(e)),(n==="cover"||n==="all")&&i.push(...A(e,s)),await C(i,e,t),i.sort(O),i}export{I as a};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as M,b as B,c as oe,d as P}from"./chunk-2YQ6TW77.js";import{a as F}from"./chunk-WAOCHXJ5.js";import{b as z}from"./chunk-CJJXT5DO.js";import{a as U}from"./chunk-2WVKOZ6W.js";import{a as j}from"./chunk-NLCCBXXV.js";import{a as k}from"./chunk-RZ4F3BHX.js";import{e as se}from"./chunk-UR6MHSHU.js";import{readFileSync as te,existsSync as C,readdirSync as ye,mkdirSync as D,writeFileSync as x}from"fs";import{readFile as ne,unlink as Re}from"fs/promises";import{join as E}from"path";import{randomUUID as A}from"crypto";var re="/home/kaneai/Downloads";function N(t){return`${re}/${t}`}function $(t){return"FILE__"+t.replace(/[^A-Za-z0-9]/g,"_")}function S(t){let e=t?.media;return!e||!e.name||!e.media_url?null:{media_id:e.media_id??"",name:e.name,media_url:e.media_url,type:e.type??"doc"}}function K(t){return t?t.includes(`
|
|
3
|
+
`)?t.split(`
|
|
4
|
+
`).map(e=>e.trim()).filter(Boolean):t.split(". ").map(e=>e.trim()).filter(Boolean).map(e=>e.endsWith(".")?e:e+"."):[]}function L(t,e){return!t||!e?t:t.replace(/\{\{(.+?)\}\}/g,(n,i)=>{let s=e[i];return s?s.value:n}).replace(/\$\{(.+?)\}/g,(n,i)=>{let s=e[i];return s?s.value:n})}var ae={click:"CLICK",double_click:"CLICK",type:"TYPE",fill:"TYPE",select:"SELECT",hover:"HOVER",drag:"DRAG_DROP",upload_files:"UPLOAD_FILE",navigate:"OPEN",go_back:"NAVIGATE",go_forward:"NAVIGATE",refresh:"REFRESH",press_key:"SENDKEYS",scroll:"SCROLL_PIXELS",scroll_into_view:"SCROLL_UNTIL_ELEMENT",wait:"WAIT",wait_until:"WAIT_UNTIL",wait_for_load:"WAIT_FOR_LOAD",switch_tab:"SWITCH_TAB",new_tab:"NEW_TAB",close_tab:"CLOSE_TAB",api:"API",evaluate_js:"EVALUATE_JS",vision_query:"VISION_QUERY",textual_query:"TEXTUAL_QUERY",get_url:"GET_URL",get_title:"GET_TITLE",assert:"ASSERTION",math:"MATHEMATICAL_OPERATION",set_cookies:"SET_COOKIES",delete_cookies:"DELETE_COOKIES",clear_cookies:"CLEAR_COOKIES",set_local_storage:"SET_LOCAL_STORAGE",delete_local_storage:"DELETE_LOCAL_STORAGE",clear_local_storage:"CLEAR_LOCAL_STORAGE",set_clipboard:"SET_CLIPBOARD",paste_clipboard:"PASTE_CLIPBOARD",clear_clipboard:"CLEAR_CLIPBOARD"},G={literal:"SET_VARIABLE",condition:"SET_VARIABLE",visual:"VISION_QUERY",dom:"TEXTUAL_QUERY",url:"GET_URL",title:"GET_TITLE",devtool_network:"DEVTOOLS_NETWORK_QUERY",devtool_console:"DEVTOOLS_CONSOLE_QUERY",devtool_cookies:"DEVTOOLS_COOKIES_QUERY",devtool_storage:"DEVTOOLS_STORAGE_QUERY",devtool_performance:"DEVTOOLS_PERFORMANCE",api_response:"API_CALLS_QUERY",textual_visual:"TEXTUAL_ANALYZER"},le=new Set(["CLICK","TYPE","FILL","HOVER","SCROLL_UNTIL_ELEMENT","UPLOAD_FILE","VISION_QUERY","DRAG_DROP","SELECT"]);function X(t,e){if(t==="analyze"){let i=e?.action_params?.analyzer_type??"";return G[i]}let n=ae[t];return n||console.warn(`[migrator] UNKNOWN action_type "${t}" \u2014 falling back to "${t.toUpperCase()}"; explicit mapping required`),n??t.toUpperCase()}function Y(t,e){if(!t||!e)return"";try{let n=new Date(t);return isNaN(n.getTime())?"":new Date(n.getTime()+e).toISOString()}catch{return""}}function W(t){try{return JSON.parse(t.output_value??"{}")}catch{return{}}}function ce(t){let e=t.output_variable??"";if(!e)return"[]";let i={...W(t)};return delete i.body,JSON.stringify([{name:e,unique_key:(t.action_id??"").replace(/-/g,"").slice(0,8)||A().replace(/-/g,"").slice(0,8),value:i,variable_description:"API Response"}])}function ue(t,e,n){let i=t.action_params??{},s=le.has(e)?"Vision Agent":"Operation Agent",a={operation_type:e};if(e==="OPEN"&&(a.url=i.url??""),e==="SET_VARIABLE"&&(a.variable_name=t.output_variable??i.key??"",a.variable_value=t.output_value??""),e==="UPLOAD_FILE"){let f=S(i);f&&(a.value=N(f.name))}let o={},l={},r=t.action_instruction??"",c=i.text??"",u=i.url??"",p=[["intent",r],["value",c],["url",u]];for(let[f,h]of Object.entries(n)){let b=String(h);if(f.startsWith("secrets."))for(let[I,v]of p)v.includes(b)&&(l[I]=f);for(let[I,v]of p)v.includes(b)&&!(I in o)&&(o[I]=v)}let _=t.action_type,d={operation:t.action_instruction??"",agent:s,operation_dict:a,reasoning:_==="analyze"?i.query??"":t.intent??t.action_instruction??"",variable:o,secrets:l,params:{}};_==="analyze"&&typeof i.code=="string"&&i.code&&(d.code=i.code),_==="analyze"&&typeof i.code_js=="string"&&i.code_js&&(d.code_js=i.code_js),_==="analyze"&&typeof i.condition_expression=="string"&&i.condition_expression&&(d.condition_expression=i.condition_expression),i.uses_websocket===!0&&(d.uses_websocket=!0),i.uses_sse===!0&&(d.uses_sse=!0),_==="analyze"&&i.analyzer_type==="textual_visual"&&(typeof i.wrapped_js=="string"&&(d.wrapped_js=i.wrapped_js),Array.isArray(i.locators)&&(d.locators=i.locators),typeof i.operator=="string"&&(d.operator=i.operator),Array.isArray(i.transforms)&&(d.transforms=i.transforms),typeof i.query=="string"&&(d.query=i.query),typeof i.expected_value=="string"&&(d.expected_value=i.expected_value),typeof i.needs_unit_conversion=="boolean"&&(d.needs_unit_conversion=i.needs_unit_conversion),typeof i.condition=="string"&&(d.condition=i.condition));let m={set_cookies:"cookies",set_clipboard:"text",delete_cookies:"names",set_local_storage:"items",delete_local_storage:"keys"}[_];return m&&i[m]!==void 0&&(d[m]=i[m]),_==="set_clipboard"&&typeof i.html=="string"&&i.html&&(d.html=i.html),d}function de(t){let e=t.assertion_tree??{};if(typeof e.passed=="boolean")return e.passed;let n=e.sub_results??[];return n.length===0?e.status==="passed":(e.composite_operator??"and")==="or"?n.some(s=>s.passed===!0):n.every(s=>s.passed===!0)}function H(t){return t.map(e=>({description:e.description??"",store_key:e.store_key??"",expected_value:e.expected??"",extracted_value:e.extracted_value??"",operator:e.operator??"equals",transforms:e.transforms??[]}))}function _e(t){let e=t.assertion_tree??{},n=e.sub_results??[],i=H(n);return{operator:[],assertion_operands:[],left_operand:null,right_operand:null,operands:[],sub_results:n,sub_checks:i,composite_operator:e.composite_operator??"and",verification:e.verification??"",claim:e.description??""}}function pe(t){let n=(t.action_params??{}).assertion_tree??{},i=n.sub_results??[],s=H(i);return[{operation:t.action_instruction??"",agent:"Operation Agent",operation_dict:{operation_type:"ASSERTION",assertion_tree:{sub_results:i,sub_checks:s,composite_operator:n.composite_operator??"and",verification:"",claim:n.description??t.action_instruction??"",operator:[],assertion_operands:[],left_operand:null,right_operand:null,operands:[]}},variable:{},secrets:{},params:{}}]}function ge(t,e,n,i){let s=t.visual_data;if(!s||s.x==null||s.y==null)return null;let a=e?`${e}/test_screenshots`:"";return{x:s.x,y:s.y,confidence:0,bbox:s.bbox??null,bbox_source:s.bbox?"accessibility_tree":"fallback",viewport_width:s.viewport_width??1280,viewport_height:s.viewport_height??800,scale_factor:null,raw_image_url:a?`${a}/untagged_screenshot/${n}.${i?.get(n)??"png"}`:"",raw_image_sas_url:"",annotated_image_url:"",annotated_image_sas_url:""}}function V(t,e={},n="",i){let s=t.action_type,a=X(s,t),o=t.action_params??{},l=t.coordinates??null,r=t.selectors??null,c=!!(r&&r.length>0),u=t.timestamp??"",p=t.duration_ms??0,_=t.variables_used??{},d=t.action_id??A(),g=A(),m=Y(u,p),f="",h="";if(s==="navigate")h=o.url??"",f=h;else if(s==="type"||s==="fill")f=o.text??"";else if(s==="press_key")f=o.key??"";else if(s==="wait")f=String(o.ms??o.timeout_ms??"");else if(s==="evaluate_js")f=o.script??"";else if(s==="upload_files"){let y=S(o);y&&(f=N(y.name))}else s==="analyze"&&a==="SET_VARIABLE"&&(f=t.output_value??"");let b="";s==="go_back"?b="back":s==="go_forward"&&(b="forward");let I=L(f,e),v=L(h,e),O=L(t.action_instruction??"",e),R=ue(t,a,_);return{operation_id:d,instruction_id:g,instruction:O,intent:O,operation_start:u,operation_end:m,status:t.status??"",command:a,name:"",target:"",value:I,message:"",operation_dict:"",frame:t.frame_info?JSON.stringify(t.frame_info):"",error_message:t.error??"",code_snippet:"",sub_instruction_obj:JSON.stringify(R),test_id:"",test_version:"",action:"",string_to_float:!1,feedback_msg:"",time_taken:"",create_time_stamp:"",update_time_stamp:"",locator_variable:"",locator_variable_name:"",image_url:n?`${n}/test_screenshots/untagged_screenshot/${d}.${i?.get(d)??"png"}`:"",alternative_xpaths:[],attribute:"",value_description:"",url:v,navigation_direction:b,tagified_image_url:"",query_variable_name:t.output_variable??"",query_variable_value:t.output_value??"",query_variable_type:"",expected_value:"",queried_value:"",operator:"",assertion_status:a==="ASSERTION"?de(o):"",query_info_dict:{},query_content_confidence:"none",debugging_logs:[],locator_index:0,query_html:"",user_variables:"[]",optional_flag:!1,max_retries:0,retries_delay:0,explicit_wait:0,implicit_wait:0,tab_index:String(o.tab_index??""),tab_identifier:String(o.tab_identifier??""),scroll_value:o.amount??1,scroll_direction:o.direction??"",mi_scroll_payload:{},sleep_duration:0,app_id:"",manual_interaction_tag:"",string_to_float_list:[],js_snippet:s==="evaluate_js"?o.script??"":"",code_error:"",hide:!1,dismiss_dialog:!1,use_v2_mobile_tagging:!1,multiple_inputs:!1,dialog_action:"",dialog_type:"",is_coordinates_used_for_interaction:l!==null&&!c,element_coordinates_ratio:[],element_bounds_ratio:[],x_coord:c?null:l?.x??null,y_coord:c?null:l?.y??null,target_x_coord:o.target_x??null,target_y_coord:o.target_y??null,source_description:o.source_description??null,target_description:o.target_description??null,use_coordinates:l!==null&&!c,kaneaiMobileTaggingImageLimit:1,clicks_order_code:"se_js_ac",selector:c?r.map(y=>({type:y.isXPath?"xpath":"css",...y})):"",selector_target:"",math_result_variable_name:"",math_result_variable_value:"",expression_tree:a==="ASSERTION"?_e(o):o.expression_tree??{},assertion_tree:o.assertion_tree??{},assertion_tree_simplified:{},network_throttle:{},is_mobile_offline:!1,autoheal:!1,db_query:"",db_details:{},db_query_decoded:"",is_global_variable:!1,is_global_variable_persist:!1,global_variable_id:"",wait_for_element_timeout:0,failure_condition:a==="ASSERTION"?"Fail test immediately":"",screenshot_command:"",smartui_contents:{},smartui_results:{},result_type:"",result_hint:"",drag_offset:{},start_coordinates:o.source_coordinates?{x:o.source_coordinates[0],y:o.source_coordinates[1]}:{},end_coordinates:o.target_coordinates?{x:o.target_coordinates[0],y:o.target_coordinates[1]}:{},element_rect:null,is_canvas:!1,until_condition:"",until_max_retries:0,until_settle_ms:0,api_data:s==="api"?{request:t.action_params?.api_data?.request??{}}:{},output_variables:s==="api"?t.output_variable?{[t.output_variable]:null}:{}:t.output_variable?{[t.output_variable]:t.output_value??""}:{},visual_context:ge(t,n,d,i),reasoning:s==="analyze"?o.query??"":t.intent??t.action_instruction??""}}function q(t,e,n={}){let i=t.action_type,s=X(i,t),a=t.timestamp??"",o=t.duration_ms??0,l=Y(a,o),r=s==="ASSERTION"||s==="MATHEMATICAL_OPERATION";return{instruction_id:e.instruction_id,instruction_class:r?"non_driver_action":"driver_action",module_id:"",instruction:L(t.action_instruction??"",n),command:s,error:null,parent_instruction_id:"",classification_layer_resp:s==="ASSERTION"?pe(t):[],classification_error:{},operations:[e],status:t.status??"",start_timestamp:a,end_timestamp:l,type:"agent_generated",tags:[],html_paths:[],optional_flag:!1,max_retries:0,retries_delay:0,explicit_wait:0,implicit_wait:0,content_type:i==="api"?"api":i==="analyze"&&t.action_params?.analyzer_type==="api_response"?"api_calls_query":i==="analyze"&&t.action_params?.analyzer_type?.startsWith("devtool_")?t.action_params.analyzer_type.replace("devtool_","devtools_"):"instruction",js_snippet:i==="evaluate_js"?t.action_params?.script??"":"",user_variables:i==="api"?ce(t):"[]",api_data:i==="api"?{request:t.action_params?.api_data?.request??{},response:W(t)}:{},params_used:!1,hard_assertion:s==="ASSERTION"?t.action_params?.failure_condition==="hard":!1,expected_outcome:"",module_execution_index:0,module_version:null,network_throttle:{},isEdited:!1,use_query_assertion_v2:!1,db_query:"",db_details:{},network_assertion_content:{},screenshot_command:"",smartui_contents:{},generative_id:"",plan_id:"",generative_objective:"",error_message:"",error_code:"",reason:"",title:"",used_variables:[],reasoning:i==="analyze"?t.action_params?.query??"":t.intent??t.action_instruction??""}}function fe(t,e=[]){let n=t.action_params??{},i=n.branches??[],s=n.winning_index??-1,a=n.sub_results??[],o={};for(let r of a){let c=r.sub_results;if(c)for(let u of c){let p=u.store_key;p&&(o[p]=u)}}let l=i.map((r,c)=>{let u=c===s,p=(r.sub_checks??[]).map(_=>{let d=o[_.store_key];return{description:_.description,store_key:_.store_key,expected_value:_.expected_value,stored_value:d?.extracted_value??_.stored_value,operator:_.operator??d?.operator??"equals",transforms:_.transforms??d?.transforms??[]}});if(p.length===0&&r.condition&&a.length>0){let d=a.find(g=>g.branch_index===c)?.sub_results??[];d.length>0&&(p=d.map(g=>({description:g.description??r.condition,store_key:g.store_key??"",expected_value:g.expected??"true",stored_value:g.extracted_value??void 0,operator:g.operator??"equals",transforms:g.transforms??[]})))}return{branch_index:c,condition:r.condition??null,branch_type:r.branch_type??"sub_objective",passed:u,sub_objective:null,custom_event:r.custom_event??null,children:u?e:[],sub_checks:r.condition?p:[],composite_operator:r.composite_operator??"and"}});return{content_type:"conditional_block",instruction_id:`if_else_${A().slice(0,8)}`,instruction:t.action_instruction??"",instruction_class:"driver_action",command:"",status:t.status??"success",resolved_branch_index:s,branches:l,generative_id:"",generative_objective:"",variables_used:{},classification_layer_resp:[],classification_error:{},used_variables:[],user_variables:"[]",module_id:"",module_execution_index:0,module_version:"",plan_id:"",optional_flag:!1,max_retries:0,retries_delay:0,explicit_wait:0,implicit_wait:0,error:null,error_message:"",error_code:"",reason:"",start_timestamp:t.timestamp??"",end_timestamp:"",type:"agent_generated",hook:null,hook_type:null,evaluation_context:{},query_variables:{}}}function J(t,e,n){for(let i of t)i.content_type==="instruction"&&"generative_id"in i&&(i.generative_id=e,i.generative_objective=n)}function w(t,e={},n="",i,s){let a=[],o=0;for(;o<t.length;){let l=t[o],r=l.action_type;if(!s?.keepFailedActions&&l.status==="error"&&r!=="assert"&&r!=="if_else"&&r!=="child_agent_start"&&r!=="child_agent_end"&&!(l.until_condition&&!l.error)){o+=1;continue}if(r==="analyze"&&!G[l.action_params?.analyzer_type??""]){o+=1;continue}if(r==="child_agent_start"){let c=l.action_params?.child_id??"",u=l.action_params?.objective??"",p=[];o+=1;let _=1,d="error",g;for(;o<t.length&&_>0;){let R=t[o],y=R.action_type;if(y==="child_agent_start")_+=1;else if(y==="child_agent_end"&&(_-=1,_===0)){d=R.status??"success",g=R,o+=1;break}_>0&&p.push(R),o+=1}let m=w(p,e,n,i);J(m,c,u);let f=g?.action_params?.result_code??null,h=g?.action_params?.reason_code??null,b=g?.action_params?.error_message??null,I=g?.action_params?.summary??null,v=g?.action_params?.one_liner??null,O=d==="error";a.push({content_type:"generative_block",instruction_id:`generative_block_${c}`,generative_id:c,objective:u,status:d,children:m,error_message:O?b??null:null,error_code:O?h??null:null,result_code:f??null,bifurcation_context:[],approach_reason:K(I),one_liner:v??null});continue}else if(r==="child_agent_end"){o+=1;continue}else if(r==="if_else"){o+=1;let c=[];for(;o<t.length&&t[o].action_type==="child_agent_start";){let u=t[o],p=u.action_params?.child_id??"",_=u.action_params?.objective??"",d=[];o+=1;let g=1,m="error";for(;o<t.length&&g>0;){let h=t[o];if(h.action_type==="child_agent_start")g+=1;else if(h.action_type==="child_agent_end"&&(g-=1,g===0)){m=h.status??"success",o+=1;break}g>0&&d.push(h),o+=1}let f=w(d,e,n,i);c.push(...f)}a.push(fe(l,c));continue}else if(r==="query_tool"){o+=1;continue}else if(l.until_condition){let c=V(l,e,n,i),u=q(l,c,e),p=typeof l.until_condition_met=="boolean"?l.until_condition_met:l.status==="success";a.push({content_type:"until_block",instruction_id:`until_${A().slice(0,8)}`,condition:l.until_condition,max_retries:l.until_max_retries??10,settle_ms:l.until_settle_ms??500,current_count:0,condition_met:p,children:[u],generative_id:"",generative_objective:"",variables_used:{},status:l.status??"success"})}else{let c=V(l,e,n,i),u=q(l,c,e);a.push(u)}o+=1}return a}function T(t,e={},n="",i,s){let a=[];for(let o of t){let l=w(o.records,e,n,i,s);if(l.length===0)continue;let r=A().replace(/-/g,"");J(l,r,o.objective);let c=l.some(d=>"status"in d&&typeof d.status=="string"?d.status==="error"||d.status==="failed":!1),u=o.resultCode?parseInt(o.resultCode,10):null,p=u!==null&&!isNaN(u)&&u>=200,_=c||p?"error":"success";a.push({content_type:"generative_block",instruction_id:`generative_block_${r}`,generative_id:r,objective:o.objective,status:_,children:l,error_message:_==="error"?o.errorMessage??null:null,error_code:_==="error"?o.reasonCode??null:null,result_code:o.resultCode??null,bifurcation_context:[],approach_reason:K(o.summary),one_liner:o.oneLiner??null})}return{instructions:a}}var Z=se(oe(),1);import{createWriteStream as me}from"fs";import{readFile as he}from"fs/promises";import{join as Ee,basename as be}from"path";import{tmpdir as Ie}from"os";var ve=["**/screenshots/**","**/annotated/**","**/tcg/**","**/bifurcation/**"];async function Q(t){let e=Ee(Ie(),`${be(t)}_artifacts.zip`);return new Promise((n,i)=>{let s=me(e),a=(0,Z.default)("zip",{zlib:{level:6}});s.on("close",()=>n(e)),a.on("error",i),a.pipe(s),a.glob("**/*",{cwd:t,ignore:ve}),a.finalize()})}async function ee(t){return he(t)}async function Pe(t,e){return ne(z(t,e))}function Ae(t){return{key:"artifacts",content_type:"application/zip",filename:`${t}.evidence`}}var ie=class{config;controller;testId;constructor(e){this.config=e,this.controller=new F(e.controllerBaseUrl,e.auth),this.testId=e.testId}log(e,n,i,s){this.config.log?.(e,n,i,s)}async execute(){let{onProgress:e}=this.config;try{if(!this.testId)return this.log("error","PIPELINE_ABORT","No test_id available"),{success:!1,testId:null,error:"No test_id available"};let n=this.config.evidence,i=null;if(this.config.shouldUploadArtifacts!==!1){e("convert","running");let l=this.collectNdjsonPerRun(),r=l.reduce((m,f)=>m+f.records.length,0);this.log("info","PIPELINE_CONVERT","Collected NDJSON records",{total_records:r,run_groups:l.length});let c=this.config.variables??{};this.log("info","PIPELINE_CONVERT_VARS","Variables for template resolution",{keys:Object.keys(c)});let{instructions:u}=l.length>0?T(l,c,this.config.screenshotBaseUrl??"",this.config.screenshotExtMap):{instructions:[]};this.log("info","PIPELINE_CONVERT_INSTRUCTIONS","Auteur instructions produced",{count:u.length});let p=this.buildExecutionEnvelope(u),_=Buffer.from(JSON.stringify(p));this.log("info","PIPELINE_CONVERT_BLOB","Blob created",{size_kb:+(_.length/1024).toFixed(1)});let d=E(this.config.sessionDir,"execution.json");x(d,JSON.stringify(p,null,2)),this.log("info","PIPELINE_CONVERT_LOCAL_SAVE","Execution blob saved locally",{path:d});let g=n?.packTestDir??this.config.evidenceRead?.packTestDir;if(g){let m=E(g,"auteur");D(m,{recursive:!0}),x(E(m,"execution.json"),JSON.stringify(p,null,2)),this.log("info","PIPELINE_CONVERT_PACK_COPY","Execution blob copied into pack",{path:E(m,"execution.json")})}if(e("convert","done"),n)i=_;else{e("zip","running"),this.log("info","PIPELINE_ZIP_START","Zipping session",{session_dir:this.config.sessionDir});let m=null,f;try{m=await Q(this.config.sessionDir),f=await ee(m),this.log("info","PIPELINE_ZIP_DONE","Zip complete",{size_mb:+(f.length/1024/1024).toFixed(1),path:m}),e("zip","done",`${(f.length/1024/1024).toFixed(1)}MB`)}finally{m&&await Re(m).catch(()=>{})}e("presign","running"),this.log("info","PIPELINE_PRESIGN_START","Requesting presigned URLs",{url:`${this.config.controllerBaseUrl}/upload/presign`,test_id:this.testId,session_id:this.config.sessionId});let h=await this.controller.getPresignedUrls(this.testId,this.config.sessionId,[{key:"artifacts",content_type:"application/zip",filename:`${this.config.sessionId}_artifacts.zip`},{key:"blob",content_type:"application/json",filename:`${this.config.commitId}.json`}]);this.log("info","PIPELINE_PRESIGN_OK","Presigned URLs received",{artifacts_url:h.urls.artifacts?.blob_url,blob_url:h.urls.blob?.blob_url}),e("presign","done"),e("upload","running"),this.log("info","PIPELINE_UPLOAD_START","Uploading artifacts and blob",{artifact_size_mb:+(f.length/1024/1024).toFixed(1),blob_size_kb:+(_.length/1024).toFixed(1)}),await Promise.all([P(h.urls.artifacts.upload_url,f,"application/zip"),P(h.urls.blob.upload_url,_,"application/json")]),this.log("info","PIPELINE_UPLOAD_OK","Upload complete"),e("upload","done")}}else{let l=this.collectNdjsonPerRun(),r=this.config.variables??{},{instructions:c}=l.length>0?T(l,r,this.config.screenshotBaseUrl??"",this.config.screenshotExtMap,{keepFailedActions:!0}):{instructions:[]},u=this.buildExecutionEnvelope(c),p=E(this.config.sessionDir,"execution.json");x(p,JSON.stringify(u,null,2)),this.log("info","PIPELINE_LOCAL_SAVE","Execution blob saved locally (no upload)",{path:p});let _=this.config.evidence?.packTestDir??this.config.evidenceRead?.packTestDir;if(_){let d=E(_,"auteur");D(d,{recursive:!0});let g=this.readAuthoredExecution();x(E(d,"execution.json"),g??JSON.stringify(u,null,2)),this.log("info","PIPELINE_CONVERT_PACK_COPY","Execution blob copied into pack (gated)",{path:E(d,"execution.json"),source:g?"authored":"run_envelope"})}e("convert","skipped"),e("zip","skipped"),e("presign","skipped"),e("upload","skipped"),this.log("info","PIPELINE_UPLOAD_SKIPPED","Upload steps skipped (gate disabled)")}if(this.config.shouldReplaceLocalOutput&&this.config.onAtomicReplace){e("atomic_replace","running");try{await this.config.onAtomicReplace(),this.log("info","PIPELINE_ATOMIC_REPLACE_OK","Local output replaced"),e("atomic_replace","done")}catch(l){let r=l instanceof Error?l.message:String(l);throw this.log("error","PIPELINE_ATOMIC_REPLACE_FAILED","Atomic-replace failed",{error:r}),e("atomic_replace","failed",r),l}}else e("atomic_replace","skipped");let s,a;if(this.config.shouldCommit&&!this.config.isFirstRun&&this.config.onCommitLock){e("commit_lock","running");let l=await this.config.onCommitLock();if(l.ok)s=l.testcaseId,this.log("info","PIPELINE_COMMIT_LOCK_OK","Commit lock acquired",{testcase_id:s??"none"}),e("commit_lock","done");else return this.log("error","PIPELINE_COMMIT_LOCK_FAILED","Commit lock failed",{reason:l.reason,message:l.message}),e("commit_lock","failed",`${l.reason??"unknown"}: ${l.message??""}`),{success:!1,testId:this.testId,error:`commit-lock failed: ${l.reason??"unknown"}`}}else e("commit_lock","skipped");if(this.config.isFirstRun&&!this.config.skipTmsFinalize){e("finalize","running"),this.log("info","PIPELINE_FINALIZE_START","Finalizing test (first-run)",{test_id:this.testId,commit_id:this.config.commitId});let l=new U(this.config.tmsBaseUrl,this.config.tmsUsername,this.config.tmsAccessKey),r=this.config.runObjectives&&this.config.runObjectives.length>0?this.config.runObjectives:[this.config.firstObjective];if(s=(await l.endTest(this.testId,{commit_id:this.config.commitId,time_taken:Math.round(this.config.totalDuration),steps_count:this.config.totalSteps,commit_message:this.config.firstObjective.slice(0,255),objectives:r})).testcase_id||void 0,this.log("info","PIPELINE_FINALIZE_OK","Test finalized",{testcase_id:s??"none"}),this.config.onFinalizeSuccess)try{await this.config.onFinalizeSuccess(s)}catch(u){this.log("warn","PIPELINE_FINALIZE_META_FAILED","Meta-rewrite after endTest failed",{error:String(u)})}e("finalize","done")}else e("finalize","skipped"),this.log("info","PIPELINE_FINALIZE_SKIPPED","Finalize skipped (evolve flow or first-run disabled)");if(s&&this.config.shareApiBaseUrl)try{a=await this.generateShareLink(s),this.log("info","PIPELINE_SHARE_OK","Share link generated",{share_id:a})}catch(l){this.log("warn","PIPELINE_SHARE_FAILED","Share link failed",{error:String(l)})}if(n&&i){let l=null;e("zip","running");try{await n.sealFn({testcaseId:s,shareId:a}),l=n.sealedPackPath?await ne(n.sealedPackPath):await Pe(n.executionId,n.cwd),this.log("info","PIPELINE_EVIDENCE_SEALED","Evidence pack sealed",{execution_id:n.executionId}),this.log("info","PIPELINE_PACK_READ","Sealed pack read",{size_mb:+(l.length/1024/1024).toFixed(1)})}catch(r){let c=r instanceof Error?r.message:String(r);this.log("warn","PIPELINE_EVIDENCE_UPLOAD_SKIPPED","Evidence seal/read failed \u2014 uploading blob only",{execution_id:n.executionId,error:c})}if(l){e("zip","done",`${(l.length/1024/1024).toFixed(1)}MB`),e("presign","running");let r=await this.controller.getPresignedUrls(this.testId,this.config.sessionId,[Ae(n.executionId),{key:"blob",content_type:"application/json",filename:`${this.config.commitId}.json`}]);this.log("info","PIPELINE_PRESIGN_OK","Presigned URLs received",{artifacts_url:r.urls.artifacts?.blob_url,blob_url:r.urls.blob?.blob_url}),e("presign","done"),e("upload","running"),this.log("info","PIPELINE_UPLOAD_START","Uploading pack and blob",{artifact_size_mb:+(l.length/1024/1024).toFixed(1),blob_size_kb:+(i.length/1024).toFixed(1)}),await Promise.all([P(r.urls.artifacts.upload_url,l,"application/zip"),P(r.urls.blob.upload_url,i,"application/json")]),this.log("info","PIPELINE_UPLOAD_OK","Upload complete"),e("upload","done")}else{e("zip","skipped"),e("presign","running");let r=await this.controller.getPresignedUrls(this.testId,this.config.sessionId,[{key:"blob",content_type:"application/json",filename:`${this.config.commitId}.json`}]);e("presign","done"),e("upload","running"),this.log("info","PIPELINE_UPLOAD_START","Uploading blob only (evidence skipped)",{blob_size_kb:+(i.length/1024).toFixed(1)}),await P(r.urls.blob.upload_url,i,"application/json"),this.log("info","PIPELINE_UPLOAD_OK","Blob upload complete (pack skipped)"),e("upload","done")}}let o;if(this.config.codeExport?.enabled&&s){let l=!1;try{await this.triggerCodeExport(s),this.log("info","PIPELINE_CODE_EXPORT_START","Code export triggered"),l=!0}catch(r){let c=r instanceof Error?r.message:String(r);this.log("error","PIPELINE_CODE_EXPORT_FAILED","Code export trigger failed; skipping poll",{error:c}),e("code_export","failed",`trigger failed: ${c}`)}if(l){e("code_export","running","Waiting for code generation\u2026");try{o=await this.pollAndDownloadCode(s,e),this.log("info","PIPELINE_CODE_EXPORT_OK","Code export complete",{dir:o}),e("code_export","done",o)}catch(r){let c=r instanceof Error?r.message:String(r);this.log("error","PIPELINE_CODE_EXPORT_FAILED","Code export failed",{error:c}),e("code_export","failed",c)}}}else e("code_export","skipped");return this.log("info","PIPELINE_COMPLETE","Pipeline complete"),{success:!0,testId:this.testId,testcaseId:s,shareId:a,codeExportDir:o}}catch(n){return{success:!1,testId:this.testId,error:n instanceof Error?n.message:String(n)}}}async runCodeExport(e,n){let i=n??this.config.onProgress,s=!1;try{await this.triggerCodeExport(e),this.log("info","PIPELINE_CODE_EXPORT_TRIGGER","Code export triggered",{testcase_id:e}),s=!0}catch(a){let o=a instanceof Error?a.message:String(a);this.log("error","PIPELINE_CODE_EXPORT_TRIGGER_FAILED","Code export trigger failed; skipping poll",{error:o}),i("code_export","failed",`trigger failed: ${o}`)}if(s){i("code_export","running","Waiting for code generation\u2026");try{let a=await this.pollAndDownloadCode(e,i);return this.log("info","PIPELINE_CODE_EXPORT_OK","Code export complete",{dir:a}),i("code_export","done",a),a}catch(a){let o=a instanceof Error?a.message:String(a);this.log("error","PIPELINE_CODE_EXPORT_FAILED","Code export failed",{error:o}),i("code_export","failed",o);return}}}collectNdjsonPerRun(){let e=[],n=this.config.runObjectives??[],i=this.config.runMetadata??[],s=this.config.evidence??this.config.evidenceRead;for(let a=0;a<this.config.runDirs.length;a++){let o=this.config.runDirs[a],l=n[a]||this.config.firstObjective,r=i[a],c=s?this.readNdjsonFromFile(E(s.packTestDir,"logs",`${s.runIndices?.[a]??a}-actions.ndjson`)):this.readNdjsonFromDir(o);c.length>0&&e.push({objective:l,records:c,resultCode:r?.resultCode,reasonCode:r?.reasonCode,errorMessage:r?.errorMessage,summary:r?.summary,oneLiner:r?.oneLiner})}if(e.length===0){let a=E(this.config.sessionDir,"runs");if(C(a))try{let l=ye(a,{withFileTypes:!0}).filter(r=>r.isDirectory()).map(r=>r.name).sort();for(let r of l){let c=E(a,r),u=this.readNdjsonFromDir(c);u.length>0&&e.push({objective:this.config.firstObjective,records:u})}}catch{}}return e}readNdjsonFromDir(e){let n=[E(e,"run-test","actions.ndjson"),E(e,"actions.ndjson")];for(let i of n)if(C(i))return this.readNdjsonFromFile(i);return[]}readNdjsonFromFile(e){let n=[];if(!C(e))return n;this.log("debug","PIPELINE_COLLECT_READ","Reading NDJSON file",{path:e});let i=te(e,"utf-8");for(let s of i.split(`
|
|
5
|
+
`)){let a=s.trim();if(a)try{n.push(JSON.parse(a))}catch{}}return n}async generateShareLink(e){let n=`${this.config.shareApiBaseUrl}/lshs/api/v1.0/share-item/generate-sharable-link`;this.log("info","PIPELINE_SHARE_START","Requesting share link",{url:n,testcase_id:e});let i={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({entityIds:[e],entityType:"Test Case Details",expiresAt:7})},s=!!this.config.authResolver;this.log("debug","PIPELINE_SHARE_AUTH","Share link auth config",{resolver:s,fallback_auth_type:typeof this.config.auth=="string"?"bearer":"basic",tms_user:this.config.tmsUsername});let a=s?await this.config.authResolver.fetch(n,i):await k(n,{...i,headers:{...i.headers,Authorization:this.buildAuthHeader()}});if(!a.ok)throw new Error(`Share link API failed: ${a.status} ${await a.text()}`);let o=await a.json();if(!o.shareId)throw new Error("Share link API returned no shareId");return o.shareId}async triggerCodeExport(e){if(!this.config.codeExport)throw new Error("triggerCodeExport called without resolved codeExport config");let{url:n,body:i}=M({tmsBaseUrl:this.config.tmsBaseUrl,testcaseId:e,codeExport:this.config.codeExport});this.log("info","PIPELINE_CODE_EXPORT_POST","Triggering code export",{url:n});let s={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(i)},a=this.config.authResolver?await this.config.authResolver.fetch(n,s):await k(n,{...s,headers:{...s.headers,Authorization:this.buildAuthHeader()}});if(!a.ok)throw new Error(`Code export failed: ${a.status} ${await a.text()}`)}async pollAndDownloadCode(e,n){let i=B({tmsBaseUrl:this.config.tmsBaseUrl,testcaseId:e}),s=this.config.exitTimeoutMs??3e5,a=5e3,o=Date.now()+s;this.log("info","PIPELINE_CODE_EXPORT_POLL","Polling for code export",{url:i,timeout_ms:s});let l=(r,c)=>this.config.authResolver?this.config.authResolver.fetch(r,c):k(r,{...c,headers:{...c?.headers,Authorization:this.buildAuthHeader()}});for(;Date.now()<o;){let r=await l(i,{method:"GET",headers:{Accept:"application/json"}});if(!r.ok){let d=await r.text().catch(()=>"");throw this.log("warn","PIPELINE_CODE_EXPORT_POLL_FAILED","Code export poll non-200; skipping",{status:r.status,body:d.slice(0,200)}),new Error(`code export poll skipped: HTTP ${r.status}`)}let u=(await r.json()).data?.find(d=>d.code_name==="kane-cli-trigger");if(!u){this.log("debug","PIPELINE_CODE_EXPORT_WAITING","No kane-cli-trigger entry yet"),n("code_export","running","Waiting for code generation\u2026"),await this.sleep(a);continue}let p=u.status.toLowerCase();if(p==="in progress"||p==="in_progress"||p==="pending"){this.log("debug","PIPELINE_CODE_EXPORT_IN_PROGRESS","Code export in progress",{status:u.status}),n("code_export","running","Generating code\u2026"),await this.sleep(a);continue}if(!u.url||u.url.length===0)throw new Error(`Code export status=${u.status} but no files returned`);let _=this.config.codeExportDir??E(this.config.sessionDir,"code-export");D(_,{recursive:!0}),this.log("info","PIPELINE_CODE_EXPORT_DOWNLOAD","Downloading code files",{file_count:u.url.length,dir:_}),n("code_export","running",`Downloading ${u.url.length} files\u2026`);for(let d of u.url){let g=E(_,d.file_name),m=await k(d.file_url);if(!m.ok){this.log("warn","PIPELINE_CODE_EXPORT_FILE_FAILED","Failed to download file",{file_name:d.file_name,status:m.status});continue}let f=await m.text();x(g,f,"utf-8"),this.log("info","PIPELINE_CODE_EXPORT_FILE_SAVED","File saved",{file_name:d.file_name,size_bytes:f.length})}return _}throw new Error("Code export timed out")}sleep(e){return new Promise(n=>setTimeout(n,e))}buildAuthHeader(){return typeof this.config.auth=="string"?`Bearer ${this.config.auth}`:j(this.config.auth.username,this.config.auth.accessKey)}readAuthoredExecution(){let e=this.config.authoredExecutionPath;if(!e)return null;try{let n=te(e,"utf8");return JSON.parse(n),n}catch{return this.log("warn","PIPELINE_AUTHORED_BLOB_UNREADABLE","Authored execution.json missing/unreadable \u2014 pack gets this run's envelope",{path:e}),null}}buildExecutionEnvelope(e){let n=this.config.runStatuses.every(r=>r==="passed")?"success":"error",i=this.config.variableIds??{},s=[];if(this.config.variables)for(let[r,c]of Object.entries(this.config.variables)){if(c.secret)continue;let u=r.startsWith("global.")?r.slice(7):r;s.push({id:i[u]??0,name:u,value:c.value,session_value:c.value,is_persist:!1,environment_id:0,environment_name:"No Env"})}let a=[],o=[],l=new Set;for(let r of this.collectNdjsonPerRun())for(let c of r.records)if(c.output_variable&&c.output_value!=null&&a.push({name:c.output_variable,value:String(c.output_value),value_type:"test_level",variable_description:"ANALYZE result"}),c.action_type==="upload_files"){let u=S(c.action_params);if(u){let p=u.media_id||u.media_url;if(!l.has(p)){l.add(p),o.push({media_url:u.media_url,media_id:u.media_id,name:u.name,type:u.type});let _=N(u.name);a.push({name:$(u.name),value:_,value_type:"string",variable_description:`variable for ${_}`})}}}return{test_id:this.testId,version:"v4",session_id:this.config.sessionId,org_id:String(this.config.orgId),user_id:String(this.config.userId),url:this.config.firstUrl??"",start_timestamp:this.config.startedAt,end_timestamp:this.config.endedAt,status:n,commit_id:this.config.commitId,instructions:e,modules:[],uploaded_files:o,test_params:[],test_level_variables:JSON.stringify(a),test_global_variables:s,max_network_wait:0,wait_buffer:0,network_throttle:{},secrets:this.config.secrets??[],totp:[],environment_id:0,environment:"",mobile_browser:!1,native_popups:[],smartui:{},module_index:0}}};export{Pe as a,Ae as b,ie as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c as o}from"./chunk-
|
|
2
|
+
import{c as o}from"./chunk-RN4OSVTG.js";import{a as n}from"./chunk-BC7UVJJB.js";import{existsSync as c}from"fs";function s(t,r){(t.err??t.out)(`error: ${r}`)}function a(t,r){let e=n(t);return c(e)?e:(s(r,"no context store here (run `kane-cli context ingest <files>` first)"),null)}async function p(t,r,e){return e?!0:t.isTTY?t.confirm(`${r}?`):(s(t,`refusing to ${r} without --yes (no TTY to confirm)`),!1)}function d(){return{out:t=>process.stdout.write(t+`
|
|
3
3
|
`),err:t=>process.stderr.write(t+`
|
|
4
4
|
`),isTTY:o(),confirm:async t=>{let{createInterface:r}=await import("readline/promises"),e=r({input:process.stdin,output:process.stdout});try{let i=await e.question(`${t} [y/N] `);return/^y(es)?$/i.test(i.trim())}finally{e.close()}},ask:async t=>{let{createInterface:r}=await import("readline/promises"),e=r({input:process.stdin,output:process.stdout});try{return await e.question(t)}finally{e.close()}}}}export{s as a,a as b,p as c,d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as c}from"./chunk-
|
|
2
|
+
import{d as c}from"./chunk-ZG2V2ODK.js";import{d as l}from"./chunk-5YPBPZUR.js";function h(f,o,u){let n=o.resolve(u);if(!n)return{target:null,entries:[]};let t=new Set([n.cid]),r=n.cid;for(;o.superseded.has(r);){let s=o.superseded.get(r);if(typeof s!="string"||t.has(s))break;t.add(s),r=s}let d=o.nodeLabel.get(n.cid)??"(unknown)",{records:p}=c(f),i=[];for(let s of p){for(let e of s.nodes)t.has(e.cid)&&i.push({seq:s.seq,ts:s.ts,kind:"minted",detail:`minted ${e.label} ${e.cid}`});for(let e of s.judgements??[])t.has(e.about)&&i.push({seq:s.seq,ts:s.ts,kind:"judgement",rationale:e.rationale,detail:`judgement on ${e.about}`,by:e.by});for(let e of s.review)t.has(e.id)&&i.push({seq:s.seq,ts:s.ts,kind:"review",detail:`${e.resolution}${e.reason?` \u2014 ${e.reason}`:""}`,by:e.by});for(let e of s.supersessions)e.kind==="node"&&(t.has(e.old)||e.new!==null&&t.has(e.new))&&i.push({seq:s.seq,ts:s.ts,kind:"supersession",detail:`${e.old} \u2192 ${String(e.new)} \u2014 ${e.reason}`,by:e.by});for(let e of s.names??[])t.has(e.cid)&&i.push({seq:s.seq,ts:s.ts,kind:"name",detail:`named ${e.slug}`,by:e.by});if(d===l.SOURCE)for(let[e,a]of Object.entries(s.source_head_moves))(t.has(a??"")||o.heads.get(e)!==void 0&&t.has(n.cid)&&e===o.getNode(n.cid)?.content?.source_id)&&i.push({seq:s.seq,ts:s.ts,kind:"head_move",detail:`${e} head \u2192 ${String(a)}`})}return i.sort((s,e)=>e.seq-s.seq),{target:{cid:n.cid,tip:n.tip,label:d,slug:o.nameOf.get(n.cid)},entries:i}}export{h as a};
|