agents 0.8.4 → 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.
@@ -5,7 +5,7 @@
5
5
  "jsx": "react-jsx",
6
6
  "module": "ES2022",
7
7
  "moduleResolution": "bundler",
8
- "types": ["node", "@cloudflare/workers-types"],
8
+ "types": ["node", "@cloudflare/workers-types", "vite/client"],
9
9
  "allowImportingTsExtensions": true,
10
10
  "noEmit": true,
11
11
  "isolatedModules": true,
package/dist/client.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { r as Agent } from "./index-BADmcFuB.js";
1
+ import { r as Agent } from "./index-DynYigzs.js";
2
2
  import {
3
3
  i as SerializableValue,
4
4
  n as RPCMethod,
@@ -1,4 +1,5 @@
1
- import { r as Agent } from "../index-BADmcFuB.js";
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;
@@ -720,7 +720,7 @@ declare class MCPClientConnection {
720
720
  */
721
721
  getTransport(
722
722
  transportType: BaseTransportType
723
- ): StreamableHTTPClientTransport | SSEClientTransport | RPCClientTransport;
723
+ ): RPCClientTransport | SSEClientTransport | StreamableHTTPClientTransport;
724
724
  private tryConnect;
725
725
  private _capabilityErrorHandler;
726
726
  }
@@ -2865,4 +2865,4 @@ export {
2865
2865
  Schedule as y,
2866
2866
  MCPServerOptions as z
2867
2867
  };
2868
- //# sourceMappingURL=index-BADmcFuB.d.ts.map
2868
+ //# sourceMappingURL=index-DynYigzs.d.ts.map
package/dist/index.d.ts CHANGED
@@ -33,7 +33,7 @@ import {
33
33
  w as SubAgentStub,
34
34
  x as StateUpdateMessage,
35
35
  y as Schedule
36
- } from "./index-BADmcFuB.js";
36
+ } from "./index-DynYigzs.js";
37
37
  import {
38
38
  n as AgentsOAuthProvider,
39
39
  r as DurableObjectOAuthClientProvider,
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;