agents 0.10.0 → 0.10.2
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/chat/index.js +24 -4
- package/dist/chat/index.js.map +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/compaction-helpers-BPE1_ziA.js.map +1 -1
- package/dist/compaction-helpers-BdQbZiML.d.ts +441 -0
- package/dist/email.js +1 -2
- package/dist/email.js.map +1 -1
- package/dist/experimental/memory/session/index.d.ts +61 -268
- package/dist/experimental/memory/session/index.js +238 -34
- package/dist/experimental/memory/session/index.js.map +1 -1
- package/dist/experimental/memory/utils/index.d.ts +3 -4
- package/dist/experimental/memory/utils/index.js.map +1 -1
- package/dist/{index-BPkkIqMn.d.ts → index-D2lfljd3.d.ts} +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/client.d.ts +1 -1
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +3 -12
- package/dist/mcp/index.js.map +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js.map +1 -1
- package/dist/{src-B8NZxxsO.js → src-f7-4oW_C.js} +6 -6
- package/dist/{src-B8NZxxsO.js.map → src-f7-4oW_C.js.map} +1 -1
- package/dist/workflows.d.ts +1 -1
- package/dist/workflows.js +1 -1
- package/package.json +7 -7
- package/dist/compaction-helpers-CHNQeyRm.d.ts +0 -139
package/dist/mcp/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MessageType } from "../types.js";
|
|
2
|
-
import { o as getAgentByName, s as getCurrentAgent, t as Agent } from "../src-
|
|
2
|
+
import { o as getAgentByName, s as getCurrentAgent, t as Agent } from "../src-f7-4oW_C.js";
|
|
3
3
|
import { a as RPCServerTransport, i as RPCClientTransport, o as RPC_DO_PREFIX } from "../client-QBjFV5de.js";
|
|
4
4
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
5
5
|
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
@@ -488,9 +488,8 @@ const createAutoHandler = (basePath, namespace, options = {}) => {
|
|
|
488
488
|
};
|
|
489
489
|
function corsHeaders(_request, corsOptions = {}) {
|
|
490
490
|
const origin = corsOptions.origin || "*";
|
|
491
|
-
const headers = corsOptions.headers || "Content-Type, Accept, Authorization, mcp-session-id, mcp-protocol-version";
|
|
492
491
|
return {
|
|
493
|
-
"Access-Control-Allow-Headers": headers,
|
|
492
|
+
"Access-Control-Allow-Headers": corsOptions.headers || "Content-Type, Accept, Authorization, mcp-session-id, mcp-protocol-version",
|
|
494
493
|
"Access-Control-Allow-Methods": corsOptions.methods || "GET, POST, DELETE, OPTIONS",
|
|
495
494
|
"Access-Control-Allow-Origin": origin,
|
|
496
495
|
"Access-Control-Expose-Headers": corsOptions.exposeHeaders || "mcp-session-id",
|
|
@@ -1541,15 +1540,7 @@ var McpAgent = class McpAgent extends Agent {
|
|
|
1541
1540
|
* @returns The response message(s) or undefined
|
|
1542
1541
|
*/
|
|
1543
1542
|
async handleMcpMessage(message) {
|
|
1544
|
-
|
|
1545
|
-
this.props = await this.ctx.storage.get("props");
|
|
1546
|
-
await this.init();
|
|
1547
|
-
const server = await this.server;
|
|
1548
|
-
this._transport = this.initTransport();
|
|
1549
|
-
if (!this._transport) throw new Error("Failed to initialize transport");
|
|
1550
|
-
await server.connect(this._transport);
|
|
1551
|
-
await this.reinitializeServer();
|
|
1552
|
-
}
|
|
1543
|
+
await this.__unsafe_ensureInitialized();
|
|
1553
1544
|
if (!(this._transport instanceof RPCServerTransport)) throw new Error("Expected RPC transport");
|
|
1554
1545
|
if (!Array.isArray(message)) {
|
|
1555
1546
|
const parseResult = JSONRPCMessageSchema.safeParse(message);
|