@productbrain/mcp 0.0.1-beta.178 → 0.0.1-beta.179

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.
@@ -4953,6 +4953,37 @@ async function handleCreate(from, to, type, score, preview) {
4953
4953
  sessionId: agentSessionId ?? void 0,
4954
4954
  ...preview ? { preview: true } : {}
4955
4955
  });
4956
+ if (result?.chainDebtPrevented) {
4957
+ const alts = result.suggestedAlternatives ?? [];
4958
+ const altList = alts.map((a) => ` \u2022 \`${a.type}\`: ${a.reason}`).join("\n");
4959
+ return {
4960
+ content: [{
4961
+ type: "text",
4962
+ text: `# Chain Debt Prevented
4963
+
4964
+ **"${result.originalType ?? type}"** was intercepted as a common misuse for this entry pair and converted to an agent sign-off proposal.
4965
+
4966
+ **Proposal ID:** \`${result.proposalId}\`
4967
+
4968
+ **Suggested alternatives:**
4969
+ ${altList}
4970
+
4971
+ Review at /review in Cortex UI.`
4972
+ }],
4973
+ structuredContent: success(
4974
+ `Chain debt prevented: "${result.originalType ?? type}" was intercepted and converted to an agent sign-off proposal.`,
4975
+ {
4976
+ chainDebtPrevented: true,
4977
+ proposalId: result.proposalId,
4978
+ originalType: result.originalType ?? type,
4979
+ suggestedAlternatives: result.suggestedAlternatives
4980
+ },
4981
+ [
4982
+ { tool: "relations", description: "Use correct type (e.g. informed_by)", parameters: { action: "create", from, to, type: alts[0]?.type ?? "informed_by" } }
4983
+ ]
4984
+ )
4985
+ };
4986
+ }
4956
4987
  if (result?.preview) {
4957
4988
  const suggested2 = result.suggestedType;
4958
4989
  const suggestedWithPosture2 = suggested2 ? { ...suggested2, governancePosture: suggested2.type === "governs" ? "requires_consent" : "direct" } : void 0;
@@ -9769,7 +9800,7 @@ var facilitateSchema = z14.object({
9769
9800
  betEntryId: z14.string().optional().describe("Bet entry ID. Required for both actions."),
9770
9801
  operationId: z14.string().optional().describe("Optional idempotency key for commit-constellation retries.")
9771
9802
  });
9772
- function buildStudioUrl(workspaceSlug, entryId) {
9803
+ function buildCortexUrl(workspaceSlug, entryId) {
9773
9804
  const appUrl = process.env.PRODUCTBRAIN_APP_URL ?? "https://work.productbrain.io";
9774
9805
  return `${appUrl}/${workspaceSlug}/legacy/entries/${entryId}`;
9775
9806
  }
@@ -9820,7 +9851,7 @@ async function handleResume(args) {
9820
9851
  });
9821
9852
  const enrichedData = {
9822
9853
  ...envelope.data,
9823
- studioUrl: buildStudioUrl(workspaceSlug, betId)
9854
+ cortexUrl: buildCortexUrl(workspaceSlug, betId)
9824
9855
  };
9825
9856
  const bet = enrichedData.betEntry;
9826
9857
  const cx = enrichedData.constellation;
@@ -9836,7 +9867,7 @@ async function handleResume(args) {
9836
9867
  `# ${bet.name}`,
9837
9868
  "",
9838
9869
  `**ID:** \`${bet.betEntryId}\` \xB7 **Status:** ${bet.status}`,
9839
- enrichedData.studioUrl ? `**Cortex:** ${enrichedData.studioUrl}` : "",
9870
+ enrichedData.cortexUrl ? `**Cortex:** ${enrichedData.cortexUrl}` : "",
9840
9871
  "",
9841
9872
  `**Constellation:** ${constellationSummary}`,
9842
9873
  ...draftLines.length > 0 ? ["", "**Session drafts:**", ...draftLines] : []
@@ -15649,4 +15680,4 @@ export {
15649
15680
  createProductBrainServer,
15650
15681
  initFeatureFlags
15651
15682
  };
15652
- //# sourceMappingURL=chunk-264NGZNU.js.map
15683
+ //# sourceMappingURL=chunk-IOEZLNTK.js.map