agent-task-manager-mcp 1.0.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/LICENSE.md +65 -0
- package/README.md +473 -0
- package/dist/db.d.ts +4 -0
- package/dist/db.d.ts.map +1 -0
- package/dist/db.js +20 -0
- package/dist/db.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +73 -0
- package/dist/index.js.map +1 -0
- package/dist/models/Checkpoint.d.ts +15 -0
- package/dist/models/Checkpoint.d.ts.map +1 -0
- package/dist/models/Checkpoint.js +47 -0
- package/dist/models/Checkpoint.js.map +1 -0
- package/dist/models/Session.d.ts +24 -0
- package/dist/models/Session.d.ts.map +1 -0
- package/dist/models/Session.js +58 -0
- package/dist/models/Session.js.map +1 -0
- package/dist/models/Subtask.d.ts +25 -0
- package/dist/models/Subtask.d.ts.map +1 -0
- package/dist/models/Subtask.js +63 -0
- package/dist/models/Subtask.js.map +1 -0
- package/dist/models/Task.d.ts +31 -0
- package/dist/models/Task.d.ts.map +1 -0
- package/dist/models/Task.js +66 -0
- package/dist/models/Task.js.map +1 -0
- package/dist/schemas/zod.schemas.d.ts +344 -0
- package/dist/schemas/zod.schemas.d.ts.map +1 -0
- package/dist/schemas/zod.schemas.js +106 -0
- package/dist/schemas/zod.schemas.js.map +1 -0
- package/dist/tools/checkpoint.tools.d.ts +4 -0
- package/dist/tools/checkpoint.tools.d.ts.map +1 -0
- package/dist/tools/checkpoint.tools.js +69 -0
- package/dist/tools/checkpoint.tools.js.map +1 -0
- package/dist/tools/session.tools.d.ts +4 -0
- package/dist/tools/session.tools.d.ts.map +1 -0
- package/dist/tools/session.tools.js +127 -0
- package/dist/tools/session.tools.js.map +1 -0
- package/dist/tools/subtask.tools.d.ts +4 -0
- package/dist/tools/subtask.tools.d.ts.map +1 -0
- package/dist/tools/subtask.tools.js +126 -0
- package/dist/tools/subtask.tools.js.map +1 -0
- package/dist/tools/task.tools.d.ts +4 -0
- package/dist/tools/task.tools.d.ts.map +1 -0
- package/dist/tools/task.tools.js +202 -0
- package/dist/tools/task.tools.js.map +1 -0
- package/package.json +43 -0
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ObjectIdSchema: z.ZodString;
|
|
3
|
+
export declare const TaskContextSchema: z.ZodObject<{
|
|
4
|
+
workingDirectory: z.ZodDefault<z.ZodString>;
|
|
5
|
+
initScript: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
6
|
+
repoUrl: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
7
|
+
environmentVars: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
workingDirectory: string;
|
|
10
|
+
initScript: string | null;
|
|
11
|
+
repoUrl: string | null;
|
|
12
|
+
environmentVars: Record<string, string>;
|
|
13
|
+
}, {
|
|
14
|
+
workingDirectory?: string | undefined;
|
|
15
|
+
initScript?: string | null | undefined;
|
|
16
|
+
repoUrl?: string | null | undefined;
|
|
17
|
+
environmentVars?: Record<string, string> | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const TaskCreateSchema: z.ZodObject<{
|
|
20
|
+
title: z.ZodString;
|
|
21
|
+
description: z.ZodString;
|
|
22
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
23
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
24
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
25
|
+
workingDirectory: z.ZodDefault<z.ZodString>;
|
|
26
|
+
initScript: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
27
|
+
repoUrl: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
28
|
+
environmentVars: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
workingDirectory: string;
|
|
31
|
+
initScript: string | null;
|
|
32
|
+
repoUrl: string | null;
|
|
33
|
+
environmentVars: Record<string, string>;
|
|
34
|
+
}, {
|
|
35
|
+
workingDirectory?: string | undefined;
|
|
36
|
+
initScript?: string | null | undefined;
|
|
37
|
+
repoUrl?: string | null | undefined;
|
|
38
|
+
environmentVars?: Record<string, string> | undefined;
|
|
39
|
+
}>>;
|
|
40
|
+
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
41
|
+
deadline: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
42
|
+
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
description: string;
|
|
44
|
+
title: string;
|
|
45
|
+
priority: number;
|
|
46
|
+
tags: string[];
|
|
47
|
+
metadata: Record<string, unknown>;
|
|
48
|
+
context?: {
|
|
49
|
+
workingDirectory: string;
|
|
50
|
+
initScript: string | null;
|
|
51
|
+
repoUrl: string | null;
|
|
52
|
+
environmentVars: Record<string, string>;
|
|
53
|
+
} | undefined;
|
|
54
|
+
deadline?: string | null | undefined;
|
|
55
|
+
}, {
|
|
56
|
+
description: string;
|
|
57
|
+
title: string;
|
|
58
|
+
context?: {
|
|
59
|
+
workingDirectory?: string | undefined;
|
|
60
|
+
initScript?: string | null | undefined;
|
|
61
|
+
repoUrl?: string | null | undefined;
|
|
62
|
+
environmentVars?: Record<string, string> | undefined;
|
|
63
|
+
} | undefined;
|
|
64
|
+
priority?: number | undefined;
|
|
65
|
+
tags?: string[] | undefined;
|
|
66
|
+
metadata?: Record<string, unknown> | undefined;
|
|
67
|
+
deadline?: string | null | undefined;
|
|
68
|
+
}>;
|
|
69
|
+
export declare const TaskUpdateSchema: z.ZodObject<{
|
|
70
|
+
id: z.ZodString;
|
|
71
|
+
title: z.ZodOptional<z.ZodString>;
|
|
72
|
+
description: z.ZodOptional<z.ZodString>;
|
|
73
|
+
status: z.ZodOptional<z.ZodEnum<["pending", "initializing", "in_progress", "paused", "completed", "failed"]>>;
|
|
74
|
+
phase: z.ZodOptional<z.ZodEnum<["init", "execution"]>>;
|
|
75
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
76
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
77
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
78
|
+
workingDirectory: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
79
|
+
initScript: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
80
|
+
repoUrl: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
81
|
+
environmentVars: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
82
|
+
}, "strip", z.ZodTypeAny, {
|
|
83
|
+
workingDirectory?: string | undefined;
|
|
84
|
+
initScript?: string | null | undefined;
|
|
85
|
+
repoUrl?: string | null | undefined;
|
|
86
|
+
environmentVars?: Record<string, string> | undefined;
|
|
87
|
+
}, {
|
|
88
|
+
workingDirectory?: string | undefined;
|
|
89
|
+
initScript?: string | null | undefined;
|
|
90
|
+
repoUrl?: string | null | undefined;
|
|
91
|
+
environmentVars?: Record<string, string> | undefined;
|
|
92
|
+
}>>;
|
|
93
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
94
|
+
deadline: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
95
|
+
}, "strip", z.ZodTypeAny, {
|
|
96
|
+
id: string;
|
|
97
|
+
context?: {
|
|
98
|
+
workingDirectory?: string | undefined;
|
|
99
|
+
initScript?: string | null | undefined;
|
|
100
|
+
repoUrl?: string | null | undefined;
|
|
101
|
+
environmentVars?: Record<string, string> | undefined;
|
|
102
|
+
} | undefined;
|
|
103
|
+
description?: string | undefined;
|
|
104
|
+
title?: string | undefined;
|
|
105
|
+
status?: "pending" | "initializing" | "in_progress" | "paused" | "completed" | "failed" | undefined;
|
|
106
|
+
phase?: "init" | "execution" | undefined;
|
|
107
|
+
priority?: number | undefined;
|
|
108
|
+
tags?: string[] | undefined;
|
|
109
|
+
metadata?: Record<string, unknown> | undefined;
|
|
110
|
+
deadline?: string | null | undefined;
|
|
111
|
+
}, {
|
|
112
|
+
id: string;
|
|
113
|
+
context?: {
|
|
114
|
+
workingDirectory?: string | undefined;
|
|
115
|
+
initScript?: string | null | undefined;
|
|
116
|
+
repoUrl?: string | null | undefined;
|
|
117
|
+
environmentVars?: Record<string, string> | undefined;
|
|
118
|
+
} | undefined;
|
|
119
|
+
description?: string | undefined;
|
|
120
|
+
title?: string | undefined;
|
|
121
|
+
status?: "pending" | "initializing" | "in_progress" | "paused" | "completed" | "failed" | undefined;
|
|
122
|
+
phase?: "init" | "execution" | undefined;
|
|
123
|
+
priority?: number | undefined;
|
|
124
|
+
tags?: string[] | undefined;
|
|
125
|
+
metadata?: Record<string, unknown> | undefined;
|
|
126
|
+
deadline?: string | null | undefined;
|
|
127
|
+
}>;
|
|
128
|
+
export declare const TaskGetSchema: z.ZodObject<{
|
|
129
|
+
id: z.ZodString;
|
|
130
|
+
}, "strip", z.ZodTypeAny, {
|
|
131
|
+
id: string;
|
|
132
|
+
}, {
|
|
133
|
+
id: string;
|
|
134
|
+
}>;
|
|
135
|
+
export declare const TaskListSchema: z.ZodObject<{
|
|
136
|
+
status: z.ZodOptional<z.ZodEnum<["pending", "initializing", "in_progress", "paused", "completed", "failed"]>>;
|
|
137
|
+
phase: z.ZodOptional<z.ZodEnum<["init", "execution"]>>;
|
|
138
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
139
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
140
|
+
skip: z.ZodDefault<z.ZodNumber>;
|
|
141
|
+
}, "strip", z.ZodTypeAny, {
|
|
142
|
+
skip: number;
|
|
143
|
+
limit: number;
|
|
144
|
+
status?: "pending" | "initializing" | "in_progress" | "paused" | "completed" | "failed" | undefined;
|
|
145
|
+
phase?: "init" | "execution" | undefined;
|
|
146
|
+
tags?: string[] | undefined;
|
|
147
|
+
}, {
|
|
148
|
+
skip?: number | undefined;
|
|
149
|
+
limit?: number | undefined;
|
|
150
|
+
status?: "pending" | "initializing" | "in_progress" | "paused" | "completed" | "failed" | undefined;
|
|
151
|
+
phase?: "init" | "execution" | undefined;
|
|
152
|
+
tags?: string[] | undefined;
|
|
153
|
+
}>;
|
|
154
|
+
export declare const TaskDeleteSchema: z.ZodObject<{
|
|
155
|
+
id: z.ZodString;
|
|
156
|
+
}, "strip", z.ZodTypeAny, {
|
|
157
|
+
id: string;
|
|
158
|
+
}, {
|
|
159
|
+
id: string;
|
|
160
|
+
}>;
|
|
161
|
+
export declare const TaskLockSchema: z.ZodObject<{
|
|
162
|
+
id: z.ZodString;
|
|
163
|
+
agentId: z.ZodString;
|
|
164
|
+
}, "strip", z.ZodTypeAny, {
|
|
165
|
+
id: string;
|
|
166
|
+
agentId: string;
|
|
167
|
+
}, {
|
|
168
|
+
id: string;
|
|
169
|
+
agentId: string;
|
|
170
|
+
}>;
|
|
171
|
+
export declare const TaskUnlockSchema: z.ZodObject<{
|
|
172
|
+
id: z.ZodString;
|
|
173
|
+
agentId: z.ZodString;
|
|
174
|
+
}, "strip", z.ZodTypeAny, {
|
|
175
|
+
id: string;
|
|
176
|
+
agentId: string;
|
|
177
|
+
}, {
|
|
178
|
+
id: string;
|
|
179
|
+
agentId: string;
|
|
180
|
+
}>;
|
|
181
|
+
export declare const SubtaskItemSchema: z.ZodObject<{
|
|
182
|
+
title: z.ZodString;
|
|
183
|
+
description: z.ZodString;
|
|
184
|
+
category: z.ZodDefault<z.ZodEnum<["functional", "ui", "performance", "security", "test"]>>;
|
|
185
|
+
steps: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
186
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
187
|
+
dependsOn: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
188
|
+
}, "strip", z.ZodTypeAny, {
|
|
189
|
+
description: string;
|
|
190
|
+
title: string;
|
|
191
|
+
priority: number;
|
|
192
|
+
category: "test" | "functional" | "ui" | "performance" | "security";
|
|
193
|
+
steps: string[];
|
|
194
|
+
dependsOn: string[];
|
|
195
|
+
}, {
|
|
196
|
+
description: string;
|
|
197
|
+
title: string;
|
|
198
|
+
priority?: number | undefined;
|
|
199
|
+
category?: "test" | "functional" | "ui" | "performance" | "security" | undefined;
|
|
200
|
+
steps?: string[] | undefined;
|
|
201
|
+
dependsOn?: string[] | undefined;
|
|
202
|
+
}>;
|
|
203
|
+
export declare const SubtaskCreateBulkSchema: z.ZodObject<{
|
|
204
|
+
taskId: z.ZodString;
|
|
205
|
+
subtasks: z.ZodArray<z.ZodObject<{
|
|
206
|
+
title: z.ZodString;
|
|
207
|
+
description: z.ZodString;
|
|
208
|
+
category: z.ZodDefault<z.ZodEnum<["functional", "ui", "performance", "security", "test"]>>;
|
|
209
|
+
steps: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
210
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
211
|
+
dependsOn: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
212
|
+
}, "strip", z.ZodTypeAny, {
|
|
213
|
+
description: string;
|
|
214
|
+
title: string;
|
|
215
|
+
priority: number;
|
|
216
|
+
category: "test" | "functional" | "ui" | "performance" | "security";
|
|
217
|
+
steps: string[];
|
|
218
|
+
dependsOn: string[];
|
|
219
|
+
}, {
|
|
220
|
+
description: string;
|
|
221
|
+
title: string;
|
|
222
|
+
priority?: number | undefined;
|
|
223
|
+
category?: "test" | "functional" | "ui" | "performance" | "security" | undefined;
|
|
224
|
+
steps?: string[] | undefined;
|
|
225
|
+
dependsOn?: string[] | undefined;
|
|
226
|
+
}>, "many">;
|
|
227
|
+
}, "strip", z.ZodTypeAny, {
|
|
228
|
+
taskId: string;
|
|
229
|
+
subtasks: {
|
|
230
|
+
description: string;
|
|
231
|
+
title: string;
|
|
232
|
+
priority: number;
|
|
233
|
+
category: "test" | "functional" | "ui" | "performance" | "security";
|
|
234
|
+
steps: string[];
|
|
235
|
+
dependsOn: string[];
|
|
236
|
+
}[];
|
|
237
|
+
}, {
|
|
238
|
+
taskId: string;
|
|
239
|
+
subtasks: {
|
|
240
|
+
description: string;
|
|
241
|
+
title: string;
|
|
242
|
+
priority?: number | undefined;
|
|
243
|
+
category?: "test" | "functional" | "ui" | "performance" | "security" | undefined;
|
|
244
|
+
steps?: string[] | undefined;
|
|
245
|
+
dependsOn?: string[] | undefined;
|
|
246
|
+
}[];
|
|
247
|
+
}>;
|
|
248
|
+
export declare const SubtaskGetNextSchema: z.ZodObject<{
|
|
249
|
+
taskId: z.ZodString;
|
|
250
|
+
agentId: z.ZodString;
|
|
251
|
+
}, "strip", z.ZodTypeAny, {
|
|
252
|
+
agentId: string;
|
|
253
|
+
taskId: string;
|
|
254
|
+
}, {
|
|
255
|
+
agentId: string;
|
|
256
|
+
taskId: string;
|
|
257
|
+
}>;
|
|
258
|
+
export declare const SubtaskUpdateStatusSchema: z.ZodObject<{
|
|
259
|
+
id: z.ZodString;
|
|
260
|
+
agentId: z.ZodString;
|
|
261
|
+
status: z.ZodEnum<["in_progress", "passed", "failed", "blocked"]>;
|
|
262
|
+
evidence: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
263
|
+
lastError: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
264
|
+
}, "strip", z.ZodTypeAny, {
|
|
265
|
+
id: string;
|
|
266
|
+
status: "in_progress" | "failed" | "passed" | "blocked";
|
|
267
|
+
agentId: string;
|
|
268
|
+
lastError?: string | null | undefined;
|
|
269
|
+
evidence?: string | null | undefined;
|
|
270
|
+
}, {
|
|
271
|
+
id: string;
|
|
272
|
+
status: "in_progress" | "failed" | "passed" | "blocked";
|
|
273
|
+
agentId: string;
|
|
274
|
+
lastError?: string | null | undefined;
|
|
275
|
+
evidence?: string | null | undefined;
|
|
276
|
+
}>;
|
|
277
|
+
export declare const SessionStartSchema: z.ZodObject<{
|
|
278
|
+
taskId: z.ZodString;
|
|
279
|
+
agentId: z.ZodString;
|
|
280
|
+
phase: z.ZodEnum<["init", "execution"]>;
|
|
281
|
+
}, "strip", z.ZodTypeAny, {
|
|
282
|
+
phase: "init" | "execution";
|
|
283
|
+
agentId: string;
|
|
284
|
+
taskId: string;
|
|
285
|
+
}, {
|
|
286
|
+
phase: "init" | "execution";
|
|
287
|
+
agentId: string;
|
|
288
|
+
taskId: string;
|
|
289
|
+
}>;
|
|
290
|
+
export declare const SessionEndSchema: z.ZodObject<{
|
|
291
|
+
id: z.ZodString;
|
|
292
|
+
agentId: z.ZodString;
|
|
293
|
+
progressNote: z.ZodString;
|
|
294
|
+
gitCommit: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
295
|
+
tokenCount: z.ZodOptional<z.ZodNumber>;
|
|
296
|
+
status: z.ZodDefault<z.ZodEnum<["completed", "crashed", "timed_out"]>>;
|
|
297
|
+
subtasksAttempted: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
298
|
+
subtasksCompleted: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
299
|
+
}, "strip", z.ZodTypeAny, {
|
|
300
|
+
id: string;
|
|
301
|
+
status: "completed" | "crashed" | "timed_out";
|
|
302
|
+
agentId: string;
|
|
303
|
+
subtasksAttempted: string[];
|
|
304
|
+
subtasksCompleted: string[];
|
|
305
|
+
progressNote: string;
|
|
306
|
+
gitCommit?: string | null | undefined;
|
|
307
|
+
tokenCount?: number | undefined;
|
|
308
|
+
}, {
|
|
309
|
+
id: string;
|
|
310
|
+
agentId: string;
|
|
311
|
+
progressNote: string;
|
|
312
|
+
status?: "completed" | "crashed" | "timed_out" | undefined;
|
|
313
|
+
subtasksAttempted?: string[] | undefined;
|
|
314
|
+
subtasksCompleted?: string[] | undefined;
|
|
315
|
+
gitCommit?: string | null | undefined;
|
|
316
|
+
tokenCount?: number | undefined;
|
|
317
|
+
}>;
|
|
318
|
+
export declare const CheckpointSaveSchema: z.ZodObject<{
|
|
319
|
+
taskId: z.ZodString;
|
|
320
|
+
sessionId: z.ZodString;
|
|
321
|
+
label: z.ZodString;
|
|
322
|
+
snapshot: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
323
|
+
}, "strip", z.ZodTypeAny, {
|
|
324
|
+
taskId: string;
|
|
325
|
+
sessionId: string;
|
|
326
|
+
label: string;
|
|
327
|
+
snapshot: Record<string, unknown>;
|
|
328
|
+
}, {
|
|
329
|
+
taskId: string;
|
|
330
|
+
sessionId: string;
|
|
331
|
+
label: string;
|
|
332
|
+
snapshot: Record<string, unknown>;
|
|
333
|
+
}>;
|
|
334
|
+
export declare const CheckpointRestoreSchema: z.ZodObject<{
|
|
335
|
+
taskId: z.ZodString;
|
|
336
|
+
label: z.ZodString;
|
|
337
|
+
}, "strip", z.ZodTypeAny, {
|
|
338
|
+
taskId: string;
|
|
339
|
+
label: string;
|
|
340
|
+
}, {
|
|
341
|
+
taskId: string;
|
|
342
|
+
label: string;
|
|
343
|
+
}>;
|
|
344
|
+
//# sourceMappingURL=zod.schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zod.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/zod.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,cAAc,aAAyD,CAAA;AAIpF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;EAK5B,CAAA;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQ3B,CAAA;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW3B,CAAA;AAEF,eAAO,MAAM,aAAa;;;;;;EAExB,CAAA;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;EAMzB,CAAA;AAEF,eAAO,MAAM,gBAAgB;;;;;;EAE3B,CAAA;AAEF,eAAO,MAAM,cAAc;;;;;;;;;EAGzB,CAAA;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;EAG3B,CAAA;AAIF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;EAO5B,CAAA;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGlC,CAAA;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;EAG/B,CAAA;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;EAMpC,CAAA;AAIF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;EAI7B,CAAA;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS3B,CAAA;AAIF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;EAK/B,CAAA;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;EAGlC,CAAA"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CheckpointRestoreSchema = exports.CheckpointSaveSchema = exports.SessionEndSchema = exports.SessionStartSchema = exports.SubtaskUpdateStatusSchema = exports.SubtaskGetNextSchema = exports.SubtaskCreateBulkSchema = exports.SubtaskItemSchema = exports.TaskUnlockSchema = exports.TaskLockSchema = exports.TaskDeleteSchema = exports.TaskListSchema = exports.TaskGetSchema = exports.TaskUpdateSchema = exports.TaskCreateSchema = exports.TaskContextSchema = exports.ObjectIdSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.ObjectIdSchema = zod_1.z.string().regex(/^[a-f\d]{24}$/i, 'Invalid ObjectId');
|
|
6
|
+
// ─── Task Schemas ────────────────────────────────────────────────────────────
|
|
7
|
+
exports.TaskContextSchema = zod_1.z.object({
|
|
8
|
+
workingDirectory: zod_1.z.string().default('/tmp'),
|
|
9
|
+
initScript: zod_1.z.string().nullable().default(null),
|
|
10
|
+
repoUrl: zod_1.z.string().nullable().default(null),
|
|
11
|
+
environmentVars: zod_1.z.record(zod_1.z.string()).default({}),
|
|
12
|
+
});
|
|
13
|
+
exports.TaskCreateSchema = zod_1.z.object({
|
|
14
|
+
title: zod_1.z.string().min(1),
|
|
15
|
+
description: zod_1.z.string().min(1),
|
|
16
|
+
priority: zod_1.z.number().int().min(1).max(10).default(5),
|
|
17
|
+
tags: zod_1.z.array(zod_1.z.string()).default([]),
|
|
18
|
+
context: exports.TaskContextSchema.optional(),
|
|
19
|
+
metadata: zod_1.z.record(zod_1.z.unknown()).default({}),
|
|
20
|
+
deadline: zod_1.z.string().datetime().nullable().optional(),
|
|
21
|
+
});
|
|
22
|
+
exports.TaskUpdateSchema = zod_1.z.object({
|
|
23
|
+
id: exports.ObjectIdSchema,
|
|
24
|
+
title: zod_1.z.string().min(1).optional(),
|
|
25
|
+
description: zod_1.z.string().min(1).optional(),
|
|
26
|
+
status: zod_1.z.enum(['pending', 'initializing', 'in_progress', 'paused', 'completed', 'failed']).optional(),
|
|
27
|
+
phase: zod_1.z.enum(['init', 'execution']).optional(),
|
|
28
|
+
priority: zod_1.z.number().int().min(1).max(10).optional(),
|
|
29
|
+
tags: zod_1.z.array(zod_1.z.string()).optional(),
|
|
30
|
+
context: exports.TaskContextSchema.partial().optional(),
|
|
31
|
+
metadata: zod_1.z.record(zod_1.z.unknown()).optional(),
|
|
32
|
+
deadline: zod_1.z.string().datetime().nullable().optional(),
|
|
33
|
+
});
|
|
34
|
+
exports.TaskGetSchema = zod_1.z.object({
|
|
35
|
+
id: exports.ObjectIdSchema,
|
|
36
|
+
});
|
|
37
|
+
exports.TaskListSchema = zod_1.z.object({
|
|
38
|
+
status: zod_1.z.enum(['pending', 'initializing', 'in_progress', 'paused', 'completed', 'failed']).optional(),
|
|
39
|
+
phase: zod_1.z.enum(['init', 'execution']).optional(),
|
|
40
|
+
tags: zod_1.z.array(zod_1.z.string()).optional(),
|
|
41
|
+
limit: zod_1.z.number().int().min(1).max(100).default(20),
|
|
42
|
+
skip: zod_1.z.number().int().min(0).default(0),
|
|
43
|
+
});
|
|
44
|
+
exports.TaskDeleteSchema = zod_1.z.object({
|
|
45
|
+
id: exports.ObjectIdSchema,
|
|
46
|
+
});
|
|
47
|
+
exports.TaskLockSchema = zod_1.z.object({
|
|
48
|
+
id: exports.ObjectIdSchema,
|
|
49
|
+
agentId: zod_1.z.string().min(1),
|
|
50
|
+
});
|
|
51
|
+
exports.TaskUnlockSchema = zod_1.z.object({
|
|
52
|
+
id: exports.ObjectIdSchema,
|
|
53
|
+
agentId: zod_1.z.string().min(1),
|
|
54
|
+
});
|
|
55
|
+
// ─── Subtask Schemas ─────────────────────────────────────────────────────────
|
|
56
|
+
exports.SubtaskItemSchema = zod_1.z.object({
|
|
57
|
+
title: zod_1.z.string().min(1),
|
|
58
|
+
description: zod_1.z.string().min(1),
|
|
59
|
+
category: zod_1.z.enum(['functional', 'ui', 'performance', 'security', 'test']).default('functional'),
|
|
60
|
+
steps: zod_1.z.array(zod_1.z.string()).default([]),
|
|
61
|
+
priority: zod_1.z.number().int().min(1).max(10).default(5),
|
|
62
|
+
dependsOn: zod_1.z.array(zod_1.z.string()).default([]),
|
|
63
|
+
});
|
|
64
|
+
exports.SubtaskCreateBulkSchema = zod_1.z.object({
|
|
65
|
+
taskId: exports.ObjectIdSchema,
|
|
66
|
+
subtasks: zod_1.z.array(exports.SubtaskItemSchema).min(1),
|
|
67
|
+
});
|
|
68
|
+
exports.SubtaskGetNextSchema = zod_1.z.object({
|
|
69
|
+
taskId: exports.ObjectIdSchema,
|
|
70
|
+
agentId: zod_1.z.string().min(1),
|
|
71
|
+
});
|
|
72
|
+
exports.SubtaskUpdateStatusSchema = zod_1.z.object({
|
|
73
|
+
id: exports.ObjectIdSchema,
|
|
74
|
+
agentId: zod_1.z.string().min(1),
|
|
75
|
+
status: zod_1.z.enum(['in_progress', 'passed', 'failed', 'blocked']),
|
|
76
|
+
evidence: zod_1.z.string().nullable().optional(),
|
|
77
|
+
lastError: zod_1.z.string().nullable().optional(),
|
|
78
|
+
});
|
|
79
|
+
// ─── Session Schemas ──────────────────────────────────────────────────────────
|
|
80
|
+
exports.SessionStartSchema = zod_1.z.object({
|
|
81
|
+
taskId: exports.ObjectIdSchema,
|
|
82
|
+
agentId: zod_1.z.string().min(1),
|
|
83
|
+
phase: zod_1.z.enum(['init', 'execution']),
|
|
84
|
+
});
|
|
85
|
+
exports.SessionEndSchema = zod_1.z.object({
|
|
86
|
+
id: exports.ObjectIdSchema,
|
|
87
|
+
agentId: zod_1.z.string().min(1),
|
|
88
|
+
progressNote: zod_1.z.string().min(1),
|
|
89
|
+
gitCommit: zod_1.z.string().nullable().optional(),
|
|
90
|
+
tokenCount: zod_1.z.number().int().positive().optional(),
|
|
91
|
+
status: zod_1.z.enum(['completed', 'crashed', 'timed_out']).default('completed'),
|
|
92
|
+
subtasksAttempted: zod_1.z.array(exports.ObjectIdSchema).default([]),
|
|
93
|
+
subtasksCompleted: zod_1.z.array(exports.ObjectIdSchema).default([]),
|
|
94
|
+
});
|
|
95
|
+
// ─── Checkpoint Schemas ───────────────────────────────────────────────────────
|
|
96
|
+
exports.CheckpointSaveSchema = zod_1.z.object({
|
|
97
|
+
taskId: exports.ObjectIdSchema,
|
|
98
|
+
sessionId: exports.ObjectIdSchema,
|
|
99
|
+
label: zod_1.z.string().min(1),
|
|
100
|
+
snapshot: zod_1.z.record(zod_1.z.unknown()),
|
|
101
|
+
});
|
|
102
|
+
exports.CheckpointRestoreSchema = zod_1.z.object({
|
|
103
|
+
taskId: exports.ObjectIdSchema,
|
|
104
|
+
label: zod_1.z.string().min(1),
|
|
105
|
+
});
|
|
106
|
+
//# sourceMappingURL=zod.schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zod.schemas.js","sourceRoot":"","sources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KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,QAAQ,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,OAAO,EAAE,CAAC;CAChC,CAAC,CAAA;AAEW,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9C,MAAM,EAAE,sBAAc;IACtB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACzB,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkpoint.tools.d.ts","sourceRoot":"","sources":["../../src/tools/checkpoint.tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAA;AAKzD,eAAO,MAAM,yBAAyB,EAAE,IAAI,EA6B3C,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAU,MAAM,MAAM,EAAE,MAAM,OAAO,KAAG,OAAO,CAAC,MAAM,CAkCtF,CAAA"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.handleCheckpointTool = exports.checkpointToolDefinitions = void 0;
|
|
7
|
+
const mongoose_1 = __importDefault(require("mongoose"));
|
|
8
|
+
const Checkpoint_js_1 = require("../models/Checkpoint.js");
|
|
9
|
+
const zod_schemas_js_1 = require("../schemas/zod.schemas.js");
|
|
10
|
+
exports.checkpointToolDefinitions = [
|
|
11
|
+
{
|
|
12
|
+
name: 'checkpoint_save',
|
|
13
|
+
description: 'Save a named snapshot of any state you want to persist. Use this before risky operations (large refactors, schema migrations, destructive changes) so you can roll back. The snapshot can contain any JSON-serializable data. Label it descriptively, e.g. "before-auth-refactor".',
|
|
14
|
+
inputSchema: {
|
|
15
|
+
type: 'object',
|
|
16
|
+
properties: {
|
|
17
|
+
taskId: { type: 'string' },
|
|
18
|
+
sessionId: { type: 'string' },
|
|
19
|
+
label: { type: 'string', description: 'Descriptive name, e.g. "before-db-migration"' },
|
|
20
|
+
snapshot: { type: 'object', description: 'Any JSON state you want to save' },
|
|
21
|
+
},
|
|
22
|
+
required: ['taskId', 'sessionId', 'label', 'snapshot'],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'checkpoint_restore',
|
|
27
|
+
description: 'Restore the most recent checkpoint with a given label. Returns the snapshot data — it is your responsibility to apply it. Also returns a history of all checkpoints for this task so you can choose which one to restore.',
|
|
28
|
+
inputSchema: {
|
|
29
|
+
type: 'object',
|
|
30
|
+
properties: {
|
|
31
|
+
taskId: { type: 'string' },
|
|
32
|
+
label: { type: 'string', description: 'The checkpoint label to restore' },
|
|
33
|
+
},
|
|
34
|
+
required: ['taskId', 'label'],
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
];
|
|
38
|
+
const handleCheckpointTool = async (name, args) => {
|
|
39
|
+
switch (name) {
|
|
40
|
+
case 'checkpoint_save': {
|
|
41
|
+
const { taskId, sessionId, label, snapshot } = zod_schemas_js_1.CheckpointSaveSchema.parse(args);
|
|
42
|
+
const checkpoint = await Checkpoint_js_1.Checkpoint.create({
|
|
43
|
+
taskId: new mongoose_1.default.Types.ObjectId(taskId),
|
|
44
|
+
sessionId: new mongoose_1.default.Types.ObjectId(sessionId),
|
|
45
|
+
label,
|
|
46
|
+
snapshot,
|
|
47
|
+
});
|
|
48
|
+
return JSON.stringify({ success: true, checkpoint });
|
|
49
|
+
}
|
|
50
|
+
case 'checkpoint_restore': {
|
|
51
|
+
const { taskId, label } = zod_schemas_js_1.CheckpointRestoreSchema.parse(args);
|
|
52
|
+
const taskOid = new mongoose_1.default.Types.ObjectId(taskId);
|
|
53
|
+
const checkpoint = await Checkpoint_js_1.Checkpoint.findOne({ taskId: taskOid, label })
|
|
54
|
+
.sort({ createdAt: -1 })
|
|
55
|
+
.lean();
|
|
56
|
+
if (!checkpoint)
|
|
57
|
+
return JSON.stringify({ success: false, error: `No checkpoint found with label "${label}"` });
|
|
58
|
+
const allCheckpoints = await Checkpoint_js_1.Checkpoint.find({ taskId: taskOid })
|
|
59
|
+
.sort({ createdAt: -1 })
|
|
60
|
+
.select('label createdAt sessionId')
|
|
61
|
+
.lean();
|
|
62
|
+
return JSON.stringify({ success: true, checkpoint, allCheckpoints });
|
|
63
|
+
}
|
|
64
|
+
default:
|
|
65
|
+
return JSON.stringify({ success: false, error: `Unknown checkpoint tool: ${name}` });
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
exports.handleCheckpointTool = handleCheckpointTool;
|
|
69
|
+
//# sourceMappingURL=checkpoint.tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkpoint.tools.js","sourceRoot":"","sources":["../../src/tools/checkpoint.tools.ts"],"names":[],"mappings":";;;;;;AACA,wDAA+B;AAC/B,2DAAoD;AACpD,8DAAyF;AAE5E,QAAA,yBAAyB,GAAW;IAC/C;QACE,IAAI,EAAE,iBAAiB;QACvB,WAAW,EACT,oRAAoR;QACtR,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBAC1B,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBAC7B,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8CAA8C,EAAE;gBACtF,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,iCAAiC,EAAE;aAC7E;YACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,CAAC;SACvD;KACF;IACD;QACE,IAAI,EAAE,oBAAoB;QAC1B,WAAW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