@standardagents/builder 0.19.0 → 0.19.1

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.
@@ -63365,11 +63365,19 @@ function platformEndpoint(env2) {
63365
63365
  return FALLBACK_PLATFORM_ORIGIN;
63366
63366
  }
63367
63367
  function hostedInstanceRedirectId(req, env2) {
63368
- const configured = env2.STANDARD_AGENTS_PROJECT_ID || env2.STANDARD_AGENTS_INSTANCE_ID || env2.STANDARD_AGENTS_INSTANCE_SUBDOMAIN;
63368
+ const configured = env2.STANDARD_AGENTS_INSTANCE_HOST || env2.STANDARD_AGENTS_INSTANCE_SUBDOMAIN || env2.STANDARD_AGENTS_INSTANCE_ID;
63369
63369
  if (typeof configured === "string" && configured.trim()) {
63370
63370
  return configured.trim();
63371
63371
  }
63372
- return new URL(req.url).hostname;
63372
+ const hostname = new URL(req.url).hostname;
63373
+ if (hostname && hostname !== "localhost" && hostname !== "127.0.0.1" && hostname !== "standardagents.internal") {
63374
+ return hostname;
63375
+ }
63376
+ const projectId = env2.STANDARD_AGENTS_PROJECT_ID;
63377
+ if (typeof projectId === "string" && projectId.trim()) {
63378
+ return projectId.trim();
63379
+ }
63380
+ return hostname;
63373
63381
  }
63374
63382
  function platformLoginUrl(req, env2, returnTo) {
63375
63383
  const url = new URL("/login", platformEndpoint(env2));