@mcp-use/cli 2.6.0-canary.3 → 2.6.0-canary.4

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/index.js CHANGED
@@ -3567,10 +3567,98 @@ export default PostHog;
3567
3567
  } catch (error) {
3568
3568
  }
3569
3569
  try {
3570
+ const buildNodeStubsPlugin = {
3571
+ name: "node-stubs-build",
3572
+ enforce: "pre",
3573
+ resolveId(id) {
3574
+ if (id === "posthog-node" || id.startsWith("posthog-node/")) {
3575
+ return "\0virtual:posthog-node-stub";
3576
+ }
3577
+ if (id === "path" || id === "node:path") {
3578
+ return "\0virtual:path-stub";
3579
+ }
3580
+ return null;
3581
+ },
3582
+ load(id) {
3583
+ if (id === "\0virtual:posthog-node-stub") {
3584
+ return `
3585
+ export class PostHog {
3586
+ constructor() {}
3587
+ capture() {}
3588
+ identify() {}
3589
+ alias() {}
3590
+ flush() { return Promise.resolve(); }
3591
+ shutdown() { return Promise.resolve(); }
3592
+ }
3593
+ export default PostHog;
3594
+ `;
3595
+ }
3596
+ if (id === "\0virtual:path-stub") {
3597
+ return `
3598
+ export function join(...paths) {
3599
+ return paths.filter(Boolean).join("/").replace(/\\/\\//g, "/").replace(/\\/$/, "");
3600
+ }
3601
+ export function resolve(...paths) {
3602
+ return join(...paths);
3603
+ }
3604
+ export function dirname(filepath) {
3605
+ const parts = filepath.split("/");
3606
+ parts.pop();
3607
+ return parts.join("/") || "/";
3608
+ }
3609
+ export function basename(filepath, ext) {
3610
+ const parts = filepath.split("/");
3611
+ let name = parts[parts.length - 1] || "";
3612
+ if (ext && name.endsWith(ext)) {
3613
+ name = name.slice(0, -ext.length);
3614
+ }
3615
+ return name;
3616
+ }
3617
+ export function extname(filepath) {
3618
+ const name = basename(filepath);
3619
+ const index = name.lastIndexOf(".");
3620
+ return index > 0 ? name.slice(index) : "";
3621
+ }
3622
+ export function normalize(filepath) {
3623
+ return filepath.replace(/\\/\\//g, "/");
3624
+ }
3625
+ export function isAbsolute(filepath) {
3626
+ return filepath.startsWith("/");
3627
+ }
3628
+ export const sep = "/";
3629
+ export const delimiter = ":";
3630
+ export const posix = {
3631
+ join,
3632
+ resolve,
3633
+ dirname,
3634
+ basename,
3635
+ extname,
3636
+ normalize,
3637
+ isAbsolute,
3638
+ sep,
3639
+ delimiter,
3640
+ };
3641
+ export default {
3642
+ join,
3643
+ resolve,
3644
+ dirname,
3645
+ basename,
3646
+ extname,
3647
+ normalize,
3648
+ isAbsolute,
3649
+ sep,
3650
+ delimiter,
3651
+ posix,
3652
+ };
3653
+ `;
3654
+ }
3655
+ return null;
3656
+ }
3657
+ };
3570
3658
  await build({
3571
3659
  root: tempDir,
3572
3660
  base: baseUrl,
3573
- plugins: [tailwindcss(), react()],
3661
+ plugins: [buildNodeStubsPlugin, tailwindcss(), react()],
3574
3662
  experimental: {
3575
3663
  renderBuiltUrl: (filename, { hostType }) => {
3576
3664
  if (["js", "css"].includes(hostType)) {
@@ -3587,11 +3675,18 @@ export default PostHog;
3587
3675
  "@": resourcesDir
3588
3676
  }
3589
3677
  },
3678
+ optimizeDeps: {
3679
+ // Exclude Node.js-only packages from browser bundling
3680
+ exclude: ["posthog-node"]
3681
+ },
3590
3682
  build: {
3591
3683
  outDir,
3592
3684
  emptyOutDir: true,
3593
3685
  rollupOptions: {
3594
- input: path5.join(tempDir, "index.html")
3686
+ input: path5.join(tempDir, "index.html"),
3687
+ external: (id) => {
3688
+ return false;
3689
+ }
3595
3690
  }
3596
3691
  }
3597
3692
  });