@kaddo/mcp 3.45.0 → 3.46.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 +146 -25
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -7947,7 +7947,8 @@ function buildUnderstandPlan(dir, config) {
7947
7947
  name: config.project.name,
7948
7948
  state,
7949
7949
  teamSize: config.team.size,
7950
- structure: config.project.structure
7950
+ structure: config.project.structure,
7951
+ language: "English"
7951
7952
  },
7952
7953
  scanAvailable: exists(join(dir, ".kaddo", "scan.json")),
7953
7954
  contextPackPath: ".kaddo/context-pack.md",
@@ -7966,42 +7967,140 @@ function agentName(file) {
7966
7967
  }
7967
7968
  function renderUnderstand(plan) {
7968
7969
  const { project, steps } = plan;
7970
+ const rec = plan.nextStepRecommendation;
7971
+ const ds = plan.deliveryState;
7969
7972
  const parts = [];
7970
7973
  parts.push("# Kaddo Understand Handoff\n");
7971
7974
  parts.push(
7972
7975
  "> Generated by `kaddo understand`. Kaddo does not call an LLM \u2014 you stay in control of the interpretation.\n"
7973
7976
  );
7974
7977
  parts.push("## Project\n");
7975
- parts.push(
7976
- [
7977
- `- Name: ${project.name}`,
7978
- `- State: ${project.state}`,
7979
- `- Team: ${project.teamSize}`,
7980
- `- Structure: ${project.structure}`
7981
- ].join("\n") + "\n"
7982
- );
7983
- parts.push("## Recommended Agent Flow\n");
7984
- parts.push(`Recommended order for a ${stateLabel2(project.state)} project:
7978
+ const projectLines = [
7979
+ `- Name: ${project.name}`,
7980
+ `- State: ${project.state}`,
7981
+ `- Team: ${project.teamSize}`,
7982
+ `- Structure: ${project.structure}`
7983
+ ];
7984
+ if (project.language) projectLines.push(`- Language: ${project.language}`);
7985
+ parts.push(projectLines.join("\n") + "\n");
7986
+ if (plan.phase && rec) {
7987
+ parts.push("## Current Phase\n");
7988
+ const phaseLines = [`- Phase: ${plan.phase}`];
7989
+ if (rec.agent) phaseLines.push(`- Recommended agent: ${agentName(rec.agent)}`);
7990
+ if (rec.skill) phaseLines.push(`- Recommended skill: ${rec.skill}`);
7991
+ phaseLines.push(`- Next step: ${rec.label}`);
7992
+ if (rec.reason) phaseLines.push(`- Reason: ${rec.reason}`);
7993
+ parts.push(phaseLines.join("\n") + "\n");
7994
+ }
7995
+ if (ds && ds.total_work_items > 0) {
7996
+ parts.push("## Delivery State\n");
7997
+ parts.push(
7998
+ [
7999
+ `- Draft Work Items: ${ds.draft_work_items}`,
8000
+ `- Ready Work Items: ${ds.ready_work_items}`,
8001
+ `- In-progress Work Items: ${ds.in_progress_work_items}`,
8002
+ `- Blocked Work Items: ${ds.blocked_work_items}`,
8003
+ `- Ownership coverage: ${ds.ownership_coverage}`,
8004
+ `- Remaining Work Item candidates: ${ds.remaining_work_item_candidates}`,
8005
+ `- Technical decision candidates: ${ds.decision_candidates}`,
8006
+ `- Accepted ADRs: ${ds.accepted_adrs}`,
8007
+ `- Installed adapters: ${ds.adapters_installed}`
8008
+ ].join("\n") + "\n"
8009
+ );
8010
+ }
8011
+ if (steps.length > 0) {
8012
+ parts.push("## Recommended Agent Flow\n");
8013
+ parts.push(`Recommended order for a ${stateLabel2(project.state)} project:
7985
8014
  `);
7986
- parts.push(
7987
- steps.map((s, i) => {
7988
- const flag = s.installed ? "" : " _(not installed \u2014 run `kaddo add agents`)_";
7989
- return `${i + 1}. ${agentName(s.agent)} \u2192 \`${s.output}\`${flag}`;
7990
- }).join("\n") + "\n"
7991
- );
8015
+ parts.push(
8016
+ steps.map((s, i) => {
8017
+ const flag = s.installed ? "" : " _(not installed \u2014 run `kaddo add agents`)_";
8018
+ return `${i + 1}. ${agentName(s.agent)} \u2192 \`${s.output}\`${flag}`;
8019
+ }).join("\n") + "\n"
8020
+ );
8021
+ } else if (rec) {
8022
+ parts.push("## Recommended Agent Flow\n");
8023
+ const flowSteps = [];
8024
+ if (rec.agent) flowSteps.push(agentName(rec.agent));
8025
+ if (rec.secondary) {
8026
+ for (const s of rec.secondary) {
8027
+ if (s.agent) flowSteps.push(agentName(s.agent));
8028
+ else if (s.skill) flowSteps.push(`${s.skill} skill`);
8029
+ else if (s.command) flowSteps.push(`\`${s.command}\``);
8030
+ }
8031
+ }
8032
+ if (flowSteps.length > 0) {
8033
+ parts.push(flowSteps.map((f, i) => `${i + 1}. ${f}`).join("\n") + "\n");
8034
+ }
8035
+ }
8036
+ if (rec) {
8037
+ parts.push("## Primary Recommendation\n");
8038
+ const recLines = [`- id: ${rec.id}`];
8039
+ if (rec.agent) recLines.push(`- agent: ${agentName(rec.agent)}`);
8040
+ if (rec.skill) recLines.push(`- skill: ${rec.skill}`);
8041
+ if (rec.command) recLines.push(`- command: \`${rec.command}\``);
8042
+ recLines.push(`- reason: ${rec.reason}`);
8043
+ parts.push(recLines.join("\n") + "\n");
8044
+ }
8045
+ if (rec?.secondary && rec.secondary.length > 0) {
8046
+ parts.push("## Secondary Recommendations\n");
8047
+ parts.push(rec.secondary.map((s, i) => `${i + 1}. ${s.label}`).join("\n") + "\n");
8048
+ }
8049
+ if (plan.activeWorkItems && plan.activeWorkItems.length > 0) {
8050
+ parts.push("## Active Work Items\n");
8051
+ parts.push(
8052
+ plan.activeWorkItems.map((w) => `- ${w.id} [${w.type}] ${w.lifecycle} \u2014 ${w.title}`).join("\n") + "\n"
8053
+ );
8054
+ }
7992
8055
  parts.push("## Context Pack\n");
