@productbrain/mcp 0.0.1-beta.207 → 0.0.1-beta.209
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.
|
@@ -10706,7 +10706,7 @@ function checkDocCompleteness(collections, checkedAt) {
|
|
|
10706
10706
|
};
|
|
10707
10707
|
}
|
|
10708
10708
|
function renderDocCompletenessLines(report) {
|
|
10709
|
-
const lines = ["##
|
|
10709
|
+
const lines = ["## Collection Documentation Gaps"];
|
|
10710
10710
|
if (report.summary.total === 0) {
|
|
10711
10711
|
lines.push(`All ${report.totalChecked} collection docs have required fields populated.`);
|
|
10712
10712
|
lines.push("");
|
|
@@ -10718,21 +10718,23 @@ function renderDocCompletenessLines(report) {
|
|
|
10718
10718
|
lines.push(`**${report.summary.total} gap${report.summary.total === 1 ? "" : "s"}** across ${report.totalChecked} collections (${parts.join(", ")})`);
|
|
10719
10719
|
const errors = report.violations.filter((v) => v.severity === "error");
|
|
10720
10720
|
const warnings = report.violations.filter((v) => v.severity === "warning");
|
|
10721
|
+
const ERROR_INLINE = 10;
|
|
10722
|
+
const WARNING_INLINE = 10;
|
|
10721
10723
|
if (errors.length > 0) {
|
|
10722
10724
|
lines.push("");
|
|
10723
10725
|
lines.push("**Errors** (must fix):");
|
|
10724
|
-
for (const v of errors.slice(0,
|
|
10726
|
+
for (const v of errors.slice(0, ERROR_INLINE)) {
|
|
10725
10727
|
lines.push(`- ${v.message} \u2014 ${v.fix}`);
|
|
10726
10728
|
}
|
|
10727
|
-
if (errors.length >
|
|
10729
|
+
if (errors.length > ERROR_INLINE) lines.push(`- ...and ${errors.length - ERROR_INLINE} more`);
|
|
10728
10730
|
}
|
|
10729
10731
|
if (warnings.length > 0) {
|
|
10730
10732
|
lines.push("");
|
|
10731
10733
|
lines.push("**Warnings**:");
|
|
10732
|
-
for (const v of warnings.slice(0,
|
|
10734
|
+
for (const v of warnings.slice(0, WARNING_INLINE)) {
|
|
10733
10735
|
lines.push(`- ${v.message}`);
|
|
10734
10736
|
}
|
|
10735
|
-
if (warnings.length >
|
|
10737
|
+
if (warnings.length > WARNING_INLINE) lines.push(`- ...and ${warnings.length - WARNING_INLINE} more`);
|
|
10736
10738
|
}
|
|
10737
10739
|
lines.push("");
|
|
10738
10740
|
return lines;
|
|
@@ -13089,6 +13091,28 @@ function formatScanReport(result) {
|
|
|
13089
13091
|
|
|
13090
13092
|
// src/tools/orient.ts
|
|
13091
13093
|
import { z as z22 } from "zod";
|
|
13094
|
+
|
|
13095
|
+
// src/lib/canonicalRefs.ts
|
|
13096
|
+
function getCollectionLabel(canonicalKey, form, workspaceCtx, collectionCtx) {
|
|
13097
|
+
const wsLabels = workspaceCtx?.collectionLabels?.[canonicalKey];
|
|
13098
|
+
if (wsLabels) {
|
|
13099
|
+
const wsVal = wsLabels[form];
|
|
13100
|
+
if (wsVal !== void 0 && wsVal.length > 0) return wsVal;
|
|
13101
|
+
}
|
|
13102
|
+
const colLabels = collectionCtx?.labels;
|
|
13103
|
+
if (colLabels) {
|
|
13104
|
+
const colVal = colLabels[form];
|
|
13105
|
+
if (colVal !== void 0 && colVal.length > 0) return colVal;
|
|
13106
|
+
}
|
|
13107
|
+
const defaultLabels = workspaceCtx?.collectionDefaults?.[canonicalKey];
|
|
13108
|
+
if (defaultLabels) {
|
|
13109
|
+
const defVal = defaultLabels[form];
|
|
13110
|
+
if (defVal !== void 0 && defVal.length > 0) return defVal;
|
|
13111
|
+
}
|
|
13112
|
+
return canonicalKey;
|
|
13113
|
+
}
|
|
13114
|
+
|
|
13115
|
+
// src/tools/orient.ts
|
|
13092
13116
|
var PURPOSE_GAP_PREFIX = "purpose-gap-";
|
|
13093
13117
|
function reportOrientWrapperBytes(toolResult, truncated) {
|
|
13094
13118
|
try {
|
|
@@ -13222,6 +13246,17 @@ function registerOrientTool(server) {
|
|
|
13222
13246
|
orientView = await kernelQuery("chain.getOrientView", orientArgs);
|
|
13223
13247
|
} catch {
|
|
13224
13248
|
}
|
|
13249
|
+
let vocabCtx;
|
|
13250
|
+
try {
|
|
13251
|
+
const vocab = await kernelQuery("chain.getVocabulary", {});
|
|
13252
|
+
if (vocab?.collectionLabels || vocab?.collectionDefaults) {
|
|
13253
|
+
vocabCtx = {
|
|
13254
|
+
...vocab.collectionLabels ? { collectionLabels: vocab.collectionLabels } : {},
|
|
13255
|
+
...vocab.collectionDefaults ? { collectionDefaults: vocab.collectionDefaults } : {}
|
|
13256
|
+
};
|
|
13257
|
+
}
|
|
13258
|
+
} catch {
|
|
13259
|
+
}
|
|
13225
13260
|
if (orientView) {
|
|
13226
13261
|
priorSessions = orientView.priorSessions ?? [];
|
|
13227
13262
|
recoveryBlock = orientView.recoveryBlock ?? null;
|
|
@@ -13311,7 +13346,8 @@ function registerOrientTool(server) {
|
|
|
13311
13346
|
if (sc.playingFieldCount != null && sc.playingFieldCount > 0) {
|
|
13312
13347
|
lines.push(`Playing field (${sc.playingFieldCount}): ${(sc.playingField ?? []).join(", ")}`);
|
|
13313
13348
|
}
|
|
13314
|
-
|
|
13349
|
+
const wpPlural = getCollectionLabel("work_package", "plural", vocabCtx);
|
|
13350
|
+
lines.push(`${sc.activeBetCount} active ${wpPlural}, ${sc.activeTensionCount} tension(s).`);
|
|
13315
13351
|
}
|
|
13316
13352
|
if (orientView?.taskContext && orientView.taskContext.context.length > 0) {
|
|
13317
13353
|
lines.push(`Task context: ${orientView.taskContext.totalFound} relevant entries (${orientView.taskContext.confidence} confidence).`);
|
|
@@ -13335,8 +13371,8 @@ function registerOrientTool(server) {
|
|
|
13335
13371
|
lines.push(` ${h.collectionSlug}: ${h.hint}`);
|
|
13336
13372
|
}
|
|
13337
13373
|
}
|
|
13338
|
-
if (orientView?.
|
|
13339
|
-
for (const e of orientView.
|
|
13374
|
+
if (orientView?.activeWorkPackages?.length > 0) {
|
|
13375
|
+
for (const e of orientView.activeWorkPackages) {
|
|
13340
13376
|
const tensions = e.linkedTensions;
|
|
13341
13377
|
const tensionPart = tensions?.length ? ` \u2014 ${tensions.map((t) => `${t.entryId ?? t.name} (${t.severity ?? "\u2014"})`).join(", ")}` : "";
|
|
13342
13378
|
const originPart = e.origin ? ` (origin: ${e.origin})` : "";
|
|
@@ -13523,7 +13559,10 @@ function registerOrientTool(server) {
|
|
|
13523
13559
|
if (sc.playingFieldCount != null && sc.playingFieldCount > 0) {
|
|
13524
13560
|
lines.push(`**Playing field (${sc.playingFieldCount}):** ${(sc.playingField ?? []).join(", ")}`);
|
|
13525
13561
|
}
|
|
13526
|
-
const
|
|
13562
|
+
const currentWP = sc.currentWorkPackage;
|
|
13563
|
+
const wpSingularFull = getCollectionLabel("work_package", "singular", vocabCtx);
|
|
13564
|
+
const wpPluralFull = getCollectionLabel("work_package", "plural", vocabCtx);
|
|
13565
|
+
const betLine = currentWP ? `**Current ${wpSingularFull}:** ${currentWP}. ${sc.activeBetCount} active ${wpPluralFull}.` : `No active ${wpPluralFull}.`;
|
|
13527
13566
|
lines.push(`${betLine} ${sc.activeTensionCount} open tension(s).`);
|
|
13528
13567
|
lines.push("");
|
|
13529
13568
|
}
|
|
@@ -13615,7 +13654,7 @@ function registerOrientTool(server) {
|
|
|
13615
13654
|
if (orientView) {
|
|
13616
13655
|
const result = await runAlignmentCheck(
|
|
13617
13656
|
task,
|
|
13618
|
-
orientView.
|
|
13657
|
+
orientView.activeWorkPackages ?? [],
|
|
13619
13658
|
orientView.taskContext?.context
|
|
13620
13659
|
);
|
|
13621
13660
|
lines.push(...buildAlignmentCheckLines(result));
|
|
@@ -13647,11 +13686,11 @@ function registerOrientTool(server) {
|
|
|
13647
13686
|
}
|
|
13648
13687
|
}
|
|
13649
13688
|
if (orientView) {
|
|
13650
|
-
if (orientView.
|
|
13651
|
-
lines.push("## Active
|
|
13652
|
-
lines.push("_Work outside these
|
|
13689
|
+
if (orientView.activeWorkPackages?.length > 0) {
|
|
13690
|
+
lines.push("## Active work packages \u2014 current scope");
|
|
13691
|
+
lines.push("_Work outside these work packages requires explicit user confirmation._");
|
|
13653
13692
|
lines.push("");
|
|
13654
|
-
for (const e of orientView.
|
|
13693
|
+
for (const e of orientView.activeWorkPackages) {
|
|
13655
13694
|
lines.push(fmt(e));
|
|
13656
13695
|
const tensions = e.linkedTensions;
|
|
13657
13696
|
if (tensions?.length) {
|
|
@@ -13731,11 +13770,11 @@ function registerOrientTool(server) {
|
|
|
13731
13770
|
} else {
|
|
13732
13771
|
lines.push(`**Brain stage: ${orientStage}.**`);
|
|
13733
13772
|
lines.push("");
|
|
13734
|
-
if (orientView?.
|
|
13735
|
-
lines.push("## Active
|
|
13736
|
-
lines.push("_Work outside these
|
|
13773
|
+
if (orientView?.activeWorkPackages?.length) {
|
|
13774
|
+
lines.push("## Active work packages \u2014 current scope");
|
|
13775
|
+
lines.push("_Work outside these work packages requires explicit user confirmation._");
|
|
13737
13776
|
lines.push("");
|
|
13738
|
-
for (const e of orientView.
|
|
13777
|
+
for (const e of orientView.activeWorkPackages) {
|
|
13739
13778
|
lines.push(fmt(e));
|
|
13740
13779
|
}
|
|
13741
13780
|
lines.push("");
|
|
@@ -15674,4 +15713,4 @@ export {
|
|
|
15674
15713
|
createProductBrainServer,
|
|
15675
15714
|
initFeatureFlags
|
|
15676
15715
|
};
|
|
15677
|
-
//# sourceMappingURL=chunk-
|
|
15716
|
+
//# sourceMappingURL=chunk-WEAATJDX.js.map
|