@shiplightai/sdk 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +280 -0
- package/dist/agentHelpers-UCLT5EKK.js +1 -0
- package/dist/agentLogin-ARB3NEO4.js +1 -0
- package/dist/chunk-6H2NJBNL.js +1 -0
- package/dist/chunk-GDTCZALZ.js +192 -0
- package/dist/chunk-GPZJYXUG.js +3880 -0
- package/dist/chunk-KFC5I6R5.js +14 -0
- package/dist/chunk-QIBDXB3J.js +22 -0
- package/dist/chunk-UFLZ3URR.js +1 -0
- package/dist/chunk-UHZTPBZ3.js +197 -0
- package/dist/chunk-YR4E7JSB.js +3 -0
- package/dist/handler-TPOFKKIB.js +1 -0
- package/dist/index.d.ts +446 -0
- package/dist/index.js +44 -0
- package/dist/task-57MAWXLN.js +190 -0
- package/package.json +76 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{g as e}from"./chunk-UFLZ3URR.js";import{appendFileSync as s}from"fs";var g=class{constructor(){this.initialized=!1}init(){if(this.initialized)return;let i=e().agentLogPath;if(i)try{s(i,`
|
|
2
|
+
=== Agent Execution Log ===
|
|
3
|
+
Started: ${new Date().toISOString()}
|
|
4
|
+
|
|
5
|
+
`),this.initialized=!0}catch(o){console.error(`[AgentLogger] Failed to initialize log file: ${o.message}`)}}log(i){let o=e().agentLogPath;if(o){this.initialized||this.init();try{let t=new Date().toISOString();s(o,`[${t}] ${i}
|
|
6
|
+
`)}catch{}}}section(i){this.log(`
|
|
7
|
+
${"=".repeat(60)}
|
|
8
|
+
${i}
|
|
9
|
+
${"=".repeat(60)}`)}step(i,o,t){this.section(`Step ${i}/${o}`),t.task&&this.log(`Task: ${t.task}`),t.url&&this.log(`URL: ${t.url}`),t.thinking&&this.log(`Thinking: ${t.thinking}`),t.evaluation&&this.log(`Evaluation: ${t.evaluation}`),t.memory&&this.log(`Memory: ${t.memory}`),t.goal&&this.log(`Goal: ${t.goal}`),t.actions&&this.log(`Actions: ${t.actions}`)}llmCall(i,o,t){if(this.log(`LLM Call: ${i}`),this.log(`Duration: ${(o/1e3).toFixed(2)}s`),t){let l=t.promptTokens||t.inputTokens||0,n=t.completionTokens||t.outputTokens||0,a=t.totalTokens||0;this.log(`Tokens: ${l} prompt + ${n} completion = ${a} total`)}}thinking(i){this.log(`Native Thinking:
|
|
10
|
+
${i}`)}prompt(i,o){this.section("LLM Prompt"),this.log(`System Prompt:
|
|
11
|
+
${i}`),this.log(`
|
|
12
|
+
User Prompt:
|
|
13
|
+
${o}`)}response(i){this.log(`LLM Response:
|
|
14
|
+
${i}`)}error(i,o){this.log(`ERROR: ${i}`),o&&(this.log(`Error details: ${o.message}`),o.stack&&this.log(`Stack: ${o.stack}`))}isEnabled(){return!!e().agentLogPath}},c=new g;export{c as a};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{a as h,b as T,c as m,d as p,e as w,f as u,h as f,i as g}from"./chunk-YR4E7JSB.js";import{i as Y,j as q,k as A}from"./chunk-UFLZ3URR.js";import{z as Ze}from"zod";var K=class{async execute(e,t){await e.waitForLoadState("networkidle",{timeout:3e4}).catch(()=>{}),await e.waitForLoadState("domcontentloaded")}transpile(e){return['await agent.execAction("wait_for_page_ready", page, {});']}},Kt=Ze.object({});u();var X=class{async execute(e,t){let a=t.action_data;if(!a)throw new Error("Action data not found");if(typeof a.kwargs.relative_x=="number"&&typeof a.kwargs.relative_y=="number"){let r=m(e,t);if(r){await r.waitFor({state:"attached",timeout:p});let o=await r.boundingBox();if(o){let n=o.x+a.kwargs.relative_x+o.width/2,s=o.y+a.kwargs.relative_y+o.height/2;await e.mouse.move(n,s),await e.waitForTimeout(200),await e.mouse.click(n,s,{button:"right",delay:100}),await e.waitForTimeout(200)}}else throw new Error("Element-anchored coordinates provided but no locator found")}else if(typeof a.kwargs.x=="number"&&typeof a.kwargs.y=="number")await e.mouse.move(a.kwargs.x,a.kwargs.y),await e.waitForTimeout(200),await e.mouse.click(a.kwargs.x,a.kwargs.y,{button:"right"}),await e.waitForTimeout(200);else throw new Error("Missing or invalid coordinates")}transpile(e){let t=e.action_data?.kwargs||{},a=[];return typeof t.relative_x=="number"&&typeof t.relative_y=="number"?(a.push(`action_data: { kwargs: { relative_x: ${t.relative_x}, relative_y: ${t.relative_y} } }`),e.locator?a.push(`locator: ${JSON.stringify(e.locator)}`):e.xpath&&a.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&a.push(`frame_path: ${JSON.stringify(e.frame_path)}`)):typeof t.x=="number"&&typeof t.y=="number"&&a.push(`action_data: { kwargs: { x: ${t.x}, y: ${t.y} } }`),['await agent.execAction("right_click_by_coordinates", page, {',...a.map(r=>` ${r},`),"});"]}};u();var Z=class{async execute(e,t){let a=t.action_data;if(!a)throw new Error("Action data not found");let r=a.kwargs.keys;if(!r||typeof r!="string")throw new Error("Missing or invalid keys for send keys on element action");let o=m(e,t);if(o)await o.press(r,{timeout:p}),await e.waitForTimeout(500);else throw new Error("No locator found for send keys on element action")}transpile(e){let t=e.action_data?.kwargs?.keys||"",a=[];return a.push(`action_data: { kwargs: { keys: ${JSON.stringify(t)} } }`),e.locator?a.push(`locator: ${JSON.stringify(e.locator)}`):e.xpath&&a.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&a.push(`frame_path: ${JSON.stringify(e.frame_path)}`),['await agent.execAction("send_keys_on_element", page, {',...a.map(r=>` ${r},`),"});"]}};import{z as Q}from"zod";var ee=class{async execute(e,t,a){let r=t.action_data;if(!r)throw new Error("Action data not found");let o=r.kwargs.code;if(!o)throw new Error("Missing code for js_code action");await new Function("page","agentServices",`
|
|
2
|
+
return (async () => {
|
|
3
|
+
${o}
|
|
4
|
+
})();
|
|
5
|
+
`)(e,a)}transpile(e){let t=e.action_data?.kwargs?.code;if(!t)return["// Skipping js_code: missing code"];let a=["{"],r=t.split(`
|
|
6
|
+
`);for(let o of r)a.push(` ${o}`);return a.push("}"),a}},ia=Q.object({code:Q.string().describe("JavaScript code to execute in the browser context")});u();var te=class{async execute(e,t){let a=t.action_data;if(!a)throw new Error("Action data not found");if(typeof a.kwargs.relative_x=="number"&&typeof a.kwargs.relative_y=="number"){let r=m(e,t);if(r){await r.waitFor({state:"attached",timeout:p});let o=await r.boundingBox();if(o){let n=o.x+a.kwargs.relative_x+o.width/2,s=o.y+a.kwargs.relative_y+o.height/2;await e.mouse.dblclick(n,s,{delay:50}),await e.waitForTimeout(200)}}else throw new Error("Element-anchored coordinates provided but no locator found")}else if(typeof a.kwargs.x=="number"&&typeof a.kwargs.y=="number")await e.mouse.dblclick(a.kwargs.x,a.kwargs.y),await e.waitForTimeout(200);else throw new Error("Missing or invalid coordinates")}transpile(e){let t=e.action_data?.kwargs||{},a=[];return typeof t.relative_x=="number"&&typeof t.relative_y=="number"?(a.push(`action_data: { kwargs: { relative_x: ${t.relative_x}, relative_y: ${t.relative_y} } }`),e.locator?a.push(`locator: ${JSON.stringify(e.locator)}`):e.xpath&&a.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&a.push(`frame_path: ${JSON.stringify(e.frame_path)}`)):typeof t.x=="number"&&typeof t.y=="number"&&a.push(`action_data: { kwargs: { x: ${t.x}, y: ${t.y} } }`),['await agent.execAction("double_click_by_coordinates", page, {',...a.map(r=>` ${r},`),"});"]}};u();var ae=class{async execute(e,t,a){let r=a.getActionSettings().drag_drop_steps??10,o=t.action_data;if(!o)throw new Error("Action data not found");let n=o.kwargs,s=[n.coord_source_x,n.coord_source_y],c=[n.coord_target_x,n.coord_target_y];if(typeof n.relative_x=="number"&&typeof n.relative_y=="number"&&typeof n.delta_x=="number"&&typeof n.delta_y=="number"){let i=m(e,t);if(!i)throw new Error("No locator found for drag_drop action with element-anchored coordinates");await i.waitFor({state:"attached",timeout:p});let l=await(await i).boundingBox();if(!l)throw new Error("Could not get bounding box for drag_drop element");let _=l.x+n.relative_x+l.width/2,x=l.y+n.relative_y+l.height/2,V=_+n.delta_x,H=x+n.delta_y;await e.mouse.move(_,x),await e.mouse.down(),r>0?await e.mouse.move(V,H,{steps:r}):await e.mouse.move(V,H),await e.mouse.up()}else if(s.every(i=>typeof i=="number")&&c.every(i=>typeof i=="number")){let[i,d]=s,[l,_]=c;await e.mouse.move(i,d),await e.mouse.down(),r>0?await e.mouse.move(l,_,{steps:r}):await e.mouse.move(l,_),await e.mouse.up()}else throw new Error("Missing coordinates for drag_drop action: requires either element-anchored coordinates with delta, or full absolute coordinates");await e.waitForTimeout(500)}transpile(e){let t=e.action_data?.kwargs||{},a=[],r={};return typeof t.relative_x=="number"&&(r.relative_x=t.relative_x),typeof t.relative_y=="number"&&(r.relative_y=t.relative_y),typeof t.delta_x=="number"&&(r.delta_x=t.delta_x),typeof t.delta_y=="number"&&(r.delta_y=t.delta_y),typeof t.coord_source_x=="number"&&(r.coord_source_x=t.coord_source_x),typeof t.coord_source_y=="number"&&(r.coord_source_y=t.coord_source_y),typeof t.coord_target_x=="number"&&(r.coord_target_x=t.coord_target_x),typeof t.coord_target_y=="number"&&(r.coord_target_y=t.coord_target_y),a.push(`action_data: { kwargs: ${JSON.stringify(r)} }`),e.locator?a.push(`locator: ${JSON.stringify(e.locator)}`):e.xpath&&a.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&a.push(`frame_path: ${JSON.stringify(e.frame_path)}`),['await agent.execAction("drag_drop", page, {',...a.map(o=>` ${o},`),"});"]}};var oe=class{async execute(e,t,a){let r=t.action_data;if(!r)throw new Error("Action data not found");let o=this.generateFunctionCallCode(r.kwargs);if(!o)throw new Error("Missing function name for function action");await new Function("page","agentServices",`
|
|
7
|
+
return (async () => {
|
|
8
|
+
${o}
|
|
9
|
+
})();
|
|
10
|
+
`)(e,a)}transpile(e){let t=this.generateFunctionCallCode(e.action_data?.kwargs||{});return t?[t.endsWith(";")?t:`${t};`]:["// Skipping function: missing functionName"]}generateFunctionCallCode(e){let t=e.functionName;if(!t)return null;let a={},r=e.parameterNames||[],o=e.parameterValues||e.args||[];if(r.forEach((i,d)=>{d<o.length&&(a[i]=o[d])}),Object.keys(a).length===0)return`await ${t}()`;let n=["page","testContext","request","agentServices"],s=["undefined","null","true","false"],c=Object.entries(a).map(([i,d])=>{let l=String(d);return d==null?"undefined":n.includes(i)&&n.includes(l)||s.includes(l)||/^-?\d+(\.\d+)?$/.test(l)?l:l.startsWith("$")?`agent.agentServices.readVariable('${l.substring(1)}')`:`"${l}"`});return`await ${t}(${c.join(", ")})`}};import{z as re}from"zod";var ne=class{async execute(e,t,a){let r=t.action_data;if(!r)throw new Error("Action data not found");let o=r.kwargs.statement;if(!o)throw new Error("Missing statement for ai_action");let n=r.kwargs.use_pure_vision,{executeStep:s}=await import("./agentHelpers-UCLT5EKK.js"),c=await s(o,e,a,{usePureVision:n});if(c.status!=="success")throw new Error(c.error||"Action execution failed")}transpile(e,t){let a=e.action_data?.kwargs?.statement;if(!a)return["// Skipping ai_action: missing statement"];let r=JSON.stringify(a),o=e.action_data?.kwargs?.use_pure_vision;return[`await agent.execute(page, ${r}, '${t||""}', ${o});`]}},ha=re.object({statement:re.string().describe('The action to perform (e.g., "click the submit button")')});import{z as ie}from"zod";var se=class{async execute(e,t,a){let r=t.action_data;if(!r)throw new Error("Action data not found");let o=r.kwargs.statement;if(!o)throw new Error("Missing statement for ai_step");let{runTask:n}=await import("./agentHelpers-UCLT5EKK.js"),s=await n(o,e,a);if(s.status!=="success")throw new Error(s.error||"Task execution failed")}transpile(e,t){let a=e.action_data?.kwargs?.statement;return a?[`await agent.run(page, ${JSON.stringify(a)}, '${t||""}');`]:["// Skipping ai_step: missing statement"]}},ba=ie.object({statement:ie.string().describe('The complete step to execute (e.g., "fill in the login form and submit")')});u();var ce=class{async execute(e,t){let a=t.action_data;if(!a)throw new Error("Action data not found");if(typeof a.kwargs.relative_x=="number"&&typeof a.kwargs.relative_y=="number"){let r=m(e,t);if(r){await r.waitFor({state:"attached",timeout:p});let o=await r.boundingBox();if(o){let n=o.x+a.kwargs.relative_x+o.width/2,s=o.y+a.kwargs.relative_y+o.height/2;await e.mouse.move(n,s),await e.waitForTimeout(200),await e.mouse.click(n,s),await e.waitForTimeout(500)}}else throw new Error("Element-anchored coordinates provided but no locator found")}else if(typeof a.kwargs.x=="number"&&typeof a.kwargs.y=="number")await e.mouse.move(a.kwargs.x,a.kwargs.y),await e.waitForTimeout(200),await e.mouse.click(a.kwargs.x,a.kwargs.y),await e.waitForTimeout(500);else throw new Error("Missing or invalid coordinates")}transpile(e){let t=e.action_data?.kwargs||{},a=[];return typeof t.relative_x=="number"&&typeof t.relative_y=="number"?(a.push(`action_data: { kwargs: { relative_x: ${t.relative_x}, relative_y: ${t.relative_y} } }`),e.locator?a.push(`locator: ${JSON.stringify(e.locator)}`):e.xpath&&a.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&a.push(`frame_path: ${JSON.stringify(e.frame_path)}`)):typeof t.x=="number"&&typeof t.y=="number"&&a.push(`action_data: { kwargs: { x: ${t.x}, y: ${t.y} } }`),['await agent.execAction("click_by_coordinates", page, {',...a.map(r=>` ${r},`),"});"]}};import{z as le}from"zod";var de=class{async execute(e,t,a){let r=t.action_data;if(!r)throw new Error("Action data not found");let o=r.kwargs.page_id;if(typeof o=="number"){let n=e.context().pages(),s=o===-1?n.length-1:o;if(a){let c=await a.switchTab(s);await c.waitForLoadState("load",{timeout:15e3}),await c.waitForTimeout(500)}}else throw new Error("Missing page_id for switch_tab action")}transpile(e){return['await agent.execAction("switch_tab", page, {',` action_data: { kwargs: { page_id: ${e.action_data?.kwargs?.page_id??0} } },`,"});"]}},Qe=le.object({tab_index:le.number().int().nonnegative().describe("Index of the tab to switch to (0-based). Use 0 for first tab, 1 for second, etc.")});function Oa(e,t){e.register({name:"switch_tab",description:"Switch to a different browser tab by index (0-based).",schema:Qe,async execute(a,r){let o=a.tab_index??a.index,{page:n,agentServices:s,actionDescription:c}=r;try{let i={action_description:c||`Switch to tab ${o}`,action_data:{action_name:"switch_tab",kwargs:{page_id:o}}};return await t.execute(n,i,s),{success:!0,actionEntity:i,message:`Switched to tab ${o}`}}catch(i){return{success:!1,error:i.message,actionEntity:{action_description:(c||`Switch to tab ${o}`)+" (failed)",action_data:{action_name:"switch_tab",kwargs:{page_id:o}},feedback:i.message}}}}})}import et from"fs";import tt from"path";async function Ja(e,t,a,r,o,n){let s=Array.isArray(t)?t:[t];if(s.length===0)throw new Error("No file paths provided for upload");let c=s.map(l=>{if(l.startsWith("/")||l.match(/^[A-Za-z]:\\/))return l;let _=r.testDataDir||process.cwd();return tt.join(_,l)});h.info(`Uploading files: ${c.join(", ")}`);let i=a.timeout||2e4,d={useFileInput:a.useFileInput||!1,timeout:i};if(a.selector&&typeof a.selector!="string"){let l=a.selector;await b(e,l,c,d);return}if(a.selector&&typeof a.selector=="string"){let l=a.selector,_=(l.startsWith("xpath="),e.locator(l));await b(e,_,c,d);return}if(o){let l=s.map(x=>`"${x}"`).join(", "),_="";a.targetDescription?_=`Upload ${l} to ${a.targetDescription}`:_=`Upload ${l}`,h.info(`Using AI to handle file upload: ${_}`),await o(e,_,n)}else throw new Error("No selector provided and AI action execution is not available")}async function b(e,t,a,r){let{useFileInput:o,timeout:n,mockShowOpenFilePicker:s}=r;if(s){h.info("Using mockShowOpenFilePicker approach");let c=a.map(i=>({path:i,buffer:new Uint8Array(et.readFileSync(i))}));await e.evaluate(i=>{window.__pw_showOpenFilePicker_mock_files=i},c),await t.click({timeout:n}),await e.waitForTimeout(3e3),await e.evaluate(()=>{delete window.__pw_showOpenFilePicker_mock_files})}else if(o)h.info("Using direct file input approach"),await t.setInputFiles(a,{timeout:n}),await e.waitForTimeout(3e3);else{h.info("Using file chooser approach");let c=e.waitForEvent("filechooser",{timeout:n});c.catch(()=>{}),await t.click({timeout:n}),await(await c).setFiles(a),await e.waitForTimeout(3e3)}h.info(`Successfully uploaded ${a.length} file(s)`)}import{z as y}from"zod";u();var pe=class{async execute(e,t,a){let r=t.action_data;if(!r)throw new Error("Action data not found");let o=[];if(r.kwargs.paths?o=Array.isArray(r.kwargs.paths)?r.kwargs.paths:[r.kwargs.paths]:r.kwargs.path&&(o=Array.isArray(r.kwargs.path)?r.kwargs.path:[r.kwargs.path]),o.length===0)throw new Error("No file paths provided for upload_file action");await a.downloadTestDataFiles(o);let n=o.map(d=>a.getTestDataFilePath(d)),s=m(e,t);if(!s)throw new Error("Missing locator for upload_file action");let c=r.kwargs.use_file_input||!1,i=a.getActionSettings().mock_show_open_file_picker??!1;await b(e,s,n,{useFileInput:c,timeout:p,mockShowOpenFilePicker:i})}transpile(e){let t=e.action_data?.kwargs||{},a=[],r={};return t.paths?r.paths=t.paths:t.path&&(r.path=t.path),t.use_file_input&&(r.use_file_input=!0),a.push(`action_data: { kwargs: ${JSON.stringify(r)} }`),e.locator?a.push(`locator: ${JSON.stringify(e.locator)}`):e.xpath&&a.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&a.push(`frame_path: ${JSON.stringify(e.frame_path)}`),['await agent.execAction("upload_file", page, {',...a.map(o=>` ${o},`),"});"]}};async function at(e,t,a={},r){return{...await g(t,e),action_description:r||"Upload file to element",action_data:{action_name:"upload_file",kwargs:{...a}}}}function ue(e,t){return{action_description:`${e} (failed - element not found)`,action_data:{action_name:"upload_file",kwargs:t},feedback:"Element not found in DOM"}}var ot=y.object({element_index:y.number().int().describe("Index of the target element to trigger the file upload dialog"),paths:y.string().describe("Paths to the files to upload")});function za(e,t){e.register({name:"upload_file",description:'Click on target element (usually contains hints like "Upload file" or "Choose file" etc.) to trigger the file upload dialog, and choose the files to upload',schema:ot,usesElementIndex:!0,async execute(a,r){let{element_index:o,paths:n}=a,{page:s,agentServices:c,actionDescription:i}=r;try{let d=await f(r,o);if(!d)return{success:!1,error:`File input element with index ${o} not found`,actionEntity:ue(i||`Upload file to element ${o}`,{index:o,paths:n})};let l=await at(d,s,{paths:n},i);return await t.execute(s,l,c),{success:!0,actionEntity:l,message:`Uploaded file to element ${o}`}}catch(d){return{success:!1,error:d.message,actionEntity:ue(i||`Upload file to element ${o}`,{index:o,paths:n})}}}})}var Wa=y.object({element_index:y.number().int().describe("Index of the file input element"),paths:y.string().describe("Path to the file to upload (can be relative or absolute)")});import{z as me}from"zod";var fe=class{async execute(e,t){let a=t.action_data;if(!a)throw new Error("Action data not found");let r=a.kwargs.seconds||1;await e.waitForTimeout(r*1e3)}transpile(e){return['await agent.execAction("wait", page, {',` action_data: { kwargs: { seconds: ${e.action_data?.kwargs?.seconds||1} } },`,"});"]}},rt=me.object({seconds:me.number().positive().describe("Number of seconds to wait")});function Va(e,t){e.register({name:"wait",description:"Wait for a specified number of seconds before continuing.",schema:rt,async execute(a,r){let{seconds:o}=a,{page:n,agentServices:s,actionDescription:c}=r;try{let i={action_description:c||`Wait ${o} seconds`,action_data:{action_name:"wait",kwargs:{seconds:o}}};return await t.execute(n,i,s),{success:!0,actionEntity:i,message:`Waited ${o} seconds`}}catch(i){return{success:!1,error:i.message,actionEntity:{action_description:(c||`Wait ${o} seconds`)+" (failed)",action_data:{action_name:"wait",kwargs:{seconds:o}},feedback:i.message}}}}})}import{z as ge}from"zod";var _e=class{async execute(e,t,a){let r=t.action_data;if(!r)throw new Error("Action data not found");let o=r.kwargs.timeout_seconds||10;await a.waitForDownloadComplete(e,o)}transpile(e){return['await agent.execAction("wait_for_download_complete", page, {',` action_data: { kwargs: { timeout_seconds: ${e.action_data?.kwargs?.timeout_seconds||10} } },`,"});"]}},nt=ge.object({timeout_seconds:ge.number().positive().optional().describe("Maximum time in seconds to wait for download to complete (default: 10)")});function Ka(e,t){e.register({name:"wait_for_download_complete",description:"Wait for an in-progress download to complete.",schema:nt,async execute(a,r){let{timeout_seconds:o=10}=a,{page:n,agentServices:s}=r;try{let c={action_description:`Wait for download to complete (timeout: ${o}s)`,action_data:{action_name:"wait_for_download_complete",kwargs:{timeout_seconds:o}}};return await t.execute(n,c,s),{success:!0,actionEntity:c,message:"Download completed"}}catch(c){return{success:!1,error:c.message,actionEntity:{action_description:"Wait for download to complete (failed)",action_data:{action_name:"wait_for_download_complete",kwargs:{timeout_seconds:o}},feedback:c.message}}}}})}import{z as E}from"zod";var we=class{async execute(e,t,a){let r=t.action_data;if(!r)throw new Error("Action data not found");let o=r.kwargs.condition;if(!o)throw new Error("Missing condition for ai_wait_until");let s=(r.kwargs.timeout_seconds||60)*1e3,c=1e3,i=Date.now(),{evaluateStatement:d}=await import("./agentHelpers-UCLT5EKK.js");for(;Date.now()-i<s;){if((await d(o,e,a,{})).success)return;await e.waitForTimeout(c)}throw new Error(`Timeout waiting for condition: ${o}`)}transpile(e,t){let a=e.action_data?.kwargs?.condition,r=e.action_data?.kwargs?.timeout_seconds||60;return a?[`await agent.waitUntilCondition(page, ${JSON.stringify(a)}, ${r}, '${t}');`]:["// Skipping ai_wait_until: missing condition"]}},it=E.object({condition:E.string().describe('The condition to wait for (e.g., "the loading spinner disappears")'),timeout_seconds:E.number().positive().optional().describe("Timeout in seconds (default: 60)")});function eo(e,t){e.register({name:"ai_wait_until",description:'Wait until a specific condition is met on the page (e.g., "page loads", "spinner disappears", "button becomes enabled"). Use this instead of wait when the goal is to wait for something to happen rather than waiting a fixed duration.',schema:it,async execute(a,r){let{condition:o,timeout_seconds:n=60}=a,{page:s,agentServices:c}=r;try{let i={action_description:`Wait until: ${o}`,action_data:{action_name:"ai_wait_until",kwargs:{condition:o,timeout_seconds:n}}};return await t.execute(s,i,c),{success:!0,actionEntity:i,message:`Condition met: ${o}`}}catch(i){return{success:!1,error:i.message,actionEntity:{action_description:`Wait until: ${o} (failed)`,action_data:{action_name:"ai_wait_until",kwargs:{condition:o,timeout_seconds:n}},feedback:i.message}}}}})}import{z as O}from"zod";var he=class{async execute(e,t,a){let r=t.action_data;if(!r)throw new Error("Action data not found");let o=r.kwargs.name,n=r.kwargs.value;if(!o||n===void 0)throw new Error("Missing variable name or value for save_variable");o.startsWith("$")&&(o=o.slice(1)),a.saveVariable(o,n)}transpile(e){let t=e.action_data?.kwargs?.name||"",a=e.action_data?.kwargs?.value;return['await agent.execAction("save_variable", page, {',` action_data: { kwargs: { name: ${JSON.stringify(t)}, value: ${JSON.stringify(a)} } },`,"});"]}},st=O.object({name:O.string().describe("Variable name to save"),value:O.string().describe("Value to save in the variable")});function ro(e,t){e.register({name:"save_variable",description:"Save a value to a named variable for later use in the test.",schema:st,async execute(a,r){let{name:o,value:n}=a,{page:s,agentServices:c}=r;try{let i={action_description:`Save variable "${o}" = "${n}"`,action_data:{action_name:"save_variable",kwargs:{name:o,value:n}}};return await t.execute(s,i,c),{success:!0,actionEntity:i,message:`Saved variable "${o}"`}}catch(i){return{success:!1,error:i.message,actionEntity:{action_description:`Save variable "${o}" (failed)`,action_data:{action_name:"save_variable",kwargs:{name:o,value:n}},feedback:i.message}}}}})}import{z as D}from"zod";var k=class{async execute(e,t){let a=t.action_data;if(!a)throw new Error("Action data not found");let r=a.kwargs.down??!0,o=a.kwargs.num_pages??1,n=r?1:-1;await e.evaluate(`window.scrollBy(0, window.innerHeight * ${o} * ${n})`)}transpile(e){let t=e.action_data?.kwargs?.down??!0,a=e.action_data?.kwargs?.num_pages??1;return['await agent.execAction("scroll", page, {',` action_data: { kwargs: { down: ${t}, num_pages: ${a} } },`,"});"]}};async function ct(e,t,a={}){return{action_description:t,action_data:{action_name:e,kwargs:{...a}}}}function lt(e,t,a){return{action_description:`${e} (failed)`,action_data:{action_name:t,kwargs:a},feedback:"Scroll failed!"}}var dt=D.object({down:D.boolean().describe("True to scroll down, False to scroll up"),num_pages:D.number().nonnegative().describe("Number of pages to scroll (0.5 = half page, 1.0 = one page, etc.)")});function co(e,t){e.register({name:"scroll",description:"Scroll the page by specified number of pages (set down=True to scroll down, down=False to scroll up, num_pages=number of pages to scroll like 0.5 for half page, 1.0 for one page, etc.). ",schema:dt,async execute(a,r){let{down:o,num_pages:n}=a,{page:s,agentServices:c,actionDescription:i}=r;try{let d=i||`Scroll ${o?"down":"up"} ${n} page(s)`,l=await ct("scroll",d,{down:o,num_pages:n});return await t.execute(s,l,c),{success:!0,actionEntity:l,message:`Scrolled ${o?"down":"up"} ${n} page(s)`}}catch(d){return{success:!1,error:d.message,actionEntity:lt(i||`Scroll ${o?"down":"up"} ${n} page(s)`,"scroll",{down:o,num_pages:n})}}}})}import{z as v}from"zod";u();var ye=class{async execute(e,t){let a=t.action_data;if(!a)throw new Error("Action data not found");let r=a.kwargs.delta_x||0,o=a.kwargs.delta_y||0,n=m(e,t);if(n)await n.hover({timeout:p}),await e.mouse.wheel(r,o);else throw new Error("No locator found for scroll_on_element action")}transpile(e){let t=e.action_data?.kwargs?.delta_x||0,a=e.action_data?.kwargs?.delta_y||0,r=[];return r.push(`action_data: { kwargs: { delta_x: ${t}, delta_y: ${a} } }`),e.locator?r.push(`locator: ${JSON.stringify(e.locator)}`):e.xpath&&r.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&r.push(`frame_path: ${JSON.stringify(e.frame_path)}`),['await agent.execAction("scroll_on_element", page, {',...r.map(o=>` ${o},`),"});"]}};async function ut(e,t,a,r,o={}){return{...await g(r,a),action_description:t,action_data:{action_name:e,kwargs:{...o}}}}function xe(e,t,a){return{action_description:`${e} (failed)`,action_data:{action_name:t,kwargs:a},feedback:"Element not found in DOM"}}var pt=v.object({element_index:v.number().int().describe("Index of the scrollable element"),delta_x:v.number().optional().describe("The number of pixels to scroll horizontally. Positive values scroll right, negative values scroll left."),delta_y:v.number().optional().describe("The number of pixels to scroll vertically. Positive values scroll down, negative values scroll up.")});function go(e,t){e.register({name:"scroll_on_element",description:"Scroll on a scrollable element horizontally and vertically.",schema:pt,usesElementIndex:!0,async execute(a,r){let{element_index:o,delta_x:n,delta_y:s}=a,{page:c,agentServices:i}=r;try{let d=await f(r,o);if(!d)return{success:!1,error:`Element with index ${o} not found`,actionEntity:xe(`Scroll on element ${o} horizontally: ${n}px, vertically: ${s}px`,"scroll_on_element",{index:o,delta_x:n,delta_y:s})};let l=await ut("scroll_on_element",`Scroll on element ${o} horizontally: ${n}px, vertically: ${s}px`,d,c,{delta_x:n,delta_y:s});return await t.execute(c,l,i),{success:!0,actionEntity:l,message:`Scrolled on element ${o} horizontally: ${n}px, vertically: ${s}px`}}catch(d){return{success:!1,error:d.message,actionEntity:xe(`Scroll on element ${o} horizontally: ${n}px, vertically: ${s}px`,"scroll_on_element",{index:o,delta_x:n,delta_y:s})}}}})}import{z as ke}from"zod";var be=class{async execute(e,t){let a=t.action_data;if(!a)throw new Error("Action data not found");let r=a.kwargs.text;if(r)await e.getByText(r,{exact:!1}).first().scrollIntoViewIfNeeded(),await e.waitForTimeout(500);else throw new Error("Missing text for scroll_to_text action")}transpile(e){let t=e.action_data?.kwargs?.text||"";return['await agent.execAction("scroll_to_text", page, {',` action_data: { kwargs: { text: ${JSON.stringify(t)} } },`,"});"]}},mt=ke.object({text:ke.string().describe("Text to scroll to on the page")});function xo(e,t){e.register({name:"scroll_to_text",description:"Scroll the page until specified text becomes visible.",schema:mt,async execute(a,r){let{text:o}=a,{page:n,agentServices:s,actionDescription:c}=r;try{let i={action_description:c||`Scroll to text "${o}"`,action_data:{action_name:"scroll_to_text",kwargs:{text:o}}};return await t.execute(n,i,s),{success:!0,actionEntity:i,message:`Scrolled to text "${o}"`}}catch(i){return{success:!1,error:i.message,actionEntity:{action_description:(c||`Scroll to text "${o}"`)+" (failed)",action_data:{action_name:"scroll_to_text",kwargs:{text:o}},feedback:i.message}}}}})}import{z as N}from"zod";u();var $e=class{async execute(e,t){let a=t.action_data;if(!a)throw new Error("Action data not found");let r=a.kwargs.text||a.kwargs.option,o=m(e,t);if(o&&r)await o.selectOption(r,{timeout:p});else throw new Error("Missing locator or option label for select_dropdown_option action")}transpile(e){let t=e.action_data?.kwargs?.text||e.action_data?.kwargs?.option||"",a=[];return a.push(`action_data: { kwargs: { text: ${JSON.stringify(t)} } }`),e.locator?a.push(`locator: ${JSON.stringify(e.locator)}`):e.xpath&&a.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&a.push(`frame_path: ${JSON.stringify(e.frame_path)}`),['await agent.execAction("select_dropdown_option", page, {',...a.map(r=>` ${r},`),"});"]}};async function ft(e,t,a,r){return{...await g(t,e),action_description:r||`Select option "${a}"`,action_data:{action_name:"select_dropdown_option",kwargs:{text:a}}}}function ve(e,t){return{action_description:`${e} (failed - element not found)`,action_data:{action_name:"select_dropdown_option",kwargs:t},feedback:"Element not found in DOM"}}var gt=N.object({element_index:N.number().int().describe("Index of the dropdown/select element"),option:N.string().describe("Option value, label, or index to select")});function So(e,t){e.register({name:"select_dropdown_option",description:"Select an option from a dropdown/select element by value, label, or index.",schema:gt,usesElementIndex:!0,async execute(a,r){let{element_index:o,option:n}=a,{page:s,agentServices:c,actionDescription:i}=r;try{let d=await f(r,o);if(!d)return{success:!1,error:`Dropdown element with index ${o} not found`,actionEntity:ve(i||`Select option in dropdown ${o}`,{index:o,option:n})};let l=await ft(d,s,n,i);return await t.execute(s,l,c),{success:!0,actionEntity:l,message:`Selected option "${n}" in dropdown ${o}`}}catch(d){return{success:!1,error:d.message,actionEntity:ve(`Select option in dropdown ${o}`,{index:o,option:n})}}}})}import{z as I}from"zod";u();var Se=class{async execute(e,t,a){let r=t.action_data;if(!r)throw new Error("Action data not found");let o=r.kwargs.date;if(!o)throw new Error("Date value is required");if(!/^\d{4}-\d{2}-\d{2}$/.test(o))throw new Error(`Invalid date format: ${o}. Expected format: YYYY-MM-DD (e.g., 2024-03-15)`);let s=a.replaceVariables(String(o)),c=m(e,t);if(c){let i=await c.getAttribute("type").catch(()=>null);if(i&&i!=="date")throw new Error(`Element is not a native date picker (type="${i}"). This action only works with <input type="date">. For custom date pickers, use AI-powered actions.`);await c.fill(s,{timeout:p})}else throw new Error("No locator found for set_date_for_native_date_picker action")}transpile(e){let t=e.action_data?.kwargs?.date??"",a=[];return a.push(`action_data: { kwargs: { date: ${JSON.stringify(t)} } }`),e.locator?a.push(`locator: ${JSON.stringify(e.locator)}`):e.xpath&&a.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&a.push(`frame_path: ${JSON.stringify(e.frame_path)}`),['await agent.execAction("set_date_for_native_date_picker", page, {',...a.map(r=>` ${r},`),"});"]}};async function _t(e,t,a,r){return{...await g(a,t),action_description:e,action_data:{action_name:"set_date_for_native_date_picker",kwargs:{date:r}}}}function C(e,t){return{action_description:`${e} (failed - element not found)`,action_data:{action_name:"set_date_for_native_date_picker",kwargs:t},feedback:"Element not found in DOM"}}var wt=I.object({element_index:I.number().int().describe("Index of the native date picker input element"),date:I.string().regex(/^\d{4}-\d{2}-\d{2}$/).describe("Date in YYYY-MM-DD format (e.g., 2024-03-15)")});function No(e,t){e.register({name:"set_date_for_native_date_picker",description:`Set a date in a native HTML date picker input (<input type="date">).
|
|
11
|
+
|
|
12
|
+
IMPORTANT: ONLY use this action for input elements that have type="date" attribute (native HTML date picker).
|
|
13
|
+
Do NOT use it for custom/non-native date pickers
|
|
14
|
+
|
|
15
|
+
The date must be in YYYY-MM-DD format (e.g., 2024-03-15).`,schema:wt,usesElementIndex:!0,async execute(a,r){let{element_index:o,date:n}=a,{page:s,agentServices:c}=r;try{let i=await f(r,o);if(!i)return{success:!1,error:`Date picker element with index ${o} not found`,actionEntity:C(`Set date to ${n} on element ${o}`,{index:o,date:n})};let d=i.attributes.type;if(d!=="date")return{success:!1,error:`Element ${o} is not a native date picker (type="${d}"). This action only works with <input type="date">.`,actionEntity:C(`Set date to ${n} on element ${o}`,{index:o,date:n})};let l=await _t(`Set date to ${n} on element ${o}`,i,s,n);return await t.execute(s,l,c),{success:!0,actionEntity:l,message:`Set date to ${n} on element ${o}`}}catch(i){return{success:!1,error:i.message,actionEntity:C(`Set date to ${n} on element ${o}`,{index:o,date:n})}}}})}import{z as F}from"zod";u();var J=class{async execute(e,t,a){let r=t.action_data;if(!r)throw new Error("Action data not found");let o=r.kwargs.url;if(!o)throw new Error("Missing URL for go_to_url action");let n=r.kwargs.new_tab===!0,s=a.replaceVariables(String(o)),c=e;n&&(c=await e.context().newPage(),a.setPage(c)),await c.goto(s,{timeout:w}),await c.waitForLoadState("load",{timeout:w}),await c.waitForTimeout(1e3)}transpile(e){let t=e.action_data?.kwargs?.url||"";return e.action_data?.kwargs?.new_tab===!0?['await agent.execAction("go_to_url", page, {',` action_data: { kwargs: { url: ${JSON.stringify(t)}, new_tab: true } },`,"});"]:['await agent.execAction("go_to_url", page, {',` action_data: { kwargs: { url: ${JSON.stringify(t)} } },`,"});"]}},ht=F.object({url:F.string().describe("URL to navigate to (must be a valid HTTP/HTTPS URL)"),new_tab:F.boolean().optional().describe("If true, open the URL in a new tab instead of the current page. Default is false.")});function Uo(e,t){e.register({name:"go_to_url",description:"Navigate to a specific URL. Use this to visit web pages. Set new_tab=true to open in a new tab.",schema:ht,async execute(a,r){let{url:o,new_tab:n}=a,{page:s,agentServices:c,actionDescription:i}=r;try{let d=n?`Open ${o} in new tab`:`Navigate to ${o}`,l={action_description:i||d,action_data:{action_name:"go_to_url",kwargs:{url:o,new_tab:n??!1}}};return await t.execute(s,l,c),{success:!0,actionEntity:l,message:n?`Opened ${o} in new tab`:`Navigated to ${o}`}}catch(d){let l=n?`Open ${o} in new tab`:`Navigate to ${o}`;return{success:!1,error:d.message,actionEntity:{action_description:(i||l)+" (failed)",action_data:{action_name:"go_to_url",kwargs:{url:o,new_tab:n??!1}},feedback:d.message}}}}})}import{z as Ae}from"zod";u();var U=class{async execute(e,t){let a=m(e,t);if(a){await a.waitFor({state:"attached",timeout:p});let r=await a.elementHandle();if(!r)throw new Error("Unable to obtain element handle for hover action");let o=await r.boundingBox();if(!o)throw new Error("Unable to determine bounding box for hover action");let n=o.x+o.width/2,s=o.y+o.height/2;await e.mouse.move(n,s)}else throw new Error("No locator found for hover action")}transpile(e){let t=[];return e.locator?t.push(`locator: ${JSON.stringify(e.locator)}`):e.xpath&&t.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&t.push(`frame_path: ${JSON.stringify(e.frame_path)}`),t.length===0?['await agent.execAction("hover", page, {});']:['await agent.execAction("hover", page, {',...t.map(a=>` ${a},`),"});"]}};async function xt(e,t,a,r,o={}){return{...await g(r,a),action_description:t,action_data:{action_name:e,kwargs:{...o}}}}function Te(e,t,a){return{action_description:`${e} (failed - element not found)`,action_data:{action_name:t,kwargs:a},feedback:"Element not found in DOM"}}var yt=Ae.object({element_index:Ae.number().int().describe("Index of the element to hover over")});function Wo(e,t){e.register({name:"hover",description:"Hover over an interactive element.",schema:yt,usesElementIndex:!0,async execute(a,r){let{element_index:o}=a,{page:n,agentServices:s,actionDescription:c}=r;try{let i=await f(r,o);if(!i)return{success:!1,error:`Element with index ${o} not found.`,actionEntity:Te(`Hover element ${o}`,"hover",{index:o})};let d=c||`Hover over element ${o}`,l=await xt("hover",d,i,n);return await t.execute(n,l,s),{success:!0,actionEntity:l,message:`Hovered over element ${o}`}}catch(i){return{success:!1,error:i.message,actionEntity:Te(`Hover element ${o}`,"hover",{index:o})}}}})}import{z as M}from"zod";u();var P=class{async execute(e,t,a){let r=t.action_data;if(!r)throw new Error("Action data not found");let o=r.kwargs.text??r.kwargs.value??"",n=a.replaceVariables(String(o)),s=m(e,t);if(s){await s.evaluate(d=>{d.value&&(d.value="")},null,{timeout:p}),await s.click({timeout:p}),await e.waitForTimeout(200);let i=a.getActionSettings().type_delay;i!==void 0?await e.keyboard.type(n,{delay:i}):await e.keyboard.type(n)}else throw new Error("No locator found for input_text action")}transpile(e){let t=e.action_data?.kwargs?.text??e.action_data?.kwargs?.value??"",a=[];return a.push(`action_data: { kwargs: { text: ${JSON.stringify(t)} } }`),e.locator?a.push(`locator: ${JSON.stringify(e.locator)}`):e.xpath&&a.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&a.push(`frame_path: ${JSON.stringify(e.frame_path)}`),['await agent.execAction("input_text", page, {',...a.map(r=>` ${r},`),"});"]}};async function kt(e,t,a,r,o={}){return{...await g(r,a),action_description:t,action_data:{action_name:e,kwargs:{...o}}}}function Ee(e,t,a){return{action_description:`${e} (failed - element not found)`,action_data:{action_name:t,kwargs:a},feedback:"Element not found in DOM"}}var bt=M.object({element_index:M.number().int().describe("Index of the input element"),text:M.string().describe("Text to type into the input. To use a placeholder, write {{ placeholder_name }} using exact placeholder name. Use clear_input first if you want to replace existing content.")});function Yo(e,t){e.register({name:"input_text",description:"Type text into an input field. To replace existing content, use clear_input first.",schema:bt,usesElementIndex:!0,async execute(a,r){let{element_index:o,text:n}=a,{page:s,agentServices:c,actionDescription:i}=r;try{let d=await f(r,o);if(!d)return{success:!1,error:`Input element with index ${o} not found`,actionEntity:Ee(i||`Input text to element ${o}`,"input_text",{index:o,text:n})};let l=i||`Input text to element ${o}`,_=await kt("input_text",l,d,s,{text:n});return await t.execute(s,_,c),{success:!0,actionEntity:_,message:`Input text to element ${o}`}}catch(d){return{success:!1,error:d.message,actionEntity:Ee(`Input text to element ${o}`,"input_text",{index:o,text:n})}}}})}import{z as Oe}from"zod";var L=class{async execute(e,t){let a=t.action_data;if(!a)throw new Error("Action data not found");let r=a.kwargs.keys;if(!r||typeof r!="string")throw new Error("Missing or invalid keys for press action");await e.keyboard.press(r),await e.waitForTimeout(500)}transpile(e){let t=e.action_data?.kwargs?.keys;return['await agent.execAction("press", page, {',` action_data: { kwargs: { keys: ${JSON.stringify(t)} } },`,"});"]}},vt=Oe.object({keys:Oe.string().describe("A single key or key combination to press (e.g. Escape, Backspace, Insert, PageDown, Delete, Tab, Enter). Key combinations like `Control+o`, `Control+Shift+T`, `ControlOrMeta+a` are supported. Note: This does NOT support sequences - to press multiple keys in sequence (e.g., Control+A then Backspace), call this action multiple times.")});function Zo(e,t){e.register({name:"press",description:"Press a single keyboard key or key combination. Supports combinations like `Control+A` for select all. Does NOT support sequences - call this action multiple times to press keys in sequence.",schema:vt,async execute(a,r){let{keys:o}=a,{page:n,agentServices:s,actionDescription:c}=r;try{let i={action_description:c||`Press keys "${o}"`,action_data:{action_name:"press",kwargs:{keys:o}}};return await t.execute(n,i,s),{success:!0,actionEntity:i,message:`Pressed keys "${o}"`}}catch(i){return{success:!1,error:i.message,actionEntity:{action_description:(c||`Press keys "${o}"`)+" (failed)",action_data:{action_name:"press",kwargs:{keys:o}},feedback:i.message}}}}})}import{z as $t}from"zod";u();var De=class{async execute(e,t){await e.reload({timeout:w}),await e.waitForLoadState("load",{timeout:w}),await e.waitForTimeout(1e3)}transpile(e){return['await agent.execAction("reload_page", page, {});']}},St=$t.object({});function or(e,t){e.register({name:"reload_page",description:"Reload the current page. WARNING: This will reset any in-progress forms or multi-step flows (like login). Only use when you need to refresh stale data or clear a stuck state. Do NOT use during login, checkout, or form submission flows.",schema:St,async execute(a,r){let{page:o,agentServices:n}=r;try{let s={action_description:"Reload page",action_data:{action_name:"reload_page",kwargs:{}}};return await t.execute(o,s,n),{success:!0,actionEntity:s,message:`Reloaded ${o.url()}`}}catch(s){return{success:!1,error:s.message,actionEntity:{action_description:"Reload page (failed)",action_data:{action_name:"reload_page",kwargs:{}},feedback:s.message}}}}})}import{z as Ne}from"zod";u();var j=class{async execute(e,t){let a=m(e,t);if(a)await a.click({button:"right",timeout:p});else throw new Error("No locator found for right_click action")}transpile(e){let t=[];return e.locator?t.push(`locator: ${JSON.stringify(e.locator)}`):e.xpath&&t.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&t.push(`frame_path: ${JSON.stringify(e.frame_path)}`),t.length===0?['await agent.execAction("right_click", page, {});']:['await agent.execAction("right_click", page, {',...t.map(a=>` ${a},`),"});"]}};async function At(e,t,a,r,o={}){return{...await g(r,a),action_description:t,action_data:{action_name:e,kwargs:{...o}}}}function Ie(e,t,a){return{action_description:`${e} (failed - element not found)`,action_data:{action_name:t,kwargs:a},feedback:"Element not found in DOM"}}var Tt=Ne.object({element_index:Ne.number().int().describe("Index of the element to right-click")});function lr(e,t){e.register({name:"right_click",description:"Right-click an interactive element.",schema:Tt,usesElementIndex:!0,async execute(a,r){let{element_index:o}=a,{page:n,agentServices:s,actionDescription:c}=r;try{let i=await f(r,o);if(!i)return{success:!1,error:`Element with index ${o} not found.`,actionEntity:Ie(`Right-click element ${o}`,"right_click",{index:o})};let d=c||`Right-click element ${o}`,l=await At("right_click",d,i,n);return await t.execute(n,l,s),{success:!0,actionEntity:l,message:`Right-clicked element ${o}`}}catch(i){return{success:!1,error:i.message,actionEntity:Ie(`Right-click element ${o}`,"right_click",{index:o})}}}})}import{z}from"zod";var Ce=class{async execute(e,t){}transpile(e){return["// Done - no action needed"]}},Et=z.object({success:z.boolean().describe("Whether the task was completed successfully"),summary:z.string().describe("Summary of what was accomplished or why it failed")});function mr(e,t){e.register({name:"done",description:"Mark the current task as complete. Use when you have finished all requested actions.",schema:Et,async execute(a,r){let{page:o,agentServices:n}=r;try{let s={action_description:"Task completed",action_data:{action_name:"done",kwargs:{}}};return await t.execute(o,s,n),{success:!0,actionEntity:s,message:"Task marked as complete"}}catch(s){return{success:!1,error:s.message,actionEntity:{action_description:"Task completed (failed)",action_data:{action_name:"done",kwargs:{}},feedback:s.message}}}}})}import{z as Fe}from"zod";u();var W=class{async execute(e,t){let a=m(e,t);if(a)await a.dblclick({timeout:p});else throw new Error("No locator found for double_click action")}transpile(e){let t=[];return e.locator?t.push(`locator: ${JSON.stringify(e.locator)}`):e.xpath&&t.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&t.push(`frame_path: ${JSON.stringify(e.frame_path)}`),t.length===0?['await agent.execAction("double_click", page, {});']:['await agent.execAction("double_click", page, {',...t.map(a=>` ${a},`),"});"]}};async function Ot(e,t,a,r,o={}){return{...await g(r,a),action_description:t,action_data:{action_name:e,kwargs:{...o}}}}function Je(e,t,a){return{action_description:`${e} (failed - element not found)`,action_data:{action_name:t,kwargs:a},feedback:"Element not found in DOM"}}var Dt=Fe.object({element_index:Fe.number().int().describe("Index of the element to double-click")});function xr(e,t){e.register({name:"double_click",description:"Double-click an interactive element.",schema:Dt,usesElementIndex:!0,async execute(a,r){let{element_index:o}=a,{page:n,agentServices:s,actionDescription:c}=r;try{let i=await f(r,o);if(!i)return{success:!1,error:`Element with index ${o} not found.`,actionEntity:Je(`Double-click element ${o}`,"double_click",{index:o})};let d=c||`Double-click element ${o}`,l=await Ot("double_click",d,i,n);return await t.execute(n,l,s),{success:!0,actionEntity:l,message:`Double-clicked element ${o}`}}catch(i){return{success:!1,error:i.message,actionEntity:Je(`Double-click element ${o}`,"double_click",{index:o})}}}})}import{z as Ue}from"zod";var Me=class{async execute(e,t,a){let r=t.action_data;if(!r)throw new Error("Action data not found");let o=r.kwargs.otp_secret_key;if(!o)throw new Error("Missing otp_secret_key for generate_2fa_code");let n=a.replaceVariables(String(o)),s=await a.generate2faCode(n);a.saveVariable("otp_code",s)}transpile(e){let t=e.action_data?.kwargs?.otp_secret_key||"";return['await agent.execAction("generate_2fa_code", page, {',` action_data: { kwargs: { otp_secret_key: ${JSON.stringify(t)} } },`,"});"]}},Nt=Ue.object({otp_secret_key:Ue.string().describe("The OTP secret key to generate the 2FA code from")});function vr(e,t){e.register({name:"generate_2fa_code",description:'Generate a 2FA code from an OTP secret key. The code is saved to the "otp_code" variable. To use the otp_code, you must use `$otp_code` to access it.',schema:Nt,async execute(a,r){let{otp_secret_key:o}=a,{page:n,agentServices:s}=r;try{let c={action_description:"Generate 2FA code",action_data:{action_name:"generate_2fa_code",kwargs:{otp_secret_key:o}}};return await t.execute(n,c,s),{success:!0,actionEntity:c,message:'Generated 2FA code and saved to variable "otp_code"'}}catch(c){return{success:!1,error:c.message,actionEntity:{action_description:"Generate 2FA code (failed)",action_data:{action_name:"generate_2fa_code",kwargs:{otp_secret_key:o}},feedback:c.message}}}}})}import{z as Pe}from"zod";var je=class{async execute(e,t,a){if(!t.xpath)throw new Error("XPath not found in action entity");let r=[];for(let o of e.frames())try{let n=await o.evaluate(s=>{let c=document.evaluate(s,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;return c?{options:Array.from(c.options).map(i=>({text:i.text,value:i.value,index:i.index})),id:c.id,name:c.name}:null},t.xpath);if(n){let s=[];for(let c of n.options){let i=JSON.stringify(c.text);s.push(`${c.index}: text=${i}`)}r.push(...s)}}catch{}if(r.length>0){let o=r.join(`
|
|
16
|
+
`);o+=`
|
|
17
|
+
Use the exact text string in select_dropdown_option`,a.addNote(o)}else a.addNote("No options found in any frame for dropdown")}transpile(e){let t=[];return e.xpath&&t.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&t.push(`frame_path: ${JSON.stringify(e.frame_path)}`),t.length===0?['await agent.execAction("get_dropdown_options", page, {});']:['await agent.execAction("get_dropdown_options", page, {',...t.map(a=>` ${a},`),"});"]}};async function It(e,t,a){return{...await g(t,e),action_description:a||"Get dropdown options",action_data:{action_name:"get_dropdown_options",kwargs:{}}}}function Le(e,t){return{action_description:`${e} (failed - element not found)`,action_data:{action_name:"get_dropdown_options",kwargs:t},feedback:"Element not found in DOM"}}var Ct=Pe.object({element_index:Pe.number().int().describe("Index of the dropdown/select element")});function Er(e,t){e.register({name:"get_dropdown_options",description:"Get all options from a native dropdown",schema:Ct,usesElementIndex:!0,async execute(a,r){let{element_index:o}=a,{page:n,agentServices:s,actionDescription:c}=r;try{let i=await f(r,o);if(!i)return{success:!1,error:`Dropdown element with index ${o} not found`,actionEntity:Le(c||`Get options from dropdown ${o}`,{index:o})};let d=await It(i,n,c);return await t.execute(n,d,s),{success:!0,actionEntity:d,message:d.feedback||"No options found"}}catch(i){return{success:!1,error:i.message,actionEntity:Le(c||`Get options from dropdown ${o}`,{index:o})}}}})}import{z as Ft}from"zod";u();var ze=class{async execute(e,t){await e.goBack({timeout:w}),await e.waitForLoadState("load",{timeout:w}),await e.waitForTimeout(1e3)}transpile(e){return['await agent.execAction("go_back", page, {});']}},Jt=Ft.object({});function Cr(e,t){e.register({name:"go_back",description:"Navigate back to the previous page in browser history.",schema:Jt,async execute(a,r){let{page:o,agentServices:n,actionDescription:s}=r;try{let c={action_description:s||"Go back",action_data:{action_name:"go_back",kwargs:{}}};return await t.execute(o,c,n),{success:!0,actionEntity:c,message:"Navigated back"}}catch(c){return{success:!1,error:c.message,actionEntity:{action_description:(s||"Go back")+" (failed)",action_data:{action_name:"go_back",kwargs:{}},feedback:c.message}}}}})}import{parse as Ut}from"@babel/parser";function We(e){if(!e.trim())return!1;try{return Ut(e,{sourceType:"module",plugins:["typescript"]}),!0}catch{return!1}}import{z as Re}from"zod";import*as Mt from"playwright/test";import{default as Pt}from"playwright/test";var R={};Y(R,{default:()=>Pt});q(R,Mt);var $=class{async execute(e,t,a){let r=t.action_data?.kwargs;if(r?.code){await this.executeJSAssertion(e,r.code,a);return}let o=r?.statement||t.action_description;if(!o)throw new Error("Missing statement or code for verify action");let{evaluateStatement:n}=await import("./agentHelpers-UCLT5EKK.js"),s=await n(o,e,a,{}),c=s.explanation||s.error||(s.success?`Assertion passed: ${o}`:"Assertion failed");if(a.addNote(c),!s.success)throw new Error(s.error||s.explanation||"Assertion failed")}async executeJSAssertion(e,t,a){try{await new Function("page","expect","agentServices",`
|
|
18
|
+
return (async () => {
|
|
19
|
+
${t}
|
|
20
|
+
})();
|
|
21
|
+
`)(e,R.expect,a)}catch(r){throw new Error(`Assertion failed: ${r.message}`)}}transpile(e,t){let a=e.action_data?.kwargs;if(a?.code){let n=a.code;return We(n)?n.split(`
|
|
22
|
+
`):[`throw new Error("Invalid assertion code syntax: " + ${JSON.stringify(n)});`]}let r=a?.statement||e.action_description;return r?[`await agent.assert(page, ${JSON.stringify(r)}, '${t||""}');`]:["// Skipping verify: missing statement or code"]}},Lt=Re.object({statement:Re.string().describe('The assertion statement to verify (e.g., "The login was successful")')});function Wr(e,t){e.register({name:"verify",description:"Verify that a statement is true based on the current page state. Use this to check assertions about the page content, element visibility, or any condition.",schema:Lt,async execute(a,r){let{statement:o}=a,{page:n,agentServices:s}=r;try{let c={action_description:`${o}`,action_data:{action_name:"verify",kwargs:{statement:o}}};return await t.execute(n,c,s),{success:!0,actionEntity:c,message:`Assertion verified: ${o}`}}catch(c){return{success:!1,error:c.message,actionEntity:{action_description:`Verify: ${o} (failed)`,action_data:{action_name:"verify",kwargs:{statement:o}},feedback:c.message}}}},availability:{openai:!0,mcp:!0}})}import{z as B}from"zod";var Be=class{async execute(e,t,a){let r=t.action_data;if(!r)throw new Error("Action data not found");let o=r.kwargs.element_description,n=r.kwargs.variable_name;if(!o||!n)throw new Error("Missing element_description or variable_name for ai_extract");let s=`Extract ${o} and save to ${n}`,{executeStep:c}=await import("./agentHelpers-UCLT5EKK.js"),i=await c(s,e,a);if(i.status!=="success")throw new Error(i.error||"Extraction failed")}transpile(e,t){let a=e.action_data?.kwargs?.element_description,r=e.action_data?.kwargs?.variable_name;if(!a||!r)return["// Skipping ai_extract: missing element_description or variable_name"];let o=JSON.stringify(a),n=JSON.stringify(r);return[`await agent.extract(page, ${o}, ${n}, '${t||""}');`]}},jt=B.object({elementDescription:B.string().describe('Description of the element to extract (e.g., "the price of the product")'),variableName:B.string().describe("Name of the variable to store the extracted value")});function Vr(e,t){e.register({name:"ai_extract",description:"Use AI to extract information from the page and save it to a variable. MCP-only tool.",schema:jt,async execute(a,r){let{elementDescription:o,variableName:n}=a,{page:s,agentServices:c}=r;try{let i={action_description:`Extract ${o} to ${n}`,action_data:{action_name:"ai_extract",kwargs:{element_description:o,variable_name:n}}};return await t.execute(s,i,c),{success:!0,actionEntity:i,message:`Extracted ${o} to ${n}`}}catch(i){return{success:!1,error:i.message,actionEntity:{action_description:`Extract ${o} (failed)`,action_data:{action_name:"ai_extract",kwargs:{element_description:o,variable_name:n}},feedback:i.message}}}},availability:{openai:!1,mcp:!0}})}import{z as Ge}from"zod";u();var He=class{async execute(e,t){let a=m(e,t);if(a)await a.click({timeout:p}),await e.keyboard.press("ControlOrMeta+a"),await e.waitForTimeout(200),await e.keyboard.press("Backspace"),await e.waitForTimeout(200);else throw new Error("No locator found for clear_input action")}transpile(e){let t=[];return e.locator?t.push(`locator: ${JSON.stringify(e.locator)}`):e.xpath&&t.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&t.push(`frame_path: ${JSON.stringify(e.frame_path)}`),t.length===0?['await agent.execAction("clear_input", page, {});']:['await agent.execAction("clear_input", page, {',...t.map(a=>` ${a},`),"});"]}};async function zt(e,t,a,r,o={}){return{...await g(r,a),action_description:t,action_data:{action_name:e,kwargs:{...o}}}}function Ve(e,t,a){return{action_description:`${e} (failed - element not found)`,action_data:{action_name:t,kwargs:a},feedback:"Element not found in DOM"}}var Wt=Ge.object({element_index:Ge.number().int().describe("Index of the input element to clear")});function Zr(e,t){e.register({name:"clear_input",description:"Clear the contents of an input field, textarea, or other editable element.",schema:Wt,usesElementIndex:!0,async execute(a,r){let{element_index:o}=a,{page:n,agentServices:s,actionDescription:c}=r;try{let i=await f(r,o);if(!i)return{success:!1,error:`Input element with index ${o} not found`,actionEntity:Ve(c||`Clear element ${o}`,"clear_input",{index:o})};let d=c||`Clear element ${o}`,l=await zt("clear_input",d,i,n);return await t.execute(n,l,s),{success:!0,actionEntity:l,message:`Cleared element ${o}`}}catch(i){return{success:!1,error:i.message,actionEntity:Ve(`Clear element ${o}`,"clear_input",{index:o})}}}})}import{z as Ye}from"zod";u();var S=class{async execute(e,t){let a=m(e,t);if(a){await a.click({timeout:p});try{await e.waitForTimeout(1e3)}catch{}}else throw new Error("No locator found for click action")}transpile(e){let t=[];return e.locator?t.push(`locator: ${JSON.stringify(e.locator)}`):e.xpath&&t.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&t.push(`frame_path: ${JSON.stringify(e.frame_path)}`),t.length===0?['await agent.execAction("click", page, {});']:['await agent.execAction("click", page, {',...t.map(a=>` ${a},`),"});"]}};async function Rt(e,t,a,r,o={}){return{...await g(r,a),action_description:t,action_data:{action_name:e,kwargs:{...o}}}}function qe(e,t,a){return{action_description:`${e} (failed - element not found)`,action_data:{action_name:t,kwargs:a},feedback:"Element not found in DOM"}}var Bt=Ye.object({element_index:Ye.number().int().describe("Index of the element to click (0-based). Return -1 if no element found")});function rn(e,t){e.register({name:"click",description:"Click an interactive element.",schema:Bt,usesElementIndex:!0,async execute(a,r){let{element_index:o}=a,{page:n,agentServices:s,actionDescription:c}=r;try{let i=await f(r,o);if(!i)return{success:!1,error:`Element with index ${o} not found.`,actionEntity:qe(`Click element ${o}`,"click",{index:o})};let d=c||`Click element ${o}`,l=await Rt("click",d,i,n);return await t.execute(n,l,s),{success:!0,actionEntity:l,message:`Clicked element ${o}`}}catch(i){return{success:!1,error:i.message,actionEntity:qe(`Click element ${o}`,"click",{index:o})}}}})}import{z as Ke}from"zod";var Xe=class{async execute(e,t,a){let r=t.action_data;if(!r)throw new Error("Action data not found");let o=r.kwargs.page_id??r.kwargs.index;if(o===void 0&&(o=e.context().pages().indexOf(e)),typeof o=="number"){if(o===0)throw new Error("Cannot close the first tab (page_id 0). Skipping close_tab action.");a&&await a.closeTab(o)}else throw new Error("Missing page_id for close_tab action")}transpile(e){let t=e.action_data?.kwargs?.page_id;return t=t??e.action_data?.kwargs?.index,['await agent.execAction("close_tab", page, {',` action_data: { kwargs: { page_id: ${t} } },`,"});"]}},Gt=Ke.object({index:Ke.number().int().nonnegative().optional().describe("Index of the tab to close (0-based). Defaults to current tab if not specified.")});function ln(e,t){e.register({name:"close_tab",description:"Close a browser tab by index. If no index is specified, closes the current tab.",schema:Gt,async execute(a,r){let{index:o}=a,{page:n,agentServices:s,actionDescription:c}=r;try{let i={action_description:c||`Close tab ${o}`,action_data:{action_name:"close_tab",kwargs:{page_id:o}}};return await t.execute(n,i,s),{success:!0,actionEntity:i,message:`Closed tab ${o}`}}catch(i){return{success:!1,error:i.message,actionEntity:{action_description:(c||"Close tab")+" (failed)",action_data:{action_name:"close_tab",kwargs:{}},feedback:i.message}}}}})}var Vt=["ai_action","ai_step","ai_assert","ai_extract","ai_wait_until","verify","assert"],Ht=["js_code","function","wait","wait_for_download_complete","wait_for_page_ready"],G=class{static isAiAction(e){let t=e.action_data?.action_name;return!t||(t==="verify"||t==="ai_assert"||t==="assert")&&e.action_data?.kwargs?.code?!1:Vt.includes(t)}static getAiStatement(e){let t=e.action_data?.action_name;if(!t)return null;let a=e.action_data?.kwargs||{};switch(t){case"ai_action":case"ai_step":return a.statement||null;case"verify":case"ai_assert":case"assert":return a.statement||e.action_description||null;case"ai_extract":let r=a.element_description,o=a.variable_name;return r&&o?`Extract ${r} and save to ${o}`:null;case"ai_wait_until":return a.condition||null;default:return null}}static canSelfHeal(e){let t=e.action_data?.action_name;return!t||(t==="verify"||t==="ai_assert"||t==="assert")&&e.action_data?.kwargs?.code?!1:!Ht.includes(t)}};var Yt=class{constructor(){this.actions=new Map,this.registerAllActions()}registerAllActions(){this.register("go_to_url",new J),this.register("go_back",new ze),this.register("reload_page",new De),this.register("close_tab",new Xe),this.register("switch_tab",new de),this.register("click",new S),this.register("hover",new U),this.register("right_click",new j),this.register("double_click",new W),this.register("click_by_coordinates",new ce),this.register("right_click_by_coordinates",new X),this.register("double_click_by_coordinates",new te),this.register("drag_drop",new ae),this.register("input_text",new P),this.register("clear_input",new He),this.register("press",new L),this.register("send_keys_on_element",new Z),this.register("scroll_on_element",new ye),this.register("scroll_to_text",new be),this.register("scroll",new k),this.register("upload_file",new pe),this.register("wait_for_download_complete",new _e),this.register("get_dropdown_options",new je),this.register("select_dropdown_option",new $e),this.register("set_date_for_native_date_picker",new Se),this.register("verify",new $),this.register("ai_action",new ne),this.register("ai_extract",new Be),this.register("ai_step",new se),this.register("ai_wait_until",new we),this.register("generate_2fa_code",new Me),this.register("wait",new fe),this.register("wait_for_page_ready",new K),this.register("save_variable",new he),this.register("js_code",new ee),this.register("function",new oe),this.register("done",new Ce),this.register("click_element",new S),this.register("click_element_by_index",new S),this.register("hover_element_by_index",new U),this.register("right_click_on_element",new j),this.register("double_click_on_element",new W),this.register("scroll_down",new k),this.register("scroll_up",new k),this.register("scroll_element",new k),this.register("send_keys",new L),this.register("open_tab",new J),this.register("fill",new P),this.register("ai_assert",new $),this.register("assert",new $)}register(e,t){this.actions.set(e,t)}getAction(e){return this.actions.get(e)}hasAction(e){return this.actions.has(e)}getActionNames(){return Array.from(this.actions.keys())}async execute(e,t,a){if(!a)throw new Error("AgentServices not found");let r=t.action_data?.action_name;if(!r)throw new Error("Action name not found in action_data");let o=this.getAction(r);if(!o)throw new Error(`Unknown action: ${r}`);await o.execute(e,t,a)}transpile(e,t,a){let{sanitizeForComment:r}=(u(),A(T)),o=e.action_description||"",n=e.action_data?.action_name||"",s=this.getAction(n);if(!s)return[`// ${t}: Unknown action: ${n}`];let c=s.transpile(e,t);if(G.isAiAction(e))return[`// ${t}: ${r(o)}`,"page = agent.agentServices.validatePage(page);","await agent.agentServices.waitUntilStable(page);",...c];let i=JSON.stringify(o),d=c.map(x=>` ${x}`),l=G.canSelfHeal(e),_=a?`'${a}'`:"undefined";return[`// ${t}: ${r(o)}`,"page = agent.agentServices.validatePage(page);","await agent.step(page, async () => {",...d,`}, ${i}, '${t}', ${_}, ${l});`]}transpileUncachedAction(e,t,a=!1,r=!1){let{sanitizeForComment:o}=(u(),A(T));if(!e)return[`// ${t}: Skipping - no description`];let n=JSON.stringify(e);return r?[`// ${t}: ${o(e)}`,"page = agent.agentServices.validatePage(page);","await agent.agentServices.waitUntilStable(page);",`await agent.run(page, ${n}, '${t}');`]:[`// ${t}: ${o(e)}`,"page = agent.agentServices.validatePage(page);","await agent.agentServices.waitUntilStable(page);",`await agent.execute(page, ${n}, '${t}', ${a});`]}},ei=Yt;export{Oa as a,Ja as b,za as c,Va as d,Ka as e,eo as f,ro as g,co as h,go as i,xo as j,So as k,No as l,Uo as m,Wo as n,Yo as o,Zo as p,or as q,lr as r,mr as s,xr as t,vr as u,Er as v,Cr as w,Wr as x,Vr as y,Zr as z,rn as A,ln as B,Yt as C,ei as D};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=Object.create;var o=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var p=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty;var d=(t,e,r)=>e in t?o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var v=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var N=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var O=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of c(e))!l.call(t,n)&&n!==r&&o(t,n,{get:()=>e[n],enumerable:!(i=_(e,n))||i.enumerable});return t};var R=(t,e,r)=>(r=t!=null?s(p(t)):{},O(e||!t||!t.__esModule?o(r,"default",{value:t,enumerable:!0}):r,t));var w=(t,e,r)=>d(t,typeof e!="symbol"?e+"":e,r);var h=class{constructor(){this.config=this.getDefaultConfig()}getDefaultConfig(){return{logLevel:1,debugAgent:!1,testResultsJsonPath:void 0,consoleLogsPath:void 0}}getConfig(){return{...this.config}}updateConfig(t){this.config={...this.config,...t}}resetConfig(){this.config=this.getDefaultConfig()}get(t){return this.config[t]}set(t,e){this.config[t]=e}},a=new h,D=a;function E(t){a.updateConfig(t)}function S(){return a.getConfig()}var u=Object.defineProperty,b=Object.getOwnPropertyDescriptor,g=Object.getOwnPropertyNames,C=Object.prototype.hasOwnProperty;var I=(t,e)=>function(){return t&&(e=(0,t[g(t)[0]])(t=0)),e},j=(t,e)=>{for(var r in e)u(t,r,{get:e[r],enumerable:!0})},f=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of g(e))!C.call(t,n)&&n!==r&&u(t,n,{get:()=>e[n],enumerable:!(i=b(e,n))||i.enumerable});return t},A=(t,e,r)=>(f(t,e,"default"),r&&f(r,e,"default")),F=t=>f(u({},"__esModule",{value:!0}),t);var P=(t=>(t[t.DEBUG=0]="DEBUG",t[t.INFO=1]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=3]="ERROR",t[t.SILENT=4]="SILENT",t))(P||{});export{v as a,N as b,R as c,w as d,D as e,E as f,S as g,I as h,j as i,A as j,F as k,P as l};
|