@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/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) {
@@ -29051,6 +29059,13 @@ ${result ?? error ?? "No result content."}${attachmentSummary}`;
29051
29059
  for (const replicaUser of snapshot.users) {
29052
29060
  const user = await this.upsertPlatformReplicaUser(replicaUser);
29053
29061
  activeUserIds.add(user.id);
29062
+ if (typeof replicaUser.session_revoked_at === "number" && Number.isFinite(replicaUser.session_revoked_at)) {
29063
+ await this.ctx.storage.sql.exec(
29064
+ `DELETE FROM sessions WHERE user_id = ? AND created_at <= ?`,
29065
+ user.id,
29066
+ Math.floor(replicaUser.session_revoked_at)
29067
+ );
29068
+ }
29054
29069
  }
29055
29070
  const activeList = Array.from(activeUserIds);
29056
29071
  if (activeList.length > 0) {