@productbrain/mcp 0.0.1-beta.14077 → 0.0.1-beta.14083

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.
@@ -416,6 +416,52 @@ async function listEntriesWithCut(args, next = LIST_COUNTS_OF_ROWS_READ) {
416
416
  // src/tools/entries.ts
417
417
  import { z as z13 } from "zod/v3";
418
418
 
419
+ // src/lib/conflictResolution.ts
420
+ var CONFLICT_RESOLUTIONS = ["replaces", "refines", "unrelated"];
421
+ var CONFLICT_RESOLUTION_REASON_MAX = 200;
422
+ var signed = (line) => line;
423
+ var CLASH = {
424
+ one: "possible clash",
425
+ many: "possible clashes",
426
+ mayWith: "May clash with",
427
+ check: "possible-clash check",
428
+ kinds: { contradiction: "may contradict", supersession: "may replace" },
429
+ /** A count by kind reads the kind's noun (QUE-527, KR-7): it names the kind of possible clash, never the flag (Voice, RULE-705 check 4). */
430
+ kindNouns: { contradiction: ["contradiction", "contradictions"], supersession: ["supersession", "supersessions"] }
431
+ };
432
+ var clashKind = (kind) => CLASH.kinds[kind] ?? kind;
433
+ var Clash = { one: CLASH.one[0].toUpperCase() + CLASH.one.slice(1), many: CLASH.many[0].toUpperCase() + CLASH.many.slice(1) };
434
+ var clashCount = (n, more = false) => `${n}${more ? "+" : ""} ${n === 1 && !more ? CLASH.one : CLASH.many}`;
435
+ var RESOLUTION_WORDS = {
436
+ choose: signed(`Choose ${CONFLICT_RESOLUTIONS.slice(0, -1).join(", ")} or ${CONFLICT_RESOLUTIONS[CONFLICT_RESOLUTIONS.length - 1]}.`),
437
+ both: signed("Give either the answer (real or false alarm) or the choice, not both."),
438
+ reasonTooLong: signed(`Keep the reason to one line of ${CONFLICT_RESOLUTION_REASON_MAX} characters or fewer.`),
439
+ target: "replaces or refines: the entry it replaces or refines, one of the two",
440
+ reason: `For unrelated: one line on why (${CONFLICT_RESOLUTION_REASON_MAX} characters at most); for an amendment: why the answer changes`,
441
+ /** The receipt an older backend's answer gets when it carries no line of its own (the MCP's fallback): the choice in words. */
442
+ recorded: (choice2) => `Recorded: ${choice2 === "unrelated" ? "unrelated" : `${choice2} the other entry`}.`,
443
+ /** TASK-1560 (QUE-518, QUE-501): what the propose verb does, as pb's help and the MCP tool say it (Voice signs). */
444
+ proposeHelp: `Propose the answer to a ${CLASH.one}; its owner confirms it`,
445
+ /** TASK-1571 (QUE-554, DEC-2299): what only a person does, as the person-only floor says it ("Only a person answers a possible
446
+ * clash."); the CLI and MCP read it to add their propose command to the gateway's refusal. */
447
+ answerVerb: `answers a ${CLASH.one}`,
448
+ /** What the CLI and MCP match the gateway's answer refusal by: stable across QUE-540's pick (see CLASH). */
449
+ answerMatch: "answers a possible ",
450
+ tool: `List ${CLASH.many}; propose an answer; a person answers in Cortex.`,
451
+ /** TASK-1571 (TEN-6206): the answer verbs' help on the CLI and MCP, which the gateway now refuses for every caller (QUE-554). */
452
+ answerHelp: "A key proposes; a person answers in Cortex.",
453
+ /** The list's header, one for the CLI and the MCP (DEC-2443): the open possible clashes, then the closed ones beside them when `closed` is given.
454
+ * A plus after a count means more exist than were read (RULE-17). */
455
+ openHeader: (open, closed) => `Open ${CLASH.many} (${open.n}${open.more ? "+" : ""})${closed ? `, ${closed.n}${closed.more ? "+" : ""} closed` : ""}`,
456
+ /** The list when nothing is open (all) or nothing is unanswered (the default list); the surface adds how to see the rest. */
457
+ noneOpen: `No open ${CLASH.many}.`,
458
+ noneUnanswered: `No unanswered ${CLASH.many}.`,
459
+ /** A stored answer as a person reads it: never the stored code. */
460
+ answer: (answer2) => answer2 === "real" ? "real" : "false alarm",
461
+ /** The receipt for an answer given in the older form (real or noise), on the CLI and MCP alike. */
462
+ answeredAs: (answer2) => answer2 === "real" ? `Answered as real: the ${CLASH.one} stays open until an entry changes.` : `Answered as a false alarm: the ${CLASH.one} is closed.`
463
+ };
464
+
419
465
  // src/tools/knowledge-helpers.ts
420
466
  import { z as z2 } from "zod/v3";
421
467
 
@@ -2804,7 +2850,7 @@ function registerEntriesTools(server) {
2804
2850
  description: `Write entries on the Chain: the entry lifecycle after capture. Reads live on \`context\`.
2805
2851
 
2806
2852
  - **update**: Change fields on an existing entry (publishes whenever the entry is not draft \u2014 includes archived, not just ${TRUST_STATUS_LABELS.current.toLowerCase()} entries; autoPublish is accepted but ignored).
2807
- - **accept**: Accept a draft entry onto the Chain. Runs the contradiction preflight first.
2853
+ - **accept**: Accept a draft entry onto the Chain. Runs the ${CLASH.check} first.
2808
2854
  - **move**: Relocate an entry to a different collection; pass canonicalKey too for an atomic move+retype.
2809
2855
  - **verify**: Mark verified (lightweight, no scan \u2014 see \`quality action=verify-chain\`).
2810
2856
  - **replace**: one accepted entry replaces another of its kind, with a reason.
@@ -10340,7 +10386,7 @@ async function handleClose() {
10340
10386
  `| Entries created | ${created} |`,
10341
10387
  `| Entries modified | ${modified} |`,
10342
10388
  `| Relations created | ${relations} |`,
10343
- ...session ? [`| Gate failures | ${gates} |`, `| Contradiction warnings | ${warnings} |`] : []
10389
+ ...session ? [`| Gate failures | ${gates} |`, `| ${Clash.one} warnings | ${warnings} |`] : []
10344
10390
  );
10345
10391
  if (capLine) lines.push("", capLine);
10346
10392
  if (callLine) lines.push("", callLine);
@@ -11196,54 +11242,6 @@ function registerFeedbackTool(server) {
11196
11242
 
11197
11243
  // src/tools/conflicts.ts
11198
11244
  import { z as z32 } from "zod/v3";
11199
-
11200
- // src/lib/conflictResolution.ts
11201
- var CONFLICT_RESOLUTIONS = ["replaces", "refines", "unrelated"];
11202
- var CONFLICT_RESOLUTION_REASON_MAX = 200;
11203
- var signed = (line) => line;
11204
- var CLASH = {
11205
- one: "possible clash",
11206
- many: "possible clashes",
11207
- mayWith: "May clash with",
11208
- check: "possible-clash check",
11209
- kinds: { contradiction: "may contradict", supersession: "may replace" },
11210
- /** A count by kind reads the kind's noun (QUE-527, KR-7): it names the kind of possible clash, never the flag (Voice, RULE-705 check 4). */
11211
- kindNouns: { contradiction: ["contradiction", "contradictions"], supersession: ["supersession", "supersessions"] }
11212
- };
11213
- var clashKind = (kind) => CLASH.kinds[kind] ?? kind;
11214
- var Clash = { one: CLASH.one[0].toUpperCase() + CLASH.one.slice(1), many: CLASH.many[0].toUpperCase() + CLASH.many.slice(1) };
11215
- var clashCount = (n, more = false) => `${n}${more ? "+" : ""} ${n === 1 && !more ? CLASH.one : CLASH.many}`;
11216
- var RESOLUTION_WORDS = {
11217
- choose: signed(`Choose ${CONFLICT_RESOLUTIONS.slice(0, -1).join(", ")} or ${CONFLICT_RESOLUTIONS[CONFLICT_RESOLUTIONS.length - 1]}.`),
11218
- both: signed("Give either the answer (real or false alarm) or the choice, not both."),
11219
- reasonTooLong: signed(`Keep the reason to one line of ${CONFLICT_RESOLUTION_REASON_MAX} characters or fewer.`),
11220
- target: "replaces or refines: the entry it replaces or refines, one of the two",
11221
- reason: `For unrelated: one line on why (${CONFLICT_RESOLUTION_REASON_MAX} characters at most); for an amendment: why the answer changes`,
11222
- /** The receipt an older backend's answer gets when it carries no line of its own (the MCP's fallback): the choice in words. */
11223
- recorded: (choice2) => `Recorded: ${choice2 === "unrelated" ? "unrelated" : `${choice2} the other entry`}.`,
11224
- /** TASK-1560 (QUE-518, QUE-501): what the propose verb does, as pb's help and the MCP tool say it (Voice signs). */
11225
- proposeHelp: `Propose the answer to a ${CLASH.one}; its owner confirms it`,
11226
- /** TASK-1571 (QUE-554, DEC-2299): what only a person does, as the person-only floor says it ("Only a person answers a possible
11227
- * clash."); the CLI and MCP read it to add their propose command to the gateway's refusal. */
11228
- answerVerb: `answers a ${CLASH.one}`,
11229
- /** What the CLI and MCP match the gateway's answer refusal by: stable across QUE-540's pick (see CLASH). */
11230
- answerMatch: "answers a possible ",
11231
- tool: `List ${CLASH.many}; propose an answer; a person answers in Cortex.`,
11232
- /** TASK-1571 (TEN-6206): the answer verbs' help on the CLI and MCP, which the gateway now refuses for every caller (QUE-554). */
11233
- answerHelp: "A key proposes; a person answers in Cortex.",
11234
- /** The list's header, one for the CLI and the MCP (DEC-2443): the open possible clashes, then the closed ones beside them when `closed` is given.
11235
- * A plus after a count means more exist than were read (RULE-17). */
11236
- openHeader: (open, closed) => `Open ${CLASH.many} (${open.n}${open.more ? "+" : ""})${closed ? `, ${closed.n}${closed.more ? "+" : ""} closed` : ""}`,
11237
- /** The list when nothing is open (all) or nothing is unanswered (the default list); the surface adds how to see the rest. */
11238
- noneOpen: `No open ${CLASH.many}.`,
11239
- noneUnanswered: `No unanswered ${CLASH.many}.`,
11240
- /** A stored answer as a person reads it: never the stored code. */
11241
- answer: (answer2) => answer2 === "real" ? "real" : "false alarm",
11242
- /** The receipt for an answer given in the older form (real or noise), on the CLI and MCP alike. */
11243
- answeredAs: (answer2) => answer2 === "real" ? `Answered as real: the ${CLASH.one} stays open until an entry changes.` : `Answered as a false alarm: the ${CLASH.one} is closed.`
11244
- };
11245
-
11246
- // src/tools/conflicts.ts
11247
11245
  var ACTIONS = ["list", "resolve", "propose"];
11248
11246
  var mode = z32.enum(["actionable", "all"]);
11249
11247
  var verdict = z32.enum(["real", "noise"]);
@@ -12173,4 +12171,4 @@ export {
12173
12171
  SERVER_VERSION,
12174
12172
  createProductBrainServer
12175
12173
  };
12176
- //# sourceMappingURL=chunk-6MEZEOBQ.js.map
12174
+ //# sourceMappingURL=chunk-ZUNF674E.js.map