@productbrain/mcp 0.0.1-beta.13072 → 0.0.1-beta.13110

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.
@@ -43,7 +43,7 @@ import {
43
43
  setSessionOriented,
44
44
  startAgentSession,
45
45
  withAcceptPrompt
46
- } from "./chunk-N4GNJAW7.js";
46
+ } from "./chunk-EVK7IH5X.js";
47
47
 
48
48
  // src/server.ts
49
49
  import { McpServer as McpServer2 } from "@modelcontextprotocol/sdk/server/mcp.js";
@@ -1956,6 +1956,8 @@ No DB writes \u2014 call without \`preview:true\` to accept for real.` }],
1956
1956
  const heldFlag = typeof result2?.heldFlag === "string" && result2.heldFlag.trim() ? result2.heldFlag : void 0;
1957
1957
  const heldReason = heldFlag && typeof result2?.heldReason === "string" ? result2.heldReason : void 0;
1958
1958
  if (heldFlag) lines.push("", ...heldFlag.split("\n").map((flag) => `\u26A0 ${flag}`), ...heldReason ? [heldReason] : []);
1959
+ const overlap = typeof result2?.overlap === "string" && result2.overlap.trim() ? result2.overlap : void 0;
1960
+ if (overlap) lines.push("", ...overlap.split("\n").map((line) => `\u26A0 ${line}`));
1959
1961
  const steeringAdvisory = typeof result2?.steeringAdvisory === "string" && result2.steeringAdvisory.trim() ? result2.steeringAdvisory : void 0;
1960
1962
  if (steeringAdvisory) {
1961
1963
  lines.push("");
@@ -2017,7 +2019,8 @@ No DB writes \u2014 call without \`preview:true\` to accept for real.` }],
2017
2019
  ...epistemic ? { epistemicStatus: epistemic } : {},
2018
2020
  ...steeringAdvisory ? { steeringAdvisory } : {},
2019
2021
  ...heldFlag ? { heldFlag, ...heldReason ? { heldReason } : {} } : {},
2020
- // TASK-1159
2022
+ ...overlap ? { overlap } : {},
2023
+ // TASK-1159; TASK-1325
2021
2024
  // WP-485 Slice 2b round 2 (Codex P1, FEAT-1370): mirror the server's contradiction
2022
2025
  // advisory into the structured payload so --json/agent consumers see it too.
2023
2026
  ...contradictionAdvisory ? { contradictionAdvisory } : {},
@@ -11198,17 +11201,23 @@ import { z as z34 } from "zod/v3";
11198
11201
  var QUESTION_ACTIONS = ["create", "assign", "answer", "force-close", "list"];
11199
11202
  var questionSchema = z34.object({
11200
11203
  action: z34.enum(QUESTION_ACTIONS).describe(
11201
- "'create': create a new routed question from text \u2014 the dedicated birth action; every question is born escalated to the team lead (generic entry creation and move-and-retype also pair a routing facet). 'assign': reassign ownership to a role (toRole required \u2014 no bare self-confirm, no toPerson). 'answer': close the loop \u2014 writes the answer on the question and moves it to answered; --entry links an existing decision instead. 'force-close': Team-Lead-only escape hatch \u2014 reason required. 'list': the ack-gate read model \u2014 what you owe (or, with mine:true, every question you asked, including closed ones)."
11204
+ "'create': ask a question; toRole assigns it to that role at once, else the team lead holds it (generic entry creation and move-and-retype also pair a routing facet). 'assign': reassign to a role (toRole required); the asker may do this once while the team lead holds it. 'answer': close the loop \u2014 writes the answer on the question and moves it to answered; --entry links an existing decision instead. 'force-close': Team-Lead-only escape hatch \u2014 reason required. 'list': the ack-gate read model \u2014 what you owe (or, with mine:true, every question you asked, including closed ones)."
11202
11205
  ),
11203
11206
  entryId: z34.string().max(200).optional().describe("Target question's id (human TEN-nnn form or a raw entry id). Required for every action except 'create'/'list'."),
11204
11207
  text: z34.string().max(5e3).optional().describe("'create': the question text. 'answer': the answer text (mutually exclusive with answerEntryId, at most 2,000 characters)."),
11205
11208
  blocks: z34.array(z34.string().max(200)).max(50).optional().describe("'create': entry ids this question is blocking (repeatable)."),
11206
- toRole: z34.string().max(200).optional().describe("'assign': reassign to this role (human ROL-nnn form or a raw entry id) \u2014 required."),
11209
+ toRole: z34.string().max(200).optional().describe("The role (ROL-nnn or a raw entry id): optional on 'create', required on 'assign'."),
11207
11210
  reason: z34.string().max(2e3).optional().describe("'force-close': required reason."),
11208
11211
  answerEntryId: z34.string().max(200).optional().describe("'answer': point at an already-written entry instead of supplying text (mutually exclusive with text)."),
11209
11212
  mine: z34.boolean().optional().describe("'list': true for arm C (every question YOU asked, every status). Omit/false for the ack-gate view (what you owe).")
11210
11213
  });
