@standardagents/builder 0.18.3 → 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.
package/dist/plugin.js CHANGED
@@ -7290,11 +7290,19 @@ function platformEndpoint(env) {
7290
7290
  }
7291
7291
 
7292
7292
  function hostedInstanceRedirectId(request, env) {
7293
- const configured = env && (env.STANDARD_AGENTS_PROJECT_ID || env.STANDARD_AGENTS_INSTANCE_ID || env.STANDARD_AGENTS_INSTANCE_SUBDOMAIN);
7293
+ const configured = env && (env.STANDARD_AGENTS_INSTANCE_HOST || env.STANDARD_AGENTS_INSTANCE_SUBDOMAIN || env.STANDARD_AGENTS_INSTANCE_ID);
7294
7294
  if (typeof configured === 'string' && configured.trim()) {
7295
7295
  return configured.trim();
7296
7296
  }
7297
- return new URL(request.url).hostname;
7297
+ const hostname = new URL(request.url).hostname;
7298
+ if (hostname && hostname !== 'localhost' && hostname !== '127.0.0.1' && hostname !== 'standardagents.internal') {
7299
+ return hostname;
7300
+ }
7301
+ const projectId = env && env.STANDARD_AGENTS_PROJECT_ID;
7302
+ if (typeof projectId === 'string' && projectId.trim()) {
7303
+ return projectId.trim();
7304
+ }
7305
+ return hostname;
7298
7306
  }
7299
7307
 
7300
7308
  function platformLoginUrl(request, env) {