@standardagents/builder 0.17.1 → 0.17.3

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/runtime.js CHANGED
@@ -908,7 +908,7 @@ function resolvePlatformRouting(providerName, env) {
908
908
  var DEFAULT_PLATFORM_PROXY_ORIGIN, PROVIDER_BASE_PATHS;
909
909
  var init_platform_routing = __esm({
910
910
  "src/agents/providers/platform-routing.ts"() {
911
- DEFAULT_PLATFORM_PROXY_ORIGIN = "https://proxy.standardagents.ai";
911
+ DEFAULT_PLATFORM_PROXY_ORIGIN = "https://api.standardagents.ai";
912
912
  PROVIDER_BASE_PATHS = {
913
913
  cloudflare: "/ai/v1"
914
914
  };
@@ -12539,6 +12539,19 @@ async function hashToken(token) {
12539
12539
  const hashArray = new Uint8Array(hashBuffer);
12540
12540
  return Array.from(hashArray, (byte) => byte.toString(16).padStart(2, "0")).join("");
12541
12541
  }
12542
+ var SESSION_COOKIE_NAME = "agtuser_session";
12543
+ function readSessionCookie(request) {
12544
+ const header = request.headers.get("Cookie");
12545
+ if (!header) return null;
12546
+ for (const part of header.split(";")) {
12547
+ const eq = part.indexOf("=");
12548
+ if (eq === -1) continue;
12549
+ if (part.slice(0, eq).trim() === SESSION_COOKIE_NAME) {
12550
+ return decodeURIComponent(part.slice(eq + 1).trim()) || null;
12551
+ }
12552
+ }
12553
+ return null;
12554
+ }
12542
12555
  function isValidUserToken(token) {
12543
12556
  return token.startsWith("agtuser_") && token.length > 10;
12544
12557
  }
@@ -12612,6 +12625,10 @@ function extractBearerToken(request) {
12612
12625
  if (authHeader && authHeader.startsWith("Bearer ")) {
12613
12626
  return authHeader.substring(7);
12614
12627
  }
12628
+ const cookieToken = readSessionCookie(request);
12629
+ if (cookieToken) {
12630
+ return cookieToken;
12631
+ }
12615
12632
  const isWebSocket = request.headers.get("upgrade")?.toLowerCase() === "websocket";
12616
12633
  if (isWebSocket) {
12617
12634
  try {