@productbrain/mcp 0.0.1-beta.7503 → 0.0.1-beta.7510

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.
@@ -1498,6 +1498,7 @@ var captureSchema = z4.object({
1498
1498
  entryId: entryIdSchema,
1499
1499
  canonicalKey: z4.string().optional().describe("Semantic type (e.g. 'decision', 'tension', 'vision'). Auto-assigned from collection if omitted."),
1500
1500
  data: z4.record(z4.unknown()).optional().describe("Explicit field values when you know the schema (e.g. canonical_key, cardinality_rule, required_fields). Merged with inferred values; user-provided wins."),
1501
+ why: z4.string().optional().describe("Reasoning behind this entry \u2014 hard-required for decision/rule/strategy/purpose/vision/objective."),
1501
1502
  links: z4.array(z4.object({
1502
1503
  to: z4.string().describe("Target entry ID (e.g. '<PREFIX>-<n>')"),
1503
1504
  type: z4.string().describe("Relation type (e.g. 'governs', 'related_to', 'informs')")
@@ -1814,6 +1815,7 @@ var captureCompoundSchema = z4.object({
1814
1815
  entryId: entryIdSchema,
1815
1816
  canonicalKey: z4.string().max(200).optional().describe("Semantic type (e.g. 'decision', 'tension', 'vision'). Auto-assigned from collection if omitted."),
1816
1817
  data: z4.record(z4.unknown()).optional().describe("Explicit field values. Merged with inferred values; user-provided wins."),
1818
+ why: z4.string().max(2e4).optional().describe("Why this entry exists."),
1817
1819
  links: z4.array(z4.object({
1818
1820
  to: z4.string().max(200).describe("Target entry ID (e.g. '<PREFIX>-<n>')"),
1819
1821
  type: z4.string().max(200).describe("Relation type (e.g. 'governs', 'related_to', 'informs')")
@@ -1833,7 +1835,7 @@ var captureActionUnion = z4.discriminatedUnion("action", [
1833
1835
  ]);
1834
1836
  var CAPTURE_ACTION_SPECS = {
1835
1837
  capture: {
1836
- params: ["collection", "name", "description", "context", "entryId", "canonicalKey", "data", "links", "sourceRef", "sourceExcerpt", "preview", "suggestOnly", "format"],
1838
+ params: ["collection", "name", "description", "context", "entryId", "canonicalKey", "data", "why", "links", "sourceRef", "sourceExcerpt", "preview", "suggestOnly", "format"],
1837
1839
  description: "name and description are required."
1838
1840
  }
1839
1841
  };
@@ -1850,7 +1852,7 @@ function registerSmartCaptureTools(server) {
1850
1852
  Supported collections with smart profiles: ${SMART_PROFILE_COLLECTIONS.join(", ")}.
1851
1853
  All other collections get an ENT-{random} ID and sensible defaults.
1852
1854
 
1853
- **Explicit data:** When you know the schema, pass \`data: { field: value }\` to set fields directly. Top-level \`name\` and \`description\` always win for those fields. \`data\` wins over inference for all other fields.
1855
+ **Explicit data:** When you know the schema, pass \`data: { field: value }\` to set fields directly. Top-level \`name\`/\`description\` win for those fields; \`data\` wins over inference for the rest. Governance entries also require a top-level \`why\`.
1854
1856
 
1855
1857
  **Compound capture:** Pass \`links\` to create relations in the same call (skips auto-link discovery). Entries are always created as \`draft\` \u2014 use \`entries action=commit\` to promote when ready.`,
1856
1858
  inputSchema: captureCompoundSchema,
@@ -1867,8 +1869,9 @@ All other collections get an ENT-{random} ID and sensible defaults.
1867
1869
  })
1868
1870
  );
1869
1871
  }
1870
- async function handleCapture(server, { collection, name, description, context, entryId, canonicalKey, data: userData, links, sourceRef, sourceExcerpt, preview, suggestOnly, format, ownerRoleEntryId }) {
1872
+ async function handleCapture(server, { collection, name, description, context, entryId, canonicalKey, data: userData, why, links, sourceRef, sourceExcerpt, preview, suggestOnly, format, ownerRoleEntryId }) {
1871
1873
  requireWriteAccess();
1874
+ if (typeof why === "string" && why.trim().length > 0) userData = { ...userData && typeof userData === "object" ? userData : {}, why };
1872
1875
  const timingStart = Date.now();
1873
1876
  const wsCtx = await getWorkspaceContext();
1874
1877
  const explicitCollectionProvided = typeof collection === "string" && collection.trim().length > 0;
@@ -2987,7 +2990,7 @@ async function handleCommitEntry({ entryId, preview, steeringOverrideReason, coh
2987
2990
  if (!entry) {
2988
2991
  return notFoundResult(entryId, `Entry '${entryId}' not found. Try search to find the right ID.`);
2989
2992
  }
2990
- const descField = entry.data?.description ?? entry.data?.canonical ?? entry.data?.rationale ?? "";
2993
+ const descField = entry.data?.description ?? entry.data?.canonical ?? entry.data?.rationale ?? entry.data?.why ?? "";
2991
2994
  const preflight = await runConflictPreflight(
2992
2995
  entry.name,
2993
2996
  descField,
@@ -14867,4 +14870,4 @@ export {
14867
14870
  createProductBrainServer,
14868
14871
  initFeatureFlags
14869
14872
  };
14870
- //# sourceMappingURL=chunk-NHVFNXUV.js.map
14873
+ //# sourceMappingURL=chunk-57YGCYCX.js.map