@productbrain/mcp 0.0.1-beta.4732 → 0.0.1-beta.4744
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.
|
@@ -5716,6 +5716,34 @@ async function handleCreate(from, to, type, score, preview) {
|
|
|
5716
5716
|
if (result2?.chainDebtPrevented) {
|
|
5717
5717
|
const alts = result2.suggestedAlternatives ?? [];
|
|
5718
5718
|
const altList = alts.map((a) => ` \u2022 \`${a.type}\`: ${a.reason}`).join("\n");
|
|
5719
|
+
if (result2.preview) {
|
|
5720
|
+
return {
|
|
5721
|
+
content: [{
|
|
5722
|
+
type: "text",
|
|
5723
|
+
text: `# Preview: Chain Debt Would Be Prevented
|
|
5724
|
+
|
|
5725
|
+
**"${result2.originalType ?? type}"** is a common misuse for this entry pair \u2014 a real (non-preview) call would create an agent sign-off proposal instead of writing this relation.
|
|
5726
|
+
|
|
5727
|
+
**Suggested alternatives:**
|
|
5728
|
+
${altList}
|
|
5729
|
+
|
|
5730
|
+
No DB writes \u2014 call without \`preview:true\` to create the proposal for real.`
|
|
5731
|
+
}],
|
|
5732
|
+
structuredContent: success(
|
|
5733
|
+
`Preview: "${result2.originalType ?? type}" would divert into an agent sign-off proposal instead of writing this relation.`,
|
|
5734
|
+
{
|
|
5735
|
+
status: "preview",
|
|
5736
|
+
from,
|
|
5737
|
+
to,
|
|
5738
|
+
type,
|
|
5739
|
+
chainDebtPrevented: true,
|
|
5740
|
+
originalType: result2.originalType ?? type,
|
|
5741
|
+
suggestedAlternatives: result2.suggestedAlternatives
|
|
5742
|
+
},
|
|
5743
|
+
[]
|
|
5744
|
+
)
|
|
5745
|
+
};
|
|
5746
|
+
}
|
|
5719
5747
|
return {
|
|
5720
5748
|
content: [{
|
|
5721
5749
|
type: "text",
|
|
@@ -5757,6 +5785,28 @@ ${result2.blockingReason ?? "This relation would be rejected."}` }],
|
|
|
5757
5785
|
)
|
|
5758
5786
|
};
|
|
5759
5787
|
}
|
|
5788
|
+
if (result2.wouldRequireProposal) {
|
|
5789
|
+
const advisoryText2 = (result2.advisories ?? []).map((a) => `
|
|
5790
|
+
|
|
5791
|
+
\u26A0 **${a.ruleId}** (org stage: ${a.stage}): ${a.ruleText}`).join("");
|
|
5792
|
+
return {
|
|
5793
|
+
content: [{ type: "text", text: `# Preview: would relate ${from} \u2192 ${to} (${type}) \u2014 requires consent
|
|
5794
|
+
|
|
5795
|
+
No DB writes. The real (non-preview) call would create an async-consent proposal instead of directly writing this relation.${advisoryText2}` }],
|
|
5796
|
+
structuredContent: success(
|
|
5797
|
+
`Preview: ${from} \u2192 ${to} (${type}) would require an async-consent proposal \u2014 no DB writes`,
|
|
5798
|
+
{
|
|
5799
|
+
status: "preview",
|
|
5800
|
+
from,
|
|
5801
|
+
to,
|
|
5802
|
+
type,
|
|
5803
|
+
wouldRequireProposal: true,
|
|
5804
|
+
...result2.advisories && result2.advisories.length > 0 && { advisories: result2.advisories }
|
|
5805
|
+
},
|
|
5806
|
+
[{ tool: "relations", description: "Create proposal for real", parameters: { action: "create", from, to, type } }]
|
|
5807
|
+
)
|
|
5808
|
+
};
|
|
5809
|
+
}
|
|
5760
5810
|
const suggested2 = result2.suggestedType;
|
|
5761
5811
|
const suggestedWithPosture2 = suggested2 ? { ...suggested2, governancePosture: suggested2.type === "governs" ? "requires_consent" : "direct" } : void 0;
|
|
5762
5812
|
const advisoryText = (result2.advisories ?? []).map((a) => `
|
|
@@ -16527,4 +16577,4 @@ export {
|
|
|
16527
16577
|
createProductBrainServer,
|
|
16528
16578
|
initFeatureFlags
|
|
16529
16579
|
};
|
|
16530
|
-
//# sourceMappingURL=chunk-
|
|
16580
|
+
//# sourceMappingURL=chunk-FQGCMUVS.js.map
|