@dexto/tools-scheduler 1.6.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.
Files changed (70) hide show
  1. package/LICENSE +44 -0
  2. package/dist/error-codes.cjs +44 -0
  3. package/dist/error-codes.d.cts +21 -0
  4. package/dist/error-codes.d.ts +21 -0
  5. package/dist/error-codes.js +20 -0
  6. package/dist/errors.cjs +163 -0
  7. package/dist/errors.d.cts +64 -0
  8. package/dist/errors.d.ts +64 -0
  9. package/dist/errors.js +138 -0
  10. package/dist/executor.cjs +161 -0
  11. package/dist/executor.d.cts +46 -0
  12. package/dist/executor.d.ts +46 -0
  13. package/dist/executor.js +137 -0
  14. package/dist/index.cjs +89 -0
  15. package/dist/index.d.cts +19 -0
  16. package/dist/index.d.ts +19 -0
  17. package/dist/index.js +56 -0
  18. package/dist/manager.cjs +461 -0
  19. package/dist/manager.d.cts +113 -0
  20. package/dist/manager.d.ts +113 -0
  21. package/dist/manager.js +430 -0
  22. package/dist/schemas.cjs +138 -0
  23. package/dist/schemas.d.cts +263 -0
  24. package/dist/schemas.d.ts +263 -0
  25. package/dist/schemas.js +105 -0
  26. package/dist/storage.cjs +249 -0
  27. package/dist/storage.d.cts +62 -0
  28. package/dist/storage.d.ts +62 -0
  29. package/dist/storage.js +225 -0
  30. package/dist/tool-provider.cjs +239 -0
  31. package/dist/tool-provider.d.cts +34 -0
  32. package/dist/tool-provider.d.ts +34 -0
  33. package/dist/tool-provider.js +212 -0
  34. package/dist/tool-types.cjs +16 -0
  35. package/dist/tool-types.d.cts +9 -0
  36. package/dist/tool-types.d.ts +9 -0
  37. package/dist/tool-types.js +0 -0
  38. package/dist/tools/create-schedule.cjs +75 -0
  39. package/dist/tools/create-schedule.d.cts +14 -0
  40. package/dist/tools/create-schedule.d.ts +14 -0
  41. package/dist/tools/create-schedule.js +51 -0
  42. package/dist/tools/delete-schedule.cjs +45 -0
  43. package/dist/tools/delete-schedule.d.cts +14 -0
  44. package/dist/tools/delete-schedule.d.ts +14 -0
  45. package/dist/tools/delete-schedule.js +21 -0
  46. package/dist/tools/get-history.cjs +63 -0
  47. package/dist/tools/get-history.d.cts +14 -0
  48. package/dist/tools/get-history.d.ts +14 -0
  49. package/dist/tools/get-history.js +39 -0
  50. package/dist/tools/get-schedule.cjs +68 -0
  51. package/dist/tools/get-schedule.d.cts +14 -0
  52. package/dist/tools/get-schedule.d.ts +14 -0
  53. package/dist/tools/get-schedule.js +44 -0
  54. package/dist/tools/list-schedules.cjs +67 -0
  55. package/dist/tools/list-schedules.d.cts +14 -0
  56. package/dist/tools/list-schedules.d.ts +14 -0
  57. package/dist/tools/list-schedules.js +43 -0
  58. package/dist/tools/trigger-schedule.cjs +56 -0
  59. package/dist/tools/trigger-schedule.d.cts +14 -0
  60. package/dist/tools/trigger-schedule.d.ts +14 -0
  61. package/dist/tools/trigger-schedule.js +32 -0
  62. package/dist/tools/update-schedule.cjs +53 -0
  63. package/dist/tools/update-schedule.d.cts +14 -0
  64. package/dist/tools/update-schedule.d.ts +14 -0
  65. package/dist/tools/update-schedule.js +29 -0
  66. package/dist/types.cjs +16 -0
  67. package/dist/types.d.cts +72 -0
  68. package/dist/types.d.ts +72 -0
  69. package/dist/types.js +0 -0
  70. package/package.json +41 -0
