@productbrain/mcp 0.0.1-beta.16459 → 0.0.1-beta.16477

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.
@@ -83,7 +83,7 @@ import {
83
83
  tasksUnderLines,
84
84
  withAcceptPrompt,
85
85
  workPackageListLines
86
- } from "./chunk-LLXGUAV7.js";
86
+ } from "./chunk-PJG3QSEU.js";
87
87
 
88
88
  // src/server.ts
89
89
  import { McpServer as McpServer2 } from "@modelcontextprotocol/server";
@@ -340,12 +340,37 @@ var LIST_COUNTS_OF_ROWS_READ = "The counts here are of the rows read.";
340
340
  // src/lib/checklist.ts
341
341
  var FIRST_SPINE_SUBJECT = "work_package";
342
342
  var packageNumber = (label2 = kindWord) => `${label2(SPINE_RUNG_SEQUENCE[0].targetKey)} or ${label2(KPI_KIND)}`;
343
+ var KEY_RESULT = SPINE_RUNG_SEQUENCE[0].targetKey;
344
+ var WORK_PACKAGES_SHOWN = 20;
345
+ var NOT_STARTED_LABEL = "Not started";
343
346
  var STRANDED_WORK_WORDS = {
344
347
  number: packageNumber(),
345
- heading: (n) => `Work packages with no live ${packageNumber()} (${n}):`,
346
- onlyPast: (ids) => `validates only past ${kindWord(SPINE_RUNG_SEQUENCE[0].targetKey)}s or ${kindWord(KPI_KIND)}s (${ids.join(", ")})`,
347
- none: `validates no ${packageNumber()}`
348
+ /** The labels before orient's three counts, "Started work: 2 of 4 have no live key result or KPI."; the two failing ones share `count`. */
349
+ startedLabel: "Started work",
350
+ notStartedLabel: NOT_STARTED_LABEL,
351
+ adviceLabel: `${NOT_STARTED_LABEL}, advice`,
352
+ count: (n, of, cut) => `${n} of ${of}${cut ? " read" : ""} have no live ${packageNumber()}.`,
353
+ endedCount: (n, of, cut) => `${n} of ${of}${cut ? " read" : ""} rest only on ended ${kindWord(KEY_RESULT)}s.`,
354
+ more: (k) => `and ${k} more`,
355
+ heading: (n) => `Work packages that fail, with no live ${packageNumber()} (${n}):`,
356
+ endedHeading: (n) => `${NOT_STARTED_LABEL}, resting only on ended ${kindWord(KEY_RESULT)}s; advice (${n}):`,
357
+ onlyPast: (ids) => `validates only past ${kindWord(KEY_RESULT)}s or ${kindWord(KPI_KIND)}s (${ids.join(", ")})`,
358
+ none: `validates no ${packageNumber()}`,
359
+ /** The fix after orient's two failing counts, and after its advice on packages resting only on ended key results. */
360
+ startedFix: (one) => `Link ${one ? "it" : "each"} to a live ${packageNumber()}, or close it.`,
361
+ endedFix: `Link each to a live ${packageNumber()} before it starts.`,
362
+ /** The spine check's line when its work package read hit its cap, at the CLI and MCP door (DEC-2929 points 33 and 35). */
363
+ truncated: "Work package set truncated: Not every work package was graded this pass. Run the check again."
348
364
  };
365
+ function workPackageRow(w) {
366
+ return w.name ? `${w.name.replace(/[\u0000-\u001f\u007f-\u009f]/g, " ")} (${w.id})` : w.id;
367
+ }
368
+ function workPackageListLines2(heading, list) {
369
+ if (list.length === 0) return [];
370
+ const why = (w) => w.pastTargetIds.length > 0 ? STRANDED_WORK_WORDS.onlyPast(w.pastTargetIds) : STRANDED_WORK_WORDS.none;
371
+ const more = list.length > WORK_PACKAGES_SHOWN ? [` ${STRANDED_WORK_WORDS.more(list.length - WORK_PACKAGES_SHOWN)}`] : [];
372
+ return [heading, ...list.slice(0, WORK_PACKAGES_SHOWN).map((w) => ` ${workPackageRow(w)}: ${why(w)}`), ...more];
373
+ }
349
374
  var spineSubject = (kind, label2 = kindWord) => {
350
375
  const words = withArticle(label2(kind));
351
376
  return words[0].toUpperCase() + words.slice(1);
@@ -9733,8 +9758,10 @@ function isStructural(value) {
9733
9758
  ]) {
9734
9759
  if (value[key] != null && !isStringArray(value[key])) return false;
9735
9760
  }
