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,127 @@
|
|
|
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.handleSessionTool = exports.sessionToolDefinitions = void 0;
|
|
7
|
+
const mongoose_1 = __importDefault(require("mongoose"));
|
|
8
|
+
const Session_js_1 = require("../models/Session.js");
|
|
9
|
+
const Task_js_1 = require("../models/Task.js");
|
|
10
|
+
const Subtask_js_1 = require("../models/Subtask.js");
|
|
11
|
+
const zod_schemas_js_1 = require("../schemas/zod.schemas.js");
|
|
12
|
+
exports.sessionToolDefinitions = [
|
|
13
|
+
{
|
|
14
|
+
name: 'session_start',
|
|
15
|
+
description: `Begin a new agent session for a task. Call this FIRST at the start of every context window.
|
|
16
|
+
|
|
17
|
+
Returns:
|
|
18
|
+
- The full task object with context (workingDirectory, initScript, etc.)
|
|
19
|
+
- The last session's progressNote so you know exactly where the previous agent left off
|
|
20
|
+
- A count of remaining subtasks
|
|
21
|
+
- Your new session ID — save this, you need it for session_end
|
|
22
|
+
|
|
23
|
+
After calling this, you should:
|
|
24
|
+
1. Read the progressNote carefully
|
|
25
|
+
2. Run the initScript if present to verify the environment
|
|
26
|
+
3. Call subtask_get_next to find what to work on`,
|
|
27
|
+
inputSchema: {
|
|
28
|
+
type: 'object',
|
|
29
|
+
properties: {
|
|
30
|
+
taskId: { type: 'string' },
|
|
31
|
+
agentId: { type: 'string', description: 'Unique ID for this agent instance' },
|
|
32
|
+
phase: { type: 'string', enum: ['init', 'execution'], description: 'Use "init" for the very first session, "execution" for all subsequent ones' },
|
|
33
|
+
},
|
|
34
|
+
required: ['taskId', 'agentId', 'phase'],
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'session_end',
|
|
39
|
+
description: `Close the current session and write a handoff note for the next agent. Call this LAST before your context window ends.
|
|
40
|
+
|
|
41
|
+
You MUST provide a progressNote that covers:
|
|
42
|
+
- What you accomplished this session
|
|
43
|
+
- What the next agent should work on first
|
|
44
|
+
- Any known bugs or blockers
|
|
45
|
+
- The current state of the environment
|
|
46
|
+
|
|
47
|
+
This note is the primary mechanism for continuity between sessions. Write it as if briefing a new engineer joining the project.`,
|
|
48
|
+
inputSchema: {
|
|
49
|
+
type: 'object',
|
|
50
|
+
properties: {
|
|
51
|
+
id: { type: 'string', description: 'Session ID returned from session_start' },
|
|
52
|
+
agentId: { type: 'string' },
|
|
53
|
+
progressNote: {
|
|
54
|
+
type: 'string',
|
|
55
|
+
description: 'Detailed handoff note for the next agent. Cover: what was done, current state, what to do next, any blockers.',
|
|
56
|
+
},
|
|
57
|
+
gitCommit: { type: 'string', description: 'Git commit SHA if you committed progress, optional' },
|
|
58
|
+
tokenCount: { type: 'number', description: 'Approximate tokens used this session, optional' },
|
|
59
|
+
status: {
|
|
60
|
+
type: 'string',
|
|
61
|
+
enum: ['completed', 'crashed', 'timed_out'],
|
|
62
|
+
description: 'completed = normal end, crashed = unhandled error, timed_out = ran out of context',
|
|
63
|
+
},
|
|
64
|
+
subtasksAttempted: { type: 'array', items: { type: 'string' }, description: 'IDs of subtasks you attempted' },
|
|
65
|
+
subtasksCompleted: { type: 'array', items: { type: 'string' }, description: 'IDs of subtasks you marked as passed' },
|
|
66
|
+
},
|
|
67
|
+
required: ['id', 'agentId', 'progressNote'],
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
];
|
|
71
|
+
const handleSessionTool = async (name, args) => {
|
|
72
|
+
switch (name) {
|
|
73
|
+
case 'session_start': {
|
|
74
|
+
const { taskId, agentId, phase } = zod_schemas_js_1.SessionStartSchema.parse(args);
|
|
75
|
+
const taskOid = new mongoose_1.default.Types.ObjectId(taskId);
|
|
76
|
+
const task = await Task_js_1.Task.findById(taskOid).lean();
|
|
77
|
+
if (!task)
|
|
78
|
+
return JSON.stringify({ success: false, error: 'Task not found' });
|
|
79
|
+
const lastSession = await Session_js_1.Session.findOne({ taskId: taskOid, status: 'completed' })
|
|
80
|
+
.sort({ endedAt: -1 })
|
|
81
|
+
.lean();
|
|
82
|
+
const session = await Session_js_1.Session.create({ taskId: taskOid, agentId, phase });
|
|
83
|
+
const [remainingSubtasks, totalSubtasks, passedSubtasks] = await Promise.all([
|
|
84
|
+
Subtask_js_1.Subtask.countDocuments({ taskId: taskOid, status: { $in: ['pending', 'in_progress'] } }),
|
|
85
|
+
Subtask_js_1.Subtask.countDocuments({ taskId: taskOid }),
|
|
86
|
+
Subtask_js_1.Subtask.countDocuments({ taskId: taskOid, status: 'passed' }),
|
|
87
|
+
]);
|
|
88
|
+
return JSON.stringify({
|
|
89
|
+
success: true,
|
|
90
|
+
sessionId: session._id,
|
|
91
|
+
task,
|
|
92
|
+
lastProgressNote: lastSession?.progressNote ?? null,
|
|
93
|
+
lastGitCommit: lastSession?.gitCommit ?? null,
|
|
94
|
+
subtaskProgress: {
|
|
95
|
+
total: totalSubtasks,
|
|
96
|
+
passed: passedSubtasks,
|
|
97
|
+
remaining: remainingSubtasks,
|
|
98
|
+
percentComplete: totalSubtasks > 0 ? Math.round((passedSubtasks / totalSubtasks) * 100) : 0,
|
|
99
|
+
},
|
|
100
|
+
message: lastSession
|
|
101
|
+
? 'Previous session found. Read lastProgressNote before starting work.'
|
|
102
|
+
: 'No previous sessions. This is the first session for this task.',
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
case 'session_end': {
|
|
106
|
+
const { id, agentId, progressNote, gitCommit, tokenCount, status, subtasksAttempted, subtasksCompleted } = zod_schemas_js_1.SessionEndSchema.parse(args);
|
|
107
|
+
const session = await Session_js_1.Session.findOneAndUpdate({ _id: id, agentId }, {
|
|
108
|
+
$set: {
|
|
109
|
+
progressNote,
|
|
110
|
+
gitCommit: gitCommit ?? null,
|
|
111
|
+
tokenCount: tokenCount ?? null,
|
|
112
|
+
status,
|
|
113
|
+
endedAt: new Date(),
|
|
114
|
+
subtasksAttempted: subtasksAttempted.map((sid) => new mongoose_1.default.Types.ObjectId(sid)),
|
|
115
|
+
subtasksCompleted: subtasksCompleted.map((sid) => new mongoose_1.default.Types.ObjectId(sid)),
|
|
116
|
+
},
|
|
117
|
+
}, { new: true }).lean();
|
|
118
|
+
if (!session)
|
|
119
|
+
return JSON.stringify({ success: false, error: 'Session not found or not owned by this agent' });
|
|
120
|
+
return JSON.stringify({ success: true, session });
|
|
121
|
+
}
|
|
122
|
+
default:
|
|
123
|
+
return JSON.stringify({ success: false, error: `Unknown session tool: ${name}` });
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
exports.handleSessionTool = handleSessionTool;
|
|
127
|
+
//# sourceMappingURL=session.tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.tools.js","sourceRoot":"","sources":["../../src/tools/session.tools.ts"],"names":[],"mappings":";;;;;;AACA,wDAA+B;AAC/B,qDAA8C;AAC9C,+CAAwC;AACxC,qDAA8C;AAC9C,8DAAgF;AAEnE,QAAA,sBAAsB,GAAW;IAC5C;QACE,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE;;;;;;;;;;;iDAWgC;QAC7C,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBAC1B,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mCAAmC,EAAE;gBAC7E,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,WAAW,EAAE,4EAA4E,EAAE;aAClJ;YACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,SA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EAAE,CAAA;YAER,IAAI,CAAC,OAAO;gBAAE,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,8CAA8C,EAAE,CAAC,CAAA;YAC9G,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAA;QACnD,CAAC;QAED;YACE,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,yBAAyB,IAAI,EAAE,EAAE,CAAC,CAAA;IACrF,CAAC;AACH,CAAC,CAAA;AAlEY,QAAA,iBAAiB,qBAkE7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subtask.tools.d.ts","sourceRoot":"","sources":["../../src/tools/subtask.tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAA;AASzD,eAAO,MAAM,sBAAsB,EAAE,IAAI,EA6DxC,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAU,MAAM,MAAM,EAAE,MAAM,OAAO,KAAG,OAAO,CAAC,MAAM,CAuEnF,CAAA"}
|
|
@@ -0,0 +1,126 @@
|
|
|
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.handleSubtaskTool = exports.subtaskToolDefinitions = void 0;
|
|
7
|
+
const mongoose_1 = __importDefault(require("mongoose"));
|
|
8
|
+
const Subtask_js_1 = require("../models/Subtask.js");
|
|
9
|
+
const zod_schemas_js_1 = require("../schemas/zod.schemas.js");
|
|
10
|
+
exports.subtaskToolDefinitions = [
|
|
11
|
+
{
|
|
12
|
+
name: 'subtask_create_bulk',
|
|
13
|
+
description: 'Create the full feature/subtask list for a task in one shot. Call this once during the init phase after you have analyzed the full specification. Each subtask represents one atomic unit of work. Set dependsOn to enforce ordering. Returns all created subtask IDs.',
|
|
14
|
+
inputSchema: {
|
|
15
|
+
type: 'object',
|
|
16
|
+
properties: {
|
|
17
|
+
taskId: { type: 'string' },
|
|
18
|
+
subtasks: {
|
|
19
|
+
type: 'array',
|
|
20
|
+
items: {
|
|
21
|
+
type: 'object',
|
|
22
|
+
properties: {
|
|
23
|
+
title: { type: 'string' },
|
|
24
|
+
description: { type: 'string' },
|
|
25
|
+
category: { type: 'string', enum: ['functional', 'ui', 'performance', 'security', 'test'] },
|
|
26
|
+
steps: { type: 'array', items: { type: 'string' }, description: 'Verification steps — what done looks like' },
|
|
27
|
+
priority: { type: 'number' },
|
|
28
|
+
dependsOn: { type: 'array', items: { type: 'string' }, description: 'Subtask IDs that must pass before this one can start' },
|
|
29
|
+
},
|
|
30
|
+
required: ['title', 'description'],
|
|
31
|
+
},
|
|
32
|
+
minItems: 1,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
required: ['taskId', 'subtasks'],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'subtask_get_next',
|
|
40
|
+
description: 'Get the next subtask to work on. Returns the highest-priority pending subtask whose dependencies have all passed. Claims the subtask for your agentId atomically. Returns null if all subtasks are done or blocked. ALWAYS call this instead of choosing a subtask yourself.',
|
|
41
|
+
inputSchema: {
|
|
42
|
+
type: 'object',
|
|
43
|
+
properties: {
|
|
44
|
+
taskId: { type: 'string' },
|
|
45
|
+
agentId: { type: 'string' },
|
|
46
|
+
},
|
|
47
|
+
required: ['taskId', 'agentId'],
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'subtask_update_status',
|
|
52
|
+
description: 'Update the status of a subtask after attempting it. You MUST provide evidence of how you verified the result before marking it as passed. If failed, provide lastError so the next agent knows what went wrong.',
|
|
53
|
+
inputSchema: {
|
|
54
|
+
type: 'object',
|
|
55
|
+
properties: {
|
|
56
|
+
id: { type: 'string' },
|
|
57
|
+
agentId: { type: 'string' },
|
|
58
|
+
status: { type: 'string', enum: ['in_progress', 'passed', 'failed', 'blocked'] },
|
|
59
|
+
evidence: {
|
|
60
|
+
type: 'string',
|
|
61
|
+
description: 'Required when marking passed. Describe exactly how you verified this — e.g. "curl output showed 200", "Puppeteer screenshot confirms button renders"',
|
|
62
|
+
},
|
|
63
|
+
lastError: { type: 'string', description: 'Required when marking failed or blocked. What went wrong.' },
|
|
64
|
+
},
|
|
65
|
+
required: ['id', 'agentId', 'status'],
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
];
|
|
69
|
+
const handleSubtaskTool = async (name, args) => {
|
|
70
|
+
switch (name) {
|
|
71
|
+
case 'subtask_create_bulk': {
|
|
72
|
+
const { taskId, subtasks } = zod_schemas_js_1.SubtaskCreateBulkSchema.parse(args);
|
|
73
|
+
const taskOid = new mongoose_1.default.Types.ObjectId(taskId);
|
|
74
|
+
const docs = subtasks.map((s) => ({
|
|
75
|
+
taskId: taskOid,
|
|
76
|
+
title: s.title,
|
|
77
|
+
description: s.description,
|
|
78
|
+
category: s.category,
|
|
79
|
+
steps: s.steps,
|
|
80
|
+
priority: s.priority,
|
|
81
|
+
dependsOn: s.dependsOn.map((d) => new mongoose_1.default.Types.ObjectId(d)),
|
|
82
|
+
}));
|
|
83
|
+
const created = await Subtask_js_1.Subtask.insertMany(docs);
|
|
84
|
+
return JSON.stringify({
|
|
85
|
+
success: true,
|
|
86
|
+
count: created.length,
|
|
87
|
+
subtasks: created.map((s) => ({ id: s._id, title: s.title, priority: s.priority })),
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
case 'subtask_get_next': {
|
|
91
|
+
const { taskId, agentId } = zod_schemas_js_1.SubtaskGetNextSchema.parse(args);
|
|
92
|
+
const taskOid = new mongoose_1.default.Types.ObjectId(taskId);
|
|
93
|
+
const passedIds = await Subtask_js_1.Subtask.find({ taskId: taskOid, status: 'passed' }).distinct('_id');
|
|
94
|
+
const next = await Subtask_js_1.Subtask.findOneAndUpdate({
|
|
95
|
+
taskId: taskOid,
|
|
96
|
+
status: 'pending',
|
|
97
|
+
$or: [{ dependsOn: { $size: 0 } }, { dependsOn: { $not: { $elemMatch: { $nin: passedIds } } } }],
|
|
98
|
+
}, { $set: { status: 'in_progress', agentId }, $inc: { attempts: 1 } }, { new: true, sort: { priority: -1, createdAt: 1 } }).lean();
|
|
99
|
+
if (!next)
|
|
100
|
+
return JSON.stringify({ success: true, subtask: null, message: 'No pending subtasks available' });
|
|
101
|
+
return JSON.stringify({ success: true, subtask: next });
|
|
102
|
+
}
|
|
103
|
+
case 'subtask_update_status': {
|
|
104
|
+
const { id, agentId, status, evidence, lastError } = zod_schemas_js_1.SubtaskUpdateStatusSchema.parse(args);
|
|
105
|
+
if (status === 'passed' && !evidence) {
|
|
106
|
+
return JSON.stringify({ success: false, error: 'evidence is required when marking a subtask as passed' });
|
|
107
|
+
}
|
|
108
|
+
if ((status === 'failed' || status === 'blocked') && !lastError) {
|
|
109
|
+
return JSON.stringify({ success: false, error: 'lastError is required when marking a subtask as failed or blocked' });
|
|
110
|
+
}
|
|
111
|
+
const update = { status };
|
|
112
|
+
if (evidence !== undefined)
|
|
113
|
+
update.evidence = evidence;
|
|
114
|
+
if (lastError !== undefined)
|
|
115
|
+
update.lastError = lastError;
|
|
116
|
+
const subtask = await Subtask_js_1.Subtask.findOneAndUpdate({ _id: id, agentId }, { $set: update }, { new: true }).lean();
|
|
117
|
+
if (!subtask)
|
|
118
|
+
return JSON.stringify({ success: false, error: 'Subtask not found or not owned by this agent' });
|
|
119
|
+
return JSON.stringify({ success: true, subtask });
|
|
120
|
+
}
|
|
121
|
+
default:
|
|
122
|
+
return JSON.stringify({ success: false, error: `Unknown subtask tool: ${name}` });
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
exports.handleSubtaskTool = handleSubtaskTool;
|
|
126
|
+
//# sourceMappingURL=subtask.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AAA"}
|
|
@@ -0,0 +1,202 @@
|
|
|
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.handleTaskTool = exports.taskToolDefinitions = void 0;
|
|
7
|
+
const mongoose_1 = __importDefault(require("mongoose"));
|
|
8
|
+
const Task_js_1 = require("../models/Task.js");
|
|
9
|
+
const Subtask_js_1 = require("../models/Subtask.js");
|
|
10
|
+
const Session_js_1 = require("../models/Session.js");
|
|
11
|
+
const Checkpoint_js_1 = require("../models/Checkpoint.js");
|
|
12
|
+
const zod_schemas_js_1 = require("../schemas/zod.schemas.js");
|
|
13
|
+
exports.taskToolDefinitions = [
|
|
14
|
+
{
|
|
15
|
+
name: 'task_create',
|
|
16
|
+
description: 'Create a new top-level task. Use this at the start of any large job that will span multiple agent sessions. Returns the created task with its ID — save this ID, you will need it for all subsequent operations.',
|
|
17
|
+
inputSchema: {
|
|
18
|
+
type: 'object',
|
|
19
|
+
properties: {
|
|
20
|
+
title: { type: 'string', description: 'Short human-readable title' },
|
|
21
|
+
description: { type: 'string', description: 'Full specification of what needs to be accomplished' },
|
|
22
|
+
priority: { type: 'number', description: '1 (lowest) to 10 (highest). Default 5.' },
|
|
23
|
+
tags: { type: 'array', items: { type: 'string' }, description: 'e.g. ["web", "fullstack"]' },
|
|
24
|
+
context: {
|
|
25
|
+
type: 'object',
|
|
26
|
+
properties: {
|
|
27
|
+
workingDirectory: { type: 'string' },
|
|
28
|
+
initScript: { type: 'string' },
|
|
29
|
+
repoUrl: { type: 'string' },
|
|
30
|
+
environmentVars: { type: 'object' },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
metadata: { type: 'object', description: 'Any extra data you want to persist with this task' },
|
|
34
|
+
deadline: { type: 'string', description: 'ISO 8601 datetime string, optional' },
|
|
35
|
+
},
|
|
36
|
+
required: ['title', 'description'],
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'task_get',
|
|
41
|
+
description: 'Get a task by ID, including a summary of its subtask progress (total, passed, failed, pending). Use this to understand the current state of work before starting a session.',
|
|
42
|
+
inputSchema: {
|
|
43
|
+
type: 'object',
|
|
44
|
+
properties: {
|
|
45
|
+
id: { type: 'string', description: 'MongoDB ObjectId of the task' },
|
|
46
|
+
},
|
|
47
|
+
required: ['id'],
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'task_list',
|
|
52
|
+
description: 'List tasks with optional filters. Use this to find tasks that need work, are in progress, or match specific tags.',
|
|
53
|
+
inputSchema: {
|
|
54
|
+
type: 'object',
|
|
55
|
+
properties: {
|
|
56
|
+
status: {
|
|
57
|
+
type: 'string',
|
|
58
|
+
enum: ['pending', 'initializing', 'in_progress', 'paused', 'completed', 'failed'],
|
|
59
|
+
},
|
|
60
|
+
phase: { type: 'string', enum: ['init', 'execution'] },
|
|
61
|
+
tags: { type: 'array', items: { type: 'string' } },
|
|
62
|
+
limit: { type: 'number', description: 'Max results. Default 20, max 100.' },
|
|
63
|
+
skip: { type: 'number', description: 'Pagination offset. Default 0.' },
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'task_update',
|
|
69
|
+
description: 'Update task fields. Use to change status, phase, priority, context, or store arbitrary metadata. Only provided fields are updated.',
|
|
70
|
+
inputSchema: {
|
|
71
|
+
type: 'object',
|
|
72
|
+
properties: {
|
|
73
|
+
id: { type: 'string' },
|
|
74
|
+
title: { type: 'string' },
|
|
75
|
+
description: { type: 'string' },
|
|
76
|
+
status: { type: 'string', enum: ['pending', 'initializing', 'in_progress', 'paused', 'completed', 'failed'] },
|
|
77
|
+
phase: { type: 'string', enum: ['init', 'execution'] },
|
|
78
|
+
priority: { type: 'number' },
|
|
79
|
+
tags: { type: 'array', items: { type: 'string' } },
|
|
80
|
+
context: { type: 'object' },
|
|
81
|
+
metadata: { type: 'object' },
|
|
82
|
+
deadline: { type: 'string' },
|
|
83
|
+
},
|
|
84
|
+
required: ['id'],
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'task_delete',
|
|
89
|
+
description: 'Permanently delete a task and ALL related subtasks, sessions, and checkpoints. This cannot be undone. Only call this when you are certain the task is no longer needed.',
|
|
90
|
+
inputSchema: {
|
|
91
|
+
type: 'object',
|
|
92
|
+
properties: {
|
|
93
|
+
id: { type: 'string' },
|
|
94
|
+
},
|
|
95
|
+
required: ['id'],
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: 'task_lock',
|
|
100
|
+
description: 'Claim exclusive ownership of a task for your agentId. Prevents other agents from picking up the same task. Always lock a task before starting work. Will fail if the task is already locked by a different agent.',
|
|
101
|
+
inputSchema: {
|
|
102
|
+
type: 'object',
|
|
103
|
+
properties: {
|
|
104
|
+
id: { type: 'string' },
|
|
105
|
+
agentId: { type: 'string', description: 'A unique identifier for this agent instance' },
|
|
106
|
+
},
|
|
107
|
+
required: ['id', 'agentId'],
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: 'task_unlock',
|
|
112
|
+
description: 'Release ownership of a task. Call this at the end of a session or when handing off to another agent. Only the agent that locked the task can unlock it.',
|
|
113
|
+
inputSchema: {
|
|
114
|
+
type: 'object',
|
|
115
|
+
properties: {
|
|
116
|
+
id: { type: 'string' },
|
|
117
|
+
agentId: { type: 'string' },
|
|
118
|
+
},
|
|
119
|
+
required: ['id', 'agentId'],
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
];
|
|
123
|
+
const handleTaskTool = async (name, args) => {
|
|
124
|
+
switch (name) {
|
|
125
|
+
case 'task_create': {
|
|
126
|
+
const input = zod_schemas_js_1.TaskCreateSchema.parse(args);
|
|
127
|
+
const task = await Task_js_1.Task.create(input);
|
|
128
|
+
return JSON.stringify({ success: true, task });
|
|
129
|
+
}
|
|
130
|
+
case 'task_get': {
|
|
131
|
+
const { id } = zod_schemas_js_1.TaskGetSchema.parse(args);
|
|
132
|
+
const task = await Task_js_1.Task.findById(id).lean();
|
|
133
|
+
if (!task)
|
|
134
|
+
return JSON.stringify({ success: false, error: 'Task not found' });
|
|
135
|
+
const [total, passed, failed, pending, inProgress] = await Promise.all([
|
|
136
|
+
Subtask_js_1.Subtask.countDocuments({ taskId: id }),
|
|
137
|
+
Subtask_js_1.Subtask.countDocuments({ taskId: id, status: 'passed' }),
|
|
138
|
+
Subtask_js_1.Subtask.countDocuments({ taskId: id, status: 'failed' }),
|
|
139
|
+
Subtask_js_1.Subtask.countDocuments({ taskId: id, status: 'pending' }),
|
|
140
|
+
Subtask_js_1.Subtask.countDocuments({ taskId: id, status: 'in_progress' }),
|
|
141
|
+
]);
|
|
142
|
+
return JSON.stringify({ success: true, task, subtaskSummary: { total, passed, failed, pending, inProgress } });
|
|
143
|
+
}
|
|
144
|
+
case 'task_list': {
|
|
145
|
+
const { status, phase, tags, limit, skip } = zod_schemas_js_1.TaskListSchema.parse(args);
|
|
146
|
+
const filter = {};
|
|
147
|
+
if (status)
|
|
148
|
+
filter.status = status;
|
|
149
|
+
if (phase)
|
|
150
|
+
filter.phase = phase;
|
|
151
|
+
if (tags?.length)
|
|
152
|
+
filter.tags = { $in: tags };
|
|
153
|
+
const [tasks, total] = await Promise.all([
|
|
154
|
+
Task_js_1.Task.find(filter).sort({ priority: -1, createdAt: -1 }).limit(limit).skip(skip).lean(),
|
|
155
|
+
Task_js_1.Task.countDocuments(filter),
|
|
156
|
+
]);
|
|
157
|
+
return JSON.stringify({ success: true, tasks, total, limit, skip });
|
|
158
|
+
}
|
|
159
|
+
case 'task_update': {
|
|
160
|
+
const { id, context, ...rest } = zod_schemas_js_1.TaskUpdateSchema.parse(args);
|
|
161
|
+
const updatePayload = { ...rest };
|
|
162
|
+
if (context) {
|
|
163
|
+
Object.entries(context).forEach(([k, v]) => {
|
|
164
|
+
updatePayload[`context.${k}`] = v;
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
const task = await Task_js_1.Task.findByIdAndUpdate(id, { $set: updatePayload }, { new: true }).lean();
|
|
168
|
+
if (!task)
|
|
169
|
+
return JSON.stringify({ success: false, error: 'Task not found' });
|
|
170
|
+
return JSON.stringify({ success: true, task });
|
|
171
|
+
}
|
|
172
|
+
case 'task_delete': {
|
|
173
|
+
const { id } = zod_schemas_js_1.TaskDeleteSchema.parse(args);
|
|
174
|
+
const oid = new mongoose_1.default.Types.ObjectId(id);
|
|
175
|
+
await Promise.all([
|
|
176
|
+
Task_js_1.Task.findByIdAndDelete(id),
|
|
177
|
+
Subtask_js_1.Subtask.deleteMany({ taskId: oid }),
|
|
178
|
+
Session_js_1.Session.deleteMany({ taskId: oid }),
|
|
179
|
+
Checkpoint_js_1.Checkpoint.deleteMany({ taskId: oid }),
|
|
180
|
+
]);
|
|
181
|
+
return JSON.stringify({ success: true, message: 'Task and all related data deleted' });
|
|
182
|
+
}
|
|
183
|
+
case 'task_lock': {
|
|
184
|
+
const { id, agentId } = zod_schemas_js_1.TaskLockSchema.parse(args);
|
|
185
|
+
const task = await Task_js_1.Task.findOneAndUpdate({ _id: id, $or: [{ agentId: null }, { agentId: agentId }] }, { $set: { agentId, lockedAt: new Date() } }, { new: true }).lean();
|
|
186
|
+
if (!task)
|
|
187
|
+
return JSON.stringify({ success: false, error: 'Task is already locked by another agent' });
|
|
188
|
+
return JSON.stringify({ success: true, task });
|
|
189
|
+
}
|
|
190
|
+
case 'task_unlock': {
|
|
191
|
+
const { id, agentId } = zod_schemas_js_1.TaskUnlockSchema.parse(args);
|
|
192
|
+
const task = await Task_js_1.Task.findOneAndUpdate({ _id: id, agentId }, { $set: { agentId: null, lockedAt: null } }, { new: true }).lean();
|
|
193
|
+
if (!task)
|
|
194
|
+
return JSON.stringify({ success: false, error: 'Task not found or not owned by this agent' });
|
|
195
|
+
return JSON.stringify({ success: true, task });
|
|
196
|
+
}
|
|
197
|
+
default:
|
|
198
|
+
return JSON.stringify({ success: false, error: `Unknown task tool: ${name}` });
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
exports.handleTaskTool = handleTaskTool;
|
|
202
|
+
//# sourceMappingURL=task.tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task.tools.js","sourceRoot":"","sources":["../../src/tools/task.tools.ts"],"names":[],"mappings":";;;;;;AACA,wDAA+B;AAC/B,+CAAwC;AACxC,qDAA8C;AAC9C,qDAA8C;AAC9C,2DAAoD;AACpD,8DAQkC;AAErB,QAAA,mBAAmB,GAAW;IACzC;QACE,IAAI,EAAE,aAAa;QACnB,WAAW,EACT,kNAAkN;QACpN,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4BAA4B,EAAE;gBACpE,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qDAAqD,EAAE;gBACnG,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wCAAwC,EAAE;gBACnF,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,2BAA2B,EAAE;gBAC5F,OAAO,EAAE;oBACP,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBACpC,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBAC9B,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBAC3B,eAAe,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;qBACpC;iBACF;gBACD,QAAQ,EAAE,EAAE,IAAI,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CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YACpD,MAAM,IAAI,GAAG,MAAM,cAAI,CAAC,gBAAgB,CACtC,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,EACpB,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAC3C,EAAE,GAAG,EAAE,IAAI,EAAE,CACd,CAAC,IAAI,EAAE,CAAA;YACR,IAAI,CAAC,IAAI;gBAAE,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,2CAA2C,EAAE,CAAC,CAAA;YACxG,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAA;QAChD,CAAC;QAED;YACE,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,sBAAsB,IAAI,EAAE,EAAE,CAAC,CAAA;IAClF,CAAC;AACH,CAAC,CAAA;AA3FY,QAAA,cAAc,kBA2F1B"}
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agent-task-manager-mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MCP server for managing long-running agent tasks with MongoDB",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"agent-task-manager-mcp": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"LICENSE.md"
|
|
12
|
+
],
|
|
13
|
+
"keywords": [
|
|
14
|
+
"mcp",
|
|
15
|
+
"agent",
|
|
16
|
+
"task-manager",
|
|
17
|
+
"mongodb"
|
|
18
|
+
],
|
|
19
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=18"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "https://github.com/mlnima/agent-task-manager-mcp"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsc",
|
|
29
|
+
"dev": "tsx src/index.ts",
|
|
30
|
+
"start": "node dist/index.js"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
34
|
+
"dotenv": "^16.4.5",
|
|
35
|
+
"mongoose": "^8.5.0",
|
|
36
|
+
"zod": "^3.23.8"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@types/node": "^22.0.0",
|
|
40
|
+
"tsx": "^4.16.0",
|
|
41
|
+
"typescript": "^5.5.0"
|
|
42
|
+
}
|
|
43
|
+
}
|