shiplightai 0.1.78 → 0.1.79

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/index.js CHANGED
@@ -4365,10 +4365,10 @@ ${m.join(`
4365
4365
  `)}function sc(e,t){let i=[],a=t?.version||"unknown";i.push(`// @generated by shiplightai v${a}`),i.push(...uo()),i.push(""),t?.use&&Object.keys(t.use).length>0&&(i.push(`test.use(${JSON.stringify(t.use,null,2)});`),i.push(""));let n=new Set,o={imports:n,actionEntityStore:t?.actionEntityStore},r=t?.testName||"Test Suite",s=On(t?.tags);i.push(`test.describe.serial('${s}${he(r)}', () => {`),e.beforeAll&&e.beforeAll.length>0&&(i.push(...bi("beforeAll",e.beforeAll,o,1)),i.push("")),e.beforeEach&&e.beforeEach.length>0&&(i.push(...bi("beforeEach",e.beforeEach,o,1)),i.push(""));for(let c=0;c<e.tests.length;c++){let d=e.tests[c],h=d.timeout||d.skip!==void 0||d.fail!==void 0||d.only||d.slow?{timeout:d.timeout,skip:d.skip,fail:d.fail,only:d.only,slow:d.slow}:void 0;if(d.parameters&&d.parameters.length>0)for(let m of d.parameters)i.push(...vi(d.testFlow,`${he(d.name)} [${he(m.name)}]`,o,1,h,m.name,m.values)),i.push("");else i.push(...vi(d.testFlow,he(d.name),o,1,h)),(c<e.tests.length-1||e.afterEach||e.afterAll)&&i.push("")}return e.afterEach&&e.afterEach.length>0&&(i.push(...bi("afterEach",e.afterEach,o,1)),i.push("")),e.afterAll&&e.afterAll.length>0&&i.push(...bi("afterAll",e.afterAll,o,1)),i.push("});"),ho(i,n),i.join(`
4366
4366
  `)}function On(e){return e&&e.length>0?e.map(t=>`@${t}`).join(" ")+" ":""}var lc=["testContext","request"];function xi(e){let t=new Set;function i(a){for(let n of a)switch(n.type){case de.ACTION:{let r=n.action_entity?.action_data?.kwargs;if(r?.args&&Array.isArray(r.args))for(let s of r.args)typeof s=="string"&&lc.includes(s)&&t.add(s);break}case de.STEP:i(n.statements);break;case de.IF_ELSE:{let o=n;i(o.then),o.else&&i(o.else);break}case de.WHILE_LOOP:i(n.body);break}}return i(e),t}function cc(e){let t=xi(e.statements??[]);if(e.teardown)for(let i of xi(e.teardown))t.add(i);return t}function Rn(e){return`{ ${["page","agent",...Array.from(e).sort()].join(", ")} }`}function vi(e,t,i,a=0,n,o,r){let s=" ".repeat(a),l=[],c=cc(e),d=Rn(c),h=n?.only?"test.only":"test",m=o?`, { tag: '@${he(o)}' }`:"";if(l.push(`${s}${h}('${t}'${m}, async (${d}) => {`),n?.skip===!0?l.push(`${s} test.skip();`):typeof n?.skip=="string"&&l.push(`${s} test.skip(true, '${he(n.skip)}');`),n?.fail===!0?l.push(`${s} test.fail();`):typeof n?.fail=="string"&&l.push(`${s} test.fail(true, '${he(n.fail)}');`),n?.slow&&l.push(`${s} test.slow();`),n?.timeout&&l.push(`${s} test.setTimeout(${n.timeout});`),r){for(let[y,b]of Object.entries(r))l.push(`${s} agent.agentServices.saveVariable(${JSON.stringify(y)}, ${JSON.stringify(b)});`);l.push("")}let g=e.teardown&&e.teardown.length>0,w=a+1;if(g){if(l.push(`${s} try {`),e.statements&&e.statements.length>0){l.push(`${s} // Test steps`);let b=pe(e.statements,w+1,i);l.push(...b)}l.push(`${s} } finally {`),l.push(`${s} // Teardown`);let y=pe(e.teardown,w+1,i,"teardown");l.push(...y),l.push(`${s} }`)}else if(e.statements&&e.statements.length>0){l.push(`${s} // Test steps`);let y=pe(e.statements,w,i);l.push(...y)}return l.push(`${s}});`),l}function ro(e,t,i){let a=[],n=co(t),o=xi(n),r=Rn(o);return a.push(`test.${e}(async (${r}) => {`),a.push(...pe(n,1,i,e)),a.push("});"),a}function bi(e,t,i,a){let n=" ".repeat(a),o=[],r=co(t);if(e==="beforeAll"||e==="afterAll"){let l={...i,noAgent:!0};o.push(`${n}test.${e}(async ({ browser }, workerInfo) => {`),o.push(`${n} const page = await browser.newPage({ baseURL: workerInfo.project.use.baseURL });`),o.push(...pe(r,a+1,l,e)),o.push(`${n} await page.close();`),o.push(`${n}});`)}else{let l=xi(r),c=Rn(l);o.push(`${n}test.${e}(async (${c}) => {`),o.push(...pe(r,a+1,i,e)),o.push(`${n}});`)}return o}function co(e){let i=zl({goal:"_hook",statements:e});return xe(i).statements??[]}function uo(){return["import { test, expect } from 'shiplightai/fixture';"]}function ho(e,t){if(t.size>0){let i=0;for(let n=0;n<e.length;n++)e[n].startsWith("import ")&&(i=n+1);let a=Array.from(t);e.splice(i,0,...a)}}var lo=5;function mo(e,t,i){let a={expandingPaths:new Set([Ln(t)]),depth:0,referencedPaths:new Set,basePath:i},n={...e};Array.isArray(n.statements)&&(n.statements=Oe(n.statements,t,a)),Array.isArray(n.teardown)&&(n.teardown=Oe(n.teardown,t,a));for(let o of["beforeAll","afterAll","beforeEach","afterEach"])Array.isArray(n[o])&&(n[o]=Oe(n[o],t,a));return{doc:n,referencedTemplatePaths:Array.from(a.referencedPaths)}}function Oe(e,t,i){let a=[];for(let n of e)if(fc(n)){let o=wc(n,t,i);a.push(o)}else a.push(bc(n,t,i));return a}function fc(e){return typeof e=="object"&&e!==null&&typeof e.template=="string"}function wc(e,t,i){if(i.depth>=lo)throw new Error(`Template expansion exceeded maximum depth of ${lo}. Check for deeply nested or circular template references.`);let a=Ln(mc(t),e.template),n=!pc(a)&&i.basePath?Ln(i.basePath,e.template):a;if(i.expandingPaths.has(n))throw new Error(`Circular template reference detected: ${n} is already being expanded. Stack: ${Array.from(i.expandingPaths).join(" \u2192 ")} \u2192 ${n}`);i.referencedPaths.add(n);let o;try{o=hc(n,"utf-8")}catch(w){throw new Error(`Failed to read template file: ${n} (referenced from ${t}): ${w.message}`)}let r=so(o);if(!r||typeof r!="object")throw new Error(`Invalid template file: ${n} \u2014 expected a YAML object`);let s=r.params||[],l=e.params||{};for(let w of s)if(!(w in l))throw new Error(`Template ${e.template} requires param "${w}" but it was not provided. Required params: [${s.join(", ")}]`);let c=r.statements;if(!Array.isArray(c))throw new Error(`Template ${e.template} must have a "statements" array`);if(Object.keys(l).length>0){let y=gc(c);for(let[b,p]of Object.entries(l))y=y.split(`<<${b}>>`).join(String(p));c=so(y)}let d={expandingPaths:new Set([...i.expandingPaths,n]),depth:i.depth+1,referencedPaths:i.referencedPaths},h=Oe(c,n,d),g={STEP:r.name||e.template.replace(/\.yaml$/,"").split("/").pop()||e.template,template_path:e.template,statements:h};return Object.keys(l).length>0&&(g.template_params=l),g}function bc(e,t,i){if(typeof e!="object"||e===null)return e;let a={...e};return Array.isArray(a.statements)&&(a.statements=Oe(a.statements,t,i)),Array.isArray(a.THEN)&&(a.THEN=Oe(a.THEN,t,i)),Array.isArray(a.ELSE)&&(a.ELSE=Oe(a.ELSE,t,i)),Array.isArray(a.DO)&&(a.DO=Oe(a.DO,t,i)),a}var Fn=class extends Error{constructor(e){super(e),this.name="YamlValidationError"}};function Hn(e,t,i){let a=uc(e),n=a?.name,o=a?.tags,r=a?.use;if(a&&(a.name!==void 0||a.tags!==void 0||a.use!==void 0)&&(delete a.name,delete a.tags,delete a.use),a?.suite){if(a.goal||a.statements)throw new Fn('YAML file cannot have both "suite" and top-level "goal"/"statements". Use either suite format or single-test format.');return xc(a,n,o,r,t,i)}return yc(a,n,o,r,t,i)}function yc(e,t,i,a,n,o){let r=e?.beforeEach,s=e?.afterEach,l=go(e?.parameters),c=e?.timeout,d=e?.skip,h=e?.fail,m=e?.only,g=e?.slow;if(e&&(delete e.beforeEach,delete e.afterEach,delete e.parameters,delete e.timeout,delete e.skip,delete e.fail,delete e.only,delete e.slow),e?.url)throw new Fn(`The "url" field is not supported in local YAML tests. Use "base_url: ${e.url}" and add "- URL: /" as the first statement instead.`);e&&!e.goal&&t&&(e.goal=t);let w=[];if(n&&e&&typeof e=="object"){let p=mo(e,n,o);e=p.doc,w=p.referencedTemplatePaths}let y=po(e),b=xe(y);return n&&(Ve(b.statements??[],n,"main"),b.teardown&&Ve(b.teardown,n,"teardown")),{testFlow:b,name:t,tags:i,use:a,beforeEach:r,afterEach:s,parameters:l,timeout:c,skip:d,fail:h,only:m,slow:g,referencedTemplatePaths:w}}function xc(e,t,i,a,n,o){let r=e.suite;if(!Array.isArray(r.tests)||r.tests.length===0)throw new Error('Suite must have a non-empty "tests" array.');let s=r.beforeAll,l=r.afterAll,c=r.beforeEach,d=r.afterEach,h=[],m=r.tests.map(y=>{if(!y.name)throw new Error('Each test in a suite must have a "name" field.');if(!Array.isArray(y.statements)||y.statements.length===0)throw new Error(`Suite test "${y.name}" must have a non-empty "statements" array.`);let b={goal:y.name,statements:y.statements};y.teardown&&(b.teardown=y.teardown);let p=[],x=b;if(n&&typeof b=="object"){let M=mo(b,n,o);x=M.doc,p=M.referencedTemplatePaths,h.push(...p)}let _=po(x),E=xe(_),T=go(y.parameters);return{testFlow:E,name:y.name,tags:Array.isArray(y.tags)?y.tags:void 0,parameters:T,timeout:y.timeout,skip:y.skip,fail:y.fail,only:y.only,slow:y.slow}}),g=r.base_url,w=g?{...a,baseURL:g}:a;return{suite:{beforeAll:s,afterAll:l,beforeEach:c,afterEach:d,tests:m},name:t,tags:i,use:w,referencedTemplatePaths:h}}function go(e){if(!(!Array.isArray(e)||e.length===0))return e.map((t,i)=>{if(!t.name)throw new Error(`Parameter set at index ${i} must have a "name" field.`);if(!t.values||typeof t.values!="object")throw new Error(`Parameter set "${t.name}" must have a "values" object.`);return{name:t.name,values:t.values}})}function Ve(e,t,i){for(let a=0;a<e.length;a++){let n=e[a],o=`${i}.${a}`,r=n.description||"";if(n.uid=vc(t,o,r),n.type===de.STEP)Ve(n.statements,t,o);else if(n.type===de.IF_ELSE){let s=n;Ve(s.then,t,`${o}.then`),s.else&&Ve(s.else,t,`${o}.else`)}else n.type===de.WHILE_LOOP&&Ve(n.body,t,`${o}.body`)}}function vc(e,t,i){let a=dc("sha256").update(`${e}:${t}:${i}`).digest("hex");return`${a.slice(0,8)}-${a.slice(8,12)}-${a.slice(12,16)}-${a.slice(16,20)}-${a.slice(20,32)}`}function fo(e,t,i){let a=/\btemplate:\s/.test(e),n=/^suite:/m.test(e),o=a||n?null:In(e);if(o&&!o.valid)return{valid:!1,errors:o.errors,warnings:[],stats:o.stats};let r,s,l=[];try{let c=i?.parsed??Hn(e,t,i?.basePath);l=c.referencedTemplatePaths;let d={version:i?.version,actionEntityStore:i?.actionEntityStore},h=c.testFlow?.baseURL?{...c.use,baseURL:c.testFlow.baseURL}:c.use;c.suite?r=sc(c.suite,{...d,testName:c.name,tags:c.tags,use:c.use}):r=rc(c.testFlow,{...d,testName:c.name,tags:c.tags,use:h,beforeEach:c.beforeEach,afterEach:c.afterEach,parameters:c.parameters,timeout:c.timeout,skip:c.skip,fail:c.fail,only:c.only,slow:c.slow});let m=r.split(`
4367
4367
  `).filter(g=>!g.startsWith("import ")).join(`
4368
- `);new Function(m),s=t.replace(/\.test\.yaml$/,".yaml.spec.ts"),kc(Sc(s),{recursive:!0}),_c(s,r)}catch(c){let d=c instanceof Fn?"":c.message.includes("Unexpected token")?" This usually means a YAML escaping issue \u2014 in double-quoted strings, use \\\\/ instead of \\/ for regex patterns, or use single quotes / block scalars.":" This may indicate a transpiler bug \u2014 please report it.";return{valid:!1,errors:[`Transpilation failed: ${c.message}.${d}`],warnings:[],stats:o?.stats??{total:0,action:0,draft:0,coverage:0},referencedTemplatePaths:l}}return{valid:!0,errors:[],warnings:o?.warnings??[],stats:o?.stats??{total:0,action:0,draft:0,coverage:0},specFile:s,referencedTemplatePaths:l}}var Wn="0.1.78";function wo(e){try{return Ec(e).mtimeMs}catch{return 0}}var $c=`// @generated by shiplightai v${Wn}`;function Mc(e,t){if(!yo(e)||bo(e,"utf-8").split(`
4368
+ `);new Function(m),s=t.replace(/\.test\.yaml$/,".yaml.spec.ts"),kc(Sc(s),{recursive:!0}),_c(s,r)}catch(c){let d=c instanceof Fn?"":c.message.includes("Unexpected token")?" This usually means a YAML escaping issue \u2014 in double-quoted strings, use \\\\/ instead of \\/ for regex patterns, or use single quotes / block scalars.":" This may indicate a transpiler bug \u2014 please report it.";return{valid:!1,errors:[`Transpilation failed: ${c.message}.${d}`],warnings:[],stats:o?.stats??{total:0,action:0,draft:0,coverage:0},referencedTemplatePaths:l}}return{valid:!0,errors:[],warnings:o?.warnings??[],stats:o?.stats??{total:0,action:0,draft:0,coverage:0},specFile:s,referencedTemplatePaths:l}}var Wn="0.1.79";function wo(e){try{return Ec(e).mtimeMs}catch{return 0}}var $c=`// @generated by shiplightai v${Wn}`;function Mc(e,t){if(!yo(e)||bo(e,"utf-8").split(`
4369
4369
  `,1)[0]!==$c)return!1;let a=wo(e);for(let n of t)if(wo(n)>a)return!1;return!0}function Ic(e){let t=process.argv.slice(2),i=[],a=Un(e);for(let n of t){if(n.startsWith("-"))continue;let o=n.endsWith(".yaml.spec.ts")?n.replace(/\.yaml\.spec\.ts$/,".test.yaml"):n;if(!o.endsWith(".test.yaml"))continue;let r=Un(e,o);yo(r)&&i.push(r.startsWith(a)?r.slice(a.length+1):o)}return i.length>0?i:null}function xo(e){let t=Ic(e.cwd),i=t??Ac("**/*.test.yaml",{cwd:e.cwd,ignore:["**/node_modules/**"]}),a=[];for(let n of i){let o=Un(e.cwd,n),r=o.replace(/\.test\.yaml$/,".yaml.spec.ts"),s=bo(o,"utf-8");try{let l=Hn(s,o,e.projectRoot??e.cwd),c=Tc(e.cwd,o),d=e.actionEntityStores?.get(c)??e.actionEntityStores?.get("*");if(!(d&&Object.keys(d.entries).length>0)&&Mc(r,[o,...l.referencedTemplatePaths]))continue;let m=fo(s,o,{version:Wn,actionEntityStore:d,parsed:l});if(!m.valid)throw new Error(m.errors.join("; "))}catch(l){console.error(`[shiplight] Failed to transpile ${n}:`,l),a.push({file:n,error:l})}}if(a.length>0){let n=`[shiplight] Transpilation failed for ${a.length} file(s):
4370
4370
  `+a.map(o=>` - ${o.file}`).join(`
4371
- `);if(t)throw new Error(n);console.warn(n+" (skipped)")}}import*as ae from"fs";import*as gt from"path";import{globSync as Uc}from"glob";Si();function Ao(e){let t=ki().SHIPLIGHT_API_TOKEN;return process.env.CI&&t?new zn:new Kn(e)}var Bc=".shiplight/action-cache";function To(e){return e.replace(/\//g,"__")+".json"}function Gc(e){return e.replace(/\.json$/,"").replace(/__/g,"/")}var Kn=class{constructor(t){this.cwd=t;this.cacheDir=gt.join(t,Bc)}isCloud=!1;cacheDir;async lookup(t){let i=new Map;if(t.length===0||!ae.existsSync(this.cacheDir))return i;for(let a of t){let n=gt.join(this.cacheDir,To(a));try{if(ae.existsSync(n)){let o=ae.readFileSync(n,"utf-8");i.set(a,JSON.parse(o))}}catch{}}return i}async update(t){if(t.size===0)return 0;ae.mkdirSync(this.cacheDir,{recursive:!0});let i=0;for(let[a,n]of t)try{let o=gt.join(this.cacheDir,To(a)),r=Pn();if(ae.existsSync(o))try{r=JSON.parse(ae.readFileSync(o,"utf-8"))}catch{}let s={...r,entries:{...r.entries,...n.entries}};ae.writeFileSync(o,JSON.stringify(s,null,2)),i++}catch{}return i}loadAll(){if(!ae.existsSync(this.cacheDir))return;let t=Uc("*.json",{cwd:this.cacheDir});if(t.length===0)return;let i=new Map,a=0;for(let n of t)try{let o=ae.readFileSync(gt.join(this.cacheDir,n),"utf-8"),r=JSON.parse(o),s=Gc(n);i.set(s,r),a+=Object.keys(r.entries??{}).length}catch{}if(i.size!==0)return console.log(`[shiplight] Cache: loaded ${a} cached action entit${a===1?"y":"ies"} for ${i.size} test file${i.size!==1?"s":""}`),i}},zn=class{isCloud=!0;async lookup(t){let{lookupActionStores:i}=await Promise.resolve().then(()=>(jn(),Gn));return i(t)}async update(t){let{updateActionStores:i}=await Promise.resolve().then(()=>(jn(),Gn));return i(t)}loadAll(){}};Si();function zc(e={}){e.dotenv!==!1&&Yc(e.scanDir||process.cwd());let t=e.scanDir||process.cwd(),a=Ao(t).loadAll();xo({cwd:t,projectRoot:process.cwd(),actionEntityStores:a});let n=process.env.SHIPLIGHT_REPORT_DIR,o=process.env.SHIPLIGHT_RUN_ID??Vc();return process.env.SHIPLIGHT_RUN_ID=o,n?{outputDir:`test-results/${o}`,reporter:[["list"],["shiplightai/reporter",{outputFolder:n,open:"never"}]]}:{outputDir:`test-results/${o}`,reporter:[["list"],["shiplightai/reporter",{outputFolder:`shiplight-report/${o}`,latestSymlinkDir:"shiplight-report",open:"never"}]]}}function Vc(){let e=new Date,t=(i,a=2)=>String(i).padStart(a,"0");return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}T${t(e.getHours())}-${t(e.getMinutes())}-${t(e.getSeconds())}-${t(e.getMilliseconds(),3)}`}function Xc(e,...t){return Kc(e,...t)}function Yc(e){_o(e);for(let t of Bn(e))jc.config({path:t})}R();R();Ot();Qe();import{z as Ys}from"zod";var mh=Ys.object({instruction:Ys.string().describe('The instruction of the operation to perform. Can only include one operation. Do not inlcude element indexes just describe the element, e.g. "select the text "Hello, world!" in "Hello, world!""')});function Js(e){e.register({name:"perform_accurate_operation",description:"Perform an operation that requires accurate interaction like dragging or interacting with a specific area of an element. Only use this action when neccecary.",schema:mh,usesElementIndex:!1,async execute(t,i){let{instruction:a}=t,n={page:i.page,agentServices:i.agentServices,domService:i.domService},o=await Ze(a,n,{});if(o.status==="error"||!o.actionEntity)return{success:!1,actionEntity:{action_description:a,action_data:{action_name:"perform_accurate_operation",kwargs:{instruction:a}}},error:o.error||"Failed to generate action"};let{actionEntity:r}=o,s=await Pt(r,n);return{success:s.success,actionEntity:r,message:s.success?`Successfully executed action: ${r.action_data?.action_name}`:void 0,error:s.error}}})}Se();R();import{generateText as gh}from"ai";import{convert as fh}from"html-to-text";async function wh(e,t,i){let{apiKey:a,domain:n}=e;if(!a)throw new Error("Mailgun configuration missing. Please provide apiKey and domain");let o=!!e.baseURL,r=e.baseURL||"https://api.mailgun.net",s=e.authHeader||`Basic ${Buffer.from(`api:${a}`).toString("base64")}`,l=[];try{let c=o?`${r}/events`:`${r}/v3/${n}/events`,d={event:"accepted",limit:"10",ascending:"yes",recipient:t};if(i.from_email&&(d.from=i.from_email),i.since)d.begin=Math.floor(i.since/1e3).toString();else{let g=new Date(Date.now()-6e5);d.begin=Math.floor(g.getTime()/1e3).toString()}u.info(`Mailgun params: ${JSON.stringify(d)}`);let h=await fetch(c+"?"+new URLSearchParams(d),{method:"GET",headers:{Authorization:s}});if(!h.ok){let g=await h.text();throw new Error(`Mailgun events API error: ${g}`)}let m=(await h.json()).items||[];for(let g of m.slice(0,10)){if(g.event!=="accepted")continue;let w=(g.storage||{}).url;if(u.info(`message_url: ${w}`),!w){let p=(g.message||{}).headers||{},x=p.subject||"",_=p.from||"",E=p.to||"";if(i.from_email&&!_.toLowerCase().includes(i.from_email.toLowerCase())||i.to_email&&!E.toLowerCase().includes(i.to_email.toLowerCase())||i.subject&&!x.toLowerCase().includes(i.subject.toLowerCase()))continue;l.push({subject:x,from:_,to:E,date:new Date(g.timestamp*1e3).toUTCString(),body:"Message body not available (Mailgun storage disabled)",message_id:p["message-id"]||""});continue}let y=w.split("/"),b=y[y.length-1];if(u.info(`Storage key: ${b}`),b){let p=o?`${r}/messages/${b}`:`${r}/v3/domains/${n}/messages/${b}`;try{let x=await fetch(p,{method:"GET",headers:{Authorization:s,Accept:"application/json"}});if(x.ok){let _=await x.json(),E=_.Subject||"",T=_.From||"",M=_.To||"",O=_.Date||"",N=_["Message-Id"]||"";u.info(`subject: ${E}`),u.info(`from_addr: ${T}`),u.info(`to_addr: ${M}`),u.info(`date: ${O}`),u.info(`message_id: ${N}`);let P=_["body-html"]||_["body-plain"]||"";if(P&&P.includes("<")&&(P=fh(P)),u.info(`Body: ${P.substring(0,200)}...`),i.subject&&!E.toLowerCase().includes(i.subject.toLowerCase())||i.body_contains&&!P.toLowerCase().includes(i.body_contains.toLowerCase()))continue;l.push({subject:E,from:T,to:M,date:O,body:P,message_id:N});continue}else u.warn(`Messages API returned ${x.status}`)}catch(x){u.warn(`Failed to parse JSON response: ${x}`)}}try{let p=await fetch(w,{method:"GET",headers:{Authorization:s}});if(!p.ok){u.warn(`Could not fetch stored message: ${p.status}`);continue}let x=await p.text();u.info(`Fallback: Raw email length: ${x.length}`);let _=x.split(`
4371
+ `);if(t)throw new Error(n);console.warn(n+" (skipped)")}}import*as ae from"fs";import*as gt from"path";import{globSync as Uc}from"glob";Si();function Ao(e){let t=ki().SHIPLIGHT_API_TOKEN;return process.env.CI&&t?new zn:new Kn(e)}var Bc=".shiplight/action-cache";function To(e){return e.replace(/\//g,"__")+".json"}function Gc(e){return e.replace(/\.json$/,"").replace(/__/g,"/")}var Kn=class{constructor(t){this.cwd=t;this.cacheDir=gt.join(t,Bc)}isCloud=!1;cacheDir;async lookup(t){let i=new Map;if(t.length===0||!ae.existsSync(this.cacheDir))return i;for(let a of t){let n=gt.join(this.cacheDir,To(a));try{if(ae.existsSync(n)){let o=ae.readFileSync(n,"utf-8");i.set(a,JSON.parse(o))}}catch{}}return i}async update(t){if(t.size===0)return 0;ae.mkdirSync(this.cacheDir,{recursive:!0});let i=0;for(let[a,n]of t)try{let o=gt.join(this.cacheDir,To(a)),r=Pn();if(ae.existsSync(o))try{r=JSON.parse(ae.readFileSync(o,"utf-8"))}catch{}let s={...r,entries:{...r.entries,...n.entries}};ae.writeFileSync(o,JSON.stringify(s,null,2)),i++}catch{}return i}loadAll(){if(!ae.existsSync(this.cacheDir))return;let t=Uc("*.json",{cwd:this.cacheDir});if(t.length===0)return;let i=new Map,a=0;for(let n of t)try{let o=ae.readFileSync(gt.join(this.cacheDir,n),"utf-8"),r=JSON.parse(o),s=Gc(n);i.set(s,r),a+=Object.keys(r.entries??{}).length}catch{}if(i.size!==0)return console.log(`[shiplight] Cache: loaded ${a} cached action entit${a===1?"y":"ies"} for ${i.size} test file${i.size!==1?"s":""}`),i}},zn=class{isCloud=!0;async lookup(t){let{lookupActionStores:i}=await Promise.resolve().then(()=>(jn(),Gn));return i(t)}async update(t){let{updateActionStores:i}=await Promise.resolve().then(()=>(jn(),Gn));return i(t)}loadAll(){}};Si();function zc(e={}){e.dotenv!==!1&&Yc(e.scanDir||process.cwd());let t=e.scanDir||process.cwd(),a=Ao(t).loadAll();xo({cwd:t,projectRoot:process.cwd(),actionEntityStores:a});let n=process.env.SHIPLIGHT_REPORT_DIR,o=process.env.SHIPLIGHT_RUN_ID??Vc();process.env.SHIPLIGHT_RUN_ID=o;let r=[];return process.env.PLAYWRIGHT_JSON_OUTPUT_FILE&&r.push(["json",{outputFile:process.env.PLAYWRIGHT_JSON_OUTPUT_FILE}]),n?{outputDir:`test-results/${o}`,reporter:[["list"],["shiplightai/reporter",{outputFolder:n,open:"never"}],...r]}:{outputDir:`test-results/${o}`,reporter:[["list"],["shiplightai/reporter",{outputFolder:`shiplight-report/${o}`,latestSymlinkDir:"shiplight-report",open:"never"}],...r]}}function Vc(){let e=new Date,t=(i,a=2)=>String(i).padStart(a,"0");return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}T${t(e.getHours())}-${t(e.getMinutes())}-${t(e.getSeconds())}-${t(e.getMilliseconds(),3)}`}function Xc(e,...t){return Kc(e,...t)}function Yc(e){_o(e);for(let t of Bn(e))jc.config({path:t})}R();R();Ot();Qe();import{z as Ys}from"zod";var mh=Ys.object({instruction:Ys.string().describe('The instruction of the operation to perform. Can only include one operation. Do not inlcude element indexes just describe the element, e.g. "select the text "Hello, world!" in "Hello, world!""')});function Js(e){e.register({name:"perform_accurate_operation",description:"Perform an operation that requires accurate interaction like dragging or interacting with a specific area of an element. Only use this action when neccecary.",schema:mh,usesElementIndex:!1,async execute(t,i){let{instruction:a}=t,n={page:i.page,agentServices:i.agentServices,domService:i.domService},o=await Ze(a,n,{});if(o.status==="error"||!o.actionEntity)return{success:!1,actionEntity:{action_description:a,action_data:{action_name:"perform_accurate_operation",kwargs:{instruction:a}}},error:o.error||"Failed to generate action"};let{actionEntity:r}=o,s=await Pt(r,n);return{success:s.success,actionEntity:r,message:s.success?`Successfully executed action: ${r.action_data?.action_name}`:void 0,error:s.error}}})}Se();R();import{generateText as gh}from"ai";import{convert as fh}from"html-to-text";async function wh(e,t,i){let{apiKey:a,domain:n}=e;if(!a)throw new Error("Mailgun configuration missing. Please provide apiKey and domain");let o=!!e.baseURL,r=e.baseURL||"https://api.mailgun.net",s=e.authHeader||`Basic ${Buffer.from(`api:${a}`).toString("base64")}`,l=[];try{let c=o?`${r}/events`:`${r}/v3/${n}/events`,d={event:"accepted",limit:"10",ascending:"yes",recipient:t};if(i.from_email&&(d.from=i.from_email),i.since)d.begin=Math.floor(i.since/1e3).toString();else{let g=new Date(Date.now()-6e5);d.begin=Math.floor(g.getTime()/1e3).toString()}u.info(`Mailgun params: ${JSON.stringify(d)}`);let h=await fetch(c+"?"+new URLSearchParams(d),{method:"GET",headers:{Authorization:s}});if(!h.ok){let g=await h.text();throw new Error(`Mailgun events API error: ${g}`)}let m=(await h.json()).items||[];for(let g of m.slice(0,10)){if(g.event!=="accepted")continue;let w=(g.storage||{}).url;if(u.info(`message_url: ${w}`),!w){let p=(g.message||{}).headers||{},x=p.subject||"",_=p.from||"",E=p.to||"";if(i.from_email&&!_.toLowerCase().includes(i.from_email.toLowerCase())||i.to_email&&!E.toLowerCase().includes(i.to_email.toLowerCase())||i.subject&&!x.toLowerCase().includes(i.subject.toLowerCase()))continue;l.push({subject:x,from:_,to:E,date:new Date(g.timestamp*1e3).toUTCString(),body:"Message body not available (Mailgun storage disabled)",message_id:p["message-id"]||""});continue}let y=w.split("/"),b=y[y.length-1];if(u.info(`Storage key: ${b}`),b){let p=o?`${r}/messages/${b}`:`${r}/v3/domains/${n}/messages/${b}`;try{let x=await fetch(p,{method:"GET",headers:{Authorization:s,Accept:"application/json"}});if(x.ok){let _=await x.json(),E=_.Subject||"",T=_.From||"",M=_.To||"",O=_.Date||"",N=_["Message-Id"]||"";u.info(`subject: ${E}`),u.info(`from_addr: ${T}`),u.info(`to_addr: ${M}`),u.info(`date: ${O}`),u.info(`message_id: ${N}`);let P=_["body-html"]||_["body-plain"]||"";if(P&&P.includes("<")&&(P=fh(P)),u.info(`Body: ${P.substring(0,200)}...`),i.subject&&!E.toLowerCase().includes(i.subject.toLowerCase())||i.body_contains&&!P.toLowerCase().includes(i.body_contains.toLowerCase()))continue;l.push({subject:E,from:T,to:M,date:O,body:P,message_id:N});continue}else u.warn(`Messages API returned ${x.status}`)}catch(x){u.warn(`Failed to parse JSON response: ${x}`)}}try{let p=await fetch(w,{method:"GET",headers:{Authorization:s}});if(!p.ok){u.warn(`Could not fetch stored message: ${p.status}`);continue}let x=await p.text();u.info(`Fallback: Raw email length: ${x.length}`);let _=x.split(`
4372
4372
  `),E=!0,T={},M="";for(let ie=0;ie<_.length;ie++){let U=_[ie];if(U.trim()===""&&E){E=!1;continue}if(E){let B=U.match(/^([^:]+):\s*(.+)$/);B&&(T[B[1].toLowerCase()]=B[2])}else M+=U+`
4373
4373
  `}let O=T.subject||"",N=T.from||"",P=T.to||"",Q=T.date||"",oe=T["message-id"]||"";if(i.subject&&!O.toLowerCase().includes(i.subject.toLowerCase())||i.body_contains&&!M.toLowerCase().includes(i.body_contains.toLowerCase()))continue;l.push({subject:O,from:N,to:P,date:Q,body:M.trim(),message_id:oe})}catch(p){u.warn(`Error fetching raw message: ${p}`)}}if(l.length>0){try{l.sort((w,y)=>{let b=new Date(w.date).getTime();return new Date(y.date).getTime()-b})}catch{}let g=l[0];return u.info(`Returning most recent email: ${g.subject}`),[g]}return l}catch(c){throw u.error(`Error fetching emails from Mailgun: ${c.message}`),new Error(`Error fetching emails from Mailgun: ${c.message}`)}}function bh(e,t){if(e==="verification_code")return`You are analyzing an email to extract an OTP (One-Time Password) or verification code.
4374
4374
 
package/dist/reporter.js CHANGED
@@ -883,7 +883,7 @@ import*as x from"fs";import*as w from"path";import{v4 as At}from"uuid";import{z
883
883
  });
884
884
  </script>
885
885
  </body>
886
- </html>`}var $e="0.1.78",Ee=$e!=="dev"?$e:void 0;var kn=3600*1e3,Tn=10080*60*1e3;var gt={before:0,main:1,teardown:2,after:3};function Me(e){let t=e.split(".")[0];return gt[t]??1}function Pe(e){return e.split(".").map(t=>{let r=Number(t);return Number.isNaN(r)?0:r})}function yt(e){return[...e].sort(([t],[r])=>{let i=Me(t),n=Me(r);if(i!==n)return i-n;let a=Pe(t),o=Pe(r);for(let p=0;p<Math.max(a.length,o.length);p++){let h=a[p]??-1,l=o[p]??-1;if(h!==l)return h-l}return 0})}function bt(e){let t=new Set;for(let r of e)if(t.add(r.category),r.category==="hook")for(let i of r.steps)t.add(i.category);return t}function _t(e,t){let r=e.toLowerCase();return r.includes("before")?"before":r.includes("after")?"after":t}function Z(e,t="main",r,i,n){r===void 0&&(r=!bt(e).has("test.step")),n||(n=new Map);let a=[];for(let o of e){if(o.category==="fixture"||o.category==="test.attach")continue;if(o.category==="hook"){let h=_t(o.title,t);a.push(...Z(o.steps,h,r,i,n));continue}if(o.category==="test.step"||r&&(o.category==="expect"||o.category==="pw:api")){let h=n.get(t)??0;n.set(t,h+1);let l=`${t}.${h}`,g={stepId:l,description:o.title,status:o.error?"failure":o.duration===-1?"skipped":"success",duration:o.duration>=0?o.duration:void 0};o.error&&(g.error=o.error.message??o.error.stack),i&&o.location&&i.set(l,o.location),a.push(g),o.steps.length>0&&a.push(...Z(o.steps,l,r,i,n))}}return a}function wt(e,t){let r=w.isAbsolute(e)?e:w.join(process.cwd(),e),i=w.join(r,"latest");try{if(x.lstatSync(i).isSymbolicLink())x.unlinkSync(i);else{console.warn("[report] 'latest' exists and is not a symlink; skipping update");return}}catch{}try{process.platform==="win32"?x.symlinkSync(w.join(r,t),i,"junction"):x.symlinkSync(t,i,"dir")}catch(n){console.warn(`[report] Could not create 'latest' symlink: ${n instanceof Error?n.message:String(n)}`)}}var Q=class{outputFolder;openMode;latestSymlinkDir;collected=[];config;runStartTime;constructor(t={}){this.outputFolder=t.outputFolder||"shiplight-report",this.openMode=t.open||"on-failure",this.latestSymlinkDir=t.latestSymlinkDir}onBegin(t,r){this.config=t,this.runStartTime=new Date().toISOString()}onTestEnd(t,r){this.collected.push({test:t,result:r})}async onEnd(t){if(this.collected.length===0)return;let r=new Map;for(let l of this.collected){let g=l.test.titlePath().join(" > "),b=r.get(g);b||(b=[],r.set(g,b)),b.push(l)}let i=[];for(let[,l]of r.entries()){let g=l[0].test.location.file,b=[],c,u,m;for(let y=0;y<l.length;y++){let{test:v,result:T}=l[y],A=await this.buildReportTest(v,T,g);c=A,u||(u=A.startTime),m=A.endTime,b.push({attemptNumber:y+1,status:T.status,duration:T.duration,steps:A.steps,error:A.error,videoPath:A.videoPath,tracePath:A.tracePath})}let d=b[b.length-1],{test:S}=l[l.length-1],_={title:S.title,baseTitle:c?.baseTitle,file:w.relative(process.cwd(),g),status:d.status,duration:d.duration,steps:d.steps,error:d.error,videoPath:d.videoPath,tracePath:d.tracePath,actionStepsMap:c?.actionStepsMap,tags:c?.tags,baseUrl:c?.baseUrl,skip:c?.skip,slow:c?.slow,timeout:c?.timeout,parameterSetName:c?.parameterSetName,startTime:u,endTime:m,suiteName:c?.suiteName};b.length>1&&(_.retries=b.length-1,_.attempts=b,b.some(v=>v.status==="failed"||v.status==="timedOut")&&d.status==="passed"&&(_.flaky=!0)),i.push(_)}let n={tests:i,totalDuration:t.duration,timestamp:new Date().toISOString(),shiplightVersion:Ee},a=w.isAbsolute(this.outputFolder)?this.outputFolder:w.join(process.cwd(),this.outputFolder);x.mkdirSync(a,{recursive:!0});let o=w.join(a,"screenshots");for(let l=0;l<n.tests.length;l++){let g=n.tests[l],b=g.attempts&&g.attempts.length>0,c=[{obj:g,prefix:b?`test-${l}-attempt-0`:`test-${l}`,screenshotSubDir:`test-${l}`}];if(g.attempts)for(let u=0;u<g.attempts.length;u++)c.push({obj:g.attempts[u],prefix:`test-${l}-attempt-${u+1}`,screenshotSubDir:`test-${l}/attempt-${u}`});for(let{obj:u,prefix:m,screenshotSubDir:d}of c){let S=w.join(o,d),_=!1;for(let y of u.steps)if(y.screenshot&&w.isAbsolute(y.screenshot))try{_||(x.mkdirSync(S,{recursive:!0}),_=!0);let v=`${y.stepId.replace(/\./g,"-")}.png`;x.copyFileSync(y.screenshot,w.join(S,v)),y.screenshot=`screenshots/${d}/${v}`}catch(v){console.warn(`[reporter] Failed to copy screenshot for ${y.stepId}:`,v)}if(u.videoPath&&w.isAbsolute(u.videoPath)){let y=w.extname(u.videoPath)||".webm",v=`${m}-video${y}`;try{x.copyFileSync(u.videoPath,w.join(a,v)),u.videoPath=v}catch{u.videoPath=void 0}}if(u.tracePath&&w.isAbsolute(u.tracePath)){let y=w.extname(u.tracePath)||".zip",v=`${m}-trace${y}`;try{x.copyFileSync(u.tracePath,w.join(a,v)),u.tracePath=v}catch{u.tracePath=void 0}}}}let p=w.join(a,"report-data.json");x.writeFileSync(p,JSON.stringify(n,null,2),"utf-8");let h=w.join(a,"index.html");if(x.writeFileSync(h,Ae({...n,outputDir:a}),"utf-8"),console.log(`
886
+ </html>`}var $e="0.1.79",Ee=$e!=="dev"?$e:void 0;var kn=3600*1e3,Tn=10080*60*1e3;var gt={before:0,main:1,teardown:2,after:3};function Me(e){let t=e.split(".")[0];return gt[t]??1}function Pe(e){return e.split(".").map(t=>{let r=Number(t);return Number.isNaN(r)?0:r})}function yt(e){return[...e].sort(([t],[r])=>{let i=Me(t),n=Me(r);if(i!==n)return i-n;let a=Pe(t),o=Pe(r);for(let p=0;p<Math.max(a.length,o.length);p++){let h=a[p]??-1,l=o[p]??-1;if(h!==l)return h-l}return 0})}function bt(e){let t=new Set;for(let r of e)if(t.add(r.category),r.category==="hook")for(let i of r.steps)t.add(i.category);return t}function _t(e,t){let r=e.toLowerCase();return r.includes("before")?"before":r.includes("after")?"after":t}function Z(e,t="main",r,i,n){r===void 0&&(r=!bt(e).has("test.step")),n||(n=new Map);let a=[];for(let o of e){if(o.category==="fixture"||o.category==="test.attach")continue;if(o.category==="hook"){let h=_t(o.title,t);a.push(...Z(o.steps,h,r,i,n));continue}if(o.category==="test.step"||r&&(o.category==="expect"||o.category==="pw:api")){let h=n.get(t)??0;n.set(t,h+1);let l=`${t}.${h}`,g={stepId:l,description:o.title,status:o.error?"failure":o.duration===-1?"skipped":"success",duration:o.duration>=0?o.duration:void 0};o.error&&(g.error=o.error.message??o.error.stack),i&&o.location&&i.set(l,o.location),a.push(g),o.steps.length>0&&a.push(...Z(o.steps,l,r,i,n))}}return a}function wt(e,t){let r=w.isAbsolute(e)?e:w.join(process.cwd(),e),i=w.join(r,"latest");try{if(x.lstatSync(i).isSymbolicLink())x.unlinkSync(i);else{console.warn("[report] 'latest' exists and is not a symlink; skipping update");return}}catch{}try{process.platform==="win32"?x.symlinkSync(w.join(r,t),i,"junction"):x.symlinkSync(t,i,"dir")}catch(n){console.warn(`[report] Could not create 'latest' symlink: ${n instanceof Error?n.message:String(n)}`)}}var Q=class{outputFolder;openMode;latestSymlinkDir;collected=[];config;runStartTime;constructor(t={}){this.outputFolder=t.outputFolder||"shiplight-report",this.openMode=t.open||"on-failure",this.latestSymlinkDir=t.latestSymlinkDir}onBegin(t,r){this.config=t,this.runStartTime=new Date().toISOString()}onTestEnd(t,r){this.collected.push({test:t,result:r})}async onEnd(t){if(this.collected.length===0)return;let r=new Map;for(let l of this.collected){let g=l.test.titlePath().join(" > "),b=r.get(g);b||(b=[],r.set(g,b)),b.push(l)}let i=[];for(let[,l]of r.entries()){let g=l[0].test.location.file,b=[],c,u,m;for(let y=0;y<l.length;y++){let{test:v,result:T}=l[y],A=await this.buildReportTest(v,T,g);c=A,u||(u=A.startTime),m=A.endTime,b.push({attemptNumber:y+1,status:T.status,duration:T.duration,steps:A.steps,error:A.error,videoPath:A.videoPath,tracePath:A.tracePath})}let d=b[b.length-1],{test:S}=l[l.length-1],_={title:S.title,baseTitle:c?.baseTitle,file:w.relative(process.cwd(),g),status:d.status,duration:d.duration,steps:d.steps,error:d.error,videoPath:d.videoPath,tracePath:d.tracePath,actionStepsMap:c?.actionStepsMap,tags:c?.tags,baseUrl:c?.baseUrl,skip:c?.skip,slow:c?.slow,timeout:c?.timeout,parameterSetName:c?.parameterSetName,startTime:u,endTime:m,suiteName:c?.suiteName};b.length>1&&(_.retries=b.length-1,_.attempts=b,b.some(v=>v.status==="failed"||v.status==="timedOut")&&d.status==="passed"&&(_.flaky=!0)),i.push(_)}let n={tests:i,totalDuration:t.duration,timestamp:new Date().toISOString(),shiplightVersion:Ee},a=w.isAbsolute(this.outputFolder)?this.outputFolder:w.join(process.cwd(),this.outputFolder);x.mkdirSync(a,{recursive:!0});let o=w.join(a,"screenshots");for(let l=0;l<n.tests.length;l++){let g=n.tests[l],b=g.attempts&&g.attempts.length>0,c=[{obj:g,prefix:b?`test-${l}-attempt-0`:`test-${l}`,screenshotSubDir:`test-${l}`}];if(g.attempts)for(let u=0;u<g.attempts.length;u++)c.push({obj:g.attempts[u],prefix:`test-${l}-attempt-${u+1}`,screenshotSubDir:`test-${l}/attempt-${u}`});for(let{obj:u,prefix:m,screenshotSubDir:d}of c){let S=w.join(o,d),_=!1;for(let y of u.steps)if(y.screenshot&&w.isAbsolute(y.screenshot))try{_||(x.mkdirSync(S,{recursive:!0}),_=!0);let v=`${y.stepId.replace(/\./g,"-")}.png`;x.copyFileSync(y.screenshot,w.join(S,v)),y.screenshot=`screenshots/${d}/${v}`}catch(v){console.warn(`[reporter] Failed to copy screenshot for ${y.stepId}:`,v)}if(u.videoPath&&w.isAbsolute(u.videoPath)){let y=w.extname(u.videoPath)||".webm",v=`${m}-video${y}`;try{x.copyFileSync(u.videoPath,w.join(a,v)),u.videoPath=v}catch{u.videoPath=void 0}}if(u.tracePath&&w.isAbsolute(u.tracePath)){let y=w.extname(u.tracePath)||".zip",v=`${m}-trace${y}`;try{x.copyFileSync(u.tracePath,w.join(a,v)),u.tracePath=v}catch{u.tracePath=void 0}}}}let p=w.join(a,"report-data.json");x.writeFileSync(p,JSON.stringify(n,null,2),"utf-8");let h=w.join(a,"index.html");if(x.writeFileSync(h,Ae({...n,outputDir:a}),"utf-8"),console.log(`
887
887
  Shiplight report written to: ${h}`),this.latestSymlinkDir&&wt(this.latestSymlinkDir,w.basename(a)),this.openMode==="always"||this.openMode==="on-failure"&&t.status!=="passed")try{let l=(await import("open")).default;await l(h)}catch{}}printsToStdio(){return!1}async buildReportTest(t,r,i){let n={title:t.title,file:w.relative(process.cwd(),i),status:r.status,duration:r.duration,steps:[],startTime:new Date(r.startTime).toISOString(),endTime:new Date(r.startTime.getTime()+r.duration).toISOString()};r.errors.length>0&&(n.error=r.errors.map(c=>c.message||c.stack||String(c)).join(`
888
888
 
889
889
  `)),r.stdout.length>0&&(n.stdout=r.stdout.map(c=>typeof c=="string"?c:c.toString()).join("")),r.stderr.length>0&&(n.stderr=r.stderr.map(c=>typeof c=="string"?c:c.toString()).join(""));for(let c of r.attachments)c.name==="video"&&c.path&&(n.videoPath=c.path),c.name==="trace"&&c.path&&(n.tracePath=c.path);let a=r.attachments.find(c=>c.name==="shiplight-results"),o=null;if(a)try{if(a.body)o=JSON.parse(a.body.toString("utf-8"));else if(a.path){let c=x.readFileSync(a.path,"utf-8");o=JSON.parse(c)}}catch{}let p=i.replace(/\.yaml\.spec\.ts$/,".test.yaml"),h={},l=t.title.match(/^(.*)\s+\[([^\]]+)\]$/),g=l?l[1]:t.title,b=l?l[2]:void 0;if(b&&(n.parameterSetName=b),x.existsSync(p))try{let c=x.readFileSync(p,"utf-8"),u=ve(c,p,this.config.rootDir);if(u.suite){let m=u.suite.tests.find(d=>d.name===g);m&&(h=K(m.testFlow),m.tags?.length&&(n.tags=m.tags),m.skip!==void 0&&(n.skip=m.skip),m.slow&&(n.slow=m.slow),m.timeout!==void 0&&(n.timeout=m.timeout),n.baseTitle=m.name||m.testFlow?.goal),n.suiteName=u.name,u.tags?.length&&(n.suiteTags=u.tags),u.use?.baseURL&&(n.baseUrl=u.use.baseURL)}else u.testFlow&&(h=K(u.testFlow),n.baseTitle=u.name||u.testFlow?.goal,u.tags?.length&&(n.tags=u.tags),u.use?.baseURL&&(n.baseUrl=u.use.baseURL))}catch{}if(o||Object.keys(h).length>0){let c=new Set([...Object.keys(h),...Object.keys(o||{})]),u=Array.from(c).map(d=>[d,null]),m=yt(u);for(let[d]of m){let S=h[d],_=o?.[d],y=S?.description;if(!y||y==="Action"||y==="Draft"){let T=S?.action_entity;y=T?.action_description||T?.action_data?.kwargs?.description||_?.description||d}let v={stepId:d,description:y,status:_?.status||"pending",duration:_?.duration};if(_?.message){let T=typeof _.message=="string"?_.message:JSON.stringify(_.message,null,2);_.status==="failure"?v.error=T:v.message=T}if(_?.screenshot){let T=_.screenshot,A=a?.path?w.dirname(a.path):"",O=w.isAbsolute(T)?T:w.join(A,T);x.existsSync(O)&&(v.screenshot=O)}_?.code&&(v.code=_.code),n.steps.push(v)}}if(o===null&&Object.keys(h).length===0&&!i.endsWith(".yaml.spec.ts")){let c=new Map;if(n.steps=Z(r.steps,"main",void 0,c),n.steps.length>0){let u=new Map;n.actionStepsMap=Object.fromEntries(n.steps.map(m=>{let d=c.get(m.stepId),S;if(d?.file){if(!u.has(d.file))try{u.set(d.file,x.readFileSync(d.file,"utf-8").split(`
@@ -1,4 +1,4 @@
1
- import { r as reactExports, W as We } from "./index-Mg0a6DkO.js";
1
+ import { r as reactExports, W as We } from "./index-iW9rlkck.js";
2
2
  function _defineProperty$1(obj, key, value) {
3
3
  if (key in obj) {
4
4
  Object.defineProperty(obj, key, {
@@ -649,4 +649,4 @@ export {
649
649
  loader,
650
650
  Le as useMonaco
651
651
  };
652
- //# sourceMappingURL=index-Dk5ihq1Y.js.map
652
+ //# sourceMappingURL=index-BMtHZTuv.js.map
@@ -10450,6 +10450,9 @@ fieldset:disabled .m_38aeed47:where(:not([data-inverted])),
10450
10450
  .text-right {
10451
10451
  text-align: right;
10452
10452
  }
10453
+ .align-top {
10454
+ vertical-align: top;
10455
+ }
10453
10456
  .font-\[family-name\:var\(--font-geist-mono\)\] {
10454
10457
  font-family: var(--font-geist-mono);
10455
10458
  }
@@ -11005,6 +11008,9 @@ fieldset:disabled .m_38aeed47:where(:not([data-inverted])),
11005
11008
  overflow-y: auto;
11006
11009
  overflow-x: hidden;
11007
11010
  }
11011
+ .\[overflow-wrap\:anywhere\] {
11012
+ overflow-wrap: anywhere;
11013
+ }
11008
11014
 
11009
11015
  @layer tailwind {
11010
11016
  *, ::before, ::after {