@productbrain/mcp 0.0.1-beta.12402 → 0.0.1-beta.12417
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.
- package/dist/{chunk-3U2ECUFG.js → chunk-PXHPUMH4.js} +15 -4
- package/dist/{chunk-3U2ECUFG.js.map → chunk-PXHPUMH4.js.map} +1 -1
- package/dist/{chunk-V2WCCCRI.js → chunk-QWSKAXJH.js} +5 -4
- package/dist/chunk-QWSKAXJH.js.map +1 -0
- package/dist/cli/index.js +1 -1
- package/dist/http.js +2 -2
- package/dist/index.js +2 -2
- package/dist/{setup-OMHPPHKE.js → setup-6GTZZQWF.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-V2WCCCRI.js.map +0 -1
- /package/dist/{setup-OMHPPHKE.js.map → setup-6GTZZQWF.js.map} +0 -0
|
@@ -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-
|
|
1775
|
+
//# sourceMappingURL=chunk-PXHPUMH4.js.map
|