@@ -0,0 +1,263 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Zod schemas for scheduler configuration and validation
5
+ */
6
+
7
+ /**
8
+ * Session mode schema - determines how conversation context is managed
9
+ */
10
+ declare const ScheduleSessionModeSchema: z.ZodEnum<["ephemeral", "dedicated", "inherit", "fixed"]>;
11
+ type ScheduleSessionMode = z.output<typeof ScheduleSessionModeSchema>;
12
+ /**
13
+ * Scheduler tool provider configuration schema
14
+ */
15
+ declare const SchedulerToolsConfigSchema: z.ZodObject<{
16
+ type: z.ZodLiteral<"scheduler-tools">;
17
+ timezone: z.ZodDefault<z.ZodString>;
18
+ maxSchedules: z.ZodDefault<z.ZodNumber>;
19
+ executionTimeout: z.ZodDefault<z.ZodNumber>;
20
+ maxExecutionHistory: z.ZodDefault<z.ZodNumber>;
21
+ }, "strict", z.ZodTypeAny, {
22
+ type: "scheduler-tools";
23
+ timezone: string;
24
+ maxSchedules: number;
25
+ executionTimeout: number;
26
+ maxExecutionHistory: number;
27
+ }, {
28
+ type: "scheduler-tools";
29
+ timezone?: string | undefined;
30
+ maxSchedules?: number | undefined;
31
+ executionTimeout?: number | undefined;
32
+ maxExecutionHistory?: number | undefined;
33
+ }>;
34
+ type SchedulerToolsConfig = z.output<typeof SchedulerToolsConfigSchema>;
35
+ /**
36
+ * Input schema for creating schedules via tools
37
+ *
38
+ * Session Mode Examples:
39
+ * - Standalone report: sessionMode='ephemeral' (fresh context each time)
40
+ * - Ongoing project check: sessionMode='dedicated' (builds history)
41
+ * - "Remind me in 1 hour": sessionMode='inherit' (continues this conversation)
42
+ * - Cross-thread task: sessionMode='fixed', sessionId='target-session-id'
43
+ */
44
+ declare const CreateScheduleInputSchema: z.ZodEffects<z.ZodObject<{
45
+ name: z.ZodString;
46
+ cronExpression: z.ZodString;
47
+ instruction: z.ZodString;
48
+ timezone: z.ZodOptional<z.ZodString>;
49
+ enabled: z.ZodDefault<z.ZodBoolean>;
50
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
51
+ workspacePath: z.ZodNullable<z.ZodOptional<z.ZodString>>;
52
+ sessionMode: z.ZodDefault<z.ZodEnum<["ephemeral", "dedicated", "inherit", "fixed"]>>;
53
+ sessionId: z.ZodOptional<z.ZodString>;
54
+ targetAgentId: z.ZodOptional<z.ZodString>;
55
+ }, "strict", z.ZodTypeAny, {
56
+ name: string;
57
+ cronExpression: string;
58
+ instruction: string;
59
+ enabled: boolean;
60
+ sessionMode: "ephemeral" | "dedicated" | "inherit" | "fixed";
61
+ timezone?: string | undefined;
62
+ metadata?: Record<string, unknown> | undefined;
63
+ workspacePath?: string | null | undefined;
64
+ sessionId?: string | undefined;
65
+ targetAgentId?: string | undefined;
66
+ }, {
67
+ name: string;
68
+ cronExpression: string;
69
+ instruction: string;
70
+ timezone?: string | undefined;
71
+ enabled?: boolean | undefined;
72
+ metadata?: Record<string, unknown> | undefined;
73
+ workspacePath?: string | null | undefined;
74
+ sessionMode?: "ephemeral" | "dedicated" | "inherit" | "fixed" | undefined;
75
+ sessionId?: string | undefined;
76
+ targetAgentId?: string | undefined;
77
+ }>, {
78
+ name: string;
79
+ cronExpression: string;
80
+ instruction: string;
81
+ enabled: boolean;
82
+ sessionMode: "ephemeral" | "dedicated" | "inherit" | "fixed";
83
+ timezone?: string | undefined;
84
+ metadata?: Record<string, unknown> | undefined;
85
+ workspacePath?: string | null | undefined;
86
+ sessionId?: string | undefined;
87
+ targetAgentId?: string | undefined;
88
+ }, {
89
+ name: string;
90
+ cronExpression: string;
91
+ instruction: string;
92
+ timezone?: string | undefined;
93
+ enabled?: boolean | undefined;
94
+ metadata?: Record<string, unknown> | undefined;
95
+ workspacePath?: string | null | undefined;
96
+ sessionMode?: "ephemeral" | "dedicated" | "inherit" | "fixed" | undefined;
97
+ sessionId?: string | undefined;
98
+ targetAgentId?: string | undefined;
99
+ }>;
100
+ type CreateScheduleInput = z.output<typeof CreateScheduleInputSchema>;
101
+ /**
102
+ * Input schema for updating schedules
103
+ */
104
+ declare const UpdateScheduleInputSchema: z.ZodEffects<z.ZodObject<{
105
+ name: z.ZodOptional<z.ZodString>;
106
+ cronExpression: z.ZodOptional<z.ZodString>;
107
+ instruction: z.ZodOptional<z.ZodString>;
108
+ timezone: z.ZodOptional<z.ZodString>;
109
+ enabled: z.ZodOptional<z.ZodBoolean>;
110
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
111
+ workspacePath: z.ZodNullable<z.ZodOptional<z.ZodString>>;
112
+ sessionMode: z.ZodOptional<z.ZodEnum<["ephemeral", "dedicated", "inherit", "fixed"]>>;
113
+ sessionId: z.ZodOptional<z.ZodString>;
114
+ targetAgentId: z.ZodOptional<z.ZodString>;
115
+ } & {
116
+ scheduleId: z.ZodString;
117
+ }, "strict", z.ZodTypeAny, {
118
+ scheduleId: string;
119
+ timezone?: string | undefined;
120
+ name?: string | undefined;
121
+ cronExpression?: string | undefined;
122
+ instruction?: string | undefined;
123
+ enabled?: boolean | undefined;
124
+ metadata?: Record<string, unknown> | undefined;
125
+ workspacePath?: string | null | undefined;
126
+ sessionMode?: "ephemeral" | "dedicated" | "inherit" | "fixed" | undefined;
127
+ sessionId?: string | undefined;
128
+ targetAgentId?: string | undefined;
129
+ }, {
130
+ scheduleId: string;
131
+ timezone?: string | undefined;
132
+ name?: string | undefined;
133
+ cronExpression?: string | undefined;
134
+ instruction?: string | undefined;
135
+ enabled?: boolean | undefined;
136
+ metadata?: Record<string, unknown> | undefined;
137
+ workspacePath?: string | null | undefined;
138
+ sessionMode?: "ephemeral" | "dedicated" | "inherit" | "fixed" | undefined;
139
+ sessionId?: string | undefined;
140
+ targetAgentId?: string | undefined;
141
+ }>, {
142
+ scheduleId: string;
143
+ timezone?: string | undefined;
144
+ name?: string | undefined;
145
+ cronExpression?: string | undefined;
146
+ instruction?: string | undefined;
147
+ enabled?: boolean | undefined;
148
+ metadata?: Record<string, unknown> | undefined;
149
+ workspacePath?: string | null | undefined;
150
+ sessionMode?: "ephemeral" | "dedicated" | "inherit" | "fixed" | undefined;
151
+ sessionId?: string | undefined;
152
+ targetAgentId?: string | undefined;
153
+ }, {
154
+ scheduleId: string;
155
+ timezone?: string | undefined;
156
+ name?: string | undefined;
157
+ cronExpression?: string | undefined;
158
+ instruction?: string | undefined;
159
+ enabled?: boolean | undefined;
160
+ metadata?: Record<string, unknown> | undefined;
161
+ workspacePath?: string | null | undefined;
162
+ sessionMode?: "ephemeral" | "dedicated" | "inherit" | "fixed" | undefined;
163
+ sessionId?: string | undefined;
164
+ targetAgentId?: string | undefined;
165
+ }>;
166
+ type UpdateScheduleInput = z.output<typeof UpdateScheduleInputSchema>;
167
+ /**
168
+ * Schema for update fields only (used by manager)
169
+ */
170
+ declare const UpdateScheduleFieldsOnlySchema: z.ZodObject<{
171
+ name: z.ZodOptional<z.ZodString>;
172
+ cronExpression: z.ZodOptional<z.ZodString>;
173
+ instruction: z.ZodOptional<z.ZodString>;
174
+ timezone: z.ZodOptional<z.ZodString>;
175
+ enabled: z.ZodOptional<z.ZodBoolean>;
176
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
177
+ workspacePath: z.ZodNullable<z.ZodOptional<z.ZodString>>;
178
+ sessionMode: z.ZodOptional<z.ZodEnum<["ephemeral", "dedicated", "inherit", "fixed"]>>;
179
+ sessionId: z.ZodOptional<z.ZodString>;
180
+ targetAgentId: z.ZodOptional<z.ZodString>;
181
+ }, "strict", z.ZodTypeAny, {
182
+ timezone?: string | undefined;
183
+ name?: string | undefined;
184
+ cronExpression?: string | undefined;
185
+ instruction?: string | undefined;
186
+ enabled?: boolean | undefined;
187
+ metadata?: Record<string, unknown> | undefined;
188
+ workspacePath?: string | null | undefined;
189
+ sessionMode?: "ephemeral" | "dedicated" | "inherit" | "fixed" | undefined;
190
+ sessionId?: string | undefined;
191
+ targetAgentId?: string | undefined;
192
+ }, {
193
+ timezone?: string | undefined;
194
+ name?: string | undefined;
195
+ cronExpression?: string | undefined;
196
+ instruction?: string | undefined;
197
+ enabled?: boolean | undefined;
198
+ metadata?: Record<string, unknown> | undefined;
199
+ workspacePath?: string | null | undefined;
200
+ sessionMode?: "ephemeral" | "dedicated" | "inherit" | "fixed" | undefined;
201
+ sessionId?: string | undefined;
202
+ targetAgentId?: string | undefined;
203
+ }>;
204
+ /**
205
+ * Input schema for getting a schedule
206
+ */
207
+ declare const GetScheduleInputSchema: z.ZodObject<{
208
+ scheduleId: z.ZodString;
209
+ }, "strict", z.ZodTypeAny, {
210
+ scheduleId: string;
211
+ }, {
212
+ scheduleId: string;
213
+ }>;
214
+ type GetScheduleInput = z.output<typeof GetScheduleInputSchema>;
215
+ /**
216
+ * Input schema for deleting a schedule
217
+ */
218
+ declare const DeleteScheduleInputSchema: z.ZodObject<{
219
+ scheduleId: z.ZodString;
220
+ }, "strict", z.ZodTypeAny, {
221
+ scheduleId: string;
222
+ }, {
223
+ scheduleId: string;
224
+ }>;
225
+ type DeleteScheduleInput = z.output<typeof DeleteScheduleInputSchema>;
226
+ /**
227
+ * Input schema for triggering a schedule
228
+ */
229
+ declare const TriggerScheduleInputSchema: z.ZodObject<{
230
+ scheduleId: z.ZodString;
231
+ }, "strict", z.ZodTypeAny, {
232
+ scheduleId: string;
233
+ }, {
234
+ scheduleId: string;
235
+ }>;
236
+ type TriggerScheduleInput = z.output<typeof TriggerScheduleInputSchema>;
237
+ /**
238
+ * Input schema for getting schedule history
239
+ */
240
+ declare const GetScheduleHistoryInputSchema: z.ZodObject<{
241
+ scheduleId: z.ZodString;
242
+ limit: z.ZodOptional<z.ZodNumber>;
243
+ }, "strict", z.ZodTypeAny, {
244
+ scheduleId: string;
245
+ limit?: number | undefined;
246
+ }, {
247
+ scheduleId: string;
248
+ limit?: number | undefined;
249
+ }>;
250
+ type GetScheduleHistoryInput = z.output<typeof GetScheduleHistoryInputSchema>;
251
+ /**
252
+ * Input schema for listing schedules
253
+ */
254
+ declare const ListSchedulesInputSchema: z.ZodObject<{
255
+ enabled: z.ZodOptional<z.ZodBoolean>;
256
+ }, "strict", z.ZodTypeAny, {
257
+ enabled?: boolean | undefined;
258
+ }, {
259
+ enabled?: boolean | undefined;
260
+ }>;
261
+ type ListSchedulesInput = z.output<typeof ListSchedulesInputSchema>;
262
+
263
+ export { type CreateScheduleInput, CreateScheduleInputSchema, type DeleteScheduleInput, DeleteScheduleInputSchema, type GetScheduleHistoryInput, GetScheduleHistoryInputSchema, type GetScheduleInput, GetScheduleInputSchema, type ListSchedulesInput, ListSchedulesInputSchema, type ScheduleSessionMode, ScheduleSessionModeSchema, type SchedulerToolsConfig, SchedulerToolsConfigSchema, type TriggerScheduleInput, TriggerScheduleInputSchema, UpdateScheduleFieldsOnlySchema, type UpdateScheduleInput, UpdateScheduleInputSchema };
@@ -0,0 +1,263 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Zod schemas for scheduler configuration and validation
5
+ */
6
+
7
+ /**
8
+ * Session mode schema - determines how conversation context is managed
9
+ */
10
+ declare const ScheduleSessionModeSchema: z.ZodEnum<["ephemeral", "dedicated", "inherit", "fixed"]>;
11
+ type ScheduleSessionMode = z.output<typeof ScheduleSessionModeSchema>;
12
+ /**
13
+ * Scheduler tool provider configuration schema
14
+ */
15
+ declare const SchedulerToolsConfigSchema: z.ZodObject<{
16
+ type: z.ZodLiteral<"scheduler-tools">;
17
+ timezone: z.ZodDefault<z.ZodString>;
18
+ maxSchedules: z.ZodDefault<z.ZodNumber>;
19
+ executionTimeout: z.ZodDefault<z.ZodNumber>;
20
+ maxExecutionHistory: z.ZodDefault<z.ZodNumber>;
21
+ }, "strict", z.ZodTypeAny, {
22
+ type: "scheduler-tools";
23
+ timezone: string;
24
+ maxSchedules: number;
25
+ executionTimeout: number;
26
+ maxExecutionHistory: number;
27
+ }, {
28
+ type: "scheduler-tools";
29
+ timezone?: string | undefined;
30
+ maxSchedules?: number | undefined;
31
+ executionTimeout?: number | undefined;
32
+ maxExecutionHistory?: number | undefined;
33
+ }>;
34
+ type SchedulerToolsConfig = z.output<typeof SchedulerToolsConfigSchema>;
35
+ /**
36
+ * Input schema for creating schedules via tools
37
+ *
38
+ * Session Mode Examples:
39
+ * - Standalone report: sessionMode='ephemeral' (fresh context each time)
40
+ * - Ongoing project check: sessionMode='dedicated' (builds history)
41
+ * - "Remind me in 1 hour": sessionMode='inherit' (continues this conversation)
42
+ * - Cross-thread task: sessionMode='fixed', sessionId='target-session-id'
43
+ */
44
+ declare const CreateScheduleInputSchema: z.ZodEffects<z.ZodObject<{
45
+ name: z.ZodString;
46
+ cronExpression: z.ZodString;
47
+ instruction: z.ZodString;
48
+ timezone: z.ZodOptional<z.ZodString>;
49
+ enabled: z.ZodDefault<z.ZodBoolean>;
50
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
51
+ workspacePath: z.ZodNullable<z.ZodOptional<z.ZodString>>;
52
+ sessionMode: z.ZodDefault<z.ZodEnum<["ephemeral", "dedicated", "inherit", "fixed"]>>;
53
+ sessionId: z.ZodOptional<z.ZodString>;
54
+ targetAgentId: z.ZodOptional<z.ZodString>;
55
+ }, "strict", z.ZodTypeAny, {
56
+ name: string;
57
+ cronExpression: string;
58
+ instruction: string;
59
+ enabled: boolean;
60
+ sessionMode: "ephemeral" | "dedicated" | "inherit" | "fixed";
61
+ timezone?: string | undefined;
62
+ metadata?: Record<string, unknown> | undefined;
63
+ workspacePath?: string | null | undefined;
64
+ sessionId?: string | undefined;
65
+ targetAgentId?: string | undefined;
66
+ }, {
67
+ name: string;
68
+ cronExpression: string;
69
+ instruction: string;
70
+ timezone?: string | undefined;
71
+ enabled?: boolean | undefined;
72
+ metadata?: Record<string, unknown> | undefined;
73
+ workspacePath?: string | null | undefined;
74
+ sessionMode?: "ephemeral" | "dedicated" | "inherit" | "fixed" | undefined;
75
+ sessionId?: string | undefined;
76
+ targetAgentId?: string | undefined;
77
+ }>, {
78
+ name: string;
79
+ cronExpression: string;
80
+ instruction: string;
81
+ enabled: boolean;
82
+ sessionMode: "ephemeral" | "dedicated" | "inherit" | "fixed";
83
+ timezone?: string | undefined;
84
+ metadata?: Record<string, unknown> | undefined;
85
+ workspacePath?: string | null | undefined;
86
+ sessionId?: string | undefined;
87
+ targetAgentId?: string | undefined;
88
+ }, {
89
+ name: string;
90
+ cronExpression: string;
91
+ instruction: string;
92
+ timezone?: string | undefined;
93
+ enabled?: boolean | undefined;
94
+ metadata?: Record<string, unknown> | undefined;
95
+ workspacePath?: string | null | undefined;
96
+ sessionMode?: "ephemeral" | "dedicated" | "inherit" | "fixed" | undefined;
97
+ sessionId?: string | undefined;
98
+ targetAgentId?: string | undefined;
99
+ }>;
100
+ type CreateScheduleInput = z.output<typeof CreateScheduleInputSchema>;
101
+ /**
102
+ * Input schema for updating schedules
103
+ */
104
+ declare const UpdateScheduleInputSchema: z.ZodEffects<z.ZodObject<{
105
+ name: z.ZodOptional<z.ZodString>;
106
+ cronExpression: z.ZodOptional<z.ZodString>;
107
+ instruction: z.ZodOptional<z.ZodString>;
108
+ timezone: z.ZodOptional<z.ZodString>;
109
+ enabled: z.ZodOptional<z.ZodBoolean>;
110
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
111
+ workspacePath: z.ZodNullable<z.ZodOptional<z.ZodString>>;
112
+ sessionMode: z.ZodOptional<z.ZodEnum<["ephemeral", "dedicated", "inherit", "fixed"]>>;
113
+ sessionId: z.ZodOptional<z.ZodString>;
114
+ targetAgentId: z.ZodOptional<z.ZodString>;
115
+ } & {
116
+ scheduleId: z.ZodString;
117
+ }, "strict", z.ZodTypeAny, {
118
+ scheduleId: string;
119
+ timezone?: string | undefined;
120
+ name?: string | undefined;
121
+ cronExpression?: string | undefined;
122
+ instruction?: string | undefined;
123
+ enabled?: boolean | undefined;
124
+ metadata?: Record<string, unknown> | undefined;
125
+ workspacePath?: string | null | undefined;
126
+ sessionMode?: "ephemeral" | "dedicated" | "inherit" | "fixed" | undefined;
127
+ sessionId?: string | undefined;
128
+ targetAgentId?: string | undefined;
129
+ }, {
130
+ scheduleId: string;
131
+ timezone?: string | undefined;
132
+ name?: string | undefined;
133
+ cronExpression?: string | undefined;
134
+ instruction?: string | undefined;
135
+ enabled?: boolean | undefined;
136
+ metadata?: Record<string, unknown> | undefined;
137
+ workspacePath?: string | null | undefined;
138
+ sessionMode?: "ephemeral" | "dedicated" | "inherit" | "fixed" | undefined;
139
+ sessionId?: string | undefined;
140
+ targetAgentId?: string | undefined;
141
+ }>, {
142
+ scheduleId: string;
143
+ timezone?: string | undefined;
144
+ name?: string | undefined;
145
+ cronExpression?: string | undefined;
146
+ instruction?: string | undefined;
147
+ enabled?: boolean | undefined;
148
+ metadata?: Record<string, unknown> | undefined;
149
+ workspacePath?: string | null | undefined;
150
+ sessionMode?: "ephemeral" | "dedicated" | "inherit" | "fixed" | undefined;
151
+ sessionId?: string | undefined;
152
+ targetAgentId?: string | undefined;
153
+ }, {
154
+ scheduleId: string;
155
+ timezone?: string | undefined;
156
+ name?: string | undefined;
157
+ cronExpression?: string | undefined;
158
+ instruction?: string | undefined;
159
+ enabled?: boolean | undefined;
160
+ metadata?: Record<string, unknown> | undefined;
161
+ workspacePath?: string | null | undefined;
162
+ sessionMode?: "ephemeral" | "dedicated" | "inherit" | "fixed" | undefined;
163
+ sessionId?: string | undefined;
164
+ targetAgentId?: string | undefined;
165
+ }>;
166
+ type UpdateScheduleInput = z.output<typeof UpdateScheduleInputSchema>;
167
+ /**
168
+ * Schema for update fields only (used by manager)
169
+ */
170
+ declare const UpdateScheduleFieldsOnlySchema: z.ZodObject<{
171
+ name: z.ZodOptional<z.ZodString>;
172
+ cronExpression: z.ZodOptional<z.ZodString>;
173
+ instruction: z.ZodOptional<z.ZodString>;
174
+ timezone: z.ZodOptional<z.ZodString>;
175
+ enabled: z.ZodOptional<z.ZodBoolean>;
176
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
177
+ workspacePath: z.ZodNullable<z.ZodOptional<z.ZodString>>;
178
+ sessionMode: z.ZodOptional<z.ZodEnum<["ephemeral", "dedicated", "inherit", "fixed"]>>;
179
+ sessionId: z.ZodOptional<z.ZodString>;
180
+ targetAgentId: z.ZodOptional<z.ZodString>;
181
+ }, "strict", z.ZodTypeAny, {
182
+ timezone?: string | undefined;
183
+ name?: string | undefined;
184
+ cronExpression?: string | undefined;
185
+ instruction?: string | undefined;
186
+ enabled?: boolean | undefined;
187
+ metadata?: Record<string, unknown> | undefined;
188
+ workspacePath?: string | null | undefined;
189
+ sessionMode?: "ephemeral" | "dedicated" | "inherit" | "fixed" | undefined;
190
+ sessionId?: string | undefined;
191
+ targetAgentId?: string | undefined;
192
+ }, {
193
+ timezone?: string | undefined;
194
+ name?: string | undefined;
195
+ cronExpression?: string | undefined;
196
+ instruction?: string | undefined;
197
+ enabled?: boolean | undefined;
198
+ metadata?: Record<string, unknown> | undefined;
199
+ workspacePath?: string | null | undefined;
200
+ sessionMode?: "ephemeral" | "dedicated" | "inherit" | "fixed" | undefined;
201
+ sessionId?: string | undefined;
202
+ targetAgentId?: string | undefined;
203
+ }>;
204
+ /**
205
+ * Input schema for getting a schedule
206
+ */
207
+ declare const GetScheduleInputSchema: z.ZodObject<{
208
+ scheduleId: z.ZodString;
209
+ }, "strict", z.ZodTypeAny, {
210
+ scheduleId: string;
211
+ }, {
212
+ scheduleId: string;
213
+ }>;
214
+ type GetScheduleInput = z.output<typeof GetScheduleInputSchema>;
215
+ /**
216
+ * Input schema for deleting a schedule
217
+ */
218
+ declare const DeleteScheduleInputSchema: z.ZodObject<{
219
+ scheduleId: z.ZodString;
220
+ }, "strict", z.ZodTypeAny, {
221
+ scheduleId: string;
222
+ }, {
223
+ scheduleId: string;
224
+ }>;
225
+ type DeleteScheduleInput = z.output<typeof DeleteScheduleInputSchema>;
226
+ /**
227
+ * Input schema for triggering a schedule
228
+ */
229
+ declare const TriggerScheduleInputSchema: z.ZodObject<{
230
+ scheduleId: z.ZodString;
231
+ }, "strict", z.ZodTypeAny, {
232
+ scheduleId: string;
233
+ }, {
234
+ scheduleId: string;
235
+ }>;
236
+ type TriggerScheduleInput = z.output<typeof TriggerScheduleInputSchema>;
237
+ /**
238
+ * Input schema for getting schedule history
239
+ */
240
+ declare const GetScheduleHistoryInputSchema: z.ZodObject<{
241
+ scheduleId: z.ZodString;
242
+ limit: z.ZodOptional<z.ZodNumber>;
243
+ }, "strict", z.ZodTypeAny, {
244
+ scheduleId: string;
245
+ limit?: number | undefined;
246
+ }, {
247
+ scheduleId: string;
248
+ limit?: number | undefined;
249
+ }>;
250
+ type GetScheduleHistoryInput = z.output<typeof GetScheduleHistoryInputSchema>;
251
+ /**
252
+ * Input schema for listing schedules
253
+ */
254
+ declare const ListSchedulesInputSchema: z.ZodObject<{
255
+ enabled: z.ZodOptional<z.ZodBoolean>;
256
+ }, "strict", z.ZodTypeAny, {
257
+ enabled?: boolean | undefined;
258
+ }, {
259
+ enabled?: boolean | undefined;
260
+ }>;
261
+ type ListSchedulesInput = z.output<typeof ListSchedulesInputSchema>;
262
+
263
+ export { type CreateScheduleInput, CreateScheduleInputSchema, type DeleteScheduleInput, DeleteScheduleInputSchema, type GetScheduleHistoryInput, GetScheduleHistoryInputSchema, type GetScheduleInput, GetScheduleInputSchema, type ListSchedulesInput, ListSchedulesInputSchema, type ScheduleSessionMode, ScheduleSessionModeSchema, type SchedulerToolsConfig, SchedulerToolsConfigSchema, type TriggerScheduleInput, TriggerScheduleInputSchema, UpdateScheduleFieldsOnlySchema, type UpdateScheduleInput, UpdateScheduleInputSchema };
@@ -0,0 +1,105 @@
1
+ import { z } from "zod";
2
+ const ScheduleSessionModeSchema = z.enum(["ephemeral", "dedicated", "inherit", "fixed"]).describe(
3
+ `How to manage conversation context for scheduled executions:
4
+ \u2022 ephemeral - New isolated session each time (default). Use for standalone tasks like reports.
5
+ \u2022 dedicated - Persistent session for this schedule. Builds context over multiple runs.
6
+ \u2022 inherit - Continue in the current conversation. Use for "remind me later" scenarios.
7
+ \u2022 fixed - Use a specific sessionId. Advanced: for cross-session orchestration.`
8
+ );
9
+ const SchedulerToolsConfigSchema = z.object({
10
+ type: z.literal("scheduler-tools"),
11
+ timezone: z.string().default("UTC").describe("Default timezone for schedules"),
12
+ maxSchedules: z.number().default(100).describe("Maximum number of schedules"),
13
+ executionTimeout: z.number().default(3e5).describe("Maximum execution time in milliseconds (default 5 minutes)"),
14
+ maxExecutionHistory: z.number().default(100).describe("Maximum execution history entries to keep")
15
+ }).strict();
16
+ const CreateScheduleInputSchema = z.object({
17
+ name: z.string().min(1).max(100).describe(
18
+ 'Human-readable name for the schedule (e.g., "Coffee Reminder", "Daily Standup")'
19
+ ),
20
+ cronExpression: z.string().describe('Cron expression (e.g., "0 9 * * 1-5" for weekdays at 9am)'),
21
+ instruction: z.string().min(1).describe(
22
+ "What should happen when this schedule triggers. Be natural and clear about the intent."
23
+ ),
24
+ timezone: z.string().optional().describe("Optional timezone (defaults to config timezone)"),
25
+ enabled: z.boolean().default(true).describe("Whether schedule is enabled"),
26
+ metadata: z.record(z.unknown()).optional().describe("Optional metadata for the task"),
27
+ workspacePath: z.string().optional().nullable().describe("Optional workspace path for scheduled runs"),
28
+ sessionMode: ScheduleSessionModeSchema.default("ephemeral").describe(
29
+ `Session context mode:
30
+ \u2022 ephemeral (default) - Fresh session each run. Example: "Send daily report"
31
+ \u2022 dedicated - Same session across runs. Example: "Track project progress daily"
32
+ \u2022 inherit - Continue current conversation. Example: "Remind me about this in 2 hours"
33
+ \u2022 fixed - Specific session. Example: "Post update to session abc-123"`
34
+ ),
35
+ sessionId: z.string().optional().describe(
36
+ 'Target session ID. Required for "fixed" mode. For "inherit", this is auto-captured.'
37
+ ),
38
+ targetAgentId: z.string().optional().describe(
39
+ 'Target agent ID to execute this schedule (e.g., "notes", "filesystem", "coding"). If not specified, executes in the creator agent context. Use this to delegate scheduled tasks to specialized agents.'
40
+ )
41
+ }).strict().superRefine((data, ctx) => {
42
+ if (data.sessionMode === "fixed" && !data.sessionId) {
43
+ ctx.addIssue({
44
+ code: z.ZodIssueCode.custom,
45
+ message: 'sessionId is required when sessionMode is "fixed"',
46
+ path: ["sessionId"]
47
+ });
48
+ }
49
+ });
50
+ const UpdateScheduleFieldsSchema = z.object({
51
+ name: z.string().min(1).max(100).optional().describe("Updated name"),
52
+ cronExpression: z.string().optional().describe("Updated cron expression"),
53
+ instruction: z.string().min(1).optional().describe("Updated instruction - what should happen when this schedule triggers"),
54
+ timezone: z.string().optional().describe("Updated timezone"),
55
+ enabled: z.boolean().optional().describe("Updated enabled state"),
56
+ metadata: z.record(z.unknown()).optional().describe("Updated metadata"),
57
+ workspacePath: z.string().optional().nullable().describe("Updated workspace path for scheduled runs"),
58
+ sessionMode: ScheduleSessionModeSchema.optional().describe(
59
+ "Updated session mode (ephemeral, dedicated, inherit, fixed)"
60
+ ),
61
+ sessionId: z.string().optional().describe('Updated session ID (required if changing to "fixed" mode)'),
62
+ targetAgentId: z.string().optional().describe(
63
+ "Updated target agent ID. Set to reassign schedule execution to a different agent."
64
+ )
65
+ }).strict();
66
+ const UpdateScheduleInputSchema = UpdateScheduleFieldsSchema.extend({
67
+ scheduleId: z.string().describe("The schedule ID to update")
68
+ }).superRefine((data, ctx) => {
69
+ if (data.sessionMode === "fixed" && !data.sessionId) {
70
+ ctx.addIssue({
71
+ code: z.ZodIssueCode.custom,
72
+ message: 'sessionId is required when sessionMode is "fixed"',
73
+ path: ["sessionId"]
74
+ });
75
+ }
76
+ });
77
+ const UpdateScheduleFieldsOnlySchema = UpdateScheduleFieldsSchema;
78
+ const GetScheduleInputSchema = z.object({
79
+ scheduleId: z.string().describe("The schedule ID")
80
+ }).strict();
81
+ const DeleteScheduleInputSchema = z.object({
82
+ scheduleId: z.string().describe("The schedule ID to delete")
83
+ }).strict();
84
+ const TriggerScheduleInputSchema = z.object({
85
+ scheduleId: z.string().describe("The schedule ID to trigger")
86
+ }).strict();
87
+ const GetScheduleHistoryInputSchema = z.object({
88
+ scheduleId: z.string().describe("The schedule ID"),
89
+ limit: z.number().optional().describe("Maximum number of history entries to return (default: 10)")
90
+ }).strict();
91
+ const ListSchedulesInputSchema = z.object({
92
+ enabled: z.boolean().optional().describe("Filter by enabled status (true/false)")
93
+ }).strict();
94
+ export {
95
+ CreateScheduleInputSchema,
96
+ DeleteScheduleInputSchema,
97
+ GetScheduleHistoryInputSchema,
98
+ GetScheduleInputSchema,
99
+ ListSchedulesInputSchema,
100
+ ScheduleSessionModeSchema,
101
+ SchedulerToolsConfigSchema,
102
+ TriggerScheduleInputSchema,
103
+ UpdateScheduleFieldsOnlySchema,
104
+ UpdateScheduleInputSchema
105
+ };