@standardagents/builder 0.12.4 → 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/index.js CHANGED
@@ -12885,6 +12885,23 @@ function agentbuilder(options = {}) {
12885
12885
  return {
12886
12886
  // Set publicDir to builder's client assets so Cloudflare plugin preserves assets config
12887
12887
  publicDir: fs2__default.existsSync(builderClientDir) ? builderClientDir : void 0,
12888
+ build: {
12889
+ rollupOptions: {
12890
+ // The packing system dynamically imports rollup, typescript, and related
12891
+ // plugins for the CLI `pack` command. These are never needed at runtime
12892
+ // in Cloudflare Workers and must be externalized:
12893
+ // - rollup/typescript/fsevents contain Node.js-only APIs (__filename, fs)
12894
+ // - fsevents is macOS-only and doesn't exist on Linux CI
12895
+ external: [
12896
+ "rollup",
12897
+ "@rollup/plugin-commonjs",
12898
+ "@rollup/plugin-node-resolve",
12899
+ "rollup-plugin-esbuild",
12900
+ "fsevents",
12901
+ "typescript"
12902
+ ]
12903
+ }
12904
+ },
12888
12905
  optimizeDeps: {
12889
12906
  // Exclude our packages from pre-bundling - they contain cloudflare:workers imports
12890
12907
  // that cannot be resolved during dependency optimization
@@ -12950,6 +12967,26 @@ function agentbuilder(options = {}) {
12950
12967
  ...config.optimizeDeps.include || [],
12951
12968
  ...depsToInclude.filter((dep) => !config.optimizeDeps?.include?.includes(dep))
12952
12969
  ];
12970
+ const packingDeps = [
12971
+ "rollup",
12972
+ "@rollup/plugin-commonjs",
12973
+ "@rollup/plugin-node-resolve",
12974
+ "rollup-plugin-esbuild",
12975
+ "fsevents",
12976
+ "typescript"
12977
+ ];
12978
+ config.build = config.build || {};
12979
+ config.build.rollupOptions = config.build.rollupOptions || {};
12980
+ const existing = config.build.rollupOptions.external;
12981
+ if (Array.isArray(existing)) {
12982
+ for (const dep of packingDeps) {
12983
+ if (!existing.includes(dep)) existing.push(dep);
12984
+ }
12985
+ } else if (typeof existing === "string") {
12986
+ config.build.rollupOptions.external = [existing, ...packingDeps];
12987
+ } else if (!existing) {
12988
+ config.build.rollupOptions.external = [...packingDeps];
12989
+ }
12953
12990
  },
12954
12991
  resolveId(id) {
12955
12992
  if (id === VIRTUAL_TOOLS_ID) {