@shiplightai/mcp 0.1.56 → 0.1.58
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/{agentHelpers-CBXDLHMV-FEWOZV7Q.js → agentHelpers-JS57XP7E-NTDU7ALG.js} +1 -1
- package/dist/{agentLogin-5KZL6HVN-IMIVPSCB.js → agentLogin-LDQHQBLK-H5M326VA.js} +1 -1
- package/dist/{chunk-XJBTNDI5.js → chunk-4R7SSOTO.js} +13 -13
- package/dist/{chunk-KLNLVLWZ.js → chunk-HOPRFIKM.js} +13 -13
- package/dist/{chunk-X5NUVPAF.js → chunk-LATEXF4R.js} +1 -1
- package/dist/chunk-NEBLFLPV.js +4009 -0
- package/dist/{chunk-D7CZ6CG6.js → chunk-R4J6G5GI.js} +2 -2
- package/dist/{chunk-JCRZBZKB.js → chunk-THUEPEC3.js} +348 -443
- package/dist/{chunk-VGJ5XDNL.js → chunk-VTK25XN7.js} +2 -2
- package/dist/{dist-FZZSZ2MI.js → dist-EFYURXGQ.js} +1 -1
- package/dist/dist-K3ASWHBE.js +4 -0
- package/dist/{handler-NCYONWSZ-FHSI4NBE.js → handler-65CN5L7D-IN6OTBXK.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/{relayBrowserCache-QL6LD4JJ-AD6FFB2L.js → relayBrowserCache-QL6LD4JJ-WYEVE35H.js} +1 -1
- package/dist/server-MMON425X.js +22 -0
- package/dist/{task-YAUXJI3I-PMEHHFOD.js → task-ERIJWZDN-6R32Q2PD.js} +1 -1
- package/package.json +1 -1
- package/dist/chunk-MINNFENX.js +0 -3999
- package/dist/dist-VKTI46EV.js +0 -4
- package/dist/server-4Y6IT6HL.js +0 -22
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __createRequire } from "module";
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
|
-
import{d as o,e as h,f as g}from"./chunk-HBXQFJ2K.js";import{createRequire as x}from"module";var S=x(import.meta.url),b={};g(b,{ACTION_TIMEOUT:()=>f,GOTO_TIMEOUT:()=>w,LOCATOR_TIMEOUT:()=>c,getActionTimeoutMs:()=>_,getFrameContext:()=>d,getLocator:()=>O,getMinimalActionEntity:()=>E,getPageLocatorExpression:()=>$,sanitizeForComment:()=>L});function _(e,t){return t??e?.getActionSettings()?.action_timeout_ms??f}function L(e){return e.replace(/\r\n/g," ").replace(/\n/g," ").replace(/\r/g," ").trim()}function O(e,t){let a=$(t);return a?new Function("page",`return ${a}`)(e):null}async function d(e,t=[]){let a=e;for(let l of t){let n=await a.locator(l).elementHandle();if(!n)return null;let r=await n.contentFrame();if(await n.dispose(),!r)return null;a=r}return a}function E(e){let t={action_data:e.action_data};return e.locator&&(t.locator=e.locator),e.xpath&&(t.xpath=e.xpath),e.frame_path&&(t.frame_path=e.frame_path),t}function T(e){let t=e.frame_path;return!t||t.length===0?"page":`page.frameLocator('${t[0]}')`}function W(e){let t=e.xpath;return typeof t=="string"&&t.trim()?!t.startsWith("xpath=")&&!t.startsWith("/")&&!t.startsWith("//")?`xpath=//${t}`:t.startsWith("xpath=")?t:`xpath=${t}`:null}function $(e){let t=T(e),a=e.locator;if(typeof a=="string"&&a.trim())return a=a.trim(),a.endsWith("first()")?`${t}.${a}`:`${t}.${a}.first()`;let l=W(e);if(l){let n=JSON.stringify(l);return`${t}.locator(${n}).first()`}return null}var c,f,w,v=h(()=>{c=5e3,f=
|
|
4
|
+
import{d as o,e as h,f as g}from"./chunk-HBXQFJ2K.js";import{createRequire as x}from"module";var S=x(import.meta.url),b={};g(b,{ACTION_TIMEOUT:()=>f,GOTO_TIMEOUT:()=>w,LOCATOR_TIMEOUT:()=>c,getActionTimeoutMs:()=>_,getFrameContext:()=>d,getLocator:()=>O,getMinimalActionEntity:()=>E,getPageLocatorExpression:()=>$,sanitizeForComment:()=>L});function _(e,t){return t??e?.getActionSettings()?.action_timeout_ms??f}function L(e){return e.replace(/\r\n/g," ").replace(/\n/g," ").replace(/\r/g," ").trim()}function O(e,t){let a=$(t);return a?new Function("page",`return ${a}`)(e):null}async function d(e,t=[]){let a=e;for(let l of t){let n=await a.locator(l).elementHandle();if(!n)return null;let r=await n.contentFrame();if(await n.dispose(),!r)return null;a=r}return a}function E(e){let t={action_data:e.action_data};return e.locator&&(t.locator=e.locator),e.xpath&&(t.xpath=e.xpath),e.frame_path&&(t.frame_path=e.frame_path),t}function T(e){let t=e.frame_path;return!t||t.length===0?"page":`page.frameLocator('${t[0]}')`}function W(e){let t=e.xpath;return typeof t=="string"&&t.trim()?!t.startsWith("xpath=")&&!t.startsWith("/")&&!t.startsWith("//")?`xpath=//${t}`:t.startsWith("xpath=")?t:`xpath=${t}`:null}function $(e){let t=T(e),a=e.locator;if(typeof a=="string"&&a.trim())return a=a.trim(),a.endsWith("first()")?`${t}.${a}`:`${t}.${a}.first()`;let l=W(e);if(l){let n=JSON.stringify(l);return`${t}.locator(${n}).first()`}return null}var c,f,w,v=h(()=>{c=5e3,f=1e4,w=2e4});v();async function y(e,t,a=[],l=[]){try{let n=await d(e,a);if(!n)return o.warn(`Could not find frame context for xpath: ${t}`),null;let r=null;if(l.length>0){let s=l[0];if(!s)return o.warn(`Missing shadow host xpath for element: ${t}`),null;let u=n.locator(`xpath=${m(s)}`),p=C(t);if(r=await(p?u.locator(`css=${p}`):u.locator(`xpath=${m(t)}`)).elementHandle({timeout:c}),!r)return o.warn(`Could not find shadow DOM element with xpath: ${t}`),null}else if(r=await n.locator(`xpath=${t}`).elementHandle({timeout:c}),!r)return o.warn(`Could not find element with xpath: ${t}`),null;let i=await n.evaluate(s=>typeof playwright<"u"&&playwright.generateLocator?playwright.generateLocator(s):null,r);return await r.dispose(),i?(o.debug(`Generated locator for ${t}: ${i}`),i):(o.debug("playwright.generateLocator is not available (PWDEBUG=console not set), using xpath fallback"),null)}catch(n){return o.error(`Error in pickBestLocator: ${n}`),null}}async function q(e,t){try{let a=await(await t.ownerFrame()??e).evaluate(l=>typeof playwright<"u"&&playwright.generateLocator?playwright.generateLocator(l):null,t);return await t.dispose(),a?(o.debug(`Generated locator: ${a}`),a):(o.debug("playwright.generateLocator is not available (PWDEBUG=console not set), using xpath fallback"),null)}catch(a){return o.error(`Error in pickBestLocator: ${a}`),null}}async function F(e,t){let a=new Map;return await Promise.all(t.map(async l=>{let n=await y(e,l);a.set(l,n)})),a}function m(e){let t=e.trim();return t.startsWith("/")||t.startsWith("(")||t.startsWith(".")?t:`//${t}`}function C(e){let t=e.trim().replace(/^\/+/,"");if(!t)return null;let a=t.split("/").filter(Boolean),l=[];for(let n of a){let r=n.match(/^([a-zA-Z][\w-]*)(?:\[(\d+)\])?$/);if(!r)return null;let i=r[1].toLowerCase(),s=r[2]?`:nth-of-type(${r[2]})`:"";l.push(`${i}${s}`)}return l.join(" > ")}async function H(e,t){if(t<0)return;let{page:a,domService:l}=e;return(e.domState||await l.getClickableElements(a)).selectorMap.get(t)}function M(e){let t=e.split("/").filter(n=>n);if(t.length===0)return"*";let a=t[t.length-1],l=a.match(/^(\w+)(?:\[(\d+)\])?$/);if(l){let[,n,r]=l;return r?`${n}:nth-of-type(${r})`:n}return a}function A(e,t=!0){try{let a=M(e.xpath);if(e.attributes.class&&t){let n=/^[a-zA-Z_][a-zA-Z0-9_-]*$/,r=e.attributes.class.split(/\s+/);for(let i of r)i.trim()&&n.test(i)&&(a+=`.${i}`)}let l=new Set(["id","name","type","placeholder","aria-label","aria-labelledby","aria-describedby","role","for","autocomplete","required","readonly","alt","title","target"]);t&&["data-id","data-qa","data-cy","data-testid","data-handlepos"].forEach(n=>l.add(n));for(let[n,r]of Object.entries(e.attributes)){if(n==="class"||!n.trim()||!l.has(n))continue;let i=n.replace(/:/g,"\\:");if(r==="")a+=`[${i}]`;else if(/["'<>`\n\r\t]/.test(r)){let s=r;r.includes(`
|
|
5
5
|
`)&&(s=r.split(`
|
|
6
6
|
`)[0]),s=s.replace(/\s+/g," ").trim();let u=s.replace(/"/g,'\\"');a+=`[${i}*="${u}"]`}else a+=`[${i}="${r}"]`}return a}catch{return`${e.tagName||"*"}[highlight_index='${e.highlightIndex}']`}}function k(e){let t=e.attributes;if(t.title)return`iframe[title="${t.title.replace(/"/g,'\\"')}"]`;if(t.id)return`iframe#${t.id}`;if(t.name)return`iframe[name="${t.name.replace(/"/g,'\\"')}"]`;if(t.src){try{let a=new URL(t.src);if(a.protocol==="chrome-extension:")return`iframe[src^="${a.origin}"]`}catch{}return`iframe[src="${t.src.replace(/"/g,'\\"')}"]`}return A(e,!1)}function B(e){let t=[],a=e;for(;a&&a.parent!==null;){let r=a.parent;t.push(r),a=r}t.reverse();let l=[],n=t.filter(r=>r.tagName==="iframe");for(let r of n){let i=k(r);o.debug("[frame-path] iframe attrs:",JSON.stringify(r.attributes),"\u2192",i),l.push(i)}return l}async function I(e,t){let a=null,l=B(t);return t.xpath&&(a=await y(e,t.xpath,l,t.shadowHostXPaths??[])),{locator:a||void 0,xpath:t.xpath,frame_path:l}}export{b as a,_ as b,O as c,$ as d,w as e,v as f,y as g,q as h,F as i,H as j,B as k,I as l};
|