@productbrain/mcp 0.0.1-beta.14227 → 0.0.1-beta.14234

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.
@@ -885,6 +885,15 @@ function restsOnLine(item) {
885
885
  return RESTS_ON_SENTENCES[item.kind].replace("{id}", item.entryId).replace("{label}", label).replace("{date}", date);
886
886
  }
887
887
 
888
+ // src/lib/historyLine.ts
889
+ function historyLine(h, clean) {
890
+ const date = new Date(h.timestamp).toISOString().split("T")[0];
891
+ const who = h.actingAs ? `${clean(h.displayAuthor)}, ${clean(h.actingAs)}` : clean(h.displayAuthor);
892
+ const note = h.note ? ` \u2014 ${clean(h.note)}` : "";
893
+ const qualifier = h.legacyQualifier ? ` [${clean(h.legacyQualifier)}]` : "";
894
+ return `${date}: ${clean(h.event)} (${who})${note}${qualifier}`;
895
+ }
896
+
888
897
  // src/tools/knowledge.ts
889
898
  import { z as z7 } from "zod/v3";
890
899
 
@@ -1723,11 +1732,8 @@ async function handleGetHistory({ entryId }) {
1723
1732
  }
1724
1733
  const formatted = history.map((rawH) => {
1725
1734
  const h = rawH;
1726
- const date = new Date(h.timestamp).toISOString();
1727
1735
  const changes = h.changes ? ` \u2014 ${JSON.stringify(h.changes)}` : "";
1728
- const qualifier = h.legacyQualifier ? ` [${h.legacyQualifier}]` : "";
1729
- const actingAs = h.actingAs ? `, ${sanitizeSingleLineField(h.actingAs)}` : "";
1730
- return `- **${date}** ${h.event} _(${sanitizeSingleLineField(h.displayAuthor)}${actingAs})_${changes}${qualifier}`;
1736
+ return `- ${historyLine(h, sanitizeSingleLineField)}${changes}`;
1731
1737
  }).join("\n");
1732
1738
  const cut = truncated ? `Older history left out: only the newest ${history.length} events were read.
1733
1739
 
@@ -2957,11 +2963,7 @@ function entryCard(e) {
2957
2963
  }
2958
2964
  if (Array.isArray(e.history) && e.history.length > 0) {
2959
2965
  lines.push("", "## History (last 10)", ...e.historyTruncated === true ? [`Older history left out: only the newest ${e.history.length} events were read.`] : []);
2960
- for (const h of e.history.slice(-10)) {
2961
- const date = new Date(h.timestamp).toISOString().split("T")[0];
2962
- const qualifier = h.legacyQualifier ? ` [${h.legacyQualifier}]` : "";
2963
- lines.push(`- ${date}: ${h.event} _(${sanitizeSingleLineField(h.actingAs ? `${h.displayAuthor}, ${h.actingAs}` : h.displayAuthor)})_${qualifier}`);
2964
- }
2966
+ for (const h of e.history.slice(-10)) lines.push(`- ${historyLine(h, sanitizeSingleLineField)}`);
2965
2967
  }
2966
2968
  const entryData = {
2967
2969
  entryId: String(e.entryId ?? ""),
@@ -12112,4 +12114,4 @@ export {
12112
12114
  SERVER_VERSION,
12113
12115
  createProductBrainServer
12114
12116
  };
12115
- //# sourceMappingURL=chunk-RX4OW3OO.js.map
12117
+ //# sourceMappingURL=chunk-CSF3YZ2Q.js.map