@productbrain/mcp 0.0.1-beta.13735 → 0.0.1-beta.13752

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,7 +361,36 @@ 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_MAX_CHARS = 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 };
366
+ var ENTRY_NAME_MAX_CHARS = Math.max(...Object.values(ENTRY_NAME_CAPS));
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()}`;
393
+ var ENTRY_BODY_HELP = "The detail, in Markdown.";
365
394
  var SOURCE_EXCERPT_MAX_CHARS = 4e3;
366
395
  var LABEL_DESCRIPTION_MAX_CHARS = 2e3;
367
396
  var RELATION_BATCH_MAX = 25;
@@ -1032,7 +1061,7 @@ var captureSchema = z5.object({
1032
1061
  links: z5.array(z5.object({
1033
1062
  to: z5.string().describe("Target entry ID (e.g. '<PREFIX>-<n>')"),
1034
1063
  type: z5.string().describe(LINK_TYPE_DESCRIPTION)
1035
- })).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."),
1036
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."),
1037
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."),
1038
1067
  // WP-316 S3: Preview gate — dry-run mode. Returns what would happen, no DB writes.
@@ -1114,17 +1143,17 @@ var CAPTURE_ACTIONS = ["capture"];
1114
1143
  var SUGGEST_ONLY_REMOVED = "suggestOnly was removed: call capture with preview: true to check a capture without writing.";
1115
1144
  var captureCompoundSchema = z5.object({
1116
1145
  action: z5.enum(CAPTURE_ACTIONS).optional().default("capture").describe("Create a single knowledge entry."),
1117
- collection: z5.string().max(200).optional().describe("Collection slug, e.g. 'tensions', 'rules', 'glossary', 'decisions'. Optional \u2014 the kernel classifies when omitted."),
1118
- name: z5.string().max(ENTRY_NAME_MAX_CHARS).optional().describe("Display name \u2014 required."),
1119
- description: z5.string().max(ENTRY_BODY_MAX_CHARS).optional().describe("Full context, in Markdown \u2014 required."),
1120
- 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)."),
1121
- canonicalKey: z5.string().max(200).optional().describe("Semantic type (e.g. 'decision', 'tension', 'vision'). Auto-assigned from collection if omitted."),
1146
+ collection: z5.string().max(200).optional().describe("Collection slug, e.g. 'tensions', 'rules', 'decisions'."),
1147
+ name: z5.string().max(ENTRY_NAME_MAX_CHARS).optional().describe(ENTRY_NAME_HELP),
1148
+ description: z5.string().max(ENTRY_BODY_MAX_CHARS).optional().describe(ENTRY_BODY_HELP),
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."),
1122
1151
  data: z5.record(z5.unknown()).optional().describe("Explicit field values; user-provided wins over inferred."),
1123
1152
  why: z5.string().max(ENTRY_BODY_MAX_CHARS).optional().describe("Why this entry exists."),
1124
1153
  links: z5.array(z5.object({
1125
1154
  to: z5.string().max(200).describe("Target entry ID (e.g. '<PREFIX>-<n>')"),
1126
1155
  type: z5.string().max(200).describe(LINK_TYPE_DESCRIPTION)
1127
- })).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."),
1128
1157
  sourceRef: z5.string().max(2e3).optional().describe("URI or path of the source document backing this entry."),
1129
1158
  sourceExcerpt: z5.string().max(SOURCE_EXCERPT_MAX_CHARS).optional().describe("Verbatim excerpt from the source backing this entry's claims."),
1130
1159
  preview: z5.boolean().optional().describe("If true, validates without writing."),
@@ -12059,4 +12088,4 @@ export {
12059
12088
  SERVER_VERSION,
12060
12089
  createProductBrainServer
12061
12090
  };
12062
- //# sourceMappingURL=chunk-JHZEBRHT.js.map
12091
+ //# sourceMappingURL=chunk-N3KVQBX6.js.map