@agent-plan/mcp 0.2.22-next.3 → 0.2.22-next.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAyjDA,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAItD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAwjDA,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAItD"}
package/dist/index.js CHANGED
@@ -1112,12 +1112,12 @@ server.registerTool("planner-task-delete", {
1112
1112
  return writeAndSummarize(st, `Task deleted: ${taskCompositeRef(found.task, found.phase, tdFeatures)}${found.task.shortId ? ` · ${found.task.shortId}` : ""}`, { deleted: found.task.id });
1113
1113
  });
1114
1114
  server.registerTool("planner-task-recommend", {
1115
- description: "Return the harness-agnostic recommended task: continue one active task, otherwise choose ready work by feature → phase → task priority. Reports dependency, availability, and approved deviation/resume context without starting or blocking work.",
1115
+ description: "Return the harness-agnostic recommended task: continue one active task or the current phase, otherwise choose ready work by feature → phase → task priority. Reports dependency, availability, and approved deviation/resume context without starting or blocking work.",
1116
1116
  inputSchema: {},
1117
1117
  }, async () => {
1118
1118
  const st = await requireStore();
1119
- const [features, phases, project] = await Promise.all([st.loadFeatures(), st.loadAllPhases(), st.loadProject()]);
1120
- const result = recommendNextTask(features.features, phases, project.workDeviations);
1119
+ const [features, phases, project, resume] = await Promise.all([st.loadFeatures(), st.loadAllPhases(), st.loadProject(), st.loadResume()]);
1120
+ const result = recommendNextTask(features.features, phases, project.workDeviations, resume?.currentPhaseId);
1121
1121
  if (!result.candidate)
1122
1122
  return text(`No task recommendation: ${result.reason}`, { kind: result.kind, reason: result.reason, activeTaskIds: result.activeCandidates?.map((candidate) => candidate.task.id) ?? [] });
1123
1123
  const { candidate } = result;
@@ -1131,11 +1131,11 @@ server.registerTool("planner-task-deviation", {
1131
1131
  inputSchema: { temporary_task: z.string().min(1), resume_task: z.string().min(1).optional(), reason: z.string().min(1) },
1132
1132
  }, async ({ temporary_task, resume_task, reason }) => {
1133
1133
  const st = await requireStore();
1134
- const [features, phases, project] = await Promise.all([st.loadFeatures(), st.loadAllPhases(), st.loadProject()]);
1134
+ const [features, phases, project, focus] = await Promise.all([st.loadFeatures(), st.loadAllPhases(), st.loadProject(), st.loadResume()]);
1135
1135
  const temporary = findTaskByRef(phases, features.features, temporary_task);
1136
1136
  if (!temporary)
1137
1137
  return text(`Task not found: ${temporary_task}`);
1138
- const selected = recommendNextTask(features.features, phases, project.workDeviations);
1138
+ const selected = recommendNextTask(features.features, phases, project.workDeviations, focus?.currentPhaseId);
1139
1139
  const resume = resume_task ? findTaskByRef(phases, features.features, resume_task) : selected.candidate;
1140
1140
  if (!resume)
1141
1141
  return text(`No resume task is available. Provide resume_task explicitly. ${selected.reason}`);
@@ -1212,7 +1212,7 @@ server.registerTool("planner-task-switch", {
1212
1212
  },
1213
1213
  }, async ({ from_task, to_task, reason, what_was_being_done, resume_location, how_to_resume, switched_by }) => {
1214
1214
  const st = await requireStore();
1215
- const [featuresDoc, phases, project] = await Promise.all([st.loadFeatures(), st.loadAllPhases(), st.loadProject()]);
1215
+ const [featuresDoc, phases, project, focus] = await Promise.all([st.loadFeatures(), st.loadAllPhases(), st.loadProject(), st.loadResume()]);
1216
1216
  const features = featuresDoc.features;
1217
1217
  const source = findTaskByRef(phases, features, from_task);
1218
1218
  const target = findTaskByRef(phases, features, to_task);
@@ -1244,7 +1244,7 @@ server.registerTool("planner-task-switch", {
1244
1244
  resumeLocation: resume_location, howToResume: how_to_resume,
1245
1245
  relatedTaskId: target.task.id, pausedAt: timestamp, pausedBy: switched_by?.trim() ?? "",
1246
1246
  };
1247
- const selection = recommendNextTask(features, phases, project.workDeviations);
1247
+ const selection = recommendNextTask(features, phases, project.workDeviations, focus?.currentPhaseId);
1248
1248
  const record = {
1249
1249
  id: crypto.randomUUID(), recommendedTaskId: selection.candidate?.task.id ?? source.task.id,
1250
1250
  temporaryTaskId: target.task.id, resumeTaskId: source.task.id, reason, snapshot,
@@ -1354,12 +1354,11 @@ server.registerTool("planner-task-start", {
1354
1354
  if (!hasReadRequirements(linkedRequirementIds)) {
1355
1355
  return text("Task start denied: read the requirements linked to the task's phase and feature first.", { requirementIds: linkedRequirementIds });
1356
1356
  }
1357
- const project = await st.loadProject();
1358
- const phases = await st.loadAllPhases();
1357
+ const [project, phases, focus] = await Promise.all([st.loadProject(), st.loadAllPhases(), st.loadResume()]);
1359
1358
  const eligibility = checkExplicitTaskStart(features, phases, found.task.id, project.workDeviations);
1360
1359
  if (!eligibility.eligible)
1361
1360
  return text(`Task start denied: ${eligibility.reason}`, { reason: eligibility.reason });
1362
- const selection = recommendNextTask(features, phases, project.workDeviations);
1361
+ const selection = recommendNextTask(features, phases, project.workDeviations, focus?.currentPhaseId);
1363
1362
  if (selection.kind === "conflict") {
1364
1363
  return text(`${selection.reason} Pause/reconcile active tasks before starting another task.`, {
1365
1364
  activeTaskIds: selection.activeCandidates?.map((candidate) => candidate.task.id) ?? [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-plan/mcp",
3
- "version": "0.2.22-next.3",
3
+ "version": "0.2.22-next.4",
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.22-next.3",
47
- "@agent-plan/server": "0.2.22-next.3"
46
+ "@agent-plan/core": "0.2.22-next.4",
47
+ "@agent-plan/server": "0.2.22-next.4"
48
48
  },
49
49
  "scripts": {
50
50
  "build": "tsc -p tsconfig.json",