agents 0.2.15 → 0.2.17
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 +10 -10
- package/dist/ai-chat-agent.js +6 -6
- package/dist/{ai-chat-v5-migration-gdyLiTd8.js → ai-chat-v5-migration-DBHGW4Hv.js} +2 -2
- package/dist/{ai-chat-v5-migration-gdyLiTd8.js.map → ai-chat-v5-migration-DBHGW4Hv.js.map} +1 -1
- package/dist/ai-chat-v5-migration.js +1 -1
- package/dist/ai-react.d.ts +9 -9
- package/dist/ai-react.js +1 -1
- package/dist/{ai-types-UZlfLOYP.js → ai-types-B3aQaFv3.js} +2 -2
- package/dist/{ai-types-UZlfLOYP.js.map → ai-types-B3aQaFv3.js.map} +1 -1
- package/dist/{ai-types-BWW4umHY.d.ts → ai-types-D5YoPrBZ.d.ts} +2 -2
- package/dist/ai-types.d.ts +4 -4
- package/dist/ai-types.js +1 -1
- package/dist/{client-CZBVDDoO.js → client-9Ld2_lnt.js} +2 -2
- package/dist/{client-CZBVDDoO.js.map → client-9Ld2_lnt.js.map} +1 -1
- package/dist/{client-C-nwz-3N.d.ts → client-B17XUTV7.d.ts} +20 -20
- package/dist/{client-DjR-lC16.js → client-BfiZ3HQd.js} +3 -3
- package/dist/{client-DjR-lC16.js.map → client-BfiZ3HQd.js.map} +1 -1
- package/dist/{client-CmMi85Sj.d.ts → client-CbWe9FBd.d.ts} +10 -10
- package/dist/client.d.ts +8 -8
- package/dist/client.js +2 -2
- package/dist/codemode/ai.js +5 -5
- package/dist/{do-oauth-client-provider-B2jr6UNq.js → do-oauth-client-provider-CswoD5Lu.js} +2 -2
- package/dist/{do-oauth-client-provider-B2jr6UNq.js.map → do-oauth-client-provider-CswoD5Lu.js.map} +1 -1
- package/dist/{do-oauth-client-provider-CCwGwnrA.d.ts → do-oauth-client-provider-DGc5pP0l.d.ts} +2 -2
- package/dist/{index-DWJSBMbz.d.ts → index-B6MjW6n-.d.ts} +49 -225
- package/dist/{index-W4JUkafc.d.ts → index-DhJCaDWd.d.ts} +7 -3
- package/dist/index.d.ts +36 -50
- package/dist/index.js +6 -6
- package/dist/mcp/client.d.ts +3 -3
- package/dist/mcp/client.js +1 -1
- package/dist/mcp/do-oauth-client-provider.d.ts +1 -1
- package/dist/mcp/do-oauth-client-provider.js +1 -1
- package/dist/mcp/index.d.ts +129 -7
- package/dist/mcp/index.js +1234 -6
- package/dist/mcp/index.js.map +1 -0
- package/dist/{mcp-BEwaCsxO.d.ts → mcp-Dw5vDrY8.d.ts} +2 -2
- package/dist/observability/index.d.ts +2 -2
- package/dist/observability/index.js +5 -5
- package/dist/{react-GnTP-a01.d.ts → react-CRBsIQ1z.d.ts} +28 -26
- package/dist/react.d.ts +9 -9
- package/dist/react.js +1 -1
- package/dist/{serializable-gtr9YMhp.d.ts → serializable-CymX8ovI.d.ts} +8 -3
- package/dist/serializable.d.ts +5 -5
- package/dist/src-Dz0H9hSU.js +1200 -0
- package/dist/src-Dz0H9hSU.js.map +1 -0
- package/package.json +5 -5
- package/dist/src-tpG9NtHy.js +0 -2457
- package/dist/src-tpG9NtHy.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./ai-types-
|
|
2
|
-
import "./client-
|
|
3
|
-
import "./client-
|
|
4
|
-
import "./do-oauth-client-provider-
|
|
5
|
-
import {
|
|
1
|
+
import "./ai-types-B3aQaFv3.js";
|
|
2
|
+
import "./client-BfiZ3HQd.js";
|
|
3
|
+
import "./client-9Ld2_lnt.js";
|
|
4
|
+
import "./do-oauth-client-provider-CswoD5Lu.js";
|
|
5
|
+
import { a as createCatchAllEmailResolver, c as getCurrentAgent, d as unstable_callable, i as createAddressBasedEmailResolver, l as routeAgentEmail, n as StreamingResponse, o as createHeaderBasedEmailResolver, r as callable, s as getAgentByName, t as Agent, u as routeAgentRequest } from "./src-Dz0H9hSU.js";
|
|
6
6
|
|
|
7
|
-
export { Agent, StreamingResponse,
|
|
7
|
+
export { Agent, StreamingResponse, callable, createAddressBasedEmailResolver, createCatchAllEmailResolver, createHeaderBasedEmailResolver, getAgentByName, getCurrentAgent, routeAgentEmail, routeAgentRequest, unstable_callable };
|
package/dist/mcp/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../mcp-
|
|
3
|
-
import "../do-oauth-client-provider-
|
|
1
|
+
import { i as getNamespacedData, n as MCPClientOAuthCallbackConfig, r as MCPClientOAuthResult, t as MCPClientManager } from "../client-B17XUTV7.js";
|
|
2
|
+
import "../mcp-Dw5vDrY8.js";
|
|
3
|
+
import "../do-oauth-client-provider-DGc5pP0l.js";
|
|
4
4
|
export { MCPClientManager, MCPClientOAuthCallbackConfig, MCPClientOAuthResult, getNamespacedData };
|
package/dist/mcp/client.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as DurableObjectOAuthClientProvider, t as AgentsOAuthProvider } from "../do-oauth-client-provider-DGc5pP0l.js";
|
|
2
2
|
export { AgentsOAuthProvider, DurableObjectOAuthClientProvider };
|
package/dist/mcp/index.d.ts
CHANGED
|
@@ -1,7 +1,129 @@
|
|
|
1
|
-
import { MCPClientOAuthCallbackConfig, MCPClientOAuthResult,
|
|
2
|
-
import "../mcp-
|
|
3
|
-
import "../do-oauth-client-provider-
|
|
4
|
-
import "../index-
|
|
5
|
-
import "../ai-types-
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { c as ServeOptions, d as SSEEdgeClientTransport, n as MCPClientOAuthCallbackConfig, o as BaseTransportType, r as MCPClientOAuthResult, s as MaybePromise, u as StreamableHTTPEdgeClientTransport } from "../client-B17XUTV7.js";
|
|
2
|
+
import "../mcp-Dw5vDrY8.js";
|
|
3
|
+
import "../do-oauth-client-provider-DGc5pP0l.js";
|
|
4
|
+
import "../index-DhJCaDWd.js";
|
|
5
|
+
import "../ai-types-D5YoPrBZ.js";
|
|
6
|
+
import { c as ConnectionContext, s as Connection, t as Agent } from "../index-B6MjW6n-.js";
|
|
7
|
+
import { ElicitRequest, ElicitRequestSchema, ElicitResult, ElicitResult as ElicitResult$1, JSONRPCMessage } from "@modelcontextprotocol/sdk/types.js";
|
|
8
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
9
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
10
|
+
import { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
|
|
11
|
+
|
|
12
|
+
//#region src/mcp/worker-transport.d.ts
|
|
13
|
+
interface WorkerTransportOptions {
|
|
14
|
+
sessionIdGenerator?: () => string;
|
|
15
|
+
enableJsonResponse?: boolean;
|
|
16
|
+
onsessioninitialized?: (sessionId: string) => void;
|
|
17
|
+
}
|
|
18
|
+
declare class WorkerTransport implements Transport {
|
|
19
|
+
private started;
|
|
20
|
+
private initialized;
|
|
21
|
+
private sessionIdGenerator?;
|
|
22
|
+
private enableJsonResponse;
|
|
23
|
+
private onsessioninitialized?;
|
|
24
|
+
private standaloneSseStreamId;
|
|
25
|
+
private streamMapping;
|
|
26
|
+
private requestToStreamMapping;
|
|
27
|
+
private requestResponseMap;
|
|
28
|
+
sessionId?: string;
|
|
29
|
+
onclose?: () => void;
|
|
30
|
+
onerror?: (error: Error) => void;
|
|
31
|
+
onmessage?: (message: JSONRPCMessage) => void;
|
|
32
|
+
constructor(options?: WorkerTransportOptions);
|
|
33
|
+
start(): Promise<void>;
|
|
34
|
+
handleRequest(request: Request, parsedBody?: unknown): Promise<Response>;
|
|
35
|
+
private handleGetRequest;
|
|
36
|
+
private handlePostRequest;
|
|
37
|
+
private handleDeleteRequest;
|
|
38
|
+
private handleOptionsRequest;
|
|
39
|
+
private handleUnsupportedRequest;
|
|
40
|
+
private validateSession;
|
|
41
|
+
close(): Promise<void>;
|
|
42
|
+
send(message: JSONRPCMessage): Promise<void>;
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/mcp/handler.d.ts
|
|
46
|
+
interface CreateMcpHandlerOptions extends WorkerTransportOptions {
|
|
47
|
+
/**
|
|
48
|
+
* The route path that this MCP handler should respond to.
|
|
49
|
+
* If specified, the handler will only process requests that match this route.
|
|
50
|
+
* @default "/mcp"
|
|
51
|
+
*/
|
|
52
|
+
route?: string;
|
|
53
|
+
}
|
|
54
|
+
type OAuthExecutionContext = ExecutionContext & {
|
|
55
|
+
props?: Record<string, unknown>;
|
|
56
|
+
};
|
|
57
|
+
declare function experimental_createMcpHandler(server: McpServer | Server, options?: CreateMcpHandlerOptions): (request: Request, env: unknown, ctx: ExecutionContext) => Promise<Response>;
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region src/mcp/auth-context.d.ts
|
|
60
|
+
interface McpAuthContext {
|
|
61
|
+
props: Record<string, unknown>;
|
|
62
|
+
}
|
|
63
|
+
declare function getMcpAuthContext(): McpAuthContext | undefined;
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/mcp/index.d.ts
|
|
66
|
+
declare abstract class McpAgent<Env = unknown, State = unknown, Props extends Record<string, unknown> = Record<string, unknown>> extends Agent<Env, State, Props> {
|
|
67
|
+
private _transport?;
|
|
68
|
+
props?: Props;
|
|
69
|
+
abstract server: MaybePromise<McpServer | Server>;
|
|
70
|
+
abstract init(): Promise<void>;
|
|
71
|
+
setInitializeRequest(initializeRequest: JSONRPCMessage): Promise<void>;
|
|
72
|
+
getInitializeRequest(): Promise<JSONRPCMessage | undefined>;
|
|
73
|
+
/** Read the transport type for this agent.
|
|
74
|
+
* This relies on the naming scheme being `sse:${sessionId}`
|
|
75
|
+
* or `streamable-http:${sessionId}`.
|
|
76
|
+
*/
|
|
77
|
+
getTransportType(): BaseTransportType;
|
|
78
|
+
/** Read the sessionId for this agent.
|
|
79
|
+
* This relies on the naming scheme being `sse:${sessionId}`
|
|
80
|
+
* or `streamable-http:${sessionId}`.
|
|
81
|
+
*/
|
|
82
|
+
getSessionId(): string;
|
|
83
|
+
/** Get the unique WebSocket. SSE transport only. */
|
|
84
|
+
private getWebSocket;
|
|
85
|
+
/** Returns a new transport matching the type of the Agent. */
|
|
86
|
+
private initTransport;
|
|
87
|
+
/** Update and store the props */
|
|
88
|
+
updateProps(props?: Props): Promise<void>;
|
|
89
|
+
reinitializeServer(): Promise<void>;
|
|
90
|
+
/** Sets up the MCP transport and server every time the Agent is started.*/
|
|
91
|
+
onStart(props?: Props): Promise<void>;
|
|
92
|
+
/** Validates new WebSocket connections. */
|
|
93
|
+
onConnect(conn: Connection, {
|
|
94
|
+
request: req
|
|
95
|
+
}: ConnectionContext): Promise<void>;
|
|
96
|
+
/** Handles MCP Messages for the legacy SSE transport. */
|
|
97
|
+
onSSEMcpMessage(_sessionId: string, messageBody: unknown): Promise<Error | null>;
|
|
98
|
+
/** Elicit user input with a message and schema */
|
|
99
|
+
elicitInput(params: {
|
|
100
|
+
message: string;
|
|
101
|
+
requestedSchema: unknown;
|
|
102
|
+
}): Promise<ElicitResult$1>;
|
|
103
|
+
/** Wait for elicitation response through storage polling */
|
|
104
|
+
private _waitForElicitationResponse;
|
|
105
|
+
/** Handle elicitation responses */
|
|
106
|
+
private _handleElicitationResponse;
|
|
107
|
+
/** Return a handler for the given path for this MCP.
|
|
108
|
+
* Defaults to Streamable HTTP transport.
|
|
109
|
+
*/
|
|
110
|
+
static serve(path: string, {
|
|
111
|
+
binding,
|
|
112
|
+
corsOptions,
|
|
113
|
+
transport
|
|
114
|
+
}?: ServeOptions): {
|
|
115
|
+
fetch<Env>(this: void, request: Request, env: Env, ctx: ExecutionContext): Promise<Response>;
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Legacy api
|
|
119
|
+
**/
|
|
120
|
+
static mount(path: string, opts?: Omit<ServeOptions, "transport">): {
|
|
121
|
+
fetch<Env>(this: void, request: Request, env: Env, ctx: ExecutionContext): Promise<Response>;
|
|
122
|
+
};
|
|
123
|
+
static serveSSE(path: string, opts?: Omit<ServeOptions, "transport">): {
|
|
124
|
+
fetch<Env>(this: void, request: Request, env: Env, ctx: ExecutionContext): Promise<Response>;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
//#endregion
|
|
128
|
+
export { type CreateMcpHandlerOptions, type ElicitRequest, ElicitRequestSchema, type ElicitResult, type MCPClientOAuthCallbackConfig, type MCPClientOAuthResult, McpAgent, type McpAuthContext, type OAuthExecutionContext, SSEEdgeClientTransport, StreamableHTTPEdgeClientTransport, WorkerTransport, type WorkerTransportOptions, experimental_createMcpHandler, getMcpAuthContext };
|
|
129
|
+
//# sourceMappingURL=index.d.ts.map
|