agents 0.2.31 → 0.2.34
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/README.md +121 -0
- package/dist/ai-chat-agent.d.ts +142 -17
- package/dist/ai-chat-agent.js +346 -40
- package/dist/ai-chat-agent.js.map +1 -1
- package/dist/ai-chat-v5-migration.js +154 -2
- package/dist/ai-chat-v5-migration.js.map +1 -0
- package/dist/ai-react.d.ts +136 -17
- package/dist/ai-react.js +216 -53
- package/dist/ai-react.js.map +1 -1
- package/dist/{ai-types-D_hTbf25.d.ts → ai-types-0OnT3FHg.d.ts} +26 -2
- package/dist/{ai-types-CwgHzwUb.js → ai-types-DEtF_8Km.js} +5 -1
- package/dist/ai-types-DEtF_8Km.js.map +1 -0
- package/dist/ai-types.d.ts +1 -1
- package/dist/ai-types.js +1 -1
- package/dist/{client-DfIOsabL.d.ts → client-BINtT7y-.d.ts} +9 -9
- package/dist/{client-ClORm6f0.d.ts → client-CdM5I962.d.ts} +2 -2
- package/dist/{client-CcyhkGfN.js → client-DjTPRM8-.js} +2 -2
- package/dist/{client-CcyhkGfN.js.map → client-DjTPRM8-.js.map} +1 -1
- package/dist/client.d.ts +1 -2
- package/dist/client.js +1 -2
- package/dist/codemode/ai.js +3 -4
- package/dist/codemode/ai.js.map +1 -1
- package/dist/{context-_sPQqJWv.d.ts → context-DcbQ8o7k.d.ts} +1 -1
- package/dist/context.d.ts +1 -1
- package/dist/{do-oauth-client-provider-B-ryFIPr.d.ts → do-oauth-client-provider--To1Tsjj.d.ts} +1 -1
- package/dist/{index-DPJ32qQn.d.ts → index-CfZ2mfMI.d.ts} +12 -13
- package/dist/{index-CyDpAVHZ.d.ts → index-DLuxm_9W.d.ts} +2 -2
- package/dist/index.d.ts +4 -7
- package/dist/index.js +2 -3
- package/dist/mcp/client.d.ts +1 -3
- package/dist/mcp/do-oauth-client-provider.d.ts +1 -1
- package/dist/mcp/index.d.ts +5 -8
- package/dist/mcp/index.js +3 -3
- package/dist/mcp/index.js.map +1 -1
- package/dist/{mcp-CzbSsLfc.d.ts → mcp-CPSfGUgd.d.ts} +1 -1
- package/dist/observability/index.d.ts +1 -2
- package/dist/observability/index.js +2 -3
- package/dist/react.d.ts +133 -14
- package/dist/react.js +50 -57
- package/dist/react.js.map +1 -1
- package/dist/schedule.d.ts +18 -72
- package/dist/{serializable-C4GLimgv.d.ts → serializable-Crsj26mx.d.ts} +1 -1
- package/dist/serializable.d.ts +1 -1
- package/dist/{src-BmbDclOA.js → src-BZDh910Z.js} +3 -3
- package/dist/src-BZDh910Z.js.map +1 -0
- package/package.json +28 -13
- package/dist/ai-chat-v5-migration-DguhuLKF.js +0 -155
- package/dist/ai-chat-v5-migration-DguhuLKF.js.map +0 -1
- package/dist/ai-types-CwgHzwUb.js.map +0 -1
- package/dist/react-DTzwSLAh.d.ts +0 -137
- package/dist/src-BmbDclOA.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { n as AgentEmail } from "./context-
|
|
1
|
+
import { n as AgentEmail } from "./context-DcbQ8o7k.js";
|
|
2
2
|
import {
|
|
3
3
|
h as TransportType,
|
|
4
4
|
t as MCPClientManager,
|
|
5
5
|
u as MCPConnectionState
|
|
6
|
-
} from "./client-
|
|
7
|
-
import { t as Observability } from "./index-
|
|
8
|
-
import { n as MessageType } from "./ai-types-
|
|
6
|
+
} from "./client-BINtT7y-.js";
|
|
7
|
+
import { t as Observability } from "./index-DLuxm_9W.js";
|
|
8
|
+
import { n as MessageType } from "./ai-types-0OnT3FHg.js";
|
|
9
9
|
import {
|
|
10
10
|
Connection,
|
|
11
11
|
Connection as Connection$1,
|
|
@@ -21,7 +21,6 @@ import {
|
|
|
21
21
|
ServerCapabilities,
|
|
22
22
|
Tool
|
|
23
23
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
24
|
-
import { env } from "cloudflare:workers";
|
|
25
24
|
|
|
26
25
|
//#region src/index.d.ts
|
|
27
26
|
|
|
@@ -91,7 +90,7 @@ declare const unstable_callable: (metadata?: CallableMetadata) => void;
|
|
|
91
90
|
type QueueItem<T = string> = {
|
|
92
91
|
id: string;
|
|
93
92
|
payload: T;
|
|
94
|
-
callback: keyof Agent<
|
|
93
|
+
callback: keyof Agent<Cloudflare.Env>;
|
|
95
94
|
created_at: number;
|
|
96
95
|
};
|
|
97
96
|
/**
|
|
@@ -159,7 +158,7 @@ type MCPServer = {
|
|
|
159
158
|
capabilities: ServerCapabilities | null;
|
|
160
159
|
};
|
|
161
160
|
declare function getCurrentAgent<
|
|
162
|
-
T extends Agent<
|
|
161
|
+
T extends Agent<Cloudflare.Env> = Agent<Cloudflare.Env>
|
|
163
162
|
>(): {
|
|
164
163
|
agent: T | undefined;
|
|
165
164
|
connection: Connection | undefined;
|
|
@@ -172,7 +171,7 @@ declare function getCurrentAgent<
|
|
|
172
171
|
* @template State State type to store within the Agent
|
|
173
172
|
*/
|
|
174
173
|
declare class Agent<
|
|
175
|
-
Env =
|
|
174
|
+
Env extends Cloudflare.Env = Cloudflare.Env,
|
|
176
175
|
State = unknown,
|
|
177
176
|
Props extends Record<string, unknown> = Record<string, unknown>
|
|
178
177
|
> extends Server<Env, Props> {
|
|
@@ -418,7 +417,7 @@ declare class Agent<
|
|
|
418
417
|
* Namespace for creating Agent instances
|
|
419
418
|
* @template Agentic Type of the Agent class
|
|
420
419
|
*/
|
|
421
|
-
type AgentNamespace<Agentic extends Agent<
|
|
420
|
+
type AgentNamespace<Agentic extends Agent<Cloudflare.Env>> =
|
|
422
421
|
DurableObjectNamespace<Agentic>;
|
|
423
422
|
/**
|
|
424
423
|
* Agent's durable context
|
|
@@ -485,7 +484,7 @@ type EmailRoutingOptions<Env> = AgentOptions<Env> & {
|
|
|
485
484
|
* @param options The options for routing the email
|
|
486
485
|
* @returns A promise that resolves when the email has been routed
|
|
487
486
|
*/
|
|
488
|
-
declare function routeAgentEmail<Env>(
|
|
487
|
+
declare function routeAgentEmail<Env extends Cloudflare.Env = Cloudflare.Env>(
|
|
489
488
|
email: ForwardableEmailMessage,
|
|
490
489
|
env: Env,
|
|
491
490
|
options: EmailRoutingOptions<Env>
|
|
@@ -511,8 +510,8 @@ type EmailSendOptions = {
|
|
|
511
510
|
* @returns Promise resolving to an Agent instance stub
|
|
512
511
|
*/
|
|
513
512
|
declare function getAgentByName<
|
|
514
|
-
Env,
|
|
515
|
-
T extends Agent<Env>,
|
|
513
|
+
Env extends Cloudflare.Env = Cloudflare.Env,
|
|
514
|
+
T extends Agent<Env> = Agent<Env>,
|
|
516
515
|
Props extends Record<string, unknown> = Record<string, unknown>
|
|
517
516
|
>(
|
|
518
517
|
namespace: AgentNamespace<T>,
|
|
@@ -574,4 +573,4 @@ export {
|
|
|
574
573
|
callable as x,
|
|
575
574
|
StreamingResponse as y
|
|
576
575
|
};
|
|
577
|
-
//# sourceMappingURL=index-
|
|
576
|
+
//# sourceMappingURL=index-CfZ2mfMI.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as BaseEvent, t as MCPObservabilityEvent } from "./mcp-
|
|
1
|
+
import { n as BaseEvent, t as MCPObservabilityEvent } from "./mcp-CPSfGUgd.js";
|
|
2
2
|
|
|
3
3
|
//#region src/observability/agent.d.ts
|
|
4
4
|
|
|
@@ -55,4 +55,4 @@ export {
|
|
|
55
55
|
genericObservability as r,
|
|
56
56
|
Observability as t
|
|
57
57
|
};
|
|
58
|
-
//# sourceMappingURL=index-
|
|
58
|
+
//# sourceMappingURL=index-DLuxm_9W.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { n as AgentEmail } from "./context-
|
|
2
|
-
import { h as TransportType } from "./client-
|
|
3
|
-
import "./
|
|
4
|
-
import "./do-oauth-client-provider-B-ryFIPr.js";
|
|
5
|
-
import "./index-CyDpAVHZ.js";
|
|
6
|
-
import "./ai-types-D_hTbf25.js";
|
|
1
|
+
import { n as AgentEmail } from "./context-DcbQ8o7k.js";
|
|
2
|
+
import { h as TransportType } from "./client-BINtT7y-.js";
|
|
3
|
+
import "./ai-types-0OnT3FHg.js";
|
|
7
4
|
import {
|
|
8
5
|
C as createCatchAllEmailResolver,
|
|
9
6
|
D as routeAgentEmail,
|
|
@@ -34,7 +31,7 @@ import {
|
|
|
34
31
|
w as createHeaderBasedEmailResolver,
|
|
35
32
|
x as callable,
|
|
36
33
|
y as StreamingResponse
|
|
37
|
-
} from "./index-
|
|
34
|
+
} from "./index-CfZ2mfMI.js";
|
|
38
35
|
export {
|
|
39
36
|
Agent,
|
|
40
37
|
AgentContext,
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import "./context-BkKbAa1R.js";
|
|
2
|
-
import "./
|
|
3
|
-
import "./client-CcyhkGfN.js";
|
|
2
|
+
import "./client-DjTPRM8-.js";
|
|
4
3
|
import "./client-QZa2Rq0l.js";
|
|
5
4
|
import "./do-oauth-client-provider-B1fVIshX.js";
|
|
6
|
-
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-
|
|
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-BZDh910Z.js";
|
|
7
6
|
|
|
8
7
|
export { Agent, StreamingResponse, callable, createAddressBasedEmailResolver, createCatchAllEmailResolver, createHeaderBasedEmailResolver, getAgentByName, getCurrentAgent, routeAgentEmail, routeAgentRequest, unstable_callable };
|
package/dist/mcp/client.d.ts
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import { a as MCPConnectionResult, c as RegisterServerOptions, i as MCPClientOAuthResult, l as getNamespacedData, n as MCPClientManagerOptions, o as MCPDiscoverResult, r as MCPClientOAuthCallbackConfig, s as MCPServerOptions, t as MCPClientManager } from "../client-
|
|
2
|
-
import "../mcp-CzbSsLfc.js";
|
|
3
|
-
import "../do-oauth-client-provider-B-ryFIPr.js";
|
|
1
|
+
import { a as MCPConnectionResult, c as RegisterServerOptions, i as MCPClientOAuthResult, l as getNamespacedData, n as MCPClientManagerOptions, o as MCPDiscoverResult, r as MCPClientOAuthCallbackConfig, s as MCPServerOptions, t as MCPClientManager } from "../client-BINtT7y-.js";
|
|
4
2
|
export { MCPClientManager, MCPClientManagerOptions, MCPClientOAuthCallbackConfig, MCPClientOAuthResult, MCPConnectionResult, MCPDiscoverResult, MCPServerOptions, RegisterServerOptions, getNamespacedData };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as DurableObjectOAuthClientProvider, t as AgentsOAuthProvider } from "../do-oauth-client-provider
|
|
1
|
+
import { n as DurableObjectOAuthClientProvider, t as AgentsOAuthProvider } from "../do-oauth-client-provider--To1Tsjj.js";
|
|
2
2
|
export { AgentsOAuthProvider, DurableObjectOAuthClientProvider };
|
package/dist/mcp/index.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import "../context-
|
|
2
|
-
import { a as MCPConnectionResult, d as BaseTransportType, f as CORSOptions, i as MCPClientOAuthResult, m as ServeOptions, o as MCPDiscoverResult, p as MaybePromise, r as MCPClientOAuthCallbackConfig, s as MCPServerOptions } from "../client-
|
|
3
|
-
import "../
|
|
4
|
-
import "../
|
|
5
|
-
import "../index-CyDpAVHZ.js";
|
|
6
|
-
import "../ai-types-D_hTbf25.js";
|
|
7
|
-
import { o as Connection, s as ConnectionContext, t as Agent } from "../index-DPJ32qQn.js";
|
|
1
|
+
import "../context-DcbQ8o7k.js";
|
|
2
|
+
import { a as MCPConnectionResult, d as BaseTransportType, f as CORSOptions, i as MCPClientOAuthResult, m as ServeOptions, o as MCPDiscoverResult, p as MaybePromise, r as MCPClientOAuthCallbackConfig, s as MCPServerOptions } from "../client-BINtT7y-.js";
|
|
3
|
+
import "../ai-types-0OnT3FHg.js";
|
|
4
|
+
import { o as Connection, s as ConnectionContext, t as Agent } from "../index-CfZ2mfMI.js";
|
|
8
5
|
import { SSEClientTransport, SSEClientTransportOptions } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
9
6
|
import { StreamableHTTPClientTransport, StreamableHTTPClientTransportOptions } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
10
7
|
import { ElicitRequest, ElicitRequestSchema, ElicitResult, ElicitResult as ElicitResult$1, JSONRPCMessage, MessageExtraInfo } from "@modelcontextprotocol/sdk/types.js";
|
|
@@ -136,7 +133,7 @@ declare function createMcpHandler(server: McpServer | Server, options?: CreateMc
|
|
|
136
133
|
declare function experimental_createMcpHandler(server: McpServer | Server, options?: CreateMcpHandlerOptions): (request: Request, env: unknown, ctx: ExecutionContext) => Promise<Response>;
|
|
137
134
|
//#endregion
|
|
138
135
|
//#region src/mcp/index.d.ts
|
|
139
|
-
declare abstract class McpAgent<Env =
|
|
136
|
+
declare abstract class McpAgent<Env extends Cloudflare.Env = Cloudflare.Env, State = unknown, Props extends Record<string, unknown> = Record<string, unknown>> extends Agent<Env, State, Props> {
|
|
140
137
|
private _transport?;
|
|
141
138
|
props?: Props;
|
|
142
139
|
abstract server: MaybePromise<McpServer | Server>;
|
package/dist/mcp/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "../context-BkKbAa1R.js";
|
|
2
|
-
import { t as MessageType } from "../ai-types-
|
|
3
|
-
import "../client-
|
|
2
|
+
import { t as MessageType } from "../ai-types-DEtF_8Km.js";
|
|
3
|
+
import "../client-DjTPRM8-.js";
|
|
4
4
|
import "../client-QZa2Rq0l.js";
|
|
5
5
|
import "../do-oauth-client-provider-B1fVIshX.js";
|
|
6
|
-
import { c as getCurrentAgent, s as getAgentByName, t as Agent } from "../src-
|
|
6
|
+
import { c as getCurrentAgent, s as getAgentByName, t as Agent } from "../src-BZDh910Z.js";
|
|
7
7
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
8
8
|
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
9
9
|
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|