@productbrain/mcp 0.0.1-beta.16021 → 0.0.1-beta.16031

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.
@@ -3739,10 +3739,21 @@ var WORK_PACKAGE_LIST_WORDS = {
3739
3739
  notCounted: "tasks not counted",
3740
3740
  uncounted: (counted, of, capped) => `Tasks counted under ${counted} of ${of}${capped ? "+" : ""} packages in progress.`,
3741
3741
  /** The plan's last line, counted from the plan, never from the rows a door printed: with the lead it adds up to All N (RULE-17). */
3742
- rest: (notGoing, next, { team, otherTeams, noSingleOwner }, capped, allCommand) => {
3743
- const n = (count) => `${count}${capped ? "+" : ""}`;
3744
- return `${n(notGoing)} more not in progress${next ? ", the next among them" : ""}; ${n(otherTeams)} more in other teams${noSingleOwner > 0 ? `; ${n(noSingleOwner)} more with no single owner` : ""}. All ${n(team + otherTeams + noSingleOwner)}: ${allCommand} (${ALL_COMMAND_SAYS})`;
3742
+ rest: (notGoing, next, waiting, { team, otherTeams, noSingleOwner }, capped, allCommand) => {
3743
+ const n = (count) => `${count}${capped ? "+" : ""}`, listed = [next && "the next", waiting > 0 && `${waiting} waiting`].filter(Boolean).join(" and ");
3744
+ return `${n(notGoing)} more not in progress${listed ? `, ${listed} among them` : ""}; ${n(otherTeams)} more in other teams${noSingleOwner > 0 ? `; ${n(noSingleOwner)} more with no single owner` : ""}. All ${n(team + otherTeams + noSingleOwner)}: ${allCommand} (${ALL_COMMAND_SAYS})`;
3745
3745
  },
3746
+ /** QUE-1484 point 6: the heading over planned packages skipped as the next for the wait each prints. */
3747
+ waiting: "Waiting",
3748
+ /** QUE-1484 point 4: what a plan row serves, names first, and the lines counting each one's packages by stage (RULE-17). */
3749
+ serves: (targets, cut) => `serves ${targets.join(", ")}${cut ? " and more not read" : ""}`,
3750
+ servesNone: "serves no key result or KPI",
3751
+ servesUnread: "key results or KPIs not read",
3752
+ /** The heading over each key result's line, as Next and Waiting head theirs (Product Design, round 2). */
3753
+ servesHeading: "Serves",
3754
+ keyResultLine: (target2, stages, atLeast) => `${target2}: ${stages.join(", ")}${atLeast ? ", and more not read" : ""}`,
3755
+ keyResultUncounted: (target2) => `${target2}: packages not counted`,
3756
+ mismatch: (planned, going) => `Stage and work disagree: ${planned} planned with a task done in the last 7 days; ${going} in progress with none.`,
3746
3757
  /** The command each surface names at the end of the count line: every live work package of the workspace, under listHeading. */
3747
3758
  allCommand: {
3748
3759
  cli: "pb brief confidence",
@@ -3776,22 +3787,32 @@ function workPackageListLines(rows, counts, surface) {
3776
3787
  if (counts && live > 0) lines.push(plan ? w.planLead(plan.teamName, plan.inProgress, plan.capped === true) : w.count(rows.length, counts, surface.allCommand));
3777
3788
  if (rows.some((row) => row.yours)) lines.push(w.legend);
3778
3789
  if (counts && rows.length > 0 && !anyPriority) lines.push(`${w.setOne} ${surface.setCommand}`);
3779
- const going = rows.filter((row) => !row.next), words = going.map((row) => priorityWord(row.priority));
3790
+ const going = rows.filter((row) => !row.next && !row.waiting), words = going.map((row) => priorityWord(row.priority));
3780
3791
  const tied = plan ? [...new Set(words)].filter((word) => word !== NO_PRIORITY.word && words.filter((x) => x === word).length > 1) : [];
3781
- let level;
3782
- for (const row of [...going, ...rows.filter((row2) => row2.next)]) {
3783
- if (row.next && tied.length > 0 && level !== w.next) lines.push(w.tied(tied));
3784
- const word = row.next ? w.next : priorityWord(row.priority);
3785
- if ((anyPriority || row.next) && word !== level) lines.push(surface.heading(word));
3792
+ let level, tieSaid = tied.length === 0;
3793
+ for (const row of [...going, ...rows.filter((row2) => row2.waiting), ...rows.filter((row2) => row2.next)]) {
3794
+ const word = row.next ? w.next : row.waiting ? w.waiting : priorityWord(row.priority);
3795
+ if ((row.next || row.waiting) && !tieSaid) {
3796
+ lines.push(w.tied(tied));
3797
+ tieSaid = true;
3798
+ }
3799
+ if ((anyPriority || row.next || row.waiting) && word !== level) lines.push(surface.heading(word));
3786
3800
  level = word;
3787
3801
  lines.push(...surface.row(row, row.yours ? ` ${w.yours}` : ""));
3788
3802
  }
3789
- if (tied.length > 0 && level !== w.next) lines.push(w.tied(tied));
3803
+ if (!tieSaid) lines.push(w.tied(tied));
3790
3804
  if (plan?.nextUnread) lines.push(w.nextUnread);
3791
3805
  if (plan && plan.counted < plan.inProgress) lines.push(w.uncounted(plan.counted, plan.inProgress, plan.capped === true));
3792
- if (plan && counts && live > 0) lines.push(w.rest(counts.team - plan.inProgress, plan.next === true, counts, plan.capped === true, surface.allCommand));
3806
+ const m = plan?.mismatch, n = (count, atLeast) => `${count}${atLeast ? "+" : ""}`;
3807
+ if (m && (m.planned > 0 || m.going > 0 || m.plannedAtLeast || m.goingAtLeast)) lines.push(w.mismatch(n(m.planned, m.plannedAtLeast), n(m.going, m.goingAtLeast)));
3808
+ if (plan && counts && live > 0) lines.push(w.rest(counts.team - plan.inProgress, plan.next === true, plan.waiting ?? 0, counts, plan.capped === true, surface.allCommand));
3809
+ if (plan?.keyResults?.length) lines.push(surface.heading(w.servesHeading), ...plan.keyResults.map((kr) => keyResultText(kr)));
3793
3810
  return lines;
3794
3811
  }
3812
+ function keyResultText(kr) {
3813
+ const w = WORK_PACKAGE_LIST_WORDS, target2 = `${kr.name} (${kr.entryId})`;
3814
+ return kr.stages === null ? w.keyResultUncounted(target2) : w.keyResultLine(target2, kr.stages.map((s) => `${s.count} ${entryStatusLabel(s.stage)}`), kr.atLeast === true);
3815
+ }
3795
3816
  function packageDetails(stage, { ticked, total }, due) {
3796
3817
  const w = WORK_PACKAGE_LIST_WORDS, sep = OPEN_TASK_LIST_WORDS.separator;
3797
3818
  return `${sep}${stage ? entryStatusLabel(stage) : w.noStage}${sep}${w.ticks(ticked, total)}${total > 0 && ticked === total ? ` ${w.allTicked}` : ""}${due ? `${sep}${taskDueMark(due)}` : ""}`;
@@ -3799,7 +3820,10 @@ function packageDetails(stage, { ticked, total }, due) {
3799
3820
  function planRowDetails(row) {
3800
3821
  if (row.stage === void 0) return "";
3801
3822
  const w = WORK_PACKAGE_LIST_WORDS, tasks = row.tasks === null ? w.notCounted : row.tasks ? w.taskCounts(row.tasks) : "";
3802
- return `${packageDetails(row.stage, row.ticks ?? { ticked: 0, total: 0 }, row.due)}${tasks ? `${OPEN_TASK_LIST_WORDS.separator}${tasks}` : ""}`;
3823
+ const named = row.serves?.map((t) => `${t.name} (${t.entryId})`) ?? [];
3824
+ const serves = row.serves === null ? w.servesUnread : !row.serves ? "" : named.length > 0 ? w.serves(named, row.servesCut === true) : row.servesCut ? w.servesUnread : w.servesNone;
3825
+ const parts = [tasks, row.waiting ? waitText(row.wait, row.waitUnread) : "", serves].filter(Boolean);
3826
+ return `${packageDetails(row.stage, row.ticks ?? { ticked: 0, total: 0 }, row.due)}${parts.map((p) => `${OPEN_TASK_LIST_WORDS.separator}${p}`).join("")}`;
3803
3827
  }
3804
3828
  function planLines(view, surface) {
3805
3829
  if (!view) return [];
@@ -3812,10 +3836,18 @@ function planLines(view, surface) {
3812
3836
  }), ""];
3813
3837
  }
3814
3838
  function cleanPlan(rows, counts, clean) {
3815
- const plan = counts?.plan;
3839
+ const plan = counts?.plan, named = (t) => ({ ...t, entryId: clean(t.entryId), name: clean(t.name) });
3840
+ const keyResults = plan?.keyResults?.map((kr) => ({ ...named(kr), stages: kr.stages && kr.stages.map((s) => ({ ...s, stage: clean(s.stage) })) }));
3816
3841
  return {
3817
- rows: rows.map((r) => ({ ...r, name: clean(r.name), entryId: r.entryId === null ? null : clean(r.entryId), ...r.stage === void 0 ? {} : { stage: clean(r.stage) } })),
3818
- counts: counts && plan ? { ...counts, plan: { ...plan, teamName: clean(plan.teamName) } } : counts
3842
+ rows: rows.map((r) => ({
3843
+ ...r,
3844
+ name: clean(r.name),
3845
+ entryId: r.entryId === null ? null : clean(r.entryId),
3846
+ ...r.stage === void 0 ? {} : { stage: clean(r.stage) },
3847
+ ...r.serves ? { serves: r.serves.map(named) } : {},
3848
+ ...r.wait ? { wait: { ...named(r.wait), state: clean(r.wait.state) } } : {}
3849
+ })),
3850
+ counts: counts && plan ? { ...counts, plan: { ...plan, teamName: clean(plan.teamName), ...keyResults ? { keyResults } : {} } } : counts
3819
3851
  };
3820
3852
  }
3821
3853
  function doneWhenTicks(value) {
@@ -3849,6 +3881,8 @@ var OPEN_TASK_LIST_WORDS = {
3849
3881
  /** A row in progress's wait (a depends_on link), with its target's state; over when the target is done, stopped or archived. */
3850
3882
  waitsOn: (target2, state) => `waits on ${target2}, ${state}`,
3851
3883
  waitOver: (target2, state) => `wait over: ${target2} is ${state}`,
3884
+ /** QUE-1484 point 6: a wait on an entry whose kind has no finished stage, said plainly. */
3885
+ waitNever: (target2, state) => `waits on ${target2}, ${state}, which never finishes`,
3852
3886
  noWait: "no wait written",
3853
3887
  /** The read kept too few calls to look for this row's wait: not the same as none. */
3854
3888
  waitUnread: "wait not read",
@@ -3885,6 +3919,13 @@ function openTaskCommand(surface, input = {}) {
3885
3919
  const bare = OPEN_TASK_LIST_WORDS.allCommand.mcp.slice(1, -1);
3886
3920
  return `${bare}${input.role ? ` roleId=${input.role}` : ""}${input.cursor !== void 0 ? ` cursor=${input.cursor}` : ""}`;
3887
3921
  }
3922
+ function waitText(wait, unread) {
3923
+ const w = OPEN_TASK_LIST_WORDS;
3924
+ if (unread) return w.waitUnread;
3925
+ if (!wait) return w.noWait;
3926
+ const target2 = `${wait.name} (${wait.entryId})`, state = entryStatusLabel(wait.state);
3927
+ return wait.over ? w.waitOver(target2, state) : wait.never ? w.waitNever(target2, state) : w.waitsOn(target2, state);
3928
+ }
3888
3929
  function openTaskRowText(row) {
3889
3930
  const w = OPEN_TASK_LIST_WORDS, t = row.doneWhen ?? { ticked: 0, total: 0 };
3890
3931
  const marks = [row.noOwner && w.noOwner, row.packageClosed && w.packageClosed].filter(Boolean).map((m) => ` ${m}`).join("");
@@ -3893,7 +3934,7 @@ function openTaskRowText(row) {
3893
3934
  WORK_PACKAGE_LIST_WORDS.ticks(t.ticked, t.total),
3894
3935
  row.due && taskDueMark(row.due),
3895
3936
  row.under && w.under(row.under),
3896
- row.inProgress && (row.waitUnread ? w.waitUnread : row.wait ? (row.wait.over ? w.waitOver : w.waitsOn)(`${row.wait.name} (${row.wait.entryId})`, entryStatusLabel(row.wait.state)) : w.noWait)
3937
+ row.inProgress && waitText(row.wait, row.waitUnread)
3897
3938
  ];
3898
3939
  return `${priorityWord(row.priority)}${w.separator}${row.entryId} \u2014 ${row.name}${marks}${parts.filter(Boolean).map((p) => `${w.separator}${p}`).join("")}`;
3899
3940
  }
@@ -12745,4 +12786,4 @@ export {
12745
12786
  SERVER_VERSION,
12746
12787
  createProductBrainServer
12747
12788
  };
12748
- //# sourceMappingURL=chunk-ERVVKGIY.js.map
12789
+ //# sourceMappingURL=chunk-7INLGX4F.js.map