@productbrain/mcp 0.0.1-beta.14531 → 0.0.1-beta.14536

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.
@@ -219,10 +219,79 @@ function servedSchema(schema) {
219
219
  return schema;
220
220
  }
221
221
 
222
+ // src/lib/limits.ts
223
+ var ENTRY_BODY_MAX_CHARS = 15e4;
224
+ var RULE_TITLE_MAX_BYTES = 110;
225
+ var ENTRY_NAME_CAPS = { outcome: 40, working: 80, rule: RULE_TITLE_MAX_BYTES, direction: 250, other: 250 };
226
+ var ENTRY_NAME_MAX_CHARS = Math.max(...Object.values(ENTRY_NAME_CAPS));
227
+ var NAME_KINDS = {
228
+ decisions: { word: "decision", tier: "working" },
229
+ tensions: { word: "tension", tier: "working" },
230
+ insights: { word: "insight", tier: "working" },
231
+ tasks: { word: "task", tier: "working" },
232
+ questions: { word: "question", tier: "working" },
233
+ "work-packages": { word: "work package", tier: "working" },
234
+ purpose: { word: "purpose", tier: "direction" },
235
+ vision: { word: "vision", tier: "direction" },
236
+ strategy: { word: "strategy", tier: "direction" },
237
+ objectives: { word: "objective", tier: "outcome" },
238
+ "key-results": { word: "key result", tier: "outcome" },
239
+ rules: { word: "rule", tier: "rule" },
240
+ teams: { word: "team", tier: "other" },
241
+ labels: { word: "label", tier: "other" }
242
+ };
243
+ function isAcronym(word) {
244
+ return /^(?=[0-9]*[A-Z])[A-Z0-9]{2,}s?$/.test(word);
245
+ }
246
+ function withArticle(word) {
247
+ const first = word.split(/[^A-Za-z0-9]/)[0] ?? "";
248
+ const vowelSound = isAcronym(first) ? /^[AEFHILMNORSX]/.test(first) : /^[aeiou]/i.test(word);
249
+ return `${vowelSound ? "an" : "a"} ${word}`;
250
+ }
251
+ function kindsWithCap(cap) {
252
+ const words = Object.values(NAME_KINDS).filter((k) => ENTRY_NAME_CAPS[k.tier] === cap && k.tier !== "other").map((k) => k.word);
253
+ return words.length < 2 ? words.join("") : `${words.slice(0, -1).join(", ")} or ${words[words.length - 1]}`;
254
+ }
255
+ function nameLimitsSentence() {
256
+ 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);
257
+ const clauses = caps.map((cap, i) => `${cap}${cap === ENTRY_NAME_CAPS.rule ? " bytes" : i === 0 ? " characters" : ""} for ${withArticle(kindsWithCap(cap))}`);
258
+ return `At most ${[...clauses, `${ENTRY_NAME_CAPS.other} for any other kind`].join(", ")}.`;
259
+ }
260
+ var ENTRY_NAME_HELP = `A short name. ${nameLimitsSentence()}`;
261
+ var ENTRY_BODY_CAPS = {
262
+ "key-results": { word: "key result", max: 4e3 }
263
+ };
264
+ var KEY_RESULT_BODY_HELP = `For a key result, open with what counts toward it; at most ${ENTRY_BODY_CAPS["key-results"].max} characters.`;
265
+ var ENTRY_BODY_HELP = `The detail, in Markdown. ${KEY_RESULT_BODY_HELP}`;
266
+ var SOURCE_EXCERPT_MAX_CHARS = 4e3;
267
+ var LABEL_DESCRIPTION_MAX_CHARS = 2e3;
268
+ var REASON_MAX_LENGTH = 200;
269
+ var REASON_LENGTH_FIX = `Keep the reason to one line of at most ${REASON_MAX_LENGTH} characters.`;
270
+ var REASON_WITHOUT_REPLACES = "A reason goes only with the entry this one replaces. Nothing was accepted.";
271
+ var RELATION_BATCH_MAX = 25;
272
+ var BATCH_GET_CHUNK = 4;
273
+ async function readInChunks(ids, read) {
274
+ const chunks = Array.from({ length: Math.ceil(ids.length / BATCH_GET_CHUNK) }, (_, i) => ids.slice(i * BATCH_GET_CHUNK, (i + 1) * BATCH_GET_CHUNK));
275
+ return (await Promise.all(chunks.map(read))).flat();
276
+ }
277
+ var ANSWER_TEXT_MAX_CHARS = 4e3;
278
+ var ANSWER_REFUSAL_FIX = "Shorten the answer.";
279
+ function answerTextRefusal(answer2) {
280
+ if (answer2.length <= ANSWER_TEXT_MAX_CHARS) return null;
281
+ return `Answer is ${answer2.length} characters; the cap for an answer is ${ANSWER_TEXT_MAX_CHARS}. ${ANSWER_REFUSAL_FIX}`;
282
+ }
283
+ var ANSWER_POINTER_ONLY_REFUSAL = "An answer is written in full: write the answer, and add the link beside it.";
284
+ var ANSWER_EMPTY_REFUSAL = "Answer text cannot be empty.";
285
+ var ANSWER_TEXT_HELP = `The answer in full, at most ${ANSWER_TEXT_MAX_CHARS.toLocaleString("en-US")} characters.`;
286
+ var ANSWER_ENTRY_HELP = "Link an entry beside the answer text; it resolves the question. Never instead of the text.";
287
+ function listCutLine(shown) {
288
+ return shown > 0 ? `Only the first ${shown} entries were read.` : "No entries matched in the part of the list that was read.";
289
+ }
290
+ var LIST_COUNTS_OF_ROWS_READ = "The counts here are of the rows read.";
291
+
222
292
  // src/lib/checklist.ts
