@productbrain/mcp 0.0.1-beta.23 → 0.0.1-beta.24
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 = [];
|
|
@@ -1401,10 +1402,15 @@ function registerHealthTools(server) {
|
|
|
1401
1402
|
if (sc.vision) lines.push(`Vision: ${sc.vision}`);
|
|
1402
1403
|
lines.push(`${sc.activeBetCount} active bet(s), ${sc.activeTensionCount} tension(s).`);
|
|
1403
1404
|
}
|
|
1405
|
+
if (orientEntries?.taskContext && orientEntries.taskContext.context.length > 0) {
|
|
1406
|
+
lines.push(`Task context: ${orientEntries.taskContext.totalFound} relevant entries (${orientEntries.taskContext.confidence} confidence).`);
|
|
1407
|
+
}
|
|
1404
1408
|
if (orientEntries?.activeBets?.length > 0) {
|
|
1405
|
-
orientEntries.activeBets
|
|
1406
|
-
|
|
1407
|
-
|
|
1409
|
+
for (const e of orientEntries.activeBets) {
|
|
1410
|
+
const tensions = e.linkedTensions;
|
|
1411
|
+
const tensionPart = tensions?.length ? ` \u2014 ${tensions.map((t) => `${t.entryId ?? t.name} (${t.severity ?? "\u2014"})`).join(", ")}` : "";
|
|
1412
|
+
lines.push(`- \`${e.entryId ?? e._id}\` ${e.name}${tensionPart}`);
|
|
1413
|
+
}
|
|
1408
1414
|
}
|
|
1409
1415
|
if (priorSessions.length > 0) {
|
|
1410
1416
|
const last = priorSessions[0];
|
|
@@ -1480,6 +1486,18 @@ function registerHealthTools(server) {
|
|
|
1480
1486
|
lines.push(`${betLine} ${sc.activeTensionCount} open tension(s).`);
|
|
1481
1487
|
lines.push("");
|
|
1482
1488
|
}
|
|
1489
|
+
if (orientEntries?.taskContext && orientEntries.taskContext.context.length > 0) {
|
|
1490
|
+
const tc = orientEntries.taskContext;
|
|
1491
|
+
lines.push("## Task Context");
|
|
1492
|
+
lines.push(`_Task-scoped entries (${tc.confidence} confidence, ${tc.totalFound} relevant)`);
|
|
1493
|
+
lines.push("");
|
|
1494
|
+
for (const e of tc.context) {
|
|
1495
|
+
const id = e.entryId ?? e.name;
|
|
1496
|
+
const coll = e.collectionSlug ? ` [${e.collectionSlug}]` : "";
|
|
1497
|
+
lines.push(`- \`${id}\` (score ${e.score})${coll}${e.name !== id ? ` \u2014 ${e.name}` : ""}`);
|
|
1498
|
+
}
|
|
1499
|
+
lines.push("");
|
|
1500
|
+
}
|
|
1483
1501
|
if (orientEntries) {
|
|
1484
1502
|
const fmt = (e) => {
|
|
1485
1503
|
const type = e.canonicalKey ?? "generic";
|
|
@@ -1488,7 +1506,19 @@ function registerHealthTools(server) {
|
|
|
1488
1506
|
};
|
|
1489
1507
|
if (orientEntries.activeBets?.length > 0) {
|
|
1490
1508
|
lines.push("## Active bets");
|
|
1491
|
-
|
|
1509
|
+
for (const e of orientEntries.activeBets) {
|
|
1510
|
+
lines.push(fmt(e));
|
|
1511
|
+
const tensions = e.linkedTensions;
|
|
1512
|
+
if (tensions?.length) {
|
|
1513
|
+
const tensionLines = tensions.map((t) => {
|
|
1514
|
+
const meta = [t.severity, t.priority].filter(Boolean).join(", ");
|
|
1515
|
+
return `\`${t.entryId ?? t.name}\` (${t.name}${meta ? `, ${meta}` : ""})`;
|
|
1516
|
+
});
|
|
1517
|
+
lines.push(` Tensions: ${tensionLines.join("; ")}`);
|
|
1518
|
+
} else {
|
|
1519
|
+
lines.push(` Tensions: No linked tensions`);
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1492
1522
|
lines.push("");
|
|
1493
1523
|
}
|
|
1494
1524
|
if (orientEntries.activeGoals.length > 0) {
|
|
@@ -4656,4 +4686,4 @@ export {
|
|
|
4656
4686
|
SERVER_VERSION,
|
|
4657
4687
|
createProductBrainServer
|
|
4658
4688
|
};
|
|
4659
|
-
//# sourceMappingURL=chunk-
|
|
4689
|
+
//# sourceMappingURL=chunk-K6B4YA75.js.map
|