@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.
package/dist/index.js CHANGED
@@ -19781,11 +19781,19 @@ function platformEndpoint(env) {
19781
19781
  }
19782
19782
 
19783
19783
  function hostedInstanceRedirectId(request, env) {
19784
- const configured = env && (env.STANDARD_AGENTS_PROJECT_ID || env.STANDARD_AGENTS_INSTANCE_ID || env.STANDARD_AGENTS_INSTANCE_SUBDOMAIN);
19784
+ const configured = env && (env.STANDARD_AGENTS_INSTANCE_HOST || env.STANDARD_AGENTS_INSTANCE_SUBDOMAIN || env.STANDARD_AGENTS_INSTANCE_ID);
19785
19785
  if (typeof configured === 'string' && configured.trim()) {
19786
19786
  return configured.trim();
19787
19787
  }
19788
- return new URL(request.url).hostname;
19788
+ const hostname = new URL(request.url).hostname;
19789
+ if (hostname && hostname !== 'localhost' && hostname !== '127.0.0.1' && hostname !== 'standardagents.internal') {
19790
+ return hostname;
19791
+ }
19792
+ const projectId = env && env.STANDARD_AGENTS_PROJECT_ID;
19793
+ if (typeof projectId === 'string' && projectId.trim()) {
19794
+ return projectId.trim();
19795
+ }
19796
+ return hostname;
19789
19797
  }
19790
19798
 
19791
19799
  function platformLoginUrl(request, env) {