223
293
  var FIRST_SPINE_SUBJECT = "work_package";
224
294
  var kindWord = (kind) => kind.replace(/_/g, " ");
225
- var withArticle = (word) => `${/^[aeiou]/i.test(word) ? "an" : "a"} ${word}`;
226
295
  var spineSubject = (kind, label2 = kindWord) => {
227
296
  const words = withArticle(label2(kind));
228
297
  return words[0].toUpperCase() + words.slice(1);
@@ -394,68 +463,6 @@ function resolveEffectiveCollection(result2, preview, fallbackCollection) {
394
463
  return preview && result2 && isPreviewCreateEntryResult(result2) ? result2.collection ?? fallbackCollection : fallbackCollection;
395
464
  }
396
465
 
397
- // src/lib/limits.ts
398
- var ENTRY_BODY_MAX_CHARS = 15e4;
399
- var RULE_TITLE_MAX_BYTES = 110;
400
- var ENTRY_NAME_CAPS = { outcome: 40, working: 80, rule: RULE_TITLE_MAX_BYTES, direction: 250, other: 250 };
401
- var ENTRY_NAME_MAX_CHARS = Math.max(...Object.values(ENTRY_NAME_CAPS));
402
- var NAME_KINDS = {
403
- decisions: { word: "decision", tier: "working" },
404
- tensions: { word: "tension", tier: "working" },
405
- insights: { word: "insight", tier: "working" },
406
- tasks: { word: "task", tier: "working" },
407
- questions: { word: "question", tier: "working" },
408
- "work-packages": { word: "work package", tier: "working" },
409
- purpose: { word: "purpose", tier: "direction" },
410
- vision: { word: "vision", tier: "direction" },
411
- strategy: { word: "strategy", tier: "direction" },
412
- objectives: { word: "objective", tier: "outcome" },
413
- "key-results": { word: "key result", tier: "outcome" },
414
- rules: { word: "rule", tier: "rule" },
415
- teams: { word: "team", tier: "other" },
416
- labels: { word: "label", tier: "other" }
417
- };
418
- function kindsWithCap(cap) {
419
- const words = Object.values(NAME_KINDS).filter((k) => ENTRY_NAME_CAPS[k.tier] === cap && k.tier !== "other").map((k) => k.word);
420
- return words.length < 2 ? words.join("") : `${words.slice(0, -1).join(", ")} or ${words[words.length - 1]}`;
421
- }
422
- function nameLimitsSentence() {
423
- 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);
424
- 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)}`);
425
- return `At most ${[...clauses, `${ENTRY_NAME_CAPS.other} for any other kind`].join(", ")}.`;
426
- }
427
- var ENTRY_NAME_HELP = `A short name. ${nameLimitsSentence()}`;
428
- var ENTRY_BODY_CAPS = {
429
- "key-results": { word: "key result", max: 4e3 }
430
- };
431
- var KEY_RESULT_BODY_HELP = `For a key result, open with what counts toward it; at most ${ENTRY_BODY_CAPS["key-results"].max} characters.`;
432
- var ENTRY_BODY_HELP = `The detail, in Markdown. ${KEY_RESULT_BODY_HELP}`;
433
- var SOURCE_EXCERPT_MAX_CHARS = 4e3;
434
- var LABEL_DESCRIPTION_MAX_CHARS = 2e3;
435
- var REASON_MAX_LENGTH = 200;
436
- var REASON_LENGTH_FIX = `Keep the reason to one line of at most ${REASON_MAX_LENGTH} characters.`;
437
- var REASON_WITHOUT_REPLACES = "A reason goes only with the entry this one replaces. Nothing was accepted.";
438
- var RELATION_BATCH_MAX = 25;
439
- var BATCH_GET_CHUNK = 4;
440
- async function readInChunks(ids, read) {
441
- const chunks = Array.from({ length: Math.ceil(ids.length / BATCH_GET_CHUNK) }, (_, i) => ids.slice(i * BATCH_GET_CHUNK, (i + 1) * BATCH_GET_CHUNK));
442
- return (await Promise.all(chunks.map(read))).flat();
443
- }
444
- var ANSWER_TEXT_MAX_CHARS = 4e3;
445
- var ANSWER_REFUSAL_FIX = "Shorten the answer.";
446
- function answerTextRefusal(answer2) {
447
- if (answer2.length <= ANSWER_TEXT_MAX_CHARS) return null;
448
- return `Answer is ${answer2.length} characters; the cap for an answer is ${ANSWER_TEXT_MAX_CHARS}. ${ANSWER_REFUSAL_FIX}`;
449
- }
450
- var ANSWER_POINTER_ONLY_REFUSAL = "An answer is written in full: write the answer, and add the link beside it.";
451
- var ANSWER_EMPTY_REFUSAL = "Answer text cannot be empty.";
452
- var ANSWER_TEXT_HELP = `The answer in full, at most ${ANSWER_TEXT_MAX_CHARS.toLocaleString("en-US")} characters.`;
453
- var ANSWER_ENTRY_HELP = "Link an entry beside the answer text; it resolves the question. Never instead of the text.";
454
- function listCutLine(shown) {
455
- return shown > 0 ? `Only the first ${shown} entries were read.` : "No entries matched in the part of the list that was read.";
456
- }
457
- var LIST_COUNTS_OF_ROWS_READ = "The counts here are of the rows read.";
458
-
459
466
  // src/lib/listEntries.ts
460
467
  var NARROW_IN_MCP = "Narrow it with context action=list collection=<slug> or status=<word>.";
461
468
  async function listEntriesWithCut(args, next = LIST_COUNTS_OF_ROWS_READ) {
@@ -12407,4 +12414,4 @@ export {
12407
12414
  SERVER_VERSION,
12408
12415
  createProductBrainServer
12409
12416
  };
12410
- //# sourceMappingURL=chunk-LVXKUIP6.js.map
12417
+ //# sourceMappingURL=chunk-QKL3WYAK.js.map