@productbrain/mcp 0.0.1-beta.15887 → 0.0.1-beta.15897

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.
@@ -10617,9 +10617,9 @@ function formatQuestionAckGateBlock(notice) {
10617
10617
  lines.push(`- ${questions.length} open question${questions.length === 1 ? "" : "s"} need you before you continue.`);
10618
10618
  for (const q of questions) lines.push(...formatQuestionBrief(q));
10619
10619
  lines.push(" Deal with each question above before proceeding.");
10620
- if (notice.payload?.truncated) {
10621
- lines.push(" (This list may be incomplete \u2014 you may have more open questions than shown.)");
10622
- }
10620
+ if (notice.payload?.note) lines.push(` ${safe(notice.payload.note)}`);
10621
+ else if (notice.payload?.truncated) lines.push(" (This list may be incomplete \u2014 you may have more open questions than shown.)");
10622
+ if (notice.payload?.otherTeams) lines.push(` ${safe(notice.payload.otherTeams)}`);
10623
10623
  return lines;
10624
10624
  }
10625
10625
  function formatNoticeLines(notices) {
@@ -11793,7 +11793,7 @@ import { z as z33 } from "zod/v3";
11793
11793
  var QUESTION_ACTIONS = ["create", "assign", "answer", "add", "force-close", "list"];
11794
11794
  var questionSchema = z33.object({
11795
11795
  action: z33.enum(QUESTION_ACTIONS).describe(
11796
- `'create': ask a question; toRole assigns it to that role at once. ${QUESTION_SEAT_WORDS.withoutTeam} (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 a team lead holds it. 'answer': close the loop \u2014 writes the answer on the question in full and moves it to answered; answerEntryId may link an entry beside it. 'add': ${QUESTION_LINE_WORDS.help} 'force-close': Team-Lead-only escape hatch \u2014 reason required. 'list': what you owe; mine:true what you asked; role what waits on it.`
11796
+ `'create': ask a question; toRole assigns it to that role at once. ${QUESTION_SEAT_WORDS.withoutTeam} (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 a team lead holds it. 'answer': writes the full answer and moves it to answered; answerEntryId may link an entry beside it. 'add': ${QUESTION_LINE_WORDS.help} 'force-close': Team-Lead-only escape hatch \u2014 reason required. 'list': what you owe; mine:true what you asked; role what waits on it.`
11797
11797
  ),
11798
11798
  entryId: z33.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'."),
11799
11799
  // Well above the answer cap, so an over-cap answer reaches the handler and reads the door's refusal; create keeps 5,000 in its variant.
@@ -11803,8 +11803,9 @@ var questionSchema = z33.object({
11803
11803
  toTeam: z33.string().max(200).optional().describe(`'create' and 'assign', with toRole (TEAM-nnn or a raw entry id): ${QUESTION_SEAT_WORDS.teamHelp}.`),
11804
11804
  reason: z33.string().max(2e3).optional().describe("'force-close': required reason."),
11805
11805
  answerEntryId: z33.string().max(200).optional().describe(`'answer': ${ANSWER_ENTRY_HELP}`),
11806
- mine: z33.boolean().optional().describe("'list': true for arm C (every question YOU asked, every status). Omit/false for the ack-gate view (what you owe)."),
11807
- role: z33.string().max(200).optional().describe("'list': role id (not with mine).")
11806
+ mine: z33.boolean().optional().describe("'list': true for every question you asked, any status; omit for what you owe."),
11807
+ role: z33.string().max(200).optional().describe("'list': role id (not with mine)."),
11808
+ team: z33.string().max(200).optional().describe("'list': Team Lead rows' team; no role: one you lead (TEAM-n); not with mine.")
11808
11809
  });
11809
11810
  var createVariant = z33.object({
11810
11811
  action: z33.literal("create"),
@@ -11819,7 +11820,7 @@ var assignVariant = z33.object({ action: z33.literal("assign"), entryId: z33.str
11819
11820
  var answerVariant = z33.object({ action: z33.literal("answer"), entryId: z33.string().max(200), text: z33.string().optional(), answerEntryId: z33.string().max(200).optional() });
11820
11821
  var addVariant = z33.object({ action: z33.literal("add"), entryId: z33.string().max(200), text: z33.string() });
11821
11822
  var forceCloseVariant = z33.object({ action: z33.literal("force-close"), entryId: z33.string().max(200), reason: z33.string().min(1).max(2e3) });
11822
- var listVariant = z33.object({ action: z33.literal("list"), mine: z33.boolean().optional(), role: z33.string().max(200).optional() });
11823
+ var listVariant = z33.object({ action: z33.literal("list"), mine: z33.boolean().optional(), role: z33.string().max(200).optional(), team: z33.string().max(200).optional() });
11823
11824
  var questionActionUnion = z33.discriminatedUnion("action", [
11824
11825
  createVariant,
11825
11826
  assignVariant,
@@ -11834,7 +11835,7 @@ var QUESTION_ACTION_SPECS = {
11834
11835
  answer: { params: ["entryId", "text", "answerEntryId"], description: "entryId and text are required; answerEntryId is optional, beside the text." },
11835
11836
  add: { params: ["entryId", "text"], description: "entryId and text are both required: the question you asked, and the line to add." },
11836
11837
  "force-close": { params: ["entryId", "reason"], description: "entryId and reason are both required." },
11837
- list: { params: ["mine", "role"], description: "mine and role are optional, not together \u2014 omit both for what you owe, mine:true for what you asked, role for what waits on that role." }
11838
+ list: { params: ["mine", "role", "team"], description: "mine and role are optional, not together \u2014 omit both for what you owe, mine:true for what you asked, role for what waits on that role." }
11838
11839
  };
11839
11840
  var HUMAN_ID_PATTERN = /^[A-Za-z]+-\d+$/;
11840
11841
  async function resolveEntryRef(raw, label2) {
@@ -11944,27 +11945,35 @@ async function handleQuestionForceClose(entryId, reason2) {
11944
11945
  return questionErrorResult(err, "force-close", { entryId, reason: reason2 });
11945
11946
  }
11946
11947
  }
11947
- async function handleQuestionList(mine, role) {
11948
+ async function handleQuestionList(mine, role, team) {
11948
11949
  try {
11949
- const result2 = await kernelQuery("question.list", { mine, ...role !== void 0 ? { role } : {} });
11950
+ const sessionId = getAgentSessionId() ?? void 0;
11951
+ const result2 = await kernelQuery("question.list", {
11952
+ mine,
11953
+ ...role !== void 0 ? { role } : {},
11954
+ ...team !== void 0 ? { team } : {},
11955
+ ...sessionId ? { sessionId } : {}
11956
+ });
11950
11957
  const rows = result2.questions;
11958
+ const otherTeams = result2.otherTeams ? `
11959
+ ${stripControlChars(result2.otherTeams)}` : "";
11951
11960
  if (rows.length === 0) {
11952
- const message2 = result2.role ? stripControlChars(result2.note ?? "") : mine ? "You haven't asked any questions yet." : "No open questions.";
11961
+ const message2 = (result2.role || result2.note ? stripControlChars(result2.note ?? "") : mine ? "You haven't asked any questions yet." : "No open questions.") + otherTeams;
11953
11962
  return successResult(message2, message2, { ...result2, action: "list" });
11954
11963
  }
11955
11964
  const lines = rows.map((r) => {
11956
11965
  const outcomeSuffix = mine && r.outcome ? ` \u2014 ${stripControlChars(r.outcome)}` : "";
11957
11966
  const judgeSuffix = !mine && r.judgeSentence ? ` \u2014 ${stripControlChars(r.judgeSentence)}` : "";
11958
- return `[${stripControlChars(r.entryId)}] ${stripControlChars(r.question)} \u2014 ${stripControlChars(r.stateLabel)} \u2014 ${stripControlChars(r.why)} \u2014 ${stripControlChars(r.domain)} \u2014 ${stripControlChars(r.withLabel)} \u2014 ${r.ageDays}d${outcomeSuffix}${judgeSuffix}`;
11967
+ return `[${stripControlChars(r.entryId)}] ${stripControlChars(r.question)} \u2014 ${stripControlChars(r.stateLabel)} \u2014 ${stripControlChars(r.why)} \u2014 ${stripControlChars(r.team ?? "\u2014")} \u2014 ${stripControlChars(r.withLabel)} \u2014 ${r.ageDays}d${outcomeSuffix}${judgeSuffix}`;
11959
11968
  });
11960
- const truncationNote = result2.role ? result2.note ? `
11969
+ const truncationNote = result2.role || result2.note ? result2.note ? `
11961
11970
  ${stripControlChars(result2.note)}` : "" : result2.truncated ? `
11962
11971
  (${mine ? "showing your most recent questions only \u2014 older ones exist but are not shown" : "this list may be incomplete \u2014 some obligations may not be shown"})` : "";
11963
11972
  const message = `${rows.length} question${rows.length === 1 ? "" : "s"}:
11964
- ${lines.join("\n")}${truncationNote}`;
11973
+ ${lines.join("\n")}${truncationNote}${otherTeams}`;
11965
11974
  return successResult(message, message, { ...result2, action: "list" });
11966
11975
  } catch (err) {
11967
- return questionErrorResult(err, "list", { mine, role });
11976
+ return questionErrorResult(err, "list", { mine, role, team });
11968
11977
  }
11969
11978
  }
11970
11979
  function questionErrorResult(err, action, params = {}) {
@@ -11988,7 +11997,7 @@ function registerQuestionTools(server) {
11988
11997
  answer: (data) => handleQuestionAnswer(data.entryId, data.text, data.answerEntryId),
11989
11998
  add: (data) => handleQuestionAddLine(data.entryId, data.text),
11990
11999
  "force-close": (data) => handleQuestionForceClose(data.entryId, data.reason),
11991
- list: (data) => handleQuestionList(data.mine, data.role)
12000
+ list: (data) => handleQuestionList(data.mine, data.role, data.team)
11992
12001
  };
11993
12002
  server.registerTool(
11994
12003
  "question",
@@ -11997,7 +12006,7 @@ function registerQuestionTools(server) {
11997
12006
  description: `Routed questions \u2014 ask a role with \`toRole\` on create and the question is assigned to it at once. ${QUESTION_SEAT_WORDS.withoutTeam} Six actions:
11998
12007
 
11999
12008
  - **create**: ask a question from text; \`toRole\` assigns it to that role at once; \`toTeam\`: ${QUESTION_SEAT_WORDS.teamHelp}.
12000
- - **assign**: reassign to a role (\`toRole\` required, \`toTeam\` as on create); the asker may reassign their own question once while a team lead holds it.
12009
+ - **assign**: reassign to a role (\`toRole\` required, \`toTeam\` as on create); the asker may, once, while a team lead holds it.
12001
12010
  - **answer**: close the loop. Writes \`text\` on the question as its answer, in full; \`answerEntryId\` may link an entry beside it, never instead.
12002
12011
  - **add**: ${QUESTION_LINE_WORDS.help} \`entryId\` and \`text\` required.
12003
12012
  - **force-close**: Team-Lead-only escape hatch (reason required) for a question that cannot otherwise be resolved.
@@ -12652,4 +12661,4 @@ export {
12652
12661
  SERVER_VERSION,
12653
12662
  createProductBrainServer
12654
12663
  };
12655
- //# sourceMappingURL=chunk-7RWF3SU5.js.map
12664
+ //# sourceMappingURL=chunk-RLADPZ3R.js.map