@productbrain/mcp 0.0.1-beta.208 → 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.
|
@@ -13091,6 +13091,28 @@ function formatScanReport(result) {
|
|
|
13091
13091
|
|
|
13092
13092
|
// src/tools/orient.ts
|
|
13093
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
|
|
13094
13116
|
var PURPOSE_GAP_PREFIX = "purpose-gap-";
|
|
13095
13117
|
function reportOrientWrapperBytes(toolResult, truncated) {
|
|
13096
13118
|
try {
|
|
@@ -13224,6 +13246,17 @@ function registerOrientTool(server) {
|
|
|
13224
13246
|
orientView = await kernelQuery("chain.getOrientView", orientArgs);
|
|
13225
13247
|
} catch {
|
|
13226
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
|
+
}
|
|
13227
13260
|
if (orientView) {
|
|
13228
13261
|
priorSessions = orientView.priorSessions ?? [];
|
|
13229
13262
|
recoveryBlock = orientView.recoveryBlock ?? null;
|
|
@@ -13313,7 +13346,8 @@ function registerOrientTool(server) {
|
|
|
13313
13346
|
if (sc.playingFieldCount != null && sc.playingFieldCount > 0) {
|
|
13314
13347
|
lines.push(`Playing field (${sc.playingFieldCount}): ${(sc.playingField ?? []).join(", ")}`);
|
|
13315
13348
|
}
|
|
13316
|
-
|
|
13349
|
+
const wpPlural = getCollectionLabel("work_package", "plural", vocabCtx);
|
|
13350
|
+
lines.push(`${sc.activeBetCount} active ${wpPlural}, ${sc.activeTensionCount} tension(s).`);
|
|
13317
13351
|
}
|
|
13318
13352
|
if (orientView?.taskContext && orientView.taskContext.context.length > 0) {
|
|
13319
13353
|
lines.push(`Task context: ${orientView.taskContext.totalFound} relevant entries (${orientView.taskContext.confidence} confidence).`);
|
|
@@ -13337,8 +13371,8 @@ function registerOrientTool(server) {
|
|
|
13337
13371
|
lines.push(` ${h.collectionSlug}: ${h.hint}`);
|
|
13338
13372
|
}
|
|
13339
13373
|
}
|
|
13340
|
-
if (orientView?.
|
|
13341
|
-
for (const e of orientView.
|
|
13374
|
+
if (orientView?.activeWorkPackages?.length > 0) {
|
|
13375
|
+
for (const e of orientView.activeWorkPackages) {
|
|
13342
13376
|
const tensions = e.linkedTensions;
|
|
13343
13377
|
const tensionPart = tensions?.length ? ` \u2014 ${tensions.map((t) => `${t.entryId ?? t.name} (${t.severity ?? "\u2014"})`).join(", ")}` : "";
|
|
13344
13378
|
const originPart = e.origin ? ` (origin: ${e.origin})` : "";
|
|
@@ -13525,7 +13559,10 @@ function registerOrientTool(server) {
|
|
|
13525
13559
|
if (sc.playingFieldCount != null && sc.playingFieldCount > 0) {
|
|
13526
13560
|
lines.push(`**Playing field (${sc.playingFieldCount}):** ${(sc.playingField ?? []).join(", ")}`);
|
|
13527
13561
|
}
|
|
13528
|
-
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}.`;
|
|
13529
13566
|
lines.push(`${betLine} ${sc.activeTensionCount} open tension(s).`);
|
|
13530
13567
|
lines.push("");
|
|
13531
13568
|
}
|
|
@@ -13617,7 +13654,7 @@ function registerOrientTool(server) {
|
|
|
13617
13654
|
if (orientView) {
|
|
13618
13655
|
const result = await runAlignmentCheck(
|
|
13619
13656
|
task,
|
|
13620
|
-
orientView.
|
|
13657
|
+
orientView.activeWorkPackages ?? [],
|
|
13621
13658
|
orientView.taskContext?.context
|
|
13622
13659
|
);
|
|
13623
13660
|
lines.push(...buildAlignmentCheckLines(result));
|
|
@@ -13649,11 +13686,11 @@ function registerOrientTool(server) {
|
|
|
13649
13686
|
}
|
|
13650
13687
|
}
|
|
13651
13688
|
if (orientView) {
|
|
13652
|
-
if (orientView.
|
|
13653
|
-
lines.push("## Active
|
|
13654
|
-
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._");
|
|
13655
13692
|
lines.push("");
|
|
13656
|
-
for (const e of orientView.
|
|
13693
|
+
for (const e of orientView.activeWorkPackages) {
|
|
13657
13694
|
lines.push(fmt(e));
|
|
13658
13695
|
const tensions = e.linkedTensions;
|
|
13659
13696
|
if (tensions?.length) {
|
|
@@ -13733,11 +13770,11 @@ function registerOrientTool(server) {
|
|
|
13733
13770
|
} else {
|
|
13734
13771
|
lines.push(`**Brain stage: ${orientStage}.**`);
|
|
13735
13772
|
lines.push("");
|
|
13736
|
-
if (orientView?.
|
|
13737
|
-
lines.push("## Active
|
|
13738
|
-
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._");
|
|
13739
13776
|
lines.push("");
|
|
13740
|
-
for (const e of orientView.
|
|
13777
|
+
for (const e of orientView.activeWorkPackages) {
|
|
13741
13778
|
lines.push(fmt(e));
|
|
13742
13779
|
}
|
|
13743
13780
|
lines.push("");
|
|
@@ -15676,4 +15713,4 @@ export {
|
|
|
15676
15713
|
createProductBrainServer,
|
|
15677
15714
|
initFeatureFlags
|
|
15678
15715
|
};
|
|
15679
|
-
//# sourceMappingURL=chunk-
|
|
15716
|
+
//# sourceMappingURL=chunk-WEAATJDX.js.map
|