@agent-plan/mcp 0.2.19-next.12 → 0.2.19-next.14
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/index.d.ts.map +1 -1
- package/dist/index.js +110 -4
- package/package.json +3 -3
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAohCA,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAItD"}
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
|
|
4
4
|
import * as z from "zod/v4";
|
|
5
5
|
import { join } from "node:path";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
7
|
-
import { PlanStore, ExportService, withFeatureLock, needsMotivation, findPhaseByRef, findTaskByRef, buildRecap, migrateToGlobalSequence } from "@agent-plan/core";
|
|
7
|
+
import { PlanStore, ExportService, withFeatureLock, needsMotivation, findPhaseByRef, findTaskByRef, buildRecap, migrateToGlobalSequence, addChecklistItem, removeChecklistItem, toggleChecklistItem } from "@agent-plan/core";
|
|
8
8
|
import { serve } from "@agent-plan/server";
|
|
9
9
|
import { createChecklistItemId, createFeatureId, createPhaseId, createShortId, createTaskId, clampSlug, normalizeSlug, formatPhaseRef, formatFeatureRef } from "@agent-plan/core/naming";
|
|
10
10
|
const STATUS_VALUES = ["planned", "in-progress", "done", "blocked", "canceled", "rejected", "deferred", "waiting"];
|
|
@@ -331,6 +331,7 @@ server.registerTool("planner-feature-add", {
|
|
|
331
331
|
acceptedDecisions: [],
|
|
332
332
|
phaseIds: [],
|
|
333
333
|
dependsOn: [],
|
|
334
|
+
statusLog: [],
|
|
334
335
|
createdAt: timestamp,
|
|
335
336
|
updatedAt: timestamp,
|
|
336
337
|
};
|
|
@@ -481,6 +482,7 @@ server.registerTool("planner-phase-add", {
|
|
|
481
482
|
handoffUpdatedAt: "",
|
|
482
483
|
handoffReadAt: "",
|
|
483
484
|
handoffHistory: [],
|
|
485
|
+
statusLog: [],
|
|
484
486
|
};
|
|
485
487
|
await st.savePhase(phase);
|
|
486
488
|
if (feature) {
|
|
@@ -631,7 +633,7 @@ server.registerTool("planner-task-add", {
|
|
|
631
633
|
statusLog: [],
|
|
632
634
|
decisions: [],
|
|
633
635
|
acceptedDecisions: [],
|
|
634
|
-
checklist: (checklist ?? []).map((item, index) => ({ id: createChecklistItemId(taskId, index + 1, item), title: item, checked: false })),
|
|
636
|
+
checklist: (checklist ?? []).map((item, index) => ({ id: createChecklistItemId(taskId, index + 1, item), number: index + 1, title: item, checked: false })),
|
|
635
637
|
subtasks: [],
|
|
636
638
|
dependsOn: [],
|
|
637
639
|
startedAt: "",
|
|
@@ -683,7 +685,9 @@ server.registerTool("planner-task-discuss", {
|
|
|
683
685
|
if (description !== undefined)
|
|
684
686
|
task.description = description.trim();
|
|
685
687
|
if (checklist !== undefined)
|
|
686
|
-
task.checklist = checklist.map((item, index) => ({ id: createChecklistItemId(task.id, index + 1, item), title: item, checked: false }));
|
|
688
|
+
task.checklist = checklist.map((item, index) => ({ id: createChecklistItemId(task.id, index + 1, item), number: index + 1, title: item, checked: false }));
|
|
689
|
+
if (checklist !== undefined)
|
|
690
|
+
task.checklist = checklist.map((item, index) => ({ id: createChecklistItemId(task.id, index + 1, item), number: index + 1, title: item, checked: false }));
|
|
687
691
|
task.updatedAt = nowISO();
|
|
688
692
|
phase.updatedAt = task.updatedAt;
|
|
689
693
|
updatedTask = task;
|
|
@@ -702,8 +706,9 @@ server.registerTool("planner-task-update", {
|
|
|
702
706
|
description: z.string().optional(),
|
|
703
707
|
motivation: z.string().optional(),
|
|
704
708
|
priority: z.number().int().nonnegative().optional().describe("Display order within the phase (lower = higher)."),
|
|
709
|
+
checklist: z.array(z.string()).optional().describe("Replace the task checklist (implementation steps, plain strings). Agents should tick steps via planner-task-checklist-toggle, not write DONE in titles."),
|
|
705
710
|
},
|
|
706
|
-
}, async ({ task: ref, title, status, description, motivation, priority }) => {
|
|
711
|
+
}, async ({ task: ref, title, status, description, motivation, priority, checklist }) => {
|
|
707
712
|
const st = await requireStore();
|
|
708
713
|
const found = findTaskByRef(await st.loadAllPhases(), (await st.loadFeatures()).features, ref);
|
|
709
714
|
if (!found)
|
|
@@ -750,6 +755,107 @@ server.registerTool("planner-task-update", {
|
|
|
750
755
|
const t = updatedTask ?? found.task;
|
|
751
756
|
return writeAndSummarize(st, `✅ Task updated: ${taskCompositeRef(t, found.phase, features)} — ${t.title} (${t.status})${t.shortId ? ` · ${t.shortId}` : ""}`);
|
|
752
757
|
});
|
|
758
|
+
server.registerTool("planner-task-checklist-toggle", {
|
|
759
|
+
description: "Tick/untick a task checklist item (a 'step') without rewriting the whole list. Accepts the item as C{n} (e.g. C2), the item id, or the title (case-insensitive, first match). Pass checked=true/false to set explicitly, or omit to toggle. Use this instead of writing DONE in step titles. Items are numbered C1/C2… per task.",
|
|
760
|
+
inputSchema: {
|
|
761
|
+
task: z.string().min(1).describe("Task ref: F00x/P00x/T00x, bare T00x (global), 5-char shortId, UUID, or title"),
|
|
762
|
+
item: z.string().min(1).describe("Checklist item selector: C{n} (e.g. C2), item id, or title (case-insensitive)"),
|
|
763
|
+
checked: z.boolean().optional().describe("Set explicitly: true=done, false=open. Omit to toggle."),
|
|
764
|
+
},
|
|
765
|
+
}, async ({ task: ref, item, checked }) => {
|
|
766
|
+
const st = await requireStore();
|
|
767
|
+
const found = findTaskByRef(await st.loadAllPhases(), (await st.loadFeatures()).features, ref);
|
|
768
|
+
if (!found)
|
|
769
|
+
return text(`Task not found: ${ref}`);
|
|
770
|
+
let result = "";
|
|
771
|
+
await st.updatePhase(found.phase.id, (phase) => {
|
|
772
|
+
const task = phase.tasks.find((entry) => entry.id === found.task.id);
|
|
773
|
+
if (!task) {
|
|
774
|
+
result = `Task not found: ${ref}`;
|
|
775
|
+
return phase;
|
|
776
|
+
}
|
|
777
|
+
const ck = task.checklist ?? [];
|
|
778
|
+
if (ck.length === 0) {
|
|
779
|
+
result = `Task "${found.task.title}" has no checklist.`;
|
|
780
|
+
return phase;
|
|
781
|
+
}
|
|
782
|
+
const target = toggleChecklistItem(ck, item, checked);
|
|
783
|
+
if (!target) {
|
|
784
|
+
result = `No checklist item matching "${item}".`;
|
|
785
|
+
return phase;
|
|
786
|
+
}
|
|
787
|
+
task.updatedAt = nowISO();
|
|
788
|
+
phase.updatedAt = nowISO();
|
|
789
|
+
const doneCount = ck.filter((i) => i.checked).length;
|
|
790
|
+
result = `C${target.number} "${target.title}" → ${target.checked ? "done" : "open"} (${doneCount}/${ck.length} checked)`;
|
|
791
|
+
return phase;
|
|
792
|
+
});
|
|
793
|
+
return writeAndSummarize(st, `✅ ${result}`);
|
|
794
|
+
});
|
|
795
|
+
server.registerTool("planner-task-checklist-add", {
|
|
796
|
+
description: "Add a single checklist item (a 'step') to a task without rewriting the list. The new item is appended as C{n} (next progressive number, stable id, unchecked). Use this to subdivide a task into smaller steps INSTEAD of spawning sub-tasks — the checklist keeps description, notes, statusLog and steps concentrated in one task (sub-tasks disperse context). Also use for granular adds instead of replacing the whole checklist via planner-task-update.",
|
|
797
|
+
inputSchema: {
|
|
798
|
+
task: z.string().min(1).describe("Task ref: F00x/P00x/T00x, bare T00x (global), 5-char shortId, UUID, or title"),
|
|
799
|
+
title: z.string().min(1).describe("Checklist item text (a single step)"),
|
|
800
|
+
},
|
|
801
|
+
}, async ({ task: ref, title }) => {
|
|
802
|
+
const st = await requireStore();
|
|
803
|
+
const found = findTaskByRef(await st.loadAllPhases(), (await st.loadFeatures()).features, ref);
|
|
804
|
+
if (!found)
|
|
805
|
+
return text(`Task not found: ${ref}`);
|
|
806
|
+
let result = "";
|
|
807
|
+
await st.updatePhase(found.phase.id, (phase) => {
|
|
808
|
+
const task = phase.tasks.find((entry) => entry.id === found.task.id);
|
|
809
|
+
if (!task) {
|
|
810
|
+
result = `Task not found: ${ref}`;
|
|
811
|
+
return phase;
|
|
812
|
+
}
|
|
813
|
+
const ck = task.checklist ?? [];
|
|
814
|
+
const item = addChecklistItem(ck, task.id, title);
|
|
815
|
+
ck.push(item);
|
|
816
|
+
task.checklist = ck;
|
|
817
|
+
task.updatedAt = nowISO();
|
|
818
|
+
phase.updatedAt = nowISO();
|
|
819
|
+
result = `Added C${item.number} "${item.title}" (${ck.length} items)`;
|
|
820
|
+
return phase;
|
|
821
|
+
});
|
|
822
|
+
return writeAndSummarize(st, `✅ ${result}`);
|
|
823
|
+
});
|
|
824
|
+
server.registerTool("planner-task-checklist-remove", {
|
|
825
|
+
description: "Remove a single checklist item (a 'step') from a task by C{n} (e.g. C2), item id, or title (case-insensitive). Remaining items are renumbered C1..Cn for readability; their stable ids are preserved. Use this for granular removes instead of replacing the whole checklist via planner-task-update.",
|
|
826
|
+
inputSchema: {
|
|
827
|
+
task: z.string().min(1).describe("Task ref: F00x/P00x/T00x, bare T00x (global), 5-char shortId, UUID, or title"),
|
|
828
|
+
item: z.string().min(1).describe("Checklist item selector: C{n} (e.g. C2), item id, or title (case-insensitive)"),
|
|
829
|
+
},
|
|
830
|
+
}, async ({ task: ref, item }) => {
|
|
831
|
+
const st = await requireStore();
|
|
832
|
+
const found = findTaskByRef(await st.loadAllPhases(), (await st.loadFeatures()).features, ref);
|
|
833
|
+
if (!found)
|
|
834
|
+
return text(`Task not found: ${ref}`);
|
|
835
|
+
let result = "";
|
|
836
|
+
await st.updatePhase(found.phase.id, (phase) => {
|
|
837
|
+
const task = phase.tasks.find((entry) => entry.id === found.task.id);
|
|
838
|
+
if (!task) {
|
|
839
|
+
result = `Task not found: ${ref}`;
|
|
840
|
+
return phase;
|
|
841
|
+
}
|
|
842
|
+
const ck = task.checklist ?? [];
|
|
843
|
+
if (ck.length === 0) {
|
|
844
|
+
result = `Task "${found.task.title}" has no checklist.`;
|
|
845
|
+
return phase;
|
|
846
|
+
}
|
|
847
|
+
const removed = removeChecklistItem(ck, item);
|
|
848
|
+
if (!removed) {
|
|
849
|
+
result = `No checklist item matching "${item}".`;
|
|
850
|
+
return phase;
|
|
851
|
+
}
|
|
852
|
+
task.updatedAt = nowISO();
|
|
853
|
+
phase.updatedAt = nowISO();
|
|
854
|
+
result = `Removed C${removed.number} "${removed.title}" (${ck.length} items left)`;
|
|
855
|
+
return phase;
|
|
856
|
+
});
|
|
857
|
+
return writeAndSummarize(st, `✅ ${result}`);
|
|
858
|
+
});
|
|
753
859
|
server.registerTool("planner-task-delete", {
|
|
754
860
|
description: "Delete a task.",
|
|
755
861
|
inputSchema: { task: z.string().min(1) },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-plan/mcp",
|
|
3
|
-
"version": "0.2.19-next.
|
|
3
|
+
"version": "0.2.19-next.14",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "MCP server for Agent Plan, exposing planner-* tools over stdio.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@modelcontextprotocol/sdk": "^1.17.0",
|
|
43
43
|
"zod": "^3.24.0",
|
|
44
|
-
"@agent-plan/core": "0.2.19-next.
|
|
45
|
-
"@agent-plan/server": "0.2.19-next.
|
|
44
|
+
"@agent-plan/core": "0.2.19-next.14",
|
|
45
|
+
"@agent-plan/server": "0.2.19-next.14"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "tsc -p tsconfig.json",
|