@standardagents/builder 0.9.3 → 0.9.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
@@ -2054,14 +2054,19 @@ function agentbuilder(options = {}) {
2054
2054
  config() {
2055
2055
  return {
2056
2056
  optimizeDeps: {
2057
- // Pre-bundle these deps to prevent reload during startup
2058
- include: ["openai", "zod"],
2059
- // Exclude workspace packages from pre-bundling to prevent "new version of pre-bundle" errors
2060
- // during first startup when node_modules/.vite cache is empty
2061
- exclude: [
2062
- "@standardagents/builder/mcp",
2057
+ // Pre-bundle these deps upfront to prevent "new version of pre-bundle" errors
2058
+ // during first startup when node_modules/.vite cache is empty.
2059
+ // These are discovered dynamically by the virtual modules, so we need to
2060
+ // tell Vite about them ahead of time.
2061
+ include: [
2062
+ "openai",
2063
+ "zod",
2063
2064
  "@standardagents/builder/runtime",
2064
2065
  "@standardagents/builder/built-in-routes"
2066
+ ],
2067
+ // Exclude MCP as it's not used in the main app
2068
+ exclude: [
2069
+ "@standardagents/builder/mcp"
2065
2070
  ]
2066
2071
  },
2067
2072
  ssr: {
@@ -3057,6 +3062,24 @@ export class DurableAgentBuilder extends _BaseDurableAgentBuilder {
3057
3062
  next();
3058
3063
  return;
3059
3064
  }
3065
+ const uiDevServer = process.env.UI_DEV_SERVER;
3066
+ if (uiDevServer && !pathWithoutMount.startsWith("/api/")) {
3067
+ const targetUrl = `${uiDevServer}${pathWithoutMount}`;
3068
+ try {
3069
+ const proxyRes = await fetch(targetUrl);
3070
+ res.statusCode = proxyRes.status;
3071
+ proxyRes.headers.forEach((value, key) => {
3072
+ if (!["content-encoding", "transfer-encoding"].includes(key.toLowerCase())) {
3073
+ res.setHeader(key, value);
3074
+ }
3075
+ });
3076
+ const body = await proxyRes.arrayBuffer();
3077
+ res.end(Buffer.from(body));
3078
+ return;
3079
+ } catch (error) {
3080
+ console.error("[agentbuilder] Failed to proxy to UI dev server:", error);
3081
+ }
3082
+ }
3060
3083
  const isStaticAsset = pathWithoutMount.startsWith("/assets/") || pathWithoutMount.startsWith("/vendor.js") || pathWithoutMount.startsWith("/vue.js") || pathWithoutMount.startsWith("/monaco.js") || pathWithoutMount.startsWith("/index.js") || pathWithoutMount.startsWith("/index.css") || pathWithoutMount.match(/\.(js|css|png|jpg|jpeg|gif|svg|woff|woff2|ttf|eot|ico)$/);
3061
3084
  {
3062
3085
  const currentDir = path3.dirname(fileURLToPath(import.meta.url));