@productbrain/mcp 0.0.1-beta.79 → 0.0.1-beta.80

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.
@@ -1891,12 +1891,16 @@ var AUTO_LINK_CONFIDENCE_THRESHOLD = 35;
1891
1891
  var MAX_AUTO_LINKS = 5;
1892
1892
  var MAX_SUGGESTIONS = 5;
1893
1893
  var CAPTURE_WITHOUT_THINKING_FLAG = "capture-without-thinking";
1894
+ var BR_STD_ENTRY_ID_REGEX = /^(BR|STD)-\d+$/;
1895
+ var entryIdSchema = z2.string().regex(BR_STD_ENTRY_ID_REGEX).optional().describe(
1896
+ "Only for business-rules and standards. Must match BR-NNN or STD-NNN. Omit for all other collections \u2014 IDs are auto-generated."
1897
+ );
1894
1898
  var captureSchema = z2.object({
1895
1899
  collection: z2.string().optional().describe("Collection slug, e.g. 'tensions', 'business-rules', 'glossary', 'decisions'. Optional when `capture-without-thinking` is enabled."),
1896
1900
  name: z2.string().describe("Display name \u2014 be specific (e.g. 'Convex adjacency list won't scale for graph traversal')"),
1897
1901
  description: z2.string().describe("Full context \u2014 what's happening, why it matters, what you observed"),
1898
1902
  context: z2.string().optional().describe("Optional additional context (e.g. 'Observed during context gather calls taking 700ms+')"),
1899
- entryId: z2.string().optional().describe("Optional custom entry ID (e.g. 'TEN-my-id'). Auto-generated if omitted."),
1903
+ entryId: entryIdSchema,
1900
1904
  canonicalKey: z2.string().optional().describe("Semantic type (e.g. 'decision', 'tension', 'vision'). Auto-assigned from collection if omitted."),
1901
1905
  data: z2.record(z2.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."),
1902
1906
  links: z2.array(z2.object({
@@ -1912,7 +1916,7 @@ var batchCaptureSchema = z2.object({
1912
1916
  collection: z2.string().optional().describe("Collection slug. Optional \u2014 auto-classified via LLM when omitted (FEAT-160)."),
1913
1917
  name: z2.string().describe("Display name"),
1914
1918
  description: z2.string().describe("Full context / definition"),
1915
- entryId: z2.string().optional().describe("Optional custom entry ID")
1919
+ entryId: entryIdSchema
1916
1920
  })).min(1).max(50).describe("Array of entries to capture"),
1917
1921
  autoCommit: z2.boolean().optional().describe(
1918
1922
  "If true, commits created entries immediately after linking. If omitted, Open mode workspaces commit by default and consensus/role modes stay draft-first."
@@ -2242,6 +2246,22 @@ function registerSmartCaptureTools(server) {
2242
2246
  if (!resolvedCollection) {
2243
2247
  return buildCollectionRequiredResult();
2244
2248
  }
2249
+ if (entryId && resolvedCollection !== "business-rules" && resolvedCollection !== "standards") {
2250
+ return {
2251
+ content: [{
2252
+ type: "text",
2253
+ text: `# BR-111: entryId Not Allowed
2254
+
2255
+ \`entryId\` is only valid for \`business-rules\` and \`standards\` collections. For \`${resolvedCollection}\`, omit \`entryId\` \u2014 IDs are auto-generated.`
2256
+ }],
2257
+ structuredContent: failure(
2258
+ "INVALID_ENTRY_ID",
2259
+ `entryId is only allowed for business-rules and standards. Omit for ${resolvedCollection}.`,
2260
+ "Remove entryId from your capture call.",
2261
+ []
2262
+ )
2263
+ };
2264
+ }
2245
2265
  const profile = PROFILES.get(resolvedCollection) ?? FALLBACK_PROFILE;
2246
2266
  const col = await mcpQuery("chain.getCollection", { slug: resolvedCollection });
2247
2267
  if (!col) {
@@ -2854,6 +2874,21 @@ Use \`entries action=get\` to inspect the existing entry, or \`update-entry\` to
2854
2874
  });
2855
2875
  continue;
2856
2876
  }
2877
+ if (entry.entryId && resolvedSlug !== "business-rules" && resolvedSlug !== "standards") {
2878
+ results.push({
2879
+ name: entry.name,
2880
+ collection: resolvedSlug,
2881
+ entryId: "",
2882
+ ok: false,
2883
+ autoLinks: 0,
2884
+ status: "draft",
2885
+ classifiedBy,
2886
+ confidence,
2887
+ confidenceTier,
2888
+ error: `BR-111: entryId only allowed for business-rules and standards. Omit for ${resolvedSlug}.`
2889
+ });
2890
+ continue;
2891
+ }
2857
2892
  const data = buildDataFromFields(col.fields ?? [], profile.descriptionField, entry.description);
2858
2893
  const today = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
2859
2894
  for (const def of profile.defaults) {
@@ -3403,4 +3438,4 @@ export {
3403
3438
  formatRubricCoaching,
3404
3439
  formatRubricVerdictSection
3405
3440
  };
3406
- //# sourceMappingURL=chunk-ZY3ORYC3.js.map
3441
+ //# sourceMappingURL=chunk-G4JJNINW.js.map