@agent-plan/mcp 0.2.19-next.23 → 0.2.19-next.25
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 +18 -21
- 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":";AA4vCA,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAItD"}
|
package/dist/index.js
CHANGED
|
@@ -4,9 +4,9 @@ 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,
|
|
7
|
+
import { PlanStore, ExportService, withFeatureLock, needsMotivation, findPhaseByRef, findTaskByRef, buildRecap, addChecklistItem, removeChecklistItem, toggleChecklistItem, buildPhaseContextBlock, checkExplicitTaskStart, recommendNextTask } from "@agent-plan/core";
|
|
8
8
|
import { serve } from "@agent-plan/server";
|
|
9
|
-
import { createChecklistItemId, createFeatureId, createPhaseId,
|
|
9
|
+
import { createChecklistItemId, createFeatureId, createPhaseId, createTaskId, clampSlug, normalizeSlug, formatPhaseRef, formatFeatureRef, validateResolvedTarget } from "@agent-plan/core/naming";
|
|
10
10
|
const STATUS_VALUES = ["planned", "in-progress", "done", "blocked", "canceled", "rejected", "deferred", "waiting"];
|
|
11
11
|
const PHASE_STATUS_VALUES = ["draft", "discovery", ...STATUS_VALUES];
|
|
12
12
|
function text(textValue, structuredContent) {
|
|
@@ -27,15 +27,10 @@ async function requireStore() {
|
|
|
27
27
|
const st = store();
|
|
28
28
|
if (!(await st.exists()))
|
|
29
29
|
throw new Error(`No .planner/ found at ${st.root}. Use planner-init first.`);
|
|
30
|
-
//
|
|
31
|
-
|
|
32
|
-
planBackfillDone = true;
|
|
33
|
-
await st.ensureShortIdsAndPriority().catch(() => { });
|
|
34
|
-
await migrateToGlobalSequence(st).catch(() => { });
|
|
35
|
-
}
|
|
30
|
+
// Opening a plan is read-only. Global migrations/backfills are explicit
|
|
31
|
+
// maintenance commands; running them here rewrites unrelated feature files.
|
|
36
32
|
return st;
|
|
37
33
|
}
|
|
38
|
-
let planBackfillDone = false;
|
|
39
34
|
// In-process web server handle, managed by the planner-web tool and planner-load.
|
|
40
35
|
// Lives as long as this MCP stdio process (i.e. the host session). Null when not running.
|
|
41
36
|
let webHandle = null;
|
|
@@ -398,12 +393,13 @@ server.registerTool("planner-feature-add", {
|
|
|
398
393
|
const timestamp = nowISO();
|
|
399
394
|
const effectiveStatus = status ?? "planned";
|
|
400
395
|
const existingFeatures = (await st.loadFeatures()).features;
|
|
401
|
-
const
|
|
396
|
+
const id = createFeatureId();
|
|
397
|
+
const identity = await st.allocateEntityIdentity("feature", id);
|
|
402
398
|
const priority = await st.nextPriority("feature");
|
|
403
399
|
const feature = {
|
|
404
|
-
id
|
|
405
|
-
number:
|
|
406
|
-
shortId,
|
|
400
|
+
id,
|
|
401
|
+
number: identity.number,
|
|
402
|
+
shortId: identity.shortId,
|
|
407
403
|
priority,
|
|
408
404
|
name: name.trim(),
|
|
409
405
|
description: description?.trim() ?? "",
|
|
@@ -583,12 +579,13 @@ server.registerTool("planner-phase-add", {
|
|
|
583
579
|
const phases = await st.loadAllPhases();
|
|
584
580
|
const featurePhases = feature ? phases.filter((phase) => phase.featureId === feature.id) : phases;
|
|
585
581
|
const timestamp = nowISO();
|
|
586
|
-
const
|
|
582
|
+
const id = createPhaseId();
|
|
583
|
+
const identity = await st.allocateEntityIdentity("phase", id);
|
|
587
584
|
const priority = await st.nextPriority("phase", feature?.id);
|
|
588
585
|
phase = {
|
|
589
|
-
id
|
|
590
|
-
number:
|
|
591
|
-
shortId,
|
|
586
|
+
id,
|
|
587
|
+
number: identity.number,
|
|
588
|
+
shortId: identity.shortId,
|
|
592
589
|
priority,
|
|
593
590
|
slug: normalizeSlug(title),
|
|
594
591
|
title: title.trim(),
|
|
@@ -789,13 +786,13 @@ server.registerTool("planner-task-add", {
|
|
|
789
786
|
return text(`Resolved phase ${found.id} no longer exists. Refusing to create task.`);
|
|
790
787
|
const timestamp = nowISO();
|
|
791
788
|
const taskId = createTaskId();
|
|
792
|
-
const
|
|
789
|
+
const identity = await st.allocateEntityIdentity("task", taskId);
|
|
793
790
|
const priority = await st.nextPriority("task", found.id);
|
|
794
791
|
const task = {
|
|
795
792
|
id: taskId,
|
|
796
793
|
phaseId: found.id,
|
|
797
|
-
number:
|
|
798
|
-
shortId,
|
|
794
|
+
number: identity.number,
|
|
795
|
+
shortId: identity.shortId,
|
|
799
796
|
priority,
|
|
800
797
|
shortName: clampSlug(title, 30, `task-${Date.now().toString(36)}`),
|
|
801
798
|
title: title.trim(),
|
|
@@ -1322,7 +1319,7 @@ server.registerTool("planner-web", {
|
|
|
1322
1319
|
return text("planner-web not running. Use planner-web with action=start to start the dashboard.");
|
|
1323
1320
|
});
|
|
1324
1321
|
server.registerTool("planner-load", {
|
|
1325
|
-
description: "Load/refresh the planner on explicit user request (NOT automatic): starts the web dashboard on LAN and returns a consolidated recap (project state, active task, pending handoff, web URL). This is the MCP equivalent of Pi /planner load. Call it ONLY when the user runs /planner load or /planner recap (or asks to load the planner). Present the recap
|
|
1322
|
+
description: "Load/refresh the planner on explicit user request (NOT automatic): starts the web dashboard on LAN and returns a consolidated recap (project state, active task, pending handoff, web URL). This is the MCP equivalent of Pi /planner load. Call it ONLY when the user runs /planner load or /planner recap (or asks to load the planner). Present the recap verbatim in that reply, including its final prominent Web UI line. A pending handoff is read-only context: NEVER call planner-handoff-show or planner-handoff-clear as part of load/recap. Archive it only when every phase task is done/canceled, when replacing it with a new handoff, or after an explicit user handoff-clear request. Do NOT start the planner/web or show the web URL unless the user explicitly asks (load/recap/web status).",
|
|
1326
1323
|
}, async () => {
|
|
1327
1324
|
const st = store();
|
|
1328
1325
|
if (!(await st.exists()))
|
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.25",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "MCP server for Agent Plan, exposing planner-* tools over stdio.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@modelcontextprotocol/sdk": "^1.17.0",
|
|
45
45
|
"zod": "^3.24.0",
|
|
46
|
-
"@agent-plan/core": "0.2.19-next.
|
|
47
|
-
"@agent-plan/server": "0.2.19-next.
|
|
46
|
+
"@agent-plan/core": "0.2.19-next.25",
|
|
47
|
+
"@agent-plan/server": "0.2.19-next.25"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "tsc -p tsconfig.json",
|