@productbrain/mcp 0.0.1-beta.16239 → 0.0.1-beta.16242
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.
|
@@ -3978,6 +3978,25 @@ function formatOutcomeObjectiveLines(view, clean) {
|
|
|
3978
3978
|
return lines;
|
|
3979
3979
|
}
|
|
3980
3980
|
|
|
3981
|
+
// src/lib/readingDoorWords.ts
|
|
3982
|
+
var NOT_HOLDER_TAIL = " or its lead can record this reading. Ask them to record it.";
|
|
3983
|
+
var READING_DOOR_REFUSALS = {
|
|
3984
|
+
/** A caller who neither holds the reporting role's seat nor reaches it as its lead (DEC-1810, DEC-1815). */
|
|
3985
|
+
notHolder: (roleName) => `Only ${roleName || "that role"}${NOT_HOLDER_TAIL}`,
|
|
3986
|
+
/** The same, when the role is a Team Lead role: its lead is the Team Lead itself. */
|
|
3987
|
+
notTeamLead: "Only the Team Lead can record this reading. Ask them to record it.",
|
|
3988
|
+
futureDate: "That date is in the future. Pick today or an earlier day.",
|
|
3989
|
+
notOpenOutcome: "Readings go on an open key result or KPI. Pick one that is open.",
|
|
3990
|
+
/** No live reporter and no single owner: no seat to judge, so every caller is refused (fail closed). */
|
|
3991
|
+
noReportingRole: "No role reports this entry. Ask its Team Lead to set one."
|
|
3992
|
+
};
|
|
3993
|
+
var READING_AS_OF_AHEAD_MS = 14 * 60 * 60 * 1e3;
|
|
3994
|
+
function isReadingDoorRefusal(message) {
|
|
3995
|
+
const { notTeamLead, futureDate, notOpenOutcome, noReportingRole } = READING_DOOR_REFUSALS;
|
|
3996
|
+
const fixed = [notTeamLead, futureDate, notOpenOutcome, noReportingRole];
|
|
3997
|
+
return fixed.includes(message) || message.startsWith("Only ") && message.endsWith(NOT_HOLDER_TAIL);
|
|
3998
|
+
}
|
|
3999
|
+
|
|
3981
4000
|
// src/tools/outcome.ts
|
|
3982
4001
|
var OUTCOME_ACTIONS = ["record"];
|
|
3983
4002
|
var OUTCOME_READS_MOVED = "outcome only records readings. Read with the read-only context tool: context action=outcome entryId=... (the derived view, its objective and sibling key results) or context action=readings entryId=... (the readings, newest first).";
|
|
@@ -4111,6 +4130,7 @@ function outcomeErrorResult(err, action, entryId, params = {}) {
|
|
|
4111
4130
|
] : isMissingCorrectionTarget ? [{ tool: "context", description: "List readings for this entry to find a valid correctsReadingId", parameters: { action: "readings", entryId } }] : retryIsFutile(classified.code) ? void 0 : [retryAction(action, definedParams)];
|
|
4112
4131
|
const withSource = `${classified.message} Add source.`;
|
|
4113
4132
|
if (action === "record" && sourceMissing(err)) return failureResult(errorText({ message: withSource }), classified.code, withSource, "Add source.");
|
|
4133
|
+
if (action === "record" && isReadingDoorRefusal(classified.message)) return failureResult(errorText({ message: classified.message }), classified.code, classified.message);
|
|
4114
4134
|
const recovery = isMissingCorrectionTarget ? `The reading you name as correctsReadingId does not exist on ${entryId}. Use context action=readings to see its reading ids.` : classified.recovery ?? "Use context action=outcome with a valid entryId to check the key result exists.";
|
|
4115
4135
|
return failureResult(
|
|
4116
4136
|
errorText({ message: classified.message, recovery }),
|
|
@@ -12450,4 +12470,4 @@ export {
|
|
|
12450
12470
|
SERVER_VERSION,
|
|
12451
12471
|
createProductBrainServer
|
|
12452
12472
|
};
|
|
12453
|
-
//# sourceMappingURL=chunk-
|
|
12473
|
+
//# sourceMappingURL=chunk-D7RXCQOZ.js.map
|