@productbrain/mcp 0.0.1-beta.23 → 0.0.1-beta.25
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.
|
@@ -1345,13 +1345,14 @@ function registerHealthTools(server) {
|
|
|
1345
1345
|
"orient",
|
|
1346
1346
|
{
|
|
1347
1347
|
title: "Orient \u2014 Start Here",
|
|
1348
|
-
description: "The single entry point for starting a session. Returns workspace context with a single recommended next action for low-readiness workspaces, or a standup-style briefing for established workspaces.\n\nUse this FIRST. One call to orient replaces 3\u20135 individual tool calls.\n\nCompleting orientation unlocks write tools for the active session.\n\n**mode:** `full` (default) returns full context. `brief` returns only vision, bet/tension counts, readiness, active bet names, and last-session summary \u2014 use for mid-session re-orientation.",
|
|
1348
|
+
description: "The single entry point for starting a session. Returns workspace context with a single recommended next action for low-readiness workspaces, or a standup-style briefing for established workspaces.\n\nUse this FIRST. One call to orient replaces 3\u20135 individual tool calls.\n\nCompleting orientation unlocks write tools for the active session.\n\n**mode:** `full` (default) returns full context. `brief` returns only vision, bet/tension counts, readiness, active bet names, and last-session summary \u2014 use for mid-session re-orientation.\n\n**task:** Optional natural-language task description. When provided, returns task-scoped context (scored, relevant entries) in addition to standard orient sections.",
|
|
1349
1349
|
inputSchema: {
|
|
1350
|
-
mode: z3.enum(["full", "brief"]).optional().default("full").describe("full = full context (default). brief = compact summary for mid-session re-orientation.")
|
|
1350
|
+
mode: z3.enum(["full", "brief"]).optional().default("full").describe("full = full context (default). brief = compact summary for mid-session re-orientation."),
|
|
1351
|
+
task: z3.string().optional().describe("Natural-language task description for task-scoped context. When provided, orient returns scored, relevant entries for the task.")
|
|
1351
1352
|
},
|
|
1352
1353
|
annotations: { readOnlyHint: true }
|
|
1353
1354
|
},
|
|
1354
|
-
async ({ mode = "full" }) => {
|
|
1355
|
+
async ({ mode = "full", task } = {}) => {
|
|
1355
1356
|
const errors = [];
|
|
1356
1357
|
const agentSessionId = getAgentSessionId();
|
|
1357
1358
|
let wsCtx = null;
|
|
@@ -1369,7 +1370,7 @@ function registerHealthTools(server) {
|
|
|
1369
1370
|
}
|
|
1370
1371
|
let orientEntries = null;
|
|
1371
1372
|
try {
|
|
1372
|
-
orientEntries = await mcpQuery("chain.getOrientEntries");
|
|
1373
|
+
orientEntries = await mcpQuery("chain.getOrientEntries", task ? { task } : {});
|
|
1373
1374
|
} catch {
|
|
1374
1375
|
}
|
|
1375
1376
|
let openTensions = [];
|
|
@@ -1399,12 +1400,20 @@ function registerHealthTools(server) {
|
|
|
1399
1400
|
if (orientEntries?.strategicContext) {
|
|
1400
1401
|
const sc = orientEntries.strategicContext;
|
|
1401
1402
|
if (sc.vision) lines.push(`Vision: ${sc.vision}`);
|
|
1403
|
+
if (sc.productAreaCount != null && sc.productAreaCount > 0) {
|
|
1404
|
+
lines.push(`Product areas (${sc.productAreaCount}): ${(sc.productAreas ?? []).join(", ")}`);
|
|
1405
|
+
}
|
|
1402
1406
|
lines.push(`${sc.activeBetCount} active bet(s), ${sc.activeTensionCount} tension(s).`);
|
|
1403
1407
|
}
|
|
1408
|
+
if (orientEntries?.taskContext && orientEntries.taskContext.context.length > 0) {
|
|
1409
|
+
lines.push(`Task context: ${orientEntries.taskContext.totalFound} relevant entries (${orientEntries.taskContext.confidence} confidence).`);
|
|
1410
|
+
}
|
|
1404
1411
|
if (orientEntries?.activeBets?.length > 0) {
|
|
1405
|
-
orientEntries.activeBets
|
|
1406
|
-
|
|
1407
|
-
|
|
1412
|
+
for (const e of orientEntries.activeBets) {
|
|
1413
|
+
const tensions = e.linkedTensions;
|
|
1414
|
+
const tensionPart = tensions?.length ? ` \u2014 ${tensions.map((t) => `${t.entryId ?? t.name} (${t.severity ?? "\u2014"})`).join(", ")}` : "";
|
|
1415
|
+
lines.push(`- \`${e.entryId ?? e._id}\` ${e.name}${tensionPart}`);
|
|
1416
|
+
}
|
|
1408
1417
|
}
|
|
1409
1418
|
if (priorSessions.length > 0) {
|
|
1410
1419
|
const last = priorSessions[0];
|
|
@@ -1476,10 +1485,25 @@ function registerHealthTools(server) {
|
|
|
1476
1485
|
const sc = orientEntries.strategicContext;
|
|
1477
1486
|
lines.push("## Strategic Context");
|
|
1478
1487
|
if (sc.vision) lines.push(`**Vision:** ${sc.vision}`);
|
|
1488
|
+
if (sc.productAreaCount != null && sc.productAreaCount > 0) {
|
|
1489
|
+
lines.push(`**Product areas (${sc.productAreaCount}):** ${(sc.productAreas ?? []).join(", ")}`);
|
|
1490
|
+
}
|
|
1479
1491
|
const betLine = sc.currentBet ? `**Current bet:** ${sc.currentBet}. ${sc.activeBetCount} active bet(s).` : "No active bets.";
|
|
1480
1492
|
lines.push(`${betLine} ${sc.activeTensionCount} open tension(s).`);
|
|
1481
1493
|
lines.push("");
|
|
1482
1494
|
}
|
|
1495
|
+
if (orientEntries?.taskContext && orientEntries.taskContext.context.length > 0) {
|
|
1496
|
+
const tc = orientEntries.taskContext;
|
|
1497
|
+
lines.push("## Task Context");
|
|
1498
|
+
lines.push(`_Task-scoped entries (${tc.confidence} confidence, ${tc.totalFound} relevant)`);
|
|
1499
|
+
lines.push("");
|
|
1500
|
+
for (const e of tc.context) {
|
|
1501
|
+
const id = e.entryId ?? e.name;
|
|
1502
|
+
const coll = e.collectionSlug ? ` [${e.collectionSlug}]` : "";
|
|
1503
|
+
lines.push(`- \`${id}\` (score ${e.score})${coll}${e.name !== id ? ` \u2014 ${e.name}` : ""}`);
|
|
1504
|
+
}
|
|
1505
|
+
lines.push("");
|
|
1506
|
+
}
|
|
1483
1507
|
if (orientEntries) {
|
|
1484
1508
|
const fmt = (e) => {
|
|
1485
1509
|
const type = e.canonicalKey ?? "generic";
|
|
@@ -1488,7 +1512,19 @@ function registerHealthTools(server) {
|
|
|
1488
1512
|
};
|
|
1489
1513
|
if (orientEntries.activeBets?.length > 0) {
|
|
1490
1514
|
lines.push("## Active bets");
|
|
1491
|
-
|
|
1515
|
+
for (const e of orientEntries.activeBets) {
|
|
1516
|
+
lines.push(fmt(e));
|
|
1517
|
+
const tensions = e.linkedTensions;
|
|
1518
|
+
if (tensions?.length) {
|
|
1519
|
+
const tensionLines = tensions.map((t) => {
|
|
1520
|
+
const meta = [t.severity, t.priority].filter(Boolean).join(", ");
|
|
1521
|
+
return `\`${t.entryId ?? t.name}\` (${t.name}${meta ? `, ${meta}` : ""})`;
|
|
1522
|
+
});
|
|
1523
|
+
lines.push(` Tensions: ${tensionLines.join("; ")}`);
|
|
1524
|
+
} else {
|
|
1525
|
+
lines.push(` Tensions: No linked tensions`);
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1492
1528
|
lines.push("");
|
|
1493
1529
|
}
|
|
1494
1530
|
if (orientEntries.activeGoals.length > 0) {
|
|
@@ -4656,4 +4692,4 @@ export {
|
|
|
4656
4692
|
SERVER_VERSION,
|
|
4657
4693
|
createProductBrainServer
|
|
4658
4694
|
};
|
|
4659
|
-
//# sourceMappingURL=chunk-
|
|
4695
|
+
//# sourceMappingURL=chunk-E75NDP6K.js.map
|