7993
8056
  const scanNote = plan.scanAvailable ? "" : " (incomplete \u2014 run `kaddo scan` first for a richer baseline)";
7994
8057
  parts.push(`Use \`${plan.contextPackPath}\` as the primary input${scanNote}.
7995
8058
  `);
8059
+ const agentPaths = [];
8060
+ if (plan.recommendedPaths && plan.recommendedPaths.length > 0) {
8061
+ agentPaths.push(...plan.recommendedPaths);
8062
+ } else if (steps.length > 0) {
8063
+ agentPaths.push(...steps.map((s) => agentInstallPath(s.agent)));
8064
+ }
8065
+ if (plan.recommendedSkillPaths && plan.recommendedSkillPaths.length > 0) {
8066
+ agentPaths.push(...plan.recommendedSkillPaths);
8067
+ }
8068
+ agentPaths.push(plan.contextPackPath);
7996
8069
  parts.push("## Agent Prompts\n");
7997
- parts.push(
7998
- steps.map((s) => `- \`${agentInstallPath(s.agent)}\``).join("\n") + "\n"
7999
- );
8000
- parts.push("## Expected Outputs\n");
8001
- parts.push(steps.map((s) => `- \`${s.output}\``).join("\n") + "\n");
8070
+ if (agentPaths.length > 1) {
8071
+ parts.push("Use:\n");
8072
+ parts.push(agentPaths.map((p) => `- \`${p}\``).join("\n") + "\n");
8073
+ } else {
8074
+ parts.push(`- \`${plan.contextPackPath}\`
8075
+ `);
8076
+ }
8077
+ if (steps.length > 0) {
8078
+ parts.push("## Expected Outputs\n");
8079
+ parts.push(steps.map((s) => `- \`${s.output}\``).join("\n") + "\n");
8080
+ } else if (rec) {
8081
+ parts.push("## Expected Outputs\n");
8082
+ const outputs = [];
8083
+ if (rec.target) outputs.push(`- \`${rec.target}\``);
8084
+ if (rec.id === "refine-work-item" || rec.id === "resolve-blocker")
8085
+ outputs.push("- Refined Work Item content.");
8086
+ if (rec.id === "create-work-item")
8087
+ outputs.push("- A new Work Item under `knowledge/delivery/work-items/`.");
8088
+ if (rec.id === "implement")
8089
+ outputs.push("- Implementation plan or code changes guided by the Work Item.");
8090
+ if (rec.id === "guard")
8091
+ outputs.push("- Updated knowledge artifacts reflecting recent code changes.");
8092
+ if (rec.id === "install-adapter")
8093
+ outputs.push("- An adapter configured and injected (`kaddo adapters list`).");
8094
+ if (outputs.length > 0) {
8095
+ parts.push("The LLM should produce:\n");
8096
+ parts.push(outputs.join("\n") + "\n");
8097
+ } else {
8098
+ parts.push("_See the primary recommendation above._\n");
8099
+ }
8100
+ }
8002
8101
  parts.push("## Copy/Paste Instructions\n");
