@kaddo/mcp 3.58.0 → 3.60.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.
Files changed (2) hide show
  1. package/dist/index.js +60 -47
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2450,7 +2450,9 @@ function buildDeliveryState(dir) {
2450
2450
  phase: "",
2451
2451
  draft_work_items: byState("draft"),
2452
2452
  refined_draft_work_items: wis.filter((w) => w.lifecycle === "draft" && w.rawFrontmatter.refined_by).length,
2453
+ refined_draft_ids: wis.filter((w) => w.lifecycle === "draft" && w.rawFrontmatter.refined_by).map((w) => w.id),
2453
2454
  ready_work_items: byState("ready"),
2455
+ ready_work_item_ids: wis.filter((w) => w.lifecycle === "ready").map((w) => w.id),
2454
2456
  in_progress_work_items: byState("in-progress"),
2455
2457
  blocked_work_items: byState("blocked"),
2456
2458
  total_work_items: total,
@@ -2576,60 +2578,42 @@ function resolveNextStep(dir, now = /* @__PURE__ */ new Date()) {
2576
2578
  const st = buildDeliveryState(dir);
2577
2579
  const secondary = buildSecondaryRecommendations(st);
2578
2580
  const roadmap = roadmapSignal(dir);
2579
- if (roadmap !== "has-candidates" && st.draft_work_items > 0) {
2580
- if (st.refined_draft_work_items > 0) {
2581
- return {
2582
- id: "review-work-item",
2583
- phase: "Active Delivery",
2584
- label: "Review the refined draft Work Item and mark it ready with `kaddo ready`.",
2585
- command: "kaddo ready",
2586
- mcpAction: "kaddo_mark_work_item_ready",
2587
- reason: `There ${st.refined_draft_work_items === 1 ? "is" : "are"} ${st.refined_draft_work_items} refined draft Work Item${st.refined_draft_work_items === 1 ? "" : "s"} awaiting human review.`,
2588
- ...secondary.length ? { secondary } : {}
2589
- };
2590
- }
2591
- return {
2592
- id: "refine-work-item",
2593
- phase: "Active Delivery",
2594
- label: "Refine the existing draft Work Item with the work-item-agent.",
2595
- agent: "work-item-agent",
2596
- skill: "work-item-refinement",
2597
- reason: `There ${st.draft_work_items === 1 ? "is" : "are"} ${st.draft_work_items} draft Work Item${st.draft_work_items === 1 ? "" : "s"}. Refine before defining roadmap candidates.`,
2598
- ...secondary.length ? { secondary } : {}
2599
- };
2600
- }
2601
- if (roadmap !== "has-candidates") {
2602
- return { id: "roadmap", phase: "Planning", label: "Use roadmap-agent to define roadmap candidates (`kaddo roadmap`).", command: "kaddo roadmap", agent: "roadmap-agent", target: "knowledge/delivery/roadmap.md", reason: "The roadmap has no candidates yet." };
2603
- }
2604
- if (st.total_work_items === 0) {
2605
- return {
2606
- id: "create-work-item",
2607
- phase: "Delivery Preparation",
2608
- label: "Run `kaddo create --from roadmap` to materialize the first Work Item.",
2609
- command: "kaddo create --from roadmap",
2610
- reason: "The roadmap has candidates but no Work Item exists yet.",
2611
- ...secondary.length ? { secondary } : {}
2612
- };
2613
- }
2614
2581
  const adapters = st.adapters_installed;
2615
2582
  if (st.ready_work_items > 0) {
2583
+ const ids = st.ready_work_item_ids;
2584
+ const single = ids.length === 1;
2585
+ const sec = [...secondary];
2586
+ if (roadmap !== "has-candidates" && st.remaining_work_item_candidates === 0) {
2587
+ sec.push({
2588
+ id: "roadmap",
2589
+ label: "Roadmap has no candidates. Consider running `kaddo roadmap` after handling ready Work Items.",
2590
+ command: "kaddo roadmap",
2591
+ agent: "roadmap-agent",
2592
+ reason: "The roadmap has no candidates yet, but ready Work Items exist."
2593
+ });
2594
+ }
2616
2595
  if (adapters === 0) {
2617
2596
  return {
2618
- id: "install-adapter",
2597
+ id: "prepare-implementation",
2619
2598
  phase: "Active Delivery",
2620
- label: "Install or configure an adapter before implementation (`kaddo adapters list`).",
2599
+ label: single ? `Prepare implementation for ${ids[0]}.` : "Prepare implementation for ready Work Items.",
2621
2600
  command: "kaddo adapters list",
2622
- reason: `${st.ready_work_items} Work Item(s) are ready but no adapter is installed.`,
2623
- ...secondary.length ? { secondary } : {}
2601
+ agent: "implementation-agent",
2602
+ skill: "implementation-planning",
2603
+ ...single ? { target: ids[0] } : { targets: ids },
2604
+ reason: single ? `${ids[0]} is ready for implementation but no adapter is installed.` : `There are ${ids.length} ready Work Items awaiting implementation but no adapter is installed.`,
2605
+ ...sec.length ? { secondary: sec } : {}
2624
2606
  };
2625
2607
  }
2626
2608
  return {
2627
- id: "implement",
2609
+ id: "implement-work-item",
2628
2610
  phase: "Active Delivery",
2629
- label: "Use the implementation-agent or your installed adapter to plan implementation.",
2611
+ label: single ? `Use implementation-agent to implement ${ids[0]}.` : "Use implementation-agent to implement ready Work Items.",
2630
2612
  agent: "implementation-agent",
2631
- reason: `${st.ready_work_items} Work Item(s) are ready and an adapter is installed.`,
2632
- ...secondary.length ? { secondary } : {}
2613
+ skill: "implementation-planning",
2614
+ ...single ? { target: ids[0] } : { targets: ids },
2615
+ reason: single ? `${ids[0]} is ready for implementation.` : `There are ${ids.length} ready Work Items awaiting implementation.`,
2616
+ ...sec.length ? { secondary: sec } : {}
2633
2617
  };
2634
2618
  }
2635
2619
  if (st.in_progress_work_items > 0) {
@@ -2642,6 +2626,20 @@ function resolveNextStep(dir, now = /* @__PURE__ */ new Date()) {
2642
2626
  ...secondary.length ? { secondary } : {}
2643
2627
  };
2644
2628
  }
2629
+ if (st.refined_draft_work_items > 0) {
2630
+ const ids = st.refined_draft_ids;
2631
+ const single = ids.length === 1;
2632
+ return {
2633
+ id: "review-work-item",
2634
+ phase: "Active Delivery",
2635
+ label: single ? `Review ${ids[0]} and mark it ready for implementation.` : "Review refined draft Work Items and mark one ready for implementation.",
2636
+ command: single ? `kaddo ready ${ids[0]}` : "kaddo ready <WI-ID>",
2637
+ mcpAction: "kaddo_mark_work_item_ready",
2638
+ ...single ? { target: ids[0], mcpArgs: { id: ids[0] } } : { targets: ids },
2639
+ reason: single ? `${ids[0]} is a refined draft Work Item awaiting human review.` : `There are ${ids.length} refined draft Work Items awaiting human review.`,
2640
+ ...secondary.length ? { secondary } : {}
2641
+ };
2642
+ }
2645
2643
  if (st.draft_work_items > 0) {
2646
2644
  return {
2647
2645
  id: "refine-work-item",
@@ -2649,7 +2647,7 @@ function resolveNextStep(dir, now = /* @__PURE__ */ new Date()) {
2649
2647
  label: "Refine the existing draft Work Item with the work-item-agent.",
2650
2648
  agent: "work-item-agent",
2651
2649
  skill: "work-item-refinement",
2652
- reason: `There ${st.draft_work_items === 1 ? "is" : "are"} ${st.draft_work_items} draft Work Item${st.draft_work_items === 1 ? "" : "s"} and no Work Item is ready.`,
2650
+ reason: `There ${st.draft_work_items === 1 ? "is" : "are"} ${st.draft_work_items} draft Work Item${st.draft_work_items === 1 ? "" : "s"}. Refine before defining roadmap candidates.`,
2653
2651
  ...secondary.length ? { secondary } : {}
2654
2652
  };
2655
2653
  }
@@ -2663,6 +2661,19 @@ function resolveNextStep(dir, now = /* @__PURE__ */ new Date()) {
2663
2661
  ...secondary.length ? { secondary } : {}
2664
2662
  };
2665
2663
  }
2664
+ if (roadmap !== "has-candidates") {
2665
+ return { id: "roadmap", phase: "Planning", label: "Use roadmap-agent to define roadmap candidates (`kaddo roadmap`).", command: "kaddo roadmap", agent: "roadmap-agent", target: "knowledge/delivery/roadmap.md", reason: "The roadmap has no candidates yet." };
2666
+ }
2667
+ if (st.total_work_items === 0) {
2668
+ return {
2669
+ id: "create-work-item",
2670
+ phase: "Delivery Preparation",
2671
+ label: "Run `kaddo create --from roadmap` to materialize the first Work Item.",
2672
+ command: "kaddo create --from roadmap",
2673
+ reason: "The roadmap has candidates but no Work Item exists yet.",
2674
+ ...secondary.length ? { secondary } : {}
2675
+ };
2676
+ }
2666
2677
  if (st.remaining_work_item_candidates > 0) {
2667
2678
  return {
2668
2679
  id: "materialize-more-work-items",
@@ -6106,7 +6117,9 @@ function mapNextStepId(id) {
6106
6117
  "refine-capabilities": "discover-capabilities",
6107
6118
  "refine-current-state": "describe-architecture",
6108
6119
  "refine-codebase": "describe-architecture",
6109
- "review-work-item": "refine-work-item"
6120
+ "review-work-item": "refine-work-item",
6121
+ "prepare-implementation": "prepare-implementation",
6122
+ "implement-work-item": "prepare-implementation"
6110
6123
  };
6111
6124
  return MAP[id] ?? id;
6112
6125
  }
@@ -9086,11 +9099,11 @@ function renderUnderstand(plan) {
9086
9099
  outputs.push("- Refined Work Item content.");
9087
9100
  if (rec.id === "create-work-item")
9088
9101
  outputs.push("- A new Work Item under `knowledge/delivery/work-items/`.");
9089
- if (rec.id === "implement")
9102
+ if (rec.id === "implement" || rec.id === "implement-work-item")
9090
9103
  outputs.push("- Implementation plan or code changes guided by the Work Item.");
9091
9104
  if (rec.id === "guard")
9092
9105
  outputs.push("- Updated knowledge artifacts reflecting recent code changes.");
9093
- if (rec.id === "install-adapter")
9106
+ if (rec.id === "install-adapter" || rec.id === "prepare-implementation")
9094
9107
  outputs.push("- An adapter configured and injected (`kaddo adapters list`).");
9095
9108
  if (outputs.length > 0) {
9096
9109
  parts.push("The LLM should produce:\n");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaddo/mcp",
3
- "version": "3.58.0",
3
+ "version": "3.60.0",
4
4
  "description": "MCP server for Kaddo project knowledge: read-only resources/tools/prompts plus safe derived generation under .kaddo/.",
5
5
  "license": "MIT",
6
6
  "repository": {