@economic/agents 2.8.2 → 2.8.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/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as extractTokenFromConnectRequest, i as createJwtAuthConfig, n as createAgentTracer, o as isJwtActorAuthorized, r as recordFeedbackAnalytics, s as verifyJwt, t as routeAgentRequest } from "./route-agent-request-CFDjDTV-.mjs";
1
+ import { a as extractTokenFromConnectRequest, c as verifyJwt, i as createJwtAuthConfig, n as createAgentTracer, o as getTargetActorId, r as recordFeedbackAnalytics, s as isJwtActorAuthorized, t as routeAgentRequest } from "./route-agent-request-J98VlcOj.mjs";
2
2
  import { Agent as Agent$1, callable, getCurrentAgent } from "agents";
3
3
  import { Think, skills } from "@cloudflare/think";
4
4
  import { Output, convertToModelMessages, generateText, jsonSchema, pruneMessages, tool as tool$1 } from "ai";
@@ -364,7 +364,14 @@ var Agent = class extends Think {
364
364
  parentPath: this.parentPath
365
365
  })) {
366
366
  sendConnectionStatus(connection, "unauthorized");
367
- console.error("[Agent] JWT actor does not match the requested agent");
367
+ console.error("[Agent] Authenticated actor does not own the requested agent", {
368
+ authenticatedActorId: config.getActorId(result.claims),
369
+ requiredActorId: getTargetActorId({
370
+ durableObjectName: this.name,
371
+ parentPath: this.parentPath
372
+ }),
373
+ durableObjectName: this.name
374
+ });
368
375
  connection.close(4003, "Forbidden");
369
376
  return;
370
377
  }
@@ -1056,7 +1063,14 @@ var Assistant = class extends Agent$1 {
1056
1063
  parentPath: this.parentPath
1057
1064
  })) {
1058
1065
  sendConnectionStatus(connection, "unauthorized");
1059
- console.error("[Assistant] JWT actor does not match the requested assistant");
1066
+ console.error("[Assistant] Authenticated actor does not own the requested assistant", {
1067
+ authenticatedActorId: config.getActorId(result.claims),
1068
+ requiredActorId: getTargetActorId({
1069
+ durableObjectName: this.name,
1070
+ parentPath: this.parentPath
1071
+ }),
1072
+ durableObjectName: this.name
1073
+ });
1060
1074
  connection.close(4003, "Forbidden");
1061
1075
  return;
1062
1076
  }
@@ -480,4 +480,4 @@ async function routeAgentRequest$1(request, env, options) {
480
480
  return response;
481
481
  }
482
482
  //#endregion
483
- export { extractTokenFromConnectRequest as a, createJwtAuthConfig as i, createAgentTracer as n, isJwtActorAuthorized as o, recordFeedbackAnalytics as r, verifyJwt as s, routeAgentRequest$1 as t };
483
+ export { extractTokenFromConnectRequest as a, verifyJwt as c, createJwtAuthConfig as i, createAgentTracer as n, getTargetActorId as o, recordFeedbackAnalytics as r, isJwtActorAuthorized as s, routeAgentRequest$1 as t };
package/dist/v1.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as extractTokenFromConnectRequest, n as createAgentTracer, o as isJwtActorAuthorized, s as verifyJwt, t as routeAgentRequest } from "./route-agent-request-CFDjDTV-.mjs";
1
+ import { a as extractTokenFromConnectRequest, c as verifyJwt, n as createAgentTracer, s as isJwtActorAuthorized, t as routeAgentRequest } from "./route-agent-request-J98VlcOj.mjs";
2
2
  import { Agent as Agent$1, callable, getCurrentAgent } from "agents";
3
3
  import { Output, convertToModelMessages, generateText, jsonSchema, stepCountIs, streamText, tool } from "ai";
4
4
  import { AIChatAgent } from "@cloudflare/ai-chat";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@economic/agents",
3
- "version": "2.8.2",
3
+ "version": "2.8.3",
4
4
  "description": "A starter for creating a TypeScript package.",
5
5
  "license": "MIT",
6
6
  "files": [