agents 0.2.34 → 0.3.0
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 +35 -2
- package/dist/ai-chat-agent.js +26 -0
- package/dist/ai-chat-agent.js.map +1 -1
- package/dist/ai-react.d.ts +75 -3
- package/dist/ai-react.js +60 -1
- package/dist/ai-react.js.map +1 -1
- package/dist/{client-BINtT7y-.d.ts → client-DFotUKH_.d.ts} +2 -2
- package/dist/codemode/ai.js +1 -1
- package/dist/codemode/ai.js.map +1 -1
- package/dist/{index-CfZ2mfMI.d.ts → index-CT2tCrLr.d.ts} +4 -3
- package/dist/index.d.ts +2 -2
- package/dist/mcp/client.d.ts +1 -1
- package/dist/mcp/index.d.ts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/schedule.d.ts +73 -19
- package/dist/schedule.js +1 -1
- package/dist/schedule.js.map +1 -1
- package/dist/src-BZDh910Z.js.map +1 -1
- package/package.json +7 -7
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
h as TransportType,
|
|
4
4
|
t as MCPClientManager,
|
|
5
5
|
u as MCPConnectionState
|
|
6
|
-
} from "./client-
|
|
6
|
+
} from "./client-DFotUKH_.js";
|
|
7
7
|
import { t as Observability } from "./index-DLuxm_9W.js";
|
|
8
8
|
import { n as MessageType } from "./ai-types-0OnT3FHg.js";
|
|
9
9
|
import {
|
|
@@ -416,6 +416,7 @@ declare class Agent<
|
|
|
416
416
|
/**
|
|
417
417
|
* Namespace for creating Agent instances
|
|
418
418
|
* @template Agentic Type of the Agent class
|
|
419
|
+
* @deprecated Use DurableObjectNamespace instead
|
|
419
420
|
*/
|
|
420
421
|
type AgentNamespace<Agentic extends Agent<Cloudflare.Env>> =
|
|
421
422
|
DurableObjectNamespace<Agentic>;
|
|
@@ -514,7 +515,7 @@ declare function getAgentByName<
|
|
|
514
515
|
T extends Agent<Env> = Agent<Env>,
|
|
515
516
|
Props extends Record<string, unknown> = Record<string, unknown>
|
|
516
517
|
>(
|
|
517
|
-
namespace:
|
|
518
|
+
namespace: DurableObjectNamespace<T>,
|
|
518
519
|
name: string,
|
|
519
520
|
options?: {
|
|
520
521
|
jurisdiction?: DurableObjectJurisdiction;
|
|
@@ -573,4 +574,4 @@ export {
|
|
|
573
574
|
callable as x,
|
|
574
575
|
StreamingResponse as y
|
|
575
576
|
};
|
|
576
|
-
//# sourceMappingURL=index-
|
|
577
|
+
//# sourceMappingURL=index-CT2tCrLr.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as AgentEmail } from "./context-DcbQ8o7k.js";
|
|
2
|
-
import { h as TransportType } from "./client-
|
|
2
|
+
import { h as TransportType } from "./client-DFotUKH_.js";
|
|
3
3
|
import "./ai-types-0OnT3FHg.js";
|
|
4
4
|
import {
|
|
5
5
|
C as createCatchAllEmailResolver,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
w as createHeaderBasedEmailResolver,
|
|
32
32
|
x as callable,
|
|
33
33
|
y as StreamingResponse
|
|
34
|
-
} from "./index-
|
|
34
|
+
} from "./index-CT2tCrLr.js";
|
|
35
35
|
export {
|
|
36
36
|
Agent,
|
|
37
37
|
AgentContext,
|
package/dist/mcp/client.d.ts
CHANGED
|
@@ -1,2 +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-
|
|
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-DFotUKH_.js";
|
|
2
2
|
export { MCPClientManager, MCPClientManagerOptions, MCPClientOAuthCallbackConfig, MCPClientOAuthResult, MCPConnectionResult, MCPDiscoverResult, MCPServerOptions, RegisterServerOptions, getNamespacedData };
|
package/dist/mcp/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
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-
|
|
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-DFotUKH_.js";
|
|
3
3
|
import "../ai-types-0OnT3FHg.js";
|
|
4
|
-
import { o as Connection, s as ConnectionContext, t as Agent } from "../index-
|
|
4
|
+
import { o as Connection, s as ConnectionContext, t as Agent } from "../index-CT2tCrLr.js";
|
|
5
5
|
import { SSEClientTransport, SSEClientTransportOptions } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
6
6
|
import { StreamableHTTPClientTransport, StreamableHTTPClientTransportOptions } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
7
7
|
import { ElicitRequest, ElicitRequestSchema, ElicitResult, ElicitResult as ElicitResult$1, JSONRPCMessage, MessageExtraInfo } from "@modelcontextprotocol/sdk/types.js";
|
package/dist/react.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./context-DcbQ8o7k.js";
|
|
2
|
-
import "./client-
|
|
2
|
+
import "./client-DFotUKH_.js";
|
|
3
3
|
import "./ai-types-0OnT3FHg.js";
|
|
4
|
-
import { p as MCPServersState, t as Agent } from "./index-
|
|
4
|
+
import { p as MCPServersState, t as Agent } from "./index-CT2tCrLr.js";
|
|
5
5
|
import { n as RPCMethod, t as Method } from "./serializable-Crsj26mx.js";
|
|
6
6
|
import { i as StreamOptions } from "./client-CdM5I962.js";
|
|
7
7
|
import { PartySocket } from "partysocket";
|
package/dist/schedule.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
1
|
+
import { z } from "zod/v3";
|
|
2
2
|
|
|
3
3
|
//#region src/schedule.d.ts
|
|
4
4
|
|
|
@@ -23,19 +23,46 @@ declare const scheduleSchema: z.ZodObject<
|
|
|
23
23
|
when: z.ZodObject<
|
|
24
24
|
{
|
|
25
25
|
cron: z.ZodOptional<z.ZodString>;
|
|
26
|
-
date: z.ZodOptional<z.
|
|
26
|
+
date: z.ZodOptional<z.ZodDate>;
|
|
27
27
|
delayInSeconds: z.ZodOptional<z.ZodNumber>;
|
|
28
|
-
type: z.ZodEnum<
|
|
29
|
-
cron: "cron";
|
|
30
|
-
scheduled: "scheduled";
|
|
31
|
-
delayed: "delayed";
|
|
32
|
-
"no-schedule": "no-schedule";
|
|
33
|
-
}>;
|
|
28
|
+
type: z.ZodEnum<["scheduled", "delayed", "cron", "no-schedule"]>;
|
|
34
29
|
},
|
|
35
|
-
|
|
30
|
+
"strip",
|
|
31
|
+
z.ZodTypeAny,
|
|
32
|
+
{
|
|
33
|
+
type: "cron" | "scheduled" | "delayed" | "no-schedule";
|
|
34
|
+
date?: Date | undefined;
|
|
35
|
+
cron?: string | undefined;
|
|
36
|
+
delayInSeconds?: number | undefined;
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
type: "cron" | "scheduled" | "delayed" | "no-schedule";
|
|
40
|
+
date?: Date | undefined;
|
|
41
|
+
cron?: string | undefined;
|
|
42
|
+
delayInSeconds?: number | undefined;
|
|
43
|
+
}
|
|
36
44
|
>;
|
|
37
45
|
},
|
|
38
|
-
|
|
46
|
+
"strip",
|
|
47
|
+
z.ZodTypeAny,
|
|
48
|
+
{
|
|
49
|
+
description: string;
|
|
50
|
+
when: {
|
|
51
|
+
type: "cron" | "scheduled" | "delayed" | "no-schedule";
|
|
52
|
+
date?: Date | undefined;
|
|
53
|
+
cron?: string | undefined;
|
|
54
|
+
delayInSeconds?: number | undefined;
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
description: string;
|
|
59
|
+
when: {
|
|
60
|
+
type: "cron" | "scheduled" | "delayed" | "no-schedule";
|
|
61
|
+
date?: Date | undefined;
|
|
62
|
+
cron?: string | undefined;
|
|
63
|
+
delayInSeconds?: number | undefined;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
39
66
|
>;
|
|
40
67
|
/**
|
|
41
68
|
* The type for the schedule prompt
|
|
@@ -51,19 +78,46 @@ declare const unstable_scheduleSchema: z.ZodObject<
|
|
|
51
78
|
when: z.ZodObject<
|
|
52
79
|
{
|
|
53
80
|
cron: z.ZodOptional<z.ZodString>;
|
|
54
|
-
date: z.ZodOptional<z.
|
|
81
|
+
date: z.ZodOptional<z.ZodDate>;
|
|
55
82
|
delayInSeconds: z.ZodOptional<z.ZodNumber>;
|
|
56
|
-
type: z.ZodEnum<
|
|
57
|
-
cron: "cron";
|
|
58
|
-
scheduled: "scheduled";
|
|
59
|
-
delayed: "delayed";
|
|
60
|
-
"no-schedule": "no-schedule";
|
|
61
|
-
}>;
|
|
83
|
+
type: z.ZodEnum<["scheduled", "delayed", "cron", "no-schedule"]>;
|
|
62
84
|
},
|
|
63
|
-
|
|
85
|
+
"strip",
|
|
86
|
+
z.ZodTypeAny,
|
|
87
|
+
{
|
|
88
|
+
type: "cron" | "scheduled" | "delayed" | "no-schedule";
|
|
89
|
+
date?: Date | undefined;
|
|
90
|
+
cron?: string | undefined;
|
|
91
|
+
delayInSeconds?: number | undefined;
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
type: "cron" | "scheduled" | "delayed" | "no-schedule";
|
|
95
|
+
date?: Date | undefined;
|
|
96
|
+
cron?: string | undefined;
|
|
97
|
+
delayInSeconds?: number | undefined;
|
|
98
|
+
}
|
|
64
99
|
>;
|
|
65
100
|
},
|
|
66
|
-
|
|
101
|
+
"strip",
|
|
102
|
+
z.ZodTypeAny,
|
|
103
|
+
{
|
|
104
|
+
description: string;
|
|
105
|
+
when: {
|
|
106
|
+
type: "cron" | "scheduled" | "delayed" | "no-schedule";
|
|
107
|
+
date?: Date | undefined;
|
|
108
|
+
cron?: string | undefined;
|
|
109
|
+
delayInSeconds?: number | undefined;
|
|
110
|
+
};
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
description: string;
|
|
114
|
+
when: {
|
|
115
|
+
type: "cron" | "scheduled" | "delayed" | "no-schedule";
|
|
116
|
+
date?: Date | undefined;
|
|
117
|
+
cron?: string | undefined;
|
|
118
|
+
delayInSeconds?: number | undefined;
|
|
119
|
+
};
|
|
120
|
+
}
|
|
67
121
|
>;
|
|
68
122
|
//#endregion
|
|
69
123
|
export {
|
package/dist/schedule.js
CHANGED
package/dist/schedule.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule.js","names":[],"sources":["../src/schedule.ts"],"sourcesContent":["import { z } from \"zod\";\n\n/**\n * Get the schedule prompt for a given event\n * @param event - The event to get the schedule prompt for\n * @returns The schedule prompt\n */\nexport function getSchedulePrompt(event: { date: Date }) {\n return `\n[Schedule Parser Component]\n\nCurrent time: ${event.date.toUTCString()}\n\nThis component parses natural language scheduling requests into a structured format. It extracts:\n1. A clean task description (without timing information)\n2. Scheduling details in one of these formats:\n - scheduled: Specific date/time events\n - delayed: Relative time delays (in seconds)\n - cron: Recurring patterns\n - no-schedule: Tasks without timing\n\nRules:\n- Task descriptions should be clean and focused on the action\n- Use numbers (0-6) for days in cron patterns (0=Sunday)\n- For recurring tasks, use standard cron syntax\n- For relative times, convert to seconds\n- For specific dates, use the current time as reference\n\nExample outputs:\n{\n \"description\": \"meeting with team\",\n \"when\": {\n \"type\": \"scheduled\",\n \"date\": \"tomorrow at 14:00\"\n }\n}\n\n{\n \"description\": \"backup database\",\n \"when\": {\n \"type\": \"cron\",\n \"cron\": \"0 0 * * *\"\n }\n}\n\n{\n \"description\": \"send report\",\n \"when\": {\n \"type\": \"delayed\",\n \"delayInSeconds\": 1800\n }\n}\n\n[End Schedule Parser Component]\n`;\n}\n\nlet didWarnAboutUnstableGetSchedulePrompt = false;\n\n/**\n * @deprecated this has been renamed to getSchedulePrompt, and unstable_getSchedulePrompt will be removed in the next major version\n * @param event - The event to get the schedule prompt for\n * @returns The schedule prompt\n */\nexport function unstable_getSchedulePrompt(event: { date: Date }) {\n if (!didWarnAboutUnstableGetSchedulePrompt) {\n didWarnAboutUnstableGetSchedulePrompt = true;\n console.warn(\n \"unstable_getSchedulePrompt is deprecated, use getSchedulePrompt instead. unstable_getSchedulePrompt will be removed in the next major version.\"\n );\n }\n return getSchedulePrompt(event);\n}\n\n/**\n * The schema for the schedule prompt\n */\nexport const scheduleSchema = z.object({\n description: z.string().describe(\"A description of the task\"),\n when: z.object({\n cron: z\n .string()\n .optional()\n .describe(\n \"execute task on a recurring interval specified as cron syntax (only use if the type is cron)\"\n ),\n date: z.coerce\n .date()\n .optional()\n .describe(\n \"execute task at the specified date and time (only use if the type is scheduled)\"\n ),\n delayInSeconds: z\n .number()\n .optional()\n .describe(\n \"execute task after a delay in seconds (only use if the type is delayed)\"\n ),\n type: z\n .enum([\"scheduled\", \"delayed\", \"cron\", \"no-schedule\"])\n .describe(\"The type of scheduling details\")\n })\n});\n\n/**\n * The type for the schedule prompt\n */\nexport type Schedule = z.infer<typeof scheduleSchema>;\n\n/**\n * @deprecated this has been renamed to scheduleSchema, and unstable_scheduleSchema will be removed in the next major version\n * @returns The schedule schema\n */\nexport const unstable_scheduleSchema = scheduleSchema;\n"],"mappings":";;;;;;;;AAOA,SAAgB,kBAAkB,OAAuB;AACvD,QAAO;;;gBAGO,MAAM,KAAK,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CzC,IAAI,wCAAwC;;;;;;AAO5C,SAAgB,2BAA2B,OAAuB;AAChE,KAAI,CAAC,uCAAuC;AAC1C,0CAAwC;AACxC,UAAQ,KACN,iJACD;;AAEH,QAAO,kBAAkB,MAAM;;;;;AAMjC,MAAa,iBAAiB,EAAE,OAAO;CACrC,aAAa,EAAE,QAAQ,CAAC,SAAS,4BAA4B;CAC7D,MAAM,EAAE,OAAO;EACb,MAAM,EACH,QAAQ,CACR,UAAU,CACV,SACC,+FACD;EACH,MAAM,EAAE,OACL,MAAM,CACN,UAAU,CACV,SACC,kFACD;EACH,gBAAgB,EACb,QAAQ,CACR,UAAU,CACV,SACC,0EACD;EACH,MAAM,EACH,KAAK;GAAC;GAAa;GAAW;GAAQ;GAAc,CAAC,CACrD,SAAS,iCAAiC;EAC9C,CAAC;CACH,CAAC;;;;;AAWF,MAAa,0BAA0B"}
|
|
1
|
+
{"version":3,"file":"schedule.js","names":[],"sources":["../src/schedule.ts"],"sourcesContent":["import { z } from \"zod/v3\";\n\n/**\n * Get the schedule prompt for a given event\n * @param event - The event to get the schedule prompt for\n * @returns The schedule prompt\n */\nexport function getSchedulePrompt(event: { date: Date }) {\n return `\n[Schedule Parser Component]\n\nCurrent time: ${event.date.toUTCString()}\n\nThis component parses natural language scheduling requests into a structured format. It extracts:\n1. A clean task description (without timing information)\n2. Scheduling details in one of these formats:\n - scheduled: Specific date/time events\n - delayed: Relative time delays (in seconds)\n - cron: Recurring patterns\n - no-schedule: Tasks without timing\n\nRules:\n- Task descriptions should be clean and focused on the action\n- Use numbers (0-6) for days in cron patterns (0=Sunday)\n- For recurring tasks, use standard cron syntax\n- For relative times, convert to seconds\n- For specific dates, use the current time as reference\n\nExample outputs:\n{\n \"description\": \"meeting with team\",\n \"when\": {\n \"type\": \"scheduled\",\n \"date\": \"tomorrow at 14:00\"\n }\n}\n\n{\n \"description\": \"backup database\",\n \"when\": {\n \"type\": \"cron\",\n \"cron\": \"0 0 * * *\"\n }\n}\n\n{\n \"description\": \"send report\",\n \"when\": {\n \"type\": \"delayed\",\n \"delayInSeconds\": 1800\n }\n}\n\n[End Schedule Parser Component]\n`;\n}\n\nlet didWarnAboutUnstableGetSchedulePrompt = false;\n\n/**\n * @deprecated this has been renamed to getSchedulePrompt, and unstable_getSchedulePrompt will be removed in the next major version\n * @param event - The event to get the schedule prompt for\n * @returns The schedule prompt\n */\nexport function unstable_getSchedulePrompt(event: { date: Date }) {\n if (!didWarnAboutUnstableGetSchedulePrompt) {\n didWarnAboutUnstableGetSchedulePrompt = true;\n console.warn(\n \"unstable_getSchedulePrompt is deprecated, use getSchedulePrompt instead. unstable_getSchedulePrompt will be removed in the next major version.\"\n );\n }\n return getSchedulePrompt(event);\n}\n\n/**\n * The schema for the schedule prompt\n */\nexport const scheduleSchema = z.object({\n description: z.string().describe(\"A description of the task\"),\n when: z.object({\n cron: z\n .string()\n .optional()\n .describe(\n \"execute task on a recurring interval specified as cron syntax (only use if the type is cron)\"\n ),\n date: z.coerce\n .date()\n .optional()\n .describe(\n \"execute task at the specified date and time (only use if the type is scheduled)\"\n ),\n delayInSeconds: z\n .number()\n .optional()\n .describe(\n \"execute task after a delay in seconds (only use if the type is delayed)\"\n ),\n type: z\n .enum([\"scheduled\", \"delayed\", \"cron\", \"no-schedule\"])\n .describe(\"The type of scheduling details\")\n })\n});\n\n/**\n * The type for the schedule prompt\n */\nexport type Schedule = z.infer<typeof scheduleSchema>;\n\n/**\n * @deprecated this has been renamed to scheduleSchema, and unstable_scheduleSchema will be removed in the next major version\n * @returns The schedule schema\n */\nexport const unstable_scheduleSchema = scheduleSchema;\n"],"mappings":";;;;;;;;AAOA,SAAgB,kBAAkB,OAAuB;AACvD,QAAO;;;gBAGO,MAAM,KAAK,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CzC,IAAI,wCAAwC;;;;;;AAO5C,SAAgB,2BAA2B,OAAuB;AAChE,KAAI,CAAC,uCAAuC;AAC1C,0CAAwC;AACxC,UAAQ,KACN,iJACD;;AAEH,QAAO,kBAAkB,MAAM;;;;;AAMjC,MAAa,iBAAiB,EAAE,OAAO;CACrC,aAAa,EAAE,QAAQ,CAAC,SAAS,4BAA4B;CAC7D,MAAM,EAAE,OAAO;EACb,MAAM,EACH,QAAQ,CACR,UAAU,CACV,SACC,+FACD;EACH,MAAM,EAAE,OACL,MAAM,CACN,UAAU,CACV,SACC,kFACD;EACH,gBAAgB,EACb,QAAQ,CACR,UAAU,CACV,SACC,0EACD;EACH,MAAM,EACH,KAAK;GAAC;GAAa;GAAW;GAAQ;GAAc,CAAC,CACrD,SAAS,iCAAiC;EAC9C,CAAC;CACH,CAAC;;;;;AAWF,MAAa,0BAA0B"}
|