@productbrain/mcp 0.0.1-beta.14031 → 0.0.1-beta.14041

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.
@@ -48,7 +48,7 @@ import {
48
48
  startAgentSession,
49
49
  startTimingLine,
50
50
  withAcceptPrompt
51
- } from "./chunk-MJCZCZA5.js";
51
+ } from "./chunk-SZZI75HI.js";
52
52
 
53
53
  // src/server.ts
54
54
  import { McpServer as McpServer2 } from "@modelcontextprotocol/sdk/server/mcp.js";
@@ -11208,6 +11208,9 @@ var RESOLUTION_WORDS = {
11208
11208
  target: "replaces or refines: the entry it replaces or refines, one of the two",
11209
11209
  reason: `For unrelated: one line on why (${CONFLICT_RESOLUTION_REASON_MAX} characters at most); for an amendment: why the answer changes`,
11210
11210
  recorded: (choice2) => `Recorded: ${choice2}.`,
11211
+ /** 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: "Propose the answer to a possible clash; its owner confirms it",
11213
+ tool: "Possible clashes between entries: list, resolve or propose an answer.",
11211
11214
  /** The list's header, one for the CLI and the MCP (DEC-2443): the open contradictions, then the closed ones beside them when `closed` is given.
11212
11215
  * A plus after a count means more exist than were read (RULE-17). */
11213
11216
  openHeader: (open, closed) => `Open contradictions (${open.n}${open.more ? "+" : ""})${closed ? `, ${closed.n}${closed.more ? "+" : ""} closed` : ""}`,
@@ -11221,7 +11224,7 @@ var RESOLUTION_WORDS = {
11221
11224
  };
11222
11225
 
11223
11226
  // src/tools/conflicts.ts
11224
- var ACTIONS = ["list", "resolve"];
11227
+ var ACTIONS = ["list", "resolve", "propose"];
11225
11228
  var mode = z32.enum(["actionable", "all"]);
11226
11229
  var verdict = z32.enum(["real", "noise"]);
11227
11230
  var choice = z32.enum(CONFLICT_RESOLUTIONS, { errorMap: () => ({ message: RESOLUTION_WORDS.choose }) });
@@ -11230,7 +11233,7 @@ var reason = z32.string().max(CONFLICT_RESOLUTION_REASON_MAX, RESOLUTION_WORDS.r
11230
11233
  var conflictsSchema = z32.object({
11231
11234
  action: z32.enum(ACTIONS),
11232
11235
  mode: mode.optional().describe("list: all adds answered and snoozed ones."),
11233
- issueId: z32.string().max(200).optional().describe("resolve: id from list."),
11236
+ issueId: z32.string().max(200).optional().describe("resolve or propose: id from list."),
11234
11237
  choice: choice.optional(),
11235
11238
  target,
11236
11239
  reason,
@@ -11238,16 +11241,19 @@ var conflictsSchema = z32.object({
11238
11241
  });
11239
11242
  var conflictsActionUnion = z32.discriminatedUnion("action", [
11240
11243
  z32.object({ action: z32.literal("list"), mode: mode.optional() }),
11241
- z32.object({ action: z32.literal("resolve"), issueId: z32.string().min(1).max(200), choice: choice.optional(), target, reason, verdict: verdict.optional() })
11244
+ z32.object({ action: z32.literal("resolve"), issueId: z32.string().min(1).max(200), choice: choice.optional(), target, reason, verdict: verdict.optional() }),
11245
+ z32.object({ action: z32.literal("propose"), issueId: z32.string().min(1).max(200), choice, target, reason })
11242
11246
  ]);
11243
11247
  var CONFLICTS_ACTION_SPECS = {
11244
11248
  list: { params: ["mode"], description: "mode: actionable by default." },
11245
- resolve: { params: ["issueId", "choice", "target", "reason", "verdict"], description: "issueId and choice (or real|noise)." }
11249
+ resolve: { params: ["issueId", "choice", "target", "reason", "verdict"], description: "issueId and choice (or real|noise)." },
11250
+ propose: { params: ["issueId", "choice", "target", "reason"], description: "issueId and choice; the owner confirms it." }
11246
11251
  };
11247
11252
  async function handleConflictsList(listMode = "actionable") {
11248
11253
  const rows = await kernelCall("conflicts.list", { mode: listMode });
11249
11254
  const side = (name, id) => `${sanitizeSingleLineField(name)} (${id ? sanitizeSingleLineField(id) : "gone"})`;
11250
- 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)}` : ""));
11255
+ 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)
11256
+ (r.proposedLine ? ` \xB7 ${sanitizeSingleLineField(r.proposedLine)}` : ""));
11251
11257
  const truncated = rows[0]?.listTruncated === true;
11252
11258
  const answered = rows.filter((r) => r.answered).length;
11253
11259
  const open = rows.length - answered;
@@ -11276,14 +11282,29 @@ async function handleConflictsResolve(issueId, { choice: pick, target: entry, re
11276
11282
  const message = RESOLUTION_WORDS.answeredAs(word === "noise" ? "false_alarm" : "real");
11277
11283
  return successResult(message, message, { issueId, verdict: word, result: result2 });
11278
11284
  }
11285
+ async function handleConflictsPropose(issueId, { choice: pick, target: entry, reason: why }) {
11286
+ if (!pick) return validationResult(RESOLUTION_WORDS.choose);
11287
+ requireWriteAccess();
11288
+ const sessionId = getAgentSessionId();
11289
+ const result2 = await kernelCall("conflicts.propose", {
11290
+ issueId,
11291
+ resolution: pick,
11292
+ ...entry ? { resolutionTarget: entry } : {},
11293
+ ...why ? { resolutionReason: why } : {},
11294
+ ...sessionId ? { sessionId } : {}
11295
+ });
11296
+ const line = sanitizeSingleLineField(result2.line);
11297
+ return successResult(line, line, { issueId, choice: pick, result: result2 });
11298
+ }
11279
11299
  function registerConflictsTool(server) {
11280
11300
  const handlers = {
11281
11301
  list: (data) => handleConflictsList(data.mode),
11282
- resolve: (data) => handleConflictsResolve(data.issueId, data)
11302
+ resolve: (data) => handleConflictsResolve(data.issueId, data),
11303
+ propose: (data) => handleConflictsPropose(data.issueId, data)
11283
11304
  };
11284
11305
  server.registerTool("conflicts", {
11285
11306
  title: "Conflicts",
11286
- description: "Contradictions between entries: list or resolve them.",
11307
+ description: RESOLUTION_WORDS.tool,
11287
11308
  inputSchema: conflictsSchema,
11288
11309
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false }
11289
11310
  }, thinWrapper(async (args) => {
@@ -12122,4 +12143,4 @@ export {
12122
12143
  SERVER_VERSION,
12123
12144
  createProductBrainServer
12124
12145
  };
12125
- //# sourceMappingURL=chunk-E4I3ZNSP.js.map
12146
+ //# sourceMappingURL=chunk-NTWUV44F.js.map