@productbrain/mcp 0.0.1-beta.8637 → 0.0.1-beta.8643
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.
- package/dist/{chunk-66OMK2AA.js → chunk-FZWP45AU.js} +1 -1
- package/dist/{chunk-66OMK2AA.js.map → chunk-FZWP45AU.js.map} +1 -1
- package/dist/{chunk-OZXZLLHS.js → chunk-LJBOAIFJ.js} +77 -9
- package/dist/{chunk-OZXZLLHS.js.map → chunk-LJBOAIFJ.js.map} +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/http.js +2 -2
- package/dist/index.js +2 -2
- package/dist/{setup-SM4BGXPL.js → setup-YCYGYJNK.js} +2 -2
- package/package.json +1 -1
- /package/dist/{setup-SM4BGXPL.js.map → setup-YCYGYJNK.js.map} +0 -0
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
trackQualityVerdict,
|
|
39
39
|
trackSessionCaptureRate,
|
|
40
40
|
trackZeroCaptureAuditFired
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-FZWP45AU.js";
|
|
42
42
|
|
|
43
43
|
// src/server.ts
|
|
44
44
|
import { McpServer as McpServer2 } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
@@ -7613,6 +7613,65 @@ function formatRuleListsLines(ruleLists) {
|
|
|
7613
7613
|
if (lines.length === 0 && ruleLists.unassigned === 0 && !ruleLists.truncated) return [];
|
|
7614
7614
|
return [...lines, ...formatRuleListTrailers(ruleLists)];
|
|
7615
7615
|
}
|
|
7616
|
+
var BRIEFING_PULL_COMMANDS = {
|
|
7617
|
+
cli: 'pb orient --task "<what you are doing>" \xB7 pb get <ID> \xB7 pb search <query>',
|
|
7618
|
+
mcp: 'orient task="<what you are doing>" \xB7 entries action=get entryId=<ID> \xB7 entries action=search query=<query>'
|
|
7619
|
+
};
|
|
7620
|
+
var BRIEFING_ANSWER_COMMANDS = {
|
|
7621
|
+
cli: 'pb question answer <ID> "<answer>"',
|
|
7622
|
+
mcp: 'question action=answer entryId=<ID> text="<answer>"'
|
|
7623
|
+
};
|
|
7624
|
+
var BRIEFING_QUESTION_DETAIL_COMMANDS = {
|
|
7625
|
+
cli: "pb question list",
|
|
7626
|
+
mcp: "question action=list"
|
|
7627
|
+
};
|
|
7628
|
+
var BRIEFING_QUESTION_MAX_CHARS = 160;
|
|
7629
|
+
function briefingLine(value, max) {
|
|
7630
|
+
const line = sanitizeRuleListField(value);
|
|
7631
|
+
if (max === void 0 || Array.from(line).length <= max) return line;
|
|
7632
|
+
const cut = Array.from(line).slice(0, max).join("");
|
|
7633
|
+
return `${(cut.replace(/\s+\S*$/, "") || cut).trimEnd()}\u2026`;
|
|
7634
|
+
}
|
|
7635
|
+
function idTag(entryId) {
|
|
7636
|
+
return entryId ? ` (${sanitizeRuleListField(entryId)})` : "";
|
|
7637
|
+
}
|
|
7638
|
+
function formatBriefingLines(view) {
|
|
7639
|
+
const lines = [];
|
|
7640
|
+
const f = view.facts ?? {};
|
|
7641
|
+
if (view.workspaceName) lines.push(`Workspace: ${briefingLine(view.workspaceName)}${view.actingRole ? ` \u2014 acting as ${briefingLine(view.actingRole)}` : ""}`);
|
|
7642
|
+
if (f.purpose) lines.push(`Purpose: ${briefingLine(f.purpose)}`);
|
|
7643
|
+
if (f.vision) lines.push(`Vision: ${briefingLine(f.vision)}`);
|
|
7644
|
+
if (f.strategy) {
|
|
7645
|
+
lines.push(`Strategy${idTag(f.strategy.entryId)}: ${briefingLine(f.strategy.name)}`);
|
|
7646
|
+
if (f.strategy.notDo) lines.push(` Not doing: ${briefingLine(f.strategy.notDo)}`);
|
|
7647
|
+
}
|
|
7648
|
+
if (f.objective) {
|
|
7649
|
+
lines.push(`Objective${idTag(f.objective.entryId)}: ${briefingLine(f.objective.name)}`);
|
|
7650
|
+
for (const kr of f.objective.keyResults) {
|
|
7651
|
+
const current = kr.readingUnresolved ? "unresolved (too many corrections to read)" : kr.currentValue ?? "n/a";
|
|
7652
|
+
const value = `${current} / ${kr.targetValue ?? "n/a"}`;
|
|
7653
|
+
lines.push(` - ${briefingLine(kr.name)}: ${value}`);
|
|
7654
|
+
}
|
|
7655
|
+
}
|
|
7656
|
+
if (f.currentWorkPackage) lines.push(`Current work package${idTag(f.currentWorkPackage.entryId)}: ${briefingLine(f.currentWorkPackage.name)}`);
|
|
7657
|
+
if (f.briefingUnavailable) lines.push("Purpose, vision, strategy, objective and work package: unavailable \u2014 the briefing read failed; orient again to retry.");
|
|
7658
|
+
if (f.spineUnavailable) lines.push("Objective: unavailable \u2014 the objectives read failed; orient again to retry.");
|
|
7659
|
+
if (f.truncated) lines.push("(A bounded read hit its cap: a fact above may be missing or not the current one.)");
|
|
7660
|
+
const ruleLines = formatRuleListsLines(view.ruleLists);
|
|
7661
|
+
if (ruleLines.length > 0) lines.push("", "Rules:", ...ruleLines);
|
|
7662
|
+
const questions = view.openQuestions ?? [];
|
|
7663
|
+
if (questions.length > 0) {
|
|
7664
|
+
lines.push("", `Open questions (${questions.length}) \u2014 they need you before you continue; answer with ${BRIEFING_ANSWER_COMMANDS[view.surface]}:`);
|
|
7665
|
+
for (const q of questions) {
|
|
7666
|
+
const age = q.ageDays !== void 0 ? ` (${q.ageDays}d)` : "";
|
|
7667
|
+
lines.push(` - ${sanitizeRuleListField(q.entryId)} \u2014 ${briefingLine(q.title, BRIEFING_QUESTION_MAX_CHARS)}${age}`);
|
|
7668
|
+
}
|
|
7669
|
+
if (view.openQuestionsTruncated) lines.push(" (This list may be incomplete: you may have more open questions than shown.)");
|
|
7670
|
+
lines.push(` Asker, why you, what waits on it and what you may do: ${BRIEFING_QUESTION_DETAIL_COMMANDS[view.surface]}`);
|
|
7671
|
+
}
|
|
7672
|
+
lines.push("", `Pull more: ${BRIEFING_PULL_COMMANDS[view.surface]}`);
|
|
7673
|
+
return lines;
|
|
7674
|
+
}
|
|
7616
7675
|
|
|
7617
7676
|
// src/tools/orient-rituals.ts
|
|
7618
7677
|
var RULE_LISTS_EVERYONE_ONLY_LABEL = "Rules (everyone list only; run `orient mode=full` for your team and role lists):";
|
|
@@ -12040,12 +12099,19 @@ async function handleStart2(data) {
|
|
|
12040
12099
|
lines.push(`Acting as role: ${result2.roleName ?? result2.roleEntryId}.`);
|
|
12041
12100
|
}
|
|
12042
12101
|
lines.push(FEEDBACK_SUBMIT_HINT);
|
|
12043
|
-
const
|
|
12044
|
-
|
|
12045
|
-
|
|
12046
|
-
}
|
|
12047
|
-
|
|
12048
|
-
|
|
12102
|
+
const questionNotice = result2.notices?.find((n) => n.source === QUESTION_ACK_GATE_SOURCE_ID);
|
|
12103
|
+
const noticeLines = formatNoticeLines(result2.notices?.filter((n) => n !== questionNotice));
|
|
12104
|
+
if (noticeLines.length > 0) lines.push("", "Notices:", ...noticeLines);
|
|
12105
|
+
const openQuestions = (questionNotice?.payload?.questions ?? []).map((q) => ({ entryId: q.sourcePointer, title: q.name, ageDays: q.ageDays }));
|
|
12106
|
+
lines.push("", ...formatBriefingLines({
|
|
12107
|
+
workspaceName: result2.workspaceName,
|
|
12108
|
+
actingRole: result2.roleName,
|
|
12109
|
+
facts: result2.briefing,
|
|
12110
|
+
ruleLists: result2.ruleLists,
|
|
12111
|
+
openQuestions,
|
|
12112
|
+
openQuestionsTruncated: questionNotice?.payload?.truncated === true,
|
|
12113
|
+
surface: "mcp"
|
|
12114
|
+
}));
|
|
12049
12115
|
const summary = `Session ${result2.sessionId} active. Workspace ${result2.workspaceName}. Orient with a task first; workflow checkpoints and organisation-structure writes still require it.`;
|
|
12050
12116
|
return {
|
|
12051
12117
|
content: [{ type: "text", text: lines.join("\n") }],
|
|
@@ -12059,8 +12125,10 @@ async function handleStart2(data) {
|
|
|
12059
12125
|
feedbackQueueNew: result2.feedbackQueueNew,
|
|
12060
12126
|
feedbackOldestNewAt: result2.feedbackOldestNewAt,
|
|
12061
12127
|
notices: result2.notices ?? [],
|
|
12062
|
-
ruleLists: result2.ruleLists
|
|
12128
|
+
ruleLists: result2.ruleLists,
|
|
12063
12129
|
// TASK-436
|
|
12130
|
+
briefing: result2.briefing
|
|
12131
|
+
// TASK-552
|
|
12064
12132
|
// Finding #16: bare `parameters: {}` lets orient's schema default kick in
|
|
12065
12133
|
// (action defaults to "task", which requires a `task` string) — the suggested
|
|
12066
12134
|
// next-action call failed validation instead of running. `action: "start"` is
|
|
@@ -14540,4 +14608,4 @@ export {
|
|
|
14540
14608
|
createProductBrainServer,
|
|
14541
14609
|
initFeatureFlags
|
|
14542
14610
|
};
|
|
14543
|
-
//# sourceMappingURL=chunk-
|
|
14611
|
+
//# sourceMappingURL=chunk-LJBOAIFJ.js.map
|