@shiplightai/mcp 0.1.48 → 0.1.49

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.
Files changed (48) hide show
  1. package/chrome-extension/background.js +11 -2
  2. package/dist/agentHelpers-242MN5TR-AK52N3RJ.js +4 -0
  3. package/dist/agentLogin-VLDCPI66-52P67BMY.js +4 -0
  4. package/dist/chunk-34YV5HSR.js +3999 -0
  5. package/dist/chunk-3KLJZX63.js +34 -0
  6. package/dist/chunk-5YN4X7LV.js +31 -0
  7. package/dist/chunk-67R4GP2H.js +4 -0
  8. package/dist/chunk-7W6YLS2E.js +22 -0
  9. package/dist/chunk-AFEFEPKR.js +4 -0
  10. package/dist/chunk-B7PRQ6ZM.js +4 -0
  11. package/dist/chunk-ETDHHU35.js +4 -0
  12. package/dist/chunk-FUPXB4VL.js +9 -0
  13. package/dist/chunk-GZSLCYQ7.js +192 -0
  14. package/dist/chunk-HHCLRZRA.js +15 -0
  15. package/dist/chunk-HQNPMIQW.js +200 -0
  16. package/dist/chunk-JKHKVGEC.js +4 -0
  17. package/dist/chunk-JT3U4KNR.js +59 -0
  18. package/dist/chunk-K7YTTSET.js +4 -0
  19. package/dist/chunk-KW4N7WFX.js +38 -0
  20. package/dist/chunk-LM633YUO.js +4 -0
  21. package/dist/chunk-ORSFJVJL.js +221 -0
  22. package/dist/chunk-PFLXO7G4.js +6 -0
  23. package/dist/chunk-PWGR4MG7.js +4 -0
  24. package/dist/chunk-RSM4LZ5P.js +4237 -0
  25. package/dist/chunk-Z3E7FIDS.js +17 -0
  26. package/dist/dist-CBGK26LV-CIQ64GXB.js +15 -0
  27. package/dist/dist-N7YI5OTM.js +4 -0
  28. package/dist/dist-VVPHZ43R.js +4 -0
  29. package/dist/dist-YNN5UBVC.js +4 -0
  30. package/dist/esm-7LSQY7YM.js +153 -0
  31. package/dist/fileFromPath-7DXRMRQU.js +19 -0
  32. package/dist/handler-2DVP4PMD-IFR4HH7D.js +4 -0
  33. package/dist/import-meta-resolve-GTPXFCVK.js +6 -0
  34. package/dist/index.js +21 -9352
  35. package/dist/lib-ZSSBUTBS.js +588 -0
  36. package/dist/magic-string.es-LGBSB5S5.js +16 -0
  37. package/dist/multipart-parser-JC2L5VJI.js +5 -0
  38. package/dist/multipart-parser-TJWXZEMW-OF3QE73Z.js +5 -0
  39. package/dist/relayBrowserCache-QL6LD4JJ-TKU47MOI.js +4 -0
  40. package/dist/server-KGF6BY7H.js +22 -0
  41. package/dist/src-B7EYCIZ4-XWOBV3GQ.js +6 -0
  42. package/dist/src-SYQHKG2Q.js +6 -0
  43. package/dist/task-2JIXKMIY-CMX3BD6Z.js +193 -0
  44. package/dist/token-AWIWOSVF.js +4 -0
  45. package/dist/token-QK7JKAKS.js +4 -0
  46. package/dist/token-util-GL5PN7CJ.js +4 -0
  47. package/dist/token-util-TEE5GKZ2.js +4 -0
  48. package/package.json +1 -1
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __createRequire } from "module";
3
+ const require = __createRequire(import.meta.url);
4
+ import{c as o,d as h,e as g}from"./chunk-JKHKVGEC.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=5e3,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
+ `)&&(s=r.split(`
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};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __createRequire } from "module";
3
+ const require = __createRequire(import.meta.url);
4
+ import{a as s,c as f}from"./chunk-LM633YUO.js";var O=f((ue,j)=>{"use strict";var v=Object.defineProperty,I=Object.getOwnPropertyDescriptor,$=Object.getOwnPropertyNames,N=Object.prototype.hasOwnProperty,C=(e,r)=>{for(var t in r)v(e,t,{get:r[t],enumerable:!0})},U=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of $(r))!N.call(e,o)&&o!==t&&v(e,o,{get:()=>r[o],enumerable:!(n=I(r,o))||n.enumerable});return e},F=e=>U(v({},"__esModule",{value:!0}),e),g={};C(g,{VercelOidcTokenError:()=>_});j.exports=F(g);var _=class extends Error{constructor(r,t){super(r),this.name="VercelOidcTokenError",this.cause=t}toString(){return this.cause?`${this.name}: ${this.message}: ${this.cause}`:`${this.name}: ${this.message}`}}});var E=f((pe,b)=>{"use strict";var J=Object.create,u=Object.defineProperty,M=Object.getOwnPropertyDescriptor,q=Object.getOwnPropertyNames,R=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty,B=(e,r)=>{for(var t in r)u(e,t,{get:r[t],enumerable:!0})},T=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of q(r))!L.call(e,o)&&o!==t&&u(e,o,{get:()=>r[o],enumerable:!(n=M(r,o))||n.enumerable});return e},y=(e,r,t)=>(t=e!=null?J(R(e)):{},T(r||!e||!e.__esModule?u(t,"default",{value:e,enumerable:!0}):t,e)),G=e=>T(u({},"__esModule",{value:!0}),e),D={};B(D,{findRootDir:()=>X,getUserDataDir:()=>z});b.exports=G(D);var l=y(s("path")),H=y(s("fs")),k=y(s("os")),P=O();function X(){try{let e=process.cwd();for(;e!==l.default.dirname(e);){let r=l.default.join(e,".vercel");if(H.default.existsSync(r))return e;e=l.default.dirname(e)}}catch{throw new P.VercelOidcTokenError("Token refresh only supported in node server environments")}throw new P.VercelOidcTokenError("Unable to find root directory")}function z(){if(process.env.XDG_DATA_HOME)return process.env.XDG_DATA_HOME;switch(k.default.platform()){case"darwin":return l.default.join(k.default.homedir(),"Library/Application Support");case"linux":return l.default.join(k.default.homedir(),".local/share");case"win32":return process.env.LOCALAPPDATA?process.env.LOCALAPPDATA:null;default:return null}}});var le=f((de,A)=>{var K=Object.create,p=Object.defineProperty,Q=Object.getOwnPropertyDescriptor,W=Object.getOwnPropertyNames,Y=Object.getPrototypeOf,Z=Object.prototype.hasOwnProperty,ee=(e,r)=>{for(var t in r)p(e,t,{get:r[t],enumerable:!0})},m=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of W(r))!Z.call(e,o)&&o!==t&&p(e,o,{get:()=>r[o],enumerable:!(n=Q(r,o))||n.enumerable});return e},x=(e,r,t)=>(t=e!=null?K(Y(e)):{},m(r||!e||!e.__esModule?p(t,"default",{value:e,enumerable:!0}):t,e)),re=e=>m(p({},"__esModule",{value:!0}),e),V={};ee(V,{assertVercelOidcTokenResponse:()=>h,findProjectInfo:()=>ne,getTokenPayload:()=>ce,getVercelCliToken:()=>te,getVercelDataDir:()=>S,getVercelOidcToken:()=>oe,isExpired:()=>se,loadToken:()=>ie,saveToken:()=>ae});A.exports=re(V);var c=x(s("path")),a=x(s("fs")),i=O(),d=E();function S(){let e="com.vercel.cli",r=(0,d.getUserDataDir)();return r?c.join(r,e):null}function te(){let e=S();if(!e)return null;let r=c.join(e,"auth.json");if(!a.existsSync(r))return null;let t=a.readFileSync(r,"utf8");return t?JSON.parse(t).token:null}async function oe(e,r,t){try{let n=`https://api.vercel.com/v1/projects/${r}/token?source=vercel-oidc-refresh${t?`&teamId=${t}`:""}`,o=await fetch(n,{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!o.ok)throw new i.VercelOidcTokenError(`Failed to refresh OIDC token: ${o.statusText}`);let w=await o.json();return h(w),w}catch(n){throw new i.VercelOidcTokenError("Failed to refresh OIDC token",n)}}function h(e){if(!e||typeof e!="object")throw new TypeError("Expected an object");if(!("token"in e)||typeof e.token!="string")throw new TypeError("Expected a string-valued token property")}function ne(){let e=(0,d.findRootDir)();if(!e)throw new i.VercelOidcTokenError("Unable to find root directory");try{let r=c.join(e,".vercel","project.json");if(!a.existsSync(r))throw new i.VercelOidcTokenError("project.json not found");let t=JSON.parse(a.readFileSync(r,"utf8"));if(typeof t.projectId!="string"&&typeof t.orgId!="string")throw new TypeError("Expected a string-valued projectId property");return{projectId:t.projectId,teamId:t.orgId}}catch(r){throw new i.VercelOidcTokenError("Unable to find project ID",r)}}function ae(e,r){try{let t=(0,d.getUserDataDir)();if(!t)throw new i.VercelOidcTokenError("Unable to find user data directory");let n=c.join(t,"com.vercel.token",`${r}.json`),o=JSON.stringify(e);a.mkdirSync(c.dirname(n),{mode:504,recursive:!0}),a.writeFileSync(n,o),a.chmodSync(n,432);return}catch(t){throw new i.VercelOidcTokenError("Failed to save token",t)}}function ie(e){try{let r=(0,d.getUserDataDir)();if(!r)return null;let t=c.join(r,"com.vercel.token",`${e}.json`);if(!a.existsSync(t))return null;let n=JSON.parse(a.readFileSync(t,"utf8"));return h(n),n}catch(r){throw new i.VercelOidcTokenError("Failed to load token",r)}}function ce(e){let r=e.split(".");if(r.length!==3)throw new i.VercelOidcTokenError("Invalid token");let t=r[1].replace(/-/g,"+").replace(/_/g,"/"),n=t.padEnd(t.length+(4-t.length%4)%4,"=");return JSON.parse(Buffer.from(n,"base64").toString("utf8"))}function se(e){return e.exp*1e3<Date.now()}});export{O as a,le as b};