@productbrain/mcp 0.0.1-beta.14069 → 0.0.1-beta.14077
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.
|
@@ -11201,31 +11201,46 @@ import { z as z32 } from "zod/v3";
|
|
|
11201
11201
|
var CONFLICT_RESOLUTIONS = ["replaces", "refines", "unrelated"];
|
|
11202
11202
|
var CONFLICT_RESOLUTION_REASON_MAX = 200;
|
|
11203
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}`;
|
|
11204
11216
|
var RESOLUTION_WORDS = {
|
|
11205
11217
|
choose: signed(`Choose ${CONFLICT_RESOLUTIONS.slice(0, -1).join(", ")} or ${CONFLICT_RESOLUTIONS[CONFLICT_RESOLUTIONS.length - 1]}.`),
|
|
11206
11218
|
both: signed("Give either the answer (real or false alarm) or the choice, not both."),
|
|
11207
11219
|
reasonTooLong: signed(`Keep the reason to one line of ${CONFLICT_RESOLUTION_REASON_MAX} characters or fewer.`),
|
|
11208
11220
|
target: "replaces or refines: the entry it replaces or refines, one of the two",
|
|
11209
11221
|
reason: `For unrelated: one line on why (${CONFLICT_RESOLUTION_REASON_MAX} characters at most); for an amendment: why the answer changes`,
|
|
11210
|
-
|
|
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`}.`,
|
|
11211
11224
|
/** TASK-1560 (QUE-518, QUE-501): what the propose verb does, as pb's help and the MCP tool say it (Voice signs). */
|
|
11212
|
-
proposeHelp:
|
|
11225
|
+
proposeHelp: `Propose the answer to a ${CLASH.one}; its owner confirms it`,
|
|
11213
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
|
|
11214
11227
|
* clash."); the CLI and MCP read it to add their propose command to the gateway's refusal. */
|
|
11215
|
-
answerVerb:
|
|
11216
|
-
|
|
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.`,
|
|
11217
11232
|
/** TASK-1571 (TEN-6206): the answer verbs' help on the CLI and MCP, which the gateway now refuses for every caller (QUE-554). */
|
|
11218
11233
|
answerHelp: "A key proposes; a person answers in Cortex.",
|
|
11219
|
-
/** The list's header, one for the CLI and the MCP (DEC-2443): the open
|
|
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.
|
|
11220
11235
|
* A plus after a count means more exist than were read (RULE-17). */
|
|
11221
|
-
openHeader: (open, closed) => `Open
|
|
11236
|
+
openHeader: (open, closed) => `Open ${CLASH.many} (${open.n}${open.more ? "+" : ""})${closed ? `, ${closed.n}${closed.more ? "+" : ""} closed` : ""}`,
|
|
11222
11237
|
/** The list when nothing is open (all) or nothing is unanswered (the default list); the surface adds how to see the rest. */
|
|
11223
|
-
noneOpen:
|
|
11224
|
-
noneUnanswered:
|
|
11238
|
+
noneOpen: `No open ${CLASH.many}.`,
|
|
11239
|
+
noneUnanswered: `No unanswered ${CLASH.many}.`,
|
|
11225
11240
|
/** A stored answer as a person reads it: never the stored code. */
|
|
11226
11241
|
answer: (answer2) => answer2 === "real" ? "real" : "false alarm",
|
|
11227
11242
|
/** The receipt for an answer given in the older form (real or noise), on the CLI and MCP alike. */
|
|
11228
|
-
answeredAs: (answer2) => answer2 === "real" ?
|
|
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.`
|
|
11229
11244
|
};
|
|
11230
11245
|
|
|
11231
11246
|
// src/tools/conflicts.ts
|
|
@@ -11257,12 +11272,12 @@ var CONFLICTS_ACTION_SPECS = {
|
|
|
11257
11272
|
async function handleConflictsList(listMode = "actionable") {
|
|
11258
11273
|
const rows = await kernelCall("conflicts.list", { mode: listMode });
|
|
11259
11274
|
const side = (name, id) => `${sanitizeSingleLineField(name)} (${id ? sanitizeSingleLineField(id) : "gone"})`;
|
|
11260
|
-
const lines = rows.map((r) => `${r.id} \xB7 ${side(r.entryAName, r.entryAId)} \u2194 ${side(r.entryBName, r.entryBId)} \xB7 ${r.conflictType} ${r.confidence.toFixed(2)}${r.rankLabel ? ` \xB7 ${sanitizeSingleLineField(r.rankLabel)}` : ""} \xB7 ${sanitizeSingleLineField(r.explanation)}` + (r.guidance ? ` \xB7 ${sanitizeSingleLineField(r.guidance)}` : "") + (r.resolvedLine ? ` \xB7 ${sanitizeSingleLineField(r.resolvedLine)}` : "") + // who answered and how (DEC-2443)
|
|
11275
|
+
const lines = rows.map((r) => `${r.id} \xB7 ${side(r.entryAName, r.entryAId)} \u2194 ${side(r.entryBName, r.entryBId)} \xB7 ${clashKind(r.conflictType)} ${r.confidence.toFixed(2)}${r.rankLabel ? ` \xB7 ${sanitizeSingleLineField(r.rankLabel)}` : ""} \xB7 ${sanitizeSingleLineField(r.explanation)}` + (r.guidance ? ` \xB7 ${sanitizeSingleLineField(r.guidance)}` : "") + (r.resolvedLine ? ` \xB7 ${sanitizeSingleLineField(r.resolvedLine)}` : "") + // who answered and how (DEC-2443)
|
|
11261
11276
|
(r.proposedLine ? ` \xB7 ${sanitizeSingleLineField(r.proposedLine)}` : ""));
|
|
11262
11277
|
const truncated = rows[0]?.listTruncated === true;
|
|
11263
11278
|
const answered = rows.filter((r) => r.answered).length;
|
|
11264
11279
|
const open = rows.length - answered;
|
|
11265
|
-
const count =
|
|
11280
|
+
const count = clashCount(open, truncated);
|
|
11266
11281
|
const summary = rows.length === 0 ? listMode === "all" ? RESOLUTION_WORDS.noneOpen : `${RESOLUTION_WORDS.noneUnanswered} mode=all shows answered and snoozed ones.` : listMode === "all" ? RESOLUTION_WORDS.openHeader({ n: open, more: truncated }, answered > 0 || rows[0]?.closedTruncated ? { n: answered, more: rows[0]?.closedTruncated === true } : void 0) : `${count}. Propose an answer for its owner to confirm: conflicts action=propose issueId=<id> choice=${CONFLICT_RESOLUTIONS.join("|")}`;
|
|
11267
11282
|
const order = rows[0]?.rankOrderNote ? [sanitizeSingleLineField(rows[0].rankOrderNote)] : [];
|
|
11268
11283
|
return successResult([summary, ...order, ...lines].join("\n"), summary, { mode: listMode, rows });
|
|
@@ -11272,7 +11287,7 @@ async function handleConflictsResolve(issueId, args) {
|
|
|
11272
11287
|
try {
|
|
11273
11288
|
return await resolveOnce(issueId, args);
|
|
11274
11289
|
} catch (err) {
|
|
11275
|
-
if (err instanceof Error && err.message.includes(RESOLUTION_WORDS.
|
|
11290
|
+
if (err instanceof Error && err.message.includes(RESOLUTION_WORDS.answerMatch)) return validationResult(PROPOSE_INSTEAD(err.message, issueId));
|
|
11276
11291
|
throw err;
|
|
11277
11292
|
}
|
|
11278
11293
|
}
|
|
@@ -11317,7 +11332,8 @@ function registerConflictsTool(server) {
|
|
|
11317
11332
|
propose: (data) => handleConflictsPropose(data.issueId, data)
|
|
11318
11333
|
};
|
|
11319
11334
|
server.registerTool("conflicts", {
|
|
11320
|
-
title: "
|
|
11335
|
+
title: "Possible clashes",
|
|
11336
|
+
// a literal for scripts/generate-public-docs.mjs; conflicts.test.ts pins it to Clash.many (TASK-1556)
|
|
11321
11337
|
description: RESOLUTION_WORDS.tool,
|
|
11322
11338
|
inputSchema: conflictsSchema,
|
|
11323
11339
|
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false }
|
|
@@ -12157,4 +12173,4 @@ export {
|
|
|
12157
12173
|
SERVER_VERSION,
|
|
12158
12174
|
createProductBrainServer
|
|
12159
12175
|
};
|
|
12160
|
-
//# sourceMappingURL=chunk-
|
|
12176
|
+
//# sourceMappingURL=chunk-6MEZEOBQ.js.map
|