react-grab 0.0.89 → 0.0.91

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/cli.cjs CHANGED
@@ -321,7 +321,7 @@ ${i}`;return {success:true,filePath:s,message:"Add React Grab"+(e!=="none"?` wit
321
321
  ${Sx(e)}
322
322
  )}`,h;u?h=i.replace(u[0],a):h=`${n}
323
323
  ${a}
324
- ${o}`;let l=t.replace(i,h);return {success:true,filePath:r,message:"Update React Grab options",originalContent:t,newContent:l}},$x=(t,e,r)=>{let s=t.match(/import\s*\(\s*["']react-grab["']\s*\)/);if(!s)return {success:false,filePath:r,message:"Could not find React Grab import"};let n=`import("react-grab").then((m) => m.init(${ep(e)}))`,o=t.replace(s[0],n);return {success:true,filePath:r,message:"Update React Grab options",originalContent:t,newContent:o}},kx=(t,e,r)=>{let s=t.match(/import\s*\(\s*["']react-grab["']\s*\)/);if(!s)return {success:false,filePath:r,message:"Could not find React Grab import"};let n=`import("react-grab").then((m) => m.init(${ep(e)}))`,o=t.replace(s[0],n);return {success:true,filePath:r,message:"Update React Grab options",originalContent:t,newContent:o}},tp=(t,e,r,s)=>{let i=Tx(t,e,r);if(!i)return {success:false,filePath:"",message:"Could not find file containing React Grab configuration"};let n=Zd.readFileSync(i,"utf-8");if(!Xt(n))return {success:false,filePath:i,message:"Could not find React Grab code in the file"};switch(e){case "next":return Px(n,s,i);case "vite":return $x(n,s,i);case "webpack":return kx(n,s,i);default:return {success:false,filePath:i,message:`Unknown framework: ${e}`}}},rp=t=>Er(t);var Ix="0.0.89",Os={"claude-code":"Claude Code",cursor:"Cursor",opencode:"OpenCode",codex:"Codex",gemini:"Gemini",amp:"Amp","visual-edit":"Visual Edit"},sp=new Be().name("add").description("add an agent integration").argument("[agent]","agent to add (claude-code, cursor, opencode, codex, gemini, amp, visual-edit)").option("-y, --yes","skip confirmation prompts",false).option("-c, --cwd <cwd>","working directory (defaults to current directory)",process.cwd()).action(async(t,e)=>{console.log(`${Rs.default.magenta("\u273F")} ${Rs.default.bold("React Grab")} ${Rs.default.gray(Ix)}`),console.log();try{let r=e.cwd,s=e.yes,i=se("Preflight checks.").start(),n=await Et(r);n.hasReactGrab||(i.fail("React Grab is not installed."),b.break(),b.error(`Run ${I.info("react-grab init")} first to install React Grab.`),b.break(),process.exit(1)),i.succeed();let o=["claude-code","cursor","opencode","codex","gemini","amp","visual-edit"].filter(p=>!n.installedAgents.includes(p));o.length===0&&(b.break(),b.success("All agent integrations are already installed."),b.break(),process.exit(0));let u;if(t)["claude-code","cursor","opencode","codex","gemini","amp","visual-edit"].includes(t)||(b.break(),b.error(`Invalid agent: ${t}`),b.error("Available agents: claude-code, cursor, opencode, codex, gemini, amp, visual-edit"),b.break(),process.exit(1)),n.installedAgents.includes(t)&&(b.break(),b.warn(`${Os[t]} is already installed.`),b.break(),process.exit(0)),u=t;else if(s)b.break(),b.error("Please specify an agent to add."),b.error("Available agents: "+o.join(", ")),b.break(),process.exit(1);else {b.break();let{agent:p}=await(0,iu.default)({type:"select",name:"agent",message:`Which ${I.info("agent integration")} would you like to add?`,choices:o.map(m=>({title:Os[m],value:m}))});p||(b.break(),process.exit(1)),u=p;}se(`Adding ${Os[u]}.`).start().succeed();let h=Fs(n.projectRoot,n.framework,n.nextRouterType,u,!0),l=Es(n.projectRoot,u,n.installedAgents);h.success||(b.break(),b.error(h.message),b.break(),process.exit(1));let c=!h.noChanges&&h.originalContent&&h.newContent,d=l.success&&!l.noChanges&&l.originalContent&&l.newContent;if((c||d)&&(b.break(),c&&bt(h.filePath,h.originalContent,h.newContent),d&&(c&&b.break(),bt(l.filePath,l.originalContent,l.newContent)),!s)){b.break();let{proceed:p}=await(0,iu.default)({type:"confirm",name:"proceed",message:"Apply these changes?",initial:!0});p||(b.break(),b.log("Changes cancelled."),b.break(),process.exit(0));}let f=ps(u,!1);if(f.length>0){let p=se(`Installing ${f.join(", ")}.`).start();try{fs(f,n.packageManager,n.projectRoot),p.succeed();}catch(m){p.fail(),yt(m);}}if(c){let p=se(`Applying changes to ${h.filePath}.`).start(),m=Er(h);m.success||(p.fail(),b.break(),b.error(m.error||"Failed to write file."),b.break(),process.exit(1)),p.succeed();}if(d){let p=se(`Applying changes to ${l.filePath}.`).start(),m=As(l);m.success||(p.fail(),b.break(),b.error(m.error||"Failed to write file."),b.break(),process.exit(1)),p.succeed();}b.break(),b.log(`${I.success("Success!")} ${Os[u]} has been added.`),l.warning?b.warn(l.warning):b.log("Make sure to start the agent server before using it."),b.break();}catch(r){yt(r);}});var Ts=be(Nt()),ot=be(br());var Mx="0.0.89",Ss={metaKey:process.platform==="darwin"?"\u2318 Command":"\u229E Windows",ctrlKey:"Ctrl",shiftKey:"Shift",altKey:process.platform==="darwin"?"\u2325 Option":"Alt"},Bx=t=>{if(!t)return "Default (Option/Alt)";let e=[];return t.metaKey&&e.push(process.platform==="darwin"?"\u2318":"Win"),t.ctrlKey&&e.push("Ctrl"),t.shiftKey&&e.push("Shift"),t.altKey&&e.push(process.platform==="darwin"?"\u2325":"Alt"),t.key&&e.push(t.key.toUpperCase()),e.length>0?e.join(" + "):"Default (Option/Alt)"},ip=new Be().name("configure").alias("config").description("configure React Grab options").option("-y, --yes","skip confirmation prompts",false).option("-c, --cwd <cwd>","working directory (defaults to current directory)",process.cwd()).action(async t=>{console.log(`${Ts.default.magenta("\u273F")} ${Ts.default.bold("React Grab")} ${Ts.default.gray(Mx)}`),console.log();try{let e=t.cwd,r=t.yes,s=se("Preflight checks.").start(),i=await Et(e);i.hasReactGrab||(s.fail("React Grab is not installed."),b.break(),b.error(`Run ${I.info("react-grab init")} first to install React Grab.`),b.break(),process.exit(1)),s.succeed(),r&&(b.break(),b.error("Configure command requires interactive mode."),b.error("Remove the --yes flag to use interactive prompts."),b.break(),process.exit(1)),b.break(),b.log(`Configure ${I.info("React Grab")} options:`),b.break();let n={},{wantActivationKey:o}=await(0,ot.default)({type:"confirm",name:"wantActivationKey",message:`Configure ${I.info("activation key")}?`,initial:!1});if(o===void 0&&(b.break(),process.exit(1)),o){let{key:d}=await(0,ot.default)({type:"text",name:"key",message:"Enter the activation key (e.g., g, k, space):",initial:""});d===void 0&&(b.break(),process.exit(1));let{modifiers:f}=await(0,ot.default)({type:"multiselect",name:"modifiers",message:"Select modifier keys (space to select, enter to confirm):",choices:[{title:Ss.metaKey,value:"metaKey"},{title:Ss.ctrlKey,value:"ctrlKey"},{title:Ss.shiftKey,value:"shiftKey"},{title:Ss.altKey,value:"altKey",selected:!0}],hint:"- Space to select, Enter to confirm"});f===void 0&&(b.break(),process.exit(1)),n.activationKey={...d&&{key:d.toLowerCase()},...f.includes("metaKey")&&{metaKey:!0},...f.includes("ctrlKey")&&{ctrlKey:!0},...f.includes("shiftKey")&&{shiftKey:!0},...f.includes("altKey")&&{altKey:!0}},b.log(` Activation key: ${I.info(Bx(n.activationKey))}`);}let{activationMode:u}=await(0,ot.default)({type:"select",name:"activationMode",message:`Select ${I.info("activation mode")}:`,choices:[{title:"Toggle (press to activate/deactivate)",value:"toggle"},{title:"Hold (hold key to keep active)",value:"hold"}],initial:0});if(u===void 0&&(b.break(),process.exit(1)),n.activationMode=u,u==="hold"){let{keyHoldDuration:d}=await(0,ot.default)({type:"number",name:"keyHoldDuration",message:`Enter ${I.info("key hold duration")} in milliseconds:`,initial:150,min:0,max:2e3});d===void 0&&(b.break(),process.exit(1)),n.keyHoldDuration=d;}let{allowActivationInsideInput:a}=await(0,ot.default)({type:"confirm",name:"allowActivationInsideInput",message:`Allow activation ${I.info("inside input fields")}?`,initial:!0});a===void 0&&(b.break(),process.exit(1)),n.allowActivationInsideInput=a;let{maxContextLines:h}=await(0,ot.default)({type:"number",name:"maxContextLines",message:`Enter ${I.info("max context lines")} to include:`,initial:3,min:0,max:50});h===void 0&&(b.break(),process.exit(1)),n.maxContextLines=h;let l=tp(i.projectRoot,i.framework,i.nextRouterType,n);if(l.success||(b.break(),b.error(l.message),b.break(),process.exit(1)),!l.noChanges&&l.originalContent&&l.newContent){b.break(),bt(l.filePath,l.originalContent,l.newContent),b.break();let{proceed:d}=await(0,ot.default)({type:"confirm",name:"proceed",message:"Apply these changes?",initial:!0});d||(b.break(),b.log("Changes cancelled."),b.break(),process.exit(0));let f=se(`Applying changes to ${l.filePath}.`).start(),p=rp(l);p.success||(f.fail(),b.break(),b.error(p.error||"Failed to write file."),b.break(),process.exit(1)),f.succeed();}else b.break(),b.log("No changes needed.");b.break(),b.log(`${I.success("Success!")} React Grab options have been configured.`),b.break();}catch(e){yt(e);}});var $s=be(Nt()),ks=be(br());var op="0.0.89",Hx="https://react-grab.com/api/report-cli",Ps="https://github.com/aidenybai/react-grab",np=async(t,e,r)=>{try{await fetch(Hx,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:t,version:op,config:e,error:r?{message:r.message,stack:r.stack}:void 0,timestamp:new Date().toISOString()})}).catch(()=>{});}catch{}},nu={next:"Next.js",vite:"Vite",webpack:"Webpack",unknown:"Unknown"},Nx={npm:"npm",yarn:"Yarn",pnpm:"pnpm",bun:"Bun"},qx={remix:"Remix",astro:"Astro",sveltekit:"SvelteKit",gatsby:"Gatsby"},up=new Be().name("init").description("initialize React Grab in your project").option("-y, --yes","skip confirmation prompts",false).option("-f, --force","force overwrite existing config",false).option("-a, --agent <agent>","agent integration (claude-code, cursor, opencode, codex, gemini, amp, visual-edit)").option("--skip-install","skip package installation",false).option("-c, --cwd <cwd>","working directory (defaults to current directory)",process.cwd()).action(async t=>{console.log(`${$s.default.magenta("\u273F")} ${$s.default.bold("React Grab")} ${$s.default.gray(op)}`),console.log();try{let e=t.cwd,r=t.yes,s=se("Preflight checks.").start(),i=await Et(e);i.hasReactGrab&&!t.force&&(s.succeed(),b.break(),b.warn("React Grab is already installed."),b.log(`Use ${I.info("--force")} to reconfigure, or ${I.info("npx grab@latest add")} to add an agent.`),b.break(),process.exit(0)),s.succeed();let n=se("Verifying framework.").start();if(i.unsupportedFramework){let y=qx[i.unsupportedFramework];n.fail(`Found ${I.info(y)}.`),b.break(),b.log(`${y} is not yet supported by automatic setup.`),b.log(`Visit ${I.info(Ps)} for manual setup.`),b.break(),process.exit(1);}if(i.framework==="unknown")if(i.isMonorepo&&!r){n.info("Verifying framework. Found monorepo.");let v=pf(i.projectRoot).filter(_=>_.hasReact||_.framework!=="unknown");if(v.length>0){b.break();let _=[...v].sort((T,O)=>T.framework==="unknown"&&O.framework!=="unknown"?1:T.framework!=="unknown"&&O.framework==="unknown"?-1:0),{selectedProject:F}=await(0,ks.default)({type:"select",name:"selectedProject",message:"Select a project to install React Grab:",choices:_.map(T=>{let O=T.framework!=="unknown"?` ${I.dim(`(${nu[T.framework]})`)}`:"";return {title:`${T.name}${O}`,value:T.path}})});F||(b.break(),process.exit(1)),process.chdir(F);let E=await Et(F);Object.assign(i,E),se("Verifying framework.").start().succeed(`Verifying framework. Found ${I.info(nu[E.framework])}.`);}else n.fail("Could not detect a supported framework."),b.break(),b.log(`Visit ${I.info(Ps)} for manual setup.`),b.break(),process.exit(1);}else n.fail("Could not detect a supported framework."),b.break(),b.log("React Grab supports Next.js, Vite, and Webpack projects."),b.log(`Visit ${I.info(Ps)} for manual setup.`),b.break(),process.exit(1);else n.succeed(`Verifying framework. Found ${I.info(nu[i.framework])}.`);i.framework==="next"&&se("Detecting router type.").start().succeed(`Detecting router type. Found ${I.info(i.nextRouterType==="app"?"App Router":"Pages Router")}.`),se("Detecting package manager.").start().succeed(`Detecting package manager. Found ${I.info(Nx[i.packageManager])}.`);let u=i.framework,a=i.packageManager,h=i.nextRouterType,l=t.agent||"none";if(!r&&!t.agent){b.break();let{agent:y}=await(0,ks.default)({type:"select",name:"agent",message:`Would you like to add an ${I.info("agent integration")}?`,choices:[{title:"None",value:"none"},{title:"Claude Code",value:"claude-code"},{title:"Cursor",value:"cursor"},{title:"OpenCode",value:"opencode"},{title:"Codex",value:"codex"},{title:"Gemini",value:"gemini"},{title:"Amp",value:"amp"},{title:"Visual Edit",value:"visual-edit"}]});y===void 0&&(b.break(),process.exit(1)),l=y;}let c=Fs(i.projectRoot,u,h,l,!1),d=Es(i.projectRoot,l,i.installedAgents);c.success||(b.break(),b.error(c.message),b.error(`Visit ${I.info(Ps)} for manual setup.`),b.break(),process.exit(1));let f=!c.noChanges&&c.originalContent&&c.newContent,p=d.success&&!d.noChanges&&d.originalContent&&d.newContent;if((f||p)&&(b.break(),f&&bt(c.filePath,c.originalContent,c.newContent),p&&(f&&b.break(),bt(d.filePath,d.originalContent,d.newContent)),b.break(),b.warn("Auto-detection may not be 100% accurate."),b.warn("Please verify the changes before committing."),!r)){b.break();let{proceed:y}=await(0,ks.default)({type:"confirm",name:"proceed",message:"Apply these changes?",initial:!0});y||(b.break(),b.log("Changes cancelled."),b.break(),process.exit(0));}let m=!i.hasReactGrab,g=l!=="none"&&!i.installedAgents.includes(l);if(!t.skipInstall&&(m||g)){let y=ps(l,m);if(y.length>0){let v=se(`Installing ${y.join(", ")}.`).start();try{fs(y,a,i.projectRoot),v.succeed();}catch(_){v.fail(),yt(_);}}}if(f){let y=se(`Applying changes to ${c.filePath}.`).start(),v=Er(c);v.success||(y.fail(),b.break(),b.error(v.error||"Failed to write file."),b.break(),process.exit(1)),y.succeed();}if(p){let y=se(`Applying changes to ${d.filePath}.`).start(),v=As(d);v.success||(y.fail(),b.break(),b.error(v.error||"Failed to write file."),b.break(),process.exit(1)),y.succeed();}b.break(),b.log(`${I.success("Success!")} React Grab has been installed.`),d.warning?b.warn(d.warning):b.log("You may now start your development server."),b.break(),await np("completed",{framework:u,packageManager:a,router:h,agent:l!=="none"?l:void 0,isMonorepo:i.isMonorepo});}catch(e){yt(e),await np("error",void 0,e);}});var ci=be(Nt()),hi=be(Gg()),ca=be(br());var xE="0.0.89",Vg=2e3,Ug='<script src="https://unpkg.com/react-grab/dist/index.global.js"></script>',_E=t=>`<script src="https://unpkg.com/${t}/dist/client.global.js"></script>`,Kg=async(t,e)=>new Promise(r=>{let s=http.createServer();s.listen(t,e,()=>{s.close(()=>r(t));}),s.on("error",()=>{r(Kg(t+1,e));});}),wE=t=>t.startsWith("http://")||t.startsWith("https://")?t:`http://${t}`,FE=async t=>{try{return (await fetch(t,{method:"HEAD",redirect:"follow"})).url}catch{return t}},Yg=new Be().name("start").alias("proxy").description("start a proxy server for a given URL").argument("[url]","target URL to proxy (e.g., localhost:3000)").option("-p, --port <port>","starting port for the proxy server",String(Vg)).option("--host <hostname>","hostname to bind the proxy server to","localhost").option("--provider <package>","provider package to run via npx (e.g., @react-grab/cursor)").action(async(t,e)=>{console.log(`${ci.default.magenta("\u273F")} ${ci.default.bold("React Grab")} ${ci.default.gray(xE)}`),console.log();let r=t,s=e.provider;if(!r){let{targetUrl:v}=await(0, ca.default)({type:"text",name:"targetUrl",message:"Enter the target URL to proxy:",initial:"localhost:3000"});if(v||(b.break(),process.exit(1)),r=v,!s){let{selectedProvider:_}=await(0, ca.default)({type:"select",name:"selectedProvider",message:`Select a ${I.info("provider")} to use:`,choices:[{title:"None",value:""},{title:"Claude Code",value:"@react-grab/claude-code"},{title:"Cursor",value:"@react-grab/cursor"},{title:"OpenCode",value:"@react-grab/opencode"},{title:"Codex",value:"@react-grab/codex"},{title:"Gemini",value:"@react-grab/gemini"},{title:"Amp",value:"@react-grab/amp"},{title:"Visual Edit",value:"@react-grab/visual-edit"}]});_===void 0&&(b.break(),process.exit(1)),s=_||void 0;}b.break();}let i=wE(r),n=await FE(i),o=parseInt(e.port,10),u=e.host||"localhost";(isNaN(o)||o<1||o>65535)&&(b.break(),b.error("Invalid port number. Please provide a port between 1 and 65535."),b.break(),process.exit(1));let a=await Kg(o,u),h=s?Ug+_E(s):Ug,l=v=>{let _=v.indexOf("</head>");if(_!==-1)return v.slice(0,_)+h+v.slice(_);let F=v.indexOf("</body>");return F!==-1?v.slice(0,F)+h+v.slice(F):v+h},c=(0, hi.createProxyMiddleware)({target:n,changeOrigin:true,followRedirects:false,ws:true,selfHandleResponse:true,cookieDomainRewrite:{"*":""},autoRewrite:true,preserveHeaderKeyCase:true,xfwd:true,on:{error:(v,_,F)=>{"writeHead"in F&&!F.headersSent&&(F.writeHead(503,{"Content-Type":"text/plain"}),F.end(`Proxy error: Unable to connect to ${n}`));},proxyReq:v=>{v.removeHeader("accept-encoding");},proxyRes:(0, hi.responseInterceptor)(async(v,_,F,E)=>{if(E.removeHeader("content-security-policy"),E.removeHeader("content-security-policy-report-only"),!(_.headers["content-type"]||"").includes("text/html"))return v;let O=v.toString("utf-8");return l(O)})}}),d=http.createServer((v,_)=>{c(v,_,F=>{F&&(b.error(`Request error: ${F}`),_.writeHead(500),_.end("Internal Server Error"));});});d.on("upgrade",c.upgrade);let f=se("Starting.").start(),p=()=>{f.succeed(`Open in your browser: http://${u}:${a}`);let v=["npx react-grab@latest start",r];e.port!==String(Vg)&&v.push(`--port=${e.port}`),u!=="localhost"&&v.push(`--host=${u}`),s&&v.push(`--provider=${s}`),b.break(),b.log(I.dim(`$ ${v.join(" ")}`));},m=false,g=!s,y=()=>{m&&g&&p();};if(d.listen(a,u,()=>{m=true,y();}),s){let v=child_process.spawn("npx",[`${s}@latest`],{stdio:"ignore",shell:true,detached:false}),_=()=>{v.killed||v.kill();};process.on("exit",_),process.on("SIGINT",()=>{_(),process.exit(0);}),process.on("SIGTERM",()=>{_(),process.exit(0);}),v.on("error",F=>{f.fail(`Failed to start provider: ${F.message}`);}),v.on("spawn",()=>{g=true,y();}),v.on("close",F=>{F!==0&&F!==null&&b.error(`Provider exited with code ${F}`);});}d.on("error",v=>{b.break(),b.error(`Server error: ${v.message}`),b.break(),process.exit(1);});});process.noDeprecation=true;var EE="0.0.89",AE="https://www.react-grab.com/api/version";process.on("SIGINT",()=>process.exit(0));process.on("SIGTERM",()=>process.exit(0));try{fetch(`${AE}?source=cli&t=${Date.now()}`).catch(()=>{});}catch{}var Nr=new Be().name("react-grab").description("add React Grab to your project").version(EE,"-v, --version","display the version number");Nr.addCommand(up);Nr.addCommand(sp);Nr.addCommand(ip);Nr.addCommand(Yg);Nr.parse();
324
+ ${o}`;let l=t.replace(i,h);return {success:true,filePath:r,message:"Update React Grab options",originalContent:t,newContent:l}},$x=(t,e,r)=>{let s=t.match(/import\s*\(\s*["']react-grab["']\s*\)/);if(!s)return {success:false,filePath:r,message:"Could not find React Grab import"};let n=`import("react-grab").then((m) => m.init(${ep(e)}))`,o=t.replace(s[0],n);return {success:true,filePath:r,message:"Update React Grab options",originalContent:t,newContent:o}},kx=(t,e,r)=>{let s=t.match(/import\s*\(\s*["']react-grab["']\s*\)/);if(!s)return {success:false,filePath:r,message:"Could not find React Grab import"};let n=`import("react-grab").then((m) => m.init(${ep(e)}))`,o=t.replace(s[0],n);return {success:true,filePath:r,message:"Update React Grab options",originalContent:t,newContent:o}},tp=(t,e,r,s)=>{let i=Tx(t,e,r);if(!i)return {success:false,filePath:"",message:"Could not find file containing React Grab configuration"};let n=Zd.readFileSync(i,"utf-8");if(!Xt(n))return {success:false,filePath:i,message:"Could not find React Grab code in the file"};switch(e){case "next":return Px(n,s,i);case "vite":return $x(n,s,i);case "webpack":return kx(n,s,i);default:return {success:false,filePath:i,message:`Unknown framework: ${e}`}}},rp=t=>Er(t);var Ix="0.0.91",Os={"claude-code":"Claude Code",cursor:"Cursor",opencode:"OpenCode",codex:"Codex",gemini:"Gemini",amp:"Amp","visual-edit":"Visual Edit"},sp=new Be().name("add").description("add an agent integration").argument("[agent]","agent to add (claude-code, cursor, opencode, codex, gemini, amp, visual-edit)").option("-y, --yes","skip confirmation prompts",false).option("-c, --cwd <cwd>","working directory (defaults to current directory)",process.cwd()).action(async(t,e)=>{console.log(`${Rs.default.magenta("\u273F")} ${Rs.default.bold("React Grab")} ${Rs.default.gray(Ix)}`),console.log();try{let r=e.cwd,s=e.yes,i=se("Preflight checks.").start(),n=await Et(r);n.hasReactGrab||(i.fail("React Grab is not installed."),b.break(),b.error(`Run ${I.info("react-grab init")} first to install React Grab.`),b.break(),process.exit(1)),i.succeed();let o=["claude-code","cursor","opencode","codex","gemini","amp","visual-edit"].filter(p=>!n.installedAgents.includes(p));o.length===0&&(b.break(),b.success("All agent integrations are already installed."),b.break(),process.exit(0));let u;if(t)["claude-code","cursor","opencode","codex","gemini","amp","visual-edit"].includes(t)||(b.break(),b.error(`Invalid agent: ${t}`),b.error("Available agents: claude-code, cursor, opencode, codex, gemini, amp, visual-edit"),b.break(),process.exit(1)),n.installedAgents.includes(t)&&(b.break(),b.warn(`${Os[t]} is already installed.`),b.break(),process.exit(0)),u=t;else if(s)b.break(),b.error("Please specify an agent to add."),b.error("Available agents: "+o.join(", ")),b.break(),process.exit(1);else {b.break();let{agent:p}=await(0,iu.default)({type:"select",name:"agent",message:`Which ${I.info("agent integration")} would you like to add?`,choices:o.map(m=>({title:Os[m],value:m}))});p||(b.break(),process.exit(1)),u=p;}se(`Adding ${Os[u]}.`).start().succeed();let h=Fs(n.projectRoot,n.framework,n.nextRouterType,u,!0),l=Es(n.projectRoot,u,n.installedAgents);h.success||(b.break(),b.error(h.message),b.break(),process.exit(1));let c=!h.noChanges&&h.originalContent&&h.newContent,d=l.success&&!l.noChanges&&l.originalContent&&l.newContent;if((c||d)&&(b.break(),c&&bt(h.filePath,h.originalContent,h.newContent),d&&(c&&b.break(),bt(l.filePath,l.originalContent,l.newContent)),!s)){b.break();let{proceed:p}=await(0,iu.default)({type:"confirm",name:"proceed",message:"Apply these changes?",initial:!0});p||(b.break(),b.log("Changes cancelled."),b.break(),process.exit(0));}let f=ps(u,!1);if(f.length>0){let p=se(`Installing ${f.join(", ")}.`).start();try{fs(f,n.packageManager,n.projectRoot),p.succeed();}catch(m){p.fail(),yt(m);}}if(c){let p=se(`Applying changes to ${h.filePath}.`).start(),m=Er(h);m.success||(p.fail(),b.break(),b.error(m.error||"Failed to write file."),b.break(),process.exit(1)),p.succeed();}if(d){let p=se(`Applying changes to ${l.filePath}.`).start(),m=As(l);m.success||(p.fail(),b.break(),b.error(m.error||"Failed to write file."),b.break(),process.exit(1)),p.succeed();}b.break(),b.log(`${I.success("Success!")} ${Os[u]} has been added.`),l.warning?b.warn(l.warning):b.log("Make sure to start the agent server before using it."),b.break();}catch(r){yt(r);}});var Ts=be(Nt()),ot=be(br());var Mx="0.0.91",Ss={metaKey:process.platform==="darwin"?"\u2318 Command":"\u229E Windows",ctrlKey:"Ctrl",shiftKey:"Shift",altKey:process.platform==="darwin"?"\u2325 Option":"Alt"},Bx=t=>{if(!t)return "Default (Option/Alt)";let e=[];return t.metaKey&&e.push(process.platform==="darwin"?"\u2318":"Win"),t.ctrlKey&&e.push("Ctrl"),t.shiftKey&&e.push("Shift"),t.altKey&&e.push(process.platform==="darwin"?"\u2325":"Alt"),t.key&&e.push(t.key.toUpperCase()),e.length>0?e.join(" + "):"Default (Option/Alt)"},ip=new Be().name("configure").alias("config").description("configure React Grab options").option("-y, --yes","skip confirmation prompts",false).option("-c, --cwd <cwd>","working directory (defaults to current directory)",process.cwd()).action(async t=>{console.log(`${Ts.default.magenta("\u273F")} ${Ts.default.bold("React Grab")} ${Ts.default.gray(Mx)}`),console.log();try{let e=t.cwd,r=t.yes,s=se("Preflight checks.").start(),i=await Et(e);i.hasReactGrab||(s.fail("React Grab is not installed."),b.break(),b.error(`Run ${I.info("react-grab init")} first to install React Grab.`),b.break(),process.exit(1)),s.succeed(),r&&(b.break(),b.error("Configure command requires interactive mode."),b.error("Remove the --yes flag to use interactive prompts."),b.break(),process.exit(1)),b.break(),b.log(`Configure ${I.info("React Grab")} options:`),b.break();let n={},{wantActivationKey:o}=await(0,ot.default)({type:"confirm",name:"wantActivationKey",message:`Configure ${I.info("activation key")}?`,initial:!1});if(o===void 0&&(b.break(),process.exit(1)),o){let{key:d}=await(0,ot.default)({type:"text",name:"key",message:"Enter the activation key (e.g., g, k, space):",initial:""});d===void 0&&(b.break(),process.exit(1));let{modifiers:f}=await(0,ot.default)({type:"multiselect",name:"modifiers",message:"Select modifier keys (space to select, enter to confirm):",choices:[{title:Ss.metaKey,value:"metaKey"},{title:Ss.ctrlKey,value:"ctrlKey"},{title:Ss.shiftKey,value:"shiftKey"},{title:Ss.altKey,value:"altKey",selected:!0}],hint:"- Space to select, Enter to confirm"});f===void 0&&(b.break(),process.exit(1)),n.activationKey={...d&&{key:d.toLowerCase()},...f.includes("metaKey")&&{metaKey:!0},...f.includes("ctrlKey")&&{ctrlKey:!0},...f.includes("shiftKey")&&{shiftKey:!0},...f.includes("altKey")&&{altKey:!0}},b.log(` Activation key: ${I.info(Bx(n.activationKey))}`);}let{activationMode:u}=await(0,ot.default)({type:"select",name:"activationMode",message:`Select ${I.info("activation mode")}:`,choices:[{title:"Toggle (press to activate/deactivate)",value:"toggle"},{title:"Hold (hold key to keep active)",value:"hold"}],initial:0});if(u===void 0&&(b.break(),process.exit(1)),n.activationMode=u,u==="hold"){let{keyHoldDuration:d}=await(0,ot.default)({type:"number",name:"keyHoldDuration",message:`Enter ${I.info("key hold duration")} in milliseconds:`,initial:150,min:0,max:2e3});d===void 0&&(b.break(),process.exit(1)),n.keyHoldDuration=d;}let{allowActivationInsideInput:a}=await(0,ot.default)({type:"confirm",name:"allowActivationInsideInput",message:`Allow activation ${I.info("inside input fields")}?`,initial:!0});a===void 0&&(b.break(),process.exit(1)),n.allowActivationInsideInput=a;let{maxContextLines:h}=await(0,ot.default)({type:"number",name:"maxContextLines",message:`Enter ${I.info("max context lines")} to include:`,initial:3,min:0,max:50});h===void 0&&(b.break(),process.exit(1)),n.maxContextLines=h;let l=tp(i.projectRoot,i.framework,i.nextRouterType,n);if(l.success||(b.break(),b.error(l.message),b.break(),process.exit(1)),!l.noChanges&&l.originalContent&&l.newContent){b.break(),bt(l.filePath,l.originalContent,l.newContent),b.break();let{proceed:d}=await(0,ot.default)({type:"confirm",name:"proceed",message:"Apply these changes?",initial:!0});d||(b.break(),b.log("Changes cancelled."),b.break(),process.exit(0));let f=se(`Applying changes to ${l.filePath}.`).start(),p=rp(l);p.success||(f.fail(),b.break(),b.error(p.error||"Failed to write file."),b.break(),process.exit(1)),f.succeed();}else b.break(),b.log("No changes needed.");b.break(),b.log(`${I.success("Success!")} React Grab options have been configured.`),b.break();}catch(e){yt(e);}});var $s=be(Nt()),ks=be(br());var op="0.0.91",Hx="https://react-grab.com/api/report-cli",Ps="https://github.com/aidenybai/react-grab",np=async(t,e,r)=>{try{await fetch(Hx,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:t,version:op,config:e,error:r?{message:r.message,stack:r.stack}:void 0,timestamp:new Date().toISOString()})}).catch(()=>{});}catch{}},nu={next:"Next.js",vite:"Vite",webpack:"Webpack",unknown:"Unknown"},Nx={npm:"npm",yarn:"Yarn",pnpm:"pnpm",bun:"Bun"},qx={remix:"Remix",astro:"Astro",sveltekit:"SvelteKit",gatsby:"Gatsby"},up=new Be().name("init").description("initialize React Grab in your project").option("-y, --yes","skip confirmation prompts",false).option("-f, --force","force overwrite existing config",false).option("-a, --agent <agent>","agent integration (claude-code, cursor, opencode, codex, gemini, amp, visual-edit)").option("--skip-install","skip package installation",false).option("-c, --cwd <cwd>","working directory (defaults to current directory)",process.cwd()).action(async t=>{console.log(`${$s.default.magenta("\u273F")} ${$s.default.bold("React Grab")} ${$s.default.gray(op)}`),console.log();try{let e=t.cwd,r=t.yes,s=se("Preflight checks.").start(),i=await Et(e);i.hasReactGrab&&!t.force&&(s.succeed(),b.break(),b.warn("React Grab is already installed."),b.log(`Use ${I.info("--force")} to reconfigure, or ${I.info("npx grab@latest add")} to add an agent.`),b.break(),process.exit(0)),s.succeed();let n=se("Verifying framework.").start();if(i.unsupportedFramework){let y=qx[i.unsupportedFramework];n.fail(`Found ${I.info(y)}.`),b.break(),b.log(`${y} is not yet supported by automatic setup.`),b.log(`Visit ${I.info(Ps)} for manual setup.`),b.break(),process.exit(1);}if(i.framework==="unknown")if(i.isMonorepo&&!r){n.info("Verifying framework. Found monorepo.");let v=pf(i.projectRoot).filter(_=>_.hasReact||_.framework!=="unknown");if(v.length>0){b.break();let _=[...v].sort((T,O)=>T.framework==="unknown"&&O.framework!=="unknown"?1:T.framework!=="unknown"&&O.framework==="unknown"?-1:0),{selectedProject:F}=await(0,ks.default)({type:"select",name:"selectedProject",message:"Select a project to install React Grab:",choices:_.map(T=>{let O=T.framework!=="unknown"?` ${I.dim(`(${nu[T.framework]})`)}`:"";return {title:`${T.name}${O}`,value:T.path}})});F||(b.break(),process.exit(1)),process.chdir(F);let E=await Et(F);Object.assign(i,E),se("Verifying framework.").start().succeed(`Verifying framework. Found ${I.info(nu[E.framework])}.`);}else n.fail("Could not detect a supported framework."),b.break(),b.log(`Visit ${I.info(Ps)} for manual setup.`),b.break(),process.exit(1);}else n.fail("Could not detect a supported framework."),b.break(),b.log("React Grab supports Next.js, Vite, and Webpack projects."),b.log(`Visit ${I.info(Ps)} for manual setup.`),b.break(),process.exit(1);else n.succeed(`Verifying framework. Found ${I.info(nu[i.framework])}.`);i.framework==="next"&&se("Detecting router type.").start().succeed(`Detecting router type. Found ${I.info(i.nextRouterType==="app"?"App Router":"Pages Router")}.`),se("Detecting package manager.").start().succeed(`Detecting package manager. Found ${I.info(Nx[i.packageManager])}.`);let u=i.framework,a=i.packageManager,h=i.nextRouterType,l=t.agent||"none";if(!r&&!t.agent){b.break();let{agent:y}=await(0,ks.default)({type:"select",name:"agent",message:`Would you like to add an ${I.info("agent integration")}?`,choices:[{title:"None",value:"none"},{title:"Claude Code",value:"claude-code"},{title:"Cursor",value:"cursor"},{title:"OpenCode",value:"opencode"},{title:"Codex",value:"codex"},{title:"Gemini",value:"gemini"},{title:"Amp",value:"amp"},{title:"Visual Edit",value:"visual-edit"}]});y===void 0&&(b.break(),process.exit(1)),l=y;}let c=Fs(i.projectRoot,u,h,l,!1),d=Es(i.projectRoot,l,i.installedAgents);c.success||(b.break(),b.error(c.message),b.error(`Visit ${I.info(Ps)} for manual setup.`),b.break(),process.exit(1));let f=!c.noChanges&&c.originalContent&&c.newContent,p=d.success&&!d.noChanges&&d.originalContent&&d.newContent;if((f||p)&&(b.break(),f&&bt(c.filePath,c.originalContent,c.newContent),p&&(f&&b.break(),bt(d.filePath,d.originalContent,d.newContent)),b.break(),b.warn("Auto-detection may not be 100% accurate."),b.warn("Please verify the changes before committing."),!r)){b.break();let{proceed:y}=await(0,ks.default)({type:"confirm",name:"proceed",message:"Apply these changes?",initial:!0});y||(b.break(),b.log("Changes cancelled."),b.break(),process.exit(0));}let m=!i.hasReactGrab,g=l!=="none"&&!i.installedAgents.includes(l);if(!t.skipInstall&&(m||g)){let y=ps(l,m);if(y.length>0){let v=se(`Installing ${y.join(", ")}.`).start();try{fs(y,a,i.projectRoot),v.succeed();}catch(_){v.fail(),yt(_);}}}if(f){let y=se(`Applying changes to ${c.filePath}.`).start(),v=Er(c);v.success||(y.fail(),b.break(),b.error(v.error||"Failed to write file."),b.break(),process.exit(1)),y.succeed();}if(p){let y=se(`Applying changes to ${d.filePath}.`).start(),v=As(d);v.success||(y.fail(),b.break(),b.error(v.error||"Failed to write file."),b.break(),process.exit(1)),y.succeed();}b.break(),b.log(`${I.success("Success!")} React Grab has been installed.`),d.warning?b.warn(d.warning):b.log("You may now start your development server."),b.break(),await np("completed",{framework:u,packageManager:a,router:h,agent:l!=="none"?l:void 0,isMonorepo:i.isMonorepo});}catch(e){yt(e),await np("error",void 0,e);}});var ci=be(Nt()),hi=be(Gg()),ca=be(br());var xE="0.0.91",Vg=2e3,Ug='<script src="https://unpkg.com/react-grab/dist/index.global.js"></script>',_E=t=>`<script src="https://unpkg.com/${t}/dist/client.global.js"></script>`,Kg=async(t,e)=>new Promise(r=>{let s=http.createServer();s.listen(t,e,()=>{s.close(()=>r(t));}),s.on("error",()=>{r(Kg(t+1,e));});}),wE=t=>t.startsWith("http://")||t.startsWith("https://")?t:`http://${t}`,FE=async t=>{try{return (await fetch(t,{method:"HEAD",redirect:"follow"})).url}catch{return t}},Yg=new Be().name("start").alias("proxy").description("start a proxy server for a given URL").argument("[url]","target URL to proxy (e.g., localhost:3000)").option("-p, --port <port>","starting port for the proxy server",String(Vg)).option("--host <hostname>","hostname to bind the proxy server to","localhost").option("--provider <package>","provider package to run via npx (e.g., @react-grab/cursor)").action(async(t,e)=>{console.log(`${ci.default.magenta("\u273F")} ${ci.default.bold("React Grab")} ${ci.default.gray(xE)}`),console.log();let r=t,s=e.provider;if(!r){let{targetUrl:v}=await(0, ca.default)({type:"text",name:"targetUrl",message:"Enter the target URL to proxy:",initial:"localhost:3000"});if(v||(b.break(),process.exit(1)),r=v,!s){let{selectedProvider:_}=await(0, ca.default)({type:"select",name:"selectedProvider",message:`Select a ${I.info("provider")} to use:`,choices:[{title:"None",value:""},{title:"Claude Code",value:"@react-grab/claude-code"},{title:"Cursor",value:"@react-grab/cursor"},{title:"OpenCode",value:"@react-grab/opencode"},{title:"Codex",value:"@react-grab/codex"},{title:"Gemini",value:"@react-grab/gemini"},{title:"Amp",value:"@react-grab/amp"},{title:"Visual Edit",value:"@react-grab/visual-edit"}]});_===void 0&&(b.break(),process.exit(1)),s=_||void 0;}b.break();}let i=wE(r),n=await FE(i),o=parseInt(e.port,10),u=e.host||"localhost";(isNaN(o)||o<1||o>65535)&&(b.break(),b.error("Invalid port number. Please provide a port between 1 and 65535."),b.break(),process.exit(1));let a=await Kg(o,u),h=s?Ug+_E(s):Ug,l=v=>{let _=v.indexOf("</head>");if(_!==-1)return v.slice(0,_)+h+v.slice(_);let F=v.indexOf("</body>");return F!==-1?v.slice(0,F)+h+v.slice(F):v+h},c=(0, hi.createProxyMiddleware)({target:n,changeOrigin:true,followRedirects:false,ws:true,selfHandleResponse:true,cookieDomainRewrite:{"*":""},autoRewrite:true,preserveHeaderKeyCase:true,xfwd:true,on:{error:(v,_,F)=>{"writeHead"in F&&!F.headersSent&&(F.writeHead(503,{"Content-Type":"text/plain"}),F.end(`Proxy error: Unable to connect to ${n}`));},proxyReq:v=>{v.removeHeader("accept-encoding");},proxyRes:(0, hi.responseInterceptor)(async(v,_,F,E)=>{if(E.removeHeader("content-security-policy"),E.removeHeader("content-security-policy-report-only"),!(_.headers["content-type"]||"").includes("text/html"))return v;let O=v.toString("utf-8");return l(O)})}}),d=http.createServer((v,_)=>{c(v,_,F=>{F&&(b.error(`Request error: ${F}`),_.writeHead(500),_.end("Internal Server Error"));});});d.on("upgrade",c.upgrade);let f=se("Starting.").start(),p=()=>{f.succeed(`Open in your browser: http://${u}:${a}`);let v=["npx react-grab@latest start",r];e.port!==String(Vg)&&v.push(`--port=${e.port}`),u!=="localhost"&&v.push(`--host=${u}`),s&&v.push(`--provider=${s}`),b.break(),b.log(I.dim(`$ ${v.join(" ")}`));},m=false,g=!s,y=()=>{m&&g&&p();};if(d.listen(a,u,()=>{m=true,y();}),s){let v=child_process.spawn("npx",[`${s}@latest`],{stdio:"ignore",shell:true,detached:false}),_=()=>{v.killed||v.kill();};process.on("exit",_),process.on("SIGINT",()=>{_(),process.exit(0);}),process.on("SIGTERM",()=>{_(),process.exit(0);}),v.on("error",F=>{f.fail(`Failed to start provider: ${F.message}`);}),v.on("spawn",()=>{g=true,y();}),v.on("close",F=>{F!==0&&F!==null&&b.error(`Provider exited with code ${F}`);});}d.on("error",v=>{b.break(),b.error(`Server error: ${v.message}`),b.break(),process.exit(1);});});process.noDeprecation=true;var EE="0.0.91",AE="https://www.react-grab.com/api/version";process.on("SIGINT",()=>process.exit(0));process.on("SIGTERM",()=>process.exit(0));try{fetch(`${AE}?source=cli&t=${Date.now()}`).catch(()=>{});}catch{}var Nr=new Be().name("react-grab").description("add React Grab to your project").version(EE,"-v, --version","display the version number");Nr.addCommand(up);Nr.addCommand(sp);Nr.addCommand(ip);Nr.addCommand(Yg);Nr.parse();
325
325
  /*! Bundled license information:
326
326
 
327
327
  http-proxy/lib/http-proxy/passes/web-outgoing.js:
@@ -65,6 +65,16 @@ interface Theme {
65
65
  */
