@productbrain/mcp 0.0.1-beta.5894 → 0.0.1-beta.5903

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.
@@ -8758,6 +8758,12 @@ function buildRitualsSurfaceLines(view, opts) {
8758
8758
  if (view?.atCapLine) lines.push(view.atCapLine);
8759
8759
  return lines;
8760
8760
  }
8761
+ function toSafeCodeSpan(text) {
8762
+ const longestBacktickRun = (text.match(/`+/g) ?? []).reduce((max, run) => Math.max(max, run.length), 0);
8763
+ const fence = "`".repeat(longestBacktickRun + 1);
8764
+ const pad = text.startsWith("`") || text.endsWith("`") ? " " : "";
8765
+ return `${fence}${pad}${text}${pad}${fence}`;
8766
+ }
8761
8767
  function buildDirectionLines(view) {
8762
8768
  const purpose = view?.strategicContext?.purpose;
8763
8769
  const vision = view?.strategicContext?.vision;
@@ -8770,9 +8776,11 @@ function buildDirectionLines(view) {
8770
8776
  if (vision) lines.push(`**Vision:** ${stripControlChars(vision)}`);
8771
8777
  for (const row of strategy) {
8772
8778
  const mark = provenanceMark(row.provenance);
8773
- const anchorSuffix = row.anchoredBy ? ` (${stripControlChars(row.anchoredBy)})` : "";
8779
+ const rawId = row.entryId ?? row._id;
8780
+ const idPart = typeof rawId === "string" && rawId ? `${toSafeCodeSpan(sanitizeSingleLineField(rawId))} ` : "";
8781
+ const anchorSuffix = row.anchoredBy ? ` (${sanitizeSingleLineField(row.anchoredBy)})` : "";
8774
8782
  const preview = typeof row.preview === "string" && row.preview ? ` \u2014 ${stripControlChars(row.preview)}` : "";
8775
- lines.push(`**Strategy:** ${mark}${stripControlChars(row.name)}${anchorSuffix}${preview}`);
8783
+ lines.push(`**Strategy:** ${mark}${idPart}${sanitizeSingleLineField(row.name)}${anchorSuffix}${preview}`);
8776
8784
  }
8777
8785
  return lines;
8778
8786
  }
@@ -16933,4 +16941,4 @@ export {
16933
16941
  createProductBrainServer,
16934
16942
  initFeatureFlags
16935
16943
  };
16936
- //# sourceMappingURL=chunk-DKFYOFUN.js.map
16944
+ //# sourceMappingURL=chunk-PTC2REQA.js.map