agents 0.2.9 → 0.2.11
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 +15 -18
- package/dist/ai-chat-agent.js +544 -656
- package/dist/ai-chat-agent.js.map +1 -1
- package/dist/ai-chat-v5-migration-gdyLiTd8.js +155 -0
- package/dist/ai-chat-v5-migration-gdyLiTd8.js.map +1 -0
- package/dist/ai-chat-v5-migration.d.ts +7 -4
- package/dist/ai-chat-v5-migration.js +3 -20
- package/dist/ai-react.d.ts +14 -24
- package/dist/ai-react.js +257 -343
- package/dist/ai-react.js.map +1 -1
- package/dist/ai-types-B0GBFDwi.js +20 -0
- package/dist/ai-types-B0GBFDwi.js.map +1 -0
- package/dist/ai-types-BWW4umHY.d.ts +95 -0
- package/dist/ai-types.d.ts +6 -92
- package/dist/ai-types.js +3 -8
- package/dist/client-C-u-lCFT.d.ts +5311 -0
- package/dist/client-CmMi85Sj.d.ts +104 -0
- package/dist/client-WbaRgKYN.js +788 -0
- package/dist/client-WbaRgKYN.js.map +1 -0
- package/dist/client-zS-OCVJA.js +117 -0
- package/dist/client-zS-OCVJA.js.map +1 -0
- package/dist/client.d.ts +11 -92
- package/dist/client.js +4 -13
- package/dist/codemode/ai.d.ts +19 -17
- package/dist/codemode/ai.js +90 -5139
- package/dist/codemode/ai.js.map +1 -1
- package/dist/do-oauth-client-provider-B2jr6UNq.js +93 -0
- package/dist/do-oauth-client-provider-B2jr6UNq.js.map +1 -0
- package/dist/do-oauth-client-provider-CCwGwnrA.d.ts +55 -0
- package/dist/index-DWcUTPtX.d.ts +558 -0
- package/dist/index-W4JUkafc.d.ts +54 -0
- package/dist/index.d.ts +55 -542
- package/dist/index.js +7 -32
- package/dist/mcp/client.d.ts +4 -12
- package/dist/mcp/client.js +3 -10
- package/dist/mcp/do-oauth-client-provider.d.ts +2 -42
- package/dist/mcp/do-oauth-client-provider.js +3 -8
- package/dist/mcp/index.d.ts +72 -76
- package/dist/mcp/index.js +830 -1082
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/x402.d.ts +22 -27
- package/dist/mcp/x402.js +186 -3187
- package/dist/mcp/x402.js.map +1 -1
- package/dist/{mcp-BH1fJeiU.d.ts → mcp-BEwaCsxO.d.ts} +6 -3
- package/dist/observability/index.d.ts +3 -34
- package/dist/observability/index.js +7 -12
- package/dist/react-B8BT6PYZ.d.ts +113 -0
- package/dist/react.d.ts +10 -127
- package/dist/react.js +173 -200
- package/dist/react.js.map +1 -1
- package/dist/schedule.d.ts +13 -10
- package/dist/schedule.js +43 -33
- package/dist/schedule.js.map +1 -1
- package/dist/serializable-gtr9YMhp.d.ts +34 -0
- package/dist/serializable.d.ts +7 -32
- package/dist/serializable.js +1 -1
- package/dist/src-C9xZ0CrH.js +1179 -0
- package/dist/src-C9xZ0CrH.js.map +1 -0
- package/package.json +9 -3
- package/dist/_esm-LV5FJ3HK.js +0 -3922
- package/dist/_esm-LV5FJ3HK.js.map +0 -1
- package/dist/ai-chat-v5-migration.js.map +0 -1
- package/dist/ai-types.js.map +0 -1
- package/dist/ccip-CMBYN64O.js +0 -15
- package/dist/ccip-CMBYN64O.js.map +0 -1
- package/dist/chunk-5Y6BEZDY.js +0 -276
- package/dist/chunk-5Y6BEZDY.js.map +0 -1
- package/dist/chunk-BER7KXUJ.js +0 -18
- package/dist/chunk-BER7KXUJ.js.map +0 -1
- package/dist/chunk-C2OEBJZ2.js +0 -113
- package/dist/chunk-C2OEBJZ2.js.map +0 -1
- package/dist/chunk-JJBFIGUC.js +0 -5202
- package/dist/chunk-JJBFIGUC.js.map +0 -1
- package/dist/chunk-PR4QN5HX.js +0 -43
- package/dist/chunk-PR4QN5HX.js.map +0 -1
- package/dist/chunk-QEVM4BVL.js +0 -116
- package/dist/chunk-QEVM4BVL.js.map +0 -1
- package/dist/chunk-TYAY6AU6.js +0 -159
- package/dist/chunk-TYAY6AU6.js.map +0 -1
- package/dist/chunk-UJVEAURM.js +0 -150
- package/dist/chunk-UJVEAURM.js.map +0 -1
- package/dist/chunk-XGMKNUJA.js +0 -1343
- package/dist/chunk-XGMKNUJA.js.map +0 -1
- package/dist/chunk-ZMMHNOMZ.js +0 -942
- package/dist/chunk-ZMMHNOMZ.js.map +0 -1
- package/dist/client-C8tswVoM.d.ts +0 -5248
- package/dist/client.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/mcp/client.js.map +0 -1
- package/dist/mcp/do-oauth-client-provider.js.map +0 -1
- package/dist/observability/index.js.map +0 -1
- package/dist/secp256k1-M22GZP2U.js +0 -2193
- package/dist/secp256k1-M22GZP2U.js.map +0 -1
- package/dist/serializable.js.map +0 -1
|
@@ -1,42 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
interface AgentsOAuthProvider extends OAuthClientProvider {
|
|
5
|
-
authUrl: string | undefined;
|
|
6
|
-
clientId: string | undefined;
|
|
7
|
-
serverId: string | undefined;
|
|
8
|
-
}
|
|
9
|
-
declare class DurableObjectOAuthClientProvider implements AgentsOAuthProvider {
|
|
10
|
-
storage: DurableObjectStorage;
|
|
11
|
-
clientName: string;
|
|
12
|
-
baseRedirectUrl: string;
|
|
13
|
-
private _authUrl_;
|
|
14
|
-
private _serverId_;
|
|
15
|
-
private _clientId_;
|
|
16
|
-
constructor(storage: DurableObjectStorage, clientName: string, baseRedirectUrl: string);
|
|
17
|
-
get clientMetadata(): OAuthClientMetadata;
|
|
18
|
-
get clientUri(): string;
|
|
19
|
-
get redirectUrl(): string;
|
|
20
|
-
get clientId(): string;
|
|
21
|
-
set clientId(clientId_: string);
|
|
22
|
-
get serverId(): string;
|
|
23
|
-
set serverId(serverId_: string);
|
|
24
|
-
keyPrefix(clientId: string): string;
|
|
25
|
-
clientInfoKey(clientId: string): string;
|
|
26
|
-
clientInformation(): Promise<OAuthClientInformation | undefined>;
|
|
27
|
-
saveClientInformation(clientInformation: OAuthClientInformationFull): Promise<void>;
|
|
28
|
-
tokenKey(clientId: string): string;
|
|
29
|
-
tokens(): Promise<OAuthTokens | undefined>;
|
|
30
|
-
saveTokens(tokens: OAuthTokens): Promise<void>;
|
|
31
|
-
get authUrl(): string | undefined;
|
|
32
|
-
/**
|
|
33
|
-
* Because this operates on the server side (but we need browser auth), we send this url back to the user
|
|
34
|
-
* and require user interact to initiate the redirect flow
|
|
35
|
-
*/
|
|
36
|
-
redirectToAuthorization(authUrl: URL): Promise<void>;
|
|
37
|
-
codeVerifierKey(clientId: string): string;
|
|
38
|
-
saveCodeVerifier(verifier: string): Promise<void>;
|
|
39
|
-
codeVerifier(): Promise<string>;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export { type AgentsOAuthProvider, DurableObjectOAuthClientProvider };
|
|
1
|
+
import { AgentsOAuthProvider, DurableObjectOAuthClientProvider } from "../do-oauth-client-provider-CCwGwnrA.js";
|
|
2
|
+
export { AgentsOAuthProvider, DurableObjectOAuthClientProvider };
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import "../chunk-PR4QN5HX.js";
|
|
5
|
-
export {
|
|
6
|
-
DurableObjectOAuthClientProvider
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=do-oauth-client-provider.js.map
|
|
1
|
+
import { DurableObjectOAuthClientProvider } from "../do-oauth-client-provider-B2jr6UNq.js";
|
|
2
|
+
|
|
3
|
+
export { DurableObjectOAuthClientProvider };
|
package/dist/mcp/index.d.ts
CHANGED
|
@@ -1,79 +1,75 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import '@modelcontextprotocol/sdk/client/index.js';
|
|
11
|
-
import '../observability/index.js';
|
|
12
|
-
import '../mcp-BH1fJeiU.js';
|
|
13
|
-
import '../ai-types.js';
|
|
14
|
-
import 'ai';
|
|
15
|
-
import 'zod';
|
|
16
|
-
import '@modelcontextprotocol/sdk/shared/protocol.js';
|
|
17
|
-
import '@modelcontextprotocol/sdk/client/sse.js';
|
|
18
|
-
import '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
19
|
-
import './do-oauth-client-provider.js';
|
|
20
|
-
import '@modelcontextprotocol/sdk/client/auth.js';
|
|
21
|
-
import '@modelcontextprotocol/sdk/shared/auth.js';
|
|
1
|
+
import { BaseTransportType, MCPClientOAuthCallbackConfig, MCPClientOAuthResult, MaybePromise, SSEEdgeClientTransport, ServeOptions, StreamableHTTPEdgeClientTransport } from "../client-C-u-lCFT.js";
|
|
2
|
+
import "../mcp-BEwaCsxO.js";
|
|
3
|
+
import "../do-oauth-client-provider-CCwGwnrA.js";
|
|
4
|
+
import "../index-W4JUkafc.js";
|
|
5
|
+
import "../ai-types-BWW4umHY.js";
|
|
6
|
+
import { Agent, Connection, ConnectionContext } from "../index-DWcUTPtX.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";
|
|
22
10
|
|
|
11
|
+
//#region src/mcp/index.d.ts
|
|
23
12
|
declare abstract class McpAgent<Env = unknown, State = unknown, Props extends Record<string, unknown> = Record<string, unknown>> extends Agent<Env, State, Props> {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
13
|
+
private _transport?;
|
|
14
|
+
props?: Props;
|
|
15
|
+
abstract server: MaybePromise<McpServer | Server>;
|
|
16
|
+
abstract init(): Promise<void>;
|
|
17
|
+
setInitializeRequest(initializeRequest: JSONRPCMessage): Promise<void>;
|
|
18
|
+
getInitializeRequest(): Promise<JSONRPCMessage | undefined>;
|
|
19
|
+
/** Read the transport type for this agent.
|
|
20
|
+
* This relies on the naming scheme being `sse:${sessionId}`
|
|
21
|
+
* or `streamable-http:${sessionId}`.
|
|
22
|
+
*/
|
|
23
|
+
getTransportType(): BaseTransportType;
|
|
24
|
+
/** Read the sessionId for this agent.
|
|
25
|
+
* This relies on the naming scheme being `sse:${sessionId}`
|
|
26
|
+
* or `streamable-http:${sessionId}`.
|
|
27
|
+
*/
|
|
28
|
+
getSessionId(): string;
|
|
29
|
+
/** Get the unique WebSocket. SSE transport only. */
|
|
30
|
+
private getWebSocket;
|
|
31
|
+
/** Returns a new transport matching the type of the Agent. */
|
|
32
|
+
private initTransport;
|
|
33
|
+
/** Update and store the props */
|
|
34
|
+
updateProps(props?: Props): Promise<void>;
|
|
35
|
+
reinitializeServer(): Promise<void>;
|
|
36
|
+
/** Sets up the MCP transport and server every time the Agent is started.*/
|
|
37
|
+
onStart(props?: Props): Promise<void>;
|
|
38
|
+
/** Validates new WebSocket connections. */
|
|
39
|
+
onConnect(conn: Connection, {
|
|
40
|
+
request: req
|
|
41
|
+
}: ConnectionContext): Promise<void>;
|
|
42
|
+
/** Handles MCP Messages for the legacy SSE transport. */
|
|
43
|
+
onSSEMcpMessage(_sessionId: string, messageBody: unknown): Promise<Error | null>;
|
|
44
|
+
/** Elicit user input with a message and schema */
|
|
45
|
+
elicitInput(params: {
|
|
46
|
+
message: string;
|
|
47
|
+
requestedSchema: unknown;
|
|
48
|
+
}): Promise<ElicitResult$1>;
|
|
49
|
+
/** Wait for elicitation response through storage polling */
|
|
50
|
+
private _waitForElicitationResponse;
|
|
51
|
+
/** Handle elicitation responses */
|
|
52
|
+
private _handleElicitationResponse;
|
|
53
|
+
/** Return a handler for the given path for this MCP.
|
|
54
|
+
* Defaults to Streamable HTTP transport.
|
|
55
|
+
*/
|
|
56
|
+
static serve(path: string, {
|
|
57
|
+
binding,
|
|
58
|
+
corsOptions,
|
|
59
|
+
transport
|
|
60
|
+
}?: ServeOptions): {
|
|
61
|
+
fetch<Env>(this: void, request: Request, env: Env, ctx: ExecutionContext): Promise<Response>;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Legacy api
|
|
65
|
+
**/
|
|
66
|
+
static mount(path: string, opts?: Omit<ServeOptions, "transport">): {
|
|
67
|
+
fetch<Env>(this: void, request: Request, env: Env, ctx: ExecutionContext): Promise<Response>;
|
|
68
|
+
};
|
|
69
|
+
static serveSSE(path: string, opts?: Omit<ServeOptions, "transport">): {
|
|
70
|
+
fetch<Env>(this: void, request: Request, env: Env, ctx: ExecutionContext): Promise<Response>;
|
|
71
|
+
};
|
|
77
72
|
}
|
|
78
|
-
|
|
79
|
-
export { McpAgent };
|
|
73
|
+
//#endregion
|
|
74
|
+
export { type ElicitRequest, ElicitRequestSchema, type ElicitResult, type MCPClientOAuthCallbackConfig, type MCPClientOAuthResult, McpAgent, SSEEdgeClientTransport, StreamableHTTPEdgeClientTransport };
|
|
75
|
+
//# sourceMappingURL=index.d.ts.map
|