9736
- const stranded = value.strandedWorkPackages;
9737
- if (stranded != null && !(Array.isArray(stranded) && stranded.every((w) => isRecord2(w) && typeof w.id === "string" && isStringArray(w.pastTargetIds)))) return false;
9761
+ for (const list of [value.strandedWorkPackages, value.onEndedNumberWorkPackages]) {
9762
+ const isRow = (w) => isRecord2(w) && typeof w.id === "string" && (w.name === void 0 || typeof w.name === "string") && isStringArray(w.pastTargetIds);
9763
+ if (list != null && !(Array.isArray(list) && list.every(isRow))) return false;
9764
+ }
9738
9765
  return value.visionPurposeConnectivityTruncated === void 0 || typeof value.visionPurposeConnectivityTruncated === "boolean";
9739
9766
  }
9740
9767
  function isStrategy(value) {
@@ -9759,7 +9786,7 @@ function describeSpineStaleness(changedMemberCount, membershipTruncated = false,
9759
9786
  return reason2 + (membershipTruncated ? "; membership scan incomplete" : "");
9760
9787
  }
9761
9788
  if (relationsChanged) {
9762
- return "a part_of or validates link changed since this check ran" + (membershipTruncated ? "; membership scan incomplete" : "");
9789
+ return "a link or a work package's stage changed since this check ran" + (membershipTruncated ? "; membership scan incomplete" : "");
9763
9790
  }
9764
9791
  return "freshness could not be verified; the changed-entry count is unknown" + (membershipTruncated ? "; membership scan incomplete" : "");
9765
9792
  }
@@ -9833,6 +9860,9 @@ async function handleSpineCheck(story, refresh = false) {
9833
9860
  if (s.duplicateSingletons.purpose) lines.push(`Duplicate purpose singletons (which is canonical?): ${s.duplicateSingletons.purpose.join(", ")}`);
9834
9861
  if (s.duplicateSingletons.vision) lines.push(`Duplicate vision singletons (which is canonical?): ${s.duplicateSingletons.vision.join(", ")}`);
9835
9862
  if (s.unconnectedStrategyIds.length > 0) lines.push(`Unconnected strategies (no part_of edge to any vision): ${s.unconnectedStrategyIds.join(", ")}`);
9863
+ const stranded = s.strandedWorkPackages ?? [], ended = s.onEndedNumberWorkPackages ?? [];
9864
+ lines.push(...workPackageListLines2(STRANDED_WORK_WORDS.heading(stranded.length), stranded), ...workPackageListLines2(STRANDED_WORK_WORDS.endedHeading(ended.length), ended));
9865
+ if (verdict2.workPackagesTruncated) lines.push(STRANDED_WORK_WORDS.truncated);
9836
9866
  if ((s.strategiesWithUnknownConnectivity ?? []).length > 0) {
9837
9867
  lines.push(`Connectivity unknown (relation set truncated \u2014 not confirmed disconnected): ${s.strategiesWithUnknownConnectivity.join(", ")}`);
9838
9868
  }
@@ -12501,4 +12531,4 @@ export {
12501
12531
  SERVER_VERSION,
12502
12532
  createProductBrainServer
12503
12533
  };
12504
- //# sourceMappingURL=chunk-XHWFAFLF.js.map
12534
+ //# sourceMappingURL=chunk-JCRSJYX2.js.map