@productbrain/mcp 0.0.1-beta.13746 → 0.0.1-beta.13759

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.
@@ -361,9 +361,35 @@ function resolveEffectiveCollection(result2, preview, fallbackCollection) {
361
361
 
362
362
  // src/lib/limits.ts
363
363
  var ENTRY_BODY_MAX_CHARS = 15e4;
364
- var ENTRY_NAME_CAPS = { working: 80, direction: 250, other: 250 };
364
+ var RULE_TITLE_MAX_BYTES = 110;
365
+ var ENTRY_NAME_CAPS = { outcome: 40, working: 80, rule: RULE_TITLE_MAX_BYTES, direction: 250, other: 250 };
365
366
  var ENTRY_NAME_MAX_CHARS = Math.max(...Object.values(ENTRY_NAME_CAPS));
366
- var ENTRY_NAME_HELP = `A short name, ${ENTRY_NAME_CAPS.working} characters or fewer.`;
367
+ var NAME_KINDS = {
368
+ decisions: { word: "decision", tier: "working" },
369
+ tensions: { word: "tension", tier: "working" },
370
+ insights: { word: "insight", tier: "working" },
371
+ tasks: { word: "task", tier: "working" },
372
+ questions: { word: "question", tier: "working" },
373
+ "work-packages": { word: "work package", tier: "working" },
374
+ purpose: { word: "purpose", tier: "direction" },
375
+ vision: { word: "vision", tier: "direction" },
376
+ strategy: { word: "strategy", tier: "direction" },
377
+ objectives: { word: "objective", tier: "outcome" },
378
+ "key-results": { word: "key result", tier: "outcome" },
379
+ rules: { word: "rule", tier: "rule" },
380
+ teams: { word: "team", tier: "other" },
381
+ labels: { word: "label", tier: "other" }
382
+ };
383
+ function kindsWithCap(cap) {
384
+ const words = Object.values(NAME_KINDS).filter((k) => ENTRY_NAME_CAPS[k.tier] === cap && k.tier !== "other").map((k) => k.word);
385
+ return words.length < 2 ? words.join("") : `${words.slice(0, -1).join(", ")} or ${words[words.length - 1]}`;
386
+ }
387
+ function nameLimitsSentence() {
388
+ const caps = [...new Set(Object.values(NAME_KINDS).map((k) => ENTRY_NAME_CAPS[k.tier]))].filter((cap) => cap !== ENTRY_NAME_CAPS.other).sort((a, b) => a - b);
389
+ const clauses = caps.map((cap, i) => `${cap}${cap === ENTRY_NAME_CAPS.rule ? " bytes" : i === 0 ? " characters" : ""} for ${/^[aeiou]/.test(kindsWithCap(cap)) ? "an" : "a"} ${kindsWithCap(cap)}`);
390
+ return `At most ${[...clauses, `${ENTRY_NAME_CAPS.other} for any other kind`].join(", ")}.`;
391
+ }
392
+ var ENTRY_NAME_HELP = `A short name. ${nameLimitsSentence()}`;
367
393
  var ENTRY_BODY_HELP = "The detail, in Markdown.";
368
394
  var SOURCE_EXCERPT_MAX_CHARS = 4e3;
369
395
  var LABEL_DESCRIPTION_MAX_CHARS = 2e3;
@@ -1035,7 +1061,7 @@ var captureSchema = z5.object({
1035
1061
  links: z5.array(z5.object({
1036
1062
  to: z5.string().describe("Target entry ID (e.g. '<PREFIX>-<n>')"),
1037
1063
  type: z5.string().describe(LINK_TYPE_DESCRIPTION)
1038
- })).optional().describe("Links written with the entry in one transaction; each returns written or refused with a reason; a refused link fails nothing."),
1064
+ })).optional().describe("Links written with the entry; each returns written or refused with a reason, and a refusal fails nothing."),
1039
1065
  sourceRef: z5.string().optional().describe("URI or path of the source document backing this entry (e.g. 'meeting-2026-03-28.md', 'import://batch-5'). Stored as top-level entry field, not in data."),
1040
1066
  sourceExcerpt: z5.string().optional().describe("Verbatim excerpt from the source that backs this entry's claims. Stored as top-level entry field, not in data."),
1041
1067
  // WP-316 S3: Preview gate — dry-run mode. Returns what would happen, no DB writes.
@@ -1117,17 +1143,17 @@ var CAPTURE_ACTIONS = ["capture"];
1117
1143
  var SUGGEST_ONLY_REMOVED = "suggestOnly was removed: call capture with preview: true to check a capture without writing.";
1118
1144
  var captureCompoundSchema = z5.object({
1119
1145
  action: z5.enum(CAPTURE_ACTIONS).optional().default("capture").describe("Create a single knowledge entry."),
1120
- collection: z5.string().max(200).optional().describe("Collection slug, e.g. 'tensions', 'rules', 'glossary', 'decisions'. Optional \u2014 the kernel classifies when omitted."),
1146
+ collection: z5.string().max(200).optional().describe("Collection slug, e.g. 'tensions', 'rules', 'decisions'."),
1121
1147
  name: z5.string().max(ENTRY_NAME_MAX_CHARS).optional().describe(ENTRY_NAME_HELP),
1122
1148
  description: z5.string().max(ENTRY_BODY_MAX_CHARS).optional().describe(ENTRY_BODY_HELP),
1123
- context: z5.string().max(5e3).optional().describe("Optional additional context; appended to the description, so it is stored only when the description is (not when data carries the prose field)."),
1124
- canonicalKey: z5.string().max(200).optional().describe("Semantic type (e.g. 'decision', 'tension', 'vision'). Auto-assigned from collection if omitted."),
1149
+ context: z5.string().max(5e3).optional().describe("Extra context, appended to the description: stored only when the description is, not when data carries the prose field."),
1150
+ canonicalKey: z5.string().max(200).optional().describe("Semantic type, e.g. 'decision' or 'vision'; set from the collection if omitted."),
1125
1151
  data: z5.record(z5.unknown()).optional().describe("Explicit field values; user-provided wins over inferred."),
1126
1152
  why: z5.string().max(ENTRY_BODY_MAX_CHARS).optional().describe("Why this entry exists."),
1127
1153
  links: z5.array(z5.object({
1128
1154
  to: z5.string().max(200).describe("Target entry ID (e.g. '<PREFIX>-<n>')"),
1129
1155
  type: z5.string().max(200).describe(LINK_TYPE_DESCRIPTION)
1130
- })).max(RELATION_BATCH_MAX).optional().describe("Links written with the entry in one transaction; each returns written or refused with a reason; a refused link fails nothing."),
1156
+ })).max(RELATION_BATCH_MAX).optional().describe("Links written with the entry; each returns written or refused with a reason, and a refusal fails nothing."),
1131
1157
  sourceRef: z5.string().max(2e3).optional().describe("URI or path of the source document backing this entry."),
1132
1158
  sourceExcerpt: z5.string().max(SOURCE_EXCERPT_MAX_CHARS).optional().describe("Verbatim excerpt from the source backing this entry's claims."),
1133
1159
  preview: z5.boolean().optional().describe("If true, validates without writing."),
@@ -12062,4 +12088,4 @@ export {
12062
12088
  SERVER_VERSION,
12063
12089
  createProductBrainServer
12064
12090
  };
12065
- //# sourceMappingURL=chunk-GUT3AGLO.js.map
12091
+ //# sourceMappingURL=chunk-N3KVQBX6.js.map