@standardagents/builder 0.12.5 → 0.12.6

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/plugin.js CHANGED
@@ -4861,10 +4861,19 @@ function agentbuilder(options = {}) {
4861
4861
  publicDir: fs2__default.existsSync(builderClientDir) ? builderClientDir : void 0,
4862
4862
  build: {
4863
4863
  rollupOptions: {
4864
- // fsevents is a macOS-only native module dynamically imported by rollup's
4865
- // file watcher. Rollup is pulled in by the packing system but fsevents is
4866
- // never needed at runtime. Must be externalized for Linux CI builds.
4867
- external: ["fsevents"]
4864
+ // The packing system dynamically imports rollup, typescript, and related
4865
+ // plugins for the CLI `pack` command. These are never needed at runtime
4866
+ // in Cloudflare Workers and must be externalized:
4867
+ // - rollup/typescript/fsevents contain Node.js-only APIs (__filename, fs)
4868
+ // - fsevents is macOS-only and doesn't exist on Linux CI
4869
+ external: [
4870
+ "rollup",
4871
+ "@rollup/plugin-commonjs",
4872
+ "@rollup/plugin-node-resolve",
4873
+ "rollup-plugin-esbuild",
4874
+ "fsevents",
4875
+ "typescript"
4876
+ ]
4868
4877
  }
4869
4878
  },
4870
4879
  optimizeDeps: {
@@ -4932,15 +4941,25 @@ function agentbuilder(options = {}) {
4932
4941
  ...config.optimizeDeps.include || [],
4933
4942
  ...depsToInclude.filter((dep) => !config.optimizeDeps?.include?.includes(dep))
4934
4943
  ];
4944
+ const packingDeps = [
4945
+ "rollup",
4946
+ "@rollup/plugin-commonjs",
4947
+ "@rollup/plugin-node-resolve",
4948
+ "rollup-plugin-esbuild",
4949
+ "fsevents",
4950
+ "typescript"
4951
+ ];
4935
4952
  config.build = config.build || {};
4936
4953
  config.build.rollupOptions = config.build.rollupOptions || {};
4937
4954
  const existing = config.build.rollupOptions.external;
4938
4955
  if (Array.isArray(existing)) {
4939
- if (!existing.includes("fsevents")) existing.push("fsevents");
4956
+ for (const dep of packingDeps) {
4957
+ if (!existing.includes(dep)) existing.push(dep);
4958
+ }
4940
4959
  } else if (typeof existing === "string") {
4941
- config.build.rollupOptions.external = [existing, "fsevents"];
4960
+ config.build.rollupOptions.external = [existing, ...packingDeps];
4942
4961
  } else if (!existing) {
4943
- config.build.rollupOptions.external = ["fsevents"];
4962
+ config.build.rollupOptions.external = [...packingDeps];
4944
4963
  }
4945
4964
  },
4946
4965
  resolveId(id) {