@productbrain/mcp 0.0.1-beta.7409 → 0.0.1-beta.7414
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.
|
@@ -6104,11 +6104,12 @@ function formatSteeringBrief(result2) {
|
|
|
6104
6104
|
if (result2.snapshotWarning) {
|
|
6105
6105
|
lines.push("_Note: Compound query spans multiple reads. Data consistency is not guaranteed across components (TEN-1029)._");
|
|
6106
6106
|
}
|
|
6107
|
+
const sanitizedReadiness = { ...typeof readiness?.sampleTruncated === "boolean" ? { sampleTruncated: readiness.sampleTruncated } : {}, checks: readiness?.checks, gaps: readiness?.gaps };
|
|
6107
6108
|
return {
|
|
6108
6109
|
content: [{ type: "text", text: lines.join("\n") }],
|
|
6109
6110
|
structuredContent: success(
|
|
6110
6111
|
`Steering brief: ${changes.entries.length} changes, ${delta.newEntries.length} new entries.${readiness.sampleTruncated ? " (provisional sample; gaps unverified)" : ""}`,
|
|
6111
|
-
{ ...result2, trustFilterActive: true }
|
|
6112
|
+
{ ...result2, readiness: sanitizedReadiness, trustFilterActive: true }
|
|
6112
6113
|
)
|
|
6113
6114
|
};
|
|
6114
6115
|
}
|
|
@@ -8013,7 +8014,6 @@ async function buildOrientResponse(wsCtx, agentSessionId, errors, task) {
|
|
|
8013
8014
|
}
|
|
8014
8015
|
const lines = [];
|
|
8015
8016
|
if (readiness?.sampleTruncated) lines.push(READINESS_PROVISIONAL_LINE, "");
|
|
8016
|
-
const stage = readiness?.stage ?? null;
|
|
8017
8017
|
const captureBehaviorNote = "_Everything I capture stays pending until you confirm._";
|
|
8018
8018
|
const coherence = await buildCoherenceSection();
|
|
8019
8019
|
let allCollections = [];
|
|
@@ -8150,9 +8150,8 @@ async function buildOrientResponse(wsCtx, agentSessionId, errors, task) {
|
|
|
8150
8150
|
lines.push("");
|
|
8151
8151
|
}
|
|
8152
8152
|
const { oriented, orientationStatus } = await tryMarkOriented(agentSessionId, coherence?.snapshot ?? void 0);
|
|
8153
|
-
const stageLabel = `${stage ?? "active"}${readiness?.sampleTruncated ? " (provisional sample)" : ""}`;
|
|
8154
8153
|
const gapCount = readiness?.gaps?.length ?? 0;
|
|
8155
|
-
const summaryParts = [
|
|
8154
|
+
const summaryParts = ["Product Brain ready."];
|
|
8156
8155
|
if (gapCount > 0) summaryParts.push(`${gapCount} ${readiness?.sampleTruncated ? "potential " : ""}gap${gapCount === 1 ? "" : "s"}${readiness?.sampleTruncated ? " in sampled entries; absence unverified" : ""}.`);
|
|
8157
8156
|
if (openTensions.length > 0) summaryParts.push(`${openTensions.length} open tension${openTensions.length === 1 ? "" : "s"}.`);
|
|
8158
8157
|
const next = [];
|
|
@@ -8167,7 +8166,6 @@ async function buildOrientResponse(wsCtx, agentSessionId, errors, task) {
|
|
|
8167
8166
|
structuredContent: success(
|
|
8168
8167
|
summaryParts.join(" "),
|
|
8169
8168
|
{
|
|
8170
|
-
stage,
|
|
8171
8169
|
sampleTruncated: readiness?.sampleTruncated ?? null,
|
|
8172
8170
|
totalGaps: gapCount,
|
|
8173
8171
|
openTensions: openTensions.length,
|
|
@@ -8326,6 +8324,10 @@ function taskGroundingWarningLines(task, hasTaskGrounding = false) {
|
|
|
8326
8324
|
""
|
|
8327
8325
|
];
|
|
8328
8326
|
}
|
|
8327
|
+
function readinessSummaryFact(readiness, sampleTruncated) {
|
|
8328
|
+
const n = readiness?.gaps?.length ?? 0;
|
|
8329
|
+
return !readiness ? "Readiness unavailable." : sampleTruncated ? "Provisional readiness sample." : `${n} gap${n === 1 ? "" : "s"}.`;
|
|
8330
|
+
}
|
|
8329
8331
|
function registerOrientTool(server) {
|
|
8330
8332
|
const orientHandlers = {
|
|
8331
8333
|
start: (data) => handleStartPb({ task: data.task }),
|
|
@@ -8431,7 +8433,7 @@ async function _handleOrient({ mode = "full", tier, task, startupSignals, invoca
|
|
|
8431
8433
|
errors.push(`Readiness: ${e instanceof Error ? e.message : String(e)}`);
|
|
8432
8434
|
}
|
|
8433
8435
|
const sampleTruncated = readiness?.sampleTruncated === true || orientView?.sampleTruncated === true;
|
|
8434
|
-
if (readiness?.
|
|
8436
|
+
if (readiness?.stats?.activeCount === 0 && !sampleTruncated) {
|
|
8435
8437
|
const scanLines = [
|
|
8436
8438
|
`# Welcome to ${wsCtx?.workspaceName ?? "your workspace"}`,
|
|
8437
8439
|
"",
|
|
@@ -8459,7 +8461,7 @@ async function _handleOrient({ mode = "full", tier, task, startupSignals, invoca
|
|
|
8459
8461
|
content: [{ type: "text", text: scanLines.join("\n") }],
|
|
8460
8462
|
structuredContent: success(
|
|
8461
8463
|
"No accepted user-authored entries found. Follow the spine guidance for your task; full onboarding is optional.",
|
|
8462
|
-
{
|
|
8464
|
+
{ oriented, orientationStatus: orientationStatus2, redirectHint: "Optional full onboarding: `orient action=start`. Continue an existing task using the spine guidance." },
|
|
8463
8465
|
task ? [] : [{ tool: "orient", description: "Optional full workspace onboarding", parameters: { action: "start" } }]
|
|
8464
8466
|
)
|
|
8465
8467
|
};
|
|
@@ -8467,7 +8469,6 @@ async function _handleOrient({ mode = "full", tier, task, startupSignals, invoca
|
|
|
8467
8469
|
return blankResult;
|
|
8468
8470
|
}
|
|
8469
8471
|
const lines = sampleTruncated ? [READINESS_PROVISIONAL_LINE, ""] : [];
|
|
8470
|
-
const stageQualifier = sampleTruncated ? " (provisional sample)" : "";
|
|
8471
8472
|
if (wsCtx) {
|
|
8472
8473
|
lines.push(`# ${wsCtx.workspaceName}`);
|
|
8473
8474
|
lines.push(`_Workspace \`${wsCtx.workspaceSlug}\` \u2014 Product Brain is healthy._`);
|
|
@@ -8483,8 +8484,6 @@ async function _handleOrient({ mode = "full", tier, task, startupSignals, invoca
|
|
|
8483
8484
|
lines.push("");
|
|
8484
8485
|
}
|
|
8485
8486
|
if (mode === "brief") {
|
|
8486
|
-
const briefStage = readiness?.stage ?? "unknown";
|
|
8487
|
-
lines.push(`Brain stage: ${briefStage}${stageQualifier}`);
|
|
8488
8487
|
lines.push(...buildDirectionLines(orientView));
|
|
8489
8488
|
if (orientView?.strategicContext) {
|
|
8490
8489
|
const sc = orientView.strategicContext;
|
|
@@ -8627,10 +8626,9 @@ async function _handleOrient({ mode = "full", tier, task, startupSignals, invoca
|
|
|
8627
8626
|
const briefResult = {
|
|
8628
8627
|
content: [{ type: "text", text: lines.join("\n") }],
|
|
8629
8628
|
structuredContent: success(
|
|
8630
|
-
`Oriented (brief).
|
|
8629
|
+
`Oriented (brief). ${readinessSummaryFact(readiness, sampleTruncated)}`,
|
|
8631
8630
|
{
|
|
8632
8631
|
mode: "brief",
|
|
8633
|
-
stage: readiness?.stage ?? "unknown",
|
|
8634
8632
|
sampleTruncated,
|
|
8635
8633
|
oriented: hasTaskGrounding ? isSessionOriented() : false,
|
|
8636
8634
|
sessionId: agentSessionId,
|
|
@@ -8667,7 +8665,6 @@ async function _handleOrient({ mode = "full", tier, task, startupSignals, invoca
|
|
|
8667
8665
|
reportOrientWrapperBytes(briefResult, briefTruncated, resolvedTier, taskMeaningful);
|
|
8668
8666
|
return briefResult;
|
|
8669
8667
|
}
|
|
8670
|
-
const orientStage = readiness?.stage ?? "seeded";
|
|
8671
8668
|
lines.push("_Need a collection that doesn't exist yet? Creating one is not available through this tool. Ask a platform admin to provision it, or enable the module ontology pack that owns it._");
|
|
8672
8669
|
lines.push("");
|
|
8673
8670
|
let fullCoherenceSnapshot;
|
|
@@ -8695,7 +8692,7 @@ async function _handleOrient({ mode = "full", tier, task, startupSignals, invoca
|
|
|
8695
8692
|
fullCoherenceSnapshot = fullCoherence.snapshot ?? void 0;
|
|
8696
8693
|
}
|
|
8697
8694
|
if (task) {
|
|
8698
|
-
lines.push(
|
|
8695
|
+
lines.push(`Working on: **${task}**`);
|
|
8699
8696
|
lines.push("");
|
|
8700
8697
|
lines.push(...buildDirectionLines(orientView));
|
|
8701
8698
|
if (orientView?.strategicContext) {
|
|
@@ -8914,8 +8911,6 @@ async function _handleOrient({ mode = "full", tier, task, startupSignals, invoca
|
|
|
8914
8911
|
lines.push(...formatRecoveryBlock(recoveryBlock));
|
|
8915
8912
|
}
|
|
8916
8913
|
} else {
|
|
8917
|
-
lines.push(`**Brain stage: ${orientStage}${stageQualifier}.**`);
|
|
8918
|
-
lines.push("");
|
|
8919
8914
|
const scNoTaskLines = buildDirectionLines(orientView);
|
|
8920
8915
|
if (scNoTaskLines.length > 0) lines.push(...scNoTaskLines, "");
|
|
8921
8916
|
lines.push(...buildRitualsSurfaceLines(orientView, { fetchFailed: orientFetchFailed || orientView?.fetchFailed === true }));
|
|
@@ -9030,10 +9025,10 @@ async function _handleOrient({ mode = "full", tier, task, startupSignals, invoca
|
|
|
9030
9025
|
const fullResult = {
|
|
9031
9026
|
content: [{ type: "text", text: lines.join("\n") }],
|
|
9032
9027
|
structuredContent: success(
|
|
9033
|
-
|
|
9028
|
+
// TASK-435 (C4c): the readiness stage label is deleted from served text.
|
|
9029
|
+
`Oriented (full). ${readinessSummaryFact(readiness, sampleTruncated)}`,
|
|
9034
9030
|
{
|
|
9035
9031
|
mode: "full",
|
|
9036
|
-
stage: orientStage,
|
|
9037
9032
|
sampleTruncated,
|
|
9038
9033
|
// Rendered "## Gaps" text caps at 5; this carries more, itself capped at READINESS_GAPS_MAX with an explicit truncated/total pair (round 11).
|
|
9039
9034
|
...!sampleTruncated && (readiness?.gaps?.length ?? 0) > 0 ? { readinessGaps: readiness.gaps.slice(0, READINESS_GAPS_MAX), ...readiness.gaps.length > READINESS_GAPS_MAX ? { readinessGapsTruncated: true, readinessGapsTotal: readiness.gaps.length } : {} } : {},
|
|
@@ -12662,27 +12657,12 @@ async function handleWhoami() {
|
|
|
12662
12657
|
)
|
|
12663
12658
|
};
|
|
12664
12659
|
}
|
|
12665
|
-
var STAGE_LABELS = {
|
|
12666
|
-
blank: "Blank",
|
|
12667
|
-
seeded: "Seeded",
|
|
12668
|
-
grounded: "Grounded",
|
|
12669
|
-
connected: "Connected"
|
|
12670
|
-
};
|
|
12671
|
-
var STAGE_DESCRIPTIONS = {
|
|
12672
|
-
blank: "No knowledge captured yet.",
|
|
12673
|
-
seeded: "Early knowledge is in place \u2014 keep building.",
|
|
12674
|
-
grounded: "Solid foundations \u2014 a few gaps remain.",
|
|
12675
|
-
connected: "Well-connected knowledge graph \u2014 your Brain is useful."
|
|
12676
|
-
};
|
|
12677
12660
|
async function handleWorkspaceStatus() {
|
|
12678
12661
|
const result2 = await kernelQuery("chain.workspaceReadiness");
|
|
12679
12662
|
const { checks, gaps, stats } = result2;
|
|
12680
|
-
const stage = result2.stage ?? "seeded";
|
|
12681
|
-
const stageLabel = `${STAGE_LABELS[stage] ?? stage}${result2.sampleTruncated ? " (provisional sample)" : ""}`;
|
|
12682
|
-
const stageDescription = result2.sampleTruncated ? READINESS_PROVISIONAL_LINE : STAGE_DESCRIPTIONS[stage] ?? "";
|
|
12683
12663
|
const lines = [
|
|
12684
|
-
|
|
12685
|
-
`_${
|
|
12664
|
+
"# Brain Status",
|
|
12665
|
+
...result2.sampleTruncated ? [`_${READINESS_PROVISIONAL_LINE}_`] : [],
|
|
12686
12666
|
"",
|
|
12687
12667
|
"## Sampled counts",
|
|
12688
12668
|
`- **Entries:** ${stats.totalEntries} (${stats.activeCount} accepted/active, ${stats.draftCount} draft)`,
|
|
@@ -12715,7 +12695,6 @@ async function handleWorkspaceStatus() {
|
|
|
12715
12695
|
lines.push("");
|
|
12716
12696
|
}
|
|
12717
12697
|
const statusData = {
|
|
12718
|
-
stage,
|
|
12719
12698
|
sampleTruncated: result2.sampleTruncated ?? null,
|
|
12720
12699
|
activeEntries: stats.activeCount,
|
|
12721
12700
|
totalRelations: stats.totalRelations,
|
|
@@ -12732,7 +12711,8 @@ async function handleWorkspaceStatus() {
|
|
|
12732
12711
|
return {
|
|
12733
12712
|
content: [{ type: "text", text: lines.join("\n") }],
|
|
12734
12713
|
structuredContent: success(
|
|
12735
|
-
|
|
12714
|
+
// TASK-435 (C4c): the readiness stage label is deleted from served text.
|
|
12715
|
+
`Brain: ${stats.activeCount} accepted/active entries in the sample, ${gaps.length} ${result2.sampleTruncated ? "potential gap(s); absence unverified" : "gap(s)"}.`,
|
|
12736
12716
|
statusData
|
|
12737
12717
|
)
|
|
12738
12718
|
};
|
|
@@ -12788,7 +12768,7 @@ var organisationHealthSchema = z25.object({
|
|
|
12788
12768
|
flags: z25.array(z25.object({ collection: z25.string(), count: z25.number(), suggestedCollection: z25.string() }))
|
|
12789
12769
|
});
|
|
12790
12770
|
var healthStatusOutputSchema = z25.object({
|
|
12791
|
-
|
|
12771
|
+
// TASK-435 (C4c): `stage` deleted — the readiness stage label is no longer served.
|
|
12792
12772
|
sampleTruncated: z25.boolean().nullable().optional(),
|
|
12793
12773
|
activeEntries: z25.number(),
|
|
12794
12774
|
totalRelations: z25.number(),
|
|
@@ -14811,4 +14791,4 @@ export {
|
|
|
14811
14791
|
createProductBrainServer,
|
|
14812
14792
|
initFeatureFlags
|
|
14813
14793
|
};
|
|
14814
|
-
//# sourceMappingURL=chunk-
|
|
14794
|
+
//# sourceMappingURL=chunk-MJUDIDTR.js.map
|