66
66
  enabled?: boolean;
67
67
  };
68
+ /**
69
+ * The floating dock that allows toggling React Grab activation
70
+ */
71
+ dock?: {
72
+ /**
73
+ * Whether to show the dock
74
+ * @default true
75
+ */
76
+ enabled?: boolean;
77
+ };
68
78
  }
69
79
  interface ReactGrabState {
70
80
  isActive: boolean;
@@ -287,6 +297,9 @@ interface ReactGrabRendererProps {
287
297
  onNativeSelectionCopy?: () => void;
288
298
  onNativeSelectionEnter?: () => void;
289
299
  theme?: Required<Theme>;
300
+ dockVisible?: boolean;
301
+ isActive?: boolean;
302
+ onToggleActive?: () => void;
290
303
  }
291
304
  interface GrabbedBox {
292
305
  id: string;
@@ -65,6 +65,16 @@ interface Theme {
65
65
  */
66
66
  enabled?: boolean;
67
67
  };
68
+ /**
69
+ * The floating dock that allows toggling React Grab activation
70
+ */
71
+ dock?: {
72
+ /**
73
+ * Whether to show the dock
74
+ * @default true
75
+ */
76
+ enabled?: boolean;
77
+ };
68
78
  }
69
79
  interface ReactGrabState {
70
80
  isActive: boolean;
@@ -287,6 +297,9 @@ interface ReactGrabRendererProps {
287
297
  onNativeSelectionCopy?: () => void;
288
298
  onNativeSelectionEnter?: () => void;
289
299
  theme?: Required<Theme>;
300
+ dockVisible?: boolean;
301
+ isActive?: boolean;
302
+ onToggleActive?: () => void;
290
303
  }
291
304
  interface GrabbedBox {
292
305
  id: string;
package/dist/core.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';var chunkUSAVFRIU_cjs=require('./chunk-USAVFRIU.cjs');Object.defineProperty(exports,"DEFAULT_THEME",{enumerable:true,get:function(){return chunkUSAVFRIU_cjs.f}});Object.defineProperty(exports,"copyContent",{enumerable:true,get:function(){return chunkUSAVFRIU_cjs.d}});Object.defineProperty(exports,"formatElementInfo",{enumerable:true,get:function(){return chunkUSAVFRIU_cjs.c}});Object.defineProperty(exports,"generateSnippet",{enumerable:true,get:function(){return chunkUSAVFRIU_cjs.e}});Object.defineProperty(exports,"getStack",{enumerable:true,get:function(){return chunkUSAVFRIU_cjs.b}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunkUSAVFRIU_cjs.g}});Object.defineProperty(exports,"isInstrumentationActive",{enumerable:true,get:function(){return chunkUSAVFRIU_cjs.a}});
1
+ 'use strict';var chunkW6BS7R5W_cjs=require('./chunk-W6BS7R5W.cjs');Object.defineProperty(exports,"DEFAULT_THEME",{enumerable:true,get:function(){return chunkW6BS7R5W_cjs.f}});Object.defineProperty(exports,"copyContent",{enumerable:true,get:function(){return chunkW6BS7R5W_cjs.d}});Object.defineProperty(exports,"formatElementInfo",{enumerable:true,get:function(){return chunkW6BS7R5W_cjs.c}});Object.defineProperty(exports,"generateSnippet",{enumerable:true,get:function(){return chunkW6BS7R5W_cjs.e}});Object.defineProperty(exports,"getStack",{enumerable:true,get:function(){return chunkW6BS7R5W_cjs.b}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunkW6BS7R5W_cjs.g}});Object.defineProperty(exports,"isInstrumentationActive",{enumerable:true,get:function(){return chunkW6BS7R5W_cjs.a}});
package/dist/core.d.cts CHANGED
@@ -1,3 +1,3 @@
1
- export { o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, D as DEFAULT_THEME, O as Options, d as OverlayBounds, R as ReactGrabAPI, q as ReactGrabRendererProps, U as UpdatableOptions, r as copyContent, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-D6QsgQQN.cjs';
1
+ export { o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, D as DEFAULT_THEME, O as Options, d as OverlayBounds, R as ReactGrabAPI, q as ReactGrabRendererProps, U as UpdatableOptions, r as copyContent, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-DLrSA8VT.cjs';
2
2
  export { isInstrumentationActive } from 'bippy';
3
3
  import 'bippy/source';
package/dist/core.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, D as DEFAULT_THEME, O as Options, d as OverlayBounds, R as ReactGrabAPI, q as ReactGrabRendererProps, U as UpdatableOptions, r as copyContent, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-D6QsgQQN.js';
1
+ export { o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, D as DEFAULT_THEME, O as Options, d as OverlayBounds, R as ReactGrabAPI, q as ReactGrabRendererProps, U as UpdatableOptions, r as copyContent, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-DLrSA8VT.js';
2
2
  export { isInstrumentationActive } from 'bippy';
3
3
  import 'bippy/source';
package/dist/core.js CHANGED
@@ -1 +1 @@
1
- export{f as DEFAULT_THEME,d as copyContent,c as formatElementInfo,e as generateSnippet,b as getStack,g as init,a as isInstrumentationActive}from'./chunk-S3JUQDK7.js';
1
+ export{f as DEFAULT_THEME,d as copyContent,c as formatElementInfo,e as generateSnippet,b as getStack,g as init,a as isInstrumentationActive}from'./chunk-DN7NT3CO.js';
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';var chunkUSAVFRIU_cjs=require('./chunk-USAVFRIU.cjs');/**
1
+ 'use strict';var chunkW6BS7R5W_cjs=require('./chunk-W6BS7R5W.cjs');/**
2
2
  * @license MIT
3
3
  *
4
4
  * Copyright (c) 2025 Aiden Bai
@@ -6,4 +6,4 @@
6
6
  * This source code is licensed under the MIT license found in the
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
- var e=null,A=()=>typeof window>"u"?e:window.__REACT_GRAB__??e??null,d=t=>{e=t,typeof window<"u"&&(t?window.__REACT_GRAB__=t:delete window.__REACT_GRAB__);};typeof window<"u"&&(window.__REACT_GRAB__?e=window.__REACT_GRAB__:(e=chunkUSAVFRIU_cjs.g(),window.__REACT_GRAB__=e,window.dispatchEvent(new CustomEvent("react-grab:init",{detail:e}))));Object.defineProperty(exports,"DEFAULT_THEME",{enumerable:true,get:function(){return chunkUSAVFRIU_cjs.f}});Object.defineProperty(exports,"formatElementInfo",{enumerable:true,get:function(){return chunkUSAVFRIU_cjs.c}});Object.defineProperty(exports,"generateSnippet",{enumerable:true,get:function(){return chunkUSAVFRIU_cjs.e}});Object.defineProperty(exports,"getStack",{enumerable:true,get:function(){return chunkUSAVFRIU_cjs.b}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunkUSAVFRIU_cjs.g}});Object.defineProperty(exports,"isInstrumentationActive",{enumerable:true,get:function(){return chunkUSAVFRIU_cjs.a}});exports.getGlobalApi=A;exports.setGlobalApi=d;
9
+ var e=null,A=()=>typeof window>"u"?e:window.__REACT_GRAB__??e??null,d=t=>{e=t,typeof window<"u"&&(t?window.__REACT_GRAB__=t:delete window.__REACT_GRAB__);};typeof window<"u"&&(window.__REACT_GRAB__?e=window.__REACT_GRAB__:(e=chunkW6BS7R5W_cjs.g(),window.__REACT_GRAB__=e,window.dispatchEvent(new CustomEvent("react-grab:init",{detail:e}))));Object.defineProperty(exports,"DEFAULT_THEME",{enumerable:true,get:function(){return chunkW6BS7R5W_cjs.f}});Object.defineProperty(exports,"formatElementInfo",{enumerable:true,get:function(){return chunkW6BS7R5W_cjs.c}});Object.defineProperty(exports,"generateSnippet",{enumerable:true,get:function(){return chunkW6BS7R5W_cjs.e}});Object.defineProperty(exports,"getStack",{enumerable:true,get:function(){return chunkW6BS7R5W_cjs.b}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunkW6BS7R5W_cjs.g}});Object.defineProperty(exports,"isInstrumentationActive",{enumerable:true,get:function(){return chunkW6BS7R5W_cjs.a}});exports.getGlobalApi=A;exports.setGlobalApi=d;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as ReactGrabAPI } from './core-D6QsgQQN.cjs';
2
- export { p as ActivationMode, o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, C as CrosshairContext, D as DEFAULT_THEME, h as DeepPartial, e as DragRect, j as ElementLabelContext, E as ElementLabelVariant, G as GrabbedBox, I as InputModeContext, O as Options, d as OverlayBounds, c as ReactGrabState, f as Rect, T as Theme, U as UpdatableOptions, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-D6QsgQQN.cjs';
1
+ import { R as ReactGrabAPI } from './core-DLrSA8VT.cjs';
2
+ export { p as ActivationMode, o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, C as CrosshairContext, D as DEFAULT_THEME, h as DeepPartial, e as DragRect, j as ElementLabelContext, E as ElementLabelVariant, G as GrabbedBox, I as InputModeContext, O as Options, d as OverlayBounds, c as ReactGrabState, f as Rect, T as Theme, U as UpdatableOptions, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-DLrSA8VT.cjs';
3
3
  export { isInstrumentationActive } from 'bippy';
4
4
  import 'bippy/source';
5
5
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as ReactGrabAPI } from './core-D6QsgQQN.js';
2
- export { p as ActivationMode, o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, C as CrosshairContext, D as DEFAULT_THEME, h as DeepPartial, e as DragRect, j as ElementLabelContext, E as ElementLabelVariant, G as GrabbedBox, I as InputModeContext, O as Options, d as OverlayBounds, c as ReactGrabState, f as Rect, T as Theme, U as UpdatableOptions, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-D6QsgQQN.js';
1
+ import { R as ReactGrabAPI } from './core-DLrSA8VT.js';
2
+ export { p as ActivationMode, o as AgentCompleteResult, A as AgentContext, n as AgentOptions, l as AgentProvider, k as AgentSession, m as AgentSessionStorage, C as CrosshairContext, D as DEFAULT_THEME, h as DeepPartial, e as DragRect, j as ElementLabelContext, E as ElementLabelVariant, G as GrabbedBox, I as InputModeContext, O as Options, d as OverlayBounds, c as ReactGrabState, f as Rect, T as Theme, U as UpdatableOptions, a as formatElementInfo, b as generateSnippet, g as getStack, i as init } from './core-DLrSA8VT.js';
3
3
  export { isInstrumentationActive } from 'bippy';
4
4
  import 'bippy/source';
5
5