@productbrain/mcp 0.0.1-beta.13300 → 0.0.1-beta.13310
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.
|
@@ -3478,6 +3478,63 @@ import { z as z21 } from "zod/v3";
|
|
|
3478
3478
|
// src/lib/readinessNotices.ts
|
|
3479
3479
|
var READINESS_PROVISIONAL_LINE = `The sample is incomplete: it left out ${TRUST_STATUS_LABELS.current.toLowerCase()} entries. Counts are lower bounds, apparent gaps may already be covered.`;
|
|
3480
3480
|
|
|
3481
|
+
// src/lib/priority.ts
|
|
3482
|
+
var PRIORITY_LEVELS = {
|
|
3483
|
+
urgent: { word: "Urgent", order: 1, linearInt: 1, icon: "alert" },
|
|
3484
|
+
high: { word: "High", order: 2, linearInt: 2, icon: "bars-3" },
|
|
3485
|
+
medium: { word: "Medium", order: 3, linearInt: 3, icon: "bars-2" },
|
|
3486
|
+
low: { word: "Low", order: 4, linearInt: 4, icon: "bars-1" }
|
|
3487
|
+
};
|
|
3488
|
+
var PRIORITY_TOKENS = Object.keys(PRIORITY_LEVELS);
|
|
3489
|
+
var NO_PRIORITY = { word: "No priority", order: 5, linearInt: 0, icon: "dashes" };
|
|
3490
|
+
function priorityOf(value) {
|
|
3491
|
+
return typeof value === "string" && Object.prototype.hasOwnProperty.call(PRIORITY_LEVELS, value) ? value : null;
|
|
3492
|
+
}
|
|
3493
|
+
|
|
3494
|
+
// src/lib/workPackageList.ts
|
|
3495
|
+
var WORK_PACKAGE_LIST_WORDS = {
|
|
3496
|
+
yours: "[yours]",
|
|
3497
|
+
/** Printed once under the heading when a row carries the mark, so a cold reader need not guess it (DEC-2445). */
|
|
3498
|
+
legend: "[yours] = a package your role owns",
|
|
3499
|
+
count: (shown, { team, otherTeams, noSingleOwner }, allCommand) => `Showing ${shown} of your team's ${team} live package${team === 1 ? "" : "s"}; ${otherTeams} more in other teams${noSingleOwner > 0 ? `; ${noSingleOwner} more with no single owner` : ""}. All of them: ${allCommand}`,
|
|
3500
|
+
/** The command each surface names at the end of the count line: every live work package of the workspace, under listHeading. */
|
|
3501
|
+
allCommand: {
|
|
3502
|
+
cli: "pb brief confidence",
|
|
3503
|
+
mcp: '`context action=brief briefType="confidence"`'
|
|
3504
|
+
},
|
|
3505
|
+
/** The heading of that command's list, so the count line and the list use one word. */
|
|
3506
|
+
listHeading: "Live work packages",
|
|
3507
|
+
/** That list's last line when it stopped at its cap; the brief has no way to continue past it. */
|
|
3508
|
+
listStops: (cap) => `More than ${cap} live packages; the list stops here.`,
|
|
3509
|
+
/** A tension linked to a row, named and with its id so a reader can open it; each surface adds its own indent. */
|
|
3510
|
+
tension: (t) => `\u21B3 tension${t.entryId ? ` ${t.entryId}` : ""}: ${t.name}`,
|
|
3511
|
+
setOne: "Set one (urgent, high, medium or low):",
|
|
3512
|
+
/** The command each surface prints after setOne, ending the line so it pastes whole; a live priority change asks one line of why (DEC-2418). */
|
|
3513
|
+
setCommand: {
|
|
3514
|
+
cli: 'pb update <WP-ID> -f priority=high --change-reason "<why>"',
|
|
3515
|
+
mcp: '`entries action=update entryId="<WP-ID>" data={"priority":"high"} changeReason="<why>"`'
|
|
3516
|
+
}
|
|
3517
|
+
};
|
|
3518
|
+
function priorityWord(value) {
|
|
3519
|
+
const token = priorityOf(value);
|
|
3520
|
+
return token ? PRIORITY_LEVELS[token].word : NO_PRIORITY.word;
|
|
3521
|
+
}
|
|
3522
|
+
function workPackageListLines(rows, counts, surface) {
|
|
3523
|
+
const lines = [];
|
|
3524
|
+
const anyPriority = rows.some((row) => priorityOf(row.priority) !== null);
|
|
3525
|
+
if (counts) lines.push(WORK_PACKAGE_LIST_WORDS.count(rows.length, counts, surface.allCommand));
|
|
3526
|
+
if (rows.some((row) => row.yours)) lines.push(WORK_PACKAGE_LIST_WORDS.legend);
|
|
3527
|
+
if (counts && rows.length > 0 && !anyPriority) lines.push(`${WORK_PACKAGE_LIST_WORDS.setOne} ${surface.setCommand}`);
|
|
3528
|
+
let level;
|
|
3529
|
+
for (const row of rows) {
|
|
3530
|
+
const word = priorityWord(row.priority);
|
|
3531
|
+
if (anyPriority && word !== level) lines.push(surface.heading(word));
|
|
3532
|
+
level = word;
|
|
3533
|
+
lines.push(...surface.row(row, row.yours ? ` ${WORK_PACKAGE_LIST_WORDS.yours}` : ""));
|
|
3534
|
+
}
|
|
3535
|
+
return lines;
|
|
3536
|
+
}
|
|
3537
|
+
|
|
3481
3538
|
// src/tools/documents.ts
|
|
3482
3539
|
import { z as z15 } from "zod/v3";
|
|
3483
3540
|
var DOCUMENTS_ACTIONS = ["get-last-verified-brief"];
|
|
@@ -5402,7 +5459,7 @@ function formatConfidencePass(result2) {
|
|
|
5402
5459
|
`_${changes.entries.length} entries modified${changes.truncated ? " (TRUNCATED)" : ""}_`,
|
|
5403
5460
|
""
|
|
5404
5461
|
];
|
|
5405
|
-
lines.push(`##
|
|
5462
|
+
lines.push(`## ${WORK_PACKAGE_LIST_WORDS.listHeading} (${result2.workPackageCount})`);
|
|
5406
5463
|
if (result2.activeBets.length > 0) {
|
|
5407
5464
|
for (const bet of result2.activeBets) {
|
|
5408
5465
|
const id = bet.entryId ? `**${bet.entryId}:** ` : "";
|
|
@@ -5411,7 +5468,7 @@ function formatConfidencePass(result2) {
|
|
|
5411
5468
|
} else {
|
|
5412
5469
|
lines.push("_No active work packages._");
|
|
5413
5470
|
}
|
|
5414
|
-
lines.push("");
|
|
5471
|
+
lines.push(...result2.workPackagesTruncated ? [WORK_PACKAGE_LIST_WORDS.listStops(result2.workPackageCount)] : [], "");
|
|
5415
5472
|
lines.push("_Tensions: see `pb tensions list` on the CLI \u2014 this pass no longer carries a tension count._");
|
|
5416
5473
|
lines.push("");
|
|
5417
5474
|
lines.push("## Trust");
|
|
@@ -6911,49 +6968,6 @@ function formatGapOneLiner(gap) {
|
|
|
6911
6968
|
return `Next gap: ${prompt}`;
|
|
6912
6969
|
}
|
|
6913
6970
|
|
|
6914
|
-
// src/lib/priority.ts
|
|
6915
|
-
var PRIORITY_LEVELS = {
|
|
6916
|
-
urgent: { word: "Urgent", order: 1, linearInt: 1, icon: "alert" },
|
|
6917
|
-
high: { word: "High", order: 2, linearInt: 2, icon: "bars-3" },
|
|
6918
|
-
medium: { word: "Medium", order: 3, linearInt: 3, icon: "bars-2" },
|
|
6919
|
-
low: { word: "Low", order: 4, linearInt: 4, icon: "bars-1" }
|
|
6920
|
-
};
|
|
6921
|
-
var PRIORITY_TOKENS = Object.keys(PRIORITY_LEVELS);
|
|
6922
|
-
var NO_PRIORITY = { word: "No priority", order: 5, linearInt: 0, icon: "dashes" };
|
|
6923
|
-
function priorityOf(value) {
|
|
6924
|
-
return typeof value === "string" && Object.prototype.hasOwnProperty.call(PRIORITY_LEVELS, value) ? value : null;
|
|
6925
|
-
}
|
|
6926
|
-
|
|
6927
|
-
// src/lib/workPackageList.ts
|
|
6928
|
-
var WORK_PACKAGE_LIST_WORDS = {
|
|
6929
|
-
yours: "[yours]",
|
|
6930
|
-
count: (shown, { team, otherTeams, noSingleOwner }) => `showing ${shown} of ${team} \xB7 other teams ${otherTeams}${noSingleOwner > 0 ? ` \xB7 no single owner ${noSingleOwner}` : ""}`,
|
|
6931
|
-
setOne: "Set one (urgent, high, medium or low):",
|
|
6932
|
-
/** The command each surface prints after setOne, ending the line so it pastes whole; a live priority change asks one line of why (DEC-2418). */
|
|
6933
|
-
setCommand: {
|
|
6934
|
-
cli: 'pb update <WP-ID> -f priority=high --change-reason "<why>"',
|
|
6935
|
-
mcp: '`entries action=update entryId="<WP-ID>" data={"priority":"high"} changeReason="<why>"`'
|
|
6936
|
-
}
|
|
6937
|
-
};
|
|
6938
|
-
function priorityWord(value) {
|
|
6939
|
-
const token = priorityOf(value);
|
|
6940
|
-
return token ? PRIORITY_LEVELS[token].word : NO_PRIORITY.word;
|
|
6941
|
-
}
|
|
6942
|
-
function workPackageListLines(rows, counts, surface) {
|
|
6943
|
-
const lines = [];
|
|
6944
|
-
const anyPriority = rows.some((row) => priorityOf(row.priority) !== null);
|
|
6945
|
-
if (counts) lines.push(WORK_PACKAGE_LIST_WORDS.count(rows.length, counts));
|
|
6946
|
-
if (counts && rows.length > 0 && !anyPriority) lines.push(`${WORK_PACKAGE_LIST_WORDS.setOne} ${surface.setCommand}`);
|
|
6947
|
-
let level;
|
|
6948
|
-
for (const row of rows) {
|
|
6949
|
-
const word = priorityWord(row.priority);
|
|
6950
|
-
if (anyPriority && word !== level) lines.push(surface.heading(word));
|
|
6951
|
-
level = word;
|
|
6952
|
-
lines.push(...surface.row(row, row.yours ? ` ${WORK_PACKAGE_LIST_WORDS.yours}` : ""));
|
|
6953
|
-
}
|
|
6954
|
-
return lines;
|
|
6955
|
-
}
|
|
6956
|
-
|
|
6957
6971
|
// src/lib/canonicalRefs.ts
|
|
6958
6972
|
function getCollectionLabel(canonicalKey, form, workspaceCtx, collectionCtx) {
|
|
6959
6973
|
const wsLabels = workspaceCtx?.collectionLabels?.[canonicalKey];
|
|
@@ -7200,12 +7214,12 @@ async function _handleOrient({ mode: mode2 = "full", tier, task, startupSignals,
|
|
|
7200
7214
|
lines.push(...workPackageListLines(orientView?.activeWorkPackages ?? [], orientView?.strategicContext?.workPackageTeamCounts, {
|
|
7201
7215
|
heading: (word) => `${word}:`,
|
|
7202
7216
|
setCommand: WORK_PACKAGE_LIST_WORDS.setCommand.mcp,
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
-
|
|
7208
|
-
|
|
7217
|
+
allCommand: WORK_PACKAGE_LIST_WORDS.allCommand.mcp,
|
|
7218
|
+
row: (e, mark) => [
|
|
7219
|
+
`- \`${e.entryId ?? e._id}\` ${e.name}${mark}${coherencyCheckTag(e.coherencyCheckStatus)}`,
|
|
7220
|
+
...(e.linkedTensions ?? []).map((t) => ` ${WORK_PACKAGE_LIST_WORDS.tension(t)}`)
|
|
7221
|
+
]
|
|
7222
|
+
// DEC-2445: no origin tag; tensions by id
|
|
7209
7223
|
}));
|
|
7210
7224
|
if (orientView?.trustMetrics) {
|
|
7211
7225
|
const tm = orientView.trustMetrics;
|
|
@@ -7473,13 +7487,9 @@ async function _handleOrient({ mode: mode2 = "full", tier, task, startupSignals,
|
|
|
7473
7487
|
// DEC-2426
|
|
7474
7488
|
heading: (word) => `**${word}**`,
|
|
7475
7489
|
setCommand: WORK_PACKAGE_LIST_WORDS.setCommand.mcp,
|
|
7476
|
-
|
|
7477
|
-
|
|
7478
|
-
|
|
7479
|
-
return `\`${t.entryId ?? t.name}\` (${t.name}${meta ? `, ${meta}` : ""})`;
|
|
7480
|
-
});
|
|
7481
|
-
return [fmt(e, mark), ...tensionLines.length ? [` Tensions: ${tensionLines.join("; ")}`] : []];
|
|
7482
|
-
}
|
|
7490
|
+
allCommand: WORK_PACKAGE_LIST_WORDS.allCommand.mcp,
|
|
7491
|
+
row: (e, mark) => [fmt({ ...e, origin: void 0 }, mark), ...(e.linkedTensions ?? []).map((t) => ` ${WORK_PACKAGE_LIST_WORDS.tension(t)}`)]
|
|
7492
|
+
// DEC-2445
|
|
7483
7493
|
}));
|
|
7484
7494
|
lines.push("");
|
|
7485
7495
|
}
|
|
@@ -12036,4 +12046,4 @@ export {
|
|
|
12036
12046
|
SERVER_VERSION,
|
|
12037
12047
|
createProductBrainServer
|
|
12038
12048
|
};
|
|
12039
|
-
//# sourceMappingURL=chunk-
|
|
12049
|
+
//# sourceMappingURL=chunk-LKYSMK4U.js.map
|