import{createRequire as c}from"module";import{join as u}from"path";var b=c(import.meta.url);function w(){if(process.env.MCP_BROWSER_PATH)return process.env.MCP_BROWSER_PATH;try{return b.resolve("@zibby/mcp-browser/dist/bin/mcp-browser-zibby.js")}catch{return null}}var p="1280x720",f="1280x720";function y({headless:e}={}){if(e===!0)return!0;if(e===!1)return!1;let r=process.env.ZIBBY_HEADLESS;return r==="1"||String(r).toLowerCase()==="true"}function d(e,r){let o=(e||[]).filter(s=>s!=="--headless");return r?[...o,"--headless"]:o}var _={id:"browser",serverName:"playwright",cursorKey:"playwright-official",allowedTools:["mcp__playwright__*"],sessionEnvKey:"ZIBBY_SESSION_INFO",description:"Playwright Browser MCP Server",envKeys:[],tools:[],promptFragment:`Execute this test using the browser tools available to you. You MUST make actual browser tool calls \u2014 do not fabricate results.
If you DO NOT have access to browser tools \u2192 return {"success": false, "steps": [], "browserClosed": false, "notes": "No browser tools available"}.
DO NOT return success: true unless you ACTUALLY called browser tools.`,resolve({sessionPath:e,workspace:r,nodeName:o,headless:s}={}){let i=w(),t=e&&o?u(e,o):null,n=t||e||r||"test-results",a=y({headless:s}),l={};if(t&&(l.ZIBBY_NODE_SESSION_PATH=t),e&&(l.ZIBBY_SESSION_PATH=e),!i)throw new Error(`@zibby/mcp-browser is not installed.
  Cloud:   verify the Fargate image has it (packages/Dockerfile installs it globally alongside @zibby/cli).
  Local:   \`npm install @zibby/mcp-browser\` in your workflow, or use the global @zibby/cli install (which pulls it transitively).
  Override: set MCP_BROWSER_PATH to the path of mcp-browser-zibby.js.`);return{command:"node",args:d([i,"--isolated",`--save-video=${p}`,`--viewport-size=${f}`,`--output-dir=${n}`],a),env:l}}};export{_ as browserSkill};
