@standardagents/builder 0.9.3 → 0.9.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/plugin.js CHANGED
@@ -3057,6 +3057,24 @@ export class DurableAgentBuilder extends _BaseDurableAgentBuilder {
3057
3057
  next();
3058
3058
  return;
3059
3059
  }
3060
+ const uiDevServer = process.env.UI_DEV_SERVER;
3061
+ if (uiDevServer && !pathWithoutMount.startsWith("/api/")) {
3062
+ const targetUrl = `${uiDevServer}${pathWithoutMount}`;
3063
+ try {
3064
+ const proxyRes = await fetch(targetUrl);
3065
+ res.statusCode = proxyRes.status;
3066
+ proxyRes.headers.forEach((value, key) => {
3067
+ if (!["content-encoding", "transfer-encoding"].includes(key.toLowerCase())) {
3068
+ res.setHeader(key, value);
3069
+ }
3070
+ });
3071
+ const body = await proxyRes.arrayBuffer();
3072
+ res.end(Buffer.from(body));
3073
+ return;
3074
+ } catch (error) {
3075
+ console.error("[agentbuilder] Failed to proxy to UI dev server:", error);
3076
+ }
3077
+ }
3060
3078
  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
3079
  {
3062
3080
  const currentDir = path3.dirname(fileURLToPath(import.meta.url));