agents 0.8.3 → 0.8.5

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.
@@ -0,0 +1,18 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2021",
4
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
5
+ "jsx": "react-jsx",
6
+ "module": "ES2022",
7
+ "moduleResolution": "bundler",
8
+ "types": ["node", "@cloudflare/workers-types", "vite/client"],
9
+ "allowImportingTsExtensions": true,
10
+ "noEmit": true,
11
+ "isolatedModules": true,
12
+ "verbatimModuleSyntax": true,
13
+ "esModuleInterop": true,
14
+ "forceConsistentCasingInFileNames": true,
15
+ "strict": true,
16
+ "skipLibCheck": true
17
+ }
18
+ }
@@ -1,4 +1,5 @@
1
1
  import { r as Agent } from "../index-DynYigzs.js";
2
+
2
3
  //#region src/experimental/forever.d.ts
3
4
  type FiberState = {
4
5
  id: string;
package/dist/index.js CHANGED
@@ -2713,10 +2713,13 @@ var Agent = class Agent extends Server {
2713
2713
  }
2714
2714
  if (!this._resolvedOptions.sendIdentityOnConnect && resolvedCallbackHost && !resolvedCallbackPath) throw new Error("callbackPath is required in addMcpServer options when sendIdentityOnConnect is false — the default callback URL would expose the instance name. Provide a callbackPath and route the callback request to this agent via getAgentByName.");
2715
2715
  if (!resolvedCallbackHost) {
2716
- const { request } = getCurrentAgent();
2716
+ const { request, connection } = getCurrentAgent();
2717
2717
  if (request) {
2718
2718
  const requestUrl = new URL(request.url);
2719
2719
  resolvedCallbackHost = `${requestUrl.protocol}//${requestUrl.host}`;
2720
+ } else if (connection?.uri) {
2721
+ const connectionUrl = new URL(connection.uri);
2722
+ resolvedCallbackHost = `${connectionUrl.protocol}//${connectionUrl.host}`;
2720
2723
  }
2721
2724
  }
2722
2725
  let callbackUrl;