@kaddo/mcp 3.116.0 → 3.118.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 +216 -35
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -393,13 +393,15 @@ import matter10 from "gray-matter";
393
393
 
394
394
  // ../cli/src/core/config.ts
395
395
  import { z } from "zod";
396
- import { parse as parseYaml2 } from "yaml";
396
+ import { parse as parseYaml2, stringify as stringifyYaml } from "yaml";
397
397
  var PROJECT_STATES = ["new", "pre-ai", "legacy", "ai-assisted"];
398
+ var PROJECT_MODES = ["standard", "poc"];
398
399
  var TEAM_SIZES = ["indie", "small", "medium", "enterprise"];
399
400
  var REPOSITORY_STRUCTURES = ["monorepo", "multirepo"];
400
401
  var PROJECT_LANGUAGES = ["en", "es"];
401
402
  var DEFAULTS = {
402
403
  state: "pre-ai",
404
+ mode: "standard",
403
405
  structure: "monorepo",
404
406
  teamSize: "indie",
405
407
  language: "en"
@@ -411,6 +413,9 @@ function projectLanguage(config) {
411
413
  const lang = config.project.language;
412
414
  return lang === "es" ? "es" : "en";
413
415
  }
416
+ function projectMode(config) {
417
+ return config.project.mode === "poc" ? "poc" : "standard";
418
+ }
414
419
  var ConfigError = class extends Error {
415
420
  constructor(message) {
416
421
  super(message);
@@ -422,6 +427,11 @@ var projectStateSchema = z.enum(["new", "pre-ai", "legacy", "ai-assisted"], {
422
427
  message: `project.state must be one of: ${PROJECT_STATES.join(", ")}`
423
428
  })
424
429
  });
430
+ var projectModeSchema = z.enum(["standard", "poc"], {
431
+ errorMap: () => ({
432
+ message: `project.mode must be one of: ${PROJECT_MODES.join(", ")}`
433
+ })
434
+ });
425
435
  var teamSizeSchema = z.enum(["indie", "small", "medium", "enterprise"], {
426
436
  errorMap: () => ({
427
437
  message: `team.size must be one of: ${TEAM_SIZES.join(", ")}`
@@ -443,6 +453,7 @@ var configSchema = z.object({
443
453
  project: z.object({
444
454
  name: z.string().default("project"),
445
455
  state: projectStateSchema.default(DEFAULTS.state),
456
+ mode: projectModeSchema.default(DEFAULTS.mode),
446
457
  structure: structureSchema.default(DEFAULTS.structure),
447
458
  language: languageSchema.default(DEFAULTS.language),
448
459
  role: multirepoRoleSchema,
@@ -891,7 +902,7 @@ function assessPhase(input) {
891
902
 
892
903
  // ../cli/src/core/capsule.ts
893
904
  import matter4 from "gray-matter";
894
- import { parse as parseYaml7, stringify as stringifyYaml3 } from "yaml";
905
+ import { parse as parseYaml7, stringify as stringifyYaml4 } from "yaml";
895
906
 
896
907
  // ../cli/src/services/owners.ts
897
908
  import { parse as parseYaml3 } from "yaml";
@@ -1145,7 +1156,7 @@ var Q2 = o("\u25B2", "!");
1145
1156
  var ee = o("\u25A0", "x");
1146
1157
 
1147
1158
  // ../cli/src/commands/modules-map.ts
1148
- import { parse as parseYaml6, stringify as stringifyYaml2 } from "yaml";
1159
+ import { parse as parseYaml6, stringify as stringifyYaml3 } from "yaml";
1149
1160
 
1150
1161
  // ../cli/src/templates/registry.ts
1151
1162
  var QUALITY = "## Quality checklist";
@@ -2309,7 +2320,7 @@ ${QUALITY}
2309
2320
  `;
2310
2321
 
2311
2322
  // ../cli/src/commands/modules-discover.ts
2312
- import { parse as parseYaml5, stringify as stringifyYaml } from "yaml";
2323
+ import { parse as parseYaml5, stringify as stringifyYaml2 } from "yaml";
2313
2324
 
2314
2325
  // ../cli/src/core/capsule.ts
2315
2326
  var KNOWLEDGE2 = "knowledge";
@@ -4312,6 +4323,43 @@ function buildTechDecisions(dir) {
4312
4323
  };
4313
4324
  }
4314
4325
 
4326
+ // ../cli/src/core/poc.ts
4327
+ var POC_ARTIFACT_PATH = "knowledge/delivery/poc.md";
4328
+ var PLACEHOLDER = /^[_<].*[_>]$|^(describe|list|document|what|how)\b/i;
4329
+ function section2(markdown, heading) {
4330
+ const match = markdown.match(new RegExp(`^##\\s+${heading}\\s*$([\\s\\S]*?)(?=^##\\s+|(?![\\s\\S]))`, "im"));
4331
+ return match?.[1] ?? "";
4332
+ }
4333
+ function meaningful(text3) {
4334
+ return text3.split(/\r?\n/).some((line) => {
4335
+ const value = line.trim().replace(/^[-*]\s+(?:\[[^\]]+\]\s*)?/, "");
4336
+ return Boolean(value) && !PLACEHOLDER.test(value) && !/^status:\s*(pending|tbd)$/i.test(value);
4337
+ });
4338
+ }
4339
+ function readPocSummary(dir) {
4340
+ const path9 = join(dir, POC_ARTIFACT_PATH);
4341
+ if (!exists(path9)) {
4342
+ return { exists: false, hypothesisDefined: false, successCriteriaCount: 0, constraintsDefined: false, nonGoalsDefined: false, conclusion: "pending" };
4343
+ }
4344
+ let markdown = "";
4345
+ try {
4346
+ markdown = readFile(path9);
4347
+ } catch {
4348
+ return { exists: false, hypothesisDefined: false, successCriteriaCount: 0, constraintsDefined: false, nonGoalsDefined: false, conclusion: "pending" };
4349
+ }
4350
+ const criteria = section2(markdown, "Success Criteria").split(/\r?\n/).filter((line) => /^\s*[-*]\s+(?:\[[ xX]\]\s+)?/.test(line)).filter((line) => meaningful(line)).length;
4351
+ const conclusionBody = section2(markdown, "Conclusion");
4352
+ const conclusionMatch = conclusionBody.match(/\b(?:status|outcome)\s*:\s*(validated|rejected|inconclusive)\b/i);
4353
+ return {
4354
+ exists: true,
4355
+ hypothesisDefined: meaningful(section2(markdown, "Hypothesis")),
4356
+ successCriteriaCount: criteria,
4357
+ constraintsDefined: meaningful(section2(markdown, "Constraints")),
4358
+ nonGoalsDefined: meaningful(section2(markdown, "Non-goals")),
4359
+ conclusion: conclusionMatch ? conclusionMatch[1].toLowerCase() : "pending"
4360
+ };
4361
+ }
4362
+
4315
4363
  // ../cli/src/core/next-step.ts
4316
4364
  function buildDeliveryState(dir) {
4317
4365
  const wis = discoverWorkItems(dir);
@@ -4399,6 +4447,37 @@ function resolveNextStep(dir, now = /* @__PURE__ */ new Date()) {
4399
4447
  return { id: "init", phase: "Setup", label: "Run `kaddo init` to initialize Kaddo.", command: "kaddo init", reason: "Kaddo is not initialized in this project." };
4400
4448
  }
4401
4449
  const state = config.project.state;
4450
+ if (projectMode(config) === "poc") {
4451
+ const poc = readPocSummary(dir);
4452
+ if (!poc.exists) {
4453
+ return { id: "poc-artifact", phase: "POC Definition", label: "Create or restore the POC artifact.", command: "kaddo project mode poc", target: POC_ARTIFACT_PATH, reason: `Missing ${POC_ARTIFACT_PATH}.` };
4454
+ }
4455
+ if (!poc.hypothesisDefined) {
4456
+ return { id: "poc-hypothesis", phase: "POC Definition", label: "Define the POC hypothesis.", target: POC_ARTIFACT_PATH, reason: "The POC needs a testable hypothesis before work begins." };
4457
+ }
4458
+ if (poc.successCriteriaCount === 0) {
4459
+ return { id: "poc-success-criteria", phase: "POC Definition", label: "Define observable POC success criteria.", target: POC_ARTIFACT_PATH, reason: "No success criteria are defined for the hypothesis." };
4460
+ }
4461
+ const qCurrentState2 = analyzeKnowledgeArtifact(dir, CS);
4462
+ const qCodebase2 = analyzeKnowledgeArtifact(dir, CB);
4463
+ if (exists(join(dir, ".kaddo", "scan.json")) && (qCurrentState2 !== "useful" || qCodebase2 !== "useful")) {
4464
+ return { id: "poc-technical-context", phase: "POC Discovery", label: "Document the minimal technical context for the experiment.", target: qCurrentState2 !== "useful" ? CS : CB, agent: "architecture-agent", reason: "The experiment surface and constraints are not yet sufficiently documented." };
4465
+ }
4466
+ const delivery = buildDeliveryState(dir);
4467
+ if (delivery.total_work_items === 0) {
4468
+ return { id: "poc-create-experiment", phase: "Experiment", label: "Create the first experiment Work Item (prefer `spike`).", command: "kaddo create spike", reason: "The POC has no Work Item to produce evidence." };
4469
+ }
4470
+ if (delivery.in_progress_work_items > 0) {
4471
+ return { id: "guard", phase: "Experiment", label: "Run `kaddo guard` and capture evidence from the experiment.", command: "kaddo guard", reason: `${delivery.in_progress_work_items} experiment Work Item(s) are in progress.` };
4472
+ }
4473
+ if (delivery.ready_work_items > 0 || delivery.draft_work_items > 0 || delivery.blocked_work_items > 0) {
4474
+ return { id: delivery.ready_work_items > 0 ? "implement-work-item" : "refine-work-item", phase: "Experiment", label: delivery.ready_work_items > 0 ? "Implement the ready experiment Work Item and collect evidence." : "Refine the experiment Work Item before running it.", agent: "work-item-agent", reason: "The POC evidence Work Item is not complete yet." };
4475
+ }
4476
+ if (poc.conclusion === "pending") {
4477
+ return { id: "poc-evaluate", phase: "Evaluation", label: "Evaluate the experiment evidence and record the POC conclusion.", target: POC_ARTIFACT_PATH, reason: "Experiment Work Items are complete but the POC conclusion is pending." };
4478
+ }
4479
+ return { id: "poc-complete", phase: "Conclusion", label: `POC concluded: ${poc.conclusion}. Decide whether to graduate it to standard delivery.`, target: POC_ARTIFACT_PATH, reason: "The POC conclusion is recorded from experiment evidence." };
4480
+ }
4402
4481
  const q3 = (rel) => analyzeKnowledgeArtifact(dir, rel);
4403
4482
  const resolveAgent = (agent) => {
4404
4483
  const file = agent.endsWith(".md") ? agent : `${agent}.md`;
@@ -8650,6 +8729,56 @@ var LEGACY_STEPS = [
8650
8729
  runGuard,
8651
8730
  captureLearning
8652
8731
  ];
8732
+ var definePocHypothesis = {
8733
+ id: "poc-hypothesis",
8734
+ label: "Define hypothesis",
8735
+ evaluate: (ctx) => {
8736
+ const poc = readPocSummary(ctx.dir);
8737
+ return { status: poc.hypothesisDefined ? "done" : "current", evidence: poc.hypothesisDefined ? [POC_ARTIFACT_PATH] : void 0, reason: poc.hypothesisDefined ? void 0 : "A POC starts with one testable hypothesis." };
8738
+ }
8739
+ };
8740
+ var ensurePocArtifact = {
8741
+ id: "poc-artifact",
8742
+ label: "Create POC artifact",
8743
+ evaluate: (ctx) => exists(join(ctx.dir, POC_ARTIFACT_PATH)) ? { status: "done", evidence: [POC_ARTIFACT_PATH] } : { status: "current", command: "kaddo project mode poc", reason: "Create the canonical POC artifact before defining the experiment." }
8744
+ };
8745
+ var definePocCriteria = {
8746
+ id: "poc-success-criteria",
8747
+ label: "Define success criteria",
8748
+ evaluate: (ctx) => {
8749
+ const poc = readPocSummary(ctx.dir);
8750
+ return { status: poc.successCriteriaCount > 0 ? "done" : "pending", evidence: poc.successCriteriaCount > 0 ? [POC_ARTIFACT_PATH] : void 0, reason: poc.successCriteriaCount > 0 ? void 0 : "Define observable evidence for the hypothesis." };
8751
+ }
8752
+ };
8753
+ var describePocTech = {
8754
+ id: "poc-technical-context",
8755
+ label: "Document minimal technical context",
8756
+ evaluate: (ctx) => ctx.hasScan ? describeArchitecture.evaluate(ctx) : { status: "optional", command: "kaddo scan", reason: "Add technical context only when the experiment needs to inspect existing code." }
8757
+ };
8758
+ var identifyPocResources = {
8759
+ id: "poc-resources",
8760
+ label: "Identify relevant resources",
8761
+ evaluate: (ctx) => exists(join(ctx.dir, "knowledge/resources")) ? { status: "done", evidence: ["knowledge/resources/"] } : { status: "optional", command: "kaddo resources list", reason: "Add Project Resources only when the experiment depends on external systems." }
8762
+ };
8763
+ var createPocExperiment = {
8764
+ id: "poc-create-experiment",
8765
+ label: "Create experiment Work Item",
8766
+ evaluate: (ctx) => ctx.totalWorkItems > 0 ? { status: "done", evidence: ["knowledge/delivery/work-items/"] } : { status: "pending", command: "kaddo create spike", reason: "Prefer a spike for a focused experiment." }
8767
+ };
8768
+ var capturePocEvidence = {
8769
+ id: "poc-evidence",
8770
+ label: "Capture experiment evidence",
8771
+ evaluate: (ctx) => ctx.completedWorkItems > 0 ? { status: "done", evidence: ["knowledge/delivery/work-items/"] } : { status: "pending", reason: "Complete an experiment Work Item and link its evidence in the POC artifact." }
8772
+ };
8773
+ var concludePoc = {
8774
+ id: "poc-evaluate",
8775
+ label: "Evaluate and conclude",
8776
+ evaluate: (ctx) => {
8777
+ const conclusion = readPocSummary(ctx.dir).conclusion;
8778
+ return conclusion === "pending" ? { status: "pending", reason: "Record validated, rejected, or inconclusive from the evidence." } : { status: "done", evidence: [POC_ARTIFACT_PATH], reason: `Conclusion: ${conclusion}.` };
8779
+ }
8780
+ };
8781
+ var POC_STEPS = [enableKaddo, ensurePocArtifact, definePocHypothesis, definePocCriteria, describePocTech, identifyPocResources, createPocExperiment, capturePocEvidence, concludePoc];
8653
8782
  function stepsForState(state) {
8654
8783
  switch (state) {
8655
8784
  case "new":
@@ -8746,14 +8875,21 @@ function mapNextStepId(id) {
8746
8875
  "init-module-context": "enable-kaddo",
8747
8876
  "module-ready": "ready-for-core-orchestration",
8748
8877
  "validate-work-item-modules": "validate-module-knowledge",
8749
- "modules-discover": "enable-kaddo"
8878
+ "modules-discover": "enable-kaddo",
8879
+ "poc-hypothesis": "poc-hypothesis",
8880
+ "poc-success-criteria": "poc-success-criteria",
8881
+ "poc-technical-context": "poc-technical-context",
8882
+ "poc-resources": "poc-resources",
8883
+ "poc-create-experiment": "poc-create-experiment",
8884
+ "poc-evaluate": "poc-evaluate",
8885
+ "poc-complete": "poc-evaluate"
8750
8886
  };
8751
8887
  return MAP[id] ?? id;
8752
8888
  }
8753
8889
  function buildProjectRoute(dir) {
8754
8890
  const config = loadConfig(dir);
8755
8891
  const state = config?.project.state ?? "pre-ai";
8756
- const defs = config && isModule(config) ? MODULE_STEPS : stepsForState(state);
8892
+ const defs = config && projectMode(config) === "poc" ? POC_STEPS : config && isModule(config) ? MODULE_STEPS : stepsForState(state);
8757
8893
  const ctx = buildRouteContext(dir);
8758
8894
  const steps = defs.map((d3) => {
8759
8895
  const result = d3.evaluate(ctx);
@@ -10826,6 +10962,18 @@ var RESOURCES = [
10826
10962
  "Roadmap not found. Create knowledge/delivery/roadmap.md (e.g. via the roadmap-agent) first."
10827
10963
  )
10828
10964
  },
10965
+ {
10966
+ uri: "kaddo://poc",
10967
+ name: "Kaddo proof of concept",
10968
+ description: "Canonical POC hypothesis, success criteria, evidence, and conclusion.",
10969
+ mimeType: "text/markdown",
10970
+ read: (root) => fileOrHint(
10971
+ root,
10972
+ "kaddo://poc",
10973
+ "knowledge/delivery/poc.md",
10974
+ "POC artifact not found. Initialize in POC mode or switch with `kaddo project mode poc`."
10975
+ )
10976
+ },
10829
10977
  {
10830
10978
  uri: "kaddo://capsules",
10831
10979
  name: "Kaddo knowledge capsules",
@@ -11115,14 +11263,14 @@ import matter15 from "gray-matter";
11115
11263
  import fs3 from "fs";
11116
11264
  import path3 from "path";
11117
11265
  import { z as z3 } from "zod";
11118
- import { parse as parseYaml10 } from "yaml";
11266
+ import { parse as parseYaml10, stringify as stringifyYaml5 } from "yaml";
11119
11267
  import matter12 from "gray-matter";
11120
11268
  import matter22 from "gray-matter";
11121
- import { parse as parseYaml62, stringify as stringifyYaml32 } from "yaml";
11269
+ import { parse as parseYaml62, stringify as stringifyYaml42 } from "yaml";
11122
11270
  import { parse as parseYaml22 } from "yaml";
11123
11271
  import { parse as parseYaml32 } from "yaml";
11124
- import { parse as parseYaml52, stringify as stringifyYaml22 } from "yaml";
11125
- import { parse as parseYaml42, stringify as stringifyYaml4 } from "yaml";
11272
+ import { parse as parseYaml52, stringify as stringifyYaml32 } from "yaml";
11273
+ import { parse as parseYaml42, stringify as stringifyYaml22 } from "yaml";
11126
11274
  import matter32 from "gray-matter";
11127
11275
  import matter42 from "gray-matter";
11128
11276
  import matter52 from "gray-matter";
@@ -11134,7 +11282,7 @@ import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
11134
11282
  import matter72 from "gray-matter";
11135
11283
  import matter82 from "gray-matter";
11136
11284
  import matter92 from "gray-matter";
11137
- import { parse as parseYaml82, stringify as stringifyYaml42 } from "yaml";
11285
+ import { parse as parseYaml82, stringify as stringifyYaml52 } from "yaml";
11138
11286
  import fs4 from "fs";
11139
11287
  import path4 from "path";
11140
11288
  import crypto2 from "crypto";
@@ -11143,8 +11291,8 @@ import crypto3 from "crypto";
11143
11291
  import fs5 from "fs";
11144
11292
  import matter112 from "gray-matter";
11145
11293
  import matter122 from "gray-matter";
11146
- import { parse as parseYaml92, stringify as stringifyYaml5 } from "yaml";
11147
- import { parse as parseYaml102, stringify as stringifyYaml6 } from "yaml";
11294
+ import { parse as parseYaml92, stringify as stringifyYaml6 } from "yaml";
11295
+ import { parse as parseYaml102, stringify as stringifyYaml7 } from "yaml";
11148
11296
  import matter13 from "gray-matter";
11149
11297
  function exists2(p) {
11150
11298
  return fs3.existsSync(p);
@@ -11170,11 +11318,13 @@ function join3(...parts) {
11170
11318
  return path3.join(...parts);
11171
11319
  }
11172
11320
  var PROJECT_STATES2 = ["new", "pre-ai", "legacy", "ai-assisted"];
11321
+ var PROJECT_MODES2 = ["standard", "poc"];
11173
11322
  var TEAM_SIZES2 = ["indie", "small", "medium", "enterprise"];
11174
11323
  var REPOSITORY_STRUCTURES2 = ["monorepo", "multirepo"];
11175
11324
  var PROJECT_LANGUAGES2 = ["en", "es"];
11176
11325
  var DEFAULTS2 = {
11177
11326
  state: "pre-ai",
11327
+ mode: "standard",
11178
11328
  structure: "monorepo",
11179
11329
  teamSize: "indie",
11180
11330
  language: "en"
@@ -11190,6 +11340,11 @@ var projectStateSchema2 = z3.enum(["new", "pre-ai", "legacy", "ai-assisted"], {
11190
11340
  message: `project.state must be one of: ${PROJECT_STATES2.join(", ")}`
11191
11341
  })
11192
11342
  });
11343
+ var projectModeSchema2 = z3.enum(["standard", "poc"], {
11344
+ errorMap: () => ({
11345
+ message: `project.mode must be one of: ${PROJECT_MODES2.join(", ")}`
11346
+ })
11347
+ });
11193
11348
  var teamSizeSchema2 = z3.enum(["indie", "small", "medium", "enterprise"], {
11194
11349
  errorMap: () => ({
11195
11350
  message: `team.size must be one of: ${TEAM_SIZES2.join(", ")}`
@@ -11211,6 +11366,7 @@ var configSchema2 = z3.object({
11211
11366
  project: z3.object({
11212
11367
  name: z3.string().default("project"),
11213
11368
  state: projectStateSchema2.default(DEFAULTS2.state),
11369
+ mode: projectModeSchema2.default(DEFAULTS2.mode),
11214
11370
  structure: structureSchema2.default(DEFAULTS2.structure),
11215
11371
  language: languageSchema2.default(DEFAULTS2.language),
11216
11372
  role: multirepoRoleSchema2,
@@ -19306,7 +19462,7 @@ function persistConsent(dir, consent) {
19306
19462
  const prev = doc.telemetry ?? {};
19307
19463
  delete prev.enabled;
19308
19464
  doc.telemetry = { ...prev, consent, consentVersion: CURRENT_CONSENT_VERSION };
19309
- writeFile2(configPath, stringifyYaml6(doc));
19465
+ writeFile2(configPath, stringifyYaml7(doc));
19310
19466
  }
19311
19467
  function isDeferralActive(dir) {
19312
19468
  const p = join3(dir, ".kaddo", "telemetry-deferred.json");
@@ -20257,7 +20413,7 @@ function deleteResourceTool(root, id, confirm2) {
20257
20413
  import fs7 from "fs";
20258
20414
  import path6 from "path";
20259
20415
  import matter16 from "gray-matter";
20260
- import { parse as parseYaml11, stringify as stringifyYaml7 } from "yaml";
20416
+ import { parse as parseYaml11, stringify as stringifyYaml8 } from "yaml";
20261
20417
  var ok2 = (data) => ({ ok: true, data });
20262
20418
  var fail2 = (message) => ({ ok: false, message });
20263
20419
  function moduleRepoPath(m2) {
@@ -20747,7 +20903,7 @@ function modulesDiscoverTool(root, args) {
20747
20903
  descriptor.modules.push({ id: d3.id, name: d3.id, path: d3.path, parent_system: sysName, status: "configured" });
20748
20904
  }
20749
20905
  }
20750
- const ymlContent = stringifyYaml7({ version: descriptor.version ?? 1, system: sysName, workspace_roots: workspaceRoots2, modules: descriptor.modules ?? [] });
20906
+ const ymlContent = stringifyYaml8({ version: descriptor.version ?? 1, system: sysName, workspace_roots: workspaceRoots2, modules: descriptor.modules ?? [] });
20751
20907
  writeDerived(root, ".kaddo/modules.yml", ymlContent);
20752
20908
  return ok2({ discovered, applied: true });
20753
20909
  }
@@ -20793,7 +20949,7 @@ ${list3(data.owners)}
20793
20949
  }
20794
20950
 
20795
20951
  // ../cli/src/core/system-topology.ts
20796
- import { parse as parseYaml12, stringify as stringifyYaml8 } from "yaml";
20952
+ import { parse as parseYaml12, stringify as stringifyYaml9 } from "yaml";
20797
20953
  import fs8 from "fs";
20798
20954
  import path7 from "path";
20799
20955
  import crypto from "crypto";
@@ -21308,7 +21464,7 @@ function systemImpactCandidatesTool(root, args) {
21308
21464
 
21309
21465
  // ../cli/src/services/integrations.ts
21310
21466
  import matter18 from "gray-matter";
21311
- import { parse as parseYaml13, stringify as stringifyYaml9 } from "yaml";
21467
+ import { parse as parseYaml13, stringify as stringifyYaml10 } from "yaml";
21312
21468
 
21313
21469
  // ../cli/src/core/work-item-write.ts
21314
21470
  import fs9 from "fs";
@@ -22481,6 +22637,7 @@ function buildContextPack(dir, config, now = /* @__PURE__ */ new Date()) {
22481
22637
  missing.push("No work items found.");
22482
22638
  }
22483
22639
  const state = config.project.state;
22640
+ const mode = projectMode(config);
22484
22641
  const roadmapPath = join(dir, ARCH_DIR4, "delivery", "roadmap.md");
22485
22642
  const materialized = allArtifacts.filter(
22486
22643
  (a2) => a2.filePath.replace(/\\/g, "/").includes("/delivery/work-items/") && Boolean(a2.type)
@@ -22573,6 +22730,7 @@ function buildContextPack(dir, config, now = /* @__PURE__ */ new Date()) {
22573
22730
  project: {
22574
22731
  name: config.project.name,
22575
22732
  state,
22733
+ mode,
22576
22734
  teamSize: config.team.size,
22577
22735
  structure: config.project.structure,
22578
22736
  language: languageLabel(projectLanguage(config))
@@ -22598,6 +22756,7 @@ function buildContextPack(dir, config, now = /* @__PURE__ */ new Date()) {
22598
22756
  allWorkItems: allWorkItemArtifacts.map(toContextWorkItem),
22599
22757
  artifacts: allArtifacts.filter((a2) => a2.codeGlobs.length > 0).map(toContextArtifact)
22600
22758
  },
22759
+ ...mode === "poc" ? { poc: readPocSummary(dir) } : {},
22601
22760
  layers,
22602
22761
  knowledgeQuality,
22603
22762
  roadmap,
@@ -22701,11 +22860,23 @@ function renderContextPack(pack) {
22701
22860
  [
22702
22861
  `- Name: ${project.name}`,
22703
22862
  `- State: ${project.state}`,
22863
+ `- Mode: ${project.mode}`,
22704
22864
  `- Team size: ${project.teamSize}`,
22705
22865
  `- Structure: ${project.structure}`,
22706
22866
  `- Language: ${project.language}`
22707
22867
  ].join("\n") + "\n"
22708
22868
  );
22869
+ if (pack.poc) {
22870
+ parts.push("## Proof of Concept\n");
22871
+ parts.push([
22872
+ `- Hypothesis: ${pack.poc.hypothesisDefined ? "defined" : "missing"}`,
22873
+ `- Success criteria: ${pack.poc.successCriteriaCount}`,
22874
+ `- Constraints: ${pack.poc.constraintsDefined ? "defined" : "missing"}`,
22875
+ `- Non-goals: ${pack.poc.nonGoalsDefined ? "defined" : "missing"}`,
22876
+ `- Conclusion: ${pack.poc.conclusion}`,
22877
+ "- Canonical artifact: `knowledge/delivery/poc.md`"
22878
+ ].join("\n") + "\n");
22879
+ }
22709
22880
  parts.push("## Current Phase\n");
22710
22881
  parts.push(`Phase: ${pack.phase.phase}
22711
22882
  `);
@@ -22789,27 +22960,29 @@ function renderContextPack(pack) {
22789
22960
  }
22790
22961
  parts.push("## Current Knowledge\n");
22791
22962
  parts.push((knowledge.summary || "No project knowledge summary found yet.") + "\n");
22792
- parts.push("## Roadmap Status\n");
22793
- if (pack.roadmap.present) {
22794
- parts.push(
22795
- [
22796
- `- Initiatives: ${pack.roadmap.initiatives}`,
22797
- `- Work Item candidates: ${pack.roadmap.work_item_candidates}`,
22798
- `- Materialized Work Items: ${pack.roadmap.materialized_work_items}`,
22799
- `- Remaining Work Item candidates: ${pack.roadmap.remaining_work_item_candidates}`
22800
- ].join("\n") + "\n"
22801
- );
22802
- if (pack.roadmap.remaining_work_item_candidates > 0) {
22963
+ if (project.mode !== "poc") {
22964
+ parts.push("## Roadmap Status\n");
22965
+ if (pack.roadmap.present) {
22803
22966
  parts.push(
22804
- "Work Item candidates are not yet Work Items. Materialize them with `kaddo create --from roadmap`.\n"
22967
+ [
22968
+ `- Initiatives: ${pack.roadmap.initiatives}`,
22969
+ `- Work Item candidates: ${pack.roadmap.work_item_candidates}`,
22970
+ `- Materialized Work Items: ${pack.roadmap.materialized_work_items}`,
22971
+ `- Remaining Work Item candidates: ${pack.roadmap.remaining_work_item_candidates}`
22972
+ ].join("\n") + "\n"
22805
22973
  );
22974
+ if (pack.roadmap.remaining_work_item_candidates > 0) {
22975
+ parts.push(
22976
+ "Work Item candidates are not yet Work Items. Materialize them with `kaddo create --from roadmap`.\n"
22977
+ );
22978
+ }
22806
22979
  }
22980
+ parts.push((knowledge.roadmapSummary || "No roadmap baseline found.") + "\n");
22807
22981
  }
22808
- parts.push((knowledge.roadmapSummary || "No roadmap baseline found.") + "\n");
22809
22982
  const rq = pack.roadmapQuality;
22810
22983
  const rqi = rq.initiatives;
22811
22984
  const rqw = rq.work_item_candidates;
22812
- if (rqi.total > 0 || rqw.total > 0) {
22985
+ if (project.mode !== "poc" && (rqi.total > 0 || rqw.total > 0)) {
22813
22986
  parts.push("## Roadmap Quality\n");
22814
22987
  if (rqi.total > 0) {
22815
22988
  parts.push(
@@ -23024,7 +23197,13 @@ function renderContextPack(pack) {
23024
23197
  function agentIsInstalled(dir, fileName) {
23025
23198
  return exists(join(dir, agentInstallPath(fileName))) || exists(join(dir, "knowledge", "agents", fileName));
23026
23199
  }
23027
- function flowForState(state) {
23200
+ function flowForState(state, mode) {
23201
+ if (mode === "poc") {
23202
+ return [
23203
+ { agent: "architecture-agent.md", output: "knowledge/tech/current-state.md" },
23204
+ { agent: "work-item-agent.md", output: "knowledge/delivery/poc.md" }
23205
+ ];
23206
+ }
23028
23207
  switch (state) {
23029
23208
  case "new":
23030
23209
  return [
@@ -23049,9 +23228,10 @@ function flowForState(state) {
23049
23228
  }
23050
23229
  function buildUnderstandPlan(dir, config) {
23051
23230
  const state = config.project.state;
23231
+ const mode = projectMode(config);
23052
23232
  if (isModule(config)) {
23053
23233
  return {
23054
- project: { name: config.project.name, state, teamSize: config.team.size, structure: config.project.structure, language: "English" },
23234
+ project: { name: config.project.name, state, mode, teamSize: config.team.size, structure: config.project.structure, language: "English" },
23055
23235
  steps: [],
23056
23236
  missingAgents: [],
23057
23237
  agentsInstalled: true,
@@ -23059,7 +23239,7 @@ function buildUnderstandPlan(dir, config) {
23059
23239
  contextPackPath: ".kaddo/context-pack.md"
23060
23240
  };
23061
23241
  }
23062
- const flow = flowForState(state).filter((s) => !exists(join(dir, s.output)));
23242
+ const flow = flowForState(state, mode).filter((s) => !exists(join(dir, s.output)));
23063
23243
  const steps = flow.map((s) => {
23064
23244
  const installed = agentIsInstalled(dir, s.agent);
23065
23245
  return { agent: s.agent, output: s.output, installed };
@@ -23070,6 +23250,7 @@ function buildUnderstandPlan(dir, config) {
23070
23250
  project: {
23071
23251
  name: config.project.name,
23072
23252
  state,
23253
+ mode,
23073
23254
  teamSize: config.team.size,
23074
23255
  structure: config.project.structure,
23075
23256
  language: "English"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaddo/mcp",
3
- "version": "3.116.0",
3
+ "version": "3.118.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": {