@productbrain/mcp 0.0.1-beta.186 → 0.0.1-beta.188
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.
|
@@ -5004,6 +5004,37 @@ async function handleCreate(from, to, type, score, preview) {
|
|
|
5004
5004
|
sessionId: agentSessionId ?? void 0,
|
|
5005
5005
|
...preview ? { preview: true } : {}
|
|
5006
5006
|
});
|
|
5007
|
+
if (result?.chainDebtPrevented) {
|
|
5008
|
+
const alts = result.suggestedAlternatives ?? [];
|
|
5009
|
+
const altList = alts.map((a) => ` \u2022 \`${a.type}\`: ${a.reason}`).join("\n");
|
|
5010
|
+
return {
|
|
5011
|
+
content: [{
|
|
5012
|
+
type: "text",
|
|
5013
|
+
text: `# Chain Debt Prevented
|
|
5014
|
+
|
|
5015
|
+
**"${result.originalType ?? type}"** was intercepted as a common misuse for this entry pair and converted to an agent sign-off proposal.
|
|
5016
|
+
|
|
5017
|
+
**Proposal ID:** \`${result.proposalId}\`
|
|
5018
|
+
|
|
5019
|
+
**Suggested alternatives:**
|
|
5020
|
+
${altList}
|
|
5021
|
+
|
|
5022
|
+
Review at /review in Cortex UI.`
|
|
5023
|
+
}],
|
|
5024
|
+
structuredContent: success(
|
|
5025
|
+
`Chain debt prevented: "${result.originalType ?? type}" was intercepted and converted to an agent sign-off proposal.`,
|
|
5026
|
+
{
|
|
5027
|
+
chainDebtPrevented: true,
|
|
5028
|
+
proposalId: result.proposalId,
|
|
5029
|
+
originalType: result.originalType ?? type,
|
|
5030
|
+
suggestedAlternatives: result.suggestedAlternatives
|
|
5031
|
+
},
|
|
5032
|
+
[
|
|
5033
|
+
{ tool: "relations", description: "Use correct type (e.g. informed_by)", parameters: { action: "create", from, to, type: alts[0]?.type ?? "informed_by" } }
|
|
5034
|
+
]
|
|
5035
|
+
)
|
|
5036
|
+
};
|
|
5037
|
+
}
|
|
5007
5038
|
if (result?.preview) {
|
|
5008
5039
|
const suggested2 = result.suggestedType;
|
|
5009
5040
|
const suggestedWithPosture2 = suggested2 ? { ...suggested2, governancePosture: suggested2.type === "governs" ? "requires_consent" : "direct" } : void 0;
|
|
@@ -9820,7 +9851,7 @@ var facilitateSchema = z14.object({
|
|
|
9820
9851
|
betEntryId: z14.string().optional().describe("Bet entry ID. Required for both actions."),
|
|
9821
9852
|
operationId: z14.string().optional().describe("Optional idempotency key for commit-constellation retries.")
|
|
9822
9853
|
});
|
|
9823
|
-
function
|
|
9854
|
+
function buildCortexUrl(workspaceSlug, entryId) {
|
|
9824
9855
|
const appUrl = process.env.PRODUCTBRAIN_APP_URL ?? "https://work.productbrain.io";
|
|
9825
9856
|
return `${appUrl}/${workspaceSlug}/legacy/entries/${entryId}`;
|
|
9826
9857
|
}
|
|
@@ -9871,7 +9902,7 @@ async function handleResume(args) {
|
|
|
9871
9902
|
});
|
|
9872
9903
|
const enrichedData = {
|
|
9873
9904
|
...envelope.data,
|
|
9874
|
-
|
|
9905
|
+
cortexUrl: buildCortexUrl(workspaceSlug, betId)
|
|
9875
9906
|
};
|
|
9876
9907
|
const bet = enrichedData.betEntry;
|
|
9877
9908
|
const cx = enrichedData.constellation;
|
|
@@ -9887,7 +9918,7 @@ async function handleResume(args) {
|
|
|
9887
9918
|
`# ${bet.name}`,
|
|
9888
9919
|
"",
|
|
9889
9920
|
`**ID:** \`${bet.betEntryId}\` \xB7 **Status:** ${bet.status}`,
|
|
9890
|
-
enrichedData.
|
|
9921
|
+
enrichedData.cortexUrl ? `**Cortex:** ${enrichedData.cortexUrl}` : "",
|
|
9891
9922
|
"",
|
|
9892
9923
|
`**Constellation:** ${constellationSummary}`,
|
|
9893
9924
|
...draftLines.length > 0 ? ["", "**Session drafts:**", ...draftLines] : []
|
|
@@ -15702,4 +15733,4 @@ export {
|
|
|
15702
15733
|
createProductBrainServer,
|
|
15703
15734
|
initFeatureFlags
|
|
15704
15735
|
};
|
|
15705
|
-
//# sourceMappingURL=chunk-
|
|
15736
|
+
//# sourceMappingURL=chunk-OOAGD3TL.js.map
|