@productbrain/mcp 0.0.1-beta.12402 → 0.0.1-beta.12408

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.
@@ -961,6 +961,16 @@ function authorityRecovery(refusal) {
961
961
  }
962
962
  return typeof refusal?.requiredAction === "string" ? refusal.requiredAction : void 0;
963
963
  }
964
+ function acceptPromptOf(details) {
965
+ const found = details?.find((d) => typeof d?.acceptRefusal === "object");
966
+ return typeof found?.acceptRefusal?.prompt === "string" ? found.acceptRefusal.prompt : null;
967
+ }
968
+ function withAcceptPrompt(lines, details) {
969
+ const prompt = acceptPromptOf(details);
970
+ return prompt ? `${lines}
971
+
972
+ ${prompt}` : lines;
973
+ }
964
974
  function spineNextLine(details) {
965
975
  const lines = spineNextsOf(details).map((next) => {
966
976
  if (next.action === "accept") return `Next: ${acceptCall(next.entryId, next.replaces)}.`;
@@ -1053,8 +1063,8 @@ function classifyError(err) {
1053
1063
  return {
1054
1064
  code: "VALIDATION_ERROR",
1055
1065
  fn,
1056
- message: next2 ? `${cleanMessage}
1057
- ${next2}` : cleanMessage,
1066
+ message: withAcceptPrompt(next2 ? `${cleanMessage}
1067
+ ${next2}` : cleanMessage, mcpErr.details),
1058
1068
  ...next2 ? { recovery: next2 } : {},
1059
1069
  ...hasDiagnostics ? {
1060
1070
  diagnostics: {
@@ -1104,7 +1114,7 @@ ${next2}` : cleanMessage,
1104
1114
  const next = spineNextLine(mcpErr.details);
1105
1115
  const recovery = next ?? authorityRecovery(mcpErr.details?.[0]);
1106
1116
  const said = recovery && !next ? cleanMessage.replace(/\s*\n\s*/g, " ") : cleanMessage;
1107
- return { code: convexCode, fn, message: recovery ? `${said}${next ? "\n" : " "}${recovery}` : cleanMessage, ...recovery ? { recovery } : {} };
1117
+ return { code: convexCode, fn, message: withAcceptPrompt(recovery ? `${said}${next ? "\n" : " "}${recovery}` : cleanMessage, mcpErr.details), ...recovery ? { recovery } : {} };
1108
1118
  }
1109
1119
  for (const { pattern, code, recovery, action } of GATE_PATTERNS) {
1110
1120
  if (pattern.test(message)) {
@@ -1717,6 +1727,7 @@ export {
1717
1727
  formatInviteSentence,
1718
1728
  ORGANISATION_VALIDATION_REFUSALS,
1719
1729
  authorityRecovery,
1730
+ withAcceptPrompt,
1720
1731
  acceptCall,
1721
1732
  PASS_SESSION_ID,
1722
1733
  WORKSPACE_CLOSED,
@@ -1761,4 +1772,4 @@ export {
1761
1772
  appUrl,
1762
1773
  apiKeysUrl
1763
1774
  };
1764
- //# sourceMappingURL=chunk-3U2ECUFG.js.map
1775
+ //# sourceMappingURL=chunk-PXHPUMH4.js.map