@agent-plan/mcp 0.2.19-next.13 → 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 +70 -23
- 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"];
|
|
@@ -758,9 +758,9 @@ server.registerTool("planner-task-update", {
|
|
|
758
758
|
server.registerTool("planner-task-checklist-toggle", {
|
|
759
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
760
|
inputSchema: {
|
|
761
|
-
task: z.string().min(1),
|
|
762
|
-
item: z.string().min(1),
|
|
763
|
-
checked: z.boolean().optional(),
|
|
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
764
|
},
|
|
765
765
|
}, async ({ task: ref, item, checked }) => {
|
|
766
766
|
const st = await requireStore();
|
|
@@ -779,32 +779,79 @@ server.registerTool("planner-task-checklist-toggle", {
|
|
|
779
779
|
result = `Task "${found.task.title}" has no checklist.`;
|
|
780
780
|
return phase;
|
|
781
781
|
}
|
|
782
|
-
|
|
783
|
-
const cMatch = item.match(/^C(\d+)$/i);
|
|
784
|
-
if (cMatch) {
|
|
785
|
-
const idx = parseInt(cMatch[1], 10) - 1;
|
|
786
|
-
if (idx < 0 || idx >= ck.length) {
|
|
787
|
-
result = `C${idx + 1} not found (1..${ck.length}).`;
|
|
788
|
-
return phase;
|
|
789
|
-
}
|
|
790
|
-
target = ck[idx];
|
|
791
|
-
}
|
|
792
|
-
else {
|
|
793
|
-
const needle = item.trim().toLowerCase();
|
|
794
|
-
target = ck.find((i) => i.id === item)
|
|
795
|
-
?? ck.find((i) => i.title.trim().toLowerCase() === needle)
|
|
796
|
-
?? ck.find((i) => i.title.trim().toLowerCase().includes(needle));
|
|
797
|
-
}
|
|
782
|
+
const target = toggleChecklistItem(ck, item, checked);
|
|
798
783
|
if (!target) {
|
|
799
784
|
result = `No checklist item matching "${item}".`;
|
|
800
785
|
return phase;
|
|
801
786
|
}
|
|
802
|
-
const newValue = checked ?? !target.checked;
|
|
803
|
-
target.checked = newValue;
|
|
804
787
|
task.updatedAt = nowISO();
|
|
805
788
|
phase.updatedAt = nowISO();
|
|
806
789
|
const doneCount = ck.filter((i) => i.checked).length;
|
|
807
|
-
result = `C${target.number} "${target.title}" → ${
|
|
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)`;
|
|
808
855
|
return phase;
|
|
809
856
|
});
|
|
810
857
|
return writeAndSummarize(st, `✅ ${result}`);
|
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",
|