8003
- const first2 = steps[0];
8004
- if (first2) {
8102
+ if (steps.length > 0) {
8103
+ const first2 = steps[0];
8005
8104
  parts.push(
8006
8105
  [
8007
8106
  `Start with **${agentName(first2.agent)}**:`,
@@ -8013,9 +8112,31 @@ function renderUnderstand(plan) {
8013
8112
  `5. Save the result in: \`${first2.output}\``
8014
8113
  ].join("\n") + "\n"
8015
8114
  );
8115
+ } else if (agentPaths.length > 1) {
8116
+ parts.push("Paste the following into your LLM chat:\n");
8117
+ parts.push(agentPaths.map((p, i) => `${i + 1}. \`${p}\``).join("\n") + "\n");
8118
+ if (rec?.agent) {
8119
+ parts.push(`Ask the LLM to follow the ${agentName(rec.agent)} instructions.
8120
+ `);
8121
+ }
8122
+ } else {
8123
+ parts.push(`Paste \`${plan.contextPackPath}\` into your LLM chat.
8124
+ `);
8016
8125
  }
8017
8126
  parts.push("## Next Steps\n");
8018
- if (steps.length > 1) {
8127
+ if (rec) {
8128
+ const nextLines = [];
8129
+ nextLines.push(`1. ${rec.label}`);
8130
+ let n = 2;
8131
+ if (rec.secondary) {
8132
+ for (const s of rec.secondary) {
8133
+ nextLines.push(`${n}. ${s.label}`);
8134
+ n++;
8135
+ }
8136
+ }
8137
+ nextLines.push(`${n}. Re-run \`kaddo explain\`.`);
8138
+ parts.push(nextLines.join("\n") + "\n");
8139
+ } else if (steps.length > 1) {
8019
8140
  parts.push(
8020
8141
  `After saving \`${steps[0].output}\`, continue with **${agentName(steps[1].agent)}** (feed it the context pack plus the artifacts you already produced). Re-run \`kaddo understand\` any time to see this plan again.
8021
8142
  `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaddo/mcp",
3
- "version": "3.45.0",
3
+ "version": "3.46.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": {