agents 0.0.0-1e5483a → 0.0.0-1f318be
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/ai-chat-agent.d.ts +2 -2
- package/dist/ai-chat-agent.js +2 -2
- package/dist/ai-react.d.ts +3 -3
- package/dist/cli.d.ts +8 -0
- package/dist/cli.js +27 -0
- package/dist/cli.js.map +1 -0
- package/dist/{client-mxNP7zR3.d.ts → client-BnO9jNtu.d.ts} +21 -53
- package/dist/{client-9Ld2_lnt.js → client-DZhjV_XA.js} +14 -81
- package/dist/client-DZhjV_XA.js.map +1 -0
- package/dist/codemode/ai.js +2 -2
- package/dist/{index-_D8rpSTJ.d.ts → index-CuqiHyhT.d.ts} +11 -11
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/mcp/client.d.ts +1 -1
- package/dist/mcp/client.js +1 -1
- package/dist/mcp/index.d.ts +20 -4
- package/dist/mcp/index.js +37 -5
- package/dist/mcp/index.js.map +1 -1
- package/dist/observability/index.js +2 -2
- package/dist/{react-D4uebgIu.d.ts → react-Cx9uE2Jd.d.ts} +31 -33
- package/dist/react.d.ts +3 -3
- package/dist/{src-Dz0H9hSU.js → src-CwIW7tU2.js} +26 -10
- package/dist/{src-Dz0H9hSU.js.map → src-CwIW7tU2.js.map} +1 -1
- package/package.json +51 -37
- package/dist/client-9Ld2_lnt.js.map +0 -1
package/dist/mcp/index.d.ts
CHANGED
|
@@ -1,14 +1,30 @@
|
|
|
1
|
-
import { c as MaybePromise,
|
|
1
|
+
import { c as MaybePromise, l as ServeOptions, n as MCPClientOAuthCallbackConfig, o as BaseTransportType, r as MCPClientOAuthResult, s as CORSOptions } from "../client-BnO9jNtu.js";
|
|
2
2
|
import "../mcp-Dw5vDrY8.js";
|
|
3
3
|
import "../do-oauth-client-provider-DGc5pP0l.js";
|
|
4
4
|
import "../index-DhJCaDWd.js";
|
|
5
5
|
import "../ai-types-D5YoPrBZ.js";
|
|
6
|
-
import { c as ConnectionContext, s as Connection, t as Agent } from "../index-
|
|
7
|
-
import {
|
|
6
|
+
import { c as ConnectionContext, s as Connection, t as Agent } from "../index-CuqiHyhT.js";
|
|
7
|
+
import { SSEClientTransport, SSEClientTransportOptions } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
8
|
+
import { StreamableHTTPClientTransport, StreamableHTTPClientTransportOptions } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
9
|
+
import { ElicitRequest, ElicitRequestSchema, ElicitResult, ElicitResult as ElicitResult$1, JSONRPCMessage, MessageExtraInfo } from "@modelcontextprotocol/sdk/types.js";
|
|
8
10
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
9
11
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
10
12
|
import { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
|
|
11
13
|
|
|
14
|
+
//#region src/mcp/client-transports.d.ts
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use SSEClientTransport from @modelcontextprotocol/sdk/client/sse.js instead. This alias will be removed in the next major version.
|
|
17
|
+
*/
|
|
18
|
+
declare class SSEEdgeClientTransport extends SSEClientTransport {
|
|
19
|
+
constructor(url: URL, options: SSEClientTransportOptions);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated Use StreamableHTTPClientTransport from @modelcontextprotocol/sdk/client/streamableHttp.js instead. This alias will be removed in the next major version.
|
|
23
|
+
*/
|
|
24
|
+
declare class StreamableHTTPEdgeClientTransport extends StreamableHTTPClientTransport {
|
|
25
|
+
constructor(url: URL, options: StreamableHTTPClientTransportOptions);
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
12
28
|
//#region src/mcp/worker-transport.d.ts
|
|
13
29
|
interface WorkerTransportOptions {
|
|
14
30
|
sessionIdGenerator?: () => string;
|
|
@@ -31,7 +47,7 @@ declare class WorkerTransport implements Transport {
|
|
|
31
47
|
sessionId?: string;
|
|
32
48
|
onclose?: () => void;
|
|
33
49
|
onerror?: (error: Error) => void;
|
|
34
|
-
onmessage?: (message: JSONRPCMessage) => void;
|
|
50
|
+
onmessage?: (message: JSONRPCMessage, extra?: MessageExtraInfo) => void;
|
|
35
51
|
constructor(options?: WorkerTransportOptions);
|
|
36
52
|
start(): Promise<void>;
|
|
37
53
|
private validateProtocolVersion;
|
package/dist/mcp/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { t as MessageType } from "../ai-types-B3aQaFv3.js";
|
|
2
2
|
import "../client-BfiZ3HQd.js";
|
|
3
|
-
import
|
|
3
|
+
import "../client-DZhjV_XA.js";
|
|
4
4
|
import "../do-oauth-client-provider-CswoD5Lu.js";
|
|
5
|
-
import { c as getCurrentAgent, s as getAgentByName, t as Agent } from "../src-
|
|
5
|
+
import { c as getCurrentAgent, s as getAgentByName, t as Agent } from "../src-CwIW7tU2.js";
|
|
6
6
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
7
|
+
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
8
|
+
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
7
9
|
import { ElicitRequestSchema, InitializeRequestSchema, JSONRPCMessageSchema, isInitializeRequest, isJSONRPCError, isJSONRPCNotification, isJSONRPCRequest, isJSONRPCResponse } from "@modelcontextprotocol/sdk/types.js";
|
|
8
10
|
|
|
9
11
|
//#region src/mcp/utils.ts
|
|
@@ -637,6 +639,35 @@ var StreamableHTTPServerTransport = class {
|
|
|
637
639
|
}
|
|
638
640
|
};
|
|
639
641
|
|
|
642
|
+
//#endregion
|
|
643
|
+
//#region src/mcp/client-transports.ts
|
|
644
|
+
let didWarnAboutSSEEdgeClientTransport = false;
|
|
645
|
+
/**
|
|
646
|
+
* @deprecated Use SSEClientTransport from @modelcontextprotocol/sdk/client/sse.js instead. This alias will be removed in the next major version.
|
|
647
|
+
*/
|
|
648
|
+
var SSEEdgeClientTransport = class extends SSEClientTransport {
|
|
649
|
+
constructor(url, options) {
|
|
650
|
+
super(url, options);
|
|
651
|
+
if (!didWarnAboutSSEEdgeClientTransport) {
|
|
652
|
+
didWarnAboutSSEEdgeClientTransport = true;
|
|
653
|
+
console.warn("SSEEdgeClientTransport is deprecated. Use SSEClientTransport from @modelcontextprotocol/sdk/client/sse.js instead. SSEEdgeClientTransport will be removed in the next major version.");
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
};
|
|
657
|
+
let didWarnAboutStreamableHTTPEdgeClientTransport = false;
|
|
658
|
+
/**
|
|
659
|
+
* @deprecated Use StreamableHTTPClientTransport from @modelcontextprotocol/sdk/client/streamableHttp.js instead. This alias will be removed in the next major version.
|
|
660
|
+
*/
|
|
661
|
+
var StreamableHTTPEdgeClientTransport = class extends StreamableHTTPClientTransport {
|
|
662
|
+
constructor(url, options) {
|
|
663
|
+
super(url, options);
|
|
664
|
+
if (!didWarnAboutStreamableHTTPEdgeClientTransport) {
|
|
665
|
+
didWarnAboutStreamableHTTPEdgeClientTransport = true;
|
|
666
|
+
console.warn("StreamableHTTPEdgeClientTransport is deprecated. Use StreamableHTTPClientTransport from @modelcontextprotocol/sdk/client/streamableHttp.js instead. StreamableHTTPEdgeClientTransport will be removed in the next major version.");
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
};
|
|
670
|
+
|
|
640
671
|
//#endregion
|
|
641
672
|
//#region src/mcp/worker-transport.ts
|
|
642
673
|
const SUPPORTED_PROTOCOL_VERSIONS = ["2025-03-26", "2025-06-18"];
|
|
@@ -868,6 +899,7 @@ var WorkerTransport = class {
|
|
|
868
899
|
}
|
|
869
900
|
});
|
|
870
901
|
}
|
|
902
|
+
const requestInfo = { headers: Object.fromEntries(request.headers.entries()) };
|
|
871
903
|
const isInitializationRequest = messages.some(isInitializeRequest);
|
|
872
904
|
if (isInitializationRequest) {
|
|
873
905
|
if (this.initialized && this.sessionId !== void 0) return new Response(JSON.stringify({
|
|
@@ -915,7 +947,7 @@ var WorkerTransport = class {
|
|
|
915
947
|
if (versionError) return versionError;
|
|
916
948
|
}
|
|
917
949
|
if (!messages.some(isJSONRPCRequest)) {
|
|
918
|
-
for (const message of messages) this.onmessage?.(message);
|
|
950
|
+
for (const message of messages) this.onmessage?.(message, { requestInfo });
|
|
919
951
|
return new Response(null, {
|
|
920
952
|
status: 202,
|
|
921
953
|
headers: { ...this.getHeaders() }
|
|
@@ -930,7 +962,7 @@ var WorkerTransport = class {
|
|
|
930
962
|
}
|
|
931
963
|
});
|
|
932
964
|
for (const message of messages) if (isJSONRPCRequest(message)) this.requestToStreamMapping.set(message.id, streamId);
|
|
933
|
-
for (const message of messages) this.onmessage?.(message);
|
|
965
|
+
for (const message of messages) this.onmessage?.(message, { requestInfo });
|
|
934
966
|
});
|
|
935
967
|
const { readable, writable } = new TransformStream();
|
|
936
968
|
const writer = writable.getWriter();
|
|
@@ -951,7 +983,7 @@ var WorkerTransport = class {
|
|
|
951
983
|
}
|
|
952
984
|
});
|
|
953
985
|
for (const message of messages) if (isJSONRPCRequest(message)) this.requestToStreamMapping.set(message.id, streamId);
|
|
954
|
-
for (const message of messages) this.onmessage?.(message);
|
|
986
|
+
for (const message of messages) this.onmessage?.(message, { requestInfo });
|
|
955
987
|
return new Response(readable, { headers });
|
|
956
988
|
}
|
|
957
989
|
async handleDeleteRequest(request) {
|