@productbrain/mcp 0.0.1-beta.14604 → 0.0.1-beta.14629

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.
@@ -32,6 +32,7 @@ import {
32
32
  kernelCallEnvelope,
33
33
  kernelMutation,
34
34
  kernelQuery,
35
+ kindWord,
35
36
  orientationRefusal,
36
37
  personStatusTag,
37
38
  questionSeatName,
@@ -49,7 +50,7 @@ import {
49
50
  startAgentSession,
50
51
  startTimingLine,
51
52
  withAcceptPrompt
52
- } from "./chunk-EDHY23ZB.js";
53
+ } from "./chunk-XZM2TCO3.js";
53
54
 
54
55
  // src/server.ts
55
56
  import { McpServer as McpServer2 } from "@modelcontextprotocol/server";
@@ -295,7 +296,6 @@ var LIST_COUNTS_OF_ROWS_READ = "The counts here are of the rows read.";
295
296
 
296
297
  // src/lib/checklist.ts
297
298
  var FIRST_SPINE_SUBJECT = "work_package";
298
- var kindWord = (kind) => kind.replace(/_/g, " ");
299
299
  var spineSubject = (kind, label2 = kindWord) => {
300
300
  const words = withArticle(label2(kind));
301
301
  return words[0].toUpperCase() + words.slice(1);
@@ -3038,11 +3038,11 @@ function entryCard(e) {
3038
3038
  const conflictLabel = e.possibleConflict?.label;
3039
3039
  const epistemic = deriveEpistemicStatus(toEpistemicInput(e));
3040
3040
  const lines = [
3041
- // under the status, the kernel's Replaced by and Changed by lines (DEC-2006; TASK-1674)
3041
+ // under the status, the kernel's Due, Replaced by and Changed by lines (DEC-2663; DEC-2006; TASK-1674)
3042
3042
  `# ${e.entryId ? `${e.entryId}: ` : ""}${e.name}`,
3043
3043
  "",
3044
3044
  `**Status:** ${e.status}${e.workflowStatus ? ` / ${e.workflowStatus}` : ""}`,
3045
- ...[e.replacedLine, e.changedLine].flatMap((l) => typeof l === "string" ? [sanitizeSingleLineField(l)] : []),
3045
+ ...[e.dueLine, e.replacedLine, e.changedLine].flatMap((l) => typeof l === "string" ? [sanitizeSingleLineField(l)] : []),
3046
3046
  ...typeof conflictLabel === "string" ? [`\u26A0 ${sanitizeSingleLineField(conflictLabel)}`] : [],
3047
3047
  `**Collection:** ${e.collectionSlug ?? "unknown"}`
3048
3048
  ];
@@ -3101,7 +3101,7 @@ function entryCard(e) {
3101
3101
  ...e.sourceExcerpt ? { sourceExcerpt: String(e.sourceExcerpt) } : {},
3102
3102
  ...parsedOwner ? { owner: parsedOwner } : {},
3103
3103
  // TASK-954, TASK-1027: the kernel's lines as served
3104
- ...Object.fromEntries(["heldLine", "pendingMove", "qualityOverride", "spineLine", "replacedLine", "changedLine"].filter((k) => typeof e[k] === "string").map((k) => [k, e[k]])),
3104
+ ...Object.fromEntries(["heldLine", "pendingMove", "qualityOverride", "spineLine", "replacedLine", "changedLine", "dueLine"].filter((k) => typeof e[k] === "string").map((k) => [k, e[k]])),
3105
3105
  ...e.coveredBy !== void 0 ? { coveredBy: e.coveredBy } : {},
3106
3106
  // DEC-2257: the Team Lead holding a role with no one seated
3107
3107
  ...restsOnChanged.length > 0 ? { restsOnChanged } : {},
@@ -3619,6 +3619,21 @@ function priorityOf(value) {
3619
3619
  return typeof value === "string" && Object.prototype.hasOwnProperty.call(PRIORITY_LEVELS, value) ? value : null;
3620
3620
  }
3621
3621
 
3622
+ // src/lib/taskDue.ts
3623
+ var STATE_WORDS = { overdue: "Overdue", dueToday: "Due today", due: "Due" };
3624
+ var TASK_DUE_WORDS = {
3625
+ ...STATE_WORDS,
3626
+ /** The due line on a task row: "due 7 Nov", the year only when it is not this year ("due 7 Nov 2027"). */
3627
+ line: (day) => `due ${day}`,
3628
+ /** pb get and the MCP get: "Due: 7 Nov, Overdue", "Due: today", "Due: 14 Nov". */
3629
+ label: (key, day) => `${STATE_WORDS.due}: ${key === "dueToday" ? "today" : day}${key === "overdue" ? `, ${STATE_WORDS.overdue}` : ""}`,
3630
+ /** Orient's counts line (RULE-17): the denominator is the open tasks the read judged, and a cut read says capped. */
3631
+ counts: (overdue, dueToday, read, capped) => `${overdue} ${STATE_WORDS.overdue}, ${dueToday} ${STATE_WORDS.dueToday} of ${read} open read${capped ? ", capped" : ""}.`
3632
+ };
3633
+ function taskDueMark(due) {
3634
+ return due.key === "overdue" ? `${due.word}, ${due.line}` : due.key === "dueToday" ? due.word : due.line;
3635
+ }
3636
+
3622
3637
  // src/lib/workPackageList.ts
3623
3638
  var ALL_COMMAND_SAYS = "lists every live package";
3624
3639
  var WORK_PACKAGE_LIST_WORDS = {
@@ -3664,7 +3679,7 @@ function workPackageListLines(rows, counts, surface) {
3664
3679
  return lines;
3665
3680
  }
3666
3681
  var OPEN_TASK_LIST_WORDS = {
3667
- heading: (roleName) => `${roleName}'s open tasks, not in a live package`,
3682
+ heading: (roleName) => `${roleName}'s open tasks: due ones first, then those in no live work package`,
3668
3683
  separator: " \xB7 ",
3669
3684
  inProgress: "(in progress)",
3670
3685
  noOwner: "(no owner)",
@@ -3674,9 +3689,9 @@ var OPEN_TASK_LIST_WORDS = {
3674
3689
  shown: 5,
3675
3690
  more: (hidden, capped, allCommand) => `${hidden}${capped ? "+" : ""} more: ${allCommand}`,
3676
3691
  allCommand: { cli: "pb tasks list", mcp: "`context action=tasks`" },
3677
- compact: (count, capped, roleName) => `${count}${capped ? "+" : ""} open task(s) of ${roleName}, not in a live package`,
3692
+ compact: (count, capped, roleName) => `${count}${capped ? "+" : ""} open task(s) of ${roleName}: due ones first, then those in no live work package`,
3678
3693
  /** Only for a read that was not cut: a capped read that found none prints its capped line instead, never this. */
3679
- empty: (roleName) => `${roleName} has no open tasks outside a live package.`,
3694
+ empty: (roleName) => `${roleName} has no due tasks and no open tasks outside a live work package.`,
3680
3695
  /** The tasks list's last line when another page follows. */
3681
3696
  nextPage: (command) => `More: ${command}`,
3682
3697
  /** Printed whenever the read stopped at its cap, so rows it never read are not taken for none (signed by Voice, 2026-10-30).
@@ -3698,12 +3713,13 @@ function openTaskCommand(surface, input = {}) {
3698
3713
  function openTaskRowText(row) {
3699
3714
  const w = OPEN_TASK_LIST_WORDS;
3700
3715
  const marks = [row.inProgress && w.inProgress, row.noOwner && w.noOwner, row.packageClosed && w.packageClosed].filter(Boolean);
3701
- return `${priorityWord(row.priority)}${w.separator}${row.entryId} \u2014 ${row.name}${marks.map((m) => ` ${m}`).join("")}`;
3716
+ return `${priorityWord(row.priority)}${w.separator}${row.entryId} \u2014 ${row.name}${marks.map((m) => ` ${m}`).join("")}${row.due ? `${w.separator}${taskDueMark(row.due)}` : ""}`;
3702
3717
  }
3703
3718
  function openTaskListLines(list, surface) {
3704
3719
  const shown = Math.min(surface.shown ?? list.rows.length, list.rows.length);
3705
3720
  const total = surface.total ?? list.rows.length;
3706
- const lines = list.rows.slice(0, shown).map((row) => `${surface.bullet}${openTaskRowText(row)}`);
3721
+ const due = list.dueCounts && total > 0 ? [TASK_DUE_WORDS.counts(list.dueCounts.overdue, list.dueCounts.dueToday, list.dueCounts.read, list.capped)] : [];
3722
+ const lines = [...due, ...list.rows.slice(0, shown).map((row) => `${surface.bullet}${openTaskRowText(row)}`)];
3707
3723
  const allCommand = surface.surface === "cli" ? OPEN_TASK_LIST_WORDS.allCommand.cli : OPEN_TASK_LIST_WORDS.allCommand.mcp;
3708
3724
  if (total > shown) lines.push(OPEN_TASK_LIST_WORDS.more(total - shown, list.capped, allCommand));
3709
3725
  if (list.capped) lines.push(OPEN_TASK_LIST_WORDS.capped(list.cappedAt ?? total));
@@ -4549,7 +4565,7 @@ async function handleOpenTasks(roleId, cursor) {
4549
4565
  var LOOKUP_ACTIONS = ["get", "batch", "history", "list", "search", "find", "people", "outcome", "readings", "accountable", "tasks", "preflight"];
4550
4566
  var statusFilterSchema = z19.union([z19.string().max(200), z19.array(z19.enum(ENTRY_STATUS_READ_WORDS)).max(5)]);
4551
4567
  var preflightLinks = z19.array(z19.object({ type: z19.string().max(200), entryId: z19.string().max(200) })).max(50).optional();
4552
- var LOOKUP_ACTION_DESCRIBE = `'get': entries in full by ID (entryIds: up to 20, one call). 'batch': get with entryIds. 'history': audit trail for an entry. 'list': browse entries with filters (${TRUST_STATUS_LABELS.current.toLowerCase()} entries by default). 'search': full-text search across entries. 'find': an entry's direct relations (see direction). 'people': the workspace's members with name, email and status. 'outcome': a key result's view with its objective and siblings. 'readings': its readings, newest first. 'accountable': a role's work and holders. 'tasks': your role's open tasks outside a package, or roleId's. 'preflight': a collection's requirements. `;
4568
+ var LOOKUP_ACTION_DESCRIBE = `'get': entries in full by ID (entryIds: up to 20, one call). 'batch': get with entryIds. 'history': audit trail for an entry. 'list': browse entries with filters (${TRUST_STATUS_LABELS.current.toLowerCase()} entries by default). 'search': full-text search across entries. 'find': an entry's direct relations (see direction). 'people': the workspace's members with name, email and status. 'outcome': a key result's view with its objective and siblings. 'readings': its readings, newest first. 'accountable': a role's work and holders. 'tasks': your role's open tasks, due ones first, then those in no live work package, or roleId's. 'preflight': a collection's requirements. `;
4553
4569
  var LOOKUP_TOOL_LINES = "- **get**: Full entries by ID: data, labels, relations, history. entryIds reads up to 20 in one call.\n- **batch**: get with entryIds.\n- **history**: Audit trail for an entry.\n- **list**: Browse entries by collection, status, tag or label; collections action=list names the slugs.\n- **search**: Full-text search; scope by collection or status.\n- **find**: An entry's direct relations, both ways; not text search.\n- **people**: The workspace's members: name, email, status, role. Max 200.\n- **outcome**: A key result's derived view (current, progress, pace, staleness, completion), its objective and up to 5 sibling key results.\n- **readings**: A key result's readings, newest first; a replaced row names its replacement. Record with `outcome action=record`.\n- **accountable**: What a role owns, reports on, and who holds it; no roleId: every seat.\n- **preflight**: What an entry in a collection needs; saves nothing.\n";
4554
4570
  var lookupParams = {
4555
4571
  entryIds: z19.array(z19.string().max(200)).min(1).max(20).optional().describe("For 'get'/'batch': up to 20 entry IDs, one call."),
@@ -12417,4 +12433,4 @@ export {
12417
12433
  SERVER_VERSION,
12418
12434
  createProductBrainServer
12419
12435
  };
12420
- //# sourceMappingURL=chunk-J4IIMD25.js.map
12436
+ //# sourceMappingURL=chunk-252BGUM5.js.map