@productbrain/mcp 0.0.1-beta.13351 → 0.0.1-beta.13360

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.
@@ -890,6 +890,23 @@ var ASK_ROLE_NEXT = {
890
890
  cli: (roleRef) => `Next: pb question create "<your ask>" --to-role ${roleIdOnly(roleRef)}`,
891
891
  mcp: (roleRef) => `Next: \`question action=create text="<your ask>" toRole="${roleIdOnly(roleRef)}"\`.`
892
892
  };
893
+ var NAME_ITS_COLLECTION = "Not captured: this read as a question. Not one? Name its collection";
894
+ var QUESTION_CAPTURE_REFUSED = {
895
+ default: "Not captured: a captured question lands with your Team Lead.",
896
+ classifier: {
897
+ kernel: `${NAME_ITS_COLLECTION}.`,
898
+ cli: `${NAME_ITS_COLLECTION} with --collection <slug>.`,
899
+ mcp: `${NAME_ITS_COLLECTION} with collection="<slug>".`
900
+ }
901
+ };
902
+ var QUESTION_DOOR_ROLE = "ROL-n";
903
+ function questionCaptureRefusal(variant, surface) {
904
+ return {
905
+ line: variant === "classifier" ? QUESTION_CAPTURE_REFUSED.classifier[surface] : QUESTION_CAPTURE_REFUSED.default,
906
+ next: ASK_ROLE_NEXT[surface](QUESTION_DOOR_ROLE)
907
+ };
908
+ }
909
+ var questionDoorOf = (details) => (details ?? []).map((detail) => detail?.questionDoor).find((found) => found === "default" || found === "classifier");
893
910
  function personStatusTag(status) {
894
911
  if (!status || status === "active" || !Object.prototype.hasOwnProperty.call(PERSON_STATUS_WORDS, status)) return null;
895
912
  return PERSON_STATUS_WORDS[status];
@@ -971,6 +988,10 @@ function askNextLine(refusal) {
971
988
  if (typeof seat?.roleEntryId !== "string" || refusal?.wayIn !== void 0 || refusal?.boundKey === true || refusal?.heldByAgent === true) return null;
972
989
  return typeof refusal?.decidingRoleRef === "string" ? ASK_ROLE_NEXT.mcp(refusal.decidingRoleRef) : null;
973
990
  }
991
+ function questionDoorLines(details) {
992
+ const variant = questionDoorOf(details);
993
+ return variant ? questionCaptureRefusal(variant, "mcp") : null;
994
+ }
974
995
  function returnedRefusal(refusal, fallback, clean = (s) => s) {
975
996
  const fix = authorityRecovery(refusal) ?? (typeof refusal.requiredAction === "string" ? refusal.requiredAction : fallback);
976
997
  return { message: `Refused: ${clean(refusal.reason)}`, recovery: [fix, askNextLine(refusal)].filter(Boolean).join("\n") };
@@ -1040,6 +1061,9 @@ function classifyError(err) {
1040
1061
  if (mcpErr) {
1041
1062
  const { code: convexCode, fn, cleanMessage, missingRequiredFields, fieldErrors } = mcpErr;
1042
1063
  if (convexCode === "VALIDATION_FAILED") {
1064
+ const questionDoor = questionDoorLines(mcpErr.details);
1065
+ if (questionDoor) return { code: "VALIDATION_ERROR", fn, message: `${questionDoor.line}
1066
+ ${questionDoor.next}`, recovery: questionDoor.next };
1043
1067
  const hasDiagnostics = missingRequiredFields?.length || fieldErrors?.length;
1044
1068
  const next2 = spineNextLine(mcpErr.details) ?? roleRetireNextLine(mcpErr.details);
1045
1069
  return {
@@ -1757,4 +1781,4 @@ export {
1757
1781
  appUrl,
1758
1782
  apiKeysUrl
1759
1783
  };
1760
- //# sourceMappingURL=chunk-SNTS7PC7.js.map
1784
+ //# sourceMappingURL=chunk-MFILU7JL.js.map