11211
- var createVariant = z34.object({ action: z34.literal("create"), text: z34.string().min(1).max(5e3), blocks: z34.array(z34.string().max(200)).max(50).optional() });
11214
+ var createVariant = z34.object({
11215
+ action: z34.literal("create"),
11216
+ text: z34.string().min(1).max(5e3),
11217
+ blocks: z34.array(z34.string().max(200)).max(50).optional(),
11218
+ toRole: z34.string().max(200).min(1).optional()
11219
+ // TASK-1334 (RULE-706): born assigned to the role asked
11220
+ });
11212
11221
  var assignVariant = z34.object({ action: z34.literal("assign"), entryId: z34.string().max(200), toRole: z34.string().max(200).min(1) });
11213
11222
  var answerVariant = z34.object({ action: z34.literal("answer"), entryId: z34.string().max(200), text: z34.string().max(2e3).optional(), answerEntryId: z34.string().max(200).optional() });
11214
11223
  var forceCloseVariant = z34.object({ action: z34.literal("force-close"), entryId: z34.string().max(200), reason: z34.string().min(1).max(2e3) });
@@ -11221,7 +11230,7 @@ var questionActionUnion = z34.discriminatedUnion("action", [
11221
11230
  listVariant
11222
11231
  ]);
11223
11232
  var QUESTION_ACTION_SPECS = {
11224
- create: { params: ["text", "blocks"], description: "text is required; blocks is optional." },
11233
+ create: { params: ["text", "blocks", "toRole"], description: "text is required; blocks and toRole are optional." },
11225
11234
  assign: { params: ["entryId", "toRole"], description: "entryId and toRole are both required \u2014 assign is reassign-to-a-role only." },
11226
11235
  answer: { params: ["entryId", "text", "answerEntryId"], description: "entryId is required; supply exactly one of text or answerEntryId." },
11227
11236
  "force-close": { params: ["entryId", "reason"], description: "entryId and reason are both required." },
@@ -11250,15 +11259,16 @@ async function renderCreateConfirmation(result2) {
11250
11259
  const nudge = result2.nudge ? ` ${result2.nudge}` : "";
11251
11260
  return `${base}${blocksHint}${nudge}`;
11252
11261
  }
11253
- async function handleQuestionCreate(text, blocks) {
11262
+ async function handleQuestionCreate(text, blocks, toRole) {
11254
11263
  requireWriteAccess();
11255
11264
  try {
11256
11265
  const resolvedBlocks = blocks ? await Promise.all(blocks.map((b) => resolveEntryRef(b, "Blocked entry"))) : void 0;
11257
- const result2 = await kernelMutation("question.create", { text, blocks: resolvedBlocks, sessionId: getAgentSessionId() ?? void 0 });
11266
+ const toRoleId = toRole ? await resolveEntryRef(toRole, "Role") : void 0;
11267
+ const result2 = await kernelMutation("question.create", { text, blocks: resolvedBlocks, ...toRoleId ? { toRoleId } : {}, sessionId: getAgentSessionId() ?? void 0 });
11258
11268
  const message = await renderCreateConfirmation(result2);
11259
11269
  return successResult(message, message, result2);
11260
11270
  } catch (err) {
11261
- return questionErrorResult(err, "create", { text, blocks });
11271
+ return questionErrorResult(err, "create", { text, blocks, toRole });
11262
11272
  }
11263
11273
  }
11264
11274
  async function handleQuestionAssign(entryId, toRole) {
@@ -11342,7 +11352,7 @@ function questionErrorResult(err, action, params = {}) {
11342
11352
  }
11343
11353
  function registerQuestionTools(server) {
11344
11354
  const questionHandlers = {
11345
- create: (data) => handleQuestionCreate(data.text, data.blocks),
11355
+ create: (data) => handleQuestionCreate(data.text, data.blocks, data.toRole),
11346
11356
  assign: (data) => handleQuestionAssign(data.entryId, data.toRole),
11347
11357
  answer: (data) => handleQuestionAnswer(data.entryId, data.text, data.answerEntryId),
11348
11358
  "force-close": (data) => handleQuestionForceClose(data.entryId, data.reason),
@@ -11352,7 +11362,7 @@ function registerQuestionTools(server) {
11352
11362
  "question",
11353
11363
  {
11354
11364
  title: "Question",
11355
- description: "Routed questions \u2014 a question is born with no owner and escalates straight to the team lead; the team lead reassigns it to a role. Five actions:\n\n- **create**: create a new routed question from text. Always born escalated to the team lead \u2014 there is no domain-owner suggestion any more.\n- **assign**: reassign ownership to a role (`toRole` required \u2014 no self-confirm, no person-only reassignment).\n- **answer**: close the loop. Writes `text` on the question as its answer, or links an existing decision via `answerEntryId` \u2014 never both.\n- **force-close**: Team-Lead-only escape hatch (reason required) for a question that cannot otherwise be resolved.\n- **list**: the ack-gate read model \u2014 what you owe (`mine:false`, the default), or (`mine:true`) every question you asked, including closed ones, with its outcome.\n\n`blocks` (repeatable, on create) records what a question is holding up \u2014 pass entry ids it blocks.",
11365
+ description: "Routed questions \u2014 ask a role with `toRole` on create and the question is assigned to it at once; otherwise the team lead holds it. Five actions:\n\n- **create**: ask a question from text; `toRole` assigns it to that role at once, otherwise the team lead holds it.\n- **assign**: reassign to a role (`toRole` required); the asker may reassign their own question once while the team lead holds it.\n- **answer**: close the loop. Writes `text` on the question as its answer, or links an existing decision via `answerEntryId` \u2014 never both.\n- **force-close**: Team-Lead-only escape hatch (reason required) for a question that cannot otherwise be resolved.\n- **list**: the ack-gate read model \u2014 what you owe (`mine:false`, the default), or (`mine:true`) every question you asked, including closed ones, with its outcome.\n\n`blocks` (repeatable, on create) records what a question is holding up \u2014 pass entry ids it blocks.",
11356
11366
  inputSchema: questionSchema,
11357
11367
  annotations: { readOnlyHint: false, idempotentHint: false, openWorldHint: false }
11358
11368
  },
@@ -11984,4 +11994,4 @@ export {
11984
11994
  SERVER_VERSION,
11985
11995
  createProductBrainServer
11986
11996
  };
11987
- //# sourceMappingURL=chunk-4OS4Y646.js.map
11997
+ //# sourceMappingURL=chunk-GHVPPBME.js.map